From 3378439708add2bc40f4d6d77aebc11367e380fd Mon Sep 17 00:00:00 2001
From: chenhaozhe <cgz@hz-kingdee.com>
Date: 星期一, 20 四月 2026 15:48:16 +0800
Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API

---
 WebAPI/Controllers/条码管理/WEBSController.cs |  459 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 449 insertions(+), 10 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 88ff9e0..1760065 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"
@@ -20,6 +20,7 @@
 
 namespace WebAPI.Controllers
 {
+   
     public class WEBSController : ApiController
     {
         public DBUtility.ClsPub.Enum_BillStatus BillStatus;
@@ -46,6 +47,7 @@
         /// <returns></returns>
         [Route("WEBSController/GetUser_Json")]
         [HttpGet]
+        [AllowAnonymous]
         public object GetUser_Json(string HUserNumber, string HPassWord, Int64 HStockOrgID, string HStockOrgName)
         {
             try
@@ -91,11 +93,23 @@
                         return objJsonResult;
                     }
 
+                    if(!oSystemParameter.ShowBill(ref DBUtility.ClsPub.sErrInfo))
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "鐧诲綍寮傚父锛乀oken 鐢熸垚寮傚父锛屾棤娉曡幏鍙栧叕鍙镐俊鎭紒";
+                    }
+
+                    string tokenStr = JWTHelper.GenerateToken(ds.Tables[0].Rows[0]["Czybm"].ToString(), ds.Tables[0].Rows[0]["Czymc"].ToString());
+
+
                     objJsonResult.code = "0";
                     objJsonResult.count = 1;
                     objJsonResult.Message = "鐧诲綍鎴愬姛锛�";
                     objJsonResult.data = ds.Tables[0];
-                    return objJsonResult;
+                    JObject jobjJsonResult = JObject.FromObject(objJsonResult);
+                    jobjJsonResult["token"] = tokenStr;
+                    return jobjJsonResult;
                 }
             }
             catch (Exception e)
@@ -1564,6 +1578,84 @@
         #endregion
 
 
