From 001aa51e3a7f669594bc958424be9b74b44cd7a9 Mon Sep 17 00:00:00 2001
From: zgq <519541279@qq.com>
Date: 星期六, 29 五月 2021 15:29:16 +0800
Subject: [PATCH] 工序模块优化

---
 /dev/null                                                     |   75 --
 WebAPI/Models/StationBill.cs                                  |    3 
 WebAPI/Controllers/CJGL/Cj_StationEntrustInBillController.cs  |  209 +++++++
 WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs        |  280 +++++++++
 WebAPI/Properties/PublishProfiles/API.pubxml.user             |  130 ++--
 WebAPI/WebAPI.csproj                                          |    2 
 WebAPI/Controllers/CJGL/Cj_StationInBillController.cs         |  580 +++++++++++++++-------
 WebAPI/Controllers/CJGL/Cj_StationEntrustOutBillController.cs |  228 +++++++
 8 files changed, 1,111 insertions(+), 396 deletions(-)

diff --git a/WebAPI/Controllers/CJGL/Cj_StationEntrustInBillController.cs b/WebAPI/Controllers/CJGL/Cj_StationEntrustInBillController.cs
index 22e4bde..5caf37a 100644
--- a/WebAPI/Controllers/CJGL/Cj_StationEntrustInBillController.cs
+++ b/WebAPI/Controllers/CJGL/Cj_StationEntrustInBillController.cs
@@ -139,7 +139,7 @@
                 //濮斿宸ュ簭鍙戝嚭鍙嶅簭鍒楀寲
                 msg1 = "[" + msg1.ToString() + "]";
                 List<StationBill> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<StationBill>>(msg1);
-
+                string eventType = list[0].eventType;
                 long HInterID = list[0].HInterID;//閫掑叆type寰楀埌鐨勫崟鎹甀D
                 int HYear = 2021;
                 double HPeriod = list[0].HPeriod;//鍗曚环
@@ -148,8 +148,8 @@
                 string HInnerBillNo = list[0].HInnerBillNo;//閫佽揣鍗曞彿
                 string HICMOBillNo = list[0].HICMOBillNo;//鐢熶骇璁㈠崟鍙�
                 long HICMOInterID = list[0].HICMOInterID;//鐢熶骇璁㈠崟鍙稩D
-                int HProcExchInterID = 0;
-                int HProcExchEntryID = 0;
+                long HProcExchInterID = list[0].lngBillKey;
+                long HProcExchEntryID = list[0].lngBillSubKey;
                 string HProcExchBillNo = list[0].HProcExchBillNo;//娴佽浆鍗�
                 long HProcID = list[0].HProcID;//褰撳墠宸ュ簭
                 long HMaterID = list[0].HMaterID;//浜у搧ID
@@ -180,27 +180,137 @@
                 string HBarCode = list[0].HBarCode;//鏉″舰鐮�
                 string HAddr = "";
                 string HBarCodeMaker = "";
