From ad5afdbba44566c7625d48791ff479c797cb53c0 Mon Sep 17 00:00:00 2001
From: ch <37327@LLOOCCY>
Date: 星期一, 24 五月 2021 08:43:23 +0800
Subject: [PATCH] 工序检验单 列表-合并

---
 WebAPI/DLL/ClsQC_PatrolProcCheckBill.cs                     |  441 ++++++++++++
 WebAPI/ListModels.cs                                        |  124 +++
 WebAPI/Controllers/QC_ManagementController.cs               | 1029 +++++++++++++++++++++++++++++
 WebAPI/Controllers/Sc_CheckToolsRepairWorkBillController.cs |  286 ++++++++
 WebAPI/Properties/PublishProfiles/API.pubxml.user           |  132 +-
 WebAPI/Service/LuBaoSevice.cs                               |   83 ++
 WebAPI/WebAPI.csproj                                        |    1 
 7 files changed, 2,017 insertions(+), 79 deletions(-)

diff --git a/WebAPI/Controllers/QC_ManagementController.cs b/WebAPI/Controllers/QC_ManagementController.cs
index 9d9d419..fdde39f 100644
--- a/WebAPI/Controllers/QC_ManagementController.cs
+++ b/WebAPI/Controllers/QC_ManagementController.cs
@@ -95,6 +95,8 @@
             return objJsonResult;
         }
         #endregion
+
+        #region 鏌ヨ鍒楄〃鏂规硶
         /// <summary>
         /// 杩斿洖妫�楠屾柟妗堝崟鍒楄〃
         /// </summary>
@@ -110,11 +112,11 @@
                 SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                 if (sqlWhere == null || sqlWhere.Equals(""))
                 {
-                    ds = oCN.RunProcReturn("select top 500 * from h_v_Gy_QCCheckProjectList ", "h_v_Gy_QCCheckProjectList");
+                    ds = oCN.RunProcReturn("select top 500 * from h_v_Gy_QCCheckProjectList where HBillStatus>-1 ", "h_v_Gy_QCCheckProjectList");
                 }
                 else
                 {
-                    string sql1 = "select * from h_v_Gy_QCCheckProjectList where 1 = 1 ";
+                    string sql1 = "select * from h_v_Gy_QCCheckProjectList where HBillStatus>-1 ";
                     string sql = sql1 + sqlWhere;
                     ds = oCN.RunProcReturn(sql, "h_v_Gy_QCCheckProjectList");
                 }
@@ -145,11 +147,11 @@
                 SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                 if (sqlWhere == null || sqlWhere.Equals(""))
                 {
-                    ds = oCN.RunProcReturn("select top 500 * from h_v_QC_POStockInCheckBillList ", "h_v_QC_POStockInCheckBillList");
+                    ds = oCN.RunProcReturn("select top 500 * from h_v_QC_POStockInCheckBillList where 鍏抽棴浜�='' ", "h_v_QC_POStockInCheckBillList");
                 }
                 else
                 {
-                    string sql1 = "select * from h_v_QC_POStockInCheckBillList where 1 = 1 ";
+                    string sql1 = "select * from h_v_QC_POStockInCheckBillList where 鍏抽棴浜�='' ";
                     string sql = sql1 + sqlWhere;
                     ds = oCN.RunProcReturn(sql, "h_v_QC_POStockInCheckBillList");
                 }
@@ -180,11 +182,11 @@
                 SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                 if (sqlWhere == null || sqlWhere.Equals(""))
                 {
-                    ds = oCN.RunProcReturn("select top 500 * from h_v_QC_FirstPieceCheckBillList ", "h_v_QC_FirstPieceCheckBillList");
+                    ds = oCN.RunProcReturn("select top 500 * from h_v_QC_FirstPieceCheckBillList  where  鍏抽棴浜�='' ", "h_v_QC_FirstPieceCheckBillList");
                 }
                 else
                 {
-                    string sql1 = "select * from h_v_QC_FirstPieceCheckBillList where 1 = 1 ";
+                    string sql1 = "select * from h_v_QC_FirstPieceCheckBillList where 鍏抽棴浜�='' ";
                     string sql = sql1 + sqlWhere;
                     ds = oCN.RunProcReturn(sql, "h_v_QC_FirstPieceCheckBillList");
                 }
@@ -215,11 +217,11 @@
                 SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                 if (sqlWhere == null || sqlWhere.Equals(""))
                 {
-                    ds = oCN.RunProcReturn("select top 500 * from h_v_QC_PatrolProcCheckBillList ", "h_v_QC_PatrolProcCheckBillList");
+                    ds = oCN.RunProcReturn("select top 500 * from h_v_QC_PatrolProcCheckBillList where  鍏抽棴浜�=''", "h_v_QC_PatrolProcCheckBillList");
                 }
                 else
                 {
-                    string sql1 = "select * from h_v_QC_PatrolProcCheckBillList where 1 = 1 ";
+                    string sql1 = "select * from h_v_QC_PatrolProcCheckBillList where 鍏抽棴浜�='' ";
                     string sql = sql1 + sqlWhere;
                     ds = oCN.RunProcReturn(sql, "h_v_QC_PatrolProcCheckBillList");
                 }
@@ -236,6 +238,1017 @@
         }
 
 
