diff --git a/src/com/engine/organization/service/impl/ExportCommonServiceImpl.java b/src/com/engine/organization/service/impl/ExportCommonServiceImpl.java index bf3020b5..117da446 100644 --- a/src/com/engine/organization/service/impl/ExportCommonServiceImpl.java +++ b/src/com/engine/organization/service/impl/ExportCommonServiceImpl.java @@ -15,6 +15,7 @@ import com.engine.organization.entity.department.dto.DepartmentListDTO; import com.engine.organization.entity.department.po.DepartmentPO; import com.engine.organization.entity.hrmresource.po.SearchTemplatePO; import com.engine.organization.entity.hrmresource.vo.HrmResourceVO; +import com.engine.organization.mapper.comp.CompMapper; import com.engine.organization.mapper.department.DepartmentMapper; import com.engine.organization.mapper.resource.HrmResourceMapper; import com.engine.organization.mapper.resource.ResourceMapper; @@ -217,7 +218,19 @@ public class ExportCommonServiceImpl extends Service implements ExportCommonServ String orderSql = PageInfoSortUtil.getSortSql("", " showorder "); List allList = getDepartmentMapper().listAll(orderSql); new DetachUtil(user).filterDepartmentList(allList); - List compListDTOS = DepartmentBO.buildDeptDTOList(allList); + Map poMaps = allList.stream().collect(Collectors.toMap(DepartmentPO::getId, item -> item)); + List dtoList = allList.stream().map(e -> + DepartmentListDTO + .builder() + .id(e.getId()) + .departmentMark(e.getDepartmentMark()) + .departmentName(e.getDepartmentName()) + .departmentCode(e.getDepartmentCode()) + .subCompanyName(0 == e.getSubCompanyId1() ? "" : MapperProxyFactory.getProxy(CompMapper.class).listById(e.getSubCompanyId1()).getSubCompanyName()) + .supDepName(null == poMaps.get(e.getSupDepId()) ? "" : poMaps.get(e.getSupDepId()).getDepartmentName()) + .bmfzr(DepartmentBO.getEmployeeNameById(e.getId())) + .canceled(null == e.getCanceled() ? 0 : e.getCanceled()) + .build()).collect(Collectors.toList()); // 1.工作簿名称 String sheetName = HrmI18nUtil.getI18nLabel(85368, "部门档案数据"); @@ -237,7 +250,7 @@ public class ExportCommonServiceImpl extends Service implements ExportCommonServ //数据 List> rows = new LinkedList<>(); - for (DepartmentListDTO vo : compListDTOS) { + for (DepartmentListDTO vo : dtoList) { List row = new LinkedList<>(); row.add(vo.getDepartmentName()); row.add(vo.getDepartmentCode()); diff --git a/src/com/engine/organization/util/OrganizationDateUtil.java b/src/com/engine/organization/util/OrganizationDateUtil.java index c430cb24..da57c62d 100644 --- a/src/com/engine/organization/util/OrganizationDateUtil.java +++ b/src/com/engine/organization/util/OrganizationDateUtil.java @@ -90,7 +90,7 @@ public class OrganizationDateUtil { SimpleDateFormat simpleDateFormat = new SimpleDateFormat(FORMYEAR_PATTERN); return simpleDateFormat.format(localDate); } catch (Exception e) { - log.warn("格式化年份错误", e); + log.warn("格式化日期错误", e); return StringUtils.EMPTY; } }