...
|
...
|
@@ -70,8 +70,18 @@ public class PromotionPriceService { |
|
|
promotionIndexBOS.add(promotionIndexBO);
|
|
|
}
|
|
|
//生成安装权重排序后的促销列表
|
|
|
List<PromotionIndexBO> SortedPromotionIndexBOs;
|
|
|
SortedPromotionIndexBOs = promotionIndexBOS.stream().sorted(Comparator.comparing(PromotionIndexBO::getPriority).reversed()).collect(Collectors.toList());
|
|
|
List<PromotionIndexBO> tempPromotionIndexBos = promotionIndexBOS.stream().sorted(Comparator.comparing(PromotionIndexBO::getPriority).reversed()).collect(Collectors.toList());
|
|
|
List<PromotionIndexBO> SortedPromotionIndexBOs = new ArrayList<>();
|
|
|
//去掉不满足的促销
|
|
|
for (PromotionIndexBO promotionIndexBO : tempPromotionIndexBos) {
|
|
|
//判断是否满足金额和件数条件
|
|
|
String conditionParam = promotionActionParamMap.get(promotionIndexBO.getId()).getConditionParam();
|
|
|
PromotionCond promotionCond = promotionCondService.buildPromotionCondWithJsonString(conditionParam);
|
|
|
boolean result = promotionMatchService.matchProductForPromotionPrice(promotionCond, productMap);
|
|
|
if (result) {
|
|
|
SortedPromotionIndexBOs.add(promotionIndexBO);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
//生成按照权重排序后的促销标签列表
|
|
|
List<Integer> promotionIdList = SortedPromotionIndexBOs.stream().map(PromotionIndexBO::getId).collect(Collectors.toList());
|
...
|
...
|
@@ -99,14 +109,6 @@ public class PromotionPriceService { |
|
|
continue;
|
|
|
}
|
|
|
|
|
|
//判断是否满足金额和件数条件
|
|
|
String conditionParam = promotionActionParamMap.get(promotionId).getConditionParam();
|
|
|
PromotionCond promotionCond = promotionCondService.buildPromotionCondWithJsonString(conditionParam);
|
|
|
boolean result = promotionMatchService.matchProductForPromotionPrice(promotionCond, productMap);
|
|
|
if (!result) {
|
|
|
continue;
|
|
|
}
|
|
|
|
|
|
//满足条件才可以继续算价格
|
|
|
String actionParam = promotionActionParamMap.get(promotionId).getActionParam();
|
|
|
JSONObject actionParamJson = JSONObject.parseObject(actionParam);
|
...
|
...
|
|