From 2a4e026afe1d96f609dc1efaa219f06960aabdb4 Mon Sep 17 00:00:00 2001
From: yusijie <ysj@hz-kingdee.com>
Date: 星期三, 31 一月 2024 15:32:16 +0800
Subject: [PATCH] 审核,反审核 前后控制(开工单,完工单,停工单,产量汇报单,质量汇报单,生产汇报单)

---
 WebAPI/DLL/ClsSc_ICMOReportBill.cs |   51 ++++++++++++++++++++++++++++++++++++++++++++++-----
 1 files changed, 46 insertions(+), 5 deletions(-)

diff --git a/WebAPI/DLL/ClsSc_ICMOReportBill.cs b/WebAPI/DLL/ClsSc_ICMOReportBill.cs
index 5029aa8..7c28d1a 100644
--- a/WebAPI/DLL/ClsSc_ICMOReportBill.cs
+++ b/WebAPI/DLL/ClsSc_ICMOReportBill.cs
@@ -408,7 +408,7 @@
         }
 
         //瀹℃牳
-        public bool CheckBill(Int64 lngBillKey, ref string sReturn)
+        public bool CheckBill(Int64 lngBillKey,string HBillNo, string procName, string sUser, ref string sReturn)
         {
 
             try
@@ -419,8 +419,10 @@
                 oCn.RunProc(" Update " + MvarItemKey + " set HBillStatus='2',HChecker='" + HChecker + "',HCheckDate='" + HCheckDate + "' Where HInterID=" + lngBillKey.ToString());
 
                 DataSet ds,Ds;
+                string sql = "";
+
                 ds = oCn.RunProcReturn("select * from  Sc_ICMOReportBillMain where HInterID = " + lngBillKey, "Sc_ICMOReportBillMain");
-                string HBillNo = "";
+                HBillNo = "";
 
                 if (ds.Tables[0].Rows.Count > 0)
                 {
@@ -509,7 +511,7 @@
                         FentityModel2.Add("FEntity_Link_FSId", item["FEntity_Link_FSId"].ToString());
                         Fentity2.Add(FentityModel2);
                         FentityModel.Add("FEntity_Link", Fentity2);
-                        FentityModel.Add("FBFLowId", new JObject() { ["FID"] = item["FBFLOWID"].ToString() }); //
+                        FentityModel.Add("FBFLowId", new JObject() { ["FID"] = item["FBFLOWID"].ToString() });
                         Fentity.Add(FentityModel);
                     }
                     model.Add("FEntity", Fentity); //鏄庣粏淇℃伅                       
@@ -587,6 +589,25 @@
                 }
 
                 sReturn = "瀹℃牳鍗曟嵁鎴愬姛锛�";
+
+
+                //瀹℃牳鍚庢帶鍒�===============================================Begin================================================================
+                sql = "exec " + procName + " " + lngBillKey + ",'" + HBillNo + "','" + sUser + "'";
+                ds = oCn.RunProcReturn(sql, procName);
+                if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
+                {
+                    sReturn = "瀹℃牳杩囩▼涓嚭閿欙紝璇蜂笌缃戠粶绠$悊浜哄憳鑱旂郴";
+                    oCn.RollBack();
+                    return false;
+                }
+                if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
+                {
+                    sReturn = ds.Tables[0].Rows[0]["HRemark"].ToString();
+                    oCn.RollBack();
+                    return false;
+                }
+                //瀹℃牳鍚庢帶鍒�===============================================End================================================================
+
                 oCn.Commit();
 
                 sReturn = "";
@@ -601,9 +622,10 @@
         }
 
         //鍙嶅鏍�
-        public bool AbandonCheck(Int64 lngBillKey, ref string sReturn)
+        public bool AbandonCheck(Int64 lngBillKey, string HBillNo, string procName, string sUser, ref string sReturn)
         {
-
+            string sql = "";
+            DataSet ds;
             try
             {
                 string HChecker = DBUtility.ClsPub.CurUserName;
@@ -612,6 +634,25 @@
                 //杩樺師鍗曟嵁鐘舵�佷负鏈鏍哥姸鎬�
                 oCn.RunProc(" Update " + MvarItemKey + " set HBillStatus='1',HChecker='',HCheckDate='' Where HInterID=" + lngBillKey.ToString());
                 sReturn = "鍙嶅鏍稿崟鎹垚鍔燂紒";
+
+                //瀹℃牳鍚庢帶鍒�===============================================Begin================================================================
+                sql = "exec " + procName + " " + lngBillKey + ",'" + HBillNo + "','" + sUser + "'";
+                ds = oCn.RunProcReturn(sql, procName);
+                if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
+                {
+                    sReturn = "鍙嶅鏍歌繃绋嬩腑鍑洪敊锛岃涓庣綉缁滅鐞嗕汉鍛樿仈绯�";
+                    oCn.RollBack();
+                    return false;
+                }
+                if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
+                {
+                    sReturn = ds.Tables[0].Rows[0]["HRemark"].ToString();
+                    oCn.RollBack();
+                    return false;
+                }
+                //瀹℃牳鍚庢帶鍒�===============================================End================================================================
+
+
                 oCn.Commit();
                 sReturn = "";
                 return true;

--
Gitblit v1.9.1