Browse Source

提交销售价格实体

pull/1/head
mahao 1 year ago
parent
commit
0b95ac0341
  1. 99
      code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Prices/PriceListDtoBase.cs
  2. 41
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Prices/PriceListAppService.cs
  3. 72
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppService.cs
  4. 8
      code/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationAutoMapperProfile.cs
  5. 4
      code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/SettleAccount.EntityFrameworkCore.csproj

99
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<FilterCondition> Filters { get; set; } = new List<FilterCondition>();
}
/// <summary>
/// 列表
/// </summary>
public class TB_PRICE_LISTDto : AuditedEntityDto<Guid>
{
/// <summary>
/// 零件号
/// </summary>
[Display(Name = "零件号")]
public string LU { get; set; }
/// <summary>
/// 价格
/// </summary>
[Display(Name = "价格")]
public Decimal Price { set; get; }
/// <summary>
/// 开始时间
/// </summary>
[Display(Name = "开始时间")]
public DateTime BeginTime { set; get; }
/// <summary>
/// 结束时间
/// </summary>
[Display(Name = "结束时间")]
public DateTime EndTime { set; get; }
/// <summary>
/// 客户编码
/// </summary>
[Display(Name = "客户编码")]
public string ClientCode { get; set; }
/// <summary>
/// 业务类别
/// </summary>
[Display(Name = "业务类别")]
public string BusinessType { get; set; }
/// <summary>
/// 版本
/// </summary>
[Display(Name = "版本")]
public string Version { set; get; }
}
/// <summary>
/// 列表请求
/// </summary>
public class TB_PRICE_LIST_RequestDto : PagedAndSortedResultRequestDto
{
/// <summary>
/// 零件号
/// </summary>
[Display(Name = "零件号")]
public string LU { get; set; }
/// <summary>
/// 价格
/// </summary>
[Display(Name = "价格")]
public Decimal Price { set; get; }
/// <summary>
/// 开始时间
/// </summary>
[Display(Name = "开始时间")]
public DateTime BeginTime { set; get; }
/// <summary>
/// 结束时间
/// </summary>
[Display(Name = "结束时间")]
public DateTime EndTime { set; get; }
/// <summary>
/// 客户编码
/// </summary>
[Display(Name = "客户编码")]
public string ClientCode { get; set; }
/// <summary>
/// 业务类别
/// </summary>
[Display(Name = "业务类别")]
public string BusinessType { get; set; }
/// <summary>
/// 版本
/// </summary>
[Display(Name = "版本")]
public string Version { set; get; }
/// <summary>
/// 高级检索
/// </summary>
[Display(Name = "高级检索")]
public virtual List<FilterCondition> Filters { get; set; } = new List<FilterCondition>();
}
}

41
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
{
/// <summary>
/// 标准价格单-相关应用服务
/// </summary>
[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<ImportColumnMap, Guid> _mapRepository;
private readonly TaskJobService _service;
public PriceListAppService(
IExcelImportAppService excelImportService,
ISettleAccountBranchEfCoreRepository<ImportColumnMap, Guid> mapRepository,
PriceListManager mng,
TaskJobService service
)
{
_mapRepository = mapRepository;
_excelImportService = excelImportService;
_mng = mng;
_service = service;
}
}
}

72
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppService.cs

@ -27,9 +27,9 @@ namespace Win.Sfs.SettleAccount.Entities.Prices
/// <summary>
/// 标准价格单-相关应用服务
/// </summary>
[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;
}
/// <summary>
/// 根据筛选条件获取实体列表
/// </summary>
/// <remarks>
/// 请求条件包括:筛选条件列表,排序条件,数据数量,页码
/// </remarks>
/// <param name="input">请求条件</param>
/// <returns>实体DTO列表</returns>
[HttpPost]
[Route("list")]
//[Authorize(SettleAccountPermissions.PriceLists.Default)]
public virtual async Task<PagedResultDto<TB_PRICE_LISTDto>> 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<PriceList>, List<TB_PRICE_LISTDto>>(entitys);
return new PagedResultDto<TB_PRICE_LISTDto>(totalCount, dtos);
}
/// <summary>
/// 获取总数
/// </summary>
private async Task<long> GetCountAsync(TB_PRICE_LIST_RequestDto input)
{
return await _mng.GetCountAsync(input.Filters, GuidGenerator.Create());
}
/// <summary>
/// 获取总数
/// </summary>
private async Task<long> GetCountAsync(PriceListRequestDto input)
{
return await _mng.GetCountAsync(input.Filters, GuidGenerator.Create());
}
/// <summary>
/// 结算总成和ERP总成价格对比
/// </summary>
@ -107,30 +147,7 @@ namespace Win.Sfs.SettleAccount.Entities.Prices
/// <summary>
/// 根据筛选条件获取实体列表
/// </summary>
/// <remarks>
/// 请求条件包括:筛选条件列表,排序条件,数据数量,页码
/// </remarks>
/// <param name="input">请求条件</param>
/// <returns>实体DTO列表</returns>
[HttpPost]
[Route("list")]
//[Authorize(SettleAccountPermissions.PriceLists.Default)]
virtual public async Task<PagedResultDto<PriceListDto>> 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<PriceList>, List<PriceListDto>>(entities);
return new PagedResultDto<PriceListDto>(totalCount, dtos);
}
/// <summary>
/// 根据筛选条件获取实体列表
@ -158,11 +175,6 @@ namespace Win.Sfs.SettleAccount.Entities.Prices
private async Task<long> GetCountAsync(PriceListRequestDto input)
{
return await _mng.GetCountAsync(input.Filters, GuidGenerator.Create());
}
/// <summary>
/// 获取实体总数
/// </summary>

8
code/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationAutoMapperProfile.cs

@ -301,11 +301,13 @@ namespace Win.Sfs.SettleAccount
CreateMap<PriceListVersionBJ, PriceListVersionBJExportDto>().ReverseMap();
}
/// <summary>
/// 销售价格
/// </summary>
private void CreateMapPriceList()
{
CreateMap<PriceList, TB_PRICE_LISTDto>().ReverseMap();
CreateMap<PriceList, PriceListDto>().ReverseMap();
CreateMap<PriceList, PriceListRequestDto>().ReverseMap();
CreateMap<PriceList, PriceListImportDto>().ReverseMap();

4
code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/SettleAccount.EntityFrameworkCore.csproj

@ -30,9 +30,5 @@
<ProjectReference Include="..\..\..\..\Shared\Win.Sfs.Shared\Win.Sfs.Shared.csproj" />
<ProjectReference Include="..\SettleAccount.Domain\SettleAccount.Domain.csproj" />
</ItemGroup>
<ItemGroup>
<Folder Include="Migrations\" />
</ItemGroup>
</Project>

Loading…
Cancel
Save