From fcc6bf3f4e0d50b0c7a6e66c8c4abe672d8be495 Mon Sep 17 00:00:00 2001
From: jingh <jingh@LAPTOP-I53VDLOO>
Date: 星期一, 13 九月 2021 15:07:19 +0800
Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API

---
 WebAPI/Properties/PublishProfiles/FolderProfile.pubxml.user     |  148 
 WebAPI/WebAPI.csproj.user                                       |    2 
 Model/Model.csproj                                              |    2 
 WebAPI/Controllers/SBGL/Sb_EquipDotCheckBillController.cs       |    6 
 WebAPI/Controllers/生产管理/质量汇报单/Sc_QualityReportBillController.cs |   89 +
 WebAPI/Controllers/BaseSet/Gy_EmployeeController.cs             |  837 ++++++++--
 WebAPI/Controllers/EntrustOutController.cs                      |  100 +
 WebAPI/Controllers/SBGL/Sb_EquipMaintainPlanBillController.cs   |  136 +
 Model/车间管理/ClsSc_MaterToSourceBillMain.cs                       |    8 
 WebAPI/Controllers/CJGL/Cj_StationEntrustInBillController.cs    |  410 ++++
 WebAPI/Controllers/SCGL/Sc_MaterToSourceBillController.cs       |  667 ++++++++
 Model/生产管理/设备管理/ClsSc_EquipMaintainPlanBillSub_Item.cs          |   16 
 WebAPI/Controllers/BaseSet/Gy_WorkCenterController.cs           |  202 ++
 DAL/生产管理/设备管理/ClsSb_EquipDotCheckBill.cs                        |   10 
 DAL/生产管理/设备管理/ClsSb_EquipMaintainPlanBill.cs                    |   71 
 Pub_Class/CustomerCls/ClsXt_SystemParameter.cs                  |    7 
 WebAPI/Controllers/SBGL/Sb_EquipDotCheckPlanBillController.cs   |    6 
 WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs          |  414 +++++
 WebAPI/Controllers/BaseSet/Gy_GroupController.cs                |  195 ++
 WebAPI/Models/基础资料/Gy_Employee.cs                               |  108 +
 Pub_Class/CustomerCls/ClsXt_SystemParameterMain.cs              |    2 
 Model/车间管理/ClsSc_MaterToSourceBillSub_Item.cs                   |   20 
 WebAPI/Controllers/CJGL/Cj_StationInBillController.cs           |   44 
 WebAPI/Controllers/PublicPageMethodController.cs                |    2 
 WebAPI/Controllers/BaseSet/Xt_ORGANIZATIONSController.cs        |  247 +++
 WebAPI/Controllers/BaseSet/Gy_ProcessController.cs              |  355 +++
 WebAPI/Models/Gy_Group.cs                                       |    4 
 WebAPI/ListModels.cs                                            |   37 
 WebAPI/Models/Gy_WorkCenter.cs                                  |    6 
 WebAPI/DLL/ClsSc_ICMOBillWorkQtyStatus_Tmp.cs                   |    3 
 WorkM/流转卡管理/Sc_ProcessExchangeBill_CF.cs                        |   11 
 WebAPI/Controllers/SCGL/QC_LastPieceCheckBillController.cs      |    6 
 WebAPI/Controllers/Sc_CheckToolsRepairWorkBillController.cs     |   11 
 DAL/DAL.csproj                                                  |    1 
 OAM/OAM.csproj.user                                             |    1 
 WebAPI/Models/Xt_ORGANIZATIONS.cs                               |   23 
 WebAPI/WebAPI.csproj                                            |    2 
 DAL/MES/ClsSc_MESMaterToSourceBill .cs                          |  389 +++++
 WebAPI/Controllers/品质管理/工序检验单/QC_ProcessCheckBillController.cs  |    6 
 39 files changed, 4,030 insertions(+), 574 deletions(-)

diff --git a/DAL/DAL.csproj b/DAL/DAL.csproj
index 016a791..4269c89 100644
--- a/DAL/DAL.csproj
+++ b/DAL/DAL.csproj
@@ -75,6 +75,7 @@
   </ItemGroup>
   <ItemGroup>
     <Compile Include="APS\ClsSc_WorkBillMonthSortBill.cs" />
+    <Compile Include="MES\ClsSc_MESMaterToSourceBill .cs" />
     <Compile Include="鍩虹璧勬枡\InterFace鍩虹璧勬枡\ClsIF_ORGANIZATIONS_View.cs" />
     <Compile Include="鍩虹璧勬枡\鍏朵粬鍩虹璧勬枡\ClsGy_QCCheckProject_View.cs" />
     <Compile Include="婧愬崟\InterFace婧愬崟\Cls_S_IF_ICMOBillList.cs" />
diff --git a/DAL/MES/ClsSc_MESMaterToSourceBill .cs b/DAL/MES/ClsSc_MESMaterToSourceBill .cs
new file mode 100644
index 0000000..d13ee07
--- /dev/null
+++ b/DAL/MES/ClsSc_MESMaterToSourceBill .cs
@@ -0,0 +1,389 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Text;
+using System.Data;
+
+namespace DAL
+{
+    public  class ClsSc_MESMaterToSourceBill: DBUtility.ClsXt_BaseBill
+    {
+        public Model.ClsSc_MaterToSourceBillMain omodel = new Model.ClsSc_MaterToSourceBillMain();
+        public List<Model.ClsSc_MaterToSourceBillSub> DetailColl = new List<Model.ClsSc_MaterToSourceBillSub>();
+        public List<Model.ClsSc_MaterToSourceBillSub_Item> DetailColl1 = new List<Model.ClsSc_MaterToSourceBillSub_Item>();
+        public ClsSc_MESMaterToSourceBill()
+        {
+            base.MvarItemKeySub = "Sc_MaterToSourceBillSub";
+            base.MvarItemKeySub2 = "";
+            base.MvarItemKeySub3 = "";
+            base.MvarItemKeySub4 = "";
+            base.MvarItemKey= "Sc_MaterToSourceBillMain";
+            base.MvarReportTitle="涓婃枡闃查敊鍗�";
+            base.BillType= "3786";
+            base.HBillSubType = "3786";
+
+        }
+
+        #region 鍥哄畾浠g爜
+
+        ~ClsSc_MESMaterToSourceBill()
+        {
+            DetailColl = null;
+        }
+       
+        #endregion   鑷畾涔夋柟娉�
+        //淇敼鍗曟嵁
+        public override bool ModifyBill(Int64 lngBillKey, ref string sReturn)
+        {
+            try
+            {
+                //
+                oCn.BeginTran();
+                //鏇存柊涓昏〃
+                oCn.RunProc("UpDate Sc_MaterToSourceBillMain set  " +
+                //鍥哄畾璧嬪��===============
+                " HBillNo='" + omodel.HBillNo + "'" +
+                ",HDate='" + omodel.HDate + "'" +
+                ",HYear='" + omodel.HYear.ToString() + "'" +
+                ",HPeriod='" + omodel.HPeriod.ToString() + "'" +
+                ",HRemark='" + omodel.HRemark + "'" +
+                ",HUpDater='" + DBUtility.ClsPub.CurUserName + "'" +
+                ",HUpDateDate=getdate()" +
+                //========================================
+                ",HProcExchInterID=" + omodel.HProcExchInterID.ToString() +
+                ",HProcExchEntryID=" + omodel.HProcExchEntryID.ToString() +
+                ",HProcExchBillNo='" + omodel.HProcExchBillNo + "'" +
+                ",HICMOInterID=" + omodel.HICMOInterID.ToString() +
+                ",HICMOEntryID=" + omodel.HICMOEntryID.ToString() +
+                ",HICMOBillNo='" + omodel.HICMOBillNo + "'" +
+                ",HMainSourceBillType=" + omodel.HMainSourceBillType.ToString() +
+                ",HMainSourceInterID=" + omodel.HMainSourceInterID.ToString() +
+                ",HMainSourceEntryID=" + omodel.HMainSourceEntryID.ToString() +
+                ",HMainSourceBillNo='" + omodel.HMainSourceBillNo.ToString() +"'"+
+                ",HSourceID=" + omodel.HSourceID.ToString() +
+                ",HProcID=" + omodel.HProcID.ToString() +
+                ",HMaterID=" + omodel.HMaterID.ToString() +
+                ",HSourceBarCode='" + omodel.HSourceBarCode + "'" +
+                ",HEquipID=" + omodel.HEquipID.ToString() +
+                ",HWorkerID=" + omodel.HWorkerID.ToString() +
+                ",HWorkerBarCode='" + omodel.HWorkerBarCode + "'" +
+                ",HGroupID=" + omodel.HGroupID.ToString() +
+                " where HInterID=" + lngBillKey.ToString());
+                //鍒犻櫎鍏宠仈
+                DeleteRelation(ref sReturn, lngBillKey);
+                //鍒犻櫎瀛愯〃
+                DeleteBillSub(lngBillKey);
+                //鎻掑叆瀛愯〃
+                omodel.HInterID = lngBillKey;
+                foreach (Model.ClsSc_MaterToSourceBillSub oSub in DetailColl)
+                {
+                    oCn.RunProc("Insert into Sc_MaterToSourceBillSub " +
+                      " (HInterID,HEntryID,HCloseMan,HEntryCloseDate,HCloseType,HRemark" +
+                      ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" +
+                      ",HMaterID,HUnitID,HQty,HPieceQty,HScanDate" +
+                      ",HBarCode,HBarCode_Pack,HBillNo_bak" +
+                      ") values("
+                      + omodel.HInterID.ToString() + "," + oSub.HEntryID.ToString() + ",'" + oSub.HCloseMan + "','" + oSub.HEntryCloseDate.ToShortDateString() + "'," + Convert.ToString(oSub.HCloseType ? 1 : 0) + ",'" + oSub.HRemark + "'" +
+                      "," + oSub.HSourceInterID.ToString() + "," + oSub.HSourceEntryID.ToString() + ",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "'," + oSub.HRelationQty.ToString() + "," + oSub.HRelationMoney.ToString() +
+                      "," + oSub.HMaterID.ToString() + "," + oSub.HUnitID.ToString() + "," + oSub.HQty.ToString() + "," + oSub.HPieceQty.ToString() + ",'" + oSub.HScanDate.ToShortDateString() + "'" +
+                      ",'" + oSub.HBarCode + "','" + oSub.HBarCode_Pack + "','" + oSub.HBillNo_bak + "'" +
+                      ") ");
+                }
+                sReturn = omodel.HInterID.ToString();
+                oCn.Commit();
+                return true;
+            }
+            catch (Exception e)
+            {
+                sReturn = e.Message;
+                oCn.RollBack();
+                throw (e);
+            }
+        }
+        //鏂板鍗曟嵁
+        public override bool AddBill(ref string sReturn)
+        {
+            try
+            {
+                //寰楀埌mainid
+                omodel.HInterID = DBUtility.ClsPub.CreateBillID(BillType, ref DBUtility.ClsPub.sExeReturnInfo);
+                //鑻AINDI閲嶅鍒欓噸鏂拌幏鍙�
+                oCn.BeginTran();
+                //涓昏〃
+                oCn.RunProc("Insert Into Sc_MaterToSourceBillMain   " +
+                "(HBillType,HBillSubType,HInterID,HBillNo,HDate" +
+                ",HYear,HPeriod,HRemark,HMaker,HMakeDate" +
+                ",HProcExchInterID,HProcExchEntryID,HProcExchBillNo,HICMOInterID,HICMOEntryID,HICMOBillNo" +
+                ",HMainSourceBillType,HMainSourceInterID,HMainSourceEntryID,HMainSourceBillNo" +
+                ",HSourceID,HProcID,HMaterID,HSourceBarCode,HEquipID,HWorkerID,HWorkerBarCode" +
+                ",HGroupID" +
+                ") " +
+                " values('" + this.BillType + "','" + this.HBillSubType + "'," + omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "','" + omodel.HDate + "'" +
+                ", " + omodel.HYear.ToString() + "," + omodel.HPeriod.ToString() + ",'" + omodel.HRemark + "','" + DBUtility.ClsPub.CurUserName + "',getdate()" +
+                "," + omodel.HProcExchInterID.ToString() + "," + omodel.HProcExchEntryID.ToString() + ",'" + omodel.HProcExchBillNo + "'," + omodel.HICMOInterID.ToString() + ","+ omodel.HICMOEntryID.ToString() + ",'" + omodel.HICMOBillNo + "'" +
+                "," + omodel.HMainSourceBillType.ToString() + "," + omodel.HMainSourceInterID.ToString() + "," + omodel.HMainSourceEntryID.ToString() + ",'" + omodel.HMainSourceBillNo + "'" +
+                "," + omodel.HSourceID.ToString() + "," + omodel.HProcID.ToString() + "," + omodel.HMaterID.ToString() + ",'" + omodel.HSourceBarCode + "'," + omodel.HEquipID.ToString() + "," + omodel.HWorkerID.ToString() + ",'" + omodel.HWorkerBarCode + "'" +
+                "," + omodel.HGroupID.ToString() +
+                ") ");
+                //鎻掑叆瀛愯〃
+                foreach (Model.ClsSc_MaterToSourceBillSub oSub in DetailColl)
+                {
+                    oCn.RunProc("Insert into Sc_MaterToSourceBillSub " +
+                      " (HInterID,HEntryID,HCloseMan,HEntryCloseDate,HCloseType,HRemark" +
+                      ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" +
+                      ",HMaterID,HUnitID,HQty,HPieceQty,HScanDate" +
+                      ",HBarCode,HBarCode_Pack,HBillNo_bak" +
+                      ") values("
+                      + omodel.HInterID.ToString() + "," + oSub.HEntryID.ToString() + ",'" + oSub.HCloseMan + "','" + oSub.HEntryCloseDate.ToShortDateString() + "'," + Convert.ToString(oSub.HCloseType ? 1 : 0) + ",'" + oSub.HRemark + "'" +
+                      "," + oSub.HSourceInterID.ToString() + "," + oSub.HSourceEntryID.ToString() + ",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "'," + oSub.HRelationQty.ToString() + "," + oSub.HRelationMoney.ToString() +
+                      "," + oSub.HMaterID.ToString() + "," + oSub.HUnitID.ToString() + "," + oSub.HQty.ToString() + "," + oSub.HPieceQty.ToString() + ",'" + oSub.HScanDate.ToShortDateString() + "'" +
+                      ",'" + oSub.HBarCode + "','" + oSub.HBarCode_Pack + "','" + oSub.HBillNo_bak + "'" +
+                      ") ");
+                }
+                //鍐嶆楠岃瘉 淇濆瓨鏄惁 鍚堢悊
+                DataSet ds = oCn.RunProcReturn("exec h_p_Sc_MaterToSourceBill_SaveCtrl @HInterId=" + omodel.HInterID + "", "h_p_Sc_MaterToSourceBill_SaveCtrl");
+                if (ds == null || ds.Tables[0].Rows.Count <= 0)
+                {
+                    sReturn = "鏃犻獙璇佹暟鎹紒";
+                    oCn.RollBack();
+                    return false;
+                }
+                if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) == "2")
+                {
+                    sReturn = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
+                    oCn.RollBack();
+                    return false;
+                }
+                sReturn = omodel.HInterID.ToString();
+
+                oCn.Commit();
+                return true;
+            }
+            catch (Exception e)
+            {
+                sReturn = e.Message;
+                oCn.RollBack();
+                throw (e);
+            }
+        }
+        //鏄剧ず鍗曟嵁
+        public override bool ShowBill(Int64 lngBillKey, ref string sReturn)
+        {
+            try
+            {
+                //鏌ヨ涓昏〃
+                DataSet Ds;
+                Ds = oCn.RunProcReturn("Select * from Sc_MaterToSourceBillMain Where HInterID=" + lngBillKey.ToString(), "Sc_MaterToSourceBillMain");
+                if (Ds.Tables[0].Rows.Count == 0)
+                {
+                    sReturn = "鍗曟嵁鏈壘鍒帮紒";
+                    return false;
+                }
+                //鍥哄畾璧嬪��===========================================
+                omodel.HYear = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HYear"]);
+                omodel.HPeriod = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HPeriod"]);
+                omodel.HBillType = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBillType"]);
+                omodel.HBillSubType = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBillSubType"]);
+                omodel.HInterID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HInterID"]);
+                omodel.HDate = DBUtility.ClsPub.isDate(Ds.Tables[0].Rows[0]["HDate"]);
+                omodel.HBillNo = Ds.Tables[0].Rows[0]["HBillNo"].ToString().Trim();
+                omodel.HBillStatus = DBUtility.ClsPub.isInt(Ds.Tables[0].Rows[0]["HBillStatus"]);
+                omodel.HCheckItemNowID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HCheckItemNowID"]);
+                omodel.HCheckItemNextID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HCheckItemNextID"]);
+                omodel.HCheckFlowID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HCheckFlowID"]);
+                omodel.HRemark = Ds.Tables[0].Rows[0]["HRemark"].ToString().Trim();
+                omodel.HBackRemark = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBackRemark"]);
+                omodel.HBackDate = Ds.Tables[0].Rows[0]["HBackDate"].ToString().Trim();
+                omodel.HBacker = Ds.Tables[0].Rows[0]["HBacker"].ToString().Trim();
+                omodel.HCheckDate = Ds.Tables[0].Rows[0]["HCheckDate"].ToString().Trim();
+                omodel.HChecker = Ds.Tables[0].Rows[0]["HChecker"].ToString().Trim();
+                omodel.HMaker = Ds.Tables[0].Rows[0]["HMaker"].ToString().Trim();
+                omodel.HMakeDate = Ds.Tables[0].Rows[0]["HMakeDate"].ToString().Trim();
+                omodel.HUpDateDate = Ds.Tables[0].Rows[0]["HUpDateDate"].ToString().Trim();
+                omodel.HUpDater = Ds.Tables[0].Rows[0]["HUpDater"].ToString().Trim();
+                omodel.HCloseDate = Ds.Tables[0].Rows[0]["HCloseDate"].ToString().Trim();
+                omodel.HCloseMan = Ds.Tables[0].Rows[0]["HCloseMan"].ToString().Trim();
+                omodel.HCloseType = DBUtility.ClsPub.isBool(Ds.Tables[0].Rows[0]["HCloseType"]);
+                omodel.HDeleteDate = Ds.Tables[0].Rows[0]["HDeleteDate"].ToString().Trim();
+                omodel.HDeleteMan = Ds.Tables[0].Rows[0]["HDeleteMan"].ToString().Trim();
+                omodel.HMainSourceBillType = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HMainSourceBillType"]);
+                omodel.HMainSourceInterID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HMainSourceInterID"]);
+                omodel.HMainSourceEntryID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HMainSourceEntryID"]);
+                omodel.HMainSourceBillNo = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HMainSourceBillNo"]);
+                omodel.HPrintQty = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HPrintQty"]);
+                //========================================================
+                omodel.HProcExchInterID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HProcExchInterID"]);
+                omodel.HProcExchEntryID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HProcExchEntryID"]);
+                omodel.HProcExchBillNo = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HProcExchBillNo"]);
+                omodel.HICMOInterID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HICMOInterID"]);
+                omodel.HICMOBillNo = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HICMOBillNo"]);
+                omodel.HSourceID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HSourceID"]);
+                omodel.HProcID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HProcID"]);
+                omodel.HMaterID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HMaterID"]);
+                omodel.HSourceBarCode = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HSourceBarCode"]);
+                omodel.HEquipID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HEquipID"]);
+                omodel.HWorkerID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HWorkerID"]);
+                omodel.HWorkerBarCode = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HWorkerBarCode"]);
+                omodel.HGroupID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HGroupID"]);
+                //寰幆
+                DataSet DsSub;
+                DsSub = oCn.RunProcReturn("Select * from Sc_MaterToSourceBillSub Where HInterID=" + lngBillKey.ToString() + " order by HEntryID ", "Sc_MaterToSourceBillSub");
+                DetailColl.Clear();//娓呯┖
+                for (int i = 0; i < DsSub.Tables[0].Rows.Count; i++)
+                {
+                    Model.ClsSc_MaterToSourceBillSub oSub = new Model.ClsSc_MaterToSourceBillSub();
+                    // 鍥哄畾璧嬪��===============================================
+                    oSub.HInterID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HInterID"]);
+                    oSub.HBillNo_bak = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HBillNo_bak"]);
+                    oSub.HEntryID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HEntryID"]);
+                    oSub.HSourceInterID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSourceInterID"]);
+                    oSub.HSourceEntryID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSourceEntryID"]);
+                    oSub.HSourceBillType = DsSub.Tables[0].Rows[i]["HSourceBillType"].ToString().Trim();
+                    oSub.HSourceBillNo = DsSub.Tables[0].Rows[i]["HSourceBillNo"].ToString().Trim();
+                    oSub.HRelationQty = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HRelationQty"]);
+                    oSub.HRelationMoney = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HRelationMoney"]);
+                    oSub.HCloseMan = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HCloseMan"]);
+                    oSub.HCloseType = DBUtility.ClsPub.isBool(DsSub.Tables[0].Rows[i]["HCloseType"]);
+                    oSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DsSub.Tables[0].Rows[i]["HEntryCloseDate"]);
+                    oSub.HRemark = DsSub.Tables[0].Rows[i]["HRemark"].ToString().Trim();
+                    //===================================================
+                    oSub.HMaterID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HMaterID"].ToString());
+                    oSub.HUnitID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HUnitID"].ToString());
+                    oSub.HQty = DBUtility.ClsPub.isSingle(DsSub.Tables[0].Rows[i]["HQty"].ToString());
+                    oSub.HPieceQty = DBUtility.ClsPub.isSingle(DsSub.Tables[0].Rows[i]["HPieceQty"].ToString());
+                    oSub.HScanDate = DBUtility.ClsPub.isDate(DsSub.Tables[0].Rows[i]["HScanDate"].ToString());
+                    oSub.HBarCode = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HBarCode"]);
+                    oSub.HBarCode_Pack = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HBarCode_Pack"]);
+                    DetailColl.Add(oSub);
+                }
+                sReturn = "鏄剧ず鍗曟嵁鎴愬姛锛�";
+                return true;
+            }
+            catch (Exception e)
+            {
+                sReturn = e.Message;
+                throw (e);
+            }
+        }
+
+        //鍒犻櫎鍗曟嵁
+        public override bool DeleteBill(Int64 lngBillKey, ref string sReturn)
+        {
+            try
+            {
+                oCn.BeginTran();
+                //鍒ゆ柇鏄惁鍏佽鍒犻櫎
+                DataSet ds = oCn.RunProcReturn("exec h_p_Sc_MaterToSourceBill_DelCtrl @HInterId=" + lngBillKey + "", "h_p_Sc_MaterToSourceBill_DelCtrl");
+                if (ds == null || ds.Tables[0].Rows.Count <= 0)
+                {
+                    sReturn = "鏃犻獙璇佹暟鎹紒";
+                    return false;
+                }
+                if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) == "2")
+                {
+                    sReturn = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
+                    return false;
+                }
+
+                //鍒犻櫎鍏宠仈鍏崇郴
+                oCn.RunProc("exec h_p_Sc_MaterToSourceBill_DelRelation @HInterId=" + lngBillKey + "");
+
+                //鍒犻櫎鏄庣粏琛�
+                oCn.RunProc("Delete From " + MvarItemKeySub + "  where HInterID=" + lngBillKey.ToString());
+                //鍒犻櫎涓昏〃
+                oCn.RunProc("Delete From " + MvarItemKey + "  where HInterID=" + lngBillKey.ToString());
+
+                sReturn = "鍒犻櫎鍗曟嵁鎴愬姛锛�";
+                oCn.Commit();
+                return true;
+            }
+            catch (Exception e)
+            {
+                sReturn = e.Message;
+                oCn.RollBack();
+                throw (e);
+            }
+        }
+
+        //瀹℃牳
+        public bool CheckBill(Int64 lngBillKey, ref string sReturn)
+        {
+
+            try
+            {
+                string HChecker = DBUtility.ClsPub.CurUserName;
+                string HCheckDate = DBUtility.ClsPub.GetServerDate(-1);
+                oCn.BeginTran();
+                oCn.RunProc(" Update " + MvarItemKey + " set HBillStatus='2', HChecker='" + HChecker + "',HCheckDate='" + HCheckDate + "' Where HInterID=" + lngBillKey.ToString());
+                //鐢熸垚璋冩嫧鍗�
+                //寰楀埌璋冩嫧鍗� mainid 鍗曟嵁鍙�
+                //long NewInterID = DBUtility.ClsPub.CreateBillID("1207", ref DBUtility.ClsPub.sExeReturnInfo);
+                //string NewBillNo = DBUtility.ClsPub.CreateBillCode("1207", ref DBUtility.ClsPub.sExeReturnInfo, true);//寰楀埌鏂板崟鍙�
+                //oCn.RunProc("exec h_p_Kf_MoveStockBill_Add " + lngBillKey.ToString() + "," + NewInterID.ToString() + ",'" + NewBillNo + "','" + HChecker + "'");
+                //
+                //鍐嶆楠岃瘉 淇濆瓨鏄惁 鍚堢悊
+                DataSet ds = oCn.RunProcReturn("exec h_p_Sc_MaterToSourceBill_AddRelation @HInterId=" + omodel.HInterID + "", "h_p_Sc_MaterToSourceBill_AddRelation");
+                if (ds == null || ds.Tables[0].Rows.Count <= 0)
+                {
+                    sReturn = "鏃犻獙璇佹暟鎹紒";
+                    oCn.RollBack();
+                }
+                if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) == "2")
+                {
+                    sReturn = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
+                    oCn.RollBack();
+                }
+
+                oCn.Commit();
+                sReturn = "";
+                return true;
+            }
+            catch (Exception e)
+            {
+                sReturn = e.Message;
+                throw (e);
+            }
+        }
+
+        //鍙嶅鏍�
+        public bool AbandonCheck(Int64 lngBillKey, ref string sReturn)
+        {
+
+            try
+            {
+                string HChecker = DBUtility.ClsPub.CurUserName;
+                string HCheckDate = DBUtility.ClsPub.GetServerDate(-1);
+                oCn.BeginTran();
+                oCn.RunProc(" Update " + MvarItemKey + " set HBillStatus='1', HChecker='',HCheckDate=null Where HInterID=" + lngBillKey.ToString());
+                //鐢熸垚璋冩嫧鍗�
+                //寰楀埌璋冩嫧鍗� mainid 鍗曟嵁鍙�
+                //long NewInterID = DBUtility.ClsPub.CreateBillID("1207", ref DBUtility.ClsPub.sExeReturnInfo);
+                //string NewBillNo = DBUtility.ClsPub.CreateBillCode("1207", ref DBUtility.ClsPub.sExeReturnInfo, true);//寰楀埌鏂板崟鍙�
+                //oCn.RunProc("exec h_p_Kf_MoveStockBill_Add " + lngBillKey.ToString() + "," + NewInterID.ToString() + ",'" + NewBillNo + "','" + HChecker + "'");
+                //
+                //鍐嶆楠岃瘉 淇濆瓨鏄惁 鍚堢悊
+                DataSet ds = oCn.RunProcReturn("exec h_p_Sc_MaterToSourceBill_DelRelation @HInterId=" + omodel.HInterID + "", "h_p_Sc_MaterToSourceBill_DelRelation");
+                if (ds == null || ds.Tables[0].Rows.Count <= 0)
+                {
+                    sReturn = "鏃犻獙璇佹暟鎹紒";
+                    oCn.RollBack();
+
+                }
+                if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) == "2")
+                {
+                    sReturn = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
+                    oCn.RollBack();
+
+                }
+
+                oCn.Commit();
+                sReturn = "";
+                return true;
+            }
+            catch (Exception e)
+            {
+                sReturn = e.Message;
+                throw (e);
+            }
+        }
+    }
+}
diff --git "a/DAL/\347\224\237\344\272\247\347\256\241\347\220\206/\350\256\276\345\244\207\347\256\241\347\220\206/ClsSb_EquipDotCheckBill.cs" "b/DAL/\347\224\237\344\272\247\347\256\241\347\220\206/\350\256\276\345\244\207\347\256\241\347\220\206/ClsSb_EquipDotCheckBill.cs"
index b85a9b9..2e4abe6 100644
--- "a/DAL/\347\224\237\344\272\247\347\256\241\347\220\206/\350\256\276\345\244\207\347\256\241\347\220\206/ClsSb_EquipDotCheckBill.cs"
+++ "b/DAL/\347\224\237\344\272\247\347\256\241\347\220\206/\350\256\276\345\244\207\347\256\241\347\220\206/ClsSb_EquipDotCheckBill.cs"
@@ -67,14 +67,14 @@
                       " (HInterID,HEntryID," +
                       "HCloseMan,HEntryCloseDate,HCloseType,HRemark," +
                       "HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney," +
-                      "HDotCheckItem,HDotCheckPart,HClaim," +
+                      "HDotCheckItemID,HDotCheckItem,HDotCheckPart,HClaim," +
                       "HManagerID,HManagerNumber" +
                       ") values("
-                      + omodel.HInterID.ToString() + "," + oSub.HEntryID.ToString() + 
-                      ",'" + oSub.HCloseMan + "','"+oSub.HEntryCloseDate+"'," + Convert.ToString(oSub.HCloseType ? 1 : 0) + ",'" + oSub.HRemark + "'" +
+                      + omodel.HInterID.ToString() + "," + oSub.HEntryID.ToString() +
+                      ",'" + oSub.HCloseMan + "','" + oSub.HEntryCloseDate + "'," + Convert.ToString(oSub.HCloseType ? 1 : 0) + ",'" + oSub.HRemark + "'" +
                       "," + oSub.HSourceInterID.ToString() + "," + oSub.HSourceEntryID.ToString() + ",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "'," + oSub.HRelationQty.ToString() + "," + oSub.HRelationMoney.ToString() +
-                      ",'" + oSub.HDotCheckItem + "','"+oSub.HDotCheckPart+"','"  + oSub.HClaim +
-                      "'," + oSub.HManagerID.ToString()+",'" +oSub.HManagerNumber+"'"+
+                      ",'" + oSub.HDotCheckItemID + "','" + oSub.HDotCheckItem + "','" + oSub.HDotCheckPart + "','" + oSub.HClaim +
+                      "'," + oSub.HManagerID.ToString() + ",'" + oSub.HManagerNumber + "'" +
                       ") ");
                 }
                 //
diff --git "a/DAL/\347\224\237\344\272\247\347\256\241\347\220\206/\350\256\276\345\244\207\347\256\241\347\220\206/ClsSb_EquipMaintainPlanBill.cs" "b/DAL/\347\224\237\344\272\247\347\256\241\347\220\206/\350\256\276\345\244\207\347\256\241\347\220\206/ClsSb_EquipMaintainPlanBill.cs"
index 5cb1e6e..9aa4d4a 100644
--- "a/DAL/\347\224\237\344\272\247\347\256\241\347\220\206/\350\256\276\345\244\207\347\256\241\347\220\206/ClsSb_EquipMaintainPlanBill.cs"
+++ "b/DAL/\347\224\237\344\272\247\347\256\241\347\220\206/\350\256\276\345\244\207\347\256\241\347\220\206/ClsSb_EquipMaintainPlanBill.cs"
@@ -9,11 +9,11 @@
     {
         public Model.ClsSb_EquipMaintainPlanBillMain omodel = new Model.ClsSb_EquipMaintainPlanBillMain();
         public List<Model.ClsSb_EquipMaintainPlanBillSub> DetailColl = new List<Model.ClsSb_EquipMaintainPlanBillSub>();
-
+        public List<Model.ClsSc_EquipMaintainPlanBillSub_Item> DetailCol = new List<Model.ClsSc_EquipMaintainPlanBillSub_Item>();
         public ClsSb_EquipMaintainPlanBill()
         {
             base.MvarItemKeySub = "Sb_EquipMaintainPlanBillSub";
-            base.MvarItemKeySub2 = "";
+            base.MvarItemKeySub2 = "Sb_EquipMaintainPlanBillSub_Item";
             base.MvarItemKeySub3 = "";
             base.MvarItemKeySub4 = "";
             base.MvarItemKey="Sb_EquipMaintainPlanBillMain";
@@ -45,7 +45,7 @@
                 ",HYear='" + omodel.HYear.ToString() + "'" +
                 ",HPeriod='" + omodel.HPeriod.ToString() + "'" +
                 ",HRemark='" + omodel.HRemark + "'" +
-                ",HUpDater='" + DBUtility.ClsPub.CurUserName + "'" +
+                ",HUpDater='" + omodel.HMaker + "'" +
                 ",HUpDateDate=getdate()" +
                 //========================================
                 ",HEquipID=" + omodel.HEquipID.ToString() +
@@ -60,8 +60,10 @@
                 DeleteRelation(ref sReturn, lngBillKey);
                 //鍒犻櫎瀛愯〃
                 DeleteBillSub(lngBillKey);
+                DeleteBillSub2(lngBillKey);
                 //鎻掑叆瀛愯〃
                 omodel.HInterID = lngBillKey;
+                //鎻掑叆閰嶄欢椤瑰瓙琛�
                 foreach (Model.ClsSb_EquipMaintainPlanBillSub oSub in DetailColl)
                 {
                     oCn.RunProc("Insert into Sb_EquipMaintainPlanBillSub " +
@@ -78,18 +80,23 @@
                       //"," + oSub.HManagerID.ToString()+",'" +oSub.HManagerNumber+"'"+
                       ") ");
                 }
-                //
-                //foreach (Model.ClsSb_EquipMaintainPlanBillSub oSub in DetailColl)
-                //{
-                //    Ds = oCn.RunProcReturn("exec h_p_Sb_EquipMaintainPlanBill_Qty " + oSub.HICMOInterID, "");
-                //    if (Ds.Tables[0].Rows.Count == 0)
-                //        return;
-                //    if (DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBool"]) == "Y")
-                //    {
-                //        sReturn = "姹囨姤鏁伴噺瓒呰繃璁″垝鏁伴噺锛佷笉鍏佽淇濆瓨";
-                //        return false;
-                //    }
-                //}
+                //鎻掑叆淇濆吇椤瑰瓙琛�
+                foreach (Model.ClsSc_EquipMaintainPlanBillSub_Item Item in DetailCol)
+                {
+                    oCn.RunProc("Insert into Sb_EquipMaintainPlanBillSub_Item" +
+                          " (HInterID,HEntryID,HMaintainItemID,HMaintainItem" +
+                          ",HMaintainPart,HClaim" +
+                          ",HManagerID" +
+                          ",HCloseMan,HCloseType,HRemark" +
+                          ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" +
+                          ") values("
+                          + omodel.HInterID.ToString() + "," + Item.HEntryID.ToString() + "," + Item.HMaintainItemID.ToString() + ",'" + Item.HMaintainItem.ToString() + "'" +
+                          ",'" + Item.HMaintainPart.ToString() + "','" + Item.HClaim.ToString() + "'" +
+                          "," + Item.HManagerID.ToString() +
+                          ",'" + Item.HCloseMan + "'," + Convert.ToString(Item.HCloseType ? 1 : 0) + ",'" + Item.HRemark + "'" +
+                          "," + Item.HSourceInterID.ToString() + "," + Item.HSourceEntryID.ToString() + ",'" + Item.HSourceBillNo + "','" + Item.HSourceBillType + "'," + Item.HRelationQty.ToString() + "," + Item.HRelationMoney.ToString() +
+                          ") ");
+                }
                 sReturn = "淇敼鍗曟嵁鎴愬姛锛�";
                 oCn.Commit();
                 return true;
@@ -116,11 +123,11 @@
                 ",HYear,HPeriod,HRemark,HEquipID" +
                 ",HBeginDate,HEndDate,HCheckCycle,HCycleUnit,HExplanation,HInnerBillNo" +
                 ") "+
-                " values('" + this.BillType + "','"  + this.HBillSubType + "'," +omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "','" + omodel.HDate + "','" + DBUtility.ClsPub.CurUserName + "',getdate()" +
+                " values('" + this.BillType + "','"  + this.HBillSubType + "'," +omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "','" + omodel.HDate + "','" + omodel.HMaker + "',getdate()" +
                 "," + omodel.HYear.ToString() + "," + omodel.HPeriod.ToString() + ",'" + omodel.HRemark + "'," + omodel.HEquipID.ToString() +
                 ",'" + omodel.HBeginDate +"','" +omodel.HEndDate + "'," + omodel.HCheckCycle.ToString() +",'"+ omodel.HCycleUnit + "','" + omodel.HExplanation + "','" + omodel.HInnerBillNo +"'" +
                 ") ");
-                //鎻掑叆瀛愯〃
+                //鎻掑叆閰嶄欢瀛愯〃
                 foreach (Model.ClsSb_EquipMaintainPlanBillSub oSub in DetailColl)
                 {
                     oCn.RunProc("Insert into Sb_EquipMaintainPlanBillSub " +
@@ -137,19 +144,23 @@
                         //"," + oSub.HManagerID.ToString()+",'" +oSub.HManagerNumber+"'"+
                       ") ");
                 }
-                //
-                //foreach (Model.ClsSb_EquipMaintainPlanBillSub oSub in DetailColl)
-                //{
-                //    Ds = oCn.RunProcReturn("exec h_p_Sb_EquipMaintainPlanBill_Qty " + oSub.HICMOInterID, "");
-                //    if (Ds.Tables[0].Rows.Count == 0)
-                //        return;
-                //    if (DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBool"]) == "Y")
-                //    {
-                //        sReturn = "姹囨姤鏁伴噺瓒呰繃璁″垝鏁伴噺锛佷笉鍏佽淇濆瓨";
-                //        return false;
-                //    }
-                //}
-                //
+                //鎻掑叆淇濆吇椤瑰瓙琛�
+                foreach (Model.ClsSc_EquipMaintainPlanBillSub_Item Item in DetailCol)
+                {
+                    oCn.RunProc("Insert into Sb_EquipMaintainPlanBillSub_Item" +
+                          " (HInterID,HEntryID,HMaintainItemID,HMaintainItem" +
+                          ",HMaintainPart,HClaim" +
+                          ",HManagerID" +
+                          ",HCloseMan,HCloseType,HRemark" +
+                          ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" +
+                          ") values("
+                          + omodel.HInterID.ToString() + "," + Item.HEntryID.ToString() + "," + Item.HMaintainItemID.ToString() + ",'" + Item.HMaintainItem.ToString() + "'" +
+                          ",'" + Item.HMaintainPart.ToString() + "','" + Item.HClaim.ToString() + "'" +
+                          "," + Item.HManagerID.ToString() +
+                          ",'" + Item.HCloseMan + "'," + Convert.ToString(Item.HCloseType ? 1 : 0) + ",'" + Item.HRemark + "'" +
+                          "," + Item.HSourceInterID.ToString() + "," + Item.HSourceEntryID.ToString() + ",'" + Item.HSourceBillNo + "','" + Item.HSourceBillType + "'," + Item.HRelationQty.ToString() + "," + Item.HRelationMoney.ToString() +
+                          ") ");
+                }
                 sReturn = "鏂板鍗曟嵁鎴愬姛锛�";
                 oCn.Commit();
                 return true;
diff --git a/Model/Model.csproj b/Model/Model.csproj
index f2e5661..675580b 100644
--- a/Model/Model.csproj
+++ b/Model/Model.csproj
@@ -537,6 +537,7 @@
     <Compile Include="鐢熶骇绠$悊\璁惧绠$悊\ClsSb_EquipRepairRequestBillSub.cs" />
     <Compile Include="鐢熶骇绠$悊\璁惧绠$悊\ClsSb_EquipRepairSendWorkBillMain.cs" />
     <Compile Include="鐢熶骇绠$悊\璁惧绠$悊\ClsSb_EquipRepairSendWorkBillSub.cs" />
+    <Compile Include="鐢熶骇绠$悊\璁惧绠$悊\ClsSc_EquipMaintainPlanBillSub_Item.cs" />
     <Compile Include="鐢熶骇绠$悊\璁惧绠$悊\ClsSc_ICMOBillMain.cs" />
     <Compile Include="绯荤粺鍏敤\ClsOA_EmpMessageBillModMain.cs" />
     <Compile Include="绯荤粺鍏敤\ClsOA_EmpMessageBillModSub.cs" />
@@ -605,6 +606,7 @@
     <Compile Include="杞﹂棿绠$悊\ClsSc_MaterDownBillMain.cs" />
     <Compile Include="杞﹂棿绠$悊\ClsSc_MaterDownBillSub.cs" />
     <Compile Include="杞﹂棿绠$悊\ClsSc_MaterToSourceBillMain.cs" />
+    <Compile Include="杞﹂棿绠$悊\ClsSc_MaterToSourceBillSub_Item.cs" />
     <Compile Include="杞﹂棿绠$悊\ClsSc_MaterToSourceBillSub.cs" />
     <Compile Include="杞﹂棿绠$悊\ClsSc_PackDoubleBillMain.cs" />
     <Compile Include="杞﹂棿绠$悊\ClsSc_PackDoubleBillSub.cs" />
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_EquipMaintainPlanBillSub_Item.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_EquipMaintainPlanBillSub_Item.cs"
new file mode 100644
index 0000000..15e2acd
--- /dev/null
+++ "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_EquipMaintainPlanBillSub_Item.cs"
@@ -0,0 +1,16 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace Model
+{
+    public class ClsSc_EquipMaintainPlanBillSub_Item : DBUtility.ClsXt_BaseBillSub
+    {
+        public Int64 HMaintainItemID;//  int  --淇濆吇椤圭洰ID 
+        public string HMaintainItem;//  varchar(100)  --淇濆吇椤圭洰
+        public string HMaintainPart;//  varchar(100)  --淇濆吇閮ㄤ綅
+        public string HClaim;//   	varchar(100)       --鍏蜂綋瑕佹眰
+        public Int64 HManagerID;// 	int   --璐熻矗浜篿d(鑱屽憳琛�)
+    }
+}
diff --git "a/Model/\350\275\246\351\227\264\347\256\241\347\220\206/ClsSc_MaterToSourceBillMain.cs" "b/Model/\350\275\246\351\227\264\347\256\241\347\220\206/ClsSc_MaterToSourceBillMain.cs"
index cedf9b5..249ad47 100644
--- "a/Model/\350\275\246\351\227\264\347\256\241\347\220\206/ClsSc_MaterToSourceBillMain.cs"
+++ "b/Model/\350\275\246\351\227\264\347\256\241\347\220\206/ClsSc_MaterToSourceBillMain.cs"
@@ -12,7 +12,7 @@
         public Int64 HProcExchInterID;//	int	        	--工序流转卡ID(预留字段)
         public Int64 HProcExchEntryID;//	int		        --工序流转卡子ID(预留字段)
         public string HProcExchBillNo;//	varchar(50) 	--工序流转卡号(预留字段)
-        public Int64 HICMOInterID;// 		int		        --任务单ID				
+        public Int64 HICMOInterID;// 		int		        --任务单ID		                       // 				
         public string HICMOBillNo;//		varchar(50) 	--任务单号	
         public Int64 HSourceID;//		    int		        --生产资源ID
         public string HSourceBarCode;//		varchar(50) 	--生产资源条码
@@ -24,6 +24,10 @@
         public Int64 HProcID;//  		    int	        	--工序ID
         public Int64 HMaterID;//  		    int	        	--产品ID
 
-        
+        public Int64 HICMOEntryID=0;// 		    int		        --任务单子ID 
+        public string HSourceBillNo = "";//     string		    --源单单号 
+        public Int64 HSourceInterID = 0;// 		int		        --源单主内码 
+        public Int64 HSourceEntryID = 0;// 		int		        --源单子内码 
+        public string HSourceBillType = ""; //  string          --源单类型
     }
 }
diff --git "a/Model/\350\275\246\351\227\264\347\256\241\347\220\206/ClsSc_MaterToSourceBillSub_Item.cs" "b/Model/\350\275\246\351\227\264\347\256\241\347\220\206/ClsSc_MaterToSourceBillSub_Item.cs"
new file mode 100644
index 0000000..2294e9e
--- /dev/null
+++ "b/Model/\350\275\246\351\227\264\347\256\241\347\220\206/ClsSc_MaterToSourceBillSub_Item.cs"
@@ -0,0 +1,20 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace Model
+{
+    public class ClsSc_MaterToSourceBillSub_Item: DBUtility.ClsXt_BaseBillSub
+    { 
+        public string HBillNo_bak;//		varchar(50)	--单据号(备份,以免内码丢失,找不到对应主表)
+
+        public Int64 HMouldID;//  	int	--治具内码
+        public Int64 HUnitID;//	  	int 	--单位ID
+        public Single HQty;//		money	--数量
+        public Single HPieceQty;//	money	--件量
+        public DateTime HScanDate;// 	datetime  --扫描时间
+        public string HBarCode;//   	varchar(50)	--条形码
+        public string HBarCode_Pack;// 	varchar(50)	--箱号条码
+
+    }
+}
diff --git a/OAM/OAM.csproj.user b/OAM/OAM.csproj.user
index 51efb67..23bc47a 100644
--- a/OAM/OAM.csproj.user
+++ b/OAM/OAM.csproj.user
@@ -9,5 +9,6 @@
     <ErrorReportUrlHistory />
     <FallbackCulture>zh-CN</FallbackCulture>
     <VerifyUploadedFiles>false</VerifyUploadedFiles>
+    <ProjectView>ShowAllFiles</ProjectView>
   </PropertyGroup>
 </Project>
\ No newline at end of file
diff --git a/Pub_Class/CustomerCls/ClsXt_SystemParameter.cs b/Pub_Class/CustomerCls/ClsXt_SystemParameter.cs
index 7a6e10e..f8addd7 100644
--- a/Pub_Class/CustomerCls/ClsXt_SystemParameter.cs
+++ b/Pub_Class/CustomerCls/ClsXt_SystemParameter.cs
@@ -752,7 +752,12 @@
                         omodel.Sc_ICMOReportBill_FirstCheckOut = ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HValue"]);
                     }
 
-                    
+                    //=========上料防错单
+                    //自动审核
+                    if (ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HKey"]) == "Sc_MaterToSourceBill_AutoCheck")
+                    {
+                        omodel.Sc_MaterToSourceBill_AutoCheck = ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HValue"]);
+                    }
 
                 }
                 sReturn = "显示单据成功!";
diff --git a/Pub_Class/CustomerCls/ClsXt_SystemParameterMain.cs b/Pub_Class/CustomerCls/ClsXt_SystemParameterMain.cs
index e2e0366..8f814b7 100644
--- a/Pub_Class/CustomerCls/ClsXt_SystemParameterMain.cs
+++ b/Pub_Class/CustomerCls/ClsXt_SystemParameterMain.cs
@@ -211,6 +211,8 @@
         public string Sc_ICMOBillWorkQtyStatus_AutoCheck; //自动审核
         //质量汇报单
         public string Sc_ICMOBillQualityStatus_AutoCheck; //自动审核
+        //上料防错单
+        public string Sc_MaterToSourceBill_AutoCheck;     //自动审核
 
         //QMS
 
diff --git a/WebAPI/Controllers/BaseSet/Gy_EmployeeController.cs b/WebAPI/Controllers/BaseSet/Gy_EmployeeController.cs
index fe244d6..0dca6d2 100644
--- a/WebAPI/Controllers/BaseSet/Gy_EmployeeController.cs
+++ b/WebAPI/Controllers/BaseSet/Gy_EmployeeController.cs
@@ -69,236 +69,655 @@
         }
 
         /// <summary>
-        /// 淇濆瓨鑱屽憳
+        /// 鏂板鑱屽憳-淇濆瓨鎸夐挳
+        ///鍙傛暟锛歴tring sql銆�
+        ///杩斿洖鍊硷細object銆�
         /// </summary>
-        /// <param name="msg"></param>
-        /// <returns></returns>
-        [Route("SaveGy_EmployeeList")]
+        [Route("Gy_Employee/AddNew")]
         [HttpPost]
-        public object SaveGy_EmployeeList([FromBody] JObject msg)
+        public object AddNew([FromBody] JObject oMain)
         {
-            DataSet ds;
-            var _value = msg["msg"].ToString();
-            string msg1 = _value.ToString();
-            //string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
-            //string msg2 = sArray[0].ToString();
-            //string msg3 = sArray[1].ToString();
-            Int64 HItemID = 0;
-            SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
-            //鑾峰彇鏈�澶D鍊艰祴鍊�
-            DataSet Maxds = oCN.RunProcReturn("select MAX(HItemID) HItemID from Gy_Employee ", "Gy_Employee");
-            if (Maxds != null || Maxds.Tables[0].Rows.Count > 0)
-            {
-                //HItemID= Maxds.Tables[0].Rows[0]["HItemID"]
-                var maxid = Convert.ToInt32(Maxds.Tables[0].Rows[0]["HItemID"]);
-                maxid += 1;
-                HItemID = maxid;
-            }
-            ListModels oListModels = new ListModels();
             try
             {
-                DAL.ClsGy_Employee_Ctl oBill = new DAL.ClsGy_Employee_Ctl();
-                List<Model.ClsGy_Employee_Model> lsmain = new List<Model.ClsGy_Employee_Model>();
-                msg1 = msg1.Replace("\\", "");
-                msg1 = msg1.Replace("\n", "");  //\n
-                lsmain = oListModels.getObjectByJson_Gy_Employee(msg1);
-                foreach (Model.ClsGy_Employee_Model oItem in lsmain)
-                {
-                    if (oItem.HNumber.Trim() == "")
-                    {
-                        objJsonResult.code = "0";
-                        objJsonResult.count = 0;
-                        objJsonResult.Message = "淇濆瓨澶辫触锛佷唬鐮佷笉鑳戒负绌猴紒";
-                        objJsonResult.data = 1;
-                        return objJsonResult;
-                    }
-                    if (oItem.HName.Trim() == "")
-                    {
-                        objJsonResult.code = "0";
-                        objJsonResult.count = 0;
-                        objJsonResult.Message = "淇濆瓨澶辫触锛佸悕绉颁笉鑳戒负绌猴紒";
-                        objJsonResult.data = 1;
-                        return objJsonResult;
-                    }
-                    //txtHInsuranceDate
-                    if (oItem.HInsuranceDate.Trim() != "")
-                    {
-                        if (DBUtility.ClsPub.isStrNull(DBUtility.ClsPub.isDate(oItem.HInsuranceDate.Trim())) == "1900-01-01 0:00:00")
-                        {
-                            objJsonResult.code = "0";
-                            objJsonResult.count = 0;
-                            objJsonResult.Message = "淇濆瓨澶辫触锛佸弬淇濇棩鏈熸牸寮忎笉瀵癸紒";
-                            objJsonResult.data = 1;
-                            return objJsonResult;
-                        }
-                    }
-                    //txtHDimissionDate
-                    if (oItem.HDimissionDate.Trim() != "")
-                    {
-                        if (DBUtility.ClsPub.isStrNull(DBUtility.ClsPub.isDate(oItem.HDimissionDate.Trim())) == "1900-01-01 0:00:00")
-                        {
-                            objJsonResult.code = "0";
-                            objJsonResult.count = 0;
-                            objJsonResult.Message = "淇濆瓨澶辫触锛佺鑱屾棩鏈熸牸寮忎笉瀵�!锛�";
-                            objJsonResult.data = 1;
-                            return objJsonResult;
-                        }
-                    }
-                    //txtHStayCardEDate
-                    if (oItem.HStayCardEDate.Trim() != "")
-                    {
-                        if (DBUtility.ClsPub.isStrNull(DBUtility.ClsPub.isDate(oItem.HStayCardEDate.Trim())) == "1900-01-01 0:00:00")
-                        {
-                            objJsonResult.code = "0";
-                            objJsonResult.count = 0;
-                            objJsonResult.Message = "淇濆瓨澶辫触锛佹殏浣忚瘉鍒版湡鏃ユ牸寮忎笉瀵�!锛�";
-                            objJsonResult.data = 1;
-                            return objJsonResult;
-                        }
-                    }
+                var _value = oMain["oMain"].ToString();
+                string msg1 = _value.ToString();
+                //鍙嶅簭鍒楀寲
+                msg1 = "[" + msg1.ToString() + "]";
 
-                    if (!DBUtility.ClsPub.AllowNumber(oItem.HNumber.Trim()))
-                    {
-                        objJsonResult.code = "0";
-                        objJsonResult.count = 0;
-                        objJsonResult.Message = "淇濆瓨澶辫触锛佷唬鐮佷腑涓嶈兘鍑虹幇杩炵画鈥�.鈥欏苟涓旈浣嶆湯浣嶄笉鑳戒负鈥�.鈥欙紒";
-                        objJsonResult.data = 1;
-                        return objJsonResult;
-                    }
-          
-                    //鏌ヨ鏁版嵁涓槸鍚﹀瓨鍦ㄩ噸澶嶄唬鐮�
-                    ds = oCN.RunProcReturn("select * from  Gy_Employee where HStopflag=0 and HNumber='" + oItem.HNumber.Trim() + "'", "Gy_Employee");
-                    if (oItem.HNumber.Trim() == "")
-                    {
-                        objJsonResult.code = "0";
-                        objJsonResult.count = 0;
-                        objJsonResult.Message = "淇濆瓨澶辫触锛佷唬鐮佷负绌猴紒";
-                        objJsonResult.data = 1;
-                        return objJsonResult;
-                    }
-                    //鏂板鏃跺垽鏂�
-                    if (oItem.HItemID == 0)
-                    {
-                        if (ds == null || ds.Tables[0].Rows.Count == 0)
-                        {
+                DAL.ClsGy_Employee_Ctl oDept = new DAL.ClsGy_Employee_Ctl();
+                DAL.ClsGy_Employee_View oDeptHlp = new DAL.ClsGy_Employee_View();
+                List<Gy_Employee> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Gy_Employee>>(msg1);
 
-                        }
-                        else
-                        {
-                            objJsonResult.code = "0";
-                            objJsonResult.count = 0;
-                            objJsonResult.Message = "淇濆瓨澶辫触锛佷唬鐮侀噸澶嶏紒";
-                            objJsonResult.data = 1;
-                            return objJsonResult;
-                        }
-                        //妫�鏌ョ埗绾ф槸鍚﹀瓨鍦�
-                        string sParent;
-                        sParent = DBUtility.ClsPub.GetParentCode(oItem.HNumber.Trim());
-                        if (sParent.Trim() == "")
-                        {
-                            oBill.oModel.HParentID = 0;
-                        }
-                        else
-                        {
-                            if (oBill.HavParentCode(sParent.Trim(), HItemID))
-                            {
-                                oBill.oModel.HParentID = oBill.oModel.HItemID;
-                            }
-                            else
-                            {
-                                objJsonResult.code = "0";
-                                objJsonResult.count = 0;
-                                objJsonResult.Message = "淇濆瓨澶辫触锛佷笂绾т唬鐮佷笉瀛樺湪鎴栬绂佺敤锛�";
-                                objJsonResult.data = 1;
-                                return objJsonResult;
-                            }
-                        }
-                    }
-                    else//缂栬緫鏃跺垽鏂�
-                    {
-                        //妫�鏌ョ埗绾ф槸鍚﹀瓨鍦�
-                        string sParent;
-                        sParent = DBUtility.ClsPub.GetParentCode(oItem.HNumber.Trim());
-                        if (sParent.Trim() == "")
-                        {
-                            oBill.oModel.HParentID = 0;
-                        }
-                        else
-                        {
-                            if (oBill.HavParentCode(sParent.Trim(), oItem.HItemID))
-                            {
-                                oBill.oModel.HParentID = oBill.oModel.HItemID;
-                            }
-                            else
-                            {
-                                objJsonResult.code = "0";
-                                objJsonResult.count = 0;
-                                objJsonResult.Message = "淇濆瓨澶辫触锛佷笂绾т唬鐮佷笉瀛樺湪鎴栬绂佺敤锛�";
-                                objJsonResult.data = 1;
-                                return objJsonResult;
-                            }
-                        }
-                    }
-                    //寰楀埌鐭唬鐮�
-                    string sShortNumber;
-                    sShortNumber = DBUtility.ClsPub.GetShortNumber(oItem.HNumber.Trim());
-                    if (sShortNumber.Trim() == "")
-                    {
-                        objJsonResult.code = "0";
-                        objJsonResult.count = 0;
-                        objJsonResult.Message = "淇濆瓨澶辫触锛佺煭浠g爜涓虹┖锛�";
-                        objJsonResult.data = 1;
-                        return objJsonResult;
-                    }
-                    if (DBUtility.ClsPub.isDate(oBill.oModel.HDimissionDate) < Convert.ToDateTime("1950-01-01"))
-                    {
-                        oBill.oModel.HDimissionDate = "2050-01-01";
-                    }
-                    oItem.HShortNumber = sShortNumber;//鐭唬鐮�
-                    oItem.HEndFlag = true;//鏈骇鏍囧織
-                    oItem.HLevel = DBUtility.ClsPub.GetLevel(oItem.HNumber.Trim()); //绛夌骇
-                    oBill.oModel = oItem;
-                }
+                long HItemID = list[0].HItemID;
+                string HNumber = list[0].HNumber;
+                string HName = list[0].HName;
+                string HShortNumber = list[0].HNumber;
+                long HParentID = list[0].HParentID;
+                long HLevel = 1;
+                string HHelpCode = list[0].HHelpCode;
+                bool HEndFlag = list[0].HEndFlag;
+                bool HStopflag = list[0].HStopflag;
+                string HRemark = list[0].HRemark; 
+                string HUseFlag = list[0].HUseFlag;
+                string HSex = list[0].HSex;
+                string HIDCard = list[0].HIDCard;
+                string HBirthDay = list[0].HBirthDay;
+                string HAddress = list[0].HAddress;
+                string HLinkPhone = list[0].HLinkPhone;
+                string HMobilePhone = list[0].HMobilePhone;
+                string HFax = list[0].HFax;
+                string HPostalCode = list[0].HPostalCode;
+                string HEmail = list[0].HEmail;
+                string HBank = list[0].HBank;
+                string HBankAccount = list[0].HBankAccount;
+                long HGroupID = list[0].HGroupID;
+                long HDeptID = list[0].HDeptID;
+                long HPostID = list[0].HPostID;
+                long HWorkTypeID = list[0].HWorkTypeID;
+                long HCTPrjID = list[0].HCTPrjID;
+                long HProcID = list[0].HProcID;
+                string HBasePay = list[0].HBasePay;
+                DateTime HInComDate = list[0].HInComDate;
+                DateTime HDimissionDate = list[0].HDimissionDate;
+                bool HOverType = list[0].HOverType;
+                string HEmpType = list[0].HEmpType;
+                string HOtherDeduct3 = list[0].HOtherDeduct3;
+                string HDrydock = list[0].HDrydock;
+                string HInsurance = list[0].HInsurance;
+                string HMedicare = list[0].HMedicare;
+                bool HNoBrushFlag = list[0].HNoBrushFlag;
+                bool HShiftFlag = list[0].HShiftFlag;
+                DateTime HContactDate = list[0].HContactDate;
+                bool HStopwagesFlag = list[0].HStopwagesFlag;
+                string HDimissionReason = list[0].HDimissionReason;
+                long HDormID = list[0].HDormID;
+                string HArchivesNo = list[0].HArchivesNo;
+                DateTime HStayCardEDate = list[0].HStayCardEDate;
+                DateTime HCheckCardEDate = list[0].HCheckCardEDate;
+                string HJobCardNo = list[0].HJobCardNo;
+                DateTime HJobCardEDate = list[0].HJobCardEDate;
+                string HWorkType = list[0].HWorkType;
+                long HContractYear = list[0].HContractYear;
+                DateTime HContractBDate = list[0].HContractBDate;
+                DateTime HContractEDate = list[0].HContractEDate;
+                string HInsuranceNo = list[0].HInsuranceNo;
+                DateTime HInsuranceDate = list[0].HInsuranceDate;
+                string HInsuranceStatus = list[0].HInsuranceStatus;
+                DateTime HSignDate = list[0].HSignDate;
+                bool HSignStatus = list[0].HSignStatus;
+                string HOldCompany = list[0].HOldCompany;
+                string HMarr = list[0].HMarr;
+                string HHomeAdd = list[0].HHomeAdd;
+                string HNowAdd = list[0].HNowAdd;
+                string HSpec = list[0].HSpec;
+                string HCompLev = list[0].HCompLev;
+                string HEngLev = list[0].HEngLev;
+                DateTime HGradDate = list[0].HGradDate;
+                string HGradSchool = list[0].HGradSchool;
+                string HSalaryLev = list[0].HSalaryLev;
+                long HDutyID = list[0].HDutyID;
+                string HProTitleID = list[0].HProTitleID;
+                string HKnowLev = list[0].HKnowLev;
+                string HAvoird = list[0].HAvoird;
+                string HStature = list[0].HStature;
+                string HBloodType = list[0].HBloodType;
+                string HBlightyType = list[0].HBlightyType;
+                string HGovStatus = list[0].HGovStatus;
+                string HNation = list[0].HNation;
+                string HBlighty = list[0].HBlighty;
+                long HAge = list[0].HAge;
+                string HExamLevPostMoney = list[0].HExamLevPostMoney;
+                string HBSTDeptID = list[0].HBSTDeptID;
+                string HRelDate = list[0].HRelDate;
+                string HHighestPay = list[0].HHighestPay;
+                string HOverPayRate = list[0].HOverPayRate;
+                string HLeftMoneyRate = list[0].HLeftMoneyRate;
+                string HInsuranceSubsidy = list[0].HInsuranceSubsidy;
+                string HPayType = list[0].HPayType;
+                string HStdDayTimes = list[0].HStdDayTimes;
+                string HStdDayPay = list[0].HStdDayPay;
+                string HMinDayPay = list[0].HMinDayPay;
+                string HMinMonthPay = list[0].HMinMonthPay;
+                DateTime HMadeDate = list[0].HMadeDate;
+                string HEmpRate = list[0].HEmpRate;
+                string HExamRate = list[0].HExamRate;
+                DateTime HHealthCardEDate = list[0].HHealthCardEDate;
 
-                //淇濆瓨
-                //淇濆瓨瀹屾瘯鍚庡鐞�
-                bool bResult;
-                if (oBill.oModel.HItemID == 0)
-                {
-                    // bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
-                    bResult = oBill.AddNew();
-                }
-                else
-                {
-                    bResult = oBill.ModifyByID(oBill.oModel.HItemID);
-                }
-                if (bResult)
-                {
-                    objJsonResult.code = "0";
-                    objJsonResult.count = 1;
-                    objJsonResult.Message = "淇濆瓨鎴愬姛锛�";
-                    //WebAPIController.Add_Log("閫佽揣鍗曚笅鎺�", UserName, "鐢熸垚閫佽揣鍗�");
-                    objJsonResult.data = 1;
-                    return objJsonResult;
-                }
-                else
+
+
+                if (!DBUtility.ClsPub.AllowNumber(HNumber))
                 {
                     objJsonResult.code = "0";
                     objJsonResult.count = 0;
-                    objJsonResult.Message = "淇濆瓨澶辫触锛�" + DBUtility.ClsPub.sExeReturnInfo;
-                    objJsonResult.data = 1;
+                    objJsonResult.Message = "浠g爜涓笉鑳藉嚭鐜拌繛缁��.鈥欏苟涓旈浣嶆湯浣嶄笉鑳戒负鈥�.鈥欙紒";
+                    objJsonResult.data = null;
                     return objJsonResult;
                 }
+
+                //鑻AINDI閲嶅鍒欓噸鏂拌幏鍙�
+                oCN.BeginTran();
+                oCN.RunProc("Insert into Gy_Employee (" +
+                      "HNumber,HName,HShortNumber,HEmpRate,HExamRate" +
+                      ",HLevel,HParentID,HEndflag,HHighestPay,HOverPayRate" +
+                      ",HStopflag,HRemark,HHelpCode,HInsuranceSubsidy" +
+                      ",HBirthday,HGradDate,HInsuranceDate,HContractBDate,HContractEDate" +
+                      ",HJobCardEDate,HCheckCardEDate,HStayCardEDate,HHealthCardEDate" +
+                      ",HAge,HSalaryLev,HContractYear,HInsuranceStatus,HSignStatus" +
+                      ",HSex,HMarr,HBlighty,HNation,HBlightyType" +
+                      ",HGovStatus,HBloodType,HStature,HAvoird,HKnowLev" +
+                      ",HProTitleID,HGradSchool,HEngLev,HCompLev,HSpec" +
+                      ",HEmail,HNowAdd,HHomeAdd,HIDCard,HLinkPhone,HMobilePhone,HFax" +
+                      ",HOldCompany,HInsuranceNo,HJobCardNo,HArchivesNo,HWorkType,HDimissionReason" +
+                      ",HDimissionDate,HInComDate,HSignDate,HRelDate" +
+                      ",HPostID,HDormID,HDutyID,HLeftMoneyRate" +
+                      ",HEmpType,HPayType,HOverType,HNoBrushFlag,HShiftFlag,HStopwagesFlag" +
+                      ",HPostalCode,HBank,HBasePay,HExamLevPostMoney,HBSTDeptID" + 
+                      ",HOtherDeduct3,HInsurance,HMedicare,HDrydock" +
+                      ",HBankAccount,HGroupID,HDeptID,HWorkTypeID,HCTPrjID,HAddress" +
+                      ") " +
+                      " Values('" + HNumber + "','" + HName + "','" + HShortNumber + "'," + HEmpRate.ToString() + "," + HExamRate.ToString() +
+                      "," + HLevel + "," + HParentID + "," + Convert.ToString(HEndFlag ? 1 : 0) + "," + HHighestPay.ToString() + "," + HOverPayRate.ToString() +
+                      "," + Convert.ToString(HStopflag ? 1 : 0) + ",'" + HRemark + "'" + ",'" + HHelpCode + "'," + HInsuranceSubsidy.ToString() + "" +
+                      ",'" + HBirthDay + "','" + HGradDate + "','" + HInsuranceDate + "','" + HContractBDate + "','" + HContractEDate + "'" +
+                      ",'" + HJobCardEDate + "','" + HCheckCardEDate + "','" + HStayCardEDate + "','" + HHealthCardEDate + "'" +
+                      "," + HAge.ToString() + ",'" + HSalaryLev + "'," + HContractYear.ToString() + "," + HInsuranceStatus  + "," + Convert.ToString(HSignStatus ? 1 : 0) +
+                      ",'" + HSex + "','" + HMarr + "','" + HBlighty + "','" + HNation + "','" + HBlightyType + "'" +
+                      ",'" + HGovStatus + "','" + HBloodType + "','" + HStature + "','" + HAvoird + "','" + HKnowLev + "'" +
+                      ",'" + HProTitleID + "','" + HGradSchool + "','" + HEngLev + "','" + HCompLev + "','" + HSpec + "'" +
+                      ",'" + HEmail + "','" + HNowAdd + "','" + HHomeAdd + "','" + HIDCard + "','" + HLinkPhone + "','" + HMobilePhone + "','" + HFax + "'" +
+                      ",'" + HOldCompany + "','" +HInsuranceNo + "','" +HJobCardNo + "','" +HArchivesNo + "','" + HWorkType + "','" + HDimissionReason + "'" +
+                      ",'" + HDimissionDate + "','" + HInComDate + "','" + HSignDate + "','" + HRelDate + "'" +
+                      "," + HPostID.ToString() + "," +HDormID.ToString() + "," + HDutyID.ToString() + "," + HLeftMoneyRate.ToString() +
+                      ",'" + HEmpType + "'" + ",'" + HPayType + "'" + "," + DBUtility.ClsPub.BoolToString(HOverType) + "" + "," + DBUtility.ClsPub.BoolToString(HNoBrushFlag) + "" + "," + DBUtility.ClsPub.BoolToString(HShiftFlag) + "" + "," + DBUtility.ClsPub.BoolToString(HStopwagesFlag) + "" +
+                      ",'" + HPostalCode + "','" + HBank + "'," + HBasePay.ToString() + "," + HExamLevPostMoney.ToString() + ",'" + HBSTDeptID + "'" +
+                      "," + HOtherDeduct3.ToString() + "" + "," + HInsurance.ToString() + "" + "," + HMedicare.ToString() + "" + "," + HDrydock.ToString() + "" +
+                      ",'" + HBankAccount + "'" + "," + HGroupID.ToString() + "" + "," + HDeptID.ToString() + "," + HWorkTypeID.ToString() + "," + HCTPrjID.ToString() + ",'" + HAddress + "'" +
+                      ")");
+                //淇敼涓婄骇涓洪潪鏈骇浠g爜
+                oCN.RunProc("Update Gy_Employee  set HEndflag=0 where HItemID=" + HParentID, ref DBUtility.ClsPub.sExeReturnInfo);
+             
+                oCN.Commit();
+                objJsonResult.code = "1";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "鏂板鍗曟嵁鎴愬姛锛�";
+                //objJsonResult.data = null;
+                return objJsonResult;
             }
             catch (Exception e)
             {
+                oCN.RollBack();
                 objJsonResult.code = "0";
                 objJsonResult.count = 0;
-                objJsonResult.Message = "淇濆瓨澶辫触锛�" + e.ToString();
-                objJsonResult.data = 1;
+                objJsonResult.Message = "Exception锛�" + e.Message;
+                objJsonResult.data = null;
                 return objJsonResult;
             }
         }
+        /// <summary>
+        /// 淇濆瓨鎸夐挳
+        ///鍙傛暟锛歴tring sql銆�
+        ///杩斿洖鍊硷細object銆�
+        /// </summary>
+        [Route("Gy_Employee/ModifyByID")]
+        [HttpPost]
+        public object ModifyByID([FromBody] JObject oMain)
+        {
+            try
+            {
+                DAL.ClsGy_Employee_Ctl oDept = new DAL.ClsGy_Employee_Ctl();
+                DAL.ClsGy_Employee_View oDeptHlp = new DAL.ClsGy_Employee_View();
+
+                var _value = oMain["oMain"].ToString();
+                string msg1 = _value.ToString();
+                string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
+                string msg2 = sArray[0].ToString();
+                //string msg3 = sArray[1].ToString();
+                //string msg4 = sArray[2].ToString();
+                //string msg5 = sArray[3].ToString();
+                //鍙嶅簭鍒楀寲
+                msg2 = "[" + msg2.ToString() + "]";
+                List<Gy_Employee> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Gy_Employee>>(msg2);
+
+                long HItemID = list[0].HItemID;
+                string HNumber = list[0].HNumber;
+                string HName = list[0].HName;
+                string HShortNumber = list[0].HNumber;
+                long HParentID = list[0].HParentID;
+                long HLevel = 1;
+                string HHelpCode = list[0].HHelpCode;
+                bool HEndFlag = list[0].HEndFlag;
+                bool HStopflag = list[0].HStopflag;
+                string HRemark = list[0].HRemark;
+                string HUseFlag = list[0].HUseFlag;
+                string HSex = list[0].HSex;
+                string HIDCard = list[0].HIDCard;
+                string HBirthDay = list[0].HBirthDay;
+                string HAddress = list[0].HAddress;
+                string HLinkPhone = list[0].HLinkPhone;
+                string HMobilePhone = list[0].HMobilePhone;
+                string HFax = list[0].HFax;
+                string HPostalCode = list[0].HPostalCode;
+                string HEmail = list[0].HEmail;
+                string HBank = list[0].HBank;
+                string HBankAccount = list[0].HBankAccount;
+                long HGroupID = list[0].HGroupID;
+                long HDeptID = list[0].HDeptID;
+                long HPostID = list[0].HPostID;
+                long HWorkTypeID = list[0].HWorkTypeID;
+                long HCTPrjID = list[0].HCTPrjID;
+                long HProcID = list[0].HProcID;
+                string HBasePay = list[0].HBasePay;
+                DateTime HInComDate = list[0].HInComDate;
+                DateTime HDimissionDate = list[0].HDimissionDate;
+                bool HOverType = list[0].HOverType;
+                string HEmpType = list[0].HEmpType;
+                string HOtherDeduct3 = list[0].HOtherDeduct3;
+                string HDrydock = list[0].HDrydock;
+                string HInsurance = list[0].HInsurance;
+                string HMedicare = list[0].HMedicare;
+                bool HNoBrushFlag = list[0].HNoBrushFlag;
+                bool HShiftFlag = list[0].HShiftFlag;
+                DateTime HContactDate = list[0].HContactDate;
+                bool HStopwagesFlag = list[0].HStopwagesFlag;
+                string HDimissionReason = list[0].HDimissionReason;
+                long HDormID = list[0].HDormID;
+                string HArchivesNo = list[0].HArchivesNo;
+                DateTime HStayCardEDate = list[0].HStayCardEDate;
+                DateTime HCheckCardEDate = list[0].HCheckCardEDate;
+                string HJobCardNo = list[0].HJobCardNo;
+                DateTime HJobCardEDate = list[0].HJobCardEDate;
+                string HWorkType = list[0].HWorkType;
+                long HContractYear = list[0].HContractYear;
+                DateTime HContractBDate = list[0].HContractBDate;
+                DateTime HContractEDate = list[0].HContractEDate;
+                string HInsuranceNo = list[0].HInsuranceNo;
+                DateTime HInsuranceDate = list[0].HInsuranceDate;
+                string HInsuranceStatus = list[0].HInsuranceStatus;
+                DateTime HSignDate = list[0].HSignDate;
+                bool HSignStatus = list[0].HSignStatus;
+                string HOldCompany = list[0].HOldCompany;
+                string HMarr = list[0].HMarr;
+                string HHomeAdd = list[0].HHomeAdd;
+                string HNowAdd = list[0].HNowAdd;
+                string HSpec = list[0].HSpec;
+                string HCompLev = list[0].HCompLev;
+                string HEngLev = list[0].HEngLev;
+                DateTime HGradDate = list[0].HGradDate;
+                string HGradSchool = list[0].HGradSchool;
+                string HSalaryLev = list[0].HSalaryLev;
+                long HDutyID = list[0].HDutyID;
+                string HProTitleID = list[0].HProTitleID;
+                string HKnowLev = list[0].HKnowLev;
+                string HAvoird = list[0].HAvoird;
+                string HStature = list[0].HStature;
+                string HBloodType = list[0].HBloodType;
+                string HBlightyType = list[0].HBlightyType;
+                string HGovStatus = list[0].HGovStatus;
+                string HNation = list[0].HNation;
+                string HBlighty = list[0].HBlighty;
+                long HAge = list[0].HAge;
+                string HExamLevPostMoney = list[0].HExamLevPostMoney;
+                string HBSTDeptID = list[0].HBSTDeptID;
+                string HRelDate = list[0].HRelDate;
+                string HHighestPay = list[0].HHighestPay;
+                string HOverPayRate = list[0].HOverPayRate;
+                string HLeftMoneyRate = list[0].HLeftMoneyRate;
+                string HInsuranceSubsidy = list[0].HInsuranceSubsidy;
+                string HPayType = list[0].HPayType;
+                string HStdDayTimes = list[0].HStdDayTimes;
+                string HStdDayPay = list[0].HStdDayPay;
+                string HMinDayPay = list[0].HMinDayPay;
+                string HMinMonthPay = list[0].HMinMonthPay;
+                DateTime HMadeDate = list[0].HMadeDate;
+                string HEmpRate = list[0].HEmpRate;
+                string HExamRate = list[0].HExamRate;
+                DateTime HHealthCardEDate = list[0].HHealthCardEDate;
+
+                ////鍒ゆ柇鏉冮檺
+                //if (!ClsPub.Security_Log(msg5, 1, true, msg4))
+                //{
+                //    objJsonResult.code = "0";
+                //    objJsonResult.count = 0;
+                //    objJsonResult.Message = "娌℃湁鎵惧埌璇ュ姛鑳芥ā鍧楋紒";
+                //    objJsonResult.data = null;
+                //    return objJsonResult;
+                //}
+
+                //if (!DBUtility.ClsPub.AllowNumber(HNumber))
+                //{
+                //    objJsonResult.code = "0";
+                //    objJsonResult.count = 0;
+                //    objJsonResult.Message = "浠g爜涓笉鑳藉嚭鐜拌繛缁��.鈥欏苟涓旈浣嶆湯浣嶄笉鑳戒负鈥�.鈥欙紒";
+                //    objJsonResult.data = null;
+                //    return objJsonResult;
+                //}
+
+                //if (oDept.HavSameNumber(HItemID, HNumber))
+                //{
+                //    objJsonResult.code = "0";
+                //    objJsonResult.count = 0;
+                //    objJsonResult.Message = "浠g爜閲嶅锛�";
+                //    objJsonResult.data = null;
+                //    return objJsonResult;
+                //}
+                //淇濆瓨
+                //淇濆瓨瀹屾瘯鍚庡鐞�
+                if (HItemID == 0)
+                {
+                    oCN.BeginTran();
+                    oCN.RunProc("Insert into Gy_Employee (" +
+                      "HNumber,HName,HShortNumber,HEmpRate,HExamRate" +
+                      ",HLevel,HParentID,HEndflag,HHighestPay,HOverPayRate" +
+                      ",HStopflag,HRemark,HHelpCode,HInsuranceSubsidy" +
+                      ",HBirthday,HGradDate,HInsuranceDate,HContractBDate,HContractEDate" +
+                      ",HJobCardEDate,HCheckCardEDate,HStayCardEDate,HHealthCardEDate" +
+                      ",HAge,HSalaryLev,HContractYear,HInsuranceStatus,HSignStatus" +
+                      ",HSex,HMarr,HBlighty,HNation,HBlightyType" +
+                      ",HGovStatus,HBloodType,HStature,HAvoird,HKnowLev" +
+                      ",HProTitleID,HGradSchool,HEngLev,HCompLev,HSpec" +
+                      ",HEmail,HNowAdd,HHomeAdd,HIDCard,HLinkPhone,HMobilePhone,HFax" +
+                      ",HOldCompany,HInsuranceNo,HJobCardNo,HArchivesNo,HWorkType,HDimissionReason" +
+                      ",HDimissionDate,HInComDate,HSignDate,HRelDate" +
+                      ",HPostID,HDormID,HDutyID,HLeftMoneyRate" +
+                      ",HEmpType,HPayType,HOverType,HNoBrushFlag,HShiftFlag,HStopwagesFlag" +
+                      ",HPostalCode,HBank,HBasePay,HExamLevPostMoney,HBSTDeptID" +
+                      ",HOtherDeduct3,HInsurance,HMedicare,HDrydock" +
+                      ",HBankAccount,HGroupID,HDeptID,HWorkTypeID,HCTPrjID,HAddress" +
+                      ") " +
+                    " Values('" + HNumber + "','" + HName + "','" + HShortNumber + "'," + HEmpRate.ToString() + "," + HExamRate.ToString() +
+                      "," + HLevel + "," + HParentID + "," + Convert.ToString(HEndFlag ? 1 : 0) + "," + HHighestPay.ToString() + "," + HOverPayRate.ToString() +
+                      "," + Convert.ToString(HStopflag ? 1 : 0) + ",'" + HRemark + "'" + ",'" + HHelpCode + "'," + HInsuranceSubsidy.ToString() + "" +
+                      ",'" + HBirthDay + "','" + HGradDate + "','" + HInsuranceDate + "','" + HContractBDate + "','" + HContractEDate + "'" +
+                      ",'" + HJobCardEDate + "','" + HCheckCardEDate + "','" + HStayCardEDate + "','" + HHealthCardEDate + "'" +
+                      "," + HAge.ToString() + ",'" + HSalaryLev + "'," + HContractYear.ToString() + "," + HInsuranceStatus + "," + Convert.ToString(HSignStatus ? 1 : 0) +
+                      ",'" + HSex + "','" + HMarr + "','" + HBlighty + "','" + HNation + "','" + HBlightyType + "'" +
+                      ",'" + HGovStatus + "','" + HBloodType + "','" + HStature + "','" + HAvoird + "','" + HKnowLev + "'" +
+                      ",'" + HProTitleID + "','" + HGradSchool + "','" + HEngLev + "','" + HCompLev + "','" + HSpec + "'" +
+                      ",'" + HEmail + "','" + HNowAdd + "','" + HHomeAdd + "','" + HIDCard + "','" + HLinkPhone + "','" + HMobilePhone + "','" + HFax + "'" +
+                      ",'" + HOldCompany + "','" + HInsuranceNo + "','" + HJobCardNo + "','" + HArchivesNo + "','" + HWorkType + "','" + HDimissionReason + "'" +
+                      ",'" + HDimissionDate + "','" + HInComDate + "','" + HSignDate + "','" + HRelDate + "'" +
+                      "," + HPostID.ToString() + "," + HDormID.ToString() + "," + HDutyID.ToString() + "," + HLeftMoneyRate.ToString() +
+                      ",'" + HEmpType + "'" + ",'" + HPayType + "'" + "," + DBUtility.ClsPub.BoolToString(HOverType) + "" + "," + DBUtility.ClsPub.BoolToString(HNoBrushFlag) + "" + "," + DBUtility.ClsPub.BoolToString(HShiftFlag) + "" + "," + DBUtility.ClsPub.BoolToString(HStopwagesFlag) + "" +
+                      ",'" + HPostalCode + "','" + HBank + "'," + HBasePay.ToString() + "," + HExamLevPostMoney.ToString() + ",'" + HBSTDeptID + "'" +
+                      "," + HOtherDeduct3.ToString() + "" + "," + HInsurance.ToString() + "" + "," + HMedicare.ToString() + "" + "," + HDrydock.ToString() + "" +
+                      ",'" + HBankAccount + "'" + "," + HGroupID.ToString() + "" + "," + HDeptID.ToString() + "," + HWorkTypeID.ToString() + "," + HCTPrjID.ToString() + ",'" + HAddress + "'" + "')", ref DBUtility.ClsPub.sExeReturnInfo);
+                    //淇敼涓婄骇涓洪潪鏈骇浠g爜
+                    oCN.RunProc("Update Gy_Employee set HStopflag=0 where HItemID=" + HParentID, ref DBUtility.ClsPub.sExeReturnInfo);
+                    oCN.Commit();
+                }
+                else
+                {
+                    //鑻AINDI閲嶅鍒欓噸鏂拌幏鍙�
+                    oCN.BeginTran();
+                    oCN.RunProc("Update Gy_Employee set " +
+                      "HNumber,HName,HShortNumber,HEmpRate,HExamRate" +
+                      ",HLevel,HParentID,HEndflag,HHighestPay,HOverPayRate" +
+                      ",HStopflag,HRemark,HHelpCode,HInsuranceSubsidy" +
+                      ",HBirthday,HGradDate,HInsuranceDate,HContractBDate,HContractEDate" +
+                      ",HJobCardEDate,HCheckCardEDate,HStayCardEDate,HHealthCardEDate" +
+                      ",HAge,HSalaryLev,HContractYear,HInsuranceStatus,HSignStatus" +
+                      ",HSex,HMarr,HBlighty,HNation,HBlightyType" +
+                      ",HGovStatus,HBloodType,HStature,HAvoird,HKnowLev" +
+                      ",HProTitleID,HGradSchool,HEngLev,HCompLev,HSpec" +
+                      ",HEmail,HNowAdd,HHomeAdd,HIDCard,HLinkPhone,HMobilePhone,HFax" +
+                      ",HOldCompany,HInsuranceNo,HJobCardNo,HArchivesNo,HWorkType,HDimissionReason" +
+                      ",HDimissionDate,HInComDate,HSignDate,HRelDate" +
+                      ",HPostID,HDormID,HDutyID,HLeftMoneyRate" +
+                      ",HEmpType,HPayType,HOverType,HNoBrushFlag,HShiftFlag,HStopwagesFlag" +
+                      ",HPostalCode,HBank,HBasePay,HExamLevPostMoney,HBSTDeptID" +
+                      ",HOtherDeduct3,HInsurance,HMedicare,HDrydock" +
+                      ",HBankAccount,HGroupID,HDeptID,HWorkTypeID,HCTPrjID,HAddress" + "'  Where HItemID=" + HItemID, ref DBUtility.ClsPub.sExeReturnInfo);
+                    oCN.RunProc("Update Gy_Employee set HStopflag=0 where HItemID=" + HParentID, ref DBUtility.ClsPub.sExeReturnInfo);
+                    oCN.Commit();
+                }
+                objJsonResult.code = "0";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "淇濆瓨鎴愬姛锛�";
+                //WebAPIController.Add_Log("閫佽揣鍗曚笅鎺�", UserName, "鐢熸垚閫佽揣鍗�");
+                objJsonResult.data = 1;
+                return objJsonResult;
+            }
+            catch (Exception e)
+            {
+                oCN.RollBack();
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "Exception锛�" + e.Message;
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        ///// <summary>
+        ///// 淇濆瓨鑱屽憳
+        ///// </summary>
+        ///// <param name="msg"></param>
+        ///// <returns></returns>
+        //[Route("SaveGy_EmployeeList")]
+        //[HttpPost]
+        //public object SaveGy_EmployeeList([FromBody] JObject msg)
+        //{
+        //    DataSet ds;
+        //    var _value = msg["msg"].ToString();
+        //    string msg1 = _value.ToString();
+        //    //string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
+        //    //string msg2 = sArray[0].ToString();
+        //    //string msg3 = sArray[1].ToString();
+        //    Int64 HItemID = 0;
+        //    SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+        //    //鑾峰彇鏈�澶D鍊艰祴鍊�
+        //    DataSet Maxds = oCN.RunProcReturn("select MAX(HItemID) HItemID from Gy_Employee ", "Gy_Employee");
+        //    if (Maxds != null || Maxds.Tables[0].Rows.Count > 0)
+        //    {
+        //        //HItemID= Maxds.Tables[0].Rows[0]["HItemID"]
+        //        var maxid = Convert.ToInt32(Maxds.Tables[0].Rows[0]["HItemID"]);
+        //        maxid += 1;
+        //        HItemID = maxid;
+        //    }
+        //    ListModels oListModels = new ListModels();
+        //    try
+        //    {
+        //        DAL.ClsGy_Employee_Ctl oBill = new DAL.ClsGy_Employee_Ctl();
+        //        List<Model.ClsGy_Employee_Model> lsmain = new List<Model.ClsGy_Employee_Model>();
+        //        msg1 = msg1.Replace("\\", "");
+        //        msg1 = msg1.Replace("\n", "");  //\n
+        //        lsmain = oListModels.getObjectByJson_Gy_Employee(msg1);
+        //        foreach (Model.ClsGy_Employee_Model oItem in lsmain)
+        //        {
+        //            if (oItem.HNumber.Trim() == "")
+        //            {
+        //                objJsonResult.code = "0";
+        //                objJsonResult.count = 0;
+        //                objJsonResult.Message = "淇濆瓨澶辫触锛佷唬鐮佷笉鑳戒负绌猴紒";
+        //                objJsonResult.data = 1;
+        //                return objJsonResult;
+        //            }
+        //            if (oItem.HName.Trim() == "")
+        //            {
+        //                objJsonResult.code = "0";
+        //                objJsonResult.count = 0;
+        //                objJsonResult.Message = "淇濆瓨澶辫触锛佸悕绉颁笉鑳戒负绌猴紒";
+        //                objJsonResult.data = 1;
+        //                return objJsonResult;
+        //            }
+        //            //txtHInsuranceDate
+        //            if (oItem.HInsuranceDate.Trim() != "")
+        //            {
+        //                if (DBUtility.ClsPub.isStrNull(DBUtility.ClsPub.isDate(oItem.HInsuranceDate.Trim())) == "1900-01-01 0:00:00")
+        //                {
+        //                    objJsonResult.code = "0";
+        //                    objJsonResult.count = 0;
+        //                    objJsonResult.Message = "淇濆瓨澶辫触锛佸弬淇濇棩鏈熸牸寮忎笉瀵癸紒";
+        //                    objJsonResult.data = 1;
+        //                    return objJsonResult;
+        //                }
+        //            }
+        //            //txtHDimissionDate
+        //            if (oItem.HDimissionDate.Trim() != "")
+        //            {
+        //                if (DBUtility.ClsPub.isStrNull(DBUtility.ClsPub.isDate(oItem.HDimissionDate.Trim())) == "1900-01-01 0:00:00")
+        //                {
+        //                    objJsonResult.code = "0";
+        //                    objJsonResult.count = 0;
+        //                    objJsonResult.Message = "淇濆瓨澶辫触锛佺鑱屾棩鏈熸牸寮忎笉瀵�!锛�";
+        //                    objJsonResult.data = 1;
+        //                    return objJsonResult;
+        //                }
+        //            }
+        //            //txtHStayCardEDate
+        //            if (oItem.HStayCardEDate.Trim() != "")
+        //            {
+        //                if (DBUtility.ClsPub.isStrNull(DBUtility.ClsPub.isDate(oItem.HStayCardEDate.Trim())) == "1900-01-01 0:00:00")
+        //                {
+        //                    objJsonResult.code = "0";
+        //                    objJsonResult.count = 0;
+        //                    objJsonResult.Message = "淇濆瓨澶辫触锛佹殏浣忚瘉鍒版湡鏃ユ牸寮忎笉瀵�!锛�";
+        //                    objJsonResult.data = 1;
+        //                    return objJsonResult;
+        //                }
+        //            }
+
+        //            if (!DBUtility.ClsPub.AllowNumber(oItem.HNumber.Trim()))
+        //            {
+        //                objJsonResult.code = "0";
+        //                objJsonResult.count = 0;
+        //                objJsonResult.Message = "淇濆瓨澶辫触锛佷唬鐮佷腑涓嶈兘鍑虹幇杩炵画鈥�.鈥欏苟涓旈浣嶆湯浣嶄笉鑳戒负鈥�.鈥欙紒";
+        //                objJsonResult.data = 1;
+        //                return objJsonResult;
+        //            }
+          
+        //            //鏌ヨ鏁版嵁涓槸鍚﹀瓨鍦ㄩ噸澶嶄唬鐮�
+        //            ds = oCN.RunProcReturn("select * from  Gy_Employee where HStopflag=0 and HNumber='" + oItem.HNumber.Trim() + "'", "Gy_Employee");
+        //            if (oItem.HNumber.Trim() == "")
+        //            {
+        //                objJsonResult.code = "0";
+        //                objJsonResult.count = 0;
+        //                objJsonResult.Message = "淇濆瓨澶辫触锛佷唬鐮佷负绌猴紒";
+        //                objJsonResult.data = 1;
+        //                return objJsonResult;
+        //            }
+        //            //鏂板鏃跺垽鏂�
+        //            if (oItem.HItemID == 0)
+        //            {
+        //                if (ds == null || ds.Tables[0].Rows.Count == 0)
+        //                {
+
+        //                }
+        //                else
+        //                {
+        //                    objJsonResult.code = "0";
+        //                    objJsonResult.count = 0;
+        //                    objJsonResult.Message = "淇濆瓨澶辫触锛佷唬鐮侀噸澶嶏紒";
+        //                    objJsonResult.data = 1;
+        //                    return objJsonResult;
+        //                }
+        //                //妫�鏌ョ埗绾ф槸鍚﹀瓨鍦�
+        //                string sParent;
+        //                sParent = DBUtility.ClsPub.GetParentCode(oItem.HNumber.Trim());
+        //                if (sParent.Trim() == "")
+        //                {
+        //                    oBill.oModel.HParentID = 0;
+        //                }
+        //                else
+        //                {
+        //                    if (oBill.HavParentCode(sParent.Trim(), HItemID))
+        //                    {
+        //                        oBill.oModel.HParentID = oBill.oModel.HItemID;
+        //                    }
+        //                    else
+        //                    {
+        //                        objJsonResult.code = "0";
+        //                        objJsonResult.count = 0;
+        //                        objJsonResult.Message = "淇濆瓨澶辫触锛佷笂绾т唬鐮佷笉瀛樺湪鎴栬绂佺敤锛�";
+        //                        objJsonResult.data = 1;
+        //                        return objJsonResult;
+        //                    }
+        //                }
+        //            }
+        //            else//缂栬緫鏃跺垽鏂�
+        //            {
+        //                //妫�鏌ョ埗绾ф槸鍚﹀瓨鍦�
+        //                string sParent;
+        //                sParent = DBUtility.ClsPub.GetParentCode(oItem.HNumber.Trim());
+        //                if (sParent.Trim() == "")
+        //                {
+        //                    oBill.oModel.HParentID = 0;
+        //                }
+        //                else
+        //                {
+        //                    if (oBill.HavParentCode(sParent.Trim(), oItem.HItemID))
+        //                    {
+        //                        oBill.oModel.HParentID = oBill.oModel.HItemID;
+        //                    }
+        //                    else
+        //                    {
+        //                        objJsonResult.code = "0";
+        //                        objJsonResult.count = 0;
+        //                        objJsonResult.Message = "淇濆瓨澶辫触锛佷笂绾т唬鐮佷笉瀛樺湪鎴栬绂佺敤锛�";
+        //                        objJsonResult.data = 1;
+        //                        return objJsonResult;
+        //                    }
+        //                }
+        //            }
+        //            //寰楀埌鐭唬鐮�
+        //            string sShortNumber;
+        //            sShortNumber = DBUtility.ClsPub.GetShortNumber(oItem.HNumber.Trim());
+        //            if (sShortNumber.Trim() == "")
+        //            {
+        //                objJsonResult.code = "0";
+        //                objJsonResult.count = 0;
+        //                objJsonResult.Message = "淇濆瓨澶辫触锛佺煭浠g爜涓虹┖锛�";
+        //                objJsonResult.data = 1;
+        //                return objJsonResult;
+        //            }
+        //            if (DBUtility.ClsPub.isDate(oBill.oModel.HDimissionDate) < Convert.ToDateTime("1950-01-01"))
+        //            {
+        //                oBill.oModel.HDimissionDate = "2050-01-01";
+        //            }
+        //            oItem.HShortNumber = sShortNumber;//鐭唬鐮�
+        //            oItem.HEndFlag = true;//鏈骇鏍囧織
+        //            oItem.HLevel = DBUtility.ClsPub.GetLevel(oItem.HNumber.Trim()); //绛夌骇
+        //            oBill.oModel = oItem;
+        //        }
+
+        //        //淇濆瓨
+        //        //淇濆瓨瀹屾瘯鍚庡鐞�
+        //        bool bResult;
+        //        if (oBill.oModel.HItemID == 0)
+        //        {
+        //            // bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
+        //            bResult = oBill.AddNew();
+        //        }
+        //        else
+        //        {
+        //            bResult = oBill.ModifyByID(oBill.oModel.HItemID);
+        //        }
+        //        if (bResult)
+        //        {
+        //            objJsonResult.code = "0";
+        //            objJsonResult.count = 1;
+        //            objJsonResult.Message = "淇濆瓨鎴愬姛锛�";
+        //            //WebAPIController.Add_Log("閫佽揣鍗曚笅鎺�", UserName, "鐢熸垚閫佽揣鍗�");
+        //            objJsonResult.data = 1;
+        //            return objJsonResult;
+        //        }
+        //        else
+        //        {
+        //            objJsonResult.code = "0";
+        //            objJsonResult.count = 0;
+        //            objJsonResult.Message = "淇濆瓨澶辫触锛�" + DBUtility.ClsPub.sExeReturnInfo;
+        //            objJsonResult.data = 1;
+        //            return objJsonResult;
+        //        }
+        //    }
+        //    catch (Exception e)
+        //    {
+        //        objJsonResult.code = "0";
+        //        objJsonResult.count = 0;
+        //        objJsonResult.Message = "淇濆瓨澶辫触锛�" + e.ToString();
+        //        objJsonResult.data = 1;
+        //        return objJsonResult;
+        //    }
+        //}
 
 
 
diff --git a/WebAPI/Controllers/BaseSet/Gy_GroupController.cs b/WebAPI/Controllers/BaseSet/Gy_GroupController.cs
index 60943c9..12eeffb 100644
--- a/WebAPI/Controllers/BaseSet/Gy_GroupController.cs
+++ b/WebAPI/Controllers/BaseSet/Gy_GroupController.cs
@@ -150,14 +150,14 @@
                 msg1 = "[" + msg1.ToString() + "]";
                 DAL.ClsGy_Group_Ctl oDept = new DAL.ClsGy_Group_Ctl();
                 List<Gy_Group> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Gy_Group>>(msg1);
-                long HItemID = list[0].HItemID.ToString() == "" ? 0 : list[0].HItemID;
+                long HItemID = list[0].HItemID;
                 string HNumber = list[0].HNumber;
                 string HName = list[0].HName;
                 string HShortNumber = list[0].HShortNumber;
                 long HParentID = list[0].HParentID;
                 string HHelpCode = list[0].HHelpCode;
                 string HRemark = list[0].HRemark;
-                string HStopflag = list[0].HStopflag == "True" ? "1" : "0";
+                bool HStopflag = list[0].HStopflag;
                 string HUseFlag = list[0].HUseFlag;
                 var HEmpQty = list[0].HEmpQty;
                 var HBarCodeForBase = list[0].HBarCodeForBase;
@@ -182,7 +182,7 @@
                    ",HDeptNumber,HEmpQty" +
                    ",HLevel,HEndFlag,HStopflag,HRemark,HDeptID,HBarCodeForBase" +
                    ",HProcID) " +
-                   " Values('" + HNumber + "','" + HName + "','" + HHelpCode + "','" + HShortNumber + "'," + HItemID.ToString() +
+                   " Values('" + HNumber + "','" + HName + "','" + HHelpCode + "','" + HShortNumber + "'," + HParentID.ToString() +
                    ",'" + HDeptNumber + "'," + HEmpQty +
                    ",'" + HLevel.ToString() + "'," + HEndFlag + "," + HStopflag +
                    ",'" + HRemark + "'," + HDeptID + ",'" + HBarCodeForBase + "','" + HProcID + "')";
@@ -210,22 +210,29 @@
             }
         }
         /// <summary>
-        /// 淇敼鍗曟嵁-淇濆瓨鎸夐挳
+        /// 淇濆瓨鎸夐挳
         ///鍙傛暟锛歴tring sql銆�
         ///杩斿洖鍊硷細object銆�
         /// </summary>
-        [Route("Gy_Group/EditBill")]
+        [Route("Gy_Group/ModifyByID")]
         [HttpPost]
-        public object EditBill([FromBody] JObject oMain)
+        public object ModifyByID([FromBody] JObject oMain)
         {
             try
             {
+                DAL.ClsGy_Group_Ctl oDept = new DAL.ClsGy_Group_Ctl();
+                DAL.ClsGy_Group_View oDeptHlp = new DAL.ClsGy_Group_View();
+
                 var _value = oMain["oMain"].ToString();
                 string msg1 = _value.ToString();
+                string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
+                string msg2 = sArray[0].ToString();
+                //string msg3 = sArray[1].ToString();
+                //string msg4 = sArray[2].ToString();
+                //string msg5 = sArray[3].ToString();
                 //鍙嶅簭鍒楀寲
-                msg1 = "[" + msg1.ToString() + "]";
-                DAL.ClsGy_Group_Ctl oDept = new DAL.ClsGy_Group_Ctl();
-                List<Gy_Group> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Gy_Group>>(msg1);
+                msg2 = "[" + msg2.ToString() + "]";
+                List<Gy_Group> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Gy_Group>>(msg2);
 
                 long HItemID = list[0].HItemID;
                 string HNumber = list[0].HNumber;
@@ -234,14 +241,19 @@
                 long HParentID = list[0].HParentID;
                 string HHelpCode = list[0].HHelpCode;
                 string HRemark = list[0].HRemark;
-                string HStopflag = list[0].HStopflag;
+                bool HStopflag = list[0].HStopflag;
+                bool HEndFlag = list[0].HEndFlag;
                 string HUseFlag = list[0].HUseFlag;
                 var HEmpQty = list[0].HEmpQty;
                 var HBarCodeForBase = list[0].HBarCodeForBase;
                 var HDeptID = list[0].HDeptID;
-                var HProcID = list[0].HProcID;
+                long HProcID = list[0].HProcID;
+                var HDeptNumber = "";
+                //var HEndFlag = 0;
+                long HLevel = 1;
+                //var HProcID = "";
 
-                //鍒ゆ柇鏉冮檺
+                ////鍒ゆ柇鏉冮檺
                 //if (!ClsPub.Security_Log(msg5, 1, true, msg4))
                 //{
                 //    objJsonResult.code = "0";
@@ -250,6 +262,7 @@
                 //    objJsonResult.data = null;
                 //    return objJsonResult;
                 //}
+
                 //if (!DBUtility.ClsPub.AllowNumber(HNumber))
                 //{
                 //    objJsonResult.code = "0";
@@ -258,6 +271,7 @@
                 //    objJsonResult.data = null;
                 //    return objJsonResult;
                 //}
+
                 //if (oDept.HavSameNumber(HItemID, HNumber))
                 //{
                 //    objJsonResult.code = "0";
@@ -266,31 +280,46 @@
                 //    objJsonResult.data = null;
                 //    return objJsonResult;
                 //}
-                //鑻AINDI閲嶅鍒欓噸鏂拌幏鍙�
-                oCN.BeginTran();
-                //涓昏〃
-                oCN.RunProc("Update Gy_Group set " +
-                    " HNumber='" + HNumber + "'" +
-                    ",HName='" + HName + "'" +
-                    ",HShortNumber='" + HShortNumber + "'" +
-                    ",HHelpCode='" + HHelpCode + "'" +
-                    ",HParentID=" + HParentID +
-                    ",HStopflag='" + HStopflag + "'" +
-                    ",HRemark= '" + HRemark + "'" +
-                    ",HDeptID=" + HDeptID +
-                    ",HEmpQty=" + HEmpQty +
-                    ",HBarCodeForBase='" + HBarCodeForBase + "' " +
-                    ", HProcID = '" + HProcID + "'  Where HItemID=" + HItemID, ref DBUtility.ClsPub.sExeReturnInfo);
-                //淇敼瀛愰」鐩唬鐮�
-                //oCN.RunProc("exec h_p_Gy_UpdateNumber Gy_Group,'" + HNumber + ".','" + this.HOldNumber + ".'", ref DBUtility.ClsPub.sExeReturnInfo);
-                //灏嗕笂绾� 涓洪潪鏈骇
-                //oCN.RunProc("Update Gy_Group set HEndflag=0 where HItemID=" + HParentID, ref DBUtility.ClsPub.sExeReturnInfo);
-                //
-                oCN.Commit();
-                objJsonResult.code = "1";
+                //淇濆瓨
+                //淇濆瓨瀹屾瘯鍚庡鐞�
+                if (HItemID == 0)
+                {
+                    oCN.BeginTran();
+                    oCN.RunProc("Insert into Gy_Group " +
+                    " (HNumber,HName,HHelpCode,HShortNumber,HParentID" +
+                    ",HEmpQty,HDeptID,HDeptNumber,HProcID" +
+                    ",HLevel,HEndFlag,HStopflag,HRemark,HBarCodeForBase) " +
+                    " Values('" + HNumber + "','" + HName + "','" + HHelpCode + "','" + HShortNumber + "'," + HParentID.ToString() +
+                    "," + HEmpQty.ToString() + "," + HDeptID.ToString() + ",'" + HDeptNumber + "'," + HProcID.ToString() +
+                    "," + HLevel.ToString() + "," + Convert.ToString(HEndFlag ? 1 : 0) + "," + Convert.ToString(HStopflag ? 1 : 0) + ",'" + HRemark + "','" + HBarCodeForBase + "')", ref DBUtility.ClsPub.sExeReturnInfo);
+                    //淇敼涓婄骇涓洪潪鏈骇浠g爜
+                    oCN.RunProc("Update Gy_Group set HEndflag=0 where HItemID=" + HParentID, ref DBUtility.ClsPub.sExeReturnInfo);
+                    oCN.Commit();
+                }
+                else
+                {
+                    //鑻AINDI閲嶅鍒欓噸鏂拌幏鍙�
+                    oCN.BeginTran();
+                    oCN.RunProc("Update Gy_Group set " + 
+                                 " HNumber='" + HNumber + "'" +
+                                 ",HName='" + HName + "'" +
+                                 ",HShortNumber='" + HShortNumber + "'" +
+                                 ",HHelpCode='" + HHelpCode + "'" +
+                                 ",HParentID=" + HParentID +
+                                 ",HStopflag='" + HStopflag + "'" +
+                                 ",HRemark= '" + HRemark + "'" +
+                                 ",HDeptID=" + HDeptID +
+                                 ",HEmpQty=" + HEmpQty +
+                                 ",HBarCodeForBase='" + HBarCodeForBase + "' " +
+                                 ", HProcID = '" + HProcID + "'  Where HItemID=" + HItemID, ref DBUtility.ClsPub.sExeReturnInfo);
+                    oCN.RunProc("Update Gy_Group set HEndflag=0 where HItemID=" + HParentID, ref DBUtility.ClsPub.sExeReturnInfo);
+                    oCN.Commit();
+                }
+                objJsonResult.code = "0";
                 objJsonResult.count = 1;
-                objJsonResult.Message = "淇敼鍗曟嵁鎴愬姛锛�";
-                //objJsonResult.data = null;
+                objJsonResult.Message = "淇濆瓨鎴愬姛锛�";
+                //WebAPIController.Add_Log("閫佽揣鍗曚笅鎺�", UserName, "鐢熸垚閫佽揣鍗�");
+                objJsonResult.data = 1;
                 return objJsonResult;
             }
             catch (Exception e)
@@ -303,6 +332,100 @@
                 return objJsonResult;
             }
         }
+        ///// <summary>
+        ///// 淇敼鍗曟嵁-淇濆瓨鎸夐挳
+        /////鍙傛暟锛歴tring sql銆�
+        /////杩斿洖鍊硷細object銆�
+        ///// </summary>
+        //[Route("Gy_Group/EditBill")]
+        //[HttpPost]
+        //public object EditBill([FromBody] JObject oMain)
+        //{
+        //    try
+        //    {
+        //        var _value = oMain["oMain"].ToString();
+        //        string msg1 = _value.ToString();
+        //        //鍙嶅簭鍒楀寲
+        //        msg1 = "[" + msg1.ToString() + "]";
+        //        DAL.ClsGy_Group_Ctl oDept = new DAL.ClsGy_Group_Ctl();
+        //        List<Gy_Group> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Gy_Group>>(msg1);
+
+        //        long HItemID = list[0].HItemID;
+        //        string HNumber = list[0].HNumber;
+        //        string HName = list[0].HName;
+        //        string HShortNumber = list[0].HNumber;
+        //        long HParentID = list[0].HParentID;
+        //        string HHelpCode = list[0].HHelpCode;
+        //        string HRemark = list[0].HRemark;
+        //        string HStopflag = list[0].HStopflag;
+        //        string HUseFlag = list[0].HUseFlag;
+        //        var HEmpQty = list[0].HEmpQty;
+        //        var HBarCodeForBase = list[0].HBarCodeForBase;
+        //        var HDeptID = list[0].HDeptID;
+        //        var HProcID = list[0].HProcID;
+
+        //        //鍒ゆ柇鏉冮檺
+        //        //if (!ClsPub.Security_Log(msg5, 1, true, msg4))
+        //        //{
+        //        //    objJsonResult.code = "0";
+        //        //    objJsonResult.count = 0;
+        //        //    objJsonResult.Message = "娌℃湁鎵惧埌璇ュ姛鑳芥ā鍧楋紒";
+        //        //    objJsonResult.data = null;
+        //        //    return objJsonResult;
+        //        //}
+        //        //if (!DBUtility.ClsPub.AllowNumber(HNumber))
+        //        //{
+        //        //    objJsonResult.code = "0";
+        //        //    objJsonResult.count = 0;
+        //        //    objJsonResult.Message = "浠g爜涓笉鑳藉嚭鐜拌繛缁��.鈥欏苟涓旈浣嶆湯浣嶄笉鑳戒负鈥�.鈥欙紒";
+        //        //    objJsonResult.data = null;
+        //        //    return objJsonResult;
+        //        //}
+        //        //if (oDept.HavSameNumber(HItemID, HNumber))
+        //        //{
+        //        //    objJsonResult.code = "0";
+        //        //    objJsonResult.count = 0;
+        //        //    objJsonResult.Message = "浠g爜閲嶅锛�";
+        //        //    objJsonResult.data = null;
+        //        //    return objJsonResult;
+        //        //}
+        //        //鑻AINDI閲嶅鍒欓噸鏂拌幏鍙�
+        //        oCN.BeginTran();
+        //        //涓昏〃
+        //        oCN.RunProc("Update Gy_Group set " +
+        //            " HNumber='" + HNumber + "'" +
+        //            ",HName='" + HName + "'" +
+        //            ",HShortNumber='" + HShortNumber + "'" +
+        //            ",HHelpCode='" + HHelpCode + "'" +
+        //            ",HParentID=" + HParentID +
+        //            ",HStopflag='" + HStopflag + "'" +
+        //            ",HRemark= '" + HRemark + "'" +
+        //            ",HDeptID=" + HDeptID +
+        //            ",HEmpQty=" + HEmpQty +
+        //            ",HBarCodeForBase='" + HBarCodeForBase + "' " +
+        //            ", HProcID = '" + HProcID + "'  Where HItemID=" + HItemID, ref DBUtility.ClsPub.sExeReturnInfo);
+        //        //淇敼瀛愰」鐩唬鐮�
+        //        //oCN.RunProc("exec h_p_Gy_UpdateNumber Gy_Group,'" + HNumber + ".','" + this.HOldNumber + ".'", ref DBUtility.ClsPub.sExeReturnInfo);
+        //        //灏嗕笂绾� 涓洪潪鏈骇
+        //        //oCN.RunProc("Update Gy_Group set HEndflag=0 where HItemID=" + HParentID, ref DBUtility.ClsPub.sExeReturnInfo);
+        //        //
+        //        oCN.Commit();
+        //        objJsonResult.code = "1";
+        //        objJsonResult.count = 1;
+        //        objJsonResult.Message = "淇敼鍗曟嵁鎴愬姛锛�";
+        //        //objJsonResult.data = null;
+        //        return objJsonResult;
+        //    }
+        //    catch (Exception e)
+        //    {
+        //        oCN.RollBack();
+        //        objJsonResult.code = "0";
+        //        objJsonResult.count = 0;
+        //        objJsonResult.Message = "Exception锛�" + e.Message;
+        //        objJsonResult.data = null;
+        //        return objJsonResult;
+        //    }
+        //}
         /// <summary>
         /// 鐝粍鍒犻櫎鍔熻兘
         /// </summary>
diff --git a/WebAPI/Controllers/BaseSet/Gy_ProcessController.cs b/WebAPI/Controllers/BaseSet/Gy_ProcessController.cs
index dc4e727..fc0a163 100644
--- a/WebAPI/Controllers/BaseSet/Gy_ProcessController.cs
+++ b/WebAPI/Controllers/BaseSet/Gy_ProcessController.cs
@@ -16,16 +16,14 @@
         private json objJsonResult = new json();
         SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
         DataSet ds;
-
         /// <summary>
-        /// 淇敼鍗曟嵁-淇濆瓨鎸夐挳
+        /// 鏂板鍗曟嵁-淇濆瓨鎸夐挳
         ///鍙傛暟锛歴tring sql銆�
         ///杩斿洖鍊硷細object銆�
         /// </summary>
-        [Route("Gy_Process/EditBill")]
+        [Route("Gy_Process/AddNew")]
         [HttpPost]
-        //鍘熶唬鐮� 鐢ㄤ簬 鏇挎崲瀛愰」鐩�
-        public object EditBill([FromBody] JObject oMain)
+        public object AddNew([FromBody] JObject oMain)
         {
             try
             {
@@ -33,7 +31,9 @@
                 string msg1 = _value.ToString();
                 //鍙嶅簭鍒楀寲
                 msg1 = "[" + msg1.ToString() + "]";
+
                 DAL.ClsGy_Process_Ctl oDept = new DAL.ClsGy_Process_Ctl();
+                DAL.ClsGy_Process_View oDeptHlp = new DAL.ClsGy_Process_View();
                 List<Gy_Process> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Gy_Process>>(msg1);
 
                 long HItemID = list[0].HItemID;
@@ -64,47 +64,16 @@
                 long HDeptID = list[0].HDeptID;
                 long HProcID = list[0].HProcID;
 
-                //鍒ゆ柇鏉冮檺
-                //if (!ClsPub.Security_Log(msg5, 1, true, msg4))
-                //{
-                //    objJsonResult.code = "0";
-                //    objJsonResult.count = 0;
-                //    objJsonResult.Message = "娌℃湁鎵惧埌璇ュ姛鑳芥ā鍧楋紒";
-                //    objJsonResult.data = null;
-                //    return objJsonResult;
-                //}
-                //if (!DBUtility.ClsPub.AllowNumber(HNumber))
-                //{
-                //    objJsonResult.code = "0";
-                //    objJsonResult.count = 0;
-                //    objJsonResult.Message = "浠g爜涓笉鑳藉嚭鐜拌繛缁��.鈥欏苟涓旈浣嶆湯浣嶄笉鑳戒负鈥�.鈥欙紒";
-                //    objJsonResult.data = null;
-                //    return objJsonResult;
-                //}
-                //if (oDept.HavSameNumber(HItemID, HNumber))
-                //{
-                //    objJsonResult.code = "0";
-                //    objJsonResult.count = 0;
-                //    objJsonResult.Message = "浠g爜閲嶅锛�";
-                //    objJsonResult.data = null;
-                //    return objJsonResult;
-                //}
+                if (!DBUtility.ClsPub.AllowNumber(HNumber))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "浠g爜涓笉鑳藉嚭鐜拌繛缁��.鈥欏苟涓旈浣嶆湯浣嶄笉鑳戒负鈥�.鈥欙紒";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
                 //鑻AINDI閲嶅鍒欓噸鏂拌幏鍙�
-
-                //涓昏〃
-
-                //oCN.RunProc("Update Gy_Process set " +
-                //    " (HNumber,HName,HHelpCode,HShortNumber,HParentID" +
-                //    ",HTypeFlow,HTypeCount,HDeptNumber,HSNo" +
-                //    ",HLevel,HEndFlag,HStopflag,HRemark,HDeptID,HBarCodeForBase,HProcessID_K3,HBillSubType,HAutoTrunFlag" +
-                //    ",HFixPrice,HOverFixPrice,HProcMulID,HProcCheckNote) " +
-                //    " Values('" + HNumber + "','" + HName + "','" + HHelpCode + "','" + HShortNumber + "'," + HParentID.ToString() +
-                //    "," + Convert.ToString(HTypeFlow ? 1 : 0) + "," + Convert.ToString(HTypeCount ? 1 : 0) + ",'" + HDeptNumber + "'," + HSNo.ToString() +
-                //    "," + HLevel.ToString() + "," + Convert.ToString(HEndFlag ? 1 : 0) + "," + Convert.ToString(HStopflag ? 1 : 0) + ",'" + HRemark + "'," + HDeptID +
-                //    ",'" + HBarCode + "'," + HProcessID_K3 + ",'" + HBillSubType + "'," + Convert.ToString(HAutoTrunFlag ? 1 : 0) +
-                //    "," + HFixPrice.ToString() + "," +HOverFixPrice.ToString() + "," + HProcMulID.ToString() + ",'" + HProcCheckNote.ToString() + "')", ref DBUtility.ClsPub.sExeReturnInfo);
-
-
                 oCN.BeginTran();
                 oCN.RunProc("Update Gy_Process set " +
                     " HNumber='" + HNumber + "'" +
@@ -131,16 +100,11 @@
                     ",HProcCheckNote='" + HProcCheckNote + "' Where HItemID=" + HItemID, ref DBUtility.ClsPub.sExeReturnInfo);
                 //淇敼涓婄骇涓洪潪鏈骇浠g爜
                 oCN.RunProc("Update Gy_Process set HEndflag=0 where HItemID=" + HParentID, ref DBUtility.ClsPub.sExeReturnInfo);
-                //return true;
-                //淇敼瀛愰」鐩唬鐮�
-                //oCN.RunProc("exec h_p_Gy_UpdateNumber Gy_Group,'" + HNumber + ".','" + this.HOldNumber + ".'", ref DBUtility.ClsPub.sExeReturnInfo);
-                //灏嗕笂绾� 涓洪潪鏈骇
-                //oCN.RunProc("Update Gy_Group set HEndflag=0 where HItemID=" + HParentID, ref DBUtility.ClsPub.sExeReturnInfo);
-                //
+
                 oCN.Commit();
                 objJsonResult.code = "1";
                 objJsonResult.count = 1;
-                objJsonResult.Message = "淇敼鍗曟嵁鎴愬姛锛�";
+                objJsonResult.Message = "鏂板鍗曟嵁鎴愬姛锛�";
                 //objJsonResult.data = null;
                 return objJsonResult;
             }
@@ -154,6 +118,293 @@
                 return objJsonResult;
             }
         }
+
+        ///// <summary>
+        ///// 淇敼鍗曟嵁-淇濆瓨鎸夐挳
+        /////鍙傛暟锛歴tring sql銆�
+        /////杩斿洖鍊硷細object銆�
+        ///// </summary>
+        //[Route("Gy_Process/EditBill")]
+        //[HttpPost]
+        ////鍘熶唬鐮� 鐢ㄤ簬 鏇挎崲瀛愰」鐩�
+        //public object EditBill([FromBody] JObject oMain)
+        //{
+        //    try
+        //    {
+        //        var _value = oMain["oMain"].ToString();
+        //        string msg1 = _value.ToString();
+        //        //鍙嶅簭鍒楀寲
+        //        msg1 = "[" + msg1.ToString() + "]";
+        //        DAL.ClsGy_Process_Ctl oDept = new DAL.ClsGy_Process_Ctl();
+        //        List<Gy_Process> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Gy_Process>>(msg1);
+
+        //        long HItemID = list[0].HItemID;
+        //        string HNumber = list[0].HNumber;
+        //        string HName = list[0].HName;
+        //        string HShortNumber = list[0].HNumber;
+        //        long HParentID = list[0].HParentID;
+        //        string HHelpCode = list[0].HHelpCode;
+        //        bool HTypeFlow = list[0].HTypeFlow;
+        //        bool HTypeCount = list[0].HTypeCount;
+        //        string HDeptNumber = "";
+        //        long HLevel = ClsPub.GetLevel(list[0].HNumber.Trim());
+        //        bool HEndFlag = false;
+        //        long HProcessID_K3 = list[0].HProcessID_K3;
+        //        string HBillSubType = list[0].HType;
+        //        bool HAutoTrunFlag = list[0].HAutoTrunFlag;
+        //        string HFixPrice = list[0].HFixPrice;
+        //        string HOverFixPrice = list[0].HOverFixPrice;
+        //        string HSNo = list[0].HSNo;
+        //        string HBarCode = list[0].HBarCode;
+        //        string HProcMulID = list[0].HProcMulID;
+        //        string HProcCheckNote = list[0].HProcCheckNote;
+        //        string HRemark = list[0].HRemark;
+        //        bool HStopflag = list[0].HStopflag;
+        //        string HUseFlag = list[0].HUseFlag;
+        //        long HEmpQty = list[0].HEmpQty;
+        //        string HBarCodeForBase = list[0].HBarCodeForBase;
+        //        long HDeptID = list[0].HDeptID;
+        //        long HProcID = list[0].HProcID;
+
+        //        //鍒ゆ柇鏉冮檺
+        //        //if (!ClsPub.Security_Log(msg5, 1, true, msg4))
+        //        //{
+        //        //    objJsonResult.code = "0";
+        //        //    objJsonResult.count = 0;
+        //        //    objJsonResult.Message = "娌℃湁鎵惧埌璇ュ姛鑳芥ā鍧楋紒";
+        //        //    objJsonResult.data = null;
+        //        //    return objJsonResult;
+        //        //}
+        //        //if (!DBUtility.ClsPub.AllowNumber(HNumber))
+        //        //{
+        //        //    objJsonResult.code = "0";
+        //        //    objJsonResult.count = 0;
+        //        //    objJsonResult.Message = "浠g爜涓笉鑳藉嚭鐜拌繛缁��.鈥欏苟涓旈浣嶆湯浣嶄笉鑳戒负鈥�.鈥欙紒";
+        //        //    objJsonResult.data = null;
+        //        //    return objJsonResult;
+        //        //}
+        //        //if (oDept.HavSameNumber(HItemID, HNumber))
+        //        //{
+        //        //    objJsonResult.code = "0";
+        //        //    objJsonResult.count = 0;
+        //        //    objJsonResult.Message = "浠g爜閲嶅锛�";
+        //        //    objJsonResult.data = null;
+        //        //    return objJsonResult;
+        //        //}
+        //        //鑻AINDI閲嶅鍒欓噸鏂拌幏鍙�
+
+        //        //涓昏〃
+
+        //        //oCN.RunProc("Update Gy_Process set " +
+        //        //    " (HNumber,HName,HHelpCode,HShortNumber,HParentID" +
+        //        //    ",HTypeFlow,HTypeCount,HDeptNumber,HSNo" +
+        //        //    ",HLevel,HEndFlag,HStopflag,HRemark,HDeptID,HBarCodeForBase,HProcessID_K3,HBillSubType,HAutoTrunFlag" +
+        //        //    ",HFixPrice,HOverFixPrice,HProcMulID,HProcCheckNote) " +
+        //        //    " Values('" + HNumber + "','" + HName + "','" + HHelpCode + "','" + HShortNumber + "'," + HParentID.ToString() +
+        //        //    "," + Convert.ToString(HTypeFlow ? 1 : 0) + "," + Convert.ToString(HTypeCount ? 1 : 0) + ",'" + HDeptNumber + "'," + HSNo.ToString() +
+        //        //    "," + HLevel.ToString() + "," + Convert.ToString(HEndFlag ? 1 : 0) + "," + Convert.ToString(HStopflag ? 1 : 0) + ",'" + HRemark + "'," + HDeptID +
+        //        //    ",'" + HBarCode + "'," + HProcessID_K3 + ",'" + HBillSubType + "'," + Convert.ToString(HAutoTrunFlag ? 1 : 0) +
+        //        //    "," + HFixPrice.ToString() + "," +HOverFixPrice.ToString() + "," + HProcMulID.ToString() + ",'" + HProcCheckNote.ToString() + "')", ref DBUtility.ClsPub.sExeReturnInfo);
+
+
+        //        oCN.BeginTran();
+        //        oCN.RunProc("Update Gy_Process set " +
+        //            " HNumber='" + HNumber + "'" +
+        //            ",HName='" + HName + "'" +
+        //            ",HHelpCode='" + HHelpCode + "'" +
+        //            ",HShortNumber='" + HShortNumber + "'" +
+        //            ",HParentID= " + HParentID +
+        //            ",HTypeFlow= '" + HTypeFlow + "'" +
+        //            ",HTypeCount= '" + HTypeCount + "'" +
+        //            ",HDeptNumber='" + HDeptNumber + "'" +
+        //            ",HSNo= " + HSNo +
+        //            ",HLevel= " + HLevel +
+        //            ",HEndFlag= '" + HEndFlag + "'" +
+        //            ",HStopflag= '" + HStopflag + "'" +
+        //            ",HRemark='" + HRemark + "'" +
+        //            ",HDeptID= " + HDeptID +
+        //            ",HBarCodeForBase='" + HBarCodeForBase + "'" +
+        //            ",HProcessID_K3= " + HProcessID_K3 +
+        //            ",HBillSubType='" + HBillSubType + "'" +
+        //            ",HAutoTrunFlag= '" + HAutoTrunFlag + "'" +
+        //            ",HFixPrice= " + HFixPrice +
+        //            ",HOverFixPrice= " + HOverFixPrice +
+        //            ",HProcMulID= " + HProcMulID +
+        //            ",HProcCheckNote='" + HProcCheckNote + "' Where HItemID=" + HItemID, ref DBUtility.ClsPub.sExeReturnInfo);
+        //        //淇敼涓婄骇涓洪潪鏈骇浠g爜
+        //        oCN.RunProc("Update Gy_Process set HEndflag=0 where HItemID=" + HParentID, ref DBUtility.ClsPub.sExeReturnInfo);
+        //        //return true;
+        //        //淇敼瀛愰」鐩唬鐮�
+        //        //oCN.RunProc("exec h_p_Gy_UpdateNumber Gy_Group,'" + HNumber + ".','" + this.HOldNumber + ".'", ref DBUtility.ClsPub.sExeReturnInfo);
+        //        //灏嗕笂绾� 涓洪潪鏈骇
+        //        //oCN.RunProc("Update Gy_Group set HEndflag=0 where HItemID=" + HParentID, ref DBUtility.ClsPub.sExeReturnInfo);
+        //        //
+        //        oCN.Commit();
+        //        objJsonResult.code = "1";
+        //        objJsonResult.count = 1;
+        //        objJsonResult.Message = "淇敼鍗曟嵁鎴愬姛锛�";
+        //        //objJsonResult.data = null;
+        //        return objJsonResult;
+        //    }
+        //    catch (Exception e)
+        //    {
+        //        oCN.RollBack();
+        //        objJsonResult.code = "0";
+        //        objJsonResult.count = 0;
+        //        objJsonResult.Message = "Exception锛�" + e.Message;
+        //        objJsonResult.data = null;
+        //        return objJsonResult;
+        //    }
+        //}
+
+        /// <summary>
+        /// 淇濆瓨鎸夐挳
+        ///鍙傛暟锛歴tring sql銆�
+        ///杩斿洖鍊硷細object銆�
+        /// </summary>
+        [Route("Gy_Process/ModifyByID")]
+        [HttpPost]
+        public object ModifyByID([FromBody] JObject oMain)
+        {
+            try
+            {
+                DAL.ClsGy_Process_Ctl oDept = new DAL.ClsGy_Process_Ctl();
+                DAL.ClsGy_Process_View oDeptHlp = new DAL.ClsGy_Process_View();
+
+                var _value = oMain["oMain"].ToString();
+                string msg1 = _value.ToString();
+                string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
+                string msg2 = sArray[0].ToString();
+                //string msg3 = sArray[1].ToString();
+                //string msg4 = sArray[2].ToString();
+                //string msg5 = sArray[3].ToString();
+                //鍙嶅簭鍒楀寲
+                msg2 = "[" + msg2.ToString() + "]";
+                List<Gy_Process> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Gy_Process>>(msg2);
+
+                long HItemID = list[0].HItemID;
+                string HNumber = list[0].HNumber;
+                string HName = list[0].HName;
+                string HShortNumber = list[0].HNumber;
+                long HParentID = list[0].HParentID;
+                string HHelpCode = list[0].HHelpCode;
+                bool HTypeFlow = list[0].HTypeFlow;
+                bool HTypeCount = list[0].HTypeCount;
+                string HDeptNumber = "";
+                long HLevel = ClsPub.GetLevel(list[0].HNumber.Trim());
+                bool HEndFlag = false;
+                long HProcessID_K3 = list[0].HProcessID_K3;
+                string HBillSubType = list[0].HType;
+                bool HAutoTrunFlag = list[0].HAutoTrunFlag;
+                string HFixPrice = list[0].HFixPrice;
+                string HOverFixPrice = list[0].HOverFixPrice;
+                string HSNo = list[0].HSNo;
+                string HBarCode = list[0].HBarCode;
+                string HProcMulID = list[0].HProcMulID;
+                string HProcCheckNote = list[0].HProcCheckNote;
+                string HRemark = list[0].HRemark;
+                bool HStopflag = list[0].HStopflag;
+                string HUseFlag = list[0].HUseFlag;
+                long HEmpQty = list[0].HEmpQty;
+                string HBarCodeForBase = list[0].HBarCodeForBase;
+                long HDeptID = list[0].HDeptID;
+                long HProcID = list[0].HProcID;
+
+                ////鍒ゆ柇鏉冮檺
+                //if (!ClsPub.Security_Log(msg5, 1, true, msg4))
+                //{
+                //    objJsonResult.code = "0";
+                //    objJsonResult.count = 0;
+                //    objJsonResult.Message = "娌℃湁鎵惧埌璇ュ姛鑳芥ā鍧楋紒";
+                //    objJsonResult.data = null;
+                //    return objJsonResult;
+                //}
+
+                //if (!DBUtility.ClsPub.AllowNumber(HNumber))
+                //{
+                //    objJsonResult.code = "0";
+                //    objJsonResult.count = 0;
+                //    objJsonResult.Message = "浠g爜涓笉鑳藉嚭鐜拌繛缁��.鈥欏苟涓旈浣嶆湯浣嶄笉鑳戒负鈥�.鈥欙紒";
+                //    objJsonResult.data = null;
+                //    return objJsonResult;
+                //}
+
+                //if (oDept.HavSameNumber(HItemID, HNumber))
+                //{
+                //    objJsonResult.code = "0";
+                //    objJsonResult.count = 0;
+                //    objJsonResult.Message = "浠g爜閲嶅锛�";
+                //    objJsonResult.data = null;
+                //    return objJsonResult;
+                //}
+                //淇濆瓨
+                //淇濆瓨瀹屾瘯鍚庡鐞�
+                if (HItemID == 0)
+                {
+                    oCN.BeginTran();
+                    oCN.RunProc("Insert into  Gy_Process  " +
+                        " (HNumber,HName,HHelpCode,HShortNumber,HParentID" +
+                        ",HTypeFlow,HTypeCount,HDeptNumber,HSNo" +
+                        ",HLevel,HEndFlag,HStopflag,HRemark,HDeptID,HBarCodeForBase,HProcessID_K3,HBillSubType,HAutoTrunFlag" +
+                        ",HFixPrice,HOverFixPrice,HProcMulID,HProcCheckNote) " +
+                        " Values('" + HNumber + "','" + HName + "','" + HHelpCode + "','" + HShortNumber + "'," + HParentID.ToString() +
+                        "," + Convert.ToString(HTypeFlow ? 1 : 0) + "," + Convert.ToString(HTypeCount ? 1 : 0) + ",'" + HDeptNumber + "'," + HSNo.ToString() +
+                        "," + HLevel.ToString() + "," + Convert.ToString(HEndFlag ? 1 : 0) + "," + Convert.ToString(HStopflag ? 1 : 0) + ",'" + HRemark + "'," + HDeptID +
+                        ",'" + HBarCode + "'," + HProcessID_K3 + ",'" +HBillSubType + "'," + Convert.ToString(HAutoTrunFlag ? 1 : 0) +
+                        "," + HFixPrice.ToString() + "," + HOverFixPrice.ToString() + "," + HProcMulID.ToString() + ",'" + HProcCheckNote.ToString() + "')", ref DBUtility.ClsPub.sExeReturnInfo);
+                    //淇敼涓婄骇涓洪潪鏈骇浠g爜
+                    oCN.RunProc("Update Gy_Process set HEndflag=0 where HItemID=" + HParentID, ref DBUtility.ClsPub.sExeReturnInfo);
+                    oCN.Commit();
+                }
+                else
+                {
+                    //鑻AINDI閲嶅鍒欓噸鏂拌幏鍙�
+                    oCN.BeginTran();
+                    oCN.RunProc("Update Gy_Process set " +
+                        " HNumber='" + HNumber + "'" +
+                        ",HName='" + HName + "'" +
+                        ",HHelpCode='" + HHelpCode + "'" +
+                        ",HShortNumber='" + HShortNumber + "'" +
+                        ",HParentID= " + HParentID +
+                        ",HTypeFlow= '" + HTypeFlow + "'" +
+                        ",HTypeCount= '" + HTypeCount + "'" +
+                        ",HDeptNumber='" + HDeptNumber + "'" +
+                        ",HSNo= " + HSNo +
+                        ",HLevel= " + HLevel +
+                        ",HEndFlag= '" + HEndFlag + "'" +
+                        ",HStopflag= '" + HStopflag + "'" +
+                        ",HRemark='" + HRemark + "'" +
+                        ",HDeptID= " + HDeptID +
+                        ",HBarCodeForBase='" + HBarCodeForBase + "'" +
+                        ",HProcessID_K3= " + HProcessID_K3 +
+                        ",HBillSubType='" + HBillSubType + "'" +
+                        ",HAutoTrunFlag= '" + HAutoTrunFlag + "'" +
+                        ",HFixPrice= " + HFixPrice +
+                        ",HOverFixPrice= " + HOverFixPrice +
+                        ",HProcMulID= " + HProcMulID +
+                        ",HProcCheckNote='" + HProcCheckNote + "' Where HItemID=" + HItemID, ref DBUtility.ClsPub.sExeReturnInfo);
+                    //淇敼涓婄骇涓洪潪鏈骇浠g爜
+                    oCN.RunProc("Update Gy_Process set HEndflag=0 where HItemID=" + HParentID, ref DBUtility.ClsPub.sExeReturnInfo);
+                    //
+                    oCN.Commit();
+                }
+                objJsonResult.code = "0";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "淇濆瓨鎴愬姛锛�";
+                //WebAPIController.Add_Log("閫佽揣鍗曚笅鎺�", UserName, "鐢熸垚閫佽揣鍗�");
+                objJsonResult.data = 1;
+                return objJsonResult;
+            }
+            catch (Exception e)
+            {
+                oCN.RollBack();
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "Exception锛�" + e.Message;
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
         /// <summary>
         /// 杩斿洖宸ュ簭鍒楄〃
         ///鍙傛暟锛歴tring sql銆�
diff --git a/WebAPI/Controllers/BaseSet/Gy_WorkCenterController.cs b/WebAPI/Controllers/BaseSet/Gy_WorkCenterController.cs
index e4b5560..713e589 100644
--- a/WebAPI/Controllers/BaseSet/Gy_WorkCenterController.cs
+++ b/WebAPI/Controllers/BaseSet/Gy_WorkCenterController.cs
@@ -149,15 +149,16 @@
                 //鍙嶅簭鍒楀寲
                 msg1 = "[" + msg1.ToString() + "]";
                 DAL.ClsGy_WorkCenter_Ctl oDept = new DAL.ClsGy_WorkCenter_Ctl();
+                DAL.ClsGy_WorkCenter_View oDeptHlp = new DAL.ClsGy_WorkCenter_View();
                 List<Gy_WorkCenter> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Gy_WorkCenter>>(msg1);
-                long HItemID = list[0].HItemID.ToString() == "" ? 0 : list[0].HItemID;
+                long HItemID = list[0].HItemID ;
                 string HNumber = list[0].HNumber;
                 string HName = list[0].HName;   
                 string HShortNumber = list[0].HShortNumber;
                 long HParentID = list[0].HParentID;
                 string HHelpCode = list[0].HHelpCode;
                 string HRemark = list[0].HRemark;
-                string HStopflag = list[0].HStopflag=="True"?"1":"0";
+                bool HStopflag = list[0].HStopflag;
                 string HUseFlag = list[0].HUseFlag;
                 var HWorkTimes = list[0].HWorkTimes;
                 var HQty = list[0].HQty;
@@ -184,7 +185,7 @@
                    ",HDeptNumber,HWorkTimes,HQty" +
                    ",HLevel,HEndFlag,HStopflag,HRemark,HDeptID,HBarCodeForBase" +
                    ",HProcID,HDayMoney) " +
-                   " Values('" + HNumber + "','" + HName + "','" + HHelpCode + "','" + HShortNumber + "'," + HItemID.ToString() +
+                   " Values('" + HNumber + "','" + HName + "','" + HHelpCode + "','" + HShortNumber + "'," + HParentID.ToString() +
                    ",'" + HDeptNumber + "'," + HWorkTimes + "," + HQty +
                    ",'" + HLevel.ToString() + "'," + HEndFlag + "," + HStopflag +
                    ",'" + HRemark + "'," + HDeptID + ",'" + HBarCodeForBase + "','" + HProcID + "'," + HDayMoney + ")";
@@ -212,39 +213,50 @@
             }
         }
         /// <summary>
-        /// 淇敼鍗曟嵁-淇濆瓨鎸夐挳
+        /// 淇濆瓨鎸夐挳
         ///鍙傛暟锛歴tring sql銆�
         ///杩斿洖鍊硷細object銆�
         /// </summary>
-        [Route("Gy_WorkCenter/EditBill")]
+        [Route("Gy_WorkCenter/ModifyByID")]
         [HttpPost]
-        public object EditBill([FromBody] JObject oMain)
+        public object ModifyByID([FromBody] JObject oMain)
         {
             try
             {
+                DAL.ClsGy_WorkCenter_Ctl oDept = new DAL.ClsGy_WorkCenter_Ctl();
+                DAL.ClsGy_WorkCenter_View oDeptHlp = new DAL.ClsGy_WorkCenter_View();
+
                 var _value = oMain["oMain"].ToString();
                 string msg1 = _value.ToString();
+                string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
+                string msg2 = sArray[0].ToString();
+                //string msg3 = sArray[1].ToString();
+                //string msg4 = sArray[2].ToString();
+                //string msg5 = sArray[3].ToString();
                 //鍙嶅簭鍒楀寲
-                msg1 = "[" + msg1.ToString() + "]";
-                DAL.ClsGy_WorkCenter_Ctl oDept = new DAL.ClsGy_WorkCenter_Ctl();
-                List<Gy_WorkCenter> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Gy_WorkCenter>>(msg1);
+                msg2 = "[" + msg2.ToString() + "]";
+                List<Gy_WorkCenter> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Gy_WorkCenter>>(msg2);
 
                 long HItemID = list[0].HItemID;
                 string HNumber = list[0].HNumber;
                 string HName = list[0].HName;
-                string HShortNumber = list[0].HNumber;
+                string HShortNumber = list[0].HShortNumber;
+                string HDeptNumber = list[0].HDeptNumber;
                 long HParentID = list[0].HParentID;
                 string HHelpCode = list[0].HHelpCode;
                 string HRemark = list[0].HRemark;
-                string HStopflag = list[0].HStopflag;
+                bool HStopflag = list[0].HStopflag;
+                bool HEndFlag = list[0].HStopflag;
                 string HUseFlag = list[0].HUseFlag;
                 var HQty = list[0].HQty;
                 var HBarCodeForBase = list[0].HBarCodeForBase;
                 var HDayMoney = list[0].HDayMoney;
                 var HDeptID = list[0].HDeptID;
+                var HProcID = list[0].HProcID;
+                var HLevel = list[0].HLevel;
                 var HWorkTimes = list[0].HWorkTimes;
 
-                //鍒ゆ柇鏉冮檺
+                ////鍒ゆ柇鏉冮檺
                 //if (!ClsPub.Security_Log(msg5, 1, true, msg4))
                 //{
                 //    objJsonResult.code = "0";
@@ -253,6 +265,7 @@
                 //    objJsonResult.data = null;
                 //    return objJsonResult;
                 //}
+
                 //if (!DBUtility.ClsPub.AllowNumber(HNumber))
                 //{
                 //    objJsonResult.code = "0";
@@ -261,6 +274,7 @@
                 //    objJsonResult.data = null;
                 //    return objJsonResult;
                 //}
+
                 //if (oDept.HavSameNumber(HItemID, HNumber))
                 //{
                 //    objJsonResult.code = "0";
@@ -269,31 +283,52 @@
                 //    objJsonResult.data = null;
                 //    return objJsonResult;
                 //}
-                //鑻AINDI閲嶅鍒欓噸鏂拌幏鍙�
-                oCN.BeginTran();
-                //涓昏〃
-                oCN.RunProc("Update Gy_WorkCenter set " +
-                    " HNumber='" + HNumber + "'" +
-                    ",HName='" + HName + "'" +
-                    ",HShortNumber='" + HShortNumber + "'" +
-                    ",HHelpCode='" + HHelpCode + "'" +
-                    ",HParentID=" + HParentID +
-                    ",HStopflag='" + HStopflag + "'" +
-                    ",HRemark= '" + HRemark + "'"+
-                    ",HDeptID=" + HDeptID +
-                    ",HQty=" + HQty +
-                    ",HWorkTimes=" + HWorkTimes +
-                    ",HBarCodeForBase='" + HBarCodeForBase + "'  Where HItemID=" + HItemID, ref DBUtility.ClsPub.sExeReturnInfo);
-                //淇敼瀛愰」鐩唬鐮�
-                //oCN.RunProc("exec h_p_Gy_UpdateNumber Gy_WorkCenter,'" + HNumber + ".','" + this.HOldNumber + ".'", ref DBUtility.ClsPub.sExeReturnInfo);
-                //灏嗕笂绾� 涓洪潪鏈骇
-                oCN.RunProc("Update Gy_WorkCenter set HEndflag=0 where HItemID=" + HParentID, ref DBUtility.ClsPub.sExeReturnInfo);
-                //
-                oCN.Commit();
-                objJsonResult.code = "1";
+                //淇濆瓨
+                //淇濆瓨瀹屾瘯鍚庡鐞�
+                if (HItemID == 0)
+                {
+                    oCN.BeginTran();
+                    oCN.RunProc("Insert into  Gy_WorkCenter " +
+                   " (HNumber,HName,HHelpCode,HShortNumber,HParentID" +
+                   ",HDeptNumber,HWorkTimes,HQty" +
+                   ",HLevel,HEndFlag,HStopflag,HRemark,HDeptID,HBarCodeForBase" +
+                   ",HProcID,HDayMoney) " +
+                   " Values('" + HNumber + "','" + HName + "','" + HHelpCode + "','" + HShortNumber + "'," + HParentID.ToString() +
+                    ",'" + HDeptNumber + "'," + HWorkTimes + "," + HQty +
+                    "," + HLevel.ToString() + "," + Convert.ToString(HEndFlag ? 1 : 0) + "," + Convert.ToString(HStopflag ? 1 : 0) +
+                    ",'" + HRemark + "'," + HDeptID + ",'" + HBarCodeForBase + "'," + HProcID + "," + HDayMoney + ")", ref DBUtility.ClsPub.sExeReturnInfo);
+                    //淇敼涓婄骇涓洪潪鏈骇浠g爜
+                    oCN.RunProc("Update  Gy_WorkCenter set HEndflag=0 where HItemID=" + HParentID, ref DBUtility.ClsPub.sExeReturnInfo);
+                    oCN.Commit();
+                }
+                else
+                {
+                    //鑻AINDI閲嶅鍒欓噸鏂拌幏鍙�
+                    oCN.BeginTran();
+                    oCN.RunProc("Update Gy_WorkCenter set " +
+                                  " HNumber='" + HNumber + "'" +
+                                  ",HName='" + HName + "'" +
+                                  ",HShortNumber='" + HShortNumber + "'" +
+                                  ",HHelpCode='" + HHelpCode + "'" +
+                                  ",HParentID=" + HParentID +
+                                  ",HStopflag='" + HStopflag + "'" +
+                                  ",HRemark= '" + HRemark + "'" +
+                                  ",HDeptID=" + HDeptID +
+                                  ",HQty=" + HQty +
+                                  ",HWorkTimes=" + HWorkTimes +
+                                  ",HBarCodeForBase='" + HBarCodeForBase + "'  Where HItemID=" + HItemID, ref DBUtility.ClsPub.sExeReturnInfo);
+                    //淇敼瀛愰」鐩唬鐮�
+                    //oCN.RunProc("exec h_p_Gy_UpdateNumber Gy_WorkCenter,'" + HNumber + ".','" + this.HOldNumber + ".'", ref DBUtility.ClsPub.sExeReturnInfo);
+                    //灏嗕笂绾� 涓洪潪鏈骇
+                    oCN.RunProc("Update Gy_WorkCenter set HEndflag=0 where HItemID=" + HParentID, ref DBUtility.ClsPub.sExeReturnInfo);
+
+                    oCN.Commit();
+                }
+                objJsonResult.code = "0";
                 objJsonResult.count = 1;
-                objJsonResult.Message = "淇敼鍗曟嵁鎴愬姛锛�";
-                //objJsonResult.data = null;
+                objJsonResult.Message = "淇濆瓨鎴愬姛锛�";
+                //WebAPIController.Add_Log("閫佽揣鍗曚笅鎺�", UserName, "鐢熸垚閫佽揣鍗�");
+                objJsonResult.data = 1;
                 return objJsonResult;
             }
             catch (Exception e)
@@ -306,6 +341,101 @@
                 return objJsonResult;
             }
         }
+        ///// <summary>
+        ///// 淇敼鍗曟嵁-淇濆瓨鎸夐挳
+        /////鍙傛暟锛歴tring sql銆�
+        /////杩斿洖鍊硷細object銆�
+        ///// </summary>
+        //[Route("Gy_WorkCenter/EditBill")]
+        //[HttpPost]
+        //public object EditBill([FromBody] JObject oMain)
+        //{
+        //    try
+        //    {
+        //        var _value = oMain["oMain"].ToString();
+        //        string msg1 = _value.ToString();
+        //        //鍙嶅簭鍒楀寲
+        //        msg1 = "[" + msg1.ToString() + "]";
+        //        DAL.ClsGy_WorkCenter_Ctl oDept = new DAL.ClsGy_WorkCenter_Ctl();
+        //        List<Gy_WorkCenter> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Gy_WorkCenter>>(msg1);
+
+        //long HItemID = list[0].HItemID;
+        //string HNumber = list[0].HNumber;
+        //string HName = list[0].HName;
+        //string HShortNumber = list[0].HNumber;
+        //long HParentID = list[0].HParentID;
+        //string HHelpCode = list[0].HHelpCode;
+        //string HRemark = list[0].HRemark;
+        //string HStopflag = list[0].HStopflag;
+        //string HUseFlag = list[0].HUseFlag;
+        //var HQty = list[0].HQty;
+        //var HBarCodeForBase = list[0].HBarCodeForBase;
+        //var HDayMoney = list[0].HDayMoney;
+        //var HDeptID = list[0].HDeptID;
+        //var HWorkTimes = list[0].HWorkTimes;
+
+        //        //鍒ゆ柇鏉冮檺
+        //        //if (!ClsPub.Security_Log(msg5, 1, true, msg4))
+        //        //{
+        //        //    objJsonResult.code = "0";
+        //        //    objJsonResult.count = 0;
+        //        //    objJsonResult.Message = "娌℃湁鎵惧埌璇ュ姛鑳芥ā鍧楋紒";
+        //        //    objJsonResult.data = null;
+        //        //    return objJsonResult;
+        //        //}
+        //        //if (!DBUtility.ClsPub.AllowNumber(HNumber))
+        //        //{
+        //        //    objJsonResult.code = "0";
+        //        //    objJsonResult.count = 0;
+        //        //    objJsonResult.Message = "浠g爜涓笉鑳藉嚭鐜拌繛缁��.鈥欏苟涓旈浣嶆湯浣嶄笉鑳戒负鈥�.鈥欙紒";
+        //        //    objJsonResult.data = null;
+        //        //    return objJsonResult;
+        //        //}
+        //        //if (oDept.HavSameNumber(HItemID, HNumber))
+        //        //{
+        //        //    objJsonResult.code = "0";
+        //        //    objJsonResult.count = 0;
+        //        //    objJsonResult.Message = "浠g爜閲嶅锛�";
+        //        //    objJsonResult.data = null;
+        //        //    return objJsonResult;
+        //        //}
+        //        //鑻AINDI閲嶅鍒欓噸鏂拌幏鍙�
+        //        oCN.BeginTran();
+        //        //涓昏〃
+        //        oCN.RunProc("Update Gy_WorkCenter set " +
+        //            " HNumber='" + HNumber + "'" +
+        //            ",HName='" + HName + "'" +
+        //            ",HShortNumber='" + HShortNumber + "'" +
+        //            ",HHelpCode='" + HHelpCode + "'" +
+        //            ",HParentID=" + HParentID +
+        //            ",HStopflag='" + HStopflag + "'" +
+        //            ",HRemark= '" + HRemark + "'"+
+        //            ",HDeptID=" + HDeptID +
+        //            ",HQty=" + HQty +
+        //            ",HWorkTimes=" + HWorkTimes +
+        //            ",HBarCodeForBase='" + HBarCodeForBase + "'  Where HItemID=" + HItemID, ref DBUtility.ClsPub.sExeReturnInfo);
+        //        //淇敼瀛愰」鐩唬鐮�
+        //        //oCN.RunProc("exec h_p_Gy_UpdateNumber Gy_WorkCenter,'" + HNumber + ".','" + this.HOldNumber + ".'", ref DBUtility.ClsPub.sExeReturnInfo);
+        //        //灏嗕笂绾� 涓洪潪鏈骇
+        //        oCN.RunProc("Update Gy_WorkCenter set HEndflag=0 where HItemID=" + HParentID, ref DBUtility.ClsPub.sExeReturnInfo);
+        //        //
+        //        oCN.Commit();
+        //        objJsonResult.code = "1";
+        //        objJsonResult.count = 1;
+        //        objJsonResult.Message = "淇敼鍗曟嵁鎴愬姛锛�";
+        //        //objJsonResult.data = null;
+        //        return objJsonResult;
+        //    }
+        //    catch (Exception e)
+        //    {
+        //        oCN.RollBack();
+        //        objJsonResult.code = "0";
+        //        objJsonResult.count = 0;
+        //        objJsonResult.Message = "Exception锛�" + e.Message;
+        //        objJsonResult.data = null;
+        //        return objJsonResult;
+        //    }
+        //}
         /// <summary>
         /// 宸ヤ綔涓績鍒犻櫎鍔熻兘
         /// </summary>
diff --git a/WebAPI/Controllers/BaseSet/Xt_ORGANIZATIONSController.cs b/WebAPI/Controllers/BaseSet/Xt_ORGANIZATIONSController.cs
index e5d2774..c064d67 100644
--- a/WebAPI/Controllers/BaseSet/Xt_ORGANIZATIONSController.cs
+++ b/WebAPI/Controllers/BaseSet/Xt_ORGANIZATIONSController.cs
@@ -28,6 +28,7 @@
         public object list(string sWhere)
         {
             try
+
             {
                 if (sWhere == null || sWhere.Equals(""))
                 {
@@ -65,7 +66,253 @@
                 return objJsonResult;
             }
         }
+        /// <summary>
+        /// 鏂板鍗曟嵁-淇濆瓨鎸夐挳
+        ///鍙傛暟锛歴tring sql銆�
+        ///杩斿洖鍊硷細object銆�
+        /// </summary>
+        [Route("Xt_ORGANIZATIONS/AddBill")]
+        [HttpPost]
+        public object AddBill([FromBody] JObject oMain)
+        {
+            try
+            {
+                var _value = oMain["oMain"].ToString();
+                string msg1 = _value.ToString();
+                //鍙嶅簭鍒楀寲
+                msg1 = "[" + msg1.ToString() + "]";
+                //DAL.ClsXt_ORGANIZATIONS_Ctl oDept = new DAL.ClsXt_ORGANIZATIONS_Ctl();
+                List<Xt_ORGANIZATIONS> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Xt_ORGANIZATIONS>>(msg1);
+                long HItemID = list[0].HItemID;
+                string HNumber = list[0].HNumber;
+                string HName = list[0].HName;
+              
+                long HParentID = list[0].HParentID;
+               
+                string HRemark = list[0].HRemark;
+                bool HStopflag = list[0].HStopflag;
+              
+                if (!DBUtility.ClsPub.AllowNumber(HNumber))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "浠g爜涓笉鑳藉嚭鐜拌繛缁��.鈥欏苟涓旈浣嶆湯浣嶄笉鑳戒负鈥�.鈥欙紒";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                //鑻AINDI閲嶅鍒欓噸鏂拌幏鍙�
+                oCN.BeginTran();
+                //涓昏〃
+                string sql = "Insert into Xt_ORGANIZATIONS " +
+                    " (HNumber,HName,HParentID" +
+                   ",HStopflag,HMakeTime" +
+                   ",HRemark) " +
+                   " Values('" + HNumber + "','" + HName + "'," + HParentID.ToString() +
+                   "," + HStopflag + "getdate()" +
+                   ",'" + HRemark + "')";
+                oCN.RunProc(sql, ref DBUtility.ClsPub.sExeReturnInfo);
+                //淇敼涓婄骇涓洪潪鏈骇浠g爜
+                if (list[0].HItemID.ToString() != "")
+                {
+                    oCN.RunProc("Update Xt_ORGANIZATIONS set HStopflag=0 where HItemID=" + HItemID, ref DBUtility.ClsPub.sExeReturnInfo);
+                }
+                oCN.Commit();
+                objJsonResult.code = "1";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "鏂板鎴愬姛锛�";
+                //objJsonResult.data = null;
+                return objJsonResult;
+            }
+            catch (Exception e)
+            {
+                oCN.RollBack();
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "Exception锛�" + e.Message;
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        /// <summary>
+        /// 淇濆瓨鎸夐挳
+        ///鍙傛暟锛歴tring sql銆�
+        ///杩斿洖鍊硷細object銆�
+        /// </summary>
+        [Route("Xt_ORGANIZATIONS/ModifyByID")]
+        [HttpPost]
+        public object ModifyByID([FromBody] JObject oMain)
+        {
+            try
+            {
+                //DAL.ClsXt_ORGANIZATIONS_Ctl oDept = new DAL.ClsXt_ORGANIZATIONS_Ctl();
+                //DAL.ClsXt_ORGANIZATIONS_View oDeptHlp = new DAL.ClsXt_ORGANIZATIONS_View();
 
+                var _value = oMain["oMain"].ToString();
+                string msg1 = _value.ToString();
+                string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
+                string msg2 = sArray[0].ToString();
+                //string msg3 = sArray[1].ToString();
+                //string msg4 = sArray[2].ToString();
+                //string msg5 = sArray[3].ToString();
+                //鍙嶅簭鍒楀寲
+                msg2 = "[" + msg2.ToString() + "]";
+                List<Xt_ORGANIZATIONS> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Xt_ORGANIZATIONS>>(msg2);
+
+                long HItemID = list[0].HItemID;
+                string HNumber = list[0].HNumber;
+                string HName = list[0].HName;
+                DateTime HMakeTime = list[0].HMakeTime;
+                long HParentID = list[0].HParentID;
+
+                string HRemark = list[0].HRemark;
+                bool HStopflag = list[0].HStopflag;
+
+                ////鍒ゆ柇鏉冮檺
+                //if (!ClsPub.Security_Log(msg5, 1, true, msg4))
+                //{
+                //    objJsonResult.code = "0";
+                //    objJsonResult.count = 0;
+                //    objJsonResult.Message = "娌℃湁鎵惧埌璇ュ姛鑳芥ā鍧楋紒";
+                //    objJsonResult.data = null;
+                //    return objJsonResult;
+                //}
+
+                //if (!DBUtility.ClsPub.AllowNumber(HNumber))
+                //{
+                //    objJsonResult.code = "0";
+                //    objJsonResult.count = 0;
+                //    objJsonResult.Message = "浠g爜涓笉鑳藉嚭鐜拌繛缁��.鈥欏苟涓旈浣嶆湯浣嶄笉鑳戒负鈥�.鈥欙紒";
+                //    objJsonResult.data = null;
+                //    return objJsonResult;
+                //}
+
+                //if (oDept.HavSameNumber(HItemID, HNumber))
+                //{
+                //    objJsonResult.code = "0";
+                //    objJsonResult.count = 0;
+                //    objJsonResult.Message = "浠g爜閲嶅锛�";
+                //    objJsonResult.data = null;
+                //    return objJsonResult;
+                //}
+                //淇濆瓨
+                //淇濆瓨瀹屾瘯鍚庡鐞�
+                if (HItemID == 0)
+                {
+                    oCN.BeginTran();
+                    oCN.RunProc("Insert into Xt_ORGANIZATIONS " +
+                    " (HNumber,HName,HParentID" +
+                   ",HStopflag,HMakeTime" +
+                   ",HRemark) " +
+                   " Values('" + HNumber + "','" + HName + "'," + HParentID.ToString() +
+                   "," + HStopflag + "getdate()"+
+                   ",'" + HRemark + "')", ref DBUtility.ClsPub.sExeReturnInfo);
+
+                    //淇敼涓婄骇涓洪潪鏈骇浠g爜
+                    //oCN.RunProc("Update Xt_ORGANIZATIONS set HStopflag=0 where HItemID=" + HParentID, ref DBUtility.ClsPub.sExeReturnInfo);
+                    oCN.Commit();
+                }
+                else
+                {
+                    //鑻AINDI閲嶅鍒欓噸鏂拌幏鍙�
+                    oCN.BeginTran();
+                    oCN.RunProc("Update Xt_ORGANIZATIONS set " +
+                               " HNumber='" + HNumber + "'" +
+                                 ",HName='" + HName + "'" +
+                                  ",HParentID=" + HParentID +
+                                  ",HMakeTime=" + HMakeTime +
+                                 ",HStopflag='" + HStopflag + "'" +
+                                 ",HRemark= '" + HRemark + "' Where HItemID=" + HItemID, ref DBUtility.ClsPub.sExeReturnInfo);
+                    oCN.RunProc("Update Xt_ORGANIZATIONS set HStopflag=0 where HItemID=" + HParentID, ref DBUtility.ClsPub.sExeReturnInfo);
+                    oCN.Commit();
+                }
+                objJsonResult.code = "0";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "淇濆瓨鎴愬姛锛�";
+                //WebAPIController.Add_Log("閫佽揣鍗曚笅鎺�", UserName, "鐢熸垚閫佽揣鍗�");
+                objJsonResult.data = 1;
+                return objJsonResult;
+            }
+            catch (Exception e)
+            {
+                oCN.RollBack();
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "Exception锛�" + e.Message;
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        /// <summary>
+        /// 鑱屽憳璁剧疆鍒犻櫎鍔熻兘
+        /// </summary>
+        /// <returns></returns>
+        [Route("DeltetXt_ORGANIZATIONSList")]
+        
+        [HttpGet]
+        public object DeltetXt_ORGANIZATIONSList(string HItemID)
+        {
+            DataSet ds;
+            //string ModRightNameCheck = "Sc_ProcessReport_check";
+            try
+            {
+                //鍒犻櫎鏉冮檺
+                //if (!DBUtility.ClsPub.Security_Log(ModRightNameCheck, 1, true, CurUserName))
+                //{
+                //    objJsonResult.code = "0";
+                //    objJsonResult.count = 0;
+                //    objJsonResult.Message = "瀹℃牳澶辫触锛佹棤鏉冮檺锛�";
+                //    objJsonResult.data = null;
+                //    return objJsonResult;
+                //}
+
+                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+                if (string.IsNullOrWhiteSpace(HItemID))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "HItemID涓虹┖锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                oCN.BeginTran();//寮�濮嬩簨鍔�
+                ds = oCN.RunProcReturn("select * from Xt_ORGANIZATIONSList where HItemID=" + HItemID, "Xt_ORGANIZATIONSList");
+                if (ds == null || ds.Tables[0].Rows.Count == 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "娌℃湁鏁版嵁锛屾棤娉曞垹闄わ紒";
+                    objJsonResult.data = null;
+                    return objJsonResult; ;
+                }
+                var HStopflag = Convert.ToBoolean(ds.Tables[0].Rows[0]["HStopflag"]);
+                if (HStopflag)
+                {
+                    oCN.RollBack();//鍥炴粴浜嬪姟
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鏁版嵁宸插垹闄ゆ棤娉曞啀娆″垹闄わ紒";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
+                oCN.RunProc("update Xt_ORGANIZATIONSList set HStopflag=1 where HItemID=" + HItemID);
+                oCN.Commit();//鎻愪氦浜嬪姟
+                objJsonResult.code = "0";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "* 鏁版嵁鍒犻櫎鎴愬姛锛�";
+                objJsonResult.data = null;
+                return objJsonResult; ;
+
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "鍒犻櫎澶辫触锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
 
 
         //
diff --git a/WebAPI/Controllers/CJGL/Cj_StationEntrustInBillController.cs b/WebAPI/Controllers/CJGL/Cj_StationEntrustInBillController.cs
index 52b44e2..118a408 100644
--- a/WebAPI/Controllers/CJGL/Cj_StationEntrustInBillController.cs
+++ b/WebAPI/Controllers/CJGL/Cj_StationEntrustInBillController.cs
@@ -20,11 +20,7 @@
         DataSet ds;
 
 
-        /// <summary>
-        /// 杩斿洖濮斿宸ュ簭鍙戝嚭鍗曞垪琛�
-        ///鍙傛暟锛歴tring sql銆�
-        ///杩斿洖鍊硷細object銆�
-        /// </summary>
+        #region 杩斿洖濮斿宸ュ簭鍙戝嚭鍗曞垪琛�
         [Route("Cj_StationEntrustInBill/list")]
         [HttpGet]
         public object list(string sWhere)
@@ -67,12 +63,9 @@
                 return objJsonResult;
             }
         }
+        #endregion
 
-        /// <summary>
-        /// 濮斿宸ュ簭鍙戝嚭鍗曟祦姘村彿鍥炶溅鑾峰彇娴佽浆鍗′俊鎭紙濮斿宸ュ簭鎺ユ敹銆佸伐搴忚繘绔欐帴鏀堕�氱敤锛�
-        ///鍙傛暟锛歴tring sql銆�
-        ///杩斿洖鍊硷細object銆�
-        /// </summary>
+        #region 濮斿宸ュ簭鍙戝嚭鍗曟祦姘村彿鍥炶溅鑾峰彇娴佽浆鍗′俊鎭紙濮斿宸ュ簭鎺ユ敹銆佸伐搴忚繘绔欐帴鏀堕�氱敤锛�
         [Route("Cj_StationEntrustInBill/txtHBarCode_KeyDown")]
         [HttpGet]
         public object txtHBarCode_KeyDown(string HBarCode)
@@ -122,12 +115,9 @@
                 return objJsonResult;
             }
         }
+        #endregion
 
-        /// <summary>
-        /// 鏂板鍗曟嵁-淇濆瓨鎸夐挳
-        ///鍙傛暟锛歴tring sql銆�
-        ///杩斿洖鍊硷細object銆�
-        /// </summary>
+        #region 鏂板鍗曟嵁-淇濆瓨鎸夐挳
         [Route("Cj_StationEntrustInBill/AddBill")]
         [HttpPost]
         public object AddBill([FromBody] JObject oMain)
@@ -367,12 +357,9 @@
             }
             return false;
         }
+        #endregion
 
-        /// <summary>
-        /// 缂栬緫椤甸潰鏍规嵁id鑾峰彇濮斿宸ュ簭鎺ユ敹鍗曚俊鎭�
-        ///鍙傛暟锛歴tring sql銆�
-        ///杩斿洖鍊硷細object銆�
-        /// </summary>
+        #region 缂栬緫椤甸潰鏍规嵁id鑾峰彇濮斿宸ュ簭鎺ユ敹鍗曚俊鎭�
         [Route("Cj_StationEntrustInBill/GetStationEntrustInBill")]
         [HttpGet]
         public object GetStationEntrustInBill(int HInterID)
@@ -406,13 +393,9 @@
                 return objJsonResult;
             }
         }
+        #endregion
 
-
-        /// <summary>
-        /// 濮斿宸ュ簭鍙戝嚭鍗曟祦姘村彿鍥炶溅鑾峰彇宸ュ簭淇℃伅
-        ///鍙傛暟锛歴tring sql銆�
-        ///杩斿洖鍊硷細object銆�
-        /// </summary>
+        #region 濮斿宸ュ簭鍙戝嚭鍗曟祦姘村彿鍥炶溅鑾峰彇宸ュ簭淇℃伅
         [Route("Cj_StationEntrustInBill/txtHProcNo_KeyDown")]
         [HttpGet]
         public object txtHProcNo_KeyDown(string sBillNo, string sProcNo)
@@ -455,10 +438,385 @@
                 return objJsonResult;
             }
         }
+        #endregion
 
+        #region 缂栬緫鍓嶅垽鏂�
+        [Route("Cj_StationEntrustInBill/set_ShowBillJudge")]
+        [HttpGet]
+        public object set_ShowBillJudge(string HBillNo, string CurUserName,long HInterID)
+        {
+            try
+            {
+                //ds = oCN.RunProcReturn("exec h_p_MES_StationInBill_DelCtrl  '" + HBillNo + "'", "h_p_MES_StationInBill_DelCtrl");
+                //if (ds == null || ds.Tables[0].Rows.Count == 0)
+                //{
+                //    objJsonResult.code = "0";
+                //    objJsonResult.count = 0;
+                //    objJsonResult.Message = "鍒ゆ柇鍏宠仈澶辫触锛�";
+                //    objJsonResult.data = null;
+                //    return objJsonResult;
+                //}
+                //else if (ds.Tables[0].Rows.Count > 0 && Pub_Class.ClsPub.isInt(ds.Tables[0].Rows[0][0]) == 2)
+                //{
+                //    objJsonResult.code = "0";
+                //    objJsonResult.count = 0;
+                //    objJsonResult.Message = Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0][1]);
+                //    objJsonResult.data = null;
+                //    return objJsonResult;
+                //}
 
+                //鍒ゆ柇鏉冮檺
+                if (!ClsPub.Security_Log("MES_StationEntrustInBill_Edit", 1, true, CurUserName))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鏃犳潈闄愶紒";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                ////鍒ゆ柇璇ョ敤鎴峰悕鏄惁鏈夎宸ョ珯鏉冮檺
+                //if (BillNew.CheckCenterIDByUser(DBUtility.ClsPub.isLong(66865)) == false)
+                //{
+                //    MessageBox.Show("娌℃湁璇ュ伐绔欐潈闄愶紒", "鎻愮ず");
+                //    return;
+                //}
+                ////妫�鏌ユ槸鍚﹀紑绁�
+                //string d = "";
+                //if (BillOld.CheckIsKP(BillOld.omodel.HInterID, ref d) == false)
+                //{
+                //    MessageBox.Show(d, "鎻愮ず");
+                //    return;
+                //}
+                string s = "";
+                DAL.ClsSc_StationEntrustInBill BillOld = new DAL.ClsSc_StationEntrustInBill();
+                if (BillOld.ShowBill(HInterID, ref s) == false)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "姝ゅ崟鎹湁閿欒锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                //鍒ゆ柇鏄惁鍙紪杈�
+                if (BillOld.omodel.HChecker != "")
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "姝ゅ崟鎹凡缁忚瀹℃牳锛屼笉鍏佽淇敼锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                objJsonResult.code = "1";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "Sucess锛�";
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "Exception锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
 
+        #region 瀹℃牳
+        [Route("Cj_StationEntrustInBill/set_CheckBill")]
+        [HttpGet]
+        public object set_CheckBill(int HInterID, string CurUserName)
+        {
+            try
+            {
+                //瀹℃牳鏉冮檺
+                //if (!DBUtility.ClsPub.Security_Log("MES_StationEntrustInBill_Check", 1, true, CurUserName))
+                //{
+                //    objJsonResult.code = "0";
+                //    objJsonResult.count = 0;
+                //    objJsonResult.Message = "瀹℃牳澶辫触锛佹棤鏉冮檺锛�";
+                //    objJsonResult.data = null;
+                //    return objJsonResult;
+                //}
+                if (HInterID == 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鍗曟嵁ID涓�0锛屼笉鑳藉鏍革紒";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                DAL.ClsSc_StationEntrustInBill oBill = new DAL.ClsSc_StationEntrustInBill();
+                //鏌ョ湅鏄惁宸插鏍�,鍏抽棴,浣滃簾
+                if (oBill.ShowBill(HInterID, ref DBUtility.ClsPub.sExeReturnInfo))
+                {
+                    if (oBill.omodel.HChecker.Trim() != "")
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "鍗曟嵁宸插鏍�!涓嶈兘鍐嶆瀹℃牳";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                }
+                else
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鍗曟嵁涓嶅瓨鍦�!鍘熷洜:" + DBUtility.ClsPub.sExeReturnInfo;
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                //瀹℃牳
+                if (Cj_StationEntrustInBillCheckBill(HInterID, CurUserName, ref DBUtility.ClsPub.sExeReturnInfo))
+                {
+                    objJsonResult.code = "1";
+                    objJsonResult.count = 1;
+                    objJsonResult.Message = "瀹℃牳鎴愬姛!";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                else
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "瀹℃牳澶辫触!鍘熷洜:" + DBUtility.ClsPub.sExeReturnInfo;
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
 
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "瀹℃牳澶辫触锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+
+        //瀹℃牳
+        public bool Cj_StationEntrustInBillCheckBill(Int64 lngBillKey, string CurUserName, ref string sReturn)
+        {
+            try
+            {
+                string HChecker = CurUserName;
+                string HCheckDate = DBUtility.ClsPub.GetServerDate(-1);
+                oCN.BeginTran();
+                ds = oCN.RunProcReturn("Select * from Sc_StationInBillMain Where HInterID=" + lngBillKey.ToString(), "Sc_StationInBillMain");
+                if (ds.Tables[0].Rows.Count == 0)
+                {
+                    sReturn = "鍗曟嵁鏈壘鍒帮紒";
+                    return false;
+                }
+
+                oCN.RunProc(" Update Sc_StationInBillMain set HChecker='" + HChecker + "',HCheckDate='" + HCheckDate + "' Where HInterID=" + lngBillKey.ToString());
+                oCN.RunProc("exec h_p_Mes_ProcessExchangeRelationQty_Check_In " + lngBillKey.ToString() + ",1");
+                sReturn = sReturn + " 瀹℃牳鍔熻兘锛�";
+                oCN.Commit();
+                return true;
+            }
+            catch (Exception e)
+            {
+                sReturn = e.Message;
+                oCN.RollBack();
+                return false; ;
+            }
+        }
+        #endregion
+
+        #region 鍙嶅鏍�
+        [Route("Cj_StationEntrustInBill/set_AbandonCheck")]
+        [HttpGet]
+        public object set_AbandonCheck(int HInterID, string CurUserName)
+        {
+            try
+            {
+                if (HInterID == 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鍗曟嵁ID涓�0锛屼笉鑳藉弽瀹℃牳锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                DAL.ClsSc_StationEntrustInBill oBill = new DAL.ClsSc_StationEntrustInBill();
+                //鏌ョ湅鏄惁宸插鏍�,鍏抽棴,浣滃簾
+                if (oBill.ShowBill(HInterID, ref DBUtility.ClsPub.sExeReturnInfo))
+                {
+                    if (oBill.omodel.HChecker.Trim() == "")
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "鍗曟嵁鏈鏍�!涓嶉渶瑕佸弽瀹℃牳!";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                }
+                else
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鍗曟嵁涓嶅瓨鍦�!鍘熷洜:" + DBUtility.ClsPub.sExeReturnInfo;
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                //鍙嶅鏍�
+                if (Cj_StationEntrustInBillAbandonCheckBill(HInterID, CurUserName, ref DBUtility.ClsPub.sExeReturnInfo))
+                {
+                    objJsonResult.code = "1";
+                    objJsonResult.count = 1;
+                    objJsonResult.Message = "鍙嶅鏍告垚鍔�!";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                else
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鍙嶅鏍稿け璐�!鍘熷洜:" + DBUtility.ClsPub.sExeReturnInfo;
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "鍙嶅鏍稿け璐ワ紒" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+
+        //鍙嶅鏍�
+        public bool Cj_StationEntrustInBillAbandonCheckBill(Int64 lngBillKey, string CurUserName, ref string sReturn)
+        {
+            try
+            {
+                string HChecker = CurUserName;
+                string HCheckDate = DBUtility.ClsPub.GetServerDate(-1);
+                oCN.BeginTran();
+                ds = oCN.RunProcReturn("Select * from Sc_StationInBillMain Where HInterID=" + lngBillKey.ToString(), "Sc_StationInBillMain");
+                if (ds.Tables[0].Rows.Count == 0)
+                {
+                    sReturn = "鍗曟嵁鏈壘鍒帮紒";
+                    return false;
+                }
+
+                oCN.RunProc(" Update Sc_StationInBillMain set HChecker='',HCheckDate=null Where HInterID=" + lngBillKey.ToString());
+                //oCN.RunProc("exec h_p_Mes_ProcessExchangeRelationQty_Check_In " + lngBillKey.ToString() + ",-1");
+                sReturn = sReturn + "鍙嶅鏍稿姛鑳斤紒";
+                oCN.Commit();
+                return true;
+            }
+            catch (Exception e)
+            {
+                sReturn = e.Message;
+                oCN.RollBack();
+                return false; ;
+            }
+        }
+        #endregion
+
+        #region 鏍规嵁id鍒犻櫎濮斿鍙戝嚭鍗�
+        [Route("Cj_StationEntrustInBill/del_StationEntrustInBill")]
+        [HttpGet]
+        public object del_StationEntrustInBill(long HInterID, string HDeleteMan)
+        {
+            try
+            {
+
+                //缂栬緫鏉冮檺
+                if (!DBUtility.ClsPub.Security_Log("MES_StationEntrustInBill_Delete", 1, true, HDeleteMan))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鏃犳潈闄愶紒";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                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"))
+                    {
+                        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;
+                    }
+                    SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
+                    DataSet ds;
+                    //鍒ゆ柇鏄惁瀛樺湪 鐩稿悓鍗曟嵁鍙� 鐨勯鏂欏崟 鍒ゆ柇鐢熶骇璁㈠崟鏄惁宸茬粨妗堬紝瑕佹眰璁″垝鎵嬪伐鍙嶇粨妗�    
+                    ds = oCn.RunProcReturn("exec h_p_MES_StationInBill_DelCtrl  '" + oBill.omodel.HBillNo + "'", "h_p_MES_StationInBill_DelCtrl");
+                    if (ds == null)
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "鍒ゆ柇鍏宠仈澶辫触锛�";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                    if (ds.Tables[0].Rows.Count > 0 && Pub_Class.ClsPub.isInt(ds.Tables[0].Rows[0][0]) == 2)
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0][1]);
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+
+                    //鍐欏叆鍒犻櫎鏃ュ織 
+                    string WorkList = "鍒犻櫎濮斿鍙戝嚭鍗曪細" + oBill.omodel.HBillNo;
+                    if (!oBill.DeleteBill(oBill.omodel.HInterID, oBill.omodel.HProcExchInterID, oBill.omodel.HProcExchEntryID, ref DBUtility.ClsPub.sExeReturnInfo))
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = DBUtility.ClsPub.sExeReturnInfo;
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                    else
+                    {
+                        objJsonResult.code = "1";
+                        objJsonResult.count = 1;
+                        objJsonResult.Message = "鍒犻櫎鎴愬姛锛�";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                }
+                else
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鍗曟嵁鏈壘鍒帮紒";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "寮傚父锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
         //
     }
 }
\ No newline at end of file
diff --git a/WebAPI/Controllers/CJGL/Cj_StationInBillController.cs b/WebAPI/Controllers/CJGL/Cj_StationInBillController.cs
index 4ffb696..2e2beea 100644
--- a/WebAPI/Controllers/CJGL/Cj_StationInBillController.cs
+++ b/WebAPI/Controllers/CJGL/Cj_StationInBillController.cs
@@ -569,8 +569,8 @@
                 ds1 = oCN.RunProcReturn("select HLastProc,HFstProc " +
                     " from Sc_ProcessExchangeBillMain a " +
                     " inner join Sc_ProcessExchangeBillSub b on a.HInterID=b.HInterID " +
-                    " Where a.HInterID=(Select HProcExchInterID from Sc_StationInBillMain Where HInterID=55) " +
-                    " and b.HEntryID=(Select HProcExchEntryID from Sc_StationInBillMain Where HInterID=55)", "Sc_ProcessExchangeBillMain");
+                    " Where a.HInterID=(Select HProcExchInterID from Sc_StationInBillMain Where HInterID="+ lngBillKey + ") " +
+                    " and b.HEntryID=(Select HProcExchEntryID from Sc_StationInBillMain Where HInterID="+ lngBillKey + ")", "Sc_ProcessExchangeBillMain");
                 if (ds1 == null || ds1.Tables[0].Rows.Count == 0)
                 {
                 }
@@ -680,8 +680,8 @@
                 ds1 = oCN.RunProcReturn("select HLastProc,HFstProc " +
                     " from Sc_ProcessExchangeBillMain a " +
                     " inner join Sc_ProcessExchangeBillSub b on a.HInterID=b.HInterID " +
-                    " Where a.HInterID=(Select HProcExchInterID from Sc_StationInBillMain Where HInterID=55) " +
-                    " and b.HEntryID=(Select HProcExchEntryID from Sc_StationInBillMain Where HInterID=55)", "Sc_ProcessExchangeBillMain");
+                    " Where a.HInterID=(Select HProcExchInterID from Sc_StationInBillMain Where HInterID="+ lngBillKey + ") " +
+                    " and b.HEntryID=(Select HProcExchEntryID from Sc_StationInBillMain Where HInterID="+ lngBillKey + ")", "Sc_ProcessExchangeBillMain");
                 if (ds1 == null || ds1.Tables[0].Rows.Count == 0)
                 {
                 }
@@ -867,5 +867,41 @@
             }
         }
         #endregion
+
+        //#region 鏌ョ湅宸ュ簭娴佽浆鍗″叧鑱旀暟閲忓垪琛ㄥ姞杞�
+        [Route("Cj_StationInBill/GetStationQtyList")]
+        [HttpGet]
+        public object GetStationQtyList(string HInterID)
+        {
+            try
+            {
+                ds = oCN.RunProcReturn("execute h_p_Sc_ProcExchBilltransRelationQty @HInterID=" + HInterID, "h_p_Sc_ProcExchBilltransRelationQty");
+                if (ds == null || ds.Tables[0].Rows.Count == 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "娌℃湁浣犺鎵剧殑璁板綍锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                else
+                {
+                    objJsonResult.code = "1";
+                    objJsonResult.count = 1;
+                    objJsonResult.Message = "杩斿洖璁板綍鎴愬姛锛�";
+                    objJsonResult.data = ds.Tables[0];
+                    return objJsonResult;
+                }
+            }
+            catch (Exception ex)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�" + ex.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        //#endregion
     }
 }
\ No newline at end of file
diff --git a/WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs b/WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs
index e7b2e6b..7fa0d79 100644
--- a/WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs
+++ b/WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs
@@ -23,11 +23,7 @@
         DataSet ds1;
         string fileip = System.Configuration.ConfigurationManager.AppSettings["FileIP"];
 
-        /// <summary>
-        /// 鏂板鍗曟嵁-淇濆瓨鎸夐挳
-        ///鍙傛暟锛歴tring sql銆�
-        ///杩斿洖鍊硷細object銆�
-        /// </summary>
+        #region 鏂板鍗曟嵁-淇濆瓨鎸夐挳
         [Route("Cj_StationOutBill/AddBill")]
         [HttpPost]
         public object AddBill([FromBody] JObject oMain)
@@ -386,12 +382,9 @@
             }
             return false;
         }
+        #endregion
 
-        /// <summary>
-        /// 杩斿洖宸ュ簭鍑虹珯姹囨姤鍗曞垪琛�
-        ///鍙傛暟锛歴tring sql銆�
-        ///杩斿洖鍊硷細object銆�
-        /// </summary>
+        #region 杩斿洖宸ュ簭鍑虹珯姹囨姤鍗曞垪琛�
         [Route("Cj_StationOutBill/get_Display")]
         [HttpGet]
         public object get_Display(string sWhere)
@@ -434,12 +427,9 @@
                 return objJsonResult;
             }
         }
+        #endregion
 
-        /// <summary>
-        /// 缂栬緫椤甸潰鏍规嵁id鑾峰彇宸ュ簭鍑虹珯姹囨姤鍗曚俊鎭�
-        ///鍙傛暟锛歴tring sql銆�
-        ///杩斿洖鍊硷細object銆�
-        /// </summary>
+        #region 缂栬緫椤甸潰鏍规嵁id鑾峰彇宸ュ簭鍑虹珯姹囨姤鍗曚俊鎭�
         [Route("Cj_StationOutBill/GetStationOutBill")]
         [HttpGet]
         public object GetStationOutBill(int HInterID)
@@ -473,7 +463,7 @@
                 return objJsonResult;
             }
         }
-
+        #endregion
 
         #region  宸ュ簭鍑虹珯姹囨姤鍗曟枃浠朵笂浼犲鐞�
 
@@ -670,6 +660,398 @@
 
         #endregion
 
+        #region 鏍规嵁id鍒犻櫎鍑虹珯鍗�
+        [Route("Cj_StationOutBill/del_StationOutBill")]
+        [HttpGet]
+        public object del_StationOutBill(long HInterID, string HDeleteMan)
+        {
+            try
+            {
+
+                //缂栬緫鏉冮檺
+                if (!DBUtility.ClsPub.Security_Log("MES_StationOutBill_Delete", 1, true, HDeleteMan))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鏃犳潈闄愶紒";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                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"))
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "鍙兘鍒犻櫎鏈汉鐨勫崟鎹紒";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+
+                    SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
+                    DataSet ds;
+                    //鍒ゆ柇鏄惁瀛樺湪 鐩稿悓鍗曟嵁鍙� 鐨勯鏂欏崟 鍒ゆ柇鐢熶骇璁㈠崟鏄惁宸茬粨妗堬紝瑕佹眰璁″垝鎵嬪伐鍙嶇粨妗�    
+                    ds = oCn.RunProcReturn("exec h_p_MES_StationOutBill_DelCtrl  '" + oBill.omodel.HBillNo + "'", "h_p_MES_StationOutBill_DelCtrl");
+                    if (ds == null)
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "鍒ゆ柇鍏宠仈澶辫触锛�";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                    if (ds.Tables[0].Rows.Count > 0 && Pub_Class.ClsPub.isInt(ds.Tables[0].Rows[0][0]) == 2)
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0][1]);
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                    if (oBill.omodel.HChecker != "")
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "鍗曟嵁宸茬粡瀹℃牳,涓嶈兘鍒犻櫎锛�";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+
+                    //鍐欏叆鍒犻櫎鏃ュ織 
+                    string WorkList = "鍒犻櫎鍑虹珯鍗曪細" + oBill.omodel.HBillNo;
+                    if (!oBill.DeleteBill(oBill.omodel.HInterID, oBill.omodel.HProcExchInterID, oBill.omodel.HProcExchEntryID, ref DBUtility.ClsPub.sExeReturnInfo))
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = DBUtility.ClsPub.sExeReturnInfo;
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                    else
+                    {
+                        objJsonResult.code = "1";
+                        objJsonResult.count = 1;
+                        objJsonResult.Message = "鍒犻櫎鎴愬姛锛�";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                }
+                else
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鍗曟嵁鏈壘鍒帮紒";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "寮傚父锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
+
+        #region 缂栬緫鍓嶅垽鏂�
+        [Route("Cj_StationOutBill/set_ShowBillJudge")]
+        [HttpGet]
+        public object set_ShowBillJudge(string HBillNo)
+        {
+            try
+            {
+                ds = oCN.RunProcReturn("exec h_p_MES_StationOutBill_DelCtrl  '" + HBillNo + "'", "h_p_MES_StationOutBill_DelCtrl");
+                if (ds == null || ds.Tables[0].Rows.Count == 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鍒ゆ柇鍏宠仈澶辫触锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                else if (ds.Tables[0].Rows.Count > 0 && Pub_Class.ClsPub.isInt(ds.Tables[0].Rows[0][0]) == 2)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0][1]);
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                else
+                {
+                    objJsonResult.code = "1";
+                    objJsonResult.count = 1;
+                    objJsonResult.Message = "Sucess锛�";
+                    objJsonResult.data = ds.Tables[0];
+                    return objJsonResult;
+                }
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "Exception锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
+
+        #region 瀹℃牳
+        [Route("Cj_StationOutBill/set_CheckBill")]
+        [HttpGet]
+        public object set_CheckBill(int HInterID, string CurUserName)
+        {
+            try
+            {
+                //string ModRightNameCheck = "MES_StationOutBill_Check";
+                ////瀹℃牳鏉冮檺
+                //if (!DBUtility.ClsPub.Security_Log(ModRightNameCheck, 1, true, CurUserName))
+                //{
+                //    objJsonResult.code = "0";
+                //    objJsonResult.count = 0;
+                //    objJsonResult.Message = "瀹℃牳澶辫触锛佹棤鏉冮檺锛�";
+                //    objJsonResult.data = null;
+                //    return objJsonResult;
+                //}
+                if (HInterID == 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鍗曟嵁ID涓�0锛屼笉鑳藉鏍革紒";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                DAL.ClsSc_StationOutBill oBill = new DAL.ClsSc_StationOutBill();
+                //鏌ョ湅鏄惁宸插鏍�,鍏抽棴,浣滃簾
+                if (oBill.ShowBill(HInterID, ref DBUtility.ClsPub.sExeReturnInfo))
+                {
+                    if (oBill.omodel.HChecker.Trim() != "")
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "鍗曟嵁宸插鏍�!涓嶈兘鍐嶆瀹℃牳";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                }
+                else
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鍗曟嵁涓嶅瓨鍦�!鍘熷洜:" + DBUtility.ClsPub.sExeReturnInfo;
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                //瀹℃牳
+                if (Cj_StationOutBillCheckBill(HInterID, CurUserName, oBill.omodel.HLastSubProc, ref DBUtility.ClsPub.sExeReturnInfo))
+                {
+                    objJsonResult.code = "1";
+                    objJsonResult.count = 1;
+                    objJsonResult.Message = "瀹℃牳鎴愬姛!";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                else
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "瀹℃牳澶辫触!鍘熷洜:" + DBUtility.ClsPub.sExeReturnInfo;
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "瀹℃牳澶辫触锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+
+        //瀹℃牳
+        public bool Cj_StationOutBillCheckBill(Int64 lngBillKey, string CurUserName,bool HLastSubProc, ref string sReturn)
+        {
+            try
+            {
+                string HChecker = CurUserName;
+                string HCheckDate = DBUtility.ClsPub.GetServerDate(-1);
+                oCN.BeginTran();
+                ds = oCN.RunProcReturn("Select * from Sc_StationOutBillMain Where HInterID=" + lngBillKey.ToString(), "Sc_StationOutBillMain");
+                if (ds.Tables[0].Rows.Count == 0)
+                {
+                    sReturn = "鍗曟嵁鏈壘鍒帮紒";
+                    return false;
+                }
+                oCN.RunProc(" Update Sc_StationOutBillMain set HChecker='" + HChecker + "',HCheckDate='" + HCheckDate + "' Where HInterID=" + lngBillKey.ToString());
+                oCN.RunProc("exec h_p_Mes_ProcessExchangeRelationQty_Check_In " + lngBillKey.ToString() + ",1");
+                //鍒ゆ柇鏄惁鏄� 鏈亾宸ュ簭
+                DataSet ds1;
+                ds1 = oCN.RunProcReturn("select HLastProc,HFstProc " +
+                    " from Sc_ProcessExchangeBillMain a " +
+                    " inner join Sc_ProcessExchangeBillSub b on a.HInterID=b.HInterID " +
+                    " Where a.HInterID=(Select HProcExchInterID from Sc_StationOutBillMain Where HInterID=" + lngBillKey + ") " +
+                    " and b.HEntryID=(Select HProcExchEntryID from Sc_StationOutBillMain Where HInterID=" + lngBillKey + ")", "Sc_ProcessExchangeBillMain");
+                if (ds1 == null || ds1.Tables[0].Rows.Count == 0 || HLastSubProc ==false)
+                {
+                }
+                else if (Pub_Class.ClsPub.isStrNull(ds1.Tables[0].Rows[0]["HFstProc"]) == "鏄�")
+                {
+                }
+                sReturn = sReturn + " 瀹℃牳鍔熻兘锛�";
+                oCN.Commit();
+                return true;
+            }
+            catch (Exception e)
+            {
+                sReturn = e.Message;
+                oCN.RollBack();
+                return false; ;
+            }
+        }
+        #endregion
+
+        #region 鍙嶅鏍�
+        [Route("Cj_StationOutBill/set_AbandonCheck")]
+        [HttpGet]
+        public object set_AbandonCheck(int HInterID, string CurUserName)
+        {
+            try
+            {
+                if (HInterID == 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鍗曟嵁ID涓�0锛屼笉鑳藉弽瀹℃牳锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                DAL.ClsSc_StationOutBill oBill = new DAL.ClsSc_StationOutBill();
+                //鏌ョ湅鏄惁宸插鏍�,鍏抽棴,浣滃簾
+                if (oBill.ShowBill(HInterID, ref DBUtility.ClsPub.sExeReturnInfo))
+                {
+                    if (oBill.omodel.HChecker.Trim() == "")
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "鍗曟嵁鏈鏍�!涓嶉渶瑕佸弽瀹℃牳!";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                }
+                else
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鍗曟嵁涓嶅瓨鍦�!鍘熷洜:" + DBUtility.ClsPub.sExeReturnInfo;
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                //鍙嶅鏍�
+                if (Cj_StationOutBillAbandonCheckBill(HInterID, CurUserName, oBill.omodel.HLastSubProc, ref DBUtility.ClsPub.sExeReturnInfo))
+                {
+                    objJsonResult.code = "1";
+                    objJsonResult.count = 1;
+                    objJsonResult.Message = "鍙嶅鏍告垚鍔�!";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                else
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鍙嶅鏍稿け璐�!鍘熷洜:" + DBUtility.ClsPub.sExeReturnInfo;
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "鍙嶅鏍稿け璐ワ紒" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+
+        //鍙嶅鏍�
+        public bool Cj_StationOutBillAbandonCheckBill(Int64 lngBillKey, string CurUserName, bool HLastSubProc, ref string sReturn)
+        {
+            if (Cj_StationInBillisUse(lngBillKey, ref sReturn))
+            {
+                return false;
+            }
+            try
+            {
+                string HChecker = CurUserName;
+                string HCheckDate = DBUtility.ClsPub.GetServerDate(-1);
+                oCN.BeginTran();
+                ds = oCN.RunProcReturn("Select * from Sc_StationOutBillMain Where HInterID=" + lngBillKey.ToString(), "Sc_StationOutBillMain");
+                if (ds.Tables[0].Rows.Count == 0)
+                {
+                    sReturn = "鍗曟嵁鏈壘鍒帮紒";
+                    return false;
+                }
+
+                oCN.RunProc(" Update Sc_StationOutBillMain set HChecker='',HCheckDate=null Where HInterID=" + lngBillKey.ToString());
+                //oCN.RunProc("exec h_p_Mes_ProcessExchangeRelationQty_Check_Out " + lngBillKey.ToString() + ",-1");
+                //鍒ゆ柇鏄惁鏄� 棣栭亾宸ュ簭
+                DataSet ds1;
+                ds1 = oCN.RunProcReturn("select HLastProc,HFstProc " +
+                    " from Sc_ProcessExchangeBillMain a " +
+                    " inner join Sc_ProcessExchangeBillSub b on a.HInterID=b.HInterID " +
+                    " Where a.HInterID=(Select HProcExchInterID from Sc_StationOutBillMain Where HInterID=" + lngBillKey + ") " +
+                    " and b.HEntryID=(Select HProcExchEntryID from Sc_StationOutBillMain Where HInterID=" + lngBillKey + ")", "Sc_ProcessExchangeBillMain");
+                if (ds1 == null || ds1.Tables[0].Rows.Count == 0)
+                {
+                }
+                else if (Pub_Class.ClsPub.isStrNull(ds1.Tables[0].Rows[0]["HFstProc"]) == "鏄�")
+                {
+                }
+                sReturn = sReturn + "鍙嶅鏍稿姛鑳斤紒";
+                oCN.Commit();
+                return true;
+            }
+            catch (Exception e)
+            {
+                sReturn = e.Message;
+                oCN.RollBack();
+                return false; ;
+            }
+        }
+
+        //鏄惁琚叧鑱�
+        public bool Cj_StationInBillisUse(Int64 lngBillKey, ref string sReturn)
+        {
+            try
+            {
+                //鏌ヨ涓昏〃
+                DataSet Ds;
+                //Ds = oCN.RunProcReturn("Select HinterID from " + MvarItemKeySub + "  Where HInterID=" + lngBillKey.ToString() + " and isnull(HRelationQty,0)<>0 ", MvarItemKey);
+                //if (Ds.Tables[0].Rows.Count != 0)
+                //{
+                //    sReturn = "鍗曟嵁宸茶鍏宠仈,涓嶈兘鎿嶄綔锛�";
+                //    return true;
+                //}
+                sReturn = "";
+                return false;
+            }
+            catch (Exception e)
+            {
+                sReturn = e.Message;
+                throw (e);
+            }
+        }
+        #endregion
 
         //鎵归噺鍑虹珯
         #region 鎵归噺鍑虹珯妯″潡杩斿洖鏄庣粏淇℃伅鍒楄〃
diff --git a/WebAPI/Controllers/EntrustOutController.cs b/WebAPI/Controllers/EntrustOutController.cs
index 9fd45b4..9d29217 100644
--- a/WebAPI/Controllers/EntrustOutController.cs
+++ b/WebAPI/Controllers/EntrustOutController.cs
@@ -100,6 +100,71 @@
         }
 
 
+        ///// <summary>
+        ///// 鍐欏叆涓存椂琛�  鎵簮鍗曠殑鏂规硶
+        ///// </summary>
+        ///// <param name="HSourceBillNo"></param>
+        ///// <returns></returns>
+        //[Route("EntrustOut/set_SavePonderationBillMain_Temp_Entrust_Source_Fast_Json")]
+        //[HttpGet]
+        //public object set_SavePonderationBillMain_Temp_Entrust_Source_Fast_Json(long sNewInterID, string sNewBillNo,string sSourceBillNo, string HSourceBillType )
+        //{
+        //    string sNewBillType = "1211";
+        //    string sSourceBillType = "1604";
+        //    string sRedBlueflag = "钃濆瓧";
+        //    try
+        //    {
+
+        //        string sWhere = "where 鍗曟嵁鍙� like '%" + sSourceBillNo + "%'";
+        //        //ds = BLL.ClsSourceBill.getSourceBillList(sWhere, HSourceBillType);
+        //        ds = new BLL.ClsKf_EntrustOutBill().GetWW_WWPPBomList(sWhere, ref DBUtility.ClsPub.sExeReturnInfo);
+        //        if (ds == null)
+        //        {
+        //            objJsonResult.code = "0";
+        //            objJsonResult.count = 0;
+        //            objJsonResult.Message = "鏃犳婧愬崟鍙凤紒";
+        //            objJsonResult.data = null;
+        //            return objJsonResult;
+        //        }
+
+        //        //else
+        //        //{
+        //        //    objJsonResult.code = "0";
+        //        //    objJsonResult.count = 1;
+        //        //    objJsonResult.Message = "Success";
+        //        //    objJsonResult.data = ds;
+        //        //    return objJsonResult;
+        //        //}
+        //        DAL.ClsKF_PonderationBillMain_Temp_Ctl dal = new DAL.ClsKF_PonderationBillMain_Temp_Ctl();
+        //        if (dal.AddNew_Source(sNewInterID, sNewBillNo, sNewBillType, sSourceBillNo, sSourceBillType, sRedBlueflag, ref DBUtility.ClsPub.sExeReturnInfo))
+        //        {
+        //            objJsonResult.code = "0";
+        //            objJsonResult.count = 1;
+        //            objJsonResult.Message = "淇濆瓨鍒板嚭鍏ュ簱鏉$爜涓存椂琛ㄦ垚鍔燂紒";
+        //            objJsonResult.data = ds;
+        //            return objJsonResult;
+        //        }
+        //        else
+        //        {
+        //            objJsonResult.code = "0";
+        //            objJsonResult.count = 0;
+        //            objJsonResult.Message = "淇濆瓨鍒板嚭鍏ュ簱鏉$爜涓存椂琛ㄥけ璐ワ紒";
+        //            objJsonResult.data = null;
+        //            return objJsonResult;
+        //        }
+        //    }
+        //    catch (Exception ex)
+        //    {
+        //        objJsonResult.code = "0";
+        //        objJsonResult.count = 0;
+        //        objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛佸紓甯�"+ex.ToString();
+        //        objJsonResult.data = null;
+        //        return objJsonResult;
+        //    }
+        //}
+
+
+
         /// <summary>
         /// 鍐欏叆涓存椂琛�  鎵簮鍗曠殑鏂规硶
         /// </summary>
@@ -107,7 +172,7 @@
         /// <returns></returns>
         [Route("EntrustOut/set_SavePonderationBillMain_Temp_Entrust_Source_Fast_Json")]
         [HttpGet]
-        public object set_SavePonderationBillMain_Temp_Entrust_Source_Fast_Json(long sNewInterID, string sNewBillNo,string sSourceBillNo, string HSourceBillType )
+        public object set_SavePonderationBillMain_Temp_Entrust_Source_Fast_Json(string HSourceBillType, string HSourceBillNo, Int64 sInterID, string sBillNo)
         {
             string sNewBillType = "1211";
             string sSourceBillType = "1604";
@@ -115,40 +180,34 @@
             try
             {
 
-                string sWhere = "where 鍗曟嵁鍙� like '%" + sSourceBillNo + "%'";
-                //ds = BLL.ClsSourceBill.getSourceBillList(sWhere, HSourceBillType);
-                ds = new BLL.ClsKf_EntrustOutBill().GetWW_WWPPBomList(sWhere, ref DBUtility.ClsPub.sExeReturnInfo);
-                if (ds == null)
+                string sWhere = "where 鍗曟嵁鍙� like '%" + HSourceBillNo.Trim() + "%'";
+                ds = webserver.GetWW_WWPPBomList(sWhere);
+                if (ds == null || ds.Tables[0].Rows.Count <= 0)
                 {
                     objJsonResult.code = "0";
                     objJsonResult.count = 0;
-                    objJsonResult.Message = "鏃犳婧愬崟鍙凤紒";
+                    objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍,婧愬崟绫诲瀷鏈夐敊璇紒";
                     objJsonResult.data = null;
                     return objJsonResult;
                 }
+                HSupID = DBUtility.ClsPub.isLong(ds.Tables[0].Rows[0]["HSupID"]);
+                HSupName = Convert.ToString(ds.Tables[0].Rows[0]["HSupName"]);
+                HDeptID = DBUtility.ClsPub.isLong(ds.Tables[0].Rows[0]["HDeptID"]);
+                HDeptName = Convert.ToString(ds.Tables[0].Rows[0]["HDeptName"]);
 
-                //else
-                //{
-                //    objJsonResult.code = "0";
-                //    objJsonResult.count = 1;
-                //    objJsonResult.Message = "Success";
-                //    objJsonResult.data = ds;
-                //    return objJsonResult;
-                //}
-                DAL.ClsKF_PonderationBillMain_Temp_Ctl dal = new DAL.ClsKF_PonderationBillMain_Temp_Ctl();
-                if (dal.AddNew_Source(sNewInterID, sNewBillNo, sNewBillType, sSourceBillNo, sSourceBillType, sRedBlueflag, ref DBUtility.ClsPub.sExeReturnInfo))
+                if (webserver.set_SavePonderationBillMain_Temp_Source_Fast(sInterID, sBillNo, HBillType, HSourceBillNo, HSourceBillType, "钃濆瓧", ref DBUtility.ClsPub.sErrInfo))
                 {
                     objJsonResult.code = "0";
                     objJsonResult.count = 1;
-                    objJsonResult.Message = "淇濆瓨鍒板嚭鍏ュ簱鏉$爜涓存椂琛ㄦ垚鍔燂紒";
-                    objJsonResult.data = ds;
+                    objJsonResult.Message = "杩斿洖璁板綍鎴愬姛锛�";
+                    objJsonResult.data = ds.Tables[0];
                     return objJsonResult;
                 }
                 else
                 {
                     objJsonResult.code = "0";
                     objJsonResult.count = 0;
-                    objJsonResult.Message = "淇濆瓨鍒板嚭鍏ュ簱鏉$爜涓存椂琛ㄥけ璐ワ紒";
+                    objJsonResult.Message = "鍐欏叆涓存椂琛ㄥけ璐ワ紒" + DBUtility.ClsPub.sErrInfo;
                     objJsonResult.data = null;
                     return objJsonResult;
                 }
@@ -157,12 +216,13 @@
             {
                 objJsonResult.code = "0";
                 objJsonResult.count = 0;
-                objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛佸紓甯�"+ex.ToString();
+                objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛佸紓甯�" + ex.ToString();
                 objJsonResult.data = null;
                 return objJsonResult;
             }
         }
 
+
         public bool AddNew_Source(long sNewInterID, string sNewBillNo, string sNewBillType, string sSourceBillNo, string sSourceBillType, string sRedBlueflag, ref string sReturn)
         {
             SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
diff --git a/WebAPI/Controllers/PublicPageMethodController.cs b/WebAPI/Controllers/PublicPageMethodController.cs
index 2ec055e..410fe8d 100644
--- a/WebAPI/Controllers/PublicPageMethodController.cs
+++ b/WebAPI/Controllers/PublicPageMethodController.cs
@@ -2991,5 +2991,7 @@
         #endregion
 
         #endregion
+
+
     }
 }
diff --git a/WebAPI/Controllers/SBGL/Sb_EquipDotCheckBillController.cs b/WebAPI/Controllers/SBGL/Sb_EquipDotCheckBillController.cs
index df7dedb..87a6e09 100644
--- a/WebAPI/Controllers/SBGL/Sb_EquipDotCheckBillController.cs
+++ b/WebAPI/Controllers/SBGL/Sb_EquipDotCheckBillController.cs
@@ -82,7 +82,7 @@
 
         #region 璁惧鐐规璁板綍琛� 淇濆瓨/缂栬緫
         /// <summary>
-        /// 淇濆瓨妯″叿缁翠慨鍗�
+        /// 鐐规璁板綍琛� 淇濆瓨
         /// </summary>
         /// <param name="msg"></param>
         /// <returns></returns>
@@ -318,7 +318,7 @@
                 SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                 if (sqlWhere == null || sqlWhere.Equals(""))
                 {
-                    ds = oCN.RunProcReturn("select 鐐规椤圭洰 HDotCheckItem,鐐规閮ㄤ綅 HDotCheckPart ,鍏蜂綋瑕佹眰 HClaim,琛ㄤ綋澶囨敞 HRemark,璐熻矗浜篒D HManagerID,璐熻矗浜虹紪鐮� HManagerCode,璐熻矗浜� HManagerName  from h_v_Sb_EquipDotCheckBillList", "h_v_Sb_EquipDotCheckBillList");
+                    ds = oCN.RunProcReturn("select 鐐规椤圭洰ID HDotCheckItemID,鐐规椤圭洰浠g爜 as HDotCheckCode ,鐐规椤圭洰 HDotCheckItem,鐐规閮ㄤ綅 HDotCheckPart ,鍏蜂綋瑕佹眰 HClaim,琛ㄤ綋澶囨敞 HRemark,璐熻矗浜篒D HManagerID,璐熻矗浜虹紪鐮� HManagerCode,璐熻矗浜� HManagerName  from h_v_Sb_EquipDotCheckBillList", "h_v_Sb_EquipDotCheckBillList");
                     objJsonResult.code = "0";
                     objJsonResult.count = 1;
                     objJsonResult.Message = "鑾峰彇淇℃伅鎴愬姛锛�";
@@ -326,7 +326,7 @@
                 }
                 else
                 {
-                    string sql1 = "select 鐐规椤圭洰 HDotCheckItem,鐐规閮ㄤ綅 HDotCheckPart,鍏蜂綋瑕佹眰 HClaim,琛ㄤ綋澶囨敞 HRemark,璐熻矗浜篒D HManagerID,璐熻矗浜虹紪鐮� HManagerCode,璐熻矗浜� HManagerName  from h_v_Sb_EquipDotCheckBillList where 1 = 1 ";
+                    string sql1 = "select 鐐规椤圭洰ID HDotCheckItemID,鐐规椤圭洰浠g爜 as HDotCheckCode ,鐐规椤圭洰 HDotCheckItem,鐐规閮ㄤ綅 HDotCheckPart,鍏蜂綋瑕佹眰 HClaim,琛ㄤ綋澶囨敞 HRemark,璐熻矗浜篒D HManagerID,璐熻矗浜虹紪鐮� HManagerCode,璐熻矗浜� HManagerName  from h_v_Sb_EquipDotCheckBillList where 1 = 1 ";
                     string sql = sql1 + sqlWhere;
                     ds = oCN.RunProcReturn(sql, "h_v_Sb_EquipDotCheckBillList");
                     objJsonResult.code = "0";
diff --git a/WebAPI/Controllers/SBGL/Sb_EquipDotCheckPlanBillController.cs b/WebAPI/Controllers/SBGL/Sb_EquipDotCheckPlanBillController.cs
index dc8b188..b36ced9 100644
--- a/WebAPI/Controllers/SBGL/Sb_EquipDotCheckPlanBillController.cs
+++ b/WebAPI/Controllers/SBGL/Sb_EquipDotCheckPlanBillController.cs
@@ -301,7 +301,7 @@
             return new ApiResult<DataSet> { code = 1, msg = "鏌ヨ鎴愬姛", data = dataSet };
         }
         #endregion
-        #region[璁惧鐐规璁″垝琛ㄧ紪杈戞椂鑾峰彇琛ㄩ鏁版嵁]
+        #region[璁惧鐐规璁″垝琛ㄧ紪杈戞椂鑾峰彇琛ㄤ綋鏁版嵁]
         [Route("Sb_EquipDotCheckPlanBill/Sb_EquipDotCheckPlanBillListProjectDetai")]
         [HttpGet]
         public object Sb_EquipDotCheckPlanBillListProjectDetai(string sqlWhere)
@@ -312,7 +312,7 @@
                 SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                 if (sqlWhere == null || sqlWhere.Equals(""))
                 {
-                    ds = oCN.RunProcReturn("select 鐐规椤圭洰 HDotCheckItem,鐐规閮ㄤ綅 HDotCheckPart ,鍏蜂綋瑕佹眰 HClaim,琛ㄤ綋澶囨敞 HRemark,璐熻矗浜轰唬鐮� HManagerID,璐熻矗浜� HManagerName from h_v_Sb_EquipDotCheckPlanBillList", "h_v_Sb_EquipDotCheckPlanBillList");
+                    ds = oCN.RunProcReturn("select 鐐规椤圭洰ID  HDotCheckItemID,鐐规椤圭洰浠g爜  HDotCheckCode ,鐐规椤圭洰 HDotCheckItem,鐐规閮ㄤ綅 HDotCheckPart ,鍏蜂綋瑕佹眰 HClaim,琛ㄤ綋澶囨敞 HRemark,璐熻矗浜篒D HManagerID,璐熻矗浜轰唬鐮� HManagerCode,璐熻矗浜� HManagerName from h_v_Sb_EquipDotCheckPlanBillList", "h_v_Sb_EquipDotCheckPlanBillList");
                     objJsonResult.code = "0";
                     objJsonResult.count = 1;
                     objJsonResult.Message = "鑾峰彇淇℃伅鎴愬姛锛�";
@@ -320,7 +320,7 @@
                 }
                 else
                 {
-                    string sql1 = "select 鐐规椤圭洰 HDotCheckItem,鐐规閮ㄤ綅 HDotCheckPart ,鍏蜂綋瑕佹眰 HClaim,琛ㄤ綋澶囨敞 HRemark,璐熻矗浜轰唬鐮� HManagerID,璐熻矗浜� HManagerName from h_v_Sb_EquipDotCheckPlanBillList where 1 = 1 ";
+                    string sql1 = "select 鐐规椤圭洰ID  HDotCheckItemID,鐐规椤圭洰浠g爜  HDotCheckCode ,鐐规椤圭洰 HDotCheckItem,鐐规閮ㄤ綅 HDotCheckPart ,鍏蜂綋瑕佹眰 HClaim,琛ㄤ綋澶囨敞 HRemark,璐熻矗浜篒D HManagerID,璐熻矗浜轰唬鐮� HManagerCode,璐熻矗浜� HManagerName from h_v_Sb_EquipDotCheckPlanBillList where 1 = 1 ";
                     string sql = sql1 + sqlWhere;
                     ds = oCN.RunProcReturn(sql, "h_v_Sb_EquipDotCheckPlanBillList");
                     objJsonResult.code = "0";
diff --git a/WebAPI/Controllers/SBGL/Sb_EquipMaintainPlanBillController.cs b/WebAPI/Controllers/SBGL/Sb_EquipMaintainPlanBillController.cs
index 7c415bd..d8a9b7a 100644
--- a/WebAPI/Controllers/SBGL/Sb_EquipMaintainPlanBillController.cs
+++ b/WebAPI/Controllers/SBGL/Sb_EquipMaintainPlanBillController.cs
@@ -10,6 +10,7 @@
     {
         private json objJsonResult = new json();
         public DataSet ds = new DataSet();
+        SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
 
         #region 璁惧淇濆吇璁″垝琛�
 
@@ -23,12 +24,38 @@
         {
             try
             {
-                ds = Sb_EquipMaintainPlanBillList_s(sWhere);
-                objJsonResult.code = "1";
-                objJsonResult.count = 1;
-                objJsonResult.Message = "杩斿洖璁板綍鎴愬姛锛�";
-                objJsonResult.data = ds.Tables[0];
-                return objJsonResult;
+                if (sWhere == null || sWhere.Equals(""))
+                {
+                    ds = oCN.RunProcReturn("select * from h_v_Sc_EquipMaintain " + sWhere + " order by hmainid desc", "h_v_Sc_EquipMaintain");
+                }
+                else
+                {
+                    string sql1 = "select * from h_v_Sc_EquipMaintain where 1 = 1";
+                    string sql = sql1 + sWhere + " order by hmainid desc";
+                    ds = oCN.RunProcReturn(sql, "h_v_Sc_EquipMaintain");
+                }
+                if (ds == null || ds.Tables[0].Rows.Count == 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "娌℃湁浣犺鎵剧殑璁板綍锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                else
+                {
+                    objJsonResult.code = "1";
+                    objJsonResult.count = 1;
+                    objJsonResult.Message = "杩斿洖璁板綍鎴愬姛锛�";
+                    objJsonResult.data = ds.Tables[0];
+                    return objJsonResult;
+                }
+                //ds = Sb_EquipMaintainPlanBillList_s(sWhere);
+                //objJsonResult.code = "1";
+                //objJsonResult.count = 1;
+                //objJsonResult.Message = "杩斿洖璁板綍鎴愬姛锛�";
+                //objJsonResult.data = ds.Tables[0];
+                //return objJsonResult;
             }
             catch (Exception ex)
             {
@@ -64,7 +91,7 @@
             string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
             string msg2 = sArray[0].ToString();
             string msg3 = sArray[1].ToString();
-
+            string msg4 = sArray[2].ToString();
 
             string UserName = "";
             ListModels oListModels = new ListModels();
@@ -108,20 +135,46 @@
                     }
                     oBill.omodel = oItem;
                 }
-                //琛ㄤ綋鏁版嵁
+                //淇濆吇椤硅〃浣撴暟鎹�
                 //鎸� },{鏉ユ媶鍒嗘暟缁� //鍘绘帀銆愬拰銆�
                 msg3 = msg3.Substring(1, msg3.Length - 2);
                 msg3 = msg3.Replace("\\", "");
                 msg3 = msg3.Replace("\n", "");  //\n
                 //msg2 = msg2.Replace("'", "鈥�");
-                List<Model.ClsSb_EquipMaintainPlanBillSub> ls = new List<Model.ClsSb_EquipMaintainPlanBillSub>();
-                ls = oListModels.getObjectByJson_Sb_EquipMaintainPlanBillSub(msg3);
+                List<Model.ClsSc_EquipMaintainPlanBillSub_Item> ls = new List<Model.ClsSc_EquipMaintainPlanBillSub_Item>();
+                ls = oListModels.getObjectByJson_Sc_EquipMaintainPlanBillSub_Item(msg3);
                 int i = 0;
-                foreach (Model.ClsSb_EquipMaintainPlanBillSub oItemSub in ls)
+                foreach (Model.ClsSc_EquipMaintainPlanBillSub_Item item in ls)
                 {
 
                     i++;
-                    oItemSub.HEntryID = i;
+                    item.HEntryID = i;
+                    //oItemSub.HCloseMan = "";       //琛屽叧闂�
+                    item.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now);
+                    item.HCloseType = false;   //鍏抽棴绫诲瀷
+                    //oItemSub.HRemark = "";         //澶囨敞
+                    item.HSourceInterID = 0;     // 婧愬崟涓诲唴鐮�
+                    item.HSourceEntryID = 0;   //婧愬崟瀛愬唴鐮�
+                    //oItemSub.HSourceBillNo = "";  //婧愬崟鍗曞彿
+                    //oItemSub.HSourceBillType = ""; //婧愬崟绫诲瀷
+                    item.HRelationQty = 0;     //鍏宠仈鏁伴噺
+                    oBill.DetailCol.Add(item);
+
+                }
+                //閰嶄欢椤硅〃浣撴暟鎹�
+                //鎸� },{鏉ユ媶鍒嗘暟缁� //鍘绘帀銆愬拰銆�
+                msg4 = msg4.Substring(1, msg4.Length - 2);
+                msg4 = msg4.Replace("\\", "");
+                msg4 = msg4.Replace("\n", "");  //\n
+                //msg2 = msg2.Replace("'", "鈥�");
+                List<Model.ClsSb_EquipMaintainPlanBillSub> ls1 = new List<Model.ClsSb_EquipMaintainPlanBillSub>();
+                ls1 = oListModels.getObjectByJson_Sb_EquipMaintainPlanBillSub(msg4);
+                int j = 0;
+                foreach (Model.ClsSb_EquipMaintainPlanBillSub oItemSub in ls1)
+                {
+
+                    j++;
+                    oItemSub.HEntryID = j;
                     //oItemSub.HCloseMan = "";       //琛屽叧闂�
                     oItemSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now);
                     oItemSub.HCloseType = false;   //鍏抽棴绫诲瀷
@@ -183,24 +236,13 @@
         #endregion
         #region [璁惧淇濆吇璁″垝琛ㄥ垹闄ゅ姛鑳絔
         /// <summary>
-        /// 妯″叿缁翠慨鍗曞垹闄ゅ姛鑳�
+        /// 璁惧淇濆吇璁″垝琛ㄥ垹闄ゅ姛鑳�
         /// </summary>
         /// <returns></returns>
         [Route("Sb_EquipMaintainPlanBill/DeltetEquipMaintainPlanBillList")]
         [HttpGet]
         public object DeltetEquipMaintainPlanBillList(string HInterID)
         {
-            //缂栬緫鏉冮檺
-            //if (!DBUtility.ClsPub.Security_Log("Sb_MouldRepairWorkBill_Delete", 1, true, DBUtility.ClsPub.CurUserName))
-            //{
-            //    objJsonResult.code = "0";
-            //    objJsonResult.count = 0;
-            //    objJsonResult.Message = "鏃犲垹闄ゆ潈闄愶紒";
-            //    objJsonResult.data = null;
-            //    return objJsonResult;
-            //}
-
-
             Int64 lngBillKey = 0;
             lngBillKey = DBUtility.ClsPub.isLong(HInterID);
             if (lngBillKey == 0)
@@ -285,7 +327,7 @@
                 SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                 if (sqlWhere == null || sqlWhere.Equals(""))
                 {
-                    ds = oCN.RunProcReturn("select 鐢ㄩ噺 HQty,HMaterID, HUnitID ,琛ㄤ綋澶囨敞 HRemark from h_v_Sb_EquipMaintainPlanBillList", "h_v_Sb_EquipMaintainPlanBillList_Edit");
+                    ds = oCN.RunProcReturn("select 鐢ㄩ噺 HQty, HMaterID ,鍗曚綅ID HItemID,鍗曚綅浠g爜 HUnitCodem,鍗曚綅鍚嶇О HUnitName,琛ㄤ綋澶囨敞 HRemark from h_v_Sb_EquipMaintainPlanBillList", "h_v_Sb_EquipMaintainPlanBillList_Edit");
                     objJsonResult.code = "0";
                     objJsonResult.count = 1;
                     objJsonResult.Message = "鑾峰彇淇℃伅鎴愬姛锛�";
@@ -293,7 +335,7 @@
                 }
                 else
                 {
-                    string sql1 = "select 鐢ㄩ噺 HQty,HMaterID, HUnitID ,琛ㄤ綋澶囨敞 HRemark from h_v_Sb_EquipMaintainPlanBillList where 1 = 1 ";
+                    string sql1 = "select 鐢ㄩ噺 HQty, HMaterID ,鍗曚綅ID HItemID,鍗曚綅浠g爜 HUnitCodem,鍗曚綅鍚嶇О HUnitName,琛ㄤ綋澶囨敞 HRemark from h_v_Sb_EquipMaintainPlanBillList where 1 = 1 ";
                     string sql = sql1 + sqlWhere;
                     ds = oCN.RunProcReturn(sql, "h_v_Sb_EquipMaintainPlanBillList");
                     objJsonResult.code = "0";
@@ -313,7 +355,49 @@
         }
         #endregion
 
+        #region[璁惧淇濆吇璁″垝琛ㄧ紪杈戞椂鑾峰彇琛ㄤ綋鏁版嵁鏂�(淇濆吇椤瑰垪琛ㄣ�侀厤浠堕」鍒楄〃)]
+        [Route("Sb_EquipMaintainPlanBill/Sb_EquipMaintainBillListProjectDetaiNew")]
+        [HttpGet]
+        public object Sb_EquipMaintainBillListProjectDetaiNew(string HInterID)
+        {
 
+            DataSet ds, ds1;
+            List<object> list = new List<object>();
+            string Swhere = "";
+            try
+            {
+                if (HInterID != "" || HInterID != null)
+                {
+                    Swhere = " and hmainid='" + HInterID + "'";
+                }
+                else
+                {
+                    Swhere = HInterID;
+                }
+                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+                //鑾峰彇淇濆吇椤圭洰缂栬緫鏁版嵁
+                string sql = "select HMaintainItemID, 淇濆吇椤圭洰浠g爜 HMaintainItemNumber,淇濆吇椤圭洰鍚嶇О HMaintainItem,淇濆吇閮ㄤ綅 HMaintainPart,鍏蜂綋瑕佹眰 HClaim,HManagerID,璐熻矗浜轰唬鐮� HManagerNumber,璐熻矗浜� HManagerName,琛ㄤ綋澶囨敞 HRemark  from h_v_Sb_EquipMaintainBillSub_Item where 1 = 1 " + Swhere + "";
+                ds = oCN.RunProcReturn(sql, "h_v_Sb_EquipMaintainBillSub_Item");
+                //鑾峰彇閰嶄欢椤圭洰缂栬緫鏁版嵁
+                string sql1 = "select HMaterID, 閰嶄欢浠g爜 HMaterNumber,閰嶄欢鍚嶇О HMaterName,鍗曚綅ID HUnitID,鍗曚綅浠g爜 HUnitNumber,鍗曚綅鍚嶇О HUnitName,鐢ㄩ噺 HQty,鏍囧噯鐢ㄩ噺 HQtyMust,琛ㄤ綋澶囨敞 HRemark  from h_v_Sb_EquipMaintainPlanBillList where 1 = 1 " + Swhere + "";
+                ds1 = oCN.RunProcReturn(sql1, "h_v_Sb_EquipMaintainPlanBillList");
+                list.Add(ds.Tables[0]);
+                list.Add(ds1.Tables[0]);
+                objJsonResult.code = "0";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "鑾峰彇淇℃伅鎴愬姛锛�";
+                objJsonResult.list = list;
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�" + e.ToString();
+                objJsonResult.data = null;
+            }
+            return objJsonResult;
+        }
+        #endregion
 
 
 
diff --git a/WebAPI/Controllers/SCGL/QC_LastPieceCheckBillController.cs b/WebAPI/Controllers/SCGL/QC_LastPieceCheckBillController.cs
index f4ee717..5925e55 100644
--- a/WebAPI/Controllers/SCGL/QC_LastPieceCheckBillController.cs
+++ b/WebAPI/Controllers/SCGL/QC_LastPieceCheckBillController.cs
@@ -210,13 +210,13 @@
             {
                 if (sWhere == null || sWhere.Equals(""))
                 {
-                    ds = oCN.RunProcReturn("select * from [h_v_QC_LastPieceCheckBillList] " + sWhere, "[h_v_QC_LastPieceCheckBillList]");
+                    ds = oCN.RunProcReturn("select * from h_v_QC_LastPieceCheckBillListDetail " + sWhere, "h_v_QC_LastPieceCheckBillListDetail");
                 }
                 else
                 {
-                    string sql1 = "select * from [h_v_QC_LastPieceCheckBillList] where 1 = 1 ";
+                    string sql1 = "select * from h_v_QC_LastPieceCheckBillListDetail where 1 = 1 ";
                     string sql = sql1 + sWhere;
-                    ds = oCN.RunProcReturn(sql, "[h_v_QC_LastPieceCheckBillList]");
+                    ds = oCN.RunProcReturn(sql, "h_v_QC_LastPieceCheckBillListDetail");
                 }
                 if (ds == null || ds.Tables[0].Rows.Count == 0)
                 {
diff --git a/WebAPI/Controllers/SCGL/Sc_MaterToSourceBillController.cs b/WebAPI/Controllers/SCGL/Sc_MaterToSourceBillController.cs
index 641a583..c8db589 100644
--- a/WebAPI/Controllers/SCGL/Sc_MaterToSourceBillController.cs
+++ b/WebAPI/Controllers/SCGL/Sc_MaterToSourceBillController.cs
@@ -4,6 +4,7 @@
 using System.Collections;
 using System.Collections.Generic;
 using System.Data;
+using System.Linq;
 using System.Data.SqlClient;
 using System.Web.Http;
 using WebAPI.Models;
@@ -18,8 +19,14 @@
         private json objJsonResult = new json();
         SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
         DataSet ds;
+        //鑾峰彇绯荤粺鍙傛暟
+        Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter();
+
+        public DAL.ClsSc_MESMaterToSourceBill BillNew = new DAL.ClsSc_MESMaterToSourceBill();   //瀵瑰簲鍗曟嵁绫�
+        public DAL.ClsSc_MESMaterToSourceBill BillOld = new DAL.ClsSc_MESMaterToSourceBill();   //瀵瑰簲鍗曟嵁绫�
 
 
+        #region 涓婃枡鏀鹃敊鍗昗eb鍒楄〃鏌ヨ
         /// <summary>
         /// 杩斿洖鐢熶骇涓婃枡鍗曞垪琛�
         ///鍙傛暟锛歴tring sql銆�
@@ -33,27 +40,27 @@
             {
                 if (sWhere == null || sWhere.Equals(""))
                 {
-                    ds = oCN.RunProcReturn("select * from h_v_Sc_MaterToSourceBillList " + sWhere, "h_v_Sc_MaterToSourceBillList");
+                    ds = oCN.RunProcReturn("select * from h_v_Sc_MaterToSourceBillMain " + sWhere, "h_v_Sc_MaterToSourceBillMain");
                 }
                 else
                 {
-                    string sql1 = "select * from h_v_Sc_MaterToSourceBillList where 1 = 1 ";
+                    string sql1 = "select * from h_v_Sc_MaterToSourceBillMain where 1 = 1 ";
                     string sql = sql1 + sWhere;
-                    ds = oCN.RunProcReturn(sql, "h_v_Sc_MaterToSourceBillList");
+                    ds = oCN.RunProcReturn(sql, "h_v_Sc_MaterToSourceBillMain");
                 }
                 if (ds == null || ds.Tables[0].Rows.Count == 0)
                 {
                     objJsonResult.code = "0";
                     objJsonResult.count = 0;
                     objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�";
-                    objJsonResult.data = null;
+                    objJsonResult.data = ds.Tables[0];
                     return objJsonResult;
                 }
                 else
                 {
                     objJsonResult.code = "1";
                     objJsonResult.count = 1;
-                    objJsonResult.Message = "Sucess锛�";
+                    objJsonResult.Message = "鏌ヨ鏁版嵁鎴愬姛锛�";
                     objJsonResult.data = ds.Tables[0];
                     return objJsonResult;
                 }
@@ -67,10 +74,148 @@
                 return objJsonResult;
             }
         }
+        #endregion
+
+        #region 涓婃枡闃查敊鍗曠紪杈戞椂鑾峰彇琛ㄥご鏁版嵁
+        [Route("Sc_MaterToSourceBill/Sc_MaterToSourceBillListCheckDetai")]
+        [HttpGet]
+        public ApiResult<DataSet> Sc_MaterToSourceBillListCheckDetai(string HID)
+        {
+            if (string.IsNullOrEmpty(HID))
+                return new ApiResult<DataSet> { code = -1, msg = "ID涓嶈兘涓虹┖" };
+            SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+            var dataSet = oCN.RunProcReturn("select top 1 * from h_v_Sc_MaterToSourceBillMain  where hmainid= " + HID + " ", "h_v_Sc_MaterToSourceBillMain");
+            if (dataSet == null || dataSet.Tables[0].Rows.Count == 0)
+                return new ApiResult<DataSet> { code = -1, msg = "涓嶅瓨鍦ㄤ笂鏂欓槻閿欏崟鏁版嵁" };
+            return new ApiResult<DataSet> { code = 1, msg = "鏌ヨ鎴愬姛", data = dataSet };
+        }
+        #endregion
+
+        #region 涓婃枡闃查敊鍗曠紪杈戞椂鑾峰彇琛ㄤ綋鏁版嵁(閰嶆枡璁板綍銆佹不鍏疯褰�)
+        [Route("Sc_MaterToSourceBill/Sc_MaterToSourceBillListProjectDetai")]
+        [HttpGet]
+        public object Sc_MaterToSourceBillListProjectDetai(string HInterID)
+        {
+
+            DataSet ds, ds1;
+            List<object> list = new List<object>();
+            string Swhere = "";
+            try
+            {
+                if (HInterID != "" || HInterID != null)
+                {
+                    Swhere = " and hmainid='" + HInterID + "'";
+                }
+                else
+                {
+                    Swhere = HInterID;
+                }
+                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+                //鑾峰彇閰嶆枡璁板綍缂栬緫鏁版嵁
+                string sql = "select 鏉″舰鐮� HBarCode,HMaterID,鐗╂枡浠g爜 HNumber,鐗╂枡鍚嶇О HName,瑙勬牸鍨嬪彿 HModel,HUnitID,璁¢噺鍗曚綅鍚嶇О HUnitName,鏁伴噺 HQty   from h_v_Sc_MaterToSourceBillSub where 1 = 1 " + Swhere + "";
+                ds = oCN.RunProcReturn(sql, "h_v_Sc_MaterToSourceBillSub");
+                //鑾峰彇娌诲叿璁板綍缂栬緫鏁版嵁
+                //string sql1 = "select HMaterID, 閰嶄欢浠g爜 HMaterNumber,閰嶄欢鍚嶇О HMaterName,瑙勬牸鍨嬪彿 HMaterSpec,HUnitID,鍗曚綅浠g爜 HUnitNumber,鍗曚綅鍚嶇О HUnitName,瀹為檯鐢ㄩ噺 HQty,鏍囧噯鐢ㄩ噺 HQtyMust,HManagerID,璐熻矗浜轰唬鐮� HManagerNumber,璐熻矗浜� HManagerName,琛ㄤ綋澶囨敞 HRemark  from h_v_Sc_MouldMaintainBillList where 1 = 1 " + Swhere + "";
+                //ds1 = oCN.RunProcReturn(sql1, "h_v_Sc_MouldMaintainBillList");
+                list.Add(ds.Tables[0]);
+                //list.Add(ds1.Tables[0]);
+                objJsonResult.code = "0";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "鑾峰彇淇℃伅鎴愬姛锛�";
+                objJsonResult.list = list;
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�" + e.ToString();
+                objJsonResult.data = null;
+            }
+            return objJsonResult;
+        }
+        #endregion
+
+        #region [涓婃枡闃查敊鍗曞垹闄ゅ姛鑳絔
+        /// <summary>
+        /// 寮�宸ュ崟鍒犻櫎鍔熻兘
+        /// </summary>
+        /// <returns></returns>
+        [Route("Sc_MaterToSourceBill/DeltetMaterToSourceBill")]
+        [HttpGet]
+        public object DeltetMaterToSourceBill(string HInterID, string UserName)
+        {
+            DBUtility.ClsPub.CurUserName = UserName;
+            //缂栬緫鏉冮檺
+            //if (!DBUtility.ClsPub.Security_Log("MES_MaterToSourceBill_Delete", 1, true, DBUtility.ClsPub.CurUserName))
+            //{
+            //    objJsonResult.code = "0";
+            //    objJsonResult.count = 0;
+            //    objJsonResult.Message = "鏃犲垹闄ゆ潈闄愶紒";
+            //    objJsonResult.data = null;
+            //    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;
+            }
+            DAL.ClsSc_MESMaterToSourceBill oBill = new DAL.ClsSc_MESMaterToSourceBill();
+            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)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 1;
+                    objJsonResult.Message = DBUtility.ClsPub.sExeReturnInfo;
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                else
+                {
+
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = DBUtility.ClsPub.sExeReturnInfo;
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+            }
+            else
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "鍗曟嵁鏈壘鍒�";
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
+
 
         #region  鎶ュ伐骞冲彴涓婃枡闃查敊鍗曞脊绐楁煡鎵炬暟鎹�
         [Route("Sc_MaterToSourceBill/GetMESMaterToSourceFrom")]
@@ -111,5 +256,515 @@
             return objJsonResult;
         }
         #endregion
+
+        #region 鎶ュ伐骞冲彴涓婃枡闃查敊涓�閿壂鐮佹柟娉�
+        [Route("Sc_MaterToSourceBill/get_CheckTypeByBarCode_Json")]
+        [HttpGet]
+        public object get_CheckTypeByBarCode_Json(string HBarCode,string HSourceID,string HICMOInterID,string HICMOEntryID)
+        {
+            
+            //鏍规嵁閫掑叆鐨勬潯鐮佸墠涓変綅锛屽垽鏂潯鐮佺被鍨嬶紙鐢熶骇璧勬簮銆佺墿鏂欐潯鐮侊級
+            ds = oCN.RunProcReturn(" select HSourceName,BarCodeType from Xt_BarCodeType where HSourceNumber= '" + HBarCode.Substring(0, 3) + "'", "Xt_BarCodeType");
+
+            //鏃犺繑鍥炴暟鎹垯涓虹墿鏂欐潯鐮�
+            if (ds == null || ds.Tables[0].Rows.Count == 0)
+            {
+                //1.鏌ヨ鏉″舰鐮佸湪鏉$爜妗f琛ㄤ腑鏄惁瀛樺湪
+                DataSet ds0 = oCN.RunProcReturn(" select HMaterID from Gy_BarCodeBill where HBarCode= '" + HBarCode + "'", "Gy_BarCodeBill");
+                if (ds0 == null || ds0.Tables[0].Rows.Count == 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鏉$爜妗f涓笉瀛樺湪姝ょ墿鏂欐潯鐮侊紝鏉$爜鏃犳晥锛�";
+                    return objJsonResult;
+                }
+                else 
+                {
+                    //2.鍖归厤鐢ㄦ枡娓呭崟鐨勭墿鏂欑紪鐮佹槸鍚︿竴鑷�
+                    string sql = @"select '{0}' HBarCode,b.HMaterID,m.HNumber,m.HName,m.HModel,a.HQty HMQty, b.HQty,b.HUnitID,u.HName HUnitName   from sc_PPbomBillMain a
+                                                 inner join Sc_PPBomBillSub b on a.HInterID = b.HInterID
+                                                 left join Gy_Material m on b.HMaterID = m.HItemID
+                                                 left join Gy_Unit u on b.HUnitID = u.HItemID
+                                                 where a.HICMOInterID = '{1}' and a.HICMOEntryID = '{2}'";
+                    sql = string.Format(sql,HBarCode, HICMOInterID, HICMOEntryID);
+
+               
+                    ds = oCN.RunProcReturn(sql, "Sc_PPBomBillSub");
+                    if (ds.Tables[0].Rows.Count > 0) //鏈夌敤鏂欐竻鍗曡褰�
+                    {
+                        //var dt0 = ds.Tables[0].AsEnumerable().Where<DataRow>(C => C["HMaterID"].ToString() == "133927").CopyToDataTable();
+                        DataTable dt = ds.Tables[0].AsEnumerable().Where<DataRow>(W => W["HMaterID"].ToString() == ds0.Tables[0].Rows[0]["HMaterID"].ToString()).CopyToDataTable(); //鍒ゆ柇褰撳墠鏁版嵁(涓�鏉℃垨澶氭潯)涓渶缁堝垽瀹氭槸鍚︽湁鍚堟牸
+                        if (dt == null || dt.Rows.Count == 0)
+                        {
+                            objJsonResult.code = "0";
+                            objJsonResult.count = 0;
+                            objJsonResult.Message = "鏉$爜鏃犳晥锛屼笉瀛樺湪浜庣敤鏂欐竻鍗曚腑锛�";
+                            objJsonResult.data = null;
+                            return objJsonResult;
+                        }
+                        else 
+                        {
+                            objJsonResult.code = "1";
+                            objJsonResult.count = 1;
+                            objJsonResult.Message = "鑾峰彇鐢ㄦ枡娓呭崟鏁版嵁鎴愬姛锛�";
+                            objJsonResult.Verify = "鐢ㄦ枡娓呭崟鐗╂枡鏉$爜";
+                            objJsonResult.data = dt;
+                            return objJsonResult;
+                        }
+                    }
+                    else 
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "褰撳墠鐢熶骇璁㈠崟鏃犵敤鏂欐竻鍗曡褰曪紒";
+                        return objJsonResult;
+                    }
+                }
+            }
+            else
+            {
+                string sBarBillName = Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HSourceName"]);
+                string sBarBillType = Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0]["BarCodeType"]);
+
+                //鍒ゆ柇鏉$爜绫诲瀷涓� 鍩虹璧勬枡鏉$爜 鎴� 婧愬崟鏉$爜
+                if (sBarBillType == "鍩虹璧勬枡鏉$爜")
+                {
+        
+                    //閮ㄩ棬鏉$爜
+                    if (sBarBillName == "鐢熶骇璧勬簮")
+                    {
+                        //DAL.ClsGy_Source_View dal = new DAL.ClsGy_Source_View();
+                        
+                        //灏嗛�掑叆鐨勬潯鐮佸幓鎺夊墠涓変綅鍚庤浆鍖栨垚鏁村舰
+                        int ID;
+                        if (int.TryParse(HBarCode.Remove(0, 3), out ID))
+                        {
+                            if (int.Parse(HSourceID)!= ID)
+                            {
+                                objJsonResult.code = "0";
+                                objJsonResult.count = 0;
+                                objJsonResult.Message = "鐢熶骇璧勬簮鏉$爜涓庣敓浜ц鍗曠粦瀹氳祫婧愪笉鍖归厤锛�";
+                                return objJsonResult;
+                            }
+                            else
+                            {
+                                ds = oCN.RunProcReturn("Select * from Gy_Source Where HItemID='" + ID + "'", "Gy_Source");
+                                if(ds.Tables[0].Rows.Count>0)    //if (dal.GetInfoByID(ID))
+                                {
+                                    objJsonResult.code = "1";
+                                    objJsonResult.count = 1;
+                                    objJsonResult.Message = "鑾峰彇璧勬簮缁戝畾鏁版嵁鎴愬姛锛�";
+                                    objJsonResult.Verify = "璧勬簮鏉$爜";
+                                    objJsonResult.data = ds;
+                                    return objJsonResult;
+                                }
+                                else
+                                {
+                                    objJsonResult.code = "0";
+                                    objJsonResult.count = 0;
+                                    objJsonResult.Message = "鏃犳晥璧勬簮鏉$爜锛�";
+                                    return objJsonResult;
+                                }
+                            }
+                        }
+                        else
+                        {
+                            objJsonResult.code = "0";
+                            objJsonResult.count = 0;
+                            objJsonResult.Message = "閿欒鐨勮祫婧愭潯鐮侊紒";
+                            return objJsonResult;
+                        }
+                    }
+                    else
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "鏃犳晥鍩虹璧勬枡鏉$爜锛�";
+                        return objJsonResult;
+                    }
+                }
+                //婧愬崟鏉$爜
+                else if (sBarBillType == "婧愬崟鏉$爜")
+                {
+                    
+                    
+                }
+                else
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鏃犳晥鏉$爜绫诲瀷锛�";
+                    return objJsonResult;
+                }
+            }
+            return objJsonResult;
+        }
+        #endregion
+
+        #region 鎶ュ伐鍙颁笂鏂欓槻閿欎繚瀛�
+        /// <summary>
+        /// 淇濆瓨妯″叿缁翠慨鍗�
+        /// </summary>
+        /// <param name="msg"></param>
+        /// <returns></returns>
+        [Route("Sc_MaterToSourceBill/SaveGetMaterToSourceFrom")]
+        [HttpPost]
+        public object SaveGetMaterToSourceFrom([FromBody] JObject msg)
+        {
+            var _value = msg["msg"].ToString();
+            string msg1 = _value.ToString();
+            string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
+            string msg2 = sArray[0].ToString();
+            string msg3 = sArray[1].ToString();
+            string refSav = sArray[2].ToString();
+
+            //淇濆瓨鏉冮檺
+            //if (!DBUtility.ClsPub.Security_Log("MES_MaterToSourceBill_Edit", 1, true, DBUtility.ClsPub.CurUserName))
+            //{
+            //    objJsonResult.code = "0";
+            //    objJsonResult.count = 0;
+            //    objJsonResult.Message = "鏃犱繚瀛樻潈闄愶紒";
+            //    objJsonResult.data = null;
+            //    return objJsonResult;
+            //}
+
+            //鍒ゆ柇浼氳鏈熸槸鍚﹀悎鐞�
+            string s = "";
+            int sYear = 0;
+            int sPeriod = 0;
+            if (DBUtility.Xt_BaseBillFun.Fun_AllowYearPeriod(DateTime.Now, ref sYear, ref sPeriod, ref s) == false)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = s;
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+
+            string UserName = "";
+            ListModels oListModels = new ListModels();
+            try
+            {
+                //琛ㄥご鏁版嵁瀹炰緥鍖�
+                DAL.ClsSc_MESMaterToSourceBill oBill = new DAL.ClsSc_MESMaterToSourceBill();
+                List<Model.ClsSc_MaterToSourceBillMain> lsmain = new List<Model.ClsSc_MaterToSourceBillMain>();
+                msg2 = msg2.Replace("\\", "");
+                msg2 = msg2.Replace("\n", "");  //\n
+                lsmain = oListModels.getObjectByJson_Sc_MaterToSourceBillMain(msg2);
+
+                //閰嶆枡璁板綍琛ㄤ綋鏁版嵁瀹炰緥鍖�
+                //鎸� },{鏉ユ媶鍒嗘暟缁� //鍘绘帀銆愬拰銆�
+                msg3 = msg3.Substring(1, msg3.Length - 2);
+                msg3 = msg3.Replace("\\", "");
+                msg3 = msg3.Replace("\n", "");  //\n
+                //msg2 = msg2.Replace("'", "鈥�");
+                List<Model.ClsSc_MaterToSourceBillSub> ls = new List<Model.ClsSc_MaterToSourceBillSub>();
+                ls = oListModels.getObjectByJson_Sc_MaterToSourceBillSub(msg3);
+
+                //閰嶄欢椤硅〃浣撴暟鎹疄渚嬪寲
+
+                foreach (Model.ClsSc_MaterToSourceBillMain oItem in lsmain)
+                {
+                    if (refSav == "Add")
+                    {
+                        //鍗曟嵁鍙锋槸鍚﹂噸澶�
+                        if (BillNew.IsExistBillNo(ref ClsPub.sExeReturnInfo, oItem.HBillNo, BillStatus, BillOld.omodel.HInterID))
+                        {
+                            objJsonResult.code = "0";
+                            objJsonResult.count = 0;
+                            objJsonResult.Message = "鍗曟嵁鍙烽噸澶嶏紒涓嶅厑璁镐繚瀛橈紒";
+                            objJsonResult.data = 1;
+                            return objJsonResult;
+                        }
+                    }
+                    if (refSav == "Update")
+                    {
+                        if (BillOld.ShowBill(oItem.HInterID, ref s) == false)
+                        {
+                            objJsonResult.code = "0";
+                            objJsonResult.count = 0;
+                            objJsonResult.Message = "姝ゅ崟鎹湁璇紒";
+                            objJsonResult.data = 1;
+                            return objJsonResult;
+                        }
+                        //鍒ゆ柇鏄惁鍙紪杈�
+                        if (BillOld.omodel.HChecker != "" && BillOld.omodel.HChecker != null)
+                        {
+                            objJsonResult.code = "0";
+                            objJsonResult.count = 0;
+                            objJsonResult.Message = "姝ゅ崟鎹凡缁忚瀹℃牳锛屼笉鍏佽淇敼锛�";
+                            objJsonResult.data = 1;
+                            return objJsonResult;
+                        }
+                        if (BillOld.omodel.HBillStatus > 1)
+                        {
+                            objJsonResult.code = "0";
+                            objJsonResult.count = 0;
+                            objJsonResult.Message = "姝ゅ崟鎹浜庝笉鍙紪杈戠姸鎬侊紝涓嶅厑璁镐慨鏀癸紒";
+                            objJsonResult.data = 1;
+                            return objJsonResult;
+                        }
+                        if (!DBUtility.Xt_BaseBillFun.Fun_AllowEditBill(BillOld, ref s))
+                        {
+                            objJsonResult.code = "0";
+                            objJsonResult.count = 0;
+                            objJsonResult.Message = s + "锛屼笉鍏佽淇敼";
+                            objJsonResult.data = 1;
+                            return objJsonResult;
+                        }
+                    }
+
+                    UserName = oItem.HMaker;  //鍒跺崟浜�
+                    DBUtility.ClsPub.CurUserName = UserName;
+                    oItem.HBillType = "3786";
+                    oItem.HBillSubType = "3786";
+
+                    oItem.HDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd"));//  --鏃ユ湡
+                    oItem.HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year);
+                    oItem.HPeriod = DBUtility.ClsPub.isLong(DateTime.Now.Month);
+                    oItem.HProcExchBillNo = ""; //娴佽浆鍗″彿
+                    oItem.HProcExchInterID = 0; //娴佽浆鍗′富鍐呯爜
+                    oItem.HProcExchEntryID = 0; //娴佽浆鍗″瓙鍐呯爜
+                    oItem.HProcID = 0;          //宸ュ簭ID
+                    oItem.HMainSourceBillNo =oItem.HSourceBillNo;
+                    oItem.HMainSourceBillType = oItem.HSourceBillType;
+                    oItem.HMainSourceInterID = oItem.HSourceInterID;
+                    oItem.HMainSourceEntryID = oItem.HSourceEntryID;
+
+
+                    if (DBUtility.ClsPub.isStrNull(oItem.HDate) == "")
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "淇濆瓨澶辫触锛佹病鏈夊崟鎹棩鏈燂紝鏃犳硶淇濆瓨锛�";
+                        objJsonResult.data = 1;
+                        return objJsonResult;
+                    }
+
+                    //寰幆閰嶆枡淇℃伅瀛愯〃
+                    int i = 0;
+                    foreach (Model.ClsSc_MaterToSourceBillSub oItemSub in ls)
+                    {
+
+                        i++;
+                        oItemSub.HEntryID = i;
+                        //oItemSub.HCloseMan = "";       //琛屽叧闂�
+                        oItemSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now);
+                        oItemSub.HCloseType = false;   //鍏抽棴绫诲瀷
+                                                       //oItemSub.HRemark = "";         //澶囨敞
+                        oItemSub.HSourceInterID = 0;     // 婧愬崟涓诲唴鐮�
+                        oItemSub.HSourceEntryID = 0;   //婧愬崟瀛愬唴鐮�
+                                                       //oItemSub.HSourceBillNo = "";  //婧愬崟鍗曞彿
+                                                       //oItemSub.HSourceBillType = ""; //婧愬崟绫诲瀷
+                        oItemSub.HRelationQty = 0;     //鍏宠仈鏁伴噺
+                        oItemSub.HScanDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));//  --鎵爜鏃堕棿
+                        oItemSub.HSourceBillNo = oItem.HSourceBillNo;
+                        oItemSub.HSourceBillType = oItem.HSourceBillType;
+                        oItemSub.HSourceInterID = oItem.HSourceInterID;
+                        oItemSub.HSourceEntryID = oItem.HSourceEntryID;
+                        oBill.DetailColl.Add(oItemSub);
+
+                    }
+                    oBill.omodel = oItem;
+                }
+              
+
+                //淇濆瓨
+                //淇濆瓨瀹屾瘯鍚庡鐞�
+                bool bResult;
+                if (oBill.omodel.HInterID == 0)
+                {
+                    bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
+                    if (bResult)
+                    {
+                        objJsonResult.HInterID = DBUtility.ClsPub.sExeReturnInfo; //杩斿洖涓籌D
+                        //绯荤粺鍙傛暟  鑷姩瀹℃牳
+                        string sReturn = "";
+                        if (oSystemParameter.ShowBill(ref sReturn) == true)
+                        {
+                            if (oSystemParameter.omodel.Sc_MaterToSourceBill_AutoCheck == "Y") //绯荤粺鍙傛暟  鑷姩瀹℃牳 
+                            {
+                                objJsonResult.Verify = "Y";
+                            }
+                            else
+                            {
+                                objJsonResult.Verify = "N";
+                            }
+                        }
+                    }
+                }
+                else
+                {
+                    bResult = oBill.ModifyBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo);
+                    objJsonResult.HInterID = DBUtility.ClsPub.sExeReturnInfo; //杩斿洖涓籌D
+                    objJsonResult.Verify = "N";
+                }
+                if (bResult)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 1;
+                    objJsonResult.Message = "淇濆瓨鎴愬姛锛�";
+                    //WebAPIController.Add_Log("閫佽揣鍗曚笅鎺�", UserName, "鐢熸垚閫佽揣鍗�");
+                    objJsonResult.data = 1;
+                    return objJsonResult;
+                }
+                else
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "淇濆瓨澶辫触锛�" + DBUtility.ClsPub.sExeReturnInfo;
+                    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>
+        /// 
+        /// </summary>
+        /// <param name="HInterID">鍗曟嵁ID</param>
+        /// <param name="IsAudit">瀹℃牳(0),鍙嶅鏍�(1)</param>
+        /// <param name="CurUserName">瀹℃牳浜�</param>
+        /// <returns></returns>
+        [Route("Sc_MaterToSourceBill/AuditProcessReportList")]
+        [HttpGet]
+        public object AuditProcessReportList(int HInterID, int IsAudit, string CurUserName)
+        {
+            string ModRightNameCheck = "MES_MaterToSourceBill_Check";
+            DBUtility.ClsPub.CurUserName = CurUserName;
+            try
+            {
+                //瀹℃牳鏉冮檺
+                //if (!DBUtility.ClsPub.Security_Log(ModRightNameCheck, 1, true, CurUserName))
+                //{
+                //    objJsonResult.code = "0";
+                //    objJsonResult.count = 0;
+                //    objJsonResult.Message = "瀹℃牳澶辫触锛佹棤鏉冮檺锛�";
+                //    objJsonResult.data = null;
+                //    return objJsonResult;
+                //}
+                if (HInterID <= 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "HInterID灏忎簬0锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                Int64 lngBillKey = 0;
+                lngBillKey = DBUtility.ClsPub.isLong(HInterID);
+                DAL.ClsSc_MESMaterToSourceBill oBill = new DAL.ClsSc_MESMaterToSourceBill();
+                //鏌ョ湅鏄惁宸插鏍�,鍏抽棴,浣滃簾
+                if (oBill.ShowBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo))
+                {
+                    if (oBill.omodel.HCloseMan.Trim() != "")
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "鍗曟嵁宸插叧闂�!涓嶈兘鍐嶆瀹℃牳锛�";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                    if (oBill.omodel.HDeleteMan.Trim() != "")
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "鍗曟嵁宸蹭綔搴�!涓嶈兘鍐嶆瀹℃牳锛�";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                    if (IsAudit == 0)  //瀹℃牳鍒ゆ柇
+                    {
+                        if (oBill.omodel.HChecker.Trim() != "")
+                        {
+                            objJsonResult.code = "0";
+                            objJsonResult.count = 0;
+                            objJsonResult.Message = "鍗曟嵁宸插鏍�!涓嶈兘鍐嶆瀹℃牳锛�";
+                            objJsonResult.data = null;
+                            return objJsonResult;
+                        }
+                    }
+                    if (IsAudit == 1) //鍙嶅鏍稿垽鏂�
+                    {
+                        if (oBill.omodel.HChecker.Trim() == "")
+                        {
+                            objJsonResult.code = "0";
+                            objJsonResult.count = 0;
+                            objJsonResult.Message = "鍗曟嵁鏈鏍�!涓嶉渶瑕佸弽瀹℃牳!";
+                            objJsonResult.data = null;
+                            return objJsonResult;
+                        }
+                    }
+                }
+                else
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鍗曟嵁涓嶅瓨鍦�!鍘熷洜:" + DBUtility.ClsPub.sExeReturnInfo;
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                if (IsAudit == 0) //瀹℃牳鎻愪氦
+                {
+                    //瀹℃牳鎻愪氦
+                    if (oBill.CheckBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo) == true)
+                    {
+                        objJsonResult.code = "1";
+                        objJsonResult.count = 1;
+                        objJsonResult.Message = "瀹℃牳鎴愬姛";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                    else
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "瀹℃牳澶辫触!鍘熷洜:" + DBUtility.ClsPub.sExeReturnInfo;
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                }
+                if (IsAudit == 1) //鍙嶅鏍告彁浜�
+                {
+                    //鍙嶅鏍告彁浜bandonCheck
+                    if (oBill.AbandonCheck(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo) == true)
+                    {
+                        objJsonResult.code = "1";
+                        objJsonResult.count = 1;
+                        objJsonResult.Message = "鍙嶅鏍告垚鍔�";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                    else
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "鍙嶅鏍稿け璐�!鍘熷洜:" + DBUtility.ClsPub.sExeReturnInfo;
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                }
+                return objJsonResult;
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "瀹℃牳澶辫触鎴栬�呭弽瀹℃牳澶辫触锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
     }
 }
\ No newline at end of file
diff --git a/WebAPI/Controllers/Sc_CheckToolsRepairWorkBillController.cs b/WebAPI/Controllers/Sc_CheckToolsRepairWorkBillController.cs
index dedfd6e..b231324 100644
--- a/WebAPI/Controllers/Sc_CheckToolsRepairWorkBillController.cs
+++ b/WebAPI/Controllers/Sc_CheckToolsRepairWorkBillController.cs
@@ -2733,17 +2733,6 @@
         [HttpGet]
         public object DeltetSc_MouldMaintainBill(string HInterID)
         {
-            //缂栬緫鏉冮檺
-            //if (!DBUtility.ClsPub.Security_Log("Sb_MouldRepairWorkBill_Delete", 1, true, DBUtility.ClsPub.CurUserName))
-            //{
-            //    objJsonResult.code = "0";
-            //    objJsonResult.count = 0;
-            //    objJsonResult.Message = "鏃犲垹闄ゆ潈闄愶紒";
-            //    objJsonResult.data = null;
-            //    return objJsonResult;
-            //}
-
-
             Int64 lngBillKey = 0;
             lngBillKey = DBUtility.ClsPub.isLong(HInterID);
             if (lngBillKey == 0)
diff --git "a/WebAPI/Controllers/\345\223\201\350\264\250\347\256\241\347\220\206/\345\267\245\345\272\217\346\243\200\351\252\214\345\215\225/QC_ProcessCheckBillController.cs" "b/WebAPI/Controllers/\345\223\201\350\264\250\347\256\241\347\220\206/\345\267\245\345\272\217\346\243\200\351\252\214\345\215\225/QC_ProcessCheckBillController.cs"
index b2cbab1..a5fac61 100644
--- "a/WebAPI/Controllers/\345\223\201\350\264\250\347\256\241\347\220\206/\345\267\245\345\272\217\346\243\200\351\252\214\345\215\225/QC_ProcessCheckBillController.cs"
+++ "b/WebAPI/Controllers/\345\223\201\350\264\250\347\256\241\347\220\206/\345\267\245\345\272\217\346\243\200\351\252\214\345\215\225/QC_ProcessCheckBillController.cs"
@@ -414,13 +414,13 @@
             {
                 if (sWhere == null || sWhere.Equals(""))
                 {
-                    ds = oCN.RunProcReturn("select * from h_v_QC_ProcessCheckBillList " + sWhere, "h_v_QC_ProcessCheckBillList");
+                    ds = oCN.RunProcReturn("select * from h_v_QC_ProcessCheckBillListDetail " + sWhere, "h_v_QC_ProcessCheckBillListDetail");
                 }
                 else
                 {
-                    string sql1 = "select * from h_v_QC_ProcessCheckBillList where 1 = 1 ";
+                    string sql1 = "select * from h_v_QC_ProcessCheckBillListDetail where 1 = 1 ";
                     string sql = sql1 + sWhere;
-                    ds = oCN.RunProcReturn(sql, "h_v_QC_ProcessCheckBillList");
+                    ds = oCN.RunProcReturn(sql, "h_v_QC_ProcessCheckBillListDetail");
                 }
                 if (ds == null || ds.Tables[0].Rows.Count == 0)
                 {
diff --git "a/WebAPI/Controllers/\347\224\237\344\272\247\347\256\241\347\220\206/\350\264\250\351\207\217\346\261\207\346\212\245\345\215\225/Sc_QualityReportBillController.cs" "b/WebAPI/Controllers/\347\224\237\344\272\247\347\256\241\347\220\206/\350\264\250\351\207\217\346\261\207\346\212\245\345\215\225/Sc_QualityReportBillController.cs"
index 7748ef2..933decb 100644
--- "a/WebAPI/Controllers/\347\224\237\344\272\247\347\256\241\347\220\206/\350\264\250\351\207\217\346\261\207\346\212\245\345\215\225/Sc_QualityReportBillController.cs"
+++ "b/WebAPI/Controllers/\347\224\237\344\272\247\347\256\241\347\220\206/\350\264\250\351\207\217\346\261\207\346\212\245\345\215\225/Sc_QualityReportBillController.cs"
@@ -252,6 +252,95 @@
         }
         #endregion
 
+        #region 璐ㄩ噺姹囨姤鍗曞垪琛ㄥ垹闄ゆ寜閽�
+        [Route("DeltetSc_QualityReportBill")]
+        [HttpGet]
+        public object DeltetSc_QualityReportBill(long HItemID)
+        {
+            DataSet ds;
+            DataSet ds1;
+            try
+            {
+                //鍒犻櫎鏉冮檺
+                //if (!DBUtility.ClsPub.Security_Log(ModRightNameCheck, 1, true, CurUserName))
+                //{
+                //    objJsonResult.code = "0";
+                //    objJsonResult.count = 0;
+                //    objJsonResult.Message = "瀹℃牳澶辫触锛佹棤鏉冮檺锛�";
+                //    objJsonResult.data = null;
+                //    return objJsonResult;
+                //}
+
+                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+                if (HItemID == 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "HItemID涓虹┖锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                oCN.BeginTran();//寮�濮嬩簨鍔�
+                ds = oCN.RunProcReturn("select * from Sc_QualityReportBillMain where hmainid=" + HItemID, "Sc_QualityReportBillMain");
+                ds1 = oCN.RunProcReturn("select * from Sc_QualityReportBillSub where hmainid=" + HItemID, "Sc_QualityReportBillSub");
+                if (ds == null || ds.Tables[0].Rows.Count == 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "娌℃湁鏁版嵁锛屾棤娉曞垹闄わ紒";
+                    objJsonResult.data = null;
+                    return objJsonResult; ;
+                }
+                //var HStopflag = Convert.ToBoolean(ds.Tables[0].Rows[0]["HStopflag"]);
+                //if (HStopflag)
+                //{
+                //    oCN.RollBack();//鍥炴粴浜嬪姟
+                //    objJsonResult.code = "0";
+                //    objJsonResult.count = 0;
+                //    objJsonResult.Message = "鏁版嵁宸插垹闄ゆ棤娉曞啀娆″垹闄わ紒";
+                //    objJsonResult.data = null;
+                //    return objJsonResult;
+                //}
+                //ds1 = oCN.RunProcReturn("Select HItemID from Sc_QualityReportBill  Where HParentID='" + HItemID + "'", "Sc_QualityReportBill");
+                //if (ds1.Tables[0].Rows.Count != 0)
+                //{
+                //    objJsonResult.code = "0";
+                //    objJsonResult.count = 0;
+                //    objJsonResult.Message = "姝ら」鐩瓨鍦ㄥ瓙椤圭洰锛屼笉鑳藉垹闄わ紒";
+                //    objJsonResult.data = null;
+                //    return objJsonResult;
+                //}
+                string HUseFlag = Convert.ToString(ds.Tables[0].Rows[0]["HUseFlag"]);
+                if (HUseFlag == "宸蹭娇鐢�")
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "姝ら」鐩凡浣跨敤锛屼笉鑳藉垹闄わ紒";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
+                oCN.RunProc("delete from Sc_QualityReportBillMain where hmainid=" + HItemID);
+                oCN.RunProc("delete from Sc_QualityReportBillSub where hmainid=" + HItemID);
+                oCN.Commit();//鎻愪氦浜嬪姟
+                objJsonResult.code = "0";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "* 鏁版嵁鍒犻櫎鎴愬姛锛�";
+                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 璐ㄩ噺姹囨姤鍗曟壂涓嶈壇鏉$爜鑾峰彇涓嶈壇鍘熷洜id
         [Route("Sc_QualityReportBill/get_HBadReasonID")]
         [HttpGet]
diff --git a/WebAPI/DLL/ClsSc_ICMOBillWorkQtyStatus_Tmp.cs b/WebAPI/DLL/ClsSc_ICMOBillWorkQtyStatus_Tmp.cs
index 4d545ba..f368353 100644
--- a/WebAPI/DLL/ClsSc_ICMOBillWorkQtyStatus_Tmp.cs
+++ b/WebAPI/DLL/ClsSc_ICMOBillWorkQtyStatus_Tmp.cs
@@ -98,6 +98,9 @@
                 "," + omodel.HSourceInterID.ToString() + "," + omodel.HSourceEntryID.ToString() + ",'" + omodel.HSourceBillNo + "','" + omodel.HSplitNO + "','" + omodel.HSourceBillType + "'" +
                 "," + omodel.HRelationInterID.ToString() + "," + omodel.HRelationEntryID.ToString() + ",'" + omodel.HRelationBillNo + "'," + omodel.HReportEntryID.ToString() + 
                 ") ");
+                double sumqty = omodel.HQty + omodel.HBadQty + omodel.HWasterQty;  //汇报数量+不良+报废
+                //回写生产状态临时表Sc_ICMOBillStatus_Tmp拆分汇报数量 HSplitRelationQty
+                oCn.RunProc("update Sc_ICMOBillStatus_Tmp set HSplitRelationQty=HSplitRelationQty+"+ sumqty + "  where HICMOBillNo='"+omodel.HICMOBillNo+"'  and HSourceID='"+omodel.HSourceID+"' and  HICMOInterID='"+omodel.HICMOInterID+"' and HICMOEntryID='"+omodel.HICMOEntryID+"'");
 
                 //再次验证 保存是否 合理
                 DataSet ds = oCn.RunProcReturn("exec h_p_JIT_ICMOBillWorkQtyStatus_SaveCtrl @HInterId=" + omodel.HInterID + "", "h_p_JIT_ICMOBillWorkQtyStatus_SaveCtrl");
diff --git a/WebAPI/ListModels.cs b/WebAPI/ListModels.cs
index 1c5c267..fc7951a 100644
--- a/WebAPI/ListModels.cs
+++ b/WebAPI/ListModels.cs
@@ -852,7 +852,7 @@
         }
 
         /// <summary>
-        /// 璁惧淇濆吇璁″垝 瀛愯〃
+        /// 璁惧淇濆吇璁″垝 閰嶄欢瀛愯〃
         /// </summary>
         /// <param name="jsonString"></param>
         /// <returns></returns>
@@ -860,6 +860,17 @@
         {
             jsonString = "[" + jsonString.ToString() + "]";
             List<Model.ClsSb_EquipMaintainPlanBillSub> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsSb_EquipMaintainPlanBillSub>>(jsonString);
+            return list;
+        }
+        /// <summary>
+        /// 璁惧淇濆吇璁″垝 淇濆吇瀛愯〃
+        /// </summary>
+        /// <param name="jsonString"></param>
+        /// <returns></returns>
+        public List<Model.ClsSc_EquipMaintainPlanBillSub_Item> getObjectByJson_Sc_EquipMaintainPlanBillSub_Item(string jsonString)
+        {
+            jsonString = "[" + jsonString.ToString() + "]";
+            List<Model.ClsSc_EquipMaintainPlanBillSub_Item> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsSc_EquipMaintainPlanBillSub_Item>>(jsonString);
             return list;
         }
 
@@ -1255,5 +1266,29 @@
             return list;
         }
 
+        /// <summary>
+        /// 鎶ュ伐骞冲彴鏂板涓婃枡闃查敊鍗曚富琛ㄧ殑json
+        /// </summary>
+        /// <param name="jsonString"></param>
+        /// <returns></returns>
+        public List<Model.ClsSc_MaterToSourceBillMain> getObjectByJson_Sc_MaterToSourceBillMain(string jsonString)
+        {
+            jsonString = "[" + jsonString.ToString() + "]";
+            List<Model.ClsSc_MaterToSourceBillMain> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsSc_MaterToSourceBillMain>>(jsonString);
+            return list;
+        }
+
+
+        /// <summary>
+        /// 鎶ュ伐骞冲彴鏂板涓婃枡闃查敊鍗曞瓙琛�(閰嶆枡)鐨刯son
+        /// </summary>
+        /// <param name="jsonString"></param>
+        /// <returns></returns>
+        public List<Model.ClsSc_MaterToSourceBillSub> getObjectByJson_Sc_MaterToSourceBillSub(string jsonString)
+        {
+            jsonString = "[" + jsonString.ToString() + "]";
+            List<Model.ClsSc_MaterToSourceBillSub> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsSc_MaterToSourceBillSub>>(jsonString);
+            return list;
+        }
     }
 } 
\ No newline at end of file
diff --git a/WebAPI/Models/Gy_Group.cs b/WebAPI/Models/Gy_Group.cs
index 7f3f1ea..aa605d9 100644
--- a/WebAPI/Models/Gy_Group.cs
+++ b/WebAPI/Models/Gy_Group.cs
@@ -12,8 +12,8 @@
         public string HName { get; set; }         //  
         public string HHelpCode { get; set; }      //鍔╄鐮�
         public string HShortNumber { get; set; }   //鐭唬鐮�
-        public string HEndFlag { get; set; }      //鏈骇鏍囧織
-        public string HStopflag { get; set; }     //绂佺敤鏍囧織
+        public bool HEndFlag { get; set; }      //鏈骇鏍囧織
+        public bool HStopflag { get; set; }     //绂佺敤鏍囧織
         public string HRemark { get; set; }       //澶囨敞
         public string HUseFlag { get; set; }      //浣跨敤鏍囧織
         public long HParentID { get; set; }      //鐖剁骇ID
diff --git a/WebAPI/Models/Gy_WorkCenter.cs b/WebAPI/Models/Gy_WorkCenter.cs
index 37731a1..3bb88bb 100644
--- a/WebAPI/Models/Gy_WorkCenter.cs
+++ b/WebAPI/Models/Gy_WorkCenter.cs
@@ -12,15 +12,17 @@
         public string HName { get; set; }         //  
         public string HHelpCode { get; set; }      //鍔╄鐮�
         public string HShortNumber { get; set; }   //鐭唬鐮�
-        public string HEndFlag { get; set; }      //鏈骇鏍囧織
-        public string HStopflag { get; set; }     //绂佺敤鏍囧織
+        public bool HEndFlag { get; set; }      //鏈骇鏍囧織
+        public bool HStopflag { get; set; }     //绂佺敤鏍囧織
         public string HRemark { get; set; }       //澶囨敞
         public string HUseFlag { get; set; }      //浣跨敤鏍囧織
         public long HParentID { get; set; }      //鐖剁骇ID
+        public string HDeptNumber { get; set; }
         public long HDeptID { get; set; }
         public long HWorkTimes { get; set; }
         public long HQty { get; set; }
         public long HProcID { get; set; }
+        public long HLevel { get; set; }
         public long HDayMoney { get; set; }
 
         public string HBarCodeForBase { get; set; }
diff --git a/WebAPI/Models/Xt_ORGANIZATIONS.cs b/WebAPI/Models/Xt_ORGANIZATIONS.cs
new file mode 100644
index 0000000..08b3da7
--- /dev/null
+++ b/WebAPI/Models/Xt_ORGANIZATIONS.cs
@@ -0,0 +1,23 @@
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+
+namespace WebAPI.Models
+{
+    public class Xt_ORGANIZATIONS
+    {
+        public long HItemID { get; set; }
+        public string HNumber { get; set; }       // 代码
+        public string HName { get; set; }         //  
+        public DateTime HMakeTime { get; set; }      //开始日期
+
+     
+        public bool HStopflag { get; set; }     //禁用标志
+        public string HRemark { get; set; }       //备注
+       
+        public long HParentID { get; set; }      //父级ID
+   
+    }
+}
\ No newline at end of file
diff --git "a/WebAPI/Models/\345\237\272\347\241\200\350\265\204\346\226\231/Gy_Employee.cs" "b/WebAPI/Models/\345\237\272\347\241\200\350\265\204\346\226\231/Gy_Employee.cs"
new file mode 100644
index 0000000..ffa45fb
--- /dev/null
+++ "b/WebAPI/Models/\345\237\272\347\241\200\350\265\204\346\226\231/Gy_Employee.cs"
@@ -0,0 +1,108 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+
+namespace WebAPI.Models
+{
+    public class Gy_Employee
+    {
+        public long HItemID { get; set; }
+        public string HNumber { get; set; }       // 浠g爜
+        public string HName { get; set; }         //  
+        public string HShortNumber { get; set; }   //鐭唬鐮�
+        public string HHelpCode { get; set; }      //鍔╄鐮�
+        public long HParentID { get; set; }      //鐖剁骇ID
+        public string HLevel { get; set; }
+        public bool HEndFlag { get; set; }      //鏈骇鏍囧織
+        public bool HStopflag { get; set; }     //绂佺敤鏍囧織
+        public string HRemark { get; set; }       //澶囨敞
+        public string HUseFlag { get; set; }      //浣跨敤鏍囧織
+        public string HSex { get; set; }
+        public string HIDCard { get; set; }
+        public string HBirthDay { get; set; }
+        public string HAddress { get; set; }
+        public string HLinkPhone { get; set; }
+        public string HMobilePhone { get; set; }
+       
+        public string HFax { get; set; }
+        public string HPostalCode { get; set; }
+        public string HEmail { get; set; }
+        public string HBank { get; set; }
+        public string HBankAccount { get; set; }
+        public long HGroupID { get; set; }
+        public long HDeptID { get; set; }
+        public long HPostID { get; set; }
+        public long HWorkTypeID { get; set; }
+       
+        public long HCTPrjID { get; set; }
+        public long HProcID { get; set; }
+        public string HBasePay { get; set; }
+
+        public DateTime HInComDate { get; set; }
+        public DateTime HDimissionDate { get; set; }
+        public bool HOverType { get; set; }
+        public string HEmpType { get; set; }
+        public string HOtherDeduct3 { get; set; }
+        public string HDrydock { get; set; }
+        public string HInsurance { get; set; }
+        public string HMedicare { get; set; }
+        public bool HNoBrushFlag { get; set; }
+        public bool HShiftFlag { get; set; }
+        public DateTime HContactDate { get; set; }
+        public bool HStopwagesFlag { get; set; }
+        public string HDimissionReason { get; set; }
+        public long HDormID { get; set; }
+        public string HArchivesNo { get; set; }
+        public DateTime HStayCardEDate { get; set; }
+        public DateTime HCheckCardEDate { get; set; }
+        public string HJobCardNo { get; set; }
+        public DateTime HJobCardEDate { get; set; }
+        public string HWorkType { get; set; }
+        public long HContractYear { get; set; }
+        public DateTime HContractBDate { get; set; }
+        public DateTime HContractEDate { get; set; }
+        public string HInsuranceNo { get; set; }
+        public DateTime HInsuranceDate { get; set; }
+        public string HInsuranceStatus { get; set; }
+        public DateTime HSignDate { get; set; }
+        public bool HSignStatus { get; set; }
+        public string HOldCompany { get; set; }
+        public string HMarr { get; set; }
+        public string HHomeAdd { get; set; }
+        public string HNowAdd { get; set; }
+        public string HSpec { get; set; }
+        public string HCompLev { get; set; }
+        public string HEngLev { get; set; }
+        public DateTime HGradDate { get; set; }
+        public string HGradSchool { get; set; }
+        public string HSalaryLev { get; set; }
+        public long HDutyID { get; set; }
+        public string HProTitleID { get; set; }
+        public string HKnowLev { get; set; }
+        public string HAvoird { get; set; }
+        public string HStature { get; set; }
+        public string HBloodType { get; set; }
+        public string HBlightyType { get; set; }
+        public string HGovStatus { get; set; }
+        public string HNation { get; set; }
+        public string HBlighty { get; set; }
+        public long HAge { get; set; }
+        public string HExamLevPostMoney { get; set; }
+        public string HBSTDeptID { get; set; }
+        public string HRelDate { get; set; }
+        public string HHighestPay { get; set; }
+        public string HOverPayRate { get; set; }
+        public string HLeftMoneyRate { get; set; }
+        public string HInsuranceSubsidy { get; set; }
+        public string HPayType { get; set; }
+        public string HStdDayTimes { get; set; }
+        public string HStdDayPay { get; set; }
+        public string HMinDayPay { get; set; }
+        public string HMinMonthPay { get; set; }
+        public DateTime HMadeDate { get; set; }
+        public string HEmpRate { get; set; }
+        public string HExamRate { get; set; }
+        public DateTime HHealthCardEDate { get; set; }
+    }
+}
\ No newline at end of file
diff --git a/WebAPI/Properties/PublishProfiles/FolderProfile.pubxml.user b/WebAPI/Properties/PublishProfiles/FolderProfile.pubxml.user
index b100275..018075b 100644
--- a/WebAPI/Properties/PublishProfiles/FolderProfile.pubxml.user
+++ b/WebAPI/Properties/PublishProfiles/FolderProfile.pubxml.user
@@ -5,11 +5,11 @@
 <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   <PropertyGroup>
     <_PublishTargetUrl>D:\缃戠珯鍙戝竷\鏅轰簯MESWMS\API</_PublishTargetUrl>
-    <History>True|2021-09-03T08:27:51.1888520Z;True|2021-09-03T16:19:35.9003465+08:00;True|2021-09-03T15:46:28.1828032+08:00;True|2021-09-03T15:34:21.9362871+08:00;True|2021-09-03T11:24:49.8749819+08:00;True|2021-09-03T11:21:17.8373159+08:00;True|2021-09-03T11:16:53.2208136+08:00;True|2021-09-03T11:12:23.9063804+08:00;True|2021-09-03T09:11:09.2435721+08:00;True|2021-09-02T11:16:15.1370453+08:00;True|2021-09-02T10:35:39.1171879+08:00;True|2021-09-01T10:17:09.4536285+08:00;True|2021-09-01T09:46:28.4581776+08:00;True|2021-08-31T08:54:26.8588887+08:00;True|2021-08-31T08:39:08.3685693+08:00;True|2021-08-30T17:11:56.8438985+08:00;True|2021-08-30T15:59:42.0820292+08:00;True|2021-08-30T15:45:18.1868510+08:00;True|2021-08-30T14:56:08.3958863+08:00;True|2021-08-30T14:37:11.5379830+08:00;True|2021-08-30T14:35:34.8775934+08:00;True|2021-08-30T14:24:36.5111821+08:00;True|2021-08-30T10:05:49.6945200+08:00;True|2021-08-30T10:03:28.4064538+08:00;True|2021-08-30T10:00:16.8360929+08:00;True|2021-08-30T09:56:09.4434379+08:00;True|2021-08-30T09:55:36.1725334+08:00;True|2021-08-30T09:52:04.8600054+08:00;True|2021-08-30T09:47:46.4225655+08:00;True|2021-08-30T09:45:20.4894962+08:00;False|2021-08-27T17:17:34.2646751+08:00;False|2021-08-27T16:01:21.2791979+08:00;False|2021-08-27T15:58:06.9667160+08:00;False|2021-08-27T15:38:37.4818036+08:00;False|2021-08-27T15:21:02.8863114+08:00;False|2021-08-27T15:20:28.6828668+08:00;True|2021-08-26T16:00:44.3162145+08:00;True|2021-08-26T08:57:31.3842587+08:00;True|2021-08-23T08:43:41.1549775+08:00;True|2021-08-22T09:24:12.7210871+08:00;True|2021-08-22T09:19:53.8300229+08:00;True|2021-08-20T20:00:52.0140407+08:00;True|2021-08-20T19:40:14.7712765+08:00;True|2021-08-19T17:37:54.9748049+08:00;True|2021-08-19T17:20:11.0515687+08:00;True|2021-08-19T16:12:35.4392809+08:00;True|2021-08-19T16:06:50.6204587+08:00;True|2021-08-19T16:03:53.0824286+08:00;True|2021-08-19T15:56:01.3498791+08:00;True|2021-08-19T10:18:50.8113630+08:00;True|2021-08-19T09:58:06.2784035+08:00;True|2021-08-19T09:56:54.0619777+08:00;True|2021-08-19T00:32:08.3503093+08:00;True|2021-08-19T00:11:18.3150227+08:00;True|2021-08-19T00:02:49.4827718+08:00;True|2021-08-18T23:54:45.4845900+08:00;True|2021-08-18T23:39:51.6147977+08:00;True|2021-08-18T23:16:42.7214379+08:00;True|2021-08-18T22:38:57.4681929+08:00;True|2021-08-18T21:41:58.7560707+08:00;True|2021-08-18T21:11:52.2369249+08:00;True|2021-08-18T21:01:49.5669106+08:00;True|2021-08-18T20:47:46.5352688+08:00;False|2021-08-18T20:46:36.7956141+08:00;False|2021-08-18T20:46:01.0502138+08:00;True|2021-08-18T19:39:12.8186242+08:00;False|2021-08-18T19:38:12.6839708+08:00;True|2021-08-18T19:15:51.4626694+08:00;True|2021-08-18T16:07:20.4350886+08:00;True|2021-08-18T14:29:41.7171934+08:00;True|2021-08-18T14:20:36.3647361+08:00;True|2021-08-16T09:08:58.3617662+08:00;True|2021-08-15T20:44:29.9214083+08:00;True|2021-08-15T20:36:17.0958549+08:00;True|2021-08-15T20:29:34.3879773+08:00;True|2021-08-15T20:23:47.4052038+08:00;True|2021-08-15T15:01:19.7830862+08:00;True|2021-08-15T12:15:18.3433782+08:00;True|2021-08-13T20:59:11.3947130+08:00;True|2021-08-06T22:49:09.9538339+08:00;True|2021-08-06T22:35:19.0418168+08:00;True|2021-08-06T20:29:47.4241975+08:00;True|2021-08-06T14:08:16.4791827+08:00;True|2021-08-06T13:59:28.9874611+08:00;True|2021-08-06T13:57:34.3723977+08:00;True|2021-08-06T13:36:03.4816652+08:00;True|2021-08-06T12:22:52.5055221+08:00;True|2021-08-06T09:31:58.1272499+08:00;True|2021-08-06T09:26:51.6310039+08:00;True|2021-08-06T09:24:22.2899244+08:00;True|2021-08-06T09:06:30.6477912+08:00;True|2021-08-06T09:00:55.5101612+08:00;True|2021-08-06T08:49:59.9616490+08:00;True|2021-08-06T08:45:18.8586902+08:00;True|2021-08-05T20:09:25.8861998+08:00;True|2021-08-04T19:14:27.2396953+08:00;True|2021-08-04T19:11:47.5849093+08:00;True|2021-08-04T16:42:54.0149043+08:00;True|2021-08-04T15:02:11.5056561+08:00;True|2021-08-04T14:58:37.1435509+08:00;True|2021-08-04T14:55:34.7380132+08:00;True|2021-08-04T14:47:42.5933921+08:00;True|2021-08-04T14:45:17.9911874+08:00;True|2021-08-04T13:52:20.9601351+08:00;True|2021-08-04T09:48:28.8796992+08:00;True|2021-08-03T18:14:13.1894998+08:00;True|2021-08-03T17:45:35.1349721+08:00;True|2021-08-03T17:21:52.6028977+08:00;True|2021-08-03T17:20:35.4423020+08:00;True|2021-08-03T17:03:33.1667669+08:00;True|2021-08-03T17:01:54.2656787+08:00;True|2021-08-03T17:00:22.2778374+08:00;True|2021-08-03T16:56:58.8902582+08:00;True|2021-08-03T15:02:21.8601533+08:00;True|2021-08-03T14:57:34.0186758+08:00;True|2021-08-03T14:28:47.2242515+08:00;True|2021-08-03T14:22:22.4554236+08:00;True|2021-08-03T14:21:51.1339715+08:00;True|2021-08-03T13:37:33.9697131+08:00;True|2021-08-03T13:28:29.7591095+08:00;True|2021-08-03T11:35:09.5118324+08:00;True|2021-08-03T11:11:23.3051573+08:00;True|2021-08-02T13:14:42.3663755+08:00;True|2021-07-30T22:50:19.9749878+08:00;True|2021-07-30T22:49:31.2150970+08:00;True|2021-07-28T19:12:05.8381075+08:00;True|2021-07-28T18:59:45.4808797+08:00;True|2021-07-28T18:15:58.8301509+08:00;True|2021-07-28T18:04:54.8613546+08:00;True|2021-07-28T17:53:48.6225611+08:00;True|2021-07-28T17:42:50.9171563+08:00;True|2021-07-28T17:17:16.3137677+08:00;True|2021-07-28T17:11:46.8925200+08:00;True|2021-07-28T16:28:27.6823943+08:00;True|2021-07-28T16:23:00.3385836+08:00;True|2021-07-28T09:57:55.4237411+08:00;True|2021-07-28T08:38:29.6691541+08:00;True|2021-07-27T23:16:32.0331671+08:00;True|2021-07-27T23:06:08.1947249+08:00;True|2021-07-27T23:05:58.4619176+08:00;True|2021-07-27T18:42:09.5358261+08:00;True|2021-07-27T18:30:04.8532823+08:00;True|2021-07-27T18:29:43.5775092+08:00;True|2021-07-27T15:16:49.8356224+08:00;True|2021-07-27T15:05:27.8453220+08:00;True|2021-07-27T14:59:15.9519440+08:00;True|2021-07-27T09:23:32.6111337+08:00;True|2021-07-27T08:27:41.6395353+08:00;True|2021-07-27T08:25:56.7378296+08:00;True|2021-07-26T11:18:46.0856966+08:00;True|2021-07-26T11:18:02.0751924+08:00;True|2021-07-26T11:13:49.6285395+08:00;True|2021-07-21T21:08:25.9898902+08:00;True|2021-07-21T20:09:26.2258104+08:00;True|2021-07-13T16:17:25.8407435+08:00;True|2021-07-13T13:46:13.4309531+08:00;True|2021-07-13T12:29:04.5082461+08:00;True|2021-06-29T13:55:01.6864637+08:00;True|2021-06-29T10:38:52.2206472+08:00;True|2021-06-29T10:10:13.1540749+08:00;True|2021-06-28T14:37:56.3853273+08:00;False|2021-06-28T14:36:57.5726124+08:00;True|2021-06-25T14:17:57.5196108+08:00;True|2021-06-25T13:56:38.9522535+08:00;True|2021-06-24T19:38:32.8766933+08:00;True|2021-06-24T18:26:35.6118833+08:00;True|2021-06-24T18:02:52.8136877+08:00;True|2021-06-24T17:48:49.5851948+08:00;True|2021-06-24T17:45:46.7527572+08:00;True|2021-06-24T15:05:20.1592723+08:00;True|2021-06-23T16:18:15.6814625+08:00;True|2021-06-23T16:05:24.6112343+08:00;True|2021-06-23T15:14:08.2489658+08:00;True|2021-06-23T13:52:58.6029788+08:00;True|2021-06-22T16:11:20.4726923+08:00;True|2021-06-22T16:04:53.7231389+08:00;True|2021-06-22T15:50:59.2583262+08:00;True|2021-06-22T15:38:15.3016140+08:00;True|2021-06-22T15:34:42.9185543+08:00;True|2021-06-22T15:21:55.1419108+08:00;True|2021-06-22T15:07:21.5357494+08:00;True|2021-06-22T15:03:35.0535733+08:00;True|2021-06-22T14:54:47.8802969+08:00;True|2021-06-22T11:19:38.7303011+08:00;True|2021-06-22T08:53:49.2882695+08:00;True|2021-06-22T08:47:54.8286530+08:00;True|2021-06-21T16:27:19.3017700+08:00;True|2021-06-21T15:32:28.7237952+08:00;True|2021-06-21T12:34:02.6329555+08:00;True|2021-06-21T12:24:17.5427495+08:00;True|2021-06-21T10:47:30.6423502+08:00;True|2021-06-21T08:43:20.3026558+08:00;True|2021-06-19T15:10:06.8335499+08:00;True|2021-06-18T15:37:29.5009930+08:00;True|2021-06-18T13:46:35.6283432+08:00;True|2021-06-18T10:00:37.1474954+08:00;True|2021-06-18T09:55:21.8551780+08:00;True|2021-06-18T09:22:27.8432927+08:00;True|2021-06-17T11:17:43.2166430+08:00;True|2021-06-17T09:24:09.8350403+08:00;True|2021-06-16T16:10:47.8564888+08:00;True|2021-06-16T16:04:09.8286582+08:00;True|2021-06-16T15:12:29.9427169+08:00;True|2021-06-16T14:58:45.6801892+08:00;True|2021-06-16T14:46:01.6873221+08:00;True|2021-06-16T11:02:06.1272477+08:00;True|2021-06-16T09:33:56.0223915+08:00;True|2021-06-16T08:50:07.6995413+08:00;True|2021-06-16T08:28:38.7692635+08:00;True|2021-06-16T01:04:19.6282474+08:00;True|2021-06-16T01:03:50.5058323+08:00;False|2021-06-16T01:02:15.3819672+08:00;False|2021-06-16T01:01:38.6171098+08:00;True|2021-06-16T00:34:54.9902044+08:00;True|2021-06-15T23:55:36.2003828+08:00;True|2021-06-15T22:47:17.2192750+08:00;True|2021-06-15T22:42:41.1512585+08:00;True|2021-06-15T22:38:01.7390462+08:00;True|2021-06-15T22:14:11.2060782+08:00;True|2021-06-15T22:12:27.0615357+08:00;True|2021-06-15T22:07:59.9280871+08:00;True|2021-06-15T22:04:21.5051427+08:00;True|2021-06-15T21:25:55.0099814+08:00;True|2021-06-15T19:13:51.3494172+08:00;True|2021-06-15T19:02:17.6844742+08:00;True|2021-06-15T18:47:37.1629411+08:00;False|2021-06-15T18:47:11.0828111+08:00;True|2021-06-15T18:38:26.6620668+08:00;True|2021-06-15T18:33:45.2069831+08:00;True|2021-06-15T18:24:52.0550838+08:00;True|2021-06-15T18:19:43.6999796+08:00;True|2021-06-15T18:08:17.2464506+08:00;True|2021-06-15T18:03:51.3952624+08:00;True|2021-06-15T18:01:20.6141766+08:00;True|2021-06-15T17:59:04.4479416+08:00;True|2021-06-15T17:41:44.6389379+08:00;True|2021-06-15T17:39:03.1565124+08:00;True|2021-06-15T17:34:41.0634638+08:00;True|2021-06-15T17:33:50.4853178+08:00;True|2021-06-15T17:25:38.5914037+08:00;True|2021-06-15T17:22:21.3611360+08:00;True|2021-06-15T17:16:49.4970813+08:00;True|2021-06-15T17:05:28.9389484+08:00;True|2021-06-15T16:52:54.6372199+08:00;True|2021-06-15T16:51:23.9081030+08:00;True|2021-06-15T16:45:40.6017997+08:00;True|2021-06-15T16:41:05.0218887+08:00;True|2021-06-15T16:38:02.8541862+08:00;True|2021-06-15T16:22:10.3118721+08:00;True|2021-06-15T16:12:11.1552506+08:00;True|2021-06-15T15:33:42.0100494+08:00;True|2021-06-15T15:28:39.7145659+08:00;True|2021-06-15T15:15:02.7939125+08:00;True|2021-06-15T14:49:14.2300396+08:00;True|2021-06-15T14:42:28.1198064+08:00;True|2021-06-15T13:30:12.7997686+08:00;True|2021-06-15T13:25:37.7284670+08:00;True|2021-06-15T13:23:43.6207813+08:00;False|2021-06-15T13:23:19.4190232+08:00;True|2021-06-15T13:16:38.5062674+08:00;True|2021-06-15T13:03:31.2055635+08:00;True|2021-06-15T12:58:43.1653215+08:00;True|2021-06-15T12:39:22.8442109+08:00;True|2021-06-15T12:35:09.1288556+08:00;False|2021-06-15T12:33:50.0723143+08:00;True|2021-06-15T11:28:01.9733727+08:00;True|2021-06-15T11:26:26.6569392+08:00;True|2021-06-15T11:22:43.0366435+08:00;True|2021-06-15T11:07:50.1610580+08:00;True|2021-06-15T10:32:59.1925931+08:00;True|2021-06-10T17:16:57.9552310+08:00;True|2021-06-10T16:44:42.2731836+08:00;True|2021-06-10T14:39:27.6745737+08:00;True|2021-06-10T12:15:05.1524413+08:00;True|2021-06-09T18:19:24.1005606+08:00;True|2021-06-09T17:56:09.5646288+08:00;True|2021-06-09T13:34:06.1882292+08:00;True|2021-06-09T13:29:54.5924933+08:00;True|2021-06-09T13:25:55.7520662+08:00;True|2021-06-09T13:07:47.6686811+08:00;True|2021-06-09T12:59:41.2595048+08:00;True|2021-06-09T12:45:27.1305548+08:00;True|2021-06-09T12:29:52.1418191+08:00;True|2021-06-09T12:24:12.7610588+08:00;True|2021-06-09T11:31:25.3409568+08:00;True|2021-06-09T09:57:44.4387175+08:00;True|2021-06-09T09:54:26.5161307+08:00;True|2021-06-09T09:14:14.7288045+08:00;True|2021-06-09T09:10:25.1812139+08:00;True|2021-06-09T08:46:21.6585123+08:00;True|2021-06-08T19:56:55.7192062+08:00;True|2021-06-08T19:52:59.0326821+08:00;True|2021-06-08T19:49:13.6274217+08:00;True|2021-06-08T19:09:22.1038939+08:00;True|2021-06-08T15:28:41.3716247+08:00;True|2021-06-08T15:26:47.2621178+08:00;True|2021-06-08T13:49:45.8936617+08:00;True|2021-06-08T13:43:18.8115502+08:00;True|2021-06-08T10:04:06.2200731+08:00;True|2021-06-08T09:17:10.0470792+08:00;True|2021-06-08T08:44:37.4395849+08:00;True|2021-06-08T00:01:09.3745613+08:00;True|2021-06-07T23:49:31.5196888+08:00;True|2021-06-07T23:41:00.8017855+08:00;True|2021-06-07T23:21:53.1371134+08:00;True|2021-06-07T23:01:27.5712153+08:00;True|2021-06-07T22:36:12.9274014+08:00;True|2021-06-07T22:23:00.6545134+08:00;True|2021-06-07T17:44:47.5686346+08:00;True|2021-06-07T17:17:01.3431233+08:00;True|2021-06-07T16:53:28.9989587+08:00;True|2021-06-07T16:41:10.4975607+08:00;True|2021-06-07T14:21:06.8176477+08:00;True|2021-06-07T14:10:39.0355659+08:00;True|2021-06-07T12:34:31.4562732+08:00;True|2021-06-07T12:28:44.9629488+08:00;True|2021-06-07T10:30:26.9387988+08:00;True|2021-06-07T09:12:14.7658099+08:00;True|2021-06-07T08:37:19.6353792+08:00;True|2021-06-07T08:35:25.2031954+08:00;True|2021-06-05T07:07:32.0541266+08:00;True|2021-06-05T06:44:35.9475270+08:00;True|2021-06-05T06:37:27.4595197+08:00;True|2021-06-05T06:26:59.7663998+08:00;True|2021-06-05T05:43:12.8699318+08:00;True|2021-06-04T17:00:41.2426007+08:00;True|2021-06-04T16:08:03.8078072+08:00;True|2021-06-04T15:47:21.6412616+08:00;True|2021-06-04T15:21:02.4239800+08:00;True|2021-06-04T15:20:37.8641854+08:00;True|2021-06-04T13:38:51.5088395+08:00;True|2021-06-04T10:20:01.7784282+08:00;True|2021-06-04T10:13:50.3548857+08:00;True|2021-06-04T10:11:25.5017821+08:00;True|2021-06-04T10:09:51.6792228+08:00;True|2021-06-04T10:02:39.5851057+08:00;True|2021-06-04T09:30:40.4495494+08:00;True|2021-06-03T13:16:36.0317546+08:00;True|2021-06-03T13:12:47.0402047+08:00;True|2021-06-02T14:37:08.9683351+08:00;True|2021-06-02T14:10:15.7439829+08:00;True|2021-06-02T13:59:46.5841931+08:00;True|2021-06-02T13:25:18.7962660+08:00;True|2021-06-02T13:23:16.2261980+08:00;True|2021-06-01T15:37:32.2495085+08:00;True|2021-06-01T15:21:01.2856122+08:00;True|2021-06-01T15:13:36.7262365+08:00;True|2021-06-01T15:10:26.8905629+08:00;True|2021-06-01T14:56:17.5231551+08:00;True|2021-06-01T14:38:39.7895927+08:00;True|2021-06-01T14:23:12.3265287+08:00;True|2021-03-01T09:11:31.3226422+08:00;True|2021-05-26T14:54:56.9426462+08:00;True|2021-05-26T13:57:33.7780451+08:00;True|2021-05-26T13:39:02.8043358+08:00;True|2021-02-25T16:01:40.2917200+08:00;True|2021-02-25T15:49:46.6681205+08:00;True|2021-02-25T15:16:30.9372640+08:00;True|2021-05-25T13:10:21.7831921+08:00;True|2021-05-25T11:21:38.5224475+08:00;True|2021-05-25T11:12:52.0637175+08:00;True|2021-05-25T11:02:18.4164663+08:00;True|2021-05-25T10:52:06.8998521+08:00;True|2021-05-25T10:50:45.0929606+08:00;True|2021-05-25T10:45:54.1498313+08:00;True|2021-05-25T10:39:27.8602249+08:00;True|2021-05-25T10:34:49.5771162+08:00;True|2021-05-25T10:17:30.3009163+08:00;True|2021-05-25T10:14:03.8512581+08:00;True|2021-05-25T10:05:33.4343836+08:00;True|2021-05-24T17:01:23.3221168+08:00;True|2021-05-24T10:11:24.0197347+08:00;False|2021-05-24T10:11:07.6338995+08:00;</History>
+    <History>True|2021-09-10T06:18:27.5788854Z;True|2021-09-09T15:57:01.7407207+08:00;True|2021-09-09T15:49:34.2598998+08:00;True|2021-09-09T11:32:10.7853024+08:00;True|2021-09-09T11:10:48.6840025+08:00;True|2021-09-09T10:35:37.3883078+08:00;True|2021-09-07T14:11:49.8497588+08:00;True|2021-09-07T13:34:48.4693349+08:00;True|2021-09-06T14:33:48.7549675+08:00;True|2021-09-03T16:27:51.1888520+08:00;True|2021-09-03T16:19:35.9003465+08:00;True|2021-09-03T15:46:28.1828032+08:00;True|2021-09-03T15:34:21.9362871+08:00;True|2021-09-03T11:24:49.8749819+08:00;True|2021-09-03T11:21:17.8373159+08:00;True|2021-09-03T11:16:53.2208136+08:00;True|2021-09-03T11:12:23.9063804+08:00;True|2021-09-03T09:11:09.2435721+08:00;True|2021-09-02T11:16:15.1370453+08:00;True|2021-09-02T10:35:39.1171879+08:00;True|2021-09-01T10:17:09.4536285+08:00;True|2021-09-01T09:46:28.4581776+08:00;True|2021-08-31T08:54:26.8588887+08:00;True|2021-08-31T08:39:08.3685693+08:00;True|2021-08-30T17:11:56.8438985+08:00;True|2021-08-30T15:59:42.0820292+08:00;True|2021-08-30T15:45:18.1868510+08:00;True|2021-08-30T14:56:08.3958863+08:00;True|2021-08-30T14:37:11.5379830+08:00;True|2021-08-30T14:35:34.8775934+08:00;True|2021-08-30T14:24:36.5111821+08:00;True|2021-08-30T10:05:49.6945200+08:00;True|2021-08-30T10:03:28.4064538+08:00;True|2021-08-30T10:00:16.8360929+08:00;True|2021-08-30T09:56:09.4434379+08:00;True|2021-08-30T09:55:36.1725334+08:00;True|2021-08-30T09:52:04.8600054+08:00;True|2021-08-30T09:47:46.4225655+08:00;True|2021-08-30T09:45:20.4894962+08:00;False|2021-08-27T17:17:34.2646751+08:00;False|2021-08-27T16:01:21.2791979+08:00;False|2021-08-27T15:58:06.9667160+08:00;False|2021-08-27T15:38:37.4818036+08:00;False|2021-08-27T15:21:02.8863114+08:00;False|2021-08-27T15:20:28.6828668+08:00;True|2021-08-26T16:00:44.3162145+08:00;True|2021-08-26T08:57:31.3842587+08:00;True|2021-08-23T08:43:41.1549775+08:00;True|2021-08-22T09:24:12.7210871+08:00;True|2021-08-22T09:19:53.8300229+08:00;True|2021-08-20T20:00:52.0140407+08:00;True|2021-08-20T19:40:14.7712765+08:00;True|2021-08-19T17:37:54.9748049+08:00;True|2021-08-19T17:20:11.0515687+08:00;True|2021-08-19T16:12:35.4392809+08:00;True|2021-08-19T16:06:50.6204587+08:00;True|2021-08-19T16:03:53.0824286+08:00;True|2021-08-19T15:56:01.3498791+08:00;True|2021-08-19T10:18:50.8113630+08:00;True|2021-08-19T09:58:06.2784035+08:00;True|2021-08-19T09:56:54.0619777+08:00;True|2021-08-19T00:32:08.3503093+08:00;True|2021-08-19T00:11:18.3150227+08:00;True|2021-08-19T00:02:49.4827718+08:00;True|2021-08-18T23:54:45.4845900+08:00;True|2021-08-18T23:39:51.6147977+08:00;True|2021-08-18T23:16:42.7214379+08:00;True|2021-08-18T22:38:57.4681929+08:00;True|2021-08-18T21:41:58.7560707+08:00;True|2021-08-18T21:11:52.2369249+08:00;True|2021-08-18T21:01:49.5669106+08:00;True|2021-08-18T20:47:46.5352688+08:00;False|2021-08-18T20:46:36.7956141+08:00;False|2021-08-18T20:46:01.0502138+08:00;True|2021-08-18T19:39:12.8186242+08:00;False|2021-08-18T19:38:12.6839708+08:00;True|2021-08-18T19:15:51.4626694+08:00;True|2021-08-18T16:07:20.4350886+08:00;True|2021-08-18T14:29:41.7171934+08:00;True|2021-08-18T14:20:36.3647361+08:00;True|2021-08-16T09:08:58.3617662+08:00;True|2021-08-15T20:44:29.9214083+08:00;True|2021-08-15T20:36:17.0958549+08:00;True|2021-08-15T20:29:34.3879773+08:00;True|2021-08-15T20:23:47.4052038+08:00;True|2021-08-15T15:01:19.7830862+08:00;True|2021-08-15T12:15:18.3433782+08:00;True|2021-08-13T20:59:11.3947130+08:00;True|2021-08-06T22:49:09.9538339+08:00;True|2021-08-06T22:35:19.0418168+08:00;True|2021-08-06T20:29:47.4241975+08:00;True|2021-08-06T14:08:16.4791827+08:00;True|2021-08-06T13:59:28.9874611+08:00;True|2021-08-06T13:57:34.3723977+08:00;True|2021-08-06T13:36:03.4816652+08:00;True|2021-08-06T12:22:52.5055221+08:00;True|2021-08-06T09:31:58.1272499+08:00;True|2021-08-06T09:26:51.6310039+08:00;True|2021-08-06T09:24:22.2899244+08:00;True|2021-08-06T09:06:30.6477912+08:00;True|2021-08-06T09:00:55.5101612+08:00;True|2021-08-06T08:49:59.9616490+08:00;True|2021-08-06T08:45:18.8586902+08:00;True|2021-08-05T20:09:25.8861998+08:00;True|2021-08-04T19:14:27.2396953+08:00;True|2021-08-04T19:11:47.5849093+08:00;True|2021-08-04T16:42:54.0149043+08:00;True|2021-08-04T15:02:11.5056561+08:00;True|2021-08-04T14:58:37.1435509+08:00;True|2021-08-04T14:55:34.7380132+08:00;True|2021-08-04T14:47:42.5933921+08:00;True|2021-08-04T14:45:17.9911874+08:00;True|2021-08-04T13:52:20.9601351+08:00;True|2021-08-04T09:48:28.8796992+08:00;True|2021-08-03T18:14:13.1894998+08:00;True|2021-08-03T17:45:35.1349721+08:00;True|2021-08-03T17:21:52.6028977+08:00;True|2021-08-03T17:20:35.4423020+08:00;True|2021-08-03T17:03:33.1667669+08:00;True|2021-08-03T17:01:54.2656787+08:00;True|2021-08-03T17:00:22.2778374+08:00;True|2021-08-03T16:56:58.8902582+08:00;True|2021-08-03T15:02:21.8601533+08:00;True|2021-08-03T14:57:34.0186758+08:00;True|2021-08-03T14:28:47.2242515+08:00;True|2021-08-03T14:22:22.4554236+08:00;True|2021-08-03T14:21:51.1339715+08:00;True|2021-08-03T13:37:33.9697131+08:00;True|2021-08-03T13:28:29.7591095+08:00;True|2021-08-03T11:35:09.5118324+08:00;True|2021-08-03T11:11:23.3051573+08:00;True|2021-08-02T13:14:42.3663755+08:00;True|2021-07-30T22:50:19.9749878+08:00;True|2021-07-30T22:49:31.2150970+08:00;True|2021-07-28T19:12:05.8381075+08:00;True|2021-07-28T18:59:45.4808797+08:00;True|2021-07-28T18:15:58.8301509+08:00;True|2021-07-28T18:04:54.8613546+08:00;True|2021-07-28T17:53:48.6225611+08:00;True|2021-07-28T17:42:50.9171563+08:00;True|2021-07-28T17:17:16.3137677+08:00;True|2021-07-28T17:11:46.8925200+08:00;True|2021-07-28T16:28:27.6823943+08:00;True|2021-07-28T16:23:00.3385836+08:00;True|2021-07-28T09:57:55.4237411+08:00;True|2021-07-28T08:38:29.6691541+08:00;True|2021-07-27T23:16:32.0331671+08:00;True|2021-07-27T23:06:08.1947249+08:00;True|2021-07-27T23:05:58.4619176+08:00;True|2021-07-27T18:42:09.5358261+08:00;True|2021-07-27T18:30:04.8532823+08:00;True|2021-07-27T18:29:43.5775092+08:00;True|2021-07-27T15:16:49.8356224+08:00;True|2021-07-27T15:05:27.8453220+08:00;True|2021-07-27T14:59:15.9519440+08:00;True|2021-07-27T09:23:32.6111337+08:00;True|2021-07-27T08:27:41.6395353+08:00;True|2021-07-27T08:25:56.7378296+08:00;True|2021-07-26T11:18:46.0856966+08:00;True|2021-07-26T11:18:02.0751924+08:00;True|2021-07-26T11:13:49.6285395+08:00;True|2021-07-21T21:08:25.9898902+08:00;True|2021-07-21T20:09:26.2258104+08:00;True|2021-07-13T16:17:25.8407435+08:00;True|2021-07-13T13:46:13.4309531+08:00;True|2021-07-13T12:29:04.5082461+08:00;True|2021-06-29T13:55:01.6864637+08:00;True|2021-06-29T10:38:52.2206472+08:00;True|2021-06-29T10:10:13.1540749+08:00;True|2021-06-28T14:37:56.3853273+08:00;False|2021-06-28T14:36:57.5726124+08:00;True|2021-06-25T14:17:57.5196108+08:00;True|2021-06-25T13:56:38.9522535+08:00;True|2021-06-24T19:38:32.8766933+08:00;True|2021-06-24T18:26:35.6118833+08:00;True|2021-06-24T18:02:52.8136877+08:00;True|2021-06-24T17:48:49.5851948+08:00;True|2021-06-24T17:45:46.7527572+08:00;True|2021-06-24T15:05:20.1592723+08:00;True|2021-06-23T16:18:15.6814625+08:00;True|2021-06-23T16:05:24.6112343+08:00;True|2021-06-23T15:14:08.2489658+08:00;True|2021-06-23T13:52:58.6029788+08:00;True|2021-06-22T16:11:20.4726923+08:00;True|2021-06-22T16:04:53.7231389+08:00;True|2021-06-22T15:50:59.2583262+08:00;True|2021-06-22T15:38:15.3016140+08:00;True|2021-06-22T15:34:42.9185543+08:00;True|2021-06-22T15:21:55.1419108+08:00;True|2021-06-22T15:07:21.5357494+08:00;True|2021-06-22T15:03:35.0535733+08:00;True|2021-06-22T14:54:47.8802969+08:00;True|2021-06-22T11:19:38.7303011+08:00;True|2021-06-22T08:53:49.2882695+08:00;True|2021-06-22T08:47:54.8286530+08:00;True|2021-06-21T16:27:19.3017700+08:00;True|2021-06-21T15:32:28.7237952+08:00;True|2021-06-21T12:34:02.6329555+08:00;True|2021-06-21T12:24:17.5427495+08:00;True|2021-06-21T10:47:30.6423502+08:00;True|2021-06-21T08:43:20.3026558+08:00;True|2021-06-19T15:10:06.8335499+08:00;True|2021-06-18T15:37:29.5009930+08:00;True|2021-06-18T13:46:35.6283432+08:00;True|2021-06-18T10:00:37.1474954+08:00;True|2021-06-18T09:55:21.8551780+08:00;True|2021-06-18T09:22:27.8432927+08:00;True|2021-06-17T11:17:43.2166430+08:00;True|2021-06-17T09:24:09.8350403+08:00;True|2021-06-16T16:10:47.8564888+08:00;True|2021-06-16T16:04:09.8286582+08:00;True|2021-06-16T15:12:29.9427169+08:00;True|2021-06-16T14:58:45.6801892+08:00;True|2021-06-16T14:46:01.6873221+08:00;True|2021-06-16T11:02:06.1272477+08:00;True|2021-06-16T09:33:56.0223915+08:00;True|2021-06-16T08:50:07.6995413+08:00;True|2021-06-16T08:28:38.7692635+08:00;True|2021-06-16T01:04:19.6282474+08:00;True|2021-06-16T01:03:50.5058323+08:00;False|2021-06-16T01:02:15.3819672+08:00;False|2021-06-16T01:01:38.6171098+08:00;True|2021-06-16T00:34:54.9902044+08:00;True|2021-06-15T23:55:36.2003828+08:00;True|2021-06-15T22:47:17.2192750+08:00;True|2021-06-15T22:42:41.1512585+08:00;True|2021-06-15T22:38:01.7390462+08:00;True|2021-06-15T22:14:11.2060782+08:00;True|2021-06-15T22:12:27.0615357+08:00;True|2021-06-15T22:07:59.9280871+08:00;True|2021-06-15T22:04:21.5051427+08:00;True|2021-06-15T21:25:55.0099814+08:00;True|2021-06-15T19:13:51.3494172+08:00;True|2021-06-15T19:02:17.6844742+08:00;True|2021-06-15T18:47:37.1629411+08:00;False|2021-06-15T18:47:11.0828111+08:00;True|2021-06-15T18:38:26.6620668+08:00;True|2021-06-15T18:33:45.2069831+08:00;True|2021-06-15T18:24:52.0550838+08:00;True|2021-06-15T18:19:43.6999796+08:00;True|2021-06-15T18:08:17.2464506+08:00;True|2021-06-15T18:03:51.3952624+08:00;True|2021-06-15T18:01:20.6141766+08:00;True|2021-06-15T17:59:04.4479416+08:00;True|2021-06-15T17:41:44.6389379+08:00;True|2021-06-15T17:39:03.1565124+08:00;True|2021-06-15T17:34:41.0634638+08:00;True|2021-06-15T17:33:50.4853178+08:00;True|2021-06-15T17:25:38.5914037+08:00;True|2021-06-15T17:22:21.3611360+08:00;True|2021-06-15T17:16:49.4970813+08:00;True|2021-06-15T17:05:28.9389484+08:00;True|2021-06-15T16:52:54.6372199+08:00;True|2021-06-15T16:51:23.9081030+08:00;True|2021-06-15T16:45:40.6017997+08:00;True|2021-06-15T16:41:05.0218887+08:00;True|2021-06-15T16:38:02.8541862+08:00;True|2021-06-15T16:22:10.3118721+08:00;True|2021-06-15T16:12:11.1552506+08:00;True|2021-06-15T15:33:42.0100494+08:00;True|2021-06-15T15:28:39.7145659+08:00;True|2021-06-15T15:15:02.7939125+08:00;True|2021-06-15T14:49:14.2300396+08:00;True|2021-06-15T14:42:28.1198064+08:00;True|2021-06-15T13:30:12.7997686+08:00;True|2021-06-15T13:25:37.7284670+08:00;True|2021-06-15T13:23:43.6207813+08:00;False|2021-06-15T13:23:19.4190232+08:00;True|2021-06-15T13:16:38.5062674+08:00;True|2021-06-15T13:03:31.2055635+08:00;True|2021-06-15T12:58:43.1653215+08:00;True|2021-06-15T12:39:22.8442109+08:00;True|2021-06-15T12:35:09.1288556+08:00;False|2021-06-15T12:33:50.0723143+08:00;True|2021-06-15T11:28:01.9733727+08:00;True|2021-06-15T11:26:26.6569392+08:00;True|2021-06-15T11:22:43.0366435+08:00;True|2021-06-15T11:07:50.1610580+08:00;True|2021-06-15T10:32:59.1925931+08:00;True|2021-06-10T17:16:57.9552310+08:00;True|2021-06-10T16:44:42.2731836+08:00;True|2021-06-10T14:39:27.6745737+08:00;True|2021-06-10T12:15:05.1524413+08:00;True|2021-06-09T18:19:24.1005606+08:00;True|2021-06-09T17:56:09.5646288+08:00;True|2021-06-09T13:34:06.1882292+08:00;True|2021-06-09T13:29:54.5924933+08:00;True|2021-06-09T13:25:55.7520662+08:00;True|2021-06-09T13:07:47.6686811+08:00;True|2021-06-09T12:59:41.2595048+08:00;True|2021-06-09T12:45:27.1305548+08:00;True|2021-06-09T12:29:52.1418191+08:00;True|2021-06-09T12:24:12.7610588+08:00;True|2021-06-09T11:31:25.3409568+08:00;True|2021-06-09T09:57:44.4387175+08:00;True|2021-06-09T09:54:26.5161307+08:00;True|2021-06-09T09:14:14.7288045+08:00;True|2021-06-09T09:10:25.1812139+08:00;True|2021-06-09T08:46:21.6585123+08:00;True|2021-06-08T19:56:55.7192062+08:00;True|2021-06-08T19:52:59.0326821+08:00;True|2021-06-08T19:49:13.6274217+08:00;True|2021-06-08T19:09:22.1038939+08:00;True|2021-06-08T15:28:41.3716247+08:00;True|2021-06-08T15:26:47.2621178+08:00;True|2021-06-08T13:49:45.8936617+08:00;True|2021-06-08T13:43:18.8115502+08:00;True|2021-06-08T10:04:06.2200731+08:00;True|2021-06-08T09:17:10.0470792+08:00;True|2021-06-08T08:44:37.4395849+08:00;True|2021-06-08T00:01:09.3745613+08:00;True|2021-06-07T23:49:31.5196888+08:00;True|2021-06-07T23:41:00.8017855+08:00;True|2021-06-07T23:21:53.1371134+08:00;True|2021-06-07T23:01:27.5712153+08:00;True|2021-06-07T22:36:12.9274014+08:00;True|2021-06-07T22:23:00.6545134+08:00;True|2021-06-07T17:44:47.5686346+08:00;True|2021-06-07T17:17:01.3431233+08:00;True|2021-06-07T16:53:28.9989587+08:00;True|2021-06-07T16:41:10.4975607+08:00;True|2021-06-07T14:21:06.8176477+08:00;True|2021-06-07T14:10:39.0355659+08:00;True|2021-06-07T12:34:31.4562732+08:00;True|2021-06-07T12:28:44.9629488+08:00;True|2021-06-07T10:30:26.9387988+08:00;True|2021-06-07T09:12:14.7658099+08:00;True|2021-06-07T08:37:19.6353792+08:00;True|2021-06-07T08:35:25.2031954+08:00;True|2021-06-05T07:07:32.0541266+08:00;True|2021-06-05T06:44:35.9475270+08:00;True|2021-06-05T06:37:27.4595197+08:00;True|2021-06-05T06:26:59.7663998+08:00;True|2021-06-05T05:43:12.8699318+08:00;True|2021-06-04T17:00:41.2426007+08:00;True|2021-06-04T16:08:03.8078072+08:00;True|2021-06-04T15:47:21.6412616+08:00;True|2021-06-04T15:21:02.4239800+08:00;True|2021-06-04T15:20:37.8641854+08:00;True|2021-06-04T13:38:51.5088395+08:00;True|2021-06-04T10:20:01.7784282+08:00;True|2021-06-04T10:13:50.3548857+08:00;True|2021-06-04T10:11:25.5017821+08:00;True|2021-06-04T10:09:51.6792228+08:00;True|2021-06-04T10:02:39.5851057+08:00;True|2021-06-04T09:30:40.4495494+08:00;True|2021-06-03T13:16:36.0317546+08:00;True|2021-06-03T13:12:47.0402047+08:00;True|2021-06-02T14:37:08.9683351+08:00;True|2021-06-02T14:10:15.7439829+08:00;True|2021-06-02T13:59:46.5841931+08:00;True|2021-06-02T13:25:18.7962660+08:00;True|2021-06-02T13:23:16.2261980+08:00;True|2021-06-01T15:37:32.2495085+08:00;True|2021-06-01T15:21:01.2856122+08:00;True|2021-06-01T15:13:36.7262365+08:00;True|2021-06-01T15:10:26.8905629+08:00;True|2021-06-01T14:56:17.5231551+08:00;True|2021-06-01T14:38:39.7895927+08:00;True|2021-06-01T14:23:12.3265287+08:00;True|2021-03-01T09:11:31.3226422+08:00;True|2021-05-26T14:54:56.9426462+08:00;True|2021-05-26T13:57:33.7780451+08:00;True|2021-05-26T13:39:02.8043358+08:00;True|2021-02-25T16:01:40.2917200+08:00;True|2021-02-25T15:49:46.6681205+08:00;True|2021-02-25T15:16:30.9372640+08:00;True|2021-05-25T13:10:21.7831921+08:00;True|2021-05-25T11:21:38.5224475+08:00;True|2021-05-25T11:12:52.0637175+08:00;True|2021-05-25T11:02:18.4164663+08:00;True|2021-05-25T10:52:06.8998521+08:00;True|2021-05-25T10:50:45.0929606+08:00;True|2021-05-25T10:45:54.1498313+08:00;True|2021-05-25T10:39:27.8602249+08:00;True|2021-05-25T10:34:49.5771162+08:00;True|2021-05-25T10:17:30.3009163+08:00;True|2021-05-25T10:14:03.8512581+08:00;True|2021-05-25T10:05:33.4343836+08:00;True|2021-05-24T17:01:23.3221168+08:00;True|2021-05-24T10:11:24.0197347+08:00;False|2021-05-24T10:11:07.6338995+08:00;</History>
   </PropertyGroup>
   <ItemGroup>
     <File Include="apiapp.json">
-      <publishTime>08/25/2021 20:46:11</publishTime>
+      <publishTime>08/09/2021 15:55:25</publishTime>
     </File>
     <File Include="bin/Antlr3.Runtime.dll">
       <publishTime>02/22/2013 16:43:40</publishTime>
@@ -18,31 +18,31 @@
       <publishTime>02/22/2013 16:43:40</publishTime>
     </File>
     <File Include="bin/BLL.dll">
-      <publishTime>09/03/2021 16:27:44</publishTime>
+      <publishTime>09/10/2021 14:18:02</publishTime>
     </File>
     <File Include="bin/BLL.pdb">
-      <publishTime>09/03/2021 16:27:44</publishTime>
+      <publishTime>09/10/2021 14:18:02</publishTime>
     </File>
     <File Include="bin/DAL.dll">
-      <publishTime>09/03/2021 16:27:43</publishTime>
+      <publishTime>09/10/2021 14:17:59</publishTime>
     </File>
     <File Include="bin/DAL.pdb">
-      <publishTime>09/03/2021 16:27:43</publishTime>
+      <publishTime>09/10/2021 14:17:59</publishTime>
     </File>
     <File Include="bin/Dapper.dll">
       <publishTime>07/22/2016 22:52:40</publishTime>
     </File>
     <File Include="bin/DBUtility.dll">
-      <publishTime>09/03/2021 16:27:41</publishTime>
+      <publishTime>09/10/2021 14:17:56</publishTime>
     </File>
     <File Include="bin/DBUtility.pdb">
-      <publishTime>09/03/2021 16:27:41</publishTime>
+      <publishTime>09/10/2021 14:17:56</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>08/25/2021 20:46:09</publishTime>
+      <publishTime>08/09/2021 15:55:13</publishTime>
     </File>
     <File Include="bin/Kingdee.BOS.WebApi.FormService.dll">
       <publishTime>09/20/2018 19:23:20</publishTime>
@@ -60,34 +60,34 @@
       <publishTime>07/25/2012 19:48:56</publishTime>
     </File>
     <File Include="bin/Model.dll">
-      <publishTime>09/03/2021 16:27:42</publishTime>
+      <publishTime>09/10/2021 14:17:56</publishTime>
     </File>
     <File Include="bin/Model.pdb">
-      <publishTime>09/03/2021 16:27:42</publishTime>
+      <publishTime>09/10/2021 14:17:56</publishTime>
     </File>
     <File Include="bin/Models/ClsSc_MouldScrapOutBillMain.cs">
-      <publishTime>08/25/2021 20:46:11</publishTime>
+      <publishTime>08/09/2021 15:55:25</publishTime>
     </File>
     <File Include="bin/Newtonsoft.Json.dll">
       <publishTime>08/04/2014 04:33:56</publishTime>
     </File>
     <File Include="bin/Pub_Class.dll">
-      <publishTime>09/03/2021 16:27:40</publishTime>
+      <publishTime>09/10/2021 14:17:53</publishTime>
     </File>
     <File Include="bin/Pub_Class.pdb">
-      <publishTime>09/03/2021 16:27:40</publishTime>
+      <publishTime>09/10/2021 14:17:53</publishTime>
     </File>
     <File Include="bin/Pub_Control.dll">
-      <publishTime>09/03/2021 16:27:41</publishTime>
+      <publishTime>09/10/2021 14:17:54</publishTime>
     </File>
     <File Include="bin/Pub_Control.pdb">
-      <publishTime>09/03/2021 16:27:41</publishTime>
+      <publishTime>09/10/2021 14:17:54</publishTime>
     </File>
     <File Include="bin/SQLHelper.dll">
-      <publishTime>09/03/2021 16:27:41</publishTime>
+      <publishTime>09/10/2021 14:17:54</publishTime>
     </File>
     <File Include="bin/SQLHelper.pdb">
-      <publishTime>09/03/2021 16:27:41</publishTime>
+      <publishTime>09/10/2021 14:17:54</publishTime>
     </File>
     <File Include="bin/stdole.dll">
       <publishTime>05/09/2021 13:35:37</publishTime>
@@ -156,7 +156,7 @@
       <publishTime>11/28/2018 21:01:00</publishTime>
     </File>
     <File Include="bin/System.Web.Http.WebHost.dll">
-      <publishTime>08/25/2021 20:46:11</publishTime>
+      <publishTime>08/09/2021 15:55:25</publishTime>
     </File>
     <File Include="bin/System.Web.Mvc.dll">
       <publishTime>01/28/2015 12:02:18</publishTime>
@@ -189,10 +189,10 @@
       <publishTime>11/24/2014 19:18:48</publishTime>
     </File>
     <File Include="bin/WebAPI.dll">
-      <publishTime>09/03/2021 16:27:45</publishTime>
+      <publishTime>09/10/2021 14:18:06</publishTime>
     </File>
     <File Include="bin/WebAPI.pdb">
-      <publishTime>09/03/2021 16:27:45</publishTime>
+      <publishTime>09/10/2021 14:18:06</publishTime>
     </File>
     <File Include="bin/WebGrease.dll">
       <publishTime>07/18/2013 01:03:52</publishTime>
@@ -204,166 +204,166 @@
       <publishTime>11/29/2018 21:26:30</publishTime>
     </File>
     <File Include="Content/bootstrap.css">
-      <publishTime>08/25/2021 20:46:11</publishTime>
+      <publishTime>08/09/2021 15:55:23</publishTime>
     </File>
     <File Include="Content/bootstrap.min.css">
-      <publishTime>08/25/2021 20:46:11</publishTime>
+      <publishTime>08/09/2021 15:55:23</publishTime>
     </File>
     <File Include="Content/Site.css">
-      <publishTime>08/25/2021 20:46:11</publishTime>
+      <publishTime>08/09/2021 15:55:23</publishTime>
     </File>
     <File Include="DLL/BLL.dll">
-      <publishTime>08/25/2021 20:46:11</publishTime>
+      <publishTime>08/09/2021 15:55:23</publishTime>
     </File>
     <File Include="DLL/DAL.dll">
-      <publishTime>08/25/2021 20:46:11</publishTime>
+      <publishTime>08/09/2021 15:55:23</publishTime>
     </File>
     <File Include="DLL/DBUtility.dll">
-      <publishTime>08/25/2021 20:46:11</publishTime>
+      <publishTime>08/09/2021 15:55:25</publishTime>
     </File>
     <File Include="DLL/Kingdee.BOS.WebApi.Client.dll">
-      <publishTime>08/25/2021 20:46:11</publishTime>
+      <publishTime>08/09/2021 15:55:25</publishTime>
     </File>
     <File Include="DLL/Model.dll">
-      <publishTime>08/25/2021 20:46:11</publishTime>
+      <publishTime>08/09/2021 15:55:25</publishTime>
     </File>
     <File Include="DLL/Newtonsoft.Json.Net35.dll">
-      <publishTime>08/25/2021 20:46:11</publishTime>
+      <publishTime>08/09/2021 15:55:25</publishTime>
     </File>
     <File Include="DLL/Pub_Class.dll">
-      <publishTime>08/25/2021 20:46:11</publishTime>
+      <publishTime>08/09/2021 15:55:25</publishTime>
     </File>
     <File Include="DLL/Pub_Control.dll">
-      <publishTime>08/25/2021 20:46:11</publishTime>
+      <publishTime>08/09/2021 15:55:25</publishTime>
     </File>
     <File Include="DLL/SQLHelper.dll">
-      <publishTime>08/25/2021 20:46:11</publishTime>
+      <publishTime>08/09/2021 15:55:25</publishTime>
     </File>
     <File Include="fonts/glyphicons-halflings-regular.eot">
-      <publishTime>08/25/2021 20:46:11</publishTime>
+      <publishTime>08/09/2021 15:55:25</publishTime>
     </File>
     <File Include="fonts/glyphicons-halflings-regular.svg">
-      <publishTime>08/25/2021 20:46:11</publishTime>
+      <publishTime>08/09/2021 15:55:25</publishTime>
     </File>
     <File Include="fonts/glyphicons-halflings-regular.ttf">
-      <publishTime>08/25/2021 20:46:11</publishTime>
+      <publishTime>08/09/2021 15:55:25</publishTime>
     </File>
     <File Include="fonts/glyphicons-halflings-regular.woff">
-      <publishTime>08/25/2021 20:46:11</publishTime>
+      <publishTime>08/09/2021 15:55:25</publishTime>
     </File>
     <File Include="Global.asax">
-      <publishTime>08/25/2021 20:46:11</publishTime>
+      <publishTime>08/09/2021 15:55:25</publishTime>
     </File>
     <File Include="Index.html">
-      <publishTime>08/25/2021 20:46:11</publishTime>
+      <publishTime>08/09/2021 15:55:25</publishTime>
     </File>
     <File Include="Metadata/deploymentTemplates/apiappconfig.azureresource.json">
-      <publishTime>08/25/2021 20:46:11</publishTime>
+      <publishTime>08/09/2021 15:55:25</publishTime>
     </File>
     <File Include="packages.config">
-      <publishTime>08/25/2021 20:46:11</publishTime>
+      <publishTime>08/09/2021 15:55:25</publishTime>
     </File>
     <File Include="Views/Scripts/bootstrap.js">
-      <publishTime>08/25/2021 20:46:11</publishTime>
+      <publishTime>08/09/2021 15:55:25</publishTime>
     </File>
     <File Include="Views/Scripts/bootstrap.min.js">
-      <publishTime>08/25/2021 20:46:11</publishTime>
+      <publishTime>08/09/2021 15:55:25</publishTime>
     </File>
     <File Include="Views/Scripts/jquery-1.10.2.js">
-      <publishTime>08/25/2021 20:46:11</publishTime>
+      <publishTime>08/09/2021 15:55:25</publishTime>
     </File>
     <File Include="Views/Scripts/jquery-1.10.2.min.js">
-      <publishTime>08/25/2021 20:46:11</publishTime>
+      <publishTime>08/09/2021 15:55:25</publishTime>
     </File>
     <File Include="Views/Scripts/jquery-1.10.2.min.map">
-      <publishTime>08/25/2021 20:46:11</publishTime>
+      <publishTime>08/09/2021 15:55:25</publishTime>
     </File>
     <File Include="Views/Scripts/jquery.validate.js">
-      <publishTime>08/25/2021 20:46:11</publishTime>
+      <publishTime>08/09/2021 15:55:25</publishTime>
     </File>
     <File Include="Views/Scripts/jquery.validate.min.js">
-      <publishTime>08/25/2021 20:46:11</publishTime>
+      <publishTime>08/09/2021 15:55:25</publishTime>
     </File>
     <File Include="Views/Scripts/jquery.validate.unobtrusive.js">
-      <publishTime>08/25/2021 20:46:11</publishTime>
+      <publishTime>08/09/2021 15:55:25</publishTime>
     </File>
     <File Include="Views/Scripts/jquery.validate.unobtrusive.min.js">
-      <publishTime>08/25/2021 20:46:11</publishTime>
+      <publishTime>08/09/2021 15:55:25</publishTime>
     </File>
     <File Include="Views/Scripts/modernizr-2.6.2.js">
-      <publishTime>08/25/2021 20:46:11</publishTime>
+      <publishTime>08/09/2021 15:55:25</publishTime>
     </File>
     <File Include="Views/Shared/Error.cshtml">
-      <publishTime>08/25/2021 20:46:11</publishTime>
+      <publishTime>08/09/2021 15:55:25</publishTime>
     </File>
     <File Include="Views/Shared/_Layout.cshtml">
-      <publishTime>08/25/2021 20:46:11</publishTime>
+      <publishTime>08/09/2021 15:55:25</publishTime>
     </File>
     <File Include="Views/web.config">
-      <publishTime>08/25/2021 20:46:11</publishTime>
+      <publishTime>08/09/2021 15:55:25</publishTime>
     </File>
     <File Include="Views/_ViewStart.cshtml">
-      <publishTime>08/25/2021 20:46:11</publishTime>
+      <publishTime>08/09/2021 15:55:25</publishTime>
     </File>
     <File Include="Web References/WebS/ClsCLD_Customer_Model.datasource">
-      <publishTime>08/25/2021 20:46:11</publishTime>
+      <publishTime>08/09/2021 15:55:25</publishTime>
     </File>
     <File Include="Web References/WebS/ClsCLD_Department_Model.datasource">
-      <publishTime>08/25/2021 20:46:11</publishTime>
+      <publishTime>08/09/2021 15:55:25</publishTime>
     </File>
     <File Include="Web References/WebS/ClsCLD_Employee_Model.datasource">
-      <publishTime>08/25/2021 20:46:11</publishTime>
+      <publishTime>08/09/2021 15:55:25</publishTime>
     </File>
     <File Include="Web References/WebS/ClsCLD_StockPlace_Model.datasource">
-      <publishTime>08/25/2021 20:46:11</publishTime>
+      <publishTime>08/09/2021 15:55:25</publishTime>
     </File>
     <File Include="Web References/WebS/ClsCLD_Supplier_Model.datasource">
-      <publishTime>08/25/2021 20:46:11</publishTime>
+      <publishTime>08/09/2021 15:55:25</publishTime>
     </File>
     <File Include="Web References/WebS/ClsCLD_Warehouse_Model.datasource">
-      <publishTime>08/25/2021 20:46:11</publishTime>
+      <publishTime>08/09/2021 15:55:25</publishTime>
     </File>
     <File Include="Web References/WebS/ClsGy_BadReason_Model.datasource">
-      <publishTime>08/25/2021 20:46:11</publishTime>
+      <publishTime>08/09/2021 15:55:25</publishTime>
     </File>
     <File Include="Web References/WebS/ClsGy_BarCodeBill_WMS_Model_View.datasource">
-      <publishTime>08/25/2021 20:46:11</publishTime>
+      <publishTime>08/09/2021 15:55:25</publishTime>
     </File>
     <File Include="Web References/WebS/ClsGy_Customer_Model.datasource">
-      <publishTime>08/25/2021 20:46:11</publishTime>
+      <publishTime>08/09/2021 15:55:25</publishTime>
     </File>
     <File Include="Web References/WebS/ClsGy_Department_Model.datasource">
-      <publishTime>08/25/2021 20:46:11</publishTime>
+      <publishTime>08/09/2021 15:55:25</publishTime>
     </File>
     <File Include="Web References/WebS/ClsGy_Employee_Model.datasource">
-      <publishTime>08/25/2021 20:46:11</publishTime>
+      <publishTime>08/09/2021 15:55:25</publishTime>
     </File>
     <File Include="Web References/WebS/ClsGy_Group_Model.datasource">
-      <publishTime>08/25/2021 20:46:11</publishTime>
+      <publishTime>08/09/2021 15:55:25</publishTime>
     </File>
     <File Include="Web References/WebS/ClsGy_Item30JiTai_Model.datasource">
-      <publishTime>08/25/2021 20:46:11</publishTime>
+      <publishTime>08/09/2021 15:55:25</publishTime>
     </File>
     <File Include="Web References/WebS/ClsGy_Source_Model.datasource">
-      <publishTime>08/25/2021 20:46:11</publishTime>
+      <publishTime>08/09/2021 15:55:25</publishTime>
     </File>
     <File Include="Web References/WebS/ClsGy_StockPlace_Model.datasource">
-      <publishTime>08/25/2021 20:46:11</publishTime>
+      <publishTime>08/09/2021 15:55:25</publishTime>
     </File>
     <File Include="Web References/WebS/ClsGy_Supplier_Model.datasource">
-      <publishTime>08/25/2021 20:46:11</publishTime>
+      <publishTime>08/09/2021 15:55:25</publishTime>
     </File>
     <File Include="Web References/WebS/ClsGy_Warehouse_Model.datasource">
-      <publishTime>08/25/2021 20:46:11</publishTime>
+      <publishTime>08/09/2021 15:55:25</publishTime>
     </File>
     <File Include="Web References/WebS/ClsKf_ICStockBill_WMS.datasource">
-      <publishTime>08/25/2021 20:46:11</publishTime>
+      <publishTime>08/09/2021 15:55:25</publishTime>
     </File>
     <File Include="Web References/WebS/Reference.map">
       <publishTime>08/06/2021 22:57:28</publishTime>
     </File>
     <File Include="Web.config">
-      <publishTime>09/03/2021 16:27:50</publishTime>
+      <publishTime>09/10/2021 14:18:25</publishTime>
     </File>
   </ItemGroup>
 </Project>
\ No newline at end of file
diff --git a/WebAPI/WebAPI.csproj b/WebAPI/WebAPI.csproj
index a673d05..3229e98 100644
--- a/WebAPI/WebAPI.csproj
+++ b/WebAPI/WebAPI.csproj
@@ -398,6 +398,7 @@
     <Compile Include="Models\ClsSb_EquipMaintainBillMain.cs" />
     <Compile Include="Models\ClsSb_EquipMaintainBillSub.cs" />
     <Compile Include="Models\ClsSb_EquipRepairWorkBillMain.cs" />
+    <Compile Include="Models\Xt_ORGANIZATIONS.cs" />
     <Compile Include="Models\ClsSb_EquipRepairWorkBillSub.cs" />
     <Compile Include="Models\ClsSc_ICMOBillWorkQtyStatus_Tmp.cs" />
     <Compile Include="Models\ClsSc_ICMOReportBillMain.cs" />
@@ -464,6 +465,7 @@
     <Compile Include="Models\WWSendOutBillViewModel.cs" />
     <Compile Include="Models\WW_EntrustProcSendWorkViewModel.cs" />
     <Compile Include="Models\WW_EntrustWorkOrderViewModel.cs" />
+    <Compile Include="Models\鍩虹璧勬枡\Gy_Employee.cs" />
     <Compile Include="Models\鍩虹璧勬枡\Gy_Process.cs" />
     <Compile Include="Models\鍩虹璧勬枡\Warehouse.cs" />
     <Compile Include="Properties\Resources.Designer.cs">
diff --git a/WebAPI/WebAPI.csproj.user b/WebAPI/WebAPI.csproj.user
index 8d7bb3f..c934955 100644
--- a/WebAPI/WebAPI.csproj.user
+++ b/WebAPI/WebAPI.csproj.user
@@ -7,7 +7,7 @@
     <WebStackScaffolding_IsReferencingScriptLibrariesSelected>True</WebStackScaffolding_IsReferencingScriptLibrariesSelected>
     <WebStackScaffolding_LayoutPageFile />
     <WebStackScaffolding_IsAsyncSelected>False</WebStackScaffolding_IsAsyncSelected>
-    <NameOfLastUsedPublishProfile>D:\Git浠撳簱\MESWMS\MES-WEB-API\WebAPI\Properties\PublishProfiles\FolderProfile.pubxml</NameOfLastUsedPublishProfile>
+    <NameOfLastUsedPublishProfile>FolderProfile</NameOfLastUsedPublishProfile>
     <LastActiveSolutionConfig>Debug|Any CPU</LastActiveSolutionConfig>
     <UseIISExpress>false</UseIISExpress>
     <Use64BitIISExpress />
diff --git "a/WorkM/\346\265\201\350\275\254\345\215\241\347\256\241\347\220\206/Sc_ProcessExchangeBill_CF.cs" "b/WorkM/\346\265\201\350\275\254\345\215\241\347\256\241\347\220\206/Sc_ProcessExchangeBill_CF.cs"
index 659e23f..9df12ad 100644
--- "a/WorkM/\346\265\201\350\275\254\345\215\241\347\256\241\347\220\206/Sc_ProcessExchangeBill_CF.cs"
+++ "b/WorkM/\346\265\201\350\275\254\345\215\241\347\256\241\347\220\206/Sc_ProcessExchangeBill_CF.cs"
@@ -91,6 +91,8 @@
         public const Int16 HSupIDCol = 68;
         public const Int16 HPassRateCol = 69;
         public const Int16 HSumPassRateCol = 70;
+        public const Int16 HMouldNoCol = 71;
+        public const Int16 HProcWorkNumCol = 72;
         //
         //
         //琛�2
@@ -1145,7 +1147,8 @@
                     grdMain.Rows[i].Cells[HSeOrderEntryIDCol].Value = oSub.HSeOrderEntryID.ToString();
                     grdMain.Rows[i].Cells[HWWOrderBillNoCol].Value = oSub.HWWOrderBillNo;
                     grdMain.Rows[i].Cells[HWWOrderEntryIDCol].Value = oSub.HWWOrderEntryID.ToString();
-                    grdMain.Rows[i].Cells[HWWOrderInterIDCol].Value = oSub.HWWOrderInterID.ToString();
+                    grdMain.Rows[i].Cells[HMouldNoCol].Value = oSub.HMouldNo.ToString();
+                    grdMain.Rows[i].Cells[HProcWorkNumCol].Value = oSub.HProcWorkNum.ToString();
 
                     i = i + 1;
                 }
@@ -1383,6 +1386,8 @@
                     oSub.HWWOrderBillNo = DBUtility.ClsPub.isStrNull(grdMain.Rows[i].Cells[HWWOrderBillNoCol].Value);
                     oSub.HPrevSourceInterID = DBUtility.ClsPub.isLong(grdMain.Rows[i].Cells[HPrevSourceInterIDCol].Value);
                     oSub.HPrevSourceEntryID = DBUtility.ClsPub.isLong(grdMain.Rows[i].Cells[HPrevSourceEntryIDCol].Value);
+                    oSub.HMouldNo = DBUtility.ClsPub.isStrNull(grdMain.Rows[i].Cells[HMouldNoCol].Value);
+                    oSub.HProcWorkNum = DBUtility.ClsPub.isStrNull(grdMain.Rows[i].Cells[HProcWorkNumCol].Value);
                     BillNew.DetailColl.Add(oSub);
                 }
             }
@@ -1431,7 +1436,7 @@
         {
 
             //
-            grdMain.ColumnCount = 71;                       //鎬诲垪鏁�
+            grdMain.ColumnCount = 73;                       //鎬诲垪鏁�
             DBUtility.Xt_BaseBillFun.initGridFst(grdMain, this.Name);
             //=
             grdMain.Columns[HProcNoCol].HeaderText = "宸ュ簭鍙�";
@@ -1493,6 +1498,8 @@
 
             grdMain.Columns[HPassRateCol].HeaderText = "鑹巼";
             grdMain.Columns[HSumPassRateCol].HeaderText = "绱鑹巼";
+            grdMain.Columns[HMouldNoCol].HeaderText = "妯″叿缂栧彿";
+            grdMain.Columns[HProcWorkNumCol].HeaderText = "绋嬪簭鍙�";
             grdMain.Columns[HSupIDCol].HeaderText = "渚涘簲鍟咺D";
             ////鍥哄畾璧嬪��=====================================================
             grdMain.Columns[HSnoCol].HeaderText = "搴忓彿";

--
Gitblit v1.9.1