From 5a517fbdc48beb4eb8291ec18452e11fcbf9da7a Mon Sep 17 00:00:00 2001
From: duhe <226547893@qq.com>
Date: 星期四, 07 三月 2024 11:42:16 +0800
Subject: [PATCH] 1
---
WebAPI/Controllers/XSGL/YS_ReceiveOtherBillController.cs | 121 ++++++++++++++++++++++------------------
1 files changed, 67 insertions(+), 54 deletions(-)
diff --git a/WebAPI/Controllers/XSGL/YS_ReceiveOtherBillController.cs b/WebAPI/Controllers/XSGL/YS_ReceiveOtherBillController.cs
index 53ab7da..db723c1 100644
--- a/WebAPI/Controllers/XSGL/YS_ReceiveOtherBillController.cs
+++ b/WebAPI/Controllers/XSGL/YS_ReceiveOtherBillController.cs
@@ -308,7 +308,7 @@
objJsonResult.data = 1;
return objJsonResult;
}
- //鍒ゆ柇鏄惁鍙紪杈�
+ //鍒ゆ柇鏄惁鍙垹闄�
if (BillOld.omodel.HChecker != "" && BillOld.omodel.HChecker != null)
{
objJsonResult.code = "0";
@@ -317,68 +317,81 @@
objJsonResult.data = 1;
return objJsonResult;
}
-
- //鍒犻櫎鍓嶆帶鍒�=========================================
- string sql1 = "exec h_p_YS_ReceiveOtherBill_BeforeDelCtrl " + BillOld.omodel.HInterID + ",'" + BillOld.omodel.HBillNo + "','" + user + "'";
- ds = oCN.RunProcReturn(sql1, "h_p_YS_ReceiveOtherBill_BeforeDelCtrl");
- if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
+ //鍒ゆ柇鏄惁鏄垱寤虹姸鎬佽繘琛屽垹闄�
+ if (BillOld.omodel.HBillStatus.ToString() == "1")
{
- objJsonResult.code = "0";
+
+
+ //鍒犻櫎鍓嶆帶鍒�=========================================
+ string sql1 = "exec h_p_YS_ReceiveOtherBill_BeforeDelCtrl " + BillOld.omodel.HInterID + ",'" + BillOld.omodel.HBillNo + "','" + user + "'";
+ ds = oCN.RunProcReturn(sql1, "h_p_YS_ReceiveOtherBill_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;
+ }
+
+ 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;
+ }
+ //==================================================================================
+
+
+
+ oCN.BeginTran();
+
+ oCN.RunProc("delete from YS_ReceiveOtherBillMain where HInterID = " + HInterID);
+ oCN.RunProc("delete from YS_ReceiveOtherBillSub where HInterID= " + HInterID);
+
+ //鍒犻櫎鍚庢帶鍒�==================================================================================
+ string sql2 = "exec h_p_YS_ReceiveOtherBill_AfterDelCtrl " + BillOld.omodel.HInterID + ",'" + BillOld.omodel.HBillNo + "','" + user + "'";
+ ds = oCN.RunProcReturn(sql2, "h_p_YS_ReceiveOtherBill_AfterDelCtrl");
+ if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
+ {
+ s = "鍒犻櫎鍚庡垽鏂け璐ワ紝璇蜂笌缃戠粶绠$悊浜哄憳鑱旂郴";
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鍒犻櫎澶辫触!鍘熷洜:" + s;
+ objJsonResult.data = null;
+ oCN.RollBack();
+ return objJsonResult;
+ }
+ if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
+ {
+ s = ds.Tables[0].Rows[0]["HRemark"].ToString();
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鍒犻櫎澶辫触!鍘熷洜:" + s;
+ objJsonResult.data = null;
+ oCN.RollBack();
+ return objJsonResult;
+ }
+ //==============================================================================================
+
+ oCN.Commit();
+
+ objJsonResult.code = "1";
objJsonResult.count = 1;
- objJsonResult.Message = "鍒犻櫎澶辫触!鍘熷洜:鍒犻櫎鍓嶅垽鏂け璐ワ紝璇蜂笌缃戠粶绠$悊浜哄憳鑱旂郴";
+ objJsonResult.Message = "鍒犻櫎鎴愬姛";
objJsonResult.data = null;
return objJsonResult;
}
-
- if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
+ else
{
objJsonResult.code = "0";
- objJsonResult.count = 1;
- objJsonResult.Message = "鍒犻櫎澶辫触!鍘熷洜:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
- objJsonResult.data = null;
+ objJsonResult.count = 0;
+ objJsonResult.Message = "姝ゅ崟鎹笉鏄垱寤虹姸鎬侊紝涓嶅厑璁稿垹闄わ紒";
+ objJsonResult.data = 1;
return objJsonResult;
}
- //==================================================================================
-
-
-
- oCN.BeginTran();
-
- oCN.RunProc("delete from YS_ReceiveOtherBillMain where HInterID = " + HInterID);
- oCN.RunProc("delete from YS_ReceiveOtherBillSub where HInterID= " + HInterID);
-
- //鍒犻櫎鍚庢帶鍒�==================================================================================
- string sql2 = "exec h_p_YS_ReceiveOtherBill_AfterDelCtrl " + BillOld.omodel.HInterID + ",'" + BillOld.omodel.HBillNo + "','" + user + "'";
- ds = oCN.RunProcReturn(sql2, "h_p_YS_ReceiveOtherBill_AfterDelCtrl");
- if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
- {
- s = "鍒犻櫎鍚庡垽鏂け璐ワ紝璇蜂笌缃戠粶绠$悊浜哄憳鑱旂郴";
- objJsonResult.code = "0";
- objJsonResult.count = 1;
- objJsonResult.Message = "鍒犻櫎澶辫触!鍘熷洜:" + s;
- objJsonResult.data = null;
- oCN.RollBack();
- return objJsonResult;
- }
- if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
- {
- s = ds.Tables[0].Rows[0]["HRemark"].ToString();
- objJsonResult.code = "0";
- objJsonResult.count = 1;
- objJsonResult.Message = "鍒犻櫎澶辫触!鍘熷洜:" + s;
- objJsonResult.data = null;
- oCN.RollBack();
- return objJsonResult;
- }
- //==============================================================================================
-
- oCN.Commit();
-
- objJsonResult.code = "1";
- objJsonResult.count = 1;
- objJsonResult.Message = "鍒犻櫎鎴愬姛";
- objJsonResult.data = null;
- return objJsonResult;
}
catch (Exception e)
{
--
Gitblit v1.9.1