From fad12ab96ea63fe46e75d33e95754d032deddcdb Mon Sep 17 00:00:00 2001
From: 杨乐 <yang.le.192@qq.com>
Date: 星期三, 19 一月 2022 17:04:32 +0800
Subject: [PATCH] 生产工序  完善 器具维修派工单 验证 设备维修派工单 编辑

---
 WebAPI/DLL/ClsSc_ProcessPlan.cs                                 |  291 ++++++++++++++++
 WebAPI/Models/ClsSb_EquipRepairSendWorkBillSub.cs               |   16 
 WebAPI/Controllers/SBGL/Sb_EquipRepairSendWorkBillController.cs |  225 ++++++++++++
 WebAPI/DLL/ClsSb_EquipRepairSendWorkBill.cs                     |  229 ++++++++++++
 WebAPI/Models/ClsSb_EquipRepairSendWorkBillMain.cs              |   23 +
 WebAPI/Controllers/Sc_ProcessMangementController.cs             |  253 +++++++++++++
 WebAPI/Controllers/LMESController.cs                            |   17 
 WebAPI/WebAPI.csproj                                            |    4 
 WebAPI/Controllers/Sc_MouldRepairSendWorkBillController.cs      |   18 
 9 files changed, 1,059 insertions(+), 17 deletions(-)

diff --git a/WebAPI/Controllers/LMESController.cs b/WebAPI/Controllers/LMESController.cs
index c57bd54..828d0e7 100644
--- a/WebAPI/Controllers/LMESController.cs
+++ b/WebAPI/Controllers/LMESController.cs
@@ -246,7 +246,7 @@
                     return objJsonResult;
                 }
                 oCN.BeginTran();//寮�濮嬩簨鍔�
-                ds = oCN.RunProcReturn("select * from Gy_RoutingBillSub where HInterID=" + lngBillKey, "Gy_RoutingBillSub");
+                ds = oCN.RunProcReturn("select * from Gy_RoutingBillmain where HInterID=" + lngBillKey, "Gy_RoutingBillmain");
                 if (ds == null || ds.Tables[0].Rows.Count == 0)
                 {
                     objJsonResult.code = "0";
@@ -255,12 +255,21 @@
                     objJsonResult.data = null;
                     return objJsonResult; ;
                 }
-                //string HChecker = Convert.ToString(ds.Tables[0].Rows[0]["HChecker"]);
-                //if (HChecker != " ")
+                string HChecker = Convert.ToString(ds.Tables[0].Rows[0]["HChecker"]);
+                //string hdeleteman = Convert.ToString(ds.Tables[0].Rows[0]["hdeleteman"]);
+                if (HChecker != "")
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鍗曟嵁宸茬粡瀹℃牳,涓嶈兘鍒犻櫎锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                //if (hdeleteman != "")
                 //{
                 //    objJsonResult.code = "0";
                 //    objJsonResult.count = 0;
-                //    objJsonResult.Message = "鍗曟嵁宸茬粡瀹℃牳,涓嶈兘鍒犻櫎锛�";
+                //    objJsonResult.Message = "鍗曟嵁宸茬粡浣滃簾,涓嶈兘鍒犻櫎锛�";
                 //    objJsonResult.data = null;
                 //    return objJsonResult;
                 //}
diff --git a/WebAPI/Controllers/SBGL/Sb_EquipRepairSendWorkBillController.cs b/WebAPI/Controllers/SBGL/Sb_EquipRepairSendWorkBillController.cs
index e5b13d8..2090c65 100644
--- a/WebAPI/Controllers/SBGL/Sb_EquipRepairSendWorkBillController.cs
+++ b/WebAPI/Controllers/SBGL/Sb_EquipRepairSendWorkBillController.cs
@@ -1,9 +1,11 @@
-锘縰sing System;
+锘縰sing Newtonsoft.Json.Linq;
+using System;
 using System.Collections.Generic;
 using System.Data;
 using System.Linq;
 using System.Web;
 using System.Web.Http;
+using WebAPI.DLL;
 using WebAPI.Models;
 
 namespace WebAPI.Controllers.SBGL
