From 1d521ea0a9dbb49ed018cb0c13455ebdf5c73206 Mon Sep 17 00:00:00 2001
From: zrg <z18737863051@163.com>
Date: 星期三, 08 一月 2025 17:48:42 +0800
Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API

---
 WebAPI/Controllers/条码管理/WEBSController.cs | 1280 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 1,248 insertions(+), 32 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 fca57c4..956cceb 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"
@@ -35,9 +35,6 @@
         string ComputerName = SystemInformation.ComputerName;   //璁惧鍚嶇О
 
 
-        WebS.ClsXt_SystemParameterMain oSystemParameterMain = new WebS.ClsXt_SystemParameterMain();
-
-
         #region 鍏敤鏂规硶
 
         #region 璐﹀彿鐧诲叆
@@ -1075,6 +1072,90 @@
 
         #region 鎵爜妯″潡璋冪敤鏂规硶
 
+        #region 鍏朵粬鍏ュ簱    鑾峰彇鍏ュ簱绫诲瀷
+
+        /// <summary>
+        /// 鑾峰彇鍏ュ簱绫诲瀷
+        /// </summary>
+        /// <returns></returns>
+        [Route("WEBSController/GetStockInStyle_Json")]
+        [HttpGet]
+        public Object GetStockInStyle_Json()
+        {
+            try
+            {
+                ds = oWebs.get_StockInStyle();
+                if (ds == null || ds.Tables[0].Rows.Count == 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鏌ヨ涓嶅埌鍏ュ簱绫诲瀷淇℃伅锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                else
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 1;
+                    objJsonResult.Message = "鎴愬姛";
+                    objJsonResult.data = ds.Tables[0];
+                    return objJsonResult;
+                }
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "鑾峰彇鍏ュ簱绫诲瀷淇℃伅澶辫触锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+
+        #endregion
+
+        #region 鍏朵粬鍑哄簱    鑾峰彇鍑哄簱绫诲瀷
+
+        /// <summary>
+        /// 鑾峰彇鍑哄簱绫诲瀷
+        /// </summary>
+        /// <returns></returns>
+        [Route("WEBSController/GetStockOutStyle_Json")]
+        [HttpGet]
+        public Object GetStockOutStyle_Json()
+        {
+            try
+            {
+                ds = oWebs.get_StockOutStyle();
+                if (ds == null || ds.Tables[0].Rows.Count == 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鏌ヨ涓嶅埌鍑哄簱绫诲瀷淇℃伅锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                else
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 1;
+                    objJsonResult.Message = "鎴愬姛";
+                    objJsonResult.data = ds.Tables[0];
+                    return objJsonResult;
+                }
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "鑾峰彇鍑哄簱绫诲瀷淇℃伅澶辫触锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+
+        #endregion
+
         #region 鐩存帴璋冩嫧    鑾峰彇璋冩嫧鍑鸿揣绫诲瀷
 
         /// <summary>
@@ -1264,6 +1345,9 @@
         {
             try
             {
+                //鏍规嵁鎵樻潯鐮佸瓧娈靛垹闄ゆ湰鍗曟潯鐮佸嚭鍏ュ簱缂撳瓨琛ㄦ暟鎹�
+                oCn.RunProc("Delete from KF_PonderationBillMain_Temp where HBarCode_Pack<>'' and HInterID=" + HInterID.ToString() + " and HBillType='" + HBillType + "' and HBarCode_Pack='" + HBarCode + "'", ref DBUtility.ClsPub.sExeReturnInfo);
+                //鏍规嵁鏉$爜瀛楁鍒犻櫎鏈崟鏉$爜鍑哄叆搴撶紦瀛樿〃鏁版嵁
                 oCn.RunProc("Delete from KF_PonderationBillMain_Temp where HBarCode<>'' and HInterID=" + HInterID.ToString() + " and HBillType='" + HBillType + "' and HBarCode='" + HBarCode + "'", ref DBUtility.ClsPub.sExeReturnInfo);
                 objJsonResult.code = "0";
                 objJsonResult.count = 1;
@@ -1328,22 +1412,12 @@
         {
             try
             {
-                if (oWebs.set_DelPonderationBillMain_Temp_InterIDAndSource(HInterID, HMaterID, HAuxPropID, HMTONo, HSourceInterID, HSourceEntryID, HBillType, 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;
-                }
+                oCn.RunProc("Delete from KF_PonderationBillMain_Temp where HInterID=" + HInterID.ToString() + " and HMaterID= " + HMaterID.ToString() + " and HAuxPropID= " + HAuxPropID.ToString() + " and HBillType='" + HBillType + "' and HSourceInterID=" + HSourceInterID.ToString() + " and HSourceEntryID=" + HSourceEntryID.ToString() + " and HQty<>0 ", ref DBUtility.ClsPub.sExeReturnInfo);
+                objJsonResult.code = "0";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "鍒犻櫎鎴愬姛";
+                objJsonResult.data = null;
+                return objJsonResult;
             }
             catch (Exception e)
             {
@@ -1399,6 +1473,50 @@
         }
 
         #endregion
+
+
+        #region 鎵爜妯″潡    瀹㈡埛銆佷紶绁ㄣ�佹潯鐮侀獙璇佽皟鐢�
+
+        /// <summary>
+        /// 鎵爜妯″潡    瀹㈡埛銆佷紶绁ㄣ�佹潯鐮侀獙璇佽皟鐢�
+        /// </summary>
+        /// <returns></returns>
+        [Route("WEBSController/GetCheakBarCodeAndCP_Json")]
+        [HttpGet]
+        public object GetCheakBarCodeAndCP_Json(long HCusID, string HCP, string HBarCode)
+        {
+            try
+            {
+                HBarCode = HBarCode.Trim();
+                if (oWebs.Get_CheakBarCodeAndCP(HCusID, HCP, HBarCode, 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
 
@@ -2015,6 +2133,61 @@
 
         #endregion
 
+        #region 鐢熶骇鍏ュ簱    鏍¢獙妯″紡
+
+        /// <summary>
+        /// 鐢熶骇鍏ュ簱鏍¢獙涓婁紶
+        /// </summary>
+        /// <returns></returns>
+        [Route("WEBSController/set_SaveProductInBill_BillCheck_Json")]
+        [HttpPost]
+        public object set_SaveProductInBill_BillCheck_Json([FromBody] JObject oMain)
+        {
+            var _value = oMain["oMain"].ToString();
+            string msg1 = _value.ToString();
+
+            try
+            {
+                List<Model.ClsKf_ProductInBillMain> lsmain = new List<Model.ClsKf_ProductInBillMain>();
+                ListModels oListModels = new ListModels();
+                lsmain = oListModels.getProductInBillMainByJson(msg1);
+
+                WebAPI.WebS.ClsKf_ProductInBillMain websLsmain = new WebS.ClsKf_ProductInBillMain();
+
+                websLsmain.HInterID = lsmain[0].HInterID;
+                websLsmain.HBillNo = lsmain[0].HBillNo;
+                websLsmain.HBillType = "1202";
+                websLsmain.HSTOCKORGID = lsmain[0].HSTOCKORGID;
+
+                if (oWebs.set_SaveProductInBill_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 閲囪喘鍏ュ簱    涓婁紶鐢熷崟
@@ -2101,6 +2274,60 @@
 
         #endregion
 
+        #region 閲囪喘鍏ュ簱    鏍¢獙妯″紡
+
+        /// <summary>
+        /// 閲囪喘鍏ュ簱鏍¢獙涓婁紶
+        /// </summary>
+        /// <returns></returns>
+        [Route("WEBSController/set_SavePOStockInBill_BillCheck_Json")]
+        [HttpPost]
+        public object set_SavePOStockInBill_BillCheck_Json([FromBody] JObject oMain)
+        {
+            var _value = oMain["oMain"].ToString();
+            string msg1 = _value.ToString();
+
+            try
+            {
+                List<Model.ClsKf_POStockInBillMain> lsmain = new List<Model.ClsKf_POStockInBillMain>();
+                ListModels oListModels = new ListModels();
+                lsmain = oListModels.getPOStockInBillMainByJson(msg1);
+
+                WebAPI.WebS.ClsKf_POStockInBillMain websLsmain = new WebS.ClsKf_POStockInBillMain();
+
+                websLsmain.HInterID = lsmain[0].HInterID;
+                websLsmain.HBillNo = lsmain[0].HBillNo;
+                websLsmain.HBillType = "1201";
+                websLsmain.HSTOCKORGID = lsmain[0].HSTOCKORGID;
+
+                if (oWebs.set_SavePOStockInBill_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
 
@@ -2272,6 +2499,61 @@
 
         #endregion
 
+        #region 鍏朵粬鍏ュ簱    鏍¢獙妯″紡
+
+        /// <summary>
+        /// 鍏朵粬鍏ュ簱鏍¢獙涓婁紶
+        /// </summary>
+        /// <returns></returns>
+        [Route("WEBSController/set_SaveOtherInBill_BillCheck_Json")]
+        [HttpPost]
+        public object set_SaveOtherInBill_BillCheck_Json([FromBody] JObject oMain)
+        {
+            var _value = oMain["oMain"].ToString();
+            string msg1 = _value.ToString();
+
+            try
+            {
+                List<Model.ClsKf_OtherInBillMain> lsmain = new List<Model.ClsKf_OtherInBillMain>();
+                ListModels oListModels = new ListModels();
+                lsmain = oListModels.getOtherInBillMainByJson(msg1);
+
+                WebAPI.WebS.ClsKf_OtherInBillMain websLsmain = new WebS.ClsKf_OtherInBillMain();
+
+                websLsmain.HInterID = lsmain[0].HInterID;
+                websLsmain.HBillNo = lsmain[0].HBillNo;
+                websLsmain.HBillType = "1203";
+                websLsmain.HSTOCKORGID = lsmain[0].HSTOCKORGID;
+
+                if (oWebs.set_SaveOtherInBill_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 棰嗘枡鍑哄簱    涓婁紶鐢熷崟
@@ -2364,6 +2646,61 @@
                 objJsonResult.code = "0";
                 objJsonResult.count = 0;
                 objJsonResult.Message = "棰嗘枡鍑哄簱鍗曚笂浼犲け璐ワ紒" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+
+        #endregion
+
+        #region 棰嗘枡鍑哄簱    鏍¢獙妯″紡
+
+        /// <summary>
+        /// 棰嗘枡鍑哄簱鏍¢獙涓婁紶
+        /// </summary>
+        /// <returns></returns>
+        [Route("WEBSController/set_SaveMateOutBill_BillCheck_Json")]
+        [HttpPost]
+        public object set_SaveMateOutBill_BillCheck_Json([FromBody] JObject oMain)
+        {
+            var _value = oMain["oMain"].ToString();
+            string msg1 = _value.ToString();
+
+            try
+            {
+                List<Model.ClsKf_MateOutBillMain> lsmain = new List<Model.ClsKf_MateOutBillMain>();
+                ListModels oListModels = new ListModels();
+                lsmain = oListModels.getMateOutBillMainByJson(msg1);
+
+                WebAPI.WebS.ClsKf_MateOutBillMain websLsmain = new WebS.ClsKf_MateOutBillMain();
+
+                websLsmain.HInterID = lsmain[0].HInterID;
+                websLsmain.HBillNo = lsmain[0].HBillNo;
+                websLsmain.HBillType = "1204";
+                websLsmain.HSTOCKORGID = lsmain[0].HSTOCKORGID;
+
+                if (oWebs.set_SaveMateOutBill_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;
             }
@@ -2725,6 +3062,61 @@
                 objJsonResult.code = "0";
                 objJsonResult.count = 0;
                 objJsonResult.Message = "鍏朵粬鍑哄簱鍗曚笂浼犲け璐ワ紒" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+
+        #endregion
+
+        #region 鍏朵粬鍑哄簱    鏍¢獙妯″紡
+
+        /// <summary>
+        /// 鍏朵粬鍑哄簱鏍¢獙涓婁紶
+        /// </summary>
+        /// <returns></returns>
+        [Route("WEBSController/set_SaveOtherOutBill_BillCheck_Json")]
+        [HttpPost]
+        public object set_SaveOtherOutBill_BillCheck_Json([FromBody] JObject oMain)
+        {
+            var _value = oMain["oMain"].ToString();
+            string msg1 = _value.ToString();
+
+            try
+            {
+                List<Model.ClsKf_OtherOutBillMain> lsmain = new List<Model.ClsKf_OtherOutBillMain>();
+                ListModels oListModels = new ListModels();
+                lsmain = oListModels.getOtherOutBillMainByJson(msg1);
+
+                WebAPI.WebS.ClsKf_OtherOutBillMain websLsmain = new WebS.ClsKf_OtherOutBillMain();
+
+                websLsmain.HInterID = lsmain[0].HInterID;
+                websLsmain.HBillNo = lsmain[0].HBillNo;
+                websLsmain.HBillType = "1206";
+                websLsmain.HSTOCKORGID = lsmain[0].HSTOCKORGID;
+
+                if (oWebs.set_SaveOtherOutBill_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;
             }
@@ -4297,6 +4689,7 @@
                 }
                 else if(oSystemParameter.omodel.WMS_CampanyName == "妫シ" && HSourceBillType == "1241")
                 {
+                    LogService.Write("妫シ鍏朵粬鍏ュ簱鎵爜鏉$爜璁板綍锛�" + sBarCode);
                     DataSet ds;
                     string sql = "select HBarCode,HSourceInterID,HSourceEntryID,HSourceBillNo from Gy_BarCodeBill with(nolock) where HBarCode = '" + sBarCode + "'";
                     string HDataBaseName = Util.GetConfigKey(AppDomain.CurrentDomain.BaseDirectory + "/Config/kdapi.config", "DataBaseName");//鑾峰彇閲戣澏鏁版嵁搴撳悕绉�
@@ -4307,6 +4700,7 @@
                     //鍒ゆ柇鏉$爜淇℃伅鏄惁鍦ㄦ潯鐮佹。妗堜腑
                     if (ds == null || ds.Tables[0].Rows.Count < 1)
                     {
+                        LogService.Write("鍏朵粬鍏ュ簱锛屾潯鐮佹。妗堜腑涓嶅瓨鍦ㄦ鏉$爜缂栧彿锛�" + sBarCode);
                         objJsonResult.code = "0";
                         objJsonResult.count = 0;
                         objJsonResult.Message = "鏉$爜妗f涓笉瀛樺湪姝ゆ潯鐮佺紪鍙凤細" + sBarCode;
@@ -4403,7 +4797,7 @@
                                     FentityModel.Add("FKEEPERID", new JObject() { ["FNumber"] = item["淇濈鑰呬唬鐮�"].ToString() });  // 淇濈鑰呬唬鐮�
                                     FentityModel.Add("FAuxPropId", new JObject() { ["FAUXPROPID__FF100003"] = new JObject() { ["FNumber"] = item["杈呭姪灞炴�т唬鐮�"].ToString() } });  // 杈呭姪灞炴��
                                     FentityModel.Add("FExtAuxUnitId", new JObject() { ["FNumber"] = item["杈呰閲忓崟浣嶄唬鐮�"].ToString() });  // 杈呭崟浣�
-                                    FentityModel.Add("FExtAuxUnitQty", item["绠辨暟"].ToString()); //绠辨暟
+                                    FentityModel.Add("FExtAuxUnitQty", item["鏄庣粏绠辨暟"].ToString()); //绠辨暟
                                     FentityModel.Add("F_TFKO_Assistant", new JObject() { ["FNumber"] = item["缃戝埆浠g爜"].ToString() });  // 缃戝埆 ???蹇呭~
                                     FentityModel.Add("F_TFKO_Assistant1", new JObject() { ["FNumber"] = item["瀛斿瀷浠g爜"].ToString() });  // 瀛斿瀷
                                     FentityModel.Add("F_TFKO_Assistant2", new JObject() { ["FNumber"] = item["鑹叉辰浠g爜"].ToString() });  // 鑹叉辰 ???蹇呭~
@@ -4532,15 +4926,16 @@
                                     }
                                 }
                             }
+
+                            //鏇存柊鏉$爜婧愬崟id淇℃伅
+                            sql = string.Format($@"update a set HSourceInterID = isnull(b.FID,0),HSourceEntryID = isnull(c.FEntryID,0) from Gy_BarCodeBill a left join AIS20220609121235..TFKO_t_Cust100009 b on a.HSourceBillNo = b.FBillNo left join AIS20220609121235..TFKO_t_Cust_Entry100065 c on b.FID = C.FID and a.HBarcodeNo = c.FSEQ where HSourceBillNo = '{HSourceBillNo_TB}'");
+                            //鎵ц鏇存柊璇彞
+                            oCn.RunProc(sql);
+
                         }
                     }
 
-                    sJXCode = sBarCode;
-
-                    //鏇存柊鏉$爜婧愬崟id淇℃伅
-                     sql = string.Format($@"update a set HSourceInterID = b.FID,HSourceEntryID = c.FEntryID from Gy_BarCodeBill a left join AIS20220609121235..TFKO_t_Cust100009 b on a.HSourceBillNo = b.FBillNo left join AIS20220609121235..TFKO_t_Cust_Entry100065 c on b.FID = C.FID and a.HBarcodeNo = c.FSEQ where HSourceBillNo = '{HSourceBillNo_TB}'");
-                    //鎵ц鏇存柊璇彞
-                    oCn.RunProc(sql);
+                    sJXCode = sBarCode;                   
                 }
                 else
                 {
@@ -4884,7 +5279,15 @@
                     objJsonResult.code = "0";
                     objJsonResult.count = 0;
                     objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�";
-                    objJsonResult.data = null;
+                    objJsonResult.data = new
+                    {
+                        Materlist = ds.Tables[0],           //杩斿洖鐗╂枡鏄庣粏鍒楄〃淇℃伅锛�0锛�
+                        Mouldlist = ds.Tables[1],           //杩斿洖妯℃不鍏峰垪琛ㄤ俊鎭紙1锛�
+                        FIFOlist = ds.Tables[2],            //杩斿洖鍏堣繘鍏堝嚭鍒楄〃淇℃伅锛�2锛�
+                        BarCodelist = ds.Tables[3],         //杩斿洖鏉$爜鏄庣粏鍒楄〃淇℃伅锛�3锛�
+                        ICMOReportlist = ds.Tables[4],      //杩斿洖婧愬崟鐢熶骇姹囨姤鍗曟潯鐮佹槑缁嗗垪琛ㄤ俊鎭紙4锛�
+                        BarCodeDetailslist = ds.Tables[5]   //杩斿洖褰撳墠鎵�鎵弿鏉$爜鏄庣粏淇℃伅锛�5锛�
+                    };
                     return objJsonResult;
                 }
                 else
@@ -5065,6 +5468,48 @@
 
         #endregion
 
+        #region 鎵弿鍗曟嵁鏉$爜  宸插瓨鍦ㄦ壂鐮佽褰曚笖鍗曟嵁鍙戠敓鍙樻洿鍚庝袱杈规暟鎹笉涓�鑷存椂锛屾竻绌哄師鎵爜鏁版嵁   20241216
+
+        /// <summary>
+        /// 宸插瓨鍦ㄦ壂鐮佽褰曚笖鍗曟嵁鍙戠敓鍙樻洿鍚庝袱杈规暟鎹笉涓�鑷存椂锛屾竻绌哄師鎵爜鏁版嵁
+        /// </summary>
+        /// <returns></returns>
+        [Route("WEBSController/get_ClearBarCode_BillCheck_Json")]
+        [HttpGet]
+        public object get_ClearBarCode_BillCheck_Json(Int64 HInterID, string HBillType, string HMaker, Int64 HStockOrgID)
+        {
+            try
+            {
+                ds = oCn.RunProcReturn("exec h_p_WMS_ClearBarCode_BillCheck " + HInterID.ToString() + ",'" + HBillType + "','" + HMaker + "'," + HStockOrgID.ToString(), "h_p_WMS_ClearBarCode_BillCheck");
+                if (ds == null || ds.Tables[0].Rows.Count == 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "娓呯┖鍘熸壂鐮佹暟鎹彂鐢熼敊璇紒";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                else
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 1;
+                    objJsonResult.Message = "鎴愬姛锛�";
+                    objJsonResult.data = ds.Tables[0];
+                    return objJsonResult;
+                }
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "娓呯┖鍘熸壂鐮佹暟鎹け璐ワ紒" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+
+        #endregion
+
         #region 鎵弿鐗╂枡鏉$爜  鍑哄叆搴撴ā鍧�
 
         /// <summary>
@@ -5078,14 +5523,102 @@
             //鑾峰彇绯荤粺鍙傛暟
             string sErrMsg = "";
             string sJXCode = "";
-            if (oSystemParameter.ShowBill(ref sErrMsg) == true)
+            if (oSystemParameter.ShowBillByOrgID(HStockOrgID, ref sErrMsg) == true)
             {
                 string sSourceBarCodeCtl = "N";   //鏍¢獙-鏄惁杩涜婧愬崟瀵瑰簲鏉$爜鏍稿锛�'Y'涓烘牳瀵癸級
-                if (HBillType == "1205" && oSystemParameter.omodel.Kf_SellOutBillCheck_SourceBarCodeCtl == "Y")
+
+                #region 绯荤粺鍙傛暟鑾峰彇
+                //閲囪喘鍏ュ簱鍗�
+                if (HBillType == "1201")
                 {
-                    //閿�鍞嚭搴撳崟
-                    sSourceBarCodeCtl = "Y";
+                    //鏍¢獙-鏄惁杩涜婧愬崟瀵瑰簲鏉$爜鏍稿锛�'Y'涓烘牳瀵癸級
+                    if (oSystemParameter.omodel.Kf_POStockInBillCheck_SourceBarCodeCtl == "Y")
+                    {
+                        sSourceBarCodeCtl = "Y";
+                    }
                 }
+                //鐢熶骇鍏ュ簱鍗�
+                if (HBillType == "1202")
+                {
+                    //鏍¢獙-鏄惁杩涜婧愬崟瀵瑰簲鏉$爜鏍稿锛�'Y'涓烘牳瀵癸級
+                    if (oSystemParameter.omodel.Kf_ProductInBillCheck_SourceBarCodeCtl == "Y")
+                    {
+                        sSourceBarCodeCtl = "Y";
+                    }
+                }
+                //鍏朵粬鍏ュ簱鍗�
+                if (HBillType == "1203")
+                {
+                    //鏍¢獙-鏄惁杩涜婧愬崟瀵瑰簲鏉$爜鏍稿锛�'Y'涓烘牳瀵癸級
+                    if (oSystemParameter.omodel.Kf_OtherInBillCheck_SourceBarCodeCtl == "Y")
+                    {
+                        sSourceBarCodeCtl = "Y";
+                    }
+                }
+                //棰嗘枡鍑哄簱鍗�
+                else if (HBillType == "1204")
+                {
+                    //鏍¢獙-鏄惁杩涜婧愬崟瀵瑰簲鏉$爜鏍稿锛�'Y'涓烘牳瀵癸級
+                    if (oSystemParameter.omodel.Kf_MateOutBillCheck_SourceBarCodeCtl == "Y")
+                    {
+                        sSourceBarCodeCtl = "Y";
+                    }
+                }
+                //閿�鍞嚭搴撳崟
+                else if (HBillType == "1205")
+                {
+                    //鏍¢獙-鏄惁杩涜婧愬崟瀵瑰簲鏉$爜鏍稿锛�'Y'涓烘牳瀵癸級
+                    if (oSystemParameter.omodel.Kf_SellOutBillCheck_SourceBarCodeCtl == "Y")
+                    {
+                        sSourceBarCodeCtl = "Y";
+                    }
+                }
+                //鍏朵粬鍑哄簱鍗�
+                else if (HBillType == "1206")
+                {
+                    //鏍¢獙-鏄惁杩涜婧愬崟瀵瑰簲鏉$爜鏍稿锛�'Y'涓烘牳瀵癸級
+                    if (oSystemParameter.omodel.Kf_OtherOutBillCheck_SourceBarCodeCtl == "Y")
+                    {
+                        sSourceBarCodeCtl = "Y";
+                    }
+                }
+                //濮斿棰嗘枡鍗�
+                else if (HBillType == "1211")
+                {
+                    //鏍¢獙-鏄惁杩涜婧愬崟瀵瑰簲鏉$爜鏍稿锛�'Y'涓烘牳瀵癸級
+                    if (oSystemParameter.omodel.Kf_EntrustOutBillCheck_SourceBarCodeCtl == "Y")
+                    {
+                        sSourceBarCodeCtl = "Y";
+                    }
+                }
+                //鐢熶骇琛ユ枡鍗�
+                else if (HBillType == "1254")
+                {
+                    //鏍¢獙-鏄惁杩涜婧愬崟瀵瑰簲鏉$爜鏍稿锛�'Y'涓烘牳瀵癸級
+                    if (oSystemParameter.omodel.Kf_MateReplenishOutBillCheck_SourceBarCodeCtl == "Y")
+                    {
+                        sSourceBarCodeCtl = "Y";
+                    }
+                }
+                //濮斿琛ユ枡鍗�
+                else if (HBillType == "1255")
+                {
+                    //鏍¢獙-鏄惁杩涜婧愬崟瀵瑰簲鏉$爜鏍稿锛�'Y'涓烘牳瀵癸級
+                    if (oSystemParameter.omodel.Kf_EntrustReplenishOutBillCheck_SourceBarCodeCtl == "Y")
+                    {
+                        sSourceBarCodeCtl = "Y";
+                    }
+                }
+                //鐩存帴璋冩嫧鍗�
+                else if (HBillType == "1207")
+                {
+                    //鏍¢獙-鏄惁杩涜婧愬崟瀵瑰簲鏉$爜鏍稿锛�'Y'涓烘牳瀵癸級
+                    if (oSystemParameter.omodel.Kf_MoveStockBillCheck_SourceBarCodeCtl == "Y")
+                    {
+                        sSourceBarCodeCtl = "Y";
+                    }
+                }
+                #endregion
 
                 if (oSystemParameter.omodel.WMS_CampanyName == "瀹夌憺") //绯荤粺鍙傛暟  瀹㈡埛瀹氬埗鍖栧悕绉�     绌虹櫧涓洪�氱敤
                 {
@@ -5161,6 +5694,71 @@
 
         #endregion
 
+        #region 杩斿洖鍗曟嵁鍒楄〃淇℃伅    20241114
+
+        /// <summary>
+        /// 杩斿洖鍗曟嵁鍒楄〃淇℃伅    鏍¢獙妯″紡
+        /// </summary>
+        /// <returns></returns>
+        [Route("WEBSController/GetKf_PonderationBillMain_Temp_BillCheck_New_Json")]
+        [HttpGet]
+        public object GetKf_PonderationBillMain_Temp_BillCheck_New_Json(long HInterID, string HBillType, string sWhere, string HSourceBarCodeCtl)
+        {
+            try
+            {
+                //鍘熷崟鎹负鎵爜鐢熸垚锛屽鍘熸壂鎻忕殑鏉$爜杩涜鏍稿
+                if (HSourceBarCodeCtl == "Y")
+                {
+                    ds = oCn.RunProcReturn("exec h_p_KF_PonderationBillMain_TempList_Verify " + HInterID.ToString() + ",'" + HBillType + "','" + sWhere + "'", "h_p_KF_PonderationBillMain_TempList_Verify");
+                }
+                //鍘熷崟鎹潪鎵爜鐢熸垚
+                else
+                {
+                    ds = oCn.RunProcReturn("exec h_p_KF_PonderationBillMain_TempList_BillCheck " + HInterID.ToString() + ",'" + HBillType + "','" + sWhere + "'", "h_p_KF_PonderationBillMain_TempList_BillCheck");
+                }
+
+                if (ds == null || ds.Tables[0].Rows.Count == 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                else
+                {
+                    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鍒楀璞$殑鍒楀悕
+                    }
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 1;
+                    objJsonResult.Message = "鑾峰彇淇℃伅鎴愬姛锛�";
+                    objJsonResult.data = new
+                    {
+                        Materlist = ds.Tables[0],           //杩斿洖鐗╂枡鏄庣粏鍒楄〃淇℃伅锛�0锛�
+                        BarCodeDetailslist = ds.Tables[1],  //杩斿洖褰撳墠鎵�鎵弿鏉$爜鏄庣粏淇℃伅锛�5锛�
+                    };
+                    objJsonResult.list = columnNameList;
+                    return objJsonResult;
+                }
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "鑾峰彇鍒楄〃淇℃伅澶辫触锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+
+        #endregion
+
         #region 杩斿洖鍗曟嵁鍒楄〃淇℃伅
 
         /// <summary>
@@ -5207,6 +5805,50 @@
                 objJsonResult.Message = "鑾峰彇鍒楄〃淇℃伅澶辫触锛�" + e.ToString();
                 objJsonResult.data = null;
                 return objJsonResult;
+            }
+        }
+
+        #endregion
+
+        #region 鏍¢獙鎵爜妯″潡锛屽垹闄ら�変腑琛屾潯鐮佸嚭鍏ュ簱涓存椂琛ㄨ褰�    20241114
+
+        /// <summary>
+        /// 鎵爜妯″潡锛屽垹闄ら�変腑琛屾潯鐮佸嚭鍏ュ簱涓存椂琛ㄨ褰�
+        /// </summary>
+        /// <returns></returns>
+        [Route("WEBSController/set_DeleteBarCodeByEntryID_BillCheck_New_Json")]
+        [HttpGet]
+        public object set_DeleteBarCodeByEntryID_BillCheck_New_Json(long HInterID, string HBillType, long HSourceInterID, long HSourceEntryID, string HSourceBarCodeCtl)
+        {
+            //鍘熷崟鎹负鎵爜鐢熸垚锛屽鍘熸壂鎻忕殑鏉$爜杩涜鏍稿
+            if (HSourceBarCodeCtl == "Y")
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "鏍¢獙鏉$爜锛屾棤闇�鍒犻櫎锛�";
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+            //鍘熷崟鎹潪鎵爜鐢熸垚
+            else
+            {
+                try
+                {
+                    oCn.RunProc("Delete from KF_PonderationBillMain_Temp where HInterID=" + HInterID.ToString() + " and HBillType='" + HBillType + "' and HSourceInterID=" + HSourceInterID.ToString() + " and HSourceEntryID=" + HSourceEntryID.ToString() + " and HQty<>0 ", ref DBUtility.ClsPub.sExeReturnInfo);
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 1;
+                    objJsonResult.Message = "鍒犻櫎鎴愬姛";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                catch (Exception e)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鍒犻櫎鎵�閫夎鏉$爜鍑哄叆搴撲复鏃惰〃璁板綍澶辫触锛�" + e.ToString();
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
             }
         }
 
@@ -5276,7 +5918,7 @@
 
         #endregion
 
-        #region 缂撳瓨妯″潡    杩斿洖缂撳瓨鍒楄〃淇℃伅
+        #region 鏍¢獙缂撳瓨妯″潡    杩斿洖缂撳瓨鍒楄〃淇℃伅
 
         /// <summary>
         /// 杩斿洖缂撳瓨鍒楄〃淇℃伅    鏍¢獙妯″紡
@@ -5320,6 +5962,186 @@
                 objJsonResult.code = "0";
                 objJsonResult.count = 0;
                 objJsonResult.Message = "鑾峰彇缂撳瓨鍒楄〃淇℃伅澶辫触锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+
+        #endregion
+
+        #region 鏍¢獙缂撳瓨妯″潡    鏍规嵁鍗曟嵁ID,鍒犻櫎涓存椂琛ㄨ褰�    20241216
+
+        /// <summary>
+        /// 鏍规嵁鍗曟嵁ID,鍒犻櫎涓存椂琛ㄨ褰�
+        /// </summary>
+        /// <returns></returns>
+        [Route("WEBSController/DeleteTempBillList_BillCheck_Json")]
+        [HttpGet]
+        public object DeleteTempBillList_BillCheck_Json(long HInterID, string HBillNo, string HBillType, string HMaker, string MvarReportTitle, Int64 HStockOrgID)
+        {
+            string WorkList = "鍒犻櫎鏍¢獙缂撳瓨鍗曟嵁锛屽崟鎹彿锛�" + HBillNo;
+            string SystemName = "WMS-" + MvarReportTitle + "妯″潡";
+            //鑾峰彇绯荤粺鍙傛暟
+            string sErrMsg = "";
+            if (oSystemParameter.ShowBillByOrgID(HStockOrgID, ref sErrMsg) == true)
+            {
+                string sSourceBarCodeCtl = "N";   //鏍¢獙-鏄惁杩涜婧愬崟瀵瑰簲鏉$爜鏍稿锛�'Y'涓烘牳瀵癸級
+
+                #region 绯荤粺鍙傛暟鑾峰彇
+                //閲囪喘鍏ュ簱鍗�
+                if (HBillType == "1201")
+                {
+                    //鏍¢獙-鏄惁杩涜婧愬崟瀵瑰簲鏉$爜鏍稿锛�'Y'涓烘牳瀵癸級
+                    if (oSystemParameter.omodel.Kf_POStockInBillCheck_SourceBarCodeCtl == "Y")
+                    {
+                        sSourceBarCodeCtl = "Y";
+                    }
+                }
+                //鐢熶骇鍏ュ簱鍗�
+                if (HBillType == "1202")
+                {
+                    //鏍¢獙-鏄惁杩涜婧愬崟瀵瑰簲鏉$爜鏍稿锛�'Y'涓烘牳瀵癸級
+                    if (oSystemParameter.omodel.Kf_ProductInBillCheck_SourceBarCodeCtl == "Y")
+                    {
+                        sSourceBarCodeCtl = "Y";
+                    }
+                }
+                //鍏朵粬鍏ュ簱鍗�
+                if (HBillType == "1203")
+                {
+                    //鏍¢獙-鏄惁杩涜婧愬崟瀵瑰簲鏉$爜鏍稿锛�'Y'涓烘牳瀵癸級
+                    if (oSystemParameter.omodel.Kf_OtherInBillCheck_SourceBarCodeCtl == "Y")
+                    {
+                        sSourceBarCodeCtl = "Y";
+                    }
+                }
+                //棰嗘枡鍑哄簱鍗�
+                else if (HBillType == "1204")
+                {
+                    //鏍¢獙-鏄惁杩涜婧愬崟瀵瑰簲鏉$爜鏍稿锛�'Y'涓烘牳瀵癸級
+                    if (oSystemParameter.omodel.Kf_MateOutBillCheck_SourceBarCodeCtl == "Y")
+                    {
+                        sSourceBarCodeCtl = "Y";
+                    }
+                }
+                //閿�鍞嚭搴撳崟
+                else if (HBillType == "1205")
+                {
+                    //鏍¢獙-鏄惁杩涜婧愬崟瀵瑰簲鏉$爜鏍稿锛�'Y'涓烘牳瀵癸級
+                    if (oSystemParameter.omodel.Kf_SellOutBillCheck_SourceBarCodeCtl == "Y")
+                    {
+                        sSourceBarCodeCtl = "Y";
+                    }
+                }
+                //鍏朵粬鍑哄簱鍗�
+                else if (HBillType == "1206")
+                {
+                    //鏍¢獙-鏄惁杩涜婧愬崟瀵瑰簲鏉$爜鏍稿锛�'Y'涓烘牳瀵癸級
+                    if (oSystemParameter.omodel.Kf_OtherOutBillCheck_SourceBarCodeCtl == "Y")
+                    {
+                        sSourceBarCodeCtl = "Y";
+                    }
+                }
+                //濮斿棰嗘枡鍗�
+                else if (HBillType == "1211")
+                {
+                    //鏍¢獙-鏄惁杩涜婧愬崟瀵瑰簲鏉$爜鏍稿锛�'Y'涓烘牳瀵癸級
+                    if (oSystemParameter.omodel.Kf_EntrustOutBillCheck_SourceBarCodeCtl == "Y")
+                    {
+                        sSourceBarCodeCtl = "Y";
+                    }
+                }
+                //鐢熶骇琛ユ枡鍗�
+                else if (HBillType == "1254")
+                {
+                    //鏍¢獙-鏄惁杩涜婧愬崟瀵瑰簲鏉$爜鏍稿锛�'Y'涓烘牳瀵癸級
+                    if (oSystemParameter.omodel.Kf_MateReplenishOutBillCheck_SourceBarCodeCtl == "Y")
+                    {
+                        sSourceBarCodeCtl = "Y";
+                    }
+                }
+                //濮斿琛ユ枡鍗�
+                else if (HBillType == "1255")
+                {
+                    //鏍¢獙-鏄惁杩涜婧愬崟瀵瑰簲鏉$爜鏍稿锛�'Y'涓烘牳瀵癸級
+                    if (oSystemParameter.omodel.Kf_EntrustReplenishOutBillCheck_SourceBarCodeCtl == "Y")
+                    {
+                        sSourceBarCodeCtl = "Y";
+                    }
+                }
+                //鐩存帴璋冩嫧鍗�
+                else if (HBillType == "1207")
+                {
+                    //鏍¢獙-鏄惁杩涜婧愬崟瀵瑰簲鏉$爜鏍稿锛�'Y'涓烘牳瀵癸級
+                    if (oSystemParameter.omodel.Kf_MoveStockBillCheck_SourceBarCodeCtl == "Y")
+                    {
+                        sSourceBarCodeCtl = "Y";
+                    }
+                }
+                #endregion
+
+                //鍘熷崟鎹负鎵爜鐢熸垚锛屽鍘熸壂鎻忕殑鏉$爜杩涜鏍稿锛屽垹闄ゆ潯鐮佸嚭鍏ュ簱鏍¢獙缂撳瓨璁板綍
+                if (sSourceBarCodeCtl == "Y")
+                {
+                    try
+                    {
+                        oCn.BeginTran();
+                        oCn.RunProc("Delete from KF_PonderationBillMain_Temp_Verify where HInterID=" + HInterID.ToString() + " and HBillType='" + HBillType + "'", ref DBUtility.ClsPub.sExeReturnInfo);
+                        //鍐欏叆鏃ュ織
+                        oCn.RunProc("Insert into System_Log(GeginDate,userid,WorkstationName,WorkList,SystemName,NetUserName,State) values " +
+                            "(getdate(),'" + HMaker + "','" + ComputerName + "','" + WorkList + "','" + SystemName + "','','鍒犻櫎')"
+                            );
+                        oCn.Commit();
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 1;
+                        objJsonResult.Message = "鍗曟嵁鍙凤細" + HBillNo + " 鍒犻櫎鎴愬姛";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                    catch (Exception e)
+                    {
+                        oCn.RollBack();
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "鍒犻櫎鎵�閫夊崟鎹潯鐮佸嚭鍏ュ簱涓存椂琛ㄨ褰曞け璐ワ紒" + e.ToString();
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                }
+                //鍘熷崟鎹潪鎵爜鐢熸垚锛屽垹闄ゆ潯鐮佸嚭鍏ュ簱缂撳瓨鍒楄〃璁板綍
+                else
+                {
+                    try
+                    {
+                        oCn.BeginTran();
+                        oCn.RunProc("Delete from KF_PonderationBillMain_Temp where HInterID=" + HInterID.ToString() + " and HBillType='" + HBillType + "' and HSubBillType=1", ref DBUtility.ClsPub.sExeReturnInfo);
+                        //鍐欏叆鏃ュ織
+                        oCn.RunProc("Insert into System_Log(GeginDate,userid,WorkstationName,WorkList,SystemName,NetUserName,State) values " +
+                            "(getdate(),'" + HMaker + "','" + ComputerName + "','" + WorkList + "','" + SystemName + "','','鍒犻櫎')"
+                            );
+                        oCn.Commit();
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 1;
+                        objJsonResult.Message = "鍗曟嵁鍙凤細" + HBillNo + " 鍒犻櫎鎴愬姛";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                    catch (Exception e)
+                    {
+                        oCn.RollBack();
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "鍒犻櫎鎵�閫夊崟鎹潯鐮佸嚭鍏ュ簱涓存椂琛ㄨ褰曞け璐ワ紒" + e.ToString();
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                }
+            }
+            else
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "鑾峰彇绯荤粺鍙傛暟澶辫触锛� " + sErrMsg;
                 objJsonResult.data = null;
                 return objJsonResult;
             }
@@ -5389,6 +6211,227 @@
                         objJsonResult.data = null;
                         return objJsonResult;
                     }
+                }
+            }
+            else
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "鑾峰彇绯荤粺鍙傛暟澶辫触锛� " + sErrMsg;
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+
+        #endregion
+
+        #region 鏍¢獙缂撳瓨妯″潡  宸蹭笂浼犳煡璇㈢晫闈㈠埛鏂�   20241216
+
+        /// <summary>
+        /// 宸蹭笂浼犳煡璇㈢晫闈紝鏍规嵁鍗曟嵁绫诲瀷銆佸崟鎹彿銆佺敤鎴锋煡璇㈠凡涓婁紶鍗曟嵁淇℃伅
+        /// </summary>
+        /// <returns></returns>
+        [Route("WEBSController/GetKf_ICStockBillQueryList_User_BillCheck_Json")]
+        [HttpGet]
+        public object GetKf_ICStockBillQueryList_User_BillCheck_Json(string HBillType, string HBillNo, string HMaker, Int64 HStockOrgID)
+        {
+            try
+            {
+                ds = oCn.RunProcReturn("exec h_p_Kf_ICStockBillQueryByUserList_BillCheck '" + HBillType + "','" + HBillNo + "','" + HMaker + "'," + HStockOrgID.ToString(), "h_p_Kf_ICStockBillQueryByUserList_BillCheck");
+                if (ds == null || ds.Tables[0].Rows.Count == 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鏌ヨ涓嶅埌璇ュ崟鎹褰曪紒";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                else
+                {
+                    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鍒楀璞$殑鍒楀悕
+                    }
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 1;
+                    objJsonResult.Message = "鑾峰彇鍗曟嵁淇℃伅鎴愬姛锛�";
+                    objJsonResult.data = ds.Tables[0];
+                    objJsonResult.list = columnNameList;
+                    return objJsonResult;
+                }
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "鑾峰彇宸蹭笂浼犲崟鎹俊鎭け璐ワ紒" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+
+        #endregion
+
+        #region 鏍¢獙缂撳瓨妯″潡  宸蹭笂浼犲垪琛ㄧ晫闈紝鎾ら攢鍔熻兘锛屽垹闄MS琛ㄨ褰曪紝骞舵洿鏂癟EMP琛ㄤ腑鐨勪笂浼犲瓧娈� HRelationInterID=0     20241216
+
+        /// <summary>
+        /// 宸蹭笂浼犲垪琛ㄧ晫闈紝鎾ら攢鍔熻兘锛屽垹闄MS琛ㄨ褰曪紝骞舵洿鏂癟EMP琛ㄤ腑鐨勪笂浼犲瓧娈� HRelationInterID=0
+        /// </summary>
+        /// <returns></returns>
+        [Route("WEBSController/set_DeleteICStockBillAndWMS_BillCheck_Json")]
+        [HttpGet]
+        public object set_DeleteICStockBillAndWMS_BillCheck_Json(Int64 HInterID, string HBillNo, string HBillType, string HMaker, string MvarReportTitle, Int64 HStockOrgID)
+        {
+            string WorkList = "鎾ら攢鏍¢獙宸蹭笂浼犲崟鎹紝鍗曟嵁鍙凤細" + HBillNo;
+            string SystemName = "WMS-" + MvarReportTitle + "妯″潡";
+            //鑾峰彇绯荤粺鍙傛暟
+            string sErrMsg = "";
+            if (oSystemParameter.ShowBillByOrgID(HStockOrgID, ref sErrMsg) == true)
+            {
+                string sERPMode = oSystemParameter.omodel.WMS_WMSStockCtl_ERPMode;   //搴撳瓨鎺у埗-WMS搴撳瓨鎺у埗ERP妯″紡	(WISE銆丆LOUD銆丮ES)
+                string sSourceBarCodeCtl = "N";   //鏍¢獙-鏄惁杩涜婧愬崟瀵瑰簲鏉$爜鏍稿锛�'Y'涓烘牳瀵癸級
+
+                #region 绯荤粺鍙傛暟鑾峰彇
+                //閲囪喘鍏ュ簱鍗�
+                if (HBillType == "1201")
+                {
+                    //鏍¢獙-鏄惁杩涜婧愬崟瀵瑰簲鏉$爜鏍稿锛�'Y'涓烘牳瀵癸級
+                    if (oSystemParameter.omodel.Kf_POStockInBillCheck_SourceBarCodeCtl == "Y")
+                    {
+                        sSourceBarCodeCtl = "Y";
+                    }
+                }
+                //鐢熶骇鍏ュ簱鍗�
+                if (HBillType == "1202")
+                {
+                    //鏍¢獙-鏄惁杩涜婧愬崟瀵瑰簲鏉$爜鏍稿锛�'Y'涓烘牳瀵癸級
+                    if (oSystemParameter.omodel.Kf_ProductInBillCheck_SourceBarCodeCtl == "Y")
+                    {
+                        sSourceBarCodeCtl = "Y";
+                    }
+                }
+                //鍏朵粬鍏ュ簱鍗�
+                if (HBillType == "1203")
+                {
+                    //鏍¢獙-鏄惁杩涜婧愬崟瀵瑰簲鏉$爜鏍稿锛�'Y'涓烘牳瀵癸級
+                    if (oSystemParameter.omodel.Kf_OtherInBillCheck_SourceBarCodeCtl == "Y")
+                    {
+                        sSourceBarCodeCtl = "Y";
+                    }
+                }
+                //棰嗘枡鍑哄簱鍗�
+                else if (HBillType == "1204")
+                {
+                    //鏍¢獙-鏄惁杩涜婧愬崟瀵瑰簲鏉$爜鏍稿锛�'Y'涓烘牳瀵癸級
+                    if (oSystemParameter.omodel.Kf_MateOutBillCheck_SourceBarCodeCtl == "Y")
+                    {
+                        sSourceBarCodeCtl = "Y";
+                    }
+                }
+                //閿�鍞嚭搴撳崟
+                else if (HBillType == "1205")
+                {
+                    //鏍¢獙-鏄惁杩涜婧愬崟瀵瑰簲鏉$爜鏍稿锛�'Y'涓烘牳瀵癸級
+                    if (oSystemParameter.omodel.Kf_SellOutBillCheck_SourceBarCodeCtl == "Y")
+                    {
+                        sSourceBarCodeCtl = "Y";
+                    }
+                }
+                //鍏朵粬鍑哄簱鍗�
+                else if (HBillType == "1206")
+                {
+                    //鏍¢獙-鏄惁杩涜婧愬崟瀵瑰簲鏉$爜鏍稿锛�'Y'涓烘牳瀵癸級
+                    if (oSystemParameter.omodel.Kf_OtherOutBillCheck_SourceBarCodeCtl == "Y")
+                    {
+                        sSourceBarCodeCtl = "Y";
+                    }
+                }
+                //濮斿棰嗘枡鍗�
+                else if (HBillType == "1211")
+                {
+                    //鏍¢獙-鏄惁杩涜婧愬崟瀵瑰簲鏉$爜鏍稿锛�'Y'涓烘牳瀵癸級
+                    if (oSystemParameter.omodel.Kf_EntrustOutBillCheck_SourceBarCodeCtl == "Y")
+                    {
+                        sSourceBarCodeCtl = "Y";
+                    }
+                }
+                //鐢熶骇琛ユ枡鍗�
+                else if (HBillType == "1254")
+                {
+                    //鏍¢獙-鏄惁杩涜婧愬崟瀵瑰簲鏉$爜鏍稿锛�'Y'涓烘牳瀵癸級
+                    if (oSystemParameter.omodel.Kf_MateReplenishOutBillCheck_SourceBarCodeCtl == "Y")
+                    {
+                        sSourceBarCodeCtl = "Y";
+                    }
+                }
+                //濮斿琛ユ枡鍗�
+                else if (HBillType == "1255")
+                {
+                    //鏍¢獙-鏄惁杩涜婧愬崟瀵瑰簲鏉$爜鏍稿锛�'Y'涓烘牳瀵癸級
+                    if (oSystemParameter.omodel.Kf_EntrustReplenishOutBillCheck_SourceBarCodeCtl == "Y")
+                    {
+                        sSourceBarCodeCtl = "Y";
+                    }
+                }
+                //鐩存帴璋冩嫧鍗�
+                else if (HBillType == "1207")
+                {
+                    //鏍¢獙-鏄惁杩涜婧愬崟瀵瑰簲鏉$爜鏍稿锛�'Y'涓烘牳瀵癸級
+                    if (oSystemParameter.omodel.Kf_MoveStockBillCheck_SourceBarCodeCtl == "Y")
+                    {
+                        sSourceBarCodeCtl = "Y";
+                    }
+                }
+                #endregion
+
+                try
+                {
+                    oCn.BeginTran();
+                    ds = oCn.RunProcReturn("exec h_p_WMS_ICStockBillAndWMS_Delete_BillCheck " + HInterID + ",'" + HBillNo + "','" + HBillType + "','" + sSourceBarCodeCtl + "','" + sERPMode + "'", "h_p_WMS_ICStockBillAndWMS_Delete_BillCheck");
+                    if (ds == null || ds.Tables[0].Rows.Count == 0)
+                    {
+                        oCn.RollBack();
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "鎾ら攢鍗曟嵁宸蹭笂浼犺褰曞け璐ワ紝鎾ら攢鍗曟嵁鍒ゆ柇閿欒锛�";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                    else if (DBUtility.ClsPub.isLong(ds.Tables[0].Rows[0]["HBack"]) == 1)
+                    {
+                        oCn.RollBack();
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;  //澶辫触锛�
+                        objJsonResult.Message = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HRemark"]);
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                    else
+                    {
+                        //鍐欏叆鏃ュ織
+                        oCn.RunProc("Insert into  System_Log(GeginDate,userid,WorkstationName,WorkList,SystemName,NetUserName,State) values " +
+                            "(getdate(),'" + HMaker + "','" + ComputerName + "','" + WorkList + "','" + SystemName + "','','鎾ら攢')"
+                            );
+                        oCn.Commit();
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 1;  //鎴愬姛锛�
+                        objJsonResult.Message = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HRemark"]);
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                }
+                catch (Exception e)
+                {
+                    oCn.RollBack();
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鎾ら攢鍗曟嵁宸蹭笂浼犺褰曞け璐ワ紒" + e.ToString();
+                    objJsonResult.data = null;
+                    return objJsonResult;
                 }
             }
             else
@@ -8035,6 +9078,179 @@
             }
         }
         #endregion
+
+        #region 閿�鍞嚭搴撹拷婧褰曟姤琛�
+        /// <summary>
+        /// 鑾峰彇閿�鍞嚭搴撹拷婧褰�
+        /// </summary>
+        /// <returns></returns>
+        [Route("WEBSController/GetKf_SellOutBarTraceReport_Json")]
+        [HttpGet]
+        public object GetKf_SellOutBarTraceReport_Json(DateTime HBeginDate, DateTime HEndDate, string HBarCode, Int64 HStockOrgID, string HWhere)
+        {
+            try
+            {
+                ds = oCn.RunProcReturn("exec h_p_Kf_SellOutBarTraceReport '" + HBeginDate.ToShortDateString() + "','" + HEndDate.ToShortDateString() + "','" + HBarCode + "'," + HStockOrgID.ToString() + ",'" + HWhere + "'", "h_p_Kf_SellOutBarTraceReport");
+                
+                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鍒楀璞$殑鍒楀悕
+                }
+                objJsonResult.code = "0";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "鎴愬姛锛�";
+                objJsonResult.data = ds.Tables[0];
+                objJsonResult.list = columnNameList;
+                return objJsonResult;
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "鏌ヨ閿�鍞嚭搴撹拷婧褰曚俊鎭け璐ワ紒" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
+
+        #region 浠撳簱鍑哄叆搴撴姤琛�
+
+
+        #region 鑾峰彇鍗曟嵁绫诲瀷淇℃伅
+        /// <summary>
+        /// 鑾峰彇鍗曟嵁绫诲瀷淇℃伅
+        /// </summary>
+        /// <returns></returns>
+        [Route("WEBSController/GetICStockBill_BillType_Json")]
+        [HttpGet]
+        public object GetICStockBill_BillType_Json()
+        {
+            try
+            {
+                ds = oCn.RunProcReturn("exec h_p_KF_StockInOutReport_BillType ", "h_p_KF_StockInOutReport_BillType");
+                objJsonResult.code = "0";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "鎴愬姛锛�";
+                objJsonResult.data = ds.Tables[0];
+                return objJsonResult;
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "鑾峰彇鍗曟嵁绫诲瀷淇℃伅澶辫触锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
+
+        #region 浠撳簱鍑哄叆搴撴槑缁嗘姤琛�
+        /// <summary>
+        /// 浠撳簱鍑哄叆搴撴槑缁嗘姤琛�
+        /// </summary>
+        /// <returns></returns>
+        [Route("WEBSController/GetKF_StockInOutEntryReport_Json")]
+        [HttpGet]
+        public object GetKF_StockInOutEntryReport_Json(string sWhere)
+        {
+            try
+            {
+                ds = oCn.RunProcReturn("exec h_p_KF_StockInOutEntryReport " + sWhere, "h_p_KF_StockInOutEntryReport");
+                if (ds == null || ds.Tables[0].Rows.Count == 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "褰撳墠鎵�杈撳叆杩囨护鏉′欢锛屾病鏈夎繑鍥炰换浣曠粨鏋滐紒";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                else
+                {
+                    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鍒楀璞$殑鍒楀悕
+                    }
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 1;
+                    objJsonResult.Message = "鎴愬姛锛�";
+                    objJsonResult.data = ds.Tables[0];
+                    objJsonResult.list = columnNameList;
+                    return objJsonResult;
+                }
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "鏌ヨ浠撳簱鍑哄叆搴撴槑缁嗘姤琛ㄥけ璐ワ紒" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
+
+        #region 浠撳簱鍑哄叆搴撹褰曟姤琛�
+        /// <summary>
+        /// 浠撳簱鍑哄叆搴撹褰曟姤琛�
+        /// </summary>
+        /// <returns></returns>
+        [Route("WEBSController/GetKF_StockInOutRecordReport_Json")]
+        [HttpGet]
+        public object GetKF_StockInOutRecordReport_Json(string sWhere)
+        {
+            try
+            {
+                ds = oCn.RunProcReturn("exec h_p_KF_StockInOutRecordReport " + sWhere, "h_p_KF_StockInOutRecordReport");
+                if (ds == null || ds.Tables[0].Rows.Count == 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "褰撳墠鎵�杈撳叆杩囨护鏉′欢锛屾病鏈夎繑鍥炰换浣曠粨鏋滐紒";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                else
+                {
+                    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鍒楀璞$殑鍒楀悕
+                    }
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 1;
+                    objJsonResult.Message = "鎴愬姛锛�";
+                    objJsonResult.data = ds.Tables[0];
+                    objJsonResult.list = columnNameList;
+                    return objJsonResult;
+                }
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "鏌ヨ浠撳簱鍑哄叆搴撹褰曚俊鎭け璐ワ紒" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
+
+        #endregion
+
+
         #endregion
 
         #region 瀹㈡埛鏉$爜鎵弿璁板綍鍗�

--
Gitblit v1.9.1