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/LookingForBillController.cs |   37 ++++++++++++++++++++-----------------
 1 files changed, 20 insertions(+), 17 deletions(-)

diff --git a/WebAPI/Controllers/LookingForBillController.cs b/WebAPI/Controllers/LookingForBillController.cs
index 61b55e7..9226e3d 100644
--- a/WebAPI/Controllers/LookingForBillController.cs
+++ b/WebAPI/Controllers/LookingForBillController.cs
@@ -36,16 +36,16 @@
                     return objJsonResult;
                 }
                 else
-                { 
+                {
                     objJsonResult.code = "1";
                     objJsonResult.count = 1;
                     objJsonResult.Message = "鎵爜鎴愬姛锛�";
                     objJsonResult.data = ds.Tables[0];
-                    return objJsonResult; 
+                    return objJsonResult;
                 }
             }
             catch (Exception ex)
-            { 
+            {
                 objJsonResult.code = "0";
                 objJsonResult.count = 0;
                 objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�" + ex.ToString();
@@ -175,16 +175,19 @@
         /// <returns></returns>
         [Route("LookingFor/set_SaveLookingForBill_Json")]
         [HttpPost]
-        public object set_SaveLookingForBill_Json([FromBody]JObject oMain)
+        public object set_SaveLookingForBill_Json([FromBody] JObject oMain)
         {
             string oMainData = oMain["oMain"].ToString();
-            oMainData = oMainData.Substring(8,oMainData.Length-9);
+            string HJiaYe = oMain["HJiaYe"].ToString();
+            oMainData = oMainData.Substring(8, oMainData.Length - 9);
             SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
             try
             {
-                List<LookingForBill> lsmain = new List<LookingForBill>();
                 ListModels oListModels = new ListModels();
                 List<LookingForBill> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<LookingForBill>>(oMainData);
+                //淇濆瓨浜哄憳
+                string saveGroupEmpsql = $"exec h_p_saveGroupEmp '{list[0].HMaker}','{list[0].HGroupID}',{HJiaYe.Split(',')[0]},{HJiaYe.Split(',')[1]},'{HJiaYe}'";
+                oCN.RunProc(saveGroupEmpsql);
                 oCN.BeginTran();
                 //var mainSql1 = "Insert Into Kf_LookingForReturnBillMain " +
                 //    "(HInterID,HBillNo,HSourceInterID,HSourceBillNo,HCreateBy)" +
@@ -192,26 +195,26 @@
                 //    "(" + list[0].HInterID + ",'" + list[0].HBillNo + "'," + list[0].HSourceInterID + ",'" + list[0].HSourceBillNo + "','" + list[0].HMaker + "')";
                 var mainSql = "Insert Into Kf_LookingForBillMain " +
                     "(HInterID,HBillNo,HSourceInterID,HSourceBillNo,HWhID,HWhName,HSPID,HSPName,HGroupID,HGroup" +
-                    ",HSourceID,HSource,HCreateBy)" +
+                    ",HSourceID,HSource,HCreateBy,HJiaYe)" +
                     " values" +
-                    "(" + list[0].HInterID + ",'" + list[0].HBillNo + "'," + list[0].HSourceInterID+ ",'" + list[0].HSourceBillNo + "'," + list[0].HWHID + ",'" + list[0].HWHName + "'," + list[0].HSPID + ",'" + list[0].HSPName + "'," + list[0].HGroupID + ",'" + list[0].HGroup + "',"
-                    + list[0].HSourceID + ",'" + list[0].HSource + "','" + list[0].HMaker + "')";
+                    "(" + list[0].HInterID + ",'" + list[0].HBillNo + "'," + list[0].HSourceInterID + ",'" + list[0].HSourceBillNo + "'," + list[0].HWHID + ",'" + list[0].HWHName + "'," + list[0].HSPID + ",'" + list[0].HSPName + "'," + list[0].HGroupID + ",'" + list[0].HGroup + "',"
+                    + list[0].HSourceID + ",'" + list[0].HSource + "','" + list[0].HMaker + "','" + HJiaYe + "')";
                 oCN.RunProc(mainSql);
                 for (int i = 0; i < list.Count; i++)
                 {
                     var subSql = "Insert Into Kf_LookingForBillSub " +
                     "(HWHID,HWHName,HSPID,HSPName,HMTONo,HQty,HMaterID,HMaterName,HMaterNumber,HMaterModel,HBarCode,HGroupID,HGroup,HSourceID,HSource,HCreateBy,HMainItemID)" +
                     " values" +
-                    "(" + list[i].HWHID + ",'" + list[i].HWHName + "'," + list[i].HSPID + ",'" + list[i].HSPName + "','" + list[i].HMTONo + "',"+ list[i].HQty + ","
-                    + list[i].HMaterID + ",'"+ list[i].HMaterName + "','"+ list[i].HMaterNumber + "','"+ list[i].HMaterModel + "','" + list[i].HBarCode + "',"
-                    + list[i].HGroupID + ",'"+ list[i].HGroup + "',"+ list[i].HSourceID + ",'" + list[i].HSource + "','"+ list[i].HMaker + "',(select HItemID from Kf_LookingForBillMain where HBillNo = '" + list[i].HBillNo + "'))";
+                    "(" + list[i].HWHID + ",'" + list[i].HWHName + "'," + list[i].HSPID + ",'" + list[i].HSPName + "','" + list[i].HMTONo + "'," + list[i].HQty + ","
+                    + list[i].HMaterID + ",'" + list[i].HMaterName + "','" + list[i].HMaterNumber + "','" + list[i].HMaterModel + "','" + list[i].HBarCode + "',"
+                    + list[i].HGroupID + ",'" + list[i].HGroup + "'," + list[i].HSourceID + ",'" + list[i].HSource + "','" + list[i].HMaker + "',(select HItemID from Kf_LookingForBillMain where HBillNo = '" + list[i].HBillNo + "'))";
                     oCN.RunProc(subSql);
-                    var barCodeSql = "update Gy_BarCodeBill set HStatus='瑁佸垏涓�-" + list[i].HSource + "' where HBarCode = '"+ list[i].HBarCode + "'";
+                    var barCodeSql = "update Gy_BarCodeBill set HStatus='瑁佸垏涓�-" + list[i].HSource + "' where HBarCode = '" + list[i].HBarCode + "'";
                     oCN.RunProc(barCodeSql);
                 }
                 oCN.Commit();
                 //鍙嶅啓閲戣澏閿�鍞鍗曠殑鎵捐揣缁勫拰鎵捐揣鏃堕棿
-                oCN.RunProc("exec h_p_IFCLD_DataBackToSeOrderFindGoodsTime "+ list[0].HInterID);
+                oCN.RunProc("exec h_p_IFCLD_DataBackToSeOrderFindGoodsTime " + list[0].HInterID);
                 objJsonResult.code = "1";
                 objJsonResult.count = 1;
                 objJsonResult.Message = "鐢熸垚鎵捐揣鍗曟垚鍔燂紒鍗曟嵁鍙蜂负锛�" + list[0].HBillNo;
@@ -505,7 +508,7 @@
 
         public static DataSet getPackUnionBillList_s(string HBarCode_Pack)
         {
-            return new SQLHelper.ClsCN().RunProcReturn("EXEC h_p_Kf_getPackUnionBillList " + "'"+HBarCode_Pack+"'", "h_p_Kf_getPackUnionBillList");
+            return new SQLHelper.ClsCN().RunProcReturn("EXEC h_p_Kf_getPackUnionBillList " + "'" + HBarCode_Pack + "'", "h_p_Kf_getPackUnionBillList");
         }
 
         public static DataSet getPackUnionBillListDetailed_s(string HBarCode)
@@ -516,7 +519,7 @@
         public static DataSet getSellOrderList_s(string HSourceBillNo)
         {
             //鍚屾閿�鍞鍗�
-            new SQLHelper.ClsCN().RunProcReturn("EXEC h_p_IFCLD_ERPSourceBillToLocal_SEOrderToICMO '" + HSourceBillNo+ "'", "h_p_IFCLD_ERPSourceBillToLocal_SEOrderToICMO");
+            new SQLHelper.ClsCN().RunProcReturn("EXEC h_p_IFCLD_ERPSourceBillToLocal_SEOrderToICMO '" + HSourceBillNo + "'", "h_p_IFCLD_ERPSourceBillToLocal_SEOrderToICMO");
             string sWhere = " Where HSourceBillNo = '" + HSourceBillNo.Trim() + "'";
             return new SQLHelper.ClsCN().RunProcReturn("select * from h_v_getSellOrderList_s " + sWhere, "h_v_getSellOrderList_s");
         }
@@ -589,7 +592,7 @@
             DataSet ds;
             ds = new SQLHelper.ClsCN().RunProcReturn("EXEC h_p_Xs_SellOutFindSP '" + HbillNo + "'", "h_p_Xs_SellOutFindSP");
 
-            if (Pub_Class.ClsPub.isLong(ds.Tables[0].Rows.Count) >= 0 )
+            if (Pub_Class.ClsPub.isLong(ds.Tables[0].Rows.Count) >= 0)
             {
                 objJsonResult.code = "1";
                 objJsonResult.count = 1;

--
Gitblit v1.9.1