@@ -12,6 +14,9 @@
     {
         public DBUtility.ClsPub.Enum_BillStatus BillStatus;
 
+        ClsSb_EquipRepairSendWorkBillMain omodel = new ClsSb_EquipRepairSendWorkBillMain();
+        List<ClsSb_EquipRepairSendWorkBillSub> DetailColl = new List<ClsSb_EquipRepairSendWorkBillSub>();
+        ClsSb_EquipRepairSendWorkBill oBill = new ClsSb_EquipRepairSendWorkBill();
         private json objJsonResult = new json();
         SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
         DataSet ds;
@@ -23,7 +28,7 @@
         {
             try
             {
-                string sql = "select * from  h_v_Sb_EquipRepairSendWorkBillList ";
+                string sql = "select * from  h_v_Sb_EquipRepairSendWorkBillList where 1=1 ";
                 if (sWhere == "" || sWhere == null)
                 {
                     ds = oCN.RunProcReturn(sql, "h_v_Sb_EquipRepairSendWorkBillList");
@@ -59,6 +64,222 @@
         #endregion
 
         #region 璁惧缁翠慨娲惧伐鍗� 娣诲姞/淇敼
+        [Route("Sb_EquipRepairSendWorkBill/AddEquipRepairSendWorkBill")]
+        [HttpPost]
+        public object AddBill([FromBody] JObject sMainSub)
+        {
+            var _value = sMainSub["sMainSub"].ToString();
+            string msg1 = _value.ToString();
+            oCN.BeginTran();
+            //淇濆瓨涓昏〃
+            objJsonResult = AddBillMain(msg1);
+            if (objJsonResult.code == "0")
+            {
+                oCN.RollBack();
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = objJsonResult.Message;
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+            oCN.Commit();
+            objJsonResult.code = "1";
+            objJsonResult.count = 1;
+            objJsonResult.Message = "鏂板鍗曟嵁鎴愬姛锛�";
+            objJsonResult.data = null;
+            return objJsonResult;
+        }
+
+        public json AddBillMain(string msg1)
+        {
+            string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
+            string msg2 = sArray[0].ToString();
+            string msg3 = sArray[1].ToString();
+
+            int hentryid = int.Parse(sArray[2].ToString());//瀛愯〃鐨勯『搴廼d
+            int OperationType = int.Parse(sArray[3].ToString());//鏁版嵁绫诲瀷 1娣诲姞 3淇敼
+            try
+            {
+                omodel = Newtonsoft.Json.JsonConvert.DeserializeObject<ClsSb_EquipRepairSendWorkBillMain>(msg2);
+                string BillType = "3909";
+
+
+                if (OperationType == 1)//鏂板
+                {
+                    //涓昏〃
+                    oCN.RunProc("Insert Into Sb_EquipRepairSendWorkBillMain" +
+               "(HBillType,HBillSubType,HInterID,HBillNo,HDate" +
+              ",HYear,HPeriod,HRemark,HMaker,HMakeDate" +
+              ",HEquipID,HExplanation,HInnerBillNo,HRepairID,HEmpID" +
+              ",HManagerID,HDeptID,HRepairContent,HRepairPlanBeginDate,HRepairPlanEndDate" +
+              ",HPlanTimes,HCycleUnit" +
+              ") " +
+              " values('" + BillType + "','" + BillType + "'," + omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "','" + omodel.HDate + "'" +
+              ", " + omodel.HYear.ToString() + "," + omodel.HPeriod.ToString() + ",'" + omodel.HRemark + "','" + omodel.HMaker + "',getdate()" +
+              ", " + omodel.HEquipID.ToString() + ",'" + omodel.HExplanation + "','" + omodel.HInnerBillNo + "'," + omodel.HRepairID.ToString() + "," + omodel.HEmpID.ToString() +
+              "," + omodel.HManagerID.ToString() + "," + omodel.HDeptID.ToString() + ",'" + omodel.HRepairContent + "','" + omodel.HRepairPlanBeginDate + "','" + omodel.HRepairPlanEndDate + "'" +
+              "," + omodel.HPlanTimes.ToString() + ",'" + omodel.HCycleUnit + "'" +
+              ") ");
+
+                }
+                else if (OperationType == 3)
+                {
+                    //淇敼
+                    oCN.RunProc("UpDate Sb_EquipRepairSendWorkBillMain set  " +
+                    "HDate='" + omodel.HDate + "'" +
+                    ",HYear='" + omodel.HYear.ToString() + "'" +
+                    ",HPeriod='" + omodel.HPeriod.ToString() + "'" +
+                    ",HRemark='" + omodel.HRemark + "'" +
+                    ",HUpDater='" + omodel.HUpDater + "'" +
+                    ",HUpDateDate=getdate()" +
+                    //=========================================
+                    ",HEquipID=" + omodel.HEquipID.ToString() +
+                    ",HRepairID=" + omodel.HRepairID.ToString() +
+                    ",HPlanTimes=" + omodel.HPlanTimes.ToString() +
+                    ",HEmpID=" + omodel.HEmpID.ToString() +
+                    ",HManagerID=" + omodel.HManagerID.ToString() +
+                    ",HDeptID=" + omodel.HDeptID.ToString() +
+                    ",HRepairPlanBeginDate='" + omodel.HRepairPlanBeginDate + "'" +
+                    ",HRepairPlanEndDate='" + omodel.HRepairPlanEndDate + "'" +
+                    ",HRepairContent='" + omodel.HRepairContent + "'" +
+                    ",HCycleUnit='" + omodel.HCycleUnit + "'" +
+                    ",HExplanation='" + omodel.HExplanation + "'" +
+                    ",HInnerBillNo='" + omodel.HInnerBillNo + "'" +
+                    " where HInterID=" + omodel.HInterID);
+
+                    //鍒犻櫎瀛愯〃
+                    oCN.RunProc("delete from Sb_EquipRepairSendWorkBillSub where HInterID='" + omodel.HInterID + "' and HEntryID='" + hentryid + "'");
+                }
+                //淇濆瓨瀛愯〃
+                objJsonResult = AddBillSub(msg3, hentryid);
+                if (objJsonResult.code == "0")
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = objJsonResult.Message;
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
+                objJsonResult.code = "1";
+                objJsonResult.count = 1;
+                objJsonResult.Message = null;
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "Exception锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+
+        public json AddBillSub(string msg3, int hentryid)
+        {
+            DetailColl = Newtonsoft.Json.JsonConvert.DeserializeObject<List<ClsSb_EquipRepairSendWorkBillSub>>(msg3);
+            int i = 1;
+            //鎻掑叆瀛愯〃
+            foreach (Models.ClsSb_EquipRepairSendWorkBillSub oSub in DetailColl)
+            {
+                oCN.RunProc("Insert into Sb_EquipRepairSendWorkBillSub " +
+                       " (HInterID,HEntryID,HCloseMan,HEntryCloseDate,HCloseType,HRemark" +
+                       ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" +
+                       ",HRepairID,HManagerID,HRepairExplanation" +
+                       ") values("
+                       + omodel.HInterID.ToString() + "," + (hentryid==-1?i: hentryid) + ",'" + 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.HRepairID.ToString() + "," + oSub.HManagerID.ToString() + ",'" + oSub.HRepairExplanation + "'" +
+                       ") ");
+                i++;
+            }
+
+            objJsonResult.code = "1";
+            objJsonResult.count = 1;
+            objJsonResult.Message = null;
+            objJsonResult.data = null;
+            return objJsonResult;
+        }
+        #endregion
+
+        #region 璁惧缁翠慨娲惧伐鍗� 鍒犻櫎
+        [Route("Sb_EquipRepairSendWorkBill/DeleteWorkBill")]
+        [HttpGet]
+        public object MouldDeleteBill(long HInterID, string User, string ModRightNameDelete)
+        {
+            try
+            {
+                //鍒ゆ柇鏉冮檺
+                //if (!DBUtility.ClsPub.Security_Log(ModRightNameDelete, 1, false, User))
+                //{
+                //    objJsonResult.code = "0";
+                //    objJsonResult.count = 0;
+                //    objJsonResult.Message = "娌℃湁鍒犻櫎鏉冮檺";
+                //    objJsonResult.data = null;
+                //    return objJsonResult;
+                //}
+                oBill.ShowBill(HInterID, ref DBUtility.ClsPub.sExeReturnInfo);
+
+                if (oBill.omodel.HBillStatus > 1)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 1;
+                    objJsonResult.Message = "鍗曟嵁褰撳墠澶勪簬涓嶈兘鍒犻櫎鐨勭姸鎬�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                if (oBill.omodel.HCloseMan != "")
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 1;
+                    objJsonResult.Message = "鍗曟嵁褰撳墠宸插叧闂�,涓嶈兘鍒犻櫎";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                if (oBill.omodel.HDeleteMan != "")
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 1;
+                    objJsonResult.Message = "鍗曟嵁褰撳墠宸蹭綔搴�,涓嶈兘鍒犻櫎";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                if (oBill.omodel.HChecker != "")
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 1;
+                    objJsonResult.Message = "鍗曟嵁褰撳墠宸插鏍�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                if (oBill.DeleteBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo))
+                {
+                    objJsonResult.code = "1";
+                    objJsonResult.count = 1;
+                    objJsonResult.Message = "鍒犻櫎鎴愬姛";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                else
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 1;
+                    objJsonResult.Message = "鍒犻櫎澶辫触";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "鏃犳潈闄愬垹闄�";
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
         #endregion
     }
 }
\ No newline at end of file
diff --git a/WebAPI/Controllers/Sc_MouldRepairSendWorkBillController.cs b/WebAPI/Controllers/Sc_MouldRepairSendWorkBillController.cs
index d7ff4ba..a62889f 100644
--- a/WebAPI/Controllers/Sc_MouldRepairSendWorkBillController.cs
+++ b/WebAPI/Controllers/Sc_MouldRepairSendWorkBillController.cs
@@ -248,14 +248,15 @@
                     objJsonResult.data = null;
                     return objJsonResult;
                 }
-                if (oBill.omodel.HChecker != "")
-                {
-                    objJsonResult.code = "0";
-                    objJsonResult.count = 1;
-                    objJsonResult.Message = "鍗曟嵁褰撳墠宸插鏍�";
-                    objJsonResult.data = null;
-                    return objJsonResult;
-                }
+                //涓嶉渶瑕�
+                //if (oBill.omodel.HChecker != "")
+                //{
+                //    objJsonResult.code = "0";
+                //    objJsonResult.count = 1;
+                //    objJsonResult.Message = "鍗曟嵁褰撳墠宸插鏍�";
+                //    objJsonResult.data = null;
+                //    return objJsonResult;
+                //}
                 if (oBill.DeleteBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo))
                 {
                     objJsonResult.code = "1";
@@ -313,6 +314,7 @@
                     return objJsonResult;
                 }
 
+
                 //杞崲id
                 Int64 lngBillKey = 0;
                 lngBillKey = DBUtility.ClsPub.isLong(HInterID);
diff --git a/WebAPI/Controllers/Sc_ProcessMangementController.cs b/WebAPI/Controllers/Sc_ProcessMangementController.cs
index 26b7cc7..8f1878c 100644
--- a/WebAPI/Controllers/Sc_ProcessMangementController.cs
+++ b/WebAPI/Controllers/Sc_ProcessMangementController.cs
@@ -6,6 +6,7 @@
 using System.Data;
 using System.Data.SqlClient;
 using System.Web.Http;
+using WebAPI.DLL;
 using WebAPI.Models;
 using WebAPI.Service;
 
@@ -223,10 +224,11 @@
         }
 
         #region 宸ュ簭璁″垝鍗�
-
-        #region 宸ュ簭璁″垝鍗曞垪琛�
         List<ClsSc_ProcessPlanSub> DetailColl = new List<ClsSc_ProcessPlanSub>();
         ClsSc_ProcessPlanMain omodel = new ClsSc_ProcessPlanMain();
+        ClsSc_ProcessPlan oBill = new ClsSc_ProcessPlan();
+
+        #region 宸ュ簭璁″垝鍗曞垪琛�
         /// <summary>
         /// 杩斿洖鐢熶骇宸ュ簭璁″垝鍗曞垪琛�
         ///鍙傛暟锛歴tring sql銆�
@@ -316,7 +318,7 @@
                     ",HRemark,HInnerBillNo,HMaker,HMakeDate" +
                     ") " +
                     " values(" + omodel.HYear.ToString() + "," + omodel.HPeriod.ToString() + ",'" + BillType + "','" + BillType + "'," + omodel.HInterID.ToString() +
-                    ",'" + omodel.HDate.ToShortDateString() + "','" + omodel.HBillNo + "'," + omodel.HBillStatus.ToString() + "," + omodel.HCheckItemNowID.ToString() + "," + omodel.HCheckItemNextID.ToString() +
+                    ",'" + omodel.HDate.ToShortDateString() + "','" + omodel.HBillNo + "'," + (omodel.HBillStatus=1) + "," + omodel.HCheckItemNowID.ToString() + "," + omodel.HCheckItemNextID.ToString() +
                     "," + omodel.HICMOInterID.ToString() + ",'" + omodel.HICMOBillNo + "'," + omodel.HMaterID.ToString() + ",'" + omodel.HMaterNumber + "'," + omodel.HUnitID.ToString() +
                     ",'" + omodel.HUnitNumber + "'," + omodel.HPlanQty.ToString() + ",'" + omodel.HPlanBeginDate.ToShortDateString() + "','" + omodel.HPlanEndDate.ToShortDateString() + "','" + omodel.HExplanation + "'" +
                     ",'" + omodel.HRemark + "','" + omodel.HInnerBillNo + "','" + omodel.HMaker + "',getdate()" +
@@ -419,6 +421,251 @@
         }
         #endregion
 
+        #region 瀹℃牳/鍙嶅鏍�
+        [Route("Sc_ProcessMangement/CheckDeOAuditBill")]
+        [HttpGet]
+        public object CheckDeOAuditBill(int HInterID, int IsAudit, string CurUserName)
+        {
+            //    string ModRightNameCheck = ""; 璇ユā鍧楃殑瀹℃牳鍔熻兘
+            DBUtility.ClsPub.CurUserName = CurUserName;//瀛樺偍鐢ㄦ埛鍚�
+
+            try
+            {
+                ////鍒ゆ柇鏄惁鏈夊鏍告潈闄�
+                //    if (!DBUtility.ClsPub.Security_Log(ModRightNameCheck, 1, false, CurUserName))
+                //{
+                //    objJsonResult.code = "0";
+                //    objJsonResult.count = 0;
+                //    objJsonResult.Message = "瀹℃牳澶辫触锛佹棤鏉冮檺锛�";
+                //    objJsonResult.data = null;
+                //    return objJsonResult;
+                //}
+
+                //鍒ゆ柇id鏄惁澶т簬0
+                if (HInterID <= 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "ID灏忎簬0";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
+                //杞崲id
+                Int64 lngBillKey = 0;
+                lngBillKey = DBUtility.ClsPub.isLong(HInterID);
+
+                //鏌ヨ瀹℃牳鐨勮繖鏉℃暟鎹�
+                ds = oCN.RunProcReturn("select * from Sc_ProcessPlanMain where HInterID='" + HInterID + "'", "Sc_ProcessPlanMain");
+
+                if (ds.Tables[0].Rows.Count > 0)
+                {
+                    string HCloseMan = ds.Tables[0].Rows[0]["HCloseMan"].ToString().Trim();//鍏抽棴浜�
+                    string HDeleteMan = ds.Tables[0].Rows[0]["HDeleteMan"].ToString().Trim();//浣滃簾浜�
+                    string HChecker = ds.Tables[0].Rows[0]["HChecker"].ToString().Trim();//瀹℃牳浜�
+
+                    if (HCloseMan != "")
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "褰撳墠鍗曟嵁宸插叧闂�,涓嶈兘瀹℃牳";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                    if (HDeleteMan != "")
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "褰撳墠鍗曟嵁宸蹭綔搴�,涓嶈兘瀹℃牳";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                    //IsAudit==0  瀹℃牳
+                    if (IsAudit == 0)
+                    {
+                        if (HChecker != "")
+                        {
+                            objJsonResult.code = "0";
+                            objJsonResult.count = 0;
+                            objJsonResult.Message = "褰撳墠鏁版嵁宸插鏍�";
+                            objJsonResult.data = null;
+                            return objJsonResult;
+                        }
+                    }
+                    //IsAudit==1  鍙嶅鏍�
+                    if (IsAudit == 1)
+                    {
+                        if (HChecker == "")
+                        {
+                            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 (CheckBill(lngBillKey, 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;
+                    }
+                }
+                //鍙嶅鏍告彁浜�
+                if (IsAudit == 1)
+                {
+                    if (AbandonCheck(lngBillKey, 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;
+                    }
+                }
+                return objJsonResult;
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "瀹℃牳澶辫触鎴栧弽瀹℃牳澶辫触" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+          
+        }
+        //瀹℃牳
+        public bool CheckBill(Int64 lngBillKey, ref string sReturn)
+        {
+            try
+            {
+                string HChecker = DBUtility.ClsPub.CurUserName;//鐢ㄦ埛鍚�
+                oCN.BeginTran();//鎵撳紑浜嬪姟
+                oCN.RunProc("update Sc_ProcessPlanMain set HChecker='" + HChecker + "',HCheckDate='" + DateTime.Now + "',HBillStatus=2 where HInterID='" + lngBillKey + "'");
+                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;//鐢ㄦ埛鍚�
+                oCN.BeginTran();//鎵撳紑浜嬪姟
+                oCN.RunProc("update Sc_ProcessPlanMain set HChecker='',HCheckDate=null,HBillStatus=1 where HInterID='" + lngBillKey + "'");
+                oCN.Commit();//鍏抽棴浜嬪姟
+                sReturn = "鍙嶅鏍稿崟鎹垚鍔�!";
+                return true;
+            }
+            catch (Exception e)
+            {
+                sReturn = e.Message;
+                throw (e);
+            }
+        }
+        #endregion
+
+        #region 鍒犻櫎
+        [Route("Sc_ProcessMangement/DeleteProcessBill")]
+        [HttpGet]
+        public object MouldDeleteBill(long HInterID, string User, string ModRightNameDelete)
+        {
+            try
+            {
+                //鍒ゆ柇鏉冮檺
+                //if (!DBUtility.ClsPub.Security_Log(ModRightNameDelete, 1, false, User))
+                //{
+                //    objJsonResult.code = "0";
+                //    objJsonResult.count = 0;
+                //    objJsonResult.Message = "娌℃湁鍒犻櫎鏉冮檺";
+                //    objJsonResult.data = null;
+                //    return objJsonResult;
+                //}
+                oBill.ShowBill(HInterID, ref DBUtility.ClsPub.sExeReturnInfo);
+
+                if (oBill.omodel.HBillStatus > 1)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 1;
+                    objJsonResult.Message = "鍗曟嵁褰撳墠澶勪簬涓嶈兘鍒犻櫎鐨勭姸鎬�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                //涓嶉渶瑕�
+                //if (oBill.omodel.HChecker != "")
+                //{
+                //    objJsonResult.code = "0";
+                //    objJsonResult.count = 1;
+                //    objJsonResult.Message = "鍗曟嵁褰撳墠宸插鏍�";
+                //    objJsonResult.data = null;
+                //    return objJsonResult;
+                //}
+                if (oBill.DeleteBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo))
+                {
+                    objJsonResult.code = "1";
+                    objJsonResult.count = 1;
+                    objJsonResult.Message = "鍒犻櫎鎴愬姛";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                else
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 1;
+                    objJsonResult.Message = "鍒犻櫎澶辫触";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "鏃犳潈闄愬垹闄�";
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
+
         #endregion
         /// <summary>
         /// 杩斿洖鐢熶骇宸ュ簭娲惧伐鍗曞垪琛�
diff --git a/WebAPI/DLL/ClsSb_EquipRepairSendWorkBill.cs b/WebAPI/DLL/ClsSb_EquipRepairSendWorkBill.cs
new file mode 100644
index 0000000..facd0be
--- /dev/null
+++ b/WebAPI/DLL/ClsSb_EquipRepairSendWorkBill.cs
@@ -0,0 +1,229 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Text;
+using System.Data;
+
+namespace WebAPI.DLL
+{
+    public class ClsSb_EquipRepairSendWorkBill : DBUtility.ClsXt_BaseBill
+    {
+        public Models.ClsSb_EquipRepairSendWorkBillMain omodel = new Models.ClsSb_EquipRepairSendWorkBillMain();
+        public List<Models.ClsSb_EquipRepairSendWorkBillSub> DetailColl = new List<Models.ClsSb_EquipRepairSendWorkBillSub>();
+
+        public ClsSb_EquipRepairSendWorkBill()
+        {
+            base.MvarItemKeySub = "Sb_EquipRepairSendWorkBillSub";
+            base.MvarItemKeySub2 = "";
+            base.MvarItemKeySub3 = "";
+            base.MvarItemKeySub4 = "";
+            base.MvarItemKey = "Sb_EquipRepairSendWorkBillMain";
+            base.MvarReportTitle = "璁惧缁翠慨娲惧伐鍗�";
+            base.BillType = "3909";
+        }
+
+        #region 鍥哄畾浠g爜
+
+        ~ClsSb_EquipRepairSendWorkBill()
+        {
+            DetailColl = null;
+        }
+
+        #endregion   鑷畾涔夋柟娉�
+        //淇敼鍗曟嵁
+        public override bool ModifyBill(Int64 lngBillKey, ref string sReturn)
+        {
+            try
+            {
+                //
+                oCn.BeginTran();
+                //鏇存柊涓昏〃
+                oCn.RunProc("UpDate Sb_EquipRepairSendWorkBillMain set  " +
+                " HBillNo='" + omodel.HBillNo + "'" +  //鍥哄畾璧嬪��===============
+                ",HDate='" + omodel.HDate + "'" +
+                ",HYear='" + omodel.HYear.ToString() + "'" +
+                ",HPeriod='" + omodel.HPeriod.ToString() + "'" +
+                ",HRemark='" + omodel.HRemark + "'" +
+                ",HUpDater='" + DBUtility.ClsPub.CurUserName + "'" +
+                ",HUpDateDate=getdate()" +
+                //=========================================
+                ",HEquipID=" + omodel.HEquipID.ToString() +
+                ",HRepairID=" + omodel.HRepairID.ToString() +
+                ",HPlanTimes=" + omodel.HPlanTimes.ToString() +
+                ",HEmpID=" + omodel.HEmpID.ToString() +
+                ",HManagerID=" + omodel.HManagerID.ToString() +
+                ",HDeptID=" + omodel.HDeptID.ToString() +
+                ",HRepairPlanBeginDate='" + omodel.HRepairPlanBeginDate + "'" +
+                ",HRepairPlanEndDate='" + omodel.HRepairPlanEndDate + "'" +
+                ",HRepairContent='" + omodel.HRepairContent + "'" +
+                ",HCycleUnit='" + omodel.HCycleUnit + "'" +
+                ",HExplanation='" + omodel.HExplanation + "'" +
+                ",HInnerBillNo='" + omodel.HInnerBillNo + "'" +
+                " where HInterID=" + lngBillKey.ToString());                
+                //鍒犻櫎鍏宠仈
+                //DeleteRelation(ref sReturn, lngBillKey);
+                ////鍒犻櫎瀛愯〃
+                DeleteBillSub(lngBillKey);
+                ////鎻掑叆瀛愯〃
+                omodel.HInterID = lngBillKey;
+                foreach (Models.ClsSb_EquipRepairSendWorkBillSub oSub in DetailColl)
+                {
+                    oCn.RunProc("Insert into Sb_EquipRepairSendWorkBillSub " +
+                      " (HInterID,HEntryID,HCloseMan,HEntryCloseDate,HCloseType,HRemark" +
+                      ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" +
+                      ",HRepairID,HManagerID,HRepairExplanation" +
+                      ") 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.HRepairID.ToString() + "," + oSub.HManagerID.ToString() + ",'" + oSub.HRepairExplanation + "'" +
+                      ") ");
+                }
+                sReturn = "淇敼鍗曟嵁鎴愬姛锛�";
+                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 Sb_EquipRepairSendWorkBillMain" +
+                 "(HBillType,HBillSubType,HInterID,HBillNo,HDate" +
+                ",HYear,HPeriod,HRemark,HMaker,HMakeDate" +
+                ",HEquipID,HExplanation,HInnerBillNo,HRepairID,HEmpID" +
+                ",HManagerID,HDeptID,HRepairContent,HRepairPlanBeginDate,HRepairPlanEndDate" +
+                ",HPlanTimes,HCycleUnit" +
+                ") " +
+                " 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.HEquipID.ToString() + ",'" + omodel.HExplanation + "','" + omodel.HInnerBillNo + "'," + omodel.HRepairID.ToString() + "," + omodel.HEmpID.ToString() +
+                "," + omodel.HManagerID.ToString() + "," + omodel.HDeptID.ToString() + ",'" + omodel.HRepairContent + "','" + omodel.HRepairPlanBeginDate + "','" + omodel.HRepairPlanEndDate + "'" +
+                "," + omodel.HPlanTimes.ToString() + ",'" + omodel.HCycleUnit + "'" +
+                ") ");
+                ////鎻掑叆瀛愯〃
+                foreach (Models.ClsSb_EquipRepairSendWorkBillSub oSub in DetailColl)
+                {
+                    oCn.RunProc("Insert into Sb_EquipRepairSendWorkBillSub " +
+                      " (HInterID,HEntryID,HCloseMan,HEntryCloseDate,HCloseType,HRemark" +
+                      ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" +
+                      ",HRepairID,HManagerID,HRepairExplanation" +
+                      ") 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.HRepairID.ToString() + "," + oSub.HManagerID.ToString() + ",'" + oSub.HRepairExplanation + "'" +
+                      ") ");
+                }
+                sReturn = "鏂板鍗曟嵁鎴愬姛锛�";
+                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 Sb_EquipRepairSendWorkBillMain Where HInterID=" + lngBillKey.ToString(), "Sb_EquipRepairSendWorkBillMain");
+                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.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.HEquipID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HEquipID"]);
+                omodel.HRepairID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HRepairID"]);
+                omodel.HEmpID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HEmpID"]);
+                omodel.HPlanTimes = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HPlanTimes"]);
+                omodel.HManagerID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HManagerID"]);
+                omodel.HRepairPlanBeginDate = DBUtility.ClsPub.isDate(Ds.Tables[0].Rows[0]["HRepairPlanBeginDate"]);
+                omodel.HRepairPlanEndDate = DBUtility.ClsPub.isDate(Ds.Tables[0].Rows[0]["HRepairPlanEndDate"]);
+                omodel.HDeptID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HDeptID"]);
+                omodel.HRepairContent = Ds.Tables[0].Rows[0]["HRepairContent"].ToString().Trim();
+                omodel.HCycleUnit = Ds.Tables[0].Rows[0]["HCycleUnit"].ToString().Trim();
+                omodel.HExplanation = Ds.Tables[0].Rows[0]["HExplanation"].ToString().Trim();
+                omodel.HInnerBillNo = Ds.Tables[0].Rows[0]["HInnerBillNo"].ToString().Trim(); 
+                //寰幆
+                DataSet DsSub;
+                DsSub = oCn.RunProcReturn("Select * from Sb_EquipRepairSendWorkBillSub Where HInterID=" + lngBillKey.ToString() + " order by HEntryID ", "Sb_EquipRepairSendWorkBillSub");
+                DetailColl.Clear();//娓呯┖
+                for (int i = 0; i < DsSub.Tables[0].Rows.Count; i++)
+                {
+                    Models.ClsSb_EquipRepairSendWorkBillSub oSub = new Models.ClsSb_EquipRepairSendWorkBillSub();
+                    // 鍥哄畾璧嬪��===============================================
+                    oSub.HInterID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HInterID"]);
+                    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.HRepairID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HRepairID"]);
+                    oSub.HRepairExplanation = DsSub.Tables[0].Rows[i]["HRepairExplanation"].ToString().Trim();
+                    oSub.HManagerID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HManagerID"]);
+                   
+                    DetailColl.Add(oSub);
+                }
+                sReturn = "鏄剧ず鍗曟嵁鎴愬姛锛�";
+                return true;
+            }
+            catch (Exception e)
+            {
+                sReturn = e.Message;
+                throw (e);
+            }
+        }
+
+
+    }
+}
\ No newline at end of file
diff --git a/WebAPI/DLL/ClsSc_ProcessPlan.cs b/WebAPI/DLL/ClsSc_ProcessPlan.cs
new file mode 100644
index 0000000..059a1d7
--- /dev/null
+++ b/WebAPI/DLL/ClsSc_ProcessPlan.cs
@@ -0,0 +1,291 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Text;
+using System.Data;
+
+namespace WebAPI.DLL
+{
+    public  class ClsSc_ProcessPlan:DBUtility.ClsXt_BaseBill
+    {
+        public Models.ClsSc_ProcessPlanMain omodel = new Models.ClsSc_ProcessPlanMain();
+        public List<Models.ClsSc_ProcessPlanSub> DetailColl = new List<Models.ClsSc_ProcessPlanSub>();
+
+        public ClsSc_ProcessPlan()
+        {
+            base.MvarItemKeySub = "Sc_ProcessPlanSub";
+            base.MvarItemKeySub2 = "";
+            base.MvarItemKeySub3 = "";
+            base.MvarItemKeySub4 = "";
+            base.MvarItemKey="Sc_ProcessPlanMain";
+            base.MvarReportTitle="宸ュ簭璁″垝鍗�";
+            base.BillType="3715"; 
+        }
+
+        #region 鍥哄畾浠g爜
+
+        ~ClsSc_ProcessPlan()
+        {
+            DetailColl = null;
+        }
+       
+        #endregion   鑷畾涔夋柟娉�
+        //鍒犻櫎
+        public bool DeleteBill2(Int64 lngBillKey, ref string sReturn)
+        {
+            oK3Cn.RunProc("update ICMO set FCardClosed=1059 where finterid=" + lngBillKey.ToString());
+            return true;
+        }
+        //淇敼鍗曟嵁
+        public override bool ModifyBill(Int64 lngBillKey, ref string sReturn)
+        {
+            try
+            {
+                //
+                oCn.BeginTran();
+                //鏇存柊涓昏〃
+                oCn.RunProc("UpDate Sc_ProcessPlanMain set  " +
+                " HYear=" + omodel.HYear.ToString() +
+                ",HPeriod=" + omodel.HPeriod.ToString() +
+                ",HInterID=" + omodel.HInterID.ToString() +
+                ",HDate='" + omodel.HDate.ToShortDateString() + "'" +
+                ",HBillNo='" + omodel.HBillNo + "'" +
+                ",HBillStatus=" + omodel.HBillStatus.ToString() +
+                ",HCheckItemNowID=" + omodel.HCheckItemNowID.ToString() +
+                ",HCheckItemNextID=" + omodel.HCheckItemNextID.ToString() +
+                ",HICMOInterID=" + omodel.HICMOInterID.ToString() +
+                ",HICMOBillNo='" + omodel.HICMOBillNo + "'" +
+                ",HMaterID=" + omodel.HMaterID.ToString() +
+                ",HMaterNumber='" + omodel.HMaterNumber + "'" +
+                ",HUnitID=" + omodel.HUnitID.ToString() +
+                ",HUnitNumber='" + omodel.HUnitNumber + "'" +
+                ",HPlanQty=" + omodel.HPlanQty.ToString() +
+                ",HPlanBeginDate='" + omodel.HPlanBeginDate.ToShortDateString() + "'" +
+                ",HPlanEndDate='" + omodel.HPlanEndDate.ToShortDateString() + "'" +
+                ",HExplanation='" + omodel.HExplanation + "'" +
+                ",HRemark='" + omodel.HRemark + "'" +
+                ",HInnerBillNo='" + omodel.HInnerBillNo + "'" +
+                ",HUpDater='" + DBUtility.ClsPub.CurUserName + "'" +
+                ",HUpDateDate=getdate()" +
+                " where HInterID=" + lngBillKey.ToString());
+                //鍒犻櫎鍏宠仈
+                DeleteRelation(ref sReturn, lngBillKey);
+                //鍒犻櫎瀛愯〃
+                DeleteBillSub(lngBillKey);
+                //鎻掑叆瀛愯〃
+                omodel.HInterID = lngBillKey;
+                foreach (Models.ClsSc_ProcessPlanSub oSub in DetailColl)
+                {
+                    oCn.RunProc("Insert into Sc_ProcessPlanSub " +
+                  " (HInterID,HEntryID,HBillNo,HProcNo,HProcID,HWorkingQty" +
+                  ",HProcNumber,HWorkRemark,HCenterID,HDeptID,HDeptNumber" +
+                  ",HGroupID,HGroupNumber,HWorkerID,HWorkerNumber,HSourceID" +
+                  ",HQty,HTimeUnit,HPlanWorkTimes,HPlanBeginDate,HPlanEndDate" +
+                  ",HICMOInterID,HICMOBillNo,HSeOrderInterID,HSeOrderEntryID,HSeOrderBillNo" +
+                  ",HCloseMan,HCloseType,HRemark,HSourceInterID,HSourceEntryID" +
+                  ",HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" +
+                  ",HBeginDayQty,HBeginFixQty,HFixWorkDays,HTrunWorkDays,HReadyTimes" +
+                  ",HReadyTime,HQueueTime,HMoveTime,HBatchNo" +
+                  ") values("
+                  + omodel.HInterID.ToString() + "," + oSub.HEntryID.ToString() + ",'" + oSub.HBillNo + "'," + oSub.HProcNo.ToString() + "," + oSub.HProcID.ToString() + "," + oSub.HWorkingQty.ToString() +
+                  ",'" + oSub.HProcNumber + "','" + oSub.HWorkRemark + "'," + oSub.HCenterID.ToString() +  "," + oSub.HDeptID.ToString()  + ",'" + oSub.HDeptNumber + "'" +
+                  "," + oSub.HGroupID.ToString() + ",'" + oSub.HGroupNumber + "'," + oSub.HWorkerID.ToString() + ",'" + oSub.HWorkerNumber + "'," + oSub.HSourceID.ToString() +
+                  "," + oSub.HQty.ToString() + ",'" + oSub.HTimeUnit + "'," + oSub.HPlanWorkTimes.ToString() + ",'" + oSub.HPlanBeginDate + "','" + oSub.HPlanEndDate +"'"+
+                  "," + oSub.HICMOInterID.ToString() + ",'" + oSub.HICMOBillNo + "'," + oSub.HSeOrderInterID.ToString() + "," + oSub.HSeOrderEntryID.ToString() + ",'" + oSub.HSeOrderBillNo +"'"+
+                  ",'" + oSub.HCloseMan + "'," + 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.HBeginDayQty.ToString() + "," + oSub.HBeginFixQty.ToString() + "," + oSub.HFixWorkDays.ToString() + "," + oSub.HTrunWorkDays.ToString() + "," + oSub.HReadyTimes.ToString() +
+                  "," + oSub.HReadyTime.ToString() + "," + oSub.HQueueTime.ToString() + "," + oSub.HMoveTime.ToString() + ",'" + oSub.HBatchNo + "'" + 
+                  ") ");
+                }
+                sReturn = "淇敼鍗曟嵁鎴愬姛锛�";
+                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_ProcessPlanMain   " +
+                "(HYear,HPeriod,HBillType,HBillSubType,HInterID" +
+                ",HDate,HBillNo,HBillStatus,HCheckItemNowID,HCheckItemNextID" +
+                ",HICMOInterID,HICMOBillNo,HMaterID,HMaterNumber,HUnitID" +
+                ",HUnitNumber,HPlanQty,HPlanBeginDate,HPlanEndDate,HExplanation" +
+                ",HRemark,HInnerBillNo,HMaker,HMakeDate" +
+                ") " +
+                " values(" + omodel.HYear.ToString() + "," + omodel.HPeriod.ToString() + ",'" + this.BillType + "','" + omodel.HBillSubType + "'," + omodel.HInterID.ToString() +
+                ",'" + omodel.HDate.ToShortDateString() + "','" + omodel.HBillNo + "'," + omodel.HBillStatus.ToString() + "," + omodel.HCheckItemNowID.ToString() + "," + omodel.HCheckItemNextID.ToString() +
+                "," + omodel.HICMOInterID.ToString() + ",'" + omodel.HICMOBillNo + "'," + omodel.HMaterID.ToString() + ",'" + omodel.HMaterNumber + "'," + omodel.HUnitID.ToString() +
+                ",'" + omodel.HUnitNumber + "'," + omodel.HPlanQty.ToString() + ",'" + omodel.HPlanBeginDate.ToShortDateString() + "','" + omodel.HPlanEndDate.ToShortDateString() + "','" + omodel.HExplanation +"'"+
+                ",'" + omodel.HRemark + "','" + omodel.HInnerBillNo + "','" + DBUtility.ClsPub.CurUserName + "',getdate()" + 
+                ") ");
+                //鎻掑叆瀛愯〃
+                foreach (Models.ClsSc_ProcessPlanSub oSub in DetailColl)
+                {
+                    oCn.RunProc("Insert into Sc_ProcessPlanSub " +
+                  " (HInterID,HEntryID,HBillNo,HProcNo,HProcID,HWorkingQty" +
+                  ",HProcNumber,HWorkRemark,HCenterID,HDeptID,HDeptNumber" +
+                  ",HGroupID,HGroupNumber,HWorkerID,HWorkerNumber,HSourceID" +
+                  ",HQty,HTimeUnit,HPlanWorkTimes,HPlanBeginDate,HPlanEndDate" +
+                  ",HICMOInterID,HICMOBillNo,HSeOrderInterID,HSeOrderEntryID,HSeOrderBillNo" +
+                  ",HCloseMan,HCloseType,HRemark,HSourceInterID,HSourceEntryID" +
+                  ",HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" +
+                  ",HBeginDayQty,HBeginFixQty,HFixWorkDays,HTrunWorkDays,HReadyTimes" +
+                  ",HReadyTime,HQueueTime,HMoveTime,HBatchNo" +
+                  ") values("
+                  + omodel.HInterID.ToString() + "," + oSub.HEntryID.ToString() + ",'" + oSub.HBillNo + "'," + oSub.HProcNo.ToString() + "," + oSub.HProcID.ToString() + "," + oSub.HWorkingQty.ToString() +
+                  ",'" + oSub.HProcNumber + "','" + oSub.HWorkRemark + "'," + oSub.HCenterID.ToString() + "," + oSub.HDeptID.ToString() + ",'" + oSub.HDeptNumber + "'" +
+                  "," + oSub.HGroupID.ToString() + ",'" + oSub.HGroupNumber + "'," + oSub.HWorkerID.ToString() + ",'" + oSub.HWorkerNumber + "'," + oSub.HSourceID.ToString() +
+                  "," + oSub.HQty.ToString() + ",'" + oSub.HTimeUnit + "'," + oSub.HPlanWorkTimes.ToString() + ",'" + oSub.HPlanBeginDate + "','" + oSub.HPlanEndDate + "'" +
+                  "," + oSub.HICMOInterID.ToString() + ",'" + oSub.HICMOBillNo + "'," + oSub.HSeOrderInterID.ToString() + "," + oSub.HSeOrderEntryID.ToString() + ",'" + oSub.HSeOrderBillNo + "'" +
+                  ",'" + oSub.HCloseMan + "'," + 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.HBeginDayQty.ToString() + "," + oSub.HBeginFixQty.ToString() + "," + oSub.HFixWorkDays.ToString() + "," + oSub.HTrunWorkDays.ToString() + "," + oSub.HReadyTimes.ToString() +
+                  "," + oSub.HReadyTime.ToString() + "," + oSub.HQueueTime.ToString() + "," + oSub.HMoveTime.ToString() + ",'" +oSub.HBatchNo + "'" +
+                  ") ");
+                }
+                sReturn = "鏂板鍗曟嵁鎴愬姛锛�";
+                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_ProcessPlanMain Where HInterID=" + lngBillKey.ToString(), "Sc_ProcessPlanMain");
+                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 = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBillNo"]);
+                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.HICMOInterID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HICMOInterID"]);
+                omodel.HICMOBillNo = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HICMOBillNo"]);
+                omodel.HMaterID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HMaterID"]);
+                omodel.HMaterNumber = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HMaterNumber"]);
+                omodel.HUnitID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HUnitID"]);
+                omodel.HUnitNumber = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HUnitNumber"]);
+                omodel.HPlanQty = DBUtility.ClsPub.isDoule(Ds.Tables[0].Rows[0]["HPlanQty"]);
+                omodel.HPlanBeginDate = DBUtility.ClsPub.isDate(Ds.Tables[0].Rows[0]["HPlanBeginDate"]);
+                omodel.HPlanEndDate = DBUtility.ClsPub.isDate(Ds.Tables[0].Rows[0]["HPlanEndDate"]);
+                omodel.HExplanation = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HExplanation"]);
+                omodel.HRemark = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HRemark"]);
+                omodel.HInnerBillNo = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HInnerBillNo"]);
+                //
+                omodel.HBacker = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBacker"]);
+                omodel.HBackDate = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBackDate"]);
+                omodel.HChecker = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HChecker"]);
+                omodel.HCheckDate = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HCheckDate"]);
+                omodel.HMaker = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HMaker"]);
+                omodel.HMakeDate = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HMakeDate"]);
+                omodel.HUpDater = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HUpDater"]);
+                omodel.HUpDateDate = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HUpDateDate"]);
+                omodel.HCloseMan = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HCloseMan"]);
+                omodel.HCloseDate = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HCloseDate"]);
+                omodel.HCloseType = DBUtility.ClsPub.isBool(Ds.Tables[0].Rows[0]["HCloseType"]);
+                omodel.HDeleteMan = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HDeleteMan"]);
+                omodel.HDeleteDate = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HDeleteDate"]);
+                //寰幆
+                DataSet DsSub ;
+                DsSub = oCn.RunProcReturn("Select * from Sc_ProcessPlanSub Where HInterID=" + lngBillKey.ToString() + " order by HEntryID ", "Sc_ProcessPlanSub");
+                DetailColl.Clear();//娓呯┖
+                for (int i = 0; i < DsSub.Tables[0].Rows.Count; i++)
+                {
+                    Models.ClsSc_ProcessPlanSub oSub = new Models.ClsSc_ProcessPlanSub();
+                    oSub.HInterID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HInterID"]);
+                    oSub.HEntryID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HEntryID"]);
+                    //
+                    oSub.HBillNo = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HBillNo"]);
+                    oSub.HBatchNo = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HBatchNo"]);
+                    oSub.HProcNo = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HProcNo"]);
+                    oSub.HProcID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HProcID"]);
+                    oSub.HProcNumber = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HProcNumber"]);
+                    oSub.HWorkRemark = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HWorkRemark"]);
+                    oSub.HCenterID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HCenterID"]);
+                    oSub.HDeptID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HDeptID"]);
+                    oSub.HDeptNumber = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HDeptNumber"]);
+                    oSub.HGroupID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HGroupID"]);
+                    oSub.HGroupNumber = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HGroupNumber"]);
+                    oSub.HWorkerID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HWorkerID"]);
+                    oSub.HWorkerNumber = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HWorkerNumber"]);
+                    oSub.HSourceID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSourceID"]);
+                    oSub.HQty = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HQty"]);
+                    oSub.HTimeUnit = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HTimeUnit"]);
+                    oSub.HPlanWorkTimes = DBUtility.ClsPub.isSingle(DsSub.Tables[0].Rows[i]["HPlanWorkTimes"]);
+                    oSub.HPlanBeginDate = DBUtility.ClsPub.isDate(DsSub.Tables[0].Rows[i]["HPlanBeginDate"]);
+                    oSub.HPlanEndDate = DBUtility.ClsPub.isDate(DsSub.Tables[0].Rows[i]["HPlanEndDate"]);
+                    oSub.HICMOInterID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HICMOInterID"]);
+                    oSub.HICMOBillNo = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HICMOBillNo"]);
+                    oSub.HSeOrderInterID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSeOrderInterID"]);
+                    oSub.HSeOrderEntryID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSeOrderEntryID"]);
+                    oSub.HSeOrderBillNo = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HSeOrderBillNo"]);
+                    oSub.HWorkingQty = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HWorkingQty"]);
+                    //
+                    oSub.HCloseMan = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HCloseMan"]);
+                    oSub.HCloseType = DBUtility.ClsPub.isBool(DsSub.Tables[0].Rows[i]["HCloseType"]);
+                    oSub.HRemark = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HRemark"]);
+                    oSub.HSourceInterID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSourceInterID"]);
+                    oSub.HSourceEntryID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSourceEntryID"]);
+                    oSub.HSourceBillNo = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HSourceBillNo"]);
+                    oSub.HSourceBillType = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HSourceBillType"]);
+                    oSub.HRelationQty = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HRelationQty"]);
+                    oSub.HRelationMoney = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HRelationMoney"]);
+                    oSub.HBeginDayQty = DBUtility.ClsPub.isSingle(DsSub.Tables[0].Rows[i]["HBeginDayQty"]);
+                    oSub.HBeginFixQty = DBUtility.ClsPub.isSingle(DsSub.Tables[0].Rows[i]["HBeginFixQty"]);
+                    oSub.HFixWorkDays = DBUtility.ClsPub.isSingle(DsSub.Tables[0].Rows[i]["HFixWorkDays"]);
+                    oSub.HTrunWorkDays = DBUtility.ClsPub.isSingle(DsSub.Tables[0].Rows[i]["HTrunWorkDays"]);
+                    oSub.HReadyTimes = DBUtility.ClsPub.isSingle(DsSub.Tables[0].Rows[i]["HReadyTimes"]);
+                    oSub.HReadyTime = DBUtility.ClsPub.isSingle(DsSub.Tables[0].Rows[i]["HReadyTime"]);
+                    oSub.HQueueTime = DBUtility.ClsPub.isSingle(DsSub.Tables[0].Rows[i]["HQueueTime"]);
+                    oSub.HMoveTime = DBUtility.ClsPub.isSingle(DsSub.Tables[0].Rows[i]["HMoveTime"]);
+                    DetailColl.Add(oSub);
+                }
+                sReturn = "鏄剧ず鍗曟嵁鎴愬姛锛�";
+                return true;
+            }
+            catch (Exception e)
+            {
+                sReturn = e.Message;
+                throw (e);
+            }
+        }
+       
+        
+
+
+    }
+
+}
diff --git a/WebAPI/Models/ClsSb_EquipRepairSendWorkBillMain.cs b/WebAPI/Models/ClsSb_EquipRepairSendWorkBillMain.cs
new file mode 100644
index 0000000..209894b
--- /dev/null
+++ b/WebAPI/Models/ClsSb_EquipRepairSendWorkBillMain.cs
@@ -0,0 +1,23 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace WebAPI.Models
+{
+    public class ClsSb_EquipRepairSendWorkBillMain : DBUtility.ClsXt_BaseBillMain
+    {        
+        public Int64 HEquipID;
+        public Int64 HRepairID;
+        public Int64 HPlanTimes;    
+        public DateTime HRepairPlanBeginDate;
+        public DateTime HRepairPlanEndDate;
+        public Int64 HEmpID;      
+        public Int64 HManagerID;
+        public Int64 HDeptID;
+        public string HCycleUnit;
+        public string HRepairContent;
+        public string HExplanation;
+        public string HInnerBillNo;
+
+    }
+}
diff --git a/WebAPI/Models/ClsSb_EquipRepairSendWorkBillSub.cs b/WebAPI/Models/ClsSb_EquipRepairSendWorkBillSub.cs
new file mode 100644
index 0000000..a3dde88
--- /dev/null
+++ b/WebAPI/Models/ClsSb_EquipRepairSendWorkBillSub.cs
@@ -0,0 +1,16 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace WebAPI.Models
+{
+    public class ClsSb_EquipRepairSendWorkBillSub : DBUtility.ClsXt_BaseBillSub
+    {
+        //============
+        public Int64 HRepairID;
+        public string HRepairExplanation;
+        public Int64 HManagerID;
+      
+      
+    }
+}
diff --git a/WebAPI/WebAPI.csproj b/WebAPI/WebAPI.csproj
index 2efb971..df73b21 100644
--- a/WebAPI/WebAPI.csproj
+++ b/WebAPI/WebAPI.csproj
@@ -479,6 +479,7 @@
     <Compile Include="DLL\ClsSb_EquipMaintainBill.cs" />
     <Compile Include="DLL\ClsSb_EquipMaintainRuleBill.cs" />
     <Compile Include="DLL\ClsSb_EquipRepairCheckBill.cs" />
+    <Compile Include="DLL\ClsSb_EquipRepairSendWorkBill.cs" />
     <Compile Include="DLL\ClsSb_EquipRepairWorkBill.cs" />
     <Compile Include="DLL\ClsSb_MouldRepairWorkBill.cs" />
     <Compile Include="DLL\ClsSc_ICMOBillWorkQtyStatus_Tmp.cs" />
@@ -494,6 +495,7 @@
     <Compile Include="DLL\ClsSc_MouldOtherInBill.cs" />
     <Compile Include="DLL\ClsSc_MouldMoveStockStepOutBill.cs" />
     <Compile Include="DLL\ClsSc_PackUnionBill.cs" />
+    <Compile Include="DLL\ClsSc_ProcessPlan.cs" />
     <Compile Include="DLL\ClsWW_PPBomBill.cs" />
     <Compile Include="DLL\宸ヨ祫绠$悊\ClsPay_GroupBalBill.cs" />
     <Compile Include="DLL\宸ヨ祫绠$悊\ClsGy_GroupEmpBill.cs" />
@@ -502,6 +504,8 @@
     <Compile Include="InvokeHelper.cs" />
     <Compile Include="Log.cs" />
     <Compile Include="Models\ClsGy_StockCheckItemBill.cs" />
+    <Compile Include="Models\ClsSb_EquipRepairSendWorkBillMain.cs" />
+    <Compile Include="Models\ClsSb_EquipRepairSendWorkBillSub.cs" />
     <Compile Include="Models\ClsSb_MouldRepairWorkBillMain.cs" />
     <Compile Include="Models\ClsSb_MouldRepairWorkBillSub.cs" />
     <Compile Include="Models\ClsSc_PackUnionBillMain.cs" />

--
Gitblit v1.9.1