Commit ce148126 authored by Smile's avatar Smile Committed by wux

会员等级配置,同等级相同顺序报错

parent 7a24c14e
......@@ -73,4 +73,5 @@ public interface ErrorCodeConstants {
ErrorCode SCORE_RULE_CUSTOMERSIDE_ERROR = new ErrorCode(1004008028, "score.rule.customer.side.error");
ErrorCode LEVEL_RULE_NOT_EXISTS = new ErrorCode(1004008028, "level.rule.not.exists");
ErrorCode LEVEL_DETAILs_NOT_EXISTS = new ErrorCode(1004008028, "level.details.not.exists");
ErrorCode LEVEL_Order_REPEAT = new ErrorCode(1004008029, "level.order.repeat");
}
......@@ -23,6 +23,7 @@ import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;
import javax.annotation.Resource;
import java.util.Collections;
import java.util.Comparator;
import java.util.Date;
import java.util.List;
......@@ -128,6 +129,19 @@ public class MemberUserLevelConfigServiceImpl extends AbstractService<MemberUser
if (query.getLowerCount() > query.getUpperCount()) {
throw exception(LEVEL_BOUND_RANGE_ERROR);
}
MemberUserLevelConfigReqVO memberUserLevelConfigReqVO = new MemberUserLevelConfigReqVO();
memberUserLevelConfigReqVO.setLevel(Collections.singletonList(query.getLevel()));
memberUserLevelConfigReqVO.setPageNo(1);
memberUserLevelConfigReqVO.setPageSize(1000);
PageResult<MemberUserLevelConfigBaseRespVO> levelPage = this.getLevelPage(memberUserLevelConfigReqVO);
if (levelPage.getTotal() > 0){
List<MemberUserLevelConfigBaseRespVO> list = levelPage.getList();
list.forEach(i -> {
if (i.getSort().equals(query.getSort())){
throw exception(LEVEL_Order_REPEAT);
}
});
}
}
@Override
......
......@@ -1061,6 +1061,7 @@ level.bound.range.error = upper count must greater than lower count
level.bound.range.conflict = score range exist conflict'
level.rule.not.exists = Membership level rule does not exist
level.details.not.exists = Membership level details do not exist
level.order.repeat = Membership level configuration order repeats
score.operate.idempotent.error = idempotent key conflict
score.rule.not.exists = score rule not exists
......
......@@ -1059,6 +1059,7 @@ level.bound.range.error=La valeur sup\u00E9rieure doit \u00EAtre sup\u00E9rieure
level.bound.range.conflict=Conflit dans la plage des points de fid\u00E9lit\u00E9
level.rule.not.exists = La r\u00E8gle du niveau de membre n'existe pas
level.details.not.exists = Les d\u00E9tails du niveau de membre n'existent pas
level.order.repeat = L'ordre de configuration du niveau d'adh\u00E9sion se r\u00E9p\u00E8te
score.operate.idempotent.error=Conflit de cl\u00E9 idempotente
score.rule.not.exists=La r\u00E8gle de points n'existe pas
......
......@@ -1061,6 +1061,7 @@ level.bound.range.error = \u4E0A\u754C\u6570\u503C\u5FC5\u987B\u5927\u4E8E\u4E0B
level.bound.range.conflict = \u79EF\u5206\u8303\u56F4\u5B58\u5728\u51B2\u7A81
level.rule.not.exists = \u4F1A\u5458\u7B49\u7EA7\u89C4\u5219\u4E0D\u5B58\u5728
level.details.not.exists = \u4F1A\u5458\u7B49\u7EA7\u8BE6\u60C5\u4E0D\u5B58\u5728
level.order.repeat = \u4F1A\u5458\u7B49\u7EA7\u89C4\u5219\u91CD\u590D
score.operate.idempotent.error = \u5E42\u7B49key\u51B2\u7A81
score.rule.not.exists = \u79EF\u5206\u89C4\u5219\u4E0D\u5B58\u5728
......
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