From 448a9eda2bf3b7acc50a500309428fcc6c41e3f3 Mon Sep 17 00:00:00 2001
From: zrg <z18737863051@163.com>
Date: 星期五, 22 十二月 2023 10:10:53 +0800
Subject: [PATCH] 1
---
WebAPI/Controllers/XSGL/Xs_ExceptiveCheckRequestBillController.cs | 128 +++++++++++++++++++++++++++++++++++++++++-
1 files changed, 125 insertions(+), 3 deletions(-)
diff --git a/WebAPI/Controllers/XSGL/Xs_ExceptiveCheckRequestBillController.cs b/WebAPI/Controllers/XSGL/Xs_ExceptiveCheckRequestBillController.cs
index 9fe4a0b..cdbfc7f 100644
--- a/WebAPI/Controllers/XSGL/Xs_ExceptiveCheckRequestBillController.cs
+++ b/WebAPI/Controllers/XSGL/Xs_ExceptiveCheckRequestBillController.cs
@@ -468,6 +468,8 @@
//杩涜闇�瑕佽繘琛岀殑瀹℃牳/鍙嶅鏍告搷浣�
if (IsAudit == 0) //瀹℃牳鎻愪氦
{
+ oCN.BeginTran();
+
//妫�楠屾簮鍗曟槸鍚﹀瓨鍦�
string sql = "";
if(oBill.omodel.HMainSourceBillType == "1401")
@@ -516,6 +518,18 @@
return objJsonResult;
}
}
+ else if (oBill.omodel.HMainSourceBillType == "1425")
+ {
+ objJsonResult = AuditXs_ExceptiveCheckRequestBill_CheckSeOrderChangeBill(oBill.omodel.HMainSourceInterID);
+ if (objJsonResult.code != "1")
+ {
+ return objJsonResult;
+ }
+
+ //鍙嶅啓閿�鍞鍗曟暟鎹�
+ sql = "exec h_p_IF_SeOrderBill_ReWriteBySeOrderChangeBill " + oBill.omodel.HMainSourceInterID;
+ oCN.RunProc(sql);
+ }
else
{
objJsonResult.code = "0";
@@ -525,15 +539,14 @@
return objJsonResult;
}
- oCN.BeginTran();
//鍙嶅啓婧愬崟鍗曟嵁鐘舵��
sql = "exec h_p_Xs_ExceptiveCheckRequestBill_ReWriteSourceStatus " + oBill.omodel.HMainSourceInterID + ",'" + oBill.omodel.HMainSourceBillType + "','" + CurUserName + "'";
oCN.RunProc(sql);
if (oBill.CheckBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo) == true)
- {
+ {
oCN.Commit();
-
+
objJsonResult.code = "1";
objJsonResult.count = 1;
objJsonResult.Message = "瀹℃牳鎴愬姛";
@@ -584,6 +597,115 @@
return objJsonResult;
}
}
+
+ #region 瀹℃牳鐗规壒鐢宠鍗曞弽鍐欓攢鍞鍗曞彉鏇村崟鐘舵�佹暟鎹楠�
+ public json AuditXs_ExceptiveCheckRequestBill_CheckSeOrderChangeBill(long HInterID)
+ {
+
+ try
+ {
+ Int64 lngBillKey = 0;
+ lngBillKey = DBUtility.ClsPub.isLong(HInterID); //瀵笻InterID杩涜绫诲瀷鐨勮浆鎹�
+ DAL.ClsXs_SeOrderChangeBill oBill = new DAL.ClsXs_SeOrderChangeBill(); //閿�鍞鍗曞彉鏇村崟瀹炰緥鍖栧崟鎹搷浣滅被锛岀敤浜庤繘琛岀浉鍏虫搷浣�
+ DAL.ClsXs_SeOrderBill oBillSource = new DAL.ClsXs_SeOrderBill(); //閿�鍞鍗曞疄渚嬪寲鍗曟嵁鎿嶄綔绫伙紝鐢ㄤ簬杩涜鐩稿叧鎿嶄綔
+
+ //閽堝闇�瑕佽繘琛岀殑鎿嶄綔锛屾楠屽綋鍓嶅崟鎹殑鐘舵�佹槸鍚︽敮鎸侀渶瑕佽繘琛岀殑鎿嶄綔
+ if (oBill.ShowBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo)) //鏍规嵁HInterID鑾峰彇閿�鍞鍗曞彉鏇村崟鍗曟嵁鐨勬暟鎹�
+ {
+ if (!oBillSource.ShowBill(oBill.DetailColl[0].HSourceInterID, ref DBUtility.ClsPub.sExeReturnInfo)) //鍒ゆ柇閿�鍞鍗曞彉鏇村崟鐨勬簮鍗�-閿�鍞鍗曟槸鍚﹀瓨鍦ㄥ苟鑾峰彇鏁版嵁
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "瀹℃牳澶辫触!鍘熷洜:婧愬崟-閿�鍞鍗曞彉鏇村崟鐨勬簮鍗�-閿�鍞鍗曚笉瀛樺湪!";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+
+ if (oBill.omodel.HBillStatus != 1)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "瀹℃牳澶辫触!鍘熷洜:婧愬崟-閿�鍞鍗曞彉鏇村崟涓嶄负鈥樺垱寤衡�欑姸鎬侊紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ if (oBillSource.omodel.HBillStatus != 2)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "瀹℃牳澶辫触!鍘熷洜:婧愬崟-閿�鍞鍗曞彉鏇村崟鐨勬簮鍗�-閿�鍞鍗曚笉涓衡�樺凡瀹℃牳鈥欑姸鎬侊紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ //妫�楠屽瓙琛ㄦ暟鎹�
+ string errorMessage = "";
+ DateTime today = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd")); //褰撴棩鏃ユ湡
+ double HRelationQty = 0; //婧愬崟-閿�鍞鍗曞叧鑱旀暟閲�(閿�鍞嚭搴撴暟閲�)
+ foreach (Model.ClsXs_SeOrderChangeBillSub oSub in oBill.DetailColl)
+ {
+ string sql = "select * from Xs_SeOrderBillSub where HInterID = " + oSub.HSourceInterID + " and HEntryID = " + oSub.HSourceEntryID;
+ ds = oCN.RunProcReturn(sql, "Xs_SeOrderBillSub");
+ if (ds.Tables[0].Rows.Count == 0)
+ {
+ errorMessage += "婧愬崟-閿�鍞鍗曞彉鏇村崟锛氱" + oSub.HEntryID + "琛岀墿鏂欏湪婧愬崟-閿�鍞鍗曚腑涓嶅瓨鍦�!";
+ }
+ else
+ {
+ //鑾峰彇閿�鍞鍗曞彉鏇村崟涓搴旂墿鏂欏湪婧愬崟-閿�鍞鍗曚腑鐨勫叧鑱旀暟閲�
+ 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 != "")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "瀹℃牳澶辫触!鍘熷洜:" + errorMessage;
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = null;
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ else
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "瀹℃牳澶辫触!鍘熷洜:婧愬崟-閿�鍞鍗曞彉鏇村崟涓嶅瓨鍦�!";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ catch (Exception e)
+ {
+ oCN.RollBack();
+
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "瀹℃牳澶辫触鎴栬�呭弽瀹℃牳澶辫触锛�" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ #endregion
#endregion
#region 鐗规壒鐢宠鍗� 鍏抽棴/鍙嶅叧闂�
--
Gitblit v1.9.1