后台报错

pull/2/head^2
perry 2023-05-26 13:45:46 +08:00
parent b59f558cb6
commit e14b6608ef
1 changed files with 3 additions and 2 deletions

View File

@ -5,6 +5,7 @@ import cn.hutool.core.util.StrUtil;
import cn.iocoder.yudao.framework.common.exception.ServiceException; import cn.iocoder.yudao.framework.common.exception.ServiceException;
import cn.iocoder.yudao.framework.common.util.validation.ValidationUtils; import cn.iocoder.yudao.framework.common.util.validation.ValidationUtils;
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils; import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
import cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder;
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.enums.ErrorCodeConstants; import cn.iocoder.yudao.module.member.enums.ErrorCodeConstants;
import cn.iocoder.yudao.module.member.service.user.MemberUserService; import cn.iocoder.yudao.module.member.service.user.MemberUserService;
@ -71,11 +72,11 @@ public class PromoterServiceImpl implements PromoterService {
memberUserDO.setMobile(createReqVO.getMobile()); memberUserDO.setMobile(createReqVO.getMobile());
memberUserDO.setStatus(createReqVO.getStatus()); memberUserDO.setStatus(createReqVO.getStatus());
memberUserDO.setPassword(createReqVO.getMobile().substring(createReqVO.getMobile().length() - 6)); memberUserDO.setPassword(createReqVO.getMobile().substring(createReqVO.getMobile().length() - 6));
memberUserService.createUserIfAbsent(createReqVO.getMobile(), createReqVO.getNickname(), getClientIP()); memberUserDO = memberUserService.createUserIfAbsent(createReqVO.getMobile(), createReqVO.getNickname(), getClientIP());
} }
// 插入 // 插入
PromoterDO promoter = PromoterConvert.INSTANCE.convert(createReqVO); PromoterDO promoter = PromoterConvert.INSTANCE.convert(createReqVO);
promoter.setTenantId(SecurityFrameworkUtils.getLoginUser().getTenantId()); promoter.setTenantId(TenantContextHolder.getTenantId());
Long count = promoterMapper.selectCount(Wrappers.lambdaQuery(PromoterDO.class).eq(PromoterDO::getUserId, memberUserDO.getId())); Long count = promoterMapper.selectCount(Wrappers.lambdaQuery(PromoterDO.class).eq(PromoterDO::getUserId, memberUserDO.getId()));
if (count > 0) { if (count > 0) {
throw new ServiceException(PROMOTER_EXISTS); throw new ServiceException(PROMOTER_EXISTS);