From cfd2e350f5d92ba5b9d0cdf0f3e455497210c9ce Mon Sep 17 00:00:00 2001
From: wtt <1985833171@qq.com>
Date: 星期五, 16 八月 2024 16:59:01 +0800
Subject: [PATCH] 11
---
WebAPI/Controllers/XSGL/Xs_SeOrderBillController.cs | 163 ++++++++++++++++++++++++++++++++++++++++++++++++++----
1 files changed, 151 insertions(+), 12 deletions(-)
diff --git a/WebAPI/Controllers/XSGL/Xs_SeOrderBillController.cs b/WebAPI/Controllers/XSGL/Xs_SeOrderBillController.cs
index 5b56500..5c5ebd7 100644
--- a/WebAPI/Controllers/XSGL/Xs_SeOrderBillController.cs
+++ b/WebAPI/Controllers/XSGL/Xs_SeOrderBillController.cs
@@ -75,6 +75,7 @@
{
try
{
+ List<object> columnNameList = new List<object>(); //瀹氫箟澹版槑鍙橀噺 锛屾妸閫氳繃 new List<object>()鍒涘缓鐨� 瀹炰緥锛岃祴鍊肩粰鍙橀噺
//鍒ゆ柇鏌ヨ鏉冮檺
if (!DBUtility.ClsPub.Security_Log("Xs_SeOrderBillQuery", 1, false, user))
{
@@ -95,11 +96,19 @@
string sql = sql1 + sWhere+ " order by hmainid desc,hsubid asc";
ds = oCN.RunProcReturn(sql, "h_v_IF_SeOrderBillList");
}
+ foreach (DataColumn col in ds.Tables[0].Columns)//閬嶅巻ds涓涓�涓〃锛圱ables[0]锛夌殑鎵�鏈夊垪锛圕olumns锛夋瘡娆″惊鐜腑锛宑ol鍙橀噺浼氭寔鏈夊綋鍓嶅垪鐨勫紩鐢�
+ {
+ Type dataType = col.DataType; //鑾峰彇褰撳墠鏁版嵁绫诲瀷浼犲叆 鑷畾涔夊彉閲廳atadataType
+ string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}"; //瀛楃涓叉嫾鎺� // 灏嗗垪鍚嶅拰鏁版嵁绫诲瀷淇℃伅鎷兼帴鎴愪竴涓狫SON鏍煎紡鐨勫瓧绗︿覆
+ columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕
+ }
+
objJsonResult.code = "1";
objJsonResult.count = 1;
objJsonResult.Message = "Sucess锛�";
objJsonResult.data = ds.Tables[0];
+ objJsonResult.list = columnNameList;//灏哻olumnNameList璧嬪�肩粰objJsonResult鐨刲ist灞炴��
return objJsonResult;
}
catch (Exception e)
@@ -1038,10 +1047,49 @@
oCN.BeginTran();//寮�濮嬩簨鍔�
- //Type 1 浣滃簾 2 鍙嶄綔搴�
- if (Type == 1)
+ //Type 0 浣滃簾 1 鍙嶄綔搴�
+ if (Type == 0)
{
- if (!BillOld.Cancelltion(int.Parse(HInterID), ref ClsPub.sExeReturnInfo))
+ //鍒ゆ柇鍗曟嵁鏄惁宸茬粡浣滃簾
+ 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)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍗曟嵁涓嶅瓨鍦紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ 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() != "")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍗曟嵁宸插鏍�!涓嶈兘杩涜浣滃簾!";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ if (ds.Tables[0].Rows[0]["HDeleteMan"] != null && ds.Tables[0].Rows[0]["HDeleteMan"].ToString() != "")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍗曟嵁宸蹭綔搴�!涓嶉渶瑕佸啀浣滃簾!";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ if (ds.Tables[0].Rows[0]["HBillStatus"].ToString() == "6")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍗曟嵁鍦ㄥ鏍镐腑!涓嶈兘杩涜浣滃簾!";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ if (!BillOld.Cancelltion(int.Parse(HInterID), ref ClsPub.sExeReturnInfo))
{
objJsonResult.code = "0";
objJsonResult.count = 1;
@@ -1052,7 +1100,38 @@
}
else
{
- if (!BillOld.AbandonCancelltion(int.Parse(HInterID), ref ClsPub.sExeReturnInfo))
+ //鍒ゆ柇鍗曟嵁鏄惁宸茬粡鍙嶄綔搴�
+ 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)
+ {
+ if (ds.Tables[0].Rows[0]["HChecker"] != null && ds.Tables[0].Rows[0]["HChecker"].ToString() != "")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍗曟嵁宸插鏍�!涓嶈兘杩涜浣滃簾!";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ if (ds.Tables[0].Rows[0]["HDeleteMan"] == null || ds.Tables[0].Rows[0]["HDeleteMan"].ToString() == "")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍗曟嵁鏈綔搴�!涓嶉渶瑕佸啀鍙嶄綔搴�!";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ if (ds.Tables[0].Rows[0]["HBillStatus"].ToString() == "瀹℃牳涓�")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍗曟嵁鍦ㄥ鏍镐腑!涓嶈兘杩涜浣滃簾!";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ if (!BillOld.AbandonCancelltion(int.Parse(HInterID), ref ClsPub.sExeReturnInfo))
{
objJsonResult.code = "0";
objJsonResult.count = 1;
@@ -1468,12 +1547,71 @@
}
#endregion
+ #region 閿�鍞鍗� 椹冲洖
+ [Route("Xs_SeOrderBill/RejectCheckFlow_POOrderBill")]
+ [HttpGet]
+ public object RejectCheckFlow_POOrderBill(string HInterID, string CurUserID)
+ {
+ try
+ {
+ Int64 lngBillKey = 0;
+ lngBillKey = DBUtility.ClsPub.isLong(HInterID); //瀵笻InterID杩涜绫诲瀷鐨勮浆鎹�
+ DAL.ClsXs_SeOrderBill oBill = new DAL.ClsXs_SeOrderBill(); //瀹炰緥鍖栧崟鎹搷浣滅被锛岀敤浜庤繘琛岀浉鍏虫搷浣�
+ if (oBill.ShowBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo)) //鏍规嵁HInterID鑾峰彇璇ュ崟鎹殑鏁版嵁
+ {
+ if (oBill.omodel.HBillStatus != 6)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍗曟嵁鏈湪瀹℃牳涓笉鑳介┏鍥�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ //鍙戣捣椹冲洖
+ if (oBill.RejectCheckFlowProgress(lngBillKey, oBill.omodel.HBillNo, CurUserID, ref DBUtility.ClsPub.sExeReturnInfo) == true)
+ {
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "椹冲洖鎴愬姛";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ else
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "椹冲洖澶辫触澶辫触!鍘熷洜:" + DBUtility.ClsPub.sExeReturnInfo;
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ else
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍗曟嵁涓嶅瓨鍦�!鍘熷洜:" + DBUtility.ClsPub.sExeReturnInfo;
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ }
+ catch (Exception e)
+ {
+ oCN.RollBack();
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "Exception锛�" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ #endregion
+
#region 閿�鍞鍗� 鍙戣捣瀹℃壒
[Route("Xs_SeOrderBill/StartCheckFlow_SeOrderBIll")]
[HttpGet]
- public object StartCheckFlow_SeOrderBIll(int HInterID,int HCheckFlowID_select, string CurUserName)
+ public object StartCheckFlow_SeOrderBIll(int HInterID,string CurUserName)
{
- string ModRightNameCheck = "Xs_SeOrderBill_Check";
DBUtility.ClsPub.CurUserName = CurUserName;
try
{
@@ -1503,7 +1641,7 @@
DAL.ClsXs_SeOrderBill oBill = new DAL.ClsXs_SeOrderBill(); //瀹炰緥鍖栧崟鎹搷浣滅被锛岀敤浜庤繘琛岀浉鍏虫搷浣�
//鍙戣捣瀹℃壒
- if (oBill.startCheckFlow(lngBillKey,HCheckFlowID_select, ref DBUtility.ClsPub.sExeReturnInfo) ==true)
+ if (oBill.startCheckFlow(lngBillKey,ref DBUtility.ClsPub.sExeReturnInfo) ==true)
{
objJsonResult.code = "1";
objJsonResult.count = 1;
@@ -1849,7 +1987,7 @@
string HCheckFlowID = ds0.Tables[0].Rows[0]["HCheckFlowID"].ToString(); //瀹℃壒娴佸唴鐮�
string HCheckItemNowID = "0"; //褰撳墠瀹℃壒椤圭洰鍐呯爜
string HCheckItemNextID = "0"; //寰呭鎵归」鐩唴鐮�
- if (oBill.omodel.HBillStatus <= 1)
+ if (oBill.omodel.HBillStatus == 6)
{
for (int i = 0; i < ds0.Tables[0].Rows.Count; i++)
{
@@ -1894,7 +2032,7 @@
oCN.RunProc(sql02);
//鍒ゆ柇鍙嶅鏍哥殑鍗曟嵁鏄惁宸茬粡瀹℃牳瀹屾垚锛岃嫢瀹℃牳瀹屾垚锛屽弽瀹℃牳闇�瑕佸彉鏇村崟鎹姸鎬併��
- if (oBill.omodel.HBillStatus <= 1)
+ if (oBill.omodel.HBillStatus == 6)
{
//鏇存柊鍗曟嵁涓昏〃鐨勫鎵规祦鏁版嵁
string sql04 = "update " + oBill.MvarItemKey + " set HCheckItemNowID=" + HCheckItemNowID + ",HCheckItemNextID=" + HCheckItemNextID + " where HInterID = " + lngBillKey;
@@ -1908,13 +2046,14 @@
}
else
{
- //鏇存柊鍗曟嵁涓昏〃鐨勫鎵规祦鏁版嵁
- string sql04 = "update " + oBill.MvarItemKey + " set HCheckItemNowID=" + HCheckItemNowID + ",HCheckItemNextID=" + HCheckItemNextID + " where HInterID = " + lngBillKey;
- oCN.RunProc(sql04);
+
//鍙嶅鏍告彁浜bandonCheck
if (oBill.AbandonCheck(oCN,oBill.omodel.HInterID, oBill.omodel.HBillNo, "h_p_Xs_SeOrderBill_AfterUnCheckCtrl", CurUserName, ref DBUtility.ClsPub.sExeReturnInfo) == true)
{
+ //鏇存柊鍗曟嵁涓昏〃鐨勫鎵规祦鏁版嵁
+ string sql04 = "update " + oBill.MvarItemKey + " set HCheckItemNowID=" + HCheckItemNowID + ",HCheckItemNextID=" + HCheckItemNextID + ",HBillStatus=6 " + " where HInterID = " + lngBillKey;
+ oCN.RunProc(sql04);
objJsonResult.code = "1";
objJsonResult.count = 1;
objJsonResult.Message = "鍙嶅鏍告垚鍔�";
--
Gitblit v1.9.1