|
|
@ -2,6 +2,7 @@ using System; |
|
|
|
using System.Collections.Generic; |
|
|
|
using System.ComponentModel.DataAnnotations; |
|
|
|
using System.Linq; |
|
|
|
using EFCore.BulkExtensions; |
|
|
|
using Magicodes.ExporterAndImporter.Excel; |
|
|
|
using Microsoft.AspNetCore.SignalR; |
|
|
|
using Microsoft.OpenApi.Extensions; |
|
|
@ -85,7 +86,7 @@ namespace SettleAccount.Job.Services.Report |
|
|
|
/// </summary>
|
|
|
|
public string ExportFile(Guid id, List<string> exportName, List<CustomCondition> property) |
|
|
|
{ |
|
|
|
var version = property.Where(p => p.Name == "Version").FirstOrDefault().Value; |
|
|
|
var version = int.Parse(property.Where(p => p.Name == "Version").FirstOrDefault().Value); |
|
|
|
var strBusinessType = property.Where(t => t.Name == "BusinessType").FirstOrDefault().Value; |
|
|
|
var lu = property.Where(p => p.Name == "LU").FirstOrDefault().Value; |
|
|
|
var pn = property.Where(p => p.Name == "PN").FirstOrDefault().Value; |
|
|
@ -101,7 +102,7 @@ namespace SettleAccount.Job.Services.Report |
|
|
|
} |
|
|
|
var filename = exportName.FirstOrDefault(); |
|
|
|
//var pubSaSeCompareDiffs = _pubSaSeCompareDapperRepository.GetDetailDiffReportList(strBusinessType, version, seStartDateTime, seEndDateTime);
|
|
|
|
var pubSaSeCompareDiffs = GetSaSeCompareData(businessType, int.Parse(version), DateTime.Parse(seStartDateTime), DateTime.Parse(seEndDateTime)); |
|
|
|
var pubSaSeCompareDiffs = GetSaSeCompareData(businessType, version, DateTime.Parse(seStartDateTime), DateTime.Parse(seEndDateTime)); |
|
|
|
|
|
|
|
HandlePubSaSeCompareDiffList(pubSaSeCompareDiffs); |
|
|
|
|
|
|
@ -117,48 +118,11 @@ namespace SettleAccount.Job.Services.Report |
|
|
|
//二次对比比对上的数据入库
|
|
|
|
var pubSeCDetailEntitys = _objectMapper.Map<List<PubSaSeCompareDiff>, List<PUB_SEC_DETAIL>>(secondMatchHaveSaHaveSes); |
|
|
|
_settleAccountDbContext.Set<PUB_SEC_DETAIL>().AddRange(pubSeCDetailEntitys); |
|
|
|
//_pubSeCDetailRepository.InsertManyAsync(pubSeCDetailEntitys);
|
|
|
|
} |
|
|
|
#endregion
|
|
|
|
|
|
|
|
//var haveSaNotHaveSeFPartCodePNs = haveSaNotHaveSes.Select(t => new { t.ReplaceFactoryPartCode, t.PN });
|
|
|
|
//var notHaveSaHaveSeFPartCodePNs = notHaveSaHaveSes.Select(t => new { t.ReplaceFactoryPartCode, t.PN });
|
|
|
|
////二次匹配 匹配上的厂内零件号、PN
|
|
|
|
//var secondMatchFPartCodePNs = haveSaNotHaveSeFPartCodePNs.Intersect(notHaveSaHaveSeFPartCodePNs);
|
|
|
|
//if (secondMatchFPartCodePNs.Any() == true)
|
|
|
|
//{
|
|
|
|
// pubSaSeCompareDiffs.RemoveAll<PubSaSeCompareDiff>(t => secondMatchFPartCodePNs.Contains(new { t.ReplaceFactoryPartCode, t.PN }));
|
|
|
|
|
|
|
|
// foreach (var secondMatchFPartCodePN in secondMatchFPartCodePNs)
|
|
|
|
// {
|
|
|
|
// var haveSaNotHaveSe = haveSaNotHaveSes.FirstOrDefault(t => t.ReplaceFactoryPartCode == secondMatchFPartCodePN.ReplaceFactoryPartCode && t.PN == secondMatchFPartCodePN.PN);
|
|
|
|
// var notHaveSaHaveSe = notHaveSaHaveSes.FirstOrDefault(t => t.ReplaceFactoryPartCode == secondMatchFPartCodePN.ReplaceFactoryPartCode && t.PN == secondMatchFPartCodePN.PN);
|
|
|
|
// if (haveSaNotHaveSe != null && notHaveSaHaveSe != null)
|
|
|
|
// {
|
|
|
|
|
|
|
|
// }
|
|
|
|
// secondMatchHaveSaHaveSes.Add(new PubSaSeCompareDiff()
|
|
|
|
// {
|
|
|
|
// WmsBillNum = notHaveSaHaveSe.WmsBillNum,
|
|
|
|
// ShippingDate = notHaveSaHaveSe.ShippingDate,
|
|
|
|
// SeqNumber = notHaveSaHaveSe.SeqNumber,
|
|
|
|
// PJISSeqNumber = notHaveSaHaveSe.PJISSeqNumber,
|
|
|
|
// MaterialNumber = haveSaNotHaveSe.MaterialNumber,
|
|
|
|
// MaterialDes = haveSaNotHaveSe.MaterialDes,
|
|
|
|
// CustomerOfflineTime = haveSaNotHaveSe.CustomerOfflineTime,
|
|
|
|
// SAQty = haveSaNotHaveSe.SAQty,
|
|
|
|
// SEQty = notHaveSaHaveSe.SEQty,
|
|
|
|
// MateType = haveSaNotHaveSe.MateType,
|
|
|
|
// FixPrice = haveSaNotHaveSe.FixPrice,
|
|
|
|
// PrimitiveLU = haveSaNotHaveSe.PrimitiveLU,
|
|
|
|
// ReplaceLU = haveSaNotHaveSe.ReplaceLU,
|
|
|
|
// SeLU = notHaveSaHaveSe.SeLU,
|
|
|
|
// SaLU = haveSaNotHaveSe.SaLU,
|
|
|
|
// PN = haveSaNotHaveSe.PN,
|
|
|
|
// Category = EnumPubSaSeCompareCategory.HaveSaHaveSe,
|
|
|
|
// IsRemove = false
|
|
|
|
// });
|
|
|
|
// }
|
|
|
|
//}
|
|
|
|
#region 结算数据处理
|
|
|
|
HandlSaDetails(pubSaSeCompareDiffs, businessType, version); |
|
|
|
#endregion
|
|
|
|
|
|
|
|
if (string.IsNullOrEmpty(lu) == false) |
|
|
|