|
|
|
@ -19,6 +19,8 @@ import co.yixiang.modules.user.service.YxSystemUserLevelService;
|
|
|
|
|
import co.yixiang.modules.user.service.YxSystemUserTaskService; |
|
|
|
|
import co.yixiang.modules.user.service.YxUserLevelService; |
|
|
|
|
import co.yixiang.modules.user.service.YxUserService; |
|
|
|
|
import co.yixiang.modules.user.service.mapper.BxgUserMapper; |
|
|
|
|
import co.yixiang.modules.user.service.mapper.SystemUserLevelMapper; |
|
|
|
|
import co.yixiang.modules.user.service.mapper.SystemUserTaskMapper; |
|
|
|
|
import co.yixiang.modules.user.service.mapper.YxUserLevelMapper; |
|
|
|
|
import co.yixiang.utils.OrderUtil; |
|
|
|
@ -44,6 +46,13 @@ public class YxUserLevelServiceImpl extends BaseServiceImpl<YxUserLevelMapper, Y
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
private YxUserLevelMapper yxUserLevelMapper; |
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
private BxgUserMapper bxgUserMapper; |
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
private SystemUserLevelMapper systemUserLevelMapper; |
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
private SystemUserTaskMapper yxSystemUserTaskMapper; |
|
|
|
|
|
|
|
|
@ -71,7 +80,15 @@ public class YxUserLevelServiceImpl extends BaseServiceImpl<YxUserLevelMapper, Y
|
|
|
|
|
if(nextLevelId == 0) { |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//获取下个等级所需成长值
|
|
|
|
|
int growthValue=systemUserLevelMapper.selectById(nextLevelId).getGrowthValue(); |
|
|
|
|
//用户已有成长值
|
|
|
|
|
YxUser yxUser=bxgUserMapper.selectById(uid); |
|
|
|
|
int userGrowth=yxUser.getGrowth(); |
|
|
|
|
if (userGrowth>=growthValue){ |
|
|
|
|
this.setUserLevel(uid,nextLevelId); |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
Long finishCount = systemUserTaskService.getTaskComplete(nextLevelId,uid); |
|
|
|
|
|
|
|
|
|
//目前任务固定,如果增加任务需要自己增加逻辑,目前每个会员任务固定3
|
|
|
|
|