|
|
@@ -78,12 +78,30 @@ public class CorpsAttnServiceImpl extends ServiceImpl<CorpsAttnMapper, CorpsAttn
|
|
|
user.setPostId(corpsAttn.getPostId());
|
|
|
|
|
|
if (ObjectUtil.isNotEmpty(attn.getUserId())) {
|
|
|
- user.setId(attn.getUserId());
|
|
|
- R<Boolean> result = userClient.updateUser(user);
|
|
|
|
|
|
- if (!result.isSuccess()) {
|
|
|
- throw new ServiceException(result.getMsg());
|
|
|
+ R<User> userR = userClient.userInfoById(attn.getUserId());
|
|
|
+ if (ObjectUtil.isNotEmpty(userR.getData())){
|
|
|
+ user.setId(attn.getUserId());
|
|
|
+ R<Boolean> result = userClient.updateUser(user);
|
|
|
+
|
|
|
+ if (!result.isSuccess()) {
|
|
|
+ throw new ServiceException(result.getMsg());
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ user.setPassword(LandConstant.USER_PASSWORD);
|
|
|
+ R<Boolean> result = userClient.saveUser(user);
|
|
|
+ if (!result.isSuccess()) {
|
|
|
+ throw new ServiceException(result.getMsg());
|
|
|
+ }
|
|
|
+
|
|
|
+ R<User> userTemp = userClient.userByAccount(AuthUtil.getTenantId(), attn.getTel());
|
|
|
+ if (!userTemp.isSuccess()) {
|
|
|
+ throw new ServiceException(userTemp.getMsg());
|
|
|
+ }
|
|
|
+ attn.setUserId(userTemp.getData().getId());
|
|
|
+ baseMapper.updateById(attn);
|
|
|
}
|
|
|
+
|
|
|
} else {
|
|
|
user.setPassword(LandConstant.USER_PASSWORD);
|
|
|
R<Boolean> result = userClient.saveUser(user);
|