luoyb
2021-06-18 543941f345319f29f92d9be2529d41868bc3cf80
febs-server/febs-server-hr/src/main/java/cc/mrbird/febs/server/hr/service/impl/EmpBaseInfoServiceImpl.java
@@ -98,6 +98,7 @@
        //设置部门
        // List<EmpBaseInfo> list = setDeptName(iPage.getRecords());
        List<EmpBaseInfo> list = iPage.getRecords();
        List<EmpBaseInfo> newList = new ArrayList<>();
        List<DicItem> dicItems = CastUtil.castList(redisService.get("dicItems"), DicItem.class);
        list.forEach(p -> {
            p.setSexName("1".equals(p.getSex()) ? "男" : "女");
@@ -157,8 +158,23 @@
                    .findFirst()
                    .map(DicItem::getDicItemName)
                    .orElse(""));
            p.setCertificateListName(getCertificateListName(p.getCertificateList(),dicItems));
            p.setCertificateListName(getCertificateListName(p.getCertificateList(), dicItems));
        });
        // if (StringUtils.isNotBlank(empBaseInfo.getCertificateList())) {
        //     String[] certificates = empBaseInfo.getCertificateList().split(",");
        //     list.forEach(k -> {
        //         String[] dbCertificates = k.getCertificateList().split(",");
        //         for (String certificate : certificates) {
        //             if (Arrays.asList(dbCertificates).contains(certificate)) {
        //                 newList.add(k);
        //                 break;
        //             }
        //         }
        //     });
        //     iPage.setRecords(newList);
        // } else {
        //     iPage.setRecords(list);
        // }
        iPage.setRecords(list);
        return iPage;
    }
@@ -1151,8 +1167,8 @@
                @Override
                public void accept(QueryWrapper<EmpBaseInfo> wrapper) {
                    for (int i = 0; i < certificates.length; i++) {
                        String ageBtn = certificates[i];
                        wrapper.or().like("a.certificateList", ageBtn);
                        String ageBtn =  certificates[i] ;
                        wrapper.or().gt("LOCATE('"+ageBtn+"',certificateList)",0);
                    }
                }
            };
@@ -1387,11 +1403,11 @@
    @Override
    public boolean updateSeniority() {
        return empBaseInfoMapper.updateSeniority()>0;
        return empBaseInfoMapper.updateSeniority() > 0;
    }
    @Override
    public boolean updateDeptName() {
        return empBaseInfoMapper.updateDeptName()>0;
        return empBaseInfoMapper.updateDeptName() > 0;
    }
}