From b51ed3cea777b1809afe07db7314b0e0a8c0e9b8 Mon Sep 17 00:00:00 2001 From: yusijie <ysj@hz-kingdee.com> Date: 星期三, 22 二月 2023 11:15:25 +0800 Subject: [PATCH] 工序出站-保存屏蔽包装标识,员工同步更改 --- DAL/WMS/ClsGy_BarCodeBill_Ctl.cs | 266 ++++++++++++++++++++++++++++++++++++++--------------- 1 files changed, 191 insertions(+), 75 deletions(-) diff --git a/DAL/WMS/ClsGy_BarCodeBill_Ctl.cs b/DAL/WMS/ClsGy_BarCodeBill_Ctl.cs index 9cfa797..d03c159 100644 --- a/DAL/WMS/ClsGy_BarCodeBill_Ctl.cs +++ b/DAL/WMS/ClsGy_BarCodeBill_Ctl.cs @@ -167,42 +167,6 @@ } } - //浣滃簾鏉$爜 - public bool Cancelltion(string sBarCode) - { - try - { - oCn.BeginTran(); - //浣滃簾鏉$爜 - oCn.RunProc("update Gy_BarCodeBill set HStopflag=1 where HBarCode='" + sBarCode + "'", ref DBUtility.ClsPub.sExeReturnInfo); - oCn.Commit(); - return true; - } - catch (Exception e) - { - oCn.RollBack(); - throw (e); - } - } - - //鍙嶄綔搴熸潯鐮� - public bool UnCancelltion(string sBarCode) - { - try - { - oCn.BeginTran(); - //鍙嶄綔搴熸潯鐮� - oCn.RunProc("update Gy_BarCodeBill set HStopflag=0 where HBarCode='" + sBarCode + "'", ref DBUtility.ClsPub.sExeReturnInfo); - oCn.Commit(); - return true; - } - catch (Exception e) - { - oCn.RollBack(); - throw (e); - } - } - public bool DeleteByMul(string[] sSQL, ref string sReturn) { try @@ -225,42 +189,115 @@ } - //鍒犻櫎鏉$爜 - public bool DeleteBill(long sHItemID, string sHBarCode, string CurUserName, ref string sReturn) + + //--------------------------------------------------------- + //New + + //浣滃簾鏉$爜 + public bool Cancelltion(string sHItemID, string sHBarCode, string sHDeleteMan) { - //缂栬緫鏉冮檺 - if (!DBUtility.ClsPub.Security_Log(ModRightNameEdit, 1, false, CurUserName)) - { - sReturn = "鎮ㄦ病鏈夊垹闄ゆ潈闄愶紒"; - return true; - } try { - DataSet DS = oCn.RunProcReturn("exec h_p_Gy_BarCodeBill_Delete " + sHItemID + ",'" + sHBarCode + "','" + CurUserName + "','" + DBUtility.ClsPub.ComputerName + "','" + DBUtility.ClsPub.IPAddress + "'", "h_p_Gy_BarCodeBill_Delete", ref DBUtility.ClsPub.sExeReturnInfo); + oCn.BeginTran(); + string[] NewBarCode; + NewBarCode = sHBarCode.Split(Convert.ToChar("#")); + + //浣滃簾鏉$爜 + oCn.RunProc("update Gy_BarCodeBill set HStopflag=1,HDeleteMan='" + sHDeleteMan + "',HDeleteDate=getdate() where HItemID in (" + sHItemID + ")", ref DBUtility.ClsPub.sExeReturnInfo); + //鍐欏叆绯荤粺鏃ュ織 + for (int i = 0; i <= NewBarCode.Length - 1; i++) + { + oCn.RunProc("Insert into System_log (GeginDate, userid, WorkstationName, WorkList, SystemName, NetuserName, State) select GETDATE(),'" + DBUtility.ClsPub.CurUserName + "','" + DBUtility.ClsPub.ComputerName + "','浣滃簾鏉$爜锛�" + NewBarCode[i] + "','WMS绯荤粺-鏉$爜妗f鍒楄〃妯″潡','" + DBUtility.ClsPub.IPAddress + "','浣滃簾'", ref DBUtility.ClsPub.sExeReturnInfo); + } + oCn.Commit(); + return true; + } + catch (Exception e) + { + oCn.RollBack(); + throw (e); + } + } + + //鍙嶄綔搴熸潯鐮� + public bool UnCancelltion(string sHItemID, string sHBarCode, string sSourceQtyCtl, ref string sReturn) + { + try + { + oCn.BeginTran(); + string[] NewBarCode; + NewBarCode = sHBarCode.Split(Convert.ToChar("#")); + //鍙嶄綔搴熸潯鐮佸墠杩涜鍒ゆ柇 + DataSet DS = oCn.RunProcReturn("exec h_p_Gy_BarCodeBill_UnCancelltion '" + sHItemID + "','" + sSourceQtyCtl + "'", "h_p_Gy_BarCodeBill_UnCancelltion", ref DBUtility.ClsPub.sExeReturnInfo); if (DS == null || DS.Tables[0].Rows.Count <= 0) { oCn.CnClose(); oCn.CnDispose(); - sReturn = "鍒犻櫎鏉$爜鏃跺彂鐢熼敊璇紒"; - return true; + sReturn = "鍙嶄綔搴熸潯鐮佸墠鍒ゆ柇鍙戠敓閿欒锛�"; + return false; } else { - //鍒犻櫎澶辫触 if (DBUtility.ClsPub.isStrNull(DS.Tables[0].Rows[0][0]) == "1") { oCn.CnClose(); oCn.CnDispose(); sReturn = DBUtility.ClsPub.isStrNull(DS.Tables[0].Rows[0]["HRemark"]); - return true; + return false; } else - //鍒犻櫎鎴愬姛 + { + //鍙嶄綔搴熸潯鐮� + oCn.RunProc("update Gy_BarCodeBill set HStopflag=0,HDeleteMan='',HDeleteDate=null where HItemID in (" + sHItemID + ")", ref DBUtility.ClsPub.sExeReturnInfo); + //鍐欏叆绯荤粺鏃ュ織 + for (int i = 0; i <= NewBarCode.Length - 1; i++) + { + oCn.RunProc("Insert into System_log (GeginDate, userid, WorkstationName, WorkList, SystemName, NetuserName, State) select GETDATE(),'" + DBUtility.ClsPub.CurUserName + "','" + DBUtility.ClsPub.ComputerName + "','鍙嶄綔搴熸潯鐮侊細" + NewBarCode[i] + "','WMS绯荤粺-鏉$爜妗f鍒楄〃妯″潡','" + DBUtility.ClsPub.IPAddress + "','鍙嶄綔搴�'", ref DBUtility.ClsPub.sExeReturnInfo); + } + oCn.Commit(); + return true; + } + } + } + catch (Exception e) + { + oCn.RollBack(); + throw (e); + } + } + + //鍗曟潯鍒犻櫎鏉$爜 + public bool DeleteBill(long sHItemID, string sHBarCode, ref string sReturn) + { + try + { + oCn.BeginTran(); + //鍒犻櫎鏉$爜鍓嶈繘琛屽垽鏂� + DataSet DS = oCn.RunProcReturn("exec h_p_Gy_BarCodeBill_Delete_Before " + sHItemID + ",'" + sHBarCode + "'", "h_p_Gy_BarCodeBill_Delete_Before", ref DBUtility.ClsPub.sExeReturnInfo); + if (DS == null || DS.Tables[0].Rows.Count <= 0) + { + oCn.CnClose(); + oCn.CnDispose(); + sReturn = "鍒犻櫎鏉$爜鍓嶅垽鏂彂鐢熼敊璇紒"; + return false; + } + else + { + if (DBUtility.ClsPub.isStrNull(DS.Tables[0].Rows[0][0]) == "1") { oCn.CnClose(); oCn.CnDispose(); sReturn = DBUtility.ClsPub.isStrNull(DS.Tables[0].Rows[0]["HRemark"]); return false; + } + else + { + //鍒犻櫎鏉$爜 + oCn.RunProc("Delete from Gy_BarCodeBill where HItemID = " + sHItemID, ref DBUtility.ClsPub.sExeReturnInfo); + //鍐欏叆绯荤粺鏃ュ織 + oCn.RunProc("Insert into System_log (GeginDate, userid, WorkstationName, WorkList, SystemName, NetuserName, State) select GETDATE(),'" + DBUtility.ClsPub.CurUserName + "','" + DBUtility.ClsPub.ComputerName + "','鍒犻櫎鏉$爜锛�" + sHBarCode + "','WMS绯荤粺-鏉$爜妗f鍒楄〃妯″潡','" + DBUtility.ClsPub.IPAddress + "','鍒犻櫎'", ref DBUtility.ClsPub.sExeReturnInfo); + oCn.Commit(); + return true; } } } @@ -272,41 +309,42 @@ } //鎵归噺鍒犻櫎鏉$爜 - public bool MulDeleteBill(string sHItemID, string sHBarCode, string CurUserName, ref string sReturn) + public bool MulDeleteBill(string sHItemID, string sHBarCode, ref string sReturn) { - //缂栬緫鏉冮檺 - if (!DBUtility.ClsPub.Security_Log(ModRightNameEdit, 1, false, CurUserName)) - { - sReturn = "鎮ㄦ病鏈夊垹闄ゆ潈闄愶紒"; - return true; - } try { - DataSet DS = oCn.RunProcReturn("exec h_p_Gy_BarCodeBill_MulDelete '" + sHItemID + "','" + sHBarCode + "','" + CurUserName + "','" + DBUtility.ClsPub.ComputerName + "','" + DBUtility.ClsPub.IPAddress + "'", "h_p_Gy_BarCodeBill_MulDelete", ref DBUtility.ClsPub.sExeReturnInfo); + oCn.BeginTran(); + string[] NewBarCode; + NewBarCode = sHBarCode.Split(Convert.ToChar("#")); + //鎵归噺鍒犻櫎鏉$爜鍓嶈繘琛屽垽鏂� + DataSet DS = oCn.RunProcReturn("exec h_p_Gy_BarCodeBill_MulDelete_Before '" + sHItemID + "','" + sHBarCode + "'", "h_p_Gy_BarCodeBill_MulDelete_Before", ref DBUtility.ClsPub.sExeReturnInfo); if (DS == null || DS.Tables[0].Rows.Count <= 0) { oCn.CnClose(); oCn.CnDispose(); - sReturn = "鎵归噺鍒犻櫎鏉$爜鏃跺彂鐢熼敊璇紒"; - return true; + sReturn = "鎵归噺鍒犻櫎鏉$爜鍓嶅垽鏂彂鐢熼敊璇紒"; + return false; } else { - //鎵归噺鍒犻櫎澶辫触 if (DBUtility.ClsPub.isStrNull(DS.Tables[0].Rows[0][0]) == "1") { oCn.CnClose(); oCn.CnDispose(); sReturn = DBUtility.ClsPub.isStrNull(DS.Tables[0].Rows[0]["HRemark"]); - return true; + return false; } else - //鎵归噺鍒犻櫎鎴愬姛 { - oCn.CnClose(); - oCn.CnDispose(); - sReturn = DBUtility.ClsPub.isStrNull(DS.Tables[0].Rows[0]["HRemark"]); - return false; + //鎵归噺鍒犻櫎鏉$爜 + oCn.RunProc("Delete from Gy_BarCodeBill where HItemID in (" + sHItemID + ")", ref DBUtility.ClsPub.sExeReturnInfo); + //鍐欏叆绯荤粺鏃ュ織 + for (int i = 0; i <= NewBarCode.Length - 1; i++) + { + oCn.RunProc("Insert into System_log (GeginDate, userid, WorkstationName, WorkList, SystemName, NetuserName, State) select GETDATE(),'" + DBUtility.ClsPub.CurUserName + "','" + DBUtility.ClsPub.ComputerName + "','鎵归噺鍒犻櫎鏉$爜锛�" + NewBarCode[i] + "','WMS绯荤粺-鏉$爜妗f鍒楄〃妯″潡','" + DBUtility.ClsPub.IPAddress + "','鎵归噺鍒犻櫎'", ref DBUtility.ClsPub.sExeReturnInfo); + } + oCn.Commit(); + return true; } } } @@ -317,17 +355,95 @@ } } + //鏉$爜鐢熸垚妯″潡璋冪敤 鏉$爜鎵撳嵃鍓嶏紝鏉$爜鎵撳嵃娆℃暟鎺у埗锛堟槸鍚﹁秴杩囧厑璁稿彲鎵撳嵃娆℃暟锛� + public bool Set_CheckPrintQty_SD(Int64 HInterID, long PrintQty, ref string sReturn) + { + DataSet DS; + string sBarCode = ""; + DS = oCn.RunProcReturn("select stuff((select ','+HBarCode from Gy_BarCodeBill with(nolock) where HPrintQty >=" + PrintQty + " and HBarCodeType = '鍞竴鏉$爜' and HInterID = " + HInterID + " for xml path('')),1,1,'')", "Gy_BarCodeBill"); + if (DS == null || DS.Tables[0].Rows.Count == 0) + { + sReturn = "姝e父锛�"; + return false; + } + else + { + sBarCode = DBUtility.ClsPub.isStrNull(DS.Tables[0].Rows[0][0]); + if (sBarCode == "") + { + sReturn = "姝e父锛�"; + return false; + } + else + { + sReturn = "鏉$爜缂栧彿锛�" + DBUtility.ClsPub.isStrNull(DS.Tables[0].Rows[0][0]) + "锛屽凡鎵撳嵃" + PrintQty + " 娆★紝涓嶅厑璁稿啀娆¢瑙堟墦鍗帮紒"; + return true; + } + } + } + //鏉$爜妗f鍒楄〃妯″潡璋冪敤 鏉$爜鎵撳嵃鍓嶏紝鏉$爜鎵撳嵃娆℃暟鎺у埗锛堟槸鍚﹁秴杩囧厑璁稿彲鎵撳嵃娆℃暟锛� + public bool Set_CheckPrintQty(string sBarCodeItemID, long PrintQty, ref string sReturn) + { + DataSet DS; + string sBarCode = ""; + DS = oCn.RunProcReturn("select stuff((select ','+HBarCode from Gy_BarCodeBill with(nolock) where HPrintQty >=" + PrintQty + " and HBarCodeType = '鍞竴鏉$爜' and HItemID in (" + sBarCodeItemID + ") for xml path('')),1,1,'')", "Gy_BarCodeBill"); + if (DS == null || DS.Tables[0].Rows.Count == 0) + { + sReturn = "姝e父锛�"; + return false; + } + else + { + sBarCode = DBUtility.ClsPub.isStrNull(DS.Tables[0].Rows[0][0]); + if (sBarCode == "") + { + sReturn = "姝e父锛�"; + return false; + } + else + { + sReturn = "鏉$爜缂栧彿锛�" + DBUtility.ClsPub.isStrNull(DS.Tables[0].Rows[0][0]) + "锛屽凡鎵撳嵃" + PrintQty + " 娆★紝涓嶅厑璁稿啀娆¢瑙堟墦鍗帮紒"; + return true; + } + } + } + //鏉$爜鐢熸垚妯″潡璋冪敤 鏉$爜鎵撳嵃鍚庯紝鏇存柊鏉$爜鎵撳嵃娆℃暟 + public bool Set_UpdatePrintQty_SD(Int64 HInterID) + { + try + { + oCn.BeginTran(); + //鏇存柊 鏉$爜鎵撳嵃娆℃暟 + oCn.RunProc("update Gy_BarCodeBill set HPrintQty=isnull(HPrintQty,0)+1 where HInterID = " + HInterID, ref DBUtility.ClsPub.sExeReturnInfo); + oCn.Commit(); + return true; + } + catch (Exception e) + { + oCn.RollBack(); + throw (e); + } + } - - - - - - - - + //鏉$爜妗f鍒楄〃妯″潡璋冪敤 鏉$爜鎵撳嵃鍚庯紝鏇存柊鏉$爜鎵撳嵃娆℃暟 + public bool Set_UpdatePrintQty(string sBarCodeItemID) + { + try + { + oCn.BeginTran(); + //鏇存柊 鏉$爜鎵撳嵃娆℃暟 + oCn.RunProc("update Gy_BarCodeBill set HPrintQty=isnull(HPrintQty,0)+1 where HItemID in (" + sBarCodeItemID + ")", ref DBUtility.ClsPub.sExeReturnInfo); + oCn.Commit(); + return true; + } + catch (Exception e) + { + oCn.RollBack(); + throw (e); + } + } -- Gitblit v1.9.1