用户信息文件问题

This commit is contained in:
wanggeng 2024-07-25 19:18:20 +08:00
parent 4be10cc0d3
commit faac0d72b9

View File

@ -4,6 +4,7 @@ import cn.com.tenlion.operator.controller.api.user.custom.UserCustomController;
import cn.com.tenlion.operator.pojo.dtos.user.custom.UserCustomDTO; import cn.com.tenlion.operator.pojo.dtos.user.custom.UserCustomDTO;
import cn.com.tenlion.operator.pojo.dtos.user.info.UserInfoDTO; import cn.com.tenlion.operator.pojo.dtos.user.info.UserInfoDTO;
import cn.com.tenlion.operator.pojo.pos.account.AccountPO; import cn.com.tenlion.operator.pojo.pos.account.AccountPO;
import cn.com.tenlion.operator.properties.SystemApiPathProperties;
import cn.com.tenlion.operator.service.account.IAccountService; import cn.com.tenlion.operator.service.account.IAccountService;
import cn.com.tenlion.operator.service.user.info.UserInfoService; import cn.com.tenlion.operator.service.user.info.UserInfoService;
import com.sun.org.apache.bcel.internal.generic.RETURN; import com.sun.org.apache.bcel.internal.generic.RETURN;
@ -43,6 +44,8 @@ public class UserCustomService extends DefaultBaseService {
private IRoleUserService roleUserService; private IRoleUserService roleUserService;
@Autowired @Autowired
private UserInfoService userInfoService; private UserInfoService userInfoService;
@Autowired
private SystemApiPathProperties systemApiPathProperties;
public SuccessResultList<List<UserCustomDTO>> listpage(ListPage page) { public SuccessResultList<List<UserCustomDTO>> listpage(ListPage page) {
SuccessResultList<List<UserDTO>> successResultList = userService.listPage(page); SuccessResultList<List<UserDTO>> successResultList = userService.listPage(page);
@ -62,7 +65,11 @@ public class UserCustomService extends DefaultBaseService {
List<RolePO> rolePOS = roleUserService.listRolePOByUserId(userDTO.getUserId()); List<RolePO> rolePOS = roleUserService.listRolePOByUserId(userDTO.getUserId());
List<UserCustomDTO.Role> roles = rolePOS.stream().map(rolePO -> new UserCustomDTO.Role(rolePO.getRoleId(), rolePO.getRoleName())).collect(Collectors.toList()); List<UserCustomDTO.Role> roles = rolePOS.stream().map(rolePO -> new UserCustomDTO.Role(rolePO.getRoleId(), rolePO.getRoleName())).collect(Collectors.toList());
userCustomDTO.setRoles(roles); userCustomDTO.setRoles(roles);
userInfoDTOS.stream().filter(dto -> StringUtils.equals(userDTO.getUserId(), dto.getUserId())).findFirst().ifPresent(userCustomDTO::setUserInfo); userInfoDTOS.stream().filter(dto -> StringUtils.equals(userDTO.getUserId(), dto.getUserId())).findFirst().ifPresent(userInfo -> {
userInfo.setIdCardFront(String.format("%sroute/file/download/true/%s", systemApiPathProperties.getCopyrightExternal(), userInfo.getIdCardFront()));
userInfo.setIdCardBack(String.format("%sroute/file/download/true/%s", systemApiPathProperties.getCopyrightExternal(), userInfo.getIdCardBack()));
userCustomDTO.setUserInfo(userInfo);
});
return userCustomDTO; return userCustomDTO;
}).collect(Collectors.toList()); }).collect(Collectors.toList());
return new SuccessResultList<>(userCustomDTOS, successResultList.getPage(), successResultList.getTotal()); return new SuccessResultList<>(userCustomDTOS, successResultList.getPage(), successResultList.getTotal());