From c4419b105b4bacea26f7581ed30d12bf3530a37d Mon Sep 17 00:00:00 2001
From: zrg <z1873@LAPTOP-EAVL132E>
Date: 星期三, 22 十月 2025 12:33:58 +0800
Subject: [PATCH] 测试职员同步员工同步,开工单增加字段HPeopleSum 开工人数
---
WebAPI/DLL/ClsGy_PreventErrMould_Ctl.cs | 74 ++++++++++++++++++++++++++++++++++--
1 files changed, 69 insertions(+), 5 deletions(-)
diff --git a/WebAPI/DLL/ClsGy_PreventErrMould_Ctl.cs b/WebAPI/DLL/ClsGy_PreventErrMould_Ctl.cs
index 3ec2b2a..ef4bd69 100644
--- a/WebAPI/DLL/ClsGy_PreventErrMould_Ctl.cs
+++ b/WebAPI/DLL/ClsGy_PreventErrMould_Ctl.cs
@@ -13,19 +13,51 @@
public string HOldNumber;
public Model.ClsGy_PreventErrMould_Model oModel = new Model.ClsGy_PreventErrMould_Model();
//鏂板
- public override bool AddNew()
+ public bool AddNew(ref string sReturn)
{
//
- try
+ try
{
oCn.BeginTran();
+
+ //淇濆瓨鍓嶆帶鍒�=========================================
+ DataSet ds = oCn.RunProcReturn("Exec h_p_Gy_PreventErrMould_BeforeSaveCtrl " + oModel.HMakeEmp + ",1 ", "h_p_Gy_PreventErrMould_BeforeSaveCtrl");
+ if (ds == null)
+ {
+ sReturn = "淇濆瓨鍓嶅垽鏂け璐ワ紒";
+ return false;
+ }
+ if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) != "0")
+ {
+ sReturn = "淇濆瓨澶辫触锛�" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HRemark"]);
+ return false;
+ }
+ //=========================================================
+
oCn.RunProc("Insert into " + MvarItemKey + " " +
" (HNumber,HName,HHelpCode,HShortNumber,HParentID" +
",HLevel,HEndFlag,HStopflag,HRemark,HMakeTime,HUSEORGID,HUseFlag,HMakeEmp,HCREATEORGID) " +
" Values('" + oModel.HNumber + "','" + oModel.HName + "','" + oModel.HHelpCode + "','" + oModel.HShortNumber + "'," + oModel.HParentID.ToString() +
- "," + oModel.HLevel.ToString() + "," + Convert.ToString(oModel.HEndFlag ? 1 : 0) + "," + Convert.ToString(oModel.HStopflag ? 1 : 0) + ",'" + oModel.HRemark + "','" +DateTime.Now+ "','" + oModel.HUSEORGID + "','" + oModel.HUseFlag + "','" + oModel.HMakeEmp+ "','" + oModel.HUSEORGID + "')", ref DBUtility.ClsPub.sExeReturnInfo);
+ "," + oModel.HLevel.ToString() + "," + Convert.ToString(oModel.HEndFlag ? 1 : 0) + "," + Convert.ToString(oModel.HStopflag ? 1 : 0) + ",'" + oModel.HRemark + "','" +DateTime.Now+ "','" + oModel.HUSEORGID + "','" + oModel.HUseFlag + "','" + oModel.HMakeEmp+ "','" + oModel.HCREATEORGID + "')", ref DBUtility.ClsPub.sExeReturnInfo);
//淇敼涓婄骇涓洪潪鏈骇浠g爜
oCn.RunProc("Update " + MvarItemKey + " set HEndflag=0 where HItemID=" + oModel.HParentID, ref DBUtility.ClsPub.sExeReturnInfo);
+
+ //=========================淇濆瓨鍚庢帶鍒�
+ DataSet ds2 = oCn.RunProcReturn("Exec h_p_Gy_PreventErrMould_AfterSaveCtrl " + oModel.HMakeEmp + ",1", "h_p_Gy_PreventErrMould_AfterSaveCtrl");
+ if (ds2 == null)
+ {
+ sReturn = "淇濆瓨鍚庢帶鍒跺垽鏂け璐ワ紒";
+ oCn.RollBack();
+ return false;
+ }
+ if (DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBack"]) != "0")
+ {
+ sReturn = "淇濆瓨澶辫触2锛�" + DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HRemark"]);
+ oCn.RollBack();
+ return false;
+ }
+ //============================
+
oCn.Commit();
return true;
}
@@ -37,12 +69,27 @@
}
//淇敼
- public override bool ModifyByID(Int64 sItemID)
+ public bool ModifyByID(Int64 sItemID, ref string sReturn)
{
try
{
oCn.BeginTran();
+
+ //淇濆瓨鍓嶆帶鍒�=========================================
+ DataSet ds = oCn.RunProcReturn("Exec h_p_Gy_PreventErrMould_BeforeSaveCtrl " + oModel.HMakeEmp + ",2 ", "h_p_Gy_PreventErrMould_BeforeSaveCtrl");
+ if (ds == null)
+ {
+ sReturn = "淇濆瓨鍓嶅垽鏂け璐ワ紒";
+ return false;
+ }
+ if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) != "0")
+ {
+ sReturn = "淇濆瓨澶辫触锛�" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HRemark"]);
+ return false;
+ }
+ //=========================================================
+
oCn.RunProc("Update " + MvarItemKey + " set " +
" HNumber='" + oModel.HNumber + "'" +
",HName='" + oModel.HName + "'" +
@@ -50,6 +97,7 @@
",HHelpCode='" + oModel.HHelpCode + "'" +
",HModifyTime='" + DateTime.Now + "'" +
",HUSEORGID='" + oModel.HUSEORGID + "'" +
+ ",HCREATEORGID='" + oModel.HCREATEORGID + "'" +
",HModifyEmp ='" + oModel.HMakeEmp + "'" +
",HUseFlag='" + oModel.HUseFlag + "'" +
",HStopflag=" + Convert.ToString(oModel.HStopflag ? 1 : 0) +
@@ -58,7 +106,23 @@
oCn.RunProc("exec h_p_Gy_UpdateNumber '" + MvarItemKey + "','" + oModel.HNumber + ".','" + this.HOldNumber + ".'", ref DBUtility.ClsPub.sExeReturnInfo);
//灏嗕笂绾� 涓洪潪鏈骇
oCn.RunProc("Update " + MvarItemKey + " set HEndflag=0 where HItemID=" + oModel.HParentID, ref DBUtility.ClsPub.sExeReturnInfo);
- //
+
+ //=========================淇濆瓨鍚庢帶鍒�
+ DataSet ds2 = oCn.RunProcReturn("Exec h_p_Gy_PreventErrMould_AfterSaveCtrl " + oModel.HMakeEmp + ",2", "h_p_Gy_PreventErrMould_AfterSaveCtrl");
+ if (ds2 == null)
+ {
+ sReturn = "淇濆瓨鍚庢帶鍒跺垽鏂け璐ワ紒";
+ oCn.RollBack();
+ return false;
+ }
+ if (DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBack"]) != "0")
+ {
+ sReturn = "淇濆瓨澶辫触2锛�" + DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HRemark"]);
+ oCn.RollBack();
+ return false;
+ }
+ //============================
+
oCn.Commit();
return true;
}
--
Gitblit v1.9.1