From c48c7746efa89e3cbf38e089d20cd9029c2ce1c8 Mon Sep 17 00:00:00 2001
From: yangle <admin@YINMOU>
Date: 星期五, 07 六月 2024 09:52:37 +0800
Subject: [PATCH] 模具点检单PDA 扫条码没有返回数据,核对匹配字段

---
 WebAPI/Controllers/MJGL/Sc_MouldProdMoveBillListController.cs |   38 +++++++++++++++++++++++++++-----------
 1 files changed, 27 insertions(+), 11 deletions(-)

diff --git a/WebAPI/Controllers/MJGL/Sc_MouldProdMoveBillListController.cs b/WebAPI/Controllers/MJGL/Sc_MouldProdMoveBillListController.cs
index 76c827b..e28d3ab 100644
--- a/WebAPI/Controllers/MJGL/Sc_MouldProdMoveBillListController.cs
+++ b/WebAPI/Controllers/MJGL/Sc_MouldProdMoveBillListController.cs
@@ -89,7 +89,7 @@
             try
             {
                 //缂栬緫鏉冮檺 
-                if (!DBUtility.ClsPub.Security_Log_second("Sc_MouldProdMoveBillList", 1, true, user))
+                if (!DBUtility.ClsPub.Security_Log_second("Sc_MouldProdMoveBillList", 1, false, user))
                 {
                     objJsonResult.code = "0";
                     objJsonResult.count = 0;
@@ -99,6 +99,7 @@
                 }
 
                 ds = Sc_GetMouldProdMoveBill(sWhere,Organization);
+
                 objJsonResult.code = "1";
                 objJsonResult.count = 1;
                 objJsonResult.Message = "杩斿洖璁板綍鎴愬姛锛�";
@@ -120,11 +121,11 @@
             string sql1 = string.Format(@"select * from h_v_Sc_MouldProdMoveBillList where (璋冨叆缁勭粐='" + Organization + "' or 璋冨嚭缁勭粐='" + Organization + "')");
             if (sWhere == null || sWhere.Equals(""))
             {
-                return new SQLHelper.ClsCN().RunProcReturn(sql1+ "order by 鏃ユ湡 desc", "h_v_Sc_MouldProdMoveBillList");
+                return new SQLHelper.ClsCN().RunProcReturn(sql1+ "order by 鍒跺崟鏃ユ湡 desc", "h_v_Sc_MouldProdMoveBillList");
             }
             else
             {
-                string sql = sql1 + sWhere+ "order by 鏃ユ湡 desc";
+                string sql = sql1 + sWhere+ "order by 鍒跺崟鏃ユ湡 desc";
                 return new SQLHelper.ClsCN().RunProcReturn(sql, "h_v_Sc_MouldProdMoveBillList");
             }
 
@@ -166,7 +167,7 @@
                                                 璁捐瀵垮懡 HDesignLife, 鍓╀綑瀵垮懡 HLeaveLife, 绱Н浣跨敤瀵垮懡 HUseLife, 搴斿彂鏁伴噺 HQtyMust, 瀹炲彂鏁伴噺 HQty, 
                                                 鍗曚环 HPrice, 閲戦 HMoney,HStockOrgID,璋冨叆缁勭粐浠g爜 HStockOrgCode,璋冨叆缁勭粐 HStockOrgName, HOtherOrgID ,璋冨嚭缁勭粐浠g爜 HOtherOrgCode,璋冨嚭缁勭粐 HOtherOrgName, HWHID, 璋冨叆浠撳簱浠g爜 HWHCode, 璋冨叆浠撳簱 HWHName,HSPID, 
                                                 璋冨叆浠撲綅浠g爜 HSPCode, 璋冨叆浠撲綅 HSPName,HSCWHID, 璋冨嚭浠撳簱浠g爜 HSCWHCode, 璋冨嚭浠撳簱 HSCWHName,HSCSPID, 
-                                                璋冨嚭浠撲綅浠g爜 HSCSPCode, 璋冨嚭浠撲綅 HSCSPName,琛ㄤ綋澶囨敞 HRemark,HStockOrgID,HUnitID,璁¢噺鍗曚綅浠g爜,璁¢噺鍗曚綅 FROM h_v_Sc_MouldProdMoveBillList"), "h_v_Sc_MouldProdMoveBillList");
+                                                璋冨嚭浠撲綅浠g爜 HSCSPCode, 璋冨嚭浠撲綅 HSCSPName,琛ㄤ綋澶囨敞 HRemark,HStockOrgID,HUnitID,璁¢噺鍗曚綅浠g爜 HUnitCode,璁¢噺鍗曚綅 HUnitName FROM h_v_Sc_MouldProdMoveBillList"), "h_v_Sc_MouldProdMoveBillList");
 
                 }
                 else
