From 78549fbacdf433bb0026a2c2f41351e9638cb3d4 Mon Sep 17 00:00:00 2001
From: duhe <226547893@qq.com>
Date: 星期一, 09 三月 2026 01:49:24 +0800
Subject: [PATCH] 1

---
 WebAPI/Controllers/BaseSet/Gy_MaterialController.cs |  109 +++++++++++++++++++++++++++++++++++++++++++++++++++---
 1 files changed, 102 insertions(+), 7 deletions(-)

diff --git a/WebAPI/Controllers/BaseSet/Gy_MaterialController.cs b/WebAPI/Controllers/BaseSet/Gy_MaterialController.cs
index 6a0abc9..07a63aa 100644
--- a/WebAPI/Controllers/BaseSet/Gy_MaterialController.cs
+++ b/WebAPI/Controllers/BaseSet/Gy_MaterialController.cs
@@ -2708,6 +2708,9 @@
                 string HProductDesignSize = mainList[0].HProductDesignSize;  // 浜у搧璁捐灏哄
                 string HGaugeDesignSize = mainList[0].HGaugeDesignSize;  // 妫�鍏疯璁″昂瀵�
                 int HProductQTY = mainList[0].HProductQTY;  // 浜у搧鏁伴噺
+                int HManagerID = mainList[0].HManagerID;  // 璐熻矗浜�
+                double HPackV = mainList[0].HPackV;     //鎵樹綋绉�
+                double HStandardQtyForMouldInPack = mainList[0].HStandardQtyForMouldInPack; //鎵樻爣鍑嗗鍣ㄦ暟閲�
 
                 //淇濆瓨鍓嶆帶鍒�=========================================
                 string HBillNote = "";
@@ -2745,7 +2748,7 @@
                 ",HUseLife,HLeaveLife,HProdQty,HProdWeight,HMouldOWNER,HSaveLife,HMouldDotCheckRuleInterID,HMouldMaintainRuleInterID,HBarCode,HMadeSupID" +
                 ",HMouldClass,HNowWHID,HNowSPID,HInitLife,HMouldUseStatus,HCREATEORGID,HUSEORGID " +
                  ",HMouldLength,HMouldWidth,HMouldHeight,HMouldFoldHeight,HTransPackFlag,HSendPackFlag," +
-                 "HUserID,HBrand,HCalibrationType,HLocation,HCalibrationDate,HCalibrationCycle,HProductDesignSize,HGaugeDesignSize,HProductQTY ) " +
+                 "HUserID,HBrand,HCalibrationType,HLocation,HCalibrationDate,HCalibrationCycle,HProductDesignSize,HGaugeDesignSize,HProductQTY,HManagerID,HPackV,HStandardQtyForMouldInPack) " +
 
                " values('" + BillType + "','" + BillType + "'," + HInterID + ",'" + HBillNo + "','" + HDate + "'" +
                 "," + HYear + "," + HPeriod + ",'" + HRemark + "','" + HMaker + "',getdate()" +
@@ -2758,7 +2761,7 @@
                 ",'" + HUseLife + "','" + HLeaveLife + "','" + HProdQty + "','" + HProdWeight + "','" + HMouldOWNER + "','" + HSaveLife + "','" + HMouldDotCheckRuleInterID + "','" + HMouldMaintainRuleInterID + "','" + HBarCode + "'," + HMadeSupID +
                 ",'" + HMouldClass + "'," + HNowWHID + "," + HNowSPID + ",'" + HInitLife + "','" + HMouldUseStatus + "'," + HCREATEORGID + "," + HUSEORGID +
                 "," + HMouldLength + "," + HMouldWidth + "," + HMouldHeight + "," + HMouldFoldHeight + "," + Convert.ToString(HTransPackFlag ? 1 : 0) + "," + Convert.ToString(HSendPackFlag ? 1 : 0) + "," +
