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 |  448 ++++++++++++++++++++++++++++++++++++++++++++++++++-----
 1 files changed, 407 insertions(+), 41 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 7d730ae..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"
@@ -1345,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;
@@ -2130,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 閲囪喘鍏ュ簱    涓婁紶鐢熷崟
@@ -2216,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
 
@@ -2399,15 +2511,12 @@
         {
             var _value = oMain["oMain"].ToString();
             string msg1 = _value.ToString();
-            string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
-            string sMainStr = sArray[0].ToString();             //鍗曟嵁鏁版嵁
-            string HSourceBarCodeCtl = sArray[1].ToString();    //鏍¢獙-鏄惁杩涜婧愬崟瀵瑰簲鏉$爜鏍稿锛�'Y'涓烘牳瀵癸級
 
             try
             {
                 List<Model.ClsKf_OtherInBillMain> lsmain = new List<Model.ClsKf_OtherInBillMain>();
                 ListModels oListModels = new ListModels();
-                lsmain = oListModels.getOtherInBillMainByJson(sMainStr);
+                lsmain = oListModels.getOtherInBillMainByJson(msg1);
 
                 WebAPI.WebS.ClsKf_OtherInBillMain websLsmain = new WebS.ClsKf_OtherInBillMain();
 
@@ -2416,45 +2525,21 @@
                 websLsmain.HBillType = "1203";
                 websLsmain.HSTOCKORGID = lsmain[0].HSTOCKORGID;
 
-                //鍘熷崟鎹负鎵爜鐢熸垚锛屽鍘熸壂鎻忕殑鏉$爜杩涜鏍稿
-                if (HSourceBarCodeCtl == "Y")
+                if (oWebs.set_SaveOtherInBill_BillCheck(websLsmain, ref DBUtility.ClsPub.sErrInfo))
                 {
-                    if (oWebs.set_SaveOtherInBill_CLD_BillCheck_Verify(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;
-                    }
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 1;
+                    objJsonResult.Message = DBUtility.ClsPub.sErrInfo;  //鎴愬姛锛�
+                    objJsonResult.data = null;
+                    return objJsonResult;
                 }
-                //鍘熷崟鎹潪鎵爜鐢熸垚
                 else
                 {
-                    if (oWebs.set_SaveOtherInBill_CLD_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;
-                    }
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = DBUtility.ClsPub.sErrInfo;  //澶辫触锛�
+                    objJsonResult.data = null;
+                    return objJsonResult;
                 }
             }
             catch (Exception e)
@@ -2561,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;
             }
@@ -2922,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;
             }
@@ -4487,8 +4682,6 @@
             string sJXCode = "";
             if (oSystemParameter.ShowBill(ref sErrMsg) == true)
             {
-                LogService.Write("妫シ鎵爜鍙傛暟鍊硷紝瀹㈡埛锛�" + oSystemParameter.omodel.WMS_CampanyName + " ,婧愬崟绫诲瀷锛�" + HSourceBillType);
-
                 if (oSystemParameter.omodel.WMS_CampanyName == "瀹夌憺") //绯荤粺鍙傛暟  瀹㈡埛瀹氬埗鍖栧悕绉�     绌虹櫧涓洪�氱敤
                 {
                     sJXCode = POStockInBillController.JX_Json(sBarCode, HInterID, HBillType, HStockOrgID, HBillNo, HMaker);
@@ -8885,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