fix(bug修复): 导出Excel
修正了导出项
| | |
| | | request.setPageNum(1); |
| | | List<EmpBaseInfo> exportList = this.empBaseInfoService.findZsEmpBaseInfos(request, empBaseinfo).getRecords(); |
| | | List<Map<String, Object>> listMapDicItem = new ArrayList(); |
| | | List<Map<String, Object>> allList = PoiExportExcel.getDataList(exportField, exportList, listMapDicItem); |
| | | String fileName = "在职员工列表"; |
| | | List<Map<String, Object>> allList = PoiExportExcel.getDataList(exportField, exportList, null); |
| | | String fileName = "员工列表"; |
| | | Date currentDate = new Date(); |
| | | String dateStr = DateUtil.formatDate(currentDate); |
| | | boolean result = PoiExportExcel.exportCommonExcel(response, fileName + dateStr, fileName, allList); |
| | |
| | | private String empNumb = ""; |
| | | |
| | | @NotBlank(message = "{required}") |
| | | @FieldInfo(name = "empName", type = "varchar", explain = "员工姓名") |
| | | @FieldInfo(name = "empName", type = "varchar", explain = "员姓名") |
| | | @TableField("empName") |
| | | @ExcelField(value = "员工姓名") |
| | | private String empName = ""; |
| | |
| | | @ExcelField(value = "性别", writeConverterExp = "1=男,2=女") |
| | | private String sex = ""; |
| | | |
| | | //@FieldInfo(name = "sexName", type = "varchar", explain = "性别") |
| | | @FieldInfo(name = "sexName", type = "varchar", explain = "性别") |
| | | @TableField(exist = false) |
| | | private String sexName = ""; |
| | | |
| | |
| | | @TableField("jobId") |
| | | private Long jobId = 0L; |
| | | |
| | | @FieldInfo(name = "jobName", type = "varchar", explain = "岗位名称") |
| | | @FieldInfo(name = "jobName", type = "varchar", explain = "所属岗位") |
| | | @TableField("jobName") |
| | | @ExcelField(value = "岗位名称") |
| | | private String jobName = ""; |
| | |
| | | @ExcelField(value = "员工类别", writeConverterExp = "1=正式工,2=临时工") |
| | | private String empType = ""; |
| | | |
| | | //@FieldInfo(name = "empTypeName", type = "varchar", explain = "员工类别") |
| | | @FieldInfo(name = "empTypeName", type = "varchar", explain = "员工类别") |
| | | @TableField(exist = false) |
| | | private String empTypeName = ""; |
| | | |
| | |
| | | @TableField("nation") |
| | | private String nation = ""; |
| | | |
| | | //@FieldInfo(name = "nationName", type = "varchar", explain = "民族") |
| | | @FieldInfo(name = "nationName", type = "varchar", explain = "民族") |
| | | @TableField(exist = false) |
| | | @ExcelField(value = "民族") |
| | | private String nationName = ""; |
| | |
| | | @TableField("marriage") |
| | | private String marriage = ""; |
| | | |
| | | //@FieldInfo(name = "marriageName", type = "varchar", explain = "婚姻状况") |
| | | @FieldInfo(name = "marriageName", type = "varchar", explain = "婚姻状况") |
| | | @TableField(exist = false) |
| | | @ExcelField(value = "婚姻状况") |
| | | private String marriageName = ""; |
| | |
| | | @TableField("politics") |
| | | private String politics = ""; |
| | | |
| | | //@FieldInfo(name = "politicsName", type = "varchar", explain = "政治面貌") |
| | | @FieldInfo(name = "politicsName", type = "varchar", explain = "政治面貌") |
| | | @TableField(exist = false) |
| | | @ExcelField(value = "政治面貌") |
| | | private String politicsName = ""; |
| | |
| | | @TableField("education") |
| | | private String education = ""; |
| | | |
| | | //@FieldInfo(name = "educationName", type = "varchar", explain = "最高学历") |
| | | @FieldInfo(name = "educationName", type = "varchar", explain = "学历") |
| | | @TableField(exist = false) |
| | | @ExcelField(value = "最高学历") |
| | | private String educationName = ""; |
| | |
| | | @TableField("nativePlace") |
| | | private String nativePlace = ""; |
| | | |
| | | //@FieldInfo(name = "nativePlaceName", type = "varchar", explain = "籍贯") |
| | | @FieldInfo(name = "nativePlaceName", type = "varchar", explain = "籍贯") |
| | | @TableField(exist = false) |
| | | @ExcelField(value = "籍贯") |
| | | private String nativePlaceName = ""; |
| | |
| | | @TableField("archivesStatus") |
| | | private String archivesStatus = ""; |
| | | |
| | | //@FieldInfo(name = "archivesStatusName", type = "varchar", explain = "档案情况") |
| | | @FieldInfo(name = "archivesStatusName", type = "varchar", explain = "档案情况") |
| | | @TableField(exist = false) |
| | | @ExcelField(value = "档案情况") |
| | | private String archivesStatusName = ""; |
| | |
| | | @ExcelField(value = "银行账号") |
| | | private String bankNumb = ""; |
| | | |
| | | @FieldInfo(name = "InsuranceType", type = "varchar", explain = "保险类型") |
| | | @FieldInfo(name = "insuranceType", type = "varchar", explain = "保险类型") |
| | | @TableField("InsuranceType") |
| | | private String insuranceType = ""; |
| | | |
| | | //@FieldInfo(name = "InsuranceTypeName", type = "varchar", explain = "保险类型") |
| | | @FieldInfo(name = "insuranceTypeName", type = "varchar", explain = "保险类型") |
| | | @TableField(exist = false) |
| | | @ExcelField(value = "保险类型") |
| | | private String insuranceTypeName = ""; |
| | |
| | | @ExcelField(value = "员工手册", writeConverterExp = "0=未发,1=已发") |
| | | private String handbookStatus = ""; |
| | | |
| | | //@FieldInfo(name = "handbookStatusName", type = "varchar", explain = "员工手册") |
| | | @FieldInfo(name = "handbookStatusName", type = "varchar", explain = "员工手册") |
| | | @TableField(exist = false) |
| | | @ExcelField(value = "员工手册") |
| | | private String handbookStatusName = ""; |
| | |
| | | @ExcelField(value = "紧急联系电话") |
| | | private String urgencyPhone = ""; |
| | | |
| | | @FieldInfo(name = "empCardStatus", type = "varchar", explain = "工作证") |
| | | @FieldInfo(name = "empCardStatus", type = "varchar", explain = "工作证代码") |
| | | @TableField("empCardStatus") |
| | | @ExcelField(value = "工作证", writeConverterExp = "0=未发,1=已发") |
| | | private String empCardStatus = ""; |
| | | |
| | | //@FieldInfo(name = "empCardStatusName", type = "varchar", explain = "工作证") |
| | | @FieldInfo(name = "empCardStatusName", type = "varchar", explain = "工作证") |
| | | @TableField(exist = false) |
| | | @ExcelField(value = "工作证") |
| | | private String empCardStatusName = ""; |
| | |
| | | @FieldInfo(name = "baseKey", type = "varchar", explain = "查询关键词") |
| | | @TableField(exist = false) |
| | | private String baseKey; |
| | | |
| | | @FieldInfo(name = "empStatusName", type = "varchar", explain = "员工状态") |
| | | @TableField(exist = false) |
| | | private String empStatusName = ""; |
| | | } |
| | |
| | | p.setArchivesStatusName("0".equals(p.getArchivesStatus()) ? "未移交" : "已移交"); |
| | | p.setEmpCardStatusName("1".equals(p.getEmpCardStatus()) ? "未发" : "已发"); |
| | | p.setHandbookStatusName("1".equals(p.getHandbookStatus()) ? "未发" : "已发"); |
| | | p.setEmpStatusName("0".equals(p.getEmpStatus()) ? "在职" : "离职"); |
| | | //保险类型 |
| | | p.setInsuranceTypeName(dicItems.stream() |
| | | .filter(k -> DicCode.INSURANCETYPE.equals(k.getDicCode()) && k.getDicItemCode().equals(p.getInsuranceType())) |
| | | .findFirst() |
| | | .map(DicItem::getDicItemName) |
| | | .orElse("汉族")); |
| | | .orElse("未知")); |
| | | //员工类别 |
| | | p.setEmpTypeName(dicItems.stream() |
| | | .filter(k -> DicCode.EMPTYPE.equals(k.getDicCode()) && k.getDicItemCode().equals(p.getEmpType())) |
| | |
| | | |
| | | //工作经历 |
| | | IPage<EmpWorkExperience> workExperienceIPage = empWorkExperienceMapper.selectPageVo(page, new QueryWrapper<EmpWorkExperience>().in("a.empId", empIds).ne("a.delFlag", 1)); |
| | | if (workExperienceIPage.getRecords().size()!=0){ |
| | | if (workExperienceIPage.getRecords().size() != 0) { |
| | | exportField = FebsUtil.reflectAnnotation(EmpWorkExperience.class); |
| | | List<Map<String, Object>> allListEmpWork = PoiExportExcel.getDataList(exportField, workExperienceIPage.getRecords(), listMapDicItem); |
| | | allList.add(allListEmpWork.get(0)); |
| | |
| | | |
| | | //体检信息 |
| | | IPage<EmpPhysicalExam> empPhysicalExamIPage = empPhysicalExamMapper.selectPageVo(page, new QueryWrapper<EmpPhysicalExam>().in("a.empId", empIds).ne("a.delFlag", 1)); |
| | | if (empPhysicalExamIPage.getRecords().size()!=0){ |
| | | if (empPhysicalExamIPage.getRecords().size() != 0) { |
| | | exportField = FebsUtil.reflectAnnotation(EmpWorkExperience.class); |
| | | List<Map<String, Object>> allListEmpPhysical = PoiExportExcel.getDataList(exportField, empPhysicalExamIPage.getRecords(), listMapDicItem); |
| | | allList.add(allListEmpPhysical.get(0)); |
| | |
| | | |
| | | //调岗记录 |
| | | IPage<EmpJobChange> jobChangeIPage = empJobChangeMapper.selectPageVoBean(page, new QueryWrapper<EmpJobChange>().in("a.empId", empIds).ne("a.delFlag", 1)); |
| | | if (jobChangeIPage.getRecords().size()!=0){ |
| | | if (jobChangeIPage.getRecords().size() != 0) { |
| | | exportField = FebsUtil.reflectAnnotation(EmpJobChange.class); |
| | | List<Map<String, Object>> allListjobChangeI = PoiExportExcel.getDataList(exportField, jobChangeIPage.getRecords(), listMapDicItem); |
| | | allList.add(allListjobChangeI.get(0)); |
| | |
| | | |
| | | //合同信息 |
| | | IPage<EmpContractInfo> empContractInfoIPage = empContractInfoMapper.selectPageVo(page, new QueryWrapper<EmpContractInfo>().in("a.empId", empIds).ne("a.delFlag", 1)); |
| | | if (empContractInfoIPage.getRecords().size()!=0){ |
| | | if (empContractInfoIPage.getRecords().size() != 0) { |
| | | exportField = FebsUtil.reflectAnnotation(EmpContractInfo.class); |
| | | List<Map<String, Object>> allListEmpContractInfo = PoiExportExcel.getDataList(exportField, empContractInfoIPage.getRecords(), listMapDicItem); |
| | | allList.add(allListEmpContractInfo.get(0)); |
| | |
| | | |
| | | //入离职记录 |
| | | IPage<EmpDimissionAttend> empDimissionAttendIPage = empDimissionAttendMapper.selectPageVo(page, new QueryWrapper<EmpDimissionAttend>().in("a.empId", empIds).ne("a.delFlag", 1)); |
| | | if (empDimissionAttendIPage.getRecords().size()!=0){ |
| | | if (empDimissionAttendIPage.getRecords().size() != 0) { |
| | | exportField = FebsUtil.reflectAnnotation(EmpDimissionAttend.class); |
| | | List<Map<String, Object>> allListEmpDimissionAtt = PoiExportExcel.getDataList(exportField, empDimissionAttendIPage.getRecords(), listMapDicItem); |
| | | allList.add(allListEmpDimissionAtt.get(0)); |
| | |
| | | |
| | | //请假记录 |
| | | IPage<EmpLeaveInfo> empLeaveInfoIPage = empLeaveInfoMapper.selectPageVo(page, new QueryWrapper<EmpLeaveInfo>().in("a.empId", empIds).ne("a.delFlag", 1)); |
| | | if (empLeaveInfoIPage.getRecords().size()!=0){ |
| | | if (empLeaveInfoIPage.getRecords().size() != 0) { |
| | | exportField = FebsUtil.reflectAnnotation(EmpLeaveInfo.class); |
| | | List<Map<String, Object>> allListEmpLoeaveInfo = PoiExportExcel.getDataList(exportField, empLeaveInfoIPage.getRecords(), listMapDicItem); |
| | | allList.add(allListEmpLoeaveInfo.get(0)); |
| | |
| | | |
| | | //失业金领取 |
| | | IPage<EmpUnemployment> empUnemploymentIPage = empUnemploymentMapper.selectPageVo(page, new QueryWrapper<EmpUnemployment>().in("a.empId", empIds).ne("a.delFlag", 1)); |
| | | if (empUnemploymentIPage.getRecords().size()!=0){ |
| | | if (empUnemploymentIPage.getRecords().size() != 0) { |
| | | exportField = FebsUtil.reflectAnnotation(EmpUnemployment.class); |
| | | List<Map<String, Object>> allListEmpUnemployment = PoiExportExcel.getDataList(exportField, empUnemploymentIPage.getRecords(), listMapDicItem); |
| | | allList.add(allListEmpUnemployment.get(0)); |
| | |
| | | |
| | | //社保申请 |
| | | IPage<EmpInsurance> empInsuranceIPage = empInsuranceMapper.selectPageVo(page, new QueryWrapper<EmpInsurance>().in("a.empId", empIds).ne("a.delFlag", 1)); |
| | | if (empInsuranceIPage.getRecords().size()!=0){ |
| | | if (empInsuranceIPage.getRecords().size() != 0) { |
| | | exportField = FebsUtil.reflectAnnotation(EmpInsurance.class); |
| | | List<Map<String, Object>> allListEmpInsurance = PoiExportExcel.getDataList(exportField, empInsuranceIPage.getRecords(), listMapDicItem); |
| | | allList.add(allListEmpInsurance.get(0)); |
| | |
| | | |
| | | //意外险案件 |
| | | IPage<EmpAccidentCases> empAccidentCasesIPage = empAccidentCasesMapper.selectPageVo(page, new QueryWrapper<EmpInsurance>().in("a.empId", empIds).ne("a.delFlag", 1)); |
| | | if (empAccidentCasesIPage.getRecords().size()!=0){ |
| | | if (empAccidentCasesIPage.getRecords().size() != 0) { |
| | | exportField = FebsUtil.reflectAnnotation(EmpAccidentCases.class); |
| | | List<Map<String, Object>> allListEmpAccidentCases = PoiExportExcel.getDataList(exportField, empAccidentCasesIPage.getRecords(), listMapDicItem); |
| | | allList.add(allListEmpAccidentCases.get(0)); |
| | |
| | | |
| | | //工伤案件 |
| | | IPage<EmpOccupational> empOccupationalIPage = empOccupationalMapper.selectPageVo(page, new QueryWrapper<EmpOccupational>().in("a.empId", empIds).ne("a.delFlag", 1)); |
| | | if (empOccupationalIPage.getRecords().size()!=0){ |
| | | if (empOccupationalIPage.getRecords().size() != 0) { |
| | | exportField = FebsUtil.reflectAnnotation(EmpOccupational.class); |
| | | List<Map<String, Object>> allListEmpOccupational = PoiExportExcel.getDataList(exportField, empOccupationalIPage.getRecords(), listMapDicItem); |
| | | allList.add(allListEmpOccupational.get(0)); |
| | |
| | | |
| | | //劳资案件 |
| | | IPage<EmpLaborTrouble> empLaborTroubleIPage = empLaborTroubleMapper.selectPageVo(page, new QueryWrapper<EmpInsurance>().in("a.empId", empIds).ne("a.delFlag", 1)); |
| | | if (empLaborTroubleIPage.getRecords().size()!=0){ |
| | | if (empLaborTroubleIPage.getRecords().size() != 0) { |
| | | exportField = FebsUtil.reflectAnnotation(EmpLaborTrouble.class); |
| | | List<Map<String, Object>> allListEmpLaborTrouble = PoiExportExcel.getDataList(exportField, empLaborTroubleIPage.getRecords(), listMapDicItem); |
| | | allList.add(allListEmpLaborTrouble.get(0)); |
| | |
| | | |
| | | //不良记录 |
| | | IPage<EmpBadRecord> empBadRecordIPage = empBadRecordMapper.selectPageVo(page, new QueryWrapper<EmpInsurance>().in("a.empId", empIds).ne("a.delFlag", 1)); |
| | | if (empBadRecordIPage.getRecords().size()!=0){ |
| | | if (empBadRecordIPage.getRecords().size() != 0) { |
| | | exportField = FebsUtil.reflectAnnotation(EmpBadRecord.class); |
| | | List<Map<String, Object>> allListEmpBadRecord = PoiExportExcel.getDataList(exportField, empBadRecordIPage.getRecords(), listMapDicItem); |
| | | allList.add(allListEmpBadRecord.get(0)); |
| | |
| | | |
| | | //备注信息 |
| | | IPage<EmpRemarkInfo> empRemarkInfoIPage = empRemarkInfoMapper.selectPageVo(page, new QueryWrapper<EmpRemarkInfo>().in("a.empId", empIds).ne("a.delFlag", 1)); |
| | | if (empRemarkInfoIPage.getRecords().size()!=0){ |
| | | if (empRemarkInfoIPage.getRecords().size() != 0) { |
| | | exportField = FebsUtil.reflectAnnotation(EmpRemarkInfo.class); |
| | | List<Map<String, Object>> allListEmpRemarkInfo = PoiExportExcel.getDataList(exportField, empRemarkInfoIPage.getRecords(), listMapDicItem); |
| | | allList.add(allListEmpRemarkInfo.get(0)); |
| | |
| | | config: |
| | | server-addr: ${nacos.url}:8848 |
| | | group: DEFAULT_GROUP |
| | | prefix: febs-server-hr |
| | | prefix: febs-server-Hr |
| | | file-extension: yaml |
| | | discovery: |
| | | server-addr: ${nacos.url}:8848 |