|
|
@ -8,12 +8,16 @@ import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
|
|
|
|
import cn.iocoder.yudao.framework.common.enums.UserTypeEnum;
|
|
|
|
import cn.iocoder.yudao.framework.common.enums.UserTypeEnum;
|
|
|
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
|
|
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
|
|
|
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
|
|
|
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
|
|
|
|
|
|
|
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
|
|
|
import cn.iocoder.yudao.module.member.controller.admin.user.vo.MemberUserPageReqVO;
|
|
|
|
import cn.iocoder.yudao.module.member.controller.admin.user.vo.MemberUserPageReqVO;
|
|
|
|
import cn.iocoder.yudao.module.member.controller.admin.user.vo.MemberUserUpdateReqVO;
|
|
|
|
import cn.iocoder.yudao.module.member.controller.admin.user.vo.MemberUserUpdateReqVO;
|
|
|
|
import cn.iocoder.yudao.module.member.controller.app.user.vo.*;
|
|
|
|
import cn.iocoder.yudao.module.member.controller.app.user.vo.*;
|
|
|
|
import cn.iocoder.yudao.module.member.convert.auth.AuthConvert;
|
|
|
|
import cn.iocoder.yudao.module.member.convert.auth.AuthConvert;
|
|
|
|
import cn.iocoder.yudao.module.member.convert.user.MemberUserConvert;
|
|
|
|
import cn.iocoder.yudao.module.member.convert.user.MemberUserConvert;
|
|
|
|
|
|
|
|
import cn.iocoder.yudao.module.member.dal.dataobject.level.MemberLevelDO;
|
|
|
|
import cn.iocoder.yudao.module.member.dal.dataobject.user.MemberUserDO;
|
|
|
|
import cn.iocoder.yudao.module.member.dal.dataobject.user.MemberUserDO;
|
|
|
|
|
|
|
|
import cn.iocoder.yudao.module.member.dal.mysql.level.MemberLevelMapper;
|
|
|
|
|
|
|
|
import cn.iocoder.yudao.module.member.dal.mysql.level.MemberLevelRecordMapper;
|
|
|
|
import cn.iocoder.yudao.module.member.dal.mysql.user.MemberUserMapper;
|
|
|
|
import cn.iocoder.yudao.module.member.dal.mysql.user.MemberUserMapper;
|
|
|
|
import cn.iocoder.yudao.module.member.mq.producer.user.MemberUserProducer;
|
|
|
|
import cn.iocoder.yudao.module.member.mq.producer.user.MemberUserProducer;
|
|
|
|
import cn.iocoder.yudao.module.system.api.sms.SmsCodeApi;
|
|
|
|
import cn.iocoder.yudao.module.system.api.sms.SmsCodeApi;
|
|
|
@ -64,6 +68,12 @@ public class MemberUserServiceImpl implements MemberUserService {
|
|
|
|
@Resource
|
|
|
|
@Resource
|
|
|
|
private MemberUserProducer memberUserProducer;
|
|
|
|
private MemberUserProducer memberUserProducer;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
|
|
|
private MemberLevelRecordMapper levelLogMapper;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
|
|
|
private MemberLevelMapper memberLevelMapper;
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public MemberUserDO getUserByMobile(String mobile) {
|
|
|
|
public MemberUserDO getUserByMobile(String mobile) {
|
|
|
|
return memberUserMapper.selectByMobile(mobile);
|
|
|
|
return memberUserMapper.selectByMobile(mobile);
|
|
|
@ -314,4 +324,43 @@ public class MemberUserServiceImpl implements MemberUserService {
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public boolean updateUserLevelId(Long userId) {
|
|
|
|
|
|
|
|
//查询帮扶人等级id
|
|
|
|
|
|
|
|
MemberLevelDO memberLevelDO = memberLevelMapper.selectOne(new LambdaQueryWrapperX<MemberLevelDO>()
|
|
|
|
|
|
|
|
.eq(MemberLevelDO::getStatus, 0)
|
|
|
|
|
|
|
|
.eq(MemberLevelDO::getDeleted, 0)
|
|
|
|
|
|
|
|
.eq(MemberLevelDO::getLevel, 1)
|
|
|
|
|
|
|
|
.orderByAsc(MemberLevelDO::getLevel));
|
|
|
|
|
|
|
|
int i = memberUserMapper.updateById(new MemberUserDO()
|
|
|
|
|
|
|
|
.setId(userId)
|
|
|
|
|
|
|
|
.setLevelId(memberLevelDO.getId())
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
if(i>0){
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public boolean updateUserUpgradesLevel(Long userId) {
|
|
|
|
|
|
|
|
//查询帮扶人等级id
|
|
|
|
|
|
|
|
List<MemberLevelDO> levelList = memberLevelMapper.selectList(new LambdaQueryWrapperX<MemberLevelDO>()
|
|
|
|
|
|
|
|
.eq(MemberLevelDO::getStatus, 0)
|
|
|
|
|
|
|
|
.eq(MemberLevelDO::getDeleted, 0)
|
|
|
|
|
|
|
|
.orderByAsc(MemberLevelDO::getLevel));
|
|
|
|
|
|
|
|
//循环处理帮扶人等级
|
|
|
|
|
|
|
|
for (MemberLevelDO vo:levelList) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
//先会员本身升级为帮扶员
|
|
|
|
|
|
|
|
// if(i>0){
|
|
|
|
|
|
|
|
// return true;
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void recursionMemberLevel(List<MemberLevelDO> levelList,Long userId){
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|