From b8d7145eadce706aef50ef95be75cff9ef79b518 Mon Sep 17 00:00:00 2001
From: llj <132905093+newwwwwwtree@users.noreply.github.com>
Date: 星期五, 31 十月 2025 09:01:20 +0800
Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API

---
 WebAPI/Controllers/条码管理/WEBSController.cs |  413 ++++++++++++++++++++++++++++++++++++++++++++++------------
 1 files changed, 326 insertions(+), 87 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 453190c..39c37af 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"
@@ -112,6 +112,8 @@
 
         #region 鐢ㄦ埛妯″潡鏉冮檺鍒ゆ柇
 
+        #region 鐢ㄦ埛妯″潡鏉冮檺鍒ゆ柇    鍒ゆ柇閲戣澏璐﹀彿鏄惁姝g‘
+
         /// <summary>
         /// 杩涘叆妯″潡鏃惰繘琛岀敤鎴锋潈闄愬垽鏂�
         /// </summary>
@@ -184,6 +186,48 @@
                 return objJsonResult;
             }
         }
+
+        #endregion
+
+        #region 鐢ㄦ埛妯″潡鏉冮檺鍒ゆ柇
+
+        /// <summary>
+        /// 杩涘叆妯″潡鏃惰繘琛岀敤鎴锋潈闄愬垽鏂�
+        /// </summary>
+        /// <returns></returns>
+        [Route("WEBSController/CheckModRight_ERP_Json")]
+        [HttpGet]
+        public object CheckModRight_ERP_Json(string ModRightName, string HUserName)
+        {
+            try
+            {
+                //鍒ゆ柇鏉冮檺
+                if (!DBUtility.ClsPub.Security_Log(ModRightName, 3, false, HUserName))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鎮ㄦ病鏈夊搴旀ā鍧楁潈闄�,璇蜂笌绠$悊鍛樿仈绯伙紒";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
+                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;
+            }
+        }
+
+        #endregion
 
         #endregion
 