+        #region 鎵爜妯″潡    鏍规嵁鏉$爜鍒犻櫎缂撳瓨鍒楄〃涓搴旀潯鐮佽褰�
+
+        /// <summary>
+        /// 鏍规嵁鏉$爜鏇存柊鏉$爜鍑哄叆搴撶紦瀛樿〃鏁伴噺
+        /// </summary>
+        /// <returns></returns>
+        [Route("WEBSController/set_UpdatePonderationBillMain_Temp_BarCode_Json")]
+        [HttpGet]
+        public object set_UpdatePonderationBillMain_Temp_BarCode_Json(long HInterID, string HBillType, string HBarCode, double HQty, long HItemID)
+        {
+            try
+            {
+                //(HBarCode_Pack <> '' and HInterID = { HInterID.ToString() } and HBillType = '{HBillType}' and HBarCode_Pack = '{HBarCode}') or
+                //              (HBarCode <> '' and HInterID ={ HInterID.ToString()}
+                //and HBillType = '{HBillType}' and HBarCode = '{HBarCode}')
+                // 鏍规嵁鎵樻潯鐮佸瓧娈靛拰鏉$爜瀛楁 鍒ゆ柇 鏇存柊鐨勬潯鐮佹暟閲忔槸鍚﹀ぇ浜庢渶澶ф暟閲忔垨灏忎簬0
+                ds = oCn.RunProcReturn($@"select * from KF_PonderationBillMain_Temp where 
+                    HItemID = {HItemID}
+                ", "KF_PonderationBillMain_Temp");
+
+                if(ds == null || ds.Tables[0].Rows.Count == 0)
+                {
+                    // 鎵�鎵潯鐮佷笉瀛樺湪
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鏇存柊澶辫触锛屾墍鎵潯鐮佷笉瀛樺湪...";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
+                if(HQty < 0)
+                {
+                    // 鏇存柊鐨勬潯鐮佹暟閲忓皬浜�0
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鏇存柊澶辫触锛屾洿鏂版暟閲忓皬浜�0...";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
+                //if(Double.Parse(ds.Tables[0].Rows[0]["HQtyMust"].ToString()) < HQty)
+                //{
+                    //// 鏇存柊鐨勬潯鐮佹暟閲忔槸鍚﹀ぇ浜庢渶澶ф暟閲�
+                    //objJsonResult.code = "0";
+                    //objJsonResult.count = 0;
+                    //objJsonResult.Message = $"鏇存柊澶辫触锛屾潯鐮佹暟閲弡HQty}澶т簬鏈�澶у彲鎵暟閲弡ds.Tables[0].Rows[0]["HQtyMust"].ToString()}...";
+                    //objJsonResult.data = null;
+                    //return objJsonResult;
+                //}
+
+                //鏍规嵁鎵樻潯鐮佸瓧娈垫洿鏂版湰鍗曟潯鐮佸嚭鍏ュ簱缂撳瓨琛ㄦ暟鎹�
+                //oCn.RunProc($"Update KF_PonderationBillMain_Temp set HQty = {HQty} where HBarCode_Pack<>'' and HInterID={HInterID.ToString()} and HBillType='{HBillType}' and HBarCode_Pack='{HBarCode}'", ref DBUtility.ClsPub.sExeReturnInfo);
+
+                //鏍规嵁鏉$爜瀛楁鏇存柊鏈崟鏉$爜鍑哄叆搴撶紦瀛樿〃鏁版嵁
+                //oCn.RunProc($"Update KF_PonderationBillMain_Temp set HQty = {HQty} where HBarCode<>'' and HInterID={HInterID.ToString()} and HBillType='{HBillType}' and HBarCode='{HBarCode}'", ref DBUtility.ClsPub.sExeReturnInfo);
+                
+                //鏍规嵁鏉$爜鑷鍒� 鏇存柊 鏉$爜鍑哄叆搴撶紦瀛樿〃鏁版嵁
+                oCn.RunProc($"exec h_p_KF_PonderationBillMain_Temp_Update {HInterID}, '{HBillType}', '{HBarCode}', {HQty}, {HItemID}", ref DBUtility.ClsPub.sExeReturnInfo);
+
+                objJsonResult.code = "1";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "鏇存柊鎴愬姛";
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "鏇存柊鏉$爜鍑哄叆搴撶紦瀛樺垪琛ㄦ潯鐮佽褰曞け璐ワ紒" + e.Message.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+
+        #endregion
+
+
         #region 鎵爜妯″潡    鏍规嵁HItemID鍒犻櫎缂撳瓨鍒楄〃涓搴旀潯鐮佽褰�
 
         /// <summary>
@@ -2535,6 +2627,11 @@
                 {
                     sFormId = "STK_MISCELLANEOUS";
                 }
+                //鍙楁墭鍔犲伐鍏ュ簱鍗�
+                else if (HBillType == "1212")
+                {
+                    sFormId = "STK_OEMInStock";
+                }
                 //棰嗘枡鍑哄簱鍗�
                 else if (HBillType == "1204")
                 {
@@ -2564,6 +2661,11 @@
                 else if (HBillType == "1255")
                 {
                     sFormId = "SUB_FEEDMTRL";
+                }
+                //鍙楁墭鍔犲伐鍑哄簱鍗曪紙鍙楁墭鍔犲伐閫�鏂欙級
+                else if (HBillType == "1213")
+                {
+                    sFormId = "STK_OEMInStockRETURN";
                 }
                 //鐩存帴璋冩嫧鍗�
                 else if (HBillType == "1207")
@@ -2942,6 +3044,7 @@
         /// <returns></returns>
         [Route("WEBSController/set_SavePOStockInBill_Json")]
         [HttpPost]
+        [Permission(HModName = "Kf_POStockInBill", Operate = "_Edit")]
         public object set_SavePOStockInBill_Json([FromBody] JObject oMain)
         {
             var _value = oMain["oMain"].ToString();
@@ -3291,6 +3394,89 @@
                 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_SaveInceptEntInBill_Json")]
+        [HttpPost]
+        public object set_SaveInceptEntInBill_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);
+                WebS.ClsKf_ICStockBillMain websLsmain = new WebS.ClsKf_ICStockBillMain();
+                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.HStockStyle = lsmain[0].HStockStyle;
+                websLsmain.HBillSubType = lsmain[0].HBillSubType;
+                if (lsmain[0].HMainSourceBillType == "1130")
+                {
+                    websLsmain.HMainSourceBillType = "鍙楁墭鍔犲伐鏀舵枡閫氱煡鍗�";
+                }
+                else
+                {
+                    websLsmain.HMainSourceBillType = "鎵嬪伐褰曞叆";
+                }
+                websLsmain.HMaker = lsmain[0].HMaker;
+                websLsmain.HBillerID = lsmain[0].HBillerID;
+                websLsmain.HSTOCKORGID = lsmain[0].HSTOCKORGID;
+                websLsmain.HOWNERID = lsmain[0].HSTOCKORGID;
+
+                if (oWebs.set_SaveInceptEntInBill_New(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;
+                }
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "鍙楁墭鍔犲伐鍏ュ簱鍗曚笂浼犲け璐ワ紒" + e.ToString();
                 objJsonResult.data = null;
                 return objJsonResult;
             }
@@ -4168,6 +4354,64 @@
                 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_SaveInceptEntOutBill_BillCheck_Json")]
+        [HttpPost]
+        public object set_SaveInceptEntOutBill_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 = "1213";
+                websLsmain.HMaker = lsmain[0].HMaker;
+                websLsmain.HSTOCKORGID = lsmain[0].HSTOCKORGID;
+
+                if (oWebs.set_SaveInceptEntOutBill_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;
             }
@@ -5259,7 +5503,7 @@
         /// </summary>
         /// <returns></returns>
         [Route("WEBSController/set_SaveQCPOStockInCheckBill_Json")]
-        [HttpPost]
+        [HttpGet]
         public object set_SaveQCPOStockInCheckBill_Json(Int64 HInterID, string HBillNo, string HSourceBillType, string HSourceBillNo, Int64 HSourceInterID, string sHSourceEntryID, Int64 HFirstCheckEmp, string HMaker)
         {
             try
@@ -5395,16 +5639,16 @@
                     oSub.HBadQty = Pub_Class.ClsPub.isDoule(Ds.Tables[1].Rows[i]["HBadQty"]);
 
                     oCn.RunProc("Insert Into QC_POStockInCheckBillSub " +
-                    "(HInterID,HEntryID,,HBillNo_bak,HRemark" +
+                    "(HInterID,HEntryID,HBillNo_bak,HRemark" +
                     ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType" +
                     ",HQCCheckClassID,HQCCheckItemID,HQCStd,HQCRelValue" +
-                    "HResult,HProcCheckEmp,HProcCheckTime" +
-                    "HMaterID,HInStockQty,HCheckQty,HRightQty,HBadQty" +
+                    ",HResult,HProcCheckEmp,HProcCheckTime" +
+                    ",HMaterID,HInStockQty,HCheckQty,HRightQty,HBadQty" +
                     ") " +
                     " values(" + oMain.HInterID.ToString() + "," + oSub.HEntryID.ToString() + ",'" + oMain.HBillNo + "','" + oSub.HRemark + "'" +
                     ", " + oSub.HSourceInterID.ToString() + "," + oSub.HSourceEntryID.ToString() + ",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "'" +
                     ", " + oSub.HQCCheckClassID.ToString() + "," + oSub.HQCCheckItemID.ToString() + ",'" + oSub.HQCStd + "','" + oSub.HQCRelValue + "'" +
-                    ",'" + oSub.HResult + "'," + oSub.HProcCheckEmp.ToString() + "',getdate()" +
+                    ",'" + oSub.HResult + "'," + oSub.HProcCheckEmp.ToString() + ",getdate()" +
                     ", " + oSub.HMaterID.ToString() + "," + oSub.HInStockQty.ToString() + "," + oSub.HCheckQty.ToString() + "," + oSub.HRightQty.ToString() + "," + oSub.HBadQty.ToString() +
                     ") ");
                 }
@@ -5692,7 +5936,6 @@
                 if (isSuccess == 1)
                 {
                     string result = InvokeHelper.Save("QM_InspectBill", sJson); //淇濆瓨
-
                     sRemark = sRemark + " 锛涚敓鎴怌LOUD鍗曟嵁" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss:ffff");
 
                     HReturn = result.ToString();
@@ -5716,6 +5959,24 @@
                     else
                     {
                         sRemark = sRemark + sJson;
+                        // 鎻愪氦鍜屼繚瀛樺崟鎹�
+                        string result1 = string.Empty;
+                        string result2 = string.Empty;
+                        var fID = JObject.Parse(result)["Result"]["Id"].ToString();
+                        var fBillNo = JObject.Parse(result)["Result"]["Number"].ToString();
+                        var json = new
+                        {
+                            Ids = fID,
+                        };
+
+                        result1 = InvokeHelper.Submit("QM_InspectBill", JsonConvert.SerializeObject(json));//鎻愪氦
+                        result2 = InvokeHelper.Audit("QM_InspectBill", JsonConvert.SerializeObject(json));//瀹℃牳
+                        if (JObject.Parse(result1)["Result"]["ResponseStatus"]["IsSuccess"].ToString().ToUpper() != "TRUE")
+                        {
+                            oCn.RollBack();
+                            sErrMsg = $"鏉ユ枡妫�楠屽崟鍙凤細{fBillNo}锛屾彁浜ゅけ璐�" + result;
+                            return false;
+                        }
                         oCn.Commit();
                     }
                 }
@@ -6531,6 +6792,48 @@
             try
             {
                 WebSoBar = oWebs.get_SourceBarCode_OtherIn(HInterID, HBillNo, HBillType, HSourceBillNo, HSourceBillType, HMaker, HStockOrgID, ref DBUtility.ClsPub.sErrInfo);
+                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
+
+        #region 鍙楁墭鍔犲伐鍏ュ簱    鎵弿婧愬崟鏉$爜
+
+        /// <summary>
+        /// 鍙楁墭鍔犲伐鍏ュ簱    鎵弿婧愬崟鏉$爜
+        /// </summary>
+        /// <returns></returns>
+        [Route("WEBSController/Get_SourceBarCode_InceptEntIn_Json")]
+        [HttpGet]
+        public object get_SourceBarCode_InceptEntIn_Json(Int64 HInterID, string HBillNo, string HBillType, string HSourceBillNo, string HSourceBillType, string HMaker, Int64 HStockOrgID)
+        {
+            try
+            {
+                WebSoBar = oWebs.get_SourceBarCode_InceptEntIn(HInterID, HBillNo, HBillType, HSourceBillNo, HSourceBillType, HMaker, HStockOrgID, ref DBUtility.ClsPub.sErrInfo);
                 if (WebSoBar == null)
                 {
                     objJsonResult.code = "0";
@@ -7839,6 +8142,20 @@
                         sAutoBarCode = "Y";
                     }
                 }
+                //鍙楁墭鍔犲伐鍏ュ簱鍗�
+                else if (HBillType == "1212")
+                {
+                    //鏍¢獙-鏄惁杩涜婧愬崟瀵瑰簲鏉$爜鏍稿锛�'Y'涓烘牳瀵癸級
+                    if (oSystemParameter.omodel.Kf_InceptEntInBillCheck_SourceBarCodeCtl.ToUpper() == "Y")
+                    {
+                        sSourceBarCodeCtl = "Y";
+                    }
+                    //鍏嶆壂鐗╂枡鏉$爜妯″紡锛�'Y'涓轰笉鎵墿鏂欐潯鐮侊級
+                    if (oSystemParameter.omodel.Kf_InceptEntInBillCheck_AutoBarCode.ToUpper() == "Y")
+                    {
+                        sAutoBarCode = "Y";
+                    }
+                }
                 //棰嗘枡鍑哄簱鍗�
                 else if (HBillType == "1204")
                 {
@@ -7919,6 +8236,20 @@
                     }
                     //鍏嶆壂鐗╂枡鏉$爜妯″紡锛�'Y'涓轰笉鎵墿鏂欐潯鐮侊級
                     if (oSystemParameter.omodel.Kf_EntrustReplenishOutBillCheck_AutoBarCode.ToUpper() == "Y")
+                    {
+                        sAutoBarCode = "Y";
+                    }
+                }
+                //鍙楁墭鍔犲伐鍑哄簱鍗�
+                else if (HBillType == "1213")
+                {
+                    //鏍¢獙-鏄惁杩涜婧愬崟瀵瑰簲鏉$爜鏍稿锛�'Y'涓烘牳瀵癸級
+                    if (oSystemParameter.omodel.Kf_InceptEntOutBillCheck_SourceBarCodeCtl.ToUpper() == "Y")
+                    {
+                        sSourceBarCodeCtl = "Y";
+                    }
+                    //鍏嶆壂鐗╂枡鏉$爜妯″紡锛�'Y'涓轰笉鎵墿鏂欐潯鐮侊級
+                    if (oSystemParameter.omodel.Kf_InceptEntOutBillCheck_AutoBarCode.ToUpper() == "Y")
                     {
                         sAutoBarCode = "Y";
                     }
@@ -8454,6 +8785,14 @@
                 {
                     sFIFOCtl = "Y";
                 }
+                //鍙楁墭鍔犲伐鍑哄簱鍗�-鍏堣繘鍏堝嚭鎺у埗
+                if (HBillType == "1213"
+                    && oSystemParameter.omodel.Kf_InceptEntOutBillCheck_AutoBarCode.ToUpper() == "N"         //鍏嶆壂鐗╂枡鏉$爜妯″紡锛�'Y'涓轰笉鎵墿鏂欐潯鐮侊級
+                    && oSystemParameter.omodel.Kf_InceptEntOutBillCheck_SourceBarCodeCtl.ToUpper() == "N"    //鏍¢獙-鏄惁杩涜婧愬崟瀵瑰簲鏉$爜鏍稿锛�'Y'涓烘牳瀵癸級
+                    && (oSystemParameter.omodel.Kf_InceptEntOutBillCheck_FIFOCtl == "1" || oSystemParameter.omodel.Kf_InceptEntOutBillCheck_FIFOCtl == "2" || oSystemParameter.omodel.Kf_InceptEntOutBillCheck_FIFOCtl == "3"))
+                {
+                    sFIFOCtl = "Y";
+                }
                 //鐩存帴璋冩嫧鍗�-鍏堣繘鍏堝嚭鎺у埗
                 if (HBillType == "1207"
                     && oSystemParameter.omodel.Kf_MoveStockBillCheck_AutoBarCode.ToUpper() == "N"         //鍏嶆壂鐗╂枡鏉$爜妯″紡锛�'Y'涓轰笉鎵墿鏂欐潯鐮侊級
@@ -8596,6 +8935,15 @@
                         sSourceBarCodeCtl = "Y";
                     }
                 }
+                //鍙楁墭鍔犲伐鍏ュ簱鍗�
+                else if (HBillType == "1212")
+                {
+                    //鏍¢獙-鏄惁杩涜婧愬崟瀵瑰簲鏉$爜鏍稿锛�'Y'涓烘牳瀵癸級
+                    if (oSystemParameter.omodel.Kf_InceptEntInBillCheck_SourceBarCodeCtl.ToUpper() == "Y")
+                    {
+                        sSourceBarCodeCtl = "Y";
+                    }
+                }
                 //棰嗘枡鍑哄簱鍗�
                 else if (HBillType == "1204")
                 {
@@ -8661,6 +9009,17 @@
                     }
                     //鍏堣繘鍏堝嚭鎺у埗
                     sFIFOCtl = oSystemParameter.omodel.Kf_EntrustReplenishOutBillCheck_FIFOCtl;
+                }
+                //鍙楁墭鍔犲伐鍑哄簱鍗�
+                else if (HBillType == "1213")
+                {
+                    //鏍¢獙-鏄惁杩涜婧愬崟瀵瑰簲鏉$爜鏍稿锛�'Y'涓烘牳瀵癸級
+                    if (oSystemParameter.omodel.Kf_InceptEntOutBillCheck_SourceBarCodeCtl.ToUpper() == "Y")
+                    {
+                        sSourceBarCodeCtl = "Y";
+                    }
+                    //鍏堣繘鍏堝嚭鎺у埗
+                    sFIFOCtl = oSystemParameter.omodel.Kf_InceptEntOutBillCheck_FIFOCtl;
                 }
                 //鐩存帴璋冩嫧鍗�
                 else if (HBillType == "1207")
@@ -8969,6 +9328,15 @@
                         sSourceBarCodeCtl = "Y";
                     }
                 }
+                //鍙楁墭鍔犲伐鍏ュ簱鍗�
+                else if (HBillType == "1212")
+                {
+                    //鏍¢獙-鏄惁杩涜婧愬崟瀵瑰簲鏉$爜鏍稿锛�'Y'涓烘牳瀵癸級
+                    if (oSystemParameter.omodel.Kf_InceptEntInBillCheck_SourceBarCodeCtl.ToUpper() == "Y")
+                    {
+                        sSourceBarCodeCtl = "Y";
+                    }
+                }
                 //棰嗘枡鍑哄簱鍗�
                 else if (HBillType == "1204")
                 {
@@ -9019,6 +9387,15 @@
                 {
                     //鏍¢獙-鏄惁杩涜婧愬崟瀵瑰簲鏉$爜鏍稿锛�'Y'涓烘牳瀵癸級
                     if (oSystemParameter.omodel.Kf_EntrustReplenishOutBillCheck_SourceBarCodeCtl.ToUpper() == "Y")
+                    {
+                        sSourceBarCodeCtl = "Y";
+                    }
+                }
+                //鍙楁墭鍔犲伐鍑哄簱鍗�
+                else if (HBillType == "1213")
+                {
+                    //鏍¢獙-鏄惁杩涜婧愬崟瀵瑰簲鏉$爜鏍稿锛�'Y'涓烘牳瀵癸級
+                    if (oSystemParameter.omodel.Kf_InceptEntOutBillCheck_SourceBarCodeCtl.ToUpper() == "Y")
                     {
                         sSourceBarCodeCtl = "Y";
                     }
@@ -12830,6 +13207,60 @@
 
         #endregion
 
+        #region  WMS姣忔棩杩愯鐘舵�佸垎鏋愶紙姣忔棩鍒跺崟鏁伴噺锛�
+        [Route("WEBSController/GetKf_WMSDailyRunStateReport_Json")]
+        [HttpGet]
+        public object GetKf_WMSDailyRunStateReport_Json(string sWhere, string user)
+        {
+            try
+            {
+
+                Dictionary<object, object> dic = Newtonsoft.Json.JsonConvert.DeserializeObject<Dictionary<object, object>>(sWhere);
+
+                string HBeginDate = dic["HBeginDate"].ToString();
+                string HEndDate = dic["HEndDate"].ToString();
+
+                List<object> columnNameList = new List<object>();
+
+                ds = oCn.RunProcReturn("exec h_p_Kf_WMSDailyRunStateReport  '" + HBeginDate + "','" + HEndDate + "'", "h_p_Kf_WMSDailyRunStateReport");
+
+                if (ds.Tables[0].Rows.Count != 0 || ds != null)
+                {
+                    //娣诲姞鍒楀悕
+                    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 = "Sucess锛�";
+                    objJsonResult.data = ds;
+                    objJsonResult.list = columnNameList;
+                    return objJsonResult;
+                }
+                else
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鏃犳暟鎹�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "Exception锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
 
         #endregion
 
@@ -14638,8 +15069,8 @@
             {
                 string sErrMsg = "";
                 oSystemParameter.ShowBill(ref sErrMsg);
-                // 鍗庤垷瀹㈡埛
-                if (oSystemParameter.omodel.WMS_CampanyName == "鍗庤垷")
+                // 鍗庤垷瀹㈡埛   宸ュ簭杩涚珯鎺ユ敹鍗�  宸ュ簭濮斿鎺ユ敹鍗� 鐢熶骇璁㈠崟 宸ュ簭娴佽浆鍗�
+                if (oSystemParameter.omodel.WMS_CampanyName == "鍗庤垷" && HSourceBillType != 3790 && HSourceBillType != 3793 && HSourceBillType != 3710 && HSourceBillType != 3772)
                 {
                     if (!string.IsNullOrWhiteSpace(HBarCode))
                     {
@@ -14690,6 +15121,14 @@
                     objJsonResult.code = "0";
                     objJsonResult.count = 0;
                     objJsonResult.Message = "鎵弿鍗曟嵁鏉$爜澶辫触锛佹棤缁戝畾璐ㄦ鏂规淇℃伅";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                if (ds.Tables[0].Columns.Contains("HBack") && 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;
                 }
@@ -14932,7 +15371,7 @@
             else
             {
                 objJsonResult.code = "0";
-                objJsonResult.count = 0;
+                objJsonResult.count = 1;
                 objJsonResult.Message = DBUtility.ClsPub.sErrInfo;  //鎴愬姛锛�
                 objJsonResult.data = oDs.Tables[0];
                 return objJsonResult;

--
Gitblit v1.9.1