use of com.web.framework.core.model.dto.UserDTO in project spring-boot-web by wangchengming666.
the class UcUserServiceImpl method list.
@Override
@UserOpreationLog(code = UserOperationConstants.U01)
public List<UserDTO> list(UserVO vo) {
List<UserDTO> reList = new ArrayList<>(1);
if (StringUtils.isNotBlank(vo.getCellphone())) {
List<UcUserCellphone> cellphones = ucUserCellphoneMapper.selectList(new QueryWrapper<UcUserCellphone>().eq("cellphone", vo.getCellphone()));
for (UcUserCellphone item : cellphones) {
UcUser user = new UcUser();
user.setId(item.getUserId());
reList.addAll(listUser(user));
}
return reList;
}
if (StringUtils.isNotBlank(vo.getEmail())) {
List<UcUserEmail> emails = ucUserEmailMapper.selectList(new QueryWrapper<UcUserEmail>().eq("email", vo.getEmail()));
for (UcUserEmail item : emails) {
UcUser user = new UcUser();
user.setId(item.getUserId());
reList.addAll(listUser(user));
}
return reList;
}
UcUser ucUser = new UcUser();
ucUser.setIdentityCard(vo.getIdentityCard());
ucUser.setTrueName(vo.getTrueName());
ucUser.setNickName(vo.getNickName());
ucUser.setUcName(vo.getUcName());
return listUser(ucUser);
}
use of com.web.framework.core.model.dto.UserDTO in project spring-boot-web by wangchengming666.
the class UcUserServiceImpl method listUser.
private List<UserDTO> listUser(UcUser ucUser) {
List<UserDTO> userDTOs;
List<UcUser> users = ucUserMapper.selectList(new QueryWrapper<UcUser>().eq(StringUtils.isNotBlank(ucUser.getUcName()), "upper_uc_name", StringUtils.upperCase(ucUser.getUcName())).eq(StringUtils.isNotBlank(ucUser.getIdentityCard()), "identity_card", ucUser.getIdentityCard()).eq(StringUtils.isNotBlank(ucUser.getTrueName()), "true_name", ucUser.getTrueName()).eq(StringUtils.isNotBlank(ucUser.getNickName()), "nick_name", ucUser.getNickName()).eq(ucUser.getId() != null, "id", ucUser.getId()));
userDTOs = new ArrayList<>(users.size());
for (UcUser item : users) {
UserDTO dto = new UserDTO(item);
dto.setEmails(ucUserEmailMapper.selectList(new QueryWrapper<UcUserEmail>().eq("user_id", item.getId())));
dto.setCellphones(ucUserCellphoneMapper.selectList(new QueryWrapper<UcUserCellphone>().eq("user_id", item.getId())));
userDTOs.add(dto);
}
return userDTOs;
}
Aggregations