mahao 1 year ago
parent
commit
3fc49a7063
  1. 1
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_SA_SERVICE.cs
  2. 1
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_SA_SERVICE.cs
  3. 1
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_SA_SERVICE.cs
  4. 20
      code/src/Modules/SettleAccount/src/SettleAccount.Domain.Shared/Enums/EnumMappingType.cs
  5. 2
      code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/PubSaSeCompareExportService.cs
  6. 33
      code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SaSeCompareExportBaseService.cs

1
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_SA_SERVICE.cs

@ -335,7 +335,6 @@ public class BBAC_SA_SERVICE : SettleAccountApplicationBase<BBAC_SA>
}
bbacSaDetail.PN = Regex.Replace(bbacSaDetail.PN, "['‘’]", "");
});
return GroupPnLu(bbacSaDetails);
}

1
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_SA_SERVICE.cs

@ -297,7 +297,6 @@ public class HBPO_SA_SERVICE : SettleAccountApplicationBase<HBPO_SA>
hbpoSaDetail.CustomerPartCodeNoSpace = hbpoSaDetail.LU.Replace(" ", "");
hbpoSaDetail.Version = Version;
});
return GroupPnLu(hbpoSaDetails);
}

1
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_SA_SERVICE.cs

@ -406,7 +406,6 @@ public class PUB_SA_SERVICE : SettleAccountApplicationBase<PUB_SA>
}
pubSaDetail.PN = Regex.Replace(pubSaDetail.PN, "['‘’]", "");
});
return GroupPnLu(pubSaDetails);
}

20
code/src/Modules/SettleAccount/src/SettleAccount.Domain.Shared/Enums/EnumMappingType.cs

@ -0,0 +1,20 @@
using System.ComponentModel.DataAnnotations;
namespace Win.Sfs.SettleAccount.Enums;
/// <summary>
/// 匹配类型
/// </summary>
public enum EnumMappingType
{
/// <summary>
/// 未定义
/// </summary>
[Display(Name = "未定义")]
None = 0,
/// <summary>
/// 完全匹配
/// </summary>
[Display(Name = "完全匹配")]
PerfectMatch = 1
}

2
code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/PubSaSeCompareExportService.cs

@ -2,7 +2,6 @@ using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using EFCore.BulkExtensions;
using Magicodes.ExporterAndImporter.Excel;
using Microsoft.AspNetCore.SignalR;
using Microsoft.OpenApi.Extensions;
@ -17,7 +16,6 @@ using Volo.Abp.ObjectMapping;
using Win.Sfs.BaseData.ImportExcelCommon;
using Win.Sfs.SettleAccount;
using Win.Sfs.SettleAccount.Entities.BQ;
using Win.Sfs.SettleAccount.Enums;
using Win.Sfs.SettleAccount.Reports;
using Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report;
using Win.Sfs.Shared.RepositoryBase;

33
code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SaSeCompareExportBaseService.cs

@ -7,6 +7,7 @@ using Microsoft.AspNetCore.SignalR;
using SettleAccount.Bases;
using SettleAccount.Domain.BQ;
using SettleAccount.Job.SignalR;
using Volo.Abp;
using Win.Sfs.SettleAccount;
using Win.Sfs.SettleAccount.Consts;
using Win.Sfs.SettleAccount.Enums;
@ -173,6 +174,38 @@ namespace SettleAccount.Job.Services.Report
}
}
/// <summary>
/// 处理发运数据
/// 结算、发运对比上的数据修改结算数据状态
/// </summary>
public virtual void HandLeSaDetailsMain<T>(List<PubSaSeCompareDiff> pubSaSeCompareDiffs, EnumBusinessType businessType, int version) where T : SA_BASE
{
var haveSaHaveSes = pubSaSeCompareDiffs.FindAll(t => t.Category == EnumPubSaSeCompareCategory.HaveSaHaveSe);
if (haveSaHaveSes.Any())
{
//结算详情
var saDetails = (from sa in _settleAccountDbContext.Set<T>()
where sa.BusinessType == businessType && sa.Version == version
select sa).ToList();
if (saDetails.Any())
{
var saDetailsUpdate = saDetails.Join(haveSaHaveSes, o => new { o.PN, o.LU }, i => new { i.PN, LU = i.CustomerPartCode }, (o, i) =>
{
var mappingType = (i.SAQty - i.SEQty) switch
{
> 0 => EnumMappingType.None,
0 => EnumMappingType.PerfectMatch,
< 0 => EnumMappingType.None,
_ => default,
};
o.ExtraProperties.Add("MappingType", mappingType);
return o;
}).ToList();
_settleAccountDbContext.BulkUpdate(saDetailsUpdate);
}
}
}
/// <summary>
/// 创建导出文件结构
/// </summary>

Loading…
Cancel
Save