From d82756d630f5f9bcc588fee772b68bc2a7725cb0 Mon Sep 17 00:00:00 2001
From: wtt <1985833171@qq.com>
Date: 星期一, 19 五月 2025 16:06:08 +0800
Subject: [PATCH] 1

---
 WebAPI/DLL/ClsSb_EquipDotCheckBill.cs |   79 +++++++++++++++++++++++++++++++++++++--
 1 files changed, 74 insertions(+), 5 deletions(-)

diff --git a/WebAPI/DLL/ClsSb_EquipDotCheckBill.cs b/WebAPI/DLL/ClsSb_EquipDotCheckBill.cs
index 5afb8c8..2f2d117 100644
--- a/WebAPI/DLL/ClsSb_EquipDotCheckBill.cs
+++ b/WebAPI/DLL/ClsSb_EquipDotCheckBill.cs
@@ -38,6 +38,22 @@
             {
                 //
                 oCn.BeginTran();
+
+                //淇濆瓨鍓嶆帶鍒�=========================================
+                string HBillNote = "";
+                DataSet ds = oCn.RunProcReturn("Exec h_p_Sb_EquipDotCheckBill_BeforeSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "','" + HBillNote + "'2 ", "h_p_Sb_EquipDotCheckBill_BeforeSaveCtrl");
+                if (ds == null)
+                {
+                    sReturn = "淇濆瓨鍓嶅垽鏂け璐ワ紒";
+                    return false;
+                }
+                if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) != "0")
+                {
+                    sReturn = "淇濆瓨澶辫触锛�" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
+                    return false;
+                }
+                //=========================================================
+
                 //鏇存柊涓昏〃
                 oCn.RunProc("UpDate Sb_EquipDotCheckBillMain set  " +
                 " HBillNo='" + omodel.HBillNo + "'" +  //鍥哄畾璧嬪��===============
@@ -89,6 +105,23 @@
                 //        return false;
                 //    }
                 //}
+
+                //=========================淇濆瓨鍚庢帶鍒�  
+                DataSet ds2 = oCn.RunProcReturn("Exec h_p_Sb_EquipDotCheckBill_AfterSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "',2 ", "h_p_Sb_EquipDotCheckBill_AfterSaveCtrl");
+                if (ds2 == null)
+                {
+                    sReturn = "淇濆瓨鍚庢帶鍒跺垽鏂け璐ワ紒";
+                    oCn.RollBack();
+                    return false;
+                }
+                if (DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBack"]) != "0")
+                {
+                    sReturn = "淇濆瓨澶辫触2锛�" + DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBackRemark"]);
+                    oCn.RollBack();
+                    return false;
+                }
+                //============================
+
                 sReturn = "淇敼鍗曟嵁鎴愬姛锛�";
                 oCn.Commit();
                 return true;
@@ -107,6 +140,22 @@
             {
                 //寰楀埌mainid
                 omodel.HInterID = DBUtility.ClsPub.CreateBillID(BillType, ref DBUtility.ClsPub.sExeReturnInfo);
+
+                //淇濆瓨鍓嶆帶鍒�=========================================
+                string HBillNote = "";
+                DataSet ds = oCn.RunProcReturn("Exec h_p_Sb_EquipDotCheckBill_BeforeSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "','" + HBillNote + "',1 ", "h_p_Sb_EquipDotCheckBill_BeforeSaveCtrl");
+                if (ds == null)
+                {
+                    sReturn = "淇濆瓨鍓嶅垽鏂け璐ワ紒";
+                    return false;
+                }
+                if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) != "0")
+                {
+                    sReturn = "淇濆瓨澶辫触锛�" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
+                    return false;
+                }
+                //=========================================================
+
                 //鑻AINDI閲嶅鍒欓噸鏂拌幏鍙�
                 oCn.BeginTran();
                 //涓昏〃
@@ -114,12 +163,13 @@
                 "(HBillType,HBillSubType,HInterID,HBillNo,HDate,HMaker,HMakeDate" +
                 ",HYear,HPeriod,HRemark,HEquipID" +
                 ",HBeginDate,HEndDate,HPlanNo,HExplanation,HInnerBillNo" +
-                ",HDeptID" +
+                ",HDeptID,HQty,HEquipDotCheckRuleInterID" +
+                ",HLastResult,HErrNote,HBigSafeNote,HShiftsID,HDotCheckNote" +
                 ") " +
                 " values('" + this.BillType + "','"  + this.HBillSubType + "'," +omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "','" + omodel.HDate + "','" + omodel.HMaker + "',getdate()" +
                 "," + omodel.HYear.ToString() + "," + omodel.HPeriod.ToString() + ",'" + omodel.HRemark + "'," + omodel.HEquipID.ToString() +
                 ",'" + omodel.HBeginDate + "','" + omodel.HEndDate + "','" + omodel.HPlanNo + "','" + omodel.HExplanation + "','" + omodel.HInnerBillNo + "'" +
-               ",'" + omodel.HDeptID + "'" +
+               ",'" + omodel.HDeptID + "'," + omodel.HQty + "," + omodel.HEquipDotCheckRuleInterID + ",'" + omodel.HLastResult + "','" + omodel.HErrNote + "','" + omodel.HBigSafeNote + "'," + omodel.HShiftsID + ",'" + omodel.HDotCheckNote + "'" +
                 ") ");
                 //鎻掑叆瀛愯〃
                 foreach (Models.ClsSb_EquipDotCheckBillSub oSub in DetailColl)
@@ -129,15 +179,18 @@
                       "HCloseMan,HEntryCloseDate,HCloseType,HRemark," +
                       "HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney," +
                       "HDotCheckItem,HDotCheckPart,HClaim," +
-                      "HManagerID,HManagerNumber" +
+                      "HManagerID,HManagerNumber,HDotCheckResult,HDotCheckItemID " +
+                      ",HDotCheckItemClassID,HDotCheckItemMethodID" +
                       ") values("
                       + omodel.HInterID.ToString() + "," + oSub.HEntryID.ToString() +
                       ",'" + oSub.HCloseMan + "','" + oSub.HEntryCloseDate + "'," + Convert.ToString(oSub.HCloseType ? 1 : 0) + ",'" + oSub.HRemark + "'" +
-                      "," + oSub.HSourceInterID.ToString() + "," + oSub.HSourceEntryID.ToString() + ",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "'," + oSub.HRelationQty.ToString() + "," + oSub.HRelationMoney.ToString() +
+                      "," + oSub.HSourceInterID.ToString()  + "," + oSub.HSourceEntryID.ToString() + ",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "'," + oSub.HRelationQty.ToString() + "," + oSub.HRelationMoney.ToString() +
                       ",'" + oSub.HDotCheckItem + "','" + oSub.HDotCheckPart + "','" + oSub.HClaim +
-                      "'," + oSub.HManagerID.ToString() + ",'" + oSub.HManagerNumber + "'" +
+                      "'," + oSub.HManagerID.ToString() + ",'" + oSub.HManagerNumber + "','" + oSub.HDotCheckResult + "'," + oSub.HDotCheckItemID + "," + oSub.HDotCheckItemClassID + "," + oSub.HDotCheckItemMethodID + 
                       ") ");
                 }
