Browse Source

提交

master
mahao 1 year ago
parent
commit
c9bea580c4
  1. 2
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisHBPOSeSyncAppService.cs
  2. 7
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisHBPOSeSyncBaseAppService.cs
  3. 6
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/JisBBACEidSeCompareReport.cs
  4. 196
      code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisBBACEdiSeCompareExportService.cs

2
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisHBPOSeSyncAppService.cs

@ -39,7 +39,7 @@ public class JisHBPOSeSyncAppService : JisHBPOSeSyncBaseAppService, IJobService
EnumDeliverSubBillType.HBPO, EnumDeliverSubBillType.HBPO,
EnumDeliverSubBillType.HBPO EnumDeliverSubBillType.HBPO
}, },
BusinessType = EnumBusinessType.MaiDanJianHBPO BusinessType = EnumBusinessType.JisHBPO
}; };
} }

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

@ -8,7 +8,6 @@ using EFCore.BulkExtensions;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using SettleAccount.Domain.BQ; using SettleAccount.Domain.BQ;
using Volo.Abp.Application.Services; using Volo.Abp.Application.Services;
using Volo.Abp.Uow;
using Win.Sfs.SettleAccount.Entities.BQ.Managers; using Win.Sfs.SettleAccount.Entities.BQ.Managers;
using Win.Sfs.SettleAccount.EntityFrameworkCore; using Win.Sfs.SettleAccount.EntityFrameworkCore;
using Win.Sfs.SettleAccount.MaterialRelationships; using Win.Sfs.SettleAccount.MaterialRelationships;
@ -88,11 +87,10 @@ public class JisHBPOSeSyncBaseAppService : ApplicationService, IInvocable
/// <summary> /// <summary>
/// 同步JitRecord /// 同步JitRecord
/// </summary> /// </summary>
[UnitOfWork]
private async Task SyncJitRecordAsync() private async Task SyncJitRecordAsync()
{ {
//同步表名称 //同步表名称
var syncTableName = "JisBBACSeSync_Jit"; var syncTableName = $"{SeSyncConfigInfo.SyncTableName}_Jit";
//同步发运主类型 //同步发运主类型
var deliverBillType = SeSyncConfigInfo.SyncDeliverBillType; var deliverBillType = SeSyncConfigInfo.SyncDeliverBillType;
//同步发运子类型 //同步发运子类型
@ -152,11 +150,10 @@ public class JisHBPOSeSyncBaseAppService : ApplicationService, IInvocable
/// <summary> /// <summary>
/// 同步JisRecord /// 同步JisRecord
/// </summary> /// </summary>
[UnitOfWork]
private async Task SyncJisRecordAsync() private async Task SyncJisRecordAsync()
{ {
//同步表名称 //同步表名称
var syncTableName = "JisBBACSeSync_Jit"; var syncTableName = $"{SeSyncConfigInfo.SyncTableName}_Jis";
//同步发运主类型 //同步发运主类型
var deliverBillType = SeSyncConfigInfo.SyncDeliverBillType; var deliverBillType = SeSyncConfigInfo.SyncDeliverBillType;
//同步发运子类型 //同步发运子类型

6
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/JisBBACEidSeCompareReport.cs

@ -65,7 +65,7 @@ public class JisBBACEidSeCompareExport
/// </summary> /// </summary>
[Display(Name = "发货日期")] [Display(Name = "发货日期")]
[ExporterHeader(DisplayName = "发货日期", Format = "yyyy-MM-dd")] [ExporterHeader(DisplayName = "发货日期", Format = "yyyy-MM-dd")]
public DateTime ShippingDate { get; set; } public DateTime? ShippingDate { get; set; }
/// <summary> /// <summary>
/// 生产码 /// 生产码
/// </summary> /// </summary>
@ -119,13 +119,13 @@ public class JisBBACEidSeCompareExport
/// </summary> /// </summary>
[Display(Name = "客户下线时间")] [Display(Name = "客户下线时间")]
[ExporterHeader(DisplayName = "客户下线时间")] [ExporterHeader(DisplayName = "客户下线时间")]
public DateTime AssemblyDate { get; set; } public DateTime? AssemblyDate { get; set; }
/// <summary> /// <summary>
/// 小总成号 /// 小总成号
/// </summary> /// </summary>
[Display(Name = "小总成号")] [Display(Name = "小总成号")]
[ExporterHeader(DisplayName = "小总成号")] [ExporterHeader(DisplayName = "小总成号")]
public DateTime MatchNumber { get; set; } public string MatchNumber { get; set; }
/// <summary> /// <summary>
/// 注塑码 /// 注塑码
/// </summary> /// </summary>

196
code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisBBACEdiSeCompareExportService.cs

@ -68,67 +68,123 @@ namespace SettleAccount.Job.Services.Report
var pn = property.Where(p => p.Name == "PN").FirstOrDefault().Value; var pn = property.Where(p => p.Name == "PN").FirstOrDefault().Value;
var seStartDateTime = property.Where(p => p.Name == "SeStartDateTime").FirstOrDefault().Value; var seStartDateTime = property.Where(p => p.Name == "SeStartDateTime").FirstOrDefault().Value;
var seEndDateTime = property.Where(p => p.Name == "SeEndDateTime").FirstOrDefault().Value; var seEndDateTime = property.Where(p => p.Name == "SeEndDateTime").FirstOrDefault().Value;
var filename = exportName.FirstOrDefault();
//有EDI的发运数据 //有EDI无发运
// var haveEidSesGroup = _settleAccountDbContext.Set<BBAC_SE_DETAIL>().Where(t => t.IsHaveEdiData == true).GroupBy(t => new { t.PN, t.LU }).Select(t => var haveEdiNotHaveSe = _settleAccountDbContext.Set<BBAC_SE_EDI>().Where(t => t.IsHaveSeData == false)
//t.First().SetQty(t.Sum(q => q.Qty))).ToList(); .GroupBy(t => new { t.LU, t.PN })
var seDetailGroup = _settleAccountDbContext.Set<BBAC_SE_DETAIL>().Where(t => t.IsHaveEdiData == false).GroupBy(t => new { t.PN, t.LU }).Select(t => new { t.Key.PN, t.Key.LU }).ToList(); .Select(t => new JisBBACEidSeCompareExport()
{
// var haveEidSesGroup = _settleAccountDbContext.Set<BBAC_SE_DETAIL>().Where(t => t.IsHaveEdiData == true).GroupBy(t => new { t.PN, t.LU }).Select(t => Category = "JIS",
//t.FirstOrDefault()).ToList(); WmsBillNum = default,
CarModeCode = default,
var dddd = new JisBBACEidSeCompareExport() LineStationcode = default,
{ SequenceNumber = default,
Category = default, ParType = default,
WmsBillNum = default, MESConfigCode = default,
CarModeCode = default, ShippingDate = null,
LineStationcode = default, PN = default,
SequenceNumber = default, = default,
ParType = default, PJIS日顺序号 = default,
MESConfigCode = default, MaterialNumber = default,
ShippingDate = default, MaterialDes = default,
PN = default, SEQty = default,
= default, EdiQty = default,
PJIS日顺序号 = default, DiffQty = default,
MaterialNumber = default, AssemblyDate = null,
MaterialDes = default, MatchNumber = default,
SEQty = default, InjectionCode = default,
EdiQty = default, MateType = default,
DiffQty = default, DiffDesc = default
AssemblyDate = default, }).ToList();
MatchNumber = default, //无EDI有发运
InjectionCode = default, var notHaveEdiHaveSe = _settleAccountDbContext.Set<BBAC_SE_DETAIL>().Where(t => t.IsHaveEdiData == false)
MateType = default, .GroupBy(t => new { t.LU, t.PN })
DiffDesc = default .Select(t => new JisBBACEidSeCompareExport()
}; {
Category = default,
var haveEidSesGroup = _settleAccountDbContext.Set<BBAC_SE_DETAIL>().Where(t => t.IsHaveEdiData == true).GroupBy(t => new { t.PN, t.LU }).Select(t => new JisBBACEidSeCompareExport() WmsBillNum = default,
{ CarModeCode = default,
Category = default, LineStationcode = default,
WmsBillNum = default, SequenceNumber = default,
CarModeCode = default, ParType = default,
LineStationcode = default, MESConfigCode = default,
SequenceNumber = default, ShippingDate = null,
ParType = default, PN = default,
MESConfigCode = default, = default,
ShippingDate = default, PJIS日顺序号 = default,
PN = default, MaterialNumber = default,
= default, MaterialDes = default,
PJIS日顺序号 = default, SEQty = default,
MaterialNumber = default, EdiQty = default,
MaterialDes = default, DiffQty = default,
SEQty = default, AssemblyDate = null,
EdiQty = default, MatchNumber = default,
DiffQty = default, InjectionCode = default,
AssemblyDate = default, MateType = default,
MatchNumber = default, DiffDesc = default
InjectionCode = default, }).ToList();
MateType = default,
DiffDesc = default
}).ToList(); // //有EDI的发运数据
// //var haveEidSesGroup = _settleAccountDbContext.Set<BBAC_SE_DETAIL>().Where(t => t.IsHaveEdiData == true).GroupBy(t => new { t.PN, t.LU }).Select(t =>
var haveEidSesGroup22 = _settleAccountDbContext.Set<BBAC_SE_DETAIL>().Where(t => t.IsHaveEdiData == true)?.GroupBy(t => new { t.PN, t.LU }).Select(t => // //t.First().SetQty(t.Sum(q => q.Qty))).ToList();
t.FirstOrDefault()).ToList(); // var seDetailGroup = _settleAccountDbContext.Set<BBAC_SE_DETAIL>().Where(t => t.IsHaveEdiData == false).GroupBy(t => new { t.PN, t.LU }).Select(t => new { t.Key.PN, t.Key.LU }).ToList();
// // var haveEidSesGroup = _settleAccountDbContext.Set<BBAC_SE_DETAIL>().Where(t => t.IsHaveEdiData == true).GroupBy(t => new { t.PN, t.LU }).Select(t =>
// //t.FirstOrDefault()).ToList();
// var dddd = new JisBBACEidSeCompareExport()
// {
// Category = default,
// WmsBillNum = default,
// CarModeCode = default,
// LineStationcode = default,
// SequenceNumber = default,
// ParType = default,
// MESConfigCode = default,
// ShippingDate = default,
// PN = default,
// 序列号 = default,
// PJIS日顺序号 = default,
// MaterialNumber = default,
// MaterialDes = default,
// SEQty = default,
// EdiQty = default,
// DiffQty = default,
// AssemblyDate = default,
// MatchNumber = default,
// InjectionCode = default,
// MateType = default,
// DiffDesc = default
// };
// var haveEidSesGroup = _settleAccountDbContext.Set<BBAC_SE_DETAIL>().Where(t => t.IsHaveEdiData == true).GroupBy(t => new { t.PN, t.LU }).Select(t => new JisBBACEidSeCompareExport()
// {
// Category = default,
// WmsBillNum = default,
// CarModeCode = default,
// LineStationcode = default,
// SequenceNumber = default,
// ParType = default,
// MESConfigCode = default,
// ShippingDate = default,
// PN = default,
// 序列号 = default,
// PJIS日顺序号 = default,
// MaterialNumber = default,
// MaterialDes = default,
// SEQty = default,
// EdiQty = default,
// DiffQty = default,
// AssemblyDate = default,
// MatchNumber = default,
// InjectionCode = default,
// MateType = default,
// DiffDesc = default
// }).ToList();
// var haveEidSesGroup22 = _settleAccountDbContext.Set<BBAC_SE_DETAIL>().Where(t => t.IsHaveEdiData == true)?.GroupBy(t => new { t.PN, t.LU }).Select(t =>
//t.FirstOrDefault()).ToList();
//有发运的EDI数据 //有发运的EDI数据
//var haveSeEidsGroup = _settleAccountDbContext.Set<BBAC_SE_EDI>().Where(t => t.IsDeleted == false && t.IsHaveSeData == true).GroupBy(t => new { t.PN, t.LU }).Select(t => t.First().SetQty(t.Sum(q => q.Qty))).ToList(); //var haveSeEidsGroup = _settleAccountDbContext.Set<BBAC_SE_EDI>().Where(t => t.IsDeleted == false && t.IsHaveSeData == true).GroupBy(t => new { t.PN, t.LU }).Select(t => t.First().SetQty(t.Sum(q => q.Qty))).ToList();
@ -173,16 +229,16 @@ t.FirstOrDefault()).ToList();
////无EDI有发运 ////无EDI有发运
//var notHaveEdiHaveSeCompareExports = haveEidHaveSes.ToList(); //var notHaveEdiHaveSeCompareExports = haveEidHaveSes.ToList();
//ExcelExporter excelExporter = new ExcelExporter(); ExcelExporter excelExporter = new ExcelExporter();
//excelExporter excelExporter
// .Append(haveEdiNotHaveSeCompareExports, $"BBACEDI数据和发货对比") .Append(haveEdiNotHaveSe.ToList(), $"BBACEDI数据和发货对比")
// .SeparateBySheet() .SeparateBySheet()
// .Append(notHaveEdiHaveSeCompareExports, $"BBAC发货和EDI数据对比") .Append(notHaveEdiHaveSe.ToList(), $"BBAC发货和EDI数据对比")
// .SeparateBySheet(); .SeparateBySheet();
//var result = excelExporter.ExportAppendDataAsByteArray(); var result = excelExporter.ExportAppendDataAsByteArray();
//result.ShouldNotBeNull(); result.ShouldNotBeNull();
////_fileContainer.SaveAsync(filename, result.Result, true); _fileContainer.SaveAsync(filename, result.Result, true);
//Notify(); //Notify();
return id.ToString(); return id.ToString();

Loading…
Cancel
Save