From a6c49705949fa3ef4d6ebe50b9b02a3e34a2d351 Mon Sep 17 00:00:00 2001
From: yangle <admin@YINMOU>
Date: 星期三, 31 一月 2024 15:49:45 +0800
Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API

---
 WebAPI/DLL/ClsSc_ICMOReportBill.cs |   62 +++++++++++++++++++++++++++---
 1 files changed, 55 insertions(+), 7 deletions(-)

diff --git a/WebAPI/DLL/ClsSc_ICMOReportBill.cs b/WebAPI/DLL/ClsSc_ICMOReportBill.cs
index 5029aa8..a5269ab 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;

--
Gitblit v1.9.1