luoyb
2021-03-12 a704eb0aced975b55f39d71591ef87f2539e1263
febs-server/febs-server-hr/src/main/java/cc/mrbird/febs/server/hr/service/impl/ExportPdfServiceImpl.java
@@ -1,7 +1,10 @@
package cc.mrbird.febs.server.hr.service.impl;
import cc.mrbird.febs.common.core.constant.DicCode;
import cc.mrbird.febs.common.core.entity.QueryRequest;
import cc.mrbird.febs.common.core.entity.system.DicItem;
import cc.mrbird.febs.common.core.utils.CastUtil;
import cc.mrbird.febs.common.redis.service.RedisService;
import cc.mrbird.febs.server.hr.entity.*;
import cc.mrbird.febs.server.hr.feign.IRemoteDicItemService;
import cc.mrbird.febs.server.hr.mapper.EmpAccessoryMapper;
@@ -59,7 +62,8 @@
   private    IEmpUnemploymentService iEmpUnemploymentService;
   @Autowired
   private    IEmpAccidentCasesService iEmpAccidentCasesService;
   @Autowired
   private  RedisService redisService;
   @Autowired
   private EmpAccessoryMapper empAccessoryMapper;
   @Autowired
@@ -160,10 +164,10 @@
            EDUCATION.put(m.getDicItemCode(),m.getDicItemName());
         }
         //籍贯
         Map<String,String> NATIVEPLACE= new HashMap<>();
         for (DicItem m:    (List<DicItem>)iRemoteDicItemService.dictType("NATIVEPLACE")) {
         /*Map<String,String> NATIVEPLACE= new HashMap<>();
         for (DicItem m:    empAccessoryMapper.getDictType("NATIVEPLACE")) {
            NATIVEPLACE.put(m.getDicItemCode(),m.getDicItemName());
         }
         }*/
         //保险类型
         Map<String,String> INSURANCETYPE= new HashMap<>();
         for (DicItem m:   empAccessoryMapper.getDictType("INSURANCETYPE")) {
@@ -196,7 +200,7 @@
               , "身份证号码"};
         EmpBaseInfo baseInfo=new EmpBaseInfo();
         baseInfo.setCertificateNumb(empNum);
         List<DicItem> dicItems = CastUtil.castList(redisService.get("dicItems"), DicItem.class);
         List<EmpBaseInfo> empBaseInfoList = iEmpBaseInfoService.findEmpBaseInfos(queryRequest, baseInfo).getRecords();
         for (EmpBaseInfo empBaseInfo: empBaseInfoList){
            empBaseInfo.setArchivesStatusName(archivesStatus.get(empBaseInfo.getArchivesStatus()==null?"":empBaseInfo.getArchivesStatus()));
@@ -206,10 +210,20 @@
            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.setNativePlaceName(dicItems.stream()
                  .filter(k -> DicCode.NATIVEPLACE.equals(k.getDicCode()) && k.getDicItemCode().equals(empBaseInfo.getNativePlace()==null?"":empBaseInfo.getNativePlace()))
                  .findFirst()
                  .map(DicItem::getDicItemName)
                  .orElse(""));
            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()));
            empBaseInfo.setEmpStatusName("0".equals(empBaseInfo.getEmpStatus()) ? "在职" : "离职");
            empBaseInfo.setEntryTypeName(dicItems.stream()
                  .filter(k -> DicCode.IN_OUT_TYPE.equals(k.getDicCode()) && k.getDicItemCode().equals(empBaseInfo.getEntryType()))
                  .findFirst()
                  .map(DicItem::getDicItemName)
                  .orElse(""));
         }
         //工作经历
         String[] workhead = { "开始时间", "结束时间", "工作单位", "主要工作内容"};
@@ -219,7 +233,7 @@
         
         List<EmpWorkExperience> empWorkExperiences1 = iEmpWorkExperienceService.findEmpWorkExperiences(queryRequest, empWorkExperiences).getRecords();
         //体检信息
         String[] empPhysicalhead = { "体检医院", "体检日期", "体检类型", "血压", "转氨酶", "心电图", "体检结论", "复查记录", "备注"};
         String[] empPhysicalhead = {  "体检医院", "体检日期", "体检类型", "血压", "转氨酶", "心电图", "体检结论", "复查日期", "备注"};
         EmpPhysicalExam empPhysicalExam=new EmpPhysicalExam();
         empPhysicalExam.setCertificateNumb(empNum);
         
@@ -228,7 +242,7 @@
            empPhysicalExam1.setPhysicalExamTypeName(physicalExamType.get(empPhysicalExam1.getPhysicalExamType()==null?"":empPhysicalExam1.getPhysicalExamType()));
         }
         //合同信息
         String[] empContractInfo = { "合同签订日期", "合同结束日期", "合同期限(年)", "合同状态", "合同办理人"};
         String[] empContractInfo = {  "合同签订日期", "合同结束日期", "合同期限(年)", "合同状态", "合同办理人","备注"};
         EmpContractInfo empContractInfo1=new EmpContractInfo();
         empContractInfo1.setCertificateNumb(empNum);
         