+                //鏇存柊鐐规璁″垝瀛愯〃鍏宠仈鏍囪
+                oCn.RunProc("update Sb_EquipDotCheckPlanBillSub_Plan set HRelationFlag = 1 where HInterID = " + omodel.HPlanInterID + " and HEntryID = " + omodel.HPlanEntryID);
                 //
                 //foreach (Model.ClsSb_EquipDotCheckBillSub oSub in DetailColl)
                 //{
@@ -151,6 +204,22 @@
                 //    }
                 //}
                 //
+
+                //=========================淇濆瓨鍚庢帶鍒�  
+                DataSet ds2 = oCn.RunProcReturn("Exec h_p_Sb_EquipDotCheckBill_AfterSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "',1 ", "h_p_Sb_EquipDotCheckBill_AfterSaveCtrl");
+                if (ds2 == null)
+                {
+                    sReturn = "淇濆瓨鍚庢帶鍒跺垽鏂け璐ワ紒";
+                    oCn.RollBack();
+                    return false;
+                }
+                if (DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBack"]) != "0")
+                {
+                    sReturn = "淇濆瓨澶辫触2锛�" + DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBackRemark"]);
+                    oCn.RollBack();
+                    return false;
+                }
+                //============================
                 sReturn = "鏂板鍗曟嵁鎴愬姛锛�";
                 oCn.Commit();
                 return true;

--
Gitblit v1.9.1