|
|
@@ -33,9 +33,9 @@ import me.zhengjie.base.AppBaseResponse;
|
|
|
import me.zhengjie.base.util.ApplicationContextUtil;
|
|
|
import me.zhengjie.base.util.FileUploadUtil;
|
|
|
import me.zhengjie.config.RsaProperties;
|
|
|
-import me.zhengjie.dao.mybatis.entity.Dept;
|
|
|
-import me.zhengjie.dao.mybatis.entity.FileInfoEntity;
|
|
|
-import me.zhengjie.dao.mybatis.entity.User;
|
|
|
+import me.zhengjie.dao.mybatis.entity.*;
|
|
|
+import me.zhengjie.dao.mybatis.mapper.BankMapper;
|
|
|
+import me.zhengjie.dao.mybatis.mapper.NotaryOfficeMapper;
|
|
|
import me.zhengjie.exception.BadRequestException;
|
|
|
import me.zhengjie.utils.RsaUtils;
|
|
|
import me.zhengjie.utils.enums.CodeEnum;
|
|
|
@@ -75,6 +75,8 @@ public class UserController {
|
|
|
private final VerifyService verificationCodeService;
|
|
|
private final FileInfoService fileInfoService;
|
|
|
private final ApplicationContextUtil contextUtil;
|
|
|
+ private final BankMapper bankMapper;
|
|
|
+ private final NotaryOfficeMapper notaryOfficeMapper;
|
|
|
|
|
|
@ApiOperation("获取用户信息")
|
|
|
@GetMapping(value = "/info")
|
|
|
@@ -82,19 +84,24 @@ public class UserController {
|
|
|
// 这里需要处理图片显示问题
|
|
|
JwtUserDto jwtUserDto = contextUtil.getCurrentUser();
|
|
|
// 处理图片的显示,重新查询一下当前的用户的值
|
|
|
- UserDto cacheUser = jwtUserDto.getUser();
|
|
|
- UserDto nocacheUser = userService.findUserNoCacheId(cacheUser.getId());
|
|
|
- //重新设置user
|
|
|
+ UserDto nocacheUser = userService.findUserNoCacheId(jwtUserDto.getUser().getId());
|
|
|
+ // 重新设置user
|
|
|
if (nocacheUser != null) {
|
|
|
- jwtUserDto.setUser(nocacheUser);
|
|
|
+ String[] split = nocacheUser.getOrgId().split("_");
|
|
|
+ if ("bank".equals(split[0])) {
|
|
|
+ nocacheUser.setOrgName(bankMapper.selectById(split[1]).getBankName());
|
|
|
+ } else {
|
|
|
+ NotaryOfficeEntity notaryOfficeEntity = notaryOfficeMapper.selectById(split[1]);
|
|
|
+ nocacheUser.setOrgName(notaryOfficeEntity.getName());
|
|
|
+ nocacheUser.setAutoGenerate(notaryOfficeEntity.getAutoGenerate());
|
|
|
+ }
|
|
|
FileInfoEntity fileInfo = fileInfoService.getById(nocacheUser.getSignImgId());
|
|
|
if (fileInfo != null) {
|
|
|
- String signImgUrl = FileUploadUtil.getFileUrl(fileInfo.getPath());
|
|
|
- cacheUser.setSignImgUrl(signImgUrl);
|
|
|
- }else {
|
|
|
- //这里需要设置图片的路径为空
|
|
|
- cacheUser.setSignImgUrl("");
|
|
|
+ nocacheUser.setSignImgUrl(FileUploadUtil.getFileUrl(fileInfo.getPath()));
|
|
|
+ } else {
|
|
|
+ nocacheUser.setSignImgUrl("");
|
|
|
}
|
|
|
+ jwtUserDto.setUser(nocacheUser);
|
|
|
}
|
|
|
return ResponseEntity.ok(jwtUserDto);
|
|
|
}
|