From 091468bc308c7eb8141b47d02b704f7c53782a76 Mon Sep 17 00:00:00 2001
From: zzr99 <1940172413@qq.com>
Date: 星期四, 02 十二月 2021 17:38:50 +0800
Subject: [PATCH] 器具领用退库单 增加 存储过程 更新 器具档案的 使用寿命、剩余寿命;

---
 WebAPI/Controllers/Sc_MouldRepairInBillListController - .cs |  860 +++++++++++++++++++++++++++++++++++++-------------------
 1 files changed, 563 insertions(+), 297 deletions(-)

diff --git a/WebAPI/Controllers/Sc_MouldRepairInBillListController - .cs b/WebAPI/Controllers/Sc_MouldRepairInBillListController - .cs
index cef2724..7cd5fe5 100644
--- a/WebAPI/Controllers/Sc_MouldRepairInBillListController - .cs
+++ b/WebAPI/Controllers/Sc_MouldRepairInBillListController - .cs
@@ -17,6 +17,8 @@
         private json objJsonResult = new json();
         public DataSet ds = new DataSet();
         public WebServer webserver = new WebServer();
+        public SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
+        SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
 
         public DAL.ClsSc_MouldScrapInBill BillNew0 = new DAL.ClsSc_MouldScrapInBill();   //妯″叿鎶ュ簾鍏ュ簱瀵瑰簲鍗曟嵁绫�
         public DAL.ClsSc_MouldScrapInBill BillOld0 = new DAL.ClsSc_MouldScrapInBill();   //妯″叿鎶ュ簾鍏ュ簱瀵瑰簲鍗曟嵁绫�
@@ -226,9 +228,9 @@
             else
             {
                 string sql1 = "select * from h_v_Sc_MouldMaintain where 1 = 1 ";
-                string sql = sql1 + sWhere+ "order by 鏃ユ湡 desc";
+                string sql = sql1 + sWhere + "order by 鏃ユ湡 desc";
                 return new SQLHelper.ClsCN().RunProcReturn(sql, "h_v_Sc_MouldMaintain");
-              
+
             }
             //return new SQLHelper.ClsCN().RunProcReturn("select * from h_v_Sc_MouldMaintainBillList ", "h_v_Sc_MouldMaintainBillList");
         }
@@ -328,7 +330,7 @@
 
         public static DataSet Sc_MouldDotCheckBillList_s(string sWhere)
         {
-            return new SQLHelper.ClsCN().RunProcReturn("select * from h_v_Sc_MouldDotCheckBillList where 1=1 "+sWhere+ "order by 鏃ユ湡 desc", "h_v_Sc_MouldDotCheckBillList");
+            return new SQLHelper.ClsCN().RunProcReturn("select * from h_v_Sc_MouldDotCheckBillList where 1=1 " + sWhere + "order by 鏃ユ湡 desc", "h_v_Sc_MouldDotCheckBillList");
         }
         #endregion
 
@@ -467,12 +469,12 @@
             DataSet ds;
             if (sWhere == null || sWhere.Equals(""))
             {
-               ds = new SQLHelper.ClsCN().RunProcReturn("select * from h_v_Sc_MouldConkBookBillList order by 鏃ユ湡 desc" + sWhere, "h_v_Sc_MouldConkBookBillList");
+                ds = new SQLHelper.ClsCN().RunProcReturn("select * from h_v_Sc_MouldConkBookBillList order by 鏃ユ湡 desc" + sWhere, "h_v_Sc_MouldConkBookBillList");
             }
             else
             {
                 string sql1 = "select * from h_v_Sc_MouldConkBookBillList where 1 = 1 ";
-                string sql = sql1 + sWhere+ "order by 鏃ユ湡 desc";
+                string sql = sql1 + sWhere + "order by 鏃ユ湡 desc";
                 ds = new SQLHelper.ClsCN().RunProcReturn(sql, "h_v_Sc_MouldConkBookBillList");
             }
             return ds;
@@ -522,7 +524,7 @@
             else
             {
                 string sql1 = "select * from h_v_Sc_MouldRepairCheckBillList_Edit where 1 = 1 ";
-                string sql = sql1 + sWhere+ "order by 鏃ユ湡 desc";
+                string sql = sql1 + sWhere + "order by 鏃ユ湡 desc";
                 ds = new SQLHelper.ClsCN().RunProcReturn(sql, "h_v_Sc_MouldRepairCheckBillList_Edit");
             }
             return ds;
@@ -638,7 +640,7 @@
             else
             {
                 string sql1 = "select * from h_v_Sc_MouldRepairWorkBillList where 1 = 1 ";
-                string sql = sql1 + sWhere+ "order by 鏃ユ湡 desc";
+                string sql = sql1 + sWhere + "order by 鏃ユ湡 desc";
                 return new SQLHelper.ClsCN().RunProcReturn(sql, "h_v_Sc_MouldRepairWorkBillList");
             }
         }
@@ -790,56 +792,6 @@
             return new SQLHelper.ClsCN().RunProcReturn("select * from h_v_IF_MoveStockBillList order by 鏃ユ湡 desc", "h_v_IF_MoveStockBillList");
         }
         #endregion
-
-        /// <summary>
-        /// 鐢熶骇棰嗘枡鍗曞垪琛�
-        /// </summary>
-        /// <returns></returns>
-        [Route("Kf_MateOutBill/GetMateOutBillList")]
-        [HttpGet]
-        public object GetMateOutBillList(string sWhere)
-        {
-            try
-            {
-
-                ds = Sc_GetMateOutBillList(sWhere);
-                if (ds == null || ds.Tables[0].Rows.Count <= 0)
-                {
-                    objJsonResult.code = "0";
-                    objJsonResult.count = 0;
-                    objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�";
-                    objJsonResult.data = null;
-                    return objJsonResult;
-                }
-                else
-                {
-                    objJsonResult.code = "1";
-                    objJsonResult.count = 1;
-                    objJsonResult.Message = "杩斿洖璁板綍鎴愬姛锛�";
-                    objJsonResult.data = ds.Tables[0];
-                    return objJsonResult;
-                }
-            }
-            catch (Exception ex)
-            {
-                objJsonResult.code = "0";
-                objJsonResult.count = 0;
-                objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�" + ex.ToString();
-                objJsonResult.data = null;
-                return objJsonResult;
-            }
-        }
-
-        #region sql璇彞
-
-
-        public static DataSet Sc_GetMateOutBillList(string sWhere)
-        {
-            return new SQLHelper.ClsCN().RunProcReturn("select * from h_v_IF_MateOutBillList order by 鏃ユ湡 desc", "h_v_IF_MateOutBillList");
-        }
-        #endregion
-
-
         /// <summary>
         /// 閿�鍞嚭搴撳崟鍒楄〃
         /// </summary>
@@ -878,7 +830,36 @@
                 return objJsonResult;
             }
         }
