Browse Source

Merge branch 'master' of http://dev.ccwin-in.com:3000/BoXu.Zheng/BeiJinSettleAccount

master
学 赵 1 year ago
parent
commit
e1b0b32f2d
  1. 15
      code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/MaterialRelationship/MaterialRelationshipDtoBase.cs
  2. 24
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_SA_SERVICE.cs
  3. 29
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_SA_SERVICE.cs
  4. 27
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_SA_SERVICE.cs
  5. 79
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_SE_DETAIL_SERVICE.cs
  6. 3
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisBBACSeSyncBaseAppService.cs
  7. 3
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisHBPOSeSyncBaseAppService.cs
  8. 3
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JitSeSyncAppService.cs
  9. 4
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/SeSyncExtendManager.cs
  10. 24
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/MaterialRelationships/MaterialRelationshipAppService.cs
  11. 1
      code/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationAutoMapperProfile.cs
  12. 7
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeEdiCompareDetailReport.cs
  13. 9
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeEdiCompareDiff.cs
  14. 4
      code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisBBACSaSeEdiCompareExportService.cs
  15. 4
      code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisHBPOSaSeEdiCompareExportService.cs
  16. 1
      code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/MaiDanBBACSaSeCompareExportService.cs
  17. 1
      code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/MaiDanHBPOSaSeCompareExportService.cs
  18. 5
      code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SeEdiCompareExportBaseService.cs

15
code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/MaterialRelationship/MaterialRelationshipDtoBase.cs

@ -99,19 +99,16 @@ namespace Win.Sfs.SettleAccount.MaterialRelationships
/// </summary> /// </summary>
[ExporterHeaderAttribute(DisplayName = "厂内物料号")] [ExporterHeaderAttribute(DisplayName = "厂内物料号")]
public string ErpMaterialCode { get; set; } public string ErpMaterialCode { get; set; }
/// <summary> /// <summary>
/// 厂内物料描述 /// 厂内物料描述
/// </summary> /// </summary>
[ExporterHeaderAttribute(DisplayName = "厂内物料描述")] [ExporterHeaderAttribute(DisplayName = "厂内物料描述")]
public string MaterialDesc { get; set; } public string MaterialDesc { get; set; }
/// <summary> /// <summary>
/// 客户物料号 /// 客户物料号
/// </summary> /// </summary>
[ExporterHeaderAttribute(DisplayName = "客户物料号")] [ExporterHeaderAttribute(DisplayName = "客户物料号")]
public string SettleMaterialCode { get; set; } public string SettleMaterialCode { get; set; }
/// <summary> /// <summary>
/// 业务类别 /// 业务类别
/// </summary> /// </summary>
@ -138,6 +135,10 @@ namespace Win.Sfs.SettleAccount.MaterialRelationships
/// 文件 /// 文件
/// </summary> /// </summary>
public IFormFileCollection Files { get; set; } public IFormFileCollection Files { get; set; }
/// <summary>
/// 业务分类
/// </summary>
public EnumBusinessType BusinessType { get; set; }
} }
/// <summary> /// <summary>
@ -153,14 +154,12 @@ namespace Win.Sfs.SettleAccount.MaterialRelationships
[Required(ErrorMessage = "{0}是必填项")] [Required(ErrorMessage = "{0}是必填项")]
[MaxLength(CommonConsts.MaxNameLength, ErrorMessage = "{0}最多输入{1}个字符")] [MaxLength(CommonConsts.MaxNameLength, ErrorMessage = "{0}最多输入{1}个字符")]
public string ErpMaterialCode { get; set; } public string ErpMaterialCode { get; set; }
/// <summary> /// <summary>
/// 厂内物料描述 /// 厂内物料描述
/// </summary> /// </summary>
[ImporterHeader(Name = "厂内物料描述")] [ImporterHeader(Name = "厂内物料描述")]
[MaxLength(CommonConsts.MaxNameLength, ErrorMessage = "{0}最多输入{1}个字符")] [MaxLength(CommonConsts.MaxNameLength, ErrorMessage = "{0}最多输入{1}个字符")]
public string MaterialDesc { get; set; } public string MaterialDesc { get; set; }
/// <summary> /// <summary>
/// 客户物料号 /// 客户物料号
/// </summary> /// </summary>
@ -168,6 +167,12 @@ namespace Win.Sfs.SettleAccount.MaterialRelationships
[Required(ErrorMessage = "{0}是必填项")] [Required(ErrorMessage = "{0}是必填项")]
[MaxLength(CommonConsts.MaxNameLength, ErrorMessage = "{0}最多输入{1}个字符")] [MaxLength(CommonConsts.MaxNameLength, ErrorMessage = "{0}最多输入{1}个字符")]
public string SettleMaterialCode { get; set; } public string SettleMaterialCode { get; set; }
/// <summary>
/// 业务类别
/// </summary>
[ImporterHeader(Name = "业务类别")]
[Required(ErrorMessage = "{0}是必填项")]
public EnumBusinessType BusinessType { get; set; }
} }
public class MaterialRelationshipDetailDto : EntityDto<Guid> public class MaterialRelationshipDetailDto : EntityDto<Guid>

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