+        /// <summary>
+        /// 妫�楠屾柟妗堣幏鍙栦俊鎭�
+        /// </summary>
+        /// <returns></returns>
+        [Route("GetQCCheckProjectDetail")]
+        [HttpGet]
+        public ApiResult<DataSet> GetQCCheckProjectDetail(string HID)
+        {
+            var model = LuBaoSevice.GetCheckProjectDetail(HID);
+            return model;
+        }
+
+        /// <summary>
+        /// 鏉ユ枡妫�楠屽崟鑾峰彇淇℃伅
+        /// </summary>
+        /// <returns></returns>
+        [Route("GetPOStockInCheckDetail")]
+        [HttpGet]
+        public ApiResult<DataSet> GetPOStockInCheckDetail(string HID)
+        {
+            var model = LuBaoSevice.GetPOStockInCheckBillDetail(HID);
+            return model;
+        }
+
+        /// <summary>
+        /// 棣栦欢妫�楠屽崟鑾峰彇淇℃伅
+        /// </summary>
+        /// <returns></returns>
+        [Route("GetQC_FirstPieceCheckDetail")]
+        [HttpGet]
+        public ApiResult<DataSet> GetQC_FirstPieceCheckDetail(string HID)
+        {
+            var model = LuBaoSevice.GetQC_FirstPieceCheckBillDetail(HID);
+            return model;
+        }
+
+
+        /// <summary>
+        /// 宸℃鍗曡幏鍙栦俊鎭�
+        /// </summary>
+        /// <returns></returns>
+        [Route("GetQC_PatrolProcCheckDetail")]
+        [HttpGet]
+        public ApiResult<DataSet> GetQC_PatrolProcCheckDetail(string HID)
+        {
+            var model = LuBaoSevice.GetQC_PatrolProcCheckBillDetail(HID);
+            return model;
+        }
+
+
+        /// <summary>
+        /// 杩斿洖妫�楠屾柟妗堝崟瀛愯〃璇︽儏
+        /// </summary>
+        /// <param name="sWhere"></param>
+        /// <returns></returns>
+        [Route("MES_QC_CheckProjectDetail_Json")]
+        [HttpGet]
+        public object MES_QC_CheckProjectDetail_Json(string sqlWhere)
+        {
+            DataSet ds;
+            try
+            {
+                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+                if (sqlWhere == null || sqlWhere.Equals(""))
+                {
+                    ds = oCN.RunProcReturn("select HPrjNo,HQCCheckItemID,HQCStd,HQCStdMax,HQCUnit,HRemark from Gy_QCCheckProjectSub", "Gy_QCCheckProjectSub");
+                }
+                else
+                {
+                    string sql1 = "select HPrjNo,HQCCheckItemID,HQCStd,HQCStdMax,HQCUnit,HRemark from Gy_QCCheckProjectSub where 1 = 1 ";
+                    string sql = sql1 + sqlWhere;
+                    ds = oCN.RunProcReturn(sql, "Gy_QCCheckProjectSub");
+                }
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+            return GetObjectJson(ds);
+        }
+
+
+        /// <summary>
+        /// 杩斿洖鏉ユ枡妫�楠屽崟瀛愯〃璇︽儏
+        /// </summary>
+        /// <param name="sWhere"></param>
+        /// <returns></returns>
+        [Route("MES_QC_POStockInCheckDetail_Json")]
+        [HttpGet]
+        public object MES_QC_POStockInCheckDetail_Json(string sqlWhere)
+        {
+            DataSet ds;
+            try
+            {
+                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+                if (sqlWhere == null || sqlWhere.Equals(""))
+                {
+                    ds = oCN.RunProcReturn("select * from h_v_QC_Edit_POStockInCheckBillList", "h_v_QC_Edit_POStockInCheckBillList");
+                }
+                else
+                {
+                    string sql1 = "select * from h_v_QC_Edit_POStockInCheckBillList where 1 = 1 ";
+                    string sql = sql1 + sqlWhere;
+                    ds = oCN.RunProcReturn(sql, "h_v_QC_Edit_POStockInCheckBillList");
+                }
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+            return GetObjectJson(ds);
+        }
+
+        /// <summary>
+        /// 杩斿洖棣栦欢妫�楠屽崟瀛愯〃璇︽儏
+        /// </summary>
+        /// <param name="sWhere"></param>
+        /// <returns></returns>
+        [Route("MES_QC_FirstPieceCheckDetail_Json")]
+        [HttpGet]
+        public object MES_QC_FirstPieceCheckDetail_Json(string sqlWhere)
+        {
+            DataSet ds;
+            try
+            {
+                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+                if (sqlWhere == null || sqlWhere.Equals(""))
+                {
+                    ds = oCN.RunProcReturn("select * from h_v_QC_Edit_FirstPieceCheckBillList", "h_v_QC_Edit_FirstPieceCheckBillList");
+                }
+                else
+                {
+                    string sql1 = "select * from h_v_QC_Edit_FirstPieceCheckBillList where 1 = 1 ";
+                    string sql = sql1 + sqlWhere;
+                    ds = oCN.RunProcReturn(sql, "h_v_QC_Edit_FirstPieceCheckBillList");
+                }
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+            return GetObjectJson(ds);
+        }
+
+
+        /// <summary>
+        /// 杩斿洖宸℃鍗曞瓙琛ㄨ鎯�
+        /// </summary>
+        /// <param name="sWhere"></param>
+        /// <returns></returns>
+        [Route("MES_QC_PatrolProcCheckDetail_Json")]
+        [HttpGet]
+        public object MES_QC_PatrolProcCheckDetail_Json(string sqlWhere)
+        {
+            DataSet ds;
+            try
+            {
+                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+                if (sqlWhere == null || sqlWhere.Equals(""))
+                {
+                    ds = oCN.RunProcReturn("select * from h_v_QC_Edit_PatrolProcCheckBillList", "h_v_QC_Edit_PatrolProcCheckBillList");
+                }
+                else
+                {
+                    string sql1 = "select * from h_v_QC_Edit_PatrolProcCheckBillList where 1 = 1 ";
+                    string sql = sql1 + sqlWhere;
+                    ds = oCN.RunProcReturn(sql, "h_v_QC_Edit_PatrolProcCheckBillList");
+                }
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+            return GetObjectJson(ds);
+        }
+
+
+        #endregion
+
+        #region 淇濆瓨/缂栬緫/鍒犻櫎鏂规硶
+
+        #region 妫�楠屾柟妗�
+        /// <summary>
+        /// 淇濆瓨妫�楠屾柟妗�
+        /// </summary>
+        /// <param name="msg"></param>
+        /// <returns></returns>
+        [Route("SaveQCCheckProjectList")]
+        [HttpPost]
+        public object SaveQCCheckProjectList([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 UserName = "";
+            ListModels oListModels = new ListModels();
+            try
+            {
+                DAL.ClsGy_QCCheckProjectMain oBill = new DAL.ClsGy_QCCheckProjectMain();
+                List<Model.ClsGy_QCCheckProjectMain> lsmain = new List<Model.ClsGy_QCCheckProjectMain>();
+                msg2 = msg2.Replace("\\", "");
+                msg2 = msg2.Replace("\n", "");  //\n
+                lsmain = oListModels.getObjectByJson_Gy_QCCheckProjectMain(msg2);
+                foreach (Model.ClsGy_QCCheckProjectMain oItem in lsmain)
+                {
+                    //oItem.HMaker = "";
+                    UserName = oItem.HMaker;
+                    oItem.HMakeDate = DBUtility.ClsPub.isStrNull(DateTime.Now.ToString("yyyy-MM-dd"));
+                    oItem.HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year);
+                    oItem.HDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd"));
+                    oItem.HBillType = "3302";
+                    oItem.HBillSubType = "3302";
+                    oItem.HBillStatus = 0;
+                    oItem.HPeriod = 0;
+                    oItem.HMaker = "";
+                    oItem.HStandard = false;
+                    oItem.HMainSourceInterID = oItem.HInterID;
+                    oItem.HMaterTypeID = 0;
+                    //oItem.HInterID = DBUtility.ClsPub.CreateBillID_SRMProd("1103", ref DBUtility.ClsPub.sExeReturnInfo);
+                    if (DBUtility.ClsPub.isStrNull(oItem.HDate) == "")
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "淇濆瓨澶辫触锛佹病鏈夊崟鎹棩鏈燂紝鏃犳硶淇濆瓨锛�";
+                        objJsonResult.data = 1;
+                        return objJsonResult;
+                    }
+                    oBill.omodel = oItem;
+                }
+                //琛ㄤ綋鏁版嵁
+                //鎸� },{鏉ユ媶鍒嗘暟缁� //鍘绘帀銆愬拰銆�
+                msg3 = msg3.Substring(1, msg3.Length - 2);
+                msg3 = msg3.Replace("\\", "");
+                msg3 = msg3.Replace("\n", "");  //\n
+                //msg2 = msg2.Replace("'", "鈥�");
+                List<Model.ClsGy_QCCheckProjectSub> ls = new List<Model.ClsGy_QCCheckProjectSub>();
+                ls = oListModels.getObjectByJson_ClsGy_QCCheckProjectSub(msg3);
+                int i = 0;
+                foreach (Model.ClsGy_QCCheckProjectSub oItemSub in ls)
+                {
+                    oItemSub.HBillNo_bak = oBill.omodel.HBillNo;//鍗曟嵁鍙凤紙澶囦唤锛屼互鍏嶅唴鐮佷涪澶憋紝鎵句笉鍒板搴斾富琛級
+                    i++;
+                    if (string.IsNullOrWhiteSpace(oItemSub.HBillNo_bak))
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "淇濆瓨澶辫触锛佹病澶囦唤鍗曟嵁鍙凤紝鏃犳硶淇濆瓨锛�";
+                        objJsonResult.data = 1;
+                        return objJsonResult;
+                    }
+                    oItemSub.HSourceEntryID =0;
+                    oItemSub.HSourceInterID =0;
+                    oItemSub.HEntryID = i;
+                    oItemSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now);
+                    oItemSub.HCloseType = false;
+                    oItemSub.HSourceBillNo = "";
+                    oItemSub.HSourceBillType = "";
+                    oItemSub.HRelationQty = 0;
+                    oItemSub.HRelationMoney = 0;
+                    oItemSub.HCloseMan = "";
+                    oItemSub.HRemark = "";
+                    oBill.DetailColl.Add(oItemSub);
+
+                }
+                //淇濆瓨
+                //淇濆瓨瀹屾瘯鍚庡鐞�
+                bool bResult;
+                if (oBill.omodel.HInterID == 0)
+                {
+                    // bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
+                    bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
+                }
+                else
+                {
+                    bResult = oBill.ModifyBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo);
+                }
+                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;
+            }
+        }
+
+        /// <summary>
+        /// 妫�楠屾柟妗堥�昏緫鍒犻櫎鍔熻兘
+        /// </summary>
+        /// <returns></returns>
+        [Route("DeltetQCCheckProject")]
+        [HttpGet]
+        public object DeltetQCCheckProject(string HInterID)
+        {
+            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(HInterID))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "HInterID涓虹┖锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                oCN.BeginTran();//寮�濮嬩簨鍔�
+                ds = oCN.RunProcReturn("select * from Gy_QCCheckProjectMain where HInterID=" + HInterID, "Gy_QCCheckProjectMain");
+                DataSet ds2 = oCN.RunProcReturn("select * from Gy_QCCheckProjectSub where HInterID=" + HInterID, "Gy_QCCheckProjectSub");
+                if (ds == null || ds.Tables[0].Rows.Count == 0 || ds2==null || ds2.Tables[0].Rows.Count == 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "娌℃湁杩欎釜鍗曟嵁锛屾棤娉曞垹闄わ紒";
+                    objJsonResult.data = null;
+                    return objJsonResult; ;
+                }
+                int HBillStatus = Convert.ToInt32(ds.Tables[0].Rows[0]["HBillStatus"]);
+                int HPrjNo= Convert.ToInt32(ds2.Tables[0].Rows[0]["HPrjNo"]);
+                if (HBillStatus < 0 || HPrjNo<0)
+                {
+                    oCN.RollBack();//鍥炴粴浜嬪姟
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鍗曟嵁宸插垹闄ゆ棤娉曞啀娆″垹闄わ紒";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+             
+                oCN.RunProc("update Gy_QCCheckProjectMain set HBillStatus=-1 where HInterID="+HInterID);
+                oCN.RunProc("update Gy_QCCheckProjectSub set HPrjNo=-1 where HInterID=" + HInterID);
+                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 鏉ユ枡妫�楠�
+        /// <summary>
+        /// 淇濆瓨鏉ユ枡妫�楠屽崟
+        /// </summary>
+        /// <param name="msg"></param>
+        /// <returns></returns>
+        [Route("SaveQC_POStockInCheckList")]
+        [HttpPost]
+        public object SaveQC_POStockInCheckList([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 UserName = "";
+            ListModels oListModels = new ListModels();
+            try
+            {
+                DAL.ClsQC_POStockInCheckBill oBill = new DAL.ClsQC_POStockInCheckBill();
+                List<Model.ClsQC_POStockInCheckBillMain> lsmain = new List<Model.ClsQC_POStockInCheckBillMain>();
+                msg2 = msg2.Replace("\\", "");
+                msg2 = msg2.Replace("\n", "");  //\n
+                lsmain = oListModels.getObjectByJson_QC_POStockInCheckBillMain(msg2);
+                foreach (Model.ClsQC_POStockInCheckBillMain oItem in lsmain)
+                {
+                    //oItem.HMaker = "";
+                    UserName = oItem.HMaker;
+                    oItem.HMakeDate = DBUtility.ClsPub.isStrNull(DateTime.Now.ToString("yyyy-MM-dd"));
+                    oItem.HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year);
+                    oItem.HDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd"));
+                    oItem.HBillType = "7503";
+                    oItem.HBillSubType = "7503";
+                    oItem.HBillStatus = 0;
+                    oItem.HPeriod = 0;
+                    oItem.HMaker = "";
+                    oItem.HMainSourceInterID = oItem.HInterID;
+
+                    //oItem.HInterID = DBUtility.ClsPub.CreateBillID_SRMProd("1103", ref DBUtility.ClsPub.sExeReturnInfo);
+                    if (DBUtility.ClsPub.isStrNull(oItem.HDate) == "")
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "淇濆瓨澶辫触锛佹病鏈夊崟鎹棩鏈燂紝鏃犳硶淇濆瓨锛�";
+                        objJsonResult.data = 1;
+                        return objJsonResult;
+                    }
+                    oBill.omodel = oItem;
+                }
+                //琛ㄤ綋鏁版嵁
+                //鎸� },{鏉ユ媶鍒嗘暟缁� //鍘绘帀銆愬拰銆�
+                msg3 = msg3.Substring(1, msg3.Length - 2);
+                msg3 = msg3.Replace("\\", "");
+                msg3 = msg3.Replace("\n", "");  //\n
+                //msg2 = msg2.Replace("'", "鈥�");
+                List<Model.ClsQC_POStockInCheckBillSub> ls = new List<Model.ClsQC_POStockInCheckBillSub>();
+                ls = oListModels.getObjectByJson_QC_POStockInCheckBillSub(msg3);
+                int i = 0;
+                foreach (Model.ClsQC_POStockInCheckBillSub oItemSub in ls)
+                {
+                    oItemSub.HBillNo_bak = oBill.omodel.HBillNo;//鍗曟嵁鍙凤紙澶囦唤锛屼互鍏嶅唴鐮佷涪澶憋紝鎵句笉鍒板搴斾富琛級
+                    i++;
+                    if (string.IsNullOrWhiteSpace(oItemSub.HBillNo_bak))
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "淇濆瓨澶辫触锛佹病澶囦唤鍗曟嵁鍙凤紝鏃犳硶淇濆瓨锛�";
+                        objJsonResult.data = 1;
+                        return objJsonResult;
+                    }
+                    oItemSub.HSourceEntryID = 0;
+                    oItemSub.HSourceInterID = 0;
+                    oItemSub.HEntryID = i;
+                    // DBUtility.ClsPub.isDate(DateTime.Now);
+                    oItemSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now);
+                    oItemSub.HCloseType = false;
+                    oItemSub.HSourceBillNo = "";
+                    oItemSub.HSourceBillType = "";
+                    oItemSub.HRelationQty = 0;
+                    oItemSub.HRelationMoney = 0;
+                    oItemSub.HCloseMan = "";
+                    oItemSub.HRemark = "";
+                    oItemSub.HProcCheckEmp = oBill.omodel.HFirstCheckEmp;//妫�娴嬪憳
+                    oBill.DetailColl.Add(oItemSub);
+
+                }
+                //淇濆瓨
+                //淇濆瓨瀹屾瘯鍚庡鐞�
+                bool bResult;
+                if (oBill.omodel.HInterID == 0)
+                {
+                    // bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
+                    bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
+                }
+                else
+                {
+                    bResult = oBill.ModifyBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo);
+                }
+                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;
+            }
+        }
+
+        /// <summary>
+        /// 鏉ユ枡妫�楠岄�昏緫鍒犻櫎鍔熻兘
+        /// </summary>
+        /// <returns></returns>
+        [Route("DeltetQC_POStockInCheck")]
+        [HttpGet]
+        public object DeltetQC_POStockInCheck(string HInterID)
+        {
+            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(HInterID))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "HInterID涓虹┖锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                oCN.BeginTran();//寮�濮嬩簨鍔�
+                ds = oCN.RunProcReturn("select * from QC_POStockInCheckBillMain where HInterID=" + HInterID, "QC_POStockInCheckBillMain");
+                DataSet ds2 = oCN.RunProcReturn("select * from QC_POStockInCheckBillSub where HInterID=" + HInterID, "QC_POStockInCheckBillSub");
+                if (ds == null || ds.Tables[0].Rows.Count == 0 || ds2 == null || ds2.Tables[0].Rows.Count == 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "娌℃湁杩欎釜鍗曟嵁锛屾棤娉曞垹闄わ紒";
+                    objJsonResult.data = null;
+                    return objJsonResult; ;
+                }
+                var HCloseMan = Convert.ToString(ds.Tables[0].Rows[0]["HCloseMan"]);
+                var HCloseMan2 = Convert.ToString(ds2.Tables[0].Rows[0]["HCloseMan"]);
+                if (!string.IsNullOrWhiteSpace(HCloseMan) || !string.IsNullOrWhiteSpace(HCloseMan2) )
+                {
+                    oCN.RollBack();//鍥炴粴浜嬪姟
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鍗曟嵁宸插垹闄ゆ棤娉曞啀娆″垹闄わ紒";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
+                oCN.RunProc("update QC_POStockInCheckBillMain set HCloseMan='-1',HCloseDate=GETDATE()  where HInterID=" + HInterID);
+                oCN.RunProc("update QC_POStockInCheckBillSub set HCloseMan='-1',HEntryCloseDate=GETDATE()  where HInterID=" + HInterID);
+                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 棣栦欢妫�楠�
+        /// <summary>
+        /// 淇濆瓨棣栦欢妫�楠屽崟
+        /// </summary>
+        /// <param name="msg"></param>
+        /// <returns></returns>
+        [Route("SaveQC_FirstPieceCheckList")]
+        [HttpPost]
+        public object SaveQC_FirstPieceCheckList([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 UserName = "";
+            ListModels oListModels = new ListModels();
+            try
+            {
+
+                DAL.ClsQC_FirstPieceCheckBill oBill = new DAL.ClsQC_FirstPieceCheckBill();
+                List<Model.ClsQC_FirstPieceCheckBillMain> lsmain = new List<Model.ClsQC_FirstPieceCheckBillMain>();
+                msg2 = msg2.Replace("\\", "");
+                msg2 = msg2.Replace("\n", "");  //\n
+                lsmain = oListModels.getObjectByJson_QC_FirstPieceCheckBillMain(msg2);
+                foreach (Model.ClsQC_FirstPieceCheckBillMain oItem in lsmain)
+                {
+                    //oItem.HMaker = "";
+                    UserName = oItem.HMaker;
+                    oItem.HMakeDate = DBUtility.ClsPub.isStrNull(DateTime.Now.ToString("yyyy-MM-dd"));
+                    oItem.HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year);
+                    oItem.HDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd"));
+                    oItem.HBillType = "7505";
+                    oItem.HBillSubType = "7505";
+                    oItem.HBillStatus = 0;
+                    oItem.HPeriod = 0;
+                    oItem.HMaker = "";
+                    oItem.HMainSourceInterID = oItem.HInterID;
+
+                    //oItem.HInterID = DBUtility.ClsPub.CreateBillID_SRMProd("1103", ref DBUtility.ClsPub.sExeReturnInfo);
+                    if (DBUtility.ClsPub.isStrNull(oItem.HDate) == "")
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "淇濆瓨澶辫触锛佹病鏈夊崟鎹棩鏈燂紝鏃犳硶淇濆瓨锛�";
+                        objJsonResult.data = 1;
+                        return objJsonResult;
+                    }
+                    oBill.omodel = oItem;
+                }
+                //琛ㄤ綋鏁版嵁
+                //鎸� },{鏉ユ媶鍒嗘暟缁� //鍘绘帀銆愬拰銆�
+                msg3 = msg3.Substring(1, msg3.Length - 2);
+                msg3 = msg3.Replace("\\", "");
+                msg3 = msg3.Replace("\n", "");  //\n
+                //msg2 = msg2.Replace("'", "鈥�");
+                List<Model.ClsQC_FirstPieceCheckBillSub> ls = new List<Model.ClsQC_FirstPieceCheckBillSub>();
+                ls = oListModels.getObjectByJson_QC_FirstPieceCheckBillSub(msg3);
+                int i = 0;
+                foreach (Model.ClsQC_FirstPieceCheckBillSub oItemSub in ls)
+                {
+                    oItemSub.HBillNo_bak = oBill.omodel.HBillNo;//鍗曟嵁鍙凤紙澶囦唤锛屼互鍏嶅唴鐮佷涪澶憋紝鎵句笉鍒板搴斾富琛級
+                    i++;
+                    if (string.IsNullOrWhiteSpace(oItemSub.HBillNo_bak))
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "淇濆瓨澶辫触锛佹病澶囦唤鍗曟嵁鍙凤紝鏃犳硶淇濆瓨锛�";
+                        objJsonResult.data = 1;
+                        return objJsonResult;
+                    }
+                    oItemSub.HSourceEntryID = 0;
+                    oItemSub.HSourceInterID = 0;
+                    oItemSub.HEntryID = i;
+                    // DBUtility.ClsPub.isDate(DateTime.Now);
+                    oItemSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now);
+                    oItemSub.HCloseType = false;
+                    oItemSub.HSourceBillNo = "";
+                    oItemSub.HSourceBillType = "";
+                    oItemSub.HRelationQty = 0;
+                    oItemSub.HRelationMoney = 0;
+                    oItemSub.HCloseMan = "";
+                    oItemSub.HRemark = "";
+                    oBill.DetailColl.Add(oItemSub);
+
+                }
+                //淇濆瓨
+                //淇濆瓨瀹屾瘯鍚庡鐞�
+                bool bResult;
+                if (oBill.omodel.HInterID == 0)
+                {
+                    // bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
+                    bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
+                }
+                else
+                {
+                    bResult = oBill.ModifyBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo);
+                }
+                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;
+            }
+        }
+
+        /// <summary>
+        /// 棣栦欢妫�楠岄�昏緫鍒犻櫎鍔熻兘
+        /// </summary>
+        /// <returns></returns>
+        [Route("DeltetQC_FirstPieceCheck")]
+        [HttpGet]
+        public object DeltetQC_FirstPieceCheck(string HInterID)
+        {
+            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(HInterID))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "HInterID涓虹┖锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                oCN.BeginTran();//寮�濮嬩簨鍔�
+                ds = oCN.RunProcReturn("select * from QC_FirstPieceCheckBillMain where HInterID=" + HInterID, "QC_FirstPieceCheckBillMain");
+                DataSet ds2 = oCN.RunProcReturn("select * from QC_FirstPieceCheckBillSub where HInterID=" + HInterID, "QC_FirstPieceCheckBillSub");
+                if (ds == null || ds.Tables[0].Rows.Count == 0 || ds2 == null || ds2.Tables[0].Rows.Count == 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "娌℃湁杩欎釜鍗曟嵁锛屾棤娉曞垹闄わ紒";
+                    objJsonResult.data = null;
+                    return objJsonResult; ;
+                }
+                var HCloseMan = Convert.ToString(ds.Tables[0].Rows[0]["HCloseMan"]);
+                var HCloseMan2 = Convert.ToString(ds2.Tables[0].Rows[0]["HCloseMan"]);
+                if (!string.IsNullOrWhiteSpace(HCloseMan) || !string.IsNullOrWhiteSpace(HCloseMan2))
+                {
+                    oCN.RollBack();//鍥炴粴浜嬪姟
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鍗曟嵁宸插垹闄ゆ棤娉曞啀娆″垹闄わ紒";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
+                oCN.RunProc("update QC_FirstPieceCheckBillMain set HCloseMan='-1',HCloseDate=GETDATE()  where HInterID=" + HInterID);
+                oCN.RunProc("update QC_FirstPieceCheckBillSub set HCloseMan='-1',HEntryCloseDate=GETDATE()  where HInterID=" + HInterID);
+                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 宸℃
+        /// <summary>
+        /// 淇濆瓨宸℃鍗�
+        /// </summary>
+        /// <param name="msg"></param>
+        /// <returns></returns>
+        [Route("SaveQC_PatrolProcCheckList")]
+        [HttpPost]
+        public object SaveQC_PatrolProcCheckList([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 UserName = "";
+            ListModels oListModels = new ListModels();
+            try
+            {
+                WebAPI.DLL.ClsQC_PatrolProcCheckBill oBill = new WebAPI.DLL.ClsQC_PatrolProcCheckBill();
+                List<Model.ClsQC_PatrolProcCheckBillMain> lsmain = new List<Model.ClsQC_PatrolProcCheckBillMain>();
+                msg2 = msg2.Replace("\\", "");
+                msg2 = msg2.Replace("\n", "");  //\n
+                lsmain = oListModels.getObjectByJson_QC_PatrolProcCheckBillMain(msg2);
+                foreach (Model.ClsQC_PatrolProcCheckBillMain oItem in lsmain)
+                {
+                    //oItem.HMaker = "";
+                    UserName = oItem.HMaker;
+                    oItem.HMakeDate = DBUtility.ClsPub.isStrNull(DateTime.Now.ToString("yyyy-MM-dd"));
+                    oItem.HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year);
+                    oItem.HDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd"));
+                    oItem.HBillType = "7506";
+                    oItem.HBillSubType = "7506";
+                    oItem.HBillStatus = 0;
+                    oItem.HPeriod = 0;
+                    oItem.HMaker = "";
+                    oItem.HMainSourceInterID = oItem.HInterID;
+
+                    //oItem.HInterID = DBUtility.ClsPub.CreateBillID_SRMProd("1103", ref DBUtility.ClsPub.sExeReturnInfo);
+                    if (DBUtility.ClsPub.isStrNull(oItem.HDate) == "")
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "淇濆瓨澶辫触锛佹病鏈夊崟鎹棩鏈燂紝鏃犳硶淇濆瓨锛�";
+                        objJsonResult.data = 1;
+                        return objJsonResult;
+                    }
+                    oBill.omodel = oItem;
+                }
+                //琛ㄤ綋鏁版嵁
+                //鎸� },{鏉ユ媶鍒嗘暟缁� //鍘绘帀銆愬拰銆�
+                msg3 = msg3.Substring(1, msg3.Length - 2);
+                msg3 = msg3.Replace("\\", "");
+                msg3 = msg3.Replace("\n", "");  //\n
+                //msg2 = msg2.Replace("'", "鈥�");
+                List<Model.ClsQC_PatrolProcCheckBillSub> ls = new List<Model.ClsQC_PatrolProcCheckBillSub>();
+                ls = oListModels.getObjectByJson_QC_PatrolProcCheckBillSub(msg3);
+                int i = 0;
+                foreach (Model.ClsQC_PatrolProcCheckBillSub oItemSub in ls)
+                {
+                    oItemSub.HBillNo_bak = oBill.omodel.HBillNo;//鍗曟嵁鍙凤紙澶囦唤锛屼互鍏嶅唴鐮佷涪澶憋紝鎵句笉鍒板搴斾富琛級
+                    i++;
+                    if (string.IsNullOrWhiteSpace(oItemSub.HBillNo_bak))
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "淇濆瓨澶辫触锛佹病澶囦唤鍗曟嵁鍙凤紝鏃犳硶淇濆瓨锛�";
+                        objJsonResult.data = 1;
+                        return objJsonResult;
+                    }
+                    oItemSub.HSourceEntryID = 0;
+                    oItemSub.HSourceInterID = 0;
+                    oItemSub.HEntryID = i;
+                    // DBUtility.ClsPub.isDate(DateTime.Now);
+                    oItemSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now);
+                    oItemSub.HCloseType = false;
+                    oItemSub.HSourceBillNo = "";
+                    oItemSub.HSourceBillType = "";
+                    oItemSub.HRelationQty = 0;
+                    oItemSub.HRelationMoney = 0;
+                    oItemSub.HCloseMan = "";
+                    oItemSub.HRemark = "";
+                    oBill.DetailColl.Add(oItemSub);
+
+                }
+                //淇濆瓨
+                //淇濆瓨瀹屾瘯鍚庡鐞�
+                bool bResult;
+                if (oBill.omodel.HInterID == 0)
+                {
+                    // bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
+                    bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
+                }
+                else
+                {
+                    bResult = oBill.ModifyBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo);
+                }
+                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;
+            }
+        }
+
+        /// <summary>
+        /// 宸℃閫昏緫鍒犻櫎鍔熻兘
+        /// </summary>
+        /// <returns></returns>
+        [Route("DeltetQC_PatrolProcCheck")]
+        [HttpGet]
+        public object DeltetQC_PatrolProcCheck(string HInterID)
+        {
+            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(HInterID))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "HInterID涓虹┖锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                oCN.BeginTran();//寮�濮嬩簨鍔�
+                ds = oCN.RunProcReturn("select * from QC_PatrolProcCheckBillMain where HInterID=" + HInterID, "QC_PatrolProcCheckBillMain");
+                DataSet ds2 = oCN.RunProcReturn("select * from QC_PatrolProcCheckBillSub where HInterID=" + HInterID, "QC_PatrolProcCheckBillSub");
+                if (ds == null || ds.Tables[0].Rows.Count == 0 || ds2 == null || ds2.Tables[0].Rows.Count == 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "娌℃湁杩欎釜鍗曟嵁锛屾棤娉曞垹闄わ紒";
+                    objJsonResult.data = null;
+                    return objJsonResult; ;
+                }
+                var HCloseMan = Convert.ToString(ds.Tables[0].Rows[0]["HCloseMan"]);
+                var HCloseMan2 = Convert.ToString(ds2.Tables[0].Rows[0]["HCloseMan"]);
+                if (!string.IsNullOrWhiteSpace(HCloseMan) || !string.IsNullOrWhiteSpace(HCloseMan2))
+                {
+                    oCN.RollBack();//鍥炴粴浜嬪姟
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鍗曟嵁宸插垹闄ゆ棤娉曞啀娆″垹闄わ紒";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
+                oCN.RunProc("update QC_PatrolProcCheckBillMain set HCloseMan='-1',HCloseDate=GETDATE()  where HInterID=" + HInterID);
+                oCN.RunProc("update QC_PatrolProcCheckBillSub set HCloseMan='-1',HEntryCloseDate=GETDATE()  where HInterID=" + HInterID);
+                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
+
+        #endregion
+
+
+
 
     }
 }
\ No newline at end of file
diff --git a/WebAPI/Controllers/Sc_CheckToolsRepairWorkBillController.cs b/WebAPI/Controllers/Sc_CheckToolsRepairWorkBillController.cs
index 30b672e..18d1120 100644
--- a/WebAPI/Controllers/Sc_CheckToolsRepairWorkBillController.cs
+++ b/WebAPI/Controllers/Sc_CheckToolsRepairWorkBillController.cs
@@ -30,8 +30,8 @@
         {
             try
             {
-                
-                    ds = Sc_CheckToolsRepairWorkBillList_s(sWhere);
+
+                ds = Sc_CheckToolsRepairWorkBillList_s(sWhere);
                 if (ds == null || ds.Tables[0].Rows.Count <= 0)
                 {
                     objJsonResult.code = "0";
@@ -61,7 +61,7 @@
 
         #region sql璇彞
 
-      
+
         public static DataSet Sc_CheckToolsRepairWorkBillList_s(string sWhere)
         {
             return new SQLHelper.ClsCN().RunProcReturn("select * from h_v_Sc_CheckToolsRepairWorkBillList ", "h_v_Sc_CheckToolsRepairWorkBillList");
@@ -69,7 +69,7 @@
 
 
 
-      
+
 
 
         /// <summary>
@@ -1165,7 +1165,7 @@
             DataSet ds;
             ds = new SQLHelper.ClsCN().RunProcReturn("EXEC h_p_Xs_SellOutFindSP '" + HbillNo + "'", "h_p_Xs_SellOutFindSP");
 
-            if (Pub_Class.ClsPub.isLong(ds.Tables[0].Rows.Count) >= 0 )
+            if (Pub_Class.ClsPub.isLong(ds.Tables[0].Rows.Count) >= 0)
             {
                 objJsonResult.code = "1";
                 objJsonResult.count = 1;
@@ -1187,5 +1187,281 @@
 
         #endregion
 
+
+        #region 妯″叿缁翠慨鍗曚繚瀛�/缂栬緫
+        /// <summary>
+        /// 淇濆瓨妯″叿缁翠慨鍗�
+        /// </summary>
+        /// <param name="msg"></param>
+        /// <returns></returns>
+        [Route("Sb_MouldRepairWorkBill/SaveGetMouldRepairWorkBillList")]
+        [HttpPost]
+        public object SaveGetMouldRepairWorkBillList([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 UserName = "";
+            ListModels oListModels = new ListModels();
+            try
+            {
+                DAL.ClsSb_MouldRepairWorkBill oBill = new DAL.ClsSb_MouldRepairWorkBill();
+                List<Model.ClsSb_MouldRepairWorkBillMain> lsmain = new List<Model.ClsSb_MouldRepairWorkBillMain>();
+                msg2 = msg2.Replace("\\", "");
+                msg2 = msg2.Replace("\n", "");  //\n
+                lsmain = oListModels.getObjectByJson_Gy_MouldRepairWorkBillMain(msg2);
+                foreach (Model.ClsSb_MouldRepairWorkBillMain oItem in lsmain)
+                {
+                    //oItem.HMaker = "";
+                    UserName = oItem.HMaker;  //鍒跺崟浜�
+                    oItem.HBillType = "3807";
+                    oItem.HBillSubType = "3807";
+                    //oItem.HBillNo = "";    //鍗曟嵁鍙�
+                    //oItem.HDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd"));//  --鏃ユ湡
+                    oItem.HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year);
+                    oItem.HMakeDate = DBUtility.ClsPub.isStrNull(DateTime.Now.ToString("yyyy-MM-dd"));
+                    //oItem.HEquipID = 0;    //璁惧ID(Gy_EquipMent)
+                    //oItem.HPeriod = 0;
+                    //oItem.HRepairBeginDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd"));  //  --缁翠慨寮�濮嬫棩鏈�
+                    //oItem.HRepairEndDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd"));//  --缁翠慨缁撴潫鏃ユ湡
+                    //oItem.HRepairContent = "";  //缁翠慨鍐呭
+                    //oItem.HCycleUnit = "";     //鏃堕棿鍗曚綅(灏忔椂锛屽ぉ)
+                    //oItem.HPlanTimes = 0;       //璁″垝缁翠慨宸ユ椂
+                    //oItem.HTimes = 0;          //瀹為檯缁翠慨宸ユ椂
+                    //oItem.HEmpID = 0;           //缁翠慨浜�(Gy_Employee)
+                    //oItem.HManagerID = 0;      //涓荤(Gy_Employee)
+                    //oItem.HDeptID = 0;        //缁翠慨閮ㄩ棬(Gy_Department)
+                    //oItem.HExplanation = ""; //--缁翠慨瑕佹眰   
+                    //oItem.HInnerBillNo = "";  //  --鍐呴儴鍗曟嵁鍙�
+                    //oItem.HMouldID = 0;      //鎴愬搧妯″叿ID
+                    //oItem.HSupID = 0;       //--渚涘簲鍟嗭紙Gy_Supplier锛�	
+                    //oItem.HRepairType = ""; //--缁翠慨绫诲瀷锛堝唴閮ㄧ淮淇紝濮斿缁翠慨锛�   	addnew
+                    //oItem.HNewModel = "";    //缁翠慨鍚庢柊瑙勬牸
+                    //oItem.HNewDesignLife = 0;  //鏂拌璁″鍛�
+                    //oItem.HRepairID = 0; //缁翠慨椤圭洰(Gy_Repair)
+                    //oItem.HRemark = "";   //澶囨敞
+                    //oItem.HMainSourceInterID = oItem.HInterID;
+
+                    //oItem.HInterID = DBUtility.ClsPub.CreateBillID_SRMProd("1103", ref DBUtility.ClsPub.sExeReturnInfo);
+                    if (DBUtility.ClsPub.isStrNull(oItem.HDate) == "")
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "淇濆瓨澶辫触锛佹病鏈夊崟鎹棩鏈燂紝鏃犳硶淇濆瓨锛�";
+                        objJsonResult.data = 1;
+                        return objJsonResult;
+                    }
+                    oBill.omodel = oItem;
+                }
+                //琛ㄤ綋鏁版嵁
+                //鎸� },{鏉ユ媶鍒嗘暟缁� //鍘绘帀銆愬拰銆�
+                msg3 = msg3.Substring(1, msg3.Length - 2);
+                msg3 = msg3.Replace("\\", "");
+                msg3 = msg3.Replace("\n", "");  //\n
+                //msg2 = msg2.Replace("'", "鈥�");
+                List<Model.ClsSb_MouldRepairWorkBillSub> ls = new List<Model.ClsSb_MouldRepairWorkBillSub>();
+                ls = oListModels.getObjectByJson_Gy_MouldRepairWorkBillSub(msg3);
+                int i = 0;
+                foreach (Model.ClsSb_MouldRepairWorkBillSub 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.HRelationMoney = 0;   //鍏宠仈閲戦
+                    //oItemSub.HRepairID = 0;       //缁翠慨椤圭洰
+                    //oItemSub.HRepairExplanation ="";   //缁翠慨瑕佹眰
+                    //oItemSub.HManagerID = 0;   //璐熻矗浜篒D
+                    //oItemSub.HMoney = 0;        //缁翠慨璐圭敤
+                    oBill.DetailColl.Add(oItemSub);
+
+                }
+                //淇濆瓨
+                //淇濆瓨瀹屾瘯鍚庡鐞�
+                bool bResult;
+                if (oBill.omodel.HInterID == 0)
+                {
+                    // bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
+                    bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
+                }
+                else
+                {
+                    bResult = oBill.ModifyBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo);
+                }
+                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[妯″叿缁翠慨鍒楄〃缂栬緫鏃惰幏鍙栬〃澶存暟鎹甝
+        [Route("Sb_MouldRepairWorkBill/Sb_MouldRepairWorkBillListCheckDetai")]
+        [HttpGet]
+        public ApiResult<DataSet> Sb_MouldRepairWorkBillListCheckDetai(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_MouldRepairWorkBillList  where hmainid= " + HID + " ", "h_v_Sc_MouldRepairWorkBillList");
+            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("Sb_MouldRepairWorkBill/Sb_MouldRepairWorkBillListProjectDetai")]
+        [HttpGet]
+        public object Sb_MouldRepairWorkBillListProjectDetai(string sqlWhere)
+        {
+            DataSet ds;
+            try
+            {
+                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+                if (sqlWhere == null || sqlWhere.Equals(""))
+                {
+                    ds = oCN.RunProcReturn("select HRepairID,HRepairExplanation,HManagerID,HMoney,HRemark   from Sc_MouldRepairWorkBillSub", "Sc_MouldRepairWorkBillSub");
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 1;
+                    objJsonResult.Message = "鑾峰彇淇℃伅鎴愬姛锛�";
+                    objJsonResult.data = ds.Tables[0];
+                }
+                else
+                {
+                    string sql1 = "select HRepairID,HRepairExplanation,HManagerID,HMoney,HRemark  from Sc_MouldRepairWorkBillSub where 1 = 1 ";
+                    string sql = sql1 + sqlWhere;
+                    ds = oCN.RunProcReturn(sql, "Sc_MouldRepairWorkBillSub");
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 1;
+                    objJsonResult.Message = "鑾峰彇淇℃伅鎴愬姛锛�";
+                    objJsonResult.data = ds.Tables[0];
+                }
+            }
+            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("Sb_MouldRepairWorkBill/DeltetMouldRepairWorkBill")]
+        [HttpGet]
+        public object DeltetMouldRepairWorkBill(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)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "鍗曟嵁ID涓虹┖锛�";
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+            DAL.ClsSb_MouldRepairWorkBill oBill = new DAL.ClsSb_MouldRepairWorkBill();
+            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
+
     }
 }
\ No newline at end of file
diff --git a/WebAPI/DLL/ClsQC_PatrolProcCheckBill.cs b/WebAPI/DLL/ClsQC_PatrolProcCheckBill.cs
new file mode 100644
index 0000000..d1dc5c0
--- /dev/null
+++ b/WebAPI/DLL/ClsQC_PatrolProcCheckBill.cs
@@ -0,0 +1,441 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Text;
+using System.Data;
+
+namespace WebAPI.DLL
+{
+    public  class ClsQC_PatrolProcCheckBill:DBUtility.ClsXt_BaseBill
+    {
+        public Model.ClsQC_PatrolProcCheckBillMain omodel = new Model.ClsQC_PatrolProcCheckBillMain();
+        public List<Model.ClsQC_PatrolProcCheckBillSub> DetailColl = new List<Model.ClsQC_PatrolProcCheckBillSub>();
+        //public List<Model.ClsQC_PatrolProcCheckBillSub_Item> DetailColl1 = new List<Model.ClsQC_PatrolProcCheckBillSub_Item>();
+        public ClsQC_PatrolProcCheckBill()
+        {
+            base.MvarItemKeySub = "QC_PatrolProcCheckBillSub";
+            base.MvarItemKeySub2 = "";
+            base.MvarItemKeySub3 = "";
+            base.MvarItemKeySub4 = "";
+            base.MvarItemKey="QC_PatrolProcCheckBillMain";
+            base.MvarReportTitle="宸℃鍗�";
+            base.BillType="7506";
+            base.HBillSubType = "7506";
+
+        }
+
+        #region 鍥哄畾浠g爜
+
+        ~ClsQC_PatrolProcCheckBill()
+        {
+            DetailColl = null;
+        }
+       
+        #endregion   鑷畾涔夋柟娉�
+        //淇敼鍗曟嵁
+        public override bool ModifyBill(Int64 lngBillKey, ref string sReturn)
+        {
+            try
+            {
+                //
+                oCn.BeginTran();
+                string sqlerro = @"UpDate QC_PatrolProcCheckBillMain set  " +
+                " HBillNo='" + omodel.HBillNo + "'" +  //鍥哄畾璧嬪��===============
+                ",HDate='" + omodel.HDate + "'" +
+                ",HYear='" + omodel.HYear.ToString() + "'" +
+                ",HPeriod='" + omodel.HPeriod.ToString() + "'" +
+                ",HBillStatus='" + omodel.HBillStatus + "'" +
+                ",HRemark='" + omodel.HRemark + "'" +
+                //",HBacker='"+omodel.HBacker+"'"+
+                //",HBackDate='" + omodel.HBackDate + "'" +
+                //",HBackRemark='"+omodel.HBackRemark+"'"+
+                //",HChecker='" + omodel.HChecker + "'" +
+                //",HCheckDate='" + omodel.HCheckDate + "'" +
+                //",HMaker='" + omodel.HMaker + "'" +
+                //",HMakeDate='" + omodel.HMakeDate + "'" +
+                ",HUpDater='" + DBUtility.ClsPub.CurUserName + "'" +
+                ",HUpDateDate=getdate()" +
+                //",HCloseMan='" + omodel.HCloseMan + "'" +
+                //",HCloseDate='" + omodel.HCloseDate + "'" +
+                //",HCloseType="+omodel.HCloseType.ToString()+
+                //",HDeleteMan='" + omodel.HDeleteMan + "'" +
+                //",HDeleteDate='" + omodel.HDeleteDate + "'" +
+                ",HPrintQty=" + omodel.HPrintQty.ToString() +
+                //========================================
+                //",HSupID=" + omodel.HSupID.ToString() +
+                //",HEmpID=" + omodel.HEmpID.ToString() +
+                ",HSourceID=" + omodel.HSourceID.ToString() +
+                ",HICMOInterID=" + omodel.HICMOInterID.ToString() +
+                ",HICMOBillNo='" + omodel.HICMOBillNo + "'" +
+                ",HICMOQty=" + omodel.HICMOQty.ToString() +
+                ",HProcExchInterID=" + omodel.HICMOQty.ToString() +
+                ",HProcExchEntryID=" + omodel.HICMOQty.ToString() +
+                ",HProcExchBillNo='" + omodel.HProcExchBillNo + "'" +
+                ",HProcExchQty=" + omodel.HICMOQty.ToString() +
+                ",HMaterID=" + omodel.HMaterID.ToString() +
+                ",HFirstCheckEmp=" + omodel.HFirstCheckEmp.ToString() +
+                " where HInterID=" + lngBillKey.ToString();
+                //鏇存柊涓昏〃
+                oCn.RunProc(sqlerro);
+                //鍒犻櫎鍏宠仈
+                DeleteRelation(ref sReturn, lngBillKey);
+                //鍒犻櫎瀛愯〃
+                DeleteBillSub(lngBillKey);
+                //鎻掑叆瀛愯〃
+                omodel.HInterID = lngBillKey;
+                foreach (Model.ClsQC_PatrolProcCheckBillSub oSub in DetailColl)
+                {
+                    oCn.RunProc("Insert into QC_PatrolProcCheckBillSub " +
+                      " (HInterID,HBillNo_bak,HEntryID,HCloseMan" +
+                      ",HEntryCloseDate,HCloseType,HRemark,HSourceInterID" +
+                      ",HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" +
+                      ",HQCCheckItemID,HQCStd,HQCNote1,HQCNote2,HQCNote3,HQCNote4" +
+                      ",HQCNote5,HQCNote6,HQCNote7,HQCNote8,HQCNote9,HQCNote10"+
+                      ") values("
+                      + omodel.HInterID.ToString() + ",'" + oSub.HBillNo_bak + "'," + oSub.HEntryID.ToString() + ",'" + oSub.HCloseMan + "'" +
+                      ",getdate()," + 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.HQCCheckItemID.ToString() + ",'" + oSub.HQCStd + "','" + oSub.HQCNote1 + "','" + oSub.HQCNote2 + "','" + oSub.HQCNote3+ "','" + oSub.HQCNote4+ "'" +
+                      ",'" + oSub.HQCNote5+ "','" + oSub.HQCNote6 + "','" + oSub.HQCNote7 + "','" + oSub.HQCNote8 + "','" + oSub.HQCNote9 + "','" + oSub.HQCNote10 + "'" +
+                      ") ");
+                }
+                //foreach (Model.ClsQC_PatrolProcCheckBillSub_Item oSub2 in DetailColl1)
+                //{
+                //    oCn.RunProc("Insert into QC_PatrolProcCheckBillSub_Item " +
+                //      " (HInterID,HBillNo_bak,HEntryID,HCloseMan" +
+                //      ",HEntryCloseDate,HCloseType,HRemark,HSourceInterID" +
+                //      ",HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" +
+                //      ",HMaintainItemID,HMaintainItem,HMaintainPart,HClaim,HManagerID" +
+
+                //      ") values("
+                //      + omodel.HInterID.ToString() + ",'" + oSub2.HBillNo_bak + "'," + oSub2.HEntryID.ToString() + ",'" + oSub2.HCloseMan + "'" +
+                //      ",getdate()," + Convert.ToString(oSub2.HCloseType ? 1 : 0) + ",'" + oSub2.HRemark + "'," + oSub2.HSourceInterID.ToString() +
+                //      "," + oSub2.HSourceEntryID.ToString() + ",'" + oSub2.HSourceBillNo + "','" + oSub2.HSourceBillType + "'," + oSub2.HRelationQty.ToString() + "," + oSub2.HRelationMoney.ToString() +
+                //      "," + oSub2.HMaintainItemID.ToString() + ",'" + oSub2.HMaintainItem + "','" + oSub2.HMaintainPart + "','" + oSub2.HClaim + "'," + oSub2.HManagerID.ToString() +
+                //      ") ");
+                //}
+                //
+                //foreach (Model.ClsQC_PatrolProcCheckBillSub oSub in DetailColl)
+                //{
+                //    Ds = oCn.RunProcReturn("exec h_p_QC_PatrolProcCheckBill_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;
+                //    }
+                //}
+                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 QC_PatrolProcCheckBillMain " +
+                "(HBillType,HBillSubType,HInterID,HBillNo,HBillStatus,HDate,HMaker,HMakeDate" +
+                ",HYear,HPeriod,HRemark" +
+                ",HSourceID,HICMOInterID,HICMOBillNo,HICMOQty,HProcExchInterID,HProcExchEntryID" +
+                ",HProcExchBillNo,HProcExchQty,HMaterID,HFirstCheckEmp" +
+                ") " +
+                " values('" + this.BillType + "','" + this.HBillSubType + "'," + omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "'," + omodel.HBillStatus.ToString() + ",'" + omodel.HDate + "','" + DBUtility.ClsPub.CurUserName + "',getdate()" +
+                "," + omodel.HYear.ToString() + "," + omodel.HPeriod.ToString() + ",'" + omodel.HRemark + "'" +
+                "," + omodel.HSourceID.ToString() + "," + omodel.HICMOInterID.ToString() + ",'" + omodel.HICMOBillNo + "'," + omodel.HICMOQty.ToString() + "," + omodel.HProcExchInterID.ToString() + "," + omodel.HProcExchEntryID.ToString() +
+                ",'" + omodel.HProcExchBillNo + "'," + omodel.HProcExchQty.ToString() + "," + omodel.HMaterID.ToString() + "," + omodel.HFirstCheckEmp.ToString() + 
+                ") ");
+                //鎻掑叆瀛愯〃
+                foreach (Model.ClsQC_PatrolProcCheckBillSub oSub in DetailColl)
+                {
+                    oCn.RunProc("Insert into QC_PatrolProcCheckBillSub " +
+                      " (HInterID,HBillNo_bak,HEntryID,HCloseMan" +
+                      ",HEntryCloseDate,HCloseType,HRemark,HSourceInterID" +
+                      ",HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" +
+                      ",HQCCheckItemID,HQCStd,HQCNote1,HQCNote2,HQCNote3,HQCNote4" +
+                      ",HQCNote5,HQCNote6,HQCNote7,HQCNote8,HQCNote9,HQCNote10" +
+                      ") values("
+                      + omodel.HInterID.ToString() + ",'" + oSub.HBillNo_bak + "'," + oSub.HEntryID.ToString() + ",'" + oSub.HCloseMan + "'" +
+                      ",getdate()," + 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.HQCCheckItemID.ToString() + ",'" + oSub.HQCStd + "','" + oSub.HQCNote1 + "','" + oSub.HQCNote2 + "','" + oSub.HQCNote3 + "','" + oSub.HQCNote4 + "'" +
+                      ",'" + oSub.HQCNote5 + "','" + oSub.HQCNote6 + "','" + oSub.HQCNote7 + "','" + oSub.HQCNote8 + "','" + oSub.HQCNote9 + "','" + oSub.HQCNote10 + "'" +
+                      ") ");
+                }
+                //foreach (Model.ClsQC_PatrolProcCheckBillSub_Item oSub2 in DetailColl1)
+                //{
+                //    oCn.RunProc("Insert into QC_PatrolProcCheckBillSub_Item " +
+                //      " (HInterID,HBillNo_bak,HEntryID,HCloseMan" +
+                //      ",HEntryCloseDate,HCloseType,HRemark,HSourceInterID" +
+                //      ",HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" +
+                //      ",HMaintainItemID,HMaintainItem,HMaintainPart,HClaim,HManagerID" +
+
+                //      ") values("
+                //      + omodel.HInterID.ToString() + ",'" + oSub2.HBillNo_bak + "'," + oSub2.HEntryID.ToString() + ",'" + oSub2.HCloseMan + "'" +
+                //      ",getdate()," + Convert.ToString(oSub2.HCloseType ? 1 : 0) + ",'" + oSub2.HRemark + "'," + oSub2.HSourceInterID.ToString() +
+                //      "," + oSub2.HSourceEntryID.ToString() + ",'" + oSub2.HSourceBillNo + "','" + oSub2.HSourceBillType + "'," + oSub2.HRelationQty.ToString() + "," + oSub2.HRelationMoney.ToString() +
+                //      "," + oSub2.HMaintainItemID.ToString() + ",'" + oSub2.HMaintainItem + "','" + oSub2.HMaintainPart + "','" + oSub2.HClaim + "'," + oSub2.HManagerID.ToString() +
+                //      ") ");
+                //}
+                //
+                //foreach (Model.ClsQC_PatrolProcCheckBillSub oSub in DetailColl)
+                //{
+                //    Ds = oCn.RunProcReturn("exec h_p_QC_PatrolProcCheckBill_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;
+                //    }
+                //}
+                //
+                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 QC_PatrolProcCheckBillMain Where HInterID=" + lngBillKey.ToString(), "QC_PatrolProcCheckBillMain");
+                if(Ds.Tables[0].Rows.Count==0)
+                {
+                    sReturn = "鍗曟嵁鏈壘鍒帮紒";
+                    return false;
+                }
+                //鍥哄畾璧嬪��===========================================
+                omodel.HInterID =DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HInterID"]);
+                omodel.HBillNo = Ds.Tables[0].Rows[0]["HBillNo"].ToString().Trim();
+                omodel.HDate =DBUtility.ClsPub.isDate(Ds.Tables[0].Rows[0]["HDate"]);
+                omodel.HYear = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HYear"]);
+                omodel.HPeriod = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HPeriod"]);
+                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.HBillStatus = DBUtility.ClsPub.isInt(Ds.Tables[0].Rows[0]["HBillStatus"]);
+                omodel.HBillType = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBillType"]);
+                omodel.HBillSubType = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBillSubType"]);
+                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.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.HCloseDate = Ds.Tables[0].Rows[0]["HCloseDate"].ToString().Trim();
+                omodel.HCloseMan = Ds.Tables[0].Rows[0]["HCloseMan"].ToString().Trim();
+                omodel.HDeleteDate = Ds.Tables[0].Rows[0]["HDeleteDate"].ToString().Trim();
+                omodel.HDeleteMan = Ds.Tables[0].Rows[0]["HDeleteMan"].ToString().Trim();
+                //========================================================
+                ////==
+                //omodel.HWHID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HWHID"]);
+                //omodel.HSCWHID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HSCWHID"]);
+                //omodel.HSupID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HSupID"]);
+                //omodel.HEmpID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HEmpID"]);
+                //omodel.HMangerID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HMangerID"]);
+                omodel.HSourceID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HSourceID"]);
+                omodel.HICMOInterID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HICMOInterID"]);
+                omodel.HICMOBillNo = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HICMOBillNo"]);
+                omodel.HICMOQty = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HICMOQty"]); ;
+                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.HProcExchQty = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HProcExchQty"]); ;
+                omodel.HMaterID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HMaterID"]);
+                omodel.HFirstCheckEmp = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HFirstCheckEmp"]);
+
+                //omodel.HRedBlueFlag = DBUtility.ClsPub.isBool(Ds.Tables[0].Rows[0]["HRedBlueFlag"]);
+                //
+                
+                //寰幆
+                DataSet DsSub ;
+                DsSub = oCn.RunProcReturn("Select * from QC_PatrolProcCheckBillSub Where HInterID=" + lngBillKey.ToString() + " order by HEntryID ", "QC_PatrolProcCheckBillSub");
+                DetailColl.Clear();//娓呯┖
+                for (int i = 0; i < DsSub.Tables[0].Rows.Count; i++)
+                {
+                    Model.ClsQC_PatrolProcCheckBillSub oSub = new Model.ClsQC_PatrolProcCheckBillSub();
+                    // 鍥哄畾璧嬪��===============================================
+                    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.HCloseMan = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HCloseMan"]);
+                    oSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DsSub.Tables[0].Rows[i]["HEntryCloseDate"]);
+                    oSub.HCloseType = DBUtility.ClsPub.isBool(DsSub.Tables[0].Rows[i]["HCloseType"]);
+                    oSub.HRemark = DsSub.Tables[0].Rows[i]["HRemark"].ToString().Trim();
+                    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.HQCCheckItemID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HQCCheckItemID"]);
+                    oSub.HQCStd = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HQCStd"]);               
+                    oSub.HQCNote1 = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HQCNote1"]);
+                    oSub.HQCNote2 = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HQCNote2"]);
+                    oSub.HQCNote3 = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HQCNote3"]);
+                    oSub.HQCNote4 = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HQCNote4"]);
+                    oSub.HQCNote5 = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HQCNote5"]);
+                    oSub.HQCNote6 = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HQCNote6"]);
+                    oSub.HQCNote7 = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HQCNote7"]);
+                    oSub.HQCNote8 = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HQCNote8"]);
+                    oSub.HQCNote9 = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HQCNote9"]);
+                    oSub.HQCNote10 = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HQCNote10"]);
+                    //oSub.HDotCheckItemID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HDotCheckItemID"]);
+                    //oSub.HDotCheckItem = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HDotCheckItem"]);
+                    //oSub.HDotCheckPart = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HDotCheckPart"]);
+                    //oSub.HClaim = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HClaim"]);
+                    //oSub.HManagerID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HManagerID"]);
+                    //oSub.HWorkerID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HWorkerID"]);
+                    //oSub.HWorkerNumber = DsSub.Tables[0].Rows[i]["HWorkerNumber"].ToString().Trim();
+                    //oSub.HSourceID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSourceID"]);
+                    //oSub.HMaterID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HMaterID"]);
+                    //oSub.HPropertyID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HPropertyID"]);
+                    //oSub.HSecUnitID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSecUnitID"]);
+                    //oSub.HSecUnitRate = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HSecUnitRate"]);
+                    //oSub.HUnitID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HUnitID"]);
+                    //oSub.HBatchNo = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HBatchNo"]);
+                    //oSub.HQtyMust = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HQtyMust"]);
+                    //oSub.HQty = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HQty"]);
+                    //oSub.HPrice = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HPrice"]);
+                    //oSub.HMoney = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HMoney"]);
+                    //oSub.HDesignLife = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HDesignLife"]);
+                    //oSub.HLeaveLife = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HLeaveLife"]);
+                    //oSub.HUseLife = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HUseLife"]);
+                    //oSub.HWHID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HWHID"]);
+                    //oSub.HSPID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSPID"]);
+                    //oSub.HSCWHID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSCWHID"]);
+                    //oSub.HSCSPID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSCSPID"]);
+                    //oSub.HSPGroupID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSPGroupID"]);
+
+                    //oSub.HQtyMust = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HQtyMust"]);
+                    //oSub.HBadCount = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HBadCount"]);
+                    //oSub.HWasterQty = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HWasterQty"]);
+                    //oSub.HSeOrderInterID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSeOrderInterID"]);
+                    //oSub.HSeOrderEntryID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSeOrderEntryID"]);
+                    //oSub.HSeOrderBillNo = DsSub.Tables[0].Rows[i]["HSeOrderBillNo"].ToString().Trim();
+                    
+                    DetailColl.Add(oSub);
+                }
+                //DataSet DsSub2;
+                //DsSub2 = oCn.RunProcReturn("Select * from QC_PatrolProcCheckBillSub_Item Where HInterID=" + lngBillKey.ToString() + " order by HEntryID ", "QC_PatrolProcCheckBillSub_Item");
+                //DetailColl1.Clear();//娓呯┖
+                //for (int i = 0; i < DsSub2.Tables[0].Rows.Count; i++)
+                //{
+                //    Model.ClsQC_PatrolProcCheckBillSub_Item oSub2 = new Model.ClsQC_PatrolProcCheckBillSub_Item();
+                //    // 鍥哄畾璧嬪��===============================================
+                //    oSub2.HInterID = DBUtility.ClsPub.isLong(DsSub2.Tables[0].Rows[i]["HInterID"]);
+                //    oSub2.HEntryID = DBUtility.ClsPub.isLong(DsSub2.Tables[0].Rows[i]["HEntryID"]);
+                //    oSub2.HBillNo_bak = DBUtility.ClsPub.isStrNull(DsSub2.Tables[0].Rows[i]["HBillNo_bak"]);
+                //    oSub2.HCloseMan = DBUtility.ClsPub.isStrNull(DsSub2.Tables[0].Rows[i]["HCloseMan"]);
+                //    oSub2.HEntryCloseDate = DBUtility.ClsPub.isDate(DsSub2.Tables[0].Rows[i]["HEntryCloseDate"]);
+                //    oSub2.HCloseType = DBUtility.ClsPub.isBool(DsSub2.Tables[0].Rows[i]["HCloseType"]);
+                //    oSub2.HRemark = DBUtility.ClsPub.isStrNull(DsSub2.Tables[0].Rows[i]["HRemark"]);
+                //    oSub2.HSourceInterID = DBUtility.ClsPub.isLong(DsSub2.Tables[0].Rows[i]["HSourceInterID"]);
+                //    oSub2.HSourceEntryID = DBUtility.ClsPub.isLong(DsSub2.Tables[0].Rows[i]["HSourceEntryID"]);
+                //    oSub2.HSourceBillType = DsSub2.Tables[0].Rows[i]["HSourceBillType"].ToString().Trim();
+                //    oSub2.HSourceBillNo = DsSub2.Tables[0].Rows[i]["HSourceBillNo"].ToString().Trim();
+                //    oSub2.HRelationQty = DBUtility.ClsPub.isDoule(DsSub2.Tables[0].Rows[i]["HRelationQty"]);
+                //    oSub2.HRelationMoney = DBUtility.ClsPub.isDoule(DsSub2.Tables[0].Rows[i]["HRelationMoney"]);
+                //    //===================================================
+                //    //oSub.HWorkerID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HWorkerID"]);
+                //    //oSub.HWorkerNumber = DsSub.Tables[0].Rows[i]["HWorkerNumber"].ToString().Trim();
+                //    //oSub.HSourceID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSourceID"]);
+                //    //oSub.HMaterID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HMaterID"]);
+                //    //oSub.HPropertyID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HPropertyID"]);
+                //    //oSub.HSecUnitID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSecUnitID"]);
+                //    //oSub.HSecUnitRate = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HSecUnitRate"]);
+                //    //oSub.HUnitID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HUnitID"]);
+                //    //oSub.HBatchNo = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HBatchNo"]);
+                //    //oSub.HQtyMust = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HQtyMust"]);
+                //    //oSub.HQty = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HQty"]);
+                //    //oSub.HPrice = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HPrice"]);
+                //    //oSub.HMoney = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HMoney"]);
+                //    //oSub.HDesignLife = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HDesignLife"]);
+                //    //oSub.HLeaveLife = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HLeaveLife"]);
+                //    //oSub.HUseLife = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HUseLife"]);
+                //    //oSub.HWHID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HWHID"]);
+                //    //oSub.HSPID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSPID"]);
+                //    //oSub.HSCWHID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSCWHID"]);
+                //    //oSub.HSCSPID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSCSPID"]);
+                //    //oSub.HSPGroupID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSPGroupID"]);
+                //    oSub2.HMaintainItemID = DBUtility.ClsPub.isLong(DsSub2.Tables[0].Rows[i]["HMaintainItemID"]);
+                //    oSub2.HMaintainItem = DBUtility.ClsPub.isStrNull(DsSub2.Tables[0].Rows[i]["HMaintainItem"]);
+                //    oSub2.HMaintainPart = DBUtility.ClsPub.isStrNull(DsSub2.Tables[0].Rows[i]["HMaintainPart"]);
+                //    oSub2.HClaim = DBUtility.ClsPub.isStrNull(DsSub2.Tables[0].Rows[i]["HClaim"]);
+                //    oSub2.HManagerID = DBUtility.ClsPub.isLong(DsSub2.Tables[0].Rows[i]["HManagerID"]);
+                //    //oSub.HQtyMust = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HQtyMust"]);
+                //    //oSub.HBadCount = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HBadCount"]);
+                //    //oSub.HWasterQty = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HWasterQty"]);
+                //    //oSub.HSeOrderInterID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSeOrderInterID"]);
+                //    //oSub.HSeOrderEntryID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSeOrderEntryID"]);
+                //    //oSub.HSeOrderBillNo = DsSub.Tables[0].Rows[i]["HSeOrderBillNo"].ToString().Trim();
+
+                //    DetailColl1.Add(oSub2);
+                //}
+                sReturn = "鏄剧ず鍗曟嵁鎴愬姛锛�";
+                return true;
+            }
+            catch (Exception e)
+            {
+                sReturn = e.Message;
+                throw (e);
+            }
+        }
+
+        //瀹℃牳
+        public bool CheckBill(Int64 lngBillKey, ref string sReturn)
+        {
+
+            try
+            {
+                string HChecker = DBUtility.ClsPub.CurUserName;
+                string HCheckDate = DBUtility.ClsPub.GetServerDate(-1);
+                oCn.RunProc(" Update " + MvarItemKey + " set 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 + "'");
+                //
+                sReturn = "";
+                return true;
+            }
+            catch (Exception e)
+            {
+                sReturn = e.Message;
+                throw (e);
+            }
+        }
+
+
+
+
+        
+    }
+}
diff --git a/WebAPI/ListModels.cs b/WebAPI/ListModels.cs
index c2f2a22..3b0b10c 100644
--- a/WebAPI/ListModels.cs
+++ b/WebAPI/ListModels.cs
@@ -333,5 +333,129 @@
             return list;
         }
 
+        /// <summary>
+        /// 澶勭悊鏂板妫�楠屾柟妗堜富琛ㄧ殑json
+        /// </summary>
+        /// <param name="jsonString"></param>
+        /// <returns></returns>
+        public List<Model.ClsGy_QCCheckProjectMain> getObjectByJson_Gy_QCCheckProjectMain(string jsonString)
+        {
+            jsonString = "[" + jsonString.ToString() + "]";
+            List<Model.ClsGy_QCCheckProjectMain> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsGy_QCCheckProjectMain>>(jsonString);
+            return list;
+        }
+
+        
+        /// <summary>
+        /// 澶勭悊鏂板妫�楠屾柟妗堝瓙琛ㄧ殑json
+        /// </summary>
+        /// <param name="jsonString"></param>
+        /// <returns></returns>
+        public List<Model.ClsGy_QCCheckProjectSub> getObjectByJson_ClsGy_QCCheckProjectSub(string jsonString)
+        {
+            jsonString = "[" + jsonString.ToString() + "]";
+            List<Model.ClsGy_QCCheckProjectSub> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsGy_QCCheckProjectSub>>(jsonString);
+            return list;
+        }
+
+        /// <summary>
+        /// 澶勭悊鏂板鏉ユ枡妫�楠屼富琛ㄧ殑json
+        /// </summary>
+        /// <param name="jsonString"></param>
+        /// <returns></returns>
+        public List<Model.ClsQC_POStockInCheckBillMain> getObjectByJson_QC_POStockInCheckBillMain(string jsonString)
+        {
+            jsonString = "[" + jsonString.ToString() + "]";
+            List<Model.ClsQC_POStockInCheckBillMain> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsQC_POStockInCheckBillMain>>(jsonString);
+            return list;
+        }
+
+        /// <summary>
+        /// 澶勭悊鏂板鏉ユ枡妫�楠屽瓙琛ㄧ殑json
+        /// </summary>
+        /// <param name="jsonString"></param>
+        /// <returns></returns>
+        public List<Model.ClsQC_POStockInCheckBillSub> getObjectByJson_QC_POStockInCheckBillSub(string jsonString)
+        {
+            jsonString = "[" + jsonString.ToString() + "]";
+            List<Model.ClsQC_POStockInCheckBillSub> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsQC_POStockInCheckBillSub>>(jsonString);
+            return list;
+        }
+
+        /// <summary>
+        /// 澶勭悊鏂板棣栦欢妫�楠屼富琛ㄧ殑json
+        /// </summary>
+        /// <param name="jsonString"></param>
+        /// <returns></returns>
+        public List<Model.ClsQC_FirstPieceCheckBillMain> getObjectByJson_QC_FirstPieceCheckBillMain(string jsonString)
+        {
+            jsonString = "[" + jsonString.ToString() + "]";
+            List<Model.ClsQC_FirstPieceCheckBillMain> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsQC_FirstPieceCheckBillMain>>(jsonString);
+            return list;
+        }
+
+        /// <summary>
+        /// 澶勭悊鏂板棣栦欢妫�楠屽瓙琛ㄧ殑json
+        /// </summary>
+        /// <param name="jsonString"></param>
+        /// <returns></returns>
+        public List<Model.ClsQC_FirstPieceCheckBillSub> getObjectByJson_QC_FirstPieceCheckBillSub(string jsonString)
+        {
+            jsonString = "[" + jsonString.ToString() + "]";
+            List<Model.ClsQC_FirstPieceCheckBillSub> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsQC_FirstPieceCheckBillSub>>(jsonString);
+            return list;
+        }
+
+
+        /// <summary>
+        /// 澶勭悊鏂板宸℃鍗曚富琛ㄧ殑json
+        /// </summary>
+        /// <param name="jsonString"></param>
+        /// <returns></returns>
+        public List<Model.ClsQC_PatrolProcCheckBillMain> getObjectByJson_QC_PatrolProcCheckBillMain(string jsonString)
+        {
+            jsonString = "[" + jsonString.ToString() + "]";
+            List<Model.ClsQC_PatrolProcCheckBillMain> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsQC_PatrolProcCheckBillMain>>(jsonString);
+            return list;
+        }
+
+        /// <summary>
+        /// 澶勭悊鏂板宸℃鍗曞瓙琛ㄧ殑json
+        /// </summary>
+        /// <param name="jsonString"></param>
+        /// <returns></returns>
+        public List<Model.ClsQC_PatrolProcCheckBillSub> getObjectByJson_QC_PatrolProcCheckBillSub(string jsonString)
+        {
+            jsonString = "[" + jsonString.ToString() + "]";
+            List<Model.ClsQC_PatrolProcCheckBillSub> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsQC_PatrolProcCheckBillSub>>(jsonString);
+            return list;
+        }
+
+
+        /// <summary>
+        /// 澶勭悊鏂板妯″叿缁翠慨涓昏〃鐨刯son
+        /// </summary>
+        /// <param name="jsonString"></param>
+        /// <returns></returns>
+        public List<Model.ClsSb_MouldRepairWorkBillMain> getObjectByJson_Gy_MouldRepairWorkBillMain(string jsonString)
+        {
+            jsonString = "[" + jsonString.ToString() + "]";
+            List<Model.ClsSb_MouldRepairWorkBillMain> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsSb_MouldRepairWorkBillMain>>(jsonString);
+            return list;
+        }
+
+
+        /// <summary>
+        /// 澶勭悊鏂板妯″叿缁翠慨瀛愯〃鐨刯son
+        /// </summary>
+        /// <param name="jsonString"></param>
+        /// <returns></returns>
+        public List<Model.ClsSb_MouldRepairWorkBillSub> getObjectByJson_Gy_MouldRepairWorkBillSub(string jsonString)
+        {
+            jsonString = "[" + jsonString.ToString() + "]";
+            List<Model.ClsSb_MouldRepairWorkBillSub> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsSb_MouldRepairWorkBillSub>>(jsonString);
+            return list;
+        }
+
     }
 }
