From c62aab5f09d8393619c6a0819e1bffdc2aa29085 Mon Sep 17 00:00:00 2001
From: black-goat-me <226547893@qq.com>
Date: 星期五, 19 五月 2023 09:29:08 +0800
Subject: [PATCH] 1

---
 WebAPI/Controllers/JHGL/Gy_RoutingBillController.cs             |   68 +-
 WebAPI/Models/StationBill.cs                                    |    1 
 WebAPI/Properties/PublishProfiles/FolderProfile.pubxml.user     |  180 +++---
 Model/车间管理/ClsSc_ProcessExchangeBillMain.cs                     |    3 
 WebAPI/Controllers/BaseSet/Gy_MaterialController.cs             |   44 +
 WebAPI/WebAPI.csproj.user                                       |    2 
 WebAPI/Controllers/LMESController.cs                            |  114 +++
 DAL/车间管理/ClsSc_ProcessExchangeBill.cs                           |    7 
 WebAPI/Web.config                                               |    9 
 WebAPI/Properties/PublishProfiles/FolderProfile.pubxml          |    2 
 Pub_Class/CustomerCls/ClsXt_SystemParameter.cs                  |   46 +
 WebAPI/Controllers/SCGL/Sc_ComplementGoodBillController.cs      |    5 
 WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs          |   26 
 WebAPI/Controllers/基础资料/基础资料/Gy_MaterTypeBillController.cs      |    6 
 Model/生产管理/设备管理/ClsSc_ICMOBillMain.cs                           |    4 
 WebAPI/Controllers/CJGL/Sc_ProcessExchangeBillController.cs     |  258 +++++++--
 Pub_Class/CustomerCls/ClsXt_SystemParameterMain.cs              |  137 +++-
 WebAPI/Controllers/CJGL/Cj_StationInBillController.cs           |   25 
 WebAPI/Controllers/POStockInBillController.cs                   |    6 
 WebAPI/Controllers/生产管理/生产任务单/Sc_ICMOBillController.cs          |  265 +++++++++
 WebAPI/Controllers/PublicPageMethodController.cs                |   36 +
 WebAPI/Controllers/CJGL/Mes_OrderProcFlowAllReportController.cs |  196 +++++++
 WebAPI/Controllers/BaseSet/Gy_ICBomBillController.cs            |    1 
 WebAPI/Controllers/Sc_ProcessMangementController.cs             |   27 
 WebAPI/Controllers/基础资料/工资基础资料/Gy_ProcPriceController.cs        |   39 +
 Pub_Class/CustomerCls/ClsPub.cs                                 |   48 +
 WebAPI/Controllers/BLL/Xt_UserGroupController.cs                |    6 
 27 files changed, 1,244 insertions(+), 317 deletions(-)

diff --git "a/DAL/\350\275\246\351\227\264\347\256\241\347\220\206/ClsSc_ProcessExchangeBill.cs" "b/DAL/\350\275\246\351\227\264\347\256\241\347\220\206/ClsSc_ProcessExchangeBill.cs"
index a9330f3..fcb96aa 100644
--- "a/DAL/\350\275\246\351\227\264\347\256\241\347\220\206/ClsSc_ProcessExchangeBill.cs"
+++ "b/DAL/\350\275\246\351\227\264\347\256\241\347\220\206/ClsSc_ProcessExchangeBill.cs"
@@ -96,6 +96,7 @@
                 ",HProjectNum='" + omodel.HProjectNum.ToString() + "'" +
                 ",HMateOutBatchNo='" + omodel.HMateOutBatchNo + "'" +
                 ",HBLFlag='" + (omodel.HBLFlag ? 1 : 0) + "'" +
+                ",HMachineLine='" + omodel.HMachineLine + "'" +
                 ",HXTNumber='" + omodel.HXTNumber  + "'" +
                 ",HXTModel='" + omodel.HXTModel + "'" +
                 ",HRemark2='" + omodel.HRemark2 + "'" +
@@ -112,6 +113,8 @@
                 ",HAl1Long='" + omodel.HAl1Long + "'" +
                 ",HDensity='" + omodel.HDensity + "'" +
                 ",HTela='" + omodel.HTela + "'" +
+                ",HSplitSumQty='" + omodel.HSplitSumQty + "'" +
+                ",HSplitColorQty='" + omodel.HSplitColorQty + "'" +
                 ",HUnderTela='" + omodel.HUnderTela + "'" +
                 ",HSizing='" + omodel.HSizing + "'" +
                 ",HSellDate='" + omodel.HSellDate + "'" +
@@ -320,7 +323,7 @@
 ",HPicNumVer,HPicNumAssemble,HMaterTexture,HProductNum,HVerNum,HPRDORGID,HBLFlag,HCusNumber,HPickLabel,HPickLabelNumber,HXTNumber,HXTModel,HWorkBillSortNo" +
                ", HRoutingBillID,HMaterModel,HWidth,HWeight,HAuxQty,HAuxUnit,HSplitNo" +
                ",HHeight,HInches,HAl1Long,HDensity,HTela,HUnderTela,HSizing,HSellDate" +
-               ",HRemark2,HRemark3,HEmpID,HCusID,HColorRemark) " +
+               ",HRemark2,HRemark3,HEmpID,HCusID,HColorRemark,HSplitSumQty,HSplitColorQty,HMachineLine) " +
                 " values('" + this.BillType + "','" + this.HBillSubType + "'," + omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "','" + omodel.HDate + "','" + omodel.HMaker + "',getdate()," + "" + (omodel.HPrevMainSourceInterID == 0 ? omodel.HInterID : omodel.HPrevMainSourceInterID) +
                 "," + omodel.HYear.ToString() + "," + omodel.HPeriod.ToString() + ",'" + omodel.HRemark + "','" + omodel.HBatchNo + "'," + omodel.HMainMaterID.ToString() + "," + omodel.HKeyMaterID.ToString() + "," + omodel.HNo.ToString() + ",'" + omodel.HOrderProcNO + "'" +
                 "," + omodel.HWWOrderInterID.ToString() + "," + omodel.HWWOrderEntryID.ToString() + ",'" + omodel.HWWOrderBillNo + "'," + omodel.HICMOInterID.ToString() + "," + omodel.HEquipMentID.ToString() +
@@ -334,7 +337,7 @@
                 ",'" + omodel.HPicNumVer + "','" + omodel.HPicNumAssemble + "','" + omodel.HMaterTexture + "','" + omodel.HProductNum + "','" + omodel.HVerNum + "','"+ omodel.HPRDORGID+ "','" + (omodel.HBLFlag ? 1 : 0) + "','" + omodel.HCusNumber + "','" + omodel.HPickLabel + "','" + omodel.HPickLabelNumber + "','" + omodel.HXTNumber + "','" + omodel.HXTModel + "','" + omodel.HWorkBillSortNo + 
                 "',"+ omodel.HRoutingBillID + ",'"+ omodel.HMaterModel + "',"+ omodel.HWidth + ","+ omodel.HWeight + ","+ omodel.HAuxQty + ","+ omodel.HAuxUnit +","+ omodel.HSplitNo +"" +
                 ",'" + omodel.HHeight + "','" + omodel.HInches + "','" + omodel.HAl1Long + "','" + omodel.HDensity + "','" + omodel.HTela + "','" + omodel.HUnderTela + "','" + omodel.HSizing + "','" + omodel.HSellDate + "'" +
-                ",'"+ omodel.HRemark2 + "','"+ omodel.HRemark3 + "',"+ omodel.HEmpID + "," + omodel.HCusID + ",'"+ omodel.HColorRemark + "')");
+                ",'"+ omodel.HRemark2 + "','"+ omodel.HRemark3 + "',"+ omodel.HEmpID + "," + omodel.HCusID + ",'"+ omodel.HColorRemark + "',"+ omodel.HSplitSumQty + ","+ omodel.HSplitColorQty + ",'"+ omodel.HMachineLine + "')");
                 sErr = sErr + "1;";
                 //鎻掑叆瀛愯〃
                 foreach (Model.ClsSc_ProcessExchangeBillSub oSub in DetailColl)
diff --git "a/Model/\347\224\237\344\272\247\347\256\241\347\220\206/\350\256\276\345\244\207\347\256\241\347\220\206/ClsSc_ICMOBillMain.cs" "b/Model/\347\224\237\344\272\247\347\256\241\347\220\206/\350\256\276\345\244\207\347\256\241\347\220\206/ClsSc_ICMOBillMain.cs"
index 0b1ba82..7a7ad5f 100644
--- "a/Model/\347\224\237\344\272\247\347\256\241\347\220\206/\350\256\276\345\244\207\347\256\241\347\220\206/ClsSc_ICMOBillMain.cs"
+++ "b/Model/\347\224\237\344\272\247\347\256\241\347\220\206/\350\256\276\345\244\207\347\256\241\347\220\206/ClsSc_ICMOBillMain.cs"
@@ -24,6 +24,8 @@
         public Int64 HBomID;          //  --BOM单ID
         public string HBomNumber;	 		 
         public Int64 HRoutingInterID;     //    --工艺路线ID
+        public Int64 HOWNERID;     //    --货主
+        public string HOWNERTYPEID;     //    --货主类型
         public DateTime HPlanBeginDate;      //计划开工日期
         public DateTime HPlanEndDate;	    //计划完工日期
         public DateTime HBeginDate;    // --最迟开工日期		 
@@ -32,6 +34,8 @@
         public double HReadyQty;     //      --齐套数量		 
         public double? HPlanQty;        //计划生产数量
         public string HRemark;
+        public string HIsStockQty;//是否取库存
+        public string HRemark3;//底部备注
 
         public double HRelationQty;
         public string HOrderProcNo;//订单跟踪号
diff --git "a/Model/\350\275\246\351\227\264\347\256\241\347\220\206/ClsSc_ProcessExchangeBillMain.cs" "b/Model/\350\275\246\351\227\264\347\256\241\347\220\206/ClsSc_ProcessExchangeBillMain.cs"
index e3d795e..821d217 100644
--- "a/Model/\350\275\246\351\227\264\347\256\241\347\220\206/ClsSc_ProcessExchangeBillMain.cs"
+++ "b/Model/\350\275\246\351\227\264\347\256\241\347\220\206/ClsSc_ProcessExchangeBillMain.cs"
@@ -91,6 +91,9 @@
         public double HAuxQty;//辅数量
         public int HAuxUnit;//辅助单位
         public int HSplitNo;//拆分号
+        public int HSplitSumQty;//拆分总量
+        public int HSplitColorQty;//分缸号
+        public string HMachineLine;//机台
 
         public string HRemark2;//备注2
         public string HRemark3;//底部备注
diff --git a/Pub_Class/CustomerCls/ClsPub.cs b/Pub_Class/CustomerCls/ClsPub.cs
index e560972..fdc5f20 100644
--- a/Pub_Class/CustomerCls/ClsPub.cs
+++ b/Pub_Class/CustomerCls/ClsPub.cs
@@ -458,6 +458,47 @@
                                 oCn.RunProc("update Gy_Maxnum set NowNumBer=NowNumBer+1 where BillCode='" + BillCode.Trim() + "' and KjYear='" + sKjYear + "' and Period='" + sPeriod + "' and whcode='" + sDay + "'");
                             }
                             return sBillNo;
+                        case 3: //鏍规嵁 涔斾竴 锛圫 + 骞达紙23锛�+浜斾綅娴佹按鍙凤級瀹炰緥锛歋2300001
+                            Ds = oCn.RunProcReturn("Select * from Gy_MaxNum where BillCode='" + BillCode.Trim() + "' and KjYear='0'  and whcode=''", "Gy_MaxNum");
+                            sKjYear = sKjYear.Substring(2, 2);
+                            if (Ds.Tables[0].Rows.Count != 0)
+                            {
+                                sStr = new string(c, CodeLen - (Ds.Tables[0].Rows[0]["NowNumBer"].ToString()).Length);
+                                Profix = Profix.Substring(0, 1);
+                                sBillNo = Profix.Trim() + sKjYear + sStr + Ds.Tables[0].Rows[0]["NowNumBer"].ToString().Trim();
+                            }
+                            else //鎻掑叆鏂拌褰�
+                            {
+                                sStr = new string(c, CodeLen - 1);
+                                oCn.RunProc("insert into Gy_Maxnum(BillCode,Kjyear,Period,whcode,NowNumber)  values('" + BillCode.Trim() + "','" + sKjYear + "','" + sPeriod + "','" + sDay + "',1)");
+                                sBillNo = Profix.Trim() + sKjYear + sStr + 1;
+                            }
+                            if (Add == true)
+                            {
+                                oCn.RunProc("update Gy_Maxnum set NowNumBer=NowNumBer+1 where BillCode='" + BillCode.Trim() + "' and KjYear='0'  and whcode=''");
+                            }
+                            return sBillNo;
+                        case 4: //鏍规嵁 涔斾竴 宸ュ簭娴佽浆鍗″彿鏀规垚骞�+鏈�+鍥涗綅娴佹按鍙凤紙23050001锛�
+                            Ds = oCn.RunProcReturn("Select * from Gy_MaxNum where BillCode='" + BillCode.Trim() + "' and KjYear='0'  and whcode=''", "Gy_MaxNum");
+                            sKjYear = sKjYear.Substring(2, 2);
+                            sPeriod = "0" + sPeriod;
+                            sPeriod = sPeriod.Substring(sPeriod.Length - 2, 2);
+                            if (Ds.Tables[0].Rows.Count != 0)
+                            {
+                                sStr = new string(c, CodeLen - (Ds.Tables[0].Rows[0]["NowNumBer"].ToString()).Length);
+                                sBillNo = sKjYear + sPeriod + sStr + Ds.Tables[0].Rows[0]["NowNumBer"].ToString().Trim();
+                            }
+                            else //鎻掑叆鏂拌褰�
+                            {
+                                sStr = new string(c, CodeLen - 1);
+                                oCn.RunProc("insert into Gy_Maxnum(BillCode,Kjyear,Period,whcode,NowNumber)  values('" + BillCode.Trim() + "','" + sKjYear + "','" + sPeriod + "','" + sDay + "',1)");
+                                sBillNo = sKjYear + sPeriod + sStr + 1;
+                            }
+                            if (Add == true)
+                            {
+                                oCn.RunProc("update Gy_Maxnum set NowNumBer=NowNumBer+1 where BillCode='" + BillCode.Trim() + "' and KjYear='0'  and whcode=''");
+                            }
+                            return sBillNo;
                         default:
                             return sBillNo;
 
