From 59e981656f036352ef84e6a54a37e330afe90c01 Mon Sep 17 00:00:00 2001
From: duhe <226547893@qq.com>
Date: 星期二, 27 六月 2023 13:06:12 +0800
Subject: [PATCH] 基础资料(职员、客户、供应商、工作中心)添加审核、反审核、禁用、反禁用功能
---
WebAPI/Controllers/BaseSet/Gy_CustomerController.cs | 196 ++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 194 insertions(+), 2 deletions(-)
diff --git a/WebAPI/Controllers/BaseSet/Gy_CustomerController.cs b/WebAPI/Controllers/BaseSet/Gy_CustomerController.cs
index 4445410..e9d3302 100644
--- a/WebAPI/Controllers/BaseSet/Gy_CustomerController.cs
+++ b/WebAPI/Controllers/BaseSet/Gy_CustomerController.cs
@@ -300,7 +300,7 @@
",HEmpID,HCreditDate,HCreditRatingDate,HMaxCreditRatingDate" +
",HMonthUseQty,HForecastCreditRating,HCreditLevelID,HCountAccrualRating" +
",HSubsidyAccrualRating,HCreditRating,HMaxCreditRating" +
- ",HCusTypeID) " +
+ ",HCusTypeID,HCREATEORGID,HUSEORGID) " +
" Values('" + HNumber + "','" + HName + "','" + HHelpCode + "','" + HShortNumber + "'," + HParentID +
", " + HLevel + ",0,'" + HStopflag + "','" + HRemark + "'" +
",'" + HShortName + "','" + HAddress + "','" + HLinkMan + "','" + HLinkPhone + "','" + HMobilePhone + "'" +
@@ -310,7 +310,7 @@
"," + HEmpID + "," + HCreditDate + "," + HCreditRatingDate + "," + HMaxCredRatingDate +
"," + HMonthUseQty + "," + HForecastCreditRating + "," + HCreditLevelID + "," + HCountAccrualRating +
"," + HSubsidyAccrualRating + "," + HCreditRating + "," + HMaxCreditRating +
- ", " + HCusTypeID + ")");
+ ", " + HCusTypeID + ","+ HCreateOrgID + ","+ HUseOrgID + ")");
//淇敼涓婄骇涓洪潪鏈骇浠g爜
oCN.RunProc("Update Gy_Customer set HEndflag=0 where HItemID=" + HParentID, ref DBUtility.ClsPub.sExeReturnInfo);
oCN.Commit();
@@ -672,6 +672,198 @@
}
}
+
+ #region 瀹㈡埛瀹℃牳銆佸弽瀹℃牳
+ /// <summary>
+ ///
+ /// </summary>
+ /// <param name="HInterID">鍗曟嵁ID</param>
+ /// <param name="IsAudit">瀹℃牳(0),鍙嶅鏍�(1)</param>
+ /// <param name="CurUserName">瀹℃牳浜�</param>
+ /// <returns></returns>
+ [Route("Gy_Customer/AuditGy_Customer")]
+ [HttpGet]
+ public object AuditGy_Customer(int HInterID, int IsAudit, string CurUserName)
+ {
+ try
+ {
+ //瀹℃牳鏉冮檺
+ if (!DBUtility.ClsPub.Security_Log_second("Gy_Customer_Check", 1, false, CurUserName))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "瀹℃牳澶辫触锛佹棤鏉冮檺锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ var ds = oCN.RunProcReturn("select * from Gy_Customer where HItemID=" + HInterID, "Gy_Customer");
+ if (ds.Tables[0].Rows.Count > 0)
+ {
+ if (IsAudit == 0) //瀹℃牳鍒ゆ柇
+ {
+ if (ds.Tables[0].Rows[0]["HCheckEmp"].ToString() != "")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍗曟嵁宸插鏍�!涓嶈兘鍐嶆瀹℃牳锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ if (IsAudit == 1) //鍙嶅鏍稿垽鏂�
+ {
+ if (ds.Tables[0].Rows[0]["HCheckEmp"].ToString() == "")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍗曟嵁鏈鏍�!涓嶉渶瑕佸弽瀹℃牳!";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ }
+ else
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍗曟嵁涓嶅瓨鍦�!";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ oCN.BeginTran();
+
+ if (IsAudit == 0) //瀹℃牳鍒ゆ柇
+ {
+ oCN.RunProc("update Gy_Customer set HCheckEmp='" + CurUserName + "',HCheckTime=getdate() where HItemID=" + HInterID);
+
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "瀹℃牳鎴愬姛";
+ objJsonResult.data = null;
+ }
+ if (IsAudit == 1) //鍙嶅鏍稿垽鏂�
+ {
+ oCN.RunProc("update Gy_Customer set HCheckEmp='',HCheckTime=null where HItemID=" + HInterID);
+
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鍙嶅鏍告垚鍔�";
+ objJsonResult.data = null;
+ }
+ oCN.Commit();
+
+ return objJsonResult;
+ }
+ catch (Exception e)
+ {
+ oCN.RollBack();
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "瀹℃牳澶辫触鎴栬�呭弽瀹℃牳澶辫触锛�" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ #endregion
+
+ #region 瀹㈡埛绂佺敤銆佸弽绂佺敤
+ /// <summary>
+ ///
+ /// </summary>
+ /// <param name="HInterID">鍗曟嵁ID</param>
+ /// <param name="IsStop">绂佺敤(0),鍙嶇鐢�(1)</param>
+ /// <param name="CurUserName">瀹℃牳浜�</param>
+ /// <returns></returns>
+ [Route("Gy_Customer/StopGy_Customer")]
+ [HttpGet]
+ public object StopGy_Customer(int HInterID, int IsStop, string CurUserName)
+ {
+ try
+ {
+ //瀹℃牳鏉冮檺
+ if (!DBUtility.ClsPub.Security_Log_second("Gy_Customer_Stop", 1, false, CurUserName))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "绂佺敤澶辫触锛佹棤鏉冮檺锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ var ds = oCN.RunProcReturn("select * from Gy_Customer where HItemID=" + HInterID, "Gy_Material");
+ if (ds.Tables[0].Rows.Count > 0)
+ {
+ if (IsStop == 0) //绂佺敤鍒ゆ柇
+ {
+ if (ds.Tables[0].Rows[0]["HStopEmp"].ToString() != "")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍗曟嵁宸茬鐢�!涓嶈兘鍐嶆绂佺敤锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ if (IsStop == 1) //鍙嶇鐢ㄥ垽鏂�
+ {
+ if (ds.Tables[0].Rows[0]["HStopEmp"].ToString() == "")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍗曟嵁鏈鐢�!涓嶉渶瑕佸弽绂佺敤!";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ }
+ else
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍗曟嵁涓嶅瓨鍦�!";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ oCN.BeginTran();
+
+ if (IsStop == 0) //绂佺敤鍒ゆ柇
+ {
+ oCN.RunProc("update Gy_Customer set HStopEmp='" + CurUserName + "',HStopTime=getdate(),HStopflag=1 where HItemID=" + HInterID);
+
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "绂佺敤鎴愬姛";
+ objJsonResult.data = null;
+ }
+ if (IsStop == 1) //鍙嶇鐢ㄥ垽鏂�
+ {
+ oCN.RunProc("update Gy_Customer set HStopEmp='',HStopTime=null,HStopflag=0 where HItemID=" + HInterID);
+
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鍙嶇鐢ㄦ垚鍔�";
+ objJsonResult.data = null;
+ }
+ oCN.Commit();
+
+ 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("Gy_Customer/Gy_CustomerViewApi")]
[HttpGet]
--
Gitblit v1.9.1