From 9f7b0ecace9c80ff2a1d95f4343058b3b031bd22 Mon Sep 17 00:00:00 2001
From: dytyqx <1342948614@qq.com>
Date: 星期一, 30 三月 2026 21:39:29 +0800
Subject: [PATCH] 容器管理新增字段子单据类型

---
 WebAPI/Controllers/MJGL/Sc_MouldUpperBillController.cs |  145 ++++++++++++++++++++++++++++++++++++++++-------
 1 files changed, 122 insertions(+), 23 deletions(-)

diff --git a/WebAPI/Controllers/MJGL/Sc_MouldUpperBillController.cs b/WebAPI/Controllers/MJGL/Sc_MouldUpperBillController.cs
index d7a0cf4..492ac86 100644
--- a/WebAPI/Controllers/MJGL/Sc_MouldUpperBillController.cs
+++ b/WebAPI/Controllers/MJGL/Sc_MouldUpperBillController.cs
@@ -141,7 +141,7 @@
             }
             else
             {
-                objJsonResult.code = "0";
+                objJsonResult.code = "1";
                 objJsonResult.count = 1;  //鎴愬姛锛�
                 objJsonResult.Message = DBUtility.ClsPub.isStrNull(BeforeSave.Tables[0].Rows[0]["HRemark"]);
                 objJsonResult.data = null;
@@ -171,7 +171,7 @@
             }
             else
             {
-                objJsonResult.code = "0";
+                objJsonResult.code = "1";
                 objJsonResult.count = 1;  //鎴愬姛锛�
                 objJsonResult.Message = DBUtility.ClsPub.isStrNull(AfterSave.Tables[0].Rows[0]["HRemark"]);
                 objJsonResult.data = null;
@@ -301,10 +301,27 @@
                     objJsonResult.data = null;
                     return objJsonResult;
                 }
-             
+
+                if (OperationType == 1)
+                {
+                    string sReturn = "";
+                    if (oSystemParameter.ShowBill(ref sReturn) == true)
+                    {
+                        if (oSystemParameter.omodel.Sc_MouldUpperBill_AutoCheck.ToUpper() == "Y")
+                        {
+                            oCN.RunProc("Update Sc_MouldUpperBillMain Set HChecker='" + HMaker + "',HCheckDate=getdate(),HBillStatus=2 where HInterID= " + HInterID);
+
+                            objJsonResult.code = "1";
+                            objJsonResult.count = 1;
+                            objJsonResult.Message = "鏂板骞跺鏍稿崟鎹垚鍔�!";
+                            objJsonResult.data = null;
+                            return objJsonResult;
+                        }                        
+                    }
+                }
                 objJsonResult.code = "1";
                 objJsonResult.count = 1;
-                objJsonResult.Message = null;
+                objJsonResult.Message = "淇濆瓨鍗曟嵁鎴愬姛!";
                 objJsonResult.data = null;
                 return objJsonResult;
             }
@@ -337,6 +354,7 @@
 
             if (OperationType == 1)//鏂板
             {
+                
                 //淇濆瓨鍚庢帶鍒�
                 objJsonResult = AfterSave_MouldUpperBill(HInterID, HBillNo, 1);
                 if (objJsonResult.count == 0)
@@ -1131,7 +1149,7 @@
             }
             else
             {
-                objJsonResult.code = "0";
+                objJsonResult.code = "1";
                 objJsonResult.count = 1;  //鎴愬姛锛�
                 objJsonResult.Message = DBUtility.ClsPub.isStrNull(BeforeSave.Tables[0].Rows[0]["HRemark"]);
                 objJsonResult.data = null;
@@ -1161,7 +1179,7 @@
             }
             else
             {
-                objJsonResult.code = "0";
+                objJsonResult.code = "1";
                 objJsonResult.count = 1;  //鎴愬姛锛�
                 objJsonResult.Message = DBUtility.ClsPub.isStrNull(AfterSave.Tables[0].Rows[0]["HRemark"]);
                 objJsonResult.data = null;
@@ -1291,10 +1309,26 @@
                     objJsonResult.data = null;
                     return objJsonResult;
                 }
+                if (OperationType == 1)
+                {
+                    string sReturn = "";
+                    if (oSystemParameter.ShowBill(ref sReturn) == true)
+                    {
+                        if (oSystemParameter.omodel.Sc_MouldLowerBill_AutoCheck.ToUpper() == "Y")
+                        {
+                            oCN.RunProc("Update Sc_MouldLowerBillMain Set HChecker='" + HMaker + "',HCheckDate=getdate(),HBillStatus=2 where HInterID= " + HInterID);
 
+                            objJsonResult.code = "1";
+                            objJsonResult.count = 1;
+                            objJsonResult.Message = "鏂板骞跺鏍稿崟鎹垚鍔�!";
+                            objJsonResult.data = null;
+                            return objJsonResult;
+                        }
+                    }
+                }
                 objJsonResult.code = "1";
                 objJsonResult.count = 1;
-                objJsonResult.Message = null;
+                objJsonResult.Message = "淇濆瓨鍗曟嵁鎴愬姛!";
                 objJsonResult.data = null;
                 return objJsonResult;
             }
@@ -2013,11 +2047,16 @@
 
                 if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                 {
-                    objJsonResult.code = "0";
-                    objJsonResult.count = 0;
-                    objJsonResult.Message = "鏌ユ棤鏁版嵁锛�";
-                    objJsonResult.data = null;
-                    return objJsonResult;
+                    ds = oCN.RunProcReturn("select * from  h_v_Gy_MouldFile_Query where 1=1" + sWhere, "h_v_Gy_MouldFile_Query");
+
+                    if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "褰撳墠妯″叿鏈仛涓婃ā鍗�,鏌ヨ澶辫触锛�";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }                  
                 }
 
                 objJsonResult.code = "1";
@@ -2210,9 +2249,26 @@
                     return objJsonResult;
                 }
 
+                if (OperationType == 1)
+                {
+                    string sReturn = "";
+                    if (oSystemParameter.ShowBill(ref sReturn) == true)
+                    {
+                        if (oSystemParameter.omodel.Sc_MouldUpperBill_AutoCheck.ToUpper() == "Y")
+                        {
+                            oCN.RunProc("Update Sc_MouldUpperBillMain Set HChecker='" + HMaker + "',HCheckDate=getdate(),HBillStatus=2 where HInterID= " + HInterID);
+
+                            objJsonResult.code = "1";
+                            objJsonResult.count = 1;
+                            objJsonResult.Message = "鏂板骞跺鏍稿崟鎹垚鍔�!";
+                            objJsonResult.data = null;
+                            return objJsonResult;
+                        }
+                    }
+                }
                 objJsonResult.code = "1";
                 objJsonResult.count = 1;
-                objJsonResult.Message = null;
+                objJsonResult.Message = "淇濆瓨鍗曟嵁鎴愬姛!";
                 objJsonResult.data = null;
                 return objJsonResult;
             }