@@ -889,7 +930,7 @@
                 if (LogTF == 1 || LogTF == 3)//闇�瑕佸垽鏂潈闄�
                 {
                     //鏍规嵁鐢ㄦ埛鍚嶇О鍒ゆ柇鏉冮檺
-                    DsUser = oCn.RunProcReturn("select * from gy_czygl where czymc='" + UserID.Trim() + "'", "gy_czygl");
+                    DsUser = oCn.RunProcReturn("select ManagerFlag,isnull(AuthorityID,'') AuthorityID,Czybm from gy_czygl where czymc='" + UserID.Trim() + "'", "gy_czygl");
                     if (DsUser.Tables[0].Rows.Count == 0)
                     {
                         if (Msg == true)
@@ -905,7 +946,8 @@
                     }
                     else
                     {
-                        if (DsUser.Tables[0].Rows[0]["AuthorityID"].ToString().Trim().Substring((int)ModID - 1, 1) == "1")
+                        if (ClsPub.isStrNull(DsUser.Tables[0].Rows[0]["AuthorityID"]).Length > ModID
+                            && DsUser.Tables[0].Rows[0]["AuthorityID"].ToString().Trim().Substring((int)ModID - 1, 1) == "1")
                         {
                             HavRight = true;
                         }
@@ -914,7 +956,7 @@
                             //鑾峰彇鐢ㄦ埛缁�  骞跺惊鐜垽鏂潈闄�
                             //鍒ゆ柇瑙掕壊鏄惁鏈夋潈闄�
                             DsJS = oCn.RunProcReturn("select isnull(AuthorityID,'') AuthorityID from System_UserGroupinfo a inner join System_UserGroup b on a.GroupID=b.GroupID " + 
-                                " Where a.USERID='" + UserID.Trim() + "'", "gy_czygl");
+                                " Where a.USERID='" + DsUser.Tables[0].Rows[0]["Czybm"].ToString().Trim() + "'", "gy_czygl");
                             if (DsJS == null)
                             {
                                 HavRight = false;
diff --git a/Pub_Class/CustomerCls/ClsXt_SystemParameter.cs b/Pub_Class/CustomerCls/ClsXt_SystemParameter.cs
index 1d02c35..02c7421 100644
--- a/Pub_Class/CustomerCls/ClsXt_SystemParameter.cs
+++ b/Pub_Class/CustomerCls/ClsXt_SystemParameter.cs
@@ -513,6 +513,10 @@
                     {
                         omodel.Kf_SellOutBillCheck_MultilineCtl = ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HValue"]);
                     }
+                    if (ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HKey"]) == "Kf_SellOutBillCheck_SourceBarCodeCtl")
+                    {
+                        omodel.Kf_SellOutBillCheck_SourceBarCodeCtl = ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HValue"]);
+                    }
 
                     //其他出库单
                     if (ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HKey"]) == "Kf_OtherOutBill_AutoCheck")
@@ -1648,6 +1652,36 @@
                         omodel.Sc_MESProceReportWorkBill_AutoCheck = ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HValue"]);
                     }
 
+                    //条码主档删除人必须是制单人('Y'为控制)
+                    if (ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HKey"]) == "BarCode_DeleterAndMakerMustSame")
+                    {
+                        omodel.BarCode_DeleterAndMakerMustSame = ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HValue"]);
+                    }
+
+                    //-==================生产订单
+                    //生产订单同步时自动生成流转卡
+                    if (ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HKey"]) == "Sc_ICMOBill_AutoProcExchBill")
+                    {
+                        omodel.Sc_ICMOBill_AutoProcExchBill = ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HValue"]);
+                    }
+                    if (ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HKey"]) == "Sc_ICMOBill_DeleterAndMakerMustSame")
+                    {
+                        omodel.Sc_ICMOBill_DeleterAndMakerMustSame = ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HValue"]);
+                    }
+
+
+                    //-==================工序流转卡
+                    //工序流转卡保存自动同步条码档案
+                    if (ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HKey"]) == "Sc_ProcessExchangeBill_AutoBarCode")
+                    {
+                        omodel.Sc_ProcessExchangeBill_AutoBarCode = ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HValue"]);
+                    }
+                    if (ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HKey"]) == "Sc_ProcessExchangeBill_DeleterAndMakerMustSame")
+                    {
+                        omodel.Sc_ProcessExchangeBill_DeleterAndMakerMustSame = ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HValue"]);
+                    }
+
+
                     ////=========工序进站单
                     ////自动匹配流水号
                     //if (ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HKey"]) == "MES_StationBill_ProcNo")
@@ -2072,6 +2106,10 @@
                     if (ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HKey"]) == "Kf_SellOutBillCheck_MultilineCtl")
                     {
                         omodel.Kf_SellOutBillCheck_MultilineCtl = ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HValue"]);
+                    }
+                    if (ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HKey"]) == "Kf_SellOutBillCheck_SourceBarCodeCtl")
+                    {
+                        omodel.Kf_SellOutBillCheck_SourceBarCodeCtl = ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HValue"]);
                     }
 
                     //============其他出库单
@@ -2914,6 +2952,10 @@
                     {
                         omodel.Sc_ICMOBill_AutoProcExchBill = ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HValue"]);
                     }
+                    if (ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HKey"]) == "Sc_ICMOBill_DeleterAndMakerMustSame")
+                    {
+                        omodel.Sc_ICMOBill_DeleterAndMakerMustSame = ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HValue"]);
+                    }
 
 
                     //-==================工序流转卡
@@ -2922,6 +2964,10 @@
                     {
                         omodel.Sc_ProcessExchangeBill_AutoBarCode = ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HValue"]);
                     }
+                    if (ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HKey"]) == "Sc_ProcessExchangeBill_DeleterAndMakerMustSame")
+                    {
+                        omodel.Sc_ProcessExchangeBill_DeleterAndMakerMustSame = ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HValue"]);
+                    }
 
 
                     //-======工序进站接收单
diff --git a/Pub_Class/CustomerCls/ClsXt_SystemParameterMain.cs b/Pub_Class/CustomerCls/ClsXt_SystemParameterMain.cs
index ee584d3..c9d7957 100644
--- a/Pub_Class/CustomerCls/ClsXt_SystemParameterMain.cs
+++ b/Pub_Class/CustomerCls/ClsXt_SystemParameterMain.cs
@@ -9,7 +9,8 @@
         //========================================================================================WMS条码 系统参数
 
         //生产汇报单
-        public string Sc_ICMOReportBill_AutoCheck;              //是否自动审核
+        public string Sc_ICMOReportBill_AutoCheck;              //保存后是否自动审核
+        public string Sc_ICMOReportBill_SaveAutoAddnew;               //保存后变为新增状态
         public string Sc_ICMOReportBill_ERPMode;                //WMS系统同步至ERP的类型(WISE、CLOUD、无)
         public string Sc_ICMOReportBill_MustQtyCtl;             //应收数量控制(小于等于应收、完全等于应收、不控制)
         public string Sc_ICMOReportBill_MulSourceBill;          //多源单模式
@@ -25,12 +26,15 @@
         public string Sc_ICMOReportBill_DeleterAndMakerMustSame;    //生产汇报单暂存删除人必须是制单人
 
         //收料通知单(送货单、到货确认)
-        public string Cg_POInStockBill_AutoCheck;       //是否自动审核
+        public string Cg_POInStockBill_AutoCheck;       //保存后是否自动审核
+        public string Cg_POInStockBill_SaveAutoAddnew;               //保存后变为新增状态
         public string Cg_POInStockBill_ERPMode;         //WMS系统同步至ERP的类型(WISE、CLOUD、无)
         public string Cg_POInStockBill_BarCodeCtl;                 //到货确认必须扫码箱条码
+        public string Cg_POInStockBill_DeleterAndMakerMustSame;    //送货单(收料单)删除人必须是制单人
 
         //采购入库
-        public string Kf_POStockInBill_AutoCheck;       //是否自动审核
+        public string Kf_POStockInBill_AutoCheck;       //保存后是否自动审核
+        public string Kf_POStockInBill_SaveAutoAddnew;               //保存后变为新增状态
         public string Kf_POStockInBill_ERPMode;         //WMS系统同步至ERP的类型(WISE、CLOUD、无)
         public string Kf_POStockInBill_MustQtyCtl;      //应收数量控制(小于等于应收、完全等于应收、不控制)
         public string Kf_POStockInBill_MulSourceBill;   //多源单模式
@@ -44,7 +48,8 @@
         public string Kf_POStockInBill_DeleterAndMakerMustSame;    //采购入库单暂存删除人必须是制单人
 
         //产品入库
-        public string Kf_ProductInBill_AutoCheck;       //是否自动审核
+        public string Kf_ProductInBill_AutoCheck;       //保存后是否自动审核
+        public string Kf_ProductInBill_SaveAutoAddnew;               //保存后变为新增状态
         public string Kf_ProductInBill_ERPMode;         //WMS系统同步至ERP的类型(WISE、CLOUD、无)
         public string Kf_ProductInBill_MustQtyCtl;      //应收数量控制(小于等于应收、完全等于应收、不控制)
         public string Kf_ProductInBill_MulSourceBill;   //多源单模式
@@ -58,7 +63,8 @@
         public string Kf_ProductInBill_DeleterAndMakerMustSame;    //产品入库单暂存删除人必须是制单人
 
         //其他入库
-        public string Kf_OtherInBill_AutoCheck;       //是否自动审核
+        public string Kf_OtherInBill_AutoCheck;       //保存后是否自动审核
+        public string Kf_OtherInBill_SaveAutoAddnew;               //保存后变为新增状态
         public string Kf_OtherInBill_ERPMode;         //WMS系统同步至ERP的类型(WISE、CLOUD、无)
         public string Kf_OtherInBill_MustQtyCtl;      //应收数量控制(小于等于应收、完全等于应收、不控制)
         public string Kf_OtherInBill_MulSourceBill;   //多源单模式
@@ -75,7 +81,8 @@
         public string Kf_OtherInBillCheck_MultilineCtl; //校验-多行相同物料自动拆分换行匹配
 
         //委外入库
-        public string Kf_EntrustInBill_AutoCheck;       //是否自动审核
+        public string Kf_EntrustInBill_AutoCheck;       //保存后是否自动审核
+        public string Kf_EntrustInBill_SaveAutoAddnew;               //保存后变为新增状态
         public string Kf_EntrustInBill_ERPMode;         //WMS系统同步至ERP的类型(WISE、CLOUD、无)
         public string Kf_EntrustInBill_MustQtyCtl;      //应收数量控制(小于等于应收、完全等于应收、不控制)
         public string Kf_EntrustInBill_MulSourceBill;   //多源单模式
@@ -88,7 +95,8 @@
         public string Kf_EntrustInBill_DeleterAndMakerMustSame;    //委外入库单暂存删除人必须是制单人
 
         //生产领料
-        public string Kf_MateOutBill_AutoCheck;         //是否自动审核
+        public string Kf_MateOutBill_AutoCheck;         //保存后是否自动审核
+        public string Kf_MateOutBill_SaveAutoAddnew;               //保存后变为新增状态
         public string Kf_MateOutBill_ERPMode;           //WMS系统同步至ERP的类型(WISE、CLOUD、无)
         public string Kf_MateOutBill_MustQtyCtl;        //应收数量控制(小于等于应收、完全等于应收、不控制)
         public string Kf_MateOutBill_MulSourceBill;     //多源单模式
@@ -108,7 +116,8 @@
         public string Kf_MateOutBillCheck_MultilineCtl; //校验-多行相同物料自动拆分换行匹配
 
         //销售出库
-        public string Kf_SellOutBill_AutoCheck;             //是否自动审核
+        public string Kf_SellOutBill_AutoCheck;             //保存后是否自动审核
+        public string Kf_SellOutBill_SaveAutoAddnew;               //保存后变为新增状态
         public string Kf_SellOutBill_ERPMode;               //WMS系统同步至ERP的类型(WISE、CLOUD、无)
         public string Kf_SellOutBill_MustQtyCtl;            //应收数量控制(小于等于应收、完全等于应收、不控制)
         public string Kf_SellOutBill_MulSourceBill;         //多源单模式
@@ -127,9 +136,11 @@
         public string Kf_SellOutBillCheck_MustQtyCtl;   //校验数量控制
         public string Kf_SellOutBillCheck_WHSPCtl;      //校验-是否校对仓库仓位
         public string Kf_SellOutBillCheck_MultilineCtl; //校验-多行相同物料自动拆分换行匹配
+        public string Kf_SellOutBillCheck_SourceBarCodeCtl;   //校验-是否进行源单对应条码核对('Y'为核对)
 
         //其他出库
-        public string Kf_OtherOutBill_AutoCheck;       //是否自动审核
+        public string Kf_OtherOutBill_AutoCheck;                    //保存后是否自动审核
+        public string Kf_OtherOutBill_SaveAutoAddnew;               //保存后变为新增状态
         public string Kf_OtherOutBill_ERPMode;         //WMS系统同步至ERP的类型(WISE、CLOUD、无)
         public string Kf_OtherOutBill_MustQtyCtl;      //应收数量控制(小于等于应收、完全等于应收、不控制)
         public string Kf_OtherOutBill_MulSourceBill;   //多源单模式
@@ -147,7 +158,8 @@
         public string Kf_OtherOutBillCheck_MultilineCtl; //校验-多行相同物料自动拆分换行匹配
 
         //委外出库
-        public string Kf_EntrustOutBill_AutoCheck;       //是否自动审核
+        public string Kf_EntrustOutBill_AutoCheck;       //保存后是否自动审核
+        public string Kf_EntrustOutBill_SaveAutoAddnew;               //保存后变为新增状态
         public string Kf_EntrustOutBill_ERPMode;         //WMS系统同步至ERP的类型(WISE、CLOUD、无)
         public string Kf_EntrustOutBill_MustQtyCtl;      //应收数量控制(小于等于应收、完全等于应收、不控制)
         public string Kf_EntrustOutBill_MulSourceBill;   //多源单模式
@@ -166,7 +178,8 @@
         public string Kf_EntrustOutBillCheck_MultilineCtl; //校验-多行相同物料自动拆分换行匹配
 
         //生产补料
-        public string Kf_MateReplenishOutBill_AutoCheck;       //是否自动审核
+        public string Kf_MateReplenishOutBill_AutoCheck;       //保存后是否自动审核
+        public string Kf_MateReplenishOutBill_SaveAutoAddnew;               //保存后变为新增状态
         public string Kf_MateReplenishOutBill_ERPMode;         //WMS系统同步至ERP的类型(WISE、CLOUD、无)
         public string Kf_MateReplenishOutBill_MustQtyCtl;      //应收数量控制(小于等于应收、完全等于应收、不控制)
         public string Kf_MateReplenishOutBill_MulSourceBill;   //多源单模式
@@ -182,7 +195,8 @@
         public string Kf_MateReplenishOutBillCheck_MultilineCtl; //校验-多行相同物料自动拆分换行匹配
 
         //委外补料
-        public string Kf_EntrustReplenishOutBill_AutoCheck;       //是否自动审核
+        public string Kf_EntrustReplenishOutBill_AutoCheck;       //保存后是否自动审核
+        public string Kf_EntrustReplenishOutBill_SaveAutoAddnew;               //保存后变为新增状态
         public string Kf_EntrustReplenishOutBill_ERPMode;         //WMS系统同步至ERP的类型(WISE、CLOUD、无)
         public string Kf_EntrustReplenishOutBill_MustQtyCtl;      //应收数量控制(小于等于应收、完全等于应收、不控制)
         public string Kf_EntrustReplenishOutBill_MulSourceBill;   //多源单模式
@@ -198,7 +212,8 @@
         public string Kf_EntrustReplenishOutBillCheck_MultilineCtl; //校验-多行相同物料自动拆分换行匹配
 
         //直接调拨
-        public string Kf_MoveStockBill_AutoCheck;       //是否自动审核
+        public string Kf_MoveStockBill_AutoCheck;       //保存后是否自动审核
+        public string Kf_MoveStockBill_SaveAutoAddnew;               //保存后变为新增状态
         public string Kf_MoveStockBill_ERPMode;         //WMS系统同步至ERP的类型(WISE、CLOUD、无)
         public string Kf_MoveStockBill_MustQtyCtl;      //应收数量控制(小于等于应收、完全等于应收、不控制)
         public string Kf_MoveStockBill_MulSourceBill;   //多源单模式
@@ -217,7 +232,8 @@
         public string Kf_MoveStockBillCheck_MultilineCtl;   //校验-多行相同物料自动拆分换行匹配
 
         //分步式调出单
-        public string Kf_MoveStockStepOutBill_AutoCheck;       //是否自动审核
+        public string Kf_MoveStockStepOutBill_AutoCheck;       //保存后是否自动审核
+        public string Kf_MoveStockStepOutBill_SaveAutoAddnew;               //保存后变为新增状态
         public string Kf_MoveStockStepOutBill_ERPMode;         //WMS系统同步至ERP的类型(WISE、CLOUD、无)
         public string Kf_MoveStockStepOutBill_MustQtyCtl;      //应收数量控制(小于等于应收、完全等于应收、不控制)
         public string Kf_MoveStockStepOutBill_MulSourceBill;   //多源单模式
@@ -231,7 +247,8 @@
         public string Kf_MoveStockStepOutBill_DeleterAndMakerMustSame;    //分步式调出单暂存删除人必须是制单人
 
         //分步式调入单
-        public string Kf_MoveStockStepInBill_AutoCheck;       //是否自动审核
+        public string Kf_MoveStockStepInBill_AutoCheck;       //保存后是否自动审核
+        public string Kf_MoveStockStepInBill_SaveAutoAddnew;               //保存后变为新增状态
         public string Kf_MoveStockStepInBill_ERPMode;         //WMS系统同步至ERP的类型(WISE、CLOUD、无)
         public string Kf_MoveStockStepInBill_MustQtyCtl;      //应收数量控制(小于等于应收、完全等于应收、不控制)
         public string Kf_MoveStockStepInBill_MulSourceBill;   //多源单模式
@@ -246,7 +263,8 @@
         public string Kf_MoveStockStepInBill_DeleterAndMakerMustSame;    //分步式调入单暂存删除人必须是制单人
 
         //采购退料
-        public string Kf_POStockInBackBill_AutoCheck;       //是否自动审核
+        public string Kf_POStockInBackBill_AutoCheck;       //保存后是否自动审核
+        public string Kf_POStockInBackBill_SaveAutoAddnew;               //保存后变为新增状态
         public string Kf_POStockInBackBill_ERPMode;         //WMS系统同步至ERP的类型(WISE、CLOUD、无)
         public string Kf_POStockInBackBill_MustQtyCtl;      //应收数量控制(小于等于应收、完全等于应收、不控制)
         public string Kf_POStockInBackBill_MulSourceBill;   //多源单模式
@@ -258,7 +276,8 @@
         public string Kf_POStockInBackBill_DeleterAndMakerMustSame;    //采购退料单暂存删除人必须是制单人
 
         //产品退库
-        public string Kf_ProductInBackBill_AutoCheck;       //是否自动审核
+        public string Kf_ProductInBackBill_AutoCheck;       //保存后是否自动审核
+        public string Kf_ProductInBackBill_SaveAutoAddnew;               //保存后变为新增状态
         public string Kf_ProductInBackBill_ERPMode;         //WMS系统同步至ERP的类型(WISE、CLOUD、无)
         public string Kf_ProductInBackBill_MustQtyCtl;      //应收数量控制(小于等于应收、完全等于应收、不控制)
         public string Kf_ProductInBackBill_MulSourceBill;   //多源单模式
@@ -270,7 +289,8 @@
         public string Kf_ProductInBackBill_DeleterAndMakerMustSame;    //产品退库单暂存删除人必须是制单人
 
         //其他入库红字
-        public string Kf_OtherInBackBill_AutoCheck;       //是否自动审核
+        public string Kf_OtherInBackBill_AutoCheck;       //保存后是否自动审核
+        public string Kf_OtherInBackBill_SaveAutoAddnew;               //保存后变为新增状态
         public string Kf_OtherInBackBill_ERPMode;         //WMS系统同步至ERP的类型(WISE、CLOUD、无)
         public string Kf_OtherInBackBill_MustQtyCtl;      //应收数量控制(小于等于应收、完全等于应收、不控制)
         public string Kf_OtherInBackBill_MulSourceBill;   //多源单模式
@@ -282,7 +302,8 @@
         public string Kf_OtherInBackBill_DeleterAndMakerMustSame;    //其他入库红字单暂存删除人必须是制单人
 
         //委外退库
-        public string Kf_EntrustInBackBill_AutoCheck;       //是否自动审核
+        public string Kf_EntrustInBackBill_AutoCheck;       //保存后是否自动审核
+        public string Kf_EntrustInBackBill_SaveAutoAddnew;               //保存后变为新增状态
         public string Kf_EntrustInBackBill_ERPMode;         //WMS系统同步至ERP的类型(WISE、CLOUD、无)
         public string Kf_EntrustInBackBill_MustQtyCtl;      //应收数量控制(小于等于应收、完全等于应收、不控制)
         public string Kf_EntrustInBackBill_MulSourceBill;   //多源单模式
@@ -294,7 +315,8 @@
         public string Kf_EntrustInBackBill_DeleterAndMakerMustSame;    //委外退库单暂存删除人必须是制单人
 
         //生产退料
-        public string Kf_MateOutBackBill_AutoCheck;       //是否自动审核
+        public string Kf_MateOutBackBill_AutoCheck;       //保存后是否自动审核
+        public string Kf_MateOutBackBill_SaveAutoAddnew;               //保存后变为新增状态
         public string Kf_MateOutBackBill_ERPMode;         //WMS系统同步至ERP的类型(WISE、CLOUD、无)
         public string Kf_MateOutBackBill_MustQtyCtl;      //应收数量控制(小于等于应收、完全等于应收、不控制)
         public string Kf_MateOutBackBill_MulSourceBill;   //多源单模式
@@ -307,7 +329,8 @@
         public string Kf_MateOutBackBill_DeleterAndMakerMustSame;    //生产退料单暂存删除人必须是制单人
 
         //销售退库
-        public string Kf_SellOutBackBill_AutoCheck;                 //是否自动审核
+        public string Kf_SellOutBackBill_AutoCheck;                 //保存后是否自动审核
+        public string Kf_SellOutBackBill_SaveAutoAddnew;               //保存后变为新增状态
         public string Kf_SellOutBackBill_ERPMode;                   //WMS系统同步至ERP的类型(WISE、CLOUD、无)
         public string Kf_SellOutBackBill_MustQtyCtl;                //应收数量控制(小于等于应收、完全等于应收、不控制)
         public string Kf_SellOutBackBill_MulSourceBill;             //多源单模式
@@ -320,7 +343,8 @@
         public string Kf_SellOutBackBill_DeleterAndMakerMustSame;    //销售退库单暂存删除人必须是制单人
 
         //其他出库红字
-        public string Kf_OtherOutBackBill_AutoCheck;       //是否自动审核
+        public string Kf_OtherOutBackBill_AutoCheck;       //保存后是否自动审核
+        public string Kf_OtherOutBackBill_SaveAutoAddnew;               //保存后变为新增状态
         public string Kf_OtherOutBackBill_ERPMode;         //WMS系统同步至ERP的类型(WISE、CLOUD、无)
         public string Kf_OtherOutBackBill_MustQtyCtl;      //应收数量控制(小于等于应收、完全等于应收、不控制)
         public string Kf_OtherOutBackBill_MulSourceBill;   //多源单模式
@@ -332,7 +356,8 @@
         public string Kf_OtherOutBackBill_DeleterAndMakerMustSame;    //其他出库红字单暂存删除人必须是制单人
 
         //委外退料
-        public string Kf_EntrustOutBackBill_AutoCheck;       //是否自动审核
+        public string Kf_EntrustOutBackBill_AutoCheck;       //保存后是否自动审核
+        public string Kf_EntrustOutBackBill_SaveAutoAddnew;               //保存后变为新增状态
         public string Kf_EntrustOutBackBill_ERPMode;         //WMS系统同步至ERP的类型(WISE、CLOUD、无)
         public string Kf_EntrustOutBackBill_MustQtyCtl;      //应收数量控制(小于等于应收、完全等于应收、不控制)
         public string Kf_EntrustOutBackBill_MulSourceBill;   //多源单模式
@@ -345,8 +370,11 @@
         public string Kf_EntrustOutBackBill_DeleterAndMakerMustSame;    //委外退料单暂存删除人必须是制单人
 
         //生产组托
+        public string Sc_PackUnionBill_AutoCheck;       //保存后是否自动审核
+        public string Sc_PackUnionBill_SaveAutoAddnew;               //保存后变为新增状态
         public string Sc_PackUnionBill_SourceBillTypeCtl;   //未入库条码进行组托时,进行同源单类型控制(Y为控制)
         public string Sc_PackUnionBill_SourceBillNoCtl;     //未入库条码进行组托时,进行同源单控制(Y为控制)
+        public string Sc_PackUnionBill_DeleterAndMakerMustSame;    //生产组托单暂存删除人必须是制单人
 
         //WMS   通用
         public string WMS_ERPStockCtl;//ERP负库存控制(物料库存)
@@ -380,12 +408,19 @@
         //====================================================工序流转WIP
 
         //生产订单
-        public string Sc_ICMOBill_AutoProcExchBill;                //生产订单同步时自动生成流转卡
+        public string Sc_ICMOBill_AutoCheck;                        //保存后是否自动审核
+        public string Sc_ICMOBill_SaveAutoAddnew;               //保存后变为新增状态
+        public string Sc_ICMOBill_AutoProcExchBill;                 //生产订单同步时自动生成流转卡
+        public string Sc_ICMOBill_DeleterAndMakerMustSame;          //生产订单删除人必须是制单人
 
         //工序流转卡
+        public string Sc_ProcessExchangeBill_AutoCheck;                        //保存后是否自动审核
+        public string Sc_ProcessExchangeBill_SaveAutoAddnew;               //保存后变为新增状态
         public string Sc_ProcessExchangeBill_AutoBarCode;                //工序流转卡保存自动同步条码档案
+        public string Sc_ProcessExchangeBill_DeleterAndMakerMustSame;    //工序流转卡删除人必须是制单人
 
         //工序进站接收单 
+        public string MES_StationInBill_AutoCheck;                        //保存后是否自动审核
         public string MES_StationInBill_FIFOCtl;                //工站或工序先进先出(本生产资源 有单据没有出站则,不能进站其他单据)
         public string MES_StationInBill_FullMoveCtl;             //上道完全出站控制(本道进站时,上道的报废+合格必须等于上道进站数量
         public string MES_StationInBill_QtyCtl;                 //进站数量不能大于上道出站汇总合格数
@@ -401,6 +436,7 @@
         public string MES_StationInBill_PreQtyCtl;              //本道进站数量不能大于上道出站合格数量
 
         //工序出站汇报单
+        public string MES_StationOutBill_AutoCheck;                        //保存后是否自动审核
         public string MES_StationOutBill_QtyCtl;                //出站数量不能大于本道进站汇总数
         public string MES_StationOutBill_QtyPreQtyCtl;                //出站数量(合格数量或总数量)汇总不能大于上道合格汇总数
         public string MES_StationOutBill_QtyNextQtyCtl;                //出站数量(合格数量或总数量)汇总不能大于下道合格汇总数 
@@ -418,10 +454,12 @@
         public string MES_StationOutBill_NextQtyCtl;                //本道出站数量不允许小于下道进站数量
 
         //不良品评审单
+        public string QC_NoPassProdCheckBill_AutoCheck;                        //保存后是否自动审核
         public string QC_NoPassProdCheckBill_QtyCtl;            //不良品数不能大于出站单报废数量
         public string QC_NoPassProdCheckBill_BadReasonQtyCtrl;  //不良品评审单不良数量和不良原因总数必须一致
         public string QC_NoPassProdCheckBill_DeleteCtl;         //删除单据时制单人与删除人必须一致
         //工序委外发出单
+        public string MES_StationEntrustInBill_AutoCheck;                        //保存后是否自动审核
         public string MES_StationEntrustInBill_FIFOCtl;         //工站或工序先进先出(同上)
         public string MES_StationEntrustInBill_FullMoveCtl;     //上道完全出站控制(同上)
         public string MES_StationEntrustInBill_QtyCtl;          //进站数量不能大于上道出站汇总合格数(同上)
@@ -429,6 +467,7 @@
         public string MES_StationEntrustInBill_DeleteCtl;       //删除单据时制单人与删除人必须一致
         public string MES_StationEntrustInBill_SaveAutoAddnew; //保存后变为新增状态
         //工序委外接收单
+        public string MES_StationEntrustOutBill_AutoCheck;                        //保存后是否自动审核
         public string MES_StationEntrustOutBill_QtyCtl;         //出站数量不能大于本道进站汇总数
         public string MES_StationEntrustOutBill_DeleteCtl;      //删除单据时制单人与删除人必须一致
         public string MES_StationEntrustOutBill_SaveAutoAddnew; //保存后变为新增状态
@@ -438,44 +477,68 @@
 
 
         //开班单
-        public string Sc_MESBeginWorkBill_AutoCheck; //自动审核
+        public string Sc_MESBeginWorkBill_AutoCheck;                    //保存后是否自动审核
+        public string Sc_MESBeginWorkBill_SaveAutoAddnew;               //保存后变为新增状态
+        public string Sc_MESBeginWorkBill_DeleterAndMakerMustSame;      //删除人必须是制单人
         //返工单
-        public string Sc_MESReturnWorkBill_AutoCheck; //自动审核
+        public string Sc_MESReturnWorkBill_AutoCheck;                   //保存后是否自动审核
+        public string Sc_MESReturnWorkBill_SaveAutoAddnew;               //保存后变为新增状态
+        public string Sc_MESReturnWorkBill_DeleterAndMakerMustSame;      //删除人必须是制单人
         //结班单
-        public string Sc_MESEndWorkBill_AutoCheck; //自动审核
+        public string Sc_MESEndWorkBill_AutoCheck;                      //保存后是否自动审核
+        public string Sc_MESEndWorkBill_SaveAutoAddnew;               //保存后变为新增状态
+        public string Sc_MESEndWorkBill_DeleterAndMakerMustSame;      //删除人必须是制单人
         //停工挂起单
-        public string Sc_MESStopWorkBill_AutoCheck; //自动审核
+        public string Sc_MESStopWorkBill_AutoCheck;                     //保存后是否自动审核
+        public string Sc_MESStopWorkBill_SaveAutoAddnew;               //保存后变为新增状态
+        public string Sc_MESStopWorkBill_DeleterAndMakerMustSame;      //删除人必须是制单人
         //产量汇报单
-        public string Sc_ICMOBillWorkQtyStatus_AutoCheck; //自动审核
+        public string Sc_ICMOBillWorkQtyStatus_AutoCheck;                   //保存后是否自动审核
+        public string Sc_ICMOBillWorkQtyStatus_SaveAutoAddnew;               //保存后变为新增状态
+        public string Sc_ICMOBillWorkQtyStatus_DeleterAndMakerMustSame;      //删除人必须是制单人
         //质量汇报单
-        public string Sc_ICMOBillQualityStatus_AutoCheck; //自动审核
+        public string Sc_ICMOBillQualityStatus_AutoCheck;                       //保存后是否自动审核
+        public string Sc_ICMOBillQualityStatus_SaveAutoAddnew;               //保存后变为新增状态
+        public string Sc_ICMOBillQualityStatus_DeleterAndMakerMustSame;      //删除人必须是制单人
         //上料防错单
-        public string Sc_MaterToSourceBill_AutoCheck;               //自动审核
+        public string Sc_MaterToSourceBill_AutoCheck;               //保存后是否自动审核
+        public string Sc_MaterToSourceBill_SaveAutoAddnew;               //保存后变为新增状态
+        public string Sc_MaterToSourceBill_DeleterAndMakerMustSame;      //删除人必须是制单人
         public string Sc_MaterToSourceBill_MouldLifeCtrl;           //保存时器具寿命控制 (Y 控制, N 不控制 当器具预计寿命或者当前寿命不足时,不允许上料)
         public string Sc_MaterToSourceBill_MouldLifeCtrlType;       //保存时器具寿命控制类型 (Y 强制控制, N 仅提示)
         //异常反馈单
-        public string OA_ErrMsgBackBill_AutoCheck;  //自动审核
+        public string OA_ErrMsgBackBill_AutoCheck;                      //保存后是否自动审核
+        public string OA_ErrMsgBackBill_SaveAutoAddnew;               //保存后变为新增状态
+        public string OA_ErrMsgBackBill_DeleterAndMakerMustSame;      //删除人必须是制单人
         //报工台工序汇报
-        public string Sc_MESProceReportWorkBill_AutoCheck; //自动审核
+        public string Sc_MESProceReportWorkBill_AutoCheck; //保存后是否自动审核
+        public string Sc_MESProceReportWorkBill_SaveAutoAddnew;               //保存后变为新增状态
+        public string Sc_MESProceReportWorkBill_DeleterAndMakerMustSame;      //删除人必须是制单人
 
         //QMS
 
         //首件检验单
-        public string QC_FirstPieceCheckBill_AutoCheck; //保存后变为新增状态  
+        public string QC_FirstPieceCheckBill_AutoCheck;                     //保存后是否自动审核  
+        public string QC_FirstPieceCheckBill_SaveAutoAddnew;               //保存后变为新增状态
+        public string QC_FirstPieceCheckBill_DeleterAndMakerMustSame;      //删除人必须是制单人
 
 
 
         //EAM
 
         //器具领用出库单
-        public string Sc_MouldProdOutBill_AutoCheck; //自动审核
-        public string Sc_MouldProdOutBill_SaveAutoAddnew; //保存后自动新增
+        public string Sc_MouldProdOutBill_AutoCheck; //保存后是否自动审核
+        public string Sc_MouldProdOutBill_SaveAutoAddnew; //保存后变为新增状态
+        public string Sc_MouldProdOutBill_DeleterAndMakerMustSame;      //删除人必须是制单人
         public string Sc_MouldProdOutBill_MouldLifeCtrl; //保存时器具寿命控制 (Y 控制, N 不控制 当器具预计寿命或者当前寿命不足时,不允许领用)
         public string Sc_MouldProdOutBill_MouldLifeCtrlType; //保存时器具寿命控制类型 (Y 强制控制, N 仅提示)
 
 
         //工艺路线
-        public string Gy_RoutingBill_SaveAutoLastProc; //保存到数据库时自动加上转工序
+        public string Gy_RoutingBill_AutoCheck;                     //保存后是否自动审核
+        public string Gy_RoutingBill_SaveAutoAddnew;                //保存后变为新增状态
+        public string Gy_RoutingBill_DeleterAndMakerMustSame;       //删除人必须是制单人
+        public string Gy_RoutingBill_SaveAutoLastProc;              //保存到数据库时自动加上转工序
         
 
         ////工序进站单
diff --git a/WebAPI/Controllers/BLL/Xt_UserGroupController.cs b/WebAPI/Controllers/BLL/Xt_UserGroupController.cs
index 64d2d52..28a421d 100644
--- a/WebAPI/Controllers/BLL/Xt_UserGroupController.cs
+++ b/WebAPI/Controllers/BLL/Xt_UserGroupController.cs
@@ -192,8 +192,10 @@
                 if (ds.Tables[0].Rows.Count > 0)
                 {
                     oCN.BeginTran();//寮�鍚簨鍔�
-
-                    oCN.RunProc($"delete from h_v_System_UserGroup where HGroupID={HInterID}");
+                    //鍒犻櫎瑙掕壊琛�
+                    oCN.RunProc($"delete from System_UserGroup where GroupID={HInterID}");
+                    //鍒犻櫎鍏宠仈鐨勭敤鎴峰叧绯�
+                    oCN.RunProc($"delete from System_UserGroupInfo where GroupId={HInterID}");
 
                     oCN.Commit();//缁撴潫浜嬪姟
 
diff --git a/WebAPI/Controllers/BaseSet/Gy_ICBomBillController.cs b/WebAPI/Controllers/BaseSet/Gy_ICBomBillController.cs
index a70b248..8089cf5 100644
--- a/WebAPI/Controllers/BaseSet/Gy_ICBomBillController.cs
+++ b/WebAPI/Controllers/BaseSet/Gy_ICBomBillController.cs
@@ -35,6 +35,7 @@
                 oCN.RunProc(sql);
                 sql = $"delete Gy_ICBomBillSub where HinterID = {mainList[0].HInterID}";
                 oCN.RunProc(sql);
+                mainList[0].HBillNo =  DBUtility.ClsPub.CreateBillCode("3302", ref DBUtility.ClsPub.sExeReturnInfo,true);
                 oCN.RunProc("Insert Into Gy_ICBomBillMain   " +
                 "(HBillType,HInterID,HBillNo,HDate" +
                 ",HYear,HPeriod,HRemark,HMaker,HMakeDate,HMaterTypeID,HStatus" +
diff --git a/WebAPI/Controllers/BaseSet/Gy_MaterialController.cs b/WebAPI/Controllers/BaseSet/Gy_MaterialController.cs
index 46d3563..45d8bee 100644
--- a/WebAPI/Controllers/BaseSet/Gy_MaterialController.cs
+++ b/WebAPI/Controllers/BaseSet/Gy_MaterialController.cs
@@ -79,11 +79,11 @@
                 string sql1 = string.Format(@"select * from h_v_Gy_MaterialList where 缁勭粐鍚嶇О='" + Organization + "'");
                 if (sWhere == null || sWhere.Equals(""))
                 {
-                    ds = oCN.RunProcReturn(sql1 + sWhere + " order by 鐗╂枡浠g爜 ", "h_v_Gy_MaterialList");
+                    ds = oCN.RunProcReturn(sql1 + sWhere + " order by 鐗╂枡浠g爜 desc", "h_v_Gy_MaterialList");
                 }
                 else
                 {
-                    string sql = sql1 + sWhere + " order by 鐗╂枡浠g爜 ";
+                    string sql = sql1 + sWhere + " order by 鐗╂枡浠g爜 desc";
                     ds = oCN.RunProcReturn(sql, "h_v_Gy_MaterialList");
                 }
 
@@ -192,7 +192,7 @@
                     {
                         objJsonResult.code = "0";
                         objJsonResult.count = 0;
-                        objJsonResult.Message = "淇濆瓨澶辫触锛佺墿鏂欏睘鎬т笉鑳戒负绌猴紒";
+                        objJsonResult.Message = "淇濆瓨澶辫触锛佺墿鏂欏垎绫讳笉鑳戒负绌猴紒";
                         objJsonResult.data = 1;
                         return objJsonResult;
                     }
@@ -802,17 +802,7 @@
             string HInterID = HInter.Replace("\"", "");
             string user = sArray[1].ToString();
             string HBarCode = sArray[2].ToString().Replace("\"","");
-            string HComputerName = SystemInformation.ComputerName; //璁惧鍚嶇О
-
-            //缂栬緫鏉冮檺
-            if (!DBUtility.ClsPub.Security_Log("Gy_BarCodeBillList_Edit", 1, false, user))
-            {
-                objJsonResult.code = "0";
-                objJsonResult.count = 0;
-                objJsonResult.Message = "鏃犲垹闄ゆ潈闄愶紒";
-                objJsonResult.data = null;
-                return objJsonResult;
-            }
+            string HComputerName = SystemInformation.ComputerName; //璁惧鍚嶇О           
 
             try
             {
@@ -820,6 +810,16 @@
 
                 string[] NewBarCode;
                 NewBarCode = HBarCode.Split(Convert.ToChar(","));
+
+                //缂栬緫鏉冮檺
+                if (!DBUtility.ClsPub.Security_Log("Gy_BarCodeBill_Del", 1, false, user))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鏃犲垹闄ゆ潈闄愶紒";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
 
                 //鍒犻櫎鏉$爜鍓嶈繘琛屽垽鏂�
                 Ds = oCN.RunProcReturn("exec h_p_Gy_BarCodeBill_MulDelete_Before '" + HInterID + "','" + HBarCode + "'", "h_p_Gy_BarCodeBill_MulDelete_Before", ref DBUtility.ClsPub.sExeReturnInfo);
@@ -857,7 +857,21 @@
                 if (Ds.Tables[0].Rows.Count != 0)
                 {
                     oCN.BeginTran();
-                    oCN.RunProc("Delete from Gy_BarCodeBill Where HItemID in (" + HInterID + ")");
+
+                    //鑾峰彇绯荤粺鍙傛暟
+                    string Ret = "";
+                    if (oSystemParameter.ShowBill(ref Ret))
+                    {
+                        //鍒ゆ柇鏄惁鍙兘鍒犻櫎鑷繁鐢熸垚鐨勬潯鐮�
+                        if (oSystemParameter.omodel.BarCode_DeleterAndMakerMustSame == "Y") //绯荤粺鍙傛暟                      
+                        {
+                            oCN.RunProc("Delete from Gy_BarCodeBill Where HItemID in (" + HInterID + ")" + " and HMaker = '" + user + "'");
+                        }
+                        else
+                        {
+                            oCN.RunProc("Delete from Gy_BarCodeBill Where HItemID in (" + HInterID + ")");
+                        }
+                    }                    
 
                     //鍐欏叆绯荤粺鏃ュ織
                     for (int i = 0; i <= NewBarCode.Length - 1; i++)
diff --git a/WebAPI/Controllers/CJGL/Cj_StationInBillController.cs b/WebAPI/Controllers/CJGL/Cj_StationInBillController.cs
index 80f8aee..83b1ba4 100644
--- a/WebAPI/Controllers/CJGL/Cj_StationInBillController.cs
+++ b/WebAPI/Controllers/CJGL/Cj_StationInBillController.cs
@@ -124,6 +124,7 @@
                 long HCenterID = list[0].HCenterID;//宸ヤ綔涓績ID
                 string HOrderProcNO = list[0].HOrderProcNO;//璁㈠崟璺熻釜鍙�
                 long HPRDOrgID = list[0].HPRDOrgID;//缁勭粐ID
+                double HmaterOutqty = list[0].HmaterOutqty;//鐧藉澂鍙戝竷
                 //鍗曟嵁瀹屾暣鎬у垽鏂�
                 if (HMaterID <= 0)
                 {
@@ -191,6 +192,7 @@
                     ",HGroupID,HDeptID,HEmpID,HBarCode,HAddr,HBarCodeMaker,HBarCodeMakeDate" +
                     ",HSupID,HQty,HPrice,HMoney,HPieceQty,HSourceName,HCenterID" +
                     ",HProcNo,HOrderProcNO,HMainInterID,HPRDOrgID" +
+                    ",HmaterOutqty" +
                     ") " +
                     " values('" + BillType + "','" + BillType + "'," + HInterID + ",'" + HBillNo + "'," + HBillStatus + ",getdate(),'" + HMaker + "',getdate()" +
                     "," + HYear + "," + HPeriod + ",'" + HRemark + "'" +
@@ -199,7 +201,7 @@
                     "," + HGroupID + "," + HDeptID + "," + HEmpID + ",'" + HBarCode + "','" + HAddr + "','" + HBarCodeMaker + "',getdate()" +
                     "," + HSupID + "," + HQty + "," + HPrice + "," + HMoney + "," + HPieceQty + ",'" + HSourceName + "'," + HCenterID +
                     ",'" + HProcNo + "','" + HOrderProcNO + "','" + HMainInterID + "'," + HPRDOrgID +
-                    ") ");
+                    ","+ HmaterOutqty + ") ");
                 }
                 else if ("Modify".Equals(eventType))
                 {
@@ -227,6 +229,7 @@
                     ",HProcExchBillNo='" + HProcExchBillNo + "'" +
                     ",HMaterID=" + HMaterID +
                     ",HProcID=" + HProcID +
+                    ",HmaterOutqty=" + HmaterOutqty +
                     ",HICMOQty=" + HICMOQty +
                     ",HPlanQty=" + HPlanQty +
                     ",HStationInTime=getdate()" +
@@ -974,14 +977,22 @@
                 DAL.ClsSc_StationInBill oBill = new DAL.ClsSc_StationInBill();
                 if (oBill.ShowBill(HInterID, ref DBUtility.ClsPub.sExeReturnInfo))
                 {
-                    if (oBill.omodel.HMaker != HDeleteMan && (HDeleteMan != "admin" && HDeleteMan != "Admin"))
+                    string sReturn = "";
+                    if (oSystemParameter.ShowBill(ref sReturn))
                     {
-                        objJsonResult.code = "0";
-                        objJsonResult.count = 0;
-                        objJsonResult.Message = "鍙兘鍒犻櫎鏈汉鐨勫崟鎹紒";
-                        objJsonResult.data = null;
-                        return objJsonResult;
+                        if (oSystemParameter.omodel.MES_StationInBill_DeleteCtl == "Y")
+                        {
+                            if (oBill.omodel.HMaker != HDeleteMan && (HDeleteMan != "admin" && HDeleteMan != "Admin"))
+                            {
+                                objJsonResult.code = "0";
+                                objJsonResult.count = 0;
+                                objJsonResult.Message = "鍙兘鍒犻櫎鏈汉鐨勫崟鎹紒";
+                                objJsonResult.data = null;
+                                return objJsonResult;
+                            }
+                        }
                     }
+                   
 
                     SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
                     DataSet ds;
diff --git a/WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs b/WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs
index 151d2a4..0b69b2c 100644
--- a/WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs
+++ b/WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs
@@ -118,6 +118,7 @@
                 double HWorkTimes = list[0].HWorkTimes;//宸ユ椂
                 long HQCCheckID = list[0].HQCCheckID;//妫�楠屽憳ID
                 long HPRDOrgID = list[0].HPRDOrgID;//缁勭粐ID
+                double HmaterOutqty = list[0].HmaterOutqty;//鐧藉澂鍙戝竷
                 //鍗曟嵁瀹屾暣鎬у垽鏂�
                 if (HProcExchInterID <= 0)
                 {
@@ -190,7 +191,7 @@
                 if (oSystemParameter.ShowBill(ref Ret))
                 {
                     //鍒ゆ柇瀹㈡埛涓嶄负榫欏北姹介厤
-                    if (oSystemParameter.omodel.WMS_CampanyName != "榫欏北姹介厤") //绯荤粺鍙傛暟                      
+                    if (oSystemParameter.omodel.WMS_CampanyName != "榫欏北姹介厤"&& oSystemParameter.omodel.WMS_CampanyName != "鐟炰笌绁�") //绯荤粺鍙傛暟                      
                     {
                         if (HSourceID == 0)
                         {
@@ -302,6 +303,7 @@
                     ",HSupID,HQty,HPrice,HMoney,HBadCount,HCenterID,HProcNo,HOrderProcNO,HSourceNameList" +
                     ",HMainSourceInterID,HMainSourceBillNo,HMainSourceBillType,HLastSubProc" +
                     ",HEmpID2,HEmpID3,HEmpID4,HEmpID5,HDSQty,HChongQty,HPriceRate,HWorkTimes,HQCCheckID,HMainInterID,HPRDOrgID" +
+                       ",HmaterOutqty" +
                     ") " +
                     " values('" + BillType + "','" + HBillSubType + "'," + HInterID + ",'" + HBillNo + "'," + HBillStatus + ",getdate(),'" + HMaker + "',getdate(),'" + HMouldNum + "'" +
                     "," + HYear + "," + HPeriod + ",'" + HRemark + "','" + HSourceName + "'," + HPieceQty + "," + HWasterQty + "," + HPlanPieceQty + "," + HBadPNL +
@@ -311,7 +313,7 @@
                     "," + 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 + "," + HMainInterID + "," + HPRDOrgID +
-                    ") ");
+                     ","+ HmaterOutqty + ") ");
                 }
                 else if ("Modify".Equals(eventType))
                 {
@@ -1623,14 +1625,22 @@
                 DAL.ClsSc_StationOutBill oBill = new DAL.ClsSc_StationOutBill();
                 if (oBill.ShowBill(HInterID, ref DBUtility.ClsPub.sExeReturnInfo))
                 {
-                    if (oBill.omodel.HMaker != HDeleteMan && (HDeleteMan != "admin" && HDeleteMan != "Admin"))
+                    string sReturn = "";
+                    if (oSystemParameter.ShowBill(ref sReturn))
                     {
-                        objJsonResult.code = "0";
-                        objJsonResult.count = 0;
-                        objJsonResult.Message = "鍙兘鍒犻櫎鏈汉鐨勫崟鎹紒";
-                        objJsonResult.data = null;
-                        return objJsonResult;
+                        if (oSystemParameter.omodel.MES_StationOutBill_DeleteCtl == "Y")
+                        {
+                            if (oBill.omodel.HMaker != HDeleteMan && (HDeleteMan != "admin" && HDeleteMan != "Admin"))
+                            {
+                                objJsonResult.code = "0";
+                                objJsonResult.count = 0;
+                                objJsonResult.Message = "鍙兘鍒犻櫎鏈汉鐨勫崟鎹紒";
+                                objJsonResult.data = null;
+                                return objJsonResult;
+                            }
+                        }
                     }
+                   
 
                     SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
                     DataSet ds;
diff --git a/WebAPI/Controllers/CJGL/Mes_OrderProcFlowAllReportController.cs b/WebAPI/Controllers/CJGL/Mes_OrderProcFlowAllReportController.cs
index 00411ab..6d09fc3 100644
--- a/WebAPI/Controllers/CJGL/Mes_OrderProcFlowAllReportController.cs
+++ b/WebAPI/Controllers/CJGL/Mes_OrderProcFlowAllReportController.cs
@@ -130,7 +130,8 @@
         }
         #endregion
 
-        #region 涓嶈壇鏄庣粏鑹巼鎶ヨ〃 鏌ヨ
+
+        #region 杞﹂棿鐢熶骇姹囨姤缁熻琛� 鏌ヨ
         [Route("Mes_OrderProcFlowAllReport/StationOutSumReportList")]
         [HttpGet]
         public object StationOutSumReportList(string sWhere)
@@ -166,5 +167,198 @@
             }
         }
         #endregion
+
+
+        #region 璁′欢宸ヨ祫鎶ヨ〃 鏌ヨ
+        [Route("Mes_OrderProcFlowAllReport/EmployeePiecePayReport")]
+        [HttpGet]
+        public object EmployeePiecePayReport(string sWhere)
+        {
+            try
+            {
+                //鍙嶅簭鍒楀寲浼犻�掔殑鍊�
+
+                ds = oCN.RunProcReturn("exec h_p_Sc_EmployeePiecePayReport " + sWhere + "", "h_p_Sc_EmployeePiecePayReport");
+
+                List<object> listCol = new List<object>();
+                foreach (DataColumn col in ds.Tables[0].Columns)
+                {
+                    Type dataType = col.DataType;
+                    string str = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
+                    listCol.Add(JsonConvert.DeserializeObject(str));
+                }
+
+                objJsonResult.code = "1";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "Sucess锛�";
+                objJsonResult.data = ds.Tables[0];
+                objJsonResult.list = listCol;
+                return objJsonResult;
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "Exception锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
+
+
+        #region 璁′欢宸ヨ祫姹囨�绘姤琛� 鏌ヨ
+        [Route("Mes_OrderProcFlowAllReport/EmployeePiecePaySumReport")]
+        [HttpGet]
+        public object EmployeePiecePaySumReport(string sWhere)
+        {
+            try
+            {
+                //鍙嶅簭鍒楀寲浼犻�掔殑鍊�
+
+                ds = oCN.RunProcReturn("exec h_p_Sc_EmployeePiecePaySumReport " + sWhere + "", "h_p_Sc_EmployeePiecePaySumReport");
+
+                List<object> listCol = new List<object>();
+                foreach (DataColumn col in ds.Tables[0].Columns)
+                {
+                    Type dataType = col.DataType;
+                    string str = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
+                    listCol.Add(JsonConvert.DeserializeObject(str));
+                }
+
+                objJsonResult.code = "1";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "Sucess锛�";
+                objJsonResult.data = ds.Tables[0];
+                objJsonResult.list = listCol;
+                return objJsonResult;
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "Exception锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
+
+
+        #region 宸ヨ祫姹囨姤鏃ユ姤琛� 鏌ヨ
+        [Route("Mes_OrderProcFlowAllReport/EmployeePieceWorkReport")]
+        [HttpGet]
+        public object EmployeePieceWorkReport(string sWhere)
+        {
+            try
+            {
+                //鍙嶅簭鍒楀寲浼犻�掔殑鍊�
+
+                ds = oCN.RunProcReturn("exec h_p_Sc_EmployeePieceWorkReport " + sWhere + "", "h_p_Sc_EmployeePieceWorkReport");
+
+                List<object> listCol = new List<object>();
+                foreach (DataColumn col in ds.Tables[0].Columns)
+                {
+                    Type dataType = col.DataType;
+                    string str = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
+                    listCol.Add(JsonConvert.DeserializeObject(str));
+                }
+
+                objJsonResult.code = "1";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "Sucess锛�";
+                objJsonResult.data = ds.Tables[0];
+                objJsonResult.list = listCol;
+                return objJsonResult;
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "Exception锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
+
+
+        #region 鐢熶骇杞﹂棿宸ュ簭鎶ヨ〃 鏌ヨ
+        [Route("Mes_OrderProcFlowAllReport/WorkShopProcessWIPReport")]
+        [HttpGet]
+        public object WorkShopProcessWIPReport(string sWhere)
+        {
+            try
+            {
+                //鍙嶅簭鍒楀寲浼犻�掔殑鍊�
+
+                ds = oCN.RunProcReturn("exec h_p_Sc_WorkShopProcessWIPReport " + sWhere + "", "h_p_Sc_WorkShopProcessWIPReport");
+
+                List<object> listCol = new List<object>();
+                foreach (DataColumn col in ds.Tables[0].Columns)
+                {
+                    Type dataType = col.DataType;
+                    string str = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
+                    listCol.Add(JsonConvert.DeserializeObject(str));
+                }
+
+                objJsonResult.code = "1";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "Sucess锛�";
+                objJsonResult.data = ds.Tables[0];
+                objJsonResult.list = listCol;
+                return objJsonResult;
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "Exception锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
+
+
+        #region 宸ュ簭鍦ㄥ埗鍝佹姤琛� 鏌ヨ
+        [Route("Mes_OrderProcFlowAllReport/WorkShopProcessWIPSumReport")]
+        [HttpGet]
+        public object WorkShopProcessWIPSumReport(string sWhere)
+        {
+            try
+            {
+                //鍙嶅簭鍒楀寲浼犻�掔殑鍊�
+
+                ds = oCN.RunProcReturn("exec h_p_Sc_WorkShopProcessWIPSumReport " + sWhere + "", "h_p_Sc_WorkShopProcessWIPSumReport");
+
+                List<object> listCol = new List<object>();
+                foreach (DataColumn col in ds.Tables[0].Columns)
+                {
+                    Type dataType = col.DataType;
+                    string str = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
+                    listCol.Add(JsonConvert.DeserializeObject(str));
+                }
+
+                objJsonResult.code = "1";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "Sucess锛�";
+                objJsonResult.data = ds.Tables[0];
+                objJsonResult.list = listCol;
+                return objJsonResult;
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "Exception锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
+
+
+
     }
 }
\ No newline at end of file
diff --git a/WebAPI/Controllers/CJGL/Sc_ProcessExchangeBillController.cs b/WebAPI/Controllers/CJGL/Sc_ProcessExchangeBillController.cs
index 187c835..b582041 100644
--- a/WebAPI/Controllers/CJGL/Sc_ProcessExchangeBillController.cs
+++ b/WebAPI/Controllers/CJGL/Sc_ProcessExchangeBillController.cs
@@ -18,6 +18,7 @@
         private json objJsonResult = new json();
         SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
         DataSet ds;
+        Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter();
 
         #region[鏂板鍗曟嵁-淇濆瓨鎸夐挳]
         /// <summary>
@@ -373,6 +374,112 @@
         //}
         #endregion
 
+        #region[鏂板鍗曟嵁-淇濆瓨鎸夐挳-鎵归噺澶嶅埗]
+        /// <summary>
+        /// 鏂板鍗曟嵁-淇濆瓨鎸夐挳
+        ///鍙傛暟锛歴tring sql銆�
+        ///杩斿洖鍊硷細object銆�
+        /// </summary>
+        [Route("Sc_ProcessExchangeBill/AddBill_Copy_pl")]
+        [HttpPost]
+        public object AddBill_Copy_pl([FromBody] JObject sMainSub)
+        {
+            var _value = sMainSub["sMainSub"].ToString();
+            string msg1 = _value.ToString();
+            string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
+            int msg2 = int.Parse(sArray[0].ToString());
+            string msg3 = sArray[1].ToString();
+            string msg4 = sArray[2].ToString();
+            string msg5 = sArray[3].ToString();
+
+            string UserName = "";
+            ListModels oListModels = new ListModels();
+            string sReturn = "";
+            try
+            {
+                if (!DBUtility.ClsPub.Security_Log("Sc_ProcessExchangeBill_Edit", 1, false, msg4))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鏃犱繚瀛樻潈闄愶紒";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
+                DAL.ClsSc_ProcessExchangeBill oBill = new DAL.ClsSc_ProcessExchangeBill();
+                DBUtility.ClsPub.HOrgID = long.Parse(msg5);
+                DBUtility.ClsPub.CurUserName = msg4;
+                oBill.ShowBill(long.Parse(msg3), ref sReturn);
+
+                ds = oCN.RunProcReturn("select isnull(sum(HQty),0) from Sc_ProcessExchangeBillMain where HICMOBillNo='" + oBill.omodel.HICMOBillNo + "' and HInterID <>"+ oBill.omodel.HInterID, "Sc_ProcessExchangeBillMain");
+                var HQty = double.Parse(ds.Tables[0].Rows[0][0].ToString());
+                int num = 0;
+                //鍗曟嵁鏁伴噺 * 寮犳暟 + 宸茬敓鎴愪笉鍖呮嫭鏈崟鎹殑鏁伴噺 >鐢熶骇璁㈠崟鏁伴噺
+                if ((oBill.omodel.HQty * msg2) + HQty > oBill.omodel.HPlanQty)
+                {
+                    if (((oBill.omodel.HPlanQty - oBill.omodel.HQty - HQty) % oBill.omodel.HQty) == 0)
+                    {
+                        num = (int)((oBill.omodel.HPlanQty - oBill.omodel.HQty - HQty) / oBill.omodel.HQty);
+                    } else
+                    {
+                        num = (int)((oBill.omodel.HPlanQty - oBill.omodel.HQty - HQty) / oBill.omodel.HQty);
+                        num += 1;
+                    }
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鏈�澶氬彲浠ュ鍒�" + num + "寮狅紒";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
+                if (num == 0) {
+                    double HPlanQty = oBill.omodel.HPlanQty - oBill.omodel.HQty - HQty;
+                    for (int i = 0; i < msg2; i++)
+                    {
+                        oBill.omodel.HBillNo = DBUtility.ClsPub.CreateBillCode("3772", ref DBUtility.ClsPub.sExeReturnInfo, true);
+                        oBill.omodel.HDate =DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd"));
+                        oBill.omodel.HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year);
+                        oBill.omodel.HPeriod = DBUtility.ClsPub.isLong(DateTime.Now.Month);
+                        oBill.omodel.HChecker = "";
+                        oBill.omodel.HCheckDate = "";
+                        oBill.omodel.HMaker = msg4;
+
+                        if (HPlanQty < oBill.omodel.HQty)
+                        {
+                            oBill.omodel.HQty = HPlanQty;
+                        }
+
+                        //淇濆瓨瀹屾瘯鍚庡鐞�
+                        bool bResult;
+
+                        bResult = oBill.AddBill(ref sReturn);
+                        if (bResult)
+                        {
+                            num++;
+                            HPlanQty -= oBill.omodel.HQty;
+                        }
+                    }
+                    
+                }
+
+                objJsonResult.code = "0";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "澶嶅埗浜�" + num + "寮犲崟鎹紒";
+                objJsonResult.data = 1;
+                return objJsonResult;
+
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "淇濆瓨澶辫触锛�" + e.ToString();
+                objJsonResult.data = 1;
+                return objJsonResult;
+            }
+        }
+        #endregion
+
         #region[鎵归噺鏂板鍗曟嵁-淇濆瓨鎸夐挳]
         /// <summary>
         /// 鏂板鍗曟嵁-淇濆瓨鎸夐挳
@@ -698,7 +805,7 @@
         /// <returns></returns>
         [Route("Sc_ProcessExchangeBill/DeltetProcessExchangeBillByID")]
         [HttpGet]
-        public object DeltetProcessExchangeBillByID(string HInterID,int HPRDORGID, string user)
+        public object DeltetProcessExchangeBillByID(string HInterID, int HPRDORGID, string user)
         {
             //缂栬緫鏉冮檺
             if (!DBUtility.ClsPub.Security_Log("Sc_ProcessExchangeBill_Drop", 1, false, user))
@@ -710,69 +817,91 @@
                 return objJsonResult;
             }
 
-
-            Int64 lngBillKey = 0;
-            lngBillKey = DBUtility.ClsPub.isLong(HInterID);
-            if (lngBillKey == 0)
-            {
-                objJsonResult.code = "0";
-                objJsonResult.count = 0;
-                objJsonResult.Message = "鍗曟嵁ID涓虹┖锛�";
-                objJsonResult.data = null;
-                return objJsonResult;
-            }
-
-
-            //鍒犻櫎鍓嶅垽鏂叧鑱旀暟閲�
-            SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
-            DataSet ds;
-            ds = oCn.RunProcReturn("select ct from (  " +
-                          "  select 1 ct from Sc_StationInBillMain Where HProcExchInterID=" + lngBillKey + " " +
-                          "  union all " +
-                          "  select 1 from Sc_StationOutBillMain Where HProcExchInterID=" + lngBillKey + " ) as a  ", "Sc_ProcExchReportSub");
-            if (ds.Tables[0].Rows.Count != 0)
-            {
-                objJsonResult.code = "0";
-                objJsonResult.count = 0;
-                objJsonResult.Message = "娴佽浆鍗″凡缁忔湁涓嬫父杩涘嚭绔欏崟鍚庯紝涓嶅厑璁稿垹闄わ紒";
-                objJsonResult.data = null;
-                return objJsonResult;
-            }
-
-
             DAL.ClsSc_ProcessExchangeBill oBill = new DAL.ClsSc_ProcessExchangeBill();
-            DBUtility.ClsPub.HOrgID = HPRDORGID;
-            if (oBill.ShowBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo))
-            {
-                if (oBill.omodel.HBillStatus > 1)
-                {
-                    objJsonResult.code = "0";
-                    objJsonResult.count = 0;
-                    objJsonResult.Message = "鍗曟嵁褰撳墠澶勪簬涓嶈兘鍒犻櫎鐘舵��,涓嶈兘鍒犻櫎锛�";
-                    objJsonResult.data = null;
-                    return objJsonResult;
-                }
-                if (oBill.omodel.HChecker != "")
-                {
-                    objJsonResult.code = "0";
-                    objJsonResult.count = 0;
-                    objJsonResult.Message = "鍗曟嵁宸茬粡瀹℃牳,涓嶈兘鍒犻櫎锛�";
-                    objJsonResult.data = null;
-                    return objJsonResult;
-                }
 
-                bool IsDete = oBill.DeleteBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo);
-                if (IsDete)
+            string[] HBillNo = HInterID.Split(',');
+
+            foreach (var item in HBillNo)
+            {
+                Int64 lngBillKey = 0;
+                lngBillKey = DBUtility.ClsPub.isLong(item);
+
+                DBUtility.ClsPub.HOrgID = HPRDORGID;
+                if (oBill.ShowBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo))
                 {
-                    objJsonResult.code = "0";
-                    objJsonResult.count = 1;
-                    objJsonResult.Message = DBUtility.ClsPub.sExeReturnInfo;
-                    objJsonResult.data = null;
-                    return objJsonResult;
+                    if (lngBillKey == 0)
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "鍗曟嵁鍙�:"+ oBill .omodel.HBillNo+ "鍗曟嵁ID涓虹┖锛�";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+
+                    //鍒犻櫎鍓嶅垽鏂叧鑱旀暟閲�
+                    SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
+                    DataSet ds;
+                    ds = oCn.RunProcReturn("select ct from (  " +
+                                  "  select 1 ct from Sc_StationInBillMain Where HProcExchInterID=" + lngBillKey + " " +
+                                  "  union all " +
+                                  "  select 1 from Sc_StationOutBillMain Where HProcExchInterID=" + lngBillKey + " ) as a  ", "Sc_ProcExchReportSub");
+                    if (ds.Tables[0].Rows.Count != 0)
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "鍗曟嵁鍙�:" + oBill.omodel.HBillNo + "娴佽浆鍗″凡缁忔湁涓嬫父杩涘嚭绔欏崟鍚庯紝涓嶅厑璁稿垹闄わ紒";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+
+                    string sReturn = "";
+                    if (oSystemParameter.ShowBill(ref sReturn))
+                    {
+                        if (oSystemParameter.omodel.Sc_ProcessExchangeBill_DeleterAndMakerMustSame == "Y")
+                        {
+                            if (oBill.omodel.HMaker != user && (user != "admin" && user != "Admin"))
+                            {
+                                objJsonResult.code = "0";
+                                objJsonResult.count = 0;
+                                objJsonResult.Message = "鍗曟嵁鍙�:" + oBill.omodel.HBillNo + "鍙兘鍒犻櫎鏈汉鐨勫崟鎹紒";
+                                objJsonResult.data = null;
+                                return objJsonResult;
+                            }
+                        }
+                    }
+
+
+                    if (oBill.omodel.HBillStatus > 1)
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "鍗曟嵁鍙�:" + oBill.omodel.HBillNo + "鍗曟嵁褰撳墠澶勪簬涓嶈兘鍒犻櫎鐘舵��,涓嶈兘鍒犻櫎锛�";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                    if (oBill.omodel.HChecker != "")
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "鍗曟嵁鍙�:" + oBill.omodel.HBillNo + "鍗曟嵁宸茬粡瀹℃牳,涓嶈兘鍒犻櫎锛�";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
                 }
                 else
                 {
-
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鍗曟嵁鏈壘鍒�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+            }
+            foreach (var item in HBillNo)
+            {
+                bool IsDete = oBill.DeleteBill(long.Parse(item), ref DBUtility.ClsPub.sExeReturnInfo);
+                if (!IsDete)
+                {
                     objJsonResult.code = "0";
                     objJsonResult.count = 0;
                     objJsonResult.Message = DBUtility.ClsPub.sExeReturnInfo;
@@ -780,14 +909,11 @@
                     return objJsonResult;
                 }
             }
-            else
-            {
-                objJsonResult.code = "0";
-                objJsonResult.count = 0;
-                objJsonResult.Message = "鍗曟嵁鏈壘鍒�";
-                objJsonResult.data = null;
-                return objJsonResult;
-            }
+            objJsonResult.code = "0";
+            objJsonResult.count = 1;
+            objJsonResult.Message = DBUtility.ClsPub.sExeReturnInfo;
+            objJsonResult.data = null;
+            return objJsonResult;
         }
         #endregion
 
diff --git a/WebAPI/Controllers/JHGL/Gy_RoutingBillController.cs b/WebAPI/Controllers/JHGL/Gy_RoutingBillController.cs
index 7635a40..045da5d 100644
--- a/WebAPI/Controllers/JHGL/Gy_RoutingBillController.cs
+++ b/WebAPI/Controllers/JHGL/Gy_RoutingBillController.cs
@@ -218,7 +218,7 @@
                         ",HProductNum='" + HProductNum + "',HVerNum='" + HVerNum + "' where HInterID='" + HInterID + "'");
 
                     //鍒犻櫎瀛愯〃
-                    oCN.RunProc("delete from Gy_RoutingBillSub where HInterID='" + HInterID + "' and HProcNo!='9999'");
+                    oCN.RunProc("delete from Gy_RoutingBillSub where HInterID='" + HInterID + "'");
                 }
                 //淇濆瓨瀛愯〃
                 objJsonResult = AddBillSub(msg3, HInterID, OperationType);
@@ -337,34 +337,31 @@
                     return objJsonResult;
                 }
 
-                if (oSub.HProcNo != "9999" || OperationType == 2)
-                {
-                    oCN.RunProc("Insert into Gy_RoutingBillSub " +
-                    "(HInterID,HEntryID,HProcID,HProcNO,HSupID,HSupFlag" +
-                    ",HWorkQty,HCenterID,HTimeUnit,HUnitTime" +
-                    ",HReadyTime,HQueueTime,HMoveTime" +
-                    ",HCloseMan,HCloseType,HRemark,HProcType,HNextProcFlag,HFlowProc" +
-                    ",HFixPrice,HProcPrice,HBadPrice,HWasterPrice,HStdFlag,HBeginDayQty,HBeginFixQty" +
-                    ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney,HAutoTrunFlag" +
-                    ",HFixWorkDays,HTrunWorkDays,HReadyTimes,HICMOReadyTimes,HSubStdEmpQty,HSubCanUseSourceQty" +
-                    ",HProcID_S,HCenterID_S,HWorkQty_S,HSubStdEmpQty_S,HMouldNo,HChangeMould" +
-                    ",HPackStd,HPack,HPutArea,HMyWorkDays,HMyFixWorkDays,HPassRate" +
-                    ",HTechnologyParameter,HPicNum,HProcCheckNote" +
-                    ",HOverRate,HProcWorkNum,HBadWHID,HWasterWHID, HWHID " +
-                    ") values("
-                    + HInterID + "," + i + "," + oSub.HProcID.ToString() + ",'" + oSub.HProcNo + "'," + oSub.HSupID.ToString() + "," + Convert.ToString(oSub.HSupFlag ? 1 : 0) + "" +
-                    "," + oSub.HWorkQty.ToString() + "," + oSub.HCenterID.ToString() + ",'" + oSub.HTimeUnit.ToString() + "'," + oSub.HUnitTime.ToString() +
-                    "," + oSub.HReadyTime.ToString() + "," + oSub.HQueueTime.ToString() + "," + oSub.HMoveTime.ToString() +
-                    ",'" + oSub.HCloseMan + "'," + Convert.ToString(oSub.HCloseType ? 1 : 0) + ",'" + oSub.HRemark + "','" + oSub.HProcType + "'," + Convert.ToString(oSub.HNextProcFlag ? 1 : 0) + "," + Convert.ToString(oSub.HFlowProc ? 1 : 0) +
-                    "," + oSub.HFixPrice.ToString() + "," + oSub.HProcPrice.ToString() + "," + oSub.HBadPrice.ToString() + "," + oSub.HWasterPrice.ToString() + "," + Convert.ToString(oSub.HStdFlag ? 1 : 0) + "," + oSub.HBeginDayQty.ToString() + "," + oSub.HBeginFixQty.ToString() +
-                    "," + oSub.HSourceInterID.ToString() + "," + oSub.HSourceEntryID.ToString() + ",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "'," + oSub.HRelationQty.ToString() + "," + oSub.HRelationMoney.ToString() + "," + Convert.ToString(oSub.HAutoTrunFlag ? 1 : 0) +
-                   "," + oSub.HFixWorkDays.ToString() + "," + oSub.HTrunWorkDays.ToString() + "," + oSub.HReadyTimes.ToString() + "," + oSub.HICMOReadyTimes.ToString() + "," + oSub.HSubStdEmpQty.ToString() + "," + oSub.HSubCanUseSourceQty.ToString() +
-                   "," + oSub.HProcID_S.ToString() + "," + oSub.HCenterID_S.ToString() + "," + oSub.HWorkQty_S.ToString() + ", " + oSub.HSubStdEmpQty_S.ToString() + ",'" + oSub.HMouldNo + "'," + oSub.HChangeMould.ToString() +
-                   ",'" + oSub.HPackStd + "','" + oSub.HPack + "','" + oSub.HPutArea + "'," + oSub.HMyWorkDays.ToString() + "," + oSub.HMyFixWorkDays.ToString() + "," + oSub.HPassRate.ToString() +
-                   ",'" + oSub.HTechnologyParameter.ToString() + "','" + oSub.HPicNum.ToString() + "','" + oSub.HProcCheckNote.ToString() +
-                   "', " + oSub.HOverRate.ToString() + ",'" + oSub.HProcWorkNum.ToString() + "'," + oSub.HBadWHID.ToString()+"," + oSub.HWasterWHID.ToString()+"," + oSub.HWHID.ToString() +
-                    ") ");
-                }
+                oCN.RunProc("Insert into Gy_RoutingBillSub " +
+                "(HInterID,HEntryID,HProcID,HProcNO,HSupID,HSupFlag" +
+                ",HWorkQty,HCenterID,HTimeUnit,HUnitTime" +
+                ",HReadyTime,HQueueTime,HMoveTime" +
+                ",HCloseMan,HCloseType,HRemark,HProcType,HNextProcFlag,HFlowProc" +
+                ",HFixPrice,HProcPrice,HBadPrice,HWasterPrice,HStdFlag,HBeginDayQty,HBeginFixQty" +
+                ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney,HAutoTrunFlag" +
+                ",HFixWorkDays,HTrunWorkDays,HReadyTimes,HICMOReadyTimes,HSubStdEmpQty,HSubCanUseSourceQty" +
+                ",HProcID_S,HCenterID_S,HWorkQty_S,HSubStdEmpQty_S,HMouldNo,HChangeMould" +
+                ",HPackStd,HPack,HPutArea,HMyWorkDays,HMyFixWorkDays,HPassRate" +
+                ",HTechnologyParameter,HPicNum,HProcCheckNote" +
+                ",HOverRate,HProcWorkNum,HBadWHID,HWasterWHID, HWHID " +
+                ") values("
+                + HInterID + "," + i + "," + oSub.HProcID.ToString() + ",'" + oSub.HProcNo + "'," + oSub.HSupID.ToString() + "," + Convert.ToString(oSub.HSupFlag ? 1 : 0) + "" +
+                "," + oSub.HWorkQty.ToString() + "," + oSub.HCenterID.ToString() + ",'" + oSub.HTimeUnit.ToString() + "'," + oSub.HUnitTime.ToString() +
+                "," + oSub.HReadyTime.ToString() + "," + oSub.HQueueTime.ToString() + "," + oSub.HMoveTime.ToString() +
+                ",'" + oSub.HCloseMan + "'," + Convert.ToString(oSub.HCloseType ? 1 : 0) + ",'" + oSub.HRemark + "','" + oSub.HProcType + "'," + Convert.ToString(oSub.HNextProcFlag ? 1 : 0) + "," + Convert.ToString(oSub.HFlowProc ? 1 : 0) +
+                "," + oSub.HFixPrice.ToString() + "," + oSub.HProcPrice.ToString() + "," + oSub.HBadPrice.ToString() + "," + oSub.HWasterPrice.ToString() + "," + Convert.ToString(oSub.HStdFlag ? 1 : 0) + "," + oSub.HBeginDayQty.ToString() + "," + oSub.HBeginFixQty.ToString() +
+                "," + oSub.HSourceInterID.ToString() + "," + oSub.HSourceEntryID.ToString() + ",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "'," + oSub.HRelationQty.ToString() + "," + oSub.HRelationMoney.ToString() + "," + Convert.ToString(oSub.HAutoTrunFlag ? 1 : 0) +
+               "," + oSub.HFixWorkDays.ToString() + "," + oSub.HTrunWorkDays.ToString() + "," + oSub.HReadyTimes.ToString() + "," + oSub.HICMOReadyTimes.ToString() + "," + oSub.HSubStdEmpQty.ToString() + "," + oSub.HSubCanUseSourceQty.ToString() +
+               "," + oSub.HProcID_S.ToString() + "," + oSub.HCenterID_S.ToString() + "," + oSub.HWorkQty_S.ToString() + ", " + oSub.HSubStdEmpQty_S.ToString() + ",'" + oSub.HMouldNo + "'," + oSub.HChangeMould.ToString() +
+               ",'" + oSub.HPackStd + "','" + oSub.HPack + "','" + oSub.HPutArea + "'," + oSub.HMyWorkDays.ToString() + "," + oSub.HMyFixWorkDays.ToString() + "," + oSub.HPassRate.ToString() +
+               ",'" + oSub.HTechnologyParameter.ToString() + "','" + oSub.HPicNum.ToString() + "','" + oSub.HProcCheckNote.ToString() +
+               "', " + oSub.HOverRate.ToString() + ",'" + oSub.HProcWorkNum.ToString() + "'," + oSub.HBadWHID.ToString() + "," + oSub.HWasterWHID.ToString() + "," + oSub.HWHID.ToString() +
+                ") ");
             }
 
             objJsonResult.code = "1";
@@ -388,20 +385,13 @@
         {
             try
             {
-                string flag = "flase";
                 string sErrMsg = "";
-                if (oSystemParameter.ShowBill(ref sErrMsg))
-                {
-                    if (oSystemParameter.omodel.Gy_RoutingBill_SaveAutoLastProc == "Y")
-                    {
-                        flag = "true";
-                    }
-                }
-                
+                oSystemParameter.ShowBill(ref sErrMsg);
+
                 objJsonResult.code = "1";
                 objJsonResult.count = 1;
                 objJsonResult.Message = "";
-                objJsonResult.data = flag;
+                objJsonResult.data = oSystemParameter.omodel;
                 return objJsonResult;
             }
             catch (Exception e)
diff --git a/WebAPI/Controllers/LMESController.cs b/WebAPI/Controllers/LMESController.cs
index bdd3b1a..c3145a8 100644
--- a/WebAPI/Controllers/LMESController.cs
+++ b/WebAPI/Controllers/LMESController.cs
@@ -62,14 +62,14 @@
             {
                 List<object> columnNameList = new List<object>();
                 //鍒ゆ柇鏄惁鏈夋煡璇㈡潈闄�
-                //if (!DBUtility.ClsPub.Security_Log("Sc_ProcessExchangeBill_Query", 1, false, user))
-                //{
-                //    objJsonResult.code = "0";
-                //    objJsonResult.count = 0;
-                //    objJsonResult.Message = "鏃犳煡璇㈡潈闄�!";
-                //    objJsonResult.data = null;
-                //    return objJsonResult;
-                //}
+                if (!DBUtility.ClsPub.Security_Log("Sc_ProcessExchangeBill_Query", 1, false, user))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鏃犳煡璇㈡潈闄�!";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
 
                 SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                 ds = oCN.RunProcReturn("select * from h_v_Sc_ProcessExchangeBillQuery where 1 = 1 " + sWhere + " order by hmainid desc ", "h_v_Sc_ProcessExchangeBillQuery");
@@ -363,14 +363,14 @@
             try
             {
                 //鍒ゆ柇鏄惁鏈夋煡璇㈡潈闄�
-                //if (!DBUtility.ClsPub.Security_Log("Gy_RoutingBill_Query", 1, false, user))
-                //{
-                //    objJsonResult.code = "0";
-                //    objJsonResult.count = 0;
-                //    objJsonResult.Message = "鏃犳潈闄愭煡璇�!";
-                //    objJsonResult.data = null;
-                //    return objJsonResult;
-                //}
+                if (!DBUtility.ClsPub.Security_Log("Gy_RoutingBill_Query", 1, false, user))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鏃犳潈闄愭煡璇�!";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
 
                 SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                 if (sWhere == null || sWhere.Equals(""))
@@ -379,7 +379,7 @@
                 }
                 else
                 {
-                    string sql1 = "select  top 1000 * from h_v_Gy_RoutingBillList where 1 = 1 ";
+                    string sql1 = "select top 1000 * from h_v_Gy_RoutingBillList where 1 = 1 ";
                     string sql = sql1 + sWhere + " order by hmainid desc,cast(宸ュ簭鍙� as int)";
                     ds = oCN.RunProcReturn(sql, "h_v_Gy_RoutingBillList");
                 }
@@ -521,6 +521,84 @@
 
         #endregion
 
+        #region 宸ヨ壓璺嚎(缁存姢宸ヤ环)
+        /// <summary>
+        /// 杩斿洖宸ヨ壓璺嚎鍒楄〃
+        ///鍙傛暟锛歴tring sql銆�
+        ///杩斿洖鍊硷細object銆�
+        /// </summary>
+        [Route("LEMS/MES_Gy_RoutingBillMainRates_Json")]
+        [HttpGet]
+        public object MES_Gy_RoutingBillMainRates_Json(string sWhere, string user)
+        {
+            DataSet ds;
+            try
+            {
+                //鍒ゆ柇鏄惁鏈夋煡璇㈡潈闄�
+                if (!DBUtility.ClsPub.Security_Log("Gy_RoutingBill_Query", 1, false, user))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鏃犳潈闄愭煡璇�!";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
+                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+                if (sWhere == null || sWhere.Equals(""))
+                {
+                    ds = oCN.RunProcReturn("select * from h_v_Gy_RoutingBillList_MainRate order by hmainid desc", "h_v_Gy_RoutingBillList_MainRate");
+                }
+                else
+                {
+                    string sql1 = "select * from h_v_Gy_RoutingBillList_MainRate where 1 = 1 ";
+                    string sql = sql1 + sWhere + " order by hmainid desc,cast(宸ュ簭鍙� as int)";
+                    ds = oCN.RunProcReturn(sql, "h_v_Gy_RoutingBillList_MainRate");
+                }
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+            return GetObjectJson(ds);
+        }
+
+        #endregion
+
+        #region 鍒ゆ柇鐗╂枡鏄惁宸茬粡瀛樺湪宸ヨ壓璺嚎
+        /// <summary>
+        /// 杩斿洖宸ヨ壓璺嚎鍒楄〃
+        ///鍙傛暟锛歴tring sql銆�
+        ///杩斿洖鍊硷細object銆�
+        /// </summary>
+        [Route("LEMS/IsExistRoutingByMaterial")]
+        [HttpGet]
+        public object IsExistRoutingByMaterial(int HMaterID, string user)
+        {
+            DataSet ds;
+            try
+            {               
+                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+
+                ds = oCN.RunProcReturn("select * from Gy_RoutingBillMain where HMaterID = '" + HMaterID + "'", "Gy_RoutingBillMain");               
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+            return GetObjectJson(ds);
+        }
+
+        #endregion
+
         #endregion
 
         /// <summary>
@@ -545,7 +623,7 @@
                     return objJsonResult;
                 }
 
-                ds = oCN.RunProcReturn("select * from h_v_IF_ICMOBillList where 1 = 1 " + sWhere + " order by 鍗曟嵁鍙� desc", "h_v_IF_ICMOBillList");
+                ds = oCN.RunProcReturn("select * from h_v_IF_ICMOBillList where 1 = 1 " + sWhere + " order by 鍒跺崟鏃ユ湡 desc,鍗曟嵁鍙� desc", "h_v_IF_ICMOBillList");
             }
             catch (Exception e)
             {
diff --git a/WebAPI/Controllers/POStockInBillController.cs b/WebAPI/Controllers/POStockInBillController.cs
index 1569fde..d5acaaa 100644
--- a/WebAPI/Controllers/POStockInBillController.cs
+++ b/WebAPI/Controllers/POStockInBillController.cs
@@ -1261,9 +1261,9 @@
                     "-",
                     num27.ToString()
                         }));
-                        string text20 = sBarCodeNew.Remove(0, 16);
-                        string text21 = text20.Remove(text20.Length - 9, 9);
-                        ClsCN clsCN3 = new ClsCN();
+                        string text20 = sBarCodeNew.Remove(0, 16); //SAE1300100230309 2303704250308010
+                        string text21 = text20.Remove(text20.Length - 9 , 9); //SAE1300100230309 2303704 250308010
+                         ClsCN clsCN3 = new ClsCN();
                         DataSet dataSet13 = clsCN3.RunProcReturn(" select HItemID,HName,HModel,HUnitID from Gy_Material where HNumber= '" + str6 + "' and  huseorgid = " + HOrgID.ToString(), "Gy_Material");
                         long num28 = ClsPub.isLong(dataSet13.Tables[0].Rows[0]["HItemID"]);
                         string text22 = ClsPub.isStrNull(dataSet13.Tables[0].Rows[0]["HName"]);
diff --git a/WebAPI/Controllers/PublicPageMethodController.cs b/WebAPI/Controllers/PublicPageMethodController.cs
index 2c8564e..80faac1 100644
--- a/WebAPI/Controllers/PublicPageMethodController.cs
+++ b/WebAPI/Controllers/PublicPageMethodController.cs
@@ -3410,7 +3410,7 @@
         #region 鏉′欢鏌ヨ鏉冮檺鍒楄〃
         [Route("PublicPageMethod/PowerList")]
         [HttpGet]
-        public object PowerList(string czybm, string sGnbm)
+        public object PowerList(string czybm, string sGnbm,string HSouceBillType)
         {
             try
             {
@@ -3426,10 +3426,17 @@
                         sName = sGnbm;
                     }
                 }
+                if (HSouceBillType == "yh")
+                {
+                    ds = oCN.RunProcReturn("select * from  Gy_Czygl where czybm='" + czybm + "'", "Gy_Czygl");
+                }
+                else if (HSouceBillType == "js")
+                {
+                    ds = oCN.RunProcReturn("select * from  System_UserGroup where GroupID='" + czybm + "'", "System_UserGroup");
+                }
 
-                ds = oCN.RunProcReturn("select * from  Gy_Czygl where czybm='" + czybm + "'", "Gy_Czygl");
                 string AuthorityID = ClsPub.isStrNull(ds.Tables[0].Rows[0]["AuthorityID"]);
-                ds = oCN.RunProcReturn("SELECT id hid,case when id<=" + AuthorityID.Length + " then case when SUBSTRING('" + AuthorityID + "',id,1)=1 then 1 else 0 end else 0 end AuthorityID,'' AuthorityHID, gnms ,gnbm hgnbm FROM  xt_xtgnb where useflag=1 and sjgnbm='" + sName + "'  and rightflag=1  order by gnbm", "xt_xtgnb");
+                ds = oCN.RunProcReturn("SELECT id hid,case when id<=" + AuthorityID.Length + " then case when SUBSTRING('" + AuthorityID + "',id,1)=1 then 1 else 0 end else 0 end AuthorityID,case when id<=" + AuthorityID.Length + " then case when SUBSTRING('" + AuthorityID + "',id,1)=1 then 1 else 0 end else 0 end AuthorityHID, gnms ,gnbm hgnbm FROM  xt_xtgnb where useflag=1 and sjgnbm='" + sName + "'  and rightflag=1  order by gnbm", "xt_xtgnb");
                 if (ds == null || ds.Tables[0].Rows.Count == 0)
                 {
                     objJsonResult.code = "0";
@@ -3503,6 +3510,7 @@
             string msg2 = sArray[0].ToString();
             string msg3 = sArray[1].ToString();
             string msg4 = sArray[2].ToString();
+            string HSouceBillType = sArray[3].ToString();
             ListModels oListModels = new ListModels();
             try
             {
@@ -3511,7 +3519,16 @@
                 msg3 = msg3.Replace("\\", "");
                 msg3 = msg3.Replace("\n", "");  //\n
                 lsmain = oListModels.getObjectByJson_UserPower(msg3);
-                ds = oCN.RunProcReturn("select * from  Gy_Czygl where czybm='" + msg4.Trim() + "'", "Gy_Czygl");
+
+                if (HSouceBillType == "yh")
+                {
+                    ds = oCN.RunProcReturn("select * from  Gy_Czygl where czybm='" + msg4.Trim() + "'", "Gy_Czygl");
+                }
+                else if (HSouceBillType == "js")
+                {
+                    ds = oCN.RunProcReturn("select * from  System_UserGroup where GroupID='" + msg4 + "'", "System_UserGroup");
+                }
+              
                 string AuthorityID = ClsPub.isStrNull(ds.Tables[0].Rows[0]["AuthorityID"]);
                 string Auth_str = AuthorityID;
                 string MKID = "";
@@ -3565,7 +3582,16 @@
                     }
                     oDs = null;
                 }
-                oCN.RunProc("UPDATE  Gy_Czygl SET AuthorityID='" + Auth_str + "' WHERE czybm='" + msg4.Trim() + "'");
+
+                if (HSouceBillType == "yh")
+                {
+                    oCN.RunProc("UPDATE  Gy_Czygl SET AuthorityID='" + Auth_str + "' WHERE czybm='" + msg4.Trim() + "'");
+                }
+                else if (HSouceBillType == "js")
+                {
+                    oCN.RunProc("UPDATE  System_UserGroup SET AuthorityID='" + Auth_str + "' WHERE GroupID='" + msg4.Trim() + "'");
+                }
+              
                 objJsonResult.code = "1";
                 objJsonResult.count = 1;
                 objJsonResult.Message = "鎺堟潈鎴愬姛锛�";
diff --git a/WebAPI/Controllers/SCGL/Sc_ComplementGoodBillController.cs b/WebAPI/Controllers/SCGL/Sc_ComplementGoodBillController.cs
index 273dfc6..3f53aa9 100644
--- a/WebAPI/Controllers/SCGL/Sc_ComplementGoodBillController.cs
+++ b/WebAPI/Controllers/SCGL/Sc_ComplementGoodBillController.cs
@@ -774,6 +774,11 @@
                     //鎷f枡閰嶉�� 涓嬫煡
                     ds = oCN.RunProcReturn($"exec h_p_JIT_ComplementGoodsBillList_DownQuery '{com.HSouceInterID}',{com.HSourceEntryID}", "h_p_JIT_ComplementGoodsBillList_DownQuery");
                 }
+                else if (com.Type == 3772)
+                {
+                    //鐢熶骇璁㈠崟 涓嬫煡 宸ュ簭娴佽浆鍗� 
+                    ds = oCN.RunProcReturn($"select * from h_v_Sc_ProcessExchangeBillQuery where HICMOInterID='{com.HSouceInterID}' and HICMOEntryID={com.HSourceEntryID}", "h_v_Sc_ProcessExchangeBillQuery");
+                }
 
                 //娣诲姞鍒楀悕
                 foreach (DataColumn col in ds.Tables[0].Columns)
diff --git a/WebAPI/Controllers/Sc_ProcessMangementController.cs b/WebAPI/Controllers/Sc_ProcessMangementController.cs
index 4fc83d5..77c76a3 100644
--- a/WebAPI/Controllers/Sc_ProcessMangementController.cs
+++ b/WebAPI/Controllers/Sc_ProcessMangementController.cs
@@ -694,6 +694,31 @@
                     return objJsonResult;
                 }
 
+
+                string sErr = "";
+                if (oSystemParameter.ShowBill(ref sErr))
+                {
+                    if (oSystemParameter.omodel.WMS_CampanyName == "鐟炰笌绁�")
+                    {
+                        //鍒ゆ柇閲戣澏浜戠敓浜ф眹鎶ュ崟 鏁伴噺 鏄惁 澶т簬 鏈亾鍑虹珯鏁伴噺
+                        ds = oCN.RunProcReturn($@"select sum(FFinishQty)-(select HQty from Sc_StationOutBillMain where HBillNo='{BillNo}') 
+                        from  AIS20220308151944..T_PRD_MORPT rpt3 
+                        left join AIS20220308151944..T_PRD_MORPTENTRY  rpt2 on rpt3.FID = rpt2.FID
+                        where F_bsv_Text=(select HProcExchBillNo from Sc_StationOutBillMain where HBillNo='{BillNo}')", "SumCount");
+                    }
+                }
+
+              
+
+                if (double.Parse(ds.Tables[0].Rows[0][0].ToString()) < 0) {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "閲戣澏浜戞眹鎶ユ暟閲忓皬浜庢湰鍦板嚭绔欐暟閲�!";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
+
                 JObject model = new JObject();
                 model.Add("FBillType", new JObject() { ["FNumber"] = "SCRKD01_SYS" }); //鍗曟嵁绫诲瀷
                 model.Add("FDate", DateTime.Now.ToString("yyyy-MM-dd")); //鍗曟嵁鏃ユ湡
@@ -725,7 +750,7 @@
                     FentityModel.Add("FBaseRealQty", item["鏁伴噺"].ToString());//
                     FentityModel.Add("FOwnerTypeId", "BD_OwnerOrg");//
                     FentityModel.Add("FOwnerId", new JObject() { ["FNumber"] = item["HPrdOrgNumber"].ToString() });//
-                    string sErr = "";
+
                     if (oSystemParameter.ShowBill(ref sErr))
                     {
                         if (oSystemParameter.omodel.WMS_CampanyName == "鐟炰笌绁�")
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_MaterTypeBillController.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_MaterTypeBillController.cs"
index fd72d9a..339ea43 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_MaterTypeBillController.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_MaterTypeBillController.cs"
@@ -477,11 +477,11 @@
 
                 foreach (DataRow row in ds.Tables[0].Rows)
                 {
-                    var strLen = row["hnumber"].ToString().Split('.');
+                    var strLen = row["hitemid"].ToString().Split('.');
                     if (strLen.Length == 1)
                     {
                         TreeModel tree = new TreeModel();
-                        tree.id = row["hnumber"].ToString();
+                        tree.id = row["hitemid"].ToString();
                         tree.title = row["hname"].ToString();
                         treeModels[0].children.Add(tree);
                     }
@@ -518,7 +518,7 @@
                     if (strLen.Length == num && dt.Rows[i]["hnumber"].ToString().Contains(tree[m].id + "."))
                     {
                         TreeModel tbjson = new TreeModel();
-                        tbjson.id = dt.Rows[i]["hnumber"].ToString();
+                        tbjson.id = dt.Rows[i]["hitemid"].ToString();
                         tbjson.title = dt.Rows[i]["hname"].ToString();
                         tree[m].children.Add(tbjson);
                     }
diff --git "a/WebAPI/Controllers/\345\237\272\347\241\200\350\265\204\346\226\231/\345\267\245\350\265\204\345\237\272\347\241\200\350\265\204\346\226\231/Gy_ProcPriceController.cs" "b/WebAPI/Controllers/\345\237\272\347\241\200\350\265\204\346\226\231/\345\267\245\350\265\204\345\237\272\347\241\200\350\265\204\346\226\231/Gy_ProcPriceController.cs"
index 70d50bf..3997316 100644
--- "a/WebAPI/Controllers/\345\237\272\347\241\200\350\265\204\346\226\231/\345\267\245\350\265\204\345\237\272\347\241\200\350\265\204\346\226\231/Gy_ProcPriceController.cs"
+++ "b/WebAPI/Controllers/\345\237\272\347\241\200\350\265\204\346\226\231/\345\267\245\350\265\204\345\237\272\347\241\200\350\265\204\346\226\231/Gy_ProcPriceController.cs"
@@ -120,7 +120,7 @@
                         oSub.HMaterID = DBUtility.ClsPub.isLong(subList[i].HMaterIDCol);
                         oSub.HProcID = DBUtility.ClsPub.isLong(subList[i].HProcIDCol);
                         oSub.HSourceID = DBUtility.ClsPub.isLong(subList[i].HSourceIDCol);
-                        oSub.HPrice = DBUtility.ClsPub.isLong(subList[i].HPriceCol);
+                        oSub.HPrice = DBUtility.ClsPub.isDoule(subList[i].HPriceCol);
                         oSub.HBeginDate = DBUtility.ClsPub.isDate(subList[i].HBeginDateCol);
                         oSub.HEndDate = DBUtility.ClsPub.isDate(subList[i].HEndDateCol);
                         oSub.HCostFlag = DBUtility.ClsPub.GridToBool(subList[i].HCostFlagCol);
@@ -415,5 +415,42 @@
         }
         #endregion
 
+
+        #region 缁存姢宸ヤ环鏃惰繑鍥炲伐鑹鸿矾绾夸俊鎭�
+        [Route("Gy_RoutingBill/EditPrice")]
+        [HttpGet]
+        public object EditPrice(string HMaterNumber)
+        {
+            try
+            {
+                List<object> columnNameList = new List<object>();
+
+                ds = oCN.RunProcReturn("exec Gy_RoutingBill_EditPrice '" + HMaterNumber + "'", "Gy_RoutingBill_EditPrice");
+
+                //娣诲姞鍒楀悕
+                foreach (DataColumn col in ds.Tables[0].Columns)
+                {
+                    Type dataType = col.DataType;
+                    string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
+                    columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕
+                }
+
+                objJsonResult.code = "1";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "Sucess锛�";
+                objJsonResult.data = ds.Tables[0];
+                objJsonResult.list = columnNameList;
+                return objJsonResult;
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "Exception锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
     }
 }
\ No newline at end of file
diff --git "a/WebAPI/Controllers/\347\224\237\344\272\247\347\256\241\347\220\206/\347\224\237\344\272\247\344\273\273\345\212\241\345\215\225/Sc_ICMOBillController.cs" "b/WebAPI/Controllers/\347\224\237\344\272\247\347\256\241\347\220\206/\347\224\237\344\272\247\344\273\273\345\212\241\345\215\225/Sc_ICMOBillController.cs"
index 5d76142..8fdcc66 100644
--- "a/WebAPI/Controllers/\347\224\237\344\272\247\347\256\241\347\220\206/\347\224\237\344\272\247\344\273\273\345\212\241\345\215\225/Sc_ICMOBillController.cs"
+++ "b/WebAPI/Controllers/\347\224\237\344\272\247\347\256\241\347\220\206/\347\224\237\344\272\247\344\273\273\345\212\241\345\215\225/Sc_ICMOBillController.cs"
@@ -287,11 +287,13 @@
                         (HBillType,HInterID,HBillNo,HDate,HPRDORGID
                         ,HYear,HPeriod,HRemark,HMaker,HMakeDate
                         ,HSeOrderBillNo,HSeOrderInterID,HSeOrderEntryID,HEmpID,HCusID
-                        ,HCenterID,HPlanQty,HDeptID,HMaterID,HUnitID,HBomID,HPlanBeginDate,HPlanEndDate,HBillStatus)
+                        ,HCenterID,HPlanQty,HDeptID,HMaterID,HUnitID,HBomID,HPlanBeginDate,HPlanEndDate,HBillStatus
+                        ,HOWNERID,HOWNERTYPEID)
                         values('3710'," + mainList[0].HInterID + ",'" + mainList[0].HBillNo + "','" + mainList[0].HDate + "'," + mainList[0].HPRDORGID +
                 "," + DateTime.Now.Year + "," + DateTime.Now.Month + ",'" + mainList[0].HRemark + "','" + mainList[0].HMaker + "',getdate()" +
                 ",'" + mainList[0].HSeOrderBillNo + "'," + mainList[0].HSeOrderInterID + "," + mainList[0].HSeOrderEntryID + "," + mainList[0].HEmpID + "," + mainList[0].HCusID +
-                "," + mainList[0].HCenterID + "," + mainList[0].HPlanQty + ",0,0,0,0,'','',2) ");
+                "," + mainList[0].HCenterID + "," + mainList[0].HPlanQty + ",0,0,0,0,'','',2" +
+                ","+ mainList[0].HOWNERID + ",'"+ mainList[0].HOWNERTYPEID + "') ");
                 //淇濆瓨涓昏〃
                 foreach (var oSub in subList)
                 {
@@ -301,13 +303,13 @@
 	            ,HBeginDate,HEndDate
                 ,HMaterID,HUnitID,HRemark,HSourceID,HDeptID,HSTATUS
 				,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney
-                ,HCOSTRATE,HISBACKFLUSH,HBatchNo,HBomID,HCHECKPRODUCT,HSEQ) 
+                ,HCOSTRATE,HISBACKFLUSH,HBatchNo,HBomID,HCHECKPRODUCT,HSEQ,HSTOCKINORGID) 
                  values({oSub.HInterID},{oSub.HEntryID},{(oSub.HQty == null ? 0 : oSub.HQty)}
                 ,'{(oSub.HPlanBeginDate == null ? DateTime.Now.ToString("yyyy-MM-dd") : oSub.HPlanBeginDate.ToString())}','{(oSub.HPlanEndDate == null ? DateTime.Now.AddDays(1).ToString("yyyy-MM-dd") : oSub.HPlanEndDate.ToString())}'
                 ,'{(oSub.HPlanBeginDate == null ? DateTime.Now.ToString("yyyy-MM-dd") : oSub.HPlanBeginDate.ToString())}','{(oSub.HPlanEndDate == null ? DateTime.Now.AddDays(1).ToString("yyyy-MM-dd") : oSub.HPlanEndDate.ToString())}'
                 ,{oSub.HMaterID},{oSub.HUnitID},'{oSub.HRemark}',{oSub.HSourceID},{oSub.HDeptID},4
 	                    ,0,0,'','',0,0
-                ,{oSub.HCOSTRATE},{oSub.HISBACKFLUSH},'{oSub.HBatchNo}',{oSub.HBomID},{oSub.HCHECKPRODUCT},{oSub.HSEQ})");
+                ,{oSub.HCOSTRATE},{oSub.HISBACKFLUSH},'{oSub.HBatchNo}',{oSub.HBomID},{oSub.HCHECKPRODUCT},{oSub.HSEQ},{oSub.HSTOCKINORGID})");
                 }
 
                 foreach (var _item in _mainList)
@@ -440,6 +442,8 @@
                 long HBomID = mainList[0].HBomID;//bom
                 //double? HPlanQty = mainList[0].HPlanQty == null ? 0 : mainList[0].HPlanQty;//璁″垝鏁伴噺
                 string HMaker = user;//鍒跺崟浜�
+                string HIsStockQty = mainList[0].HIsStockQty;
+                string HRemark3 = mainList[0].HRemark3;
 
                 ds = oCN.RunProcReturn("select * from h_v_IF_ICMOBillList where hmainid=" + HInterID + " and 鍗曟嵁鍙�='" + HBillNo + "'", "h_v_IF_ICMOBillList");
 
@@ -450,11 +454,13 @@
                         (HBillType,HBillStatus,HInterID,HBillNo,HDate,HPRDORGID
                         ,HYear,HPeriod,HRemark,HMaker,HMakeDate
                         ,HSeOrderBillNo,HSeOrderInterID,HSeOrderEntryID,HEmpID,HCusID
-                        ,HCenterID,HPlanQty,HDeptID,HMaterID,HUnitID,HBomID,HPlanBeginDate,HPlanEndDate)
+                        ,HCenterID,HPlanQty,HDeptID,HMaterID,HUnitID,HBomID,HPlanBeginDate,HPlanEndDate
+                        ,HIsStockQty,HRemark3)
                         values('3710',1," + HInterID + ",'" + HBillNo + "','" + HDate + "'," + HPRDORGID +
                     "," + DateTime.Now.Year + "," + DateTime.Now.Month + ",'" + HRemark + "','" + HMaker + "',getdate()" +
                     ",'" + HSeOrderBillNo + "'," + HSeOrderInterID + "," + HSeOrderEntryID + "," + HEmpID + "," + HCusID +
-                    "," + HCenterID + ",0,0,0,0," + HBomID + ",'','') ");
+                    "," + HCenterID + ",0,0,0,0," + HBomID + ",'',''" +
+                    ",'"+ HIsStockQty + "','"+ HRemark3 + "') ");
                 }
                 else if (OperationType == 3 || ds.Tables[0].Rows.Count != 0)
                 {
@@ -470,8 +476,8 @@
                     //淇敼
                     oCN.RunProc("update Sc_ICMOBillMain  set " +
                                 "HRemark='" + HRemark + "', HUpDater='" + HMaker + "', HUpDateDate=getdate()" +
-                                ", HSeOrderBillNo='" + HSeOrderBillNo + "', HSeOrderInterID=" + HSeOrderInterID + ", HSeOrderEntryID=" + HSeOrderEntryID + ", HEmpID=" + HEmpID + ", HCusID=" + HCusID + "" +
-                                ", HCenterID=" + HCenterID + ",HBomID=" + HBomID + " where HInterID=" + HInterID);
+                                ", HSeOrderBillNo='" + HSeOrderBillNo + "', HSeOrderInterID=" + HSeOrderInterID + ", HSeOrderEntryID=" + HSeOrderEntryID + ", HEmpID=" + HEmpID + ", HCusID=" + HCusID +
+                                ", HCenterID=" + HCenterID + ",HBomID=" + HBomID + ",HIsStockQty='"+ HIsStockQty + "',HRemark3='" + HRemark3 + "' where HInterID=" + HInterID);
 
                     //鍒犻櫎瀛愯〃
                     oCN.RunProc("delete from Sc_ICMOBillSub where HInterID='" + HInterID + "' and HEntryID='" + HEntryID + "'");
@@ -843,6 +849,24 @@
                     return objJsonResult; ;
                 }
 
+                string sReturn = "";
+                if (oSystemParameter.ShowBill(ref sReturn))
+                {
+                    if (oSystemParameter.omodel.Sc_ICMOBill_DeleterAndMakerMustSame == "Y")
+                    {
+                        if (ds.Tables[0].Rows[0]["HMaker"].ToString() != user && (user != "admin" && user != "Admin"))
+                        {
+                            objJsonResult.code = "0";
+                            objJsonResult.count = 0;
+                            objJsonResult.Message = "鍙兘鍒犻櫎鏈汉鐨勫崟鎹紒";
+                            objJsonResult.data = null;
+                            return objJsonResult;
+                        }
+                    }
+                }
+
+
+
                 if (int.Parse(ds.Tables[0].Rows[0]["HBillStatus"].ToString()) > 1)
                 {
                     objJsonResult.code = "0";
@@ -873,6 +897,204 @@
         }
         #endregion
 
+        #region 鐢熶骇浠诲姟鍗� 澶氳鎵归噺涓嬫帹
+        [Route("Sc_ICMOBill/Sc_ICMOReportBill_dh")]
+        [HttpGet]
+        public object Sc_ICMOReportBill_dh(string HInterID, string user, int OrganizationID)
+        {
+            try
+            {
+                //鑾峰彇鍗曟嵁ID
+                string[] HBillNo = HInterID.Split(',');
+                string Error = "";
+                int i = 0;
+                foreach (var item in HBillNo)
+                {
+                    string err = "";
+                    DAL.ClsSc_ProcessExchangeBill oBill = new DAL.ClsSc_ProcessExchangeBill();
+                    Model.ClsSc_ProcessExchangeBillMain lsmain = new Model.ClsSc_ProcessExchangeBillMain();
+                    List<Model.ClsSc_ProcessExchangeBillSub> ls = new List<Model.ClsSc_ProcessExchangeBillSub>();
+                    string HBillNOs = "";
+                    string hmainid = item.Split('|')[0];
+                    string HEntryID = item.Split('|')[1];
+
+                    ds = oCN.RunProcReturn("select * from h_v_IF_ICMOBillList where 1 = 1  and hmainid=" + hmainid + " and  HEntryID=" + HEntryID + " order by 鍗曟嵁鍙� desc", "h_v_IF_ICMOBillList");
+                    if (ds.Tables[0].Rows.Count == 0)
+                    {
+                        err = "鏃犳暟鎹�! \n";
+                    }
+                    else
+                    {
+                        string HNumber = ds.Tables[0].Rows[0]["浜у搧浠g爜"].ToString();
+                        HBillNOs = ds.Tables[0].Rows[0]["鍗曟嵁鍙�"].ToString();
+
+                        if (ds.Tables[0].Rows[0]["瀹℃牳浜�"].ToString() == "")
+                        {
+                            err = "鎵�閫夌敓浜ц鍗曚负鏈鏍哥姸鎬侊紝涓嶅厑璁镐笅鎺ㄧ敓鎴愬伐搴忔祦杞崱锛乗n";
+                        }
+
+                        if (ds.Tables[0].Rows[0]["鍏抽棴浜�"].ToString() != "")
+                        {
+                            err = "鎵�閫夌敓浜ц鍗曚负宸插叧闂姸鎬侊紝涓嶅厑璁镐笅鎺ㄧ敓鎴愬伐搴忔祦杞崱锛乗n";
+                        }
+
+                        if (ds.Tables[0].Rows[0]["浣滃簾浜�"].ToString() != "")
+                        {
+                            err = "鎵�閫夌敓浜ц鍗曚负宸蹭綔搴熺姸鎬侊紝涓嶅厑璁镐笅鎺ㄧ敓鎴愬伐搴忔祦杞崱锛乗n";
+                        }
+
+                        ds = oCN.RunProcReturn("select * from h_v_S_Sc_ICMOBillList where hmainid=" + hmainid + " and HEntryID=" + HEntryID + " and HSTOCKINORGID='" + OrganizationID + "'", "h_v_S_Sc_ICMOBillList");
+
+                        if (double.Parse(ds.Tables[0].Rows[0]["娴佽浆鍗℃暟閲�"].ToString()) == 0)
+                        {
+                            err = "鎵�閫夌敓浜ц鍗曞凡鍏ㄩ儴涓嬫帹鐢熸垚宸ュ簭娴佽浆鍗★紝鍓╀綑鍙笅鎺ㄦ暟閲忎负0锛屼笉鍏佽涓嬫帹鐢熸垚宸ュ簭娴佽浆鍗★紒\n";
+                        }
+                        lsmain.HMaker = user;  //鍒跺崟浜�
+                        lsmain.HBillType = "3772";
+                        lsmain.HBillSubType = "3772";
+                        lsmain.HDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd"));
+                        lsmain.HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year);
+                        lsmain.HPeriod = DBUtility.ClsPub.isLong(DateTime.Now.Month);
+                        lsmain.HICMOInterID = long.Parse(ds.Tables[0].Rows[0]["hmainid"].ToString());
+                        lsmain.HICMOBillNo = ds.Tables[0].Rows[0]["鐢熶骇璁㈠崟鍙�"].ToString();
+                        lsmain.HICMOEntryID = long.Parse(ds.Tables[0].Rows[0]["HEntryID"].ToString());
+                        lsmain.HOrderProcNO = ds.Tables[0].Rows[0]["璁㈠崟璺熻釜鍙�"].ToString();
+                        lsmain.HMaterID = long.Parse(ds.Tables[0].Rows[0]["hmaterid"].ToString());
+                        lsmain.HMaterID2 = long.Parse(ds.Tables[0].Rows[0]["hmaterid"].ToString());
+                        lsmain.HMaterNumber = ds.Tables[0].Rows[0]["鐗╂枡浠g爜"].ToString();
+                        lsmain.HMaterModel = ds.Tables[0].Rows[0]["瑙勬牸鍨嬪彿"].ToString();
+                        lsmain.HBatchNo = ds.Tables[0].Rows[0]["鎵瑰彿"].ToString();
+                        lsmain.HSplitNo =1;//閮芥槸1
+                        lsmain.HUnitID = long.Parse(ds.Tables[0].Rows[0]["hunitid"].ToString());
+                        lsmain.HUnitNumber = ds.Tables[0].Rows[0]["璁¢噺鍗曚綅浠g爜"].ToString();
+                        lsmain.HPlanQty = double.Parse(ds.Tables[0].Rows[0]["璁″垝鐢熶骇鏁伴噺"].ToString());
+                        lsmain.HQty = double.Parse(ds.Tables[0].Rows[0]["娴佽浆鍗℃暟閲�"].ToString());
+                        lsmain.HPlanBeginDate = DateTime.Parse(ds.Tables[0].Rows[0]["璁″垝寮�宸ユ棩鏈�"].ToString());
+                        lsmain.HPlanEndDate = DateTime.Parse(ds.Tables[0].Rows[0]["璁″垝瀹屽伐鏃ユ湡"].ToString());
+                        lsmain.HWorkShopID = long.Parse(ds.Tables[0].Rows[0]["hdeptid"].ToString());
+                        lsmain.HProdMaterCode = ds.Tables[0].Rows[0]["浜у搧CODE"].ToString();
+                        lsmain.HSeOrderBillNo = ds.Tables[0].Rows[0]["閿�鍞鍗曞彿"].ToString();
+                        lsmain.HCusShortName = ds.Tables[0].Rows[0]["瀹㈡埛绠�绉�"].ToString();
+                        lsmain.HCusNeedMaterial = ds.Tables[0].Rows[0]["瀹㈡埛瑕佹眰鏉愭枡鎴愬垎"].ToString();
+                        lsmain.HPlanSendGoodsDate = ds.Tables[0].Rows[0]["棰勮鍑鸿揣鏃ユ湡"].ToString()==""?DateTime.Now.ToString(): ds.Tables[0].Rows[0]["棰勮鍑鸿揣鏃ユ湡"].ToString();
+                        lsmain.HSellDate = DateTime.Now.ToString();
+                        lsmain.HPRDORGID = OrganizationID;
+                        lsmain.HProdMaterName = ds.Tables[0].Rows[0]["浜у搧鍚嶇О"].ToString();
+                        lsmain.HCusName = ds.Tables[0].Rows[0]["瀹㈡埛鍚嶇О"].ToString();
+                        lsmain.HWorkRemark = ds.Tables[0].Rows[0]["鐢熶骇澶囨敞"].ToString();
+                        lsmain.HImportNote = ds.Tables[0].Rows[0]["閲嶈鎻愮ず"].ToString();
+                        lsmain.HPicNumVer = ds.Tables[0].Rows[0]["鍥惧彿鐗堟湰"].ToString();
+                        lsmain.HPicNumAssemble = ds.Tables[0].Rows[0]["鎬昏鍥惧彿"].ToString();
+                        lsmain.HMaterTexture = ds.Tables[0].Rows[0]["鏉愯川"].ToString();
+                        lsmain.HProductNum = ds.Tables[0].Rows[0]["鎴愬搧缂栧彿"].ToString();
+                        lsmain.HVerNum = ds.Tables[0].Rows[0]["鐗堟湰"].ToString();
+                        //lsmain.HCusNumber = ds.Tables[0].Rows[0]["婧愬崟瀹㈡埛缂栫爜"].ToString();
+                        //lsmain.HPickLabel = ds.Tables[0].Rows[0]["鍖呰鏍囪瘑"].ToString();
+                        //lsmain.HPickLabelNumber = ds.Tables[0].Rows[0]["鍖呰鏍囪瘑缂栫爜"].ToString();
+                        //lsmain.HXTNumber = ds.Tables[0].Rows[0]["鑺綋鐗╂枡浠g爜"].ToString();
+                        //lsmain.HXTModel = ds.Tables[0].Rows[0]["鑺綋瑙勬牸鍨嬪彿"].ToString();
+                        lsmain.HWidth = double.Parse(ds.Tables[0].Rows[0]["HWidth"].ToString());
+                        lsmain.HWeight = double.Parse(ds.Tables[0].Rows[0]["HWeight"].ToString());
+                        lsmain.HAuxUnit = int.Parse(ds.Tables[0].Rows[0]["HAuxUnit"].ToString());
+                        lsmain.HRemark2 = ds.Tables[0].Rows[0]["澶囨敞"].ToString();
+                        lsmain.HEmpID = long.Parse(ds.Tables[0].Rows[0]["HEmpID"].ToString());
+                        lsmain.HCusID = long.Parse(ds.Tables[0].Rows[0]["HCusID"].ToString());
+                        lsmain.HColorRemark = ds.Tables[0].Rows[0]["鏌撹壊瑕佹眰"].ToString();
+                        lsmain.HBLFlag = ds.Tables[0].Rows[0]["HBLFlag"].ToString() == "0" ? false : true;
+                        lsmain.HAuxQty = 0;
+                        lsmain.HAuxUnit = 0;
+
+
+                        ds = oCN.RunProcReturn("select top 1000 * from h_v_Gy_RoutingBillList a left join Gy_Process p on a.hprocid = p.HItemID where 鐗╂枡浠g爜='" + HNumber + "' and 榛樿宸ヨ壓=1", "h_v_Gy_RoutingBillList");
+
+                        if (ds.Tables[0].Rows.Count == 0)
+                        {
+                            err = "鎵�閫夌敓浜ц鍗曞搴旂墿鏂欐湭璁剧疆瀵瑰簲鐨勫伐鑹鸿矾绾匡紝涓嶅厑璁镐笅鎺ㄧ敓鎴愬伐搴忔祦杞崱锛乗n";
+                        }
+                        else
+                        {
+                            lsmain.HRoutingBillID = ds.Tables[0].Rows[0]["hmainid"].ToString();
+                            oBill.omodel = lsmain;
+
+                            int j = 0;
+                            foreach (DataRow row in ds.Tables[0].Rows)
+                            {
+                                if (row["HTProcessFlag"].ToString() == "False")
+                                {
+                                    ClsSc_ProcessExchangeBillSub sub = new ClsSc_ProcessExchangeBillSub();
+                                    sub.HEntryID = j + 1;
+                                    sub.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now);
+                                    sub.HProcNo = long.Parse(row["宸ュ簭鍙�"].ToString());
+                                    sub.HProcID = long.Parse(row["HProcID"].ToString());
+                                    sub.HProcNumber = row["宸ュ簭浠g爜"].ToString();
+                                    sub.HWorkRemark = row["琛ㄤ綋澶囨敞"].ToString();
+                                    sub.HCenterID = long.Parse(row["HCenterID"].ToString());
+                                    sub.HSupID = long.Parse(row["HSupID"].ToString());
+                                    sub.HSupFlag = row["濮斿鏍囪"].ToString() == "False" ? false : true;
+                                    sub.HQty = lsmain.HQty;
+                                    sub.HTechnologyParameter = row["宸ヨ壓鍙傛暟"].ToString();
+                                    sub.HPicNum = row["鍥剧焊缂栧彿"].ToString();
+                                    sub.HProcCheckNote = row["鏈伐搴忕‘璁よ褰�"].ToString();
+                                    sub.HDeptID = 0;
+                                    sub.HDeptNumber = "";
+                                    sub.HOutPrice = 0;
+                                    sub.HRemark = "";
+                                    sub.HRelationQty_In =0;
+                                    sub.HRelationQty_Out = 0;
+                                    sub.HRelationQty_WWOrder = 0;
+                                    sub.HRelationQty_Bad = 0;
+                                    sub.HOverRate = 0;
+                                    sub.HMaxQty = 0;
+                                    sub.HPassRate = 0;
+                                    sub.HSumPassRate = 0;
+                                    j++;
+                                    oBill.DetailColl.Add(sub);
+                                }
+                            }
+                           
+                        }
+                    }
+
+                    bool bResult = false;
+                    if (err != "")
+                    {
+                        Error += "鐢熶骇璁㈠崟鍗曟嵁鍙�:" + HBillNOs + "\n" + err;
+                    }
+                    else
+                    {
+                        oBill.omodel.HBillNo = DBUtility.ClsPub.CreateBillCode("3772", ref DBUtility.ClsPub.sExeReturnInfo,true);
+                        bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
+                        oBill.DetailColl.Clear();
+
+                        if (!bResult)
+                        {
+                            Error += "淇濆瓨澶辫触,鐢熶骇璁㈠崟鍗曟嵁鍙�:" + HBillNOs + "\n" + err;
+                        }
+                        else
+                        {
+                            i++;
+                        }
+                    }
+                }
+                Error = "鎴愬姛:" + i + "琛�  !!!    " + Error;
+                objJsonResult.code = "1";
+                objJsonResult.count = 1;
+                objJsonResult.Message = Error;
+                objJsonResult.data = null;
+                return objJsonResult; ;
+
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "涓嬫帹澶辫触锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
+
         #region 鐢熶骇浠诲姟鍗曡幏鍙栬溅闂�
         [Route("Sc_ICMOBill/GetHDeptList")]
         [HttpGet]
@@ -900,6 +1122,33 @@
         }
         #endregion
 
+        #region 鐢熶骇浠诲姟鍗曡幏鍙栧伐浣滀腑蹇�
+        [Route("Sc_ICMOBill/GetHWorkCenterList")]
+        [HttpGet]
+        public object GetHWorkCenterList()
+        {
+            try
+            {
+                DataSet oDs = new DataSet();
+                //==========
+                oDs = oCN.RunProcReturn("select HItemID,HName from Gy_WorkCenter", "Gy_WorkCenter");
+                objJsonResult.code = "1";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "鑾峰彇鎴愬姛锛�";
+                objJsonResult.data = oDs.Tables[0];
+                return objJsonResult; ;
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "鍒犻櫎澶辫触锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
+
         #region 澧欏挃瑁呯鍗曞洖杞︿簨浠�
         [Route("Sc_ICMOBill/QK_PackingBillByXSBill")]
         [HttpGet]
diff --git a/WebAPI/Models/StationBill.cs b/WebAPI/Models/StationBill.cs
index 79db468..1e80503 100644
--- a/WebAPI/Models/StationBill.cs
+++ b/WebAPI/Models/StationBill.cs
@@ -73,5 +73,6 @@
         public string eventType { get; set; }
         public long HMainInterID { get; set; }
         public long HPRDOrgID { get; set; }
+        public double HmaterOutqty { get; set; }
     }
 }
\ No newline at end of file
diff --git a/WebAPI/Properties/PublishProfiles/FolderProfile.pubxml b/WebAPI/Properties/PublishProfiles/FolderProfile.pubxml
index 9250916..4e00e52 100644
--- a/WebAPI/Properties/PublishProfiles/FolderProfile.pubxml
+++ b/WebAPI/Properties/PublishProfiles/FolderProfile.pubxml
@@ -10,7 +10,7 @@
     <LastUsedBuildConfiguration>Debug</LastUsedBuildConfiguration>
     <LastUsedPlatform>x86</LastUsedPlatform>
     <PublishProvider>FileSystem</PublishProvider>
-    <PublishUrl>D:\缃戠珯鍙戝竷\鏅轰簯MESWMS\API</PublishUrl>
+    <PublishUrl>E:\缃戠珯鍙戝竷\API</PublishUrl>
     <WebPublishMethod>FileSystem</WebPublishMethod>
     <SiteUrlToLaunchAfterPublish />
   </PropertyGroup>
diff --git a/WebAPI/Properties/PublishProfiles/FolderProfile.pubxml.user b/WebAPI/Properties/PublishProfiles/FolderProfile.pubxml.user
index 60fe718..7d05d6b 100644
--- a/WebAPI/Properties/PublishProfiles/FolderProfile.pubxml.user
+++ b/WebAPI/Properties/PublishProfiles/FolderProfile.pubxml.user
@@ -9,13 +9,13 @@
   </PropertyGroup>
   <ItemGroup>
     <File Include="apiapp.json">
-      <publishTime>04/06/2023 15:57:02</publishTime>
+      <publishTime>08/19/2021 09:44:01</publishTime>
     </File>
     <File Include="bin/Antlr3.Runtime.dll">
-      <publishTime>02/22/2013 16:43:40</publishTime>
+      <publishTime>02/22/2013 08:43:40</publishTime>
     </File>
     <File Include="bin/Antlr3.Runtime.pdb">
-      <publishTime>02/22/2013 16:43:40</publishTime>
+      <publishTime>02/22/2013 08:43:40</publishTime>
     </File>
     <File Include="bin/BLL.dll">
       <publishTime>11/09/2022 16:02:08</publishTime>
@@ -28,7 +28,7 @@
       <publishTime>05/18/2023 22:34:20</publishTime>
     </File>
     <File Include="bin/BouncyCastle.Crypto.dll">
-      <publishTime>12/18/2020 05:32:28</publishTime>
+      <publishTime>12/17/2020 21:32:28</publishTime>
     </File>
     <File Include="bin/DAL.dll">
       <publishTime>11/09/2022 16:02:06</publishTime>
@@ -41,7 +41,7 @@
       <publishTime>05/18/2023 22:34:19</publishTime>
     </File>
     <File Include="bin/Dapper.dll">
-      <publishTime>07/22/2016 22:52:40</publishTime>
+      <publishTime>07/22/2016 14:52:40</publishTime>
     </File>
     <File Include="bin/DBUtility.dll">
       <publishTime>11/02/2022 22:02:56</publishTime>
@@ -54,34 +54,34 @@
       <publishTime>05/18/2023 22:34:16</publishTime>
     </File>
     <File Include="bin/Grpc.Core.Api.dll">
-      <publishTime>03/22/2022 13:17:26</publishTime>
+      <publishTime>03/22/2022 05:17:26</publishTime>
     </File>
     <File Include="bin/Grpc.Core.Api.pdb">
-      <publishTime>03/19/2022 07:39:42</publishTime>
+      <publishTime>03/18/2022 23:39:42</publishTime>
     </File>
     <File Include="bin/Grpc.Core.dll">
-      <publishTime>03/22/2022 13:17:20</publishTime>
+      <publishTime>03/22/2022 05:17:20</publishTime>
     </File>
     <File Include="bin/Grpc.Core.pdb">
-      <publishTime>03/19/2022 07:39:48</publishTime>
+      <publishTime>03/18/2022 23:39:48</publishTime>
     </File>
     <File Include="bin/grpc_csharp_ext.x64.dll">
-      <publishTime>03/22/2022 13:17:22</publishTime>
+      <publishTime>03/22/2022 05:17:22</publishTime>
     </File>
     <File Include="bin/grpc_csharp_ext.x86.dll">
-      <publishTime>03/22/2022 13:17:22</publishTime>
+      <publishTime>03/22/2022 05:17:22</publishTime>
     </File>
     <File Include="bin/ICSharpCode.SharpZipLib.dll">
-      <publishTime>05/09/2021 01:08:30</publishTime>
+      <publishTime>05/08/2021 17:08:30</publishTime>
     </File>
     <File Include="bin/ICSharpCode.SharpZipLib.pdb">
-      <publishTime>05/09/2021 01:08:30</publishTime>
+      <publishTime>05/08/2021 17:08:30</publishTime>
     </File>
     <File Include="bin/Interop.gregn6Lib.dll">
       <publishTime>08/25/2021 10:28:25</publishTime>
     </File>
     <File Include="bin/Kingdee.BOS.WebApi.Client.dll">
-      <publishTime>04/06/2023 15:57:02</publishTime>
+      <publishTime>02/09/2023 20:21:24</publishTime>
     </File>
     <File Include="bin/Kingdee.BOS.WebApi.FormService.dll">
       <publishTime>09/20/2018 19:23:20</publishTime>
@@ -90,19 +90,19 @@
       <publishTime>09/20/2018 19:28:34</publishTime>
     </File>
     <File Include="bin/libgrpc_csharp_ext.x64.dylib">
-      <publishTime>03/19/2022 07:38:44</publishTime>
+      <publishTime>03/18/2022 23:38:44</publishTime>
     </File>
     <File Include="bin/libgrpc_csharp_ext.x64.so">
-      <publishTime>03/19/2022 07:38:42</publishTime>
+      <publishTime>03/18/2022 23:38:42</publishTime>
     </File>
     <File Include="bin/Microsoft.Azure.AppService.ApiApps.Service.dll">
-      <publishTime>03/19/2015 01:02:50</publishTime>
+      <publishTime>03/18/2015 17:02:50</publishTime>
     </File>
     <File Include="bin/Microsoft.CSharp.dll">
       <publishTime>09/26/2012 03:16:08</publishTime>
     </File>
     <File Include="bin/Microsoft.Web.Infrastructure.dll">
-      <publishTime>07/25/2012 19:48:56</publishTime>
+      <publishTime>07/25/2012 11:48:56</publishTime>
     </File>
     <File Include="bin/Model.dll">
       <publishTime>11/09/2022 16:02:01</publishTime>
@@ -115,34 +115,34 @@
       <publishTime>05/18/2023 22:34:16</publishTime>
     </File>
     <File Include="bin/Models/ClsSc_MouldScrapOutBillMain.cs">
-      <publishTime>04/06/2023 15:57:02</publishTime>
+      <publishTime>08/19/2021 09:44:01</publishTime>
     </File>
     <File Include="bin/Newtonsoft.Json.dll">
-      <publishTime>08/04/2014 04:33:56</publishTime>
+      <publishTime>08/03/2014 20:33:56</publishTime>
     </File>
     <File Include="bin/NPOI.dll">
-      <publishTime>10/23/2021 09:07:54</publishTime>
+      <publishTime>10/23/2021 01:07:54</publishTime>
     </File>
     <File Include="bin/NPOI.OOXML.dll">
-      <publishTime>10/23/2021 09:07:56</publishTime>
+      <publishTime>10/23/2021 01:07:56</publishTime>
     </File>
     <File Include="bin/NPOI.OOXML.pdb">
-      <publishTime>10/23/2021 17:07:56</publishTime>
+      <publishTime>10/23/2021 09:07:56</publishTime>
     </File>
     <File Include="bin/NPOI.OpenXml4Net.dll">
-      <publishTime>10/23/2021 09:07:54</publishTime>
+      <publishTime>10/23/2021 01:07:54</publishTime>
     </File>
     <File Include="bin/NPOI.OpenXml4Net.pdb">
-      <publishTime>10/23/2021 17:07:54</publishTime>
-    </File>
-    <File Include="bin/NPOI.OpenXmlFormats.dll">
       <publishTime>10/23/2021 09:07:54</publishTime>
     </File>
+    <File Include="bin/NPOI.OpenXmlFormats.dll">
+      <publishTime>10/23/2021 01:07:54</publishTime>
+    </File>
     <File Include="bin/NPOI.OpenXmlFormats.pdb">
-      <publishTime>10/23/2021 17:07:54</publishTime>
+      <publishTime>10/23/2021 09:07:54</publishTime>
     </File>
     <File Include="bin/NPOI.pdb">
-      <publishTime>10/23/2021 17:07:54</publishTime>
+      <publishTime>10/23/2021 09:07:54</publishTime>
     </File>
     <File Include="bin/Pub_Class.dll">
       <publishTime>11/09/2022 16:01:56</publishTime>
@@ -165,7 +165,7 @@
       <publishTime>05/18/2023 22:34:15</publishTime>
     </File>
     <File Include="bin/RestSharp.dll">
-      <publishTime>08/31/2012 06:22:50</publishTime>
+      <publishTime>08/30/2012 22:22:50</publishTime>
     </File>
     <File Include="bin/SQLHelper.dll">
       <publishTime>05/18/2023 22:34:15</publishTime>
@@ -179,10 +179,10 @@
       <publishTime>05/09/2021 13:35:37</publishTime>
     </File>
     <File Include="bin/Swashbuckle.Core.dll">
-      <publishTime>02/16/2015 01:57:08</publishTime>
+      <publishTime>02/15/2015 17:57:08</publishTime>
     </File>
     <File Include="bin/System.Buffers.dll">
-      <publishTime>07/19/2017 18:01:28</publishTime>
+      <publishTime>07/19/2017 10:01:28</publishTime>
     </File>
     <File Include="bin/System.ComponentModel.DataAnnotations.dll">
       <publishTime>09/26/2012 03:16:08</publishTime>
@@ -206,19 +206,19 @@
       <publishTime>09/26/2012 03:16:08</publishTime>
     </File>
     <File Include="bin/System.IdentityModel.Tokens.Jwt.dll">
-      <publishTime>08/19/2014 18:03:34</publishTime>
+      <publishTime>08/19/2014 10:03:34</publishTime>
     </File>
     <File Include="bin/System.Memory.dll">
-      <publishTime>04/18/2019 00:24:34</publishTime>
+      <publishTime>04/17/2019 16:24:34</publishTime>
     </File>
     <File Include="bin/System.Net.Http.dll">
       <publishTime>09/26/2012 03:16:08</publishTime>
     </File>
     <File Include="bin/System.Net.Http.Formatting.dll">
-      <publishTime>11/28/2018 21:00:36</publishTime>
+      <publishTime>11/28/2018 13:00:36</publishTime>
     </File>
     <File Include="bin/System.Runtime.CompilerServices.Unsafe.dll">
-      <publishTime>09/19/2018 03:38:10</publishTime>
+      <publishTime>09/18/2018 19:38:10</publishTime>
     </File>
     <File Include="bin/System.Runtime.Serialization.dll">
       <publishTime>09/26/2012 03:16:08</publishTime>
@@ -227,7 +227,7 @@
       <publishTime>09/26/2012 03:16:08</publishTime>
     </File>
     <File Include="bin/System.Web.Cors.dll">
-      <publishTime>11/28/2018 20:58:44</publishTime>
+      <publishTime>11/28/2018 12:58:44</publishTime>
     </File>
     <File Include="bin/System.Web.dll">
       <publishTime>09/26/2012 03:16:08</publishTime>
@@ -242,37 +242,37 @@
       <publishTime>09/26/2012 03:16:08</publishTime>
     </File>
     <File Include="bin/System.Web.Helpers.dll">
-      <publishTime>01/28/2015 12:04:30</publishTime>
+      <publishTime>01/28/2015 04:04:30</publishTime>
     </File>
     <File Include="bin/System.Web.Http.Cors.dll">
-      <publishTime>11/28/2018 21:01:26</publishTime>
+      <publishTime>11/28/2018 13:01:26</publishTime>
     </File>
     <File Include="bin/System.Web.Http.dll">
-      <publishTime>11/28/2018 21:01:00</publishTime>
+      <publishTime>11/28/2018 13:01:00</publishTime>
     </File>
     <File Include="bin/System.Web.Http.WebHost.dll">
-      <publishTime>04/06/2023 15:57:02</publishTime>
+      <publishTime>08/19/2021 09:44:01</publishTime>
     </File>
     <File Include="bin/System.Web.Mvc.dll">
-      <publishTime>01/28/2015 12:02:18</publishTime>
+      <publishTime>01/28/2015 04:02:18</publishTime>
     </File>
     <File Include="bin/System.Web.Optimization.dll">
-      <publishTime>02/11/2014 23:26:04</publishTime>
+      <publishTime>02/11/2014 15:26:04</publishTime>
     </File>
     <File Include="bin/System.Web.Razor.dll">
-      <publishTime>01/28/2015 12:02:32</publishTime>
+      <publishTime>01/28/2015 04:02:32</publishTime>
     </File>
     <File Include="bin/System.Web.Services.dll">
       <publishTime>09/26/2012 03:16:08</publishTime>
     </File>
     <File Include="bin/System.Web.WebPages.Deployment.dll">
-      <publishTime>01/28/2015 12:04:30</publishTime>
+      <publishTime>01/28/2015 04:04:30</publishTime>
     </File>
     <File Include="bin/System.Web.WebPages.dll">
-      <publishTime>01/28/2015 12:04:30</publishTime>
+      <publishTime>01/28/2015 04:04:30</publishTime>
     </File>
     <File Include="bin/System.Web.WebPages.Razor.dll">
-      <publishTime>01/28/2015 12:04:30</publishTime>
+      <publishTime>01/28/2015 04:04:30</publishTime>
     </File>
     <File Include="bin/System.Xml.dll">
       <publishTime>09/26/2012 03:16:08</publishTime>
@@ -281,7 +281,7 @@
       <publishTime>09/26/2012 03:16:08</publishTime>
     </File>
     <File Include="bin/WebActivatorEx.dll">
-      <publishTime>11/24/2014 19:18:48</publishTime>
+      <publishTime>11/24/2014 11:18:48</publishTime>
     </File>
     <File Include="bin/WebAPI.dll">
       <publishTime>11/14/2022 11:23:59</publishTime>
@@ -297,130 +297,130 @@
       <publishTime>05/18/2023 22:34:24</publishTime>
     </File>
     <File Include="bin/WebGrease.dll">
-      <publishTime>07/18/2013 01:03:52</publishTime>
+      <publishTime>07/17/2013 17:03:52</publishTime>
     </File>
     <File Include="bin/zh-Hans/System.Net.Http.Formatting.resources.dll">
-      <publishTime>11/29/2018 21:26:02</publishTime>
+      <publishTime>11/29/2018 13:26:02</publishTime>
     </File>
     <File Include="bin/zh-Hans/System.Web.Http.resources.dll">
-      <publishTime>11/29/2018 21:26:30</publishTime>
+      <publishTime>11/29/2018 13:26:30</publishTime>
     </File>
     <File Include="Config/kdapi.config">
-      <publishTime>04/06/2023 15:57:01</publishTime>
+      <publishTime>08/19/2022 08:17:39</publishTime>
     </File>
     <File Include="Content/bootstrap.css">
-      <publishTime>04/06/2023 15:57:01</publishTime>
+      <publishTime>08/19/2021 09:44:01</publishTime>
     </File>
     <File Include="Content/bootstrap.min.css">
-      <publishTime>04/06/2023 15:57:01</publishTime>
+      <publishTime>08/19/2021 09:44:01</publishTime>
     </File>
     <File Include="Content/Site.css">
-      <publishTime>04/06/2023 15:57:01</publishTime>
+      <publishTime>08/19/2021 09:44:01</publishTime>
     </File>
     <File Include="DLL/BLL.dll">
-      <publishTime>04/06/2023 15:57:02</publishTime>
+      <publishTime>08/19/2021 09:44:01</publishTime>
     </File>
     <File Include="DLL/DAL.dll">
-      <publishTime>04/06/2023 15:57:02</publishTime>
+      <publishTime>11/01/2021 09:26:33</publishTime>
     </File>
     <File Include="DLL/DBUtility.dll">
-      <publishTime>04/06/2023 15:57:02</publishTime>
+      <publishTime>08/19/2021 09:44:01</publishTime>
     </File>
     <File Include="DLL/Kingdee.BOS.WebApi.Client.dll">
-      <publishTime>04/06/2023 15:57:02</publishTime>
+      <publishTime>02/09/2023 20:21:24</publishTime>
     </File>
     <File Include="DLL/Model.dll">
-      <publishTime>04/06/2023 15:57:02</publishTime>
+      <publishTime>08/19/2021 09:44:01</publishTime>
     </File>
     <File Include="DLL/Newtonsoft.Json.Net35.dll">
-      <publishTime>04/06/2023 15:57:02</publishTime>
+      <publishTime>08/19/2021 09:44:01</publishTime>
     </File>
     <File Include="DLL/Pub_Class.dll">
-      <publishTime>04/06/2023 15:57:02</publishTime>
+      <publishTime>08/19/2021 09:44:01</publishTime>
     </File>
     <File Include="DLL/Pub_Control.dll">
-      <publishTime>04/06/2023 15:57:02</publishTime>
+      <publishTime>08/19/2021 09:44:01</publishTime>
     </File>
     <File Include="DLL/SQLHelper.dll">
-      <publishTime>04/06/2023 15:57:02</publishTime>
+      <publishTime>08/19/2021 09:44:01</publishTime>
     </File>
     <File Include="fonts/glyphicons-halflings-regular.eot">
-      <publishTime>04/06/2023 15:57:02</publishTime>
+      <publishTime>08/19/2021 09:44:01</publishTime>
     </File>
     <File Include="fonts/glyphicons-halflings-regular.svg">
-      <publishTime>04/06/2023 15:57:02</publishTime>
+      <publishTime>08/19/2021 09:44:01</publishTime>
     </File>
     <File Include="fonts/glyphicons-halflings-regular.ttf">
-      <publishTime>04/06/2023 15:57:02</publishTime>
+      <publishTime>08/19/2021 09:44:01</publishTime>
     </File>
     <File Include="fonts/glyphicons-halflings-regular.woff">
-      <publishTime>04/06/2023 15:57:02</publishTime>
+      <publishTime>08/19/2021 09:44:01</publishTime>
     </File>
     <File Include="Global.asax">
-      <publishTime>04/06/2023 15:57:02</publishTime>
+      <publishTime>08/19/2021 09:44:01</publishTime>
     </File>
     <File Include="grpc_csharp_ext.x64.dll">
-      <publishTime>03/22/2022 13:17:22</publishTime>
+      <publishTime>03/22/2022 05:17:22</publishTime>
     </File>
     <File Include="grpc_csharp_ext.x86.dll">
-      <publishTime>03/22/2022 13:17:22</publishTime>
+      <publishTime>03/22/2022 05:17:22</publishTime>
     </File>
     <File Include="Index.html">
-      <publishTime>04/06/2023 15:57:02</publishTime>
+      <publishTime>08/19/2021 09:44:01</publishTime>
     </File>
     <File Include="libgrpc_csharp_ext.x64.dylib">
-      <publishTime>03/19/2022 07:38:44</publishTime>
+      <publishTime>03/18/2022 23:38:44</publishTime>
     </File>
     <File Include="libgrpc_csharp_ext.x64.so">
-      <publishTime>03/19/2022 07:38:42</publishTime>
+      <publishTime>03/18/2022 23:38:42</publishTime>
     </File>
     <File Include="Metadata/deploymentTemplates/apiappconfig.azureresource.json">
-      <publishTime>04/06/2023 15:57:02</publishTime>
+      <publishTime>08/19/2021 09:44:01</publishTime>
     </File>
     <File Include="packages.config">
-      <publishTime>04/06/2023 15:57:02</publishTime>
+      <publishTime>11/29/2022 10:36:46</publishTime>
     </File>
     <File Include="Views/Scripts/bootstrap.js">
-      <publishTime>04/06/2023 15:57:02</publishTime>
+      <publishTime>08/19/2021 09:44:01</publishTime>
     </File>
     <File Include="Views/Scripts/bootstrap.min.js">
-      <publishTime>04/06/2023 15:57:02</publishTime>
+      <publishTime>08/19/2021 09:44:01</publishTime>
     </File>
     <File Include="Views/Scripts/jquery-1.10.2.js">
-      <publishTime>04/06/2023 15:57:02</publishTime>
+      <publishTime>08/19/2021 09:44:01</publishTime>
     </File>
     <File Include="Views/Scripts/jquery-1.10.2.min.js">
-      <publishTime>04/06/2023 15:57:02</publishTime>
+      <publishTime>08/19/2021 09:44:01</publishTime>
     </File>
     <File Include="Views/Scripts/jquery-1.10.2.min.map">
-      <publishTime>04/06/2023 15:57:02</publishTime>
+      <publishTime>08/19/2021 09:44:01</publishTime>
     </File>
     <File Include="Views/Scripts/jquery.validate.js">
-      <publishTime>04/06/2023 15:57:02</publishTime>
+      <publishTime>08/19/2021 09:44:01</publishTime>
     </File>
     <File Include="Views/Scripts/jquery.validate.min.js">
-      <publishTime>04/06/2023 15:57:02</publishTime>
+      <publishTime>08/19/2021 09:44:01</publishTime>
     </File>
     <File Include="Views/Scripts/jquery.validate.unobtrusive.js">
-      <publishTime>04/06/2023 15:57:02</publishTime>
+      <publishTime>08/19/2021 09:44:01</publishTime>
     </File>
     <File Include="Views/Scripts/jquery.validate.unobtrusive.min.js">
-      <publishTime>04/06/2023 15:57:02</publishTime>
+      <publishTime>08/19/2021 09:44:01</publishTime>
     </File>
     <File Include="Views/Scripts/modernizr-2.6.2.js">
-      <publishTime>04/06/2023 15:57:02</publishTime>
+      <publishTime>08/19/2021 09:44:01</publishTime>
     </File>
     <File Include="Views/Shared/Error.cshtml">
-      <publishTime>04/06/2023 15:57:02</publishTime>
+      <publishTime>08/19/2021 09:44:01</publishTime>
     </File>
     <File Include="Views/Shared/_Layout.cshtml">
-      <publishTime>04/06/2023 15:57:02</publishTime>
+      <publishTime>08/19/2021 09:44:01</publishTime>
     </File>
     <File Include="Views/web.config">
-      <publishTime>04/06/2023 15:57:02</publishTime>
+      <publishTime>08/19/2021 09:44:01</publishTime>
     </File>
     <File Include="Views/_ViewStart.cshtml">
-      <publishTime>04/06/2023 15:57:02</publishTime>
+      <publishTime>08/19/2021 09:44:01</publishTime>
     </File>
     <File Include="Web References/WebS/ClsCLD_Customer_Model.datasource">
       <publishTime>04/06/2023 15:57:02</publishTime>
diff --git a/WebAPI/Web.config b/WebAPI/Web.config
index 42e1be6..20977ae 100644
--- a/WebAPI/Web.config
+++ b/WebAPI/Web.config
@@ -28,7 +28,7 @@
 		<!--<add key="sUrl" value="http://10.10.130.181/WEBS-WMS/WebService1.asmx"/>    鍗氭棩绉戞妧-->
 		<!--<add key="sUrl" value="http://192.168.0.214/WEBS-WMS/WebService1.asmx"/>    鐟炰笌绁�-->
 		<!--<add key="sUrl" value="http://60.191.27.141:8090/WEBS-WMS/WebService1.asmx"/>    妫シ-->
-		<add key="sUrl" value="http://47.96.97.237/WEBS-WMS/WebService1.asmx"/>  
+		<!--<add key="sUrl" value="http://47.96.97.237/WEBS-WMS/WebService1.asmx"/>     -->
 		<!--<add key="sUrl" value="http://192.168.80.90:9090/WEBS/WebService1.asmx"/>     瀹夌憺鏈嶅姟鍣�-->
 		<!--<add key="sUrl" value="http://122.227.133.186:8090/WEBS/WebService1.asmx"/>	-->
 		<!--<add key="sUrl" value="http://192.168.80.90:9090/WEBS-WMS/WebService1.asmx"/>     瀹夌憺鏈嶅姟鍣�-->
@@ -100,7 +100,7 @@
 			</basicHttpBinding>
 		</bindings>
 		<client>
-			<endpoint address="http://47.96.97.237/WEBS-WMS/WebService1.asmx" binding="basicHttpBinding"
+			<endpoint address="http://192.168.63.3/WEBS-WMS/WebService1.asmx" binding="basicHttpBinding"
 			  bindingConfiguration="WebService1Soap" contract="Webs1.WebService1Soap"
 			  name="WebService1Soap" />
 		</client>
@@ -108,11 +108,8 @@
 
 	<applicationSettings>
 		<WebAPI.Properties.Settings>
-			<setting name="WebAPI_WebS2_WebService1" serializeAs="String">
-				<value>http://47.96.97.237/WEBS-WMS/WebService1.asmx</value>
-			</setting>
 			<setting name="WebAPI_WebS_WebService1" serializeAs="String">
-				<value>http://47.96.97.237/WEBS-WMS/WebService1.asmx</value>
+				<value>http://192.168.63.3/WEBS-WMS/WebService1.asmx</value>
 			</setting>
 		</WebAPI.Properties.Settings>
 	</applicationSettings>
diff --git a/WebAPI/WebAPI.csproj.user b/WebAPI/WebAPI.csproj.user
index 6a6fc2c..e951c6c 100644
--- a/WebAPI/WebAPI.csproj.user
+++ b/WebAPI/WebAPI.csproj.user
@@ -9,7 +9,7 @@
     <WebStackScaffolding_IsAsyncSelected>False</WebStackScaffolding_IsAsyncSelected>
     <NameOfLastUsedPublishProfile>FolderProfile</NameOfLastUsedPublishProfile>
     <NameOfLastUsedPublishProfile>D:\Git\houduan\WebAPI\Properties\PublishProfiles\FolderProfile.pubxml</NameOfLastUsedPublishProfile>
-    <NameOfLastUsedPublishProfile>D:\缃戠珯鍙戝竷\鍚庣浠g爜\MES-WEB-API\MES-WEB-API\WebAPI\Properties\PublishProfiles\FolderProfile.pubxml</NameOfLastUsedPublishProfile>
+    <NameOfLastUsedPublishProfile>D:\GIT浠撳簱\MES-WEB-API\WebAPI\Properties\PublishProfiles\FolderProfile.pubxml</NameOfLastUsedPublishProfile>
     <LastActiveSolutionConfig>Debug|Any CPU</LastActiveSolutionConfig>
     <UseIISExpress>false</UseIISExpress>
     <Use64BitIISExpress />

--
Gitblit v1.9.1