Search in sources :

Example 1 with UserDTO

use of com.dtstack.taier.dao.dto.UserDTO in project Taier by DTStack.

the class BatchTaskService method buildUserDTOInfo.

public void buildUserDTOInfo(final Map<Long, User> userMap, final ScheduleTaskVO vo) {
    if (Objects.nonNull(vo.getCreateUserId())) {
        User createUser = userMap.get(vo.getCreateUserId());
        UserDTO dto = new UserDTO();
        BeanUtils.copyProperties(createUser, dto);
        vo.setCreateUser(dto);
        if (vo.getCreateUserId().equals(vo.getModifyUserId())) {
            vo.setModifyUser(dto);
        } else {
            UserDTO modifyDto = new UserDTO();
            BeanUtils.copyProperties(userMap.getOrDefault(vo.getModifyUserId(), new User()), modifyDto);
            vo.setModifyUser(modifyDto);
        }
    }
}
Also used : User(com.dtstack.taier.dao.domain.User) UserDTO(com.dtstack.taier.dao.dto.UserDTO)

Example 2 with UserDTO

use of com.dtstack.taier.dao.dto.UserDTO in project Taier by DTStack.

the class UserService method getUserByDTO.

public UserDTO getUserByDTO(Long userId) {
    if (userId == null) {
        return null;
    }
    User one = getById(userId);
    if (Objects.isNull(one)) {
        return null;
    }
    UserDTO userDTO = new UserDTO();
    BeanUtils.copyProperties(one, userDTO);
    return userDTO;
}
Also used : User(com.dtstack.taier.dao.domain.User) UserDTO(com.dtstack.taier.dao.dto.UserDTO)

Aggregations

User (com.dtstack.taier.dao.domain.User)2 UserDTO (com.dtstack.taier.dao.dto.UserDTO)2