Commit 17de5acd authored by Smile's avatar Smile Committed by wux

会员定时任务修改

parent b8b3d77f
......@@ -113,7 +113,7 @@ public class userLevelDetailsTask implements JobHandler {
if (addScore>reduceScore){
int score = addScore - reduceScore;
log.info("符合规则积分数量: {}", score);
if (score>userLevelConfigDO.getLowerCount()){
if (score>=userLevelConfigDO.getLowerCount()){
//进入积分规则设置方法
//大于最低分,符合规则,查看是否有规则详情
Boolean b = setConfigDetails(memberId, userLevelConfigDO);
......@@ -254,6 +254,64 @@ public class userLevelDetailsTask implements JobHandler {
return true;
}
}
}else {
//设置了不降级,只能升级
if (memberUserLevelDetailsBackVO.getLevel()<memberUserLevelConfigDO.getLevel()){
//升级流程
//设置用户为admin
MemberUserLevelDetailsDO memberUserLevelDetailsDO=new MemberUserLevelDetailsDO();
memberUserLevelDetailsDO.setId(memberUserLevelDetailsBackVO.getId());
memberUserLevelDetailsDO.setMemberId(memberUserLevelDetailsBackVO.getMemberId());
memberUserLevelDetailsDO.setLevel(memberUserLevelConfigDO.getLevel());
memberUserLevelDetailsDO.setSpecificSettings(memberUserLevelDetailsBackVO.getSpecificSettings());
memberUserLevelDetailsDO.setValidityPeriod(memberUserLevelConfigDO.getValidityPeriod());
memberUserLevelDetailsDO.setRemarks(memberUserLevelConfigDO.getDescription());
memberUserLevelDetailsDO.setConfigId(memberUserLevelConfigDO.getId());
memberUserLevelDetailsDO.setUpdater(String.valueOf(user.getId()));
memberUserLevelDetailsService.updateById(memberUserLevelDetailsDO);
//插入一条日志 升级日志
MemberUserLevelOperateLogDO memberUserLevelOperateLogDo = MemberUserLevelOperateLogDO.builder()
.configId(memberUserLevelDetailsDO.getConfigId())
.configName(memberUserLevelConfigDO.getName())
.memberId(memberUserLevelDetailsDO.getMemberId())
.operator(user.getNickname())
.remarks(memberUserLevelDetailsDO.getRemarks())
.level(memberUserLevelConfigDO.getLevel())
.operateType(1)
.build();
memberUserLevelOperateService.save(memberUserLevelOperateLogDo);
log.info("客户等级小于当前等级,等级详情进入升级操作,规则id:{},用户id:{}",memberUserLevelConfigDO.getRuleNumber(),memberId);
return true;
}else if(memberUserLevelDetailsBackVO.getLevel()==memberUserLevelConfigDO.getLevel()&&!memberUserLevelDetailsBackVO.getRuleNumber().equals(memberUserLevelConfigDO.getRuleNumber())){
//级别相同比较sort顺序
MemberUserLevelConfigDO memberUserLevelConfigOldDo = memberUserLevelConfigService.getById(memberUserLevelDetailsBackVO.getConfigId());
if (memberUserLevelConfigOldDo.getSort()<memberUserLevelConfigDO.getSort()){
//降级流程
//设置用户为admin
MemberUserLevelDetailsDO memberUserLevelDetailsDO=new MemberUserLevelDetailsDO();
memberUserLevelDetailsDO.setId(memberUserLevelDetailsBackVO.getId());
memberUserLevelDetailsDO.setMemberId(memberUserLevelDetailsBackVO.getMemberId());
memberUserLevelDetailsDO.setLevel(memberUserLevelConfigDO.getLevel());
memberUserLevelDetailsDO.setSpecificSettings(memberUserLevelDetailsBackVO.getSpecificSettings());
memberUserLevelDetailsDO.setValidityPeriod(memberUserLevelConfigDO.getValidityPeriod());
memberUserLevelDetailsDO.setRemarks(memberUserLevelConfigDO.getDescription());
memberUserLevelDetailsDO.setConfigId(memberUserLevelConfigDO.getId());
memberUserLevelDetailsDO.setUpdater(String.valueOf(user.getId()));
memberUserLevelDetailsService.updateById(memberUserLevelDetailsDO);
//插入一条日志 升级日志
MemberUserLevelOperateLogDO memberUserLevelOperateLogDo = MemberUserLevelOperateLogDO.builder()
.configId(memberUserLevelDetailsDO.getConfigId())
.configName(memberUserLevelConfigDO.getName())
.memberId(memberUserLevelDetailsDO.getMemberId())
.operator(user.getNickname())
.remarks(memberUserLevelDetailsDO.getRemarks())
.level(memberUserLevelConfigDO.getLevel())
.operateType(2)
.build();
memberUserLevelOperateService.save(memberUserLevelOperateLogDo);
}
}
}
}
return false;
......
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