|
|
@@ -348,7 +348,11 @@ public class StudentPaymentOrderDetailServiceImpl extends BaseServiceImpl<Long,
|
|
|
kitGroupPurchaseType = spod.getKitGroupPurchaseType();
|
|
|
goodsId = spod.getGoodsIdList();
|
|
|
}else if(spod.getType() == OrderDetailTypeEnum.ACCESSORIES){
|
|
|
- accessoriesId = spod.getGoodsIdList() + ",";
|
|
|
+ if(StringUtils.isBlank(accessoriesId)){
|
|
|
+ accessoriesId = spod.getGoodsIdList();
|
|
|
+ }else{
|
|
|
+ accessoriesId = accessoriesId + "," + spod.getGoodsIdList();
|
|
|
+ }
|
|
|
}else{
|
|
|
withoutMusicalTotalAmount = withoutMusicalTotalAmount.add(spod.getPrice().subtract(spod.getRemitFee()));
|
|
|
}
|
|
|
@@ -389,10 +393,18 @@ public class StudentPaymentOrderDetailServiceImpl extends BaseServiceImpl<Long,
|
|
|
dto.setUsername(usernameMap.get(userId));
|
|
|
}else{
|
|
|
|
|
|
- if(StringUtils.isNoneBlank(accessoriesId)){
|
|
|
- accessoriesId = StringUtils.removeEnd(accessoriesId, ",");
|
|
|
- dto.setAccessoriesName(goodsService.findGoodsByIds(accessoriesId).stream().map(Goods::getName).collect(Collectors.joining(",")));
|
|
|
- }
|
|
|
+ if (StringUtils.isNoneBlank(accessoriesId)) {
|
|
|
+ accessoriesId = StringUtils.removeEnd(accessoriesId, ",");
|
|
|
+ Map<Integer, Goods> goodsMap = goodsService.findGoodsByIds(accessoriesId).stream().collect(Collectors.toMap(Goods::getId, Goods -> Goods));
|
|
|
+
|
|
|
+ String[] accessoriesIds = StringUtils.split(accessoriesId, ',');
|
|
|
+
|
|
|
+ StringBuffer sb = new StringBuffer();
|
|
|
+ for (String s : accessoriesIds) {
|
|
|
+ sb.append(goodsMap.get(Integer.parseInt(s)).getName()).append(",");
|
|
|
+ }
|
|
|
+ dto.setAccessoriesName(StringUtils.removeEnd(sb.toString(), ","));
|
|
|
+ }
|
|
|
|
|
|
dto.setAccessoriesAmount(userOrderTypeMap.get(OrderDetailTypeEnum.ACCESSORIES));
|
|
|
dto.setCourseAmount(userOrderTypeMap.get(OrderDetailTypeEnum.COURSE));
|