screen-manage/src/main/java/com/moral/api/pojo/vo/account/AccountVO.java
@@ -5,6 +5,7 @@
import com.moral.api.entity.ManageRole;
import com.moral.api.pojo.dto.account.AccountDTO;
import lombok.Data;
import org.springframework.util.ObjectUtils;
import java.util.ArrayList;
import java.util.List;
@@ -20,8 +21,6 @@
@JsonInclude(JsonInclude.Include.NON_EMPTY)
public class AccountVO {
    private String code;
    private Integer id;
    private String userName;
@@ -34,14 +33,16 @@
    private List<String> roleNames;
    public static AccountVO convert(AccountDTO dto){
        if(dto.getAccount()==null)
    public static AccountVO convert(AccountDTO dto) {
        if (dto.getAccount() == null)
            return null;
        AccountVO vo = new AccountVO();
        ManageAccount account = dto.getAccount();
        List<ManageRole> roles = dto.getRoles();
        List<String> roleNames = new ArrayList<>();
        roles.forEach(role->roleNames.add(role.getName()));
        if (!ObjectUtils.isEmpty(roles)) {
            roles.forEach(role -> roleNames.add(role.getName()));
        }
        vo.setId(account.getId());
        vo.setUserName(account.getUserName());
        vo.setEmail(account.getEmail());