mahao 1 year ago
parent
commit
4ae9db3145
  1. 40
      code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_SA_DTO.cs
  2. 4
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisBBACSeEdiCompareAppService.cs
  3. 2
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisHBPOSeEdiCompareAppService.cs
  4. 15
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppService.cs
  5. 14
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppServiceBJ.cs
  6. 6
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeEdiCompareDetailReport.cs
  7. 2
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SeEidCompareReport.cs

40
code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_SA_DTO.cs

@ -1,5 +1,7 @@
using System; using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using System.Linq;
using Magicodes.ExporterAndImporter.Core; using Magicodes.ExporterAndImporter.Core;
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
using Volo.Abp.Application.Dtos; using Volo.Abp.Application.Dtos;
@ -101,7 +103,7 @@ public class BBAC_SA_DETAIL_DTO : AuditedAggregateRoot<Guid>
/// <summary> /// <summary>
/// BBAC结算导入请求 /// BBAC结算导入请求
/// </summary> /// </summary>
public class BBACSaImportRequestDto public class BBACSaImportRequestDto //: IValidatableObject
{ {
/// <summary> /// <summary>
/// 文件 /// 文件
@ -116,7 +118,43 @@ public class BBACSaImportRequestDto
/// 地点 /// 地点
/// </summary> /// </summary>
[Display(Name = "地点")] [Display(Name = "地点")]
[Required(ErrorMessage = "{0}必须填写")]
//[ValidateSite(Sites = new string[] { "1040", "1046" }, ErrorMessage = "{0}值无效")]
public string Site { get; set; } public string Site { get; set; }
//public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
//{
// if (Site != "1040" && Site != "1046")
// {
// yield return new ValidationResult(
// $"地点值无效",
// new[] { nameof(Site) });
// }
//}
}
public class ValidateSiteAttribute : ValidationAttribute
{
public ValidateSiteAttribute()
{
}
public string[] Sites { get; set; }
protected override ValidationResult IsValid(object value, ValidationContext validationContext)
{
if (!Sites.Contains(value))
{
return new ValidationResult(FormatErrorMessage(validationContext.DisplayName));
}
return ValidationResult.Success;
}
//public override bool IsValid(object value)
//{
// return AllowEmptyStrings || value is not string stringValue || !string.IsNullOrWhiteSpace(stringValue);
// return base.IsValid(value);
//}
} }
/// <summary> /// <summary>

4
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisBBACSeEdiCompareAppService.cs

@ -1,4 +1,4 @@
using System; using System;
using System.Linq; using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using Coravel.Invocable; using Coravel.Invocable;
@ -47,7 +47,7 @@ public class JisBBACSeEdiCompareAppService : ApplicationService, IInvocable
from edi in ediDetailGroup from edi in ediDetailGroup
where se.PN == edi.PN && se.CustomerPartCodeNoSpace == edi.CustomerPartCodeNoSpace where se.PN == edi.PN && se.CustomerPartCodeNoSpace == edi.CustomerPartCodeNoSpace
select new { se.PN, se.CustomerPartCodeNoSpace } select new { se.PN, se.CustomerPartCodeNoSpace }
).Take(1000).ToList(); ).Take(5_000).ToList();
if (keyCodes.Any()) if (keyCodes.Any())
{ {
var pns = keyCodes.Select(t => t.PN).Distinct().ToList(); var pns = keyCodes.Select(t => t.PN).Distinct().ToList();

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

@ -48,7 +48,7 @@ public class JisHBPOSeEdiCompareAppService : ApplicationService, IInvocable
from edi in ediDetailGroup from edi in ediDetailGroup
where se.PN == edi.PN && se.CustomerPartCodeNoSpace == edi.CustomerPartCodeNoSpace where se.PN == edi.PN && se.CustomerPartCodeNoSpace == edi.CustomerPartCodeNoSpace
select new { se.PN, se.CustomerPartCodeNoSpace } select new { se.PN, se.CustomerPartCodeNoSpace }
).Take(1000).ToList(); ).Take(5_000).ToList();
if (keyCodes.Any()) if (keyCodes.Any())
{ {
var pns = keyCodes.Select(t => t.PN).Distinct().ToList(); var pns = keyCodes.Select(t => t.PN).Distinct().ToList();

15
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppService.cs

@ -155,16 +155,23 @@ public class PriceListAppService : SettleAccountApplicationBase<PriceList>
return priceList; // 只有一个或零个价格条目 return priceList; // 只有一个或零个价格条目
} }
var sortedList = priceList.OrderBy(t => t.LU).ThenBy(t => t.BeginTime).ToList(); var clientCodeGroup = priceList.GroupBy(t => t.ClientCode);
foreach (var item in clientCodeGroup)
{
if (item.ToList().Count <= 1)
{
continue;
}
var sortedList = item.OrderBy(t => t.LU).ThenBy(t => t.BeginTime).ToList();
for (var i = 1; i < sortedList.Count; i++) for (var i = 1; i < sortedList.Count; i++)
{ {
if (sortedList[i].LU == sortedList[i - 1].LU && sortedList[i].BeginTime != sortedList[i - 1].EndTime.AddDays(1)) if (sortedList[i].LU == sortedList[i - 1].LU && sortedList[i].BeginTime != sortedList[i - 1].EndTime.AddDays(1))
{ {
priceList.Add(sortedList[i]); pricelist.Add(sortedList[i]);
} }
} }
}
return priceList; // 所有价格时间都连续 return pricelist; // 所有价格时间都连续
} }
/// <summary> /// <summary>

14
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppServiceBJ.cs

@ -139,16 +139,24 @@ public class PriceListAppServiceBJ : SettleAccountApplicationBase<PriceListBJ>
return priceList; // 只有一个或零个价格条目 return priceList; // 只有一个或零个价格条目
} }
var sortedList = priceList.OrderBy(t => t.LU).ThenBy(t => t.BeginDate).ToList(); var clientCodeGroup = priceList.GroupBy(t => t.ClientCode);
foreach (var item in clientCodeGroup)
{
if (item.ToList().Count <= 1)
{
continue;
}
var sortedList = item.OrderBy(t => t.LU).ThenBy(t => t.BeginDate).ToList();
for (var i = 1; i < sortedList.Count; i++) for (var i = 1; i < sortedList.Count; i++)
{ {
if (sortedList[i].LU == sortedList[i - 1].LU && sortedList[i].BeginDate != sortedList[i - 1].EndDate.AddDays(1)) if (sortedList[i].LU == sortedList[i - 1].LU && sortedList[i].BeginDate != sortedList[i - 1].EndDate.AddDays(1))
{ {
priceList.Add(sortedList[i]); pricelist.Add(sortedList[i]);
}
} }
} }
return priceList; // 所有价格时间都连续 return pricelist; // 所有价格时间都连续
} }
/// <summary> /// <summary>

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

@ -1,4 +1,4 @@
using System; using System;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using Magicodes.ExporterAndImporter.Core; using Magicodes.ExporterAndImporter.Core;
using Magicodes.ExporterAndImporter.Excel; using Magicodes.ExporterAndImporter.Excel;
@ -55,7 +55,7 @@ public class SaSeEdiCompareDetailReport
/// 发货日期 /// 发货日期
/// </summary> /// </summary>
[Display(Name = "发货日期")] [Display(Name = "发货日期")]
[ExporterHeader(DisplayName = "发货日期")] [ExporterHeader(DisplayName = "发货日期", Format = "yyyy-MM-dd")]
public DateTime? ShippingDate { get; set; } public DateTime? ShippingDate { get; set; }
/// <summary> /// <summary>
/// 生产码 /// 生产码
@ -103,7 +103,7 @@ public class SaSeEdiCompareDetailReport
/// 客户下线时间 /// 客户下线时间
/// </summary> /// </summary>
[Display(Name = "客户下线时间")] [Display(Name = "客户下线时间")]
[ExporterHeader(DisplayName = "客户下线时间")] [ExporterHeader(DisplayName = "客户下线时间", Format = "yyyy-MM-dd")]
public DateTime? CustomerOfflineTime { get; set; } public DateTime? CustomerOfflineTime { get; set; }
/// <summary> /// <summary>
/// 小总成号 /// 小总成号

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

@ -121,7 +121,7 @@ public class SeEidCompareReport
/// 客户下线时间 /// 客户下线时间
/// </summary> /// </summary>
[Display(Name = "客户下线时间")] [Display(Name = "客户下线时间")]
[ExporterHeader(DisplayName = "客户下线时间")] [ExporterHeader(DisplayName = "客户下线时间", Format = "yyyy-MM-dd")]
public DateTime? AssemblyDate { get; set; } public DateTime? AssemblyDate { get; set; }
/// <summary> /// <summary>
/// 小总成号 /// 小总成号

Loading…
Cancel
Save