\ No newline at end of file
diff --git a/WebAPI/Properties/PublishProfiles/API.pubxml.user b/WebAPI/Properties/PublishProfiles/API.pubxml.user
index 4e6793f..3fa4e06 100644
--- a/WebAPI/Properties/PublishProfiles/API.pubxml.user
+++ b/WebAPI/Properties/PublishProfiles/API.pubxml.user
@@ -7,12 +7,12 @@
   <PropertyGroup>
     <TimeStampOfAssociatedLegacyPublishXmlFile />
     <_PublishTargetUrl>D:\缃戠珯鍙戝竷\鏅轰簯MESWMS\API</_PublishTargetUrl>
-    <History>True|2021-05-17T08:36:00.1226059Z;True|2021-05-17T16:31:05.1414358+08:00;True|2021-05-17T16:22:57.4215158+08:00;True|2021-05-17T16:22:52.6941933+08:00;True|2021-05-17T16:22:49.0033372+08:00;True|2021-05-17T16:18:03.8629751+08:00;True|2021-05-17T15:50:27.6196340+08:00;True|2021-05-17T13:22:15.7308548+08:00;True|2021-05-12T09:19:36.0666124+08:00;True|2021-05-12T09:17:40.0887602+08:00;True|2021-05-12T09:06:24.5508601+08:00;True|2021-05-12T08:39:56.6657894+08:00;True|2021-05-11T17:42:28.6508833+08:00;True|2021-05-11T15:22:03.4937062+08:00;True|2021-05-10T16:45:56.1282466+08:00;True|2021-05-08T19:04:07.1084339+08:00;True|2021-05-08T18:04:40.2166839+08:00;True|2021-05-08T18:04:32.5635574+08:00;True|2021-05-08T18:01:24.5206432+08:00;True|2021-05-08T17:38:05.5582200+08:00;True|2021-05-08T15:26:55.2861241+08:00;True|2021-05-08T14:52:13.1682476+08:00;True|2021-05-08T14:50:30.5356438+08:00;True|2021-05-08T14:38:40.3445313+08:00;True|2021-05-08T14:38:37.9504757+08:00;True|2021-05-08T14:30:31.9762236+08:00;True|2021-05-08T14:21:37.4496495+08:00;True|2021-05-07T20:47:46.1401919+08:00;True|2021-05-07T20:31:45.7777162+08:00;True|2021-05-07T20:31:35.2882424+08:00;True|2021-05-07T20:31:21.5616729+08:00;False|2021-05-07T20:29:33.8855457+08:00;False|2021-05-07T20:28:43.1845420+08:00;False|2021-05-07T20:28:13.1335411+08:00;True|2021-05-07T20:10:01.7346568+08:00;True|2021-05-07T20:03:17.0005596+08:00;True|2021-05-07T09:05:04.3102029+08:00;True|2021-05-06T18:11:36.9078607+08:00;True|2021-05-06T18:08:40.5403791+08:00;True|2021-05-06T18:07:04.1929681+08:00;True|2021-05-06T18:06:54.5987264+08:00;True|2021-05-06T18:05:46.1791578+08:00;True|2021-05-06T17:18:58.8131464+08:00;True|2021-05-06T17:18:37.9969968+08:00;True|2021-05-06T14:47:33.5704679+08:00;True|2021-05-06T10:03:28.7226576+08:00;True|2021-04-28T10:18:54.1336497+08:00;True|2021-04-27T16:34:19.0789205+08:00;True|2021-04-27T14:48:28.8138232+08:00;True|2021-04-27T10:34:03.6370089+08:00;True|2021-04-26T16:18:32.0260755+08:00;True|2021-04-26T15:00:58.6773071+08:00;True|2021-04-26T13:23:50.3968646+08:00;True|2021-04-16T08:50:41.5499248+08:00;True|2021-04-16T08:32:59.1701708+08:00;True|2021-04-16T08:27:36.9176335+08:00;True|2021-04-15T15:56:26.8485667+08:00;True|2021-04-15T15:21:23.2875671+08:00;True|2021-04-15T14:41:16.9980034+08:00;True|2021-04-15T14:36:34.8570017+08:00;True|2021-04-13T16:15:00.7668503+08:00;</History>
+    <History>True|2021-05-23T15:05:37.3855541Z;True|2021-05-22T05:45:13.7439233+08:00;True|2021-05-22T05:42:35.4852011+08:00;True|2021-05-22T05:25:16.8821260+08:00;True|2021-05-21T15:58:20.5625475+08:00;True|2021-05-21T15:55:21.1943961+08:00;True|2021-05-21T15:53:35.6852027+08:00;True|2021-05-21T15:46:56.7370418+08:00;True|2021-05-21T15:32:49.2494690+08:00;True|2021-05-21T15:19:19.8145510+08:00;True|2021-05-21T10:16:44.9563480+08:00;True|2021-05-20T19:21:19.8572280+08:00;True|2021-05-20T19:15:57.2506092+08:00;True|2021-05-20T15:58:09.0123323+08:00;True|2021-05-20T15:54:54.6251445+08:00;True|2021-05-20T15:32:04.9783034+08:00;True|2021-05-20T15:31:58.9418248+08:00;True|2021-05-20T15:31:53.2904235+08:00;True|2021-05-20T15:31:48.5385850+08:00;True|2021-05-20T13:31:35.5777988+08:00;True|2021-05-20T10:46:01.6559203+08:00;True|2021-05-20T10:40:53.2131788+08:00;True|2021-05-20T08:58:49.3511837+08:00;True|2021-05-19T16:15:22.7730518+08:00;True|2021-05-19T16:13:03.2756422+08:00;True|2021-05-19T16:11:16.3163692+08:00;True|2021-05-19T15:31:19.7575868+08:00;True|2021-05-19T14:49:47.6104541+08:00;True|2021-05-19T10:46:17.6515193+08:00;True|2021-05-19T10:45:23.6466498+08:00;True|2021-05-18T17:19:36.9591198+08:00;True|2021-05-18T17:16:38.1513255+08:00;True|2021-05-18T10:31:35.2246444+08:00;True|2021-05-17T16:36:00.1226059+08:00;True|2021-05-17T16:31:05.1414358+08:00;True|2021-05-17T16:22:57.4215158+08:00;True|2021-05-17T16:22:52.6941933+08:00;True|2021-05-17T16:22:49.0033372+08:00;True|2021-05-17T16:18:03.8629751+08:00;True|2021-05-17T15:50:27.6196340+08:00;True|2021-05-17T13:22:15.7308548+08:00;True|2021-05-12T09:19:36.0666124+08:00;True|2021-05-12T09:17:40.0887602+08:00;True|2021-05-12T09:06:24.5508601+08:00;True|2021-05-12T08:39:56.6657894+08:00;True|2021-05-11T17:42:28.6508833+08:00;True|2021-05-11T15:22:03.4937062+08:00;True|2021-05-10T16:45:56.1282466+08:00;True|2021-05-08T19:04:07.1084339+08:00;True|2021-05-08T18:04:40.2166839+08:00;True|2021-05-08T18:04:32.5635574+08:00;True|2021-05-08T18:01:24.5206432+08:00;True|2021-05-08T17:38:05.5582200+08:00;True|2021-05-08T15:26:55.2861241+08:00;True|2021-05-08T14:52:13.1682476+08:00;True|2021-05-08T14:50:30.5356438+08:00;True|2021-05-08T14:38:40.3445313+08:00;True|2021-05-08T14:38:37.9504757+08:00;True|2021-05-08T14:30:31.9762236+08:00;True|2021-05-08T14:21:37.4496495+08:00;True|2021-05-07T20:47:46.1401919+08:00;True|2021-05-07T20:31:45.7777162+08:00;True|2021-05-07T20:31:35.2882424+08:00;True|2021-05-07T20:31:21.5616729+08:00;False|2021-05-07T20:29:33.8855457+08:00;False|2021-05-07T20:28:43.1845420+08:00;False|2021-05-07T20:28:13.1335411+08:00;True|2021-05-07T20:10:01.7346568+08:00;True|2021-05-07T20:03:17.0005596+08:00;True|2021-05-07T09:05:04.3102029+08:00;True|2021-05-06T18:11:36.9078607+08:00;True|2021-05-06T18:08:40.5403791+08:00;True|2021-05-06T18:07:04.1929681+08:00;True|2021-05-06T18:06:54.5987264+08:00;True|2021-05-06T18:05:46.1791578+08:00;True|2021-05-06T17:18:58.8131464+08:00;True|2021-05-06T17:18:37.9969968+08:00;True|2021-05-06T14:47:33.5704679+08:00;True|2021-05-06T10:03:28.7226576+08:00;True|2021-04-28T10:18:54.1336497+08:00;True|2021-04-27T16:34:19.0789205+08:00;True|2021-04-27T14:48:28.8138232+08:00;True|2021-04-27T10:34:03.6370089+08:00;True|2021-04-26T16:18:32.0260755+08:00;True|2021-04-26T15:00:58.6773071+08:00;True|2021-04-26T13:23:50.3968646+08:00;True|2021-04-16T08:50:41.5499248+08:00;True|2021-04-16T08:32:59.1701708+08:00;True|2021-04-16T08:27:36.9176335+08:00;True|2021-04-15T15:56:26.8485667+08:00;True|2021-04-15T15:21:23.2875671+08:00;True|2021-04-15T14:41:16.9980034+08:00;True|2021-04-15T14:36:34.8570017+08:00;True|2021-04-13T16:15:00.7668503+08:00;</History>
   </PropertyGroup>
   <ItemGroup>
     <File Include="apiapp.json">
       <publishTime>04/12/2021 11:33:15</publishTime>
