mahao 1 year ago
parent
commit
1691e4e70f
  1. 3
      code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisBBACSeEdiCompareExportService.cs
  2. 12
      code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/PubSaSeCompareExportService.cs
  3. 36
      code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SaSeCompareExportBaseService.cs

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

@ -3,8 +3,6 @@ using System.Collections.Generic;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using System.Linq; using System.Linq;
using System.Linq.Dynamic.Core; using System.Linq.Dynamic.Core;
using Magicodes.ExporterAndImporter.Core.Extension;
using Magicodes.ExporterAndImporter.Excel;
using Microsoft.AspNetCore.SignalR; using Microsoft.AspNetCore.SignalR;
using Microsoft.OpenApi.Extensions; using Microsoft.OpenApi.Extensions;
using SettleAccount.Domain.BQ; using SettleAccount.Domain.BQ;
@ -17,7 +15,6 @@ using Volo.Abp.DependencyInjection;
using Volo.Abp.ObjectMapping; using Volo.Abp.ObjectMapping;
using Win.Sfs.BaseData.ImportExcelCommon; using Win.Sfs.BaseData.ImportExcelCommon;
using Win.Sfs.SettleAccount; using Win.Sfs.SettleAccount;
using Win.Sfs.SettleAccount.Consts;
using Win.Sfs.SettleAccount.Reports; using Win.Sfs.SettleAccount.Reports;
namespace SettleAccount.Job.Services.Report namespace SettleAccount.Job.Services.Report

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