@@ -237,7 +251,7 @@
            empCon.setContractStatusName(contractstatus.get(empCon.getContractStatus()==null?"":empCon.getContractStatus()));
         }
         //调岗记录
         String[] empJobChange = { "现部门", "现岗位", "姓名", "原部门", "原岗位", "调岗日期", "调岗类型"};
         String[] empJobChange = {  "现部门", "现岗位", "姓名", "原部门", "原岗位", "调岗日期", "调岗类型"};
         EmpJobChange empJobChange1=new EmpJobChange();
         empJobChange1.setCertificateNumb(empNum);
         
@@ -246,7 +260,7 @@
            map.put("changeType",changeType.get(map.get("changeType")==null?"":map.get("changeType").toString()));
         }
         //请假记录
         String[] leaveInfo = { "开始时间", "结束时间", "请假天数", "请假类型", "到岗时间", "报备人", "备注"};
         String[] leaveInfo = {  "开始时间", "结束时间", "请假天数", "请假类型", "到岗时间", "报备人", "备注"};
         EmpLeaveInfo empLeaveInfo=new EmpLeaveInfo();
         empLeaveInfo.setCertificateNumb(empNum);
         
@@ -255,19 +269,19 @@
            leaveInfo1.setLeaveTypeName(leavetype.get(leaveInfo1.getLeaveType()==null?"":leaveInfo1.getLeaveType()));
         }
         //辞职申请
         String[] resign = { "辞职申请日期", "辞职事由", "汇报人", "备注"};
         String[] resign = {  "辞职申请日期", "辞职事由", "汇报人", "备注"};
         EmpResign empResign=new EmpResign();
         empResign.setCertificateNumb(empNum);
         
         List<EmpResign> empResigns = iEmpResignService.findEmpResigns(queryRequest, empResign).getRecords();
         //离职当月考勤
         String[] dimissionAttend = { "离职考勤月份", "出勤天数", "加班(天)", "加班(小时)", "有无代扣款项", "请假(天)", "旷工(天)", "备注"};
         String[] dimissionAttend = {  "离职考勤月份", "出勤天数", "加班(天)", "加班(小时)", "有无代扣款项", "请假(天)", "旷工(天)", "备注"};
         EmpDimissionAttend empDimissionAttend=new EmpDimissionAttend();
         empDimissionAttend.setCertificateNumb(empNum);
         
         List<EmpDimissionAttend> dimissionAttends = iEmpDimissionAttendService.findEmpDimissionattends(queryRequest, empDimissionAttend).getRecords();
            //入离职记录
         String[] dimissionLog = { "入职日期", "离职日期", "离职类型", "自离天数", "报备人", "备注"};
         String[] dimissionLog = {  "入职日期", "离职日期", "离职类型", "自离天数", "报备人", "备注"};
         EmpDimissionLog empDimissionLog=new EmpDimissionLog();
         empDimissionLog.setCertificateNumb(empNum);
         
@@ -276,13 +290,13 @@
            objectMap.put("dimissionType",lztype.get(objectMap.get("dimissionType")==null?"":objectMap.get("dimissionType").toString()));
         }
         //失业金领取
         String[] unemployment = { "失业金申请日期", "申报事由", "汇报人", "审核人", "备注"};
         String[] unemployment = {  "失业金申请日期", "申报事由", "汇报人", "审核人", "备注"};
         EmpUnemployment empUnemployment=new EmpUnemployment();
         empUnemployment.setCertificateNumb(empNum);
         
         List<EmpUnemployment> empUnemployments = iEmpUnemploymentService.findEmpUnemployments(queryRequest, empUnemployment).getRecords();
           //社保申请
         String[] insurance = { "社保申请日期", "申请人", "社保档位", "是否已报告", "状态", "审核人", "备注"};
         String[] insurance = {  "社保申请日期", "申请人", "社保档位", "是否已报告", "状态", "审核人", "备注"};
         EmpInsurance empInsurance=new EmpInsurance();
         empInsurance.setCertificateNumb(empNum);
         