@ -187,18 +187,18 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
} }
} }
//if (!checkList.Any()) if (!checkList.Any())
//{ {
// //验证客户对应厂内零件号是否存在 //验证客户对应厂内零件号是否存在
// if (jisSaDetails.Any()) if (jisSaDetails.Any())
// { {
// checkList.AddRange(await CheckAsync(jisSaDetails, EnumBusinessType.JisBBAC).ConfigureAwait(false)); checkList.AddRange(await CheckAsync(jisSaDetails, EnumBusinessType.JisBBAC).ConfigureAwait(false));
// } }
// if (maiDanSaDetails.Any()) if (maiDanSaDetails.Any())
// { {
// checkList.AddRange(await CheckAsync(maiDanSaDetails, EnumBusinessType.MaiDanJianBBAC).ConfigureAwait(false)); checkList.AddRange(await CheckAsync(maiDanSaDetails, EnumBusinessType.MaiDanJianBBAC).ConfigureAwait(false));
// } }
//} }
if (checkList.Count > 0) if (checkList.Count > 0)
{ {

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

@ -120,15 +120,14 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
public async Task<IActionResult> ImportAsync([FromForm] HBPOSaImportRequestDto hbpoSaImportRequestDto) public async Task<IActionResult> ImportAsync([FromForm] HBPOSaImportRequestDto hbpoSaImportRequestDto)
{ {
IActionResult result = new JsonResult(new { Code = 400 }); IActionResult result = new JsonResult(new { Code = 400 });
BusinessType = hbpoSaImportRequestDto.BusinessType;
Version = hbpoSaImportRequestDto.Version; Version = hbpoSaImportRequestDto.Version;
switch (hbpoSaImportRequestDto.BusinessType) switch (BusinessType)
{ {
case EnumBusinessType.JisHBPO: case EnumBusinessType.JisHBPO:
BusinessType = EnumBusinessType.JisHBPO;
result = await ImportJisHBPOAsync(hbpoSaImportRequestDto.Files).ConfigureAwait(false); result = await ImportJisHBPOAsync(hbpoSaImportRequestDto.Files).ConfigureAwait(false);
break; break;
case EnumBusinessType.MaiDanJianHBPO: case EnumBusinessType.MaiDanJianHBPO:
BusinessType = EnumBusinessType.MaiDanJianHBPO;
result = await ImportMaiDanJianHBPOAsync(hbpoSaImportRequestDto.Files).ConfigureAwait(false); result = await ImportMaiDanJianHBPOAsync(hbpoSaImportRequestDto.Files).ConfigureAwait(false);
break; break;
default: default:
@ -515,18 +514,18 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
if (!checkList.Any()) if (!checkList.Any())
{ {
////验证客户对应厂内零件号是否存在 //验证客户对应厂内零件号是否存在
////导入的零件号集合 //导入的零件号集合
//var importSaLUs = hbpoSaDetails.Select(t => t.LU).Distinct(); var importSaLUs = hbpoSaDetails.Select(t => t.LU).Distinct();
//var materialRelationshipEntitys = await _materialRelationshipRepository.GetListAsync(t => t.BusinessType == BusinessType && importSaLUs.Contains(t.SettleMaterialCode)).ConfigureAwait(false); var materialRelationshipEntitys = await _materialRelationshipRepository.GetListAsync(t => t.BusinessType == BusinessType && importSaLUs.Contains(t.SettleMaterialCode)).ConfigureAwait(false);
//var materialRelationshipEntitySettleMaterialCodes = materialRelationshipEntitys.Select(t => t.SettleMaterialCode).Distinct(); var materialRelationshipEntitySettleMaterialCodes = materialRelationshipEntitys.Select(t => t.SettleMaterialCode).Distinct();
////不存在的客户零件号(差集) //不存在的客户零件号(差集)
//var noExistSettleMaterialCodes = importSaLUs.Except(materialRelationshipEntitySettleMaterialCodes); var noExistSettleMaterialCodes = importSaLUs.Except(materialRelationshipEntitySettleMaterialCodes);
//noExistSettleMaterialCodes.ForEach(t => noExistSettleMaterialCodes.ForEach(t =>
//{ {
// checkList.Add(new ErrorExportDto(string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, $"客户零件号【{t}】对应厂内零件号系统中不存在", string.Empty)); checkList.Add(new ErrorExportDto(string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, $"客户零件号【{t}】对应厂内零件号系统中不存在", string.Empty));
//}); });
} }
return checkList; return checkList;

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

@ -403,21 +403,18 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
if (!checkList.Any()) if (!checkList.Any())
{ {
if (businessType == EnumBusinessType.BeiJian) //验证客户对应厂内零件号是否存在
//导入的零件号集合
var importPubSaLUs = pubSaDetails.Select(t => t.LU).Distinct();
var materialRelationshipEntitys = await _materialRelationshipRepository.GetListAsync(t => t.BusinessType == businessType && importPubSaLUs.Contains(t.SettleMaterialCode)).ConfigureAwait(false);
var materialRelationshipEntitySettleMaterialCodes = materialRelationshipEntitys.Select(t => t.SettleMaterialCode).Distinct();
//不存在的客户零件号(差集)
var noExistSettleMaterialCodes = importPubSaLUs.Except(materialRelationshipEntitySettleMaterialCodes);
noExistSettleMaterialCodes.ForEach(t =>
{ {
//验证客户对应厂内零件号是否存在 checkList.Add(new ErrorExportDto(string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, $"客户零件号【{t}】对应厂内零件号系统中不存在", string.Empty));
//导入的零件号集合 });
var importPubSaLUs = pubSaDetails.Select(t => t.LU).Distinct();
var materialRelationshipEntitys = await _materialRelationshipRepository.GetListAsync(t => t.BusinessType == businessType && importPubSaLUs.Contains(t.SettleMaterialCode)).ConfigureAwait(false);
var materialRelationshipEntitySettleMaterialCodes = materialRelationshipEntitys.Select(t => t.SettleMaterialCode).Distinct();
//不存在的客户零件号(差集)
var noExistSettleMaterialCodes = importPubSaLUs.Except(materialRelationshipEntitySettleMaterialCodes);
noExistSettleMaterialCodes.ForEach(t =>
{
checkList.Add(new ErrorExportDto(string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, $"客户零件号【{t}】对应厂内零件号系统中不存在", string.Empty));
});
}
} }
return checkList; return checkList;
@ -531,7 +528,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
.FirstOrDefault(); .FirstOrDefault();
importPubSaDetail.Price = priceListEntity?.Price ?? 0; importPubSaDetail.Price = priceListEntity?.Price ?? 0;
}); });
} }
#endregion #endregion
// 客户-厂内零件号关系 // 客户-厂内零件号关系

79
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_SE_DETAIL_SERVICE.cs

@ -78,85 +78,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
await _excelImportService.SaveBlobAsync(new SaveExcelImportInputDto { Name = fileName, Content = result }).ConfigureAwait(false); await _excelImportService.SaveBlobAsync(new SaveExcelImportInputDto { Name = fileName, Content = result }).ConfigureAwait(false);
return fileName; return fileName;
} }
[HttpGet]
public async Task<string> TextExportAsync()
{
var fileName = $"发运数据_{Guid.NewGuid()}.xlsx";
var haveEdiHaveSeList = new List<SeEidCompareReportJisBBAC>();
for (int i = 0; i < 2_000_000; i++)
{
haveEdiHaveSeList.Add(new SeEidCompareReportJisBBAC()
{
Category = "JIS",
WmsBillNum = i.ToString(),
CarModeCode = i.ToString(),
LineStationcode = i.ToString(),
SequenceNumber = i.ToString(),
ParType = i.ToString(),
MESConfigCode = i.ToString(),
ShippingDate = DateTime.Now,
PN = i.ToString(),
Seq = i.ToString(),
PjsNum = i.ToString(),
MaterialNumber = i.ToString(),
MaterialDes = i.ToString(),
SEQty = 1,
EdiQty = 1,
AssemblyDate = DateTime.Now,
MatchNumber = i.ToString(),
InjectionCode = i.ToString(),
DiffDesc = "WMS有发货EDI有订单"
});
}
var jisBBACEidSeCompareEexcelExporterAttribute = typeof(SeEidCompareReportJisBBAC).GetAttribute<ExcelExporterAttribute>();
var jisBBACEidSeCompareEexcelMaxRowNumberOnASheet = 9_000_000;
if (jisBBACEidSeCompareEexcelExporterAttribute != null)
{
jisBBACEidSeCompareEexcelMaxRowNumberOnASheet = jisBBACEidSeCompareEexcelExporterAttribute.MaxRowNumberOnASheet > 0 ? jisBBACEidSeCompareEexcelExporterAttribute.MaxRowNumberOnASheet : jisBBACEidSeCompareEexcelMaxRowNumberOnASheet;
}
ExcelExporter excelExporter = new ExcelExporter();
excelExporter.Append(haveEdiHaveSeList.Take(jisBBACEidSeCompareEexcelMaxRowNumberOnASheet).ToList(), $"BBACEDI数据和发货对比");
var ediSheetCount = (int)(haveEdiHaveSeList.Count / jisBBACEidSeCompareEexcelMaxRowNumberOnASheet) + ((haveEdiHaveSeList.Count % jisBBACEidSeCompareEexcelMaxRowNumberOnASheet) > 0 ? 1 : 0);
if (ediSheetCount > 1)
{
for (int i = 1; i < ediSheetCount; i++)
{
var sheetDataItems = haveEdiHaveSeList.Skip(i * jisBBACEidSeCompareEexcelMaxRowNumberOnASheet)
.Take(jisBBACEidSeCompareEexcelMaxRowNumberOnASheet).ToList();
excelExporter.SeparateBySheet();
excelExporter.Append(sheetDataItems, $"BBACEDI数据和发货对比-{i}");
}
}
excelExporter.Append(haveEdiHaveSeList.Take(jisBBACEidSeCompareEexcelMaxRowNumberOnASheet).ToList(), $"BBAC发货和EDI数据对比");
var seSheetCount = (int)(haveEdiHaveSeList.Count / jisBBACEidSeCompareEexcelMaxRowNumberOnASheet) + ((haveEdiHaveSeList.Count % jisBBACEidSeCompareEexcelMaxRowNumberOnASheet) > 0 ? 1 : 0);
if (seSheetCount > 1)
{
for (int i = 1; i < seSheetCount; i++)
{
var sheetDataItems = haveEdiHaveSeList.Skip(i * jisBBACEidSeCompareEexcelMaxRowNumberOnASheet)
.Take(jisBBACEidSeCompareEexcelMaxRowNumberOnASheet).ToList();
excelExporter.SeparateBySheet();
excelExporter.Append(sheetDataItems, $"BBAC发货和EDI数据对比-{i}");
}
}
//excelExporter
// .Append(haveEdiHaveSeList, $"BBACEDI数据和发货对比");
//.SeparateBySheet()
////.Append(haveEdiHaveSeList, $"BBAC发货和EDI数据对比");
var result = excelExporter.ExportAppendDataAsByteArray();
await result.ShouldNotBeNull().ConfigureAwait(false);
await _fileContainer.SaveAsync(fileName, result.Result, true).ConfigureAwait(false);
return fileName;
}
#endregion #endregion
#region 查询 #region 查询

