学 赵 1 year ago
parent
commit
cb2f460704
  1. 1
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/vmi/sum.js
  2. 159
      code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Prices/PriceListDtoBase.cs
  3. 2
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/VmiAppService.cs
  4. 21
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppService.cs
  5. 13
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppServiceBJ.cs
  6. 6
      code/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationAutoMapperProfile.cs

1
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/vmi/sum.js

@ -116,6 +116,7 @@ export default function () {
},
sorting: {
hidden: true,
default: "RealPartCode",
},
},
},

159
code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Prices/PriceListDtoBase.cs

@ -16,42 +16,51 @@ public class PriceListDto : EntityDto<Guid>
/// </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 EnumBusinessType BusinessType { get; set; }
/// <summary>
/// 版本
/// </summary>
[Display(Name = "版本")]
public string Version { set; get; }
/// <summary>
/// 合同签订时间
/// </summary>
[Display(Name = "合同签订时间")]
public DateTime Date { get; set; }
public string Date { get; set; }
/// <summary>
/// 合同号
/// </summary>
[Display(Name = "合同号")]
public string ContractNo { get; set; }
/// <summary>
/// 是否作废
/// </summary>
[Display(Name = "是否作废")]
public bool IsCancel { get; set; }
}
/// <summary>
@ -182,6 +191,18 @@ public class PriceListRequestDto : PagedAndSortedResultRequestDto
public virtual List<FilterCondition> Filters { get; set; } = new List<FilterCondition>();
}
/// <summary>
/// UpdateDto
/// </summary>
public class PriceListUpdateDto : EntityDto<Guid>
{
/// <summary>
/// 是否作废
/// </summary>
[Display(Name = "是否作废")]
public bool IsCancel { get; set; }
}
#region 备件价格
/// <summary>
/// 备件价格
@ -229,6 +250,11 @@ public class PriceListBJDto : AuditedEntityDto<Guid>
/// </summary>
[Display(Name = "合同号")]
public string ContractNo { get; set; }
/// <summary>
/// 是否作废
/// </summary>
[Display(Name = "是否作废")]
public bool IsCancel { get; set; }
}
/// <summary>
@ -364,125 +390,18 @@ public class PriceListBJRequestDto : RequestInputBase
public string Version { set; get; }
public virtual List<FilterCondition> Filters { get; set; } = new List<FilterCondition>();
}
#endregion
/// <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 EnumBusinessType BusinessType { get; set; }
/// <summary>
/// 版本
/// </summary>
[Display(Name = "版本")]
public string Version { set; get; }
/// <summary>
/// 合同签订时间
/// </summary>
[Display(Name = "合同签订时间")]
public string Date { get; set; }
/// <summary>
/// 合同号
/// </summary>
[Display(Name = "合同号")]
public string ContractNo { get; set; }
}
/// <summary>
/// 列表请求
/// UpdateDto
/// </summary>
public class TB_PRICE_LIST_RequestDto : PagedAndSortedResultRequestDto
public class PriceListBJUpdateDto : EntityDto<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 EnumBusinessType 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>();
/// <summary>
/// 导出文件类型
/// </summary>
public int FileType { set; get; }
[Display(Name = "是否作废")]
public bool IsCancel { get; set; }
}
#endregion

2
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/VmiAppService.cs

@ -191,9 +191,9 @@ public class VmiAppService : Controller, IApplicationService, IJobService, ITran
{
query = query.Where(input.Filters.ToLambda<VmiBalance>());
}
query = string.IsNullOrEmpty(input.Sorting) ? query : DynamicQueryableExtensions.OrderBy(query, input.Sorting);
var query2 = query.GroupBy(o => new { o.ErpToLoc, o.RealPartCode }).Select(o => new VmiBalanceSumDto { ErpToLoc = o.Key.ErpToLoc, RealPartCode = o.Key.RealPartCode, Qty = o.Sum(o => o.Qty) });
var totalCount = query2.Count();
query2 = string.IsNullOrEmpty(input.Sorting) ? query2 : DynamicQueryableExtensions.OrderBy(query2, input.Sorting);
var entities = await query2.PageBy(input.SkipCount, input.MaxResultCount).ToListAsync().ConfigureAwait(false);
return new PagedResultDto<VmiBalanceSumDto>(totalCount, entities);
}

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