-      <publishTime>05/10/2021 09:27:02</publishTime>
+      <publishTime>05/21/2021 18:05:12</publishTime>
     </File>
     <File Include="bin/Antlr3.Runtime.dll">
       <publishTime>02/22/2013 08:43:40</publishTime>
@@ -27,19 +27,19 @@
       <publishTime>05/07/2021 20:31:20</publishTime>
     </File>
     <File Include="bin/BLL.dll">
-      <publishTime>05/10/2021 09:27:02</publishTime>
+      <publishTime>05/21/2021 18:05:12</publishTime>
     </File>
     <File Include="bin/DAL.dll">
-      <publishTime>05/10/2021 09:27:02</publishTime>
+      <publishTime>05/21/2021 18:05:12</publishTime>
     </File>
     <File Include="bin/Dapper.dll">
       <publishTime>07/22/2016 14:52:40</publishTime>
     </File>
     <File Include="bin/DBUtility.dll">
-      <publishTime>05/10/2021 09:27:02</publishTime>
+      <publishTime>05/21/2021 18:05:12</publishTime>
     </File>
     <File Include="bin/Kingdee.BOS.WebApi.Client.dll">
-      <publishTime>05/10/2021 09:27:02</publishTime>
+      <publishTime>05/21/2021 18:05:12</publishTime>
     </File>
     <File Include="bin/Kingdee.BOS.WebApi.FormService.dll">
       <publishTime>09/20/2018 19:23:20</publishTime>