3
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisBBACSeSyncBaseAppService.cs

@ -173,6 +173,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs
await _syncExtendManager.AddNewMaterialRelationshipsAsync(materialRelationships).ConfigureAwait(false); await _syncExtendManager.AddNewMaterialRelationshipsAsync(materialRelationships).ConfigureAwait(false);
} }
var dateTimeNow = DateTime.Now;
seDetails.ForEach(t => seDetails.ForEach(t =>
{ {
t.SetId(GuidGenerator.Create()); t.SetId(GuidGenerator.Create());
@ -183,6 +184,8 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs
{ {
t.Version = int.Parse(t.BillTime?.ToString("yyyyMM")); t.Version = int.Parse(t.BillTime?.ToString("yyyyMM"));
} }
t.CreateTime = dateTimeNow;
t.CreationTime = dateTimeNow;
}); });
var syncPosition = seDetails.Last().UID.ToString(); var syncPosition = seDetails.Last().UID.ToString();

3
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisHBPOSeSyncBaseAppService.cs

@ -174,6 +174,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs
await _syncExtendManager.AddNewMaterialRelationshipsAsync(materialRelationships).ConfigureAwait(false); await _syncExtendManager.AddNewMaterialRelationshipsAsync(materialRelationships).ConfigureAwait(false);
} }
var dateTimeNow = DateTime.Now;
seDetails.ForEach(t => seDetails.ForEach(t =>
{ {
t.SetId(GuidGenerator.Create()); t.SetId(GuidGenerator.Create());
@ -184,6 +185,8 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs
{ {
t.Version = int.Parse(t.BillTime?.ToString("yyyyMM")); t.Version = int.Parse(t.BillTime?.ToString("yyyyMM"));
} }
t.CreateTime = dateTimeNow;
t.CreationTime = dateTimeNow;
}); });
var syncPosition = seDetails.Last().UID.ToString(); var syncPosition = seDetails.Last().UID.ToString();

