Commit af759488 authored by zhangfeng's avatar zhangfeng

bugfix-476: 积分规则唯一性校验修改

parent 423791de
......@@ -134,13 +134,14 @@ public class ScoreRuleServiceImpl extends AbstractService<ScoreRuleMapper, Score
scoreRuleDOLambdaQuery.ne(ScoreRuleDO::getId, delayId);
}
List<ScoreRuleDO> scoreRuleDOS = scoreRuleMapper.selectList(scoreRuleDOLambdaQuery);
if (scoreRuleDOS == null || scoreRuleDOS.isEmpty()) {
return;
}
if (transportType != null) {
if (scoreRuleDOS != null && !scoreRuleDOS.isEmpty()) {
for (ScoreRuleDO scoreRuleDO : scoreRuleDOS) {
ScoreRuleOrderVExtraVO bean = JSONUtil.toBean(scoreRuleDO.getExtra(), ScoreRuleOrderVExtraVO.class);
if (Objects.equals(bean.getTransportType(), transportType) && verifyTimeOverlap(newScoreRuleStart, newScoreRuleEnd, scoreRuleDO)) {
throw exception(SCORE_RULE_UNIQUE_CHECK_ERROR);
}
for (ScoreRuleDO scoreRuleDO : scoreRuleDOS) {
ScoreRuleOrderVExtraVO bean = JSONUtil.toBean(scoreRuleDO.getExtra(), ScoreRuleOrderVExtraVO.class);
if (Objects.equals(bean.getTransportType(), transportType) && verifyTimeOverlap(newScoreRuleStart, newScoreRuleEnd, scoreRuleDO)) {
throw exception(SCORE_RULE_UNIQUE_CHECK_ERROR);
}
}
} else {
......
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