|
|
|
@ -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<DepartmentPO> allList = getDepartmentMapper().listAll(orderSql);
|
|
|
|
|
new DetachUtil(user).filterDepartmentList(allList);
|
|
|
|
|
List<DepartmentListDTO> compListDTOS = DepartmentBO.buildDeptDTOList(allList);
|
|
|
|
|
Map<Integer, DepartmentPO> poMaps = allList.stream().collect(Collectors.toMap(DepartmentPO::getId, item -> item));
|
|
|
|
|
List<DepartmentListDTO> 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<List<Object>> rows = new LinkedList<>();
|
|
|
|
|
for (DepartmentListDTO vo : compListDTOS) {
|
|
|
|
|
for (DepartmentListDTO vo : dtoList) {
|
|
|
|
|
List<Object> row = new LinkedList<>();
|
|
|
|
|
row.add(vo.getDepartmentName());
|
|
|
|
|
row.add(vo.getDepartmentCode());
|
|
|
|
|