From 4625a964be61b460b484c575219f7a5b90694f5f Mon Sep 17 00:00:00 2001
From: wy <1qaz@123>
Date: 星期一, 26 九月 2022 21:19:29 +0800
Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/YqnApi

---
 WebAPI/Controllers/ProductInController.cs |  219 +++++++++++++++++++++++++++---------------------------
 1 files changed, 109 insertions(+), 110 deletions(-)

diff --git a/WebAPI/Controllers/ProductInController.cs b/WebAPI/Controllers/ProductInController.cs
index 03e4b12..2ea6533 100644
--- a/WebAPI/Controllers/ProductInController.cs
+++ b/WebAPI/Controllers/ProductInController.cs
@@ -37,16 +37,17 @@
         public bool sRedBlueFlag = false;
         public bool SourceFlag = false;
         //public string sSourceType = "3710";
-        public WebServer webserver =new WebServer();
-        public DataSet ds =new DataSet();
-        public ClsGy_BarCodeBill_WMS_Model_View oView =new ClsGy_BarCodeBill_WMS_Model_View();
+        public WebServer webserver = new WebServer();
+        public DataSet ds = new DataSet();
+
+        public ClsGy_BarCodeBill_WMS_Model_View oView = new ClsGy_BarCodeBill_WMS_Model_View();
         public ClsKF_PonderationBillMain_Temp model = new ClsKF_PonderationBillMain_Temp();
         public ClsKf_ICStockBill_WMS oBar = new Model.ClsKf_ICStockBill_WMS();
         //public ClsKf_ICStockBill_WMS oBar = new ClsKf_ICStockBill_WMS();
         public double sRelQty = 0;
-       // private DataBaseServices objDataBaseServices = new DataBaseServices();
+        // private DataBaseServices objDataBaseServices = new DataBaseServices();
         private json objJsonResult = new json();