-                "'" + HUserID + "','" + HBrand + "','" + HCalibrationType + "','" + HLocation + "','" + HCalibrationDate + "','" + HCalibrationCycle + "','" + HProductDesignSize + "','" + HGaugeDesignSize + "','" + HProductQTY + "') ");
+                "'" + HUserID + "','" + HBrand + "','" + HCalibrationType + "','" + HLocation + "','" + HCalibrationDate + "','" + HCalibrationCycle + "','" + HProductDesignSize + "','" + HGaugeDesignSize + "','" + HProductQTY + "','" + HManagerID + "','" + HPackV + "','" + HStandardQtyForMouldInPack + "') ");
 
                 //瀛愯〃
                 oCN.RunProc("Insert into Gy_MouldFileSub " +
@@ -2917,11 +2920,14 @@
                 string HBrand = mainList[0].HBrand;  // 鍝佺墝
                 string HCalibrationType = mainList[0].HCalibrationType;  // 鏍″噯绫诲瀷 (鍐�/澶栨牎)
                 string HLocation = mainList[0].HLocation;  // 浣嶇疆
-                DateTime HCalibrationDate = mainList[0].HCalibrationDate;  // 鏍″噯鏃ユ湡
+                DateTime HCalibrationDate = mainList[0].HCalibrationDate != null ? mainList[0].HCalibrationDate: DateTime.Now; // 鏍″噯鏃ユ湡
                 string HCalibrationCycle = mainList[0].HCalibrationCycle;  // 鏍″噯鍛ㄦ湡
                 string HProductDesignSize = mainList[0].HProductDesignSize;  // 浜у搧璁捐灏哄
                 string HGaugeDesignSize = mainList[0].HGaugeDesignSize;  // 妫�鍏疯璁″昂瀵�
                 int HProductQTY = mainList[0].HProductQTY;  // 浜у搧鏁伴噺
+                int HManagerID = mainList[0].HManagerID;  // 璐熻矗浜�
+                double HPackV = mainList[0].HPackV;     //鎵樹綋绉�
+                double HStandardQtyForMouldInPack = mainList[0].HStandardQtyForMouldInPack; //鎵樻爣鍑嗗鍣ㄦ暟閲�
 
                 //鑻AINDI閲嶅鍒欓噸鏂拌幏鍙�
                 oCN.BeginTran();
@@ -2947,6 +2953,82 @@
                     return objJsonResult;
                 }
                 //=========================================================
+                string sql= "UpDate Gy_MouldFileMain set  " +
+                 " HBillNo='" + HBillNo + "'" +  //鍥哄畾璧嬪��===============
+                 ",HDate='" + HDate + "'" +
+                 ",HYear='" + HYear.ToString() + "'" +
+                 ",HPeriod='" + HPeriod.ToString() + "'" +
+                 ",HRemark='" + HRemark + "'" +
+                 ",HUpDater='" + HUpDater + "'" +
+                 ",HUpDateDate=getdate()" +
+                 //========================================
+                 ",HMouldNo='" + HMouldNo + "'" +
+                 ",HName='" + HName + "'" +
+                 ",HModel='" + HModel + "'" +
+                 ",HModel2='" + HModel2 + "'" +
+                 ",HDiameter='" + HDiameter + "'" +
+                 ",HSubjoin='" + HSubjoin + "'" +
+                 ",HSubjoin2='" + HSubjoin2 + "'" +
+                 ",HPICNo='" + HPICNo + "'" +
+                 ",HWorkMaterModel='" + HWorkMaterModel + "'" +
+                 ",HMaterID=" + HMaterID.ToString() +
+                 ",HUSEORGID=" + HUSEORGID.ToString() +
+                 ",HMaterNumber='" + HMaterNumber + "'" +
+                 ",HMouldClass='" + HMouldClass + "'" +
+                 ",HMouldType=" + HMouleTypeID.ToString() +
+                 ",HUnitID=" + HUnitID.ToString() +
+                 ",HOutComDate='" + HOutComDate + "'" +
+                 ",HOutComNo='" + HOutComNo + "'" +
+                 ",HDeptID=" + HDeptID.ToString() +
+                 ",HSupID=" + HSupID.ToString() +
+                 ",HSupNumber='" + HSupNumber + "'" +
+                 ",HMouldStatus='" + HMouldStatus + "'" +
+                 ",HSaveLife='" + HSaveLife + "'" +
+                 ",HWhID=" + HWHID.ToString() +
+                 ",HRoutingID=" + HRoutingID.ToString() +
+                 ",HBomID=" + HBOMID.ToString() +
+                 ",HVersion='" + HVersion + "'" +
+                 ",HSPGroupID=" + HSPGroupID.ToString() +
+                 ",HSPID=" + HSPID.ToString() +
+                 ",HDesignLife=" + HDesignLife.ToString() +
+                 ",HCaveQty=" + HCaveQty.ToString() +
+                 ",HUseLife=" + HUseLife.ToString() +
+                 ",HLeaveLife=" + HLeaveLife.ToString() +
+                 ",HProdQty=" + HProdQty.ToString() +
+                 ",HMouldDotCheckRuleInterID=" + HMouldDotCheckRuleInterID.ToString() +
+                 ",HMouldMaintainRuleInterID=" + HMouldMaintainRuleInterID.ToString() +
+                 ",HMouldOWNER='" + HMouldOWNER + "'" +
+                 ",HNowSupID=" + HNowSupID.ToString() +
+                 ",HNowSupTypeID=" + HNowSupTypeID.ToString() +
+                 ",HProdWeight=" + HProdWeight.ToString() +
+                 ",HBarCode='" + HBarCode.ToString() + "'" +
+                 ",HMadeSupID=" + HMadeSupID +
+                 ",HNowWHID=" + HNowWHID +
+                 ",HNowSPID=" + HNowSPID +
+                 ",HTransPackFlag=" + Convert.ToString(HTransPackFlag ? 1 : 0) +
+                 ",HSendPackFlag=" + Convert.ToString(HSendPackFlag ? 1 : 0) +
+                 ",HMouldLength=" + HMouldLength +
+                 ",HMouldWidth=" + HMouldWidth +
+                 ",HMouldHeight=" + HMouldHeight +
+                 ",HMouldFoldHeight=" + HMouldFoldHeight +
+                 ",HInitLife='" + HInitLife +
+                 "',HNextMainDate='" + HNextMainDate +
+                 "',HMouldUseStatus='" + HMouldUseStatus +
+                 "',HUserID='" + HUserID +
+                 "',HBrand='" + HBrand +
+                 "',HCalibrationType='" + HCalibrationType +
+                 "',HLocation='" + HLocation +
+                 "',HCalibrationDate='" + HCalibrationDate +
+                 "',HCalibrationCycle='" + HCalibrationCycle +
+                 "',HProductDesignSize='" + HProductDesignSize +
+                 "',HGaugeDesignSize='" + HGaugeDesignSize +
+                 "',HProductQTY='" + HProductQTY +
+                 "',HManagerID='" + HManagerID +
+                 "',HPackV='" + HPackV +
+                 "',HStandardQtyForMouldInPack='" + HStandardQtyForMouldInPack +
+                 "' where HInterID=" + HInterID.ToString();
+
+                LogService.Write(sql);
 
                 //涓昏〃
                 oCN.RunProc("UpDate Gy_MouldFileMain set  " +
@@ -3019,6 +3101,9 @@
                  "',HProductDesignSize='" + HProductDesignSize +
                  "',HGaugeDesignSize='" + HGaugeDesignSize +
                  "',HProductQTY='" + HProductQTY +
+                 "',HManagerID='" + HManagerID +
+                 "',HPackV='" + HPackV +
+                 "',HStandardQtyForMouldInPack='" + HStandardQtyForMouldInPack +
                  "' where HInterID=" + HInterID.ToString());             
 
                 oCN.RunProc("delete from Gy_MouldFileSub_SubMater where HInterID='" + HInterID + "'");
