luoyb
2021-11-05 6d240fbbf6a47b4125320f26c4f5c537e1493fb6
febs-server/febs-server-hr/src/main/java/cc/mrbird/febs/server/hr/service/impl/ExportPdfServiceImpl.java
@@ -25,6 +25,7 @@
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@Service
public class ExportPdfServiceImpl implements ExportPdfService {
@@ -105,7 +106,7 @@
         }
         //社保档位
         Map<String,String> insuranceGaers = new HashMap<>();
         for (DicItem m:   empAccessoryMapper.getDictType("insuranceGaers")) {
         for (DicItem m:   empAccessoryMapper.getDictType("INSURANCETYPE")) {
            insuranceGaers.put(m.getDicItemCode(),m.getDicItemName());
         }
         //社保是否已经报告
@@ -217,7 +218,7 @@
                  .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.setCertificateListName(getCertificateListName(empBaseInfo.getCertificateList(), certificateList));
            empBaseInfo.setEmpStatusName("0".equals(empBaseInfo.getEmpStatus()) ? "在职" : "离职");
            empBaseInfo.setEntryTypeName(dicItems.stream()
                  .filter(k -> DicCode.IN_OUT_TYPE.equals(k.getDicCode()) && k.getDicItemCode().equals(empBaseInfo.getEntryType()))
@@ -284,7 +285,7 @@
            //入离职记录
         String[] dimissionLog = {  "入职日期", "离职日期", "离职类型", "自离天数", "报备人", "备注"};
         EmpDimissionLog empDimissionLog=new EmpDimissionLog();
         empDimissionLog.setCertificateNumb(empNum);
         empDimissionLog.setEmpId(empBaseInfo.getEmpId());
         empDimissionLog.setEmpStatus(empBaseInfo.getEmpStatus());
         List<Map<String, Object>> records1 = iEmpDimissionLogService.findEmpDimissionLogs(queryRequest, empDimissionLog).getRecords();
         for (Map<String, Object> objectMap:records1){
@@ -408,4 +409,22 @@
      }
      return null;
   }
    private String getCertificateListName(String certificateList, Map<String,String> mapCertificate) {
        String tempName;
        List<String> nameList = new ArrayList<>();
        String[] tempList = certificateList.split(",");
        // certificateList.get(empBaseInfo.getCertificateList()
        if (tempList.length > 0) {
            for (int i = 0, len = tempList.length; i < len; i++) {
                String tempValue = tempList[i];
                tempName = mapCertificate.get(tempValue)==null?tempValue:mapCertificate.get(tempValue);
                nameList.add(tempName);
            }
            tempName = nameList.stream().collect(Collectors.joining(", "));
        } else {
            tempName = "";
        }
        return tempName;
    }
}