@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using EFCore.BulkExtensions;
using LinqToDB;
using Magicodes.ExporterAndImporter.Core;
using Magicodes.ExporterAndImporter.Excel;
using Microsoft.AspNetCore.Authorization;
@ -16,6 +17,7 @@ using Win.Sfs.BaseData.ImportExcelCommon;
using Win.Sfs.SettleAccount.CommonManagers;
using Win.Sfs.SettleAccount.Constant;
using Win.Sfs.SettleAccount.Entities.BQ.Dtos;
using Win.Sfs.SettleAccount.Entities.Factories;
using Win.Sfs.SettleAccount.ExcelImporter;
using Win.Sfs.SettleAccount.ExportReports;
using Win.Sfs.Shared.RepositoryBase;
@ -217,12 +219,12 @@ public class PriceListAppService : SettleAccountApplicationBase<PriceList>
/// 获取列表
/// </summary>
[HttpPost]
public async Task<PagedResultDto<TB_PRICE_LISTDto>> GetListAsync(RequestDto input)
public async Task<PagedResultDto<PriceListDto>> GetListAsync(RequestDto input)
{
var entities = await _priceListRepository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount, true).ConfigureAwait(false);
var totalCount = await _priceListRepository.GetCountByFilterAsync(input.Filters).ConfigureAwait(false);
var dtos = ObjectMapper.Map<List<PriceList>, List<TB_PRICE_LISTDto>>(entities);
return new PagedResultDto<TB_PRICE_LISTDto>(totalCount, dtos);
var dtos = ObjectMapper.Map<List<PriceList>, List<PriceListDto>>(entities);
return new PagedResultDto<PriceListDto>(totalCount, dtos);
}
/// <summary>
@ -242,6 +244,19 @@ public class PriceListAppService : SettleAccountApplicationBase<PriceList>
{
return await _priceListRepository.DeleteListAsync(ids).ConfigureAwait(false);
}
/// <summary>
/// 修改实体
/// </summary>
[HttpPost]
public async Task<PriceListDto> UpdateAsync(PriceListUpdateDto input)
{
var entity = await _settleAccountDbContext.Set<PriceList>().FindAsync(input.Id).ConfigureAwait(false);
entity.IsCancel = input.IsCancel;
_settleAccountDbContext.Set<PriceList>().Update(entity);
var dto = ObjectMapper.Map<PriceList, PriceListDto>(entity);
return dto;
}
#endregion
}

13
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppServiceBJ.cs

@ -202,6 +202,19 @@ public class PriceListAppServiceBJ : SettleAccountApplicationBase<PriceListBJ>
var dtos = ObjectMapper.Map<List<PriceListBJ>, List<PriceListBJDto>>(entities);
return new PagedResultDto<PriceListBJDto>(totalCount, dtos);
}
/// <summary>
/// 修改实体
/// </summary>
[HttpPost]
public async Task<PriceListBJDto> UpdateAsync(PriceListBJUpdateDto input)
{
var entity = await _settleAccountDbContext.Set<PriceListBJ>().FindAsync(input.Id).ConfigureAwait(false);
entity.IsCancel = input.IsCancel;
_settleAccountDbContext.Set<PriceListBJ>().Update(entity);
var dto = ObjectMapper.Map<PriceListBJ, PriceListBJDto>(entity);
return dto;
}
#endregion
}

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

@ -556,7 +556,7 @@ namespace Win.Sfs.SettleAccount
/// </summary>
private void CreateMapPriceList()
{
CreateMap<PriceList, TB_PRICE_LISTDto>()
CreateMap<PriceList, PriceListDto>()
.ForMember(x => x.Date, y => y.MapFrom(d => d.Date.ToString("yyyy-MM-dd")));
CreateMap<PriceListImportDto, PriceList>()
.ForMember(x => x.LU, y => y.MapFrom(y => y.PartNo))
@ -566,10 +566,6 @@ namespace Win.Sfs.SettleAccount
.ForMember(x => x.ClientCode, y => y.MapFrom(y => y.Plant))
.ForMember(x => x.Date, y => y.MapFrom(y => DateTime.ParseExact(y.Date, "dd.MM.yyyy", System.Globalization.CultureInfo.CurrentCulture)));
CreateMap<PriceList, PriceListExportDto>();
CreateMap<PriceList, PriceListDto>().ReverseMap();
CreateMap<PriceList, PriceListRequestDto>().ReverseMap();
}
/// <summary>

Loading…
Cancel
Save