|
|
@@ -65,7 +65,7 @@ public class UserRegisterController extends BaseController {
|
|
|
UserFields.getFieldDesc(bindingResult.getFieldError().getField())));
|
|
|
return res;
|
|
|
}
|
|
|
- User u = userService.selectByNameAndType(user.getUsername().trim(), null);
|
|
|
+ User u = userService.selectByMobieAndType(user.getMobile().trim(),user.getType());
|
|
|
if (null != u) {
|
|
|
res.getError().add(buildError(ErrorConstants.USER_ALREADY_EXIST, "用户已存在"));
|
|
|
}
|
|
|
@@ -81,7 +81,6 @@ public class UserRegisterController extends BaseController {
|
|
|
if (res.getError().isEmpty()) {
|
|
|
User us = new User();
|
|
|
us.setId(UUID.randomUUID().toString());
|
|
|
- us.setUsername(user.getUsername().trim());
|
|
|
us.setMobile(user.getMobile().trim());
|
|
|
us.setPassword(user.getPassword());
|
|
|
Calendar now = Calendar.getInstance();
|
|
|
@@ -89,8 +88,7 @@ public class UserRegisterController extends BaseController {
|
|
|
us.setCreateTime(now.getTime());
|
|
|
us.setUpdateTime(now.getTime());
|
|
|
us.setPassword(passwordUtil.getEncryptPwd(us));
|
|
|
- us.setLvl(0);
|
|
|
- us.setNickname(user.getUsername());
|
|
|
+ us.setNickname(user.getUnitName());
|
|
|
us.setSource(AFTConstants.USER_SOURCE_REGISTER);
|
|
|
us.setStatus(AFTConstants.USER_STATUS_NORMAL);
|
|
|
us.setShareType(AFTConstants.USER_SHARE_PUBLIC);
|
|
|
@@ -119,7 +117,7 @@ public class UserRegisterController extends BaseController {
|
|
|
UserFields.getFieldDesc(bindingResult.getFieldError().getField())));
|
|
|
return res;
|
|
|
}
|
|
|
- User u = userService.selectByNameAndType(user.getUsername().trim(), null);
|
|
|
+ User u = userService.selectByMobieAndType(user.getMobile().trim(),user.getType());
|
|
|
if (null != u) {
|
|
|
res.getError().add(buildError(ErrorConstants.USER_ALREADY_EXIST, "用户已存在"));
|
|
|
}
|
|
|
@@ -143,8 +141,7 @@ public class UserRegisterController extends BaseController {
|
|
|
us.setCreateTime(now.getTime());
|
|
|
us.setUpdateTime(now.getTime());
|
|
|
us.setPassword(passwordUtil.getEncryptPwd(us));
|
|
|
- us.setLvl(0);
|
|
|
- us.setNickname(user.getUsername());
|
|
|
+ us.setNickname(user.getUnitName());
|
|
|
us.setSource(AFTConstants.USER_SOURCE_REGISTER);
|
|
|
us.setStatus(AFTConstants.USER_STATUS_NORMAL);
|
|
|
us.setShareType(AFTConstants.USER_SHARE_PUBLIC);
|