From 7a72361cf3b374329ac8cf7b3c75d6308b124111 Mon Sep 17 00:00:00 2001
From: yusijie <ysj@hz-kingdee.com>
Date: 星期二, 02 一月 2024 13:49:41 +0800
Subject: [PATCH] 生成条码时新增写入字段,列表改为动态列;退货单列表;同步送货单时新增字段,夏宝得先在金蝶删除收料通知单才能在供应商平台删除送货单

---
 WebAPI/Controllers/POInStockBackController.cs |   63 +++++++++++++++
 WebAPI/DLL/DAL.dll                            |    0 
 WebAPI/Controllers/POInStockController.cs     |  113 ++++++++++++++++++---------
 WebAPI/DLL/Model.dll                          |    0 
 WebAPI/Controllers/BarCodeController.cs       |   40 ++++++++--
 5 files changed, 170 insertions(+), 46 deletions(-)

diff --git a/WebAPI/Controllers/BarCodeController.cs b/WebAPI/Controllers/BarCodeController.cs
index ae04a00..fe0ca61 100644
--- a/WebAPI/Controllers/BarCodeController.cs
+++ b/WebAPI/Controllers/BarCodeController.cs
@@ -1,4 +1,5 @@
 锘縰sing DBUtility;
+using Newtonsoft.Json;
 using Newtonsoft.Json.Linq;
 using SQLHelper;
 using System;
@@ -630,6 +631,7 @@
                             bar.HMTONO = oItemSub.HMTONO;
                             bar.HSupBatchNo = oItemSub.HSupBatchNo;
                             bar.HSupMaterNumber = oItemSub.HSupMaterNumber;
+                            bar.HISKFPERIOD = oItemSub.HISKFPERIOD;
                             ls2.Add(bar);
                         }
                     }
@@ -712,6 +714,7 @@
                             bar2.HMTONO = oItemSub2.HMTONO;
                             bar2.HSupBatchNo = DBUtility.ClsPub.isStrNull(oItemSub2.HSupBatchNo);
                             bar2.HSupMaterNumber = DBUtility.ClsPub.isStrNull(oItemSub2.HSupMaterNumber);
+                            bar2.HISKFPERIOD = DBUtility.ClsPub.isInt(oItemSub2.HISKFPERIOD);
                             ls3.Add(bar2);
                             //LogService.Write("娴嬭瘯鍔�+++" + oItemSub2.HSupID);
                         }
@@ -738,6 +741,7 @@
                 string HMTONO = "";
                 string HSupBatchNo = "";
                 string HSupMaterNumber = "";
