From 2bc84b72f4cf693673716ef722a6bb19a8bf3f6f Mon Sep 17 00:00:00 2001
From: duhe <226547893@qq.com>
Date: 星期一, 22 一月 2024 15:56:42 +0800
Subject: [PATCH] 通用审核、反审核:增加审核、反审核方法,并进行审核、反审核后判定
---
DBUtility/业务单据/ClsXt_BaseBill.cs | 100 ++++++++++++++++++++++++++++++++++++++++++++++++++
WebAPI/Controllers/生产管理/生产任务单/Sc_ICMOBillController.cs | 4 +-
2 files changed, 102 insertions(+), 2 deletions(-)
diff --git "a/DBUtility/\344\270\232\345\212\241\345\215\225\346\215\256/ClsXt_BaseBill.cs" "b/DBUtility/\344\270\232\345\212\241\345\215\225\346\215\256/ClsXt_BaseBill.cs"
index 4b7bcc9..f8731e0 100644
--- "a/DBUtility/\344\270\232\345\212\241\345\215\225\346\215\256/ClsXt_BaseBill.cs"
+++ "b/DBUtility/\344\270\232\345\212\241\345\215\225\346\215\256/ClsXt_BaseBill.cs"
@@ -132,6 +132,63 @@
throw (e);
}
}
+ //鍙嶅鏍�(鍖呭惈鍙嶅鏍稿悗鎺у埗)
+ public bool AbandonCheck(Int64 lngBillKey, string HBillNo, string procName, string sUser, ref string sReturn)
+ {
+ string sql = "";
+ DataSet ds;
+
+ if (isUse(lngBillKey, ref sReturn))
+ {
+ return false;
+ }
+ try
+ {
+ //寮�鍚簨鍔�
+ oCn.BeginTran();
+
+ ds = oCn.RunProcReturn("select * from " + MvarItemKey + " where HInterID=" + lngBillKey.ToString(), MvarItemKey);
+ if (ds.Tables[0].Rows[0]["HDeleteMan"].ToString() != "")
+ {
+ oCn.RunProc(" Update " + MvarItemKey + " set HChecker='',HCheckDate=null,HBillStatus=4 Where HInterID=" + lngBillKey.ToString());
+ }
+ else if (ds.Tables[0].Rows[0]["HCloseMan"].ToString() != "")
+ {
+ oCn.RunProc(" Update " + MvarItemKey + " set HChecker='',HCheckDate=null,HBillStatus=3 Where HInterID=" + lngBillKey.ToString());
+ }
+ else
+ {
+ oCn.RunProc(" Update " + MvarItemKey + " set HChecker='',HCheckDate=null,HBillStatus=1 Where HInterID=" + lngBillKey.ToString());
+ }
+
+ //鍙嶅鏍稿悗鎺у埗
+ sql = "exec " + procName + " " + lngBillKey + ",'" + HBillNo + "','" + sUser + "'";
+ ds = oCn.RunProcReturn(sql, procName);
+ if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
+ {
+ sReturn = "鍙嶅鏍歌繃绋嬩腑鍑洪敊锛岃涓庣綉缁滅鐞嗕汉鍛樿仈绯�";
+ oCn.RollBack();
+ return false;
+ }
+ if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
+ {
+ sReturn = ds.Tables[0].Rows[0]["HRemark"].ToString();
+ oCn.RollBack();
+ return false;
+ }
+
+ sReturn = "";
+ oCn.Commit();
+ return true;
+ }
+ catch (Exception e)
+ {
+ oCn.RollBack();
+ sReturn = e.Message;
+ throw (e);
+ }
+ }
+
//瀹℃牳
public bool CheckBill(Int64 lngBillKey, ref string sReturn)
{
@@ -168,6 +225,49 @@
throw (e);
}
}
+ //瀹℃牳(鍖呭惈鍙嶅鏍稿悗鎺у埗)
+ public bool CheckBill(Int64 lngBillKey, string HBillNo,string procName , string sUser, ref string sReturn)
+ {
+ string sql = "";
+ DataSet ds;
+ try
+ {
+ string HChecker = sUser;
+ string HCheckDate = ClsPub.GetServerDate(-1);
+
+ //寮�鍚簨鍔�
+ oCn.BeginTran();
+
+ //鏇存柊鍗曟嵁鐘舵��
+ oCn.RunProc(" Update " + MvarItemKey + " set HChecker='" + HChecker + "',HCheckDate='" + HCheckDate + "' Where HInterID=" + lngBillKey.ToString());
+
+ //瀹℃牳鍚庢帶鍒�
+ sql = "exec " + procName + " " + lngBillKey + ",'" + HBillNo + "','" + sUser + "'";
+ ds = oCn.RunProcReturn(sql, procName);
+ if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
+ {
+ sReturn = "瀹℃牳杩囩▼涓嚭閿欙紝璇蜂笌缃戠粶绠$悊浜哄憳鑱旂郴";
+ oCn.RollBack();
+ return false;
+ }
+ if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
+ {
+ sReturn = ds.Tables[0].Rows[0]["HRemark"].ToString();
+ oCn.RollBack();
+ return false;
+ }
+
+ sReturn = "";
+ oCn.Commit();
+ return true;
+ }
+ catch (Exception e)
+ {
+ oCn.RollBack();
+ sReturn = e.Message;
+ throw (e);
+ }
+ }
//鍏抽棴
public bool CloseBill(Int64 lngBillKey, ref string sReturn)
{
diff --git "a/WebAPI/Controllers/\347\224\237\344\272\247\347\256\241\347\220\206/\347\224\237\344\272\247\344\273\273\345\212\241\345\215\225/Sc_ICMOBillController.cs" "b/WebAPI/Controllers/\347\224\237\344\272\247\347\256\241\347\220\206/\347\224\237\344\272\247\344\273\273\345\212\241\345\215\225/Sc_ICMOBillController.cs"
index 0b1561a..db1ae52 100644
--- "a/WebAPI/Controllers/\347\224\237\344\272\247\347\256\241\347\220\206/\347\224\237\344\272\247\344\273\273\345\212\241\345\215\225/Sc_ICMOBillController.cs"
+++ "b/WebAPI/Controllers/\347\224\237\344\272\247\347\256\241\347\220\206/\347\224\237\344\272\247\344\273\273\345\212\241\345\215\225/Sc_ICMOBillController.cs"
@@ -720,7 +720,7 @@
//Type 1 瀹℃牳 2 鍙嶅鏍�
if (Type == 1)
{
- if (!BillOld.CheckBill(int.Parse(HInterID), ref ClsPub.sExeReturnInfo))
+ if (!BillOld.CheckBill(int.Parse(HInterID),"", "h_p_Sc_ICMOBill_AfterCheckCtrl", user, ref ClsPub.sExeReturnInfo))
{
objJsonResult.code = "0";
objJsonResult.count = 1;
@@ -731,7 +731,7 @@
}
else
{
- if (BillOld.AbandonCheck(int.Parse(HInterID), ref ClsPub.sExeReturnInfo))
+ if (BillOld.AbandonCheck(int.Parse(HInterID), "", "h_p_Sc_ICMOBill_AfterUnCheckCtrl", user, ref ClsPub.sExeReturnInfo))
{
SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
DataSet DSet = oCn.RunProcReturn("exec h_p_Sc_ICMOBill_AbandonCheckCtrl " + int.Parse(HInterID), "h_p_Sc_ICMOBill_AbandonCheckCtrl");
--
Gitblit v1.9.1