|
@@ -29,7 +29,9 @@ import com.zhongzheng.modules.distribution.service.IDistributionActivityService;
|
|
|
import com.zhongzheng.modules.distribution.service.IDistributionSellerService;
|
|
import com.zhongzheng.modules.distribution.service.IDistributionSellerService;
|
|
|
import com.zhongzheng.modules.distribution.vo.DistributionSellerVo;
|
|
import com.zhongzheng.modules.distribution.vo.DistributionSellerVo;
|
|
|
import com.zhongzheng.modules.distribution.vo.SellerOrderVo;
|
|
import com.zhongzheng.modules.distribution.vo.SellerOrderVo;
|
|
|
|
|
+import com.zhongzheng.modules.system.domain.SysTenant;
|
|
|
import com.zhongzheng.modules.system.service.ISysRoleService;
|
|
import com.zhongzheng.modules.system.service.ISysRoleService;
|
|
|
|
|
+import com.zhongzheng.modules.system.service.ISysTenantService;
|
|
|
import com.zhongzheng.modules.system.service.ISysUserService;
|
|
import com.zhongzheng.modules.system.service.ISysUserService;
|
|
|
import com.zhongzheng.modules.top.distribution.bo.DistributionSellerQuery;
|
|
import com.zhongzheng.modules.top.distribution.bo.DistributionSellerQuery;
|
|
|
import com.zhongzheng.modules.user.domain.User;
|
|
import com.zhongzheng.modules.user.domain.User;
|
|
@@ -73,6 +75,9 @@ public class DistributionSellerServiceImpl extends ServiceImpl<DistributionSelle
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private IDistributionActivityService iDistributionActivityService;
|
|
private IDistributionActivityService iDistributionActivityService;
|
|
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private ISysTenantService iSysTenantService;
|
|
|
|
|
+
|
|
|
@Override
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public Boolean registerSeller(SellerAppRegisterBo bo) {
|
|
public Boolean registerSeller(SellerAppRegisterBo bo) {
|
|
@@ -99,16 +104,16 @@ public class DistributionSellerServiceImpl extends ServiceImpl<DistributionSelle
|
|
|
if(!code.equals(bo.getCode())){
|
|
if(!code.equals(bo.getCode())){
|
|
|
throw new CustomException("验证码错误");
|
|
throw new CustomException("验证码错误");
|
|
|
}
|
|
}
|
|
|
- SysUser seller = iSysUserService.getOne(new LambdaQueryWrapper<SysUser>()
|
|
|
|
|
- .eq(SysUser::getPhonenumber, bo.getTel()).last("limit 1"));
|
|
|
|
|
|
|
+ SysUser seller = iSysUserService.getOneByTenant(bo.getTel());
|
|
|
if(Validator.isNotNull(seller)){
|
|
if(Validator.isNotNull(seller)){
|
|
|
- throw new CustomException("该手机号已注册");
|
|
|
|
|
|
|
+ SysTenant tenant = iSysTenantService.getById(seller.getTenantId());
|
|
|
|
|
+ throw new CustomException(String.format("该手机号已在【%s】注册过!",tenant.getTenantName()));
|
|
|
}
|
|
}
|
|
|
- SysUser sellerIdCard = iSysUserService.getOne(new LambdaQueryWrapper<SysUser>()
|
|
|
|
|
- .eq(SysUser::getIdCard,EncryptHandler.encrypt(bo.getIdcard())).last("limit 1"));
|
|
|
|
|
|
|
+ SysUser sellerIdCard = iSysUserService.getOneIdCardByTenant(EncryptHandler.encrypt(bo.getIdcard()));
|
|
|
if(Validator.isNotNull(sellerIdCard)){
|
|
if(Validator.isNotNull(sellerIdCard)){
|
|
|
if(Validator.isNotEmpty(sellerIdCard.getSellerId())){
|
|
if(Validator.isNotEmpty(sellerIdCard.getSellerId())){
|
|
|
- throw new CustomException("该身份证已注册业务员");
|
|
|
|
|
|
|
+ SysTenant tenant = iSysTenantService.getById(seller.getTenantId());
|
|
|
|
|
+ throw new CustomException(String.format("该身份证已在【%s】已注册业务员!",tenant.getTenantName()));
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
DistributionSeller inertData = new DistributionSeller();
|
|
DistributionSeller inertData = new DistributionSeller();
|