wanggang 1 year ago
parent
commit
a12c2a26b8
  1. 57
      code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/INVOICE_GRP_DTO.cs
  2. 27
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/BA_SERVICE.cs
  3. 25
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_BA_SERVICE.cs
  4. 2
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_CAN_SA_SERVICE.cs
  5. 1
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_SA_SERVICE.cs
  6. 4
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_BA_SERVICE.cs
  7. 1
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_SA_SERVICE.cs
  8. 179
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/INVOICE_SERVICE.cs
  9. 7
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_BA_SERVICE.cs
  10. 1
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_SA_SERVICE.cs
  11. 20
      code/src/Modules/SettleAccount/src/SettleAccount.Domain.Shared/Enums/EnumMappingType.cs
  12. 15
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Bases/BaseDomainServices/BaseDomainService.cs
  13. 33
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/TED_SA_INV.cs
  14. 72
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/JisBBACEidSeCompareReport.cs
  15. 102
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/JisHBPOEidSeCompareReport.cs
  16. 34
      code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/ExChangeCenterDbContext.cs
  17. 42
      code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContextModelCreatingExtensions.cs
  18. 2
      code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/PubSaSeCompareExportService.cs
  19. 33
      code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SaSeCompareExportBaseService.cs

57
code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/INVOICE_GRP_DTO.cs

@ -292,6 +292,9 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
[Display(Name = "零件号")]
public string PartCode { get; set; }
[Display(Name = "零件描述")]
public string PartDesc { get; set; }
/// <summary>
///单价
/// </summary>
@ -381,6 +384,10 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
[Display(Name = "零件号")]
public string PartCode { get; set; }
[Display(Name = "零件描述")]
public string PartDesc { get; set; }
/// <summary>
///单价
/// </summary>
@ -456,6 +463,10 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
[Display(Name = "零件号")]
public string PartCode { get; set; }
[Display(Name = "零件描述")]
public string PartDesc { get; set; }
/// <summary>
///单价
/// </summary>
@ -652,6 +663,52 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
}
public class INVOICE_NOT_SETTLE_EXT_DTO
{
[Display(Name = "金税发票")]
public string RealInvBillNum { get; set; }
[Display(Name = "发票日期")]
public DateTime? InvDate { set; get; }
[Display(Name = "发票号")]
public string InvBillNum { get; set; }
/// <summary>
///发票分组号
/// </summary>
[Display(Name = "发票分组号")]
public string InvGroupNum { get; set; }
/// <summary>
///结算分组号
/// </summary>
[Display(Name = "结算分组号")]
public string SettleGroupNum { get; set; }
/// <summary>
///可结算零件号
/// </summary>
[Display(Name = "结算零件号")]
public string SettleLU { get; set; }
[Display(Name = "可结算数量")]
public string SettleQty { get; set; }
/// <summary>
///可结算零件号
/// </summary>
[Display(Name = "不结算零件号")]
public string NotSettleLU { get; set; }
[Display(Name = "不可结数量")]
public string Qty { get; set; }
}

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

