From cee055eb7cdecf5d995cc65d379494e471bde9c8 Mon Sep 17 00:00:00 2001
From: yangle <admin@YINMOU>
Date: 星期三, 02 四月 2025 10:06:03 +0800
Subject: [PATCH] 合并
---
WebAPI/Controllers/LMESController.cs | 167 ++++++++++++++++++++++++++++++++++++++++++++++++++++---
1 files changed, 158 insertions(+), 9 deletions(-)
diff --git a/WebAPI/Controllers/LMESController.cs b/WebAPI/Controllers/LMESController.cs
index 4931d80..85434fe 100644
--- a/WebAPI/Controllers/LMESController.cs
+++ b/WebAPI/Controllers/LMESController.cs
@@ -192,7 +192,7 @@
SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
- ds = oCN.RunProcReturn("select * from h_v_Sc_ProcessExchangeBillList_Query where 1 = 1 " + sWhere + " order by 鍗曟嵁鍙� desc ", "h_v_Sc_ProcessExchangeBillList_Query");
+ ds = oCN.RunProcReturn("select top 3000 * from h_v_Sc_ProcessExchangeBillList_Query where 1 = 1 " + sWhere + " order by 鍗曟嵁鍙� desc ", "h_v_Sc_ProcessExchangeBillList_Query");
//娣诲姞鍒楀悕
@@ -957,7 +957,7 @@
{
objJsonResult.code = "0";
objJsonResult.count = 0;
- objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�" + e.ToString();
+ objJsonResult.Message = "[0000-1-045]娌℃湁杩斿洖浠讳綍璁板綍锛�" + e.ToString();
objJsonResult.data = null;
return objJsonResult;
}
@@ -1623,6 +1623,7 @@
objJsonResult.data = 1;
return objJsonResult;
}
+ var HBillNo = ds.Tables[0].Rows[0]["HBillNo"].ToString();
//if (hdeleteman != "")
//{
// objJsonResult.code = "0";
@@ -1631,11 +1632,64 @@
// objJsonResult.data = null;
// return objJsonResult;
//}
+
+
+ //鍒犻櫎鍓嶆帶鍒�=========================================
+ string sql1 = "exec h_p_Gy_RoutingBill_BeforeDelCtrl " + lngBillKey + ",'" + HBillNo + "','" + user + "'";
+ ds = oCN.RunProcReturn(sql1, "h_p_Gy_RoutingBill_BeforeDelCtrl");
+ if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鍒犻櫎澶辫触!鍘熷洜:鍒犻櫎鍓嶅垽鏂け璐ワ紝璇蜂笌缃戠粶绠$悊浜哄憳鑱旂郴";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鍒犻櫎澶辫触!鍘熷洜:" + ds.Tables[0].Rows[0]["HRemark"].ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ //==================================================================================
+
+
+
oCN.RunProc("delete from Gy_RoutingBillmain where HInterID=" + lngBillKey);
oCN.RunProc("delete from Gy_RoutingBillSub where HInterID=" + lngBillKey);
- LogService.Write("鐢ㄦ埛:" + user + ",鏃ユ湡:" + DateTime.Now + ",鍒犻櫎宸ヨ壓璺嚎鍗曟嵁:" + ds.Tables[0].Rows[0]["HBillNo"].ToString());
- oCN.RunProc("Insert into System_log (GeginDate, userid, WorkstationName, WorkList, SystemName, NetuserName, State) select GETDATE(),'" + user + "','" + HComputerName + "','" + "鍒犻櫎宸ヨ壓璺嚎鍗曟嵁锛�" + ds.Tables[0].Rows[0]["HBillNo"].ToString() + "','LMES-宸ヨ壓璺嚎妯″潡','" + DBUtility.ClsPub.IPAddress + "','鍒犻櫎鍗曟嵁'", ref DBUtility.ClsPub.sExeReturnInfo);
+ //鍒犻櫎鍚庢帶鍒�==================================================================================
+ string sql2 = "exec h_p_Gy_RoutingBill_AfterDelCtrl " + lngBillKey + ",'" + HBillNo + "','" + user + "'";
+ ds = oCN.RunProcReturn(sql2, "h_p_Gy_RoutingBill_AfterDelCtrl");
+ if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
+ {
+
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鍒犻櫎澶辫触!鍘熷洜:鍒犻櫎鍚庡垽鏂け璐ワ紝璇蜂笌缃戠粶绠$悊浜哄憳鑱旂郴";
+ objJsonResult.data = null;
+ oCN.RollBack();
+ return objJsonResult;
+ }
+ if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鍒犻櫎澶辫触!鍘熷洜:" + ds.Tables[0].Rows[0]["HRemark"].ToString();
+ objJsonResult.data = null;
+ oCN.RollBack();
+ return objJsonResult;
+ }
+ //==============================================================================================
+
+
+
+
+ LogService.Write("鐢ㄦ埛:" + user + ",鏃ユ湡:" + DateTime.Now + ",鍒犻櫎宸ヨ壓璺嚎鍗曟嵁:" + HBillNo);
+ oCN.RunProc("Insert into System_log (GeginDate, userid, WorkstationName, WorkList, SystemName, NetuserName, State) select GETDATE(),'" + user + "','" + HComputerName + "','" + "鍒犻櫎宸ヨ壓璺嚎鍗曟嵁锛�" + HBillNo + "','LMES-宸ヨ壓璺嚎妯″潡','" + DBUtility.ClsPub.IPAddress + "','鍒犻櫎鍗曟嵁'", ref DBUtility.ClsPub.sExeReturnInfo);
oCN.Commit();//鎻愪氦浜嬪姟
objJsonResult.code = "0";
@@ -1775,6 +1829,39 @@
return GetObjectJson(ds);
}
+ #endregion
+
+ #region 宸ヨ壓璺嚎鎵规敼灏忔椂浜ц兘
+ [Route("Gy_RoutingBill/BulkWorkQty")]
+ [HttpGet]
+ public object BulkWorkQty(string HMaterNumber1, string HMaterNumber2,string HProcID, string HWorkQty)
+ {
+ try
+ {
+ oCN.BeginTran();
+
+ string sql = $"update b set b.HWorkQty = {HWorkQty} from Gy_RoutingBillMain a left join Gy_RoutingBillSub b on a.HInterID = b.HInterID left join Gy_Material m on a.HMaterID = m.HItemID where m.HNumber between '{HMaterNumber1}' and '{HMaterNumber2}' and b.HProcID = {HProcID} and a.HCloseMan = ''";
+
+ //鎵ц鏇存柊涓婄彮宸ユ椂璇彞
+ oCN.RunProc(sql);
+
+ oCN.Commit();
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鎵规敼鎴愬姛锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ catch (Exception e)
+ {
+ oCN.RollBack();
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "Exception锛�" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
#endregion
#endregion
@@ -2584,7 +2671,7 @@
objJsonResult.code = "1";
objJsonResult.count = 1;
- objJsonResult.Message = "Sucess锛�";
+ objJsonResult.Message = "[0000-1-037]Sucess锛�";
objJsonResult.data = ds.Tables[0];
objJsonResult.list = columnNameList;
@@ -2594,7 +2681,7 @@
{
objJsonResult.code = "0";
objJsonResult.count = 0;
- objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�" + e.ToString();
+ objJsonResult.Message = "[0000-1-010]娌℃湁杩斿洖浠讳綍璁板綍锛�" + e.ToString();
objJsonResult.data = null;
return objJsonResult;
}
@@ -3618,9 +3705,59 @@
return objJsonResult;
}
}
+ string HBillNo = ds.Tables[0].Rows[0]["HBillNo"].ToString();
+
+ //瀹℃牳鍓嶆帶鍒�=========================================
+ string sql1 = "exec h_p_Gy_RoutingBill_BeforeCheckCtrl " + HInterID + ",'" + HBillNo + "','" + user + "'";
+ ds = oCN.RunProcReturn(sql1, "h_p_Gy_RoutingBill_BeforeCheckCtrl");
+ if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "瀹℃牳澶辫触!鍘熷洜:瀹℃牳鍓嶅垽鏂け璐ワ紝璇蜂笌缃戠粶绠$悊浜哄憳鑱旂郴";
+ objJsonResult.data = null;
+ oCN.RollBack();
+ return objJsonResult;
+ }
+
+ if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "瀹℃牳澶辫触!鍘熷洜:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
+ objJsonResult.data = null;
+ oCN.RollBack();
+ return objJsonResult;
+ }
+ //==================================================================================
//瀹℃牳宸ヨ壓璺嚎
oCN.RunProc(" Update Gy_RoutingBillMain set HChecker='" + user + "',HCheckDate=getdate(),HBillStatus=2 Where HInterID=" + HInterID.ToString());
+
+
+ //瀹℃牳鍚庢帶鍒�=========================================
+ string sql2 = "exec h_p_Gy_RoutingBill_AfterCheckCtrl " + HInterID + ",'" + HBillNo + "','" + user + "'";
+ ds = oCN.RunProcReturn(sql1, "h_p_Gy_RoutingBill_AfterCheckCtrl");
+ if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "瀹℃牳澶辫触!鍘熷洜:瀹℃牳鍚庡垽鏂け璐ワ紝璇蜂笌缃戠粶绠$悊浜哄憳鑱旂郴";
+ objJsonResult.data = null;
+ oCN.RollBack();
+ return objJsonResult;
+ }
+
+ if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "瀹℃牳澶辫触!鍘熷洜:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
+ objJsonResult.data = null;
+ oCN.RollBack();
+ return objJsonResult;
+ }
+ //==================================================================================
//鑾峰彇绯荤粺鍙傛暟
string Ret = "";
@@ -3680,7 +3817,7 @@
}
}
//鍙嶅鏍稿崟鎹�
- if (BillOld.AbandonCheck(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo))
+ if (BillOld.AbandonCheck(Int64.Parse(HInterID), ds.Tables[0].Rows[0]["HBillNo"].ToString(), "h_p_Gy_RoutingBill_AfterUnCheckCtrl", user, ref ClsPub.sExeReturnInfo))
{
//SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
//DataSet DSet = oCn.RunProcReturn("exec h_p_Sc_ICMOBill_AbandonCheckCtrl " + int.Parse(HInterID), "h_p_Sc_ICMOBill_AbandonCheckCtrl");
@@ -3832,7 +3969,7 @@
{
objJsonResult.code = "0";
objJsonResult.count = 0;
- objJsonResult.Message = "鍗曟嵁宸插弽鍏抽棴!涓嶉渶瑕佸啀鍙嶅叧闂�!";
+ objJsonResult.Message = "鍗曟嵁鏈墜鍔ㄥ叧闂�!闇�瑕佸厛鍏抽棴";
objJsonResult.data = null;
return objJsonResult;
}
@@ -3856,6 +3993,17 @@
objJsonResult.data = null;
return objJsonResult;
}
+ //鑾峰彇绯荤粺鍙傛暟璁剧疆澶辨晥鏃堕棿
+ string Ret = "";
+ if (oSystemParameter.ShowBill(ref Ret))
+ {
+ //鍒ゆ柇瀹㈡埛
+ if (oSystemParameter.omodel.WMS_CampanyName == "娣诲悍绉戞妧") //绯荤粺鍙傛暟
+ {
+ //鍒锋柊澶辨晥鏃堕棿
+ oCN.RunProc("update Gy_RoutingBillMain set HEndDate = '9999-12-31',HBeginDate = CONVERT(date, GETDATE()) where HInterID = " + HInterID);
+ }
+ }
}
oCN.Commit();//鎻愪氦浜嬪姟
@@ -3878,6 +4026,7 @@
}
#endregion
+
#region 鎶ヨ〃鏌ョ湅鏉冮檺鎺у埗
/// <summary>
@@ -3912,7 +4061,7 @@
{
objJsonResult.code = "0";
objJsonResult.count = 0;
- objJsonResult.Message = "Exception锛�" + e.ToString();
+ objJsonResult.Message = "[0000-1-010]Exception锛�" + e.ToString();
objJsonResult.data = null;
return objJsonResult;
}
--
Gitblit v1.9.1