@@ -57,7 +57,7 @@
       <publishTime>07/25/2012 11:48:56</publishTime>
     </File>
     <File Include="bin/Model.dll">
-      <publishTime>05/10/2021 09:27:02</publishTime>
+      <publishTime>05/21/2021 18:05:12</publishTime>
     </File>
     <File Include="bin/Newtonsoft.Json.dll">
       <publishTime>08/03/2014 20:33:56</publishTime>
@@ -66,13 +66,13 @@
       <publishTime>01/04/2011 13:48:18</publishTime>
     </File>
     <File Include="bin/Pub_Class.dll">
-      <publishTime>05/10/2021 09:27:02</publishTime>
+      <publishTime>05/21/2021 18:05:12</publishTime>
     </File>
     <File Include="bin/Pub_Control.dll">
-      <publishTime>05/10/2021 09:27:02</publishTime>
+      <publishTime>05/21/2021 18:05:12</publishTime>
     </File>
     <File Include="bin/SQLHelper.dll">
-      <publishTime>05/10/2021 09:27:02</publishTime>
+      <publishTime>05/21/2021 18:05:12</publishTime>
     </File>
     <File Include="bin/Swashbuckle.Core.dll">
       <publishTime>02/15/2015 17:57:08</publishTime>
@@ -138,7 +138,7 @@
       <publishTime>11/28/2018 13:01:00</publishTime>
     </File>
     <File Include="bin/System.Web.Http.WebHost.dll">