@ -33,6 +33,7 @@ using Volo.Abp.Domain.Repositories;
using Volo.Abp.Uow;
using Win.Abp.Snowflakes;
using Win.Sfs.BaseData.ImportExcelCommon;
using Win.Sfs.SettleAccount.Bases.DomainServices;
using Win.Sfs.SettleAccount.CommonManagers;
using Win.Sfs.SettleAccount.Constant;
using Win.Sfs.SettleAccount.Entities.BQ.Dtos;
@ -59,25 +60,27 @@ namespace Win.Sfs.SettleAccount.Bases
protected readonly INormalEfCoreRepository<PUB_ADJ_DETAIL, Guid> _adjRepository;
protected readonly HBPO_CAN_SA_MNG _hbpoMng;
protected readonly BBAC_CAN_SA_MNG _bbacMng;
protected readonly PUB_CAN_SA_MNG _pubMng;
protected readonly PUB_CAN_SA_MNG _pubMng;
protected readonly INV_MNG _invMng;
private readonly TaskJobService _service;
private readonly BaseDomainService _baseservice;
protected BA_SERVICE(IExcelImportAppService excelImportService,
ISnowflakeIdGenerator snowflakeIdGenerator,
ICommonManager commonManager,
INormalEfCoreRepository<INVOICE_GRP, Guid> repository,
INormalEfCoreRepository<INVOICE_WAIT_DETAIL, Guid> wRepository,
INormalEfCoreRepository<INVOICE_NOT_SETTLE, Guid> sRepository,
INormalEfCoreRepository<INVOICE_MAP_GROUP, Guid> mRepository,
INormalEfCoreRepository<PUB_ADJ_DETAIL, Guid> adjRepository,
BBAC_CAN_SA_MNG bbacMng,
HBPO_CAN_SA_MNG hbpoMng,
PUB_CAN_SA_MNG pubMng,
INV_MNG invMng,
TaskJobService service
TaskJobService service,
BaseDomainService baseservice
) :
base(excelImportService, snowflakeIdGenerator, commonManager)
@ -92,6 +95,7 @@ namespace Win.Sfs.SettleAccount.Bases
_bbacMng = bbacMng;
_hbpoMng = hbpoMng;
_invMng = invMng;
_baseservice = baseservice;
}
/// <summary>
/// 审核通过
@ -147,6 +151,7 @@ namespace Win.Sfs.SettleAccount.Bases
public virtual async Task<INVOICE_GRP_DETAIL_DTO> DetailQueryAsync(INVOICE_GRP_REQ_DTO input)
{
INVOICE_GRP_DETAIL_DTO entity = new INVOICE_GRP_DETAIL_DTO();
var materialList =await _baseservice.GetMaterialList();
var invs = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, input.SkipCount);
var m = await _mRepository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, input.SkipCount);
var mdtos = ObjectMapper.Map<List<INVOICE_MAP_GROUP>, List<INVOICE_MAP_GROUP_DTO>>(m);
@ -158,9 +163,13 @@ namespace Win.Sfs.SettleAccount.Bases
var AMap = ObjectMapper.Map<List<INVOICE_WAIT_DETAIL>, List<INVOICE_WAIT_DETAIL_BBAC_DTO>>(A);
var wquery = from itm in AMap
join itm1 in invs on itm.InvbillNum equals itm1.InvbillNum
join itm2 in materialList on itm.LU equals itm2.SettleMaterialCode into temp
select from tm in temp.DefaultIfEmpty()
select
new INVOICE_WAIT_DETAIL_BBAC_DTO()
{
PartDesc=tm==null?string.Empty:itm.PartDesc,
InvDate = itm1.CreationTime,
RealInvbillNum = string.IsNullOrEmpty(itm1.RealnvBillNum) ? string.Empty : itm1.RealnvBillNum,
Version = itm.Version,
@ -185,9 +194,12 @@ namespace Win.Sfs.SettleAccount.Bases
var wquery = from itm in BMap
join itm1 in invs on itm.InvbillNum equals itm1.InvbillNum
select
join itm2 in materialList on itm.LU equals itm2.SettleMaterialCode into temp
select from tm in temp.DefaultIfEmpty()
select
new INVOICE_WAIT_DETAIL_BJ_DTO()
{
PartDesc = tm == null ? string.Empty : itm.PartDesc,
InvDate = itm1.CreationTime,
RealInvbillNum = string.IsNullOrEmpty(itm1.RealnvBillNum) ? string.Empty : itm1.RealnvBillNum,
Version = itm.Version,
@ -211,9 +223,12 @@ namespace Win.Sfs.SettleAccount.Bases
var wdtos = ObjectMapper.Map<List<INVOICE_WAIT_DETAIL>, List<INVOICE_WAIT_DETAIL_DTO>>(w);
var wquery = from itm in wdtos
join itm1 in invs on itm.InvbillNum equals itm1.InvbillNum
select
join itm2 in materialList on itm.LU equals itm2.SettleMaterialCode into temp
select from tm in temp.DefaultIfEmpty()
select
new INVOICE_WAIT_DETAIL_DTO()
{
PartDesc = tm == null ? string.Empty : itm.PartDesc,
InvDate = itm1.CreationTime,
RealInvbillNum = string.IsNullOrEmpty(itm1.RealnvBillNum) ? string.Empty : itm1.RealnvBillNum,
Version = itm.Version,

25
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_BA_SERVICE.cs

@ -18,6 +18,7 @@ using Volo.Abp.ObjectMapping;
using Win.Abp.Snowflakes;
using Win.Sfs.BaseData.ImportExcelCommon;
using Win.Sfs.SettleAccount.Bases;
using Win.Sfs.SettleAccount.Bases.DomainServices;
using Win.Sfs.SettleAccount.CommonManagers;
using Win.Sfs.SettleAccount.Constant;
using Win.Sfs.SettleAccount.Entities.BQ.Dtos;
@ -39,6 +40,9 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
private readonly INormalEfCoreRepository<PriceList, Guid> _priceRepository;
public BBAC_BA_SERVICE(IExcelImportAppService excelImportService,
ISnowflakeIdGenerator snowflakeIdGenerator,
ICommonManager commonManager,
@ -53,14 +57,31 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
PUB_CAN_SA_MNG pubMng,
INV_MNG invMng,
TaskJobService service,
BaseDomainService baseservice,
INormalEfCoreRepository<PriceList, Guid> priceRepository
) : base(excelImportService, snowflakeIdGenerator, commonManager, repository, wRepository, sRepository, mRepository, adjRepository, bbacMng, hbpoMng, pubMng, invMng, service)
) : base(
excelImportService,
snowflakeIdGenerator,
commonManager,
repository,
wRepository,
sRepository,
mRepository,
adjRepository,
bbacMng,
hbpoMng,
pubMng,
invMng,
service,
baseservice)
{
_priceRepository = priceRepository;
}
/// <summary>
/// 发票重开
/// </summary>

2
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_CAN_SA_SERVICE.cs

@ -63,7 +63,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
INormalEfCoreRepository<BBAC_CAN_SA, Guid> repository,
INormalEfCoreRepository<BBAC_CAN_SA_DETAIL, Guid> detailRepository,
INV_MNG invmng,
INormalEfCoreRepository<BBAC_NOT_SA_DETAIL, Guid> notRepository,
INormalEfCoreRepository<BBAC_NOT_SA_DETAIL, Guid> notRepository,
INormalEfCoreRepository<PriceList, Guid> priceRepository,
BBAC_CAN_SA_MNG bbacMng

1
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_SA_SERVICE.cs

@ -335,7 +335,6 @@ public class BBAC_SA_SERVICE : SettleAccountApplicationBase<BBAC_SA>
}
bbacSaDetail.PN = Regex.Replace(bbacSaDetail.PN, "['‘’]", "");
});
return GroupPnLu(bbacSaDetails);
}

4
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_BA_SERVICE.cs

@ -13,6 +13,7 @@ using Volo.Abp.Application.Services;
using Win.Abp.Snowflakes;
using Win.Sfs.BaseData.ImportExcelCommon;
using Win.Sfs.SettleAccount.Bases;
using Win.Sfs.SettleAccount.Bases.DomainServices;
using Win.Sfs.SettleAccount.CommonManagers;
using Win.Sfs.SettleAccount.Constant;
using Win.Sfs.SettleAccount.Entities.BQ.Dtos;
@ -35,10 +36,11 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
INormalEfCoreRepository<PUB_ADJ_DETAIL, Guid> adjRepository, BBAC_CAN_SA_MNG bbacMng,
HBPO_CAN_SA_MNG hbpoMng, PUB_CAN_SA_MNG pubMng, INV_MNG invMng,
TaskJobService service,
BaseDomainService baseservice,
INormalEfCoreRepository<PriceList, Guid> priceRepository
)
: base(excelImportService, snowflakeIdGenerator, commonManager, repository, wRepository, sRepository, mRepository, adjRepository, bbacMng, hbpoMng, pubMng, invMng, service)
: base(excelImportService, snowflakeIdGenerator, commonManager, repository, wRepository, sRepository, mRepository, adjRepository, bbacMng, hbpoMng, pubMng, invMng, service,baseservice)
{
_priceRepository= priceRepository;
}

