From 355dec078e44db52fc6c6371debbe44898e6f1f1 Mon Sep 17 00:00:00 2001
From: zrg <z18737863051@163.com>
Date: 星期四, 07 三月 2024 11:22:42 +0800
Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API

---
 WebAPI/DLL/ClsSc_ICMOReportBill.cs |   32 +++++++++++++++++++++++++++++---
 1 files changed, 29 insertions(+), 3 deletions(-)

diff --git a/WebAPI/DLL/ClsSc_ICMOReportBill.cs b/WebAPI/DLL/ClsSc_ICMOReportBill.cs
index 7c28d1a..35ebae6 100644
--- a/WebAPI/DLL/ClsSc_ICMOReportBill.cs
+++ b/WebAPI/DLL/ClsSc_ICMOReportBill.cs
@@ -261,7 +261,7 @@
 
                     //鍙嶅啓浜ч噺姹囨姤鍗曪紝璐ㄩ噺姹囨姤鍗曞叧鑱斿瓧娈�,鐢熶骇璁㈠崟鍏宠仈鏁伴噺
                     ds = oCn.RunProcReturn("exec h_p_Sc_ICMOReportBill_ReverseWriteQty " + omodel.HInterID + "," + oSub.HEntryID + ",'" + omodel.HBillNo + "'," +
-                        DetailColl[0].HICMOInterID + "," + DetailColl[0].HICMOEntryID + "," + DetailColl[0].HICMOBillNo + ",'" + DetailColl[0].HSourceID + "','" +
+                        DetailColl[0].HICMOInterID + "," + DetailColl[0].HICMOEntryID + ",'" + DetailColl[0].HICMOBillNo + "','" + DetailColl[0].HSourceID + "','" +
                         "Add" + "'," + 0
                         , "h_p_Sc_ICMOReportBill_ReverseWriteQty");
                     if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) == "1")
@@ -446,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();
@@ -493,8 +495,14 @@
                         FentityModel.Add("FBASEFINISHQTY", item["FBASEFINISHQTY"].ToString());//鍩烘湰鍗曚綅瀹屾垚鏁伴噺
                         FentityModel.Add("FFINISHQTY", item["FFINISHQTY"].ToString());//瀹屾垚鏁伴噺
                         FentityModel.Add("FLot", new JObject() { ["FNumber"] = item["FLot"].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 +
@@ -665,14 +673,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();
                 //
@@ -699,6 +707,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