mahao 1 year ago
parent
commit
14dee41d4c
  1. 3
      code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisBBACSeEdiCompareExportService.cs
  2. 3
      code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisHBPOSeEdiCompareExportService.cs
  3. 11
      code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SeEdiCompareExportBaseService.cs

3
code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisBBACSeEdiCompareExportService.cs

@ -52,12 +52,11 @@ namespace SettleAccount.Job.Services.Report
var strSeStartDateTime = property.Where(p => p.Name == "SeStartDateTime").FirstOrDefault().Value; var strSeStartDateTime = property.Where(p => p.Name == "SeStartDateTime").FirstOrDefault().Value;
var strSeEndDateTime = property.Where(p => p.Name == "SeEndDateTime").FirstOrDefault().Value; var strSeEndDateTime = property.Where(p => p.Name == "SeEndDateTime").FirstOrDefault().Value;
var businessTypeDisplayName = EnumBusinessType.JisBBAC.GetAttributeOfType<DisplayAttribute>()?.Name?? EnumBusinessType.JisBBAC.ToString();
var seStartDateTime = DateTime.Parse(strSeStartDateTime); var seStartDateTime = DateTime.Parse(strSeStartDateTime);
var seEndDateTime = DateTime.Parse(strSeEndDateTime); var seEndDateTime = DateTime.Parse(strSeEndDateTime);
var filename = exportName.FirstOrDefault(); var filename = exportName.FirstOrDefault();
var excelExporter = GetSeEdiCompareData<BBAC_SE_DETAIL, BBAC_SE_EDI, SeEidCompareReportJisBBAC>(seStartDateTime, seEndDateTime, businessTypeDisplayName); var excelExporter = GetSeEdiCompareData<BBAC_SE_DETAIL, BBAC_SE_EDI, SeEidCompareReportJisBBAC>(seStartDateTime, seEndDateTime, EnumBusinessType.JisBBAC);
var result = excelExporter.ExportAppendDataAsByteArray(); var result = excelExporter.ExportAppendDataAsByteArray();
result.ShouldNotBeNull(); result.ShouldNotBeNull();
_fileContainer.SaveAsync(filename, result.Result, true); _fileContainer.SaveAsync(filename, result.Result, true);

3
code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisHBPOSeEdiCompareExportService.cs

@ -49,12 +49,11 @@ namespace SettleAccount.Job.Services.Report
var strSeStartDateTime = property.Where(p => p.Name == "SeStartDateTime").FirstOrDefault().Value; var strSeStartDateTime = property.Where(p => p.Name == "SeStartDateTime").FirstOrDefault().Value;
var strSeEndDateTime = property.Where(p => p.Name == "SeEndDateTime").FirstOrDefault().Value; var strSeEndDateTime = property.Where(p => p.Name == "SeEndDateTime").FirstOrDefault().Value;
var businessTypeDisplayName = EnumBusinessType.JisHBPO.GetAttributeOfType<DisplayAttribute>()?.Name ?? EnumBusinessType.JisHBPO.ToString();
var seStartDateTime = DateTime.Parse(strSeStartDateTime); var seStartDateTime = DateTime.Parse(strSeStartDateTime);
var seEndDateTime = DateTime.Parse(strSeEndDateTime); var seEndDateTime = DateTime.Parse(strSeEndDateTime);
var filename = exportName.FirstOrDefault(); var filename = exportName.FirstOrDefault();
var excelExporter = GetSeEdiCompareData<HBPO_SE_DETAIL, HBPO_SE_EDI, SeEidCompareReportJisHBPO>(seStartDateTime, seEndDateTime, businessTypeDisplayName); var excelExporter = GetSeEdiCompareData<HBPO_SE_DETAIL, HBPO_SE_EDI, SeEidCompareReportJisHBPO>(seStartDateTime, seEndDateTime, EnumBusinessType.JisHBPO);
var result = excelExporter.ExportAppendDataAsByteArray(); var result = excelExporter.ExportAppendDataAsByteArray();
result.ShouldNotBeNull(); result.ShouldNotBeNull();
_fileContainer.SaveAsync(filename, result.Result, true); _fileContainer.SaveAsync(filename, result.Result, true);

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

