From 9d8435352f7a1ac512554f9d22ce2a63d1b98f95 Mon Sep 17 00:00:00 2001
From: chenhaozhe <cgz@hz-kingdee.com>
Date: 星期四, 25 九月 2025 09:33:19 +0800
Subject: [PATCH] 来料检验单 产品入库检验单 添加 关闭/反关闭 作废/反作废
---
WebAPI/Controllers/BaseSet/Gy_MaterialController.cs | 228 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 228 insertions(+), 0 deletions(-)
diff --git a/WebAPI/Controllers/BaseSet/Gy_MaterialController.cs b/WebAPI/Controllers/BaseSet/Gy_MaterialController.cs
index 4fc4425..02baea2 100644
--- a/WebAPI/Controllers/BaseSet/Gy_MaterialController.cs
+++ b/WebAPI/Controllers/BaseSet/Gy_MaterialController.cs
@@ -317,6 +317,33 @@
}
#endregion
+ #region 鑾峰彇杞﹂棿鍙�
+ [Route("Gy_Material/Get_HDepartment")]
+ [HttpGet]
+ public object Get_HDepartment()
+ {
+ try
+ {
+ DataSet oDs = new DataSet();
+ //==========
+ oDs = oCN.RunProcReturn("select top(20) HItemID , HName from Gy_Department", "Gy_Department");
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鑾峰彇鎴愬姛锛�";
+ objJsonResult.data = oDs.Tables[0];
+ return objJsonResult; ;
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍒犻櫎澶辫触锛�" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ #endregion
+
/// <summary>
/// 鑾峰彇椤圭洰鍒楄〃
/// </summary>
@@ -2218,6 +2245,24 @@
//杩涜闇�瑕佽繘琛岀殑浣滃簾/鍙嶄綔搴熸搷浣�
if (IsAudit == 0) //浣滃簾鎻愪氦
{
+ string sql_deleteBeforeCtrl = "exec h_p_Gy_BarCodeBill_Cancelltion_Before " + HInterID;
+ DataSet ds_deleteBeforeCtrl = oCN.RunProcReturn(sql_deleteBeforeCtrl, "h_p_Gy_BarCodeBill_Cancelltion_Before");
+ if (ds_deleteBeforeCtrl == null || ds_deleteBeforeCtrl.Tables.Count == 0)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "浣滃簾澶辫触锛氭潯鐮佷綔搴熷墠鎺у埗澶辫触锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }else if(ds_deleteBeforeCtrl.Tables[0].Rows[0]["HBack"].ToString() != "0")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "浣滃簾澶辫触锛�" + ds_deleteBeforeCtrl.Tables[0].Rows[0]["HRemark"].ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
oCN.BeginTran();
//浣滃簾鏉$爜
@@ -2296,6 +2341,187 @@
if (ds != null && ds.Tables[0].Rows.Count > 0)
{
string HBarCode = ds.Tables[0].Rows[0]["HBarCode"].ToString();
+ oCN.RunProc("Insert into System_log (GeginDate, userid, WorkstationName, WorkList, SystemName, NetuserName, State) select GETDATE(),'" + CurUserName + "','" + DBUtility.ClsPub.ComputerName + "','鍙嶄綔搴熸潯鐮侊細" + HBarCode + "','WMS绯荤粺-鏉$爜妗f鍒楄〃妯″潡','" + DBUtility.ClsPub.IPAddress + "','鍙嶄綔搴�'", ref DBUtility.ClsPub.sExeReturnInfo);
+
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "[0000-1-043]鍙嶄綔搴熸垚鍔�";
+ objJsonResult.data = null;
+ oCN.Commit();
+ return objJsonResult;
+ }
+ else
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "[0000-1-042]鍙嶄綔搴熷け璐�!鍘熷洜:" + DBUtility.ClsPub.sExeReturnInfo;
+ objJsonResult.data = null;
+ oCN.RollBack();
+ return objJsonResult;
+ }
+ }
+ return objJsonResult;
+ }
+ catch (Exception e)
+ {
+ oCN.RollBack();
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "[0000-1-044]浣滃簾澶辫触鎴栬�呭弽浣滃簾澶辫触锛�" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ #endregion
+
+ #region 鏉$爜涓绘。缁存姢 鎵归噺浣滃簾/鎵归噺鍙嶄綔搴�
+ /// <summary>
+ /// </summary>
+ /// <param name="HInterID">鍗曟嵁ID</param>
+ /// <param name="IsAudit">浣滃簾(0),鍙嶄綔搴�(1)</param>
+ /// <param name="CurUserName">浣滃簾浜�</param>
+ /// <returns></returns>
+ [Route("Gy_BarCodeBillList/DeleteBatchGy_BarCodeBillList")]
+ [HttpGet]
+ public object DeleteBatchGy_BarCodeBillList(string HInterID, int IsAudit, string CurUserName)
+ {
+ string ModRightNameCheck = "Gy_BarCodeBillList_Delete";
+ DBUtility.ClsPub.CurUserName = CurUserName;
+ try
+ {
+ //妫�鏌ユ潈闄�
+ if (!DBUtility.ClsPub.Security_Log_second(ModRightNameCheck, 1, false, CurUserName))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "[0000-1-063]浣滃簾/鍙嶄綔搴熷け璐ワ紒鏃犳潈闄愶紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ //HInterID鏁版嵁鍒ゆ柇
+ if (HInterID.Length<=0)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鏈�夋嫨闇�瑕佷綔搴�/鍙嶄綔搴� 鐨勬潯鐮�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+
+ Int64 lngBillKey = 0;
+ lngBillKey = DBUtility.ClsPub.isLong(HInterID); //瀵笻InterID杩涜绫诲瀷鐨勮浆鎹�
+
+ //杩涜闇�瑕佽繘琛岀殑浣滃簾/鍙嶄綔搴熸搷浣�
+ if (IsAudit == 0) //浣滃簾鎻愪氦
+ {
+ string sql_deleteBeforeCtrl = "exec h_p_Gy_BarCodeBill_Cancelltion_Before '" + HInterID + "'";
+ DataSet ds_deleteBeforeCtrl = oCN.RunProcReturn(sql_deleteBeforeCtrl, "h_p_Gy_BarCodeBill_Cancelltion_Before");
+ if (ds_deleteBeforeCtrl == null || ds_deleteBeforeCtrl.Tables.Count == 0)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "浣滃簾澶辫触锛氭潯鐮佷綔搴熷墠鎺у埗澶辫触锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ else if (ds_deleteBeforeCtrl.Tables[0].Rows[0]["HBack"].ToString() != "0")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "浣滃簾澶辫触锛�" + ds_deleteBeforeCtrl.Tables[0].Rows[0]["HRemark"].ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ oCN.BeginTran();
+
+ //浣滃簾鏉$爜
+ oCN.RunProc("update Gy_BarCodeBill set HStopflag=1,HDeleteMan='" + CurUserName + "',HDeleteDate=getdate() where HItemID in (" + HInterID + ")", ref DBUtility.ClsPub.sExeReturnInfo);
+
+ string sql = "select * from Gy_BarCodeBill where HItemID in (" + HInterID + ")";
+ ds = oCN.RunProcReturn(sql, "Gy_BarCodeBill");
+ if (ds != null && ds.Tables[0].Rows.Count > 0)
+ {
+ string HBarCode = "";
+ for(int i = 0; i < ds.Tables[0].Rows.Count; i++)
+ {
+ HBarCode = ds.Tables[0].Rows[0]["HBarCode"].ToString() + "锛�";
+ }
+
+
+ //娣诲姞鎿嶄綔鏃ュ織
+ oCN.RunProc("Insert into System_log (GeginDate, userid, WorkstationName, WorkList, SystemName, NetuserName, State) select GETDATE(),'" + CurUserName + "','" + DBUtility.ClsPub.ComputerName + "','浣滃簾鏉$爜锛�" + HBarCode + "','WMS绯荤粺-鏉$爜妗f鍒楄〃妯″潡','" + DBUtility.ClsPub.IPAddress + "','浣滃簾'", ref DBUtility.ClsPub.sExeReturnInfo);
+
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "[0000-1-040]浣滃簾鎴愬姛";
+ objJsonResult.data = null;
+
+ oCN.Commit();
+ }
+ else
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "[0000-1-042]浣滃簾澶辫触!鍘熷洜:" + DBUtility.ClsPub.sExeReturnInfo;
+ objJsonResult.data = null;
+
+ oCN.RollBack();
+ }
+
+
+ return objJsonResult;
+ }
+ if (IsAudit == 1) //鍙嶅叧闂彁浜�
+ {
+ oCN.BeginTran();
+
+ //#region 鍙嶄綔搴熸潯鐮佸墠杩涜鍒ゆ柇
+ ////鍙嶄綔搴熸潯鐮佸墠杩涜鍒ゆ柇------------------------------------------------------------------------------------------------------------------------------------------------------
+ ////--------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+ //DataSet DS = oCN.RunProcReturn("exec h_p_Gy_BarCodeBill_UnCancelltion '" + HInterID + "','N'", "h_p_Gy_BarCodeBill_UnCancelltion", ref DBUtility.ClsPub.sExeReturnInfo);
+ //if (DS == null || DS.Tables[0].Rows.Count <= 0)
+ //{
+ // oCN.RollBack();
+
+ // objJsonResult.code = "0";
+ // objJsonResult.count = 0;
+ // objJsonResult.Message = "[0000-1-042]鍙嶄綔搴熷け璐ワ紝鍘熷洜锛氬弽浣滃簾鏉$爜鍓嶅垽鏂彂鐢熼敊璇紒";
+ // objJsonResult.data = null;
+ // return objJsonResult;
+ //}
+ //else
+ //{
+ // if (DBUtility.ClsPub.isStrNull(DS.Tables[0].Rows[0][0]) == "1")
+ // {
+ // oCN.RollBack();
+
+ // objJsonResult.code = "1";
+ // objJsonResult.count = 1;
+ // objJsonResult.Message = "[0000-1-042]鍙嶄綔搴熷け璐ワ紝鍘熷洜锛�" + DBUtility.ClsPub.isStrNull(DS.Tables[0].Rows[0]["HRemark"]);
+ // objJsonResult.data = null;
+ // return objJsonResult;
+ // }
+ //}
+ ////--------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+ ////--------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+ //#endregion
+
+ //鍙嶄綔搴熸潯鐮�
+ oCN.RunProc("update Gy_BarCodeBill set HStopflag=0,HDeleteMan='',HDeleteDate=null where HItemID in (" + HInterID + ")", ref DBUtility.ClsPub.sExeReturnInfo);
+
+ //澧炲姞鎿嶄綔鏃ュ織
+ string sql = "select * from Gy_BarCodeBill where HItemID in (" + HInterID + ")";
+ ds = oCN.RunProcReturn(sql, "Gy_BarCodeBill");
+ if (ds != null && ds.Tables[0].Rows.Count > 0)
+ {
+ string HBarCode = "";
+ for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
+ {
+ HBarCode = ds.Tables[0].Rows[0]["HBarCode"].ToString() + "锛�";
+ }
+
oCN.RunProc("Insert into System_log (GeginDate, userid, WorkstationName, WorkList, SystemName, NetuserName, State) select GETDATE(),'" + CurUserName + "','" + DBUtility.ClsPub.ComputerName + "','鍙嶄綔搴熸潯鐮侊細" + HBarCode + "','WMS绯荤粺-鏉$爜妗f鍒楄〃妯″潡','" + DBUtility.ClsPub.IPAddress + "','鍙嶄綔搴�'", ref DBUtility.ClsPub.sExeReturnInfo);
objJsonResult.code = "1";
@@ -2665,6 +2891,7 @@
int HNowSPID = mainList[0].HNowSPID;
string HMouldUseStatus = mainList[0].HMouldUseStatus;
int HUSEORGID = mainList[0].HUSEORGID;
+ DateTime HNextMainDate = mainList[0].HNextMainDate;
//鑻AINDI閲嶅鍒欓噸鏂拌幏鍙�
oCN.BeginTran();
@@ -2745,6 +2972,7 @@
",HNowWHID=" + HNowWHID +
",HNowSPID=" + HNowSPID +
",HInitLife='" + HInitLife +
+ ",HNextMainDate='" + HNextMainDate +
"',HMouldUseStatus='" + HMouldUseStatus +
"' where HInterID=" + HInterID.ToString());
--
Gitblit v1.9.1