|
@@ -362,7 +362,15 @@ public class SubjectChangeServiceImpl extends BaseServiceImpl<Integer, SubjectCh
|
|
|
List<Goods> goodsList = goodsService.findGoodsByIds(goodsIdsStr);
|
|
|
Map<Integer,Goods> goodsMap = goodsList.stream().collect(Collectors.toMap(Goods :: getId, t -> t));
|
|
|
Goods goods = null;
|
|
|
- BigDecimal goodsTotalGroupPurchasePrice = goodsList.stream().map(t -> t.getGroupPurchasePrice()).reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
|
+ BigDecimal goodsTotalGroupPurchasePrice = BigDecimal.ZERO;
|
|
|
+
|
|
|
+ for(String goodsIdStr : goodsIdsStr.split(",")){
|
|
|
+ if(StringUtils.isBlank(goodsIdStr)){
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ goods = goodsMap.get(Integer.parseInt(goodsIdStr));
|
|
|
+ goodsTotalGroupPurchasePrice = goodsTotalGroupPurchasePrice.add(goods.getGroupPurchasePrice());
|
|
|
+ }
|
|
|
|
|
|
for(String goodsIdStr : goodsIdsStr.split(",")){
|
|
|
if(StringUtils.isBlank(goodsIdStr)){
|