From 82de67c48acaf472a6f8bb8b53f3f4feec9f5e54 Mon Sep 17 00:00:00 2001
From: zrg <z1873@LAPTOP-EAVL132E>
Date: 星期五, 17 十月 2025 10:42:18 +0800
Subject: [PATCH] 1
---
WebAPI/Controllers/XSGL/Xs_ReceivableBillController.cs | 94 ++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 93 insertions(+), 1 deletions(-)
diff --git a/WebAPI/Controllers/XSGL/Xs_ReceivableBillController.cs b/WebAPI/Controllers/XSGL/Xs_ReceivableBillController.cs
index bf7fca2..d20866a 100644
--- a/WebAPI/Controllers/XSGL/Xs_ReceivableBillController.cs
+++ b/WebAPI/Controllers/XSGL/Xs_ReceivableBillController.cs
@@ -25,6 +25,38 @@
SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
DataSet ds;
+ #region 搴旀敹鍗曞垪琛� 鏍规嵁鍗曚环绫诲瀷鑾峰彇鐗╂枡鍗曞嚮
+ /// <summary>
+ /// 杩斿洖搴旀敹鍗曞垪琛�
+ ///鍙傛暟锛歴tring sql銆�
+ ///杩斿洖鍊硷細object銆�
+ /// </summary>
+ [Route("Xs_ReceivableBill/getPriceByType")]
+ [HttpGet]
+ public object getPriceByType(string HMaterID, string HType)
+ {
+ try
+ {
+ string sql1 = "exec h_p_Xs_ReceivableBill_getPriceByType " + HMaterID + ",'" + HType + "'";
+ ds = oCN.RunProcReturn(sql1, "h_p_Xs_ReceivableBill_getPriceByType");
+
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "Sucess锛�";
+ objJsonResult.data = ds.Tables[0].Rows[0]["HPrice"].ToString();
+ return objJsonResult;
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "Exception锛�" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ #endregion
+
#region 搴旀敹鍗曞垪琛� 鏌ヨ
/// <summary>
/// 杩斿洖搴旀敹鍗曞垪琛�
@@ -72,6 +104,66 @@
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 搴旀敹鍗曞垪琛� 鏌ヨ-鍒嗛〉
+ /// <summary>
+ /// 杩斿洖搴旀敹鍗曞垪琛�
+ ///鍙傛暟锛歴tring sql銆�
+ ///杩斿洖鍊硷細object銆�
+ /// </summary>
+ [Route("Xs_ReceivableBill/list_byPage")]
+ [HttpGet]
+ public object getXs_ReceivableBill_byPage(string sWhere, string user, string Organization, int page, int size)
+ {
+ try
+ {
+ List<object> columnNameList = new List<object>();
+ //鏌ョ湅鏉冮檺
+ if (!DBUtility.ClsPub.Security_Log("Xs_ReceivableBill_Query", 1, false, user))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鏃犳煡鐪嬫潈闄愶紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ sWhere = sWhere.Replace("'", "''");
+
+ if (sWhere == null || sWhere.Equals(""))
+ {
+ ds = oCN.RunProcReturn("exec h_p_Xs_ReceivableBillList_Query " + page + "," + size + ",'" + Organization + "'," + "''", "h_p_Xs_ReceivableBillList_Query");
+ }
+ else
+ {
+ ds = oCN.RunProcReturn("exec h_p_Xs_ReceivableBillList_Query " + page + "," + size + ",'" + Organization + "','" + sWhere + "'", "h_p_Xs_ReceivableBillList_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 = "1";
+ objJsonResult.count = int.Parse(ds.Tables[1].Rows[0]["count"].ToString());
+ objJsonResult.Message = "Sucess锛�";
+ objJsonResult.list = columnNameList;
+ objJsonResult.data = ds.Tables[0];
return objJsonResult;
}
catch (Exception e)
@@ -1608,7 +1700,7 @@
}
string sql = "select * from h_v_Xs_ReceivableBillQuerySub where hmainid = " + hmainid;
- ds = oCN.RunProcReturn(sql + " order by hsubid desc", "h_v_Xs_ReceivableBillQuerySub");
+ ds = oCN.RunProcReturn(sql + " order by hsubid ASC", "h_v_Xs_ReceivableBillQuerySub");
foreach (DataColumn col in ds.Tables[0].Columns)
--
Gitblit v1.9.1