From 2cea3c0d7cb988f28b9c296457cd89a34ea1d0e8 Mon Sep 17 00:00:00 2001
From: zzr99 <1940172413@qq.com>
Date: 星期二, 16 八月 2022 16:24:11 +0800
Subject: [PATCH] 设备履历+器具履历

---
 WebAPI/Controllers/MJGL/Sc_MouldProdInBillController.cs |   41 +++++++++++++++++++++++++++++------------
 1 files changed, 29 insertions(+), 12 deletions(-)

diff --git a/WebAPI/Controllers/MJGL/Sc_MouldProdInBillController.cs b/WebAPI/Controllers/MJGL/Sc_MouldProdInBillController.cs
index a12cc8c..dba3dc3 100644
--- a/WebAPI/Controllers/MJGL/Sc_MouldProdInBillController.cs
+++ b/WebAPI/Controllers/MJGL/Sc_MouldProdInBillController.cs
@@ -144,9 +144,22 @@
                     objJsonResult.data = null;
                     return objJsonResult;
                 }
+                //鍒犻櫎鍓嶆煡鎵惧綋鍓嶅崟鎹殑鎵�鏈夊櫒鍏稩D
+                //string swhere = "";
+                //DataSet ds = oCn.RunProcReturn("select HMaterID from Sc_MouldStockBillSub where HinterID=" + HInterID, "Sc_MouldStockBillSub");
+                //for (var i = 0; i < ds.Tables[0].Rows.Count; i++)
+                //{
+                //    swhere = swhere + ds.Tables[0].Rows[i]["HMaterID"].ToString() + ",";
+                //}
+                //swhere = swhere.Substring(0, swhere.Length - 1);
                 bool IsDete = oBill.DeleteBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo);
+                
                 if (IsDete)
                 {
+                    //鍒犻櫎鎴愬姛淇敼鍣ㄥ叿妗f浣嶇疆
+                    //string sql = string.Format($"exec h_p_Sc_MouldChangeNowWHID  0,0,'{swhere}' ");
+                    string sql = string.Format($"exec h_p_Sc_MouldChangeNowWHID ");
+                    oCn.RunProc(sql);
                     objJsonResult.code = "1";
                     objJsonResult.count = 1;
                     objJsonResult.Message = DBUtility.ClsPub.sExeReturnInfo;
@@ -166,7 +179,7 @@
             {
                 objJsonResult.code = "0";
                 objJsonResult.count = 0;
-                objJsonResult.Message = "鍗曟嵁鏈壘鍒�";
+                objJsonResult.Message = DBUtility.ClsPub.sExeReturnInfo;
                 objJsonResult.data = null;
                 return objJsonResult;
             }
@@ -627,24 +640,28 @@
                 {
                     // 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)
-                {
-                    string sql =string.Format($"exec h_p_Sc_MouldChangeFileStatus  'in','{oBill.omodel.HInterID.ToString()}' ");
-                    DataSet db=oCn.RunProcReturn(sql, "h_p_Sc_MouldChangeFileStatus");
-                    if (db.Tables[0].Rows[0]["issuccess"].ToString()=="0")
+                    //淇敼鍣ㄥ叿妗f浣嶇疆
+                    string sql = string.Format($"exec h_p_Sc_MouldChangeFileStatus  'in','{oBill.omodel.HInterID.ToString()}' ");
+                    DataSet db = oCn.RunProcReturn(sql, "h_p_Sc_MouldChangeFileStatus");
+                    if (db.Tables[0].Rows[0]["issuccess"].ToString() == "0")
                     {
                         objJsonResult.code = "0";
                         objJsonResult.count = 0;
                         objJsonResult.Message = "鍣ㄥ叿浣嶇疆鍚屾澶辫触锛�";
-                        //WebAPIController.Add_Log("閫佽揣鍗曚笅鎺�", UserName, "鐢熸垚閫佽揣鍗�");
                         objJsonResult.data = 1;
                         return objJsonResult;
                     }
+                }
+                else
+                {
+                    bResult = oBill.ModifyBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo);
+                    //淇敼鎴愬姛
+                    //string sql = string.Format($"exec h_p_Sc_MouldChangeNowWHID  1,{oBill.omodel.HInterID.ToString()},' ' ");
+                    string sql = string.Format($"exec h_p_Sc_MouldChangeNowWHID ");
+                    oCn.RunProc(sql);
+                }
+                if (bResult)
+                {
                     objJsonResult.code = "0";
                     objJsonResult.count = 1;
                     objJsonResult.Message = "淇濆瓨鎴愬姛锛�";

--
Gitblit v1.9.1