1;新增用户 账户 手机号唯一验证 提示
This commit is contained in:
parent
3b7a0c2f5b
commit
fc5e0af648
|
@ -8,7 +8,9 @@ import com.ruoyi.business.service.IBusIntegralRecordService;
|
|||
import com.ruoyi.common.core.domain.entity.SysDept;
|
||||
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||
import com.ruoyi.common.core.domain.model.LoginUser;
|
||||
import com.ruoyi.common.exception.ServiceException;
|
||||
import com.ruoyi.common.utils.SecurityUtils;
|
||||
import com.ruoyi.system.mapper.SysUserMapper;
|
||||
import com.ruoyi.system.service.ISysDeptService;
|
||||
import com.ruoyi.system.service.ISysUserService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
@ -36,6 +38,8 @@ public class BusAgentInfoServiceImpl implements IBusAgentInfoService
|
|||
@Autowired
|
||||
private ISysUserService userService;
|
||||
@Autowired
|
||||
private SysUserMapper sysUserMapper;
|
||||
@Autowired
|
||||
private ISysDeptService deptService;
|
||||
|
||||
/**
|
||||
|
@ -119,6 +123,14 @@ public class BusAgentInfoServiceImpl implements IBusAgentInfoService
|
|||
@Transactional
|
||||
public int insertAgentInfo(LoginUser loginUser, BusAgentInfo busAgentInfo) {
|
||||
SysUser user = new SysUser();
|
||||
BusAgentInfo agentInfo = busAgentInfoMapper.getAgentByAccount(busAgentInfo.getAgentAccount());
|
||||
if(agentInfo != null){
|
||||
throw new ServiceException("账户名已存在!");
|
||||
}
|
||||
SysUser info = sysUserMapper.checkPhoneUnique(busAgentInfo.getPhoneNumber());
|
||||
if(info != null){
|
||||
throw new ServiceException("手机号已存在!");
|
||||
}
|
||||
user.setUserName(busAgentInfo.getAgentAccount());
|
||||
user.setNickName(busAgentInfo.getAgentName());
|
||||
String pwd = SecurityUtils.encryptPassword(busAgentInfo.getPassword());
|
||||
|
|
Loading…
Reference in New Issue