From b40af0bf7784ea07536d325fa2de57a1568f2c71 Mon Sep 17 00:00:00 2001
From: chenhaozhe <cgz@hz-kingdee.com>
Date: 星期三, 04 三月 2026 15:12:47 +0800
Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API
---
WebAPI/Controllers/CJGL/Sc_ProcExchSendWorkBillController.cs | 201 ++++++++++++++++++++++++++++++++++++++++++++++---
1 files changed, 186 insertions(+), 15 deletions(-)
diff --git a/WebAPI/Controllers/CJGL/Sc_ProcExchSendWorkBillController.cs b/WebAPI/Controllers/CJGL/Sc_ProcExchSendWorkBillController.cs
index a5fb5d4..839a384 100644
--- a/WebAPI/Controllers/CJGL/Sc_ProcExchSendWorkBillController.cs
+++ b/WebAPI/Controllers/CJGL/Sc_ProcExchSendWorkBillController.cs
@@ -19,13 +19,23 @@
public DAL.ClsSc_ICMOBill BillOld = new DAL.ClsSc_ICMOBill();
DataSet ds;
- #region 宸ュ簭娲惧伐鍗曞垪琛�
+ #region 宸ュ簭娴佽浆鍗℃淳宸ュ崟鍒楄〃
[Route("Sc_ProcExchSendWorkBill/Sc_ProcExchSendWorkBillList")]
[HttpGet]
public object Sc_ProcExchSendWorkBillList(string sWhere, string user)
{
try
{
+ //鍒ゆ柇鏄惁鏈夋潈闄�
+ if (!DBUtility.ClsPub.Security_Log("Sc_ProcExchSendWorkBill_Query", 1, false, user))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鏃犳潈闄愭煡鐪�!";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
List<object> columnNameList = new List<object>();
string sql1 = "select * from h_v_Sc_ProcExchSendWorkBillList where 1 = 1 ";
@@ -59,7 +69,47 @@
}
#endregion
- #region 宸ュ簭娲惧伐鍗曞垪琛�(鑱屽憳鏌ョ湅鑷繁浠诲姟)
+ #region 宸ュ簭娴佽浆鍗℃淳宸ュ崟缂栬緫鍥炴樉
+ [Route("Sc_ProcExchSendWorkBill/Sc_ProcExchSendWorkBillEdit")]
+ [HttpGet]
+ public object Sc_ProcExchSendWorkBillEdit(string sWhere, string user)
+ {
+ try
+ {
+ List<object> columnNameList = new List<object>();
+
+ string sql1 = "select * from h_v_Sc_ProcExchSendWorkBillEdit where 1 = 1 ";
+ string sql = sql1 + sWhere + " order by hmainid desc";
+ ds = oCN.RunProcReturn(sql, "h_v_Sc_ProcExchSendWorkBillEdit");
+
+ //娣诲姞鍒楀悕
+ 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鍒楀璞$殑鍒楀悕
+ }
+
+
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "Sucess锛�";
+ objJsonResult.list = columnNameList;
+ objJsonResult.data = ds.Tables[0];
+ return objJsonResult;
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "Exception锛�" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ #endregion
+
+ #region 宸ュ簭娴佽浆鍗℃淳宸ュ崟鍒楄〃(鑱屽憳鏌ョ湅鑷繁浠诲姟)
[Route("Sc_ProcExchSendWorkBill/Sc_ProcExchSendWorkBillListByEmp")]
[HttpGet]
public object Sc_ProcExchSendWorkBillListByEmp(string sWhere, string user,int HEmpID)
@@ -97,6 +147,110 @@
}
}
#endregion
+
+ #region 宸ュ簭娴佽浆鍗℃淳宸� 鍒犻櫎锛堝瓙琛級鐢ㄤ簬鍙栨秷娲惧崟
+ [Route("Sc_ProcExchSendWorkBill/DelProcessSendWork_Sec")]
+ [HttpGet]
+ public object DelProcessSendWork_Sec(string HInterID, string HEntryID, string User)
+ {
+ try
+ {
+
+ ds = oCN.RunProcReturn("select a.* from Sc_ProcExchSendWorkBillMain a left join Sc_ProcExchSendWorkBillSub b on b.HInterID= a.HInterID where 1=1 and a.HInterID=" + HInterID, "Sc_ProcExchSendWorkBillMain");
+
+ if (ds.Tables[0].Rows.Count > 0)
+ {
+ if (ds.Tables[0].Rows[0]["HBillStatus"].ToString() != "1"&& ds.Tables[0].Rows[0]["HBillStatus"].ToString() != "0")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "褰撳墠鍗曟嵁涓嶈兘鍒犻櫎锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ //鍒犻櫎鍓嶆帶鍒�=========================================
+ string HBillNo = ds.Tables[0].Rows[0]["HBillNo"].ToString();
+ string sql1 = "exec h_p_Sc_ProcExchSendWorkBill_BeforeDelCtrl " + HInterID + ",'" + HBillNo + "','" + User + "'";
+ DataSet ds1 = oCN.RunProcReturn(sql1, "h_p_Sc_ProcExchSendWorkBill_BeforeDelCtrl");
+ if (ds1 == null || ds1.Tables.Count == 0 || ds1.Tables[0].Rows.Count == 0)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍒犻櫎澶辫触!鍘熷洜:鍒犻櫎鍓嶅垽鏂け璐ワ紝璇蜂笌缃戠粶绠$悊浜哄憳鑱旂郴";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ if (ds1.Tables[0].Rows[0]["HBack"].ToString() != "0")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍒犻櫎澶辫触!鍘熷洜:" + ds1.Tables[0].Rows[0]["HRemark"].ToString(); ;
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ //==================================================================================
+ oCN.BeginTran();//寮�鍚簨鍔�
+
+ if (ds.Tables[0].Rows.Count == 1)
+ {
+ oCN.RunProc($"delete from Sc_ProcExchSendWorkBillMain where HInterID={HInterID}");
+ }
+ oCN.RunProc($"delete from Sc_ProcExchSendWorkBillSub where HInterID={HInterID} and HEntryID={HEntryID}");
+
+ //鍒犻櫎鍚庢帶鍒�=========================================
+ string sql2 = "exec h_p_Sc_ProcExchSendWorkBill_AfterDelCtrl " + HInterID + ",'" + HBillNo + "','" + User + "'";
+ DataSet ds2 = oCN.RunProcReturn(sql2, "h_p_Sc_ProcExchSendWorkBill_AfterDelCtrl");
+ if (ds2 == null || ds2.Tables.Count == 0 || ds2.Tables[0].Rows.Count == 0)
+ {
+ oCN.RollBack();
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍒犻櫎澶辫触!鍘熷洜:鍒犻櫎鍓嶅垽鏂け璐ワ紝璇蜂笌缃戠粶绠$悊浜哄憳鑱旂郴";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ if (ds2.Tables[0].Rows[0]["HBack"].ToString() != "0")
+ {
+ oCN.RollBack();
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍒犻櫎澶辫触!鍘熷洜:" + ds2.Tables[0].Rows[0]["HRemark"].ToString(); ;
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ //==================================================================================
+
+
+ oCN.Commit();//缁撴潫浜嬪姟
+
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鍒犻櫎鎴愬姛锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ 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
+
#region 娲惧伐骞冲彴鏌ヨ宸ュ簭娴佽浆鍗℃暟鎹�
[Route("Sc_ProcExchSendWorkBill/Sc_ProcessExchangeHEmpList")]
@@ -166,9 +320,9 @@
}
#endregion
- #region 宸ュ簭娲惧伐鍗� 淇濆瓨/缂栬緫
+ #region 宸ュ簭娴佽浆鍗℃淳宸ュ崟 淇濆瓨/缂栬緫
/// <summary>
- /// 宸ュ簭娲惧伐鍗� 淇濆瓨
+ /// 宸ュ簭娴佽浆鍗℃淳宸ュ崟 淇濆瓨
/// </summary>
/// <param name="msg"></param>
/// <returns></returns>
@@ -182,7 +336,17 @@
string msg2 = sArray[0].ToString();
string msg3 = sArray[1].ToString();
string msg4 = sArray[2].ToString();
+ string msg5 = sArray[3].ToString();
+ //鍒ゆ柇鏄惁鏈夋潈闄�
+ if (!DBUtility.ClsPub.Security_Log("Sc_ProcExchSendWorkBill_Edit", 1, false, msg5))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鏃犳潈闄愪繚瀛�!";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
string UserName = "";
ListModels oListModels = new ListModels();
@@ -231,10 +395,6 @@
oItemSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now);
oItemSub.HCloseType = false; //鍏抽棴绫诲瀷
//oItemSub.HRemark = ""; //澶囨敞
- oItemSub.HSourceInterID = oItemSub.HSourceInterID; // 婧愬崟涓诲唴鐮�
- oItemSub.HSourceEntryID = oItemSub.HSourceEntryID; //婧愬崟瀛愬唴鐮�
- oItemSub.HSourceBillNo = oItemSub.HSourceBillNo; //婧愬崟鍗曞彿
- oItemSub.HSourceBillType = oItemSub.HSourceBillType; //婧愬崟绫诲瀷
oItemSub.HRelationQty = 0; //鍏宠仈鏁伴噺
oBill.DetailColl.Add(oItemSub);
@@ -280,13 +440,24 @@
}
#endregion
- //#region 宸ュ簭娲惧伐鍗� 鍒犻櫎
+ #region 宸ュ簭娴佽浆鍗℃淳宸ュ崟 鍒犻櫎
[Route("Sc_ProcExchSendWorkBill/DelProcessSendWork")]
[HttpGet]
public object DelProcessSendWork(string HInterID, string user)
{
Int64 lngBillKey = 0;
lngBillKey = DBUtility.ClsPub.isLong(HInterID);
+
+ //鍒ゆ柇鏄惁鏈夋潈闄�
+ if (!DBUtility.ClsPub.Security_Log("Sc_ProcExchSendWorkBill_Delete", 1, false, user))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鏃犳潈闄愬垹闄�!";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
if (lngBillKey == 0)
{
objJsonResult.code = "0";
@@ -368,17 +539,17 @@
return objJsonResult;
}
}
- //#endregion
+ #endregion
- #region 宸ュ簭娲惧伐鍗曞鏍�/鍙嶅鏍稿姛鑳�
+ #region 宸ュ簭娴佽浆鍗℃淳宸ュ崟瀹℃牳/鍙嶅鏍稿姛鑳�
[Route("Sc_ProcExchSendWorkBill/CheckSc_ProcExchSendWorkBill")]
[HttpGet]
public object CheckSc_ProcExchSendWorkBill(string HInterID, int Type, string user)
{
try
{
- //鍒ゆ柇鏄惁鏈夊垹闄ゆ潈闄�
- if (!DBUtility.ClsPub.Security_Log("Sc_ProcessSendWork_Check", 1, false, user))
+ //鍒ゆ柇鏄惁鏈夋潈闄�
+ if (!DBUtility.ClsPub.Security_Log("Sc_ProcExchSendWorkBill_Check", 1, false, user))
{
objJsonResult.code = "0";
objJsonResult.count = 0;
@@ -535,7 +706,7 @@
}
#endregion
- #region 宸ュ簭娲惧伐鍗曞叧闂�/鍙嶅叧闂姛鑳�
+ #region 宸ュ簭娴佽浆鍗℃淳宸ュ崟鍏抽棴/鍙嶅叧闂姛鑳�
[Route("Sc_ProcExchSendWorkBill/CloseSc_ProcExchSendWorkBill")]
[HttpGet]
public object CloseSc_ProcExchSendWorkBill(string HInterID, int Type, string user)
@@ -543,7 +714,7 @@
try
{
//鍒ゆ柇鏄惁鏈夊垹闄ゆ潈闄�
- if (!DBUtility.ClsPub.Security_Log("Sc_ProcessSendWork_Close", 1, false, user))
+ if (!DBUtility.ClsPub.Security_Log("Sc_ProcExchSendWorkBill_Close", 1, false, user))
{
objJsonResult.code = "0";
objJsonResult.count = 0;
--
Gitblit v1.9.1