1
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_SA_SERVICE.cs

@ -297,7 +297,6 @@ public class HBPO_SA_SERVICE : SettleAccountApplicationBase<HBPO_SA>
hbpoSaDetail.CustomerPartCodeNoSpace = hbpoSaDetail.LU.Replace(" ", "");
hbpoSaDetail.Version = Version;
});
return GroupPnLu(hbpoSaDetails);
}

179
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/INVOICE_SERVICE.cs

@ -26,6 +26,7 @@ using Volo.Abp.Uow;
using Win.Abp.Snowflakes;
using Win.Sfs.BaseData.ImportExcelCommon;
using Win.Sfs.SettleAccount.Bases;
using Win.Sfs.SettleAccount.Bases.DomainServices;
using Win.Sfs.SettleAccount.CommonManagers;
using Win.Sfs.SettleAccount.Constant;
using Win.Sfs.SettleAccount.Entities.BQ.Dtos;
@ -49,6 +50,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
private readonly BBAC_CAN_SA_MNG _bbacMng;
private readonly HBPO_CAN_SA_MNG _hbpoMng;
private readonly INV_MNG _invMng;
private readonly BaseDomainService _baseservice;
public INVOICE_SERVICE(IExcelImportAppService excelImportService,
ISnowflakeIdGenerator snowflakeIdGenerator,
ICommonManager commonManager,
@ -57,6 +59,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
INormalEfCoreRepository<INVOICE_NOT_SETTLE, Guid> sRepository,
INormalEfCoreRepository<INVOICE_MAP_GROUP, Guid> mRepository,
INormalEfCoreRepository<PUB_ADJ_DETAIL, Guid> adjRepository,
BaseDomainService baseservice,
PUB_CAN_SA_MNG pubMng,
BBAC_CAN_SA_MNG bbacMng,
HBPO_CAN_SA_MNG hbpoMng,
@ -64,6 +67,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
) : base(excelImportService, snowflakeIdGenerator, commonManager)
{
_baseservice = baseservice;
_repository = repository;
_wRepository = wRepository;
_mRepository = mRepository;
@ -146,20 +150,24 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
public virtual async Task<INVOICE_GRP_DETAIL_DTO> DetailQueryAsync(INVOICE_GRP_REQ_DTO input)
{
INVOICE_GRP_DETAIL_DTO entity = new INVOICE_GRP_DETAIL_DTO();
var materialList = await _baseservice.GetMaterialList();
var invs = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, input.SkipCount);
var m = await _mRepository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, input.SkipCount);
var mdtos = ObjectMapper.Map<List<INVOICE_MAP_GROUP>, List<INVOICE_MAP_GROUP_DTO>>(m);
if (invs.FirstOrDefault().BusinessType == EnumBusinessType.JisBBAC)
{
var A = await _wRepository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, input.SkipCount);
var AMap = ObjectMapper.Map<List<INVOICE_WAIT_DETAIL>, List<INVOICE_WAIT_DETAIL_BBAC_DTO>>(A);
var wquery = from itm in AMap
join itm1 in invs on itm.InvbillNum equals itm1.InvbillNum
join itm2 in materialList on itm.LU equals itm2.SettleMaterialCode into temp
select from tm in temp.DefaultIfEmpty()
select
new INVOICE_WAIT_DETAIL_BBAC_DTO()
{
PartDesc = tm == null ? string.Empty : itm.PartDesc,
InvDate = itm1.CreationTime,
RealInvbillNum = string.IsNullOrEmpty(itm1.RealnvBillNum) ? string.Empty : itm1.RealnvBillNum,
Version = itm.Version,
@ -184,9 +192,12 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
var wquery = from itm in BMap
join itm1 in invs on itm.InvbillNum equals itm1.InvbillNum
join itm2 in materialList on itm.LU equals itm2.SettleMaterialCode into temp
select from tm in temp.DefaultIfEmpty()
select
new INVOICE_WAIT_DETAIL_BJ_DTO()
{
PartDesc = tm == null ? string.Empty : itm.PartDesc,
InvDate = itm1.CreationTime,
RealInvbillNum = string.IsNullOrEmpty(itm1.RealnvBillNum) ? string.Empty : itm1.RealnvBillNum,
Version = itm.Version,
@ -211,9 +222,13 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
var wdtos = ObjectMapper.Map<List<INVOICE_WAIT_DETAIL>, List<INVOICE_WAIT_DETAIL_DTO>>(w);
var wquery = from itm in wdtos
join itm1 in invs on itm.InvbillNum equals itm1.InvbillNum
join itm2 in materialList on itm.LU equals itm2.SettleMaterialCode into temp
select from tm in temp.DefaultIfEmpty()
select
new INVOICE_WAIT_DETAIL_DTO()
{
PartDesc = tm == null ? string.Empty : itm.PartDesc,
InvDate = itm1.CreationTime,
RealInvbillNum = string.IsNullOrEmpty(itm1.RealnvBillNum) ? string.Empty : itm1.RealnvBillNum,
Version = itm.Version,
@ -334,7 +349,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
IExporter _csv = new CsvExporter();
ExcelExporter _excel = new ExcelExporter();
var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, 0, true);
var dtoDetails = ObjectMapper.Map<List<INVOICE_GRP>, List<INVOICE_GRP_EXP_DTO>>(entities);
var invdetail= await DetailQueryAsync(input);
var m = invdetail.INVOICE_MAP_GROUP;
@ -343,40 +357,165 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
var adj = invdetail.ADJ_DETAIL;
var bbac = invdetail.INVOICE_WAIT_DETAIL_BBAC;
var bj = invdetail.INVOICE_WAIT_DETAIL_BJ;
var classDisplayName = typeof(INVOICE_GRP_DTO).GetCustomAttribute<DisplayAttribute>()?.Name ?? typeof(INVOICE_GRP_DTO).Name;
string _fileName = $"{classDisplayName}_{Guid.NewGuid().ToString()}.xlsx";
if (entities.FirstOrDefault().BusinessType == EnumBusinessType.JisBBAC)
{
_excel.Append(bbac, "发票明细");
}
else if (entities.FirstOrDefault().BusinessType == EnumBusinessType.BeiJian)
{
_excel.Append(bj, "发票明细");
}
else
{
_excel.Append(detail, "发票明细");
}
foreach (var itm in entities)
{
var mgroup =m.Where(p => p.InvbillNum == itm.InvbillNum).ToList();
var adjp = adj.Where(p => p.InvBillNum == itm.InvbillNum).ToList();
var nolist = not.Where(p => p.InvBillNum == itm.InvbillNum).ToList();
var lsC =nolist.Where(p => p.Extend1 == "可结算").ToList();
var lsN = nolist.Where(p => p.Extend1 == "不可结算").ToList();
// var r = (from t1 in lsC
// join t2 in lsN on new { t1.LU, t1.SettleGroupNum }
// equals new { t2.LU, t2.SettleGroupNum }
// into temp
// from tm in temp.DefaultIfEmpty()
// select new INVOICE_NOT_SETTLE_EXT_DTO
// {
// RealInvBillNum = t1.RealInvBillNum,
// InvDate = t1.InvDate,
// InvBillNum = t1.InvBillNum,
// InvGroupNum = t1.InvGroupNum,
// SettleGroupNum = t1.SettleGroupNum,
// SettleLU = t1.LU,
// NotSettleLU = tm == null ? string.Empty : tm.LU,
// Qty = tm == null ? string.Empty : tm.Qty
// }
// )
//.Union
//(from t2 in lsN
// join t1 in lsC
// on new { t2.LU, t2.SettleGroupNum }
// equals new { t1.LU, t1.SettleGroupNum }
// into temp
// from tm in temp.DefaultIfEmpty()
// where tm == null
// select new INVOICE_NOT_SETTLE_EXT_DTO
// {
// RealInvBillNum = t2.RealInvBillNum,
// InvDate = t2.InvDate,
// InvBillNum = t2.InvBillNum,
// InvGroupNum = t2.InvGroupNum,
// SettleGroupNum = t2.SettleGroupNum,
// SettleLU = string.Empty,
// NotSettleLU = t2.LU,
// Qty = t2.Qty
// }
// );
if (entities.FirstOrDefault().BusinessType == EnumBusinessType.JisBBAC)
//_excel.Append(r.OrderBy(p=>p.SettleGroupNum).ToList(), "结算分组零件" + itm.InvbillNum);
var lineC = lsC.Count;
var lineN = lsN.Count;
List<INVOICE_NOT_SETTLE_EXT_DTO> ls = new List<INVOICE_NOT_SETTLE_EXT_DTO>();
if (lineC > lineN)//可结大于不可结行数时
{
var bbaclist = bbac.Where(p => p.InvbillNum == itm.InvbillNum).ToList();
_excel.Append(bbaclist, "发票号" + itm.InvbillNum).SeparateBySheet();
for (int number = 0; number < lineC; number++)
{
if (number + 1 > lineN)
{
INVOICE_NOT_SETTLE_EXT_DTO entity = new INVOICE_NOT_SETTLE_EXT_DTO();
entity.RealInvBillNum = lsC[number].RealInvBillNum;
entity.InvDate = lsC[number].InvDate;
entity.InvBillNum = lsC[number].InvBillNum;
entity.InvGroupNum = lsC[number].InvGroupNum;
entity.SettleGroupNum = lsC[number].SettleGroupNum;
entity.SettleLU = lsC[number].LU;
entity.SettleQty = lsC[number].Qty;
entity.NotSettleLU = string.Empty;
entity.Qty = string.Empty;
ls.Add(entity);
}
else
{
INVOICE_NOT_SETTLE_EXT_DTO entity = new INVOICE_NOT_SETTLE_EXT_DTO();
entity.RealInvBillNum = lsC[number].RealInvBillNum;
entity.InvDate = lsC[number].InvDate;
entity.InvBillNum = lsC[number].InvBillNum;
entity.InvGroupNum = lsC[number].InvGroupNum;
entity.SettleGroupNum = lsC[number].SettleGroupNum;
entity.SettleLU = lsC[number].LU;
entity.SettleQty= lsC[number].Qty;
entity.NotSettleLU = lsN[number].LU;
entity.Qty = lsN[number].Qty;
ls.Add(entity);
}
}
}
else if (entities.FirstOrDefault().BusinessType == EnumBusinessType.BeiJian)
else
{
var bjlist = bj.Where(p => p.InvbillNum == itm.InvbillNum).ToList();
_excel.Append(bjlist, "发票号" + itm.InvbillNum).SeparateBySheet();
for (int number = 0; number < lineN; number++)
{
if (number + 1 > lineC)//不可结大于可结行数时
{
INVOICE_NOT_SETTLE_EXT_DTO entity = new INVOICE_NOT_SETTLE_EXT_DTO();
entity.RealInvBillNum = lsN[number].RealInvBillNum;
entity.InvDate = lsN[number].InvDate;
entity.InvBillNum = lsN[number].InvBillNum;
entity.InvGroupNum = lsN[number].InvGroupNum;
entity.SettleGroupNum = lsN[number].SettleGroupNum;
entity.SettleLU = string.Empty;
entity.SettleQty = string.Empty;
entity.NotSettleLU = lsN[number].LU;
entity.Qty = lsN[number].Qty;
ls.Add(entity);
}
else
{
INVOICE_NOT_SETTLE_EXT_DTO entity = new INVOICE_NOT_SETTLE_EXT_DTO();
entity.RealInvBillNum = lsN[number].RealInvBillNum;
entity.InvDate = lsN[number].InvDate;
entity.InvBillNum = lsN[number].InvBillNum;
entity.InvGroupNum = lsN[number].InvGroupNum;
entity.SettleGroupNum = lsN[number].SettleGroupNum;
entity.SettleLU = lsC[number].LU;
entity.NotSettleLU = lsN[number].LU;
entity.Qty = lsN[number].Qty;
entity.SettleQty = lsC[number].Qty;
ls.Add(entity);
}
}
}
var disList= ls.Select(p => p.SettleGroupNum).Distinct().ToList();
foreach (var de in ls)
{
de.SettleGroupNum = string.Empty;
}
else
for (int i = 0; i < disList.Count; i++)
{
var invlist = detail.Where(p => p.InvbillNum == itm.InvbillNum).ToList();
_excel.Append(invlist, "发票号" + itm.InvbillNum).SeparateBySheet();
ls[i].SettleGroupNum = disList[i];
}
_excel.Append(ls, "结算分组零件" + itm.InvbillNum);
_excel.Append(mgroup, "发票结算分组对应" + itm.InvbillNum).SeparateBySheet();
_excel.Append(adjp, "发票调整数据" + itm.InvbillNum).SeparateBySheet();
_excel.Append(nolist, "结算分组零件" + itm.InvbillNum);
}
var result = _excel.ExportAppendDataAsByteArray();
result.ShouldNotBeNull();
//保存导出文件到服务器存成二进制

7
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_BA_SERVICE.cs

@ -13,6 +13,7 @@ using Volo.Abp.Application.Services;
using Win.Abp.Snowflakes;
using Win.Sfs.BaseData.ImportExcelCommon;
using Win.Sfs.SettleAccount.Bases;
using Win.Sfs.SettleAccount.Bases.DomainServices;
using Win.Sfs.SettleAccount.CommonManagers;
using Win.Sfs.SettleAccount.Constant;
using Win.Sfs.SettleAccount.Entities.BQ.Dtos;
@ -34,11 +35,13 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
public PUB_BA_SERVICE(IExcelImportAppService excelImportService, ISnowflakeIdGenerator snowflakeIdGenerator, ICommonManager commonManager, INormalEfCoreRepository<PUB_ADJ_DETAIL, Guid> pubRepository, INormalEfCoreRepository<INVOICE_GRP, Guid> repository, INormalEfCoreRepository<INVOICE_WAIT_DETAIL, Guid> wRepository, INormalEfCoreRepository<INVOICE_NOT_SETTLE, Guid> sRepository, INormalEfCoreRepository<INVOICE_MAP_GROUP, Guid> mRepository, INormalEfCoreRepository<PUB_ADJ_DETAIL, Guid> adjRepository, BBAC_CAN_SA_MNG bbacMng, HBPO_CAN_SA_MNG hbpoMng, PUB_CAN_SA_MNG pubMng, INV_MNG invMng,
TaskJobService service, INormalEfCoreRepository<PriceList, Guid> priceRepository
TaskJobService service,
BaseDomainService baseservice,
INormalEfCoreRepository<PriceList, Guid> priceRepository
) : base(excelImportService, snowflakeIdGenerator, commonManager, repository, wRepository, sRepository, mRepository, adjRepository, bbacMng, hbpoMng, pubMng, invMng, service)
) : base(excelImportService, snowflakeIdGenerator, commonManager, repository, wRepository, sRepository, mRepository, adjRepository, bbacMng, hbpoMng, pubMng, invMng, service,baseservice)
{
_priceRepository = priceRepository;

1
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_SA_SERVICE.cs

@ -406,7 +406,6 @@ public class PUB_SA_SERVICE : SettleAccountApplicationBase<PUB_SA>
}
pubSaDetail.PN = Regex.Replace(pubSaDetail.PN, "['‘’]", "");
});
return GroupPnLu(pubSaDetails);
}

