From 7cce3c1dbda47d04067ab78a6eebcdbbca9ba246 Mon Sep 17 00:00:00 2001
From: zrg <z18737863051@163.com>
Date: 星期五, 28 二月 2025 09:21:08 +0800
Subject: [PATCH] 1
---
WebAPI/Controllers/CGGL/Cg_POOrderBillController.cs | 160 +++++++++++++++++++++++++++++++++++++++++++++++++---
1 files changed, 149 insertions(+), 11 deletions(-)
diff --git a/WebAPI/Controllers/CGGL/Cg_POOrderBillController.cs b/WebAPI/Controllers/CGGL/Cg_POOrderBillController.cs
index ba14fd5..0db6ff1 100644
--- a/WebAPI/Controllers/CGGL/Cg_POOrderBillController.cs
+++ b/WebAPI/Controllers/CGGL/Cg_POOrderBillController.cs
@@ -25,7 +25,70 @@
SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
DataSet ds;
- /// <summary>
+ #region 閲囪喘璁㈠崟鍒嗛〉鍒楄〃
+ [Route("Cg_POOrderBill/page")]
+ [HttpGet]
+ public object Cg_POOrderBillPage(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("Cg_POOrderBillList", 3, false, user))
+ {
+ objJsonResult.code = CodeConstant.FAIL;
+ objJsonResult.count = CountConstant.FAIL;
+ objJsonResult.Message = "鎮ㄦ病鏈夎妯″潡鏉冮檺,璇蜂笌绠$悊鍛樿仈绯伙紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ //鍒ゆ柇鏄惁鏈夐噰璐粡鐞嗘潈闄愶紙瀹夌憺锛�
+ bool isCgjl = Security_Log("Cg_POOrderBill_PurchasManager", 1, true, user);
+ if (!isCgjl)
+ {
+ sWhere += $" and HEmpID in (select HEmpID from Gy_Czygl where Czymc='{user}' and HEmpID >0 )";
+ }
+
+
+ sWhere = sWhere.Replace("'", "''");
+ if (sWhere == null || sWhere.Equals(""))
+ {
+ ds = oCN.RunProcReturn("exec h_p_IF_POOrderBillList " + page + "," + size + ",''", "h_p_IF_POOrderBillList");
+ }
+ else
+ {
+ ds = oCN.RunProcReturn("exec h_p_IF_POOrderBillList " + page + "," + size + ",'" + sWhere + "'", "h_p_IF_POOrderBillList");
+ }
+
+ //娣诲姞鍒楀悕
+ 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
+
+ /// <summary>
/// 杩斿洖閲囪喘璁㈠崟鍒楄〃
///鍙傛暟锛歴tring sql銆�
///杩斿洖鍊硷細object銆�
@@ -979,14 +1042,14 @@
long HBUYERWITHHOLDING = DetailColl2[i].HBUYERWITHHOLDING;//涔版柟浠f墸浠g即
string HMATERIALDESC = DetailColl2[i].HMATERIALDESC == null ? "''" : DetailColl2[i].HMATERIALDESC; //鐗╂枡璇存槑
i++;
- if (oSub.HQty <= 0 || oSub.HQty == 0)
- {
- objJsonResult.code = "0";
- objJsonResult.count = 0;
- objJsonResult.Message = "绗�" + i + "琛岋紝鏁伴噺涓嶈兘涓�0鎴栬�呭皬浜�0";
- objJsonResult.data = null;
- return objJsonResult;
- }
+ //if (oSub.HQty <= 0 || oSub.HQty == 0)
+ //{
+ // objJsonResult.code = "0";
+ // objJsonResult.count = 0;
+ // objJsonResult.Message = "绗�" + i + "琛岋紝鏁伴噺涓嶈兘涓�0鎴栬�呭皬浜�0";
+ // objJsonResult.data = null;
+ // return objJsonResult;
+ //}
if (oSub.HMaterID == 0)
{
@@ -1275,7 +1338,7 @@
try
{
- ds = oCN.RunProcReturn("select * from h_v_IF_POOrderBillList where hmainid =" + HInterID, "h_v_IF_POOrderBillList");
+ ds = oCN.RunProcReturn("select * from h_v_IF_POOrderBillEdit where hmainid =" + HInterID, "h_v_IF_POOrderBillList");
if (ds == null || ds.Tables[0].Rows.Count == 0)
{
objJsonResult.code = "0";
@@ -3054,7 +3117,7 @@
}
string sql = "select * from h_v_Cg_POOrderBillQuerySub where hmainid = "+ hmainid;
- ds = oCN.RunProcReturn(sql + " order by hsubid desc", "h_v_Cg_POOrderBillQuerySub");
+ ds = oCN.RunProcReturn(sql + " order by hsubid ASC", "h_v_Cg_POOrderBillQuerySub");
foreach (DataColumn col in ds.Tables[0].Columns)
@@ -3139,6 +3202,81 @@
}
}
#endregion
+
+ #region 鍑哄簱姹囨�� 鏌ヨ
+ [Route("Xs_SeOrderOutStockSumReport/Xs_SeOrderOutStockSumReportList")]
+ [HttpGet]
+ public object Xs_SeOrderOutStockSumReportList(string sWhere)
+ {
+ try
+ {
+ //鍙嶅簭鍒楀寲浼犻�掔殑鍊�
+
+ ds = oCN.RunProcReturn($"exec h_p_Xs_SeOrderOutStockSumReport " + sWhere + "", "h_p_Xs_SeOrderOutStockSumReport");
+
+ List<object> listCol = new List<object>();
+ foreach (DataColumn col in ds.Tables[0].Columns)
+ {
+ Type dataType = col.DataType;
+ string str = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
+ listCol.Add(JsonConvert.DeserializeObject(str));
+ }
+
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "Sucess锛�";
+ objJsonResult.data = ds.Tables[0];
+ objJsonResult.list = listCol;
+ 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_PoOrderInStockSumReport/Cg_PoOrderInStockSumReportList")]
+ [HttpGet]
+ public object Cg_PoOrderInStockSumReportList(string sWhere)
+ {
+ try
+ {
+ //鍙嶅簭鍒楀寲浼犻�掔殑鍊�
+
+ ds = oCN.RunProcReturn($"exec h_p_Cg_PoOrderInStockSumReport " + sWhere + "", "h_p_Cg_PoOrderInStockSumReport");
+
+ List<object> listCol = new List<object>();
+ foreach (DataColumn col in ds.Tables[0].Columns)
+ {
+ Type dataType = col.DataType;
+ string str = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
+ listCol.Add(JsonConvert.DeserializeObject(str));
+ }
+
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "Sucess锛�";
+ objJsonResult.data = ds.Tables[0];
+ objJsonResult.list = listCol;
+ 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