From 04ef83a36a24e309c8d5240eee6ac93fc2bb156d Mon Sep 17 00:00:00 2001
From: YL <YL@LAPTOP-SE03PLUR>
Date: 星期一, 06 十二月 2021 17:17:43 +0800
Subject: [PATCH] 器具改制申请单删除不掉问题查找'缺少表对象'

---
 WebAPI/Controllers/Sc_MouldOtherInBillController.cs |   29 ++++++++++++++++++-----------
 1 files changed, 18 insertions(+), 11 deletions(-)

diff --git a/WebAPI/Controllers/Sc_MouldOtherInBillController.cs b/WebAPI/Controllers/Sc_MouldOtherInBillController.cs
index 653c4bd..6e46586 100644
--- a/WebAPI/Controllers/Sc_MouldOtherInBillController.cs
+++ b/WebAPI/Controllers/Sc_MouldOtherInBillController.cs
@@ -17,6 +17,7 @@
         private json objJsonResult = new json();
         public DataSet ds = new DataSet();
         public WebServer webserver = new WebServer();
+        SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
 
         public DAL.ClsSc_MouldScrapInBill BillNew0 = new DAL.ClsSc_MouldScrapInBill();   //妯″叿鎶ュ簾鍏ュ簱瀵瑰簲鍗曟嵁绫�
         public DAL.ClsSc_MouldScrapInBill BillOld0 = new DAL.ClsSc_MouldScrapInBill();   //妯″叿鎶ュ簾鍏ュ簱瀵瑰簲鍗曟嵁绫�
@@ -92,7 +93,7 @@
                 {
                     objJsonResult.code = "0";
                     objJsonResult.count = 0;
-                    objJsonResult.Message = "鏃犲垹闄ゆ潈闄愶紒";
+                    objJsonResult.Message = "鏃犳煡鐪嬫潈闄愶紒";
                     objJsonResult.data = null;
                     return objJsonResult;
                 }
@@ -154,6 +155,8 @@
         public object Sc_MouldOtherInBillListProjectDetai(string sqlWhere)
         {
             DataSet ds;
+            DataSet ds1;
+            List<object> list = new List<object>();
             try
             {
                 SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
@@ -164,14 +167,9 @@
                                                 鍗曚环 HPrice, 閲戦 HMoney,HWHSonID HWHID, 鍙戞枡浠撳簱浠g爜 HWHCode, 鍙戞枡浠撳簱 HWHName,HSPID, 
                                                 浠撲綅浠g爜 HSPCode, 浠撲綅 HSPName,琛ㄤ綋澶囨敞 HRemark,HStockOrgID FROM h_v_Sc_MouldOtherInBillList"), "h_v_Sc_MouldOtherInBillList");
 
-                    objJsonResult.code = "0";
-                    objJsonResult.count = 1;
-                    objJsonResult.Message = "鑾峰彇淇℃伅鎴愬姛锛�";
-                    objJsonResult.data = ds.Tables[0];
                 }
                 else
                 {
-
                     //string sql1 = "select HRepairCheckID,HRepairCheckContent,HManagerID,HRemark  from Sc_MouldRepairCheckBillSub where 1 = 1 ";
                     string sql1 = string.Format(@"SELECT HMaterID,妯″叿浠g爜 HMaterCode,妯″叿鍚嶇О HMaterName,瑙勬牸鍨嬪彿 HMaterSpec,鎵规 HBatchNo,
                                                 璁捐瀵垮懡 HDesignLife, 鍓╀綑瀵垮懡 HLeaveLife, 绱Н浣跨敤瀵垮懡 HUseLife, 搴斿彂鏁伴噺 HQtyMust, 瀹炲彂鏁伴噺 HQty, 
@@ -180,11 +178,18 @@
                     string sql = sql1 + sqlWhere;
                     ds = oCN.RunProcReturn(sql, "h_v_Sc_MouldOtherInBillList");
 
-                    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_MouldOtherInBillList 
+                                            where 1=1 " + sqlWhere + " group by 鐗╂枡浠g爜,瑙勬牸鍨嬪彿,HWHSonID,鎵规,琛ㄤ綋澶囨敞"), "h_v_Sc_MouldOtherInBillList");
+
+                list.Add(ds.Tables[0]);
+                list.Add(ds1.Tables[0]);
+                objJsonResult.code = "0";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "鑾峰彇淇℃伅鎴愬姛锛�";
+                objJsonResult.list = list;
             }
             catch (Exception e)
             {
@@ -223,7 +228,7 @@
                 {
                     objJsonResult.code = "0";
                     objJsonResult.count = 0;
-                    objJsonResult.Message = "鏃犲垹闄ゆ潈闄愶紒";
+                    objJsonResult.Message = "鏃犱繚瀛樻潈闄愶紒";
                     objJsonResult.data = null;
                     return objJsonResult;
                 }
@@ -315,6 +320,8 @@
                 }
                 if (bResult)
                 {
+                    string sql = $"exec h_p_Sc_MouldChangeFileStatus  'in','{oBill.omodel.HInterID.ToString()}' ";
+                    oCN.RunProc(sql);
                     objJsonResult.code = "0";
                     objJsonResult.count = 1;
                     objJsonResult.Message = "淇濆瓨鎴愬姛锛�";

--
Gitblit v1.9.1