-       // private string msgModel = "{{\"count\":{0},\"code\":{0},\"message\":\"{1}\",\"result\":{2}}}";
+        // private string msgModel = "{{\"count\":{0},\"code\":{0},\"message\":\"{1}\",\"result\":{2}}}";
         public static string GetSession(string sMsg)
         {
             try
@@ -106,7 +107,7 @@
             {
                 HBillType = "1245";
             }
-            oBar = webserver.get_CheckTypeByBarCode_All(sCode, sInterID, HBillType, sBillNo, sMaker, WhID, SPID, sQty, sRedBlue, SourceFlag, sSourceBillNo, sSourceType, HOWNERID,sExpressNumber,ref DBUtility.ClsPub.sErrInfo);
+            oBar = webserver.get_CheckTypeByBarCode_All(sCode, sInterID, HBillType, sBillNo, sMaker, WhID, SPID, sQty, sRedBlue, SourceFlag, sSourceBillNo, sSourceType, HOWNERID, sExpressNumber, ref DBUtility.ClsPub.sErrInfo);
             if (oBar == null)
             {
                 objJsonResult.code = "0";
@@ -212,8 +213,8 @@
         {
             try
             {
-               // DataSet ds = new DataSet();
-               // WebServer webserver = new WebServer();
+                // DataSet ds = new DataSet();
+                // WebServer webserver = new WebServer();
                 string sWhere = " Where 鍗曟嵁鍙� like '%" + HSourceBillNo.Trim() + "%'";
                 if (HSourceBillType == "3710")
                 {
@@ -265,7 +266,7 @@
             {
                 objJsonResult.code = "0";
                 objJsonResult.count = 0;
-                objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�"+ex.ToString();
+                objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�" + ex.ToString();
                 objJsonResult.data = null;
                 return objJsonResult;
             }
@@ -356,115 +357,107 @@
 
 
 
-//        /// <summary>
-//        /// 鎵弿鐗╂枡鏉$爜锛屽皢鐗╂枡鏉$爜淇℃伅鍐欏叆鏉$爜涓存椂琛�
-//        /// </summary>
-//        /// <param name="sBarCode"></param>
-//        /// <param name="sInterID"></param>
-//        /// <param name="sBillNo"></param>
-//        /// <param name="sQty"></param>
-//        /// <returns></returns>
-//        [Route("ProductIn/SetMaterBarCode_Webs_Json")]
-//        [HttpGet]
-//        public object SetMaterBarCode_Webs_Json(string sBarCode, Int64 HBillID, string HBillNo, string HMaker, Int64 HWhID, Int64 HSPID, Double HQty, bool SourceFlag, string HSourceBillNo, string HSourceBillType, Int64 HOWNERID, ref string sErrMsg)
-//        {
-//            ClsKf_ICStockBill_WMS oBar = new ClsKf_ICStockBill_WMS();
-//            try
-//            {
-//                if (sBarCode.Trim() == "")
-//                {
-//                    objJsonResult.code = "0";
-//                    objJsonResult.count = 0;
-//                    objJsonResult.Message = "鏉$爜涓虹┖锛�";
-//                    objJsonResult.data = null;
-//                    return objJsonResult;
-//                }
+        //        /// <summary>
+        //        /// 鎵弿鐗╂枡鏉$爜锛屽皢鐗╂枡鏉$爜淇℃伅鍐欏叆鏉$爜涓存椂琛�
+        //        /// </summary>
+        //        /// <param name="sBarCode"></param>
+        //        /// <param name="sInterID"></param>
+        //        /// <param name="sBillNo"></param>
+        //        /// <param name="sQty"></param>
+        //        /// <returns></returns>
+        //        [Route("ProductIn/SetMaterBarCode_Webs_Json")]
+        //        [HttpGet]
+        //        public object SetMaterBarCode_Webs_Json(string sBarCode, Int64 HBillID, string HBillNo, string HMaker, Int64 HWhID, Int64 HSPID, Double HQty, bool SourceFlag, string HSourceBillNo, string HSourceBillType, Int64 HOWNERID, ref string sErrMsg)
+        //        {
+        //            ClsKf_ICStockBill_WMS oBar = new ClsKf_ICStockBill_WMS();
+        //            try
+        //            {
+        //                if (sBarCode.Trim() == "")
+        //                {
+        //                    objJsonResult.code = "0";
+        //                    objJsonResult.count = 0;
+        //                    objJsonResult.Message = "鏉$爜涓虹┖锛�";
+        //                    objJsonResult.data = null;
+        //                    return objJsonResult;
+        //                }
 
-//                //鏍规嵁鏉$爜鍓嶇紑璧� 涓嶅悓鏂规硶锛堜粨搴撱�佷粨浣嶃�侀儴闂級锛堟簮鍗曘�佺墿鏂欐潯鐮侊級
-//                oBar = webserver.get_CheckTypeByBarCode(sBarCode, HBillID, HBillType, HBillNo, HMaker, HWhID, HSPID, HQty, sRedBlueFlag, SourceFlag, HSourceBillNo, HSourceBillType, HOWNERID, ref DBUtility.ClsPub.sErrInfo);
-//                if (oBar == null)
-//                {
-//                    objJsonResult.code = "0";
-//                    objJsonResult.count = 0;
-//                    objJsonResult.Message = DBUtility.ClsPub.sErrInfo;
-//                    objJsonResult.data = null;
-//                    return objJsonResult;
-//                }
-//                else
-//                {
-//                    //----------鍒涘缓铏氳〃------------------------
-//                    DataTable dt_Main = new DataTable("Json");
-//                    dt_Main.Columns.Add("HBarType", typeof(string));
-//                    dt_Main.Columns.Add("HSourceBillType", typeof(string));
-//                    dt_Main.Columns.Add("HSourceBillNo", typeof(string));
-//                    dt_Main.Columns.Add("HSupID", typeof(int));
-//                    dt_Main.Columns.Add("HSupName", typeof(string));
-//                    dt_Main.Columns.Add("HDeptID", typeof(int));
-//                    dt_Main.Columns.Add("HDeptNumber", typeof(string));
-//                    dt_Main.Columns.Add("HDeptName", typeof(string));
-//                    dt_Main.Columns.Add("HWhID", typeof(int));
-//                    dt_Main.Columns.Add("HWhNumber", typeof(string));
-//                    dt_Main.Columns.Add("HWhName", typeof(string));
-//                    dt_Main.Columns.Add("HSPFlag", typeof(bool));
-//                    dt_Main.Columns.Add("HSPID", typeof(int));
-//                    dt_Main.Columns.Add("HSPNumber", typeof(string));
-//                    dt_Main.Columns.Add("HSPName", typeof(string));
-//                    dt_Main.Columns.Add("SourceFlag", typeof(bool));
-//                    //---------鍒涘缓鏂拌------------------------
-//                    DataRow dr_main = dt_Main.NewRow();//鍒涘缓鏂拌 
-//                    dt_Main.Rows.Add(dr_main);//灏嗘柊琛屽姞鍏ュ埌琛ㄤ腑
-//                    dr_main["HBarType"] = oBar.HBarType;
-//                    dr_main["HSourceBillType"] = oBar.HSourceBillType;
-//                    dr_main["HSourceBillNo"] = oBar.HSourceBillNo;
-//                    dr_main["HSupID"] = oBar.HSupID;
-//                    dr_main["HSupName"] = oBar.HSupName;
-//                    dr_main["HDeptID"] = oBar.HDeptID;
-//                    dr_main["HDeptNumber"] = oBar.HDeptNumber;
-//                    dr_main["HDeptName"] = oBar.HDeptName;
-//                    dr_main["HWhID"] = oBar.HWhID;
-//                    dr_main["HWhNumber"] = oBar.HWhNumber;
-//                    dr_main["HWhName"] = oBar.HWhName;
-//                    dr_main["HSPFlag"] = oBar.HSPFlag;
-//                    dr_main["HSPID"] = oBar.HSPID;
-//                    dr_main["HSPNumber"] = oBar.HSPNumber;
-//                    dr_main["HSPName"] = oBar.HSPName;
-//                    dr_main["SourceFlag"] = true;
+        //                //鏍规嵁鏉$爜鍓嶇紑璧� 涓嶅悓鏂规硶锛堜粨搴撱�佷粨浣嶃�侀儴闂級锛堟簮鍗曘�佺墿鏂欐潯鐮侊級
+        //                oBar = webserver.get_CheckTypeByBarCode(sBarCode, HBillID, HBillType, HBillNo, HMaker, HWhID, HSPID, HQty, sRedBlueFlag, SourceFlag, HSourceBillNo, HSourceBillType, HOWNERID, ref DBUtility.ClsPub.sErrInfo);
+        //                if (oBar == null)
+        //                {
+        //                    objJsonResult.code = "0";
+        //                    objJsonResult.count = 0;
+        //                    objJsonResult.Message = DBUtility.ClsPub.sErrInfo;
+        //                    objJsonResult.data = null;
+        //                    return objJsonResult;
+        //                }
+        //                else
+        //                {
+        //                    //----------鍒涘缓铏氳〃------------------------
+        //                    DataTable dt_Main = new DataTable("Json");
+        //                    dt_Main.Columns.Add("HBarType", typeof(string));
+        //                    dt_Main.Columns.Add("HSourceBillType", typeof(string));
+        //                    dt_Main.Columns.Add("HSourceBillNo", typeof(string));
+        //                    dt_Main.Columns.Add("HSupID", typeof(int));
+        //                    dt_Main.Columns.Add("HSupName", typeof(string));
+        //                    dt_Main.Columns.Add("HDeptID", typeof(int));
+        //                    dt_Main.Columns.Add("HDeptNumber", typeof(string));
+        //                    dt_Main.Columns.Add("HDeptName", typeof(string));
+        //                    dt_Main.Columns.Add("HWhID", typeof(int));
+        //                    dt_Main.Columns.Add("HWhNumber", typeof(string));
+        //                    dt_Main.Columns.Add("HWhName", typeof(string));
+        //                    dt_Main.Columns.Add("HSPFlag", typeof(bool));
+        //                    dt_Main.Columns.Add("HSPID", typeof(int));
+        //                    dt_Main.Columns.Add("HSPNumber", typeof(string));
+        //                    dt_Main.Columns.Add("HSPName", typeof(string));
+        //                    dt_Main.Columns.Add("SourceFlag", typeof(bool));
+        //                    //---------鍒涘缓鏂拌------------------------
+        //                    DataRow dr_main = dt_Main.NewRow();//鍒涘缓鏂拌 
+        //                    dt_Main.Rows.Add(dr_main);//灏嗘柊琛屽姞鍏ュ埌琛ㄤ腑
+        //                    dr_main["HBarType"] = oBar.HBarType;
+        //                    dr_main["HSourceBillType"] = oBar.HSourceBillType;
+        //                    dr_main["HSourceBillNo"] = oBar.HSourceBillNo;
+        //                    dr_main["HSupID"] = oBar.HSupID;
+        //                    dr_main["HSupName"] = oBar.HSupName;
+        //                    dr_main["HDeptID"] = oBar.HDeptID;
+        //                    dr_main["HDeptNumber"] = oBar.HDeptNumber;
+        //                    dr_main["HDeptName"] = oBar.HDeptName;
+        //                    dr_main["HWhID"] = oBar.HWhID;
+        //                    dr_main["HWhNumber"] = oBar.HWhNumber;
+        //                    dr_main["HWhName"] = oBar.HWhName;
+        //                    dr_main["HSPFlag"] = oBar.HSPFlag;
+        //                    dr_main["HSPID"] = oBar.HSPID;
+        //                    dr_main["HSPNumber"] = oBar.HSPNumber;
+        //                    dr_main["HSPName"] = oBar.HSPName;
+        //                    dr_main["SourceFlag"] = true;
 
-//                    objJsonResult.code = "0";
-//                    objJsonResult.count = 1;
-//                    objJsonResult.Message = "鎵爜鎴愬姛锛�";
-//                    objJsonResult.data = dt_Main;
-//                    return objJsonResult;
-//                }
-//            }
-//            catch (Exception e)
-//            {
-//                objJsonResult.code = "0";
-//                objJsonResult.count = 0;
-//                objJsonResult.Message = "鍐欏叆涓存椂琛ㄤ俊鎭け璐�!" + e.Message + DBUtility.ClsPub.sErrInfo;
-//                objJsonResult.data = null;
-//                return objJsonResult;
-//            }
-//        }
-       
+        //                    objJsonResult.code = "0";
+        //                    objJsonResult.count = 1;
+        //                    objJsonResult.Message = "鎵爜鎴愬姛锛�";
+        //                    objJsonResult.data = dt_Main;
+        //                    return objJsonResult;
+        //                }
+        //            }
+        //            catch (Exception e)
+        //            {
+        //                objJsonResult.code = "0";
+        //                objJsonResult.count = 0;
+        //                objJsonResult.Message = "鍐欏叆涓存椂琛ㄤ俊鎭け璐�!" + e.Message + DBUtility.ClsPub.sErrInfo;
+        //                objJsonResult.data = null;
+        //                return objJsonResult;
+        //            }
+        //        }
+
         /// <summary>
-        /// 鐢熸垚浜у搧鍏ュ簱鍗�
+        /// 鐢熸垚浜у搧鍏ュ簱鍗�(浜у搧鍏ュ簱鎻愪氦)
         /// </summary>
         /// <returns></returns>
         [Route("ProductIn/set_SaveProductInBill_Json")]
         [HttpPost]
-        public object set_SaveProductInBill_Json([FromBody]JObject oMain)
+        public object set_SaveProductInBill_Json([FromBody] JObject oMain)
         {
             var _value = oMain["oMain"].ToString();
             string msg1 = _value.ToString();
-            //List<Model.ClsKf_ProductInBillMain> lsmain = new List<Model.ClsKf_ProductInBillMain>();
-            //ListModels oListModels = new ListModels();
-            //lsmain = oListModels.getProductInBillMainByJson(msg1);
-            //lsmain[0].HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year);
-            //lsmain[0].HDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd"));
-            //string sSourceBillType = lsmain[0].HBillType;
-            //BLL.ClsKf_ProductInBill bll = new BLL.ClsKf_ProductInBill();
-            //return bll.set_SaveProductInBill_New(lsmain[0], sSourceBillType, ref DBUtility.ClsPub.sErrInfo);
             try
             {
                 List<Model.ClsKf_ProductInBillMain> lsmain = new List<Model.ClsKf_ProductInBillMain>();
@@ -475,7 +468,6 @@
                 string sSourceBillType = lsmain[0].HBillType;
 
                 WebAPI.WebS.ClsKf_ProductInBillMain websLsmain = new WebS.ClsKf_ProductInBillMain();
-
                 websLsmain.HInterID = lsmain[0].HInterID;
                 websLsmain.HDate = lsmain[0].HDate;
                 websLsmain.HBillNo = lsmain[0].HBillNo;
@@ -486,7 +478,14 @@
                 websLsmain.HWHID = lsmain[0].HWHID;
                 websLsmain.HSupID = lsmain[0].HSupID;
                 websLsmain.HExplanation = lsmain[0].HExplanation;
-
+                websLsmain.HGroupID = lsmain[0].HGroupID;
+                websLsmain.HJiaYe = lsmain[0].HJiaYe;
+                
+                //淇濆瓨浜哄憳
+                SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
+                string saveGroupEmpsql = $"exec h_p_saveGroupEmp '{lsmain[0].HMaker}','{lsmain[0].HGroupID}',{lsmain[0].HJiaYe.Split(',')[0]},{lsmain[0].HJiaYe.Split(',')[1]},'{lsmain[0].HJiaYe}'";
+                
+                oCn.RunProc(saveGroupEmpsql);
 
                 if (webserver.set_SaveProductInBill_New(websLsmain, sSourceBillType, ref DBUtility.ClsPub.sErrInfo))
                 {

--
Gitblit v1.9.1