From cee055eb7cdecf5d995cc65d379494e471bde9c8 Mon Sep 17 00:00:00 2001
From: yangle <admin@YINMOU>
Date: 星期三, 02 四月 2025 10:06:03 +0800
Subject: [PATCH] 合并
---
WebAPI/Controllers/CGGL/Cg_PayableBillController.cs | 442 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 436 insertions(+), 6 deletions(-)
diff --git a/WebAPI/Controllers/CGGL/Cg_PayableBillController.cs b/WebAPI/Controllers/CGGL/Cg_PayableBillController.cs
index da93c5a..3981534 100644
--- a/WebAPI/Controllers/CGGL/Cg_PayableBillController.cs
+++ b/WebAPI/Controllers/CGGL/Cg_PayableBillController.cs
@@ -8,6 +8,7 @@
using System.Data.SqlClient;
using System.Web.Http;
using WebAPI.Models;
+using SyntacticSugar.constant;
namespace WebAPI.Controllers
{
@@ -23,6 +24,63 @@
private json objJsonResult = new json();
SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
DataSet ds;
+
+ #region 搴斾粯鍗曞垎椤靛垪琛�
+ [Route("Cg_PayableBill/page")]
+ [HttpGet]
+ public object Cg_PayableBillPage(string sWhere, string user, int page, int size)
+ {
+ DataSet ds;
+ json res = new json();
+ try
+ {
+ List<object> columnNameList = new List<object>();
+ //鍒ゆ柇鏉冮檺
+ //if (!DBUtility.ClsPub.Security_Log("Kf_POStockInBillList", 1, false, user))
+ //{
+ // objJsonResult.code = CodeConstant.FAIL;
+ // objJsonResult.count = CountConstant.FAIL;
+ // objJsonResult.Message = "鎮ㄦ病鏈夎妯″潡鏉冮檺,璇蜂笌绠$悊鍛樿仈绯伙紒";
+ // objJsonResult.data = null;
+ // return objJsonResult;
+ //}
+
+ sWhere = sWhere.Replace("'", "''");
+ if (sWhere == null || sWhere.Equals(""))
+ {
+ ds = oCN.RunProcReturn("exec h_p_Cg_PayableBillList " + page + "," + size + ",''", "h_p_Cg_PayableBillList");
+ }
+ else
+ {
+ ds = oCN.RunProcReturn("exec h_p_Cg_PayableBillList " + page + "," + size + ",'" + sWhere + "'", "h_p_Cg_PayableBillList");
+ }
+
+ //娣诲姞鍒楀悕
+ 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鍒楀璞$殑鍒楀悕
+ }
+
+ res.code = CodeConstant.SUCCEED;
+ res.count = int.Parse(ds.Tables[1].Rows[0]["count"].ToString());
+ res.Message = "Sucess锛�";
+ res.list = columnNameList;
+ res.data = ds.Tables[0];
+ return res;
+ }
+ catch (Exception e)
+ {
+ res.code = CodeConstant.FAIL;
+ res.count = CountConstant.FAIL;
+ res.Message = "Exception锛�" + e.ToString();
+ res.data = null;
+ return res;
+ }
+ }
+ #endregion
+
#region 搴斾粯鍗曞垪琛� 鏌ヨ
/// <summary>
@@ -239,6 +297,31 @@
{
bResult = false;
}
+
+ //鑷姩瀹℃牳璁剧疆
+ if (refSav == "Add")
+ {
+ objJsonResult.HInterID = oBill.omodel.HInterID.ToString(); //杩斿洖涓籌D
+ //绯荤粺鍙傛暟 鑷姩瀹℃牳
+ string sReturn = "";
+ if (oSystemParameter.ShowBill(ref sReturn) == true)
+ {
+ if (oSystemParameter.omodel.Cg_PayableBill_AutoCheck == "Y") //绯荤粺鍙傛暟 鑷姩瀹℃牳
+ {
+ objJsonResult.Verify = "Y";
+ }
+ else
+ {
+ objJsonResult.Verify = "N";
+ }
+ }
+ }
+ else if (refSav == "Update")
+ {
+ objJsonResult.HInterID = oBill.omodel.HInterID.ToString(); //杩斿洖涓籌D
+ objJsonResult.Verify = "N";
+ }
+
if (bResult)
{
objJsonResult.code = "0";
@@ -388,7 +471,7 @@
//搴斾粯鍗� 鍒犻櫎 鎾ら攢 閲囪喘鍏ュ簱鍗� 鍏宠仈鏁伴噺
oCN.RunProc("exec h_p_Cg_UpDateRelation_POStockInToPayable_Del " + HInterID);
- //搴斾粯鍗� 鍒犻櫎 鎾ら攢 搴斾粯鍗� 鍏宠仈鏁伴噺
+ //搴斾粯鍗� 鍒犻櫎 鎾ら攢 閲囪喘璁㈠崟 鍏宠仈鏁伴噺
oCN.RunProc("exec h_p_Cg_UpDateRelation_POOrderToPayable_Del " + HInterID);
oCN.RunProc("delete from Cg_PayableBillMain where HInterID = " + HInterID);
@@ -1091,7 +1174,7 @@
[HttpGet]
public object AuditCg_PayableBill_Flow(int HInterID, int IsAudit, string CurUserName, string CurUserID)
{
- //string ModRightNameCheck = "Cg_POOrderBill_Check";
+ //string ModRightNameCheck = "Cg_PayableBill_Check";
DBUtility.ClsPub.CurUserName = CurUserName;
try
{
@@ -1196,8 +1279,8 @@
{
#region 瀹℃牳鍓嶇殑鐩稿叧鍒ゆ柇
//瀹℃牳鍓嶆帶鍒�=========================================
- //string sql1 = "exec h_p_Cg_POOrderBill_BeforeCheckCtrl " + oBill.omodel.HInterID + ",'" + oBill.omodel.HBillNo + "','" + CurUserName + "'";
- //ds = oCN.RunProcReturn(sql1, "h_p_Cg_POOrderBill_BeforeCheckCtrl");
+ //string sql1 = "exec h_p_Cg_PayableBill_BeforeCheckCtrl " + oBill.omodel.HInterID + ",'" + oBill.omodel.HBillNo + "','" + CurUserName + "'";
+ //ds = oCN.RunProcReturn(sql1, "h_p_Cg_PayableBill_BeforeCheckCtrl");
//if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
//{
// objJsonResult.code = "0";
@@ -1302,7 +1385,7 @@
oCN.RunProc(sql04);
//鏇存柊鍗曟嵁鐨勫崟鎹姸鎬�
- if (oBill.CheckBill(oCN, oBill.omodel.HInterID, oBill.omodel.HBillNo, "h_p_Cg_POOrderBill_AfterCheckCtrl", CurUserName, ref DBUtility.ClsPub.sExeReturnInfo) == true)
+ if (oBill.CheckBill(oCN, oBill.omodel.HInterID, oBill.omodel.HBillNo, "h_p_Cg_PayableBill_AfterCheckCtrl", CurUserName, ref DBUtility.ClsPub.sExeReturnInfo) == true)
{
objJsonResult.code = "1";
objJsonResult.count = 1;
@@ -1325,7 +1408,7 @@
{
#region 鍙嶅鏍稿墠鐨勭浉鍏冲垽鏂�
//鍙嶅鏍稿墠鎺у埗=========================================
- //DataSet ds = oCN.RunProcReturn("Exec h_p_Cg_POOrderBill_BeforeUnCheckCtrl " + oBill.omodel.HInterID + ",'" + oBill.omodel.HBillNo + "','" + CurUserName + "'", "h_p_Cg_POOrderBill_BeforeUnCheckCtrl");
+ //DataSet ds = oCN.RunProcReturn("Exec h_p_Cg_PayableBill_BeforeUnCheckCtrl " + oBill.omodel.HInterID + ",'" + oBill.omodel.HBillNo + "','" + CurUserName + "'", "h_p_Cg_PayableBill_BeforeUnCheckCtrl");
//if (ds == null)
//{
// objJsonResult.code = "0";
@@ -1474,5 +1557,352 @@
}
#endregion
+ #region 搴斾粯鍗曞垪琛� 鏌ヨ渚涘簲鍟嗕粯娆捐鍒掕〃
+ /// <summary>
+ /// 杩斿洖搴旀敹鍗曞垪琛�
+ ///鍙傛暟锛歴tring sql銆�
+ ///杩斿洖鍊硷細object銆�
+ /// </summary>
+ [Route("Cg_PayableBill/SupplierPayPlanList")]
+ [HttpGet]
+ public object SupplierPayPlanList(string sWhere, string user)
+ {
+ try
+ {
+ List<object> columnNameList = new List<object>();
+
+ if (sWhere == null || sWhere.Equals(""))
+ {
+ ds = oCN.RunProcReturn("select * from h_v_Gy_SupplierPayPlanList order by 鍗曟嵁鍙� desc", "h_v_Gy_SupplierPayPlanList");
+ }
+ else
+ {
+ string sql1 = "select * from h_v_Gy_SupplierPayPlanList where 1 = 1 ";
+ string sql = sql1 + sWhere + " order by 鍗曟嵁鍙� desc";
+ ds = oCN.RunProcReturn(sql, "h_v_Gy_SupplierPayPlanList");
+ }
+
+ //娣诲姞鍒楀悕
+ 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_PayableBill/QueryList")]
+ [HttpGet]
+ public object QueryList(string sWhere, string user)
+ {
+ try
+ {
+ List<object> columnNameList = new List<object>();
+ //鍒ゆ柇鏄惁鏈夋煡璇㈡潈闄�
+
+ //if (!DBUtility.ClsPub.Security_Log("Cg_PayableBillQuery", 1, false, user))
+ //{
+ // objJsonResult.code = CodeConstant.FAIL;
+ // objJsonResult.count = CountConstant.FAIL;
+ // objJsonResult.Message = "鏃犳潈闄愭煡鐪�!";
+ // objJsonResult.data = null;
+ // return objJsonResult;
+ //}
+ string sql = "select * from h_v_Cg_PayableBillQuery where 1 = 1 ";
+
+ if (sWhere == "" || sWhere == null)
+ {
+ ds = oCN.RunProcReturn("select * from h_v_Cg_PayableBillQuery order by hmainid desc", "h_v_Cg_PayableBillQuery");
+ }
+ else
+ {
+ ds = oCN.RunProcReturn(sql + sWhere + " order by hmainid desc", "h_v_Cg_PayableBillQuery");
+ }
+
+
+
+ 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 = CodeConstant.SUCCEED;
+ objJsonResult.count = CountConstant.SUCCEED;
+ objJsonResult.Message = "Sucess锛�";
+ objJsonResult.data = ds.Tables[0];
+ objJsonResult.list = columnNameList;
+ return objJsonResult;
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = CodeConstant.FAIL;
+ objJsonResult.count = CountConstant.FAIL;
+ objJsonResult.Message = "Exception锛�" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ #endregion
+
+ #region 搴斾粯鍗曟煡璇㈠瓙鍒楄〃
+ [Route("Cg_PayableBill/QuerySubList")]
+ [HttpGet]
+ public object QuerySubList(string hmainid, string user)
+ {
+ try
+ {
+ List<object> columnNameList = new List<object>();
+ //鍒ゆ柇鏄惁鏈夋煡璇㈡潈闄�
+
+ //if (!DBUtility.ClsPub.Security_Log("Cg_PayableBillQuery", 1, false, user))
+ //{
+ // objJsonResult.code = CodeConstant.FAIL;
+ // objJsonResult.count = CountConstant.FAIL;
+ // objJsonResult.Message = "鏃犳潈闄愭煡鐪�!";
+ // objJsonResult.data = null;
+ // return objJsonResult;
+ //}
+ string sql = "select * from h_v_Cg_PayableBillQuerySub where hmainid = " + hmainid;
+
+ ds = oCN.RunProcReturn(sql + " order by hsubid ASC", "h_v_Cg_PayableBillQuerySub");
+
+
+ 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 = CodeConstant.SUCCEED;
+ objJsonResult.count = CountConstant.SUCCEED;
+ objJsonResult.Message = "Sucess锛�";
+ objJsonResult.data = ds.Tables[0];
+ objJsonResult.list = columnNameList;
+ return objJsonResult;
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = CodeConstant.FAIL;
+ objJsonResult.count = CountConstant.FAIL;
+ objJsonResult.Message = "Exception锛�" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ #endregion
+
+ #region 搴斾粯鍗曢渶瑕佹垜瀹℃壒娴佸鎵圭殑
+ [Route("Cg_PayableBill/NeedChecklist")]
+ [HttpGet]
+ public object NeedChecklist(string user, string userid)
+ {
+ try
+ {
+ List<object> columnNameList = new List<object>();
+ //鍒ゆ柇鏄惁鏈夋煡璇㈡潈闄�
+
+ //if (!DBUtility.ClsPub.Security_Log("Cg_PayableBillQuery", 1, false, user))
+ //{
+ // objJsonResult.code = CodeConstant.FAIL;
+ // objJsonResult.count = CountConstant.FAIL;
+ // objJsonResult.Message = "鏃犳潈闄愭煡鐪�!";
+ // objJsonResult.data = null;
+ // return objJsonResult;
+ //}
+ //鎼滅储闇�瑕佸鏍哥殑
+ string sql = "select * from h_v_Cg_PayableBillQuery_NeedCheck where HCheckUserID = '" + userid + "' ORDER BY hmainid DESC,hsubid ASC";
+ ds = oCN.RunProcReturn(sql, "h_v_Cg_PayableBillQuery_NeedCheck");
+ 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 = CodeConstant.SUCCEED;
+ objJsonResult.count = CountConstant.SUCCEED;
+ objJsonResult.Message = "Sucess锛�";
+ objJsonResult.data = ds.Tables[0];
+ objJsonResult.list = columnNameList;
+ return objJsonResult;
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = CodeConstant.FAIL;
+ objJsonResult.count = CountConstant.FAIL;
+ objJsonResult.Message = "Exception锛�" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+
+ #endregion
+
+ #region 搴斾粯鍗曞凡缁忓鎵规祦瀹℃壒鐨�
+ [Route("Cg_PayableBill/Checkedlist")]
+ [HttpGet]
+ public object Checkedlist(string user)
+ {
+ try
+ {
+ List<object> columnNameList = new List<object>();
+ //鍒ゆ柇鏄惁鏈夋煡璇㈡潈闄�
+
+ //if (!DBUtility.ClsPub.Security_Log("Cg_PayableBillQuery", 1, false, user))
+ //{
+ // objJsonResult.code = CodeConstant.FAIL;
+ // objJsonResult.count = CountConstant.FAIL;
+ // objJsonResult.Message = "鏃犳潈闄愭煡鐪�!";
+ // objJsonResult.data = null;
+ // return objJsonResult;
+ //}
+ //鎼滅储闇�瑕佸鏍哥殑
+ string sql = "select TOP 1000 * from h_v_Cg_PayableBillQuery_Checked where 椤圭洰瀹℃牳浜� = '" + user + "'" +
+ " ORDER BY hmainid DESC,hsubid ASC";
+ ds = oCN.RunProcReturn(sql, "h_v_Cg_PayableBillList_Query");
+ 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 = CodeConstant.SUCCEED;
+ objJsonResult.count = CountConstant.SUCCEED;
+ objJsonResult.Message = "Sucess锛�";
+ objJsonResult.data = ds.Tables[0];
+ objJsonResult.list = columnNameList;
+ return objJsonResult;
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = CodeConstant.FAIL;
+ objJsonResult.count = CountConstant.FAIL;
+ objJsonResult.Message = "Exception锛�" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+
+ #endregion
+
+ #region 搴斾粯鍗� 鎵归噺澶氱骇瀹℃牳
+ [Route("Cg_PayableBill/CheckAllFlow")]
+ [HttpGet]
+ public object CheckAll(string HInterIDS, int IsAudit, string CurUserName, string CurUserID)
+ {
+ try
+ {
+ //澶勭悊瀛楃涓�
+ if (!string.IsNullOrEmpty(HInterIDS))
+ {
+ int[] idArray = Array.ConvertAll(HInterIDS.Split(','), int.Parse);
+ // 澶勭悊idArray...
+ for (int i = 0; i < idArray.Length; i++)
+ {
+ objJsonResult = (json)AuditCg_PayableBill_Flow(idArray[i], IsAudit, CurUserName, CurUserID);//瀹℃牳鎵ц
+ if (objJsonResult.count == 0)
+ {
+ objJsonResult.Message += "绗�" + (i + 1) + "琛屽嚭鐜伴棶棰樻棤娉曠户缁畬鎴�";
+ return objJsonResult;
+ }
+ }
+ }
+ else
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "璇烽�夋嫨姝g‘琛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ objJsonResult.code = CodeConstant.SUCCEED;
+ objJsonResult.count = CountConstant.SUCCEED;
+ 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
+
+ #region 搴斾粯鍗� 鎵归噺椹冲洖
+ [Route("Cg_PayableBill/RejectAllCheckFlow")]
+ [HttpGet]
+ public object RejectAllCheckFlow(string HInterIDS, string CurUserID)
+ {
+ try
+ {
+ //澶勭悊瀛楃涓�
+ if (!string.IsNullOrEmpty(HInterIDS))
+ {
+ int[] idArray = Array.ConvertAll(HInterIDS.Split(','), int.Parse);
+ // 澶勭悊idArray...
+ for (int i = 0; i < idArray.Length; i++)
+ {
+ objJsonResult = (json)RejectCheckFlow_POOrderBill(idArray[i].ToString(), CurUserID);//瀹℃牳鎵ц
+ if (objJsonResult.count == 0)
+ {
+ objJsonResult.Message += "绗�" + (i + 1) + "琛屽嚭鐜伴棶棰樻棤娉曠户缁畬鎴�";
+ return objJsonResult;
+ }
+ }
+ }
+ else
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "璇烽�夋嫨姝g‘琛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ objJsonResult.code = CodeConstant.SUCCEED;
+ objJsonResult.count = CountConstant.SUCCEED;
+ objJsonResult.Message = "鎵ц鎴愬姛锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "椹冲洖搴斾粯鍗曞け璐ワ紒" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ #endregion
+
}
}
\ No newline at end of file
--
Gitblit v1.9.1