From a6fc210e0b4d709a17d764c353297e457a235768 Mon Sep 17 00:00:00 2001
From: wbc <2597324127@qq.com>
Date: 星期一, 28 七月 2025 13:44:23 +0800
Subject: [PATCH] 工序排产
---
WebApi/Gs.Wom/WorkService/WorkTechniqueController.cs | 120 ++++++++++++++++++++++++++++++++++++++++++++++-------------
1 files changed, 93 insertions(+), 27 deletions(-)
diff --git a/WebApi/Gs.Wom/WorkService/WorkTechniqueController.cs b/WebApi/Gs.Wom/WorkService/WorkTechniqueController.cs
index 8c8b8fe..805642a 100644
--- a/WebApi/Gs.Wom/WorkService/WorkTechniqueController.cs
+++ b/WebApi/Gs.Wom/WorkService/WorkTechniqueController.cs
@@ -49,7 +49,8 @@
var dset = new DataSet();
try
{
- dset = DbHelperSQL.RunProcedure("[work_technique_mx]", parameters, "0");
+ //dset = DbHelperSQL.RunProcedure("[work_technique_mx]", parameters, "0");
+ dset = DbHelperSQL.RunProcedure("[mes_prod_gx_mx]", parameters, "0");
if (dset != null && dset.Tables.Count > 0 &&
dset.Tables[0].Rows.Count > 0)
{
@@ -57,7 +58,7 @@
m = dr.RowToDynamic();
var _tb = dset.Tables[1].TableToDynamicList();
m.list = _tb;
- var _tb2 = dset.Tables[1].TableToDynamicList();
+ var _tb2 = dset.Tables[2].TableToDynamicList();
m.list2 = _tb2;
}
}
@@ -80,28 +81,36 @@
public ReturnDto<ExpandoObject> EditModel([FromBody] dynamic model)
{
Guid? guid = model.guid; //浜у搧涓婚敭
- string fType = model.fType;
- string fBegDate = model.fBegDate;
- string fEndDate = model.fEndDate;
- string fJingDu = model.fJingDu;
- string fCapacity = model.fCapacity;
- string fMaxWeight = model.fMaxWeight;
- string fMinWeight = model.fMinWeight;
- string fSumPeople = model.fSumPeople;
- string remark = model.remark;
+ string orgName = model.orgName;
+ string itemNo = model.itemNo;
var _sb = new StringBuilder();
var _split = "|";
foreach (var m in model.list)
{
- var _line = m.fSeq + _split
+ var _line = m.guid + _split
+ m.processNo + _split
- + m.statStatus + _split
- + m.collectionName + _split
- + m.remark + _split
+ + m.gxOrder + _split
+ + m.signingFlag + _split
+ + m.storageFlag + _split
+ m.frontProcessNo;
if (_sb.Length > 0)
_sb.Append("~");
_sb.Append(_line);
+ }
+ var _sb2 = new StringBuilder();
+ var _split2 = "|";
+ foreach (var m in model.list2)
+ {
+ var _line2 = m.guid + _split2
+ + m.workers + _split2
+ + m.hours + _split2
+ + m.capacity + _split2
+ + m.sCapacity + _split2
+ + m.lineType + _split2
+ + m.changeTime;
+ if (_sb2.Length > 0)
+ _sb2.Append("~");
+ _sb2.Append(_line2);
}
dynamic mObj = new ExpandoObject();
mObj.outMsg = "";
@@ -110,7 +119,8 @@
mObj.outNo = "";
using (var conn = new SqlConnection(DbHelperSQL.strConn))
{
- using (var cmd = new SqlCommand("[work_technique_edt]", conn))
+ //using (var cmd = new SqlCommand("[work_technique_edt]", conn))
+ using (var cmd = new SqlCommand("[mes_prod_gx_edt]", conn))
{
try
{
@@ -123,17 +133,11 @@
new("@outGuid", SqlDbType.UniqueIdentifier),
new("@outNo", SqlDbType.NVarChar, 300),
new("@inOrderGuid", CheckGuid(guid) ? guid : DBNull.Value),
- new("@fType", fType),
- new("@fBegDate", fBegDate),
- new("@fEndDate", fEndDate),
- new("@fJingDu", fJingDu),
- new("@fCapacity", fCapacity),
- new("@fMaxWeight", fMaxWeight),
- new("@fMinWeight", fMinWeight),
- new("@fSumPeople", fSumPeople),
- new("@remark", remark),
+ new("@orgName", orgName),
+ new("@itemNo", itemNo),
new("@inEdtUserGuid", _userGuid),
- new("@inLineList", _sb.ToString())
+ new("@inLineList", _sb.ToString()),
+ new("@inLineList2", _sb2.ToString())
};
parameters[0].Direction = ParameterDirection.Output;
parameters[1].Direction = ParameterDirection.Output;
@@ -241,7 +245,8 @@
var _outSum = -1;
using (var conn = new SqlConnection(DbHelperSQL.strConn))
{
- using (var cmd = new SqlCommand("[work_technique_del]", conn))
+ //using (var cmd = new SqlCommand("[work_technique_del]", conn))
+ using (var cmd = new SqlCommand("[mes_prod_gx_del]", conn))
{
try
{
@@ -287,6 +292,67 @@
return ReturnDto<int>.QuickReturn(rtnInt, ReturnCode.Success, _outMsg);
}
+ /// <summary>
+ /// 鍒犻櫎涓昏〃鎴栨槑缁�
+ /// </summary>
+ /// <param name="model"></param>
+ /// <returns></returns>
+ [RequestMethod(RequestMethods.POST)]
+ public ReturnDto<int?> DeleteMode2OrMx([FromBody] dynamic model)
+ {
+ int? rtnInt = (int)ReturnCode.Default;
+ Guid? guid = model.guid;
+ string mxGuid2 = model.mxGuid2;
+ var _outMsg = "";
+ var _outSum = -1;
+ using (var conn = new SqlConnection(DbHelperSQL.strConn))
+ {
+ //using (var cmd = new SqlCommand("[work_technique_del]", conn))
+ using (var cmd = new SqlCommand("[mes_prod_gx_del2]", conn))
+ {
+ try
+ {
+ conn.Open();
+ cmd.CommandType = CommandType.StoredProcedure;
+ SqlParameter[] parameters =
+ {
+ new("@outMsg", SqlDbType.NVarChar, 300),
+ new("@outSum", SqlDbType.Int),
+ new("@inOrderGuid",
+ CheckGuid(guid)
+ ? guid
+ : DBNull.Value),
+ new("@inEdtUserGuid", _userGuid),
+ new("@inMxGuid", mxGuid2)
+ };
+ parameters[0].Direction = ParameterDirection.Output;
+ parameters[1].Direction = ParameterDirection.Output;
+ foreach (var parameter in parameters)
+ cmd.Parameters.Add(parameter);
+
+ cmd.ExecuteNonQuery();
+ _outMsg = parameters[0].Value.ToString();
+ _outSum = int.Parse(parameters[1].Value.ToString());
+ }
+ catch (Exception ex)
+ {
+ LogHelper.Debug(ToString(),
+ "work_technique error锛�" + ex.Message);
+ _outMsg = ex.Message;
+ _outSum = -1;
+ }
+ finally
+ {
+ conn.Close();
+ }
+ }
+ }
+
+ if (_outSum <= 0)
+ return ReturnDto<int>.QuickReturn(rtnInt, ReturnCode.Exception,
+ _outMsg);
+ return ReturnDto<int>.QuickReturn(rtnInt, ReturnCode.Success, _outMsg);
+ }
/// <summary>
/// 澶嶅埗鐗╂枡椤圭洰
--
Gitblit v1.9.3