@@ -2396,7 +2452,7 @@
                 if (OperationType == 1) // 鏂板
                 {
                     objJsonResult = AfterSave_MouldLowerBill(HInterID, HBillNo, 1);
-                    if (objJsonResult.count == 0)
+                    if (objJsonResult.code == "0")
                     {
                         oCN.RollBack();
                         objJsonResult.code = "0";
@@ -2408,7 +2464,7 @@
                 else // 淇敼/澶嶅埗
                 {
                     objJsonResult = AfterSave_MouldLowerBill(HInterID, HBillNo, 2);
-                    if (objJsonResult.count == 0)
+                    if (objJsonResult.code == "0")
                     {
                         oCN.RollBack();
                         objJsonResult.code = "0";
@@ -2437,14 +2493,22 @@
                                 Service.GeTuiService.PubishSingle(HInterID0);
                             }
                         }
-                    }
-                }
+                        if (oSystemParameter.omodel.Sc_MouldLowerBill_AutoCheck.ToUpper() == "Y")
+                        {
+                            oCN.RunProc("Update Sc_MouldLowerBillMain Set HChecker='" + HMaker + "',HCheckDate=getdate(),HBillStatus=2 where HInterID= " + HInterID);
 
-                // 杩斿洖鎴愬姛缁撴灉锛堟敞鎰忓師閫昏緫涓娇鐢ㄤ簡 ds.Tables[0]锛�
+                            objJsonResult.code = "1";
+                            objJsonResult.count = 1;
+                            objJsonResult.Message = "鏂板骞跺鏍稿崟鎹垚鍔�!";
+                            objJsonResult.data = null;
+                            return objJsonResult;
+                        }
+                    }
+                }                
                 objJsonResult.code = "1";
                 objJsonResult.count = 1;
-                objJsonResult.Message = "鏂板鍗曟嵁鎴愬姛锛�";
-                objJsonResult.data = ds.Tables[0];
+                objJsonResult.Message = "淇濆瓨鍗曟嵁鎴愬姛!";
+                objJsonResult.data = null;
                 return objJsonResult;
             }
             catch (Exception e)
@@ -2574,9 +2638,27 @@
                     return objJsonResult;
                 }
 
+
+                if (OperationType == 1)
+                {
+                    string sReturn = "";
+                    if (oSystemParameter.ShowBill(ref sReturn) == true)
+                    {
+                        if (oSystemParameter.omodel.Sc_MouldLowerBill_AutoCheck.ToUpper() == "Y")
+                        {
+                            oCN.RunProc("Update Sc_MouldLowerBillMain Set HChecker='" + HMaker + "',HCheckDate=getdate(),HBillStatus=2 where HInterID= " + HInterID);
+
+                            objJsonResult.code = "1";
+                            objJsonResult.count = 1;
+                            objJsonResult.Message = "鏂板骞跺鏍稿崟鎹垚鍔�!";
+                            objJsonResult.data = null;
+                            return objJsonResult;
+                        }
+                    }
+                }
                 objJsonResult.code = "1";
                 objJsonResult.count = 1;
-                objJsonResult.Message = null;
+                objJsonResult.Message = "淇濆瓨鍗曟嵁鎴愬姛!";
                 objJsonResult.data = null;
                 return objJsonResult;
             }
@@ -2692,7 +2774,7 @@
             oCN.Commit();
             objJsonResult.code = "1";
             objJsonResult.count = 1;
-            objJsonResult.Message = "鏂板鍗曟嵁鎴愬姛锛�";
+            objJsonResult.Message = objJsonResult.Message;
             objJsonResult.data = ds.Tables[0];
             return objJsonResult;
         }
@@ -2786,9 +2868,26 @@
                     return objJsonResult;
                 }
 
+                if (OperationType == 1)
+                {
+                    string sReturn = "";
+                    if (oSystemParameter.ShowBill(ref sReturn) == true)
+                    {
+                        if (oSystemParameter.omodel.Sc_MouldUpperBill_AutoCheck.ToUpper() == "Y")
+                        {
+                            oCN.RunProc("Update Sc_MouldUpperBillMain Set HChecker='" + HMaker + "',HCheckDate=getdate(),HBillStatus=2 where HInterID= " + HInterID);
+
+                            objJsonResult.code = "1";
+                            objJsonResult.count = 1;
+                            objJsonResult.Message = "鏂板骞跺鏍稿崟鎹垚鍔�!";
+                            objJsonResult.data = null;
+                            return objJsonResult;
+                        }
+                    }
+                }
                 objJsonResult.code = "1";
                 objJsonResult.count = 1;
-                objJsonResult.Message = null;
+                objJsonResult.Message = "淇濆瓨鍗曟嵁鎴愬姛!";
                 objJsonResult.data = null;
                 return objJsonResult;
             }

--
Gitblit v1.9.1