From 74a20573de4e4a0e6b2de8a4f69c35ad614edd45 Mon Sep 17 00:00:00 2001
From: jingh <jingh@LAPTOP-I53VDLOO>
Date: 星期五, 31 十二月 2021 16:23:17 +0800
Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API

---
 WebAPI/Controllers/BaseSet/Gy_MaterialController.cs             |    8 
 WebAPI/DLL/ClsSc_PackUnionBill.cs                               |    6 
 WebAPI/Controllers/博日自动扫码线/ScanlineAPIController.cs             |   20 ++
 WebAPI/Controllers/基础资料/基础资料/Gy_StockCheckItemBillController.cs |   95 ---------------
 WebAPI/Controllers/仓存管理/领料发货/Kf_MateOutBackBillController.cs    |   31 ++++-
 WebAPI/Controllers/Sc_MouldRepairInBillListController.cs        |   79 ++++++------
 WebAPI/WebAPI.csproj                                            |    2 
 WebAPI/Controllers/SCGL/Sc_ProductionReturnBillController.cs    |   20 +-
 WebAPI/Controllers/CGGL/Cg_PurchaseReturnController.cs          |    2 
 WebAPI/Controllers/仓存管理/验收入库/Kf_StepFoldinBillController.cs     |   67 +++++++++++
 10 files changed, 170 insertions(+), 160 deletions(-)

diff --git a/WebAPI/Controllers/BaseSet/Gy_MaterialController.cs b/WebAPI/Controllers/BaseSet/Gy_MaterialController.cs
index 543c1c8..41081e7 100644
--- a/WebAPI/Controllers/BaseSet/Gy_MaterialController.cs
+++ b/WebAPI/Controllers/BaseSet/Gy_MaterialController.cs
@@ -608,7 +608,7 @@
                 ",HMaterID,HMaterNumber,HMouldType,HUnitID" +
                 ",HOutComDate,HOutComNo,HDeptID,HSupID,HSupNumber" +
                 ",HPrintQty,HMouldStatus,HWhID,HRoutingID,HCaveQty" +
-                ",HBomID,HVersion,HSPGroupID,HSPID,HDesignLife" +
+                ",HBomID,HVersion,HSPGroupID,HSPID,HDesignLife,HNowSupID,HNowSupTypeID" +
                 ",HUseLife,HLeaveLife,HProdQty,HProdWeight,HMouldOWNER,HSaveLife,HMouldDotCheckRuleInterID,HMouldMaintainRuleInterID" +
                 ") " +
                 " values('" + BillType + "','" + BillType + "'," + HInterID + ",'" + HBillNo + "','" + HDate + "'" +
@@ -618,8 +618,8 @@
                 "," + HMaterID + ",'" + HMaterNumber + "'," + HMouleTypeID + "," + HUnitID +
                 ",'" + HOutComDate + "','" + HOutComNo + "'," + HDeptID + "," + HSupID + ",'" + HSupNumber + "'" +
                 "," + HPrintQty + ",'" + HMouldStatus + "'," + HWHID + "," + HRoutingID +","+ HCaveQty+
-                "," + HBOMID + ",'" + HVersion + "'," + HSPGroupID + "," + HSPID + ",'" + HDesignLife +
-                "','" + HUseLife + "','" + HLeaveLife + "','" + HProdQty + "','" + HProdWeight + "','" + HMouldOWNER + "','" + HSaveLife + "','" + HMouldDotCheckRuleInterID+"','"+ HMouldMaintainRuleInterID+"'"+
+                "," + HBOMID + ",'" + HVersion + "'," + HSPGroupID + "," + HSPID + ",'" + HDesignLife + "','" + HNowSupID+"','"+ HNowSupTypeID+"'"+
+                ",'" + HUseLife + "','" + HLeaveLife + "','" + HProdQty + "','" + HProdWeight + "','" + HMouldOWNER + "','" + HSaveLife + "','" + HMouldDotCheckRuleInterID+"','"+ HMouldMaintainRuleInterID+"'"+
                 ") ");
 
 
@@ -784,6 +784,8 @@
                 ",HMouldDotCheckRuleInterID="+ HMouldDotCheckRuleInterID.ToString()+
                 ",HMouldMaintainRuleInterID=" + HMouldMaintainRuleInterID.ToString() +
                 ",HMouldOWNER='" + HMouldOWNER + "'" +
