From ecc7833631efc9af3d081d3ffb64b93d45a10f6d Mon Sep 17 00:00:00 2001
From: yxj <yxj@hz-kingdee.com>
Date: 星期四, 05 二月 2026 11:09:58 +0800
Subject: [PATCH] 新增委外退料校验上传调用方法

---
 WebAPI/Controllers/条码管理/WEBSController.cs |  377 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 373 insertions(+), 4 deletions(-)

diff --git "a/WebAPI/Controllers/\346\235\241\347\240\201\347\256\241\347\220\206/WEBSController.cs" "b/WebAPI/Controllers/\346\235\241\347\240\201\347\256\241\347\220\206/WEBSController.cs"
index 579811a..a06b901 100644
--- "a/WebAPI/Controllers/\346\235\241\347\240\201\347\256\241\347\220\206/WEBSController.cs"
+++ "b/WebAPI/Controllers/\346\235\241\347\240\201\347\256\241\347\220\206/WEBSController.cs"
@@ -1118,7 +1118,7 @@
                 }
                 else
                 {
-                    objJsonResult.code = "0";
+                    objJsonResult.code = "1";
                     objJsonResult.count = 1;
                     objJsonResult.Message = "鎴愬姛锛�";
                     objJsonResult.data = ds.Tables[0];
@@ -4870,6 +4870,62 @@
 
         #endregion
 
+        #region 鐢熶骇閫�鏂�    鏍¢獙妯″紡
+
+        /// <summary>
+        /// 鐢熶骇閫�鏂欐牎楠屼笂浼�
+        /// </summary>
+        /// <returns></returns>
+        [Route("WEBSController/set_SaveMateOutBackBill_BillCheck_Json")]
+        [HttpPost]
+        public object set_SaveMateOutBackBill_BillCheck_Json([FromBody] JObject oMain)
+        {
+            var _value = oMain["oMain"].ToString();
+            string msg1 = _value.ToString();
+
+            try
+            {
+                List<Model.ClsKf_ICStockBillMain> lsmain = new List<Model.ClsKf_ICStockBillMain>();
+                ListModels oListModels = new ListModels();
+                lsmain = oListModels.getICStockBillMainByJson(msg1);
+
+                WebAPI.WebS.ClsKf_ICStockBillMain websLsmain = new WebS.ClsKf_ICStockBillMain();
+
+                websLsmain.HInterID = lsmain[0].HInterID;
+                websLsmain.HBillNo = lsmain[0].HBillNo;
+                websLsmain.HBillType = "1244";
+                websLsmain.HMaker = lsmain[0].HMaker;
+                websLsmain.HSTOCKORGID = lsmain[0].HSTOCKORGID;
+
+                if (oWebs.set_SaveMateOutBackBill_BillCheck(websLsmain, ref DBUtility.ClsPub.sErrInfo))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 1;
+                    objJsonResult.Message = DBUtility.ClsPub.sErrInfo;  //鎴愬姛锛�
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                else
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = DBUtility.ClsPub.sErrInfo;  //澶辫触锛�
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "鐢熶骇閫�鏂欐牎楠屽け璐ワ紒" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+
+        #endregion
+
         #endregion
 
         #region 閿�鍞��璐�    涓婁紶鐢熷崟
@@ -4949,6 +5005,66 @@
                 objJsonResult.code = "0";
                 objJsonResult.count = 0;
                 objJsonResult.Message = "閿�鍞��璐у崟涓婁紶澶辫触锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+
+        #endregion
+
+        #endregion
+
+        #region 濮斿閫�鏂�    涓婁紶鐢熷崟
+
+        #region 濮斿閫�鏂�    鏍¢獙妯″紡
+
+        /// <summary>
+        /// 濮斿閫�鏂欐牎楠屼笂浼�
+        /// </summary>
+        /// <returns></returns>
+        [Route("WEBSController/set_SaveEntrustOutBackBill_BillCheck_Json")]
+        [HttpPost]
+        public object set_SaveEntrustOutBackBill_BillCheck_Json([FromBody] JObject oMain)
+        {
+            var _value = oMain["oMain"].ToString();
+            string msg1 = _value.ToString();
+
+            try
+            {
+                List<Model.ClsKf_ICStockBillMain> lsmain = new List<Model.ClsKf_ICStockBillMain>();
+                ListModels oListModels = new ListModels();
+                lsmain = oListModels.getICStockBillMainByJson(msg1);
+
+                WebAPI.WebS.ClsKf_ICStockBillMain websLsmain = new WebS.ClsKf_ICStockBillMain();
+
+                websLsmain.HInterID = lsmain[0].HInterID;
+                websLsmain.HBillNo = lsmain[0].HBillNo;
+                websLsmain.HBillType = "1238";
+                websLsmain.HMaker = lsmain[0].HMaker;
+                websLsmain.HSTOCKORGID = lsmain[0].HSTOCKORGID;
+
+                if (oWebs.set_SaveEntrustOutBackBill_BillCheck(websLsmain, ref DBUtility.ClsPub.sErrInfo))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 1;
+                    objJsonResult.Message = DBUtility.ClsPub.sErrInfo;  //鎴愬姛锛�
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                else
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = DBUtility.ClsPub.sErrInfo;  //澶辫触锛�
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "濮斿閫�鏂欐牎楠屽け璐ワ紒" + e.ToString();
                 objJsonResult.data = null;
                 return objJsonResult;
             }
@@ -5250,6 +5366,28 @@
                 }
                 else
                 {
+
+                    //鍒犻櫎鍓嶆帶鍒�=========================================
+                    DataSet dds = oCn.RunProcReturn("Exec h_p_KF_ICInventory_WorkShop_BeforeDelCtrl " + mainList[0].HInterID.ToString()  , "h_p_KF_ICInventory_WorkShop_BeforeDelCtrl");
+
+                    if (dds == null)
+                    {
+                        oCn.RollBack();
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "鍒犻櫎鍓嶅垽鏂け璐ワ紒";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                    if (DBUtility.ClsPub.isStrNull(dds.Tables[0].Rows[0]["HBack"]) != "0")
+                    {
+                        oCn.RollBack();
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "鍒犻櫎澶辫触锛�" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
                     //鏇存柊杞﹂棿鐗╂枡搴撳瓨
                     oCn.RunProc("EXEC h_p_WMS_UPDateICinventory_WorkShop " + mainList[0].HInterID.ToString() + ",'" + mainList[0].HBillType + "'");
                     //鏇存柊杞﹂棿鏉$爜搴撳瓨
@@ -7076,6 +7214,76 @@
                         sAutoBarCode = "Y";
                     }
                 }
+                //閲囪喘閫�鏂欏崟
+                else if (HBillType == "1239")
+                {
+                    //鏍¢獙-鏄惁杩涜婧愬崟瀵瑰簲鏉$爜鏍稿锛�'Y'涓烘牳瀵癸級
+                    if (oSystemParameter.omodel.Kf_POStockInBackBillCheck_SourceBarCodeCtl.ToUpper() == "Y")
+                    {
+                        sSourceBarCodeCtl = "Y";
+                    }
+                    //鍏嶆壂鐗╂枡鏉$爜妯″紡锛�'Y'涓轰笉鎵墿鏂欐潯鐮侊級
+                    if (oSystemParameter.omodel.Kf_POStockInBackBillCheck_AutoBarCode.ToUpper() == "Y")
+                    {
+                        sAutoBarCode = "Y";
+                    }
+                }
+                //鐢熶骇閫�搴撳崟
+                else if (HBillType == "1245")
+                {
+                    //鏍¢獙-鏄惁杩涜婧愬崟瀵瑰簲鏉$爜鏍稿锛�'Y'涓烘牳瀵癸級
+                    if (oSystemParameter.omodel.Kf_ProductInBackBillCheck_SourceBarCodeCtl.ToUpper() == "Y")
+                    {
+                        sSourceBarCodeCtl = "Y";
+                    }
+                    //鍏嶆壂鐗╂枡鏉$爜妯″紡锛�'Y'涓轰笉鎵墿鏂欐潯鐮侊級
+                    if (oSystemParameter.omodel.Kf_ProductInBackBillCheck_AutoBarCode.ToUpper() == "Y")
+                    {
+                        sAutoBarCode = "Y";
+                    }
+                }
+                //鐢熶骇閫�鏂欏崟
+                else if (HBillType == "1244")
+                {
+                    //鏍¢獙-鏄惁杩涜婧愬崟瀵瑰簲鏉$爜鏍稿锛�'Y'涓烘牳瀵癸級
+                    if (oSystemParameter.omodel.Kf_MateOutBackBillCheck_SourceBarCodeCtl.ToUpper() == "Y")
+                    {
+                        sSourceBarCodeCtl = "Y";
+                    }
+                    //鍏嶆壂鐗╂枡鏉$爜妯″紡锛�'Y'涓轰笉鎵墿鏂欐潯鐮侊級
+                    if (oSystemParameter.omodel.Kf_MateOutBackBillCheck_AutoBarCode.ToUpper() == "Y")
+                    {
+                        sAutoBarCode = "Y";
+                    }
+                }
+                //閿�鍞��璐у崟
+                else if (HBillType == "1247")
+                {
+                    //鏍¢獙-鏄惁杩涜婧愬崟瀵瑰簲鏉$爜鏍稿锛�'Y'涓烘牳瀵癸級
+                    if (oSystemParameter.omodel.Kf_SellOutBackBillCheck_SourceBarCodeCtl.ToUpper() == "Y")
+                    {
+                        sSourceBarCodeCtl = "Y";
+                    }
+                    //鍏嶆壂鐗╂枡鏉$爜妯″紡锛�'Y'涓轰笉鎵墿鏂欐潯鐮侊級
+                    if (oSystemParameter.omodel.Kf_SellOutBackBillCheck_AutoBarCode.ToUpper() == "Y")
+                    {
+                        sAutoBarCode = "Y";
+                    }
+                }
+                //濮斿閫�鏂欏崟
+                else if (HBillType == "1238")
+                {
+                    //鏍¢獙-鏄惁杩涜婧愬崟瀵瑰簲鏉$爜鏍稿锛�'Y'涓烘牳瀵癸級
+                    if (oSystemParameter.omodel.Kf_EntrustOutBackBillCheck_SourceBarCodeCtl.ToUpper() == "Y")
+                    {
+                        sSourceBarCodeCtl = "Y";
+                    }
+                    //鍏嶆壂鐗╂枡鏉$爜妯″紡锛�'Y'涓轰笉鎵墿鏂欐潯鐮侊級
+                    if (oSystemParameter.omodel.Kf_EntrustOutBackBillCheck_AutoBarCode.ToUpper() == "Y")
+                    {
+                        sAutoBarCode = "Y";
+                    }
+                }
                 #endregion
 
                 if (oSystemParameter.omodel.WMS_CampanyName == "瀹夌憺") //绯荤粺鍙傛暟  瀹㈡埛瀹氬埗鍖栧悕绉�     绌虹櫧涓洪�氱敤
@@ -7742,6 +7950,51 @@
                     //鍏堣繘鍏堝嚭鎺у埗
                     sFIFOCtl = oSystemParameter.omodel.Kf_MoveStockBillCheck_FIFOCtl;
                 }
+                //閲囪喘閫�鏂欏崟
+                else if (HBillType == "1239")
+                {
+                    //鏍¢獙-鏄惁杩涜婧愬崟瀵瑰簲鏉$爜鏍稿锛�'Y'涓烘牳瀵癸級
+                    if (oSystemParameter.omodel.Kf_POStockInBackBillCheck_SourceBarCodeCtl.ToUpper() == "Y")
+                    {
+                        sSourceBarCodeCtl = "Y";
+                    }
+                }
+                //鐢熶骇閫�搴撳崟
+                else if (HBillType == "1245")
+                {
+                    //鏍¢獙-鏄惁杩涜婧愬崟瀵瑰簲鏉$爜鏍稿锛�'Y'涓烘牳瀵癸級
+                    if (oSystemParameter.omodel.Kf_ProductInBackBillCheck_SourceBarCodeCtl.ToUpper() == "Y")
+                    {
+                        sSourceBarCodeCtl = "Y";
+                    }
+                }
+                //鐢熶骇閫�鏂欏崟
+                else if (HBillType == "1244")
+                {
+                    //鏍¢獙-鏄惁杩涜婧愬崟瀵瑰簲鏉$爜鏍稿锛�'Y'涓烘牳瀵癸級
+                    if (oSystemParameter.omodel.Kf_MateOutBackBillCheck_SourceBarCodeCtl.ToUpper() == "Y")
+                    {
+                        sSourceBarCodeCtl = "Y";
+                    }
+                }
+                //閿�鍞��璐у崟
+                else if (HBillType == "1247")
+                {
+                    //鏍¢獙-鏄惁杩涜婧愬崟瀵瑰簲鏉$爜鏍稿锛�'Y'涓烘牳瀵癸級
+                    if (oSystemParameter.omodel.Kf_SellOutBackBillCheck_SourceBarCodeCtl.ToUpper() == "Y")
+                    {
+                        sSourceBarCodeCtl = "Y";
+                    }
+                }
+                //濮斿閫�鏂欏崟
+                else if (HBillType == "1238")
+                {
+                    //鏍¢獙-鏄惁杩涜婧愬崟瀵瑰簲鏉$爜鏍稿锛�'Y'涓烘牳瀵癸級
+                    if (oSystemParameter.omodel.Kf_EntrustOutBackBillCheck_SourceBarCodeCtl.ToUpper() == "Y")
+                    {
+                        sSourceBarCodeCtl = "Y";
+                    }
+                }
                 #endregion
 
                 //鍘熷崟鎹负鎵爜鐢熸垚锛屽鍘熸壂鎻忕殑鏉$爜杩涜鏍稿锛屽垹闄ゆ潯鐮佸嚭鍏ュ簱鏍¢獙缂撳瓨璁板綍
@@ -8052,6 +8305,51 @@
                 {
                     //鏍¢獙-鏄惁杩涜婧愬崟瀵瑰簲鏉$爜鏍稿锛�'Y'涓烘牳瀵癸級
                     if (oSystemParameter.omodel.Kf_MoveStockBillCheck_SourceBarCodeCtl.ToUpper() == "Y")
+                    {
+                        sSourceBarCodeCtl = "Y";
+                    }
+                }
+                //閲囪喘閫�鏂欏崟
+                else if (HBillType == "1239")
+                {
+                    //鏍¢獙-鏄惁杩涜婧愬崟瀵瑰簲鏉$爜鏍稿锛�'Y'涓烘牳瀵癸級
+                    if (oSystemParameter.omodel.Kf_POStockInBackBillCheck_SourceBarCodeCtl.ToUpper() == "Y")
+                    {
+                        sSourceBarCodeCtl = "Y";
+                    }
+                }
+                //鐢熶骇閫�搴撳崟
+                else if (HBillType == "1245")
+                {
+                    //鏍¢獙-鏄惁杩涜婧愬崟瀵瑰簲鏉$爜鏍稿锛�'Y'涓烘牳瀵癸級
+                    if (oSystemParameter.omodel.Kf_ProductInBackBillCheck_SourceBarCodeCtl.ToUpper() == "Y")
+                    {
+                        sSourceBarCodeCtl = "Y";
+                    }
+                }
+                //鐢熶骇閫�鏂欏崟
+                else if (HBillType == "1244")
+                {
+                    //鏍¢獙-鏄惁杩涜婧愬崟瀵瑰簲鏉$爜鏍稿锛�'Y'涓烘牳瀵癸級
+                    if (oSystemParameter.omodel.Kf_MateOutBackBillCheck_SourceBarCodeCtl.ToUpper() == "Y")
+                    {
+                        sSourceBarCodeCtl = "Y";
+                    }
+                }
+                //閿�鍞��璐у崟
+                else if (HBillType == "1247")
+                {
+                    //鏍¢獙-鏄惁杩涜婧愬崟瀵瑰簲鏉$爜鏍稿锛�'Y'涓烘牳瀵癸級
+                    if (oSystemParameter.omodel.Kf_SellOutBackBillCheck_SourceBarCodeCtl.ToUpper() == "Y")
+                    {
+                        sSourceBarCodeCtl = "Y";
+                    }
+                }
+                //濮斿閫�鏂欏崟
+                else if (HBillType == "1238")
+                {
+                    //鏍¢獙-鏄惁杩涜婧愬崟瀵瑰簲鏉$爜鏍稿锛�'Y'涓烘牳瀵癸級
+                    if (oSystemParameter.omodel.Kf_EntrustOutBackBillCheck_SourceBarCodeCtl.ToUpper() == "Y")
                     {
                         sSourceBarCodeCtl = "Y";
                     }
@@ -8828,6 +9126,29 @@
 
         #endregion
 
+        #endregion
+
+        #region 鏍规嵁sn鐮佸鎵惧搴旂殑涓鐮�
+        [Route("WEBSController/getMiddleCodeBySn")]
+        [HttpGet]
+        public object getMiddleCodeBySn(string HBarCode,int HStockOrgID)
+        {
+            DataSet dss = oCn.RunProcReturn("select * from Gy_CaseCodeRelation where HBarCode='"+ HBarCode + "'", "Gy_CaseCodeRelation");
+
+            if (dss.Tables[0].Rows[0]["HCaseCode"].ToString() == "" || dss == null)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "鏈壘鍒皊n鐮佹墍瀵瑰簲鐨勪腑绠辩爜";
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+            objJsonResult.code = "1";
+            objJsonResult.count = 1;
+            objJsonResult.Message = "鎴愬姛";
+            objJsonResult.data = dss.Tables[0];
+            return objJsonResult;
+        }
         #endregion
 
         #endregion
@@ -13592,19 +13913,27 @@
         {
             try
             {
+                string sErrMsg = "";
+                oSystemParameter.ShowBill(ref sErrMsg);
+                // 鍗庤垷瀹㈡埛
+                if(oSystemParameter.omodel.WMS_CampanyName == "鍗庤垷")
+                {
+                    HBarCode = HBarCode.Split('-')[0];
+                }
+
                 // Mode = 1 琛ㄧず 鎵爜妯″紡 Mode = 2 琛ㄧず 閫夊崟妯″紡
-                if(Mode == 1)
+                if (Mode == 1)
                 {
                     //鎵爜妯″紡闇�瑕佽В鏋愭潯鐮佽幏鍙朒InterID鍜孒EntryID
                     ds = oCn.RunProcReturn($@"
                     exec h_p_CheckBillBarCode_AnalysisBarcode 
                         @HBillType={HBillType},
                         @HSourceBillType={HSourceBillType},
-                        @HBarCode={HBarCode},
+                        @HBarCode='{HBarCode}',
                         @user = '{user}'
                     ", "h_p_CheckBillBarCode_AnalysisBarcode");
 
-                    if (ds.Tables[0].Rows.Count == 0)
+                    if (ds is null || ds.Tables[0].Rows.Count == 0)
                     {
                         objJsonResult.code = "0";
                         objJsonResult.count = 0;
@@ -13744,5 +14073,45 @@
             }
         }
         #endregion
+
+        #region [鍙栨牱鍗昡 鑾峰彇鏈笅鎺ㄦ垚妫�楠屽崟鐨勫彇鏍峰崟鍒楄〃
+        [Route("WEBSController/AwaitCheckSampleBillList")]
+        [HttpGet]
+        public Object AwaitCheckSampleBillList(string user)
+        {
+            List<object> columnNameList = new List<object>();
+            try
+            {
+                ds = oCn.RunProcReturn($@"
+                    exec h_p_AwaitCheckSampleBillList @user={user}
+                ", "h_p_CheckBillBarCode_CheckItem");
+
+                //娣诲姞鍒楀悕
+                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鍒楀璞$殑鍒楀悕
+                }
+
+                objJsonResult.code = "1";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "success锛�";
+                objJsonResult.data = ds.Tables;
+                objJsonResult.list = columnNameList;
+
+                return objJsonResult;
+
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "鎵弿鍗曟嵁鏉$爜澶辫触锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
     }
 }

--
Gitblit v1.9.1