-
+        /// <summary>
+        ///閿�鍞嚭搴撳崟鍒犻櫎鍔熻兘
+        /// </summary>
+        /// <returns></returns>
+        [Route("Kf_SellOutBill/DeltetSellOutBill")]
+        [HttpGet]
+        public object DeltetSeOutStockBackBill(string HInterID)
+        {
+            try
+            {
+                oCN.BeginTran();
+                oCN.RunProc("Delete From Kf_ICStockBillMain where HInterID = " + HInterID);
+                oCN.RunProc("Delete From Kf_ICStockBillSub where HInterID = " + HInterID);
+                oCN.Commit();
+                objJsonResult.code = "1";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "鍒犻櫎鎴愬姛锛�";
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+            catch (Exception e)
+            {
+                oCN.RollBack();
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "Exception锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
         #region sql璇彞
 
 
@@ -987,44 +968,44 @@
         #endregion
 
 
-        /// <summary>
-        /// 閲囪喘鍏ュ簱鍗曞垪琛�
-        /// </summary>
-        /// <returns></returns>
-        [Route("Kf_POStockInBill/GetPOStockInBill")]
-        [HttpGet]
-        public object GetPOStockInBill(string sWhere)
-        {
-            try
-            {
+        ///// <summary>
+        ///// 閲囪喘鍏ュ簱鍗曞垪琛�
+        ///// </summary>
+        ///// <returns></returns>
+        //[Route("Kf_POStockInBill/GetPOStockInBill")]
+        //[HttpGet]
+        //public object GetPOStockInBill(string sWhere)
+        //{
+        //    try
+        //    {
 
-                ds = Sc_GetPOStockInBill(sWhere);
-                if (ds == null || ds.Tables[0].Rows.Count <= 0)
-                {
-                    objJsonResult.code = "0";
-                    objJsonResult.count = 0;
-                    objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�";
-                    objJsonResult.data = null;
-                    return objJsonResult;
-                }
-                else
-                {
-                    objJsonResult.code = "1";
-                    objJsonResult.count = 1;
-                    objJsonResult.Message = "杩斿洖璁板綍鎴愬姛锛�";
-                    objJsonResult.data = ds.Tables[0];
-                    return objJsonResult;
-                }
-            }
-            catch (Exception ex)
-            {
-                objJsonResult.code = "0";
-                objJsonResult.count = 0;
-                objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�" + ex.ToString();
-                objJsonResult.data = null;
-                return objJsonResult;
-            }
-        }
+        //        ds = Sc_GetPOStockInBill(sWhere);
+        //        if (ds == null || ds.Tables[0].Rows.Count <= 0)
+        //        {
+        //            objJsonResult.code = "0";
+        //            objJsonResult.count = 0;
+        //            objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�";
+        //            objJsonResult.data = null;
+        //            return objJsonResult;
+        //        }
+        //        else
+        //        {
+        //            objJsonResult.code = "1";
+        //            objJsonResult.count = 1;
+        //            objJsonResult.Message = "杩斿洖璁板綍鎴愬姛锛�";
+        //            objJsonResult.data = ds.Tables[0];
+        //            return objJsonResult;
+        //        }
+        //    }
+        //    catch (Exception ex)
+        //    {
+        //        objJsonResult.code = "0";
+        //        objJsonResult.count = 0;
+        //        objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�" + ex.ToString();
+        //        objJsonResult.data = null;
+        //        return objJsonResult;
+        //    }
+        //}
 
         #region sql璇彞
 
@@ -1075,7 +1056,36 @@
                 return objJsonResult;
             }
         }
-
+        /// <summary>
+        ///浜у搧鍏ュ簱鍗曞垹闄ゅ姛鑳�
+        /// </summary>
+        /// <returns></returns>
+        [Route("Kf_ProductInBill/DeltetProductInBill")]
+        [HttpGet]
+        public object DeltetProductInBill(string HInterID)
+        {
+            try
+            {
+                oCN.BeginTran();
+                oCN.RunProc("Delete From Kf_ICStockBillMain where HInterID = " + HInterID);
+                oCN.RunProc("Delete From Kf_ICStockBillSub where HInterID = " + HInterID);
+                oCN.Commit();
+                objJsonResult.code = "1";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "鍒犻櫎鎴愬姛锛�";
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+            catch (Exception e)
+            {
+                oCN.RollBack();
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "Exception锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
         #region sql璇彞
 
 
@@ -1145,24 +1155,12 @@
         {
             try
             {
-
                 ds = Sc_GetEntrustInBill(sWhere);
-                if (ds == null || ds.Tables[0].Rows.Count <= 0)
-                {
-                    objJsonResult.code = "0";
-                    objJsonResult.count = 0;
-                    objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�";
-                    objJsonResult.data = null;
-                    return objJsonResult;
-                }
-                else
-                {
-                    objJsonResult.code = "1";
-                    objJsonResult.count = 1;
-                    objJsonResult.Message = "杩斿洖璁板綍鎴愬姛锛�";
-                    objJsonResult.data = ds.Tables[0];
-                    return objJsonResult;
-                }
+                objJsonResult.code = "1";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "杩斿洖璁板綍鎴愬姛锛�";
+                objJsonResult.data = ds.Tables[0];
+                return objJsonResult;
             }
             catch (Exception ex)
             {
@@ -1302,10 +1300,6 @@
                     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;       //缁翠慨椤圭洰
@@ -1383,7 +1377,7 @@
                 if (sqlWhere == null || sqlWhere.Equals(""))
                 {
                     //ds = oCN.RunProcReturn("select HRepairID,HRepairExplanation,HManagerID,HMoney,HRemark   from Sc_MouldRepairWorkBillSub", "Sc_MouldRepairWorkBillSub");
-                    ds = oCN.RunProcReturn("select HRepairID, 瀛愮淮淇」鐩唬鐮� HRepairCode,瀛愮淮淇」鐩� HRepairName,瀛愮淮淇姹� HRepairExplanation,HManagerSonID HManagerID,瀛愯礋璐d汉浠g爜 HManagerCode,瀛愯礋璐d汉 HManagerName,缁翠慨璐圭敤 HMoney,琛ㄤ綋澶囨敞 HRemark  from h_v_Sc_MouldRepairWorkBillList_Edit", "h_v_Sc_MouldRepairWorkBillList_Edit");
+                    ds = oCN.RunProcReturn("select HRepairID, 瀛愮淮淇」鐩唬鐮� HRepairCode,瀛愮淮淇」鐩� HRepairName,瀛愮淮淇姹� HRepairExplanation,HManagerSonID HManagerID,瀛愯礋璐d汉浠g爜 HManagerCode,瀛愯礋璐d汉 HManagerName,缁翠慨璐圭敤 HMoney,琛ㄤ綋澶囨敞 HRemark,婧愬崟涓诲唴鐮� HSourceInterID,婧愬崟瀛愬唴鐮� HSourceEntryID,婧愬崟鍗曞彿 HSourceBillNo,婧愬崟绫诲瀷 HSourceBillType   from h_v_Sc_MouldRepairWorkBillList_Edit", "h_v_Sc_MouldRepairWorkBillList_Edit");
                     objJsonResult.code = "0";
                     objJsonResult.count = 1;
                     objJsonResult.Message = "鑾峰彇淇℃伅鎴愬姛锛�";
@@ -1392,7 +1386,7 @@
                 else
                 {
                     //string sql1 = "select HRepairID,HRepairExplanation,HManagerID,HMoney,HRemark  from Sc_MouldRepairWorkBillSub where 1 = 1 ";
-                    string sql1 = "select HRepairID,瀛愮淮淇」鐩唬鐮� HRepairCode,瀛愮淮淇」鐩� HRepairName,瀛愮淮淇姹� HRepairExplanation,HManagerSonID HManagerID,瀛愯礋璐d汉浠g爜 HManagerCode,瀛愯礋璐d汉 HManagerName,缁翠慨璐圭敤 HMoney,琛ㄤ綋澶囨敞 HRemark  from h_v_Sc_MouldRepairWorkBillList_Edit where 1 = 1 ";
+                    string sql1 = "select HRepairID,瀛愮淮淇」鐩唬鐮� HRepairCode,瀛愮淮淇」鐩� HRepairName,瀛愮淮淇姹� HRepairExplanation,HManagerSonID HManagerID,瀛愯礋璐d汉浠g爜 HManagerCode,瀛愯礋璐d汉 HManagerName,缁翠慨璐圭敤 HMoney,琛ㄤ綋澶囨敞 HRemark,婧愬崟涓诲唴鐮� HSourceInterID,婧愬崟瀛愬唴鐮� HSourceEntryID,婧愬崟鍗曞彿 HSourceBillNo,婧愬崟绫诲瀷 HSourceBillType   from h_v_Sc_MouldRepairWorkBillList_Edit where 1 = 1 ";
                     string sql = sql1 + sqlWhere;
                     ds = oCN.RunProcReturn(sql, "h_v_Sc_MouldRepairWorkBillList_Edit");
                     objJsonResult.code = "0";
@@ -1505,7 +1499,7 @@
         public object AuditProcessReportList(int HInterID, int IsAudit, string CurUserName)
         {
             string ModRightNameCheck = "Sb_MouldRepairWorkBill_Check";
-            DBUtility.ClsPub.CurUserName=CurUserName;
+            DBUtility.ClsPub.CurUserName = CurUserName;
             try
             {
                 //瀹℃牳鏉冮檺
@@ -1579,7 +1573,7 @@
                     return objJsonResult;
                 }
                 if (IsAudit == 0) //瀹℃牳鎻愪氦
-                {  
+                {
                     //瀹℃牳鎻愪氦
                     if (oBill.CheckBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo) == true)
                     {
@@ -2356,7 +2350,7 @@
                 SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                 if (sqlWhere == null || sqlWhere.Equals(""))
                 {
-                    ds = oCN.RunProcReturn("select HMaterID,HUnitID,HQty,HQtyMust,HRemark   from Sc_MouldMaintainPlanBillSub", "Sc_MouldMaintainPlanBillSub");
+                    ds = oCN.RunProcReturn("select a.HMaterID,m.HNumber HMaterNumber,a.HUnitID,u.HNumber HUnitNumber,a.HQty,a.HQtyMust,a.HRemark  from Sc_MouldMaintainPlanBillSub a left join Gy_Unit u on a.HUnitID=u.HItemID left join h_v_IF_Material m on a.HMaterID=m.HItemID", "Sc_MouldMaintainPlanBillSub");
                     objJsonResult.code = "0";
                     objJsonResult.count = 1;
                     objJsonResult.Message = "鑾峰彇淇℃伅鎴愬姛锛�";
@@ -2364,7 +2358,7 @@
                 }
                 else
                 {
-                    string sql1 = "select HMaterID,HUnitID,HQty,HQtyMust,HRemark   from Sc_MouldMaintainPlanBillSub where 1 = 1 ";
+                    string sql1 = "select a.HMaterID,m.HNumber HMaterNumber,a.HUnitID,u.HNumber HUnitNumber,a.HQty,a.HQtyMust,a.HRemark  from Sc_MouldMaintainPlanBillSub a left join Gy_Unit u on a.HUnitID=u.HItemID left join h_v_IF_Material m on a.HMaterID=m.HItemID where 1 = 1 ";
                     string sql = sql1 + sqlWhere;
                     ds = oCN.RunProcReturn(sql, "Sc_MouldMaintainPlanBillSub");
                     objJsonResult.code = "0";
@@ -2575,12 +2569,12 @@
                     //oItemSub.HSourceBillNo = "";  //婧愬崟鍗曞彿
                     //oItemSub.HSourceBillType = ""; //婧愬崟绫诲瀷
                     Sub.HRelationQty = 0;     //鍏宠仈鏁伴噺
-                                                   //oItemSub.HRelationMoney = 0;   //鍏宠仈閲戦
-                                                   //HMaterID = "";//閰嶄欢浠g爜
-                                                   //HUnitID = "";//鍗曚綅浠g爜
-                                                   //HQty = "";//瀹為檯鐢ㄩ噺
-                                                   //HQtyMust = "";//鍗曚綅鐢ㄩ噺
-                                                   //HRemark = "";//澶囨敞
+                                              //oItemSub.HRelationMoney = 0;   //鍏宠仈閲戦
+                                              //HMaterID = "";//閰嶄欢浠g爜
+                                              //HUnitID = "";//鍗曚綅浠g爜
+                                              //HQty = "";//瀹為檯鐢ㄩ噺
+                                              //HQtyMust = "";//鍗曚綅鐢ㄩ噺
+                                              //HRemark = "";//澶囨敞
 
                     oBill.DetailColl.Add(Sub);
 
@@ -2686,7 +2680,7 @@
         public object Sc_MouldMaintainBillListProjectDetaiNew(string HInterID)
         {
 
-            DataSet ds,ds1;
+            DataSet ds, ds1;
             List<object> list = new List<object>();
             string Swhere = "";
             try
@@ -2695,7 +2689,7 @@
                 {
                     Swhere = " and hmainid='" + HInterID + "'";
                 }
-                else 
+                else
                 {
                     Swhere = HInterID;
                 }
@@ -2703,7 +2697,7 @@
                 //鑾峰彇淇濆吇椤圭洰缂栬緫鏁版嵁
                 string sql = "select HMaintainItemID, 淇濆吇椤圭洰浠g爜 HMaintainItemNumber,淇濆吇椤圭洰鍚嶇О HMaintainItem,淇濆吇閮ㄤ綅 HMaintainPart,鍏蜂綋瑕佹眰 HClaim,HManagerID,璐熻矗浜轰唬鐮� HManagerNumber,璐熻矗浜� HManagerName,琛ㄤ綋澶囨敞 HRemark  from h_v_Sc_MouldMaintainBillListItem where 1 = 1 " + Swhere + "";
                 ds = oCN.RunProcReturn(sql, "h_v_Sc_MouldMaintainBillListItem");
-               //鑾峰彇閰嶄欢椤圭洰缂栬緫鏁版嵁
+                //鑾峰彇閰嶄欢椤圭洰缂栬緫鏁版嵁
                 string sql1 = "select HMaterID, 閰嶄欢浠g爜 HMaterNumber,閰嶄欢鍚嶇О HMaterName,瑙勬牸鍨嬪彿 HMaterSpec,HUnitID,鍗曚綅浠g爜 HUnitNumber,鍗曚綅鍚嶇О HUnitName,瀹為檯鐢ㄩ噺 HQty,鏍囧噯鐢ㄩ噺 HQtyMust,HManagerID,璐熻矗浜轰唬鐮� HManagerNumber,璐熻矗浜� HManagerName,琛ㄤ綋澶囨敞 HRemark  from h_v_Sc_MouldMaintainBillList where 1 = 1 " + Swhere + "";
                 ds1 = oCN.RunProcReturn(sql1, "h_v_Sc_MouldMaintainBillList");
                 list.Add(ds.Tables[0]);
@@ -2725,11 +2719,11 @@
         #endregion
 
         #region [妯″叿淇濆吇璁板綍琛ㄥ垹闄ゅ姛鑳絔
-            /// <summary>
-            /// 妯″叿缁翠慨鍗曞垹闄ゅ姛鑳�
-            /// </summary>
-            /// <returns></returns>
-            [Route("Sc_MouldMaintainBill/DeltetSc_MouldMaintainBill")]
+        /// <summary>
+        /// 妯″叿缁翠慨鍗曞垹闄ゅ姛鑳�
+        /// </summary>
+        /// <returns></returns>
+        [Route("Sc_MouldMaintainBill/DeltetSc_MouldMaintainBill")]
         [HttpGet]
         public object DeltetSc_MouldMaintainBill(string HInterID)
         {
@@ -2956,7 +2950,7 @@
                 SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                 if (sqlWhere == null || sqlWhere.Equals(""))
                 {
-                    ds = oCN.RunProcReturn("select 鐐规椤圭洰 HDotCheckItem,鐐规閮ㄤ綅 HDotCheckPart,鍏蜂綋瑕佹眰 HClaim,琛ㄤ綋澶囨敞 HRemark,HManagerID,璐熻矗浜轰唬鐮� HManagerNumber,璐熻矗浜� HManagerName from h_v_Sc_MouldDotCheckBillList", "h_v_Sc_MouldDotCheckBillList");
+                    ds = oCN.RunProcReturn("select HDotCheckItemID,鐐规椤圭洰 HDotCheckItem,鐐规閮ㄤ綅 HDotCheckPart,鍏蜂綋瑕佹眰 HClaim,琛ㄤ綋澶囨敞 HRemark,HManagerID,璐熻矗浜轰唬鐮� HManagerNumber,璐熻矗浜� HManagerName from h_v_Sc_MouldDotCheckBillList", "h_v_Sc_MouldDotCheckBillList");
                     objJsonResult.code = "0";
                     objJsonResult.count = 1;
                     objJsonResult.Message = "鑾峰彇淇℃伅鎴愬姛锛�";
@@ -2964,7 +2958,7 @@
                 }
                 else
                 {
-                    string sql1 = "select 鐐规椤圭洰 HDotCheckItem,鐐规閮ㄤ綅 HDotCheckPart,鍏蜂綋瑕佹眰 HClaim,琛ㄤ綋澶囨敞 HRemark,HManagerID,璐熻矗浜轰唬鐮� HManagerNumber,璐熻矗浜� HManagerName from h_v_Sc_MouldDotCheckBillList where 1 = 1 ";
+                    string sql1 = "select HDotCheckItemID,鐐规椤圭洰 HDotCheckItem,鐐规閮ㄤ綅 HDotCheckPart,鍏蜂綋瑕佹眰 HClaim,琛ㄤ綋澶囨敞 HRemark,HManagerID,璐熻矗浜轰唬鐮� HManagerNumber,璐熻矗浜� HManagerName from h_v_Sc_MouldDotCheckBillList where 1 = 1 ";
                     string sql = sql1 + sqlWhere;
                     ds = oCN.RunProcReturn(sql, "h_v_Sc_MouldDotCheckBillList");
                     objJsonResult.code = "0";
@@ -3228,7 +3222,7 @@
                 SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                 if (sqlWhere == null || sqlWhere.Equals(""))
                 {
-                    ds = oCN.RunProcReturn("select HDotCheckItem,HDotCheckPart,HClaim,HRemark,HManagerID from Sc_MouldDotCheckPlanBillSub", "Sc_MouldDotCheckPlanBillSub");
+                    ds = oCN.RunProcReturn("select HDotCheckItem, HDotCheckPart , HClaim, a.HRemark,a.HManagerID,e.HNumber HManagerCode,e.HName HManagerName from Sc_MouldDotCheckPlanBillSub a left join Gy_Employee e on a.HManagerID=e.HItemID", "Sc_MouldDotCheckPlanBillSub");
                     objJsonResult.code = "0";
                     objJsonResult.count = 1;
                     objJsonResult.Message = "鑾峰彇淇℃伅鎴愬姛锛�";
@@ -3236,7 +3230,7 @@
                 }
                 else
                 {
-                    string sql1 = "select HDotCheckItem,HDotCheckPart,HClaim,HRemark,HManagerID from Sc_MouldDotCheckPlanBillSub where 1 = 1 ";
+                    string sql1 = "select HDotCheckItem, HDotCheckPart , HClaim, a.HRemark,a.HManagerID,e.HNumber HManagerCode,e.HName HManagerName from Sc_MouldDotCheckPlanBillSub a left join Gy_Employee e on a.HManagerID=e.HItemID where 1 = 1 ";
                     string sql = sql1 + sqlWhere;
                     ds = oCN.RunProcReturn(sql, "Sc_MouldDotCheckPlanBillSub");
                     objJsonResult.code = "0";
@@ -3367,6 +3361,8 @@
         public object Sc_MouldScrapInHouseBillListProjectDetai(string sqlWhere)
         {
             DataSet ds;
+            DataSet ds1;
+            List<object> list = new List<object>();
             try
             {
                 SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
@@ -3378,10 +3374,6 @@
                                             HSPID, 浠撲綅浠g爜 HSPCode, 浠撲綅鍚嶇О HSPName, 澶囨敞 HRemark,HStockOrgID
                                             FROM h_v_Sc_MouldScrapInHouseBillList"), "h_v_Sc_MouldScrapInHouseBillList");
 
-                    objJsonResult.code = "0";
-                    objJsonResult.count = 1;
-                    objJsonResult.Message = "鑾峰彇淇℃伅鎴愬姛锛�";
-                    objJsonResult.data = ds.Tables[0];
                 }
                 else
                 {
@@ -3395,11 +3387,18 @@
                     string sql = sql1 + sqlWhere;
                     ds = oCN.RunProcReturn(sql, "h_v_Sc_MouldScrapInHouseBillList");
 
-                    objJsonResult.code = "0";
-                    objJsonResult.count = 1;
-                    objJsonResult.Message = "鑾峰彇淇℃伅鎴愬姛锛�";
-                    objJsonResult.data = ds.Tables[0];
                 }
+                //鏌ユ眹鎬�
+                ds1 = oCN.RunProcReturn(string.Format(@"select  鐗╂枡浠g爜,max(鐗╂枡鍚嶇О)鐗╂枡鍚嶇О,瑙勬牸鍨嬪彿,max(鍗曟嵁鍙�)鍗曟嵁鍙�,鎵规,sum(瀹炴敹鏁伴噺)瀹炴敹鏁伴噺,
+                                            hwhid1,max(鏀舵枡浠撳簱浠g爜)鏀舵枡浠撳簱浠g爜,max(鏀舵枡浠撳簱鍚嶇О)鏀舵枡浠撳簱鍚嶇О,瀛愬娉� from h_v_Sc_MouldScrapInHouseBillList 
+                                            where 1=1 " + sqlWhere + " group by 鐗╂枡浠g爜,瑙勬牸鍨嬪彿,hwhid1,鎵规,瀛愬娉�"), "h_v_Sc_MouldScrapInHouseBillList");
+
+                list.Add(ds.Tables[0]);
+                list.Add(ds1.Tables[0]);
+                objJsonResult.code = "0";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "鑾峰彇淇℃伅鎴愬姛锛�";
+                objJsonResult.list = list;
             }
             catch (Exception e)
             {
@@ -3673,7 +3672,7 @@
                     oBill.omodel = oItem;
                 }
                 //瀛愯〃浣撴暟鎹�
- 
+
                 List<Models.ClsSc_MouldStockBillSub> ls = new List<Models.ClsSc_MouldStockBillSub>();
                 ls = oListModels.getObjectByJson_Gy_MouldScrapInHouseBillSub(msg2);
                 int i = 0;
@@ -3751,7 +3750,7 @@
 
         [Route("Sc_MouldScrapOutHouseBill/GetMouldScrapOutHouseBill")]
         [HttpGet]
-        public object GetMouldScrapOutHouseBill(string sWhere,string user, string Organization)
+        public object GetMouldScrapOutHouseBill(string sWhere, string user, string Organization)
         {
             try
             {
@@ -3765,7 +3764,7 @@
                     return objJsonResult;
                 }
 
-                ds = Sc_GetMouldScrapOutHouseBill(sWhere,Organization);
+                ds = Sc_GetMouldScrapOutHouseBill(sWhere, Organization);
                 objJsonResult.code = "1";
                 objJsonResult.count = 1;
                 objJsonResult.Message = "杩斿洖璁板綍鎴愬姛锛�";
@@ -3787,11 +3786,11 @@
             string sql1 = string.Format(@"select * from h_v_Sc_MouldScrapOutHouseBillList where 搴撳瓨缁勭粐='" + Organization + "'");
             if (sWhere == null || sWhere.Equals(""))
             {
-                return new SQLHelper.ClsCN().RunProcReturn(sql1+ "order by 鏃ユ湡 desc", "h_v_Sc_MouldScrapOutHouseBillList");
+                return new SQLHelper.ClsCN().RunProcReturn(sql1 + "order by 鏃ユ湡 desc", "h_v_Sc_MouldScrapOutHouseBillList");
             }
             else
             {
-                string sql = sql1 + sWhere+ "order by 鏃ユ湡 desc";
+                string sql = sql1 + sWhere + "order by 鏃ユ湡 desc";
                 return new SQLHelper.ClsCN().RunProcReturn(sql, "h_v_Sc_MouldScrapOutHouseBillList");
             }
         }
@@ -3821,6 +3820,8 @@
         public object Sc_MouldScrapOutHouseBillListProjectDetai(string sqlWhere)
         {
             DataSet ds;
+            DataSet ds1;
+            List<object> list = new List<object>();
             try
             {
                 SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
@@ -3831,10 +3832,6 @@
                                                   璁捐瀵垮懡 HDesignLife, 鍓╀綑瀵垮懡 HLeaveLife, 浣跨敤瀵垮懡 HUseLife, 瀹炲彂鏁伴噺 HQty, 鍗曚环 HPrice, 閲戦 HMoney, HWHID, 鍙戣揣浠撳簱浠g爜 HWHCode, 鍙戣揣浠撳簱鍚嶇О HWHName,
                                                   HSPID, 浠撲綅浠g爜 HSPCode, 浠撲綅鍚嶇О HSPName, 澶囨敞 HRemark,HStockOrgID FROM h_v_Sc_MouldScrapOutHouseBillList"), "h_v_Sc_MouldScrapOutHouseBillList");
 
-                    objJsonResult.code = "0";
-                    objJsonResult.count = 1;
-                    objJsonResult.Message = "鑾峰彇淇℃伅鎴愬姛锛�";
-                    objJsonResult.data = ds.Tables[0];
                 }
                 else
                 {
@@ -3847,11 +3844,18 @@
                     string sql = sql1 + sqlWhere;
                     ds = oCN.RunProcReturn(sql, "h_v_Sc_MouldScrapOutHouseBillList");
 
-                    objJsonResult.code = "0";
-                    objJsonResult.count = 1;
-                    objJsonResult.Message = "鑾峰彇淇℃伅鎴愬姛锛�";
-                    objJsonResult.data = ds.Tables[0];
                 }
+                //鏌ユ眹鎬�
+                ds1 = oCN.RunProcReturn(string.Format(@"select  鐗╂枡浠g爜,max(鐗╂枡鍚嶇О)鐗╂枡鍚嶇О,瑙勬牸鍨嬪彿,max(鍗曟嵁鍙�)鍗曟嵁鍙�,鎵规,sum(瀹炲彂鏁伴噺)瀹炲彂鏁伴噺,
+                                            hwhid1,max(鍙戣揣浠撳簱浠g爜)鍙戣揣浠撳簱浠g爜,max(鍙戣揣浠撳簱鍚嶇О)鍙戣揣浠撳簱鍚嶇О,瀛愬娉� from h_v_Sc_MouldScrapOutHouseBillList 
+                                            where 1=1 " + sqlWhere + " group by 鐗╂枡浠g爜,瑙勬牸鍨嬪彿,hwhid1,鎵规,瀛愬娉�"), "h_v_Sc_MouldScrapOutHouseBillList");
+
+                list.Add(ds.Tables[0]);
+                list.Add(ds1.Tables[0]);
+                objJsonResult.code = "0";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "鑾峰彇淇℃伅鎴愬姛锛�";
+                objJsonResult.list = list;
             }
             catch (Exception e)
             {
@@ -4016,7 +4020,7 @@
         /// <returns></returns>
         [Route("Sc_MouldScrapOutHouseBill/DeltetMouldScrapOutHouseBill")]
         [HttpGet]
-        public object DeltetMouldScrapOutHouseBill(string HInterID,string user)
+        public object DeltetMouldScrapOutHouseBill(string HInterID, string user)
         {
             //缂栬緫鏉冮檺
             if (!DBUtility.ClsPub.Security_Log("Sc_MouldScrapOutBill_Delete", 1, true, user))
@@ -4089,139 +4093,223 @@
         }
         #endregion
 
-        #region [妯″叿澶勭悊鍑哄簱鍗曞鏍搞�佸弽瀹℃牳]
-        /// <summary>
-        /// 
-        /// </summary>
-        /// <param name="HInterID">鍗曟嵁ID</param>
-        /// <param name="IsAudit">瀹℃牳(0),鍙嶅鏍�(1)</param>
-        /// <param name="CurUserName">瀹℃牳浜�</param>
-        /// <returns></returns>
-        [Route("Sc_MouldScrapOutHouseBill/AuditMouldScrapOutList")]
+        //#region [妯″叿澶勭悊鍑哄簱鍗曞鏍搞�佸弽瀹℃牳]
+        ///// <summary>
+        ///// 
+        ///// </summary>
+        ///// <param name="HInterID">鍗曟嵁ID</param>
+        ///// <param name="IsAudit">瀹℃牳(0),鍙嶅鏍�(1)</param>
+        ///// <param name="CurUserName">瀹℃牳浜�</param>
+        ///// <returns></returns>
+        //[Route("Sc_MouldScrapOutHouseBill/AuditMouldScrapOutList")]
+        //[HttpGet]
+        //public object AuditMouldScrapOutList(int HInterID, int IsAudit, string CurUserName)
+        //{
+        //    string ModRightNameCheck = "Sc_MouldScrapOutBill_Check";
+        //    DBUtility.ClsPub.CurUserName = CurUserName;
+        //    try
+        //    {
+        //        //瀹℃牳鏉冮檺
+        //        if (!DBUtility.ClsPub.Security_Log(ModRightNameCheck, 1, true, CurUserName))
+        //        {
+        //            objJsonResult.code = "0";
+        //            objJsonResult.count = 0;
+        //            objJsonResult.Message = "瀹℃牳澶辫触锛佹棤鏉冮檺锛�";
+        //            objJsonResult.data = null;
+        //            return objJsonResult;
+        //        }
+        //        if (HInterID <= 0)
+        //        {
+        //            objJsonResult.code = "0";
+        //            objJsonResult.count = 0;
+        //            objJsonResult.Message = "HInterID灏忎簬0锛�";
+        //            objJsonResult.data = null;
+        //            return objJsonResult;
+        //        }
+        //        Int64 lngBillKey = 0;
+        //        lngBillKey = DBUtility.ClsPub.isLong(HInterID);
+        //        DLL.ClsSc_MouldScrapOutBill oBill = new DLL.ClsSc_MouldScrapOutBill();
+        //        //鏌ョ湅鏄惁宸插鏍�,鍏抽棴,浣滃簾
+        //        if (oBill.ShowBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo))
+        //        {
+        //            if (oBill.omodel.HCloseMan.Trim() != "")
+        //            {
+        //                objJsonResult.code = "0";
+        //                objJsonResult.count = 0;
+        //                objJsonResult.Message = "鍗曟嵁宸插叧闂�!涓嶈兘鍐嶆瀹℃牳锛�";
+        //                objJsonResult.data = null;
+        //                return objJsonResult;
+        //            }
+        //            if (oBill.omodel.HDeleteMan.Trim() != "")
+        //            {
+        //                objJsonResult.code = "0";
+        //                objJsonResult.count = 0;
+        //                objJsonResult.Message = "鍗曟嵁宸蹭綔搴�!涓嶈兘鍐嶆瀹℃牳锛�";
+        //                objJsonResult.data = null;
+        //                return objJsonResult;
+        //            }
+        //            if (IsAudit == 0)  //瀹℃牳鍒ゆ柇
+        //            {
+        //                if (oBill.omodel.HChecker.Trim() != "")
+        //                {
+        //                    objJsonResult.code = "0";
+        //                    objJsonResult.count = 0;
+        //                    objJsonResult.Message = "鍗曟嵁宸插鏍�!涓嶈兘鍐嶆瀹℃牳锛�";
+        //                    objJsonResult.data = null;
+        //                    return objJsonResult;
+        //                }
+        //            }
+        //            if (IsAudit == 1) //鍙嶅鏍稿垽鏂�
+        //            {
+        //                if (oBill.omodel.HChecker.Trim() == "")
+        //                {
+        //                    objJsonResult.code = "0";
+        //                    objJsonResult.count = 0;
+        //                    objJsonResult.Message = "鍗曟嵁鏈鏍�!涓嶉渶瑕佸弽瀹℃牳!";
+        //                    objJsonResult.data = null;
+        //                    return objJsonResult;
+        //                }
+        //            }
+        //        }
+        //        else
+        //        {
+        //            objJsonResult.code = "0";
+        //            objJsonResult.count = 0;
+        //            objJsonResult.Message = "鍗曟嵁涓嶅瓨鍦�!鍘熷洜:" + DBUtility.ClsPub.sExeReturnInfo;
+        //            objJsonResult.data = null;
+        //            return objJsonResult;
+        //        }
+        //        if (IsAudit == 0) //瀹℃牳鎻愪氦
+        //        {
+        //            //瀹℃牳鎻愪氦
+        //            if (oBill.CheckBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo) == true)
+        //            {
+        //                objJsonResult.code = "1";
+        //                objJsonResult.count = 1;
+        //                objJsonResult.Message = "瀹℃牳鎴愬姛";
+        //                objJsonResult.data = null;
+        //                return objJsonResult;
+        //            }
+        //            else
+        //            {
+        //                objJsonResult.code = "0";
+        //                objJsonResult.count = 0;
+        //                objJsonResult.Message = "瀹℃牳澶辫触!鍘熷洜:" + DBUtility.ClsPub.sExeReturnInfo;
+        //                objJsonResult.data = null;
+        //                return objJsonResult;
+        //            }
+        //        }
+        //        if (IsAudit == 1) //鍙嶅鏍告彁浜�
+        //        {
+        //            //鍙嶅鏍告彁浜bandonCheck
+        //            if (oBill.AbandonCheck(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo) == true)
+        //            {
+        //                objJsonResult.code = "1";
+        //                objJsonResult.count = 1;
+        //                objJsonResult.Message = "鍙嶅鏍告垚鍔�";
+        //                objJsonResult.data = null;
+        //                return objJsonResult;
+        //            }
+        //            else
+        //            {
+        //                objJsonResult.code = "0";
+        //                objJsonResult.count = 0;
+        //                objJsonResult.Message = "鍙嶅鏍稿け璐�!鍘熷洜:" + DBUtility.ClsPub.sExeReturnInfo;
+        //                objJsonResult.data = null;
+        //                return objJsonResult;
+        //            }
+        //        }
+        //        return objJsonResult;
+        //    }
+        //    catch (Exception e)
+        //    {
+        //        objJsonResult.code = "0";
+        //        objJsonResult.count = 0;
+        //        objJsonResult.Message = "瀹℃牳澶辫触鎴栬�呭弽瀹℃牳澶辫触锛�" + e.ToString();
+        //        objJsonResult.data = null;
+        //        return objJsonResult;
+        //    }
+        //}
+        //#endregion
+
+        #region 鍣ㄥ叿澶勭悊鍑哄簱鍗曞鏍�/鍙嶅鏍�
+        [Route("Sc_MouldScrapOutHouseBill/AuditMouldScrapOutHouseBill")]
         [HttpGet]
-        public object AuditMouldScrapOutList(int HInterID, int IsAudit, string CurUserName)
+        public object AuditMouldScrapOutHouseBill(string HInterID, string user, int flag)
         {
-            string ModRightNameCheck = "Sc_MouldScrapOutBill_Check";
-            DBUtility.ClsPub.CurUserName = CurUserName;
-            try
+            //flag=1 瀹℃牳锛�  flag=2 鍙嶅鏍�
+            //缂栬緫鏉冮檺
+            if (!DBUtility.ClsPub.Security_Log_second("Sc_MouldScrapOutBill_Check", 1, true, user))
             {
-                //瀹℃牳鏉冮檺
-                if (!DBUtility.ClsPub.Security_Log(ModRightNameCheck, 1, true, 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;
+            }
+            DLL.ClsSc_MouldProdOutBill oBill = new DLL.ClsSc_MouldProdOutBill();
+            if (oBill.ShowBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo))
+            {
+                if (flag == 1)
                 {
-                    objJsonResult.code = "0";
-                    objJsonResult.count = 0;
-                    objJsonResult.Message = "瀹℃牳澶辫触锛佹棤鏉冮檺锛�";
-                    objJsonResult.data = null;
-                    return objJsonResult;
-                }
-                if (HInterID <= 0)
-                {
-                    objJsonResult.code = "0";
-                    objJsonResult.count = 0;
-                    objJsonResult.Message = "HInterID灏忎簬0锛�";
-                    objJsonResult.data = null;
-                    return objJsonResult;
-                }
-                Int64 lngBillKey = 0;
-                lngBillKey = DBUtility.ClsPub.isLong(HInterID);
-                DLL.ClsSc_MouldScrapOutBill oBill = new DLL.ClsSc_MouldScrapOutBill();
-                //鏌ョ湅鏄惁宸插鏍�,鍏抽棴,浣滃簾
-                if (oBill.ShowBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo))
-                {
-                    if (oBill.omodel.HCloseMan.Trim() != "")
+                    if (oBill.omodel.HBillStatus == 2)
                     {
                         objJsonResult.code = "0";
                         objJsonResult.count = 0;
-                        objJsonResult.Message = "鍗曟嵁宸插叧闂�!涓嶈兘鍐嶆瀹℃牳锛�";
+                        objJsonResult.Message = "褰撳墠鍗曟嵁宸插鏍革紝鏃犻渶鍐嶆瀹℃牳";
                         objJsonResult.data = null;
                         return objJsonResult;
                     }
-                    if (oBill.omodel.HDeleteMan.Trim() != "")
+                    else
                     {
+                        string HCheckDate = DateTime.Now.Date.ToString();
+                        oCn.RunProc(" Update Sc_MouldStockBillMain set HChecker ='" + user + "',HCheckDate='" + HCheckDate + "',HBillStatus=2 Where HBillType='3832' and HInterID=" + HInterID);
                         objJsonResult.code = "0";
-                        objJsonResult.count = 0;
-                        objJsonResult.Message = "鍗曟嵁宸蹭綔搴�!涓嶈兘鍐嶆瀹℃牳锛�";
-                        objJsonResult.data = null;
+                        objJsonResult.count = 1;
+                        objJsonResult.Message = "瀹℃牳鎴愬姛锛�";
+                        objJsonResult.data = 1;
                         return objJsonResult;
-                    }
-                    if (IsAudit == 0)  //瀹℃牳鍒ゆ柇
-                    {
-                        if (oBill.omodel.HChecker.Trim() != "")
-                        {
-                            objJsonResult.code = "0";
-                            objJsonResult.count = 0;
-                            objJsonResult.Message = "鍗曟嵁宸插鏍�!涓嶈兘鍐嶆瀹℃牳锛�";
-                            objJsonResult.data = null;
-                            return objJsonResult;
-                        }
-                    }
-                    if (IsAudit == 1) //鍙嶅鏍稿垽鏂�
-                    {
-                        if (oBill.omodel.HChecker.Trim() == "")
-                        {
-                            objJsonResult.code = "0";
-                            objJsonResult.count = 0;
-                            objJsonResult.Message = "鍗曟嵁鏈鏍�!涓嶉渶瑕佸弽瀹℃牳!";
-                            objJsonResult.data = null;
-                            return objJsonResult;
-                        }
                     }
                 }
                 else
                 {
-                    objJsonResult.code = "0";
-                    objJsonResult.count = 0;
-                    objJsonResult.Message = "鍗曟嵁涓嶅瓨鍦�!鍘熷洜:" + DBUtility.ClsPub.sExeReturnInfo;
-                    objJsonResult.data = null;
-                    return objJsonResult;
-                }
-                if (IsAudit == 0) //瀹℃牳鎻愪氦
-                {
-                    //瀹℃牳鎻愪氦
-                    if (oBill.CheckBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo) == true)
+                    if (oBill.omodel.HBillStatus == 1)
                     {
-                        objJsonResult.code = "1";
-                        objJsonResult.count = 1;
-                        objJsonResult.Message = "瀹℃牳鎴愬姛";
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "褰撳墠鍗曟嵁鏈鏍革紝鏃犻渶鍙嶅鏍�";
                         objJsonResult.data = null;
                         return objJsonResult;
                     }
                     else
                     {
+                        string HCheckDate = DateTime.Now.Date.ToString();
+                        oCn.RunProc(" Update Sc_MouldStockBillMain set HChecker=' ',HCheckDate=' ',HBillStatus=1 Where HBillType='3832' and HInterID=" + HInterID);
                         objJsonResult.code = "0";
-                        objJsonResult.count = 0;
-                        objJsonResult.Message = "瀹℃牳澶辫触!鍘熷洜:" + DBUtility.ClsPub.sExeReturnInfo;
-                        objJsonResult.data = null;
-                        return objJsonResult;
-                    }
-                }
-                if (IsAudit == 1) //鍙嶅鏍告彁浜�
-                {
-                    //鍙嶅鏍告彁浜bandonCheck
-                    if (oBill.AbandonCheck(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo) == true)
-                    {
-                        objJsonResult.code = "1";
                         objJsonResult.count = 1;
-                        objJsonResult.Message = "鍙嶅鏍告垚鍔�";
-                        objJsonResult.data = null;
-                        return objJsonResult;
-                    }
-                    else
-                    {
-                        objJsonResult.code = "0";
-                        objJsonResult.count = 0;
-                        objJsonResult.Message = "鍙嶅鏍稿け璐�!鍘熷洜:" + DBUtility.ClsPub.sExeReturnInfo;
-                        objJsonResult.data = null;
+                        objJsonResult.Message = "鍙嶅鏍告垚鍔燂紒";
+                        objJsonResult.data = 1;
                         return objJsonResult;
                     }
                 }
-                return objJsonResult;
+
             }
-            catch (Exception e)
+            else
             {
                 objJsonResult.code = "0";
                 objJsonResult.count = 0;
-                objJsonResult.Message = "瀹℃牳澶辫触鎴栬�呭弽瀹℃牳澶辫触锛�" + e.ToString();
+                objJsonResult.Message = "鍗曟嵁鏈壘鍒�";
                 objJsonResult.data = null;
                 return objJsonResult;
             }
@@ -4236,7 +4324,7 @@
 
         [Route("Sc_MouldProdBackBill/GetMouldProdBackBill")]
         [HttpGet]
-        public object GetMouldProdBackBill(string sWhere,string user, string Organization)
+        public object GetMouldProdBackBill(string sWhere, string user, string Organization)
         {
             try
             {
@@ -4249,7 +4337,7 @@
                     return objJsonResult;
                 }
 
-                ds = Sc_GetMouldProdBackBill(sWhere,Organization);
+                ds = Sc_GetMouldProdBackBill(sWhere, Organization);
                 objJsonResult.code = "1";
                 objJsonResult.count = 1;
                 objJsonResult.Message = "杩斿洖璁板綍鎴愬姛锛�";
@@ -4266,7 +4354,7 @@
             }
         }
 
-        public static DataSet Sc_GetMouldProdBackBill(string sWhere,string Organization)
+        public static DataSet Sc_GetMouldProdBackBill(string sWhere, string Organization)
         {
             string sql1 = string.Format(@"select * from h_v_Sc_MouldProdBackBillList where 搴撳瓨缁勭粐='" + Organization + "'");
             if (sWhere == null || sWhere.Equals(""))
@@ -4275,7 +4363,7 @@
             }
             else
             {
-                string sql = sql1 + sWhere+ "order by 鏃ユ湡 desc";
+                string sql = sql1 + sWhere + "order by 鏃ユ湡 desc";
                 return new SQLHelper.ClsCN().RunProcReturn(sql, "h_v_Sc_MouldProdBackBillList");
             }
 
@@ -4306,6 +4394,8 @@
         public object Sc_MouldProdBackBillListProjectDetai(string sqlWhere)
         {
             DataSet ds;
+            DataSet ds1;
+            List<object> list = new List<object>();
             try
             {
                 SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
@@ -4314,12 +4404,8 @@
                     ds = oCN.RunProcReturn(string.Format(@"SELECT HMaterID,妯″叿浠g爜 HMaterCode,妯″叿鍚嶇О HMaterName,瑙勬牸鍨嬪彿 HMaterSpec,鎵规 HBatchNo,
                                                 璁捐瀵垮懡 HDesignLife, 鍓╀綑瀵垮懡 HLeaveLife, 绱Н浣跨敤瀵垮懡 HUseLife, 搴斿彂鏁伴噺 HQtyMust, 瀹炲彂鏁伴噺 HQty, 
                                                 鍗曚环 HPrice, 閲戦 HMoney,HWHSonID HWHID, 鍙戞枡浠撳簱浠g爜 HWHCode, 鍙戞枡浠撳簱 HWHName,HSPID, 
-                                                浠撲綅浠g爜 HSPCode, 浠撲綅 HSPName,琛ㄤ綋澶囨敞 HRemark,HStockOrgID FROM h_v_Sc_MouldProdBackBillList"), "h_v_Sc_MouldProdBackBillList");
+                                                浠撲綅浠g爜 HSPCode, 浠撲綅 HSPName,琛ㄤ綋澶囨敞 HRemark,HStockOrgID,HUnitID,璁¢噺鍗曚綅浠g爜,璁¢噺鍗曚綅 FROM h_v_Sc_MouldProdBackBillList"), "h_v_Sc_MouldProdBackBillList");
 
-                    objJsonResult.code = "0";
-                    objJsonResult.count = 1;
-                    objJsonResult.Message = "鑾峰彇淇℃伅鎴愬姛锛�";
-                    objJsonResult.data = ds.Tables[0];
                 }
                 else
                 {
@@ -4328,15 +4414,22 @@
                     string sql1 = string.Format(@"SELECT HMaterID,妯″叿浠g爜 HMaterCode,妯″叿鍚嶇О HMaterName,瑙勬牸鍨嬪彿 HMaterSpec,鎵规 HBatchNo,
                                                 璁捐瀵垮懡 HDesignLife, 鍓╀綑瀵垮懡 HLeaveLife, 绱Н浣跨敤瀵垮懡 HUseLife, 搴斿彂鏁伴噺 HQtyMust, 瀹炲彂鏁伴噺 HQty, 
                                                 鍗曚环 HPrice, 閲戦 HMoney,HWHSonID HWHID, 鍙戞枡浠撳簱浠g爜 HWHCode, 鍙戞枡浠撳簱 HWHName,HSPID, 
-                                                浠撲綅浠g爜 HSPCode, 浠撲綅 HSPName,琛ㄤ綋澶囨敞 HRemark,HStockOrgID FROM h_v_Sc_MouldProdBackBillList where 1 = 1 ");
+                                                浠撲綅浠g爜 HSPCode, 浠撲綅 HSPName,琛ㄤ綋澶囨敞 HRemark,HStockOrgID,HUnitID,璁¢噺鍗曚綅浠g爜,璁¢噺鍗曚綅 FROM h_v_Sc_MouldProdBackBillList where 1 = 1 ");
                     string sql = sql1 + sqlWhere;
                     ds = oCN.RunProcReturn(sql, "h_v_Sc_MouldProdBackBillList");
 
-                    objJsonResult.code = "0";
-                    objJsonResult.count = 1;
-                    objJsonResult.Message = "鑾峰彇淇℃伅鎴愬姛锛�";
-                    objJsonResult.data = ds.Tables[0];
                 }
+                //鏌ユ眹鎬�
+                ds1 = oCN.RunProcReturn(string.Format(@"select  鐗╂枡浠g爜,max(鐗╂枡鍚嶇О)鐗╂枡鍚嶇О,瑙勬牸鍨嬪彿,max(鍗曟嵁鍙�)鍗曟嵁鍙�,鎵规,sum(瀹炲彂鏁伴噺)瀹炲彂鏁伴噺,
+                                            HWHSonID,max(鍙戞枡浠撳簱浠g爜)鍙戞枡浠撳簱浠g爜,max(鍙戞枡浠撳簱)鍙戞枡浠撳簱,琛ㄤ綋澶囨敞 from h_v_Sc_MouldProdBackBillList 
+                                            where 1=1 " + sqlWhere + " group by 鐗╂枡浠g爜,瑙勬牸鍨嬪彿,HWHSonID,鎵规,琛ㄤ綋澶囨敞"), "h_v_Sc_MouldProdBackBillList");
+
+                list.Add(ds.Tables[0]);
+                list.Add(ds1.Tables[0]);
+                objJsonResult.code = "0";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "鑾峰彇淇℃伅鎴愬姛锛�";
+                objJsonResult.list = list;
             }
             catch (Exception e)
             {
@@ -4386,7 +4479,7 @@
                 lsmain = oListModels.getObjectByJson_Gy_MouldProdBackBillMain(msg2);
                 foreach (Model.ClsSc_MouldProdBackBillMain oItem in lsmain)
                 {
-                    //oItem.HMaker = "";
+                     //oItem.HMaker = "";
                     UserName = oItem.HMaker;  //鍒跺崟浜�
                     oItem.HBillType = "3803";
                     oItem.HBillSubType = "3803";
@@ -4459,6 +4552,7 @@
                 {
                     // bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
                     bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
+                  
                 }
                 else
                 {
@@ -4466,6 +4560,8 @@
                 }
                 if (bResult)
                 {
+                    string sql = $"exec h_p_Sc_MouldProdBackBillList '{oBill.omodel.HBillNo}' ";
+                    oCn.RunProc(sql);
                     objJsonResult.code = "0";
                     objJsonResult.count = 1;
                     objJsonResult.Message = "淇濆瓨鎴愬姛锛�";
@@ -4500,7 +4596,7 @@
         /// <returns></returns>
         [Route("Sc_MouldProdBackBill/DeltetMouldProdBackBill")]
         [HttpGet]
-        public object DeltetMouldProdBackBill(string HInterID,string user)
+        public object DeltetMouldProdBackBill(string HInterID, string user)
         {
             //缂栬緫鏉冮檺
             if (!DBUtility.ClsPub.Security_Log("Sc_MouldProdBackBill_Delete", 1, true, user))
@@ -4573,6 +4669,89 @@
         }
         #endregion
 
+        #region 鍣ㄥ叿鐢熶骇閫�搴撳崟瀹℃牳/鍙嶅鏍�
+        [Route("Sc_MouldProdBackBill/AuditMouldProdBackBill")]
+        [HttpGet]
+        public object AuditMouldProdBackBill(string HInterID, string user, int flag)
+        {
+            //flag=1 瀹℃牳锛�  flag=2 鍙嶅鏍�
+            //缂栬緫鏉冮檺
+            if (!DBUtility.ClsPub.Security_Log_second("Sc_MouldProdBackBill_Check", 1, true, user))
+            {
+                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;
+            }
+            DLL.ClsSc_MouldProdOutBill oBill = new DLL.ClsSc_MouldProdOutBill();
+            if (oBill.ShowBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo))
+            {
+                if (flag == 1)
+                {
+                    if (oBill.omodel.HBillStatus == 2)
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "褰撳墠鍗曟嵁宸插鏍革紝鏃犻渶鍐嶆瀹℃牳";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                    else
+                    {
+                        string HCheckDate = DateTime.Now.Date.ToString();
+                        oCn.RunProc(" Update Sc_MouldStockBillMain set HChecker='" + user + "',HCheckDate='" + HCheckDate + "',HBillStatus=2 Where HBillType='3803' and HInterID=" + HInterID);
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 1;
+                        objJsonResult.Message = "瀹℃牳鎴愬姛锛�";
+                        objJsonResult.data = 1;
+                        return objJsonResult;
+                    }
+                }
+                else
+                {
+                    if (oBill.omodel.HBillStatus == 1)
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "褰撳墠鍗曟嵁鏈鏍革紝鏃犻渶鍙嶅鏍�";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                    else
+                    {
+                        string HCheckDate = DateTime.Now.Date.ToString();
+                        oCn.RunProc(" Update Sc_MouldStockBillMain set HChecker=' ',HCheckDate=' ',HBillStatus=1 Where HBillType='3803' and HInterID=" + HInterID);
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 1;
+                        objJsonResult.Message = "鍙嶅鏍告垚鍔燂紒";
+                        objJsonResult.data = 1;
+                        return objJsonResult;
+                    }
+                }
+
+            }
+            else
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "鍗曟嵁鏈壘鍒�";
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
         #endregion
 
         #region 妯″叿棰嗙敤鍗�
@@ -4581,7 +4760,7 @@
 
         [Route("Sc_MouldProdOutBill/GetMouldProdOutBill")]
         [HttpGet]
-        public object GetMouldProdOutBill(string sWhere, string user,string Organization)
+        public object GetMouldProdOutBill(string sWhere, string user, string Organization)
         {
             try
             {
@@ -4594,7 +4773,7 @@
                     return objJsonResult;
                 }
 
-                ds = Sc_GetMouldProdOutBill(sWhere,Organization);
+                ds = Sc_GetMouldProdOutBill(sWhere, Organization);
                 objJsonResult.code = "1";
                 objJsonResult.count = 1;
                 objJsonResult.Message = "杩斿洖璁板綍鎴愬姛锛�";
@@ -4616,11 +4795,11 @@
             string sql1 = string.Format(@"select * from h_v_Sc_MouldProdOutHouseBillList where 搴撳瓨缁勭粐='" + Organization + "'");
             if (sWhere == null || sWhere.Equals(""))
             {
-                return new SQLHelper.ClsCN().RunProcReturn(sql1+ "order by 鏃ユ湡 desc", "h_v_Sc_MouldProdOutHouseBillList");
+                return new SQLHelper.ClsCN().RunProcReturn(sql1 + "order by 鏃ユ湡 desc", "h_v_Sc_MouldProdOutHouseBillList");
             }
             else
             {
-                string sql = sql1 + sWhere+ "order by 鏃ユ湡 desc";
+                string sql = sql1 + sWhere + "order by 鏃ユ湡 desc";
                 return new SQLHelper.ClsCN().RunProcReturn(sql, "h_v_Sc_MouldProdOutHouseBillList");
             }
 
@@ -4651,6 +4830,8 @@
         public object Sc_MouldProdOutBillListProjectDetai(string sqlWhere)
         {
             DataSet ds;
+            DataSet ds1;
+            List<object> list = new List<object>();
             try
             {
                 SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
@@ -4659,12 +4840,8 @@
                     ds = oCN.RunProcReturn(string.Format(@"SELECT HMaterID,妯″叿浠g爜 HMaterCode,妯″叿鍚嶇О HMaterName,瑙勬牸鍨嬪彿 HMaterSpec,鎵规 HBatchNo,
                                                 璁捐瀵垮懡 HDesignLife, 鍓╀綑瀵垮懡 HLeaveLife, 绱Н浣跨敤瀵垮懡 HUseLife, 搴斿彂鏁伴噺 HQtyMust, 瀹炲彂鏁伴噺 HQty, 
                                                 鍗曚环 HPrice, 閲戦 HMoney,HWHSonID HWHID, 鍙戞枡浠撳簱浠g爜 HWHCode, 鍙戞枡浠撳簱 HWHName,HSPID, 
-                                                浠撲綅浠g爜 HSPCode, 浠撲綅 HSPName,琛ㄤ綋澶囨敞 HRemark,HStockOrgID FROM h_v_Sc_MouldProdOutHouseBillList"), "h_v_Sc_MouldProdOutHouseBillList");
+                                                浠撲綅浠g爜 HSPCode, 浠撲綅 HSPName,琛ㄤ綋澶囨敞 HRemark,HStockOrgID,HUnitID,璁¢噺鍗曚綅浠g爜,璁¢噺鍗曚綅 FROM h_v_Sc_MouldProdOutHouseBillList"), "h_v_Sc_MouldProdOutHouseBillList");
 
-                    objJsonResult.code = "0";
-                    objJsonResult.count = 1;
-                    objJsonResult.Message = "鑾峰彇淇℃伅鎴愬姛锛�";
-                    objJsonResult.data = ds.Tables[0];
                 }
                 else
                 {
@@ -4673,15 +4850,21 @@
                     string sql1 = string.Format(@"SELECT HMaterID,妯″叿浠g爜 HMaterCode,妯″叿鍚嶇О HMaterName,瑙勬牸鍨嬪彿 HMaterSpec,鎵规 HBatchNo,
                                                 璁捐瀵垮懡 HDesignLife, 鍓╀綑瀵垮懡 HLeaveLife, 绱Н浣跨敤瀵垮懡 HUseLife, 搴斿彂鏁伴噺 HQtyMust, 瀹炲彂鏁伴噺 HQty, 
                                                 鍗曚环 HPrice, 閲戦 HMoney,HWHSonID HWHID, 鍙戞枡浠撳簱浠g爜 HWHCode, 鍙戞枡浠撳簱 HWHName,HSPID, 
-                                                浠撲綅浠g爜 HSPCode, 浠撲綅 HSPName,琛ㄤ綋澶囨敞 HRemark,HStockOrgID FROM h_v_Sc_MouldProdOutHouseBillList where 1 = 1 ");
+                                                浠撲綅浠g爜 HSPCode, 浠撲綅 HSPName,琛ㄤ綋澶囨敞 HRemark,HStockOrgID,HUnitID,璁¢噺鍗曚綅浠g爜,璁¢噺鍗曚綅 FROM h_v_Sc_MouldProdOutHouseBillList where 1 = 1 ");
                     string sql = sql1 + sqlWhere;
                     ds = oCN.RunProcReturn(sql, "h_v_Sc_MouldProdOutHouseBillList");
-
-                    objJsonResult.code = "0";
-                    objJsonResult.count = 1;
-                    objJsonResult.Message = "鑾峰彇淇℃伅鎴愬姛锛�";
-                    objJsonResult.data = ds.Tables[0];
                 }
+                //鏌ユ眹鎬�
+                ds1 = oCN.RunProcReturn(string.Format(@"select  鐗╂枡浠g爜,max(鐗╂枡鍚嶇О)鐗╂枡鍚嶇О,瑙勬牸鍨嬪彿,max(鍗曟嵁鍙�)鍗曟嵁鍙�,鎵规,sum(瀹炲彂鏁伴噺)瀹炲彂鏁伴噺,
+                                            HWHSonID,max(鍙戞枡浠撳簱浠g爜)鍙戞枡浠撳簱浠g爜,max(鍙戞枡浠撳簱)鍙戞枡浠撳簱,琛ㄤ綋澶囨敞 from h_v_Sc_MouldProdOutHouseBillList 
+                                            where 1=1 " + sqlWhere + " group by 鐗╂枡浠g爜,瑙勬牸鍨嬪彿,HWHSonID,鎵规,琛ㄤ綋澶囨敞"), "h_v_Sc_MouldProdOutHouseBillList");
+
+                list.Add(ds.Tables[0]);
+                list.Add(ds1.Tables[0]);
+                objJsonResult.code = "0";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "鑾峰彇淇℃伅鎴愬姛锛�";
+                objJsonResult.list = list;
             }
             catch (Exception e)
             {
@@ -4709,7 +4892,7 @@
             string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
             string msg2 = sArray[0].ToString();
             string msg3 = sArray[1].ToString();
-            string msg4= sArray[2].ToString();
+            string msg4 = sArray[2].ToString();
 
 
             string UserName = "";
@@ -4918,6 +5101,89 @@
         }
         #endregion
 
+        #region 鍣ㄥ叿棰嗙敤鍑哄簱鍗曞鏍�/鍙嶅鏍�
+        [Route("Sc_MouldProdOutBill/AuditMouldProdOutBill")]
+        [HttpGet]
+        public object AuditMouldProdOutBill(string HInterID, string user, int flag)
+        {
+            //flag=1 瀹℃牳锛�  flag=2 鍙嶅鏍�
+            //缂栬緫鏉冮檺
+            if (!DBUtility.ClsPub.Security_Log_second("Sc_MouldProdOutBill_Check", 1, true, user))
+            {
+                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;
+            }
+            DLL.ClsSc_MouldProdOutBill oBill = new DLL.ClsSc_MouldProdOutBill();
+            if (oBill.ShowBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo))
+            {
+                if (flag == 1)
+                {
+                    if (oBill.omodel.HBillStatus == 2)
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "褰撳墠鍗曟嵁宸插鏍革紝鏃犻渶鍐嶆瀹℃牳";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                    else
+                    {
+                        string HCheckDate = DateTime.Now.Date.ToString();
+                        oCn.RunProc(" Update Sc_MouldStockBillMain set HChecker='" + user + "',HCheckDate='" + HCheckDate + "',HBillStatus=2 Where HBillType='3802' and HInterID=" + HInterID);
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 1;
+                        objJsonResult.Message = "瀹℃牳鎴愬姛锛�";
+                        objJsonResult.data = 1;
+                        return objJsonResult;
+                    }
+                }
+                else
+                {
+                    if (oBill.omodel.HBillStatus == 1)
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "褰撳墠鍗曟嵁鏈鏍革紝鏃犻渶鍙嶅鏍�";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                    else
+                    {
+                        string HCheckDate = DateTime.Now.Date.ToString();
+                        oCn.RunProc(" Update Sc_MouldStockBillMain set HChecker=' ',HCheckDate=' ',HBillStatus=1 Where HBillType='3802' and HInterID=" + HInterID);
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 1;
+                        objJsonResult.Message = "鍙嶅鏍告垚鍔燂紒";
+                        objJsonResult.data = 1;
+                        return objJsonResult;
+                    }
+                }
+
+            }
+            else
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "鍗曟嵁鏈壘鍒�";
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
         #endregion
 
         #region 妯″叿瀵垮懡璋冩暣鍗�
@@ -4957,7 +5223,7 @@
             else
             {
                 string sql1 = "select * from h_v_Sc_MouldLifeChangeBillList where 1 = 1 ";
-                string sql = sql1 + sWhere+ "order by 鏃ユ湡 desc";
+                string sql = sql1 + sWhere + "order by 鏃ユ湡 desc";
                 return new SQLHelper.ClsCN().RunProcReturn(sql, "h_v_Sc_MouldLifeChangeBillList");
             }
 

--
Gitblit v1.9.1