|
|
@@ -426,15 +426,10 @@ public class GoodsWholesalePayServiceImpl implements GoodsWholesalePayService {
|
|
|
}
|
|
|
String configStr = goodsWholesale.getConfig();
|
|
|
List<GoodsWholesale.GoodsWholesaleConfig> configs = Jsons.parseList(configStr, GoodsWholesale.GoodsWholesaleConfig.class);
|
|
|
- List<GoodsWholesale.GoodsWholesaleConfig> allConfigs = configs;
|
|
|
GoodsWholesale.GoodsWholesaleConfig firstConfig = configs.get(0);
|
|
|
GoodsWholesale.GoodsWholesaleConfig endConfig = configs.get(configs.size() - 1);
|
|
|
Integer hasPaidNum = goodsWholesaleOrderDonMapper.getUserWholesaleNumByUserIds(userIdList, goodsWholesale.getSkuId());
|
|
|
Integer endPayNum = hasPaidNum + thisPayNum;
|
|
|
- //移除第一档
|
|
|
- configs.remove(firstConfig);
|
|
|
- //移除倒数第一档
|
|
|
- configs.remove(endConfig);
|
|
|
//未超过第一档
|
|
|
if (endPayNum <= firstConfig.getEnd()) {
|
|
|
orderDon.setMoney(BigDecimal.valueOf(thisPayNum).multiply(firstConfig.getSingle()));
|
|
|
@@ -449,7 +444,7 @@ public class GoodsWholesalePayServiceImpl implements GoodsWholesalePayService {
|
|
|
GoodsWholesale.GoodsWholesaleConfig finalLevel = first.get();
|
|
|
|
|
|
//之前的
|
|
|
- List<GoodsWholesale.GoodsWholesaleConfig> before = allConfigs.stream().filter(config -> config.getEnd() < finalLevel.getStart() && config.getEnd() > hasPaidNum).collect(Collectors.toList());
|
|
|
+ List<GoodsWholesale.GoodsWholesaleConfig> before = configs.stream().filter(config -> config.getEnd() < finalLevel.getStart() && config.getEnd() > hasPaidNum).collect(Collectors.toList());
|
|
|
BigDecimal finalPayMoney = BigDecimal.ZERO;
|
|
|
Integer finalLevelPayNum = endPayNum;
|
|
|
for (GoodsWholesale.GoodsWholesaleConfig goodsWholesaleConfig : before) {
|