@ -1,15 +1,12 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using System.Drawing;
using System.Linq; using System.Linq;
using Magicodes.ExporterAndImporter.Excel; using Magicodes.ExporterAndImporter.Excel;
using Microsoft.AspNetCore.SignalR; using Microsoft.AspNetCore.SignalR;
using Microsoft.OpenApi.Extensions; using Microsoft.OpenApi.Extensions;
using SettleAccount.Bases;
using SettleAccount.Domain.BQ; using SettleAccount.Domain.BQ;
using SettleAccount.Job.SignalR; using SettleAccount.Job.SignalR;
using ShardingCore.Extensions;
using Shouldly; using Shouldly;
using TaskJob.EventArgs; using TaskJob.EventArgs;
using TaskJob.Interfaces; using TaskJob.Interfaces;
@ -19,8 +16,8 @@ using Volo.Abp.ObjectMapping;
using Win.Sfs.BaseData.ImportExcelCommon; using Win.Sfs.BaseData.ImportExcelCommon;
using Win.Sfs.SettleAccount; using Win.Sfs.SettleAccount;
using Win.Sfs.SettleAccount.Entities.BQ; using Win.Sfs.SettleAccount.Entities.BQ;
using Win.Sfs.SettleAccount.Enums;
using Win.Sfs.SettleAccount.Reports; using Win.Sfs.SettleAccount.Reports;
using Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report;
using Win.Sfs.Shared.RepositoryBase; using Win.Sfs.Shared.RepositoryBase;
namespace SettleAccount.Job.Services.Report namespace SettleAccount.Job.Services.Report
@ -174,7 +171,7 @@ namespace SettleAccount.Job.Services.Report
} }
//结算 //结算
var saGroup = from sa in _settleAccountDbContext.Set<PUB_SA_DETAIL>() var saGroup = from sa in _settleAccountDbContext.Set<PUB_SA_DETAIL>()
where sa.BusinessType == businessType where sa.BusinessType == businessType && sa.MappingType == EnumMappingType.None
group sa by new { sa.PN, sa.CustomerPartCodeNoSpace } into groupItem group sa by new { sa.PN, sa.CustomerPartCodeNoSpace } into groupItem
select new select new
{ {
@ -201,6 +198,7 @@ namespace SettleAccount.Job.Services.Report
}; };
//发运 //发运
var seGroup = from se in _settleAccountDbContext.Set<PUB_SE_DETAIL>() var seGroup = from se in _settleAccountDbContext.Set<PUB_SE_DETAIL>()
where se.BusinessType == businessType
group se by new { se.PN, se.CustomerPartCodeNoSpace } into groupItem group se by new { se.PN, se.CustomerPartCodeNoSpace } into groupItem
select new select new
{ {
@ -278,12 +276,13 @@ namespace SettleAccount.Job.Services.Report
/// <summary> /// <summary>
/// 获取比对数据 /// 获取比对数据
/// 印度件根据客户零件号对比
/// </summary> /// </summary>
private List<SaSeCompareDiff> GetSaSeCompareDataYinDu(int version) private List<SaSeCompareDiff> GetSaSeCompareDataYinDu(int version)
{ {
//结算 //结算
var saGroup = from sa in _settleAccountDbContext.Set<PUB_SA_DETAIL>() var saGroup = from sa in _settleAccountDbContext.Set<PUB_SA_DETAIL>()
where sa.BusinessType == EnumBusinessType.YinDuJian where sa.BusinessType == EnumBusinessType.YinDuJian && sa.MappingType == EnumMappingType.None
group sa by new { sa.CustomerPartCodeNoSpace } into groupItem group sa by new { sa.CustomerPartCodeNoSpace } into groupItem
select new select new
{ {
@ -308,6 +307,7 @@ namespace SettleAccount.Job.Services.Report
}; };
//发运 //发运
var seGroup = from se in _settleAccountDbContext.Set<PUB_SE_DETAIL>() var seGroup = from se in _settleAccountDbContext.Set<PUB_SE_DETAIL>()
where se.BusinessType == EnumBusinessType.YinDuJian
group se by new { se.CustomerPartCodeNoSpace } into groupItem group se by new { se.CustomerPartCodeNoSpace } into groupItem
select new select new
{ {

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

@ -5,6 +5,7 @@ using EFCore.BulkExtensions;
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.CodeAnalysis.CSharp.Syntax;
using SettleAccount.Bases; using SettleAccount.Bases;
using SettleAccount.Domain.BQ; using SettleAccount.Domain.BQ;
using SettleAccount.Job.SignalR; using SettleAccount.Job.SignalR;
@ -44,7 +45,7 @@ namespace SettleAccount.Job.Services.Report
{ {
//结算 //结算
var saGroup = from sa in _settleAccountDbContext.Set<TSaDetail>() var saGroup = from sa in _settleAccountDbContext.Set<TSaDetail>()
where sa.BusinessType == businessType where sa.BusinessType == businessType && sa.MappingType == EnumMappingType.None
group sa by new { sa.PN, sa.CustomerPartCodeNoSpace } into groupItem group sa by new { sa.PN, sa.CustomerPartCodeNoSpace } into groupItem
select new select new
{ {
@ -71,6 +72,7 @@ namespace SettleAccount.Job.Services.Report
}; };
//发运 //发运
var seGroup = from se in _settleAccountDbContext.Set<TSeDetail>() var seGroup = from se in _settleAccountDbContext.Set<TSeDetail>()
where se.BusinessType == businessType
group se by new { se.PN, se.CustomerPartCodeNoSpace } into groupItem group se by new { se.PN, se.CustomerPartCodeNoSpace } into groupItem
select new select new
{ {
@ -211,6 +213,8 @@ namespace SettleAccount.Job.Services.Report
}); });
}); });
if (businessType != EnumBusinessType.YinDuJian)
{
//获取二次比对上的数据 //获取二次比对上的数据
secondMatchHaveSaHaveSes = (from notHaveSaHaveSe in notHaveSaHaveSes secondMatchHaveSaHaveSes = (from notHaveSaHaveSe in notHaveSaHaveSes
join haveSaNotHaveSe in haveSaNotHaveSes join haveSaNotHaveSe in haveSaNotHaveSes
@ -237,6 +241,36 @@ namespace SettleAccount.Job.Services.Report
FactoryPartCode = haveSaNotHaveSe.FactoryPartCode, FactoryPartCode = haveSaNotHaveSe.FactoryPartCode,
ReplaceFactoryPartCode = haveSaNotHaveSe.ReplaceFactoryPartCode ReplaceFactoryPartCode = haveSaNotHaveSe.ReplaceFactoryPartCode
}).ToList(); }).ToList();
}
else
{
//获取二次比对上的数据
secondMatchHaveSaHaveSes = (from notHaveSaHaveSe in notHaveSaHaveSes
join haveSaNotHaveSe in haveSaNotHaveSes
on new { notHaveSaHaveSe.ReplaceFactoryPartCode } equals new { haveSaNotHaveSe.ReplaceFactoryPartCode }
select new SaSeCompareDiff()
{
WmsBillNum = notHaveSaHaveSe.WmsBillNum,
ShippingDate = notHaveSaHaveSe.ShippingDate,
SeqNumber = notHaveSaHaveSe.SeqNumber,
PJISSeqNumber = notHaveSaHaveSe.PJISSeqNumber,
CustomerOfflineTime = haveSaNotHaveSe.CustomerOfflineTime,
SAQty = haveSaNotHaveSe.SAQty,
SEQty = notHaveSaHaveSe.SEQty,
PN = haveSaNotHaveSe.PN,
ToLocCode = notHaveSaHaveSe.ToLocCode,
ToErpLocCode = notHaveSaHaveSe.ToErpLocCode,
Category = EnumPubSaSeCompareCategory.HaveSaHaveSe,
SeCustomerPartCode = notHaveSaHaveSe.SeCustomerPartCode,
SeFactoryPartCode = notHaveSaHaveSe.SeFactoryPartCode,
SaCustomerPartCode = haveSaNotHaveSe.SaCustomerPartCode,
SaFactoryPartCode = haveSaNotHaveSe.SaFactoryPartCode,
CustomerPartCode = haveSaNotHaveSe.CustomerPartCode,
PartCodeDesc = haveSaNotHaveSe.PartCodeDesc,
FactoryPartCode = haveSaNotHaveSe.FactoryPartCode,
ReplaceFactoryPartCode = haveSaNotHaveSe.ReplaceFactoryPartCode
}).ToList();
}
return secondMatchHaveSaHaveSes; return secondMatchHaveSaHaveSes;
} }

Loading…
Cancel
Save