Commit c68bee85 authored by alex yao's avatar alex yao

feat: 轮次扣分

parent e2abb4dc
...@@ -32,7 +32,7 @@ public class PointDeductionRulesServiceImpl implements PointDeductionRulesServic ...@@ -32,7 +32,7 @@ public class PointDeductionRulesServiceImpl implements PointDeductionRulesServic
bizPointDeductionRulesEntity.setIsDeleted(CommonConstant.IsDeleted.N); bizPointDeductionRulesEntity.setIsDeleted(CommonConstant.IsDeleted.N);
List<BizPointDeductionRulesEntity> entities = bizPointDeductionRulesService.findByExample(bizPointDeductionRulesEntity, null); List<BizPointDeductionRulesEntity> entities = bizPointDeductionRulesService.findByExample(bizPointDeductionRulesEntity, null);
Map<String, List<BizPointDeductionRulesEntity>> map = entities.stream().collect(Collectors.groupingBy(BizPointDeductionRulesEntity::getRuleType, Collectors.toList())); Map<String, List<BizPointDeductionRulesEntity>> map = entities.stream().collect(Collectors.groupingBy(BizPointDeductionRulesEntity::getRuleType, Collectors.toList()));
// 模型扣分
if (StringUtils.isNotBlank(modelName) && map.containsKey(RuleType.MODEL.getRuleType())) { if (StringUtils.isNotBlank(modelName) && map.containsKey(RuleType.MODEL.getRuleType())) {
List<BizPointDeductionRulesEntity> modelDeductionRules = map.get(RuleType.MODEL.getRuleType()); List<BizPointDeductionRulesEntity> modelDeductionRules = map.get(RuleType.MODEL.getRuleType());
for (BizPointDeductionRulesEntity modelDeductionRule : modelDeductionRules) { for (BizPointDeductionRulesEntity modelDeductionRule : modelDeductionRules) {
...@@ -42,15 +42,17 @@ public class PointDeductionRulesServiceImpl implements PointDeductionRulesServic ...@@ -42,15 +42,17 @@ public class PointDeductionRulesServiceImpl implements PointDeductionRulesServic
} }
} }
} }
//轮次 1-5-10-15 1轮和5轮扣模型原始的积分 10轮 原始积分*2 15轮 原始积分*3
if (communicationTurn != null && map.containsKey(RuleType.COMMUNICATION_TURN.getRuleType())) { if (communicationTurn != null && map.containsKey(RuleType.COMMUNICATION_TURN.getRuleType())) {
List<BizPointDeductionRulesEntity> communicationTurnRules = map.get(RuleType.COMMUNICATION_TURN.getRuleType()); List<BizPointDeductionRulesEntity> communicationTurnRules = map.get(RuleType.COMMUNICATION_TURN.getRuleType());
for (BizPointDeductionRulesEntity communicationTurnRule : communicationTurnRules) { for (BizPointDeductionRulesEntity communicationTurnRule : communicationTurnRules) {
if (communicationTurnRule.getRelationId().equals(String.valueOf(communicationTurn))) { if (communicationTurnRule.getRelationId().equals(String.valueOf(communicationTurn))) {
pointDeductionNum = pointDeductionNum + communicationTurnRule.getNumber(); pointDeductionNum = pointDeductionNum * communicationTurnRule.getNumber() + pointDeductionNum;
break; break;
} }
} }
} }
// 插件扣分
if (CollectionUtils.isNotEmpty(tools) && map.containsKey(RuleType.PLUGIN.getRuleType())) { if (CollectionUtils.isNotEmpty(tools) && map.containsKey(RuleType.PLUGIN.getRuleType())) {
List<BizPointDeductionRulesEntity> pluginRules = map.get(RuleType.PLUGIN.getRuleType()); List<BizPointDeductionRulesEntity> pluginRules = map.get(RuleType.PLUGIN.getRuleType());
for (Tool tool : tools) { for (Tool tool : tools) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment