From 3b34823a434ecfd972f9e53351ab2645e982e193 Mon Sep 17 00:00:00 2001
From: YL <YL@LAPTOP-SE03PLUR>
Date: 星期六, 22 一月 2022 13:06:26 +0800
Subject: [PATCH] 雅琪诺报工台 返工申请单

---
 WebAPI/DLL/ClsSc_MESReturnStepWorkBill.cs |   66 +++++++++++++++++++++++++++------
 1 files changed, 54 insertions(+), 12 deletions(-)

diff --git a/WebAPI/DLL/ClsSc_MESReturnStepWorkBill.cs b/WebAPI/DLL/ClsSc_MESReturnStepWorkBill.cs
index fb0bd06..dc356ac 100644
--- a/WebAPI/DLL/ClsSc_MESReturnStepWorkBill.cs
+++ b/WebAPI/DLL/ClsSc_MESReturnStepWorkBill.cs
@@ -91,19 +91,19 @@
             try
             {
                 //鑾峰彇褰撳墠宸ュ簭宸ュ簭鍙蜂互鍙婂垽鏂槸鍚︽湯閬撳伐搴�
-                string sql = string.Format(@"select max(b.HProcNo) HProcNo  from Sc_ProcessPlanMain a
-                               inner join   Sc_ProcessPlanSub  b on a.HInterID=b.HInterID  
-                               where b.HSourceBillNo='" + omodel.HSourceBillNo+"' and b.HSourceInterID='"+omodel.HSourceInterID+"'  and b.HSourceEntryID='"+omodel.HSourceEntryID+"'");
-                DataSet ds= oCn.RunProcReturn(sql, "Sc_ProcessPlanMain");
+                //string sql = string.Format(@"select max(b.HProcNo) HProcNo  from Sc_ProcessPlanMain a
+                //               inner join   Sc_ProcessPlanSub  b on a.HInterID=b.HInterID  
+                //               where b.HSourceBillNo='" + omodel.HSourceBillNo+"' and b.HSourceInterID='"+omodel.HSourceInterID+"'  and b.HSourceEntryID='"+omodel.HSourceEntryID+"'");
+                //DataSet ds= oCn.RunProcReturn(sql, "Sc_ProcessPlanMain");
                 //鏌ヨ鏈�澶у伐搴忓強鍒ゆ柇褰撳墠宸ュ簭鏄惁灏忎簬鏈�澶у伐搴�
-                if (ds.Tables[0].Rows.Count > 0 && int.Parse(ds.Tables[0].Rows[0]["HProcNo"].ToString()) > omodel.HProcID)
-                {
-                    omodel.HProcNo = omodel.HProcNo + 5;
-                }
-                else 
-                {
-                    omodel.HProcNo = omodel.HProcNo + 5; //鏈亾宸ュ簭搴忓彿鍔�5
-                }
+                //if (ds.Tables[0].Rows.Count > 0 && int.Parse(ds.Tables[0].Rows[0]["HProcNo"].ToString()) > omodel.HProcID)
+                //{
+                //    omodel.HProcNo = omodel.HProcNo + 5;
+                //}
+                //else 
+                //{
+                //    omodel.HProcNo = omodel.HProcNo + 5; //鏈亾宸ュ簭搴忓彿鍔�5
+                //}
 
                 //寰楀埌mainid
                 omodel.HInterID = DBUtility.ClsPub.CreateBillID(BillType, ref DBUtility.ClsPub.sExeReturnInfo);
@@ -156,5 +156,47 @@
                 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());
+                //鏇存柊(宸ュ簭姹囨姤鍗曘�佺敓浜х姸鎬佷复鏃惰〃)涓嶈壇鏁伴噺=涓嶈壇鏁伴噺-杩斿伐鏁伴噺
+                sReturn = "";
+                return true;
+            }
+            catch (Exception e)
+            {
+                sReturn = e.Message;
+                throw (e);
+            }
+        }
+
+        //鍙嶅鏍�
+        public bool AbandonCheck(Int64 lngBillKey, ref string sReturn)
+        {
+
+            if (isUse(lngBillKey, ref sReturn))
+            {
+                return false;
+            }
+            try
+            {
+                oCn.RunProc(" Update " + MvarItemKey + " set HChecker='',HCheckDate=null Where HInterID=" + lngBillKey.ToString());
+                //鏇存柊(宸ュ簭姹囨姤鍗曘�佺敓浜х姸鎬佷复鏃惰〃)涓嶈壇鏁伴噺=涓嶈壇鏁伴噺-杩斿伐鏁伴噺
+                sReturn = "";
+                return true;
+            }
+            catch (Exception e)
+            {
+                sReturn = e.Message;
+                throw (e);
+            }
+        }
     }
 }
\ No newline at end of file

--
Gitblit v1.9.1