|
@ -124,6 +124,10 @@ namespace Win.Sfs.SettleAccount.Entities.BQ |
|
|
/// <summary>
|
|
|
/// <summary>
|
|
|
/// 导入
|
|
|
/// 导入
|
|
|
/// </summary>
|
|
|
/// </summary>
|
|
|
|
|
|
/// <remarks>
|
|
|
|
|
|
/// 直供件BBAC、直供件HBPO、备件、印度件
|
|
|
|
|
|
/// 业务结算数据导入
|
|
|
|
|
|
/// </remarks>
|
|
|
[HttpPost] |
|
|
[HttpPost] |
|
|
public async Task<IActionResult> ImportAsync([FromForm] PUB_SAImportRequestDto pubSaImportRequestDto) |
|
|
public async Task<IActionResult> ImportAsync([FromForm] PUB_SAImportRequestDto pubSaImportRequestDto) |
|
|
{ |
|
|
{ |
|
@ -168,6 +172,12 @@ namespace Win.Sfs.SettleAccount.Entities.BQ |
|
|
/// <summary>
|
|
|
/// <summary>
|
|
|
/// 删除
|
|
|
/// 删除
|
|
|
/// </summary>
|
|
|
/// </summary>
|
|
|
|
|
|
/// <remarks>
|
|
|
|
|
|
/// 同时删除
|
|
|
|
|
|
/// 结算主表、明细表
|
|
|
|
|
|
/// 可结算主表、明细表
|
|
|
|
|
|
/// 不可结算明细表(不可结算又没主表)
|
|
|
|
|
|
/// </remarks>
|
|
|
[HttpPost] |
|
|
[HttpPost] |
|
|
public async Task<IActionResult> DeleteListAsync(List<Guid> ids) |
|
|
public async Task<IActionResult> DeleteListAsync(List<Guid> ids) |
|
|
{ |
|
|
{ |
|
@ -230,6 +240,11 @@ namespace Win.Sfs.SettleAccount.Entities.BQ |
|
|
/// <summary>
|
|
|
/// <summary>
|
|
|
/// 直供件BBAC导入
|
|
|
/// 直供件BBAC导入
|
|
|
/// </summary>
|
|
|
/// </summary>
|
|
|
|
|
|
/// <remarks>
|
|
|
|
|
|
/// 导入数据过滤
|
|
|
|
|
|
/// * 筛选 Vendor 为15663496的数据
|
|
|
|
|
|
/// HandleSaDetails方法处理导入的数据
|
|
|
|
|
|
/// </remarks>
|
|
|
private async Task<IActionResult> ImportZhiGongJianBBACAsync([FromForm] IFormFileCollection files) |
|
|
private async Task<IActionResult> ImportZhiGongJianBBACAsync([FromForm] IFormFileCollection files) |
|
|
{ |
|
|
{ |
|
|
#region 导入数据转换
|
|
|
#region 导入数据转换
|
|
@ -359,6 +374,10 @@ namespace Win.Sfs.SettleAccount.Entities.BQ |
|
|
/// <summary>
|
|
|
/// <summary>
|
|
|
/// 数据校验
|
|
|
/// 数据校验
|
|
|
/// </summary>
|
|
|
/// </summary>
|
|
|
|
|
|
/// <remarks>
|
|
|
|
|
|
/// 验证结算分组号是否已存在
|
|
|
|
|
|
/// 验证
|
|
|
|
|
|
/// </remarks>
|
|
|
private async Task<List<ErrorExportDto>> CheckAsync(List<PUB_SA_DETAIL> pubSaDetails) |
|
|
private async Task<List<ErrorExportDto>> CheckAsync(List<PUB_SA_DETAIL> pubSaDetails) |
|
|
{ |
|
|
{ |
|
|
#region 数据校验
|
|
|
#region 数据校验
|
|
@ -399,6 +418,11 @@ namespace Win.Sfs.SettleAccount.Entities.BQ |
|
|
/// <summary>
|
|
|
/// <summary>
|
|
|
/// 处理结算数据
|
|
|
/// 处理结算数据
|
|
|
/// </summary>
|
|
|
/// </summary>
|
|
|
|
|
|
/// <remarks>
|
|
|
|
|
|
/// 零件号(Lu)格式处理
|
|
|
|
|
|
/// 零件号可能存在颜色码 颜色码和塑件码中间用同一用6个空格替换
|
|
|
|
|
|
/// PN有0开头的数据过滤 '‘’符号
|
|
|
|
|
|
/// </remarks>
|
|
|
private List<PUB_SA_DETAIL> HandleSaDetails(List<PUB_SA_DETAIL> pubSaDetails) |
|
|
private List<PUB_SA_DETAIL> HandleSaDetails(List<PUB_SA_DETAIL> pubSaDetails) |
|
|
{ |
|
|
{ |
|
|
pubSaDetails.ForEach(pubSaDetail => |
|
|
pubSaDetails.ForEach(pubSaDetail => |
|
@ -419,6 +443,10 @@ namespace Win.Sfs.SettleAccount.Entities.BQ |
|
|
/// <summary>
|
|
|
/// <summary>
|
|
|
/// 结算数据分组Pn、Lu
|
|
|
/// 结算数据分组Pn、Lu
|
|
|
/// </summary>
|
|
|
/// </summary>
|
|
|
|
|
|
/// <remarks>
|
|
|
|
|
|
/// 导入文件中可能存在PN+LU相同的数据
|
|
|
|
|
|
/// 根据PN+LU分组合计数量后导入
|
|
|
|
|
|
/// </remarks>
|
|
|
private List<PUB_SA_DETAIL> GroupPnLu(List<PUB_SA_DETAIL> pubSaDetails) |
|
|
private List<PUB_SA_DETAIL> GroupPnLu(List<PUB_SA_DETAIL> pubSaDetails) |
|
|
{ |
|
|
{ |
|
|
return pubSaDetails.GroupBy(t => new { t.PN, t.LU }).Select(t => |
|
|
return pubSaDetails.GroupBy(t => new { t.PN, t.LU }).Select(t => |
|
@ -587,6 +615,11 @@ namespace Win.Sfs.SettleAccount.Entities.BQ |
|
|
/// <summary>
|
|
|
/// <summary>
|
|
|
/// 获取结算关联项
|
|
|
/// 获取结算关联项
|
|
|
/// </summary>
|
|
|
/// </summary>
|
|
|
|
|
|
/// <remarks>
|
|
|
|
|
|
/// 根据结算主表Id获取关联的结算主表、结算明细表、可结算主表、可结算明细表、不可结算明细表要删除的数据
|
|
|
|
|
|
/// 验证可结算主表状态
|
|
|
|
|
|
/// 只有可结算主表状态为未结状态时才可以删除结算数据
|
|
|
|
|
|
/// </remarks>
|
|
|
private async Task<(List<PUB_SA> pubSas, List<PUB_SA_DETAIL> pubSaDetails, List<PUB_CAN_SA> pubCanSas, List<PUB_CAN_SA_DETAIL> pubCanSaDetails, List<PUB_NOT_SA_DETAIL> pubNotSaDetails)> GetPubSaDelItemsAsync(Guid id) |
|
|
private async Task<(List<PUB_SA> pubSas, List<PUB_SA_DETAIL> pubSaDetails, List<PUB_CAN_SA> pubCanSas, List<PUB_CAN_SA_DETAIL> pubCanSaDetails, List<PUB_NOT_SA_DETAIL> pubNotSaDetails)> GetPubSaDelItemsAsync(Guid id) |
|
|
{ |
|
|
{ |
|
|
//结算主表
|
|
|
//结算主表
|
|
|