|
@@ -97,16 +97,13 @@ public class PriceSystemServiceImpl extends ServiceImpl<PriceSystemMapper, Price
|
|
|
}
|
|
|
|
|
|
// 赋值bom售价体系
|
|
|
- List<Long> bomIdList = records.stream().map(BaseIdPo::getId).collect(Collectors.toList());
|
|
|
- if (bomIdList.size() > 0) {
|
|
|
- Map<Long, Long> priceSystemBomMap = priceSystemBomService.mapKV(
|
|
|
- PriceSystemBom::getBomId,
|
|
|
- PriceSystemBom::getPriceBillingStandardId,
|
|
|
- q -> q.in(PriceSystemBom::getBomId, bomIdList));
|
|
|
-
|
|
|
- for (BomVo record : records) {
|
|
|
- record.setPriceBillingStandardId(priceSystemBomMap.get(record.getId()));
|
|
|
- }
|
|
|
+ List<Long> bomIdList = records.stream().map(BaseIdPo::getId).distinct().collect(Collectors.toList());
|
|
|
+ Map<Long, Long> priceSystemBomMap = priceSystemBomService.mapKV(
|
|
|
+ PriceSystemBom::getBomId,
|
|
|
+ PriceSystemBom::getPriceBillingStandardId,
|
|
|
+ q -> q.eq(PriceSystemBom::getPriceSystemId, priceSystemId).in(PriceSystemBom::getBomId, bomIdList));
|
|
|
+ for (BomVo record : records) {
|
|
|
+ record.setPriceBillingStandardId(priceSystemBomMap.get(record.getId()));
|
|
|
}
|
|
|
|
|
|
// 赋值bom规格对内售价和对外售价
|
|
@@ -115,12 +112,9 @@ public class PriceSystemServiceImpl extends ServiceImpl<PriceSystemMapper, Price
|
|
|
.flatMap(item -> item.getBomSpecList().stream())
|
|
|
.map(BaseIdPo::getId)
|
|
|
.collect(Collectors.toList());
|
|
|
- if (bomSpecIdList.size() == 0) {
|
|
|
- return page;
|
|
|
- }
|
|
|
Map<Long, PriceSystemBomSpec> priceSystemBomSpecMap = priceSystemBomSpecService.mapKEntity(
|
|
|
PriceSystemBomSpec::getBomSpecId,
|
|
|
- q -> q.in(PriceSystemBomSpec::getBomSpecId, bomSpecIdList));
|
|
|
+ q -> q.eq(PriceSystemBomSpec::getPriceSystemId, priceSystemId).in(PriceSystemBomSpec::getBomSpecId, bomSpecIdList));
|
|
|
for (BomVo record : records) {
|
|
|
List<BomSpec> bomSpecList = record.getBomSpecList();
|
|
|
if (ObjectUtil.isEmpty(bomSpecList)) {
|
|
@@ -139,5 +133,4 @@ public class PriceSystemServiceImpl extends ServiceImpl<PriceSystemMapper, Price
|
|
|
return page;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
}
|