+                Int64 HISKFPERIOD = 0;
                 oCn.BeginTran();
                 foreach (Model.ClsGy_MaterialList_WMS_Model oItemSub in ls)
                 {
@@ -768,6 +772,8 @@
                         HWei = ClsPub.isStrNull(oItemSub.HEndQty);
                         HSupBatchNo = ClsPub.isStrNull(oItemSub.HSupBatchNo);
                         HSupMaterNumber = ClsPub.isStrNull(oItemSub.HSupMaterNumber);
+                        HISKFPERIOD = DBUtility.ClsPub.isInt(oItemSub.HISKFPERIOD);
+
                         if (FCusName.Contains("澶忓疂"))
                         {
                             HBarCode = $"{oItemSub.HMaterID}";
@@ -775,11 +781,11 @@
                         }
                         string sql = "insert into Gy_BarCodeBill (HInterID,HBarCode,HBarCodeType,HMaterID,HUnitID,HQty,HKFDate,HKFPeriod,HKFDQDate" +
                                     ",HBatchNo,HSupID,HGroupID,HMaker,HMakeDate,HPrintQty,HEndQty,HSupflag" +
-                                    ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HMTONO,HSupBatchNo,HSupMaterNumber " +
+                                    ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HMTONO,HSupBatchNo,HSupMaterNumber,HProduceDate,HExpiryDate,HISKFPERIOD " +
                                     ") values ("
                                     + linterid.ToString() + ",'" + HBarCode + "','" + HBarCodeType + "'," + HMaterID + "," + HUnitID + "," + HQty2 + ",'" + HKFDate + "'," + HKFPeriod + ",'" + HKFDQDate
                                     + "','" + HBatchNo + "'," + HSupID + "," + HGroupID + ",'" + ClsPub.CurUserName + "','" + DateTime.Today + "'," + HPrintQty + ",'" + HWei + "',1"
-                                    + "," + HSourceInterID + "," + HSourceEntryID + ",'" + HSourceBillNo + "','" + HSourceBillType + "','" + HMTONO + "','" + HSupBatchNo+ "','" + HSupMaterNumber + "'" +
+                                    + "," + HSourceInterID + "," + HSourceEntryID + ",'" + HSourceBillNo + "','" + HSourceBillType + "','" + HMTONO + "','" + HSupBatchNo+ "','" + HSupMaterNumber + "','" + HKFDate + "','" + HKFDQDate + "'," + HISKFPERIOD +
                                     ")";
                         oCn.RunProc(sql);
                         //LogService.Write(sql);
@@ -811,6 +817,7 @@
                         HWei = ClsPub.isStrNull(oItemSub.HEndQty);
                         HSupBatchNo = ClsPub.isStrNull(oItemSub.HSupBatchNo);
                         HSupMaterNumber = ClsPub.isStrNull(oItemSub.HSupMaterNumber);
+                        HISKFPERIOD = ClsPub.isInt(oItemSub.HISKFPERIOD);
                         if (FCusName.Contains("澶忓疂"))
                         {
                             HBarCode = $"{oItemSub.HMaterID}";
@@ -818,12 +825,12 @@
                         }
                         string sql = "insert into Gy_BarCodeBill (HInterID,HBarCode,HBarCodeType,HMaterID,HUnitID,HQty,HKFDate,HKFPeriod,HKFDQDate" +
                                     ",HBatchNo,HSupID,HGroupID,HMaker,HMakeDate,HPrintQty,HEndQty,HSupflag" +
-                                    ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HMTONO ,HSupBatchNo,HSupMaterNumber" +
+                                    ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HMTONO ,HSupBatchNo,HSupMaterNumber,HProduceDate,HExpiryDate,HISKFPERIOD" +
                                     ") values ("
                                     + linterid.ToString() + ",'" + HBarCode + "','" + HBarCodeType + "'," + HMaterID + "," + HUnitID + "," + HQty2 + ",'" + HKFDate + "'," + HKFPeriod + ",'" + HKFDQDate
                                     + "','" + HBatchNo + "'," + HSupID + "," + HGroupID + ",'" + ClsPub.CurUserName + "','" + DateTime.Today + "'," + HPrintQty + ",'" + HWei + "',1"
                                     + "," + HSourceInterID + "," + HSourceEntryID + ",'" + HSourceBillNo + "','" + HSourceBillType + "','" + HMTONO +  "','" +
-                                    HSupBatchNo + "','" + HSupMaterNumber + "'" + ")";
+                                    HSupBatchNo + "','" + HSupMaterNumber + "','" + HKFDate + "','" + HKFDQDate + "'," + HISKFPERIOD + ")";
                         oCn.RunProc(sql);
                         //LogService.Write(sql);
                     }
@@ -1362,6 +1369,8 @@
         public object GetBarCodeShowList([FromBody] JObject msg)
         {
             string HSupNo = msg["HSupNo"].ToString(); string sqlWhere = msg["sqlWhere"].ToString();
+            //娣诲姞鍒楀悕
+            List<object> columnNameList = new List<object>();           
             try
             {
                 string VsWhere = "";
@@ -1392,10 +1401,18 @@
                 }
                 else
                 {
+                    foreach (DataColumn col in ds.Tables[0].Columns)
+                    {
+                        Type dataType = col.DataType;
+                        string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
+                        columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕
+                    }
+
                     objjson.code = "0";
                     objjson.count = 10000;
                     objjson.Message = "鑾峰彇鎴愬姛";
                     objjson.data = ds.Tables[0];
+                    objjson.list = columnNameList;
                     return objjson;
                 }
             }
@@ -1704,6 +1721,7 @@
                             bar.HSupID = oItemSub.HSupID;
                             bar.HEndQty = WeiShu;
                             bar.HMTONO = oItemSub.HMTONO;
+                            bar.HISKFPERIOD = oItemSub.HISKFPERIOD;
                             ls2.Add(bar);
                         }
                     }
@@ -1785,6 +1803,7 @@
                             bar2.HSupID = oItemSub2.HSupID;
                             bar2.HEndQty = WeiShu1;
                             bar2.HMTONO = oItemSub2.HMTONO;