@@ -3233,16 +3318,24 @@
                     return objJsonResult;
                 }
 
-                ds = oCN.RunProcReturn("select * from Gy_MouldFileMain where HInterID = " + hmainid + " and ISNULL(HChecker,'') <> '' and HPrintQty>0", "Gy_MouldFileMain");
+                ds = oCN.RunProcReturn("select * from Gy_MouldFileMain where HInterID = " + hmainid + " and ISNULL(HChecker,'') <> '' ", "Gy_MouldFileMain");
                 if (ds.Tables[0].Rows.Count > 0)
                 {
                     objJsonResult.code = "0";
                     objJsonResult.count = 0;
-                    objJsonResult.Message = "鍒犻櫎澶辫触锛佸崟鎹凡瀹℃牳鎴栧凡琚墦鍗帮紒";
+                    objJsonResult.Message = "鍒犻櫎澶辫触锛佸崟鎹凡瀹℃牳锛�";
                     objJsonResult.data = null;
                     return objJsonResult;
                 }
-
+                ds = oCN.RunProcReturn("select * from Gy_MouldFileMain where HInterID = " + hmainid + "  and HPrintQty>0", "Gy_MouldFileMain");
+                if (ds.Tables[0].Rows.Count > 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鍒犻櫎澶辫触锛佸崟鎹凡琚墦鍗帮紒";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
                 oCN.BeginTran();
                 //鍒犻櫎鍓嶆帶鍒�=========================================
                 ds = oCN.RunProcReturn("Exec h_p_Gy_MouldFile_BeforeDelCtrl " + hmainid + ",'" + User + "'", "h_p_Gy_MouldFile_BeforeDelCtrl");
@@ -4016,6 +4109,8 @@
                 DataSet ds = new DataSet();
                 ds = oCN.RunProcReturn("select * from Gy_MouldFileMain where HInterID=" + HInterID, "Gy_MouldFileMain");
                 DataRow dr = ds.Tables[0].Rows[0];
+                dr["HPrintQty"] = 0;
+
                 string Num = dr["HBarCode"].ToString();
                 string Num1 = Num.Substring(0, (Num.Length) - 5);
                 oCN.BeginTran();
@@ -4821,7 +4916,7 @@
                         "," + HPrintQty + ",'" + HMouldStatus + "'," + HWHID + "," + HRoutingID + "," + HCaveQty +
                         "," + HBOMID + ",'" + HVersion + "'," + HSPGroupID + "," + HSPID + ",'" + HDesignLife + "','" + HNowSupID + "','" + HNowSupTypeID + "'" +
                         ",'" + HUseLife + "','" + HLeaveLife + "','" + HProdQty + "','" + HProdWeight + "','" + HMouldOWNER + "','" + HSaveLife + "','" + HMouldDotCheckRuleInterID + "','" + HMouldMaintainRuleInterID + "','" + HBarCode + "'," + HMadeSupID +
-                        ",'" + HMouldClass + "'," + HNowWHID + "," + HNowSPID + ",'" + HInitLife + " ) ");
+                        ",'" + HMouldClass + "'," + HNowWHID + "," + HNowSPID + ",'" + HInitLife + "' ) ");
                     }
                     else
                     {

--
Gitblit v1.9.1