20
code/src/Modules/SettleAccount/src/SettleAccount.Domain.Shared/Enums/EnumMappingType.cs

@ -0,0 +1,20 @@
using System.ComponentModel.DataAnnotations;
namespace Win.Sfs.SettleAccount.Enums;
/// <summary>
/// 匹配类型
/// </summary>
public enum EnumMappingType
{
/// <summary>
/// 未定义
/// </summary>
[Display(Name = "未定义")]
None = 0,
/// <summary>
/// 完全匹配
/// </summary>
[Display(Name = "完全匹配")]
PerfectMatch = 1
}

15
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Bases/BaseDomainServices/BaseDomainService.cs

@ -28,11 +28,7 @@ namespace Win.Sfs.SettleAccount.Bases.DomainServices
private readonly INormalEfCoreRepository<MaterialRelationship, Guid> _relationshipRepository;
private readonly INormalEfCoreRepository<PriceList, Guid> _priceRepository;
private readonly INormalEfCoreRepository<PriceListBJ, Guid> _pricebjRepository;
private readonly INormalEfCoreRepository<Bom, Guid> _bomshipRepository;
public BaseDomainService(
IGuidGenerator guidGenerator,
IObjectMapper objectMapper,
@ -53,6 +49,15 @@ namespace Win.Sfs.SettleAccount.Bases.DomainServices
_bomshipRepository = bomshipRepository;
}
public async Task<List<MaterialRelationship>> GetMaterialList()
{
List<MaterialRelationship> ls = new List<MaterialRelationship>();
var lst = await _relationshipRepository.Where(p => !string.IsNullOrEmpty(p.SettleMaterialCode)).ToListAsync();
var l=lst.GroupBy(p => p.SettleMaterialCode).Select(g=> g.First());
return l.ToList();
}
public static async Task DoWorkBulkWithTransaction(DbContext dbContext, Action p_dowork)
{
@ -69,8 +74,6 @@ namespace Win.Sfs.SettleAccount.Bases.DomainServices
{
// 回滚事务
await transaction.RollbackAsync();
throw;
}
}