@@ -177,7 +178,7 @@
                                                 璁捐瀵垮懡 HDesignLife, 鍓╀綑瀵垮懡 HLeaveLife, 绱Н浣跨敤瀵垮懡 HUseLife, 搴斿彂鏁伴噺 HQtyMust, 瀹炲彂鏁伴噺 HQty, 
                                                 鍗曚环 HPrice, 閲戦 HMoney,HStockOrgID,璋冨叆缁勭粐浠g爜 HStockOrgCode,璋冨叆缁勭粐 HStockOrgName, HOtherOrgID ,璋冨嚭缁勭粐浠g爜 HOtherOrgCode,璋冨嚭缁勭粐 HOtherOrgName, HWHID, 璋冨叆浠撳簱浠g爜 HWHCode, 璋冨叆浠撳簱 HWHName,HSPID, 
                                                 璋冨叆浠撲綅浠g爜 HSPCode, 璋冨叆浠撲綅 HSPName,HSCWHID, 璋冨嚭浠撳簱浠g爜 HSCWHCode, 璋冨嚭浠撳簱 HSCWHName,HSCSPID, 
-                                                璋冨嚭浠撲綅浠g爜 HSCSPCode, 璋冨嚭浠撲綅 HSCSPName,琛ㄤ綋澶囨敞 HRemark,HStockOrgID,HUnitID,璁¢噺鍗曚綅浠g爜,璁¢噺鍗曚綅 FROM h_v_Sc_MouldProdMoveBillList where 1 = 1 ");
+                                                璋冨嚭浠撲綅浠g爜 HSCSPCode, 璋冨嚭浠撲綅 HSCSPName,琛ㄤ綋澶囨敞 HRemark,HStockOrgID,HUnitID,璁¢噺鍗曚綅浠g爜 HUnitCode,璁¢噺鍗曚綅 HUnitName FROM h_v_Sc_MouldProdMoveBillList where 1 = 1 ");
                     string sql = sql1 + sqlWhere;
                     ds = oCN.RunProcReturn(sql, "h_v_Sc_MouldProdMoveBillList");
 
@@ -226,7 +227,7 @@
             ListModels oListModels = new ListModels();
             try
             {
-                if (!DBUtility.ClsPub.Security_Log_second("Sc_MouldProdMoveBill_Edit", 1, true, msg4))
+                if (!DBUtility.ClsPub.Security_Log_second("Sc_MouldProdMoveBill_Edit", 1, false, msg4))
                 {
                     objJsonResult.code = "0";
                     objJsonResult.count = 0;
@@ -315,15 +316,19 @@
                 {
                     // bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
                     bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
+                    string sql = string.Format($"exec h_p_Sc_MouldChangeFileStatus  'in','{oBill.omodel.HInterID.ToString()}' ");
+                    oCn.RunProc(sql);
                 }
                 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)
                 {
-                    string sql = $"exec h_p_Sc_MouldChangeFileStatus  'in','{oBill.omodel.HInterID.ToString()}' ";
-                    oCn.RunProc(sql);
                     objJsonResult.code = "0";
                     objJsonResult.count = 1;
                     objJsonResult.Message = "淇濆瓨鎴愬姛锛�";
@@ -361,7 +366,7 @@
         public object DeltetMouldProdMoveBilll(string HInterID,string user)
         {
             //缂栬緫鏉冮檺
-            if (!DBUtility.ClsPub.Security_Log_second("Sc_MouldProdMoveBill_Delete", 1, true, user))
+            if (!DBUtility.ClsPub.Security_Log_second("Sc_MouldProdMoveBill_Delete", 1, false, user))
             {
                 objJsonResult.code = "0";
                 objJsonResult.count = 0;
@@ -400,10 +405,21 @@
                     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(oBill.omodel.HInterID, 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 = "0";
                     objJsonResult.count = 1;
                     objJsonResult.Message = DBUtility.ClsPub.sExeReturnInfo;
@@ -438,7 +454,7 @@
         {
             //flag=1 瀹℃牳锛�  flag=2 鍙嶅鏍�
             //缂栬緫鏉冮檺
-            if (!DBUtility.ClsPub.Security_Log_second("Sc_MouldProdMoveBill_Check", 1, true, user))
+            if (!DBUtility.ClsPub.Security_Log_second("Sc_MouldProdMoveBill_Check", 1, false, user))
             {
                 objJsonResult.code = "0";
                 objJsonResult.count = 0;

--
Gitblit v1.9.1