luoyb
2021-03-08 bfeab0c9d94480f4e742d311d168c79572b78745
febs-server/febs-server-hr/src/main/java/cc/mrbird/febs/server/hr/service/impl/ExportPdfServiceImpl.java
@@ -4,6 +4,7 @@
import cc.mrbird.febs.common.core.entity.system.DicItem;
import cc.mrbird.febs.server.hr.entity.*;
import cc.mrbird.febs.server.hr.feign.IRemoteDicItemService;
import cc.mrbird.febs.server.hr.mapper.EmpAccessoryMapper;
import cc.mrbird.febs.server.hr.po.AvailableResult;
import cc.mrbird.febs.server.hr.po.User;
import cc.mrbird.febs.server.hr.service.*;
@@ -60,6 +61,8 @@
   private    IEmpAccidentCasesService iEmpAccidentCasesService;
   @Autowired
   private EmpAccessoryMapper empAccessoryMapper;
   @Autowired
         private IRemoteDicItemService iRemoteDicItemService;
   Logger logger = LoggerFactory.getLogger(ExportPdfServiceImpl.class);
   @Override
@@ -67,92 +70,93 @@
      try {
         //体检类型
         Map<String,String> physicalExamType = new HashMap<>();
         for (DicItem m:    (List<DicItem>)iRemoteDicItemService.dictType("PHYSICALEXAMTYPE")) {
         List<DicItem> list=empAccessoryMapper.getDictType("PHYSICALEXAMTYPE");
         for (DicItem m:    list) {
            physicalExamType.put(m.getDicItemCode(),m.getDicItemName());
         }
         //心电图
         Map<String,String> ecg = new HashMap<>();
         for (DicItem m:    (List<DicItem>)iRemoteDicItemService.dictType("ECG")) {
         for (DicItem m:    empAccessoryMapper.getDictType("ECG")) {
            ecg.put(m.getDicItemCode(),m.getDicItemName());
         }
         //合同状态
         Map<String,String> contractstatus = new HashMap<>();
         for (DicItem m:    (List<DicItem>)iRemoteDicItemService.dictType("CONTRACTSTATUS")) {
         for (DicItem m:  empAccessoryMapper.getDictType("CONTRACTSTATUS")) {
            contractstatus.put(m.getDicItemCode(),m.getDicItemName());
         }
         //调岗类型
         Map<String,String> changeType = new HashMap<>();
         for (DicItem m:    (List<DicItem>)iRemoteDicItemService.dictType("changeType")) {
         for (DicItem m:  empAccessoryMapper.getDictType("changeType")) {
            changeType.put(m.getDicItemCode(),m.getDicItemName());
         }
         //请假类型
         Map<String,String> leavetype = new HashMap<>();
         for (DicItem m:    (List<DicItem>)iRemoteDicItemService.dictType("LEAVETYPE")) {
         for (DicItem m:   empAccessoryMapper.getDictType("LEAVETYPE")) {
            leavetype.put(m.getDicItemCode(),m.getDicItemName());
         }
         //入离职类型
         Map<String,String> lztype = new HashMap<>();
         for (DicItem m:    (List<DicItem>)iRemoteDicItemService.dictType("LZTYPE")) {
         for (DicItem m:   empAccessoryMapper.getDictType("LZTYPE")) {
            lztype.put(m.getDicItemCode(),m.getDicItemName());
         }
         //社保档位
         Map<String,String> insuranceGaers = new HashMap<>();
         for (DicItem m:    (List<DicItem>)iRemoteDicItemService.dictType("insuranceGaers")) {
         for (DicItem m:   empAccessoryMapper.getDictType("insuranceGaers")) {
            insuranceGaers.put(m.getDicItemCode(),m.getDicItemName());
         }
         //社保是否已经报告
         Map<String,String> reportStatus = new HashMap<>();
         for (DicItem m:    (List<DicItem>)iRemoteDicItemService.dictType("reportStatus")) {
         for (DicItem m:  empAccessoryMapper.getDictType("reportStatus")) {
            reportStatus.put(m.getDicItemCode(),m.getDicItemName());
         }
         //社保状态
         Map<String,String> applayStatus = new HashMap<>();
         for (DicItem m:    (List<DicItem>)iRemoteDicItemService.dictType("applayStatus")) {
         for (DicItem m:  empAccessoryMapper.getDictType("applayStatus")) {
            applayStatus.put(m.getDicItemCode(),m.getDicItemName());
         }
         //是否住院
         Map<String,String> hospitalizatioFlag = new HashMap<>();
         for (DicItem m:    (List<DicItem>)iRemoteDicItemService.dictType("hospitalizatioFlag")) {
         for (DicItem m:  empAccessoryMapper.getDictType("hospitalizatioFlag")) {
            hospitalizatioFlag.put(m.getDicItemCode(),m.getDicItemName());
         }
         //仲裁类型
         Map<String,String> zctype = new HashMap<>();
         for (DicItem m:    (List<DicItem>)iRemoteDicItemService.dictType("ZCTYPE")) {
         for (DicItem m:  empAccessoryMapper.getDictType("ZCTYPE")) {
            zctype.put(m.getDicItemCode(),m.getDicItemName());
         }
         //结案状态
         Map<String,String> settleStatus = new HashMap<>();
         for (DicItem m:    (List<DicItem>)iRemoteDicItemService.dictType("settleStatus")) {
         for (DicItem m:   empAccessoryMapper.getDictType("settleStatus")) {
            settleStatus.put(m.getDicItemCode(),m.getDicItemName());
         }
         //性别
         Map<String,String> sex = new HashMap<>();
         for (DicItem m:    (List<DicItem>)iRemoteDicItemService.dictType("sex")) {
         for (DicItem m:  empAccessoryMapper.getDictType("sex")) {
            sex.put(m.getDicItemCode(),m.getDicItemName());
         }
         //员工类别
         Map<String,String> empType = new HashMap<>();
         for (DicItem m:    (List<DicItem>)iRemoteDicItemService.dictType("EMPTYPE")) {
         for (DicItem m:  empAccessoryMapper.getDictType("EMPTYPE")) {
            empType.put(m.getDicItemCode(),m.getDicItemName());
         }
         //民族
         Map<String,String> NATION = new HashMap<>();
         for (DicItem m:    (List<DicItem>)iRemoteDicItemService.dictType("NATION")) {
         for (DicItem m:  empAccessoryMapper.getDictType("NATION")) {
            NATION.put(m.getDicItemCode(),m.getDicItemName());
         }
         //婚姻状态
         Map<String,String> MARRIAGE = new HashMap<>();
         for (DicItem m:    (List<DicItem>)iRemoteDicItemService.dictType("MARRIAGE")) {
         for (DicItem m:  empAccessoryMapper.getDictType("MARRIAGE")) {
            MARRIAGE.put(m.getDicItemCode(),m.getDicItemName());
         }
         //政治面貌
         Map<String,String> PLITICAL = new HashMap<>();
         for (DicItem m:    (List<DicItem>)iRemoteDicItemService.dictType("PLITICAL")) {
         for (DicItem m:  empAccessoryMapper.getDictType("PLITICAL")) {
            PLITICAL.put(m.getDicItemCode(),m.getDicItemName());
         }
         //最高学历
         Map<String,String> EDUCATION= new HashMap<>();
         for (DicItem m:    (List<DicItem>)iRemoteDicItemService.dictType("EDUCATION")) {
         for (DicItem m:  empAccessoryMapper.getDictType("EDUCATION") ) {
            EDUCATION.put(m.getDicItemCode(),m.getDicItemName());
         }
         //籍贯
@@ -162,17 +166,17 @@
         }*/
         //保险类型
         Map<String,String> INSURANCETYPE= new HashMap<>();
         for (DicItem m:    (List<DicItem>)iRemoteDicItemService.dictType("INSURANCETYPE")) {
         for (DicItem m:   empAccessoryMapper.getDictType("INSURANCETYPE")) {
            INSURANCETYPE.put(m.getDicItemCode(),m.getDicItemName());
         }
         //员工手册
         Map<String,String> handbookStatus= new HashMap<>();
         for (DicItem m:    (List<DicItem>)iRemoteDicItemService.dictType("handbookStatus")) {
         for (DicItem m:  empAccessoryMapper.getDictType("handbookStatus") ) {
            handbookStatus.put(m.getDicItemCode(),m.getDicItemName());
         }
         //相关证件
         Map<String,String> certificateList= new HashMap<>();
         for (DicItem m:    (List<DicItem>)iRemoteDicItemService.dictType("certificateList")) {
         for (DicItem m:  empAccessoryMapper.getDictType("certificateList")) {
            certificateList.put(m.getDicItemCode(),m.getDicItemName());
         }
         logger.info(">>>>>>>>>>开始导出pdf>>>>>>>>>>");
@@ -189,16 +193,16 @@
         
         List<EmpBaseInfo> empBaseInfoList = iEmpBaseInfoService.findEmpBaseInfos(queryRequest, baseInfo).getRecords();
         for (EmpBaseInfo empBaseInfo: empBaseInfoList){
            empBaseInfo.setSexName(sex.get(empBaseInfo.getSex()));
            empBaseInfo.setEmpTypeName(empType.get(empBaseInfo.getEmpType()));
            empBaseInfo.setNationName(NATION.get(empBaseInfo.getNation()));
            empBaseInfo.setMarriageName(MARRIAGE.get(empBaseInfo.getMarriage()));
            empBaseInfo.setPoliticsName(PLITICAL.get(empBaseInfo.getPolitics()));
            empBaseInfo.setEducationName(EDUCATION.get(empBaseInfo.getEducation()));
            empBaseInfo.setNativePlaceName(NATIVEPLACE.get(empBaseInfo.getNativePlace()));
            empBaseInfo.setInsuranceTypeName(INSURANCETYPE.get(empBaseInfo.getInsuranceType()));
            empBaseInfo.setHandbookStatusName(handbookStatus.get(empBaseInfo.getHandbookStatus()));
            empBaseInfo.setCertificateListName(certificateList.get(empBaseInfo.getCertificateList()));
            empBaseInfo.setSexName(sex.get(empBaseInfo.getSex()==null?"":empBaseInfo.getSex()));
            empBaseInfo.setEmpTypeName(empType.get(empBaseInfo.getEmpType()==null?"":empBaseInfo.getEmpType()));
            empBaseInfo.setNationName(NATION.get(empBaseInfo.getNation()==null?"":empBaseInfo.getNation()));
            empBaseInfo.setMarriageName(MARRIAGE.get(empBaseInfo.getMarriage()==null?"":empBaseInfo.getMarriage()));
            empBaseInfo.setPoliticsName(PLITICAL.get(empBaseInfo.getPolitics()==null?"":empBaseInfo.getPolitics()));
            empBaseInfo.setEducationName(EDUCATION.get(empBaseInfo.getEducation()==null?"":empBaseInfo.getEducation()));
            empBaseInfo.setNativePlaceName(NATIVEPLACE.get(empBaseInfo.getNativePlace()==null?"":empBaseInfo.getNativePlace()));
            empBaseInfo.setInsuranceTypeName(INSURANCETYPE.get(empBaseInfo.getInsuranceType()==null?"":empBaseInfo.getInsuranceType()));
            empBaseInfo.setHandbookStatusName(handbookStatus.get(empBaseInfo.getHandbookStatus()==null?"":empBaseInfo.getHandbookStatus()));
            empBaseInfo.setCertificateListName(certificateList.get(empBaseInfo.getCertificateList()==null?"":empBaseInfo.getCertificateList()));
         }
         //工作经历
         String[] workhead = { "开始时间", "结束时间", "工作单位", "主要工作内容"};
@@ -214,7 +218,7 @@
         
         List<EmpPhysicalExam> records = iEmpPhysicalExamService.findEmpPhysicalExams(queryRequest, empPhysicalExam).getRecords();
         for (EmpPhysicalExam empPhysicalExam1:records){
            empPhysicalExam1.setPhysicalExamTypeName(physicalExamType.get(empPhysicalExam1.getPhysicalExamType()));
            empPhysicalExam1.setPhysicalExamTypeName(physicalExamType.get(empPhysicalExam1.getPhysicalExamType()==null?"":empPhysicalExam1.getPhysicalExamType()));
         }
         //合同信息
         String[] empContractInfo = { "合同签订日期", "合同结束日期", "合同期限(年)", "合同状态", "合同办理人"};
@@ -223,7 +227,7 @@
         
         List<EmpContractInfo> empContractInfos = iEmpContractInfoService.findEmpContractinfos(queryRequest, empContractInfo1).getRecords();
         for (EmpContractInfo empCon:empContractInfos){
            empCon.setContractStatusName(contractstatus.get(empCon.getContractStatus()));
            empCon.setContractStatusName(contractstatus.get(empCon.getContractStatus()==null?"":empCon.getContractStatus()));
         }
         //调岗记录
         String[] empJobChange = { "现部门", "现岗位", "姓名", "原部门", "原岗位", "调岗日期", "调岗类型"};
@@ -232,7 +236,7 @@
         
         List<Map<String, Object>> empJobChangeList = iEmpJobChangeService.findEmpJobChanges(queryRequest, empJobChange1).getRecords();
         for (Map<String, Object> map:empJobChangeList){
            map.put("changeType",changeType.get(map.get("changeType")).toString());
            map.put("changeType",changeType.get(map.get("changeType")==null?"":map.get("changeType").toString()));
         }
         //请假记录
         String[] leaveInfo = { "开始时间", "结束时间", "请假天数", "请假类型", "到岗时间", "报备人", "备注"};
@@ -241,7 +245,7 @@
         
         List<EmpLeaveInfo> empLeaveInfos = iEmpLeaveInfoService.findEmpLeaveInfos(queryRequest, empLeaveInfo).getRecords();
         for (EmpLeaveInfo leaveInfo1:empLeaveInfos){
            leaveInfo1.setLeaveTypeName(leavetype.get(leaveInfo1.getLeaveType()));
            leaveInfo1.setLeaveTypeName(leavetype.get(leaveInfo1.getLeaveType()==null?"":leaveInfo1.getLeaveType()));
         }
         //辞职申请
         String[] resign = { "辞职申请日期", "辞职事由", "汇报人", "备注"};
@@ -262,7 +266,7 @@
         
         List<Map<String, Object>> records1 = iEmpDimissionLogService.findEmpDimissionLogs(queryRequest, empDimissionLog).getRecords();
         for (Map<String, Object> objectMap:records1){
            objectMap.put("dimissionType",lztype.get(objectMap.get("dimissionType")).toString());
            objectMap.put("dimissionType",lztype.get(objectMap.get("dimissionType")==null?"":objectMap.get("dimissionType").toString()));
         }
         //失业金领取
         String[] unemployment = { "失业金申请日期", "申报事由", "汇报人", "审核人", "备注"};
@@ -277,9 +281,9 @@
         
         List<EmpInsurance> empInsurances = iEmpInsuranceService.findEmpInsurances(queryRequest, empInsurance).getRecords();
         for (EmpInsurance leaveInfo1:empInsurances){
            leaveInfo1.setInsuranceGaers(insuranceGaers.get(leaveInfo1.getInsuranceGaers()));
            leaveInfo1.setReportStatusName(reportStatus.get(String.valueOf(leaveInfo1.getReportStatus())));
            leaveInfo1.setApplayStatusName(applayStatus.get(String.valueOf(leaveInfo1.getApplayStatus())));
            leaveInfo1.setInsuranceGaers(insuranceGaers.get(leaveInfo1.getInsuranceGaers()==null?"":leaveInfo1.getInsuranceGaers()));
            leaveInfo1.setReportStatusName(reportStatus.get(leaveInfo1.getReportStatus()==null?"":String.valueOf(leaveInfo1.getReportStatus())));
            leaveInfo1.setApplayStatusName(applayStatus.get(leaveInfo1.getApplayStatus()==null?"":String.valueOf(leaveInfo1.getApplayStatus())));
         }
         //意外险案件
         String[] accidentCases = { "受伤日期", "受伤地点", "受伤部位", "受伤经过描述", "意外险诊断", "就诊医院", "是否住院", "床号", "报案时间", "递交资料时间", "递交人", "医疗总费用", "保险赔付费用"};
@@ -288,7 +292,7 @@
         
         List<EmpAccidentCases> empAccidentCases1 = iEmpAccidentCasesService.findEmpAccidentcasess(queryRequest, empAccidentCases).getRecords();
         for (EmpAccidentCases leaveInfo1:empAccidentCases1){
            leaveInfo1.setHospitalizatioFlagName(hospitalizatioFlag.get(leaveInfo1.getHospitalizatioFlag()));
            leaveInfo1.setHospitalizatioFlagName(hospitalizatioFlag.get(leaveInfo1.getHospitalizatioFlag()==null?"":leaveInfo1.getHospitalizatioFlag()));
         }
         //工伤案件
         String[] occupational = { "受伤日期", "受伤地点", "受伤部位", "受伤经过描述", "工伤诊断", "就诊医院", "就诊科室", "是否住院", "床号", "报案时间", "递交资料时间", "递交人", "医疗总费用", "已赔付医药费用"};
@@ -297,7 +301,7 @@
         
         List<EmpOccupational> empOccupationals = iEmpOccupationalService.findEmpOccupationals(queryRequest, empOccupational).getRecords();
         for (EmpOccupational leaveInfo1:empOccupationals){
            leaveInfo1.setHospitalizatioFlagName(hospitalizatioFlag.get(leaveInfo1.getHospitalizatioFlag()));
            leaveInfo1.setHospitalizatioFlagName(hospitalizatioFlag.get(leaveInfo1.getHospitalizatioFlag()==null?"":leaveInfo1.getHospitalizatioFlag()));
         }
         //劳资案件
         String[] laborTrouble = { "仲裁日期", "仲裁类型", "仲裁事由", "报备人", "备注", "仲裁赔付(元)", "状态", "案结日期"};
@@ -306,8 +310,8 @@
         
         List<EmpLaborTrouble> empLaborTroubles = iEmpLaborTroubleService.findEmpLabortroubles(queryRequest, empLaborTrouble).getRecords();
         for (EmpLaborTrouble leaveInfo1:empLaborTroubles){
            leaveInfo1.setArbitrationTypeName(zctype.get(leaveInfo1.getArbitrationType()));
            leaveInfo1.setArbitrationStatusName(reportStatus.get(String.valueOf(leaveInfo1.getArbitrationStatus())));
            leaveInfo1.setArbitrationTypeName(zctype.get(leaveInfo1.getArbitrationType()==null?"":leaveInfo1.getArbitrationType()));
            leaveInfo1.setArbitrationStatusName(reportStatus.get(leaveInfo1.getArbitrationStatus()==null?"":String.valueOf(leaveInfo1.getArbitrationStatus())));
         }
         //不良记录
         String[] badRecord = { "不良记录日期", "不良记录描述", "汇报人", "备注"};