|
|
@@ -190,8 +190,8 @@ public class UserApiController extends BaseApiController {
|
|
|
res.getError().add(buildError(ErrorConstants.MOBILE_SAME_ERROR));
|
|
|
return res;
|
|
|
}
|
|
|
- User u = userService.selectByMobieAndType(mobile, user.getType());
|
|
|
- if (null != u){
|
|
|
+ User u = userService.selectByMobieAndType(mobile, user.getType());
|
|
|
+ if (null != u) {
|
|
|
res.getError().add(buildError(ErrorConstants.DUNPLICATE_KAY_ERROR, "", mobile));
|
|
|
return res;
|
|
|
}
|
|
|
@@ -220,11 +220,16 @@ public class UserApiController extends BaseApiController {
|
|
|
if (res.getError().isEmpty()) {
|
|
|
UserIdentity ui = new UserIdentity();
|
|
|
BeanUtils.copyProperties(userIdentity, ui);
|
|
|
- if (StringUtils.isBlank(ui.getId())) {
|
|
|
+ UserIdentity u = userIdentityService.selectUserIdentityByUserId(TokenManager.getUserId());
|
|
|
+ if (null == u && StringUtils.isBlank(ui.getId())) {
|
|
|
ui.setId(UUID.randomUUID().toString());
|
|
|
ui.setUid(TokenManager.getUserId());
|
|
|
userIdentityService.insert(ui);
|
|
|
} else {
|
|
|
+ if (StringUtils.isBlank(ui.getId())){
|
|
|
+ res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "认证信息ID"));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
userIdentityService.updateByPrimaryKeySelective(ui);
|
|
|
}
|
|
|
}
|
|
|
@@ -291,11 +296,16 @@ public class UserApiController extends BaseApiController {
|
|
|
|
|
|
UserInfo ui = new UserInfo();
|
|
|
BeanUtils.copyProperties(userInfoBo, ui);
|
|
|
- if (StringUtils.isBlank(ui.getId())) {
|
|
|
+ UserInfo info = userInfoService.selectUserInfoByUserId(TokenManager.getUserId());
|
|
|
+ if (null == info && StringUtils.isBlank(ui.getId())) {
|
|
|
ui.setId(UUID.randomUUID().toString());
|
|
|
ui.setUid(TokenManager.getUserId());
|
|
|
userInfoService.insert(ui);
|
|
|
} else {
|
|
|
+ if (StringUtils.isBlank(ui.getId())){
|
|
|
+ res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "个人资料ID"));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
userInfoService.updateByPrimaryKeySelective(ui);
|
|
|
}
|
|
|
}
|
|
|
@@ -320,12 +330,16 @@ public class UserApiController extends BaseApiController {
|
|
|
|
|
|
UserEdu ue = new UserEdu();
|
|
|
BeanUtils.copyProperties(userEdu, ue);
|
|
|
-
|
|
|
- if (StringUtils.isBlank(ue.getId())) {
|
|
|
+ UserEdu u= userEduService.selectUserEduByUserId(TokenManager.getUserId());
|
|
|
+ if (null == u && StringUtils.isBlank(ue.getId())) {
|
|
|
ue.setId(UUID.randomUUID().toString());
|
|
|
ue.setUid(TokenManager.getUserId());
|
|
|
userEduService.insert(ue);
|
|
|
} else {
|
|
|
+ if (StringUtils.isBlank(ue.getId())){
|
|
|
+ res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "教育信息ID"));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
userEduService.updateByPrimaryKeySelective(ue);
|
|
|
}
|
|
|
res.setData(userEdu);
|
|
|
@@ -349,12 +363,16 @@ public class UserApiController extends BaseApiController {
|
|
|
}
|
|
|
UserCareer uc = new UserCareer();
|
|
|
BeanUtils.copyProperties(userCareer, uc);
|
|
|
-
|
|
|
- if (StringUtils.isBlank(uc.getId())) {
|
|
|
+ UserCareer u = userCareerService.selectUserCareerByUserId(TokenManager.getUserId());
|
|
|
+ if (null == u && StringUtils.isBlank(uc.getId())) {
|
|
|
uc.setId(UUID.randomUUID().toString());
|
|
|
uc.setUid(TokenManager.getUserId());
|
|
|
userCareerService.insert(uc);
|
|
|
} else {
|
|
|
+ if (StringUtils.isBlank(uc.getId())){
|
|
|
+ res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "职业信息ID"));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
userCareerService.updateByPrimaryKeySelective(uc);
|
|
|
}
|
|
|
res.setData(userCareer);
|
|
|
@@ -378,11 +396,16 @@ public class UserApiController extends BaseApiController {
|
|
|
}
|
|
|
UserAbility ua = new UserAbility();
|
|
|
BeanUtils.copyProperties(userAbility, ua);
|
|
|
- if (StringUtils.isBlank(ua.getId())) {
|
|
|
+ UserAbility u = userAbilityService.selectUserAbilityByUserId(TokenManager.getUserId());
|
|
|
+ if (null == u && StringUtils.isBlank(ua.getId())) {
|
|
|
ua.setId(UUID.randomUUID().toString());
|
|
|
ua.setUid(TokenManager.getUserId());
|
|
|
userAbilityService.insert(ua);
|
|
|
} else {
|
|
|
+ if (StringUtils.isBlank(ua.getId())){
|
|
|
+ res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "能力标签ID"));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
userAbilityService.updateByPrimaryKeySelective(ua);
|
|
|
}
|
|
|
res.setData(userAbility);
|