From 5d75ec653bbf75637ad40380eba2bf8af856c5bf Mon Sep 17 00:00:00 2001
From: zrg <z18737863051@163.com>
Date: 星期六, 11 五月 2024 17:12:49 +0800
Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API
---
WebAPI/Controllers/CGGL/Kf_POStockInBackBillController.cs | 85 ++++++++----------------------------------
1 files changed, 17 insertions(+), 68 deletions(-)
diff --git a/WebAPI/Controllers/CGGL/Kf_POStockInBackBillController.cs b/WebAPI/Controllers/CGGL/Kf_POStockInBackBillController.cs
index f3a19ca..bd97c5b 100644
--- a/WebAPI/Controllers/CGGL/Kf_POStockInBackBillController.cs
+++ b/WebAPI/Controllers/CGGL/Kf_POStockInBackBillController.cs
@@ -176,7 +176,7 @@
ds = oCN.RunProcReturn("select * from h_v_Kf_POStockInBackBillList where hmainid=" + HInterID + " and 鍗曟嵁鍙�='" + HBillNo + "'", "h_v_Kf_POStockInBackBillList");
- if ((OperationType == 1 || OperationType == 2) && ds.Tables[0].Rows.Count == 0)//鏂板
+ if ((OperationType == 1 || OperationType == 2 || OperationType == 4) && ds.Tables[0].Rows.Count == 0)//鏂板
{
//淇濆瓨鍓嶆帶鍒�=========================================
ds = oCN.RunProcReturn("exec h_p_Kf_POStockInBackBill_BeforeSaveCtrl " + HInterID, "h_p_Kf_POStockInBackBill_BeforeSaveCtrl");
@@ -225,6 +225,9 @@
}
//淇濆瓨瀛愯〃
objJsonResult = AddBillSub(msg3, HInterID, OperationType, user);
+
+ //閲囪喘閫�鏂欏崟鏂板鍥炲~閫�鏂欓�氱煡鍗曞叧鑱旀暟閲�
+ oCN.RunProc("exec h_p_Kf_UpDateRelation_POStockInBackToPOInStockBack_Add " + HInterID);
if (objJsonResult.code == "0")
{
@@ -384,58 +387,13 @@
/// <returns></returns>
[Route("Kf_POStockInBackBill/DeltetKf_POStockInBackBill")]
[HttpGet]
- public object DeleteKf_POStockInBackBill(string Hmainid, string HsupId,string user)
+ public object DeltetKf_POStockInBackBill(string HInterID, string user)
{
- DataSet ds;
- DataSet dss;
- //string ModRightNameCheck = "Sc_ProcessReport_check";
try
{
- //鍒犻櫎鏉冮檺
- if (!DBUtility.ClsPub.Security_Log("Kf_POStockInBackBill_Delete", 1, false, user))
- {
- objJsonResult.code = "0";
- objJsonResult.count = 0;
- objJsonResult.Message = "鏃犲垹闄ゆ潈闄愶紒";
- objJsonResult.data = null;
- return objJsonResult;
- }
-
- SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
- if (string.IsNullOrWhiteSpace(Hmainid))
- {
- objJsonResult.code = "0";
- objJsonResult.count = 0;
- objJsonResult.Message = "Hmainid涓虹┖锛�";
- objJsonResult.data = null;
- return objJsonResult;
- }
- oCN.BeginTran();//寮�濮嬩簨鍔�
- ds = oCN.RunProcReturn("select * from Kf_ICStockBillMain a inner join Kf_ICStockBillSub b on a.HInterID=b.HInterID where a.HInterID= '" + Hmainid + "'", "Kf_ICStockBillMain");
- dss = oCN.RunProcReturn("exec h_p_Cg_POInStockBillMain '" + user + " '", "h_p_Cg_POInStockBillMain");
- var sReturn = "";
string HBillNo = "";
- if (DBUtility.ClsPub.isLong(dss.Tables[0].Rows[0]["HBack"]) != 0)
- {
- sReturn = DBUtility.ClsPub.isStrNull(dss.Tables[0].Rows[0]["HBackRemark"]).ToString();
- objJsonResult.code = "0";
- objJsonResult.count = 0;
- objJsonResult.Message = sReturn;
- objJsonResult.data = null;
- return objJsonResult;
- }
-
- if (ds == null || ds.Tables[0].Rows.Count == 0)
- {
- objJsonResult.code = "0";
- objJsonResult.count = 0;
- objJsonResult.Message = "娌℃湁鏁版嵁锛屾棤娉曞垹闄わ紒";
- objJsonResult.data = null;
- return objJsonResult; ;
- }
-
//鍒犻櫎鍓嶆帶鍒�=========================================
- string sql1 = "exec h_p_Kf_POStockInBackBill_BeforeDelCtrl " + Hmainid + ",'" + HBillNo + "','" + user + "'";
+ string sql1 = "exec h_p_Kf_POStockInBackBill_BeforeDelCtrl " + HInterID + ",'" + HBillNo + "','" + user + "'";
ds = oCN.RunProcReturn(sql1, "h_p_Kf_POStockInBackBill_BeforeDelCtrl");
if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
{
@@ -456,21 +414,14 @@
}
//==================================================================================
-
- if (ds.Tables[0].Rows.Count == 1)
- {
- oCN.RunProc("delete Kf_ICStockBillSub where HInterID=" + Hmainid);
- oCN.RunProc("delete Kf_ICStockBillMain where HInterID=" + Hmainid);
- }
- else
- {
- oCN.RunProc($"delete Kf_ICStockBillSub where HInterID={ Hmainid}and HEntryID={HsupId}");
- }
- oCN.Commit();//鎻愪氦浜嬪姟
-
+ string sReturn = "";
+ oCN.BeginTran();
+ oCN.RunProc("Delete From Kf_ICStockBillMain where HInterID = " + HInterID);
+ oCN.RunProc("Delete From Kf_ICStockBillSub where HInterID = " + HInterID);
+ oCN.Commit();
//鍒犻櫎鍚庢帶鍒�==================================================================================
- string sql2 = "exec h_p_Kf_POStockInBackBill_AfterDelCtrl " + Hmainid + ",'" + HBillNo + "','" + user + "'";
+ string sql2 = "exec h_p_Kf_POStockInBackBill_AfterDelCtrl " + HInterID + ",'" + HBillNo + "','" + user + "'";
ds = oCN.RunProcReturn(sql2, "h_p_Kf_POStockInBackBill_AfterDelCtrl");
if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
{
@@ -494,24 +445,22 @@
}
//==============================================================================================
-
- objJsonResult.code = "0";
+ objJsonResult.code = "1";
objJsonResult.count = 1;
- objJsonResult.Message = "鏁版嵁鍒犻櫎鎴愬姛锛�";
+ objJsonResult.Message = "鍒犻櫎鎴愬姛锛�";
objJsonResult.data = null;
- return objJsonResult; ;
-
+ return objJsonResult;
}
catch (Exception e)
{
+ oCN.RollBack();
objJsonResult.code = "0";
objJsonResult.count = 0;
- objJsonResult.Message = "鍒犻櫎澶辫触锛�" + e.ToString();
+ objJsonResult.Message = "Exception锛�" + e.ToString();
objJsonResult.data = null;
return objJsonResult;
}
}
-
/// <summary>
/// 鏍规嵁鍩虹璧勬枡ID 鏌ユ壘璁板綍
--
Gitblit v1.9.1