luoyb
2021-04-15 df489701802ac39013a2d29c9b6e01e7f905bba7
fix(bug修复): 导出员工信息时相关证件的名称转换
3个文件已修改
33 ■■■■■ 已修改文件
febs-common/febs-common-core/src/main/java/cc/mrbird/febs/common/core/constant/DicCode.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
febs-server/febs-server-hr/src/main/java/cc/mrbird/febs/server/hr/entity/EmpBaseInfo.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
febs-server/febs-server-hr/src/main/java/cc/mrbird/febs/server/hr/service/impl/EmpBaseInfoServiceImpl.java 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
febs-common/febs-common-core/src/main/java/cc/mrbird/febs/common/core/constant/DicCode.java
@@ -86,5 +86,9 @@
    /**
     * 社保档位
     */
    public final static String INSURANCE_GAERS = INSURANCETYPE;
    public final static String INSURANCE_GAERS = "INSURANCETYPE";
    /**
     * 相关证件
     */
    public final static String CERTIFICATE_LIST = "certificateList";
}
febs-server/febs-server-hr/src/main/java/cc/mrbird/febs/server/hr/entity/EmpBaseInfo.java
@@ -296,7 +296,7 @@
    @TableField("certificateList")
    private String certificateList = "";
    //@FieldInfo(name = "certificateListName", type = "varchar", explain = "相关证件")
    @FieldInfo(name = "certificateListName", type = "varchar", explain = "相关证件")
    @TableField(exist = false)
    @ExcelField(value = "相关证件", writeConverterExp = "1=高中毕业证,2=专科毕业证,3=本科毕业证")
    private String certificateListName = "";
febs-server/febs-server-hr/src/main/java/cc/mrbird/febs/server/hr/service/impl/EmpBaseInfoServiceImpl.java
@@ -157,6 +157,7 @@
                    .findFirst()
                    .map(DicItem::getDicItemName)
                    .orElse(""));
            p.setCertificateListName(getCertificateListName(p.getCertificateList(),dicItems));
        });
        iPage.setRecords(list);
        return iPage;
@@ -1331,7 +1332,8 @@
    public boolean verifyCertificateNumb(EmpBaseInfo empBaseInfo) {
        QueryWrapper<EmpBaseInfo> queryWrapper = new QueryWrapper<>();
        queryWrapper.lambda().eq(EmpBaseInfo::getCertificateNumb, empBaseInfo.getCertificateNumb())
                .ne(EmpBaseInfo::getDelFlag, 1);;
                .ne(EmpBaseInfo::getDelFlag, 1);
        ;
        if (empBaseInfo.getEmpId()!=null) {
            queryWrapper.lambda().ne(EmpBaseInfo::getEmpId, empBaseInfo.getEmpId());
        }
@@ -1343,4 +1345,25 @@
    public List<EmpBaseInfo> listAll(QueryWrapper<EmpBaseInfo> wrapper) {
        return this.baseMapper.listAll(wrapper);
    }
    private String getCertificateListName(String certificateList, List<DicItem> dicItems) {
        String tempName;
        List<String> nameList = new ArrayList<>();
        String[] tempList = certificateList.split(",");
        if (tempList.length > 0) {
            for (int i = 0, len = tempList.length; i < len; i++) {
                String tempValue = tempList[i];
                tempName = dicItems.stream()
                        .filter(k -> DicCode.CERTIFICATE_LIST.equals(k.getDicCode()) && k.getDicItemCode().equals(tempValue))
                        .findFirst()
                        .map(DicItem::getDicItemName)
                        .orElse(tempValue);
                nameList.add(tempName);
            }
            tempName = nameList.stream().collect(Collectors.joining(", "));
        } else {
            tempName = "";
        }
        return tempName;
    }
}