+                ",HNowSupID="+HNowSupID.ToString()+
+                ",HNowSupTypeID="+HNowSupTypeID.ToString()+
                 ",HProdWeight=" + HProdWeight.ToString() +
                 " where HInterID=" + HInterID.ToString());
 
diff --git a/WebAPI/Controllers/CGGL/Cg_PurchaseReturnController.cs b/WebAPI/Controllers/CGGL/Cg_PurchaseReturnController.cs
index 29bec74..0b4731a 100644
--- a/WebAPI/Controllers/CGGL/Cg_PurchaseReturnController.cs
+++ b/WebAPI/Controllers/CGGL/Cg_PurchaseReturnController.cs
@@ -25,7 +25,7 @@
             {
                 if (sWhere == null || sWhere.Equals(""))
                 {
-                    ds = oCN.RunProcReturn("select * from h_v_Kf_PurchaseReturnList " + sWhere, "h_v_Kf_PurchaseReturnList");
+                    ds = oCN.RunProcReturn("select * from h_v_Kf_PurchaseReturnList " , "h_v_Kf_PurchaseReturnList");
                 }
                 else
                 {
diff --git a/WebAPI/Controllers/SCGL/Sc_ProductionReturnBillController.cs b/WebAPI/Controllers/SCGL/Sc_ProductionReturnBillController.cs
index 0c10e5a..07dab3b 100644
--- a/WebAPI/Controllers/SCGL/Sc_ProductionReturnBillController.cs
+++ b/WebAPI/Controllers/SCGL/Sc_ProductionReturnBillController.cs
@@ -27,8 +27,15 @@
         {
             try
             {
-
-                ds = Sc_GetProductInBill(sWhere);
+                if (sWhere == null || sWhere.Equals(""))
+                {
+                    ds = oCN.RunProcReturn("select * from h_v_IF_ProductionReturnList where 1=1  order by 鏃ユ湡 desc", "h_v_IF_ProductionReturnList");
+                }
+                else
+                {
+                    string sql = "select * from h_v_IF_ProductionReturnList where 1 = 1 " + sWhere + " order by 鏃ユ湡 desc";
+                    ds = oCN.RunProcReturn(sql, "h_v_IF_ProductionReturnList");
+                }
                 if (ds == null || ds.Tables[0].Rows.Count <= 0)
                 {
                     objJsonResult.code = "0";
@@ -55,14 +62,5 @@
                 return objJsonResult;
             }
         }
-
-        #region sql璇彞
-
-
-        public static DataSet Sc_GetProductInBill(string sWhere)
-        {
-            return new SQLHelper.ClsCN().RunProcReturn("select * from h_v_IF_ProductionReturnList order by 鏃ユ湡 desc", "h_v_IF_ProductionReturnList");
-        }
-        #endregion
     }
 }
\ No newline at end of file
diff --git a/WebAPI/Controllers/Sc_MouldRepairInBillListController.cs b/WebAPI/Controllers/Sc_MouldRepairInBillListController.cs
index bafeb07..b153a67 100644
--- a/WebAPI/Controllers/Sc_MouldRepairInBillListController.cs
+++ b/WebAPI/Controllers/Sc_MouldRepairInBillListController.cs
@@ -880,8 +880,16 @@
         {
             try
             {
+                if (sWhere == null || sWhere.Equals(""))
+                {
+                    ds = oCN.RunProcReturn("select * from h_v_Kf_OtherOutBillList where 1=1 order by 鏃ユ湡 desc", "h_v_Kf_OtherOutBillList");
+                }
+                else
+                {
+                    string sql = "select * from h_v_Kf_OtherOutBillList where 1 = 1 " + sWhere+ " order by 鏃ユ湡 desc";
+                    ds = oCN.RunProcReturn(sql, "h_v_Kf_OtherOutBillList");
+                }
 
-                ds = Sc_GetOtherOutBillList(sWhere);
                 if (ds == null || ds.Tables[0].Rows.Count <= 0)
                 {
                     objJsonResult.code = "0";
@@ -908,15 +916,6 @@
                 return objJsonResult;
             }
         }
-
-        #region sql璇彞
-
-
-        public static DataSet Sc_GetOtherOutBillList(string sWhere)
-        {
-            return new SQLHelper.ClsCN().RunProcReturn("select * from h_v_Kf_OtherOutBillList order by 鏃ユ湡 desc", "h_v_Kf_OtherOutBillList");
-        }
-        #endregion
 
 
         /// <summary>
@@ -1029,7 +1028,15 @@
             try
             {
 
-                ds = Sc_GetProductInBill(sWhere);
+                if (sWhere == null || sWhere.Equals(""))
+                {
+                    ds = oCN.RunProcReturn("select * from h_v_IF_ProductInBillList where 1=1  order by 鏃ユ湡 desc", "h_v_IF_ProductInBillList");
+                }
+                else
+                {
+                    string sql = "select * from h_v_IF_ProductInBillList where 1 = 1 " + sWhere + " order by 鏃ユ湡 desc";
+                    ds = oCN.RunProcReturn(sql, "h_v_IF_ProductInBillList");
+                }
                 if (ds == null || ds.Tables[0].Rows.Count <= 0)
                 {
                     objJsonResult.code = "0";
@@ -1056,6 +1063,7 @@
                 return objJsonResult;
             }
         }
+     
         /// <summary>
         ///浜у搧鍏ュ簱鍗曞垹闄ゅ姛鑳�
         /// </summary>
@@ -1086,14 +1094,7 @@
                 return objJsonResult;
             }
         }
