From ca61b21fd1def0f587519f087438abf1cd7dbfda Mon Sep 17 00:00:00 2001
From: wtt <1985833171@qq.com>
Date: 星期五, 06 二月 2026 14:36:10 +0800
Subject: [PATCH] 模具导入调整
---
WebAPI/Controllers/BaseSet/Gy_MaterialController.cs | 141 +++++++++++++++++++++++-----------------------
1 files changed, 70 insertions(+), 71 deletions(-)
diff --git a/WebAPI/Controllers/BaseSet/Gy_MaterialController.cs b/WebAPI/Controllers/BaseSet/Gy_MaterialController.cs
index 50c5e22..4247d91 100644
--- a/WebAPI/Controllers/BaseSet/Gy_MaterialController.cs
+++ b/WebAPI/Controllers/BaseSet/Gy_MaterialController.cs
@@ -2891,7 +2891,6 @@
string HUpDater = mainList[0].HUpDater;
string HMaterNumber = mainList[0].HMaterNumber;
string HSupNumber = mainList[0].HSupNumber;
- long HPrintQty = mainList[0].HPrintQty;
string HMouldOWNER = mainList[0].HMouldOWNER;
string HSaveLife = mainList[0].HSaveLife;
int HCaveQty = mainList[0].HCaveQty;
@@ -2949,7 +2948,7 @@
}
//=========================================================
- //涓昏〃
+ //涓昏〃
oCN.RunProc("UpDate Gy_MouldFileMain set " +
" HBillNo='" + HBillNo + "'" + //鍥哄畾璧嬪��===============
",HDate='" + HDate + "'" +
@@ -2979,7 +2978,6 @@
",HDeptID=" + HDeptID.ToString() +
",HSupID=" + HSupID.ToString() +
",HSupNumber='" + HSupNumber + "'" +
- ",HPrintQty=" + HPrintQty.ToString() +
",HMouldStatus='" + HMouldStatus + "'" +
",HSaveLife='" + HSaveLife + "'" +
",HWhID=" + HWHID.ToString() +
@@ -3235,7 +3233,7 @@
return objJsonResult;
}
- ds = oCN.RunProcReturn("select * from Gy_MouldFileMain where HInterID = " + hmainid + " and ISNULL(HChecker,'') <> ''", "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";
@@ -3244,77 +3242,76 @@
objJsonResult.data = null;
return objJsonResult;
}
-
- if (oBill.DeleteBill(hmainid, ref DBUtility.ClsPub.sExeReturnInfo))
- {
- oCN.BeginTran();
- //鍒犻櫎鍓嶆帶鍒�=========================================
- ds = oCN.RunProcReturn("Exec h_p_Gy_MouldFile_BeforeDelCtrl " + hmainid + ",'" + User + "'", "h_p_Gy_MouldFile_BeforeDelCtrl");
-
- if (ds == null)
- {
- oCN.RollBack();
- objJsonResult.code = "0";
- objJsonResult.count = 0;
- objJsonResult.Message = "鍒犻櫎鍓嶅垽鏂け璐ワ紒";
- objJsonResult.data = null;
- return objJsonResult;
- }
- if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) != "0")
- {
- oCN.RollBack();
- objJsonResult.code = "0";
- objJsonResult.count = 0;
- objJsonResult.Message = "鍒犻櫎澶辫触锛�" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
- objJsonResult.data = null;
- return objJsonResult;
- }
- //=========================================================
-
- oCN.RunProc("Delete From Gy_MouldFileSub_MaintainRule where HInterID=" + hmainid);
- oCN.RunProc("Delete From Gy_MouldFileSub_DotCheckRule where HInterID=" + hmainid);
-
- //鍒犻櫎鍚庢帶鍒�=========================================
- DataSet ds2 = oCN.RunProcReturn("Exec h_p_Gy_MouldFile_AfterDelCtrl " + hmainid + ",'" + User + "'", "h_p_Gy_MouldFile_AfterDelCtrl");
- if (ds2 == null)
- {
- oCN.RollBack();
- objJsonResult.code = "0";
- objJsonResult.count = 0;
- objJsonResult.Message = "鍒犻櫎鍚庡垽鏂け璐ワ紒";
- objJsonResult.data = null;
- return objJsonResult;
- }
- if (DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBack"]) != "0")
- {
- oCN.RollBack();
- objJsonResult.code = "0";
- objJsonResult.count = 0;
- objJsonResult.Message = "鍒犻櫎澶辫触锛�" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
- objJsonResult.data = null;
- return objJsonResult;
- }
- //=========================================================
-
- oCN.Commit();
- //鍐欏叆鏃ュ織
- ClsPub.Add_Log("", "鍒犻櫎椤圭洰锛屼唬鐮侊細" + oBill.omodel.HMouldNo + ",鍚嶇О锛�" + oBill.omodel.HName, ClsPub.CurUserName);
- //鏇存柊涓婄骇涓� 鏈骇
- objJsonResult.code = "1";
- objJsonResult.count = 1;
- objJsonResult.Message = "鍒犻櫎鎴愬姛";
- objJsonResult.data = null;
- return objJsonResult;
- }
- else
+ 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.Message = "鍒犻櫎澶辫触锛佸崟鎹凡琚墦鍗帮紒";
objJsonResult.data = null;
return objJsonResult;
}
- //ds = oCN.RunProcReturn("delete from Gy_Department where HItemID = " + HItemID, "Gy_Department");
+ oCN.BeginTran();
+ //鍒犻櫎鍓嶆帶鍒�=========================================
+ ds = oCN.RunProcReturn("Exec h_p_Gy_MouldFile_BeforeDelCtrl " + hmainid + ",'" + User + "'", "h_p_Gy_MouldFile_BeforeDelCtrl");
+
+ if (ds == null)
+ {
+ oCN.RollBack();
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍒犻櫎鍓嶅垽鏂け璐ワ紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) != "0")
+ {
+ oCN.RollBack();
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍒犻櫎澶辫触锛�" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ //=========================================================
+ oCN.RunProc("Delete From Gy_MouldFileMain where HInterID=" + hmainid);
+ oCN.RunProc("Delete From Gy_MouldFileSub where HInterID=" + hmainid);
+ oCN.RunProc("Delete From Gy_MouldFileSub2 where HInterID=" + hmainid);
+ oCN.RunProc("Delete From Gy_MouldFileSub_SubMater where HInterID=" + hmainid);
+ oCN.RunProc("Delete From Gy_MouldFileSub_MaintainRule where HInterID=" + hmainid);
+ oCN.RunProc("Delete From Gy_MouldFileSub_DotCheckRule where HInterID=" + hmainid);
+
+ //鍒犻櫎鍚庢帶鍒�=========================================
+ DataSet ds2 = oCN.RunProcReturn("Exec h_p_Gy_MouldFile_AfterDelCtrl " + hmainid + ",'" + User + "'", "h_p_Gy_MouldFile_AfterDelCtrl");
+ if (ds2 == null)
+ {
+ oCN.RollBack();
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍒犻櫎鍚庡垽鏂け璐ワ紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ if (DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBack"]) != "0")
+ {
+ oCN.RollBack();
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍒犻櫎澶辫触锛�" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ //=========================================================
+
+ oCN.Commit();
+ //鍐欏叆鏃ュ織
+ ClsPub.Add_Log("", "鍒犻櫎妯″叿妗f锛屼唬鐮侊細" + oBill.omodel.HMouldNo + ",鍚嶇О锛�" + oBill.omodel.HName, ClsPub.CurUserName);
+ //鏇存柊涓婄骇涓� 鏈骇
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鍒犻櫎鎴愬姛";
+ objJsonResult.data = null;
+ return objJsonResult;
}
catch (Exception e)
@@ -4027,6 +4024,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();
@@ -4832,7 +4831,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
{
@@ -5138,7 +5137,7 @@
{
try
{
- ds = oCN.RunProcReturn($"select * from Gy_BarCodeBill where HBarCode='{HbarCode}' ", "Gy_Material");
+ ds = oCN.RunProcReturn($"select *,b.hnumber HMaterNumber,b.hname HMaterName_m from Gy_BarCodeBill a with(nolock) left join Gy_Material b with(nolock) on a.HMaterID=b.HItemID where HBarCode='{HbarCode}' ", "Gy_Material");
if (ds == null || ds.Tables[0].Rows.Count == 0)
{
objJsonResult.code = "0";
--
Gitblit v1.9.1