From cee055eb7cdecf5d995cc65d379494e471bde9c8 Mon Sep 17 00:00:00 2001
From: yangle <admin@YINMOU>
Date: 星期三, 02 四月 2025 10:06:03 +0800
Subject: [PATCH] 合并
---
WebAPI/Controllers/BaseSet/Gy_MaterialController.cs | 473 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++--
1 files changed, 451 insertions(+), 22 deletions(-)
diff --git a/WebAPI/Controllers/BaseSet/Gy_MaterialController.cs b/WebAPI/Controllers/BaseSet/Gy_MaterialController.cs
index c298d0f..e89d391 100644
--- a/WebAPI/Controllers/BaseSet/Gy_MaterialController.cs
+++ b/WebAPI/Controllers/BaseSet/Gy_MaterialController.cs
@@ -1120,11 +1120,11 @@
[HttpGet]
public object DeltetGy_Material(string HItemID, string user)
{
+ SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+ oCN.BeginTran();//寮�濮嬩簨鍔�
DataSet ds;
try
{
- SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
-
if (user == "10000")//api鍚屾鏂瑰紡
{
oCN.RunProc("delete from Gy_Material where HERPItemID=" + HItemID);
@@ -1152,7 +1152,7 @@
objJsonResult.data = null;
return objJsonResult;
}
- oCN.BeginTran();//寮�濮嬩簨鍔�
+
ds = oCN.RunProcReturn("select * from Gy_Material where HItemID=" + HItemID, "Gy_Material");
if (ds == null || ds.Tables[0].Rows.Count == 0)
{
@@ -1386,7 +1386,49 @@
}
#endregion
+ #region 鑾峰彇褰撳墠鍏徃鍚�
+ /// <summary>
+ ///
+ /// </summary>
+ /// <param name="HInterID">鍗曟嵁ID</param>
+ /// <param name="IsAudit">瀹℃牳(0),鍙嶅鏍�(1)</param>
+ /// <param name="CurUserName">瀹℃牳浜�</param>
+ /// <returns></returns>
+ [Route("Xt_getInfo/getCompanyName")]
+ [HttpGet]
+ public object getCompanyName()
+ {
+ try
+ {
+ string sErr = "";
+ if(oSystemParameter.ShowBill(ref sErr))
+ {
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = oSystemParameter.omodel.WMS_CampanyName;
+ objJsonResult.data = oSystemParameter.omodel.WMS_CampanyName;
+ }
+ else
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "褰撳墠鍏徃鍚嶈幏鍙栧け璐ワ紒" ;
+ objJsonResult.data = null;
+ }
+ return objJsonResult;
+ }
+ catch (Exception e)
+ {
+ oCN.RollBack();
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ #endregion
/// <summary>
@@ -1434,6 +1476,63 @@
return objJsonResult;
}
}
+
+ #region 妯″叿鍒楄〃鍒嗛〉鍒楄〃
+ [Route("Gy_Mould/page")]
+ [HttpGet]
+ public object Gy_MouldPage(string sWhere,string ModRightNameSelect,string user, int page, int size)
+ {
+ DataSet ds;
+ json res = new json();
+ try
+ {
+ List<object> columnNameList = new List<object>();
+ if (!DBUtility.ClsPub.Security_Log(ModRightNameSelect, 1, false, user))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "娌℃湁鏌ョ湅鏉冮檺";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ if (sWhere == null || sWhere.Equals(""))
+ {
+ ds = oCN.RunProcReturn("exec h_p_Gy_MouldFileList " + page + "," + size + ",''", "h_p_Gy_MouldFileList");
+ }
+ else
+ {
+ sWhere = sWhere.Replace("'", "''");
+ ds = oCN.RunProcReturn("exec h_p_Gy_MouldFileList " + page + "," + size + ",'" + sWhere + "'", "h_p_Gy_MouldFileList");
+ }
+
+ //娣诲姞鍒楀悕
+ foreach (DataColumn col in ds.Tables[0].Columns)
+ {
+ Type dataType = col.DataType;
+ string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
+ columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕
+ }
+
+ res.code = CodeConstant.SUCCEED;
+ res.count = int.Parse(ds.Tables[1].Rows[0]["count"].ToString());
+ res.Message = "Sucess锛�";
+ res.list = columnNameList;
+ res.data = ds.Tables[0];
+ return res;
+ }
+ catch (Exception e)
+ {
+ res.code = CodeConstant.FAIL;
+ res.count = CountConstant.FAIL;
+ res.Message = "Exception锛�" + e.ToString();
+ res.data = null;
+ return res;
+ }
+ }
+ #endregion
+
+
#region 鍣ㄥ叿妗f鍒楄〃 鏍戠姸鍥� 璁惧鍒嗙被鏌ヨ
@@ -1648,7 +1747,7 @@
{
objJsonResult.code = "0";
objJsonResult.count = 0;
- objJsonResult.Message = "鏃犲垹闄ゆ潈闄愶紒";
+ objJsonResult.Message = "[0000-1-058]鏃犲垹闄ゆ潈闄愶紒";
objJsonResult.data = null;
return objJsonResult;
}
@@ -1659,7 +1758,7 @@
{
objJsonResult.code = "0";
objJsonResult.count = 0;
- objJsonResult.Message = "鍒犻櫎鏉$爜鍓嶅垽鏂彂鐢熼敊璇紒";
+ objJsonResult.Message = "[3899-1-001]鍒犻櫎鏉$爜鍓嶅垽鏂彂鐢熼敊璇紒";
objJsonResult.data = null;
return objJsonResult;
}
@@ -1669,9 +1768,9 @@
{
objJsonResult.code = "0";
objJsonResult.count = 0;
- objJsonResult.Message = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HRemark"]);
+ objJsonResult.Message = "[0000-1-007]" + DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HRemark"]);
objJsonResult.data = null;
- return objJsonResult;
+ return objJsonResult;
}
}
//Int64 lngBillKey = 0;
@@ -1680,7 +1779,7 @@
{
objJsonResult.code = "0";
objJsonResult.count = 0;
- objJsonResult.Message = "鍗曟嵁ID涓虹┖锛�";
+ objJsonResult.Message = "[0000-1-009]鍗曟嵁ID涓虹┖锛�";
objJsonResult.data = null;
return objJsonResult;
}
@@ -1725,7 +1824,7 @@
oCN.Commit();
objJsonResult.code = "1";
objJsonResult.count = 1;
- objJsonResult.Message = "鍒犻櫎鎴愬姛";
+ objJsonResult.Message = "[0000-1-008]鍒犻櫎鎴愬姛";
objJsonResult.data = null;
return objJsonResult;
}
@@ -1733,7 +1832,7 @@
{
objJsonResult.code = "0";
objJsonResult.count = 0;
- objJsonResult.Message = "鍗曟嵁鏈壘鍒�";
+ objJsonResult.Message = "[0000-1-045]鍗曟嵁鏈壘鍒�";
objJsonResult.data = null;
return objJsonResult;
}
@@ -1743,7 +1842,7 @@
oCN.RollBack();
objJsonResult.code = "0";
objJsonResult.count = 0;
- objJsonResult.Message = e.Message;
+ objJsonResult.Message = "[0000-1-007]" + e.Message;
objJsonResult.data = null;
return objJsonResult;
}
@@ -1770,7 +1869,7 @@
{
objJsonResult.code = "0";
objJsonResult.count = 0;
- objJsonResult.Message = "浣滃簾澶辫触锛佹棤鏉冮檺锛�";
+ objJsonResult.Message = "[0000-1-063]浣滃簾澶辫触锛佹棤鏉冮檺锛�";
objJsonResult.data = null;
return objJsonResult;
}
@@ -1779,7 +1878,7 @@
{
objJsonResult.code = "0";
objJsonResult.count = 0;
- objJsonResult.Message = "HInterID灏忎簬0锛�";
+ objJsonResult.Message = "[0000-1-009]HInterID灏忎簬0锛�";
objJsonResult.data = null;
return objJsonResult;
}
@@ -1807,7 +1906,7 @@
objJsonResult.code = "1";
objJsonResult.count = 1;
- objJsonResult.Message = "浣滃簾鎴愬姛";
+ objJsonResult.Message = "[0000-1-040]浣滃簾鎴愬姛";
objJsonResult.data = null;
oCN.Commit();
@@ -1816,7 +1915,7 @@
{
objJsonResult.code = "0";
objJsonResult.count = 0;
- objJsonResult.Message = "浣滃簾澶辫触!鍘熷洜:" + DBUtility.ClsPub.sExeReturnInfo;
+ objJsonResult.Message = "[0000-1-042]浣滃簾澶辫触!鍘熷洜:" + DBUtility.ClsPub.sExeReturnInfo;
objJsonResult.data = null;
oCN.RollBack();
@@ -1839,7 +1938,7 @@
objJsonResult.code = "0";
objJsonResult.count = 0;
- objJsonResult.Message = "鍙嶄綔搴熷け璐ワ紝鍘熷洜锛氬弽浣滃簾鏉$爜鍓嶅垽鏂彂鐢熼敊璇紒";
+ objJsonResult.Message = "[0000-1-042]鍙嶄綔搴熷け璐ワ紝鍘熷洜锛氬弽浣滃簾鏉$爜鍓嶅垽鏂彂鐢熼敊璇紒";
objJsonResult.data = null;
return objJsonResult;
}
@@ -1851,7 +1950,7 @@
objJsonResult.code = "1";
objJsonResult.count = 1;
- objJsonResult.Message = "鍙嶄綔搴熷け璐ワ紝鍘熷洜锛�" + DBUtility.ClsPub.isStrNull(DS.Tables[0].Rows[0]["HRemark"]);
+ objJsonResult.Message = "[0000-1-042]鍙嶄綔搴熷け璐ワ紝鍘熷洜锛�" + DBUtility.ClsPub.isStrNull(DS.Tables[0].Rows[0]["HRemark"]);
objJsonResult.data = null;
return objJsonResult;
}
@@ -1873,7 +1972,7 @@
objJsonResult.code = "1";
objJsonResult.count = 1;
- objJsonResult.Message = "鍙嶄綔搴熸垚鍔�";
+ objJsonResult.Message = "[0000-1-043]鍙嶄綔搴熸垚鍔�";
objJsonResult.data = null;
oCN.Commit();
return objJsonResult;
@@ -1882,7 +1981,7 @@
{
objJsonResult.code = "0";
objJsonResult.count = 0;
- objJsonResult.Message = "鍙嶄綔搴熷け璐�!鍘熷洜:" + DBUtility.ClsPub.sExeReturnInfo;
+ objJsonResult.Message = "[0000-1-042]鍙嶄綔搴熷け璐�!鍘熷洜:" + DBUtility.ClsPub.sExeReturnInfo;
objJsonResult.data = null;
oCN.RollBack();
return objJsonResult;
@@ -1895,7 +1994,7 @@
oCN.RollBack();
objJsonResult.code = "0";
objJsonResult.count = 0;
- objJsonResult.Message = "浣滃簾澶辫触鎴栬�呭弽浣滃簾澶辫触锛�" + e.ToString();
+ objJsonResult.Message = "[0000-1-044]浣滃簾澶辫触鎴栬�呭弽浣滃簾澶辫触锛�" + e.ToString();
objJsonResult.data = null;
return objJsonResult;
}
@@ -2039,6 +2138,8 @@
int HNowWHID = mainList[0].HNowWHID;
int HNowSPID = mainList[0].HNowSPID;
string HMouldUseStatus = mainList[0].HMouldUseStatus;
+ int HCREATEORGID = mainList[0].HCREATEORGID;
+ int HUSEORGID = mainList[0].HUSEORGID;
//淇濆瓨鍓嶆帶鍒�=========================================
string HBillNote = "";
@@ -2074,7 +2175,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,HMouldUseStatus) " +
+ ",HMouldClass,HNowWHID,HNowSPID,HInitLife,HMouldUseStatus,HCREATEORGID,HUSEORGID) " +
" values('" + BillType + "','" + BillType + "'," + HInterID + ",'" + HBillNo + "','" + HDate + "'" +
"," + HYear + "," + HPeriod + ",'" + HRemark + "','" + HMaker + "',getdate()" +
",'" + HMouldNo + "','" + HName + "','" + HModel + "','" + HModel2 + "','" + HDiameter + "'" +
@@ -2084,7 +2185,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 + "','" + HMouldUseStatus + "') ");
+ ",'"+ HMouldClass + "'," + HNowWHID + "," + HNowSPID + ",'" + HInitLife + "','" + HMouldUseStatus + "',"+ HCREATEORGID + ","+ HUSEORGID + ") ");
//瀛愯〃
oCN.RunProc("Insert into Gy_MouldFileSub " +
@@ -2235,8 +2336,32 @@
int HNowWHID = mainList[0].HNowWHID;
int HNowSPID = mainList[0].HNowSPID;
string HMouldUseStatus = mainList[0].HMouldUseStatus;
+ int HUSEORGID = mainList[0].HUSEORGID;
//鑻AINDI閲嶅鍒欓噸鏂拌幏鍙�
oCN.BeginTran();
+
+ //淇濆瓨鍓嶆帶鍒�=========================================
+ string HBillNote = "";
+ ds = oCN.RunProcReturn("Exec h_p_Gy_MouldFileMain_BeforeSaveCtrl " + HInterID.ToString() + ", '" + HBillNo + "','" + HBillNote + "',1 ", "h_p_Gy_MouldFileMain_BeforeSaveCtrl");
+ if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "淇濆瓨澶辫触!鍘熷洜:淇濆瓨鍓嶅垽鏂け璐ワ紝璇蜂笌缃戠粶绠$悊浜哄憳鑱旂郴";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "淇濆瓨澶辫触!鍘熷洜:" + ds.Tables[0].Rows[0]["HBackRemark"].ToString(); ;
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ //=========================================================
+
//涓昏〃
oCN.RunProc("UpDate Gy_MouldFileMain set " +
" HBillNo='" + HBillNo + "'" + //鍥哄畾璧嬪��===============
@@ -2257,6 +2382,7 @@
",HPICNo='" + HPICNo + "'" +
",HWorkMaterModel='" + HWorkMaterModel + "'" +
",HMaterID=" + HMaterID.ToString() +
+ ",HUSEORGID=" + HUSEORGID.ToString() +
",HMaterNumber='" + HMaterNumber + "'" +
",HMouldClass='" + HMouldClass + "'" +
",HMouldType=" + HMouleTypeID.ToString() +
@@ -2303,6 +2429,29 @@
oCN.RunProc("delete from Gy_MouldFileSub_MaintainRule where HInterID='" + HInterID + "'");
oCN.RunProc("delete from Gy_MouldFileSub_DotCheckRule where HInterID='" + HInterID + "'");
objJsonResult = AddBillSub(msg5, msg6, msg7, HInterID, HBillNo);
+
+
+ //淇濆瓨鍚庢帶鍒�=========================================
+ ds = oCN.RunProcReturn("Exec h_p_Gy_MouldFileMain_AfterSaveCtrl " + HInterID.ToString() + ", '" + HBillNo + "','" + HBillNote + "',1 ", "h_p_Gy_MouldFileMain_AfterSaveCtrl");
+ if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "淇濆瓨澶辫触!鍘熷洜:淇濆瓨鍓嶅垽鏂け璐ワ紝璇蜂笌缃戠粶绠$悊浜哄憳鑱旂郴";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "淇濆瓨澶辫触!鍘熷洜:" + ds.Tables[0].Rows[0]["HBackRemark"].ToString(); ;
+ objJsonResult.data = null;
+ oCN.RollBack();
+ return objJsonResult;
+ }
+ //=========================================================
oCN.Commit();
objJsonResult.code = "1";
@@ -2489,8 +2638,56 @@
}
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);
//鏇存柊涓婄骇涓� 鏈骇
@@ -2864,6 +3061,26 @@
}
if (IsAudit == 0) //瀹℃牳鎻愪氦
{
+ //瀹℃牳鍓嶆帶鍒�=========================================
+ ds = oCN.RunProcReturn("Exec h_p_Sc_MouldStockBill_BeforeCheckCtrl " + HInterID + ",'" + CurUserName + "'", "h_p_Sc_MouldStockBill_BeforeCheckCtrl");
+ if (ds == null)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "瀹℃牳鍓嶅垽鏂け璐ワ紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) != "0")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "瀹℃牳澶辫触锛�" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ //=========================================================
+
//瀹℃牳鎻愪氦
if (oBill.CheckBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo) == true)
{
@@ -2881,9 +3098,50 @@
objJsonResult.data = null;
return objJsonResult;
}
+
+ //瀹℃牳鍚庢帶鍒�=========================================
+ DataSet ds2 = oCN.RunProcReturn("Exec h_p_Sc_MouldStockBill_AfterCheckCtrl " + HInterID + ",'" + CurUserName + "'", "h_p_Sc_MouldStockBill_AfterCheckCtrl");
+
+ if (ds2 == null)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "瀹℃牳鍚庡垽鏂け璐ワ紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ if (DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBack"]) != "0")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "瀹℃牳澶辫触锛�" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ //=========================================================
}
if (IsAudit == 1) //鍙嶅鏍告彁浜�
{
+ //鍙嶅鏍稿墠鎺у埗=========================================
+ ds = oCN.RunProcReturn("Exec h_p_Sc_MouldStockBill_BeforeUnCheckCtrl " + HInterID + ",'" + CurUserName + "'", "h_p_Sc_MouldStockBill_BeforeUnCheckCtrl");
+ if (ds == null)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "瀹℃牳鍓嶅垽鏂け璐ワ紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) != "0")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "瀹℃牳澶辫触锛�" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ //=========================================================
+
//鍙嶅鏍告彁浜bandonCheck
if (oBill.AbandonCheck(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo) == true)
{
@@ -2901,6 +3159,29 @@
objJsonResult.data = null;
return objJsonResult;
}
+
+ //鍙嶅鏍稿悗鎺у埗=========================================
+ DataSet ds2 = oCN.RunProcReturn("Exec h_p_Sc_MouldStockBill_AfterUnCheckCtrl " + HInterID + ",'" + CurUserName + "'", "h_p_Sc_MouldStockBill_AfterUnCheckCtrl");
+ 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;
+ }
+ //=========================================================
+
}
return objJsonResult;
}
@@ -2915,6 +3196,154 @@
}
#endregion
+ #region 妯″叿妗堝叧闂�/鍙嶅叧闂姛鑳�
+ [Route("Gy_Mould/CloseGy_Mould")]
+ [HttpGet]
+ public object CloseGy_Mould(string HInterID, int Type, string user)
+ {
+ try
+ {
+ //鍒ゆ柇鏄惁鏈夊垹闄ゆ潈闄�
+ if (!DBUtility.ClsPub.Security_Log("Gy_MouldFile_Close", 1, false, user))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鏃犳潈闄愬叧闂�!";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ if (string.IsNullOrWhiteSpace(HInterID))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "HInterID涓虹┖锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ ClsPub.CurUserName = user;
+ DAL.ClsGy_MouldFile oBill = new DAL.ClsGy_MouldFile();
+ oCN.BeginTran();//寮�濮嬩簨鍔�
+
+ //Type 1 鍏抽棴 2 鍙嶅叧闂�
+ if (Type == 1)
+ {
+ if (!oBill.CloseBill(int.Parse(HInterID), ref ClsPub.sExeReturnInfo))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鍏抽棴澶辫触!鍘熷洜:" + ClsPub.sExeReturnInfo;
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ else
+ {
+ if (!oBill.CancelClose(int.Parse(HInterID), ref ClsPub.sExeReturnInfo))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鍙嶅叧闂け璐�!鍘熷洜:" + ClsPub.sExeReturnInfo;
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+
+ oCN.Commit();//鎻愪氦浜嬪姟
+
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鎵ц鎴愬姛锛�";
+ objJsonResult.data = null;
+ return objJsonResult; ;
+
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鎵ц澶辫触锛�" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ #endregion
+
+ #region 妯″叿妗f浣滃簾/鍙嶄綔搴熷姛鑳�
+ [Route("Gy_Mould/DeleteGy_Mould")]
+ [HttpGet]
+ public object DeleteGy_Mould(string HInterID, int Type, string user)
+ {
+ try
+ {
+ //鍒ゆ柇鏄惁鏈夊垹闄ゆ潈闄�
+ if (!DBUtility.ClsPub.Security_Log("Gy_MouldFile_Drop", 1, false, user))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鏃犳潈闄愬叧闂�!";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ if (string.IsNullOrWhiteSpace(HInterID))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "HInterID涓虹┖锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ DAL.ClsGy_MouldFile oBill = new DAL.ClsGy_MouldFile();
+ ClsPub.CurUserName = user;
+
+ oCN.BeginTran();//寮�濮嬩簨鍔�
+
+ //Type 1 浣滃簾 2 鍙嶄綔搴�
+ if (Type == 1)
+ {
+ if (!oBill.Cancelltion(int.Parse(HInterID), ref ClsPub.sExeReturnInfo))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鍏抽棴澶辫触!鍘熷洜:" + ClsPub.sExeReturnInfo;
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ else
+ {
+ if (!oBill.AbandonCancelltion(int.Parse(HInterID), ref ClsPub.sExeReturnInfo))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鍙嶅叧闂け璐�!鍘熷洜:" + ClsPub.sExeReturnInfo;
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+
+ oCN.Commit();//鎻愪氦浜嬪姟
+
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鎵ц鎴愬姛锛�";
+ objJsonResult.data = null;
+ return objJsonResult; ;
+
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鎵ц澶辫触锛�" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ #endregion
+
#region [妯″叿妗f鎵归噺鐢熸垚]
[Route("Gy_Mould/SaveBatchGen_MouldFile")]
[HttpGet]
--
Gitblit v1.9.1