-      <publishTime>05/10/2021 09:27:02</publishTime>
+      <publishTime>05/21/2021 18:05:12</publishTime>
     </File>
     <File Include="bin/System.Web.Mvc.dll">
       <publishTime>01/28/2015 04:02:18</publishTime>
@@ -171,10 +171,10 @@
       <publishTime>11/24/2014 11:18:48</publishTime>
     </File>
     <File Include="bin/WebAPI.dll">
-      <publishTime>05/24/2021 00:01:16</publishTime>
+      <publishTime>05/23/2021 23:05:31</publishTime>
     </File>
     <File Include="bin/WebAPI.pdb">
-      <publishTime>05/24/2021 00:01:16</publishTime>
+      <publishTime>05/23/2021 23:05:31</publishTime>
     </File>
     <File Include="bin/WebAPI.XmlSerializers.dll">
       <publishTime>02/04/2021 21:35:21</publishTime>
@@ -192,166 +192,166 @@
       <publishTime>03/26/2019 14:23:20</publishTime>
     </File>
     <File Include="Content/bootstrap.css">
-      <publishTime>05/10/2021 09:27:02</publishTime>
+      <publishTime>05/21/2021 18:05:12</publishTime>
     </File>
     <File Include="Content/bootstrap.min.css">
-      <publishTime>05/10/2021 09:27:02</publishTime>
+      <publishTime>05/21/2021 18:05:12</publishTime>
     </File>
     <File Include="Content/Site.css">
-      <publishTime>05/10/2021 09:27:02</publishTime>
+      <publishTime>05/21/2021 18:05:12</publishTime>
     </File>
     <File Include="DLL/BLL.dll">
-      <publishTime>05/10/2021 09:27:02</publishTime>
+      <publishTime>05/21/2021 18:05:12</publishTime>
     </File>
     <File Include="DLL/DAL.dll">
-      <publishTime>05/10/2021 09:27:02</publishTime>
+      <publishTime>05/21/2021 18:05:12</publishTime>
     </File>
     <File Include="DLL/DBUtility.dll">
-      <publishTime>05/10/2021 09:27:02</publishTime>
+      <publishTime>05/21/2021 18:05:12</publishTime>
     </File>
     <File Include="DLL/Kingdee.BOS.WebApi.Client.dll">
-      <publishTime>05/10/2021 09:27:02</publishTime>
+      <publishTime>05/21/2021 18:05:12</publishTime>
     </File>
     <File Include="DLL/Model.dll">
-      <publishTime>05/10/2021 09:27:02</publishTime>
+      <publishTime>05/21/2021 18:05:12</publishTime>
     </File>
     <File Include="DLL/Newtonsoft.Json.Net35.dll">
-      <publishTime>05/10/2021 09:27:02</publishTime>
+      <publishTime>05/21/2021 18:05:12</publishTime>
     </File>
     <File Include="DLL/Pub_Class.dll">
-      <publishTime>05/10/2021 09:27:02</publishTime>
+      <publishTime>05/21/2021 18:05:12</publishTime>
     </File>
     <File Include="DLL/Pub_Control.dll">
-      <publishTime>05/10/2021 09:27:02</publishTime>
+      <publishTime>05/21/2021 18:05:12</publishTime>
     </File>
     <File Include="DLL/SQLHelper.dll">
-      <publishTime>05/10/2021 09:27:02</publishTime>
+      <publishTime>05/21/2021 18:05:12</publishTime>
     </File>
     <File Include="fonts/glyphicons-halflings-regular.eot">