@@ -293,41 +307,43 @@
            leaveInfo1.setApplayStatusName(applayStatus.get(leaveInfo1.getApplayStatus()==null?"":String.valueOf(leaveInfo1.getApplayStatus())));
         }
         //意外险案件
         String[] accidentCases = { "受伤日期", "受伤地点", "受伤部位", "受伤经过描述", "意外险诊断", "就诊医院", "是否住院", "床号", "报案时间", "递交资料时间", "递交人", "医疗总费用", "保险赔付费用"};
         String[] accidentCases = {  "受伤日期", "受伤地点", "受伤部位", "受伤经过描述", "意外险诊断", "就诊医院", "是否住院", "床号", "报案时间", "递交资料时间", "递交人", "医疗总费用", "保险赔付费用", "是否结案"};
         EmpAccidentCases empAccidentCases=new EmpAccidentCases();
         empAccidentCases.setCertificateNumb(empNum);
         
         List<EmpAccidentCases> empAccidentCases1 = iEmpAccidentCasesService.findEmpAccidentcasess(queryRequest, empAccidentCases).getRecords();
         for (EmpAccidentCases leaveInfo1:empAccidentCases1){
            leaveInfo1.setHospitalizatioFlagName(hospitalizatioFlag.get(leaveInfo1.getHospitalizatioFlag()==null?"":leaveInfo1.getHospitalizatioFlag()));
            leaveInfo1.setHospitalizatioFlagName(hospitalizatioFlag.get(leaveInfo1.getHospitalizatioFlag()==null?"":leaveInfo1.getHospitalizatioFlag().toString()));
            leaveInfo1.setSettleStatusName(settleStatus.get(leaveInfo1.getSettleStatus()==null?"":leaveInfo1.getSettleStatus().toString()));
         }
         //工伤案件
         String[] occupational = { "受伤日期", "受伤地点", "受伤部位", "受伤经过描述", "工伤诊断", "就诊医院", "就诊科室", "是否住院", "床号", "报案时间", "递交资料时间", "递交人", "医疗总费用", "已赔付医药费用"};
         String[] occupational = {  "受伤日期", "受伤地点", "受伤部位", "受伤经过描述", "工伤诊断", "就诊医院", "就诊科室", "是否住院", "床号", "报案时间", "递交资料时间", "递交人", "医疗总费用", "已赔付医药费用", "是否结案"};
         EmpOccupational empOccupational=new EmpOccupational();
         empOccupational.setCertificateNumb(empNum);
         
         List<EmpOccupational> empOccupationals = iEmpOccupationalService.findEmpOccupationals(queryRequest, empOccupational).getRecords();
         for (EmpOccupational leaveInfo1:empOccupationals){
            leaveInfo1.setHospitalizatioFlagName(hospitalizatioFlag.get(leaveInfo1.getHospitalizatioFlag()==null?"":leaveInfo1.getHospitalizatioFlag()));
            leaveInfo1.setHospitalizatioFlagName(hospitalizatioFlag.get(leaveInfo1.getHospitalizatioFlag()==null?"":leaveInfo1.getHospitalizatioFlag().toString()));
            leaveInfo1.setSettleStatusName(settleStatus.get(leaveInfo1.getSettleStatus()==null?"":leaveInfo1.getSettleStatus().toString()));
         }
         //劳资案件
         String[] laborTrouble = { "仲裁日期", "仲裁类型", "仲裁事由", "报备人", "备注", "仲裁赔付(元)", "状态", "案结日期"};
         String[] laborTrouble = {  "仲裁日期", "仲裁类型", "仲裁事由", "报备人", "备注", "仲裁赔付(元)", "是否结案", "案结日期"};
         EmpLaborTrouble empLaborTrouble=new EmpLaborTrouble();
         empLaborTrouble.setCertificateNumb(empNum);
         
         List<EmpLaborTrouble> empLaborTroubles = iEmpLaborTroubleService.findEmpLabortroubles(queryRequest, empLaborTrouble).getRecords();
         for (EmpLaborTrouble leaveInfo1:empLaborTroubles){
            leaveInfo1.setArbitrationTypeName(zctype.get(leaveInfo1.getArbitrationType()==null?"":leaveInfo1.getArbitrationType()));
            leaveInfo1.setArbitrationStatusName(reportStatus.get(leaveInfo1.getArbitrationStatus()==null?"":String.valueOf(leaveInfo1.getArbitrationStatus())));
            leaveInfo1.setArbitrationStatusName(settleStatus.get(leaveInfo1.getArbitrationStatus()==null?"":String.valueOf(leaveInfo1.getArbitrationStatus())));
         }
         //不良记录
         String[] badRecord = { "不良记录日期", "不良记录描述", "汇报人", "备注"};
         String[] badRecord = {  "不良记录日期", "不良记录描述", "汇报人", "备注"};
         EmpBadRecord empBadRecord=new EmpBadRecord();
         empBadRecord.setCertificateNumb(empNum);
         
         List<EmpBadRecord> empBadRecords = iEmpBadRecordService.findEmpBadrecords(queryRequest, empBadRecord).getRecords();
         //备注
         String[] remarkInfo = { "备注日期", "备注信息"};
         String[] remarkInfo = {  "备注日期", "备注信息"};
         EmpRemarkInfo empRemarkInfo=new EmpRemarkInfo();
         empRemarkInfo.setCertificateNumb(empNum);