From ce58bfdb73054fa181e0731d60f4c2e74798cabb Mon Sep 17 00:00:00 2001
From: llj <132905093+newwwwwwtree@users.noreply.github.com>
Date: 星期一, 13 十月 2025 09:23:38 +0800
Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API
---
WebAPI/Controllers/LMESController.cs | 348 +++++++++++++++++++++++++++++++++++++++++++++++++++++----
1 files changed, 320 insertions(+), 28 deletions(-)
diff --git a/WebAPI/Controllers/LMESController.cs b/WebAPI/Controllers/LMESController.cs
index 0364bfb..fbe5764 100644
--- a/WebAPI/Controllers/LMESController.cs
+++ b/WebAPI/Controllers/LMESController.cs
@@ -589,6 +589,7 @@
public object MES_ProcessExchangeBillList_PG(string sWhere, string user, int OperationType)
{
DataSet ds;
+ string sql = "";
try
{
List<object> columnNameList = new List<object>();
@@ -602,6 +603,8 @@
return objJsonResult;
}
+ sql = "select top 1000 * from h_v_Sc_ProcessExchangeArrangementList_PG where 1 = 1 " + sWhere + " order by hmainid desc ";
+
if (OperationType == 1)
{
//鑾峰彇绯荤粺鍙傛暟
@@ -614,6 +617,10 @@
sWhere += " ";
}
+ else if (oSystemParameter.omodel.WMS_CampanyName == "鍑礉濂堢壒")
+ {
+ sql = "select top 1000 * from h_v_Sc_ProcessExchangeArrangementList_PG where 1 = 1 " + sWhere;
+ }
else
{
sWhere += " ";
@@ -621,7 +628,7 @@
}
SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
- ds = oCN.RunProcReturn("select top 1000 * from h_v_Sc_ProcessExchangeArrangementList_PG where 1 = 1 " + sWhere + " order by hmainid desc ", "h_v_Sc_ProcessExchangeArrangementList_PG");
+ ds = oCN.RunProcReturn(sql, "h_v_Sc_ProcessExchangeArrangementList_PG");
}
else
{
@@ -635,10 +642,15 @@
}
+ else if (oSystemParameter.omodel.WMS_CampanyName == "鍑礉濂堢壒")
+ {
+ sql = "select top 1000 * from h_v_Sc_ProcessExchangeArrangementList_PG where 1 = 1 " + sWhere;
+ }
}
+ sql = "select top 1000 * from h_v_Sc_ProcessExchangeArrangementList_PG where 1 = 1 " + sWhere + " ";
SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
- ds = oCN.RunProcReturn("select * from h_v_Sc_ProcessExchangeArrangementList_PG where 1 = 1 " + sWhere, "h_v_Sc_ProcessExchangeArrangementList_PG");
+ ds = oCN.RunProcReturn(sql, "h_v_Sc_ProcessExchangeArrangementList_PG");
}
//娣诲姞鍒楀悕
@@ -3033,7 +3045,7 @@
//澧ㄨタ鍝ョ櫧鏍囩敓鎴�
[Route("LEMS/SaveCirculationCard_Json_MXG")]
[HttpGet]
- public object SaveCirculationCard_Json_MXG(string HBillNo, string HInterID, string HBillNo2, string HBarCode,string HNumber, string HName, string HModel)
+ public object SaveCirculationCard_Json_MXG(string HBillNo, string HInterID, string HBillNo2, string HBarCode,string HNumber, string HName, string HModel,string NBXMH, string HOrgID)
{
DataSet ds;
try
@@ -3043,7 +3055,7 @@
{
HBarCode = " ";
}
- ds = oCN.RunProcReturn("exec Save_Sc_ProcessExchangeBillMainToTmp_MXG '" + HBillNo + "','" + HInterID + "','" + HBillNo2 + "','" + HBarCode + "','" + HNumber + "','" + HName + "','" + HModel + "'", "Save_Sc_ProcessExchangeBillMainToTmp_MXG");
+ ds = oCN.RunProcReturn("exec Save_Sc_ProcessExchangeBillMainToTmp_MXG '" + HBillNo + "','" + HInterID + "','" + HBillNo2 + "','" + HBarCode + "','" + HNumber + "','" + HName + "','" + HModel + "','" + NBXMH + "','" + HOrgID + "'", "Save_Sc_ProcessExchangeBillMainToTmp_MXG");
}
catch (Exception e)
@@ -3293,7 +3305,7 @@
[Route("LEMS/SaveToSc_PackUnionBillMain_MXG")]
[HttpGet]
- public object SaveToSc_PackUnionBillMain(string HBillNo, string HRemark, string HProjectNum, string zxQty, string BBM, string LDM, string HMaterNumber, string HBarCode_White,string HOrgID)
+ public object SaveToSc_PackUnionBillMain(string HBillNo, string HRemark, string HProjectNum, string zxQty, string BBM, string LDM, string HMaterNumber, string HBarCode_White,string HOrgID,string NBXMH)
{
DataSet ds;
DataSet dsHSNum;
@@ -3304,7 +3316,7 @@
{
if (LDM != "鍏朵粬" && BBM != "鍏朵粬")
{
- ds = oCN.RunProcReturn($"exec h_p_MES_HBarCode_White_SMR_MXG {zxQty},'{BBM}','{HMaterNumber}','{HBillNo}'", "h_p_MES_HBarCode_White_SMR_MXG");
+ ds = oCN.RunProcReturn($"exec h_p_MES_HBarCode_White_SMR_MXG {zxQty},'{BBM}','{HMaterNumber}','{HBillNo}','{NBXMH}','{HOrgID}'", "h_p_MES_HBarCode_White_SMR_MXG");
HBarCode_White = ds.Tables[0].Rows[0]["HBarCode_White"].ToString();
}
}
@@ -3353,6 +3365,31 @@
else
{
ds = oCN.RunProcReturn("exec h_p_Save_KF_PonderationBillMain_TempToSc_PackUnionBillSub '" + HitemID + "','" + HRemark + "'", "h_p_Save_KF_PonderationBillMain_TempToSc_PackUnionBillSub");
+ }
+
+ }
+ catch (Exception e)
+ {
+ ds = null;
+ }
+ return CustomCorrect(ds);
+ }
+
+ [Route("LEMS/SaveToSc_PackUnionBillSub_Batch")]
+ [HttpGet]
+ public object SaveToSc_PackUnionBillSub_Batch(string HitemID, string HRemark)
+ {
+ DataSet ds;
+ try
+ {
+ SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+ if (HitemID == null || HitemID.Equals(""))
+ {
+ return CustomError("鏇存柊澶辫触HitemID涓虹┖锛�");
+ }
+ else
+ {
+ ds = oCN.RunProcReturn("exec h_p_Save_KF_PonderationBillMain_TempToSc_PackUnionBillSub_Batch '" + HitemID + "','" + HRemark + "'", "h_p_Save_KF_PonderationBillMain_TempToSc_PackUnionBillSub_Batch");
}
}
@@ -3417,6 +3454,31 @@
else
{
ds = oCN.RunProcReturn("exec h_p_Update_Flag_HRelationInterID '" + HitemID + "'", "h_p_Update_Flag_HRelationInterID");
+ }
+
+ }
+ catch (Exception e)
+ {
+ ds = null;
+ }
+ return CustomCorrect(ds);
+ }
+
+ [Route("LEMS/Update_Flag_HRelationInterID_Batch")]
+ [HttpGet]
+ public object Update_Flag_HRelationInterID_Batch(string HitemID)
+ {
+ DataSet ds;
+ try
+ {
+ SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+ if (HitemID == null || HitemID.Equals(""))
+ {
+ return CustomError("鏇存柊澶辫触HitemID涓虹┖锛�");
+ }
+ else
+ {
+ ds = oCN.RunProcReturn("exec h_p_Update_Flag_HRelationInterID_Batch '" + HitemID + "'", "h_p_Update_Flag_HRelationInterID_Batch");
}
}
@@ -3584,7 +3646,6 @@
#endregion
-
#region 浜х嚎鍖呰鍗曞垪琛ㄦ煡璇�
[Route("LEMS/MES_ProductionLinePackagingList_Json")]
@@ -3597,11 +3658,11 @@
SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
if (sWhere == null || sWhere.Equals(""))
{
- ds = oCN.RunProcReturn("select top 1000 * from h_v_ProductionLinePackagingList order by 鎵爜鏃ユ湡 desc, 鍞竴鏉$爜 desc", "h_v_ProductionLinePackagingList");
+ ds = oCN.RunProcReturn("select top 300 * from h_v_ProductionLinePackagingList order by 鎵爜鏃ユ湡 desc, 鍞竴鏉$爜 desc", "h_v_ProductionLinePackagingList");
}
else
{
- string sql1 = "select top 1000 * from h_v_ProductionLinePackagingList where 1 = 1 ";
+ string sql1 = "select top 300 * from h_v_ProductionLinePackagingList where 1 = 1 ";
string sql = sql1 + sWhere;
string sql2 = " order by 鎵爜鏃ユ湡 desc, 鍞竴鏉$爜 desc";
sql = sql + sql2;
@@ -3746,6 +3807,48 @@
#endregion
+ #region 鑾峰彇鐧芥爣椤圭洰鍙�
+
+ [Route("LEMS/GetHProject_MXG")]
+ [HttpGet]
+ public object GetHProject_MXG(string HOrgID)
+ {
+ DataSet ds;
+ DataSet dsHSNum;
+ try
+ {
+ SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+
+ ds = oCN.RunProcReturn("select HInterID,HSupBarCodeNumber HName from Sc_PackUnionBillBarCode_temp where HUSEORGID='" + HOrgID + "'", "Sc_PackUnionBillBarCode_temp");
+
+ if (ds == null || ds.Tables[0].Rows.Count <= 0)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鑾峰彇澶辫触" + DBUtility.ClsPub.sErrInfo;
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ else
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鑾峰彇鎴愬姛!";
+ objJsonResult.data = ds.Tables[0];
+ return objJsonResult;
+ }
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "寮傚父锛�" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ #endregion
+
#region 鏍规嵁ID鍒犻櫎缂撳瓨琛ㄤ腑鎵爜璁板綍-浜х嚎鍖呰鍗�
@@ -3869,7 +3972,7 @@
{
objJsonResult.code = "0";
objJsonResult.count = 0;
- objJsonResult.Message = "[0000-1-051]" + ds.Tables[0].Rows[0]["HBackRemark"].ToString();
+ objJsonResult.Message =ds.Tables[0].Rows[0]["HBackRemark"].ToString();
return objJsonResult;
}
else
@@ -4308,7 +4411,7 @@
{
if (HBillSubType == "SUB")
{
- //鍒ゆ柇鏄惁鏈夊垹闄ゆ潈闄�
+ //鍒ゆ柇鏄惁鏈夊鏍告潈闄�
if (!DBUtility.ClsPub.Security_Log("Gy_RoutingBill_Sub_Check", 1, false, user))
{
objJsonResult.code = "0";
@@ -4490,28 +4593,55 @@
return objJsonResult;
}
}
- //鍙嶅鏍稿崟鎹�
- 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");
- ////if (DBUtility.ClsPub.isInt(DSet.Tables[0].Rows[0]["Hback"]) != 0)
- ////{
- //// objJsonResult.code = "0";
- //// objJsonResult.count = 1;
- //// objJsonResult.Message = "璇ヤ换鍔″崟宸蹭笅鎺ㄦ祦杞崱锛屼笉鍏佽鍙嶅鏍�" + DBUtility.ClsPub.isStrNull(DSet.Tables[0].Rows[0]["HBackRemark"]);
- //// objJsonResult.data = null;
- //// return objJsonResult;
- ////}
- }
- else
+
+ string HBillNo = ds.Tables[0].Rows[0]["HBillNo"].ToString();
+
+ oCN.RunProc(" Update Gy_RoutingBillMain set HChecker='',HCheckDate=null,HBillStatus=1 Where HInterID=" + HInterID.ToString());
+
+
+ string sql2 = "exec h_p_Gy_RoutingBill_AfterCheckCtrl " + HInterID + ",'" + HBillNo + "','" + user + "'";
+ ds = oCN.RunProcReturn(sql2, "h_p_Gy_RoutingBill_AfterUnCheckCtrl");
+ if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
{
objJsonResult.code = "0";
objJsonResult.count = 1;
- objJsonResult.Message = "瀹℃牳澶辫触!鍘熷洜:" + ClsPub.sExeReturnInfo;
+ 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;
+ }
+ //鍙嶅鏍稿崟鎹�
+ // if (BillOld.AbandonCheck(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");
+ ////if (DBUtility.ClsPub.isInt(DSet.Tables[0].Rows[0]["Hback"]) != 0)
+ ////{
+ //// objJsonResult.code = "0";
+ //// objJsonResult.count = 1;
+ //// objJsonResult.Message = "璇ヤ换鍔″崟宸蹭笅鎺ㄦ祦杞崱锛屼笉鍏佽鍙嶅鏍�" + DBUtility.ClsPub.isStrNull(DSet.Tables[0].Rows[0]["HBackRemark"]);
+ //// objJsonResult.data = null;
+ //// return objJsonResult;
+ ////}
+ //}
+ // else
+ // {
+ // objJsonResult.code = "0";
+ // objJsonResult.count = 1;
+ // objJsonResult.Message = "瀹℃牳澶辫触!鍘熷洜:" + ClsPub.sExeReturnInfo;
+ // objJsonResult.data = null;
+ // return objJsonResult;
+ // }
}
oCN.Commit();//鎻愪氦浜嬪姟
@@ -4700,7 +4830,169 @@
}
#endregion
-
+ #region 宸ヨ壓璺嚎鍗曞叧闂�/鍙嶅叧闂姛鑳�(璁剧疆寮�濮嬫椂闂寸粨鏉熸椂闂�)
+ [Route("Gy_RoutingBill/CloseSetDate")]
+ [HttpGet]
+ public object CloseGy_RoutingBill(string HInterID, int Type, string user, string HBillSubType,DateTime HBeginDate,DateTime HEndDate)
+ {
+ try
+ {
+ if (HBillSubType == "SUB")
+ {
+ //鍒ゆ柇鏄惁鏈夊垹闄ゆ潈闄�
+ if (!DBUtility.ClsPub.Security_Log("Gy_RoutingBill_Sub_Close", 1, false, user))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "瀛愬伐鑹鸿矾绾挎棤鏉冮檺鍏抽棴!";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ else
+ {
+ //鍒ゆ柇鏄惁鏈夊垹闄ゆ潈闄�
+ if (!DBUtility.ClsPub.Security_Log("Gy_RoutingBill_Close", 1, false, user))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "宸ヨ壓璺嚎鏃犳潈闄愬叧闂�!";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+
+
+ if (string.IsNullOrWhiteSpace(HInterID))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "HInterID涓虹┖锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ ClsPub.CurUserName = user;
+ BillOld.MvarItemKey = "Gy_RoutingBillMain";
+ oCN.BeginTran();//寮�濮嬩簨鍔�
+
+ //Type 1 鍏抽棴 2 鍙嶅叧闂�
+ if (Type == 1)
+ {
+ //鍒ゆ柇鍗曟嵁鏄惁宸茬粡鍏抽棴
+ DataSet ds;
+ string sql = "select * from " + BillOld.MvarItemKey + " where HinterID = " + HInterID;
+ ds = oCN.RunProcReturn(sql, BillOld.MvarItemKey);
+ if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0)
+ {
+ if (ds.Tables[0].Rows[0]["HCloseMan"] != null && ds.Tables[0].Rows[0]["HCloseMan"].ToString() != "")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍗曟嵁宸插叧闂�!涓嶉渶瑕佸啀鍏抽棴!";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ string HBillStatus = Convert.ToString(ds.Tables[0].Rows[0]["HBillStatus"]);
+ //string hdeleteman = Convert.ToString(ds.Tables[0].Rows[0]["hdeleteman"]);
+ if (HBillStatus == "6")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍗曟嵁鍦ㄥ鏍镐腑,涓嶈兘鍏抽棴锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ //鍏抽棴鍗曟嵁
+ if (!BillOld.CloseBill(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鍏抽棴澶辫触!鍘熷洜:" + ClsPub.sExeReturnInfo;
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ //鑾峰彇绯荤粺鍙傛暟璁剧疆澶辨晥鏃堕棿
+ string Ret = "";
+ if (oSystemParameter.ShowBill(ref Ret))
+ {
+ //鍒ゆ柇瀹㈡埛
+ if (oSystemParameter.omodel.WMS_CampanyName == "娣诲悍绉戞妧") //绯荤粺鍙傛暟
+ {
+ //鍒锋柊澶辨晥鏃堕棿
+ oCN.RunProc("update Gy_RoutingBillMain set HEndDate = CONVERT(date, DATEADD(day, -1, GETDATE())) where HInterID = " + HInterID);
+ }
+ }
+ }
+ else
+ {
+ //鍒ゆ柇鍗曟嵁鏄惁宸茬粡鍙嶅叧闂�
+ DataSet ds;
+ string sql = "select * from " + BillOld.MvarItemKey + " where HinterID = " + HInterID;
+ ds = oCN.RunProcReturn(sql, BillOld.MvarItemKey);
+ if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0)
+ {
+ if (ds.Tables[0].Rows[0]["HCloseMan"] == null || ds.Tables[0].Rows[0]["HCloseMan"].ToString() == "")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍗曟嵁鏈墜鍔ㄥ叧闂�!闇�瑕佸厛鍏抽棴";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ string HBillStatus = Convert.ToString(ds.Tables[0].Rows[0]["HBillStatus"]);
+ //string hdeleteman = Convert.ToString(ds.Tables[0].Rows[0]["hdeleteman"]);
+ if (HBillStatus == "6")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍗曟嵁鍦ㄥ鏍镐腑,涓嶈兘鍙嶅叧闂紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ //鍙嶅叧闂崟鎹�
+ if (!BillOld.CancelClose(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鍙嶅叧闂け璐�!鍘熷洜:" + ClsPub.sExeReturnInfo;
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ //鑾峰彇绯荤粺鍙傛暟璁剧疆澶辨晥鏃堕棿
+ string Ret = "";
+ if (oSystemParameter.ShowBill(ref Ret))
+ {
+ //鍒ゆ柇瀹㈡埛
+ if (oSystemParameter.omodel.WMS_CampanyName == "娣诲悍绉戞妧") //绯荤粺鍙傛暟
+ {
+ //鍒锋柊澶辨晥鏃堕棿
+ oCN.RunProc($"update Gy_RoutingBillMain set HEndDate = '{HEndDate}',HBeginDate = '{HBeginDate}' where HInterID = " + HInterID);
+ }
+ }
+ }
+
+ oCN.Commit();//鎻愪氦浜嬪姟
+
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鎵ц鎴愬姛锛�";
+ objJsonResult.data = null;
+ return objJsonResult; ;
+
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鎵ц澶辫触锛�" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ #endregion
#region 鎶ヨ〃鏌ョ湅鏉冮檺鎺у埗
/// <summary>
--
Gitblit v1.9.1