|
|
@ -28,6 +28,8 @@ import com.engine.organization.util.excel.ExcelUtil;
|
|
|
|
import org.apache.commons.lang.StringUtils;
|
|
|
|
import org.apache.commons.lang.StringUtils;
|
|
|
|
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
|
|
|
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
|
|
|
import weaver.general.Util;
|
|
|
|
import weaver.general.Util;
|
|
|
|
|
|
|
|
import weaver.hrm.company.DepartmentComInfo;
|
|
|
|
|
|
|
|
import weaver.hrm.company.SubCompanyComInfo;
|
|
|
|
|
|
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
@ -104,7 +106,7 @@ public class ExportCommonServiceImpl extends Service implements ExportCommonServ
|
|
|
|
List<String> headerList = new ArrayList<>();
|
|
|
|
List<String> headerList = new ArrayList<>();
|
|
|
|
List<Object> headerNameList = new ArrayList<>();
|
|
|
|
List<Object> headerNameList = new ArrayList<>();
|
|
|
|
OrganizationWeaTable<HrmResourceVO> table = new OrganizationWeaTable<>(user, HrmResourceVO.class);
|
|
|
|
OrganizationWeaTable<HrmResourceVO> table = new OrganizationWeaTable<>(user, HrmResourceVO.class);
|
|
|
|
String sqlWhere = " where 1 = 1 and t.status < 4 and (t.accounttype is null or t.accounttype != 1)";
|
|
|
|
String sqlWhere = " where 1 = 1 and (t.accounttype is null or t.accounttype != 1)";
|
|
|
|
// 分权查询
|
|
|
|
// 分权查询
|
|
|
|
DetachUtil detachUtil = new DetachUtil(user);
|
|
|
|
DetachUtil detachUtil = new DetachUtil(user);
|
|
|
|
String parentCompanyIds = detachUtil.getJclRoleLevels();
|
|
|
|
String parentCompanyIds = detachUtil.getJclRoleLevels();
|
|
|
@ -215,10 +217,11 @@ public class ExportCommonServiceImpl extends Service implements ExportCommonServ
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public XSSFWorkbook departmentExport() {
|
|
|
|
public XSSFWorkbook departmentExport() {
|
|
|
|
|
|
|
|
SubCompanyComInfo subCompanyComInfo = new SubCompanyComInfo();
|
|
|
|
|
|
|
|
DepartmentComInfo departmentComInfo = new DepartmentComInfo();
|
|
|
|
String orderSql = PageInfoSortUtil.getSortSql("", " showorder ");
|
|
|
|
String orderSql = PageInfoSortUtil.getSortSql("", " showorder ");
|
|
|
|
List<DepartmentPO> allList = getDepartmentMapper().listAll(orderSql);
|
|
|
|
List<DepartmentPO> allList = getDepartmentMapper().listAll(orderSql);
|
|
|
|
new DetachUtil(user).filterDepartmentList(allList);
|
|
|
|
new DetachUtil(user).filterDepartmentList(allList);
|
|
|
|
Map<Integer, DepartmentPO> poMaps = allList.stream().collect(Collectors.toMap(DepartmentPO::getId, item -> item));
|
|
|
|
|
|
|
|
List<DepartmentListDTO> dtoList = allList.stream().map(e ->
|
|
|
|
List<DepartmentListDTO> dtoList = allList.stream().map(e ->
|
|
|
|
DepartmentListDTO
|
|
|
|
DepartmentListDTO
|
|
|
|
.builder()
|
|
|
|
.builder()
|
|
|
@ -226,8 +229,10 @@ public class ExportCommonServiceImpl extends Service implements ExportCommonServ
|
|
|
|
.departmentMark(e.getDepartmentMark())
|
|
|
|
.departmentMark(e.getDepartmentMark())
|
|
|
|
.departmentName(e.getDepartmentName())
|
|
|
|
.departmentName(e.getDepartmentName())
|
|
|
|
.departmentCode(e.getDepartmentCode())
|
|
|
|
.departmentCode(e.getDepartmentCode())
|
|
|
|
.subCompanyName(0 == e.getSubCompanyId1() ? "" : MapperProxyFactory.getProxy(CompMapper.class).listById(e.getSubCompanyId1()).getSubCompanyName())
|
|
|
|
.subCompanyId1(e.getSubCompanyId1())
|
|
|
|
.supDepName(null == poMaps.get(e.getSupDepId()) ? "" : poMaps.get(e.getSupDepId()).getDepartmentName())
|
|
|
|
.supDepId(e.getSupDepId())
|
|
|
|
|
|
|
|
.subCompanyName((null == e.getSubCompanyId1() || 0 == e.getSubCompanyId1()) ? "" : subCompanyComInfo.getSubCompanyname(Util.null2String(e.getSubCompanyId1())))
|
|
|
|
|
|
|
|
.supDepName((null == e.getSupDepId() || 0 == e.getSupDepId()) ? "" : departmentComInfo.getDepartmentname(Util.null2String(e.getSupDepId())))
|
|
|
|
.bmfzr(DepartmentBO.getEmployeeNameById(e.getId()))
|
|
|
|
.bmfzr(DepartmentBO.getEmployeeNameById(e.getId()))
|
|
|
|
.canceled(null == e.getCanceled() ? 0 : e.getCanceled())
|
|
|
|
.canceled(null == e.getCanceled() ? 0 : e.getCanceled())
|
|
|
|
.build()).collect(Collectors.toList());
|
|
|
|
.build()).collect(Collectors.toList());
|
|
|
|