|
|
|
@ -766,6 +766,7 @@ public class AppUserServiceImpl implements AppUserService { |
|
|
|
public Result<EpdcAppAuthorizationDTO> completeUserInfo(TokenDto tokenDto, EpdcCompleteUserInfoFormDTO infoDto) { |
|
|
|
|
|
|
|
UserDTO userDto = ConvertUtils.sourceToTarget(infoDto, UserDTO.class); |
|
|
|
userDto.setDeptId(Long.valueOf(infoDto.getGridId())); |
|
|
|
userDto.setId(tokenDto.getUserId()); |
|
|
|
|
|
|
|
if (StringUtils.isNotBlank(infoDto.getWxCode())) { |
|
|
|
@ -798,7 +799,7 @@ public class AppUserServiceImpl implements AppUserService { |
|
|
|
} |
|
|
|
String userState = verifyResult.getData(); |
|
|
|
|
|
|
|
UserGridRelationDTO userGrid = this.packageUserGridRelationInfo(tokenDto.getGridId()); |
|
|
|
UserGridRelationDTO userGrid = this.packageUserGridRelationInfo(infoDto.getGridId()); |
|
|
|
EpdcCompleteAppUserDTO completeAppUserDto = ConvertUtils.sourceToTarget(userDto, EpdcCompleteAppUserDTO.class); |
|
|
|
completeAppUserDto = this.packageUserCompleteInfo(completeAppUserDto, userState); |
|
|
|
// 组装对象,准备保存用户信息
|
|
|
|
@ -839,6 +840,24 @@ public class AppUserServiceImpl implements AppUserService { |
|
|
|
|
|
|
|
Result<UserDTO> result = userFeignClient.getUserInfoById(tokenDto.getUserId()); |
|
|
|
if (result.success() && null != result.getData()) { |
|
|
|
if (("0").equals(result.getData().getState())) { |
|
|
|
//未完善信息获取用户当前所在的网格的后两级机构(社区-网格),返回给前端
|
|
|
|
Result<ParentAndAllDeptDTO> resultParentAndAllDeptDTO = adminFeignClient.getParentAndAllDept(tokenDto.getGridId()); |
|
|
|
if (resultParentAndAllDeptDTO.success() && null != resultParentAndAllDeptDTO.getData()) { |
|
|
|
String allDeptNames = resultParentAndAllDeptDTO.getData().getAllDeptNames(); |
|
|
|
if (StringUtils.isNotBlank(allDeptNames)) { |
|
|
|
String gridName = allDeptNames.substring(allDeptNames.lastIndexOf("-", allDeptNames.lastIndexOf("-") - 1) + 1); |
|
|
|
result.getData().setGrid(gridName); |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
//用户已完善信息:获取用户alldeptnames 的后两级机构(社区-网格)
|
|
|
|
String allDeptNames = result.getData().getAllDeptNames(); |
|
|
|
if (StringUtils.isNotBlank(allDeptNames)) { |
|
|
|
String gridName = allDeptNames.substring(allDeptNames.lastIndexOf("-", allDeptNames.lastIndexOf("-") - 1) + 1); |
|
|
|
result.getData().setGrid(gridName); |
|
|
|
} |
|
|
|
} |
|
|
|
EpdcCompleteUserInfoDTO dto = ConvertUtils.sourceToTarget(result.getData(), EpdcCompleteUserInfoDTO.class); |
|
|
|
dto.setGridId(tokenDto.getGridId()); |
|
|
|
return new Result<EpdcCompleteUserInfoDTO>().ok(dto); |
|
|
|
|