Browse Source

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

master
zhaoxinyu 12 months ago
parent
commit
6d3083c63d
  1. 19
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/BA_SERVICE.cs
  2. 21
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/CurdBaseAppService.cs
  3. 20
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/PD_SERVICE.cs
  4. 4
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SeEidCompareReport.cs
  5. 30
      code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SeEdiCompareExportBaseService.cs

19
code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/BA_SERVICE.cs

@ -389,15 +389,16 @@ namespace Win.Sfs.SettleAccount.Bases
string _fileName = $"{classDisplayName}_{Guid.NewGuid().ToString()}.xlsx"; string _fileName = $"{classDisplayName}_{Guid.NewGuid().ToString()}.xlsx";
byte[] result = null; byte[] result = null;
switch (input.FileType) //switch (input.FileType)
{ //{
case 0: // case 0:
result = await _csv.ExportAsByteArray(dtoDetails).ConfigureAwait(false); // result = await _csv.ExportAsByteArray(dtoDetails).ConfigureAwait(false);
break; // break;
case 1: // case 1:
result = await _excel.ExportAsByteArray(dtoDetails).ConfigureAwait(false); // result = await _excel.ExportAsByteArray(dtoDetails).ConfigureAwait(false);
break; // break;
} //}
result = await _excel.ExportAsByteArray(dtoDetails).ConfigureAwait(false);
result.ShouldNotBeNull(); result.ShouldNotBeNull();
//保存导出文件到服务器存成二进制 //保存导出文件到服务器存成二进制

21
code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/CurdBaseAppService.cs

@ -1,4 +1,4 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using System.Reflection; using System.Reflection;
@ -73,15 +73,16 @@ namespace Win.Sfs.SettleAccount.Bases
string _fileName = $"{classDisplayName}_{Guid.NewGuid().ToString()}.xlsx"; string _fileName = $"{classDisplayName}_{Guid.NewGuid().ToString()}.xlsx";
byte[] result = null; byte[] result = null;
switch (input.FileType) //switch (input.FileType)
{ //{
case 0: // case 0:
result = await _csv.ExportAsByteArray(dtoDetails).ConfigureAwait(false); // result = await _csv.ExportAsByteArray(dtoDetails).ConfigureAwait(false);
break; // break;
case 1: // case 1:
result = await _excel.ExportAsByteArray(dtoDetails).ConfigureAwait(false); // result = await _excel.ExportAsByteArray(dtoDetails).ConfigureAwait(false);
break; // break;
} //}
result = await _excel.ExportAsByteArray(dtoDetails).ConfigureAwait(false);
result.ShouldNotBeNull(); result.ShouldNotBeNull();
//保存导出文件到服务器存成二进制 //保存导出文件到服务器存成二进制

20
code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/PD_SERVICE.cs

@ -114,15 +114,17 @@ namespace Win.Sfs.SettleAccount.Bases
string _fileName = $"{classDisplayName}_{Guid.NewGuid().ToString()}.xlsx"; string _fileName = $"{classDisplayName}_{Guid.NewGuid().ToString()}.xlsx";
byte[] result = null; byte[] result = null;
switch (input.FileType) //switch (input.FileType)
{ //{
case 0: // case 0:
result = await _csv.ExportAsByteArray(dtoDetails).ConfigureAwait(false); // result = await _csv.ExportAsByteArray(dtoDetails).ConfigureAwait(false);
break; // break;
case 1: // case 1:
result = await _excel.ExportAsByteArray(dtoDetails).ConfigureAwait(false); // result = await _excel.ExportAsByteArray(dtoDetails).ConfigureAwait(false);
break; // break;
} //}
result = await _excel.ExportAsByteArray(dtoDetails).ConfigureAwait(false);
result.ShouldNotBeNull(); result.ShouldNotBeNull();
//保存导出文件到服务器存成二进制 //保存导出文件到服务器存成二进制

4
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SeEidCompareReport.cs

