From 0eb5c267746a773fad80398dd935fed67bba8b5a Mon Sep 17 00:00:00 2001
From: 快乐的昕的电脑 <快乐的昕的电脑@DESKTOP-C2BQPQU>
Date: 星期六, 13 十二月 2025 14:36:36 +0800
Subject: [PATCH] 物料单位换算信息前端显示
---
WebApi/Gs.BaseInfo/Services/UnitMatrixing.cs | 89 ++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 89 insertions(+), 0 deletions(-)
diff --git a/WebApi/Gs.BaseInfo/Services/UnitMatrixing.cs b/WebApi/Gs.BaseInfo/Services/UnitMatrixing.cs
new file mode 100644
index 0000000..1c1eb27
--- /dev/null
+++ b/WebApi/Gs.BaseInfo/Services/UnitMatrixing.cs
@@ -0,0 +1,89 @@
+锘縰sing System.Data;
+using System.Data.SqlClient;
+using Gs.Toolbox;
+using Gs.Toolbox.ApiCore.Abstract.Mvc;
+using Gs.Toolbox.ApiCore.Common.Mvc;
+using Gs.Toolbox.ApiCore.Group;
+using Microsoft.AspNetCore.Http;
+using Microsoft.AspNetCore.Mvc;
+using static Gs.Toolbox.UtilityHelper;
+
+
+namespace Gs.Report
+{
+
+ [ApiGroup(ApiGroupNames.Report)]
+ public class UnitMatrixing : IRomteService
+ {
+ private readonly IHttpContextAccessor _http;
+ private readonly string _userCode, _userGuid, _orgFids;
+
+ public UnitMatrixing(IHttpContextAccessor httpContextAccessor)
+ {
+ _http = httpContextAccessor;
+ (_userCode, _userGuid, _orgFids) =
+ GetUserGuidAndOrgGuid(_http);
+ }
+
+ /// <summary>
+ /// 鐗╂枡鍗曚綅鎹㈢畻淇℃伅
+ /// </summary>
+ /// <param name="model"></param>
+ /// <returns></returns>
+ [RequestMethod(RequestMethods.POST)]
+ public ReturnDto<PageList<dynamic>> GetListPage([FromBody] dynamic model)
+ {
+ int currentPage = model.currentPage;
+ int everyPageSize = model.everyPageSize;
+ string sortName = model.sortName;
+ string keyWhere = model.keyWhere;
+ SqlParameter[] parameters =
+ {
+ new("@inCurrentPage", currentPage),//
+ new("@inEveryPageSize", everyPageSize),
+ new("@inSortName", sortName),
+ new("@inSortOrder", ""),
+ new("@inQueryWhere", keyWhere),
+ new("@inFid", ""),
+ new("@inP1", ""),
+ new("@inP2", ""),
+ new("@inP3", ""),
+ new("@inP4", "")
+ };
+ var dset = new DataSet();
+ var _pglist = new PageList<dynamic>
+ {
+ total = 0,
+ everyPageSize = 0,
+ pages = 0,
+ list = new List<dynamic>()
+ };
+ try
+ {
+ dset = DbHelperSQL.RunProcedure("UnitMatrixing", parameters, "0");
+ if (dset != null && dset.Tables.Count > 0 &&
+ dset.Tables[0].Rows.Count > 0) //鏈夋暟鎹�
+ {
+ var intTotal =
+ int.Parse(dset.Tables[1].Rows[0]["intTotal"].ToString());
+ var pages = intTotal % everyPageSize != 0
+ ? intTotal / everyPageSize + 1
+ : intTotal / everyPageSize;
+ _pglist.total = intTotal;
+ _pglist.everyPageSize = everyPageSize;
+ _pglist.pages = pages;
+ var _dy = dset.Tables[0].TableToDynamicList();
+ _pglist.list = _dy;
+ }
+ }
+ catch (Exception ex)
+ {
+ LogHelper.Debug(ToString(), ex.Message);
+ }
+
+ return ReturnDto<PageList<dynamic>>.QuickReturn(_pglist,
+ ReturnCode.Success, "璇诲彇鎴愬姛");
+ }
+ }
+}
+
--
Gitblit v1.9.3