+                            bar2.HISKFPERIOD = oItemSub2.HISKFPERIOD;
                             ls3.Add(bar2);
                         }
                     }
@@ -1807,6 +1826,7 @@
                 string HKFDQDate = "";
                 string HWei = "";
                 string HMTONO = "";
+                Int64 HISKFPERIOD = 0;
                 oCn.BeginTran();
                 foreach (Model.ClsGy_MaterialList_WMS_Model oItemSub in ls)
                 {
@@ -1838,6 +1858,7 @@
                             HSourceEntryID = ClsPub.isLong(oItemSub.HSourceEntryID);
                             HSourceBillNo = ClsPub.isStrNull(oItemSub.HSourceBillNo);
                             HSourceBillType = ClsPub.isStrNull(oItemSub.HSourceBillType);
+                            HISKFPERIOD = ClsPub.isInt(oItemSub.HISKFPERIOD);
                             HWei = ClsPub.isStrNull(oItemSub.HEndQty);
                             if (FCusName.Contains("澶忓疂"))
                             {
@@ -1846,11 +1867,12 @@
                             }
                             string sql = "insert into Gy_BarCodeBill (HInterID,HBarCode,HBarCodeType,HMaterID,HUnitID,HQty,HKFDate,HKFPeriod,HKFDQDate" +
                                         ",HBatchNo,HBarcodeQtys,HBarcodeNo,HSupID,HGroupID,HMaker,HMakeDate,HPrintQty,HEndQty,HSupflag" +
-                                        ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HMTONO " +
+                                        ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HMTONO,HProduceDate,HExpiryDate,HISKFPERIOD" +
                                         ") values ("
                                         + linterid.ToString() + ",'" + HBarCode + "','" + HBarCodeType + "'," + HMaterID + "," + HUnitID + "," + HQty2 + ",'" + HKFDate + "'," + HKFPeriod + ",'" + HKFDQDate
                                         + "','" + HBatchNo + "','" + SubModel.Count + "','" + count + "'," + HSupID + "," + HGroupID + ",'" + ClsPub.CurUserName + "','" + DateTime.Today + "'," + HPrintQty + ",'" + HWei + "',1"
-                                        + "," + HSourceInterID + "," + HSourceEntryID + ",'" + HSourceBillNo + "','" + HSourceBillType + "','" + HMTONO + "')";
+                                        + "," + HSourceInterID + "," + HSourceEntryID + ",'" + HSourceBillNo + "','" + HSourceBillType + "','" + HMTONO + "','"
+                                        + HKFDate + "','" + HKFDQDate + "'," + HISKFPERIOD + ")";
                             oCn.RunProc(sql);
                             oCn.RunProc("exec setLSH '" + DateTime.Today + "'");
                             count++;
@@ -1883,6 +1905,7 @@
                             HSourceBillNo = ClsPub.isStrNull(oItemSub.HSourceBillNo);
                             HSourceBillType = ClsPub.isStrNull(oItemSub.HSourceBillType);
                             HWei = ClsPub.isStrNull(oItemSub.HEndQty);
+                            HISKFPERIOD = ClsPub.isInt(oItemSub.HISKFPERIOD);
                             if (FCusName.Contains("澶忓疂"))
                             {
                                 HBarCode = $"{oItemSub.HMaterID}";
@@ -1890,11 +1913,12 @@
                             }
                             string sql = "insert into Gy_BarCodeBill (HInterID,HBarCode,HBarCodeType,HMaterID,HUnitID,HQty,HKFDate,HKFPeriod,HKFDQDate" +
                                       ",HBatchNo,HBarcodeQtys,HBarcodeNo,HSupID,HGroupID,HMaker,HMakeDate,HPrintQty,HEndQty,HSupflag" +
-                                      ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HMTONO " +
+                                      ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HMTONO,HProduceDate,HExpiryDate,HISKFPERIOD" +
                                       ") values ("
                                       + linterid.ToString() + ",'" + HBarCode + "','" + HBarCodeType + "'," + HMaterID + "," + HUnitID + "," + HQty2 + ",'" + HKFDate + "'," + HKFPeriod + ",'" + HKFDQDate
                                       + "','" + HBatchNo + "','" + SubModel.Count + "','" + _count + "'," + HSupID + "," + HGroupID + ",'" + ClsPub.CurUserName + "','" + DateTime.Today + "'," + HPrintQty + ",'" + HWei + "',1"
-                                      + "," + HSourceInterID + "," + HSourceEntryID + ",'" + HSourceBillNo + "','" + HSourceBillType + "','" + HMTONO + "')";
+                                      + "," + HSourceInterID + "," + HSourceEntryID + ",'" + HSourceBillNo + "','" + HSourceBillType + "','" + HMTONO + "','" 
+                                      + HKFDate + "','" + HKFDQDate + "'," + HISKFPERIOD + ")";
                             oCn.RunProc(sql);
                             _count++;
                         }
diff --git a/WebAPI/Controllers/POInStockBackController.cs b/WebAPI/Controllers/POInStockBackController.cs
index 0cf3753..8f3a9c2 100644
--- a/WebAPI/Controllers/POInStockBackController.cs
+++ b/WebAPI/Controllers/POInStockBackController.cs
@@ -1,4 +1,5 @@
 锘縰sing DBUtility;
+using Newtonsoft.Json;
 using Newtonsoft.Json.Linq;
 using SQLHelper;
 using System;
@@ -74,5 +75,67 @@
                 return objjson;
             }
         }
+
+
+        /// <summary>
+        /// 閫�璐у崟鍔ㄦ�佸垪琛�
+        /// </summary>
+        /// <param name="msg"></param>
+        /// <param name="NowPage"></param>
+        /// <param name="OnePage"></param>
+        /// <returns></returns>
+        [Route("GetPOInStockBackBill")]
+        [HttpPost]
+        //閫�璐у崟鍔ㄦ�佸垪琛�
+        public object GetPOInStockBackBill([FromBody] JObject msg)
+        {
+            string HSupNo = msg["HSupNo"].ToString(); string sqlWhere = msg["sqlWhere"].ToString();
+            //string msg = "";
+            try
+            {
+                string VsWhere = "";
+                string PcWhere = "";
+                SQLHelper.ClsCNSRM oCn = new SQLHelper.ClsCNSRM();
+                DataSet ds;
+                string sql = " Where hsupid in (select HSupID from h_v_Gy_UserSupplierList where 鐢ㄦ埛 = ^^" + HSupNo.Trim() + "^^) " + sqlWhere;
+                //杞崲鐗规畩瀛楃
+                if (Common.SQLtoChange(sql, ref VsWhere, ref PcWhere) == false)
+                {
+                    objjson.code = "0";
+                    objjson.count = 0;
+                    objjson.Message = "杞崲鐗规畩瀛楃澶辫触";
+                    objjson.data = null;
+                    return objjson;
+                }
+
+                string sql2 = "select * from h_v_SRM_POInStockBackByK3List " + VsWhere;
+
+                ds = oCn.RunProcReturn(sql2, "h_v_SRM_POInStockBackByK3List");
+                //娣诲姞鍒楀悕
+                List<object> columnNameList = new List<object>();
+                foreach (DataColumn col in ds.Tables[0].Columns)
+                {
+                    Type dataType = col.DataType;
+                    string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
+                    columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕
+                }
+                objjson.code = "0";
+                objjson.count = 10000;
+                objjson.Message = "鑾峰彇鎴愬姛";
+                objjson.data = ds.Tables[0];
+                objjson.list = columnNameList;
+                return objjson;
+
+            }
+            catch (Exception e)
+            {
+                objjson.code = "0";
+                objjson.count = 0;
+                objjson.Message = "鑾峰彇澶辫触" + e.ToString();
+                objjson.data = null;
+                return objjson;
+            }
+
+        }
     }
 }