-      <publishTime>05/10/2021 09:27:02</publishTime>
+      <publishTime>05/21/2021 18:05:12</publishTime>
     </File>
     <File Include="fonts/glyphicons-halflings-regular.svg">
-      <publishTime>05/10/2021 09:27:02</publishTime>
+      <publishTime>05/21/2021 18:05:12</publishTime>
     </File>
     <File Include="fonts/glyphicons-halflings-regular.ttf">
-      <publishTime>05/10/2021 09:27:02</publishTime>
+      <publishTime>05/21/2021 18:05:12</publishTime>
     </File>
     <File Include="fonts/glyphicons-halflings-regular.woff">
-      <publishTime>05/10/2021 09:27:02</publishTime>
+      <publishTime>05/21/2021 18:05:12</publishTime>
     </File>
     <File Include="Global.asax">
-      <publishTime>05/10/2021 09:27:02</publishTime>
+      <publishTime>05/21/2021 18:05:12</publishTime>
     </File>
     <File Include="Index.html">
-      <publishTime>05/10/2021 09:27:02</publishTime>
+      <publishTime>05/21/2021 18:05:12</publishTime>
     </File>
     <File Include="Metadata/deploymentTemplates/apiappconfig.azureresource.json">
-      <publishTime>05/10/2021 09:27:02</publishTime>
+      <publishTime>05/21/2021 18:05:12</publishTime>
     </File>
     <File Include="packages.config">
-      <publishTime>05/10/2021 09:27:02</publishTime>
+      <publishTime>05/21/2021 18:05:12</publishTime>
     </File>
     <File Include="PrecompiledApp.config">
       <publishTime>05/07/2021 20:31:19</publishTime>
     </File>
     <File Include="Views/Scripts/bootstrap.js">
-      <publishTime>05/10/2021 09:27:02</publishTime>
+      <publishTime>05/21/2021 18:05:12</publishTime>
     </File>
     <File Include="Views/Scripts/bootstrap.min.js">
-      <publishTime>05/10/2021 09:27:02</publishTime>
+      <publishTime>05/21/2021 18:05:12</publishTime>
     </File>
     <File Include="Views/Scripts/jquery-1.10.2.js">
-      <publishTime>05/10/2021 09:27:02</publishTime>
+      <publishTime>05/21/2021 18:05:12</publishTime>
     </File>
     <File Include="Views/Scripts/jquery-1.10.2.min.js">
-      <publishTime>05/10/2021 09:27:02</publishTime>
+      <publishTime>05/21/2021 18:05:12</publishTime>
     </File>
     <File Include="Views/Scripts/jquery-1.10.2.min.map">
-      <publishTime>05/10/2021 09:27:02</publishTime>
+      <publishTime>05/21/2021 18:05:12</publishTime>
     </File>
     <File Include="Views/Scripts/jquery.validate.js">
-      <publishTime>05/10/2021 09:27:02</publishTime>
+      <publishTime>05/21/2021 18:05:12</publishTime>
     </File>
     <File Include="Views/Scripts/jquery.validate.min.js">
-      <publishTime>05/10/2021 09:27:02</publishTime>
+      <publishTime>05/21/2021 18:05:12</publishTime>
     </File>
     <File Include="Views/Scripts/jquery.validate.unobtrusive.js">
-      <publishTime>05/10/2021 09:27:02</publishTime>
+      <publishTime>05/21/2021 18:05:12</publishTime>
     </File>
     <File Include="Views/Scripts/jquery.validate.unobtrusive.min.js">
-      <publishTime>05/10/2021 09:27:02</publishTime>
+      <publishTime>05/21/2021 18:05:12</publishTime>
     </File>
     <File Include="Views/Scripts/modernizr-2.6.2.js">
-      <publishTime>05/10/2021 09:27:02</publishTime>
+      <publishTime>05/21/2021 18:05:12</publishTime>
     </File>
     <File Include="Views/Shared/Error.cshtml">
-      <publishTime>05/10/2021 09:27:02</publishTime>
+      <publishTime>05/21/2021 18:05:12</publishTime>
     </File>
     <File Include="Views/Shared/_Layout.cshtml">
-      <publishTime>05/10/2021 09:27:02</publishTime>
+      <publishTime>05/21/2021 18:05:12</publishTime>
     </File>
     <File Include="Views/web.config">
-      <publishTime>05/10/2021 09:27:02</publishTime>
+      <publishTime>05/21/2021 18:05:12</publishTime>
     </File>
     <File Include="Views/_ViewStart.cshtml">
-      <publishTime>05/10/2021 09:27:02</publishTime>
+      <publishTime>05/21/2021 18:05:12</publishTime>
     </File>
     <File Include="Web References/WebS/ClsCLD_Customer_Model.datasource">
-      <publishTime>05/10/2021 09:27:02</publishTime>
+      <publishTime>05/21/2021 18:05:12</publishTime>
     </File>
     <File Include="Web References/WebS/ClsCLD_Department_Model.datasource">
-      <publishTime>05/10/2021 09:27:02</publishTime>
+      <publishTime>05/21/2021 18:05:12</publishTime>
     </File>
     <File Include="Web References/WebS/ClsCLD_Employee_Model.datasource">
-      <publishTime>05/10/2021 09:27:02</publishTime>
+      <publishTime>05/21/2021 18:05:12</publishTime>
     </File>
     <File Include="Web References/WebS/ClsCLD_StockPlace_Model.datasource">
-      <publishTime>05/10/2021 09:27:02</publishTime>
+      <publishTime>05/21/2021 18:05:12</publishTime>
     </File>
     <File Include="Web References/WebS/ClsCLD_Supplier_Model.datasource">
-      <publishTime>05/10/2021 09:27:02</publishTime>
+      <publishTime>05/21/2021 18:05:12</publishTime>
     </File>
     <File Include="Web References/WebS/ClsCLD_Warehouse_Model.datasource">
-      <publishTime>05/10/2021 09:27:02</publishTime>
+      <publishTime>05/21/2021 18:05:12</publishTime>
     </File>
     <File Include="Web References/WebS/ClsGy_BadReason_Model.datasource">
-      <publishTime>05/10/2021 09:27:02</publishTime>
+      <publishTime>05/21/2021 18:05:12</publishTime>
     </File>
     <File Include="Web References/WebS/ClsGy_BarCodeBill_WMS_Model_View.datasource">
-      <publishTime>05/10/2021 09:27:02</publishTime>
+      <publishTime>05/21/2021 18:05:12</publishTime>
     </File>
     <File Include="Web References/WebS/ClsGy_Customer_Model.datasource">
-      <publishTime>05/10/2021 09:27:02</publishTime>
+      <publishTime>05/21/2021 18:05:12</publishTime>
     </File>
     <File Include="Web References/WebS/ClsGy_Department_Model.datasource">
-      <publishTime>05/10/2021 09:27:02</publishTime>
+      <publishTime>05/21/2021 18:05:12</publishTime>
     </File>
     <File Include="Web References/WebS/ClsGy_Employee_Model.datasource">
-      <publishTime>05/10/2021 09:27:02</publishTime>
+      <publishTime>05/21/2021 18:05:12</publishTime>
     </File>
     <File Include="Web References/WebS/ClsGy_Group_Model.datasource">
-      <publishTime>05/10/2021 09:27:02</publishTime>
+      <publishTime>05/21/2021 18:05:12</publishTime>
     </File>
     <File Include="Web References/WebS/ClsGy_Item30JiTai_Model.datasource">
-      <publishTime>05/10/2021 09:27:02</publishTime>
+      <publishTime>05/21/2021 18:05:12</publishTime>
     </File>
     <File Include="Web References/WebS/ClsGy_Source_Model.datasource">
-      <publishTime>05/10/2021 09:27:02</publishTime>
+      <publishTime>05/21/2021 18:05:12</publishTime>
     </File>
     <File Include="Web References/WebS/ClsGy_StockPlace_Model.datasource">
-      <publishTime>05/10/2021 09:27:02</publishTime>
+      <publishTime>05/21/2021 18:05:12</publishTime>
     </File>
     <File Include="Web References/WebS/ClsGy_Supplier_Model.datasource">
-      <publishTime>05/10/2021 09:27:02</publishTime>
+      <publishTime>05/21/2021 18:05:12</publishTime>
     </File>
     <File Include="Web References/WebS/ClsGy_Warehouse_Model.datasource">
-      <publishTime>05/10/2021 09:27:02</publishTime>
+      <publishTime>05/21/2021 18:05:12</publishTime>
     </File>
     <File Include="Web References/WebS/ClsKf_ICStockBill_WMS.datasource">
-      <publishTime>05/10/2021 09:27:02</publishTime>
+      <publishTime>05/21/2021 18:05:12</publishTime>
     </File>
     <File Include="Web.config">
-      <publishTime>05/24/2021 00:01:20</publishTime>
+      <publishTime>05/23/2021 23:05:36</publishTime>
     </File>
   </ItemGroup>
 </Project>
\ No newline at end of file
diff --git a/WebAPI/Service/LuBaoSevice.cs b/WebAPI/Service/LuBaoSevice.cs
index 78e912e..2be8d64 100644
--- a/WebAPI/Service/LuBaoSevice.cs
+++ b/WebAPI/Service/LuBaoSevice.cs
@@ -92,5 +92,88 @@
             return dataSet;
         }
 
+
+        /// <summary>
+        /// 妫�楠屾柟妗堟牴鎹甶d鑾峰彇淇℃伅
+        /// </summary>
+        public static ApiResult<DataSet> GetCheckProjectDetail(string HID)
+        {
+            if (string.IsNullOrEmpty(HID))
+                return new ApiResult<DataSet> { code = -1, msg = "ID涓嶈兘涓虹┖" };
+            var dataSet = GetProjectDb(HID);
+            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 };
+        }
+
+        public static DataSet GetProjectDb(string HID)
+        {
+            SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+            var dataSet = oCN.RunProcReturn("select top 1 * from h_v_Gy_Edit_QCCheckProjectList  where hmainid= " + HID +" ", "h_v_Gy_Edit_QCCheckProjectList");
+            return dataSet;
+        }
+
+
+        /// <summary>
+        /// 鏉ユ枡妫�楠屾牴鎹甶d鑾峰彇淇℃伅
+        /// </summary>
+        public static ApiResult<DataSet> GetPOStockInCheckBillDetail(string HID)
+        {
+            if (string.IsNullOrEmpty(HID))
+                return new ApiResult<DataSet> { code = -1, msg = "ID涓嶈兘涓虹┖" };
+            var dataSet = GetPOStockInDb(HID);
+            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 };
+        }
+
+        public static DataSet GetPOStockInDb(string HID)
+        {
+            SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+            var dataSet = oCN.RunProcReturn("select top 1 * from h_v_QC_Edit_POStockInCheckBillList  where hmainid= " + HID + " ", "h_v_QC_Edit_POStockInCheckBillList");
+            return dataSet;
+        }
+
+
+        /// <summary>
+        /// 棣栨枡妫�楠屾牴鎹甶d鑾峰彇淇℃伅
+        /// </summary>
+        public static ApiResult<DataSet> GetQC_FirstPieceCheckBillDetail(string HID)
+        {
+            if (string.IsNullOrEmpty(HID))
+                return new ApiResult<DataSet> { code = -1, msg = "ID涓嶈兘涓虹┖" };
+            var dataSet = GetFirstPieceCheckDb(HID);
+            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 };
+        }
+
+        public static DataSet GetFirstPieceCheckDb(string HID)
+        {
+            SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+            var dataSet = oCN.RunProcReturn("select top 1 * from h_v_QC_Edit_FirstPieceCheckBillList  where hmainid= " + HID + " ", "h_v_QC_Edit_FirstPieceCheckBillList");
+            return dataSet;
+        }
+
+        /// <summary>
+        /// 宸℃鍗曟牴鎹甶d鑾峰彇淇℃伅
+        /// </summary>
+        public static ApiResult<DataSet> GetQC_PatrolProcCheckBillDetail(string HID)
+        {
+            if (string.IsNullOrEmpty(HID))
+                return new ApiResult<DataSet> { code = -1, msg = "ID涓嶈兘涓虹┖" };
+            var dataSet = GetPatrolProcCheckDb(HID);
+            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 };
+        }
+
+        public static DataSet GetPatrolProcCheckDb(string HID)
+        {
+            SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+            var dataSet = oCN.RunProcReturn("select top 1 * from h_v_QC_Edit_PatrolProcCheckBillList  where hmainid= " + HID + " ", "h_v_QC_Edit_PatrolProcCheckBillList");
+            return dataSet;
+        }
+
     }
 }
\ No newline at end of file
diff --git a/WebAPI/WebAPI.csproj b/WebAPI/WebAPI.csproj
index 935f585..8c37107 100644
--- a/WebAPI/WebAPI.csproj
+++ b/WebAPI/WebAPI.csproj
@@ -365,6 +365,7 @@
     <Compile Include="Dapper\SqlPools.cs" />
     <Compile Include="DbUntil\DataFormatUntil.cs" />
     <Compile Include="DLL\ClsQC_NoPassProdCheckBill.cs" />
+    <Compile Include="DLL\ClsQC_PatrolProcCheckBill.cs" />
     <Compile Include="DLL\ClsSc_ProcessReport.cs" />
     <Compile Include="DLL\ClsSc_ProcessSendWork.cs" />
     <Compile Include="DLL\ClsWW_EntrustProcessReportBill.cs" />

--
Gitblit v1.9.1