package com.engine.organization.transmethod;


import com.engine.organization.entity.DeleteParam;
import com.engine.organization.mapper.employee.EmployeeMapper;
import com.engine.organization.mapper.hrmresource.SystemDataMapper;
import com.engine.organization.util.db.MapperProxyFactory;
import org.apache.commons.lang3.StringUtils;

import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

/**
 * @Author weaver_cl
 * @Description:
 * @Date 2022/10/26
 * @Version V1.0
 **/
public class ManagerDetachTransMethod {

    public static String getManagerName(String ecManager) {
        String managerName  = MapperProxyFactory.getProxy(EmployeeMapper.class).getEmployeeNameById(Long.valueOf(ecManager));
        return managerName;
    }


    public static String getRoleLevel(String ecRolelevel) {
        List<Map<String, Object>> maps = MapperProxyFactory.getProxy(SystemDataMapper.class).getBrowserDatas(DeleteParam.builder().ids(ecRolelevel).build().getIds());
        String names = maps.stream().map(item -> (String) item.get("name")).collect(Collectors.joining(","));
        return names;
    }
}