33
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/TED_SA_INV.cs

@ -1,21 +1,30 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Domain.Entities.Auditing;
namespace Win.Sfs.SettleAccount.Entities.BQ;
public class TED_SA_INV : AuditedAggregateRoot<Guid>
{
public class TED_SA_INV {
public Guid GUID { set; get; }
public Guid TaskID { set; get; }
public int UID { set; get; }
/// <summary>
/// 发票号
/// </summary>
public string invoiceNumber { set; get; }
public string InvoiceNumber { set; get; }
/// <summary>
/// 结算系统发票号
/// </summary>
public string sasInvoiceNumber { set; get; }
public string SASInvoiceNumber { set; get; }
/// <summary>
/// 客户代码
@ -97,10 +106,15 @@ public class TED_SA_INV : AuditedAggregateRoot<Guid>
public DateTime endtime { set; get; }
public TED_SA_INV(string invoiceNumber, string sasInvoiceNumber, string customer, string billTo, DateTime invoiceDate, string site, string tYPE, string partNumber, decimal invoiceQuatity, decimal price, string supplier, string remark, decimal invoiceNetAmount, decimal invoiceTaxAmount, decimal taxRate, string location, decimal invoiceNet, decimal invoiceTax, DateTime begintime, DateTime endtime)
public string Domain { set; get; }
public TED_SA_INV(Guid gUID, Guid taskID, int uID, string invoiceNumber, string sASInvoiceNumber, string customer, string billTo, DateTime invoiceDate, string site, string tYPE, string partNumber, decimal invoiceQuatity, decimal price, string supplier, string remark, decimal invoiceNetAmount, decimal invoiceTaxAmount, decimal taxRate, string location, decimal invoiceNet, decimal invoiceTax, DateTime begintime, DateTime endtime, string domain)
{
this.invoiceNumber = invoiceNumber;
this.sasInvoiceNumber = sasInvoiceNumber;
GUID = gUID;
TaskID = taskID;
UID = uID;
InvoiceNumber = invoiceNumber;
SASInvoiceNumber = sASInvoiceNumber;
Customer = customer;
BillTo = billTo;
InvoiceDate = invoiceDate;
@ -119,10 +133,7 @@ public class TED_SA_INV : AuditedAggregateRoot<Guid>
InvoiceTax = invoiceTax;
this.begintime = begintime;
this.endtime = endtime;
Domain = domain;
}
public TED_SA_INV()

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

@ -25,12 +25,6 @@ public class JisBBACEidSeCompareExport
[ExporterHeader(DisplayName = "类别")]
public string Category { get; set; }
/// <summary>
/// 交货单号
/// </summary>
[Display(Name = "交货单号")]
[ExporterHeader(DisplayName = "交货单号")]
public string WmsBillNum { get; set; }
/// <summary>
/// 车型
/// </summary>
[Display(Name = "车型")]
@ -49,42 +43,12 @@ public class JisBBACEidSeCompareExport
[ExporterHeader(DisplayName = "生产码序列号日期")]
public string SequenceNumber { get; set; }
/// <summary>
/// ParType
/// </summary>
[Display(Name = "ParType")]
[ExporterHeader(DisplayName = "ParType")]
public string ParType { get; set; }
/// <summary>
/// 配置码
/// </summary>
[Display(Name = "配置码")]
[ExporterHeader(DisplayName = "配置码")]
public string MESConfigCode { get; set; }
/// <summary>
/// 发货日期
/// </summary>
[Display(Name = "发货日期")]
[ExporterHeader(DisplayName = "发货日期", Format = "yyyy-MM-dd")]
public DateTime? ShippingDate { get; set; }
/// <summary>
/// 生产码
/// </summary>
[Display(Name = "生产码")]
[ExporterHeader(DisplayName = "生产码")]
public string PN { get; set; }
/// <summary>
/// 序列号
/// </summary>
[Display(Name = "序列号")]
[ExporterHeader(DisplayName = "序列号")]
public string Seq { get; set; }
/// <summary>
/// PJIS日顺序号
/// </summary>
[Display(Name = "PJIS日顺序号")]
[ExporterHeader(DisplayName = "PJIS日顺序号")]
public string PjsNum { get; set; }
/// <summary>
/// 物料号
/// </summary>
[Display(Name = "物料号")]
@ -115,6 +79,42 @@ public class JisBBACEidSeCompareExport
[ExporterHeader(DisplayName = "WMS发货与EDI数量差")]
public decimal DiffQty => SEQty - EdiQty;
/// <summary>
/// 交货单号
/// </summary>
[Display(Name = "交货单号")]
[ExporterHeader(DisplayName = "交货单号")]
public string WmsBillNum { get; set; }
/// <summary>
/// ParType
/// </summary>
[Display(Name = "ParType")]
[ExporterHeader(DisplayName = "ParType")]
public string ParType { get; set; }
/// <summary>
/// 配置码
/// </summary>
[Display(Name = "配置码")]
[ExporterHeader(DisplayName = "配置码")]
public string MESConfigCode { get; set; }
/// <summary>
/// 发货日期
/// </summary>
[Display(Name = "发货日期")]
[ExporterHeader(DisplayName = "发货日期", Format = "yyyy-MM-dd")]
public DateTime? ShippingDate { get; set; }
/// <summary>
/// 序列号
/// </summary>
[Display(Name = "序列号")]
[ExporterHeader(DisplayName = "序列号")]
public string Seq { get; set; }
/// <summary>
/// PJIS日顺序号
/// </summary>
[Display(Name = "PJIS日顺序号")]
[ExporterHeader(DisplayName = "PJIS日顺序号")]
public string PjsNum { get; set; }
/// <summary>
/// 客户下线时间
/// </summary>
[Display(Name = "客户下线时间")]

102
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/JisHBPOEidSeCompareReport.cs

@ -25,30 +25,66 @@ public class JisHBPOEidSeCompareExport
[ExporterHeader(DisplayName = "类别")]
public string Category { get; set; }
/// <summary>
/// 交货单号
/// </summary>
[Display(Name = "交货单号")]
[ExporterHeader(DisplayName = "交货单号")]
public string WmsBillNum { get; set; }
/// <summary>
/// CarModeCode
/// 车型
/// </summary>
[Display(Name = "CarModeCode")]
[ExporterHeader(DisplayName = "CarModeCode")]
[Display(Name = "车型")]
[ExporterHeader(DisplayName = "车型")]
public string CarModeCode { get; set; }
/// <summary>
/// LineStationcode
/// 生产线
/// </summary>
[Display(Name = "LineStationcode")]
[ExporterHeader(DisplayName = "LineStationcode")]
[Display(Name = "生产线")]
[ExporterHeader(DisplayName = "生产线")]
public string LineStationcode { get; set; }
/// <summary>
/// SequenceNumber
/// 生产码序列号日期
/// </summary>
[Display(Name = "SequenceNumber")]
[ExporterHeader(DisplayName = "SequenceNumber")]
[Display(Name = "生产码序列号日期")]
[ExporterHeader(DisplayName = "生产码序列号日期")]
public string SequenceNumber { get; set; }
/// <summary>
/// 生产码
/// </summary>
[Display(Name = "生产码")]
[ExporterHeader(DisplayName = "生产码")]
public string PN { get; set; }
/// <summary>
/// 物料号
/// </summary>
[Display(Name = "物料号")]
[ExporterHeader(DisplayName = "物料号")]
public string MaterialNumber { get; set; }
/// <summary>
/// 物料描述
/// </summary>
[Display(Name = "物料描述")]
[ExporterHeader(DisplayName = "物料描述")]
public string MaterialDes { get; set; }
/// <summary>
/// WMS发货数量
/// </summary>
[Display(Name = "WMS发货数量")]
[ExporterHeader(DisplayName = "WMS发货数量")]
public decimal SEQty { get; set; }
/// <summary>
/// EDI数量
/// </summary>
[Display(Name = "EDI数量")]
[ExporterHeader(DisplayName = "EDI数量")]
public decimal EdiQty { get; set; }
/// <summary>
/// WMS发货与EDI数量差
/// </summary>
[Display(Name = "WMS发货与EDI数量差")]
[ExporterHeader(DisplayName = "WMS发货与EDI数量差")]
public decimal DiffQty => SEQty - EdiQty;
/// <summary>
/// 交货单号
/// </summary>
[Display(Name = "交货单号")]
[ExporterHeader(DisplayName = "交货单号")]
public string WmsBillNum { get; set; }
/// <summary>
/// ParType
/// </summary>
[Display(Name = "ParType")]
@ -73,12 +109,6 @@ public class JisHBPOEidSeCompareExport
[ExporterHeader(DisplayName = "实际发货生产号")]
public string RealCode { get; set; }
/// <summary>
/// 生产码
/// </summary>
[Display(Name = "生产码")]
[ExporterHeader(DisplayName = "生产码")]
public string PN { get; set; }
/// <summary>
/// 序列号
/// </summary>
[Display(Name = "序列号")]
@ -103,36 +133,6 @@ public class JisHBPOEidSeCompareExport
[ExporterHeader(DisplayName = "ERP目标库位")]
public string ErpToLoc { get; set; }
/// <summary>
/// 物料号
/// </summary>
[Display(Name = "物料号")]
[ExporterHeader(DisplayName = "物料号")]
public string MaterialNumber { get; set; }
/// <summary>
/// 物料描述
/// </summary>
[Display(Name = "物料描述")]
[ExporterHeader(DisplayName = "物料描述")]
public string MaterialDes { get; set; }
/// <summary>
/// WMS发货数量
/// </summary>
[Display(Name = "WMS发货数量")]
[ExporterHeader(DisplayName = "WMS发货数量")]
public decimal SEQty { get; set; }
/// <summary>
/// EDI数量
/// </summary>
[Display(Name = "EDI数量")]
[ExporterHeader(DisplayName = "EDI数量")]
public decimal EdiQty { get; set; }
/// <summary>
/// WMS发货与EDI数量差
/// </summary>
[Display(Name = "WMS发货与EDI数量差")]
[ExporterHeader(DisplayName = "WMS发货与EDI数量差")]
public decimal DiffQty => SEQty - EdiQty;
/// <summary>
/// 客户下线时间
/// </summary>
[Display(Name = "客户下线时间")]

34
code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/ExChangeCenterDbContext.cs

@ -0,0 +1,34 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore;
using Volo.Abp.Data;
using Win.Sfs.SettleAccount.Entities.BQ;
namespace Win.Sfs.SettleAccount.EntityFrameworkCore;
[ConnectionStringName("WMSBJBMPT")]
public class ExChangeCenterDbContext:DbContext
{
public DbSet<TED_SA_INV> TED_SA_INV { set; get; }
public ExChangeCenterDbContext(DbContextOptions<WMSBJBMPTDbContext> options) : base(options)
{
}
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
base.OnModelCreating(modelBuilder);
}
}

42
code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContextModelCreatingExtensions.cs

@ -114,7 +114,7 @@ namespace Win.Sfs.SettleAccount
builder.ConfigurePUB_PD(options);
builder.ConfigureTED_SA_INV(options);
//builder.ConfigureTED_SA_INV(options);
//大众发票导入
//builder.ConfigureInvoice(options);
//builder.ConfigureInvoiceVersion(options);
@ -976,7 +976,6 @@ namespace Win.Sfs.SettleAccount
builder.Entity<INVOICE_MAP_GROUP>(b =>
{
b.ToTable($"{options.TablePrefix}_INVOICE_MAP_GROUP", options.Schema);
b.ConfigureByConvention();
b.Property(x => x.InvbillNum).HasMaxLength(50);
b.Property(x => x.InvGroupNum).HasMaxLength(50);
@ -1085,7 +1084,6 @@ namespace Win.Sfs.SettleAccount
builder.Entity<PUB_NOT_SA_DETAIL>(b =>
{
b.ToTable($"{options.TablePrefix}_PUB_NOT_SA_DETAIL", options.Schema);
b.ConfigureByConvention();
b.Property(x => x.Site).HasMaxLength(50);
b.Property(x => x.Extend1).HasMaxLength(50);
@ -1261,28 +1259,28 @@ namespace Win.Sfs.SettleAccount
});
}
private static void ConfigureTED_SA_INV(this ModelBuilder builder, SettleAccountModelBuilderConfigurationOptions options)
{
//private static void ConfigureTED_SA_INV(this ModelBuilder builder, SettleAccountModelBuilderConfigurationOptions options)
//{
builder.Entity<TED_SA_INV>(b =>
{
// builder.Entity<TED_SA_INV>(b =>
// {
b.ToTable($"{options.TablePrefix}_TED_SA_INV", options.Schema);
// b.ToTable($"{options.TablePrefix}_TED_SA_INV", options.Schema);
b.ConfigureByConvention();
b.Property(x => x.invoiceNumber).HasMaxLength(50);
b.Property(x => x.sasInvoiceNumber).HasMaxLength(50);
b.Property(x => x.Customer).HasMaxLength(50);
b.Property(x => x.BillTo).HasMaxLength(50);
b.Property(x => x.Site).HasMaxLength(50);
b.Property(x => x.TYPE).HasMaxLength(50);
b.Property(x => x.PartNumber).HasMaxLength(50);
b.Property(x => x.Supplier).HasMaxLength(50);
b.Property(x => x.Remark).HasMaxLength(50);
b.Property(x => x.Location).HasMaxLength(50);
b.Property(x => x.ConcurrencyStamp).HasMaxLength(50);
});
}
// b.ConfigureByConvention();
// b.Property(x => x.invoiceNumber).HasMaxLength(50);
// b.Property(x => x.sasInvoiceNumber).HasMaxLength(50);
// b.Property(x => x.Customer).HasMaxLength(50);
// b.Property(x => x.BillTo).HasMaxLength(50);
// b.Property(x => x.Site).HasMaxLength(50);
// b.Property(x => x.TYPE).HasMaxLength(50);
// b.Property(x => x.PartNumber).HasMaxLength(50);
// b.Property(x => x.Supplier).HasMaxLength(50);
// b.Property(x => x.Remark).HasMaxLength(50);
// b.Property(x => x.Location).HasMaxLength(50);
// b.Property(x => x.ConcurrencyStamp).HasMaxLength(50);
// });
//}

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

@ -2,7 +2,6 @@ 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;
@ -17,7 +16,6 @@ using Volo.Abp.ObjectMapping;
using Win.Sfs.BaseData.ImportExcelCommon;
using Win.Sfs.SettleAccount;
using Win.Sfs.SettleAccount.Entities.BQ;
using Win.Sfs.SettleAccount.Enums;
using Win.Sfs.SettleAccount.Reports;
using Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report;
using Win.Sfs.Shared.RepositoryBase;

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

@ -7,6 +7,7 @@ using Microsoft.AspNetCore.SignalR;
using SettleAccount.Bases;
using SettleAccount.Domain.BQ;
using SettleAccount.Job.SignalR;
using Volo.Abp;
using Win.Sfs.SettleAccount;
using Win.Sfs.SettleAccount.Consts;
using Win.Sfs.SettleAccount.Enums;
@ -173,6 +174,38 @@ namespace SettleAccount.Job.Services.Report
}
}
/// <summary>
/// 处理发运数据
/// 结算、发运对比上的数据修改结算数据状态
/// </summary>
public virtual void HandLeSaDetailsMain<T>(List<PubSaSeCompareDiff> pubSaSeCompareDiffs, EnumBusinessType businessType, int version) where T : SA_BASE
{
var haveSaHaveSes = pubSaSeCompareDiffs.FindAll(t => t.Category == EnumPubSaSeCompareCategory.HaveSaHaveSe);
if (haveSaHaveSes.Any())
{
//结算详情
var saDetails = (from sa in _settleAccountDbContext.Set<T>()
where sa.BusinessType == businessType && sa.Version == version
select sa).ToList();
if (saDetails.Any())
{
var saDetailsUpdate = saDetails.Join(haveSaHaveSes, o => new { o.PN, o.LU }, i => new { i.PN, LU = i.CustomerPartCode }, (o, i) =>
{
var mappingType = (i.SAQty - i.SEQty) switch
{
> 0 => EnumMappingType.None,
0 => EnumMappingType.PerfectMatch,
< 0 => EnumMappingType.None,
_ => default,
};
o.ExtraProperties.Add("MappingType", mappingType);
return o;
}).ToList();
_settleAccountDbContext.BulkUpdate(saDetailsUpdate);
}
}
}
/// <summary>
/// 创建导出文件结构
/// </summary>

Loading…
Cancel
Save