diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/INVOICE_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/INVOICE_SERVICE.cs index 60989ed7..b75e1024 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/INVOICE_SERVICE.cs +++ b/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, } ); - var all= entity.INVOICE_NOT_SETTLE.Select(p => p.SettleGroupNum).Distinct().ToList();//全部分组号 - var part = mquery.ToList().Select(p => p.SettleGroupNum).Distinct().ToList();//发票对应分组号 - var unsettled= all.Where(p => !part.Contains(p));//排除发票对应分组号,都为不可结 - var unsettledList= entity.INVOICE_NOT_SETTLE.Where(p => unsettled.Contains(p.SettleGroupNum)) - .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(); + if (first.BusinessType == EnumBusinessType.ZhiGongJianBBAC) + { + //var all = entity.INVOICE_NOT_SETTLE.Select(p => p.SettleGroupNum).Distinct().ToList();//全部分组号 + //var part = mquery.ToList().Select(p => p.SettleGroupNum).Distinct().ToList();//发票对应分组号 + //var unsettled = all.Where(p => !part.Contains(p));//排除发票对应分组号,都为不可结 + var unsettledList = sdtos + .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.ADJ_DETAIL = adjQuery.ToList().OrderBy(p=>p.GroupNum).ThenBy(p=>p.LU).ToList(); return entity; @@ -388,7 +391,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ var adj = invdetail.ADJ_DETAIL;//调整表 var bbac = invdetail.INVOICE_WAIT_DETAIL_BBAC;//BBACJIS明细 var bj = invdetail.INVOICE_WAIT_DETAIL_BJ;//备件明细 - var unsettle = invdetail.UNSETTLED_DETAIL;//未结明细 + var unsettle = invdetail.UNSETTLED_DETAIL;//全部未结明细 var classDisplayName = typeof(INVOICE_GRP_DTO).GetCustomAttribute()?.Name ?? typeof(INVOICE_GRP_DTO).Name; @@ -413,10 +416,12 @@ namespace Win.Sfs.SettleAccount.Entities.BQ { _excel.Append(m, "发票结算分组对应");//发票分组对应结算号 } - if (first.BusinessType == EnumBusinessType.ZhiGongJianBBAC || first.BusinessType == EnumBusinessType.ZhiGongJianHBPO) + if (first.BusinessType == EnumBusinessType.ZhiGongJianBBAC ) { _excel.Append(unsettle, "未结零件结算汇总"); } + + foreach (var itm in entities) { var mgroup = m.Where(p => p.InvbillNum == itm.InvbillNum).ToList(); diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_CAN_SA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_CAN_SA_SERVICE.cs index 0784a176..1b072d74 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_CAN_SA_SERVICE.cs +++ b/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 INormalEfCoreRepository _priceRepository; private readonly INormalEfCoreRepository _pricebjRepository; - private readonly INormalEfCoreRepository _notRepository; + private readonly INormalEfCoreRepository _notRepository; public PUB_CAN_SA_SERVICE (IExcelImportAppService excelImportService, @@ -64,7 +64,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ INormalEfCoreRepository pricebjRepository, PUB_CAN_SA_MNG pubMng, BaseDomainService baseservice, - INormalEfCoreRepository notRepository + INormalEfCoreRepository notRepository ) : base(excelImportService, snowflakeIdGenerator, commonManager, repository, detailRepository, invmng,baseservice) { diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/HBPO_NOT_SA_MNG.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/HBPO_NOT_SA_MNG.cs index ee2caaed..6c61c6bb 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/HBPO_NOT_SA_MNG.cs +++ b/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); - return errors; }