| | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | |
| | | @Service |
| | | public class ExportPdfServiceImpl implements ExportPdfService { |
| | |
| | | .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())) |
| | |
| | | } |
| | | 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; |
| | | } |
| | | } |