From 0cdff49898d0e98556501de01d02a446501e2901 Mon Sep 17 00:00:00 2001 From: ch <37327@LLOOCCY> Date: 星期一, 07 二月 2022 23:19:20 +0800 Subject: [PATCH] 生产领料刷新方法 --- WebAPI/DLL/ClsSc_MESReturnStepWorkBill.cs | 68 +++++++++++++++++++++++++++------ 1 files changed, 55 insertions(+), 13 deletions(-) diff --git a/WebAPI/DLL/ClsSc_MESReturnStepWorkBill.cs b/WebAPI/DLL/ClsSc_MESReturnStepWorkBill.cs index fb0bd06..30b00f1 100644 --- a/WebAPI/DLL/ClsSc_MESReturnStepWorkBill.cs +++ b/WebAPI/DLL/ClsSc_MESReturnStepWorkBill.cs @@ -91,19 +91,19 @@ try { //鑾峰彇褰撳墠宸ュ簭宸ュ簭鍙蜂互鍙婂垽鏂槸鍚︽湯閬撳伐搴� - string sql = string.Format(@"select max(b.HProcNo) HProcNo from Sc_ProcessPlanMain a - inner join Sc_ProcessPlanSub b on a.HInterID=b.HInterID - where b.HSourceBillNo='" + omodel.HSourceBillNo+"' and b.HSourceInterID='"+omodel.HSourceInterID+"' and b.HSourceEntryID='"+omodel.HSourceEntryID+"'"); - DataSet ds= oCn.RunProcReturn(sql, "Sc_ProcessPlanMain"); + //string sql = string.Format(@"select max(b.HProcNo) HProcNo from Sc_ProcessPlanMain a + // inner join Sc_ProcessPlanSub b on a.HInterID=b.HInterID + // where b.HSourceBillNo='" + omodel.HSourceBillNo+"' and b.HSourceInterID='"+omodel.HSourceInterID+"' and b.HSourceEntryID='"+omodel.HSourceEntryID+"'"); + //DataSet ds= oCn.RunProcReturn(sql, "Sc_ProcessPlanMain"); //鏌ヨ鏈�澶у伐搴忓強鍒ゆ柇褰撳墠宸ュ簭鏄惁灏忎簬鏈�澶у伐搴� - if (ds.Tables[0].Rows.Count > 0 && int.Parse(ds.Tables[0].Rows[0]["HProcNo"].ToString()) > omodel.HProcID) - { - omodel.HProcNo = omodel.HProcNo + 5; - } - else - { - omodel.HProcNo = omodel.HProcNo + 5; //鏈亾宸ュ簭搴忓彿鍔�5 - } + //if (ds.Tables[0].Rows.Count > 0 && int.Parse(ds.Tables[0].Rows[0]["HProcNo"].ToString()) > omodel.HProcID) + //{ + // omodel.HProcNo = omodel.HProcNo + 5; + //} + //else + //{ + // omodel.HProcNo = omodel.HProcNo + 5; //鏈亾宸ュ簭搴忓彿鍔�5 + //} //寰楀埌mainid omodel.HInterID = DBUtility.ClsPub.CreateBillID(BillType, ref DBUtility.ClsPub.sExeReturnInfo); @@ -144,7 +144,7 @@ "from Sc_ICMOBillStatus_Tmp where HSourceBillNo='"+omodel.HSourceBillNo.ToString()+"'" + " and HSourceInterID='"+omodel.HSourceInterID+"' and HSourceEntryID='"+omodel.HMainSourceEntryID.ToString()+"'" + " and HSourceID='"+omodel.HSourceID.ToString()+"' and HProcID='"+omodel.HProcID.ToString()+"'"); - oCn.RunProc(sql); + oCn.RunProc(sql1); sReturn = "鏂板鍗曟嵁鎴愬姛锛�"; oCn.Commit(); return true; @@ -156,5 +156,47 @@ throw (e); } } + + //瀹℃牳 + public bool CheckBill(Int64 lngBillKey, ref string sReturn) + { + try + { + string HChecker = DBUtility.ClsPub.CurUserName; + string HCheckDate = DBUtility.ClsPub.GetServerDate(-1); + //鏇存柊宸ュ簭璁″垝鍗曞鏍镐汉銆佸鏍告椂闂� + oCn.RunProc(" Update " + MvarItemKey + " set HChecker='" + HChecker + "',HCheckDate='" + HCheckDate + "' Where HInterID=" + lngBillKey.ToString()); + //鏇存柊(宸ュ簭姹囨姤鍗曘�佺敓浜х姸鎬佷复鏃惰〃)涓嶈壇鏁伴噺=涓嶈壇鏁伴噺-杩斿伐鏁伴噺 + sReturn = ""; + return true; + } + catch (Exception e) + { + sReturn = e.Message; + throw (e); + } + } + + //鍙嶅鏍� + public bool AbandonCheck(Int64 lngBillKey, ref string sReturn) + { + + if (isUse(lngBillKey, ref sReturn)) + { + return false; + } + try + { + oCn.RunProc(" Update " + MvarItemKey + " set HChecker='',HCheckDate=null Where HInterID=" + lngBillKey.ToString()); + //鏇存柊(宸ュ簭姹囨姤鍗曘�佺敓浜х姸鎬佷复鏃惰〃)涓嶈壇鏁伴噺=涓嶈壇鏁伴噺-杩斿伐鏁伴噺 + sReturn = ""; + return true; + } + catch (Exception e) + { + sReturn = e.Message; + throw (e); + } + } } } \ No newline at end of file -- Gitblit v1.9.1