Commit 7f8837a4 authored by zhangfeng's avatar zhangfeng

积分规则校验

parent e688a1d4
......@@ -80,7 +80,7 @@ public class ScoreRuleServiceImpl extends AbstractService<ScoreRuleMapper, Score
if (scoreRuleIn.getType() != ScoreRuleTypeEnum.ORDER_V.getValue() && scoreRuleIn.getGetScoreOnce() <= 0) {
throw exception(SCORE_RULE_FIELD_ERROR, LocaleContextHolder.getLocale().equals(Locale.SIMPLIFIED_CHINESE) ? "单次获得积分必须大于0" : "getScoreOnce must > 0");
}
if (scoreRuleIn.getType() != ScoreRuleTypeEnum.RECOMMEND.getValue() && scoreRuleIn.getMaxScoreTotal() <= 0) {
if (scoreRuleIn.getType() != ScoreRuleTypeEnum.REGISTER.getValue() && scoreRuleIn.getMaxScoreTotal() <= 0) {
throw exception(SCORE_RULE_FIELD_ERROR, LocaleContextHolder.getLocale().equals(Locale.SIMPLIFIED_CHINESE) ? "累积最高积分必须大于0" : "maxScoreTotal must > 0");
}
if (scoreRuleIn.getStartTime().after((scoreRuleIn.getEndTime())) || scoreRuleIn.getEndTime().before(Date.from(Instant.now()))) {
......
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