3
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JitSeSyncAppService.cs

@ -122,6 +122,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs
} }
} }
var dateTimeNow = DateTime.Now;
seDetails.ForEach(t => seDetails.ForEach(t =>
{ {
t.SetId(GuidGenerator.Create()); t.SetId(GuidGenerator.Create());
@ -132,6 +133,8 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs
{ {
t.Version = int.Parse(t.BillTime?.ToString("yyyyMM")); t.Version = int.Parse(t.BillTime?.ToString("yyyyMM"));
} }
t.CreateTime = dateTimeNow;
t.CreationTime = dateTimeNow;
}); });
var syncPosition = seDetails.Last().UID.ToString(); var syncPosition = seDetails.Last().UID.ToString();

4
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/SeSyncExtendManager.cs

@ -89,7 +89,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs
Qty = t.Qty, Qty = t.Qty,
ReMark = t.Remark, ReMark = t.Remark,
RealCode = t.RealCode, RealCode = t.RealCode,
RealPartCode = t.PartCode, RealPartCode = t.RealPartCode,
Seq = t.Seq, Seq = t.Seq,
UniqueCode = isJisTable ? t.UniqueCode : t.DeliverCode, UniqueCode = isJisTable ? t.UniqueCode : t.DeliverCode,
VinCode = t.VinCode, VinCode = t.VinCode,
@ -117,7 +117,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs
Qty = -t.Qty, Qty = -t.Qty,
ReMark = t.Remark, ReMark = t.Remark,
RealCode = t.RealCode, RealCode = t.RealCode,
RealPartCode = t.PartCode, RealPartCode = t.RealPartCode,
Seq = t.Seq, Seq = t.Seq,
UniqueCode = isJisTable ? t.UniqueCode : t.DeliverCode, UniqueCode = isJisTable ? t.UniqueCode : t.DeliverCode,
VinCode = t.VinCode, VinCode = t.VinCode,

24
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/MaterialRelationships/MaterialRelationshipAppService.cs

@ -58,6 +58,11 @@ public class MaterialRelationshipAppService : SettleAccountApplicationBase<Mater
[HttpPost] [HttpPost]
public async Task<IActionResult> ImportAsync([FromForm] MaterialRelationshipImportRequestDto materialRelationshipImportRequestDto) public async Task<IActionResult> ImportAsync([FromForm] MaterialRelationshipImportRequestDto materialRelationshipImportRequestDto)
{ {
var businessType = materialRelationshipImportRequestDto.BusinessType;
if (businessType == EnumBusinessType.None)
{
return new JsonResult(new { Code = 400, Message = "导入成功" });
}
var exportImporter = new ExportImporter(); var exportImporter = new ExportImporter();
var inportDatas = await exportImporter.UploadExcelImport<MaterialRelationshipImportDto>(materialRelationshipImportRequestDto.Files, _excelImportService).ConfigureAwait(false); var inportDatas = await exportImporter.UploadExcelImport<MaterialRelationshipImportDto>(materialRelationshipImportRequestDto.Files, _excelImportService).ConfigureAwait(false);
var entitys = ObjectMapper.Map<List<MaterialRelationshipImportDto>, List<MaterialRelationship>>(inportDatas); var entitys = ObjectMapper.Map<List<MaterialRelationshipImportDto>, List<MaterialRelationship>>(inportDatas);
@ -66,6 +71,12 @@ public class MaterialRelationshipAppService : SettleAccountApplicationBase<Mater
if (entitys.Count > 0) if (entitys.Count > 0)
{ {
var checkBusinessType = entitys.FindAll(t => t.BusinessType != businessType);
foreach (var item in checkBusinessType)
{
checkList.Add(new ErrorExportDto(string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, $"客户物料号{item.SettleMaterialCode}业务类别导入错误", string.Empty));
}
var query = from arc in entitys var query = from arc in entitys
group arc by new { arc.SettleMaterialCode } group arc by new { arc.SettleMaterialCode }
into g into g
@ -83,10 +94,10 @@ public class MaterialRelationshipAppService : SettleAccountApplicationBase<Mater
} }
foreach (var item in entitys) foreach (var item in entitys)
{ {
var entity = _repository.FirstOrDefault(p => p.ErpMaterialCode == item.ErpMaterialCode && p.BusinessType == EnumBusinessType.BeiJian && p.SettleMaterialCode == item.SettleMaterialCode); var entity = _repository.FirstOrDefault(p => p.ErpMaterialCode == item.ErpMaterialCode && p.BusinessType == businessType && p.SettleMaterialCode == item.SettleMaterialCode);
if (entity == null) if (entity == null)
{ {
item.BusinessType = EnumBusinessType.BeiJian; item.BusinessType = businessType;
await _repository.InsertAsync(item).ConfigureAwait(false); await _repository.InsertAsync(item).ConfigureAwait(false);
} }
} }
@ -124,6 +135,15 @@ public class MaterialRelationshipAppService : SettleAccountApplicationBase<Mater
var dtos = ObjectMapper.Map<List<MaterialRelationship>, List<MaterialRelationshipDto>>(entities); var dtos = ObjectMapper.Map<List<MaterialRelationship>, List<MaterialRelationshipDto>>(entities);
return new PagedResultDto<MaterialRelationshipDto>(totalCount, dtos); return new PagedResultDto<MaterialRelationshipDto>(totalCount, dtos);
} }
/// <summary>
/// 批量删除
/// </summary>
[HttpPost]
public async Task<bool> DeleteListAsync(List<Guid> ids)
{
return await _repository.DeleteListAsync(ids).ConfigureAwait(false);
}
#endregion #endregion
#region 原方法(废弃) #region 原方法(废弃)

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