@ -1,8 +1,10 @@
using System; using System;
using System.ComponentModel.DataAnnotations;
using System.Linq; using System.Linq;
using Magicodes.ExporterAndImporter.Core.Extension; using Magicodes.ExporterAndImporter.Core.Extension;
using Magicodes.ExporterAndImporter.Excel; using Magicodes.ExporterAndImporter.Excel;
using Microsoft.AspNetCore.SignalR; using Microsoft.AspNetCore.SignalR;
using Microsoft.OpenApi.Extensions;
using SettleAccount.Bases; using SettleAccount.Bases;
using SettleAccount.Domain.BQ; using SettleAccount.Domain.BQ;
using SettleAccount.Job.SignalR; using SettleAccount.Job.SignalR;
@ -36,11 +38,12 @@ namespace SettleAccount.Job.Services.Report
/// <summary> /// <summary>
/// 获取发运、Eid比对数据 /// 获取发运、Eid比对数据
/// </summary> /// </summary>
public ExcelExporter GetSeEdiCompareData<TSe, TEdi, TCompareReport>(DateTime seStartDateTime, DateTime seEndDateTime, string businessTypeDisplayName) 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
where TCompareReport : SeEidCompareReport, new() where TCompareReport : SeEidCompareReport, new()
{ {
var businessTypeDisplayName = businessType.GetAttributeOfType<DisplayAttribute>()?.Name ?? businessType.ToString();
// Sheet行数 // Sheet行数
var maxRowNumberOnASheet = AppConst.DefaultRowNumberOnASheet; var maxRowNumberOnASheet = AppConst.DefaultRowNumberOnASheet;
var excelExporterAttribute = typeof(TCompareReport).GetAttribute<ExcelExporterAttribute>(inherit: true); var excelExporterAttribute = typeof(TCompareReport).GetAttribute<ExcelExporterAttribute>(inherit: true);
@ -72,7 +75,9 @@ namespace SettleAccount.Job.Services.Report
t.Remark = string.IsNullOrEmpty(t.SequenceNumber) ? "PJIS出单,AJIS未上" : ""; t.Remark = string.IsNullOrEmpty(t.SequenceNumber) ? "PJIS出单,AJIS未上" : "";
}); });
//无EDI有发运 //无EDI有发运
var notHaveEdiHaveSeList = _settleAccountDbContext.Set<TSe>().Where(t => t.IsHaveEdiData == false) var notHaveEdiHaveSeList = _settleAccountDbContext.Set<TSe>()
.Where(t => t.BusinessType == businessType)
.Where(t => t.IsHaveEdiData == false)
.GroupBy(t => new { t.PN, t.CustomerPartCodeNoSpace }) .GroupBy(t => new { t.PN, t.CustomerPartCodeNoSpace })
.Select(t => new TCompareReport() .Select(t => new TCompareReport()
{ {
@ -107,7 +112,7 @@ namespace SettleAccount.Job.Services.Report
LineStationCode = groupItem.Max(t => t.LineStationCode) LineStationCode = groupItem.Max(t => t.LineStationCode)
}; };
var seGroup = from se in _settleAccountDbContext.Set<TSe>() var seGroup = from se in _settleAccountDbContext.Set<TSe>()
where se.IsHaveEdiData == true && se.BillTime >= seStartDateTime && se.BillTime <= seEndDateTime where se.BusinessType == businessType && se.IsHaveEdiData == true && se.BillTime >= seStartDateTime && se.BillTime <= seEndDateTime
group se by new { se.PN, se.CustomerPartCodeNoSpace } into groupItem group se by new { se.PN, se.CustomerPartCodeNoSpace } into groupItem
select new select new
{ {

Loading…
Cancel
Save