@@ -381,12 +425,50 @@
             {
                 Int64 HWhID = 0;
                 HWhID = DBUtility.ClsPub.isLong(HBarCode.Replace("HWH", ""));
-                ds = oCn.RunProcReturn("select HItemID,HNumber,HName,HSPFlag from Gy_Warehouse with(nolock) where HStopflag=0 and HItemID=" + HWhID.ToString() + " and HUSEORGID = " + HStockOrgID.ToString(), "Gy_Warehouse");
+                ds = oCn.RunProcReturn("exec h_p_Gy_Warehouse_PDA " + HWhID.ToString() + "," + HStockOrgID.ToString(), "h_p_Gy_Warehouse_PDA");
                 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;
+            }
+        }
+
+        /// <summary>
+        /// 鑾峰彇PDA浠撳簱鍒楄〃淇℃伅
+        /// </summary>
+        /// <returns></returns>
+        [Route("WEBSController/GetWarehouseList_Json")]
+        [HttpGet]
+        public object GetWarehouseList_Json(string Warehouse, Int64 HStockOrgID)
+        {
+            try
+            {
+                ds = oCn.RunProcReturn("exec h_p_Gy_WarehouseList_PDA '" + Warehouse + "'," + HStockOrgID.ToString(), "h_p_Gy_WarehouseList_PDA");
+                if (ds == null || ds.Tables[0].Rows.Count == 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "娌℃湁杩斿洖浠讳綍浠撳簱璁板綍锛�";
                     objJsonResult.data = null;
                     return objJsonResult;
                 }
@@ -2511,6 +2593,7 @@
                 websLsmain.HInterID = lsmain[0].HInterID;
                 websLsmain.HBillNo = lsmain[0].HBillNo;
                 websLsmain.HBillType = "1202";
+                websLsmain.HMaker = lsmain[0].HMaker;
                 websLsmain.HSTOCKORGID = lsmain[0].HSTOCKORGID;
 
                 if (oWebs.set_SaveProductInBill_BillCheck(websLsmain, ref DBUtility.ClsPub.sErrInfo))
@@ -2652,6 +2735,7 @@
                 websLsmain.HInterID = lsmain[0].HInterID;
                 websLsmain.HBillNo = lsmain[0].HBillNo;
                 websLsmain.HBillType = "1201";
+                websLsmain.HMaker = lsmain[0].HMaker;
                 websLsmain.HSTOCKORGID = lsmain[0].HSTOCKORGID;
 
                 if (oWebs.set_SavePOStockInBill_BillCheck(websLsmain, ref DBUtility.ClsPub.sErrInfo))
@@ -2877,6 +2961,7 @@
                 websLsmain.HInterID = lsmain[0].HInterID;
                 websLsmain.HBillNo = lsmain[0].HBillNo;
                 websLsmain.HBillType = "1203";
+                websLsmain.HMaker = lsmain[0].HMaker;
                 websLsmain.HSTOCKORGID = lsmain[0].HSTOCKORGID;
 
                 if (oWebs.set_SaveOtherInBill_BillCheck(websLsmain, ref DBUtility.ClsPub.sErrInfo))
@@ -3031,6 +3116,7 @@
                 websLsmain.HInterID = lsmain[0].HInterID;
                 websLsmain.HBillNo = lsmain[0].HBillNo;
                 websLsmain.HBillType = "1204";
+                websLsmain.HMaker = lsmain[0].HMaker;
                 websLsmain.HSTOCKORGID = lsmain[0].HSTOCKORGID;
 
                 if (oWebs.set_SaveMateOutBill_BillCheck(websLsmain, ref DBUtility.ClsPub.sErrInfo))
@@ -3271,6 +3357,7 @@
                 websLsmain.HInterID = lsmain[0].HInterID;
                 websLsmain.HBillNo = lsmain[0].HBillNo;
                 websLsmain.HBillType = "1205";
+                websLsmain.HMaker = lsmain[0].HMaker;
                 websLsmain.HSTOCKORGID = lsmain[0].HSTOCKORGID;
 
                 if (oWebs.set_SaveSellOutBill_BillCheck(websLsmain, ref DBUtility.ClsPub.sErrInfo))
@@ -3410,6 +3497,7 @@
                 websLsmain.HInterID = lsmain[0].HInterID;
                 websLsmain.HBillNo = lsmain[0].HBillNo;
                 websLsmain.HBillType = "1211";
+                websLsmain.HMaker = lsmain[0].HMaker;
                 websLsmain.HSTOCKORGID = lsmain[0].HSTOCKORGID;
 
                 if (oWebs.set_SaveEntrustOutBill_BillCheck(websLsmain, ref DBUtility.ClsPub.sErrInfo))
@@ -3548,6 +3636,7 @@
                 websLsmain.HInterID = lsmain[0].HInterID;
                 websLsmain.HBillNo = lsmain[0].HBillNo;
                 websLsmain.HBillType = "1206";
+                websLsmain.HMaker = lsmain[0].HMaker;
                 websLsmain.HSTOCKORGID = lsmain[0].HSTOCKORGID;
 
                 if (oWebs.set_SaveOtherOutBill_BillCheck(websLsmain, ref DBUtility.ClsPub.sErrInfo))
@@ -3685,6 +3774,7 @@
                 websLsmain.HInterID = lsmain[0].HInterID;
                 websLsmain.HBillNo = lsmain[0].HBillNo;
                 websLsmain.HBillType = "1254";
+                websLsmain.HMaker = lsmain[0].HMaker;
                 websLsmain.HSTOCKORGID = lsmain[0].HSTOCKORGID;
 
                 if (oWebs.set_SaveMateReplenishOutBill_BillCheck(websLsmain, ref DBUtility.ClsPub.sErrInfo))
@@ -3744,6 +3834,7 @@
                 websLsmain.HInterID = lsmain[0].HInterID;
                 websLsmain.HBillNo = lsmain[0].HBillNo;
                 websLsmain.HBillType = "1255";
+                websLsmain.HMaker = lsmain[0].HMaker;
                 websLsmain.HSTOCKORGID = lsmain[0].HSTOCKORGID;
 
                 if (oWebs.set_SaveEntrustReplenishOutBill_BillCheck(websLsmain, ref DBUtility.ClsPub.sErrInfo))
@@ -3789,96 +3880,116 @@
         [HttpPost]
         public object set_SaveMoveStockBill_Json([FromBody] JObject oMain)
         {
-            var _value = oMain["oMain"].ToString();
-            string msg1 = _value.ToString();
-            try
+            //鑾峰彇绯荤粺鍙傛暟
+            string sErrMsg = "";
+            if (oSystemParameter.ShowBill(ref sErrMsg) == true)
             {
-                List<Model.ClsKf_MoveStockBillMain> lsmain = new List<Model.ClsKf_MoveStockBillMain>();
-                ListModels oListModels = new ListModels();
-                lsmain = oListModels.getMoveStockBillMainByJson(msg1);
-                WebS.ClsKf_MoveStockBillMain websLsmain = new WebS.ClsKf_MoveStockBillMain();
-                string sSourceType = lsmain[0].HMainSourceBillType;
-                websLsmain.HInterID = lsmain[0].HInterID;
-                websLsmain.HBillNo = lsmain[0].HBillNo;
-                websLsmain.HBillType = lsmain[0].HBillType;
-                websLsmain.HDate = lsmain[0].HDate;
-                websLsmain.HDeptID = lsmain[0].HDeptID;
-                websLsmain.HWHID = lsmain[0].HWHID;
-                websLsmain.HSCWHID = lsmain[0].HSCWHID;
-                websLsmain.HSupID = lsmain[0].HSupID;
-                websLsmain.HKeeperID = lsmain[0].HKeeperID;
-                websLsmain.HSecManagerID = lsmain[0].HSecManagerID;
-                websLsmain.HEmpID = lsmain[0].HEmpID;
-                websLsmain.HManagerID = lsmain[0].HManagerID;
-                websLsmain.HRemark = lsmain[0].HRemark;
-                websLsmain.HExplanation = lsmain[0].HExplanation;
-                websLsmain.HInnerBillNo = lsmain[0].HInnerBillNo;
-                websLsmain.HRedBlueFlag = lsmain[0].HRedBlueFlag;
-                websLsmain.HBillSubType = lsmain[0].HBillSubType;
-                websLsmain.HStockStyle = lsmain[0].HStockStyle;
-                websLsmain.HTransferDirect = lsmain[0].HTransferDirect;
-                websLsmain.HShipType = lsmain[0].HShipType;
-                if (lsmain[0].HMainSourceBillType == "1402")
+                var _value = oMain["oMain"].ToString();
+                string msg1 = _value.ToString();
+                try
                 {
-                    websLsmain.HMainSourceBillType = "鍙戣揣閫氱煡鍗�";
-                }
-                else if (lsmain[0].HMainSourceBillType == "1243")
-                {
-                    websLsmain.HMainSourceBillType = "璋冩嫧鐢宠鍗�";
-                }
-                else if (lsmain[0].HMainSourceBillType == "3720")
-                {
-                    websLsmain.HMainSourceBillType = "鐢熶骇鐢ㄦ枡娓呭崟";
-                }
-                else if (lsmain[0].HMainSourceBillType == "1604")
-                {
-                    websLsmain.HMainSourceBillType = "濮斿鐢ㄦ枡娓呭崟";
-                }
-                else if (lsmain[0].HMainSourceBillType == "1214")
-                {
-                    websLsmain.HMainSourceBillType = "鐢熶骇鍙戞枡閫氱煡鍗�";
-                }
-                else if (lsmain[0].HMainSourceBillType == "3721")
-                {
-                    websLsmain.HMainSourceBillType = "鐢熶骇澶囨枡鍗�";
-                }
-                else if (lsmain[0].HMainSourceBillType == "1242")
-                {
-                    websLsmain.HMainSourceBillType = "鍑哄簱鐢宠鍗�";
-                }
-                else
-                {
-                    websLsmain.HMainSourceBillType = "鎵嬪伐褰曞叆";
-                }
-                websLsmain.HMaker = lsmain[0].HMaker;
-                websLsmain.HBillerID = lsmain[0].HBillerID;
-                websLsmain.HStockInOrgID = lsmain[0].HStockInOrgID;
-                websLsmain.HStockOutOrgID = lsmain[0].HStockOutOrgID;
-                websLsmain.HSTOCKORGID = lsmain[0].HStockOutOrgID;
-                websLsmain.HOWNERID = lsmain[0].HStockOutOrgID;
+                    List<Model.ClsKf_MoveStockBillMain> lsmain = new List<Model.ClsKf_MoveStockBillMain>();
+                    ListModels oListModels = new ListModels();
+                    lsmain = oListModels.getMoveStockBillMainByJson(msg1);
+                    WebS.ClsKf_MoveStockBillMain websLsmain = new WebS.ClsKf_MoveStockBillMain();
+                    string sSourceType = lsmain[0].HMainSourceBillType;
+                    websLsmain.HInterID = lsmain[0].HInterID;
+                    websLsmain.HBillNo = lsmain[0].HBillNo;
+                    websLsmain.HBillType = lsmain[0].HBillType;
+                    websLsmain.HDate = lsmain[0].HDate;
+                    websLsmain.HDeptID = lsmain[0].HDeptID;
+                    websLsmain.HWHID = lsmain[0].HWHID;
+                    websLsmain.HSCWHID = lsmain[0].HSCWHID;
+                    if (oSystemParameter.omodel.WMS_CampanyName == "灏忓崼") //绯荤粺鍙傛暟  瀹㈡埛瀹氬埗鍖栧悕绉�     绌虹櫧涓洪�氱敤
+                    {
+                        websLsmain.HSupID = lsmain[0].HCusID;
+                    }
+                    else
+                    {
+                        websLsmain.HSupID = lsmain[0].HSupID;
+                    }
+                    websLsmain.HKeeperID = lsmain[0].HKeeperID;
+                    websLsmain.HSecManagerID = lsmain[0].HSecManagerID;
+                    websLsmain.HEmpID = lsmain[0].HEmpID;
+                    websLsmain.HManagerID = lsmain[0].HManagerID;
+                    websLsmain.HRemark = lsmain[0].HRemark;
+                    websLsmain.HExplanation = lsmain[0].HExplanation;
+                    websLsmain.HInnerBillNo = lsmain[0].HInnerBillNo;
+                    websLsmain.HRedBlueFlag = lsmain[0].HRedBlueFlag;
+                    websLsmain.HBillSubType = lsmain[0].HBillSubType;
+                    websLsmain.HStockStyle = lsmain[0].HStockStyle;
+                    websLsmain.HTransferDirect = lsmain[0].HTransferDirect;
+                    websLsmain.HShipType = lsmain[0].HShipType;
+                    if (lsmain[0].HMainSourceBillType == "1402")
+                    {
+                        websLsmain.HMainSourceBillType = "鍙戣揣閫氱煡鍗�";
+                    }
+                    else if (lsmain[0].HMainSourceBillType == "1243")
+                    {
+                        websLsmain.HMainSourceBillType = "璋冩嫧鐢宠鍗�";
+                    }
+                    else if (lsmain[0].HMainSourceBillType == "3720")
+                    {
+                        websLsmain.HMainSourceBillType = "鐢熶骇鐢ㄦ枡娓呭崟";
+                    }
+                    else if (lsmain[0].HMainSourceBillType == "1604")
+                    {
+                        websLsmain.HMainSourceBillType = "濮斿鐢ㄦ枡娓呭崟";
+                    }
+                    else if (lsmain[0].HMainSourceBillType == "1214")
+                    {
+                        websLsmain.HMainSourceBillType = "鐢熶骇鍙戞枡閫氱煡鍗�";
+                    }
+                    else if (lsmain[0].HMainSourceBillType == "3721")
+                    {
+                        websLsmain.HMainSourceBillType = "鐢熶骇澶囨枡鍗�";
+                    }
+                    else if (lsmain[0].HMainSourceBillType == "1242")
+                    {
+                        websLsmain.HMainSourceBillType = "鍑哄簱鐢宠鍗�";
+                    }
+                    else
+                    {
+                        websLsmain.HMainSourceBillType = "鎵嬪伐褰曞叆";
+                    }
+                    websLsmain.HMaker = lsmain[0].HMaker;
+                    websLsmain.HBillerID = lsmain[0].HBillerID;
+                    websLsmain.HStockInOrgID = lsmain[0].HStockInOrgID;
+                    websLsmain.HStockOutOrgID = lsmain[0].HStockOutOrgID;
+                    websLsmain.HSTOCKORGID = lsmain[0].HStockOutOrgID;
+                    websLsmain.HOWNERID = lsmain[0].HStockOutOrgID;
 
-                if (oWebs.set_SaveMoveStockBill(websLsmain, sSourceType, ref DBUtility.ClsPub.sErrInfo))
-                {
-                    objJsonResult.code = "0";
-                    objJsonResult.count = 1;
-                    objJsonResult.Message = DBUtility.ClsPub.sErrInfo;  //鎴愬姛锛�
-                    objJsonResult.data = null;
-                    return objJsonResult;
+                    if (oWebs.set_SaveMoveStockBill(websLsmain, sSourceType, 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;
+                    }
                 }
-                else
+                catch (Exception e)
                 {
                     objJsonResult.code = "0";
                     objJsonResult.count = 0;
-                    objJsonResult.Message = DBUtility.ClsPub.sErrInfo;  //澶辫触锛�
+                    objJsonResult.Message = "鐩存帴璋冩嫧鍗曚笂浼犲け璐ワ紒" + e.ToString();
                     objJsonResult.data = null;
                     return objJsonResult;
                 }
             }
-            catch (Exception e)
+            else
             {
                 objJsonResult.code = "0";
                 objJsonResult.count = 0;
-                objJsonResult.Message = "鐩存帴璋冩嫧鍗曚笂浼犲け璐ワ紒" + e.ToString();
+                objJsonResult.Message = "鑾峰彇绯荤粺鍙傛暟澶辫触锛� " + sErrMsg;
                 objJsonResult.data = null;
                 return objJsonResult;
             }
@@ -4031,6 +4142,7 @@
                 websLsmain.HInterID = lsmain[0].HInterID;
                 websLsmain.HBillNo = lsmain[0].HBillNo;
                 websLsmain.HBillType = "1207";
+                websLsmain.HMaker = lsmain[0].HMaker;
                 websLsmain.HSTOCKORGID = lsmain[0].HSTOCKORGID;
 
                 if (oWebs.set_SaveMoveStockBill_BillCheck(websLsmain, ref DBUtility.ClsPub.sErrInfo))
@@ -4325,6 +4437,10 @@
                 {
                     websLsmain.HMainSourceBillType = "閫�鏂欓�氱煡鍗�";
                 }
+                else if (lsmain[0].HMainSourceBillType == "1201")
+                {
+                    websLsmain.HMainSourceBillType = "閲囪喘鍏ュ簱鍗�";
+                }
                 else
                 {
                     websLsmain.HMainSourceBillType = "鎵嬪伐褰曞叆";
@@ -4406,6 +4522,10 @@
                 if (lsmain[0].HMainSourceBillType == "3720")
                 {
                     websLsmain.HMainSourceBillType = "鐢熶骇鐢ㄦ枡娓呭崟";
+                }
+                else if (lsmain[0].HMainSourceBillType == "1204")
+                {
+                    websLsmain.HMainSourceBillType = "鐢熶骇棰嗘枡鍗�";
                 }
                 else
                 {
@@ -7535,6 +7655,55 @@
 
         #endregion
 
+        #region 鏍¢獙妯″潡    杩斿洖婧愬崟鍒楄〃淇℃伅
+        /// <summary>
+        /// 婧愬崟鍒楄〃淇℃伅锛屾牴鎹崟鎹被鍨嬨�佺粍缁嘔D杩斿洖婧愬崟鍒楄〃淇℃伅
+        /// </summary>
+        /// <returns></returns>
+        [Route("WEBSController/GetCheckBillList_Json")]
+        [HttpGet]
+        public object GetCheckBillList_Json(string HBillType, Int64 HStockOrgID, string HBillNo, string HMater, string HCustom)
+        {
+            try
+            {
+                ds = oCn.RunProcReturn("exec h_p_WMS_GetCheckBillList '" + HBillType  + "'," + HStockOrgID.ToString() + ",'" + HBillNo + "','" + HMater + "','" + HCustom + "'", "h_p_WMS_GetCheckBillList");
+                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
 
 
@@ -7552,13 +7721,20 @@
         {
             try
             {
-                WebS.ClsGy_BarCodeBill_WMS_Model WebSoBarModel = new WebS.ClsGy_BarCodeBill_WMS_Model();
-                WebSoBarModel = oWebs.get_PackBarCode_PackUnionBill(HInterID, HBillNo, HBillType, HBarCode_Pack, HMaker, HStockOrgID, ref DBUtility.ClsPub.sErrInfo);
-                if (WebSoBarModel == null)
+                ds = oCn.RunProcReturn("exec h_p_WMS_AddPackBarCode_PackUnionBill " + HInterID.ToString() + ",'" + HBillNo + "','" + HBillType + "','" + HBarCode_Pack + "','" + HMaker + "'," + HStockOrgID.ToString(), "h_p_WMS_AddPackBarCode_PackUnionBill");
+                if (ds == null || ds.Tables[0].Rows.Count == 0)
                 {
                     objJsonResult.code = "0";
                     objJsonResult.count = 0;
-                    objJsonResult.Message = DBUtility.ClsPub.sErrInfo;
+                    objJsonResult.Message = "鎵弿鎵樻潯鐮佸彂鐢熼敊璇紒";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                else if (DBUtility.ClsPub.isLong(ds.Tables[0].Rows[0]["HBack"]) == 1)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HRemark"]);
                     objJsonResult.data = null;
                     return objJsonResult;
                 }
@@ -7566,8 +7742,8 @@
                 {
                     objJsonResult.code = "0";
                     objJsonResult.count = 1;
-                    objJsonResult.Message = "鎴愬姛";
-                    objJsonResult.data = WebSoBarModel;
+                    objJsonResult.Message = "鎴愬姛锛�";
+                    objJsonResult.data = ds.Tables[0];
                     return objJsonResult;
                 }
             }
@@ -7688,7 +7864,7 @@
             string sErrMsg = "";
             if (oSystemParameter.ShowBillByOrgID(HStockOrgID, ref sErrMsg) == true)
             {
-                string sMaterialCtl = "Y";          //缁勬墭鏃舵墭鏉$爜瀵瑰簲鐗╂枡涓庨渶瑕佺粍鎵樼殑鏉$爜瀵瑰簲鐗╂枡瑕佷竴鑷达紙Y涓洪渶涓�鑷达級
+                string sMaterialCtl = "Y";          //缁勬墭鐗╂枡鏄惁涓�鑷存帶鍒讹紙Y涓烘帶鍒讹級
                 string sSourceBillTypeCtl = "Y";    //鏈叆搴撴潯鐮佽繘琛岀粍鎵樻椂锛岃繘琛屽悓婧愬崟绫诲瀷鎺у埗锛圷涓烘帶鍒讹級
                 string sSourceBillNoCtl = "Y";      //鏈叆搴撴潯鐮佽繘琛岀粍鎵樻椂锛岃繘琛屽悓婧愬崟鎺у埗锛圷涓烘帶鍒讹級
                 sMaterialCtl = oSystemParameter.omodel.Sc_PackUnionBill_MaterialCtl.ToUpper();
@@ -9763,12 +9939,12 @@
         /// <returns></returns>
         [Route("WEBSController/GetGy_BarCodeBill_QiaoYi_PDA_Json")]
         [HttpGet]
-        public object GetGy_BarCodeBill_QiaoYi_PDA_Json(string sBarCode, string sBarCodeOutDate, string sCustomerName, string sSellOutBillNo)
+        public object GetGy_BarCodeBill_QiaoYi_PDA_Json(string sBarCode)
         {
             try
             {
-                //ds = oCn.RunProcReturn("exec h_p_Gy_BarCodeBillList_QiaoYi '" + sBarCode+ "'", "h_p_Gy_BarCodeBillList_QiaoYi");
-                ds = oCn.RunProcReturn("exec h_p_Gy_BarCodeBillList_QiaoYi2 '" + sBarCode + "','" + sBarCodeOutDate + "','" + sCustomerName + "','" + sSellOutBillNo + "'", "h_p_Gy_BarCodeBillList_QiaoYi2");
+                ds = oCn.RunProcReturn("exec h_p_Gy_BarCodeBillList_QiaoYi '" + sBarCode + "'", "h_p_Gy_BarCodeBillList_QiaoYi");
+                //ds = oCn.RunProcReturn("exec h_p_Gy_BarCodeBillList_QiaoYi2 '" + sBarCode + "','" + sBarCodeOutDate + "','" + sCustomerName + "','" + sSellOutBillNo + "'", "h_p_Gy_BarCodeBillList_QiaoYi2");
                 if (ds == null || ds.Tables[0].Rows.Count == 0)
                 {
                     objJsonResult.code = "0";
@@ -12574,5 +12750,68 @@
             }
         }
 
+       #region 鎯犲悍 鐢熶骇棰嗘枡鍗曟牎楠� 鎵弿婧愬崟 鑾峰彇鐢熶骇棰嗘枡鍗曞拰涓嬫父棰嗘枡鍗曟湭瀹℃牳 鍗曟嵁
+        [Route("WEBSController/get_BillBarCode_BillCheck_Json_MateOut_HuiKang")]
+        [HttpGet]
+        public Object get_BillBarCode_BillCheck_Json_MateOut_HuiKang(string HBillNo, string HBillType, string HMaker, Int64 HStockOrgID)
+        {
+           
+            try
+            {
+                WebSoBar = null;
+                // 1. 鏌ヨ閲戣澏浜戜腑 鎵�鏈夌鍚堢殑鐢熶骇棰嗘枡鍗曞拰涓嬫父棰嗘枡鍗�
+                ds = oCn.RunProcReturn($@"
+                    select HBillNo, HChecker,HMaker from h_v_Kf_MateOutBillList_K3 where HBillNo like '%{HBillNo}%'
+                ", "h_v_Kf_MateOutBillList_K3");
+
+                List<string> HBillNoList = new List<string>();
+                foreach (DataRow row in ds.Tables[0].Rows)
+                {
+                    if (string.IsNullOrWhiteSpace(row["HChecker"].ToString())){
+                        // 2. 鍒ゆ柇鍗曟嵁瀹℃牳鐘舵�侊紝鏌ユ壘鏈瀹℃牳鐨勫崟鎹�
+                        WebSoBar = oWebs.get_BillBarCode_BillCheck(row["HBillNo"].ToString(), HBillType, row["HMaker"].ToString(), HStockOrgID, ref DBUtility.ClsPub.sErrInfo);
+
+                        if (WebSoBar != null)
+                        {
+                            // 3. 鑾峰彇鍒扮鍚堟潯浠剁殑杩斿洖鍊硷紝绔嬪嵆杩斿洖
+                            objJsonResult.code = "0";
+                            objJsonResult.count = 1;
+                            objJsonResult.Message = "鎴愬姛";
+                            objJsonResult.data = WebSoBar;
+                            return objJsonResult;
+                        }
+                    }
+                }
+
+
+                // 3. 鎵�鏈夊崟鎹兘琚鏍革紝鎴栬�呮病鏈夌鍚堣姹傜殑鍗曟嵁锛岃繑鍥為敊璇俊鎭�
+                if (WebSoBar == null)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = DBUtility.ClsPub.sErrInfo;
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                else
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 1;
+                    objJsonResult.Message = "鎴愬姛";
+                    objJsonResult.data = WebSoBar;
+                    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