@ -4,6 +4,7 @@ using System.ComponentModel.DataAnnotations;
using System.Reflection; using System.Reflection;
using AutoMapper; using AutoMapper;
using SettleAccount.Domain.BQ; using SettleAccount.Domain.BQ;
using Volo.Abp.AutoMapper;
using Win.Sfs.SettleAccount.Boms; using Win.Sfs.SettleAccount.Boms;
using Win.Sfs.SettleAccount.BTNotConsignReports; using Win.Sfs.SettleAccount.BTNotConsignReports;
using Win.Sfs.SettleAccount.BTSeqKBDiffReports; using Win.Sfs.SettleAccount.BTSeqKBDiffReports;

7
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeEdiCompareDetailReport.cs

@ -173,5 +173,12 @@ namespace Win.Sfs.SettleAccount.Reports
[Display(Name = "WMS发货库位")] [Display(Name = "WMS发货库位")]
[ExporterHeader(DisplayName = "WMS发货库位")] [ExporterHeader(DisplayName = "WMS发货库位")]
public string ToLocCode { get; set; } public string ToLocCode { get; set; }
/// <summary>
/// 是否是当期
/// </summary>
[Display(Name = "当期")]
[ValueMapping("当期数据", true)]
[ValueMapping("", false)]
public bool IsCurrent { get; set; }
} }
} }

9
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeEdiCompareDiff.cs

@ -9,6 +9,11 @@ namespace Win.Sfs.SettleAccount.Reports
/// </summary> /// </summary>
public class SaSeEdiCompareDiff public class SaSeEdiCompareDiff
{ {
/// <summary>
/// 期间
/// </summary>
[Display(Name = "期间")]
public string Version { get; set; }
/// <summary> /// <summary>
/// 类型 /// 类型
/// </summary> /// </summary>
@ -119,6 +124,10 @@ namespace Win.Sfs.SettleAccount.Reports
/// </summary> /// </summary>
[Display(Name = "替换厂内物料号")] [Display(Name = "替换厂内物料号")]
public string ReplaceFactoryPartCode { get; set; } public string ReplaceFactoryPartCode { get; set; }
/// <summary>
/// 是否是当期
/// </summary>
public bool IsCurrent { get; set; }
} }
/// <summary> /// <summary>

4
code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisBBACSaSeEdiCompareExportService.cs

