From e6e805f9c46f41b50f4a556732f618ffdb7b4e69 Mon Sep 17 00:00:00 2001
From: duhe <226547893@qq.com>
Date: 星期二, 18 三月 2025 15:35:31 +0800
Subject: [PATCH] 生产领料单

---
 DAL/车间管理/ClsSc_WorkBeginDotCheckBillMain.cs |  101 +++++++++++++++++++++++++++++++++++++++++---------
 1 files changed, 83 insertions(+), 18 deletions(-)

diff --git "a/DAL/\350\275\246\351\227\264\347\256\241\347\220\206/ClsSc_WorkBeginDotCheckBillMain.cs" "b/DAL/\350\275\246\351\227\264\347\256\241\347\220\206/ClsSc_WorkBeginDotCheckBillMain.cs"
index 06f8557..9aa9d87 100644
--- "a/DAL/\350\275\246\351\227\264\347\256\241\347\220\206/ClsSc_WorkBeginDotCheckBillMain.cs"
+++ "b/DAL/\350\275\246\351\227\264\347\256\241\347\220\206/ClsSc_WorkBeginDotCheckBillMain.cs"
@@ -37,6 +37,21 @@
             try
             {
 
+                //淇濆瓨鍓嶆帶鍒�=========================================
+                string HBillNote = "";
+                DataSet ds = oCn.RunProcReturn("Exec h_p_Sc_WorkBeginDotCheckBill_BeforeSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "','" + HBillNote + "',1 ", "h_p_Sc_QualityReportBill_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.BeginTran();
                 //鏇存柊涓昏〃
                 oCn.RunProc("UpDate Sc_WorkBeginDotCheckBillMain set  " +
@@ -71,25 +86,42 @@
                 foreach (Model.ClsSc_WorkBeginDotCheckBillSub oSub in DetailColl)
                 {
                     string subSql = "insert into Sc_WorkBeginDotCheckBillSub " +
-                        "(HInterID,HEntryID,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRemark" +
-                        ",HCheckNoteItemID,HCheckPostID,HCheckResult) " +
-                        " values(" +
-                        "" + omodel.HInterID.ToString() +
-                        "," + oSub.HEntryID.ToString() +
-                        "," + oSub.HSourceInterID +
-                        "," + oSub.HSourceEntryID +
-                        ",'" + oSub.HSourceBillNo +
-                        "','" + oSub.HSourceBillType +
-                        "','" + oSub.HRemark +
-                        "','" + oSub.HCheckNoteItemID +
-                        "','" + oSub.HCheckPostID +
-                        "','" + oSub.HCheckResult +
-                        "')";
+                   "(HInterID,HEntryID,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRemark" +
+                   ",HCheckNoteItemID,HCheckPostID,HCheckResult,HDotCheckType,HRelationID) " +
+                   " values(" +
+                   "" + omodel.HInterID.ToString() +
+                   "," + oSub.HEntryID.ToString() +
+                   "," + oSub.HSourceInterID +
+                   "," + oSub.HSourceEntryID +
+                   ",'" + oSub.HSourceBillNo +
+                   "','" + oSub.HSourceBillType +
+                   "','" + oSub.HRemark +
+                   "','" + oSub.HCheckNoteItemID +
+                   "','" + oSub.HCheckPostID +
+                   "','" + oSub.HCheckResult +
+                   "','" + oSub.HDotCheckType +
+                   "','" + oSub.HRelationID +
+                   "')";
                     oCn.RunProc(subSql);
                 }
-
-
                 sReturn = "淇敼鍗曟嵁鎴愬姛锛�";
+
+                //=========================淇濆瓨鍚庢帶鍒�  
+                DataSet ds2 = oCn.RunProcReturn("h_p_Sc_WorkBeginDotCheckBill_AfterSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "',1 ", "h_p_Sc_QualityReportBill_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;
+                }
+                //============================
+
                 oCn.Commit();
                 return true;
             }
@@ -107,6 +139,21 @@
             {
 
                 DataSet ds;
+
+                //淇濆瓨鍓嶆帶鍒�=========================================
+                string HBillNote = "";
+                 ds = oCn.RunProcReturn("Exec h_p_Sc_WorkBeginDotCheckBill_BeforeSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "','" + HBillNote + "',1 ", "h_p_Sc_QualityReportBill_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.BeginTran();
 
@@ -161,7 +208,7 @@
                 {
                     string subSql = "insert into Sc_WorkBeginDotCheckBillSub " +
                         "(HInterID,HEntryID,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRemark" +
-                        ",HCheckNoteItemID,HCheckPostID,HCheckResult) " +
+                        ",HCheckNoteItemID,HCheckPostID,HCheckResult,HDotCheckType,HRelationID) " +
                         " values(" +
                         "" + omodel.HInterID.ToString() +
                         "," + oSub.HEntryID.ToString() +
@@ -173,11 +220,29 @@
                         "','" + oSub.HCheckNoteItemID +
                         "','" + oSub.HCheckPostID +
                         "','" + oSub.HCheckResult +
+                        "','" + oSub.HDotCheckType +
+                        "','" + oSub.HRelationID +
                         "')";
                     oCn.RunProc(subSql);
                 }
-
                 sReturn = "鏂板鍗曟嵁鎴愬姛锛�";
+
+                //=========================淇濆瓨鍚庢帶鍒�  
+                DataSet ds2 = oCn.RunProcReturn("h_p_Sc_WorkBeginDotCheckBill_AfterSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "',1 ", "h_p_Sc_QualityReportBill_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;
+                }
+                //============================
+
                 oCn.Commit();
                 return true;
             }

--
Gitblit v1.9.1