From a86725b3de175e4d90ec95d217c6fd6b27fdd2ff Mon Sep 17 00:00:00 2001 From: cwjbxqmz <1134865194@qq.com> Date: 星期五, 02 二月 2024 10:14:31 +0800 Subject: [PATCH] 1 --- WebAPI/DLL/ClsSc_ICMOReportBill.cs | 84 +++++++++++++++++++++++++++++++++++++---- 1 files changed, 75 insertions(+), 9 deletions(-) diff --git a/WebAPI/DLL/ClsSc_ICMOReportBill.cs b/WebAPI/DLL/ClsSc_ICMOReportBill.cs index 5029aa8..0221832 100644 --- a/WebAPI/DLL/ClsSc_ICMOReportBill.cs +++ b/WebAPI/DLL/ClsSc_ICMOReportBill.cs @@ -408,7 +408,7 @@ } //瀹℃牳 - public bool CheckBill(Int64 lngBillKey, ref string sReturn) + public bool CheckBill(Int64 lngBillKey,string HBillNo, string procName, string sUser, ref string sReturn) { try @@ -419,8 +419,10 @@ oCn.RunProc(" Update " + MvarItemKey + " set HBillStatus='2',HChecker='" + HChecker + "',HCheckDate='" + HCheckDate + "' Where HInterID=" + lngBillKey.ToString()); DataSet ds,Ds; + string sql = ""; + ds = oCn.RunProcReturn("select * from Sc_ICMOReportBillMain where HInterID = " + lngBillKey, "Sc_ICMOReportBillMain"); - string HBillNo = ""; + HBillNo = ""; if (ds.Tables[0].Rows.Count > 0) { @@ -444,6 +446,8 @@ model.Add("FBillNo", HBillNo); JArray Fentity = new JArray(); + string sErrMsg = ""; + string sJXCode = ""; foreach (DataRow item in Ds.Tables[1].Rows) { JObject FentityModel = new JObject(); @@ -491,8 +495,13 @@ FentityModel.Add("FBASEFINISHQTY", item["FBASEFINISHQTY"].ToString());//鍩烘湰鍗曚綅瀹屾垚鏁伴噺 FentityModel.Add("FFINISHQTY", item["FFINISHQTY"].ToString());//瀹屾垚鏁伴噺 FentityModel.Add("FLot", new JObject() { ["FNumber"] = item["FLot"].ToString() });//鎵瑰彿 - FentityModel.Add("FShiftGroupId", new JObject() { ["FNumber"] = item["FShiftGroupId"].ToString() });//鐝粍 - FentityModel.Add("F_UUBK_CZG1", new JObject() { ["FSTAFFNUMBER"] = item["F_UUBK_CZG1"].ToString() });// 鎿嶄綔鍛� + // + if (oSystemParameter.omodel.WMS_CampanyName == "涔濊彵") //绯荤粺鍙傛暟 瀹㈡埛瀹氬埗鍖栧悕绉� 绌虹櫧涓洪�氱敤 + { + FentityModel.Add("FShiftGroupId", new JObject() { ["FNumber"] = item["FShiftGroupId"].ToString() });//鐝粍 + FentityModel.Add("F_UUBK_CZG1", new JObject() { ["FSTAFFNUMBER"] = item["F_UUBK_CZG1"].ToString() });// 鎿嶄綔鍛� + } + FentityModel.Add("FBOMID", new JObject() { ["FNumber"] = item["FBOMID"].ToString() });// BOM鐗堟湰 //sJson_BatchNo + @@ -509,7 +518,7 @@ FentityModel2.Add("FEntity_Link_FSId", item["FEntity_Link_FSId"].ToString()); Fentity2.Add(FentityModel2); FentityModel.Add("FEntity_Link", Fentity2); - FentityModel.Add("FBFLowId", new JObject() { ["FID"] = item["FBFLOWID"].ToString() }); // + FentityModel.Add("FBFLowId", new JObject() { ["FID"] = item["FBFLOWID"].ToString() }); Fentity.Add(FentityModel); } model.Add("FEntity", Fentity); //鏄庣粏淇℃伅 @@ -587,6 +596,25 @@ } sReturn = "瀹℃牳鍗曟嵁鎴愬姛锛�"; + + + //瀹℃牳鍚庢帶鍒�===============================================Begin================================================================ + sql = "exec " + procName + " " + lngBillKey + ",'" + HBillNo + "','" + sUser + "'"; + ds = oCn.RunProcReturn(sql, procName); + if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) + { + sReturn = "瀹℃牳杩囩▼涓嚭閿欙紝璇蜂笌缃戠粶绠$悊浜哄憳鑱旂郴"; + oCn.RollBack(); + return false; + } + if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0") + { + sReturn = ds.Tables[0].Rows[0]["HRemark"].ToString(); + oCn.RollBack(); + return false; + } + //瀹℃牳鍚庢帶鍒�===============================================End================================================================ + oCn.Commit(); sReturn = ""; @@ -601,9 +629,10 @@ } //鍙嶅鏍� - public bool AbandonCheck(Int64 lngBillKey, ref string sReturn) + public bool AbandonCheck(Int64 lngBillKey, string HBillNo, string procName, string sUser, ref string sReturn) { - + string sql = ""; + DataSet ds; try { string HChecker = DBUtility.ClsPub.CurUserName; @@ -612,6 +641,25 @@ //杩樺師鍗曟嵁鐘舵�佷负鏈鏍哥姸鎬� oCn.RunProc(" Update " + MvarItemKey + " set HBillStatus='1',HChecker='',HCheckDate='' Where HInterID=" + lngBillKey.ToString()); sReturn = "鍙嶅鏍稿崟鎹垚鍔燂紒"; + + //瀹℃牳鍚庢帶鍒�===============================================Begin================================================================ + sql = "exec " + procName + " " + lngBillKey + ",'" + HBillNo + "','" + sUser + "'"; + ds = oCn.RunProcReturn(sql, procName); + if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) + { + sReturn = "鍙嶅鏍歌繃绋嬩腑鍑洪敊锛岃涓庣綉缁滅鐞嗕汉鍛樿仈绯�"; + oCn.RollBack(); + return false; + } + if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0") + { + sReturn = ds.Tables[0].Rows[0]["HRemark"].ToString(); + oCn.RollBack(); + return false; + } + //瀹℃牳鍚庢帶鍒�===============================================End================================================================ + + oCn.Commit(); sReturn = ""; return true; @@ -624,14 +672,14 @@ } //鍒犻櫎鍗曟嵁 - public virtual bool DeleteBill(Int64 lngBillKey, ref string sReturn) + public virtual bool DeleteBill(Int64 lngBillKey, string HBillNo, string procName, string user, ref string sReturn) { try { oCn.BeginTran(); //鏌ヨ鐢熶骇姹囨姤鍗曡〃鏁伴噺 DataSet ds = oCn.RunProcReturn("select a.HBillNo,b.HICMOInterID,b.HICMOEntryID from Sc_ICMOReportBillMain a inner join Sc_ICMOReportBillSub b on a.HInterID = b.HInterID where a.HInterID = '" + lngBillKey + "'", "Sc_ICMOReportBillMain"); - string HBillNo = ds.Tables[0].Rows[0]["HBillNo"].ToString(); + HBillNo = ds.Tables[0].Rows[0]["HBillNo"].ToString(); string HICMOInterID = ds.Tables[0].Rows[0]["HICMOInterID"].ToString(); string HICMOEntryID = ds.Tables[0].Rows[0]["HICMOEntryID"].ToString(); // @@ -658,6 +706,24 @@ //鍒犻櫎涓昏〃 DeleteBillMain(lngBillKey); + //鍒犻櫎鍚庢帶鍒�================================================================================== + string sql2 = "exec " + procName + " " + lngBillKey + ",'" + HBillNo + "','" + user + "'"; + ds = oCn.RunProcReturn(sql2, procName); + if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) + { + + sReturn = "鍒犻櫎澶辫触!鍘熷洜:鍒犻櫎鍚庡垽鏂け璐ワ紝璇蜂笌缃戠粶绠$悊浜哄憳鑱旂郴"; + oCn.RollBack(); + return false; + } + if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0") + { + sReturn = "鍒犻櫎澶辫触!鍘熷洜:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); + oCn.RollBack(); + return false; + } + //============================================================================================== + sReturn = "鍒犻櫎鍗曟嵁鎴愬姛锛�"; oCn.Commit(); return true; -- Gitblit v1.9.1