-        #region sql璇彞
-
-
-        public static DataSet Sc_GetProductInBill(string sWhere)
-        {
-            return new SQLHelper.ClsCN().RunProcReturn("select * from h_v_IF_ProductInBillList order by 鏃ユ湡 desc", "h_v_IF_ProductInBillList");
-        }
-        #endregion
+      
 
 
         /// <summary>
@@ -1107,7 +1108,15 @@
             try
             {
 
-                ds = Sc_GetOtherInBill(sWhere);
+                if (sWhere == null || sWhere.Equals(""))
+                {
+                    ds = oCN.RunProcReturn("select * from h_v_Kf_OtherInBillList where 1=1  order by 鏃ユ湡 desc", "h_v_Kf_OtherInBillList");
+                }
+                else
+                {
+                    string sql = "select * from h_v_Kf_OtherInBillList where 1 = 1 " + sWhere+ " order by 鏃ユ湡 desc";
+                    ds = oCN.RunProcReturn(sql, "h_v_Kf_OtherInBillList");
+                }
                 if (ds == null || ds.Tables[0].Rows.Count <= 0)
                 {
                     objJsonResult.code = "0";
@@ -1134,16 +1143,6 @@
                 return objJsonResult;
             }
         }
-
-        #region sql璇彞
-
-
-        public static DataSet Sc_GetOtherInBill(string sWhere)
-        {
-            return new SQLHelper.ClsCN().RunProcReturn("select * from h_v_Kf_OtherInBillList order by 鏃ユ湡 desc ", "h_v_Kf_OtherInBillList");
-        }
-        #endregion
-
 
         /// <summary>
         /// 濮斿鍏ュ簱鍗曞垪琛�
@@ -1155,7 +1154,15 @@
         {
             try
             {
-                ds = Sc_GetEntrustInBill(sWhere);
+                if (sWhere == null || sWhere.Equals(""))
+                {
+                    ds = oCN.RunProcReturn("select * from h_v_Kf_EntrustInBillList where 1=1", "h_v_Kf_EntrustInBillList");
+                }
+                else
+                {
+                    string sql = "select * from h_v_Kf_EntrustInBillList where 1 = 1 " + sWhere;
+                    ds = oCN.RunProcReturn(sql, "h_v_Kf_EntrustInBillList");
+                }
                 if (ds == null || ds.Tables[0].Rows.Count <= 0)
                 {
                     objJsonResult.code = "0";
@@ -1182,16 +1189,6 @@
                 return objJsonResult;
             }
         }
-
-        #region sql璇彞
-
-
-        public static DataSet Sc_GetEntrustInBill(string sWhere)
-        {
-            return new SQLHelper.ClsCN().RunProcReturn("select * from h_v_Kf_EntrustInBillList ", "h_v_Kf_EntrustInBillList");
-        }
-        #endregion
-
 
         //娴嬭瘯涓撶敤鎺ュ彛
         [Route("LookingFor/Test")]
diff --git "a/WebAPI/Controllers/\344\273\223\345\255\230\347\256\241\347\220\206/\351\242\206\346\226\231\345\217\221\350\264\247/Kf_MateOutBackBillController.cs" "b/WebAPI/Controllers/\344\273\223\345\255\230\347\256\241\347\220\206/\351\242\206\346\226\231\345\217\221\350\264\247/Kf_MateOutBackBillController.cs"
index b26e5a0..c628f55 100644
--- "a/WebAPI/Controllers/\344\273\223\345\255\230\347\256\241\347\220\206/\351\242\206\346\226\231\345\217\221\350\264\247/Kf_MateOutBackBillController.cs"
+++ "b/WebAPI/Controllers/\344\273\223\345\255\230\347\256\241\347\220\206/\351\242\206\346\226\231\345\217\221\350\264\247/Kf_MateOutBackBillController.cs"
@@ -28,12 +28,31 @@
         {
             try
             {
-                ds = oCn.RunProcReturn("select * from h_v_IF_MateOutBackBillList order by 鏃ユ湡 desc", "h_v_IF_MateOutBackBillList");
-                objJsonResult.code = "1";
-                objJsonResult.count = 1;
-                objJsonResult.Message = "杩斿洖璁板綍鎴愬姛锛�";
-                objJsonResult.data = ds.Tables[0];
-                return objJsonResult;
+                if (sWhere == null || sWhere.Equals(""))
+                {
+                    ds = oCn.RunProcReturn("select * from h_v_IF_MateOutBackBillList order by 鏃ユ湡 desc", "h_v_IF_MateOutBackBillList");
+                }
+                else
+                {
+                    string sql = "select * from h_v_IF_MateOutBackBillList " + sWhere+ " order by 鏃ユ湡 desc";
+                    ds = oCn.RunProcReturn(sql, "h_v_IF_MateOutBackBillList");
+                }
+                if (ds == null || ds.Tables[0].Rows.Count == 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "false锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                else
+                {
+                    objJsonResult.code = "1";
+                    objJsonResult.count = 1;
+                    objJsonResult.Message = "Sucess锛�";
+                    objJsonResult.data = ds.Tables[0];
+                    return objJsonResult;
+                }
             }
             catch (Exception ex)
             {
diff --git "a/WebAPI/Controllers/\344\273\223\345\255\230\347\256\241\347\220\206/\351\252\214\346\224\266\345\205\245\345\272\223/Kf_StepFoldinBillController.cs" "b/WebAPI/Controllers/\344\273\223\345\255\230\347\256\241\347\220\206/\351\252\214\346\224\266\345\205\245\345\272\223/Kf_StepFoldinBillController.cs"
new file mode 100644
index 0000000..b1faa0d
--- /dev/null
+++ "b/WebAPI/Controllers/\344\273\223\345\255\230\347\256\241\347\220\206/\351\252\214\346\224\266\345\205\245\345\272\223/Kf_StepFoldinBillController.cs"
@@ -0,0 +1,67 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Data;
+using System.Linq;
+using System.Web;
+using System.Web.Http;
+using WebAPI.Models;
+
+namespace WebAPI.Controllers.浠撳瓨绠$悊.楠屾敹鍏ュ簱
+{
+    public class Kf_StepFoldinBillController : ApiController
+    {
+        public DBUtility.ClsPub.Enum_BillStatus BillStatus;//鍗曟嵁鐘舵�侊紙鏂板锛屼慨鏀癸紝娴忚锛屾洿鏂板崟浠凤紝鍙樻洿锛�
+        private json objJsonResult = new json();
+        public DataSet ds = new DataSet();
+        public SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
+
+        #region 濮斿鍔犲伐鍑哄簱鍗�
+
+        [Route("Kf_StepFoldinBill/GetStepFoldinBillList")]
+        [HttpGet]
+        public object GetStepFoldinBillList(string sWhere, string user, string Organization)
+        {
+            try
+            {
+                //鍒ゆ柇鏉冮檺(鐣�)
+                
+                string sql1 = string.Format("select * from h_v_Kf_MoveStockStepInBillList where (璋冨叆缁勭粐='" + Organization + "')");
+                if (sWhere == null || sWhere.Equals(""))
+                {
+                    ds = oCn.RunProcReturn(sql1 + " order by 鏃ユ湡 desc", "h_v_Kf_MoveStockStepInBillList");
+                }
+                else
+                {
+                    string sql = sql1 + sWhere + " order by 鏃ユ湡 desc";
+                    ds = oCn.RunProcReturn(sql, "h_v_Kf_MoveStockStepInBillList");
+                }
+                if (ds == null || ds.Tables[0].Rows.Count == 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                else
+                {
+                    objJsonResult.code = "1";
+                    objJsonResult.count = 1;
+                    objJsonResult.Message = "Sucess锛�";
+                    objJsonResult.data = ds.Tables[0];
+                    return objJsonResult;
+                }
+            }
+            catch (Exception ex)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�" + ex.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+
+        #endregion
+    }
+}
\ No newline at end of file
diff --git "a/WebAPI/Controllers/\345\215\232\346\227\245\350\207\252\345\212\250\346\211\253\347\240\201\347\272\277/ScanlineAPIController.cs" "b/WebAPI/Controllers/\345\215\232\346\227\245\350\207\252\345\212\250\346\211\253\347\240\201\347\272\277/ScanlineAPIController.cs"
index 0e1a8c2..94f0f7a 100644
--- "a/WebAPI/Controllers/\345\215\232\346\227\245\350\207\252\345\212\250\346\211\253\347\240\201\347\272\277/ScanlineAPIController.cs"
+++ "b/WebAPI/Controllers/\345\215\232\346\227\245\350\207\252\345\212\250\346\211\253\347\240\201\347\272\277/ScanlineAPIController.cs"
@@ -78,7 +78,7 @@
                 ScanLineCode list = js.Deserialize<ScanLineCode>(msg.ToString());    //灏唈son鏁版嵁杞寲涓哄璞$被鍨嬪苟璧嬪�肩粰list
                 if (list.billno != "" && list.billno != null)  //浠诲姟鍗曞彿锛岄潪蹇呴』锛岄潪绌哄垯鏍¢獙barcodes閲宐arcode鏄惁鐢辨浠诲姟鍗曞埗浣滅敓鎴愮殑
                 {
-                    ds = oCN.RunProcReturn("Select HBarCode barcode from Gy_BarCodeBill where HSourceBillNo='" + list.billno.ToString().Trim()+"'  Order by HItemID ", "Gy_BarCodeBill");
+                    ds = oCN.RunProcReturn("Select HBarCode barcode,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType from Gy_BarCodeBill where HSourceBillNo='" + list.billno.ToString().Trim()+"'  Order by HItemID ", "Gy_BarCodeBill");
                     if (ds == null || ds.Tables[0].Rows.Count == 0)
                     {
                         objJsonResult.status = -1;
@@ -227,7 +227,17 @@
         {
             try
             {
-                ds = oCN.RunProcReturn("Select * from Gy_BarCodeBill where HBarCode='" + packagebarcode.ToString().Trim() + "'", "Gy_BarCodeBill");
+                //鍒ゆ柇鏄惁鍏ュ簱 
+                ds = oCN.RunProcReturn("select * from Sc_ScanLineInStock where HBarCode_Pack='" + packagebarcode + "'", "Sc_ScanLineInStock");
+                if (ds!= null && ds.Tables[0].Rows.Count>0)
+                {
+                    objJsonResult.status = -1;
+                    objJsonResult.msg = "璇ョ鏉$爜宸插叆搴撲笉鍏佽鍙栨秷!";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
+                ds = oCN.RunProcReturn("Select 1 from Gy_BarCodeBill where HBarCode='" + packagebarcode.ToString().Trim() + "'", "Gy_BarCodeBill");
                 if (ds == null && ds.Tables[0].Rows.Count == 0)
                 {
                     objJsonResult.status = -1;
@@ -235,7 +245,7 @@
                     objJsonResult.data = null;
                     return objJsonResult;
                 }
-                ds = oCN.RunProcReturn("Select * from Gy_BarCodeBill where HBarCode='" + packagebarcode.ToString().Trim() + "' and HStopflag='1'", "Gy_BarCodeBill");
+                ds = oCN.RunProcReturn("Select 1 from Gy_BarCodeBill where HBarCode='" + packagebarcode.ToString().Trim() + "' and HStopflag='1'", "Gy_BarCodeBill");
                 if (ds != null && ds.Tables[0].Rows.Count>0)
                 {
                     objJsonResult.status = -1;
@@ -246,12 +256,14 @@
 
                 //
                 oCN.BeginTran();
+                //鍒犻櫎SUM涓昏〃
+                oCN.RunProc("Delete From Sc_PackUnionBillSub_Sum  where HBarCode_Pack='" + packagebarcode.ToString() + "'");
                 //鍒犻櫎瀛愯〃
                 oCN.RunProc("Delete From Sc_PackUnionBillSub  where HBarCode_Pack='"+ packagebarcode.ToString() + "'");
                 //鍒犻櫎涓昏〃
                 oCN.RunProc("Delete From Sc_PackUnionBillMain  where HBarCode_Pack='" + packagebarcode.ToString() + "'");
                 //浣滃簾鏉$爜妗f琛�
-                oCN.RunProc("Update  Gy_BarCodeBill set HStopflag='1'  where HBarCode='"+ packagebarcode .ToString()+ "'");
+                oCN.RunProc("Update  Gy_BarCodeBill set HStopflag='1'  where HBarCode='"+ packagebarcode.ToString()+ "'");
 
                 oCN.Commit();
 
diff --git "a/WebAPI/Controllers/\345\237\272\347\241\200\350\265\204\346\226\231/\345\237\272\347\241\200\350\265\204\346\226\231/Gy_StockCheckItemBillController.cs" "b/WebAPI/Controllers/\345\237\272\347\241\200\350\265\204\346\226\231/\345\237\272\347\241\200\350\265\204\346\226\231/Gy_StockCheckItemBillController.cs"
index 573a432..14262b3 100644
--- "a/WebAPI/Controllers/\345\237\272\347\241\200\350\265\204\346\226\231/\345\237\272\347\241\200\350\265\204\346\226\231/Gy_StockCheckItemBillController.cs"
+++ "b/WebAPI/Controllers/\345\237\272\347\241\200\350\265\204\346\226\231/\345\237\272\347\241\200\350\265\204\346\226\231/Gy_StockCheckItemBillController.cs"
@@ -278,7 +278,7 @@
                         left join Gy_Customer c1 on m.HNowSupID=c1.HItemID
                         left join Gy_Warehouse w on k.HCorrespondentID=w.HItemID
                         left join Gy_Warehouse w1 on m.HNowSupID=w1.HItemID
-						where k.HBillType='3822' and " + sWhere);
+						where " + sWhere);
                 }
                 else
                 {
@@ -296,7 +296,7 @@
                         left join Gy_Customer c1 on m.HNowSupID=c1.HItemID
                         left join Gy_Warehouse w on k.HCorrespondentID=w.HItemID
                         left join Gy_Warehouse w1 on m.HNowSupID=w1.HItemID
-						where k.HBillType='3822' and " + sWhere + " and k.HSourceInterID=(select HItemID from Gy_StockCheckItem where HItemID=" + sID + ") and k.HMakeDate<=(select HEndDate from Gy_StockCheckItem where HItemID=" + sID + ")");
+						where " + sWhere + " and k.HSourceInterID=(select HItemID from Gy_StockCheckItem where HItemID=" + sID + ") and k.HMakeDate<=(select HEndDate from Gy_StockCheckItem where HItemID=" + sID + ")");
                 }
                 ds = oCN.RunProcReturn(sql, "Sc_MouldStockBillMain_Temp");
                 list.Add(ds.Tables[0]);
@@ -317,98 +317,9 @@
         }
         #endregion
 
-        
-        #region 鐩樼偣璁板綍鍒楄〃
-        [Route("Gy_StockCheckItemBill/Get_MouldStockBillMainTemp")]
-        [HttpGet]
-        public object Get_MouldStockBillMainTemp(string sWhere)
-        {
-            try
-            {
-                ds = MouldStockBillMainTemp(sWhere);
-                if (ds == null)
-                {
-                    objJsonResult.code = "0";
-                    objJsonResult.count = 0;
-                    objJsonResult.Message = "鏌ヨ鏁版嵁寮傚父锛岃涓庣鐞嗗憳鑱旂郴锛�";
-                    objJsonResult.data = null;
-                    return objJsonResult;
-                }
-                else
-                {
-                    objJsonResult.code = "1";
-                    objJsonResult.count = 1;
-                    objJsonResult.Message = "杩斿洖璁板綍鎴愬姛锛�";
-                    objJsonResult.data = ds.Tables[0];
-                    return objJsonResult;
-                }
-            }
-            catch (Exception ex)
-            {
-                objJsonResult.code = "0";
-                objJsonResult.count = 0;
-                objJsonResult.Message = "鏌ヨ鏁版嵁寮傚父锛岃涓庣鐞嗗憳鑱旂郴锛�" + ex.ToString();
-                objJsonResult.data = null;
-                return objJsonResult;
-            }
-        }
-
-        public static DataSet MouldStockBillMainTemp(string sWhere)
-        {
-            string sql1 = string.Format(@"select * from h_v_Gy_MouldStockBillMainTempList where 1=1 ");
-            if (sWhere == null || sWhere.Equals(""))
-            {
-                return new SQLHelper.ClsCN().RunProcReturn(sql1 + sWhere + " order by 鍒跺崟鏃ユ湡 desc", "h_v_Gy_MouldStockBillMainTempList");
-            }
-            else
-            {
-                string sql = sql1 + sWhere + "order by 鍒跺崟鏃ユ湡 desc";
-                return new SQLHelper.ClsCN().RunProcReturn(sql, "h_v_Gy_MouldStockBillMainTempList");
-            }
-        }
-        #endregion
-
-        #region [鐩樼偣鏂规鍒犻櫎鍔熻兘]
-        [Route("Gy_StockCheckItemBill/set_DeleteBill_Temp")]
-        [HttpGet]
-        public object set_DeleteBill_Temp(string HItemID)
-        {
-            Int64 lngBillKey = 0;
-            lngBillKey = DBUtility.ClsPub.isLong(HItemID);
-            if (lngBillKey == 0)
-            {
-                objJsonResult.code = "0";
-                objJsonResult.count = 0;
-                objJsonResult.Message = "鍗曟嵁ID涓虹┖锛�";
-                objJsonResult.data = null;
-                return objJsonResult;
-            }
-            ds = oCn.RunProcReturn("select * from Sc_MouldStockBillMain_Temp where HItemID=" + lngBillKey, "Sc_MouldStockBillMain_Temp");
-            if (ds != null)
-            {
-                oCn.RunProc("Delete from Sc_MouldStockBillMain_Temp where HItemID=" + lngBillKey);
-                objJsonResult.code = "1";
-                objJsonResult.count = 1;
-                objJsonResult.Message = "鍒犻櫎鎴愬姛锛�";
-                objJsonResult.data = null;
-                return objJsonResult;
-            }
-            else
-            {
-                objJsonResult.code = "0";
-                objJsonResult.count = 0;
-                objJsonResult.Message = "姝ゅ崟鎹笉瀛樺湪锛岃鏌ョ湅鏄惁閲嶅鍒犻櫎";
-                objJsonResult.data = null;
-                return objJsonResult;
-            }
-
-        }
-
-        #endregion
-
         #region 鐩樼偣鍒嗘瀽瀹℃牳
         #region 璋冩嫧鈥旂洿鎺ヨ皟鎷�
-        [Route("Gy_StockCheckItemBill/MakeProdMove")]
+            [Route("Gy_StockCheckItemBill/MakeProdMove")]
             [HttpGet]
             public object MakeProdMove(string HBarCode, string user, string userID)
         {
diff --git a/WebAPI/DLL/ClsSc_PackUnionBill.cs b/WebAPI/DLL/ClsSc_PackUnionBill.cs
index 2fcf05d..0f94328 100644
--- a/WebAPI/DLL/ClsSc_PackUnionBill.cs
+++ b/WebAPI/DLL/ClsSc_PackUnionBill.cs
@@ -83,6 +83,7 @@
         //鏂板鍗曟嵁
         public override bool AddBill(ref string sReturn)
         {
+            string ww = "";
             try
             {
                 //寰楀埌mainid
@@ -99,7 +100,7 @@
                 " values(" + omodel.HYear + "," + omodel.HPeriod + ",'" + this.BillType + "'," + omodel.HInterID + "" +
                 ",'" + omodel.HDate + "','" + omodel.HBillNo.ToString() + "'," + omodel.HBillStatus + ",'" + omodel.HRemark + "'," + omodel.HICMOInterID + "" +
                 ",'" + omodel.HICMOBillNo.ToString() + "','" + omodel.HBarCode_Pack.ToString() + "'," + omodel.HMaterID + "," + omodel.HUnitID + "" +
-                ",'" + DBUtility.ClsPub.CurUserName + "','" + DBUtility.ClsPub.GetServerDate(-1) + "'" +
+                ",'Admin','" + DBUtility.ClsPub.GetServerDate(-1) + "'" +
                 ") ");
                 ////鎻掑叆瀛愯〃
                 string HSourceInterID = "0";
@@ -135,8 +136,9 @@
                 //Int64 ZHInterID = DBUtility.ClsPub.CreateBillID_Prod("85", ref DBUtility.ClsPub.sExeReturnInfo);
                 oCn.RunProc("insert into Gy_BarCodeBill(HInterID,HEntryID,HBarCode,HBarCodeType,HMaterID,HUnitID,HQty,HBatchNo,HMakeDate " +
                              ",HSourceInterID, HSourceEntryID, HSourceBillNo, HSourceBillType, HUseFlag, HStopflag, HSupID, HGroupID, HPrintQty)" +
-                             "values('" + HSourceInterID + "', 1, '" + omodel.HBarCode_Pack + "', '绠卞彿鏉$爜', '" + HMaterID + "', '" + HUnitID + "','" + HQty + "', '', getdate()" +
+                             "values('" + HSourceInterID + "', 1, '" + omodel.HBarCode_Pack + "', '鎵樼洏鏉$爜', '" + HMaterID + "', '" + HUnitID + "','" + HQty + "', '', getdate()" +
                              ", '" + HSourceInterID + "', '" + HSourceEntryID + "', '" + HSourceBillNo + "', '" + HSourceBillType + "', 1, 0, 0, 0, 0)");
+                oCn.RunProcReturn("exec h_p_Sc_PackUnionBill_SumSubBill2 " + omodel.HInterID + ",'"+ omodel.HBillNo.ToString() + "','"+ this.BillType + "','Admin'", "h_p_JIT_MESBeginWorkBill_SaveCtrl");
                 sReturn = "鏂板鍗曟嵁鎴愬姛锛�";
                 oCn.Commit();
                 return true;
diff --git a/WebAPI/WebAPI.csproj b/WebAPI/WebAPI.csproj
index 0cf6b76..0700d5d 100644
--- a/WebAPI/WebAPI.csproj
+++ b/WebAPI/WebAPI.csproj
@@ -351,6 +351,7 @@
     <Compile Include="Controllers\SCGL\Sc_ProductionReturnBillController.cs" />
     <Compile Include="Controllers\SCGL\Sc_PackUnionBillController.cs" />
     <Compile Include="Controllers\Sc_ProcessMangementController.cs" />
+    <Compile Include="Controllers\浠撳瓨绠$悊\楠屾敹鍏ュ簱\Kf_StepFoldinBillController.cs" />
     <Compile Include="Controllers\鍗氭棩鑷姩鎵爜绾縗ScanlineAPIController.cs" />
     <Compile Include="Controllers\鍩虹璧勬枡\鍩虹璧勬枡\Gy_StockCheckItemBillController.cs" />
     <Compile Include="Controllers\宸ヨ祫绠$悊\Gy_ClassTimePrjBillController.cs" />
@@ -718,6 +719,7 @@
     <Folder Include="Views\Cg_PurchaseReturn\" />
     <Folder Include="Views\Gy_EquipType\" />
     <Folder Include="Views\Kf_ICStockBillMain\" />
+    <Folder Include="Views\kf_StepFoldinBill\" />
     <Folder Include="Views\MoveStockBill\" />
     <Folder Include="Views\ProductionReturnBill\" />
     <Folder Include="Views\QC_Management\" />

--
Gitblit v1.9.1