@ -104,6 +104,7 @@ namespace SettleAccount.Job.Services.Report
{ {
saSeEdiCompareDiffs = saSeEdiCompareDiffs.FindAll(p => p.PN == pn); saSeEdiCompareDiffs = saSeEdiCompareDiffs.FindAll(p => p.PN == pn);
} }
saSeEdiCompareDiffs.FindAll(t => t.Version == version.ToString()).ForEach(t => t.IsCurrent = true);
saSeEdiCompareDiffs = saSeEdiCompareDiffs.OrderBy(t => t.Category).ToList(); saSeEdiCompareDiffs = saSeEdiCompareDiffs.OrderBy(t => t.Category).ToList();
var excelExporter = new ExcelExporter(); var excelExporter = new ExcelExporter();
@ -133,6 +134,7 @@ namespace SettleAccount.Job.Services.Report
groupItem.Key.PN, groupItem.Key.PN,
groupItem.Key.CustomerPartCodeNoSpace, groupItem.Key.CustomerPartCodeNoSpace,
Qty = groupItem.Sum(t => t.Qty), Qty = groupItem.Sum(t => t.Qty),
Version = groupItem.Max(t => t.Version),
LU = groupItem.Max(t => t.LU), LU = groupItem.Max(t => t.LU),
SettleDate = groupItem.Max(t => t.SettleDate), SettleDate = groupItem.Max(t => t.SettleDate),
PartCode = groupItem.Max(t => t.PartCode), PartCode = groupItem.Max(t => t.PartCode),
@ -190,6 +192,7 @@ namespace SettleAccount.Job.Services.Report
from seEdi in temp.DefaultIfEmpty() from seEdi in temp.DefaultIfEmpty()
select new SaSeEdiCompareDiff() select new SaSeEdiCompareDiff()
{ {
Version = sa.Version.ToString(),
WmsBillNum = seEdi.WmsBillNum, WmsBillNum = seEdi.WmsBillNum,
ShippingDate = seEdi.ShippingDate, ShippingDate = seEdi.ShippingDate,
CustomerOfflineTime = sa.SettleDate, CustomerOfflineTime = sa.SettleDate,
@ -213,6 +216,7 @@ namespace SettleAccount.Job.Services.Report
from sa in temp.DefaultIfEmpty() from sa in temp.DefaultIfEmpty()
select new SaSeEdiCompareDiff() select new SaSeEdiCompareDiff()
{ {
Version = sa.Version.ToString(),
WmsBillNum = seEdi.WmsBillNum, WmsBillNum = seEdi.WmsBillNum,
ShippingDate = seEdi.ShippingDate, ShippingDate = seEdi.ShippingDate,
CustomerOfflineTime = sa.SettleDate, CustomerOfflineTime = sa.SettleDate,

4
code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisHBPOSaSeEdiCompareExportService.cs

@ -103,6 +103,7 @@ namespace SettleAccount.Job.Services.Report
{ {
saSeEdiCompareDiffs = saSeEdiCompareDiffs.FindAll(p => p.PN == pn); saSeEdiCompareDiffs = saSeEdiCompareDiffs.FindAll(p => p.PN == pn);
} }
saSeEdiCompareDiffs.FindAll(t => t.Version == version.ToString()).ForEach(t => t.IsCurrent = true);
saSeEdiCompareDiffs = saSeEdiCompareDiffs.OrderBy(t => t.Category).ToList(); saSeEdiCompareDiffs = saSeEdiCompareDiffs.OrderBy(t => t.Category).ToList();
var excelExporter = new ExcelExporter(); var excelExporter = new ExcelExporter();
@ -132,6 +133,7 @@ namespace SettleAccount.Job.Services.Report
groupItem.Key.PN, groupItem.Key.PN,
groupItem.Key.CustomerPartCodeNoSpace, groupItem.Key.CustomerPartCodeNoSpace,
Qty = groupItem.Sum(t => t.Qty), Qty = groupItem.Sum(t => t.Qty),
Version = groupItem.Max(t => t.Version),
LU = groupItem.Max(t => t.LU), LU = groupItem.Max(t => t.LU),
SettleDate = groupItem.Max(t => t.SettleDate), SettleDate = groupItem.Max(t => t.SettleDate),
PartCode = groupItem.Max(t => t.PartCode), PartCode = groupItem.Max(t => t.PartCode),
@ -189,6 +191,7 @@ namespace SettleAccount.Job.Services.Report
from seEdi in temp.DefaultIfEmpty() from seEdi in temp.DefaultIfEmpty()
select new SaSeEdiCompareDiff() select new SaSeEdiCompareDiff()
{ {
Version = sa.Version.ToString(),
WmsBillNum = seEdi.WmsBillNum, WmsBillNum = seEdi.WmsBillNum,
ShippingDate = seEdi.ShippingDate, ShippingDate = seEdi.ShippingDate,
CustomerOfflineTime = sa.SettleDate, CustomerOfflineTime = sa.SettleDate,
@ -212,6 +215,7 @@ namespace SettleAccount.Job.Services.Report
from sa in temp.DefaultIfEmpty() from sa in temp.DefaultIfEmpty()
select new SaSeEdiCompareDiff() select new SaSeEdiCompareDiff()
{ {
Version = sa.Version.ToString(),
WmsBillNum = seEdi.WmsBillNum, WmsBillNum = seEdi.WmsBillNum,
ShippingDate = seEdi.ShippingDate, ShippingDate = seEdi.ShippingDate,
CustomerOfflineTime = sa.SettleDate, CustomerOfflineTime = sa.SettleDate,

1
code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/MaiDanBBACSaSeCompareExportService.cs

@ -104,6 +104,7 @@ namespace SettleAccount.Job.Services.Report
{ {
pubSaSeCompareDiffs = pubSaSeCompareDiffs.FindAll(p => p.PN == pn); pubSaSeCompareDiffs = pubSaSeCompareDiffs.FindAll(p => p.PN == pn);
} }
pubSaSeCompareDiffs.FindAll(t => t.Version == version).ForEach(t => t.IsCurrent = true);
pubSaSeCompareDiffs = pubSaSeCompareDiffs.OrderBy(t => t.Category).ToList(); pubSaSeCompareDiffs = pubSaSeCompareDiffs.OrderBy(t => t.Category).ToList();
var excelExporter = new ExcelExporter(); var excelExporter = new ExcelExporter();
var items = _objectMapper.Map<List<SaSeCompareDiff>, List<SaSeCompareDetailReportMaiDanJianBBAC>>(pubSaSeCompareDiffs); var items = _objectMapper.Map<List<SaSeCompareDiff>, List<SaSeCompareDetailReportMaiDanJianBBAC>>(pubSaSeCompareDiffs);

1
code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/MaiDanHBPOSaSeCompareExportService.cs

@ -104,6 +104,7 @@ namespace SettleAccount.Job.Services.Report
{ {
pubSaSeCompareDiffs = pubSaSeCompareDiffs.FindAll(p => p.PN == pn); pubSaSeCompareDiffs = pubSaSeCompareDiffs.FindAll(p => p.PN == pn);
} }
pubSaSeCompareDiffs.FindAll(t => t.Version == version).ForEach(t => t.IsCurrent = true);
pubSaSeCompareDiffs = pubSaSeCompareDiffs.OrderBy(t => t.Category).ToList(); pubSaSeCompareDiffs = pubSaSeCompareDiffs.OrderBy(t => t.Category).ToList();
var excelExporter = new ExcelExporter(); var excelExporter = new ExcelExporter();
var items = _objectMapper.Map<List<SaSeCompareDiff>, List<SaSeCompareDetailReportMaiDanJianHBPO>>(pubSaSeCompareDiffs); var items = _objectMapper.Map<List<SaSeCompareDiff>, List<SaSeCompareDetailReportMaiDanJianHBPO>>(pubSaSeCompareDiffs);

5
code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SeEdiCompareExportBaseService.cs

@ -38,6 +38,11 @@ namespace SettleAccount.Job.Services.Report
/// <summary> /// <summary>
/// 获取发运、Eid比对数据 /// 获取发运、Eid比对数据
/// </summary> /// </summary>
/// <remarks>
/// 输出全量的无发运的Edi数据
/// 输出全量的无Edi的发运数据
/// 输出检索时间段内的有Edi有发运的数据
/// </remarks>
public ExcelExporter GetSeEdiCompareData<TSe, TEdi, TCompareReport>(DateTime seStartDateTime, DateTime seEndDateTime, EnumBusinessType businessType) public ExcelExporter GetSeEdiCompareData<TSe, TEdi, TCompareReport>(DateTime seStartDateTime, DateTime seEndDateTime, EnumBusinessType businessType)
where TSe : JisSeBase where TSe : JisSeBase
where TEdi : SE_EDI where TEdi : SE_EDI

Loading…
Cancel
Save