From 2609bffee3a8de0d1e08b1b2c3fa3cfe13064f4e Mon Sep 17 00:00:00 2001
From: duhe <226547893@qq.com>
Date: 星期一, 24 三月 2025 11:40:14 +0800
Subject: [PATCH] 1
---
WebAPI/Controllers/CJGL/Sc_WorkBeginDotCheckBillController.cs | 176 +++++++++++++++++++++++++++++++++++++++++++++++++++-------
1 files changed, 154 insertions(+), 22 deletions(-)
diff --git a/WebAPI/Controllers/CJGL/Sc_WorkBeginDotCheckBillController.cs b/WebAPI/Controllers/CJGL/Sc_WorkBeginDotCheckBillController.cs
index 79861b9..d1480d4 100644
--- a/WebAPI/Controllers/CJGL/Sc_WorkBeginDotCheckBillController.cs
+++ b/WebAPI/Controllers/CJGL/Sc_WorkBeginDotCheckBillController.cs
@@ -20,11 +20,13 @@
public DBUtility.ClsPub.Enum_BillStatus BillStatus;//鍗曟嵁鐘舵�侊紙鏂板锛屼慨鏀癸紝娴忚锛屾洿鏂板崟浠凤紝鍙樻洿锛�
private json objJsonResult = new json();
public DataSet ds = new DataSet();
+ public DataSet ds1 = new DataSet();
SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
public DAL.ClsSc_WorkBeginDotCheckBillMain OBill = new DAL.ClsSc_WorkBeginDotCheckBillMain(); //鍚姩鐐规鍗�
public DAL.ClsSc_WorkBeginDotCheckBillMain BillOld = new DAL.ClsSc_WorkBeginDotCheckBillMain();//鍚姩鐐规鍗�
public DAL.ClsGy_WorkBeginDotCheckListBillMain OBill1 = new DAL.ClsGy_WorkBeginDotCheckListBillMain(); //璁惧鍚姩鐐规娓呭崟
public DAL.ClsGy_WorkBeginDotCheckListBillMain BillOld1 = new DAL.ClsGy_WorkBeginDotCheckListBillMain(); //璁惧鍚姩鐐规娓呭崟
+
#region 鍚姩鐐规鍒楄〃 鏌ヨ
@@ -1154,11 +1156,51 @@
objJsonResult.data = null;
return objJsonResult;
}
-
oCN.BeginTran();
+ //鍒ゆ柇瀛樺湪鎬�
+ if (BillOld1.ShowBill(Int64.Parse(HInterID), ref DBUtility.ClsPub.sExeReturnInfo))
+ {
+ //鍒犻櫎鍓嶆帶鍒�=========================================
+ string sql1 = "exec h_p_Gy_WorkBeginDotCheckListBill_BeforeDelCtrl " + BillOld1.omodel.HInterID + ",'" + BillOld1.omodel.HBillNo + "','" + user + "'";
+ ds = oCN.RunProcReturn(sql1, "h_p_Gy_WorkBeginDotCheckListBill_BeforeDelCtrl");
+ if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鍒犻櫎澶辫触!鍘熷洜:鍒犻櫎鍓嶅垽鏂け璐ワ紝璇蜂笌缃戠粶绠$悊浜哄憳鑱旂郴";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
- oCN.RunProc("delete from Gy_WorkBeginDotCheckListBillMain where HInterID = " + HInterID);
- oCN.RunProc("delete from Gy_WorkBeginDotCheckListBillSub where HInterID = " + HInterID);
+ if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鍒犻櫎澶辫触!鍘熷洜:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ //==================================================================================
+
+ //鍒犻櫎鍗曟嵁锛堝寘鍚垹闄ゅ悗鎺у埗銆佸啓鍏ユ棩蹇楋級
+ if (!BillOld1.DeleteBill(BillOld1.omodel.HInterID, BillOld1.omodel.HBillNo, "h_p_Gy_WorkBeginDotCheckListBill_AfterDelCtrl", user, ref ClsPub.sExeReturnInfo))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍒犻櫎澶辫触!鍘熷洜:" + ClsPub.sExeReturnInfo;
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ else
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鍒犻櫎鎴愬姛锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ }
oCN.Commit();
@@ -1213,7 +1255,7 @@
if (Type == 1)
{
//鍒ゆ柇鍗曟嵁鏄惁宸茬粡瀹℃牳
- DataSet ds;
+
string sql = "select * from " + BillOld.MvarItemKey + " where HinterID = " + HInterID;
ds = oCN.RunProcReturn(sql, BillOld.MvarItemKey);
if (ds == null || ds.Tables[0].Rows.Count == 0)
@@ -1250,8 +1292,32 @@
objJsonResult.data = null;
return objJsonResult;
}
+ //瀹℃牳鍓嶆帶鍒�=========================================
+ string sql1 = "exec h_p_Gy_WorkBeginDotCheckListBill_BeforeCheckCtrl " + HInterID + ",'" + ds.Tables[0].Rows[0]["HBillNo"].ToString() + "','" + user + "'";
+ ds1 = oCN.RunProcReturn(sql1, "h_p_Gy_WorkBeginDotCheckListBill_BeforeCheckCtrl");
+ if (ds1 == null || ds1.Tables.Count == 0 || ds1.Tables[0].Rows.Count == 0)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "瀹℃牳澶辫触!鍘熷洜:瀹℃牳鍓嶅垽鏂け璐ワ紝璇蜂笌缃戠粶绠$悊浜哄憳鑱旂郴";
+ objJsonResult.data = null;
+ oCN.RollBack();
+ return objJsonResult;
+ }
+
+ if (ds1.Tables[0].Rows[0]["HBack"].ToString() != "0")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "瀹℃牳澶辫触!鍘熷洜:" + ds1.Tables[0].Rows[0]["HRemark"].ToString(); ;
+ objJsonResult.data = null;
+ oCN.RollBack();
+ return objJsonResult;
+ }
+ //==================================================================================
+
//瀹℃牳鍗曟嵁
- if (!BillOld.CheckBill(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo))
+ if (!BillOld.CheckBill(Int64.Parse(HInterID), ds.Tables[0].Rows[0]["HBillNo"].ToString(), "h_p_Gy_WorkBeginDotCheckListBill_AfterCheckCtrl",user, ref ClsPub.sExeReturnInfo))
{
objJsonResult.code = "0";
objJsonResult.count = 1;
@@ -1263,8 +1329,7 @@
}
else
{
- //鍒ゆ柇鍗曟嵁鏄惁宸茬粡鍙嶅鏍�
- DataSet ds;
+ //鍒ゆ柇鍗曟嵁鏄惁宸茬粡鍙嶅鏍�
string sql = "select * from " + BillOld.MvarItemKey + " where HinterID = " + HInterID;
ds = oCN.RunProcReturn(sql, BillOld.MvarItemKey);
if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0)
@@ -1293,8 +1358,29 @@
objJsonResult.data = null;
return objJsonResult;
}
- //鍙嶅鏍稿崟鎹�
- if (!BillOld.AbandonCheck(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo))
+ //鍙嶅鏍稿墠鎺у埗=========================================
+ string sql1 = "exec h_p_Gy_WorkBeginDotCheckListBill_BeforeUnCheckCtrl " + HInterID + ",'" + ds.Tables[0].Rows[0]["HBillNo"].ToString() + "','" + user + "'";
+ ds1 = oCN.RunProcReturn(sql1, "h_p_Gy_WorkBeginDotCheckListBill_BeforeUnCheckCtrl");
+ if (ds1 == null || ds1.Tables.Count == 0 || ds1.Tables[0].Rows.Count == 0)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鍙嶅鏍稿け璐�!鍘熷洜:鍙嶅鏍稿墠鍒ゆ柇澶辫触锛岃涓庣綉缁滅鐞嗕汉鍛樿仈绯�";
+ objJsonResult.data = null;
+ return objJsonResult;
+
+ }
+ if (ds1.Tables[0].Rows[0]["HBack"].ToString() != "0")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鍙嶅鏍稿け璐�!鍘熷洜:" + ds1.Tables[0].Rows[0]["HRemark"].ToString(); ;
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ //===========================================================
+ //鍙嶅鏍稿崟鎹�
+ if (!BillOld.AbandonCheck(Int64.Parse(HInterID), ds.Tables[0].Rows[0]["HBillNo"].ToString(), "h_p_Gy_WorkBeginDotCheckListBill_AfterUnCheckCtrl",user, ref ClsPub.sExeReturnInfo))
{
objJsonResult.code = "0";
objJsonResult.count = 1;
@@ -1479,6 +1565,7 @@
{
try
{
+
//鍒ゆ柇鏄惁鏈変綔搴熸潈闄�
if (!DBUtility.ClsPub.Security_Log("Gy_WorkBeginDotCheckListBillMain_Drop", 1, false, user))
{
@@ -1499,16 +1586,16 @@
}
ClsPub.CurUserName = user;
- BillOld.MvarItemKey = "Gy_WorkBeginDotCheckListBillMain";
+ BillOld1.MvarItemKey = "Gy_WorkBeginDotCheckListBillMain";
oCN.BeginTran();//寮�濮嬩簨鍔�
//Type 1 浣滃簾 2 鍙嶄綔搴�
if (Type == 1)
{
//鍒ゆ柇鍗曟嵁鏄惁宸茬粡浣滃簾
- DataSet ds;
- string sql = "select * from " + BillOld.MvarItemKey + " where HinterID = " + HInterID;
- ds = oCN.RunProcReturn(sql, BillOld.MvarItemKey);
+
+ string sql = "select * from " + BillOld1.MvarItemKey + " where HinterID = " + HInterID;
+ ds = oCN.RunProcReturn(sql, BillOld1.MvarItemKey);
if (ds == null || ds.Tables[0].Rows.Count == 0)
{
objJsonResult.code = "0";
@@ -1535,23 +1622,45 @@
objJsonResult.data = null;
return objJsonResult;
}
- //浣滃簾鍗曟嵁
- if (!BillOld.Cancelltion(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo))
+ //浣滃簾鍓嶆帶鍒�=========================================
+ string sql1 = "exec h_p_Gy_WorkBeginDotCheckListBill_BeforeDropCtrl " + HInterID + ",'" + ds.Tables[0].Rows[0]["HBillNo"].ToString() + "','" + user + "'";
+ ds1 = oCN.RunProcReturn(sql1, "h_p_Gy_WorkBeginDotCheckListBill_BeforeDropCtrl");
+ if (ds1 == null || ds1.Tables.Count == 0 || ds1.Tables[0].Rows.Count == 0)
{
objJsonResult.code = "0";
objJsonResult.count = 1;
+ objJsonResult.Message = "瀹℃牳澶辫触!鍘熷洜:瀹℃牳鍓嶅垽鏂け璐ワ紝璇蜂笌缃戠粶绠$悊浜哄憳鑱旂郴";
+ objJsonResult.data = null;
+ oCN.RollBack();
+ return objJsonResult;
+ }
+
+ if (ds1.Tables[0].Rows[0]["HBack"].ToString() != "0")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "瀹℃牳澶辫触!鍘熷洜:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
+ objJsonResult.data = null;
+ oCN.RollBack();
+ return objJsonResult;
+ }
+ //==================================================================================
+ //浣滃簾鍗曟嵁
+ if (!BillOld1.Cancelltion(Int64.Parse(HInterID), ds.Tables[0].Rows[0]["HBillNo"].ToString(), "h_p_Gy_WorkBeginDotCheckListBill_AfterDropCtrl", user, ref ClsPub.sExeReturnInfo))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
objJsonResult.Message = "浣滃簾澶辫触!鍘熷洜:" + ClsPub.sExeReturnInfo;
objJsonResult.data = null;
return objJsonResult;
- }
+ }
}
}
else
{
//鍒ゆ柇鍗曟嵁鏄惁宸茬粡鍙嶄綔搴�
- DataSet ds;
- string sql = "select * from " + BillOld.MvarItemKey + " where HinterID = " + HInterID;
- ds = oCN.RunProcReturn(sql, BillOld.MvarItemKey);
+ string sql = "select * from " + BillOld1.MvarItemKey + " where HinterID = " + HInterID;
+ ds = oCN.RunProcReturn(sql, BillOld1.MvarItemKey);
if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0)
{
if (ds.Tables[0].Rows[0]["HChecker"] != null && ds.Tables[0].Rows[0]["HChecker"].ToString() != "")
@@ -1570,15 +1679,38 @@
objJsonResult.data = null;
return objJsonResult;
}
- //鍙嶄綔搴熷崟鎹�
- if (!BillOld.AbandonCancelltion(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo))
+ //鍙嶄綔搴熷墠鎺у埗=========================================
+ string sql1 = "exec h_p_Gy_WorkBeginDotCheckListBill_BeforeUnDropCtrl " + HInterID + ",'" + ds.Tables[0].Rows[0]["HBillNo"].ToString() + "','" + user + "'";
+ ds1 = oCN.RunProcReturn(sql1, "h_p_Gy_WorkBeginDotCheckListBill_BeforeUnDropCtrl");
+ if (ds1 == null || ds1.Tables.Count == 0 || ds1.Tables[0].Rows.Count == 0)
{
objJsonResult.code = "0";
objJsonResult.count = 1;
+ objJsonResult.Message = "浣滃簾澶辫触!鍘熷洜:鍙嶄綔搴熷墠鍒ゆ柇澶辫触锛岃涓庣綉缁滅鐞嗕汉鍛樿仈绯�";
+ objJsonResult.data = null;
+ oCN.RollBack();
+ return objJsonResult;
+ }
+
+ if (ds1.Tables[0].Rows[0]["HBack"].ToString() != "0")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "浣滃簾澶辫触!鍘熷洜:" + ds1.Tables[0].Rows[0]["HRemark"].ToString(); ;
+ objJsonResult.data = null;
+ oCN.RollBack();
+ return objJsonResult;
+ }
+ //==================================================================================
+ //鍙嶄綔搴熷崟鎹�
+ if (!BillOld1.AbandonCancelltion(Int64.Parse(HInterID), ds.Tables[0].Rows[0]["HBillNo"].ToString(), "h_p_Gy_WorkBeginDotCheckListBill_AfterDropCtrl", user, ref ClsPub.sExeReturnInfo))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
objJsonResult.Message = "鍙嶄綔搴熷け璐�!鍘熷洜:" + ClsPub.sExeReturnInfo;
objJsonResult.data = null;
return objJsonResult;
- }
+ }
}
}
--
Gitblit v1.9.1