-
+                if (HProcExchInterID <= 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "娴佽浆鍗℃病鏈夐�夋嫨锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                if (HProcExchEntryID <= 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "娴佹按鍙�2娌℃湁閫夋嫨锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                if (HProcNo <= 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "娴佹按鍙锋病鏈夐�夋嫨锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                if (HProcExchBillNo == "")
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "娴佽浆鍗″彿娌℃湁閫夋嫨锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                if (HMaterID <= 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "浜у搧娌℃湁閫夋嫨锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                if (HSupID <= 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "渚涘簲鍟嗘病鏈夐�夋嫨锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                if (HProcID <= 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "褰撳墠宸ュ簭娌℃湁閫夋嫨锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                if (HQty <= 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鍙戝嚭鏁伴噺涓嶈兘涓�0锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
                 //鑻AINDI閲嶅鍒欓噸鏂拌幏鍙�
                 oCN.BeginTran();
-                //涓昏〃
-                oCN.RunProc("Insert Into Sc_StationInBillMain " +
-                "(HBillType,HBillSubType,HInterID,HBillNo,HBillStatus,HDate,HMaker,HMakeDate" +
-                ",HYear,HPeriod,HRemark,HInnerBillNo" +
-                ",HICMOInterID,HICMOBillNo,HProcPlanInterID,HProcPlanEntryID,HProcPlanBillNo,HProcExchInterID,HProcExchEntryID" +
-                ",HProcExchBillNo,HMaterID,HProcID,HICMOQty,HPlanQty,HStationInTime,HSourceID" +
-                ",HGroupID,HDeptID,HEmpID,HBarCode,HAddr,HBarCodeMaker,HBarCodeMakeDate" +
-                ",HSupID,HTaxRate,HQty,HPrice,HMoney,HPieceQty" +
-                ",HProcNo,HOrderProcNO,HWWWorkOrderBillNo,HWWWorkOrderInterID,HWWWorkOrderEntryID" +
-                ") " +
-                " values('3792','3792'," + HInterID.ToString() + ",'" + HBillNo + "','" + HBillStatus.ToString() + "',getdate(),'" + HMaker + "',getdate()" +
-                ",'" + HYear.ToString() + "','" + HPeriod.ToString() + "','" + HRemark + "','" + HInnerBillNo + "'" +
-                "," + HICMOInterID + ",'" + HICMOBillNo + "'," + HProcPlanInterID + "," + HProcPlanEntryID + ",'" + HProcPlanBillNo + "'," + HProcExchInterID + "," + HProcExchEntryID +
-                ",'" + HProcExchBillNo + "'," + HMaterID + "," + HProcID + "," + HICMOQty + "," + HPlanQty + ",getdate()," + HSourceID +
-                "," + HGroupID + "," + HDeptID + "," + HEmpID + ",'" + HBarCode + "','" + HAddr + "','" + HBarCodeMaker + "',getdate()" +
-                "," + HSupID + "," + HTaxRate + "," + HQty + "," + HPrice + "," + HMoney + "," + HPieceQty +
-                ",'" + HProcNo + "','" + HOrderProcNO + "'" + ",'" + HWWWorkOrderBillNo + "'" + "," + HWWWorkOrderInterID + "" + "," + HWWWorkOrderEntryID + "" +
-              ") ");
+                if ("Add".Equals(eventType))
+                {
+                    if (!AllowbillNo(HBillNo))
+                    {
+                        oCN.RollBack();
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "鍗曟嵁鍙烽噸澶嶏紒";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                    //涓昏〃
+                    oCN.RunProc("Insert Into Sc_StationInBillMain " +
+                    "(HBillType,HBillSubType,HInterID,HBillNo,HBillStatus,HDate,HMaker,HMakeDate" +
+                    ",HYear,HPeriod,HRemark,HInnerBillNo" +
+                    ",HICMOInterID,HICMOBillNo,HProcPlanInterID,HProcPlanEntryID,HProcPlanBillNo,HProcExchInterID,HProcExchEntryID" +
+                    ",HProcExchBillNo,HMaterID,HProcID,HICMOQty,HPlanQty,HStationInTime,HSourceID" +
+                    ",HGroupID,HDeptID,HEmpID,HBarCode,HAddr,HBarCodeMaker,HBarCodeMakeDate" +
+                    ",HSupID,HTaxRate,HQty,HPrice,HMoney,HPieceQty" +
+                    ",HProcNo,HOrderProcNO,HWWWorkOrderBillNo,HWWWorkOrderInterID,HWWWorkOrderEntryID" +
+                    ") " +
+                    " values('3792','3792'," + HInterID.ToString() + ",'" + HBillNo + "','" + HBillStatus.ToString() + "',getdate(),'" + HMaker + "',getdate()" +
+                    ",'" + HYear.ToString() + "','" + HPeriod.ToString() + "','" + HRemark + "','" + HInnerBillNo + "'" +
+                    "," + HICMOInterID + ",'" + HICMOBillNo + "'," + HProcPlanInterID + "," + HProcPlanEntryID + ",'" + HProcPlanBillNo + "'," + HProcExchInterID + "," + HProcExchEntryID +
+                    ",'" + HProcExchBillNo + "'," + HMaterID + "," + HProcID + "," + HICMOQty + "," + HPlanQty + ",getdate()," + HSourceID +
+                    "," + HGroupID + "," + HDeptID + "," + HEmpID + ",'" + HBarCode + "','" + HAddr + "','" + HBarCodeMaker + "',getdate()" +
+                    "," + HSupID + "," + HTaxRate + "," + HQty + "," + HPrice + "," + HMoney + "," + HPieceQty +
+                    ",'" + HProcNo + "','" + HOrderProcNO + "'" + ",'" + HWWWorkOrderBillNo + "'" + "," + HWWWorkOrderInterID + "" + "," + HWWWorkOrderEntryID + "" +
+                    ") ");
+                }
+                else if ("Modify".Equals(eventType))
+                {
+
+                    //鍒犻櫎鍏宠仈
+                    oCN.RunProc("exec h_p_Mes_ProcessExchangeRelationQty_In " + HInterID + ",-1");
+                    oCN.RunProc("exec h_p_WW_EntrustWorkOrderRelationQty_In " + HInterID + ",-1");
+
+                    //鏇存柊涓昏〃
+                    oCN.RunProc("UpDate Sc_StationInBillMain set  " +
+                    "HBillNo='" + HBillNo + "'" + 
+                    ",HRemark='" + HRemark + "'" +
+                    ",HUpDater='" + DBUtility.ClsPub.CurUserName + "'" +
+                    ",HUpDateDate=getdate()" +
+                    ",HInnerBillNo='" + HInnerBillNo + "'" +
+                    ",HSupID=" + HSupID +
+                    ",HQty=" + HQty +
+                    ",HPieceQty=" + HPieceQty +
+                    ",HPrice=" + HPrice +
+                    ",HMoney=" + HMoney +
+                    ",HTaxRate=" + HTaxRate +
+                    ",HMaterID=" + HMaterID +
+                    ",HProcID=" + HProcID +
+                    ",HProcNo=" + HProcNo +
+                    ",HOrderProcNO='" + HOrderProcNO + "'" +
+                    " where HInterID=" + HInterID);
+                }
+                else
+                {
+                    oCN.RollBack();
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鎿嶄綔绫诲瀷鏃犳晥锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
                 ds = oCN.RunProcReturn("exec h_p_MES_StationInBill_QtyCtrl " + HInterID + "", "h_p_MES_StationInBill_QtyCtrl");
                 if (ds == null)
                 {
@@ -240,7 +350,6 @@
             }
             catch (Exception e)
             {
-                oCN.RollBack();
                 objJsonResult.code = "0";
                 objJsonResult.count = 0;
                 objJsonResult.Message = "Exception锛�" + e.Message;
@@ -248,5 +357,59 @@
                 return objJsonResult;
             }
         }
+
+        private bool AllowbillNo(string HBillNo)
+        {
+            ds = oCN.RunProcReturn("select HBillNo from Sc_StationInBillMain where  HBillNo = '" + HBillNo + "'", "Sc_StationInBillMain");
+            if (ds == null || ds.Tables[0].Rows.Count == 0)
+            {
+                return true;
+            }
+            return false;
+        }
+
+        /// <summary>
+        /// 缂栬緫椤甸潰鏍规嵁id鑾峰彇濮斿宸ュ簭鎺ユ敹鍗曚俊鎭�
+        ///鍙傛暟锛歴tring sql銆�
+        ///杩斿洖鍊硷細object銆�
+        /// </summary>
+        [Route("Cj_StationEntrustInBill/GetStationEntrustInBill")]
+        [HttpGet]
+        public object GetStationEntrustInBill(int HInterID)
+        {
+            try
+            {
+                ds = oCN.RunProcReturn("select * from h_v_GetStationInBill where HInterID = " + HInterID, "h_v_GetStationOutBill");
+                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 e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "Exception锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+
+
+
+
+        //
     }
 }
\ No newline at end of file
diff --git a/WebAPI/Controllers/CJGL/Cj_StationEntrustOutBillController.cs b/WebAPI/Controllers/CJGL/Cj_StationEntrustOutBillController.cs
index dadcc8d..5c82b3c 100644
--- a/WebAPI/Controllers/CJGL/Cj_StationEntrustOutBillController.cs
+++ b/WebAPI/Controllers/CJGL/Cj_StationEntrustOutBillController.cs
@@ -84,7 +84,7 @@
                 //閮ㄩ棬鍩虹璧勬枡鍙嶅簭鍒楀寲
                 msg1 = "[" + msg1.ToString() + "]";
                 List<StationBill> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<StationBill>>(msg1);
-
+                string eventType = list[0].eventType;
                 long HInterID = list[0].HInterID;//閫掑叆type寰楀埌鐨勫崟鎹甀D
                 int HYear = 2021;
                 double HPeriod = list[0].HPeriod;//鍗曚环
@@ -93,8 +93,8 @@
                 string HInnerBillNo = list[0].HInnerBillNo;//閫佽揣鍗曞彿
                 string HICMOBillNo = list[0].HICMOBillNo;//鐢熶骇璁㈠崟鍙�
                 long HICMOInterID = list[0].HICMOInterID;//鐢熶骇璁㈠崟鍙稩D
-                int HProcExchInterID = 0;
-                int HProcExchEntryID = 0;
+                long HProcExchInterID = list[0].lngBillKey;
+                long HProcExchEntryID = list[0].lngBillSubKey;
                 string HProcExchBillNo = list[0].HProcExchBillNo;//娴佽浆鍗�
                 long HProcID = list[0].HProcID;//褰撳墠宸ュ簭
                 long HMaterID = list[0].HMaterID;//浜у搧ID
@@ -136,27 +136,162 @@
                 double HMainSourceInterID = 0;
                 string HMainSourceBillNo = "";
                 string HMainSourceBillType = "3792";
-
+                if (HProcExchInterID <= 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "娴佽浆鍗℃病鏈夐�夋嫨锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                if (HProcExchEntryID <= 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "娴佹按鍙�2娌℃湁閫夋嫨锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                if (HProcNo <= 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "娴佹按鍙锋病鏈夐�夋嫨锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                if (HProcExchBillNo == "")
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "娴佽浆鍗″彿娌℃湁閫夋嫨锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                if (HInnerBillNo == "")
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鍙戣揣鍙锋病鏈夎緭鍏ワ紒";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                if (HProcID <= 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "褰撳墠宸ュ簭娌℃湁閫夋嫨锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                if (HMaterID <= 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "浜у搧娌℃湁閫夋嫨锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                if (HSupID <= 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "渚涘簲鍟嗘病鏈夐�夋嫨锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                if (HQty <= 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鎺ユ敹涓暟涓嶈兘灏忎簬绛変簬0锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                if (HWasterQty < 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "涓嶅悎鏍兼暟涓嶈兘灏忎簬0锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                if (HTaxRate < 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "绋庣巼涓嶈兘涓鸿礋锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
                 //鑻AINDI閲嶅鍒欓噸鏂拌幏鍙�
                 oCN.BeginTran();
-                //涓昏〃
-                oCN.RunProc("Insert Into Sc_StationOutBillMain " +
-                "(HBillType,HBillSubType,HInterID,HBillNo,HBillStatus,HDate,HMaker,HMakeDate" +
-                ",HYear,HPeriod,HRemark,HInnerBillNo,HSourceName,HPieceQty,HWasterQty,HPlanPieceQty,HBadPNL" +
-                ",HICMOInterID,HICMOBillNo,HProcPlanInterID,HProcPlanEntryID,HProcPlanBillNo,HProcExchInterID,HProcExchEntryID" +
-                ",HProcExchBillNo,HMaterID,HProcID,HICMOQty,HPlanQty,HStationOutTime,HSourceID" +
-                ",HGroupID,HDeptID,HEmpID,HBarCode,HAddr,HBarCodeMaker,HBarCodeMakeDate" +
-                ",HSupID,HTaxRate,HQty,HPrice,HMoney,HPrice_BHS,HMoney_BHS,HBadCount" +
-                ",HMainSourceInterID,HMainSourceBillNo,HMainSourceBillType,HProcNo,HOrderProcNO,HLastSubProc,HWWWorkOrderBillNo,HWWWorkOrderInterID,HWWWorkOrderEntryID" +
-                ") " +
-                " values('" + BillType + "','" + BillType + "'," + HInterID + ",'" + HBillNo + "'," + HBillStatus + ",getdate(),'" + HMaker + "',getdate()" +
-                "," + HYear + "," + HPeriod + ",'" + HRemark + "','" + HInnerBillNo + "','" + HSourceName + "'," + HPieceQty + "," + HWasterQty + "," + HPlanPieceQty + "," + HBadPNL +
-                "," + HICMOInterID + ",'" + HICMOBillNo + "'," + HProcPlanInterID + "," + HProcPlanEntryID + ",'" + HProcPlanBillNo + "'," + HProcExchInterID + "," + HProcExchEntryID +
-                ",'" + HProcExchBillNo + "'," + HMaterID + "," + HProcID + "," + HICMOQty + "," + HPlanQty + ",getdate()," + HSourceID +
-                "," + HGroupID + "," + HDeptID + "," + HEmpID + ",'" + HBarCode + "','" + HAddr + "','" + HBarCodeMaker + "',getdate()" +
-                "," + HSupID + "," + HTaxRate + "," + HQty + "," + HPrice + "," + HMoney + "," + HPrice_BHS + "," + HMoney_BHS + "," + HBadCount +
-                "," + HMainSourceInterID + ",'" + HMainSourceBillNo + "','" + HMainSourceBillType + "'," + HProcNo + ",'" + HOrderProcNO + "'," + Convert.ToString(HLastSubProc ? 1 : 0) + ",'" + HWWWorkOrderBillNo + "'," + HWWWorkOrderInterID + "," + HWWWorkOrderEntryID + 
-              ") ");
+                if ("Add".Equals(eventType))
+                {
+                    if (!AllowbillNo(HBillNo))
+                    {
+                        oCN.RollBack();
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "鍗曟嵁鍙烽噸澶嶏紒";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                    //涓昏〃
+                    oCN.RunProc("Insert Into Sc_StationOutBillMain " +
+                    "(HBillType,HBillSubType,HInterID,HBillNo,HBillStatus,HDate,HMaker,HMakeDate" +
+                    ",HYear,HPeriod,HRemark,HInnerBillNo,HSourceName,HPieceQty,HWasterQty,HPlanPieceQty,HBadPNL" +
+                    ",HICMOInterID,HICMOBillNo,HProcPlanInterID,HProcPlanEntryID,HProcPlanBillNo,HProcExchInterID,HProcExchEntryID" +
+                    ",HProcExchBillNo,HMaterID,HProcID,HICMOQty,HPlanQty,HStationOutTime,HSourceID" +
+                    ",HGroupID,HDeptID,HEmpID,HBarCode,HAddr,HBarCodeMaker,HBarCodeMakeDate" +
+                    ",HSupID,HTaxRate,HQty,HPrice,HMoney,HPrice_BHS,HMoney_BHS,HBadCount" +
+                    ",HMainSourceInterID,HMainSourceBillNo,HMainSourceBillType,HProcNo,HOrderProcNO,HLastSubProc,HWWWorkOrderBillNo,HWWWorkOrderInterID,HWWWorkOrderEntryID" +
+                    ") " +
+                    " values('" + BillType + "','" + BillType + "'," + HInterID + ",'" + HBillNo + "'," + HBillStatus + ",getdate(),'" + HMaker + "',getdate()" +
+                    "," + HYear + "," + HPeriod + ",'" + HRemark + "','" + HInnerBillNo + "','" + HSourceName + "'," + HPieceQty + "," + HWasterQty + "," + HPlanPieceQty + "," + HBadPNL +
+                    "," + HICMOInterID + ",'" + HICMOBillNo + "'," + HProcPlanInterID + "," + HProcPlanEntryID + ",'" + HProcPlanBillNo + "'," + HProcExchInterID + "," + HProcExchEntryID +
+                    ",'" + HProcExchBillNo + "'," + HMaterID + "," + HProcID + "," + HICMOQty + "," + HPlanQty + ",getdate()," + HSourceID +
+                    "," + HGroupID + "," + HDeptID + "," + HEmpID + ",'" + HBarCode + "','" + HAddr + "','" + HBarCodeMaker + "',getdate()" +
+                    "," + HSupID + "," + HTaxRate + "," + HQty + "," + HPrice + "," + HMoney + "," + HPrice_BHS + "," + HMoney_BHS + "," + HBadCount +
+                    "," + HMainSourceInterID + ",'" + HMainSourceBillNo + "','" + HMainSourceBillType + "'," + HProcNo + ",'" + HOrderProcNO + "'," + Convert.ToString(HLastSubProc ? 1 : 0) + ",'" + HWWWorkOrderBillNo + "'," + HWWWorkOrderInterID + "," + HWWWorkOrderEntryID +
+                    ") ");
+                }
+                else if ("Modify".Equals(eventType))
+                {
+                    oCN.RunProc("exec h_p_Mes_ProcessExchangeRelationQty_Out " + HInterID + ",-1");
+                    oCN.RunProc("exec h_p_WW_EntrustWorkOrderRelationQty_Out " + HInterID + ",-1");
+                    //鏇存柊涓昏〃
+                    oCN.RunProc("UpDate Sc_StationOutBillMain set  " +
+                    " HBillNo='" + HBillNo + "'" +  
+                    ",HRemark='" + HRemark + "'" +
+                    ",HUpDater='" + HMaker + "'" +
+                    ",HUpDateDate=getdate()" +
+                    ",HInnerBillNo='" + HInnerBillNo + "'" +
+                    ",HSupID=" + HSupID +
+                    ",HQty=" + HQty +
+                    ",HPieceQty=" + HPieceQty +
+                    ",HPrice=" + HPrice +
+                    ",HMoney=" + HMoney +
+                     ",HProcNo=" + HProcNo +
+                    ",HPrice_BHS=" + HPrice_BHS +
+                    ",HMoney_BHS=" + HMoney_BHS +
+                    ",HTaxRate=" + HTaxRate +
+                    ",HOrderProcNO='" + HOrderProcNO + "'" +
+                    ",HMaterID=" + HMaterID +
+                    ",HProcID=" + HProcID +
+                    ",HBadPNL=" + HBadPNL +
+                    ",HWasterQty=" + HWasterQty +
+                    " where HInterID=" + HInterID);
+                }
+                else
+                {
+                    oCN.RollBack();
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鎿嶄綔绫诲瀷鏃犳晥锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
                 ds = oCN.RunProcReturn("exec h_p_MES_StationOutBill_QtyCtrl " + HInterID + "", "h_p_MES_StationOutBill_QtyCtrl");
                 if (ds == null)
                 {
@@ -196,7 +331,6 @@
             }
             catch (Exception e)
             {
-                oCN.RollBack();
                 objJsonResult.code = "0";
                 objJsonResult.count = 0;
                 objJsonResult.Message = "Exception锛�" + e.ToString();
@@ -204,7 +338,53 @@
                 return objJsonResult;
             }
         }
-
+        private bool AllowbillNo(string HBillNo)
+        {
+            ds = oCN.RunProcReturn("select HBillNo from Sc_StationOutBillMain where  HBillNo = '" + HBillNo + "'", "Sc_StationOutBillMain");
+            if (ds == null || ds.Tables[0].Rows.Count == 0)
+            {
+                return true;
+            }
+            return false;
+        }
+        /// <summary>
+        /// 缂栬緫椤甸潰鏍规嵁id鑾峰彇濮斿宸ュ簭鎺ユ敹鍗曚俊鎭�
+        ///鍙傛暟锛歴tring sql銆�
+        ///杩斿洖鍊硷細object銆�
+        /// </summary>
+        [Route("Cj_StationEntrustOutBill/GetStationEntrustOutBill")]
+        [HttpGet]
+        public object GetStationEntrustOutBill(int HInterID)
+        {
+            try
+            {
+                ds = oCN.RunProcReturn("select * from h_v_GetStationOutBill where HInterID = " + HInterID, "h_v_GetStationOutBill");
+                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 e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "Exception锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
 
         //
     }
diff --git a/WebAPI/Controllers/CJGL/Cj_StationInBillController.cs b/WebAPI/Controllers/CJGL/Cj_StationInBillController.cs
index f034796..cc78bce 100644
--- a/WebAPI/Controllers/CJGL/Cj_StationInBillController.cs
+++ b/WebAPI/Controllers/CJGL/Cj_StationInBillController.cs
@@ -21,124 +21,11 @@
         DataSet ds1;
 
 
-        /// <summary>
-        /// test
-        ///鍙傛暟锛歴tring sql銆�
-        ///杩斿洖鍊硷細object銆�
-        /// </summary>
-        [Route("Cj_StationInBill/AddBill")]
-        [HttpPost]
-        public object AddBill([FromBody] JObject oMain)
-        {
-            var _value = oMain["oMain"].ToString();
-            string msg1 = _value.ToString();
-            try
-            {
-                //濮斿宸ュ簭鍙戝嚭鍙嶅簭鍒楀寲
-                msg1 = "[" + msg1.ToString() + "]";
-                List<StationBill> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<StationBill>>(msg1);
-                string BillType = "3790";
-                long HInterID = list[0].HInterID;//閫掑叆type寰楀埌鐨勫崟鎹甀D
-                string HBillNo = list[0].HBillNo;//閫掑叆type寰楀埌鐨勫崟鎹彿
-                int HBillStatus = 0;
-                string HMaker = list[0].HMaker;//鍒跺崟浜�
-                int HYear = 2021;
-                double HPeriod = 1;
-                string HRemark = list[0].HRemark;//澶囨敞
-                long HICMOInterID = list[0].HICMOInterID;//浠诲姟鍗旾D
-                string HICMOBillNo = list[0].HICMOBillNo;//浠诲姟鍗�
-                int HProcPlanInterID = 0;
-                int HProcPlanEntryID = 0;
-                string HProcPlanBillNo = "";
-                int HProcExchInterID = 0;
-                int HProcExchEntryID = 0;
-                string HProcExchBillNo = list[0].HProcExchBillNo;//娴佽浆鍗�
-                long HMaterID = list[0].HMaterID;//浜у搧ID
-                long HProcID = list[0].HProcID;//褰撳墠宸ュ簭
-                double HICMOQty = list[0].HICMOQty;//浠诲姟鍗曟暟閲�
-                double HPlanQty = list[0].HPlanQty;//娴佽浆鍗℃暟閲�
-                long HSourceID = list[0].HSourceID;//鐢熶骇璧勬簮ID
-                long HGroupID = list[0].HGroupID;//鐝粍ID
-                long HDeptID = 0;
-                long HEmpID = list[0].HEmpID;//鎺ユ敹浜篒D
-                string HBarCode = list[0].HBarCode;//鏉″舰鐮�
-                string HAddr = "";
-                string HBarCodeMaker = "";
-                long HSupID = 0;
-                double HQty = list[0].HQty;//鎺ユ敹鏁伴噺
-                double HPrice = 0;
-                double HMoney = 0;
-                double HPieceQty = list[0].HPieceQty;//鎺ユ敹浠舵暟
-                string HSourceName = list[0].HSourceName;//鐢熶骇璧勬簮鍚嶇О
-                long HCenterID = list[0].HCenterID;//宸ヤ綔涓績ID
-                long HProcNo = list[0].HProcNo;//娴佹按鍙�
-                string HOrderProcNO = list[0].HOrderProcNO;//璁㈠崟璺熻釜鍙�
-
-                ListModels oListModels = new ListModels();
-
-                DAL.ClsSc_StationInBill BillNew = new DAL.ClsSc_StationInBill();
-
-                BillNew.omodel.HInterID = HInterID;
-                BillNew.omodel.HYear = 2011;
-                BillNew.omodel.HPeriod = 1;
-                BillNew.omodel.HBillNo = HBillNo;
-                BillNew.omodel.HICMOBillNo = HICMOBillNo;
-                BillNew.omodel.HICMOInterID = HICMOInterID;
-                BillNew.omodel.HProcExchInterID = HProcExchInterID;
-                BillNew.omodel.HProcExchEntryID = HProcExchEntryID;
-                BillNew.omodel.HProcExchBillNo = HProcExchBillNo;
-                BillNew.omodel.HProcID = HProcID;
-                BillNew.omodel.HMaterID = HMaterID;
-                BillNew.omodel.HStationInTime = DateTime.Now;
-                BillNew.omodel.HEmpID = HEmpID;
-                BillNew.omodel.HSourceID = HSourceID;
-                BillNew.omodel.HGroupID = HGroupID;
-                BillNew.omodel.HICMOQty = HICMOQty;
-                BillNew.omodel.HPlanQty = HPlanQty;
-                BillNew.omodel.HQty = HQty;
-                BillNew.omodel.HPieceQty = HPieceQty;
-                BillNew.omodel.HSourceName = HSourceName;
-                BillNew.omodel.HCenterID = HCenterID;
-
-                BillNew.omodel.HProcNo = HProcNo;
-                BillNew.omodel.HOrderProcNO = HOrderProcNO;
-                bool bResult = BillNew.AddBill(ref ClsPub.sExeReturnInfo);
-
-                //鎻愮ず
-                if (bResult == true)
-                {
-                    objJsonResult.code = "1";
-                    objJsonResult.count = 1;
-                    objJsonResult.Message = "鍗曟嵁瀛樼洏瀹屾瘯!鍗曟嵁鍙�:" + HBillNo.Trim() + ClsPub.sExeReturnInfo;
-                    objJsonResult.data = ds.Tables[0];
-                    return objJsonResult;
-                }
-                else
-                {
-                    objJsonResult.code = "0";
-                    objJsonResult.count = 0;
-                    objJsonResult.Message = "淇濆瓨澶辫触!鍘熷洜:" + ClsPub.sExeReturnInfo;
-                    objJsonResult.data = null;
-                    return objJsonResult;
-                }
-            }
-            catch (Exception e)
-            {
-                oCN.RollBack();
-                objJsonResult.code = "0";
-                objJsonResult.count = 0;
-                objJsonResult.Message = "Exception锛�" + e.ToString();
-                objJsonResult.data = null;
-                return objJsonResult;
-            }
-        }
-
-
-        /// <summary>
-        /// 鏂板鍗曟嵁-淇濆瓨鎸夐挳
-        ///鍙傛暟锛歴tring sql銆�
-        ///杩斿洖鍊硷細object銆�
-        /// </summary>
+        ///// <summary>
+        ///// test
+        /////鍙傛暟锛歴tring sql銆�
+        /////杩斿洖鍊硷細object銆�
+        ///// </summary>
         //[Route("Cj_StationInBill/AddBill")]
         //[HttpPost]
         //public object AddBill([FromBody] JObject oMain)
@@ -156,7 +43,7 @@
         //        int HBillStatus = 0;
         //        string HMaker = list[0].HMaker;//鍒跺崟浜�
         //        int HYear = 2021;
-        //        double HPeriod = 1;
+        //        long HPeriod = 1;
         //        string HRemark = list[0].HRemark;//澶囨敞
         //        long HICMOInterID = list[0].HICMOInterID;//浠诲姟鍗旾D
         //        string HICMOBillNo = list[0].HICMOBillNo;//浠诲姟鍗�
@@ -184,79 +71,72 @@
         //        double HPieceQty = list[0].HPieceQty;//鎺ユ敹浠舵暟
         //        string HSourceName = list[0].HSourceName;//鐢熶骇璧勬簮鍚嶇О
         //        long HCenterID = list[0].HCenterID;//宸ヤ綔涓績ID
-        //        string HProcNo = list[0].HProcNo;//娴佹按鍙�
+        //        long HProcNo = list[0].HProcNo;//娴佹按鍙�
         //        string HOrderProcNO = list[0].HOrderProcNO;//璁㈠崟璺熻釜鍙�
-        //        //鑻AINDI閲嶅鍒欓噸鏂拌幏鍙�
-        //        oCN.BeginTran();
-        //        //涓昏〃
-        //        oCN.RunProc("Insert Into Sc_StationInBillMain " +
-        //        "(HBillType,HBillSubType,HInterID,HBillNo,HBillStatus,HDate,HMaker,HMakeDate" +
-        //        ",HYear,HPeriod,HRemark" +
-        //        ",HICMOInterID,HICMOBillNo,HProcPlanInterID,HProcPlanEntryID,HProcPlanBillNo,HProcExchInterID,HProcExchEntryID" +
-        //        ",HProcExchBillNo,HMaterID,HProcID,HICMOQty,HPlanQty,HStationInTime,HSourceID" +
-        //        ",HGroupID,HDeptID,HEmpID,HBarCode,HAddr,HBarCodeMaker,HBarCodeMakeDate" +
-        //        ",HSupID,HQty,HPrice,HMoney,HPieceQty,HSourceName,HCenterID" +
-        //        ",HProcNo,HOrderProcNO" +
-        //        ") " +
-        //        " values('" + BillType + "','" + BillType + "'," + HInterID + ",'" + HBillNo + "'," + HBillStatus + ",getdate(),'" + HMaker + "',getdate()" +
-        //        "," + HYear + "," + HPeriod + ",'" + HRemark + "'" +
-        //        "," + HICMOInterID + ",'" + HICMOBillNo + "'," + HProcPlanInterID + "," + HProcPlanEntryID + ",'" + HProcPlanBillNo + "'," + HProcExchInterID + "," + HProcExchEntryID +
-        //        ",'" + HProcExchBillNo + "'," + HMaterID + "," + HProcID + "," + HICMOQty + "," + HPlanQty + ",getdate()," + HSourceID +
-        //        "," + HGroupID + "," + HDeptID + "," + HEmpID + ",'" + HBarCode + "','" + HAddr + "','" + HBarCodeMaker + "',getdate()" +
-        //        "," + HSupID + "," + HQty + "," + HPrice + "," + HMoney + "," + HPieceQty + ",'" + HSourceName + "'," + HCenterID +
-        //        ",'" + HProcNo + "','" + HOrderProcNO + "'" +
-        //      ") ");
-        //        ds = oCN.RunProcReturn("exec h_p_MES_StationInBill_QtyCtrl " + HInterID + "", "h_p_MES_StationInBill_QtyCtrl");
-        //        if (ds == null)
-        //        {
-        //            oCN.RollBack();
-        //            objJsonResult.code = "0";
-        //            objJsonResult.count = 0;
-        //            objJsonResult.Message = "鍒ゆ柇鏁伴噺澶辫触锛�";
-        //            objJsonResult.data = null;
-        //            return objJsonResult;
-        //        }
-        //        if (ds.Tables[0].Rows.Count == 0)
-        //        {
-        //            oCN.RollBack();
-        //            objJsonResult.code = "0";
-        //            objJsonResult.count = 0;
-        //            objJsonResult.Message = "鍒ゆ柇鏁伴噺澶辫触锛�";
-        //            objJsonResult.data = null;
-        //            return objJsonResult;
-        //        }
-        //        if (ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) == "2")
-        //        {
-        //            oCN.RollBack();
-        //            objJsonResult.code = "0";
-        //            objJsonResult.count = 0;
-        //            objJsonResult.Message = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
-        //            objJsonResult.data = null;
-        //            return objJsonResult;
-        //        }
-        //        oCN.RunProc("exec h_p_Mes_ProcessExchangeRelationQty_In " + HInterID + ",1");
-        //        //鍒ゆ柇鏄惁鏄� 棣栭亾宸ュ簭
-        //        ds1 = oCN.RunProcReturn(" select HLastProc,HFstProc from Sc_ProcessExchangeBillMain a  " +
-        //                            " inner join Sc_ProcessExchangeBillSub b on a.HInterID=b.HInterID  " +
-        //                            " Where a.HInterID=" + HProcExchInterID + " and b.HEntryID=" + HProcExchEntryID + " ", "Sc_ProcessExchangeBillMain");
-        //        if (ds1 == null || ds1.Tables[0].Rows.Count == 0)
-        //        {
-                    
-        //        }
-        //        else if (ClsPub.isStrNull(ds1.Tables[0].Rows[0]["HFstProc"]) == "鏄�")
-        //        { 
 
+        //        ListModels oListModels = new ListModels();
+
+        //        DAL.ClsSc_StationInBill BillNew = new DAL.ClsSc_StationInBill();
+
+        //        BillNew.omodel.HInterID = HInterID;
+        //        BillNew.omodel.HYear = HYear;
+        //        BillNew.omodel.HPeriod = HPeriod;
+        //        BillNew.omodel.HBillNo = HBillNo;
+        //        BillNew.omodel.HICMOBillNo = HICMOBillNo;
+        //        BillNew.omodel.HICMOInterID = HICMOInterID;
+        //        BillNew.omodel.HProcExchInterID = HProcExchInterID;
+        //        BillNew.omodel.HProcExchEntryID = HProcExchEntryID;
+        //        BillNew.omodel.HProcExchBillNo = HProcExchBillNo;
+        //        BillNew.omodel.HProcID = HProcID;
+        //        BillNew.omodel.HMaterID = HMaterID;
+        //        BillNew.omodel.HStationInTime = DateTime.Now;
+        //        BillNew.omodel.HEmpID = HEmpID;
+        //        BillNew.omodel.HSourceID = HSourceID;
+        //        BillNew.omodel.HGroupID = HGroupID;
+        //        BillNew.omodel.HICMOQty = HICMOQty;
+        //        BillNew.omodel.HPlanQty = HPlanQty;
+        //        BillNew.omodel.HQty = HQty;
+        //        BillNew.omodel.HPieceQty = HPieceQty;
+        //        BillNew.omodel.HSourceName = HSourceName;
+        //        BillNew.omodel.HCenterID = HCenterID;
+        //        BillNew.omodel.HBillStatus = HBillStatus;
+        //        BillNew.omodel.HMaker = HMaker;
+        //        BillNew.omodel.HRemark = HRemark;
+        //        BillNew.omodel.HProcPlanInterID = HProcPlanInterID;
+        //        BillNew.omodel.HProcPlanEntryID = HProcPlanEntryID;
+        //        BillNew.omodel.HProcPlanBillNo = HProcPlanBillNo;
+        //        BillNew.omodel.HDeptID = HDeptID;
+        //        BillNew.omodel.HBarCode = HBarCode;
+        //        BillNew.omodel.HAddr = HAddr;
+        //        BillNew.omodel.HBarCodeMaker = HBarCodeMaker;
+        //        BillNew.omodel.HSupID = HSupID;
+        //        BillNew.omodel.HPrice = HPrice;
+        //        BillNew.omodel.HMoney = HMoney;
+
+        //        BillNew.omodel.HProcNo = HProcNo;
+        //        BillNew.omodel.HOrderProcNO = HOrderProcNO;
+        //        bool bResult = BillNew.AddBill(ref ClsPub.sExeReturnInfo);
+
+        //        //鎻愮ず
+        //        if (bResult == true)
+        //        {
+        //            objJsonResult.code = "1";
+        //            objJsonResult.count = 1;
+        //            objJsonResult.Message = "鍗曟嵁瀛樼洏瀹屾瘯!鍗曟嵁鍙�:" + HBillNo.Trim();
+        //            objJsonResult.data = null;
+        //            return objJsonResult;
         //        }
-        //        oCN.Commit();
-        //        objJsonResult.code = "1";
-        //        objJsonResult.count = 1;
-        //        objJsonResult.Message = "鏂板鍗曟嵁鎴愬姛锛�";
-        //        objJsonResult.data = ds.Tables[0];
-        //        return objJsonResult;
+        //        else
+        //        {
+        //            objJsonResult.code = "0";
+        //            objJsonResult.count = 0;
+        //            objJsonResult.Message = "淇濆瓨澶辫触!鍘熷洜:" + ClsPub.sExeReturnInfo;
+        //            objJsonResult.data = null;
+        //            return objJsonResult;
+        //        }
         //    }
         //    catch (Exception e)
         //    {
-        //        oCN.RollBack();
         //        objJsonResult.code = "0";
         //        objJsonResult.count = 0;
         //        objJsonResult.Message = "Exception锛�" + e.ToString();
@@ -264,6 +144,293 @@
         //        return objJsonResult;
         //    }
         //}
+
+
+        /// <summary>
+        /// 鏂板鍗曟嵁-淇濆瓨鎸夐挳
+        ///鍙傛暟锛歴tring sql銆�
+        ///杩斿洖鍊硷細object銆�
+        /// </summary>
+        [Route("Cj_StationInBill/AddBill")]
+        [HttpPost]
+        public object AddBill([FromBody] JObject oMain)
+        {
+            var _value = oMain["oMain"].ToString();
+            string msg1 = _value.ToString();
+            try
+            {
+                //濮斿宸ュ簭鍙戝嚭鍙嶅簭鍒楀寲
+                msg1 = "[" + msg1.ToString() + "]";
+                List<StationBill> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<StationBill>>(msg1);
+                string eventType = list[0].eventType;
+                string BillType = "3790";
+                long HInterID = list[0].HInterID;//閫掑叆type寰楀埌鐨勫崟鎹甀D
+                string HBillNo = list[0].HBillNo;//閫掑叆type寰楀埌鐨勫崟鎹彿
+                int HBillStatus = 0;
+                string HMaker = list[0].HMaker;//鍒跺崟浜�
+                int HYear = 2021;
+                double HPeriod = 1;
+                string HRemark = list[0].HRemark;//澶囨敞
+                long HICMOInterID = list[0].HICMOInterID;//浠诲姟鍗旾D
+                string HICMOBillNo = list[0].HICMOBillNo;//浠诲姟鍗�
+                long HProcPlanInterID = 0;
+                long HProcPlanEntryID = 0;
+                string HProcPlanBillNo = "";
+                long HProcExchInterID = list[0].lngBillKey;//娴佽浆鍗′富鍐呯爜
+                long HProcExchEntryID = list[0].lngBillSubKey;//娴佽浆鍗″瓙鍐呯爜
+                string HProcExchBillNo = list[0].HProcExchBillNo;//娴佽浆鍗�
+                long HMaterID = list[0].HMaterID;//浜у搧ID
+                long HProcID = list[0].HProcID;//褰撳墠宸ュ簭
+                double HICMOQty = list[0].HICMOQty;//浠诲姟鍗曟暟閲�
+                double HPlanQty = list[0].HPlanQty;//娴佽浆鍗℃暟閲�
+                long HSourceID = list[0].HSourceID;//鐢熶骇璧勬簮ID
+                long HGroupID = list[0].HGroupID;//鐝粍ID
+                long HDeptID = 0;
+                long HEmpID = list[0].HEmpID;//鎺ユ敹浜篒D
+                string HBarCode = list[0].HBarCode;//鏉″舰鐮�
+                string HAddr = "";
+                string HBarCodeMaker = "";
+                long HSupID = 0;
+                double HQty = list[0].HQty;//鎺ユ敹鏁伴噺
+                double HPrice = 0;
+                double HMoney = 0;
+                double HPieceQty = list[0].HPieceQty;//鎺ユ敹浠舵暟
+                string HSourceName = list[0].HSourceName;//鐢熶骇璧勬簮鍚嶇О
+                long HCenterID = list[0].HCenterID;//宸ヤ綔涓績ID
+                long HProcNo = list[0].HProcNo;//娴佹按鍙�
+                string HOrderProcNO = list[0].HOrderProcNO;//璁㈠崟璺熻釜鍙�
+                //鍗曟嵁瀹屾暣鎬у垽鏂�
+                if (HProcExchInterID <= 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "閿欒鐨勬祦杞崱鍐呯爜锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                if (HProcExchEntryID <= 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "閿欒鐨勬祦杞崱瀛愬唴鐮侊紒";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                if (HProcNo <= 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "娴佹按鍙锋病鏈夐�夋嫨锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                if (HProcExchBillNo == "")
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "娴佽浆鍗″彿娌℃湁閫夋嫨锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                if (HMaterID <= 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "浜у搧娌℃湁閫夋嫨锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                if (HSourceID <= 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "宸ヤ綔涓績娌℃湁閫夋嫨锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                if (HProcID <= 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "褰撳墠宸ュ簭娌℃湁閫夋嫨锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                if (HQty <= 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鎺ユ敹涓暟涓嶈兘涓�0锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                ds = oCN.RunProcReturn("select HInterID from Sc_ProcessExchangeBillSub Where hinterid=" + HProcExchInterID + " and hprocno<" + HProcNo + " order by hprocno", "Sc_ProcessExchangeBillSub");
+                if (ds == null)
+                {
+                    oCN.RollBack();
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鍒ゆ柇棣栭亾宸ュ簭澶辫触锛屼笉鍏佽淇濆瓨锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
+
+                //鑻AINDI閲嶅鍒欓噸鏂拌幏鍙�
+                oCN.BeginTran();
+
+                if ("Add".Equals(eventType))
+                {
+                    if (!AllowbillNo(HBillNo))
+                    {
+                        oCN.RollBack();
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "鍗曟嵁鍙烽噸澶嶏紒";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                    //鎻掑叆涓昏〃
+                    oCN.RunProc("Insert Into Sc_StationInBillMain " +
+                    "(HBillType,HBillSubType,HInterID,HBillNo,HBillStatus,HDate,HMaker,HMakeDate" +
+                    ",HYear,HPeriod,HRemark" +
+                    ",HICMOInterID,HICMOBillNo,HProcPlanInterID,HProcPlanEntryID,HProcPlanBillNo,HProcExchInterID,HProcExchEntryID" +
+                    ",HProcExchBillNo,HMaterID,HProcID,HICMOQty,HPlanQty,HStationInTime,HSourceID" +
+                    ",HGroupID,HDeptID,HEmpID,HBarCode,HAddr,HBarCodeMaker,HBarCodeMakeDate" +
+                    ",HSupID,HQty,HPrice,HMoney,HPieceQty,HSourceName,HCenterID" +
+                    ",HProcNo,HOrderProcNO" +
+                    ") " +
+                    " values('" + BillType + "','" + BillType + "'," + HInterID + ",'" + HBillNo + "'," + HBillStatus + ",getdate(),'" + HMaker + "',getdate()" +
+                    "," + HYear + "," + HPeriod + ",'" + HRemark + "'" +
+                    "," + HICMOInterID + ",'" + HICMOBillNo + "'," + HProcPlanInterID + "," + HProcPlanEntryID + ",'" + HProcPlanBillNo + "'," + HProcExchInterID + "," + HProcExchEntryID +
+                    ",'" + HProcExchBillNo + "'," + HMaterID + "," + HProcID + "," + HICMOQty + "," + HPlanQty + ",getdate()," + HSourceID +
+                    "," + HGroupID + "," + HDeptID + "," + HEmpID + ",'" + HBarCode + "','" + HAddr + "','" + HBarCodeMaker + "',getdate()" +
+                    "," + HSupID + "," + HQty + "," + HPrice + "," + HMoney + "," + HPieceQty + ",'" + HSourceName + "'," + HCenterID +
+                    ",'" + HProcNo + "','" + HOrderProcNO + "'" +
+                    ") ");
+                }
+                else if ("Modify".Equals(eventType))
+                {
+                    oCN.RunProc("exec h_p_Mes_ProcessExchangeRelationQty_In " + HProcExchInterID + ",-1");
+                    //鏇存柊涓昏〃
+                    oCN.RunProc("UpDate Sc_StationInBillMain set  " +
+                    " HBillNo='" + HBillNo + "'" +  
+                    ",HYear='" + HYear + "'" +
+                    ",HPeriod='" + HPeriod + "'" +
+                    ",HBillStatus='" + HBillStatus + "'" +
+                    ",HRemark='" + HRemark + "'" +
+                    ",HUpDater='" + HMaker + "'" +
+                    ",HUpDateDate=getdate()" +
+                    ",HSupID=" + HSupID +
+                    ",HQty=" + HQty +
+                    ",HPieceQty=" + HPieceQty +
+                    ",HSourceName='" + HSourceName + "'" +
+                    ",HICMOInterID=" + HICMOInterID +
+                    ",HICMOBillNo='" + HICMOBillNo + "'" +
+                    ",HProcPlanInterID=" + HProcPlanInterID +
+                    ",HProcPlanEntryID=" + HProcPlanEntryID +
+                    ",HProcPlanBillNo='" + HProcPlanBillNo + "'" +
+                    ",HProcExchInterID=" + HProcExchInterID +
+                    ",HProcExchEntryID=" + HProcExchEntryID +
+                    ",HProcExchBillNo='" + HProcExchBillNo + "'" +
+                    ",HMaterID=" + HMaterID +
+                    ",HProcID=" + HProcID +
+                    ",HICMOQty=" + HICMOQty +
+                    ",HPlanQty=" + HPlanQty +
+                    ",HStationInTime=getdate()" +
+                    ",HSourceID=" + HSourceID +
+                    ",HGroupID=" + HGroupID +
+                    ",HDeptID=" + HDeptID +
+                    ",HEmpID=" + HEmpID +
+                    ",HBarCode='" + HBarCode + "'" +
+                    ",HSaveBillFlag=0 " +
+                    ",HAddr='" + HAddr + "'" +
+                    ",HBarCodeMaker='" + HBarCodeMaker + "'" +
+                    ",HProcNo='" + HProcNo + "'" +
+                    ",HOrderProcNO='" + HOrderProcNO + "'" +
+                    " where HInterID=" + HInterID);
+                }
+                else
+                {
+                    oCN.RollBack();
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鎿嶄綔绫诲瀷鏃犳晥锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                
+
+
+                
+
+                ds = oCN.RunProcReturn("exec h_p_MES_StationInBill_QtyCtrl " + HInterID + "", "h_p_MES_StationInBill_QtyCtrl");
+                if (ds == null)
+                {
+                    oCN.RollBack();
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鍒ゆ柇鏁伴噺澶辫触锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                if (ds.Tables[0].Rows.Count == 0)
+                {
+                    oCN.RollBack();
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鍒ゆ柇鏁伴噺澶辫触锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                if (ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) == "2")
+                {
+                    oCN.RollBack();
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                oCN.RunProc("exec h_p_Mes_ProcessExchangeRelationQty_In " + HInterID + ",1");
+                //鍒ゆ柇鏄惁鏄� 棣栭亾宸ュ簭
+                ds1 = oCN.RunProcReturn(" select HLastProc,HFstProc from Sc_ProcessExchangeBillMain a  " +
+                                    " inner join Sc_ProcessExchangeBillSub b on a.HInterID=b.HInterID  " +
+                                    " Where a.HInterID=" + HProcExchInterID + " and b.HEntryID=" + HProcExchEntryID + " ", "Sc_ProcessExchangeBillMain");
+                if (ds1 == null || ds1.Tables[0].Rows.Count == 0)
+                {
+
+                }
+                else if (ClsPub.isStrNull(ds1.Tables[0].Rows[0]["HFstProc"]) == "鏄�")
+                {
+
+                }
+                oCN.Commit();
+                objJsonResult.code = "1";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "鏂板鍗曟嵁鎴愬姛锛�";
+                objJsonResult.data = ds.Tables[0];
+                return objJsonResult;
+            }
+            catch (Exception e)
+            {
+                oCN.RollBack();
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "Exception锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        private bool AllowbillNo(string HBillNo)
+        {
+            ds = oCN.RunProcReturn("select HBillNo from Sc_StationInBillMain where  HBillNo = '" + HBillNo + "'", "Sc_StationInBillMain");
+            if (ds == null || ds.Tables[0].Rows.Count == 0)
+            {
+                return true;
+            }
+            return false;
+        }
 
         /// <summary>
         /// 宸ュ簭杩涚珯鎺ユ敹鍗曟祦姘村彿鍥炶溅鑾峰彇宸ュ簭淇℃伅
@@ -361,6 +528,47 @@
             }
         }
 
+        /// <summary>
+        /// 缂栬緫椤甸潰鏍规嵁id鑾峰彇宸ュ簭杩涚珯鎺ユ敹鍗曚俊鎭�
+        ///鍙傛暟锛歴tring sql銆�
+        ///杩斿洖鍊硷細object銆�
+        /// </summary>
+        [Route("Cj_StationInBill/GetStationInBill")]
+        [HttpGet]
+        public object GetStationOutBill(int HInterID)
+        {
+            try
+            {
+                ds = oCN.RunProcReturn("select * from h_v_GetStationInBill where HInterID = " + HInterID, "h_v_GetStationInBill");
+                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 e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "Exception锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+
+
+
 
         //
     }
diff --git a/WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs b/WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs
index 0f15e3f..024517d 100644
--- a/WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs
+++ b/WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs
@@ -21,7 +21,6 @@
         DataSet ds1;
 
 
-
         /// <summary>
         /// 鏂板鍗曟嵁-淇濆瓨鎸夐挳
         ///鍙傛暟锛歴tring sql銆�
@@ -38,7 +37,7 @@
                 //鍙嶅簭鍒楀寲
                 msg1 = "[" + msg1.ToString() + "]";
                 List<StationBill> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<StationBill>>(msg1);
-
+                string eventType = list[0].eventType;
                 string BillType = "3791";
                 string HBillSubType = "3791";
                 long HInterID = list[0].HInterID;//閫掑叆type寰楀埌鐨勫崟鎹甀D
@@ -101,29 +100,219 @@
                 double HPriceRate = list[0].HPriceRate;//绯绘暟
                 double HWorkTimes = list[0].HWorkTimes;//宸ユ椂
                 long HQCCheckID = list[0].HQCCheckID;//妫�楠屽憳ID
+                //鍗曟嵁瀹屾暣鎬у垽鏂�
+                if (HProcExchInterID <= 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "娴佽浆鍗℃病鏈夐�夋嫨锛佽鎵弿鏉″舰鐮佹垨杈撳叆鏉″舰鐮佸悗鍥炶溅";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                if (HProcExchEntryID <= 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "娴佹按鍙锋病鏈夐�夋嫨锛佽杈撳叆娴佹按鍙峰悗鍥炶溅";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                if (HProcNo <= 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "娴佹按鍙锋病鏈夐�夋嫨锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                if (HProcExchBillNo == "")
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "娴佽浆鍗″彿娌℃湁閫夋嫨锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                if (HMaterID == 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "浜у搧娌℃湁閫夋嫨锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                if (HGroupID == 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鐢熶骇鐝粍娌℃湁閫夋嫨锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
 
+                if (HProcID == 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "褰撳墠宸ュ簭娌℃湁閫夋嫨锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                if (HEmpID == 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鎿嶄綔鍛樻病鏈夐�夋嫨锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                if (HQCCheckID == 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "妫�楠屽憳娌℃湁閫夋嫨锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                if (HSourceID == 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鐢熶骇璧勬簮娌℃湁閫夋嫨锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                if (HCenterID == 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "宸ヤ綔涓績娌℃湁閫夋嫨锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                if (HQty + HWasterQty <= 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鍚堟牸鏁伴噺鍔犳姤搴熸暟閲忎笉鑳戒负0锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                if (HWorkTimes <= 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "宸ユ椂蹇呴』澶т簬0锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                //if (HEmpID2 == 0 )
+                //{
+                //    objJsonResult.code = "0";
+                //    objJsonResult.count = 0;
+                //    objJsonResult.Message = "鎿嶄綔鍛�2娌℃湁閫夋嫨锛�";
+                //    objJsonResult.data = null;
+                //    return objJsonResult;
+                //}
+                //if (HEmpID3 == 0 )
+                //{
+                //    objJsonResult.code = "0";
+                //    objJsonResult.count = 0;
+                //    objJsonResult.Message = "鎿嶄綔鍛�3娌℃湁閫夋嫨锛�";
+                //    objJsonResult.data = null;
+                //    return objJsonResult;
+                //}
+                //if (HEmpID4 == 0 )
+                //{
+                //    objJsonResult.code = "0";
+                //    objJsonResult.count = 0;
+                //    objJsonResult.Message = "鎿嶄綔鍛�4娌℃湁閫夋嫨锛�";
+                //    objJsonResult.data = null;
+                //    return objJsonResult;
+                //}
+                //if (HEmpID5 == 0 )
+                //{
+                //    objJsonResult.code = "0";
+                //    objJsonResult.count = 0;
+                //    objJsonResult.Message = "鎿嶄綔鍛�5娌℃湁閫夋嫨锛�";
+                //    objJsonResult.data = null;
+                //    return objJsonResult;
+                //}
                 //鑻AINDI閲嶅鍒欓噸鏂拌幏鍙�
                 oCN.BeginTran();
+                if ("Add".Equals(eventType))
+                {
+                    if (!AllowbillNo(HBillNo))
+                    {
+                        oCN.RollBack();
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "鍗曟嵁鍙烽噸澶嶏紒";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                    oCN.RunProc("Insert Into Sc_StationOutBillMain " +
+                    "(HBillType,HBillSubType,HInterID,HBillNo,HBillStatus,HDate,HMaker,HMakeDate,HMouldNum" +
+                    ",HYear,HPeriod,HRemark,HSourceName,HPieceQty,HWasterQty,HPlanPieceQty,HBadPNL" +
+                    ",HICMOInterID,HICMOBillNo,HProcPlanInterID,HProcPlanEntryID,HProcPlanBillNo,HProcExchInterID,HProcExchEntryID" +
+                    ",HProcExchBillNo,HMaterID,HProcID,HICMOQty,HPlanQty,HStationOutTime,HSourceID,HPayProcID" +
+                    ",HGroupID,HDeptID,HEmpID,HBarCode,HAddr,HBarCodeMaker,HBarCodeMakeDate,HSourceID2,HSourceID3,HSourceID4,HSourceID5" +
+                    ",HSupID,HQty,HPrice,HMoney,HBadCount,HCenterID,HProcNo,HOrderProcNO,HSourceNameList" +
+                    ",HMainSourceInterID,HMainSourceBillNo,HMainSourceBillType,HLastSubProc" +
+                    ",HEmpID2,HEmpID3,HEmpID4,HEmpID5,HDSQty,HChongQty,HPriceRate,HWorkTimes,HQCCheckID" +
+                    ") " +
+                    " values('" + BillType + "','" + HBillSubType + "'," + HInterID + ",'" + HBillNo + "'," + HBillStatus + ",getdate(),'" + HMaker + "',getdate(),'" + HMouldNum + "'" +
+                    "," + HYear + "," + HPeriod + ",'" + HRemark + "','" + HSourceName + "'," + HPieceQty + "," + HWasterQty + "," + HPlanPieceQty + "," + HBadPNL +
+                    "," + HICMOInterID + ",'" + HICMOBillNo + "'," + HProcPlanInterID + "," + HProcPlanEntryID + ",'" + HProcPlanBillNo + "'," + HProcExchInterID + "," + HProcExchEntryID +
+                    ",'" + HProcExchBillNo + "'," + HMaterID + "," + HProcID + "," + HICMOQty + "," + HPlanQty + ",'" + HStationOutTime + "'," + HSourceID + "," + HPayProcID +
+                    "," + HGroupID + "," + HDeptID + "," + HEmpID + ",'" + HBarCode + "','" + HAddr + "','" + HBarCodeMaker + "',getdate()" + "," + HSourceID2 + "," + HSourceID3 + "," + HSourceID4 + "," + HSourceID5 +
+                    "," + HSupID + "," + HQty + "," + HPrice + "," + HMoney + "," + HBadCount + "," + HCenterID + "," + HProcNo + ",'" + HOrderProcNO + "'" + ",'" + HSourceNameList + "'" +
+                    "," + HMainSourceInterID + ",'" + HMainSourceBillNo + "','" + HMainSourceBillType + "'," + Convert.ToString(HLastSubProc ? 1 : 0) +
+                    "," + HEmpID2 + "," + HEmpID3 + "," + HEmpID4 + "," + HEmpID5 + "," + HDSQty + "," + HChongQty + "," + HPriceRate + "," + HWorkTimes + "," + HQCCheckID +
+                    ") ");
+                }
+                else if ("Modify".Equals(eventType))
+                {
+                    oCN.RunProc("UpDate Sc_StationOutBillMain set  " +
+                    "HUpDater='" + HMaker + "'" +
+                    ",HUpDateDate=getdate()" +
+                    ",HSourceName='" + HSourceName + "'" +
+                    ",HRemark='" + HRemark + "'" +
+                    ",HQCCheckID=" + HQCCheckID +
+                    ",HEmpID=" + HEmpID +
+                    ",HEmpID2=" + HEmpID2 +
+                    ",HEmpID3=" + HEmpID3 +
+                    ",HEmpID4=" + HEmpID4 +
+                    ",HEmpID5=" + HEmpID5 +
+                    ",HSourceID=" + HSourceID +
+                    ",HSourceID2=" + HSourceID2 +
+                    ",HSourceID3=" + HSourceID3 +
+                    ",HSourceID4=" + HSourceID4 +
+                    ",HSourceID5=" + HSourceID5 +
+                    ",HPayProcID=" + HPayProcID +
+                    ",HWorkTimes=" + HWorkTimes +
+                    ",HSaveBillFlag=0 " +
+                    ",HPieceQty=" + HPieceQty +
+                    ",HQty=" + HQty +
+                    ",HDSQty=" + HDSQty +
+                    ",HChongQty=" + HChongQty +
+                    ",HMouldNum='" + HMouldNum + "'" +
+                    ",HSourceNameList='" + HSourceNameList + "'" +
+                    ",HWasterQty=" + HWasterQty +
+                    ",HLastSubProc=" + Convert.ToString(HLastSubProc ? 1 : 0) +
+                    " where HInterID=" + HInterID);
+                }
+                else
+                {
+                    oCN.RollBack();
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鎿嶄綔绫诲瀷鏃犳晥锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
                 //涓昏〃
-                oCN.RunProc("Insert Into Sc_StationOutBillMain " +
-                "(HBillType,HBillSubType,HInterID,HBillNo,HBillStatus,HDate,HMaker,HMakeDate,HMouldNum" +
-                ",HYear,HPeriod,HRemark,HSourceName,HPieceQty,HWasterQty,HPlanPieceQty,HBadPNL" +
-                ",HICMOInterID,HICMOBillNo,HProcPlanInterID,HProcPlanEntryID,HProcPlanBillNo,HProcExchInterID,HProcExchEntryID" +
-                ",HProcExchBillNo,HMaterID,HProcID,HICMOQty,HPlanQty,HStationOutTime,HSourceID,HPayProcID" +
-                ",HGroupID,HDeptID,HEmpID,HBarCode,HAddr,HBarCodeMaker,HBarCodeMakeDate,HSourceID2,HSourceID3,HSourceID4,HSourceID5" +
-                ",HSupID,HQty,HPrice,HMoney,HBadCount,HCenterID,HProcNo,HOrderProcNO,HSourceNameList" +
-                ",HMainSourceInterID,HMainSourceBillNo,HMainSourceBillType,HLastSubProc" +
-                ",HEmpID2,HEmpID3,HEmpID4,HEmpID5,HDSQty,HChongQty,HPriceRate,HWorkTimes,HQCCheckID" +
-                ") " +
-                " values('" + BillType + "','" + HBillSubType + "'," + HInterID + ",'" + HBillNo + "'," + HBillStatus + ",getdate(),'" + HMaker + "',getdate(),'" + HMouldNum + "'" +
-                "," + HYear + "," + HPeriod + ",'" + HRemark + "','" + HSourceName + "'," + HPieceQty + "," + HWasterQty + "," + HPlanPieceQty + "," + HBadPNL +
-                "," + HICMOInterID + ",'" + HICMOBillNo + "'," + HProcPlanInterID + "," + HProcPlanEntryID + ",'" + HProcPlanBillNo + "'," + HProcExchInterID + "," + HProcExchEntryID +
-                ",'" + HProcExchBillNo + "'," + HMaterID + "," + HProcID + "," + HICMOQty + "," + HPlanQty + ",'" + HStationOutTime + "'," + HSourceID + "," + HPayProcID +
-                "," + HGroupID + "," + HDeptID + "," + HEmpID + ",'" + HBarCode + "','" + HAddr + "','" + HBarCodeMaker + "',getdate()" + "," + HSourceID2 + "," + HSourceID3 + "," + HSourceID4 + "," + HSourceID5 +
-                "," + HSupID + "," + HQty + "," + HPrice + "," + HMoney + "," + HBadCount + "," + HCenterID + "," + HProcNo + ",'" + HOrderProcNO + "'" + ",'" + HSourceNameList + "'" +
-                "," + HMainSourceInterID + ",'" + HMainSourceBillNo + "','" + HMainSourceBillType + "'," + Convert.ToString(HLastSubProc ? 1 : 0) +
-                "," + HEmpID2 + "," + HEmpID3 + "," + HEmpID4 + "," + HEmpID5 + "," + HDSQty + "," + HChongQty + "," + HPriceRate + "," + HWorkTimes + "," + HQCCheckID +
-                ") ");
+                
                 ds = oCN.RunProcReturn("exec h_p_MES_StationOutBill_QtyCtrl " + HInterID + "", "h_p_MES_StationOutBill_QtyCtrl");
                 if (ds == null)
                 {
@@ -176,7 +365,6 @@
             }
             catch (Exception e)
             {
-                oCN.RollBack();
                 objJsonResult.code = "0";
                 objJsonResult.count = 0;
                 objJsonResult.Message = "Exception锛�" + e.ToString();
@@ -185,6 +373,15 @@
             }
         }
 
+        private bool AllowbillNo(string HBillNo)
+        {
+            ds = oCN.RunProcReturn("select HBillNo from Sc_StationOutBillMain where  HBillNo = '" + HBillNo + "'", "Sc_StationOutBillMain");
+            if (ds == null || ds.Tables[0].Rows.Count == 0)
+            {
+                return true;
+            }
+            return false;
+        }
 
         /// <summary>
         /// 杩斿洖宸ュ簭鍑虹珯姹囨姤鍗曞垪琛�
@@ -234,6 +431,45 @@
             }
         }
 
+        /// <summary>
+        /// 缂栬緫椤甸潰鏍规嵁id鑾峰彇宸ュ簭鍑虹珯姹囨姤鍗曚俊鎭�
+        ///鍙傛暟锛歴tring sql銆�
+        ///杩斿洖鍊硷細object銆�
+        /// </summary>
+        [Route("Cj_StationOutBill/GetStationOutBill")]
+        [HttpGet]
+        public object GetStationOutBill(int HInterID)
+        {
+            try
+            {
+                ds = oCN.RunProcReturn("select * from h_v_GetStationOutBill where HInterID = " + HInterID, "h_v_GetStationOutBill");
+                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 e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "Exception锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+
 
         //
     }
diff --git a/WebAPI/Controllers/PZGL/QC_LastPieceCheckBillController.cs b/WebAPI/Controllers/PZGL/QC_LastPieceCheckBillController.cs
deleted file mode 100644
index 3e14f8b..0000000
--- a/WebAPI/Controllers/PZGL/QC_LastPieceCheckBillController.cs
+++ /dev/null
@@ -1,75 +0,0 @@
-锘縰sing Newtonsoft.Json.Linq;
-using Pub_Class;
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using System.Data;
-using System.Data.SqlClient;
-using System.Web.Http;
-using WebAPI.Models;
-
-namespace WebAPI.Controllers
-{
-    //鎴愬搧鍏ュ簱妫�楠屽崟Controller
-    public class QC_LastPieceCheckBillController : ApiController
-    {
-        public DBUtility.ClsPub.Enum_BillStatus BillStatus;
-
-        private json objJsonResult = new json();
-        SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
-        DataSet ds;
-
-
-        /// <summary>
-        /// 杩斿洖鎴愬搧鍏ュ簱妫�楠屽崟鍒楄〃
-        ///鍙傛暟锛歴tring sql銆�
-        ///杩斿洖鍊硷細object銆�
-        /// </summary>
-        [Route("QC_LastPieceCheckBill/List")]
-        [HttpGet]
-        public object List(string sWhere)
-        {
-            try
-            {
-                if (sWhere == null || sWhere.Equals(""))
-                {
-                    ds = oCN.RunProcReturn("Select * from h_v_QC_LastPieceCheckBillList Where 1=1 " + sWhere + " order by 鍗曟嵁鍙� desc,hsubid ", "h_v_QC_LastPieceCheckBillList");
-                }
-                else
-                {
-                    string sql1 = "select * from h_v_QC_LastPieceCheckBillList where 1 = 1 ";
-                    string sql = sql1 + sWhere;
-                    ds = oCN.RunProcReturn(sql, "h_v_QC_LastPieceCheckBillList");
-                }
-                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 e)
-            {
-                objJsonResult.code = "0";
-                objJsonResult.count = 0;
-                objJsonResult.Message = "Exception锛�" + e.ToString();
-                objJsonResult.data = null;
-                return objJsonResult;
-            }
-        }
-
-
-
-        //
-    }
-}
\ No newline at end of file
diff --git a/WebAPI/Models/StationBill.cs b/WebAPI/Models/StationBill.cs
index 0064bc6..ca50c72 100644
--- a/WebAPI/Models/StationBill.cs
+++ b/WebAPI/Models/StationBill.cs
@@ -68,7 +68,10 @@
         public double HPriceRate { get; set; }
         public double HWorkTimes { get; set; }
         public long HQCCheckID { get; set; }
+        public long HProcPlanInterID { get; set; }
+        public long HProcPlanEntryID { get; set; }
 
+        public string eventType { get; set; }
 
     }
 }
\ No newline at end of file
diff --git a/WebAPI/Properties/PublishProfiles/API.pubxml.user b/WebAPI/Properties/PublishProfiles/API.pubxml.user
index 3fa4e06..7e29204 100644
--- a/WebAPI/Properties/PublishProfiles/API.pubxml.user
+++ b/WebAPI/Properties/PublishProfiles/API.pubxml.user
@@ -12,7 +12,7 @@
   <ItemGroup>
     <File Include="apiapp.json">
       <publishTime>04/12/2021 11:33:15</publishTime>
-      <publishTime>05/21/2021 18:05:12</publishTime>
+      <publishTime>01/13/2021 21:47:30</publishTime>
     </File>
     <File Include="bin/Antlr3.Runtime.dll">
       <publishTime>02/22/2013 08:43:40</publishTime>
@@ -27,19 +27,19 @@
       <publishTime>05/07/2021 20:31:20</publishTime>
     </File>
     <File Include="bin/BLL.dll">
-      <publishTime>05/21/2021 18:05:12</publishTime>
+      <publishTime>01/13/2021 21:47:30</publishTime>
     </File>
     <File Include="bin/DAL.dll">
-      <publishTime>05/21/2021 18:05:12</publishTime>
+      <publishTime>01/13/2021 21:47:30</publishTime>
     </File>
     <File Include="bin/Dapper.dll">
       <publishTime>07/22/2016 14:52:40</publishTime>
     </File>
     <File Include="bin/DBUtility.dll">
-      <publishTime>05/21/2021 18:05:12</publishTime>
+      <publishTime>01/13/2021 21:47:30</publishTime>
     </File>
     <File Include="bin/Kingdee.BOS.WebApi.Client.dll">
-      <publishTime>05/21/2021 18:05:12</publishTime>
+      <publishTime>01/13/2021 21:47:30</publishTime>
     </File>
     <File Include="bin/Kingdee.BOS.WebApi.FormService.dll">
       <publishTime>09/20/2018 19:23:20</publishTime>
@@ -57,7 +57,7 @@
       <publishTime>07/25/2012 11:48:56</publishTime>
     </File>
     <File Include="bin/Model.dll">
-      <publishTime>05/21/2021 18:05:12</publishTime>
+      <publishTime>05/20/2021 17:29:58</publishTime>
     </File>
     <File Include="bin/Newtonsoft.Json.dll">
       <publishTime>08/03/2014 20:33:56</publishTime>
@@ -66,13 +66,13 @@
       <publishTime>01/04/2011 13:48:18</publishTime>
     </File>
     <File Include="bin/Pub_Class.dll">
-      <publishTime>05/21/2021 18:05:12</publishTime>
+      <publishTime>05/21/2020 10:51:50</publishTime>
     </File>
     <File Include="bin/Pub_Control.dll">
-      <publishTime>05/21/2021 18:05:12</publishTime>
+      <publishTime>01/13/2021 21:47:30</publishTime>
     </File>
     <File Include="bin/SQLHelper.dll">
-      <publishTime>05/21/2021 18:05:12</publishTime>
+      <publishTime>01/13/2021 21:47:30</publishTime>
     </File>
     <File Include="bin/Swashbuckle.Core.dll">
       <publishTime>02/15/2015 17:57:08</publishTime>
@@ -138,7 +138,7 @@
       <publishTime>11/28/2018 13:01:00</publishTime>
     </File>
     <File Include="bin/System.Web.Http.WebHost.dll">
-      <publishTime>05/21/2021 18:05:12</publishTime>
+      <publishTime>01/13/2021 21:47:30</publishTime>
     </File>
     <File Include="bin/System.Web.Mvc.dll">
       <publishTime>01/28/2015 04:02:18</publishTime>
@@ -171,10 +171,10 @@
       <publishTime>11/24/2014 11:18:48</publishTime>
     </File>
     <File Include="bin/WebAPI.dll">
-      <publishTime>05/23/2021 23:05:31</publishTime>
+      <publishTime>05/28/2021 17:10:46</publishTime>
     </File>
     <File Include="bin/WebAPI.pdb">
-      <publishTime>05/23/2021 23:05:31</publishTime>
+      <publishTime>05/28/2021 17:10:46</publishTime>
     </File>
     <File Include="bin/WebAPI.XmlSerializers.dll">
       <publishTime>02/04/2021 21:35:21</publishTime>
@@ -192,166 +192,166 @@
       <publishTime>03/26/2019 14:23:20</publishTime>
     </File>
     <File Include="Content/bootstrap.css">
-      <publishTime>05/21/2021 18:05:12</publishTime>
+      <publishTime>01/13/2021 21:47:30</publishTime>
     </File>
     <File Include="Content/bootstrap.min.css">
-      <publishTime>05/21/2021 18:05:12</publishTime>
+      <publishTime>01/13/2021 21:47:30</publishTime>
     </File>
     <File Include="Content/Site.css">
-      <publishTime>05/21/2021 18:05:12</publishTime>
+      <publishTime>01/13/2021 21:47:30</publishTime>
     </File>
     <File Include="DLL/BLL.dll">
-      <publishTime>05/21/2021 18:05:12</publishTime>
+      <publishTime>01/13/2021 21:47:30</publishTime>
     </File>
     <File Include="DLL/DAL.dll">
-      <publishTime>05/21/2021 18:05:12</publishTime>
+      <publishTime>01/13/2021 21:47:30</publishTime>
     </File>
     <File Include="DLL/DBUtility.dll">
-      <publishTime>05/21/2021 18:05:12</publishTime>
+      <publishTime>01/13/2021 21:47:30</publishTime>
     </File>
     <File Include="DLL/Kingdee.BOS.WebApi.Client.dll">
-      <publishTime>05/21/2021 18:05:12</publishTime>
+      <publishTime>01/13/2021 21:47:30</publishTime>
     </File>
     <File Include="DLL/Model.dll">
-      <publishTime>05/21/2021 18:05:12</publishTime>
+      <publishTime>05/20/2021 17:29:58</publishTime>
     </File>
     <File Include="DLL/Newtonsoft.Json.Net35.dll">
-      <publishTime>05/21/2021 18:05:12</publishTime>
+      <publishTime>01/13/2021 21:47:30</publishTime>
     </File>
     <File Include="DLL/Pub_Class.dll">
-      <publishTime>05/21/2021 18:05:12</publishTime>
+      <publishTime>05/21/2020 10:51:50</publishTime>
     </File>
     <File Include="DLL/Pub_Control.dll">
-      <publishTime>05/21/2021 18:05:12</publishTime>
+      <publishTime>01/13/2021 21:47:30</publishTime>
     </File>
     <File Include="DLL/SQLHelper.dll">
-      <publishTime>05/21/2021 18:05:12</publishTime>
+      <publishTime>01/13/2021 21:47:30</publishTime>
     </File>
     <File Include="fonts/glyphicons-halflings-regular.eot">
-      <publishTime>05/21/2021 18:05:12</publishTime>
+      <publishTime>01/13/2021 21:47:30</publishTime>
     </File>
     <File Include="fonts/glyphicons-halflings-regular.svg">
-      <publishTime>05/21/2021 18:05:12</publishTime>
+      <publishTime>01/13/2021 21:47:30</publishTime>
     </File>
     <File Include="fonts/glyphicons-halflings-regular.ttf">
-      <publishTime>05/21/2021 18:05:12</publishTime>
+      <publishTime>01/13/2021 21:47:30</publishTime>
     </File>
     <File Include="fonts/glyphicons-halflings-regular.woff">
-      <publishTime>05/21/2021 18:05:12</publishTime>
+      <publishTime>01/13/2021 21:47:30</publishTime>
     </File>
     <File Include="Global.asax">
-      <publishTime>05/21/2021 18:05:12</publishTime>
+      <publishTime>01/13/2021 21:47:30</publishTime>
     </File>
     <File Include="Index.html">
-      <publishTime>05/21/2021 18:05:12</publishTime>
+      <publishTime>01/13/2021 21:47:30</publishTime>
     </File>
     <File Include="Metadata/deploymentTemplates/apiappconfig.azureresource.json">
-      <publishTime>05/21/2021 18:05:12</publishTime>
+      <publishTime>01/13/2021 21:47:30</publishTime>
     </File>
     <File Include="packages.config">
-      <publishTime>05/21/2021 18:05:12</publishTime>
+      <publishTime>01/21/2021 13:19:40</publishTime>
     </File>
     <File Include="PrecompiledApp.config">
       <publishTime>05/07/2021 20:31:19</publishTime>
     </File>
     <File Include="Views/Scripts/bootstrap.js">
-      <publishTime>05/21/2021 18:05:12</publishTime>
+      <publishTime>01/13/2021 21:47:30</publishTime>
     </File>
     <File Include="Views/Scripts/bootstrap.min.js">
-      <publishTime>05/21/2021 18:05:12</publishTime>
+      <publishTime>01/13/2021 21:47:30</publishTime>
     </File>
     <File Include="Views/Scripts/jquery-1.10.2.js">
-      <publishTime>05/21/2021 18:05:12</publishTime>
+      <publishTime>01/13/2021 21:47:30</publishTime>
     </File>
     <File Include="Views/Scripts/jquery-1.10.2.min.js">
-      <publishTime>05/21/2021 18:05:12</publishTime>
+      <publishTime>01/13/2021 21:47:30</publishTime>
     </File>
     <File Include="Views/Scripts/jquery-1.10.2.min.map">
-      <publishTime>05/21/2021 18:05:12</publishTime>
+      <publishTime>01/13/2021 21:47:30</publishTime>
     </File>
     <File Include="Views/Scripts/jquery.validate.js">
-      <publishTime>05/21/2021 18:05:12</publishTime>
+      <publishTime>01/13/2021 21:47:30</publishTime>
     </File>
     <File Include="Views/Scripts/jquery.validate.min.js">
-      <publishTime>05/21/2021 18:05:12</publishTime>
+      <publishTime>01/13/2021 21:47:30</publishTime>
     </File>
     <File Include="Views/Scripts/jquery.validate.unobtrusive.js">
-      <publishTime>05/21/2021 18:05:12</publishTime>
+      <publishTime>01/13/2021 21:47:30</publishTime>
     </File>
     <File Include="Views/Scripts/jquery.validate.unobtrusive.min.js">
-      <publishTime>05/21/2021 18:05:12</publishTime>
+      <publishTime>01/13/2021 21:47:30</publishTime>
     </File>
     <File Include="Views/Scripts/modernizr-2.6.2.js">
-      <publishTime>05/21/2021 18:05:12</publishTime>
+      <publishTime>01/13/2021 21:47:30</publishTime>
     </File>
     <File Include="Views/Shared/Error.cshtml">
-      <publishTime>05/21/2021 18:05:12</publishTime>
+      <publishTime>01/13/2021 21:47:30</publishTime>
     </File>
     <File Include="Views/Shared/_Layout.cshtml">
-      <publishTime>05/21/2021 18:05:12</publishTime>
+      <publishTime>01/13/2021 21:47:30</publishTime>
     </File>
     <File Include="Views/web.config">
-      <publishTime>05/21/2021 18:05:12</publishTime>
+      <publishTime>01/13/2021 21:47:30</publishTime>
     </File>
     <File Include="Views/_ViewStart.cshtml">
-      <publishTime>05/21/2021 18:05:12</publishTime>
+      <publishTime>01/13/2021 21:47:30</publishTime>
     </File>
     <File Include="Web References/WebS/ClsCLD_Customer_Model.datasource">
-      <publishTime>05/21/2021 18:05:12</publishTime>
+      <publishTime>02/22/2021 09:25:20</publishTime>
     </File>
     <File Include="Web References/WebS/ClsCLD_Department_Model.datasource">
-      <publishTime>05/21/2021 18:05:12</publishTime>
+      <publishTime>02/22/2021 09:25:20</publishTime>
     </File>
     <File Include="Web References/WebS/ClsCLD_Employee_Model.datasource">
-      <publishTime>05/21/2021 18:05:12</publishTime>
+      <publishTime>02/22/2021 09:25:20</publishTime>
     </File>
     <File Include="Web References/WebS/ClsCLD_StockPlace_Model.datasource">
-      <publishTime>05/21/2021 18:05:12</publishTime>
+      <publishTime>02/22/2021 09:25:20</publishTime>
     </File>
     <File Include="Web References/WebS/ClsCLD_Supplier_Model.datasource">
-      <publishTime>05/21/2021 18:05:12</publishTime>
+      <publishTime>02/22/2021 09:25:20</publishTime>
     </File>
     <File Include="Web References/WebS/ClsCLD_Warehouse_Model.datasource">
-      <publishTime>05/21/2021 18:05:12</publishTime>
+      <publishTime>02/22/2021 09:25:20</publishTime>
     </File>
     <File Include="Web References/WebS/ClsGy_BadReason_Model.datasource">
-      <publishTime>05/21/2021 18:05:12</publishTime>
+      <publishTime>02/22/2021 09:25:20</publishTime>
     </File>
     <File Include="Web References/WebS/ClsGy_BarCodeBill_WMS_Model_View.datasource">
-      <publishTime>05/21/2021 18:05:12</publishTime>
+      <publishTime>02/22/2021 09:25:21</publishTime>
     </File>
     <File Include="Web References/WebS/ClsGy_Customer_Model.datasource">
-      <publishTime>05/21/2021 18:05:12</publishTime>
+      <publishTime>02/22/2021 09:25:20</publishTime>
     </File>
     <File Include="Web References/WebS/ClsGy_Department_Model.datasource">
-      <publishTime>05/21/2021 18:05:12</publishTime>
+      <publishTime>02/22/2021 09:25:20</publishTime>
     </File>
     <File Include="Web References/WebS/ClsGy_Employee_Model.datasource">
-      <publishTime>05/21/2021 18:05:12</publishTime>
+      <publishTime>02/22/2021 09:25:21</publishTime>
     </File>
     <File Include="Web References/WebS/ClsGy_Group_Model.datasource">
-      <publishTime>05/21/2021 18:05:12</publishTime>
+      <publishTime>02/22/2021 09:25:20</publishTime>
     </File>
     <File Include="Web References/WebS/ClsGy_Item30JiTai_Model.datasource">
-      <publishTime>05/21/2021 18:05:12</publishTime>
+      <publishTime>02/22/2021 09:25:20</publishTime>
     </File>
     <File Include="Web References/WebS/ClsGy_Source_Model.datasource">
-      <publishTime>05/21/2021 18:05:12</publishTime>
+      <publishTime>02/22/2021 09:25:21</publishTime>
     </File>
     <File Include="Web References/WebS/ClsGy_StockPlace_Model.datasource">
-      <publishTime>05/21/2021 18:05:12</publishTime>
+      <publishTime>02/22/2021 09:25:20</publishTime>
     </File>
     <File Include="Web References/WebS/ClsGy_Supplier_Model.datasource">
-      <publishTime>05/21/2021 18:05:12</publishTime>
+      <publishTime>02/22/2021 09:25:21</publishTime>
     </File>
     <File Include="Web References/WebS/ClsGy_Warehouse_Model.datasource">
-      <publishTime>05/21/2021 18:05:12</publishTime>
+      <publishTime>02/22/2021 09:25:20</publishTime>
     </File>
     <File Include="Web References/WebS/ClsKf_ICStockBill_WMS.datasource">
-      <publishTime>05/21/2021 18:05:12</publishTime>
+      <publishTime>02/22/2021 09:25:20</publishTime>
     </File>
     <File Include="Web.config">
-      <publishTime>05/23/2021 23:05:36</publishTime>
+      <publishTime>05/28/2021 17:10:52</publishTime>
     </File>
   </ItemGroup>
 </Project>
\ No newline at end of file
diff --git a/WebAPI/WebAPI.csproj b/WebAPI/WebAPI.csproj
index d28f7c7..3aacc96 100644
--- a/WebAPI/WebAPI.csproj
+++ b/WebAPI/WebAPI.csproj
@@ -350,7 +350,6 @@
     <Compile Include="Controllers\SCGL\QC_LastPieceCheckBillController.cs" />
     <Compile Include="Controllers\SCGL\QC_OutCompCheckBillController.cs" />
     <Compile Include="Controllers\SCGL\QC_ProcessCheckBillController.cs" />
-    <Compile Include="Controllers\PZGL\QC_LastPieceCheckBillController.cs" />
     <Compile Include="Controllers\Sc_ProcessMangementController.cs" />
     <Compile Include="Controllers\CJGL\Cj_StationEntrustInBillController.cs" />
     <Compile Include="Controllers\LMESController.cs" />
@@ -478,6 +477,7 @@
   </ItemGroup>
   <ItemGroup>
     <Folder Include="App_Data\" />
+    <Folder Include="Controllers\PZGL\" />
     <Folder Include="Views\MoveStockBill\" />
     <Folder Include="Views\QC_Management\" />
   </ItemGroup>

--
Gitblit v1.9.1