Commit e2409a8b authored by wujipeng's avatar wujipeng
Browse files

新增用户优化

parent 8d02e7ff
......@@ -197,6 +197,7 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, UserEntity> impleme
@Override
@Transactional
public Boolean add(UserDTO userDTO) {
try {
//解析身份证号
Map<String, String> idCardInfo = IdCardUtils.parseIdCardInfo(userDTO.getIdCard());
if (MapUtil.isNotEmpty(idCardInfo)) {
......@@ -208,6 +209,9 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, UserEntity> impleme
userDTO.setUserName(userDTO.getUserName() + userDTO.getIdCard());
userDTO.setType("1");
return save(userDTO);
} catch (Exception e) {
throw new BusinessException("用户" + userDTO.getUserName() + "已经存在");
}
}
@Override
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment