From aff470c8e269009a173be026bf23f0207b4c001f Mon Sep 17 00:00:00 2001
From: 王 垚 <1402714037@qq.com>
Date: 星期一, 26 九月 2022 09:24:48 +0800
Subject: [PATCH] 下架找货单 委外入库 产品入库 增加班组和职员

---
 WebAPI/Controllers/LookingForBillController.cs |   35 ++++++++++++++++++-----------------
 1 files changed, 18 insertions(+), 17 deletions(-)

diff --git a/WebAPI/Controllers/LookingForBillController.cs b/WebAPI/Controllers/LookingForBillController.cs
index 61b55e7..0bea615 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,43 +175,44 @@
         /// <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
             {
+                oCN.BeginTran();
                 List<LookingForBill> lsmain = new List<LookingForBill>();
                 ListModels oListModels = new ListModels();
                 List<LookingForBill> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<LookingForBill>>(oMainData);
-                oCN.BeginTran();
                 //var mainSql1 = "Insert Into Kf_LookingForReturnBillMain " +
                 //    "(HInterID,HBillNo,HSourceInterID,HSourceBillNo,HCreateBy)" +
                 //    " values" +
                 //    "(" + 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 +506,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 +517,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 +590,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