diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Prices/PriceListDtoBase.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Prices/PriceListDtoBase.cs index 4593c59b..9acb82ea 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Prices/PriceListDtoBase.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Prices/PriceListDtoBase.cs @@ -289,8 +289,107 @@ namespace Win.Sfs.SettleAccount.Entities.Prices public virtual List Filters { get; set; } = new List(); } + /// + /// 列表 + /// + public class TB_PRICE_LISTDto : AuditedEntityDto + { + /// + /// 零件号 + /// + [Display(Name = "零件号")] + public string LU { get; set; } + /// + /// 价格 + /// + [Display(Name = "价格")] + public Decimal Price { set; get; } + /// + /// 开始时间 + /// + [Display(Name = "开始时间")] + public DateTime BeginTime { set; get; } + + /// + /// 结束时间 + /// + [Display(Name = "结束时间")] + public DateTime EndTime { set; get; } + + /// + /// 客户编码 + /// + [Display(Name = "客户编码")] + public string ClientCode { get; set; } + + /// + /// 业务类别 + /// + [Display(Name = "业务类别")] + public string BusinessType { get; set; } + + /// + /// 版本 + /// + [Display(Name = "版本")] + public string Version { set; get; } + } + + /// + /// 列表请求 + /// + public class TB_PRICE_LIST_RequestDto : PagedAndSortedResultRequestDto + { + /// + /// 零件号 + /// + [Display(Name = "零件号")] + public string LU { get; set; } + + /// + /// 价格 + /// + [Display(Name = "价格")] + public Decimal Price { set; get; } + + /// + /// 开始时间 + /// + [Display(Name = "开始时间")] + public DateTime BeginTime { set; get; } + + /// + /// 结束时间 + /// + [Display(Name = "结束时间")] + public DateTime EndTime { set; get; } + + /// + /// 客户编码 + /// + [Display(Name = "客户编码")] + public string ClientCode { get; set; } + + /// + /// 业务类别 + /// + [Display(Name = "业务类别")] + public string BusinessType { get; set; } + + /// + /// 版本 + /// + [Display(Name = "版本")] + public string Version { set; get; } + + /// + /// 高级检索 + /// + [Display(Name = "高级检索")] + public virtual List Filters { get; set; } = new List(); + } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Prices/PriceListAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Prices/PriceListAppService.cs new file mode 100644 index 00000000..dceb40f0 --- /dev/null +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Prices/PriceListAppService.cs @@ -0,0 +1,41 @@ +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Volo.Abp.Application.Services; +using Win.Sfs.BaseData.ImportExcelCommon; +using Win.Sfs.SettleAccount.Entities.ImportMap; +using Win.Sfs.SettleAccount.Entities.Prices; +using Win.Sfs.SettleAccount.Entities.TaskJobs; + +namespace Win.Sfs.SettleAccount.Entities.BQ.Prices +{ + /// + /// 标准价格单-相关应用服务 + /// + [Authorize(SettleAccountPermissions.PriceLists.Default)] + [Route("api/SettleAccount/TB_PRICE_LIST_Service")] + public class PriceListAppService : ApplicationService + { + private readonly PriceListManager _mng; + private readonly IExcelImportAppService _excelImportService; + private readonly ISettleAccountBranchEfCoreRepository _mapRepository; + private readonly TaskJobService _service; + public PriceListAppService( + IExcelImportAppService excelImportService, + ISettleAccountBranchEfCoreRepository mapRepository, + PriceListManager mng, + TaskJobService service + ) + { + _mapRepository = mapRepository; + _excelImportService = excelImportService; + _mng = mng; + _service = service; + } + + } +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppService.cs index 54fcfc5e..a0467aa7 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppService.cs @@ -27,9 +27,9 @@ namespace Win.Sfs.SettleAccount.Entities.Prices /// /// 标准价格单-相关应用服务 /// - [Authorize(SettleAccountPermissions.PriceLists.Default)] + //[Authorize(SettleAccountPermissions.PriceLists.Default)] [Route("api/SettleAccount/PriceList")] - //[AllowAnonymous] + [AllowAnonymous] public class PriceListAppService : ApplicationService /*, IPriceListAppService*/ { @@ -50,6 +50,46 @@ namespace Win.Sfs.SettleAccount.Entities.Prices _service = service; } + /// + /// 根据筛选条件获取实体列表 + /// + /// + /// 请求条件包括:筛选条件列表,排序条件,数据数量,页码 + /// + /// 请求条件 + /// 实体DTO列表 + [HttpPost] + [Route("list")] + //[Authorize(SettleAccountPermissions.PriceLists.Default)] + public virtual async Task> GetListAsync(TB_PRICE_LIST_RequestDto input) + { + if (!string.IsNullOrEmpty(input.Version)) + { + input.Filters.Add(new FilterCondition() { Action = EnumFilterAction.Equal, Column = "Version", Logic = EnumFilterLogic.And, Value = input.Version }); + } + var entitys = await _mng.GetListAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount); + var totalCount = await GetCountAsync(input); + var dtos = ObjectMapper.Map, List>(entitys); + return new PagedResultDto(totalCount, dtos); + } + + /// + /// 获取总数 + /// + private async Task GetCountAsync(TB_PRICE_LIST_RequestDto input) + { + return await _mng.GetCountAsync(input.Filters, GuidGenerator.Create()); + } + + /// + /// 获取总数 + /// + private async Task GetCountAsync(PriceListRequestDto input) + { + return await _mng.GetCountAsync(input.Filters, GuidGenerator.Create()); + } + + /// /// 结算总成和ERP总成价格对比 /// @@ -107,30 +147,7 @@ namespace Win.Sfs.SettleAccount.Entities.Prices - /// - /// 根据筛选条件获取实体列表 - /// - /// - /// 请求条件包括:筛选条件列表,排序条件,数据数量,页码 - /// - /// 请求条件 - /// 实体DTO列表 - [HttpPost] - [Route("list")] - //[Authorize(SettleAccountPermissions.PriceLists.Default)] - virtual public async Task> GetListAsync(PriceListRequestDto input) - { - if (!string.IsNullOrEmpty(input.Version)) - { - input.Filters.Add(new FilterCondition() { Action = EnumFilterAction.Equal, Column = "Version", Logic = EnumFilterLogic.And, Value = input.Version }); - } - var entities = await _mng.GetListAsync(input.Filters, input.Sorting, input.MaxResultCount, - input.SkipCount); - var totalCount = await GetCountAsync(input); - var dtos = ObjectMapper.Map, List>(entities); - return new PagedResultDto(totalCount, dtos); - } /// /// 根据筛选条件获取实体列表 @@ -158,11 +175,6 @@ namespace Win.Sfs.SettleAccount.Entities.Prices - private async Task GetCountAsync(PriceListRequestDto input) - { - return await _mng.GetCountAsync(input.Filters, GuidGenerator.Create()); - } - /// /// 获取实体总数 /// diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationAutoMapperProfile.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationAutoMapperProfile.cs index 53d54fdf..7dab1578 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationAutoMapperProfile.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationAutoMapperProfile.cs @@ -301,11 +301,13 @@ namespace Win.Sfs.SettleAccount CreateMap().ReverseMap(); } - - + /// + /// 销售价格 + /// private void CreateMapPriceList() - { + CreateMap().ReverseMap(); + CreateMap().ReverseMap(); CreateMap().ReverseMap(); CreateMap().ReverseMap(); diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/SettleAccount.EntityFrameworkCore.csproj b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/SettleAccount.EntityFrameworkCore.csproj index f90bc26f..1c3b4dc9 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/SettleAccount.EntityFrameworkCore.csproj +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/SettleAccount.EntityFrameworkCore.csproj @@ -30,9 +30,5 @@ - - - -