\ No newline at end of file
diff --git a/WebAPI/Controllers/POInStockController.cs b/WebAPI/Controllers/POInStockController.cs
index 7e0292c..cc585db 100644
--- a/WebAPI/Controllers/POInStockController.cs
+++ b/WebAPI/Controllers/POInStockController.cs
@@ -359,41 +359,41 @@
                 int i = 0;
                 foreach (Model.ClsCg_POInStockBillSub oItemSub in ls)
                 {
-                    if (FCusName.Contains("鍑礉濂堢壒")) //绯荤粺鍙傛暟  瀹㈡埛瀹氬埗鍖栧悕绉�     绌虹櫧涓洪�氱敤
-                    {
-                        if (oItemSub.HBatChNo.Length != 8 || Regex.IsMatch(oItemSub.HBatChNo, @"^[0-9]+$") == false)
-                        {
-                            objJsonResult.code = "0";
-                            objJsonResult.count = 0;
-                            objJsonResult.Message = "淇濆瓨澶辫触锛佺" + i.ToString() + "琛� 鐢熶骇鏃ユ湡D/C 鏍煎紡閿欒鏃犳硶淇濆瓨锛佹纭牸寮忎负8浣嶆暟鐨勭函鏁板瓧鏃ユ湡";
-                            objJsonResult.data = 1;
-                            return objJsonResult;
-                        }
-                       
-                        //鑾峰彇骞存湀鏃�
-                        string year = oItemSub.HBatChNo.Substring(0, 4);
-                        string month = oItemSub.HBatChNo.Substring(4, 2);
-                        string day = oItemSub.HBatChNo.Substring(6, 2);
+                    //if (FCusName.Contains("鍑礉濂堢壒")) //绯荤粺鍙傛暟  瀹㈡埛瀹氬埗鍖栧悕绉�     绌虹櫧涓洪�氱敤
+                    //{
+                    //    if (oItemSub.HBatChNo.Length != 8 || Regex.IsMatch(oItemSub.HBatChNo, @"^[0-9]+$") == false)
+                    //    {
+                    //        objJsonResult.code = "0";
+                    //        objJsonResult.count = 0;
+                    //        objJsonResult.Message = "淇濆瓨澶辫触锛佺" + i.ToString() + "琛� 鐢熶骇鏃ユ湡D/C 鏍煎紡閿欒鏃犳硶淇濆瓨锛佹纭牸寮忎负8浣嶆暟鐨勭函鏁板瓧鏃ユ湡";
+                    //        objJsonResult.data = 1;
+                    //        return objJsonResult;
+                    //    }
 
-                        //楠岃瘉鍚堟硶鎬�
-                        if (Convert.ToInt32(year) < 1900 || Convert.ToInt32(year) > 2100)
-                        {
-                            objJsonResult.code = "0";
-                            objJsonResult.count = 0;
-                            objJsonResult.Message = "淇濆瓨澶辫触锛佺" + i.ToString() + "琛� 鐢熶骇鏃ユ湡D/C 鏃ユ湡涓嶅悎娉曟棤娉曚繚瀛橈紒姝g‘鏍煎紡涓�8浣嶆暟鐨勭函鏁板瓧鏃ユ湡";
-                            objJsonResult.data = 1;
-                            return objJsonResult;
-                        }
-                        if (Convert.ToInt32(month) > 12 || Convert.ToInt32(day) > 31)
-                        {
-                            objJsonResult.code = "0";
-                            objJsonResult.count = 0;
-                            objJsonResult.Message = "淇濆瓨澶辫触锛佺" + i.ToString() + "琛� 鐢熶骇鏃ユ湡D/C 鏃ユ湡涓嶅悎娉曟棤娉曚繚瀛橈紒";
-                            objJsonResult.data = 1;
-                            return objJsonResult;
-                        }
+                    //    //鑾峰彇骞存湀鏃�
+                    //    string year = oItemSub.HBatChNo.Substring(0, 4);
+                    //    string month = oItemSub.HBatChNo.Substring(4, 2);
+                    //    string day = oItemSub.HBatChNo.Substring(6, 2);
 
-                }
+                    //    //楠岃瘉鍚堟硶鎬�
+                    //    if (Convert.ToInt32(year) < 1900 || Convert.ToInt32(year) > 2100)
+                    //    {
+                    //        objJsonResult.code = "0";
+                    //        objJsonResult.count = 0;
+                    //        objJsonResult.Message = "淇濆瓨澶辫触锛佺" + i.ToString() + "琛� 鐢熶骇鏃ユ湡D/C 鏃ユ湡涓嶅悎娉曟棤娉曚繚瀛橈紒姝g‘鏍煎紡涓�8浣嶆暟鐨勭函鏁板瓧鏃ユ湡";
+                    //        objJsonResult.data = 1;
+                    //        return objJsonResult;
+                    //    }
+                    //    if (Convert.ToInt32(month) > 12 || Convert.ToInt32(day) > 31)
+                    //    {
+                    //        objJsonResult.code = "0";
+                    //        objJsonResult.count = 0;
+                    //        objJsonResult.Message = "淇濆瓨澶辫触锛佺" + i.ToString() + "琛� 鐢熶骇鏃ユ湡D/C 鏃ユ湡涓嶅悎娉曟棤娉曚繚瀛橈紒";
+                    //        objJsonResult.data = 1;
+                    //        return objJsonResult;
+                    //    }
+
+                    //}
                 //鍒ゆ柇閲囪喘璁㈠崟鐘舵�� 
                 objJsonResult = TestPOOrder(oItemSub.HPOOrderEntryID.ToString());
                     if (objJsonResult.code == "0")
@@ -828,7 +828,7 @@
 E.FPRICETIMEPOINT,E.FSETTLECURRID,EC.FNUMBER AS FSETTLECURRNUMBER,C.FMATERIALID,CM.FNUMBER AS FMATERIALNUMBER ,C.FUNITID 
 ,CU.FNUMBER AS FUNITNUMBER,CR.FPRICE,CR.FTAXPRICE,CR.FTAXRATE,D.FPURCHASERID,isnull(T4.FNUMBER,'') AS FPURCHASERNUMBER
 ,B.HExpressNumberSub,B.HExpressSupplierSub,B.HRemark,B.HPlanArrivalDate,B.HBoxNumber,B.HBatChNo,D.FBILLTYPEID 
-,isnull(VW.FNUMBER,'') AS FReceiverNUMBER
+,isnull(VW.FNUMBER,'') AS FReceiverNUMBER,isnull(B.HKFDate,'') As FProduceDate,B.HTAXPRICE_T AS F_AAAA_PRICE1
 FROM CG_POINSTOCKBILLSUB B  
 JOIN CG_POINSTOCKBILLMAIN M ON B.HINTERID = M.HINTERID
 JOIN {0}..T_PUR_POORDERENTRY C ON B.HSOURCEINTERID = C.FID AND B.HSOURCEENTRYID = C.FENTRYID
@@ -933,6 +933,8 @@
                                     FentityModel.Add("FTaxPrice", item["FTAXPRICE"].ToString());//鍚◣鍗曚环
                                     FentityModel.Add("FEntryTaxRate", item["FTAXRATE"].ToString());//绋庣巼
                                     FentityModel.Add("FLot", new JObject() { ["Fnumber"] = item["HBatChNo"].ToString() }); // 鎵瑰彿   
+                                    FentityModel.Add("FProduceDate", item["FProduceDate"].ToString());//鐢熶骇鏃ユ湡
+                                    FentityModel.Add("F_aaaa_Price1", item["F_aaaa_Price1"].ToString());//鍚◣閲嶉噺鍗曚环/鍚�
 
                                     FentityModel.Add("F_bsv_Text1", item["HExpressSupplierSub"].ToString());//鐗╂祦鍗曚綅 (鐟炵惇)
                                     FentityModel.Add("F_bsv_Text2", item["HExpressNumberSub"].ToString());//鐗╂祦鍗曞彿 (鐟炵惇)
@@ -1255,8 +1257,43 @@
             try
             {
                 DAL.ClsCg_POInStockBill oBill = new DAL.ClsCg_POInStockBill();
-                //鍏堝垹闄� 閲戣澏鏁版嵁
-                objjson = DeleteKingDee(HInterID);
+                SQLHelper.ClsCNSRM oCn = new SQLHelper.ClsCNSRM();
+                //鑾峰彇瀹㈡埛鍚嶇О
+                string FCusName = oSystemParameter.GetSingleSystemParameter("WMS_CampanyName", ref DBUtility.ClsPub.sExeReturnInfo);
+                //澶忓疂闇�瑕佸厛鍦ㄩ噾铦跺垹闄ゆ敹鏂欓�氱煡鍗曞悗鎵嶈兘鍦ㄤ緵搴斿晢鍗忓悓骞冲彴鍒犻櫎閫佽揣鍗�
+                if (FCusName == "澶忓疂鐢靛櫒")
+                {
+                    string sqlBeforeDel = $"exec h_p_SRM_POInStockBeforeDelCtrl " + HInterID;
+
+                    DataSet ds = oCn.RunProcReturn(sqlBeforeDel, "h_p_SRM_POInStockBeforeDelCtrl");
+
+                    if (ds == null || ds.Tables[0].Rows.Count <= 0)
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "鍒犻櫎閫佽揣鍗曞彂鐢熷紓甯革紝娌℃湁浠讳綍杩斿洖璁板綍锛�";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                    else
+                    {
+                        if (ds.Tables[0].Rows[0]["HBackCount"].ToString() == "1")
+                        {
+                            objJsonResult.code = "0";
+                            objJsonResult.count = 0;
+                            objJsonResult.Message = ds.Tables[0].Rows[0]["HRemarkBack"].ToString();
+                            objJsonResult.data = null;
+                            return objJsonResult;
+                        }
+                    }
+                }
+                else
+                {
+                    //鍏堝垹闄� 閲戣澏鏁版嵁
+                    objjson = DeleteKingDee(HInterID);
+                }
+
+               
                 //LogService.Write(objjson.ToString());
                 if (objjson.code == "0")
                     return objjson;
@@ -1452,7 +1489,7 @@
 
                 //鍒ゆ柇鏈叧鑱旀暟閲忔槸鍚︿负0
                 //瀹夌憺锛欰IS20220914133941   鐟炰笌鐞細AIS20220308151944  鏈湴锛欰IS20210811135644  澶忓疂锛欰IS20211130140219  鍑礉锛欰IS20210820164804
-                DataSet ds = oCn.RunProcReturn($"select T1.hqty-T1.hrelationqty+q.FMRBQTY as hqty,鍗曟嵁鍙�,鐗╂枡缂栫爜 from H_v_SRM_POOrderBillList t1 left join AIS20220308151944..T_PUR_POORDERENTRY_R q on q.FENTRYID=t1.HEntryID  where hentryid in ({string.Join(", ", entryList)}) ", "H_v_SRM_POOrderBillList");
+                DataSet ds = oCn.RunProcReturn($"select T1.hqty-T1.hrelationqty+q.FMRBQTY as hqty,q.FRemainReceiveQty as 鍓╀綑鏀舵枡鏁伴噺,T1.hrelationqty as 宸插彂璐ф暟閲�,T1.hqty as 璁㈠崟鏁伴噺,鍗曟嵁鍙�,鐗╂枡缂栫爜 from H_v_SRM_POOrderBillList t1 left join AIS20210820164804..T_PUR_POORDERENTRY_R q on q.FENTRYID=t1.HEntryID  where hentryid in ({string.Join(", ", entryList)})", "H_v_SRM_POOrderBillList");
                 DataTable dt = ds.Tables[0];
                 if (dt.Rows.Count > 0)
                 {
@@ -1461,7 +1498,7 @@
                     {
                         objJsonResult.code = "0";
                         objJsonResult.count = 0;
-                        objJsonResult.Message = $"璇锋鏌ユ暟鎹紝鍗曟嵁鍙凤細{dr[0]["鍗曟嵁鍙�"]},鐗╂枡缂栫爜锛歿dr[0]["鐗╂枡缂栫爜"]},鍙互鍙戣揣鏁伴噺涓�0锛屽凡鍏ㄩ儴鐢熸垚閫佽揣鍗曪紒";
+                        objJsonResult.Message = $"璇锋鏌ユ暟鎹紝鍗曟嵁鍙凤細{dr[0]["鍗曟嵁鍙�"]},鐗╂枡缂栫爜锛歿dr[0]["鐗╂枡缂栫爜"]},鍙互鍙戣揣鏁伴噺涓�0锛屽凡鍏ㄩ儴鐢熸垚閫佽揣鍗曪紒,璁㈠崟鏁伴噺锛歿Convert.ToDouble(dr[0]["璁㈠崟鏁伴噺"]).ToString("f2")},宸插彂璐ф暟閲忥細{Convert.ToDouble(dr[0]["宸插彂璐ф暟閲�"]).ToString("f2")},鍓╀綑鏀舵枡鏁伴噺锛歿Convert.ToDouble(dr[0]["鍓╀綑鏀舵枡鏁伴噺"]).ToString("f2")}";
                         objJsonResult.data = null;
                         return objJsonResult;
                     }
diff --git a/WebAPI/DLL/DAL.dll b/WebAPI/DLL/DAL.dll
index a1b7656..05689a7 100644
--- a/WebAPI/DLL/DAL.dll
+++ b/WebAPI/DLL/DAL.dll
Binary files differ
diff --git a/WebAPI/DLL/Model.dll b/WebAPI/DLL/Model.dll
index 4482cbe..8c3df5c 100644
--- a/WebAPI/DLL/Model.dll
+++ b/WebAPI/DLL/Model.dll
Binary files differ

--
Gitblit v1.9.1