wanggang 1 year ago
parent
commit
6ac8ba087e
  1. 23
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/INVOICE_SERVICE.cs
  2. 4
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_CAN_SA_SERVICE.cs
  3. 1
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/HBPO_NOT_SA_MNG.cs

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

@ -318,13 +318,16 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
SettleGroupNum = p.FirstOrDefault().SettleGroupNum, SettleGroupNum = p.FirstOrDefault().SettleGroupNum,
} }
); );
var all= entity.INVOICE_NOT_SETTLE.Select(p => p.SettleGroupNum).Distinct().ToList();//全部分组号 if (first.BusinessType == EnumBusinessType.ZhiGongJianBBAC)
var part = mquery.ToList().Select(p => p.SettleGroupNum).Distinct().ToList();//发票对应分组号 {
var unsettled= all.Where(p => !part.Contains(p));//排除发票对应分组号,都为不可结 //var all = entity.INVOICE_NOT_SETTLE.Select(p => p.SettleGroupNum).Distinct().ToList();//全部分组号
var unsettledList= entity.INVOICE_NOT_SETTLE.Where(p => unsettled.Contains(p.SettleGroupNum)) //var part = mquery.ToList().Select(p => p.SettleGroupNum).Distinct().ToList();//发票对应分组号
.GroupBy(p => new { p.LU, p.SettleGroupNum }) //var unsettled = all.Where(p => !part.Contains(p));//排除发票对应分组号,都为不可结
.Select(p => new UNSETTLED_DETAIL_DTO { LU = p.Key.LU, GroupNum = p.Key.SettleGroupNum, Qty = p.Sum(itm => itm.Qty.Value) }); var unsettledList = sdtos
entity.UNSETTLED_DETAIL = unsettledList.ToList().OrderBy(p=>p.GroupNum).ThenBy(p=>p.LU).ToList(); .GroupBy(p => new { p.LU, p.SettleGroupNum })
.Select(p => new UNSETTLED_DETAIL_DTO { LU = p.Key.LU, GroupNum = p.Key.SettleGroupNum, Qty = p.Sum(itm => itm.Qty.Value) });
entity.UNSETTLED_DETAIL = unsettledList.ToList().OrderBy(p => p.GroupNum).ThenBy(p => p.LU).ToList();
}
entity.INVOICE_MAP_GROUP = lscompare.ToList().OrderBy(p => p.SettleGroupNum).ToList();//包含不可结结算分组号 entity.INVOICE_MAP_GROUP = lscompare.ToList().OrderBy(p => p.SettleGroupNum).ToList();//包含不可结结算分组号
entity.ADJ_DETAIL = adjQuery.ToList().OrderBy(p=>p.GroupNum).ThenBy(p=>p.LU).ToList(); entity.ADJ_DETAIL = adjQuery.ToList().OrderBy(p=>p.GroupNum).ThenBy(p=>p.LU).ToList();
return entity; return entity;
@ -388,7 +391,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
var adj = invdetail.ADJ_DETAIL;//调整表 var adj = invdetail.ADJ_DETAIL;//调整表
var bbac = invdetail.INVOICE_WAIT_DETAIL_BBAC;//BBACJIS明细 var bbac = invdetail.INVOICE_WAIT_DETAIL_BBAC;//BBACJIS明细
var bj = invdetail.INVOICE_WAIT_DETAIL_BJ;//备件明细 var bj = invdetail.INVOICE_WAIT_DETAIL_BJ;//备件明细
var unsettle = invdetail.UNSETTLED_DETAIL;//未结明细 var unsettle = invdetail.UNSETTLED_DETAIL;//全部未结明细
var classDisplayName = typeof(INVOICE_GRP_DTO).GetCustomAttribute<DisplayAttribute>()?.Name ?? typeof(INVOICE_GRP_DTO).Name; var classDisplayName = typeof(INVOICE_GRP_DTO).GetCustomAttribute<DisplayAttribute>()?.Name ?? typeof(INVOICE_GRP_DTO).Name;
@ -413,10 +416,12 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
{ {
_excel.Append(m, "发票结算分组对应");//发票分组对应结算号 _excel.Append(m, "发票结算分组对应");//发票分组对应结算号
} }
if (first.BusinessType == EnumBusinessType.ZhiGongJianBBAC || first.BusinessType == EnumBusinessType.ZhiGongJianHBPO) if (first.BusinessType == EnumBusinessType.ZhiGongJianBBAC )
{ {
_excel.Append(unsettle, "未结零件结算汇总"); _excel.Append(unsettle, "未结零件结算汇总");
} }
foreach (var itm in entities) foreach (var itm in entities)
{ {
var mgroup = m.Where(p => p.InvbillNum == itm.InvbillNum).ToList(); var mgroup = m.Where(p => p.InvbillNum == itm.InvbillNum).ToList();

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

@ -51,7 +51,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
private readonly PUB_CAN_SA_MNG _pubMng; private readonly PUB_CAN_SA_MNG _pubMng;
private readonly INormalEfCoreRepository<PriceList, Guid> _priceRepository; private readonly INormalEfCoreRepository<PriceList, Guid> _priceRepository;
private readonly INormalEfCoreRepository<PriceListBJ, Guid> _pricebjRepository; private readonly INormalEfCoreRepository<PriceListBJ, Guid> _pricebjRepository;
private readonly INormalEfCoreRepository<BBAC_NOT_SA_DETAIL, Guid> _notRepository; private readonly INormalEfCoreRepository<PUB_NOT_SA_DETAIL, Guid> _notRepository;
public PUB_CAN_SA_SERVICE public PUB_CAN_SA_SERVICE
(IExcelImportAppService excelImportService, (IExcelImportAppService excelImportService,
@ -64,7 +64,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
INormalEfCoreRepository<PriceListBJ, Guid> pricebjRepository, INormalEfCoreRepository<PriceListBJ, Guid> pricebjRepository,
PUB_CAN_SA_MNG pubMng, PUB_CAN_SA_MNG pubMng,
BaseDomainService baseservice, BaseDomainService baseservice,
INormalEfCoreRepository<BBAC_NOT_SA_DETAIL, Guid> notRepository INormalEfCoreRepository<PUB_NOT_SA_DETAIL, Guid> notRepository
) : base(excelImportService, snowflakeIdGenerator, commonManager, repository, detailRepository, invmng,baseservice) ) : base(excelImportService, snowflakeIdGenerator, commonManager, repository, detailRepository, invmng,baseservice)
{ {

1
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/HBPO_NOT_SA_MNG.cs

@ -112,7 +112,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
await _repository.DbContext.BulkInsertAsync(_entityList); await _repository.DbContext.BulkInsertAsync(_entityList);
return errors; return errors;
} }

Loading…
Cancel
Save