|
@@ -257,12 +257,15 @@ public class StudentRepairServiceImpl extends BaseServiceImpl<Integer, StudentRe
|
|
StudentGoodsSell studentGoodsSell = studentGoodsSellDao.get(goodsSellId);
|
|
StudentGoodsSell studentGoodsSell = studentGoodsSellDao.get(goodsSellId);
|
|
Integer studentId = studentGoodsSell.getUserId();
|
|
Integer studentId = studentGoodsSell.getUserId();
|
|
studentDao.lockUser(studentId);
|
|
studentDao.lockUser(studentId);
|
|
-// SysUser student = sysUserFeignService.queryUserById(studentId);
|
|
|
|
List<GoodsSellDto> goodsSellDtos = JSONObject.parseArray(studentGoodsSell.getGoodsJson(),GoodsSellDto.class);
|
|
List<GoodsSellDto> goodsSellDtos = JSONObject.parseArray(studentGoodsSell.getGoodsJson(),GoodsSellDto.class);
|
|
List<Integer> goodsIds = goodsSellDtos.stream().map(e -> e.getGoodsId()).collect(Collectors.toList());
|
|
List<Integer> goodsIds = goodsSellDtos.stream().map(e -> e.getGoodsId()).collect(Collectors.toList());
|
|
-
|
|
|
|
|
|
+ Map<Integer, String> integerStringMap = getMap("goods", "id_", "type_", goodsIds, Integer.class, String.class);
|
|
Map<Integer, BigDecimal> map = getMap("goods", "id_", "discount_price_", goodsIds, Integer.class, BigDecimal.class);
|
|
Map<Integer, BigDecimal> map = getMap("goods", "id_", "discount_price_", goodsIds, Integer.class, BigDecimal.class);
|
|
for (GoodsSellDto goodsSellDto : goodsSellDtos) {
|
|
for (GoodsSellDto goodsSellDto : goodsSellDtos) {
|
|
|
|
+ goodsSellDto.setGoodsType(integerStringMap.get(goodsSellDto.getGoodsId()));
|
|
|
|
+ if(StringUtils.isNotEmpty(goodsSellDto.getComplementGoodsIdList())){
|
|
|
|
+ goodsSellDto.setGoodsSellDtos(goodsService.queryGoodsSellDtos(goodsSellDto.getComplementGoodsIdList()));
|
|
|
|
+ }
|
|
goodsSellDto.setGoodsPrice(map.get(goodsSellDto.getGoodsId()));
|
|
goodsSellDto.setGoodsPrice(map.get(goodsSellDto.getGoodsId()));
|
|
goodsSellDto.setTotalGoodsPrice(map.get(goodsSellDto.getGoodsId()).multiply(new BigDecimal(goodsSellDto.getGoodsNum())));
|
|
goodsSellDto.setTotalGoodsPrice(map.get(goodsSellDto.getGoodsId()).multiply(new BigDecimal(goodsSellDto.getGoodsNum())));
|
|
}
|
|
}
|
|
@@ -771,6 +774,8 @@ public class StudentRepairServiceImpl extends BaseServiceImpl<Integer, StudentRe
|
|
Map<Integer,BigDecimal> parentGoodsCutTotalPriceMap = new HashMap<>();
|
|
Map<Integer,BigDecimal> parentGoodsCutTotalPriceMap = new HashMap<>();
|
|
//组合商品附加金额
|
|
//组合商品附加金额
|
|
Map<Integer,BigDecimal> parentGoodsAddTotalPriceMap = new HashMap<>();
|
|
Map<Integer,BigDecimal> parentGoodsAddTotalPriceMap = new HashMap<>();
|
|
|
|
+ //组合商品实际总价
|
|
|
|
+ Map<Integer,BigDecimal> parentGoodsTotalPriceMap = new HashMap<>();
|
|
//应付总额
|
|
//应付总额
|
|
BigDecimal totalActual = totalAmount.subtract(marketAmount);
|
|
BigDecimal totalActual = totalAmount.subtract(marketAmount);
|
|
//可用应付
|
|
//可用应付
|
|
@@ -799,6 +804,7 @@ public class StudentRepairServiceImpl extends BaseServiceImpl<Integer, StudentRe
|
|
for (GoodsSellDto sellDto : goodsSellDto.getGoodsSellDtos()) {
|
|
for (GoodsSellDto sellDto : goodsSellDto.getGoodsSellDtos()) {
|
|
totalGoodsPrice = totalGoodsPrice.add(sellDto.getTotalGoodsPrice());
|
|
totalGoodsPrice = totalGoodsPrice.add(sellDto.getTotalGoodsPrice());
|
|
}
|
|
}
|
|
|
|
+ parentGoodsTotalPriceMap.put(sellOrder.getParentGoodsId(),totalGoodsPrice);
|
|
//如果组合价大于预计总价
|
|
//如果组合价大于预计总价
|
|
if (parentTotalGoodsPrice.compareTo(totalGoodsPrice) == 1){
|
|
if (parentTotalGoodsPrice.compareTo(totalGoodsPrice) == 1){
|
|
parentGoodsAddTotalPriceMap.put(sellOrder.getParentGoodsId(),parentTotalGoodsPrice.subtract(totalGoodsPrice));
|
|
parentGoodsAddTotalPriceMap.put(sellOrder.getParentGoodsId(),parentTotalGoodsPrice.subtract(totalGoodsPrice));
|
|
@@ -816,12 +822,13 @@ public class StudentRepairServiceImpl extends BaseServiceImpl<Integer, StudentRe
|
|
|
|
|
|
//获取组合商品销售总价
|
|
//获取组合商品销售总价
|
|
GoodsSellDto goodsSellDto = collect.get(parentGoodsId).get(0);
|
|
GoodsSellDto goodsSellDto = collect.get(parentGoodsId).get(0);
|
|
- BigDecimal divide = goodsSellDto.getGoodsPrice();
|
|
|
|
|
|
+// BigDecimal divide = goodsSellDto.getGoodsPrice();
|
|
|
|
|
|
//获取子商品明细map
|
|
//获取子商品明细map
|
|
List<GoodsSellDto> sellDtos = goodsSellDto.getGoodsSellDtos();
|
|
List<GoodsSellDto> sellDtos = goodsSellDto.getGoodsSellDtos();
|
|
Map<Integer, List<GoodsSellDto>> subGoodsMap = sellDtos.stream().collect(Collectors.groupingBy(GoodsSellDto::getGoodsId));
|
|
Map<Integer, List<GoodsSellDto>> subGoodsMap = sellDtos.stream().collect(Collectors.groupingBy(GoodsSellDto::getGoodsId));
|
|
List<Integer> integers = new ArrayList<>(subGoodsMap.keySet());
|
|
List<Integer> integers = new ArrayList<>(subGoodsMap.keySet());
|
|
|
|
+ BigDecimal divide = parentGoodsTotalPriceMap.get(parentGoodsId);
|
|
for (int i = 0; i < integers.size(); i++) {
|
|
for (int i = 0; i < integers.size(); i++) {
|
|
GoodsSellDto sellDto = subGoodsMap.get(integers.get(i)).get(0);
|
|
GoodsSellDto sellDto = subGoodsMap.get(integers.get(i)).get(0);
|
|
//获取比例
|
|
//获取比例
|