|
|
|
@ -10,12 +10,17 @@ import com.cloudstore.eccom.pc.table.WeaTableColumn;
|
|
|
|
|
import com.cloudstore.eccom.result.WeaResultMsg;
|
|
|
|
|
import com.engine.core.impl.Service;
|
|
|
|
|
import com.engine.organization.component.OrganizationWeaTable;
|
|
|
|
|
import com.engine.organization.entity.department.bo.DepartmentBO;
|
|
|
|
|
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.department.DepartmentMapper;
|
|
|
|
|
import com.engine.organization.mapper.resource.HrmResourceMapper;
|
|
|
|
|
import com.engine.organization.mapper.resource.ResourceMapper;
|
|
|
|
|
import com.engine.organization.service.ExportCommonService;
|
|
|
|
|
import com.engine.organization.util.HrmI18nUtil;
|
|
|
|
|
import com.engine.organization.util.PageInfoSortUtil;
|
|
|
|
|
import com.engine.organization.util.db.MapperProxyFactory;
|
|
|
|
|
import com.engine.organization.util.detach.DetachUtil;
|
|
|
|
|
import com.engine.organization.util.excel.ExcelUtil;
|
|
|
|
@ -38,6 +43,12 @@ import java.util.stream.Collectors;
|
|
|
|
|
**/
|
|
|
|
|
public class ExportCommonServiceImpl extends Service implements ExportCommonService {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private static DepartmentMapper getDepartmentMapper() {
|
|
|
|
|
return MapperProxyFactory.getProxy(DepartmentMapper.class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public XSSFWorkbook resourceExport(List<Long> ids) {
|
|
|
|
|
|
|
|
|
@ -201,5 +212,45 @@ public class ExportCommonServiceImpl extends Service implements ExportCommonServ
|
|
|
|
|
return ExcelUtil.genWorkbookV2(excelSheetData, sheetName);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public XSSFWorkbook departmentExport() {
|
|
|
|
|
String orderSql = PageInfoSortUtil.getSortSql("", " showorder ");
|
|
|
|
|
List<DepartmentPO> allList = getDepartmentMapper().listAll(orderSql);
|
|
|
|
|
new DetachUtil(user).filterDepartmentList(allList);
|
|
|
|
|
List<DepartmentListDTO> compListDTOS = DepartmentBO.buildDeptDTOList(allList);
|
|
|
|
|
|
|
|
|
|
// 1.工作簿名称
|
|
|
|
|
String sheetName = HrmI18nUtil.getI18nLabel(85368, "部门档案数据");
|
|
|
|
|
// 2.表头(后面动态获取)
|
|
|
|
|
List<List<Object>> excelSheetData = new ArrayList<>();
|
|
|
|
|
|
|
|
|
|
String[] header = {
|
|
|
|
|
HrmI18nUtil.getI18nLabel( -93270, "部门名称"),
|
|
|
|
|
HrmI18nUtil.getI18nLabel( -93272, "编号"),
|
|
|
|
|
HrmI18nUtil.getI18nLabel( -93274, "部门简称"),
|
|
|
|
|
HrmI18nUtil.getI18nLabel( -93275, "所属分部"),
|
|
|
|
|
HrmI18nUtil.getI18nLabel( -93278, "上级部门"),
|
|
|
|
|
HrmI18nUtil.getI18nLabel( -93279, "部门负责人"),
|
|
|
|
|
HrmI18nUtil.getI18nLabel( -93280, "启用状态")
|
|
|
|
|
};
|
|
|
|
|
excelSheetData.add(Arrays.asList(header));
|
|
|
|
|
|
|
|
|
|
//数据
|
|
|
|
|
List<List<Object>> rows = new LinkedList<>();
|
|
|
|
|
for (DepartmentListDTO vo : compListDTOS) {
|
|
|
|
|
List<Object> row = new LinkedList<>();
|
|
|
|
|
row.add(vo.getDepartmentName());
|
|
|
|
|
row.add(vo.getDepartmentCode());
|
|
|
|
|
row.add(vo.getDepartmentMark());
|
|
|
|
|
row.add(vo.getSubCompanyName());
|
|
|
|
|
row.add(vo.getSupDepName());
|
|
|
|
|
row.add(vo.getBmfzr());
|
|
|
|
|
row.add(vo.getCanceled() == 0 ? "启用" : "未启用");
|
|
|
|
|
rows.add(row);
|
|
|
|
|
}
|
|
|
|
|
excelSheetData.addAll(rows);
|
|
|
|
|
return ExcelUtil.genWorkbookV2(excelSheetData, sheetName);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|