Commit 71146064 authored by zhangfeng's avatar zhangfeng

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

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