From bdcd6b494439c5ae7540b6cc730937980a511541 Mon Sep 17 00:00:00 2001
From: zrg <z18737863051@163.com>
Date: 星期三, 28 八月 2024 16:38:00 +0800
Subject: [PATCH] 1
---
WebAPI/Controllers/CGGL/Cg_POOrderBillController.cs | 238 +++++++++++++++++++++++++++++++++++++++++++++++++++++++----
1 files changed, 220 insertions(+), 18 deletions(-)
diff --git a/WebAPI/Controllers/CGGL/Cg_POOrderBillController.cs b/WebAPI/Controllers/CGGL/Cg_POOrderBillController.cs
index d2606ac..08f77ae 100644
--- a/WebAPI/Controllers/CGGL/Cg_POOrderBillController.cs
+++ b/WebAPI/Controllers/CGGL/Cg_POOrderBillController.cs
@@ -1160,7 +1160,28 @@
return objJsonResult;
}
//==================================================================================
-
+ //鍒ゆ柇鍗曟嵁鐘舵��
+ 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]["HBillStatus"].ToString() == "6")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍗曟嵁鍦ㄥ鏍镐腑!涓嶈兘杩涜鍒犻櫎!";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
//杩涜 浼氳鏈熼棿 缁撹处 鐨勫垽鏂拰鎺у埗
string s = "";
int sYear = 0;
@@ -1881,6 +1902,14 @@
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(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo))
{
@@ -1913,6 +1942,14 @@
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;
}
@@ -2302,7 +2339,7 @@
#region 閲囪喘璁㈠崟闇�瑕佹垜瀹℃壒娴佸鎵圭殑
[Route("Cg_POOrderBill/NeedChecklist")]
[HttpGet]
- public object NeedChecklist(string user)
+ public object NeedChecklist(string user,string userid)
{
try
{
@@ -2318,10 +2355,12 @@
return objJsonResult;
}
//鎼滅储闇�瑕佸鏍哥殑
- string sql = " select a.*,c.HItemID as HCheckFlowStatusID,m.HName as 瀹℃壒娴佸悕绉�,c.HCheckFlowID,m.HName as 瀹℃壒椤圭洰鍚嶇О,c.HCheckItemID,c.HChecker as 瀹℃壒娴佸鏍镐汉,c.HCheckNote as 瀹℃壒娴佸鏍稿缓璁�,c.HCheckDate 瀹℃壒娴佸鏍告棩鏈� from h_v_Cg_POOrderBillList AS a LEFT JOIN Xt_BillCheckFlowStatus AS c ON a.hmainid = c.HBillInterID and a.鍗曟嵁绫诲瀷 = c.HBillTypeID" +
+ string sql = " select a.*,c.HItemID as HCheckFlowStatusID,m.HName as 瀹℃壒娴�,c.HCheckFlowID,i.HName as 瀹℃壒椤圭洰鍚嶇О,c.HCheckItemID,c.HChecker as 椤圭洰瀹℃牳浜�,c.HCheckNote as 瀹℃壒娴佸鏍稿缓璁�,c.HCheckDate 瀹℃壒娴佸鏍告棩鏈� from h_v_Cg_POOrderBillList AS a LEFT JOIN Xt_BillCheckFlowStatus AS c ON a.hmainid = c.HBillInterID and a.鍗曟嵁绫诲瀷 = c.HBillTypeID" +
" LEFT JOIN Xt_CheckFlowMain as m ON m.HInterID = c.HCheckFlowID" +
+ " LEFT JOIN Cg_POOrderBillMain as po ON a.hmainid = po.HInterID" +
" LEFT JOIN Xt_CheckItem as i ON i.HItemID = c.HCheckItemID" +
- " where c.HCheckDate is NUll and c.HChecker = '" + user + "'";
+ " LEFT JOIN Xt_CheckUserRight as cr ON cr.HCheckItemID = i.HItemID and cr.HCheckFlowInterID = m.HInterID" +
+ " where po.HBillStatus = 6 and po.HCheckItemNowID = i.HItemID and cr.HUserID = '" + userid +"'" ;
ds = oCN.RunProcReturn(sql, "h_v_Cg_POOrderBillList");
foreach (DataColumn col in ds.Tables[0].Columns)
{
@@ -2368,7 +2407,7 @@
return objJsonResult;
}
//鎼滅储闇�瑕佸鏍哥殑
- string sql = " select a.*,c.HItemID as HCheckFlowStatusID,m.HName as 瀹℃壒娴佸悕绉�,c.HCheckFlowID,m.HName as 瀹℃壒椤圭洰鍚嶇О,c.HCheckItemID,c.HChecker as 瀹℃壒娴佸鏍镐汉,c.HCheckNote as 瀹℃壒娴佸鏍稿缓璁�,c.HCheckDate 瀹℃壒娴佸鏍告棩鏈� from h_v_Cg_POOrderBillList AS a LEFT JOIN Xt_BillCheckFlowStatus AS c ON a.hmainid = c.HBillInterID and a.鍗曟嵁绫诲瀷 = c.HBillTypeID" +
+ string sql = " select DISTINCT a.*,c.HItemID as HCheckFlowStatusID,m.HName as 瀹℃壒娴�,c.HCheckFlowID,i.HName as 瀹℃壒椤圭洰鍚嶇О,c.HCheckItemID,c.HChecker as 椤圭洰瀹℃牳浜�,c.HCheckNote as 瀹℃壒娴佸鏍稿缓璁�,c.HCheckDate 瀹℃壒娴佸鏍告棩鏈� from h_v_Cg_POOrderBillList AS a LEFT JOIN Xt_BillCheckFlowStatus AS c ON a.hmainid = c.HBillInterID and a.鍗曟嵁绫诲瀷 = c.HBillTypeID" +
" LEFT JOIN Xt_CheckFlowMain as m ON m.HInterID = c.HCheckFlowID" +
" LEFT JOIN Xt_CheckItem as i ON i.HItemID = c.HCheckItemID" +
" where c.HCheckDate is not NUll and c.HChecker = '" + user + "'";
@@ -2399,12 +2438,71 @@
#endregion
+ #region 閲囪喘璁㈠崟椹冲洖
+ [Route("Cg_POOrderBill/RejectCheckFlow_POOrderBill")]
+ [HttpGet]
+ public object RejectCheckFlow_POOrderBill(string HInterID,string CurUserID)
+ {
+ try
+ {
+ Int64 lngBillKey = 0;
+ lngBillKey = DBUtility.ClsPub.isLong(HInterID); //瀵笻InterID杩涜绫诲瀷鐨勮浆鎹�
+ DAL.ClsCg_POOrderBill oBill = new DAL.ClsCg_POOrderBill(); //瀹炰緥鍖栧崟鎹搷浣滅被锛岀敤浜庤繘琛岀浉鍏虫搷浣�
+ 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("Cg_POOrderBill/StartCheckFlow_POOrderBill")]
[HttpGet]
- public object StartCheckFlow_POOrderBill(int HInterID, int HCheckFlowID_select, string CurUserName)
+ public object StartCheckFlow_POOrderBill(int HInterID,string CurUserName)
{
- string ModRightNameCheck = "Cg_POOrderBill_Check";
DBUtility.ClsPub.CurUserName = CurUserName;
try
{
@@ -2432,9 +2530,9 @@
Int64 lngBillKey = 0;
lngBillKey = DBUtility.ClsPub.isLong(HInterID); //瀵笻InterID杩涜绫诲瀷鐨勮浆鎹�
DAL.ClsCg_POOrderBill oBill = new DAL.ClsCg_POOrderBill(); //瀹炰緥鍖栧崟鎹搷浣滅被锛岀敤浜庤繘琛岀浉鍏虫搷浣�
-
+
//鍙戣捣瀹℃壒
- 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;
@@ -2455,7 +2553,7 @@
{
objJsonResult.code = "0";
objJsonResult.count = 0;
- objJsonResult.Message = "瀹℃牳澶辫触鎴栬�呭弽瀹℃牳澶辫触锛�" + e.ToString();
+ objJsonResult.Message = "鍙戣捣瀹℃壒澶辫触澶辫触锛�" + e.ToString();
objJsonResult.data = null;
return objJsonResult;
}
@@ -2469,9 +2567,9 @@
/// <param name="IsAudit">瀹℃牳(0),鍙嶅鏍�(1)</param>
/// <param name="CurUserName">瀹℃牳浜�</param>
/// <returns></returns>
- [Route("Cg_POOrderBill/AuditXs_POOrderBill_Flow")]
+ [Route("Cg_POOrderBill/AuditCg_POOrderBill_Flow")]
[HttpGet]
- public object AuditXs_POOrderBill_Flow(int HInterID, int IsAudit, string CurUserName, string CurUserID)
+ public object AuditCg_POOrderBill_Flow(int HInterID, int IsAudit, string CurUserName, string CurUserID)
{
//string ModRightNameCheck = "Cg_POOrderBill_Check";
DBUtility.ClsPub.CurUserName = CurUserName;
@@ -2756,7 +2854,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++)
{
@@ -2801,7 +2899,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;
@@ -2815,13 +2913,13 @@
}
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)
+ if (oBill.AbandonCheck(oCN, oBill.omodel.HInterID, oBill.omodel.HBillNo, "h_p_Cg_POOrderBill_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 = "鍙嶅鏍告垚鍔�";
@@ -2855,6 +2953,110 @@
}
}
#endregion
+
+ #region 閲囪喘璁㈠崟鏌ヨ鍒楄〃
+ [Route("Cg_POOrderBill/QueryList")]
+ [HttpGet]
+ public object QueryList(string sWhere, string user)
+ {
+ try
+ {
+ List<object> columnNameList = new List<object>();
+ //鍒ゆ柇鏄惁鏈夋煡璇㈡潈闄�
+
+ if (!DBUtility.ClsPub.Security_Log("Cg_POOrderBillQuery", 1, false, user))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鏃犳潈闄愭煡鐪�!";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ string sql = "select * from h_v_Cg_POOrderBillQuery where 1 = 1 ";
+
+ if (sWhere == "" || sWhere == null)
+ {
+ ds = oCN.RunProcReturn("select * from h_v_Cg_POOrderBillQuery order by hmainid desc", "h_v_Cg_POOrderBillQuery");
+ }
+ else
+ {
+ ds = oCN.RunProcReturn(sql + sWhere + " order by hmainid desc", "h_v_Cg_POOrderBillQuery");
+ }
+
+
+
+ foreach (DataColumn col in ds.Tables[0].Columns)
+ {
+ Type dataType = col.DataType;
+ string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
+ columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕
+ }
+
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "Sucess锛�";
+ objJsonResult.data = ds.Tables[0];
+ objJsonResult.list = columnNameList;
+ return objJsonResult;
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "Exception锛�" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ #endregion
+
+ #region 閲囪喘璁㈠崟鏌ヨ瀛愬垪琛�
+ [Route("Cg_POOrderBill/QuerySubList")]
+ [HttpGet]
+ public object QuerySubList(string hmainid, string user)
+ {
+ try
+ {
+ List<object> columnNameList = new List<object>();
+ //鍒ゆ柇鏄惁鏈夋煡璇㈡潈闄�
+
+ if (!DBUtility.ClsPub.Security_Log("Cg_POOrderBillQuery", 1, false, user))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鏃犳潈闄愭煡鐪�!";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ string sql = "select * from h_v_Cg_POOrderBillQuerySub where hmainid = "+ hmainid;
+
+ ds = oCN.RunProcReturn(sql + " order by hsubid desc", "h_v_Cg_POOrderBillQuerySub");
+
+
+ foreach (DataColumn col in ds.Tables[0].Columns)
+ {
+ Type dataType = col.DataType;
+ string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
+ columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕
+ }
+
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "Sucess锛�";
+ objJsonResult.data = ds.Tables[0];
+ objJsonResult.list = columnNameList;
+ return objJsonResult;
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "Exception锛�" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ #endregion
}
}
\ No newline at end of file
--
Gitblit v1.9.1