@ -92,7 +92,7 @@ namespace Win.Sfs.SettleAccount.Reports
/// </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>
@ -122,7 +122,7 @@ namespace Win.Sfs.SettleAccount.Reports
/// </summary> /// </summary>
[Display(Name = "客户下线时间")] [Display(Name = "客户下线时间")]
[ExporterHeader(DisplayName = "客户下线时间", Format = "yyyy-MM-dd")] [ExporterHeader(DisplayName = "客户下线时间", Format = "yyyy-MM-dd")]
public DateTime? AssemblyDate { get; set; } public DateTime? AssemblyDate { get; set; }
/// <summary> /// <summary>
/// 小总成号 /// 小总成号
/// </summary> /// </summary>

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

@ -1,4 +1,5 @@
using System; using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using System.Linq; using System.Linq;
using Magicodes.ExporterAndImporter.Core.Extension; using Magicodes.ExporterAndImporter.Core.Extension;
@ -10,6 +11,7 @@ using SettleAccount.Domain.BQ;
using SettleAccount.Job.SignalR; using SettleAccount.Job.SignalR;
using Win.Sfs.SettleAccount; using Win.Sfs.SettleAccount;
using Win.Sfs.SettleAccount.Consts; using Win.Sfs.SettleAccount.Consts;
using Win.Sfs.SettleAccount.Entities.BQ.Syncs;
using Win.Sfs.SettleAccount.Reports; using Win.Sfs.SettleAccount.Reports;
namespace SettleAccount.Job.Services.Report namespace SettleAccount.Job.Services.Report
@ -58,7 +60,7 @@ namespace SettleAccount.Job.Services.Report
maxRowNumberOnASheet = excelExporterAttribute.MaxRowNumberOnASheet > 0 ? excelExporterAttribute.MaxRowNumberOnASheet : maxRowNumberOnASheet; maxRowNumberOnASheet = excelExporterAttribute.MaxRowNumberOnASheet > 0 ? excelExporterAttribute.MaxRowNumberOnASheet : maxRowNumberOnASheet;
} }
//有EDI无发运 //有EDI无发运
var haveEdiNotHaveSeList = _settleAccountDbContext.Set<TEdi>().Where(t => t.IsHaveSeData == false) var haveEdiNotHaveSeList = _settleAccountDbContext.Set<TEdi>().Where(t => t.IsHaveSeData == false && t.State==0)
.GroupBy(t => new { t.PN, t.CustomerPartCodeNoSpace }) .GroupBy(t => new { t.PN, t.CustomerPartCodeNoSpace })
.Select(t => new TCompareReport() .Select(t => new TCompareReport()
{ {
@ -79,9 +81,25 @@ namespace SettleAccount.Job.Services.Report
t.SequenceNumber = GetSequenceNumberDate(t.SequenceNumber); t.SequenceNumber = GetSequenceNumberDate(t.SequenceNumber);
t.Remark = string.IsNullOrEmpty(t.SequenceNumber) ? "PJIS出单,AJIS未上" : ""; t.Remark = string.IsNullOrEmpty(t.SequenceNumber) ? "PJIS出单,AJIS未上" : "";
}); });
List<EnumProTpe> proType = new List<EnumProTpe>();
proType.Add(EnumProTpe.Jit发货);
proType.Add(EnumProTpe.Jit补发订单);
proType.Add(EnumProTpe.Jis发货);
proType.Add(EnumProTpe.Jis补发订单);
proType.Add(EnumProTpe.Jit备件);
proType.Add(EnumProTpe.Jis备件);
proType.Add(EnumProTpe.Jit买单件);
proType.Add(EnumProTpe.Jis买单件);
proType.Add(EnumProTpe.);
//无EDI有发运 //无EDI有发运
var notHaveEdiHaveSeList = _settleAccountDbContext.Set<TSe>() var notHaveEdiHaveSeList = _settleAccountDbContext.Set<TSe>()
.Where(t => t.BusinessType == businessType && t.BillTime >= seStartDateTime && t.BillTime <= seEndDateTime) .Where(t => t.BusinessType == businessType && t.BillTime >= seStartDateTime && t.BillTime <= seEndDateTime)
.Where(t=>t.State==0)
.Where(t => proType.Contains(t.ProType))
.Where(t => t.IsHaveEdiData == false) .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()
@ -89,7 +107,7 @@ namespace SettleAccount.Job.Services.Report
Category = "JIS", Category = "JIS",
WmsBillNum = t.Max(t => t.BillNum), WmsBillNum = t.Max(t => t.BillNum),
MESConfigCode = t.Max(t => t.MESConfigCode), MESConfigCode = t.Max(t => t.MESConfigCode),
ShippingDate = t.Max(t => t.BillTime), ShippingDate = t.Max(t => t.BillTime),
PN = t.Max(t => t.PN), PN = t.Max(t => t.PN),
Seq = t.Max(t => t.Seq), Seq = t.Max(t => t.Seq),
PjsNum = t.Max(t => t.PjsNum), PjsNum = t.Max(t => t.PjsNum),
@ -103,7 +121,7 @@ namespace SettleAccount.Job.Services.Report
}).ToList(); }).ToList();
//有EDI有发运 //有EDI有发运
var ediGroup = from edi in _settleAccountDbContext.Set<TEdi>() var ediGroup = from edi in _settleAccountDbContext.Set<TEdi>()
where edi.IsDeleted == false && edi.IsHaveSeData == true where edi.IsDeleted == false && edi.IsHaveSeData == true && edi.State == 0
group edi by new { edi.PN, edi.CustomerPartCodeNoSpace } into groupItem group edi by new { edi.PN, edi.CustomerPartCodeNoSpace } into groupItem
select new select new
{ {
@ -116,7 +134,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.BusinessType == businessType && se.IsHaveEdiData == true && se.BillTime >= seStartDateTime && se.BillTime <= seEndDateTime where se.BusinessType == businessType && se.IsHaveEdiData == true && se.BillTime >= seStartDateTime && se.BillTime <= seEndDateTime && se.State==0 && proType.Contains(se.ProType)
group se by new { se.PN, se.CustomerPartCodeNoSpace } into groupItem group se by new { se.PN, se.CustomerPartCodeNoSpace } into groupItem
select new select new
{ {
@ -126,7 +144,7 @@ namespace SettleAccount.Job.Services.Report
LU = groupItem.Max(t => t.LU), LU = groupItem.Max(t => t.LU),
BillNum = groupItem.Max(t => t.BillNum), BillNum = groupItem.Max(t => t.BillNum),
MESConfigCode = groupItem.Max(t => t.MESConfigCode), MESConfigCode = groupItem.Max(t => t.MESConfigCode),
BillTime = groupItem.Max(t => t.BillTime), BillTime = groupItem.Max(t => t.BillTime),
Seq = groupItem.Max(t => t.Seq), Seq = groupItem.Max(t => t.Seq),
PjsNum = groupItem.Max(t => t.PjsNum), PjsNum = groupItem.Max(t => t.PjsNum),
ToLoc = groupItem.Max(t => t.ToLoc), ToLoc = groupItem.Max(t => t.ToLoc),
@ -147,7 +165,7 @@ namespace SettleAccount.Job.Services.Report
SequenceNumber = edi.Extend3, SequenceNumber = edi.Extend3,
ParType = edi.Extend2, ParType = edi.Extend2,
MESConfigCode = se.MESConfigCode, MESConfigCode = se.MESConfigCode,
ShippingDate = se.BillTime, ShippingDate = se.BillTime,
PN = se.PN, PN = se.PN,
Seq = se.Seq, Seq = se.Seq,
PjsNum = se.PjsNum, PjsNum = se.PjsNum,

Loading…
Cancel
Save