From 29111b3f4dfbd0f6ebd5cfde2d61a8d73cfcdc96 Mon Sep 17 00:00:00 2001
From: yangle <admin@YINMOU>
Date: 星期三, 15 五月 2024 10:35:14 +0800
Subject: [PATCH] 包装单优化
---
WebAPI/Controllers/LMESController.cs | 280 ++++++++++++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 272 insertions(+), 8 deletions(-)
diff --git a/WebAPI/Controllers/LMESController.cs b/WebAPI/Controllers/LMESController.cs
index 16a2d83..0151dbd 100644
--- a/WebAPI/Controllers/LMESController.cs
+++ b/WebAPI/Controllers/LMESController.cs
@@ -472,6 +472,48 @@
}
/// <summary>
+ /// 宸ュ簭娴佽浆鍗$殑鏈亾宸ュ簭
+ /// </summary>
+ /// <param name="sBillBarCode"></param>
+ /// <returns></returns>
+ [Route("LEMS/TxtHBarCode_KeyDown_Last")]
+ [HttpGet]
+ public object TxtHBarCode_KeyDown_Last(string sBillBarCode)
+ {
+ DataSet ds;
+ try
+ {
+ SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+ if (sBillBarCode == null || sBillBarCode.Equals(""))
+ {
+ return CustomError("鏈緭鍏ユ潯褰㈢爜锛�");
+ }
+ else
+ {
+ //鎷嗗垎鏉″舰鐮�
+ string[] NewBarCode;
+ if (sBillBarCode.CompareTo("#") > 0)
+ {
+ NewBarCode = sBillBarCode.Split(Convert.ToChar("#"));
+ sBillBarCode = NewBarCode[0];
+ }
+ string sBillNo = sBillBarCode;
+ ds = oCN.RunProcReturn("select top 1 * from h_v_Sc_ProcessExchangeBillList where 鍗曟嵁鍙�= '" + sBillNo + "' and 鏈亾宸ュ簭='鏄�' ", "h_v_Sc_ProcessExchangeBillList");
+ if (ds == null || ds.Tables[0].Rows.Count == 0)
+ {
+ return CustomError("涓嶅瓨鍦ㄦ娴佽浆鍗″彿锛�");
+ }
+ }
+
+ }
+ catch (Exception e)
+ {
+ ds = null;
+ }
+ return CustomCorrect(ds);
+ }
+
+ /// <summary>
/// 娴佹按鍙峰洖杞︽柟娉�(杩涚珯鎺ユ敹鍗曘�佸嚭绔欐眹鎶ュ崟)
///鍙傛暟锛歴tring sql銆�
///杩斿洖鍊硷細object銆�
@@ -769,14 +811,21 @@
/// </summary>
[Route("LEMS/SaveToSc_PackUnionBillMain")]
[HttpGet]
- public object SaveToSc_PackUnionBillMain(string HBillNo, string HRemark,string HProjectNum)
+ public object SaveToSc_PackUnionBillMain(string HBillNo, string HRemark,string HProjectNum,string zxQty, string BBM, string LDM, string HMaterNumber)
{
DataSet ds;
DataSet dsHSNum;
try
{
- //椤圭洰鍙疯幏鍙栨祦姘村彿
SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+ string HBarCode_White = "";
+ if (LDM != "鍏朵粬" && BBM != "鍏朵粬" )
+ {
+ ds = oCN.RunProcReturn($"exec h_p_MES_HBarCode_White_SMR {zxQty},'{BBM}','{HMaterNumber}'", "h_p_MES_HBarCode_White_SMR");
+ HBarCode_White = ds.Tables[0].Rows[0]["HBarCode_White"].ToString();
+ }
+
+ //椤圭洰鍙疯幏鍙栨祦姘村彿
dsHSNum = oCN.RunProcReturn("exec h_p_WMS_GetMaxNo '" + HProjectNum + "'", "h_p_WMS_GetMaxNo");
oCN.RunProc("exec h_p_WMS_SetMaxNo '" + HProjectNum + "'");
int HSNum = ClsPub.isInt(dsHSNum.Tables[0].Rows[0][0]) + 1;
@@ -788,7 +837,7 @@
}
else
{
- ds = oCN.RunProcReturn("exec h_p_Save_KF_PonderationBillMain_TempToSc_PackUnionBillMain '" + HBillNo + "','" + HRemark + "'," + HSNum + ",'" + HSNum2 + "'", "h_p_Save_KF_PonderationBillMain_TempToSc_PackUnionBillMain");
+ ds = oCN.RunProcReturn("exec h_p_Save_KF_PonderationBillMain_TempToSc_PackUnionBillMain '" + HBillNo + "','" + HRemark + "'," + HSNum + ",'" + HSNum2 + "','" + HBarCode_White + "'", "h_p_Save_KF_PonderationBillMain_TempToSc_PackUnionBillMain");
}
}
catch (Exception e)
@@ -1037,13 +1086,13 @@
SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
if (sWhere == null || sWhere.Equals(""))
{
- ds = oCN.RunProcReturn("select * from h_v_ProductionLinePackagingList order by 鍞竴鏉$爜 desc", "h_v_ProductionLinePackagingList");
+ ds = oCN.RunProcReturn("select top 1000 * from h_v_ProductionLinePackagingList order by 鎵爜鏃ユ湡 desc, 鍞竴鏉$爜 desc", "h_v_ProductionLinePackagingList");
}
else
{
- string sql1 = "select * from h_v_ProductionLinePackagingList where 1 = 1 ";
+ string sql1 = "select * from h_v_ProductionLinePackagingList where 1 = 1 ";
string sql = sql1 + sWhere;
- string sql2 = " order by 鍞竴鏉$爜 desc";
+ string sql2 = " order by 鎵爜鏃ユ湡 desc, 鍞竴鏉$爜 desc";
sql = sql + sql2;
ds = oCN.RunProcReturn(sql, "h_v_ProductionLinePackagingList");
}
@@ -1056,6 +1105,36 @@
return GetObjectJson(ds);
}
+ /// <summary>
+ /// 鍒犻櫎瀵瑰簲鐨勫寘瑁呭崟
+ /// </summary>
+ /// <param name="sWhere"></param>
+ /// <returns></returns>
+ [Route("LEMS/DelMES_ProductionLinePackagingList")]
+ [HttpGet]
+ public object DelMES_ProductionLinePackagingList(string HInterID)
+ {
+ try
+ {
+ SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+ oCN.RunProc("Delete from Sc_PackUnionBillMain where HInterID = " + HInterID);
+ oCN.RunProc("Delete from Sc_PackUnionBillSub where HInterID = " + HInterID);
+ oCN.RunProc("Delete from KF_PonderationBillMain_Temp where HInterID = " + HInterID);
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鍒犻櫎鎴愬姛锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍒犻櫎澶辫触锛�";
+ objJsonResult.data = e.ToString();
+ return objJsonResult;
+ }
+ }
/// <summary>
/// 鎵壒娆℃潯鐮佹柟娉曪紙浜х嚎缁勮杩芥函鍗曪級--鏍规嵁鎵规鏉$爜鍒版潯鐮佹。妗堣〃涓幏鍙栨暟鎹繚瀛樺埌temp琛�
///鍙傛暟锛歴tring sql銆�
@@ -1183,6 +1262,110 @@
}
}
+ //鍒ゆ柇鏉$爜鏄惁鏄笉鑹殑鐘舵��
+ [Route("LEMS/HbadStaus")]
+ [HttpGet]
+ public object HbadStaus(string SubBarcode)
+ {
+ DataSet ds;
+ try
+ {
+ SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+ ds = oCN.RunProcReturn(@"select HBillNo,HReasult from tiaom where HBillNo='" + SubBarcode + @"'
+union
+select HBarCode HBillNo,HStatus HReasult from Gy_BarCodeBill
+where HBarCode='" + SubBarcode + "'", "Gy_BarCodeBill");
+ if (ClsPub.isInt(ds.Tables[0].Rows.Count) == 0)
+ {
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "ok!";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ else if (ds.Tables[0].Rows[0]["HReasult"].ToString() =="涓嶈壇")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "褰撳墠鏉$爜鐨勭姸鎬佷负:"+ ds.Tables[0].Rows[0]["HReasult"].ToString() + "锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ else
+ {
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = null;
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "寮傚父锛�";
+ objJsonResult.data = e.ToString();
+ return objJsonResult;
+ }
+ }
+
+ //鍒ゆ柇鏉$爜涔嬪墠鐨勫伐搴忔槸鍚﹀嚭绔�
+ [Route("LEMS/SNBarcodeProcCtrl")]
+ [HttpGet]
+ public object SNBarcodeProcCtrl(string SubBarcode,string HProcExchBillNo)
+ {
+ DataSet ds;
+ try
+ {
+ SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+ ds = oCN.RunProcReturn(" select * from Gy_BarCodeBill where HSourceBillNo='" + HProcExchBillNo + "' and HBarCode='" + SubBarcode + "'", "Gy_BarCodeBill");
+ if (ds.Tables[0].Rows.Count == 0)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鏌ユ棤鏁版嵁,鏉$爜:" + SubBarcode + "涓嶅睘浜庡綋鍓嶆祦杞崱:" + HProcExchBillNo + "!";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ ds = oCN.RunProcReturn(@"exec h_p_Sc_SNBarcodeProcCtrl '" + SubBarcode + "'", "h_p_Sc_SNBarcodeProcCtrl");
+ if (ClsPub.isInt(ds.Tables[0].Rows.Count) == 0)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鏌ユ棤鏁版嵁!";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ else if (ds.Tables[0].Rows[0]["HBack"].ToString() == "2")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = ds.Tables[0].Rows[0]["HBackRemark"].ToString() + "锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ else
+ {
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = null;
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "寮傚父锛�";
+ objJsonResult.data = e.ToString();
+ return objJsonResult;
+ }
+ }
+
+
//鍒ゆ柇鎬荤殑鍖呰鏁伴噺鏄惁瓒呰繃娴佽浆鍗℃暟閲�
[Route("LEMS/h_p_Sc_ProductionLinePackaging_Checkqty")]
[HttpGet]
@@ -1197,8 +1380,8 @@
{
objJsonResult.code = "1";
objJsonResult.count = 1;
- objJsonResult.Message = "Sucess";
- objJsonResult.data = null;
+ objJsonResult.Message = "鑾峰彇淇℃伅鎴愬姛锛�";//杩斿洖鍓╀綑鏁伴噺
+ objJsonResult.data = Pub_Class.ClsPub.isInt(ds.Tables[0].Rows[0]["HBackRemark"]);
return objJsonResult;
}
else
@@ -1220,6 +1403,87 @@
}
}
+ /// <summary>
+ /// 缂撳瓨琛ㄥ寘瑁呭崟璁板綍
+ ///鍙傛暟锛歴tring sql銆�
+ ///杩斿洖鍊硷細object銆�
+ /// </summary>
+ [Route("LEMS/PackUnionCacheList")]
+ [HttpGet]
+ public object PackUnionCacheList(string sWhere)
+ {
+ DataSet ds;
+ try
+ {
+ SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+ if (sWhere == null || sWhere.Equals(""))
+ {
+ ds = oCN.RunProcReturn("select top 5000 * from h_v_PackUnionBillCacheList order by 鎵爜鏃堕棿 desc", "h_v_PackUnionBillCacheList");
+ }
+ else
+ {
+ string sql1 = "select * from h_v_PackUnionBillCacheList where 1 = 1 ";
+ string sql = sql1 + sWhere;
+ string sql2 = " order by 鎵爜鏃堕棿 desc";
+ sql += sql2;
+ ds = oCN.RunProcReturn(sql, "h_v_PackUnionBillCacheList");
+ }
+ if (ds == null || ds.Tables[0].Rows.Count == 0)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鏃犳暟鎹紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ else
+ {
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "Sucess锛�";
+ objJsonResult.data = ds.Tables[0];
+ return objJsonResult;
+ }
+
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "Exception锛�" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+
+ #region 鎵撳嵃鏌ヨ鏁版嵁
+ [Route("Gy_SOPBillList/WindowPrintList")]
+ [HttpGet]
+ public object WindowPrintList(string sWhere)
+ {
+ DataSet ds;
+ try
+ {
+ SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+ ds = oCN.RunProcReturn(sWhere, "WindowPrint");
+
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "Sucess锛�";
+ objJsonResult.data = ds.Tables[0];
+ return objJsonResult;
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "Exception锛�" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ #endregion
+
//
}
}
\ No newline at end of file
--
Gitblit v1.9.1