From 02a1b9d8ab3cfb893beb27bfeb6c11c3dcf4a5a4 Mon Sep 17 00:00:00 2001
From: zrg <z18737863051@163.com>
Date: 星期四, 28 十二月 2023 17:49:30 +0800
Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API
---
WebAPI/Controllers/XSGL/Xs_SeOrderChangeBillController.cs | 77 ++++++++++++++++++++++++++++----------
1 files changed, 57 insertions(+), 20 deletions(-)
diff --git a/WebAPI/Controllers/XSGL/Xs_SeOrderChangeBillController.cs b/WebAPI/Controllers/XSGL/Xs_SeOrderChangeBillController.cs
index d8c9740..dba32a3 100644
--- a/WebAPI/Controllers/XSGL/Xs_SeOrderChangeBillController.cs
+++ b/WebAPI/Controllers/XSGL/Xs_SeOrderChangeBillController.cs
@@ -37,14 +37,14 @@
{
List<object> columnNameList = new List<object>();
//鏌ョ湅鏉冮檺
- //if (!DBUtility.ClsPub.Security_Log("Gy_ProjectStage_Query", 1, false, user))
- //{
- // objJsonResult.code = "0";
- // objJsonResult.count = 0;
- // objJsonResult.Message = "鏃犳煡鐪嬫潈闄愶紒";
- // objJsonResult.data = null;
- // return objJsonResult;
- //}
+ if (!DBUtility.ClsPub.Security_Log("Xs_SeOrderChangeBill_Query", 1, false, user))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鏃犳煡鐪嬫潈闄愶紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
if (sWhere == null || sWhere.Equals(""))
{
@@ -473,15 +473,28 @@
DateTime today = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd")); //褰撴棩鏃ユ湡
foreach (Model.ClsXs_SeOrderChangeBillSub oSub in oBill.DetailColl)
{
- //鍒ゆ柇鏂版暟閲忔槸鍚﹀皬浜庡崟鎹叧鑱旀暟閲�
- if(oSub.HQty_New < oSub.HRelationQty)
+ string sqlCheck = "select * from Xs_SeOrderBillSub where HInterID = " + oSub.HSourceInterID + " and HEntryID = " + oSub.HSourceEntryID;
+ ds = oCN.RunProcReturn(sqlCheck, "Xs_SeOrderBillSub");
+ if (ds.Tables[0].Rows.Count == 0)
{
- errorMessage += "绗�" + oSub.HEntryID + "琛岀墿鏂欐柊鏁伴噺灏忎簬鍗曟嵁琚叧鑱旀暟閲�!";
- }
- //鍒ゆ柇鏂颁氦璐ф棩鏈熸槸鍚︽棭浜庡綋鏃�
- if ( oSub.HDate_New.CompareTo(today) < 0 )
+ errorMessage += "绗�" + oSub.HEntryID + "琛岀墿鏂欏湪婧愬崟-閿�鍞鍗曚腑涓嶅瓨鍦�!";
+ }
+ else
{
- errorMessage += "绗�" + oSub.HEntryID + "琛屾柊浜よ揣鏃ユ湡鏃╀簬褰撴棩!";
+ double HRelationQty = 0;
+ //鑾峰彇閿�鍞鍗曞彉鏇村崟涓搴旂墿鏂欏湪婧愬崟-閿�鍞鍗曚腑鐨勫叧鑱旀暟閲�
+ HRelationQty = double.Parse(ds.Tables[0].Rows[0]["HRelationQty"].ToString());
+
+ //鍒ゆ柇鐗╂枡鏂版暟閲忔槸鍚﹀皬浜庢簮鍗曞崟鎹腑瀵瑰簲鐗╂枡鐨勫叧鑱旀暟閲�
+ if (oSub.HQty_New < HRelationQty)
+ {
+ errorMessage += "绗�" + oSub.HEntryID + "琛岀墿鏂欐柊鏁伴噺灏忎簬婧愬崟-閿�鍞鍗曡鍏宠仈鏁伴噺!";
+ }
+ //鍒ゆ柇鏂颁氦璐ф棩鏈熸槸鍚︽棭浜庡綋鏃�
+ if (oSub.HDate_New.CompareTo(today) < 0)
+ {
+ errorMessage += "绗�" + oSub.HEntryID + "琛屾柊浜よ揣鏃ユ湡鏃╀簬褰撴棩!";
+ }
}
}
if(errorMessage != "")
@@ -505,17 +518,37 @@
objJsonResult.Message = "瀹℃牳澶辫触!鍘熷洜:婧愬崟涓嶅瓨鍦�!";
objJsonResult.data = null;
return objJsonResult;
+ }else if(ds.Tables[0].Rows[0]["HBillStatus"].ToString() != "2")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "瀹℃牳澶辫触!鍘熷洜:婧愬崟鏈浜庡鏍哥姸鎬�!";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ oCN.BeginTran();
+ //鍙嶅啓閿�鍞鍗曟暟鎹�
+ sql = "exec h_p_IF_SeOrderBill_ReWriteBySeOrderChangeBill " + oBill.omodel.HInterID;
+ oCN.RunProcReturn(sql, "h_p_IF_SeOrderBill_ReWriteBySeOrderChangeBill");
+ //淇$敤鎺у埗
+ sql = "exec h_p_Kf_CheckSeOrderBill_CrediControl " + oBill.omodel.HMainSourceInterID;
+ ds = oCN.RunProcReturn(sql, "h_p_Kf_CheckSeOrderBill_CrediControl");
+ if (ds.Tables[0].Rows[0]["HBack"].ToString() == "1")
+ {
+ oCN.RollBack();
+
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "瀹℃牳澶辫触!鍘熷洜:" + ds.Tables[0].Rows[0]["HRemark"].ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
}
//瀹℃牳鎻愪氦
if (oBill.CheckBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo) == true)
{
- oCN.BeginTran();
- //鍙嶅啓閿�鍞鍗曟暟鎹�
- sql = "exec h_p_IF_SeOrderBill_ReWriteBySeOrderChangeBill " + oBill.omodel.HInterID;
- oCN.RunProcReturn(sql, "h_p_IF_SeOrderBill_ReWriteBySeOrderChangeBill");
oCN.Commit();
-
objJsonResult.code = "1";
objJsonResult.count = 1;
objJsonResult.Message = "瀹℃牳鎴愬姛";
@@ -524,6 +557,8 @@
}
else
{
+ oCN.RollBack();
+
objJsonResult.code = "0";
objJsonResult.count = 0;
objJsonResult.Message = "瀹℃牳澶辫触!鍘熷洜:" + DBUtility.ClsPub.sExeReturnInfo;
@@ -555,6 +590,8 @@
}
catch (Exception e)
{
+ oCN.RollBack();
+
objJsonResult.code = "0";
objJsonResult.count = 0;
objJsonResult.Message = "瀹℃牳澶辫触鎴栬�呭弽瀹℃牳澶辫触锛�" + e.ToString();
--
Gitblit v1.9.1