From 95911911e63210aacbfc78348094654fd51bea68 Mon Sep 17 00:00:00 2001 From: "boxu.zheng" Date: Mon, 29 Jul 2024 11:21:47 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=20=E5=AF=BC=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Balances/DTOs/BalanceDTO.cs | 77 +++++++++---------- .../Balances/DTOs/BalanceExportDTO.cs | 19 +++++ .../Balances/BalanceAppService.cs | 32 ++++++-- .../Balances/BalanceAutoMapperProfile.cs | 8 +- .../settings/appsettings.Development.json | 52 ++++++------- 5 files changed, 117 insertions(+), 71 deletions(-) create mode 100644 be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application.Contracts/Balances/DTOs/BalanceExportDTO.cs diff --git a/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application.Contracts/Balances/DTOs/BalanceDTO.cs b/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application.Contracts/Balances/DTOs/BalanceDTO.cs index 5dacfe229..f7787a9bf 100644 --- a/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application.Contracts/Balances/DTOs/BalanceDTO.cs +++ b/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application.Contracts/Balances/DTOs/BalanceDTO.cs @@ -7,7 +7,7 @@ using Win_in.Sfs.Shared.Domain.Shared; namespace Win_in.Sfs.Wms.Inventory.Application.Contracts; /// -/// 实体DTO +/// 实体DTO /// [Display(Name = "实体DTO")] public class BalanceDTO : SfsBasicDTOBase @@ -19,139 +19,140 @@ public class BalanceDTO : SfsBasicDTOBase , IHasPacking , IHasInventoryStatus { - /// - /// 箱标签 + /// 箱标签 /// [Display(Name = "箱标签")] [StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")] public string PackingCode { get; set; } /// - /// 物品名称 + /// 物品名称 /// [Display(Name = "物品名称")] public string ItemName { get; set; } + /// - /// 物品描述1 + /// 物品描述1 /// [Display(Name = "物品描述1")] public string ItemDesc1 { get; set; } + /// - /// 物品描述2 + /// 物品描述2 /// [Display(Name = "物品描述2")] public string ItemDesc2 { get; set; } /// - /// ERP料号 + /// ERP料号 /// [Display(Name = "ERP料号")] [StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")] public string ItemCode { get; set; } /// - /// 配置 + /// 配置 /// [Display(Name = "配置")] public string Configuration { get; set; } //供应商批次 /// - /// 供应商批次 + /// 供应商批次 /// [Display(Name = "供应商批次")] public string SupplierBatch { get; set; } //到货时间 /// - /// 到货时间 + /// 到货时间 /// [Display(Name = "到货时间")] public DateTime ArriveDate { get; set; } = DateTime.Now; /// - /// 生产时间 + /// 生产时间 /// [Display(Name = "生产时间")] public DateTime ProduceDate { get; set; } = DateTime.Now; /// - /// 过期时间 + /// 过期时间 /// [Display(Name = "过期时间")] public DateTime ExpireDate { get; set; } = DateTime.MaxValue; /// - /// 排序批次 + /// 排序批次 /// [Display(Name = "排序批次")] [StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")] public string Lot { get; set; } /// - /// 序号 + /// 序号 /// [Display(Name = "序号")] [StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")] public string SerialNumber { get; set; } /// - /// 计量单位 + /// 计量单位 /// [Display(Name = "计量单位")] public string Uom { get; set; } /// - /// 数量 + /// 数量 /// [Display(Name = "数量")] public decimal Qty { get; set; } /// - /// 标包数量 + /// 标包数量 /// [Display(Name = "标包数量")] public decimal StdPackQty { get; set; } /// - /// 状态 + /// 状态 /// [Display(Name = "状态")] public EnumInventoryStatus Status { get; set; } /// - /// 仓库代码 + /// 仓库代码 /// [Display(Name = "仓库代码")] public string WarehouseCode { get; set; } /// - /// 库位组 + /// 库位组 /// [Display(Name = "库位组")] public string LocationGroup { get; set; } /// - /// 库区 + /// 库区 /// [Display(Name = "库区")] public string LocationArea { get; set; } /// - /// ERP库位 + /// ERP库位 /// [Display(Name = "ERP库位")] public string LocationErpCode { get; set; } /// - /// 入库时间 + /// 入库时间 /// [Display(Name = "入库时间")] public DateTime PutInTime { get; set; } /// - /// 托盘标签 + /// 托盘标签 /// [Display(Name = "托盘标签")] [StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")] @@ -164,66 +165,64 @@ public class BalanceDTO : SfsBasicDTOBase // public DateTime ExpireDate { get; set; } /// - /// 最后盘点时间 + /// 最后盘点时间 /// [Display(Name = "最后盘点时间")] public DateTime LastCountTime { get; set; } /// - /// 最后盘点计划 + /// 最后盘点计划 /// [Display(Name = "最后盘点计划")] [StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")] public string LastCountPlanNumber { get; set; } /// - /// 最后盘点标签 + /// 最后盘点标签 /// [Display(Name = "最后盘点标签")] [StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")] public string LastCountLabel { get; set; } /// - /// 是否可用 + /// 是否可用 /// [Display(Name = "是否可用")] public bool IsActive { get; set; } /// - /// 库位代码 + /// 库位代码 /// [Display(Name = "库位代码")] public string LocationCode { get; set; } /// - /// 管理类型 + /// 管理类型 /// [Display(Name = "管理类型")] public EnumItemManageType ManageType { get; set; } /// - /// 最后事务类型 + /// 最后事务类型 /// [Display(Name = "最后事务类型")] public EnumTransType LastTransType { get; set; } /// - /// 最后事务号 + /// 最后事务号 /// [Display(Name = "最后事务号")] public string LastTransNumber { get; set; } + /// - /// 标准成本单价 + /// 标准成本单价 /// [Display(Name = "标准成本单价")] public decimal StdCostPrice { get; set; } + /// - /// 标准成本价格 + /// 标准成本价格 /// [Display(Name = "标准成本价格")] - public decimal StdCost - { - get { return StdCostPrice *Qty; } - - } + public decimal StdCost => StdCostPrice * Qty; } diff --git a/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application.Contracts/Balances/DTOs/BalanceExportDTO.cs b/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application.Contracts/Balances/DTOs/BalanceExportDTO.cs new file mode 100644 index 000000000..c7dd67c4e --- /dev/null +++ b/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application.Contracts/Balances/DTOs/BalanceExportDTO.cs @@ -0,0 +1,19 @@ +using System; +using System.ComponentModel.DataAnnotations; +using Win_in.Sfs.Shared.Domain; +using Win_in.Sfs.Shared.Domain.Shared; + +namespace Win_in.Sfs.Wms.Inventory.Application.Contracts; + +/// +/// 实体DTO +/// +[Display(Name = "实体DTO")] +public class BalanceExportDTO : BalanceDTO +{ + /// + /// ERP料号类型 + /// + [Display(Name = "ERP料号类型")] + public string Type { get; set; } +} diff --git a/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application/Balances/BalanceAppService.cs b/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application/Balances/BalanceAppService.cs index 6d8bcabee..751a5bb0c 100644 --- a/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application/Balances/BalanceAppService.cs +++ b/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application/Balances/BalanceAppService.cs @@ -954,19 +954,41 @@ public class BalanceAppService : p => true; var entities = await _repository.GetPagedListAsync(expression, input.SkipCount, input.MaxResultCount, input.Sorting, true).ConfigureAwait(false); - var list = ObjectMapper.Map, List>(entities); - //var hasDetails = typeof(TEntity) is SfsMasterAggregateRootBase detailEntity; - var tt = typeof(Balance).GetBaseClasses(typeof(SfsMasterAggregateRootBase)); + var list = ObjectMapper.Map, List>(entities); + + //var hasDetails = typeof(TEntity) is SfsMasterAggregateRootBase detailEntity; + var tt = typeof(Balance).GetBaseClasses(typeof(SfsMasterAggregateRootBase)); var hasDetails = tt.Length > 0 ? true : false; if (list.Count > 0) { var itemCodes = list.Select(t => t.ItemCode).Distinct(); var itemBasicDtos = await _itemBasicAppService.GetByCodesWithPostAsync(itemCodes).ConfigureAwait(false); - if (itemBasicDtos.Count > 0) + if (itemBasicDtos.Any()) { list.ForEach(item => { - item.Configuration = itemBasicDtos.FirstOrDefault(t => t.Code == item.ItemCode)?.Configuration; + var itembaseDto=itemBasicDtos.FirstOrDefault(t => t.Code == item.ItemCode); + item.Configuration = itembaseDto.Configuration; + + //10C01成品、10C02原料、10C03物料、10C04半成品 + switch (itembaseDto.Type) + { + case "10C01": + item.Type = "成品"; + break; + case "10C02": + item.Type = "原料"; + break; + case "10C03": + item.Type = "物料"; + break; + case "10C04": + item.Type = "半成品"; + break; + default: + item.Type = "未知类型"; + break; + } }); } } diff --git a/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application/Balances/BalanceAutoMapperProfile.cs b/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application/Balances/BalanceAutoMapperProfile.cs index 68722ee3e..59214ecd1 100644 --- a/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application/Balances/BalanceAutoMapperProfile.cs +++ b/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application/Balances/BalanceAutoMapperProfile.cs @@ -34,6 +34,12 @@ public partial class InventoryApplicationAutoMapperProfile : Profile CreateMap() .Ignore(x => x.JobNumber) .Ignore(x => x.Worker); - + + CreateMap() + .Ignore(x => x.Configuration) + .Ignore(x => x.StdCostPrice) + .Ignore(x => x.StdCost) + .Ignore(x => x.Type); + } } diff --git a/build/src/docker/publish/conf/settings/appsettings.Development.json b/build/src/docker/publish/conf/settings/appsettings.Development.json index 1e52bd5d8..15909dbdf 100644 --- a/build/src/docker/publish/conf/settings/appsettings.Development.json +++ b/build/src/docker/publish/conf/settings/appsettings.Development.json @@ -61,7 +61,7 @@ }, "AuthServer": { "Audience": "Auth", - "Authority": "http://dev.ccwin-in.com:60083/", + "Authority": "http://10.164.233.5:60083/", //"Authority": "http://localhost:59093/", "ClientId": "Auth_App", "ClientSecret": "1q2w3E*", @@ -91,28 +91,28 @@ // "Store": "Server=localhost,21195;Database=Wms;Uid=sa;Pwd=aA123456!;timeout=6000;" // }, "ConnectionStrings": { - "AbpAuditLogging": "Server=dev.ccwin-in.com,13319;Database=WMS_DongYang_Main_CC;uid=ccwin-in;pwd=Microsoft@2022;timeout=6000;", - "AbpBackgroundJobs": "Server=dev.ccwin-in.com,13319;Database=WMS_DongYang_Main_CC;uid=ccwin-in;pwd=Microsoft@2022;timeout=6000;", - "AbpBlobStoring": "Server=dev.ccwin-in.com,13319;Database=WMS_DongYang_Main_CC;uid=ccwin-in;pwd=Microsoft@2022;timeout=6000;", - "AbpFeatureManagement": "Server=dev.ccwin-in.com,13319;Database=WMS_DongYang_Main_CC;uid=ccwin-in;pwd=Microsoft@2022;timeout=6000;", - "AbpIdentity": "Server=dev.ccwin-in.com,13319;Database=WMS_DongYang_Main_CC;uid=ccwin-in;pwd=Microsoft@2022;timeout=6000;", - "AbpIdentityServer": "Server=dev.ccwin-in.com,13319;Database=WMS_DongYang_Main_CC;uid=ccwin-in;pwd=Microsoft@2022;timeout=6000;", - "AbpPermissionManagement": "Server=dev.ccwin-in.com,13319;Database=WMS_DongYang_Main_CC;uid=ccwin-in;pwd=Microsoft@2022;timeout=6000;", - "AbpSettingManagement": "Server=dev.ccwin-in.com,13319;Database=WMS_DongYang_Main_CC;uid=ccwin-in;pwd=Microsoft@2022;timeout=6000;", - "AbpTenantManagement": "Server=dev.ccwin-in.com,13319;Database=WMS_DongYang_Main_CC;uid=ccwin-in;pwd=Microsoft@2022;timeout=6000;", - "Auth": "Server=dev.ccwin-in.com,13319;Database=WMS_DongYang_Main_CC;uid=ccwin-in;pwd=Microsoft@2022;timeout=6000;", - "Basedata": "Server=dev.ccwin-in.com,13319;Database=WMS_DongYang_Main_CC;uid=ccwin-in;pwd=Microsoft@2022;timeout=6000;", - "DataExchange": "Server=dev.ccwin-in.com,13319;Database=WMS_DongYang_Main_CC;uid=ccwin-in;pwd=Microsoft@2022;timeout=6000;", - "FileStorage": "Server=dev.ccwin-in.com,13319;Database=WMS_DongYang_Main_CC;uid=ccwin-in;pwd=Microsoft@2022;timeout=6000;", - "Inventory": "Server=dev.ccwin-in.com,13319;Database=WMS_DongYang_Main_CC;uid=ccwin-in;pwd=Microsoft@2022;timeout=6000;", - "Job": "Server=dev.ccwin-in.com,13319;Database=WMS_DongYang_Main_CC;uid=ccwin-in;pwd=Microsoft@2022;timeout=6000;", - "Label": "Server=dev.ccwin-in.com,13319;Database=WMS_DongYang_Main_CC;uid=ccwin-in;pwd=Microsoft@2022;timeout=6000;", - "Message": "Server=dev.ccwin-in.com,13319;Database=WMS_DongYang_Main_CC;uid=ccwin-in;pwd=Microsoft@2022;timeout=6000;", - "Store": "Server=dev.ccwin-in.com,13319;Database=WMS_DongYang_Main_CC;uid=ccwin-in;pwd=Microsoft@2022;timeout=6000;" + "AbpAuditLogging": "Server=10.164.233.6;Database=WMS_DongYang_Main_CC;uid=ccwin-in;pwd=Microsoft@2022;timeout=6000;", + "AbpBackgroundJobs": "Server=10.164.233.6;Database=WMS_DongYang_Main_CC;uid=ccwin-in;pwd=Microsoft@2022;timeout=6000;", + "AbpBlobStoring": "Server=10.164.233.6;Database=WMS_DongYang_Main_CC;uid=ccwin-in;pwd=Microsoft@2022;timeout=6000;", + "AbpFeatureManagement": "Server=10.164.233.6;Database=WMS_DongYang_Main_CC;uid=ccwin-in;pwd=Microsoft@2022;timeout=6000;", + "AbpIdentity": "Server=10.164.233.6;Database=WMS_DongYang_Main_CC;uid=ccwin-in;pwd=Microsoft@2022;timeout=6000;", + "AbpIdentityServer": "Server=10.164.233.6;Database=WMS_DongYang_Main_CC;uid=ccwin-in;pwd=Microsoft@2022;timeout=6000;", + "AbpPermissionManagement": "Server=10.164.233.6;Database=WMS_DongYang_Main_CC;uid=ccwin-in;pwd=Microsoft@2022;timeout=6000;", + "AbpSettingManagement": "Server=10.164.233.6;Database=WMS_DongYang_Main_CC;uid=ccwin-in;pwd=Microsoft@2022;timeout=6000;", + "AbpTenantManagement": "Server=10.164.233.6;Database=WMS_DongYang_Main_CC;uid=ccwin-in;pwd=Microsoft@2022;timeout=6000;", + "Auth": "Server=10.164.233.6;Database=WMS_DongYang_Main_CC;uid=ccwin-in;pwd=Microsoft@2022;timeout=6000;", + "Basedata": "Server=10.164.233.6;Database=WMS_DongYang_Main_CC;uid=ccwin-in;pwd=Microsoft@2022;timeout=6000;", + "DataExchange": "Server=10.164.233.6;Database=WMS_DongYang_Main_CC;uid=ccwin-in;pwd=Microsoft@2022;timeout=6000;", + "FileStorage": "Server=10.164.233.6;Database=WMS_DongYang_Main_CC;uid=ccwin-in;pwd=Microsoft@2022;timeout=6000;", + "Inventory": "Server=10.164.233.6;Database=WMS_DongYang_Main_CC;uid=ccwin-in;pwd=Microsoft@2022;timeout=6000;", + "Job": "Server=10.164.233.6;Database=WMS_DongYang_Main_CC;uid=ccwin-in;pwd=Microsoft@2022;timeout=6000;", + "Label": "Server=10.164.233.6;Database=WMS_DongYang_Main_CC;uid=ccwin-in;pwd=Microsoft@2022;timeout=6000;", + "Message": "Server=10.164.233.6;Database=WMS_DongYang_Main_CC;uid=ccwin-in;pwd=Microsoft@2022;timeout=6000;", + "Store": "Server=10.164.233.6;Database=WMS_DongYang_Main_CC;uid=ccwin-in;pwd=Microsoft@2022;timeout=6000;" }, "IdentityClients": { "Default": { - "Authority": "http://dev.ccwin-in.com:60083", + "Authority": "http://10.164.233.5:60083", //"Authority": "http://localhost:59093", "ClientId": "Auth_App", "ClientSecret": "1q2w3E*", @@ -129,19 +129,19 @@ }, "RemoteServices": { "Auth": { - "BaseUrl": "http://dev.ccwin-in.com:60083/" + "BaseUrl": "http://10.164.233.5:60083/" //"BaseUrl": "http://localhost:59093/" }, "BaseData": { - //"BaseUrl": "http://dev.ccwin-in.com:60084/" + //"BaseUrl": "http://10.164.233.5:60084/" "BaseUrl": "http://localhost:59094/" }, "Default": { - "BaseUrl": "http://dev.ccwin-in.com:60083/" + "BaseUrl": "http://10.164.233.5:60083/" //"BaseUrl": "http://localhost:59093/" }, "FileStorage": { - "BaseUrl": "http://dev.ccwin-in.com:60082/" + "BaseUrl": "http://10.164.233.5:60082/" //"BaseUrl": "http://localhost:59092/" }, "Inventory": { @@ -151,11 +151,11 @@ "BaseUrl": "http://localhost:59095/" }, "Label": { - "BaseUrl": "http://dev.ccwin-in.com:60082/" + "BaseUrl": "http://10.164.233.5:60082/" //"BaseUrl": "http://localhost:59092/" }, "Message": { - "BaseUrl": "http://dev.ccwin-in.com:60082/" + "BaseUrl": "http://10.164.233.5:60082/" //"BaseUrl": "http://localhost:59092/" }, "Store": {