From ae598a1b65ad844e70689ea86575c77bd3859a38 Mon Sep 17 00:00:00 2001 From: zhangli <1109134334@qq.com> Date: Fri, 5 Nov 2021 09:40:32 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B5=84=E4=BA=A7=E6=98=8E=E7=BB=86=E5=AF=BC?= =?UTF-8?q?=E5=87=BA=E5=8A=A0=E8=B5=84=E4=BA=A7=E5=88=86=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Ass_AssetsInfoItemController.cs | 8 +++++++ .../Ass_AssetsInfoItemService.cs | 2 +- .../Ass_AssetsType/Ass_AssetsTypeBLL.cs | 19 +++++++++++++++ .../Ass_AssetsType/Ass_AssetsTypeIBLL.cs | 1 + .../Ass_AssetsType/Ass_AssetsTypeService.cs | 23 +++++++++++++++++++ 5 files changed, 52 insertions(+), 1 deletion(-) diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Controllers/Ass_AssetsInfoItemController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Controllers/Ass_AssetsInfoItemController.cs index 642a58260..43b23698c 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Controllers/Ass_AssetsInfoItemController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Controllers/Ass_AssetsInfoItemController.cs @@ -24,6 +24,7 @@ namespace Learun.Application.Web.Areas.AssetManagementSystem.Controllers private DataSourceIBLL dataSourceIBLL = new DataSourceBLL(); private DepartmentIBLL departmentIBLL = new DepartmentBLL(); private UserIBLL userIBLL = new UserBLL(); + private Ass_AssetsTypeIBLL ass_AssetsTypeIBLL = new Ass_AssetsTypeBLL(); #region 视图功能 @@ -118,6 +119,7 @@ namespace Learun.Application.Web.Areas.AssetManagementSystem.Controllers var dataItem_AssState = dataItemIBLL.GetDetailList("AssState"); var departmentList = departmentIBLL.GetAllList(); var userList = userIBLL.GetAllList(); + var ass_AssetsTypeList = ass_AssetsTypeIBLL.GetAllList(); var dataSourceEntity = dataSourceIBLL.GetEntityByCode("BaseUser"); for (int i = 0; i < exportTable.Rows.Count; i++) { @@ -152,6 +154,11 @@ namespace Learun.Application.Web.Areas.AssetManagementSystem.Controllers { exportTable.Rows[i]["AIUsePeople"] = userList.Where(x=>x.F_UserId== AIUsePeople.ToString()).FirstOrDefault()?.F_RealName; } + var AIASSClass = exportTable.Rows[i]["AIASSClass"]; + if (AIASSClass != null && !string.IsNullOrEmpty(AIASSClass.ToString())) + { + exportTable.Rows[i]["AIASSClass"] = ass_AssetsTypeList.Where(x => x.ATId == AIASSClass.ToString()).FirstOrDefault()?.AName; + } } departmentList = null; @@ -171,6 +178,7 @@ namespace Learun.Application.Web.Areas.AssetManagementSystem.Controllers excelconfig.ColumnEntity.Add(new ColumnModel() { Column = "rarea", ExcelColumn = "房间面积" }); excelconfig.ColumnEntity.Add(new ColumnModel() { Column = "renabledname", ExcelColumn = "房间状态" }); excelconfig.ColumnEntity.Add(new ColumnModel() { Column = "aiassname", ExcelColumn = "资产名称" }); + excelconfig.ColumnEntity.Add(new ColumnModel() { Column = "aiassclass", ExcelColumn = "资产分类" }); excelconfig.ColumnEntity.Add(new ColumnModel() { Column = "aispecification", ExcelColumn = "资产品牌" }); excelconfig.ColumnEntity.Add(new ColumnModel() { Column = "aispecificationtype", ExcelColumn = "规格型号" }); excelconfig.ColumnEntity.Add(new ColumnModel() { Column = "aiunits", ExcelColumn = "计量单位" }); diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/AssetManagementSystem/Ass_AssetsInfoItem/Ass_AssetsInfoItemService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/AssetManagementSystem/Ass_AssetsInfoItem/Ass_AssetsInfoItemService.cs index 1f0b41996..1b4ed5639 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/AssetManagementSystem/Ass_AssetsInfoItem/Ass_AssetsInfoItemService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/AssetManagementSystem/Ass_AssetsInfoItem/Ass_AssetsInfoItemService.cs @@ -170,7 +170,7 @@ namespace Learun.Application.TwoDevelopment.AssetManagementSystem try { var strSql = new StringBuilder(); - strSql.Append(@"SELECT t.AICodeNumJY ,storage.sname as AIIStorageName,room.rcode,room.RFunction,room.RArea,'' as REnabledName,t.AIASSName,t.AISpecification, t.AISpecificationtype, t.AIUnits, '' as AIASSStateName,t.AIDepartment, t.AIUsePeople, AIPlace, AIAssValue,AIAddTime, AIRemark, DepreciationMethod, DepreciationStatus, UsefulLife, MonthlyDepreciation, MonthsOfDepreciation, MonthlyDepreciationRate, + strSql.Append(@"SELECT t.AICodeNumJY ,storage.sname as AIIStorageName,room.rcode,room.RFunction,room.RArea,'' as REnabledName,t.AIASSName,t.AIASSClass,t.AISpecification, t.AISpecificationtype, t.AIUnits, '' as AIASSStateName,t.AIDepartment, t.AIUsePeople, AIPlace, AIAssValue,AIAddTime, AIRemark, DepreciationMethod, DepreciationStatus, UsefulLife, MonthlyDepreciation, MonthsOfDepreciation, MonthlyDepreciationRate, AccumulatedDepreciation, NetWorth, VehicleLicenseUser, AIVehicleNumber, AIPlateNumber, AIBuiltArea, AIOwnership, LandUseType, LandUseUser,room.REnabled,t.AIASSState "); strSql.Append(" FROM Ass_AssetsInfoItem t "); diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/AssetManagementSystem/Ass_AssetsType/Ass_AssetsTypeBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/AssetManagementSystem/Ass_AssetsType/Ass_AssetsTypeBLL.cs index 67413f570..a8d908b61 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/AssetManagementSystem/Ass_AssetsType/Ass_AssetsTypeBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/AssetManagementSystem/Ass_AssetsType/Ass_AssetsTypeBLL.cs @@ -160,6 +160,25 @@ namespace Learun.Application.TwoDevelopment.AssetManagementSystem } } } + + public IEnumerable GetAllList() + { + try + { + return ass_AssetsTypeService.GetAllList(); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } /// /// 获取树形数据 diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/AssetManagementSystem/Ass_AssetsType/Ass_AssetsTypeIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/AssetManagementSystem/Ass_AssetsType/Ass_AssetsTypeIBLL.cs index 2edc19880..43f39739a 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/AssetManagementSystem/Ass_AssetsType/Ass_AssetsTypeIBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/AssetManagementSystem/Ass_AssetsType/Ass_AssetsTypeIBLL.cs @@ -53,6 +53,7 @@ namespace Learun.Application.TwoDevelopment.AssetManagementSystem #endregion IEnumerable GetList(string queryJson); + IEnumerable GetAllList(); void Lock(string keyValue); void UnLock(string keyValue); IEnumerable GetTree(IEnumerable typelist); diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/AssetManagementSystem/Ass_AssetsType/Ass_AssetsTypeService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/AssetManagementSystem/Ass_AssetsType/Ass_AssetsTypeService.cs index f4a54752e..d96417dbc 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/AssetManagementSystem/Ass_AssetsType/Ass_AssetsTypeService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/AssetManagementSystem/Ass_AssetsType/Ass_AssetsTypeService.cs @@ -213,6 +213,29 @@ namespace Learun.Application.TwoDevelopment.AssetManagementSystem return this.BaseRepository().FindList(strSql.ToString(), dp); } + public IEnumerable GetAllList() + { + var strSql = new StringBuilder(); + strSql.Append("SELECT "); + strSql.Append(@" + t.ATId, + t.ATCode, + t.AName, + t.ATPTId, + t.ATEName, + t.ATOrder, + t.ATCheckMark + "); + strSql.Append(" FROM Ass_AssetsType t "); + strSql.Append(" WHERE 1=1 "); + + // 虚拟参数 + var dp = new DynamicParameters(new { }); + + strSql.Append(" order by ATOrder "); + return this.BaseRepository().FindList(strSql.ToString(), dp); + } + public void Lock(string keyValue) { try