febs-server/febs-server-hr/src/main/java/cc/mrbird/febs/server/hr/service/impl/EmpBaseInfoServiceImpl.java
@@ -23,11 +23,12 @@
import cc.mrbird.febs.server.hr.service.IEmpJobChangeService;
import cc.mrbird.febs.server.hr.util.PoiExportExcel;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.collection.ListUtil;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.IdcardUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@@ -93,17 +94,18 @@
    @Override
    public IPage<EmpBaseInfo> findZsEmpBaseInfos(QueryRequest request, EmpBaseInfo empBaseInfo) {
        Page<EmpBaseInfo> page = new Page<>(request.getPageNum(), request.getPageSize());
        SortUtil.handlePageSort(request, page, "createTime", FebsConstant.ORDER_DESC, true);
        SortUtil.handlePageSort(request, page, "entryDate", FebsConstant.ORDER_ASC, true);
        IPage<EmpBaseInfo> iPage = empBaseInfoMapper.selectPageVo(page, createQueryWrapper(empBaseInfo));
        //设置部门
        // 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()) ? "男" : "女");
            p.setArchivesStatusName("0".equals(p.getArchivesStatus()) ? "未移交" : "已移交");
            p.setEmpCardStatusName("1".equals(p.getEmpCardStatus()) ? "未发" : "已发");
            p.setHandbookStatusName("1".equals(p.getHandbookStatus()) ? "未发" : "已发");
            p.setEmpCardStatusName("0".equals(p.getEmpCardStatus()) ? "未发" : "已发");
            p.setHandbookStatusName("0".equals(p.getHandbookStatus()) ? "未发" : "已发");
            p.setEmpStatusName("0".equals(p.getEmpStatus()) ? "在职" : "离职");
            //保险类型
            p.setInsuranceTypeName(dicItems.stream()
@@ -157,7 +159,23 @@
                    .findFirst()
                    .map(DicItem::getDicItemName)
                    .orElse(""));
            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;
    }
@@ -174,8 +192,11 @@
    public void createEmpBaseInfo(EmpBaseInfo empBaseInfo) {
        String operatorId = Optional.of(FebsUtil.getUserId()).orElse("1");
        EmpBaseInfo dbInfo = this.getEmpBaseInfo(empBaseInfo);
        Long empId = SequenceUtil.generateId(0L, ModuleCode.HR_EMPLOYEE);
        boolean saveDimissionLog = true;
        if (dbInfo == null) {
            empBaseInfo.setEmpId(SequenceUtil.generateId(0L, ModuleCode.HR_EMPLOYEE));
            empBaseInfo.setEmpId(empId);
            // saveDimissionLog = true;
        } else {
            empBaseInfo.setEmpId(dbInfo.getEmpId());
        }
@@ -189,13 +210,40 @@
        empBaseInfo.setCreator(operatorId);
        empBaseInfo.setModifier(operatorId);
        this.saveOrUpdate(empBaseInfo);
        addEmpDimissLog(empBaseInfo, operatorId, empId);
    }
    /**
     * 增加员工后同步增加入职记录
     * <p>
     * date 2021-07-30 09:12
     *
     * @param empBaseInfo 员工信息
     * @param operatorId  操作员Id
     * @param empId       员工Id
     * @return void
     * @author: luoyibo
     */
    private void addEmpDimissLog(EmpBaseInfo empBaseInfo, String operatorId, Long empId) {
        EmpDimissionLog dimissionLog = new EmpDimissionLog();
        dimissionLog.setCloseId(SequenceUtil.generateId(0L, ModuleCode.HR_EMPLOYEE));
        dimissionLog.setEmpId(empId);
        dimissionLog.setEntryDate(empBaseInfo.getEntryDate());
        dimissionLog.setDimissionType("20");
        dimissionLog.setRemark(empBaseInfo.getRemark());
        dimissionLog.setDeptName(empBaseInfo.getAllDeptName());
        dimissionLog.setCreator(operatorId);
        dimissionLog.setModifier(operatorId);
        dimissionLogService.save(dimissionLog);
    }
    @Override
    @Transactional(rollbackFor = Exception.class)
    public void updateEmpBaseInfo(EmpBaseInfo empBaseInfo) {
        String operatorId = Optional.of(FebsUtil.getUserId()).orElse("1");
        if (StrUtil.isNotBlank(empBaseInfo.getImagePath())) {
        if (StrUtil.isNotBlank(empBaseInfo.getImagePath()) && empBaseInfo.getImagePath().indexOf(",") > 0) {
            String path = properties.getEmpBaseInfoPath() + empBaseInfo.getEmpId() + ".png";
            if (MyUtil.generateImage(empBaseInfo.getImagePath(), path)) {
                empBaseInfo.setImagePath(empBaseInfo.getEmpId() + ".png");
@@ -208,10 +256,10 @@
        empBaseInfo.setDelFlag(dbData.getDelFlag());
        empBaseInfo.setModifyTime(new Date());
        empBaseInfo.setModifier(operatorId);
        if(StringUtils.isBlank(empBaseInfo.getImagePath())){
        if (StringUtils.isBlank(empBaseInfo.getImagePath())) {
            empBaseInfo.setImagePath(dbData.getImagePath());
        }
        if(StringUtils.isBlank(empBaseInfo.getAllDeptName())){
        if (StringUtils.isBlank(empBaseInfo.getAllDeptName())) {
            empBaseInfo.setAllDeptName(dbData.getAllDeptName());
        }
        this.saveOrUpdate(empBaseInfo);
@@ -244,22 +292,22 @@
        //同步删除关联数据
        //不良记录
        empBadRecordMapper.logicDelByUserIds(list,operatorId);
        empAccidentCasesMapper.logicDelByUserIds(list,operatorId);
        empContractInfoMapper.logicDelByUserIds(list,operatorId);
        empDimissionAttendMapper.logicDelByUserIds(list,operatorId);
        empDimissionLogMapper.logicDelByUserIds(list,operatorId);
        empInsuranceMapper.logicDelByUserIds(list,operatorId);
        empJobChangeMapper.logicDelByUserIds(list,operatorId);
        empLaborTroubleMapper.logicDelByUserIds(list,operatorId);
        empLeaveInfoMapper.logicDelByUserIds(list,operatorId);
        empOccupationalMapper.logicDelByUserIds(list,operatorId);
        empOpenArchivesMapper.logicDelByUserIds(list,operatorId);
        empPhysicalExamMapper.logicDelByUserIds(list,operatorId);
        empRemarkInfoMapper.logicDelByUserIds(list,operatorId);
        empResignMapper.logicDelByUserIds(list,operatorId);
        empUnemploymentMapper.logicDelByUserIds(list,operatorId);
        empWorkExperienceMapper.logicDelByUserIds(list,operatorId);
        empBadRecordMapper.logicDelByUserIds(list, operatorId);
        empAccidentCasesMapper.logicDelByUserIds(list, operatorId);
        empContractInfoMapper.logicDelByUserIds(list, operatorId);
        empDimissionAttendMapper.logicDelByUserIds(list, operatorId);
        empDimissionLogMapper.logicDelByUserIds(list, operatorId);
        empInsuranceMapper.logicDelByUserIds(list, operatorId);
        empJobChangeMapper.logicDelByUserIds(list, operatorId);
        empLaborTroubleMapper.logicDelByUserIds(list, operatorId);
        empLeaveInfoMapper.logicDelByUserIds(list, operatorId);
        empOccupationalMapper.logicDelByUserIds(list, operatorId);
        empOpenArchivesMapper.logicDelByUserIds(list, operatorId);
        empPhysicalExamMapper.logicDelByUserIds(list, operatorId);
        empRemarkInfoMapper.logicDelByUserIds(list, operatorId);
        empResignMapper.logicDelByUserIds(list, operatorId);
        empUnemploymentMapper.logicDelByUserIds(list, operatorId);
        empWorkExperienceMapper.logicDelByUserIds(list, operatorId);
    }
    /**
@@ -273,8 +321,8 @@
     */
    private List<EmpBaseInfo> setDeptName(List<EmpBaseInfo> empBaseInfoList) {
        List<Dept> depts = CastUtil.castList(redisService.get("depts"), Dept.class);
        if(null == depts){
            depts =remoteDeptService.setDeptRedis();
        if (null == depts) {
            depts = remoteDeptService.setDeptRedis();
        }
        for (EmpBaseInfo empBaseInfo : empBaseInfoList) {
            // 设置部门
@@ -309,6 +357,10 @@
        String operatorId = Optional.of(FebsUtil.getUserId()).orElse("1");
        String[] str = ids.split(",");
        List<String> list = new ArrayList<>(Arrays.asList(str));
//        for (int i = 0, j = str.length; i < j; i++) {
//            EmpBaseInfo emp = this.getById(str[i]);
//            addEmpDimissLog(emp, operatorId, Long.valueOf(str[i]));
//        }
        return empBaseInfoMapper.momentToNormal(list, operatorId) > 0;
    }
@@ -334,6 +386,7 @@
    public boolean closeEmpArchives(EmpDimissionLog empDimissionLog) {
        String operatorId = Optional.of(FebsUtil.getUserId()).orElse("1");
        String[] str = empDimissionLog.getEmpIds().split(",");
        String[] empDeptNames = empDimissionLog.getDeptNames().split(",");
        List<String> list = new ArrayList<>(Arrays.asList(str));
        String[] strDate = empDimissionLog.getEntryDates().split(",");
@@ -350,6 +403,7 @@
            dimissionLog.setReporter(empDimissionLog.getReporter());
            dimissionLog.setCreator(operatorId);
            dimissionLog.setModifier(operatorId);
            dimissionLog.setDeptName(empDeptNames[i]);
            dimissionLogService.save(dimissionLog);
        }
@@ -434,7 +488,7 @@
     */
    @Override
    @Transactional(rollbackFor = Exception.class)
    public void importEmpBaseInfo(List<List<Object>> listObject, List<String> returnList,List<DicItem> dicItems) {
    public void importEmpBaseInfo(List<List<Object>> listObject, List<String> returnList, List<DicItem> dicItems) {
        for (List<Object> list : listObject) {
            if (list.size() == 0) {
                continue;
@@ -443,17 +497,21 @@
                returnList.add(StrUtil.format("导入员工基本信息异常: 出现位置第{}行, 原因:{}员工编号重复", listObject.indexOf(list) + 1, list.get(1).toString()));
                continue;
            }
            if (this.count(new LambdaQueryWrapper<EmpBaseInfo>().eq(EmpBaseInfo::getCertificateNumb, list.get(1).toString()).ne(EmpBaseInfo::getDelFlag, 1)) > 0) {
                returnList.add(StrUtil.format("导入员工基本信息异常: 出现位置第{}行, 原因:{}身份证号重复", listObject.indexOf(list) + 1, list.get(1).toString()));
                continue;
            }
            EmpBaseInfo empBaseInfo = new EmpBaseInfo();
            empBaseInfo.setEmpId(SequenceUtil.generateId(0L, ModuleCode.HR_EMPLOYEE));
            empBaseInfo.setArchivesNumb(list.get(0).toString());
            empBaseInfo.setEmpNumb(list.get(1).toString());
            List<Dept> depts = CastUtil.castList(redisService.get("depts"), Dept.class);
            if(null == depts){
                depts =remoteDeptService.setDeptRedis();
            if (null == depts) {
                depts = remoteDeptService.setDeptRedis();
            }
            if(null == depts){
               depts =remoteDeptService.setDeptRedis();
            if (null == depts) {
                depts = remoteDeptService.setDeptRedis();
            }
            empBaseInfo.setDeptName(list.get(2).toString());
            Dept dept = depts.stream().filter(d -> d.getDeptName().equals(list.get(2).toString())).findFirst().orElse(null);
@@ -466,33 +524,48 @@
            empBaseInfo.setDeptId(dept.getDeptId());
            List<Position> positionList = CastUtil.castList(redisService.get("position"), Position.class);
            if (null==positionList){
            if (null == positionList) {
                positionList = remotePositionService.setPositionRedis();
                if (null==positionList){
                if (null == positionList) {
                    returnList.add(StrUtil.format("导入员工基本信息异常: 出现位置第{}行, 原因:{}获取岗位为空,请设置岗位", listObject.indexOf(list) + 1, list.get(3).toString()));
                    continue;
                }
            }
            Position position = positionList.stream().filter(d -> d.getPositionName().equals(list.get(3).toString())).findFirst().orElse(null);
            if (null == position){
            if (null == position) {
                returnList.add(StrUtil.format("导入员工基本信息异常: 出现位置第{}行, 原因:{}获取岗位为空", listObject.indexOf(list) + 1, list.get(3).toString()));
                continue;
            }
            empBaseInfo.setJobId(position.getPositionId());
            empBaseInfo.setJobName(list.get(3).toString());
            empBaseInfo.setEmpName(list.get(4).toString());
            empBaseInfo.setCertificateNumb(list.get(5).toString());
            try {
                if (StrUtil.isNotBlank(list.get(5).toString())) {
                    empBaseInfo.setCertificateNumb(list.get(5).toString());
                    if (IdcardUtil.isValidCard(list.get(5).toString())) {
                        empBaseInfo.setAge(IdcardUtil.getAgeByIdCard(list.get(5).toString()));
                        empBaseInfo.setBirthdate(IdcardUtil.getBirthDate(list.get(5).toString()));
                    }
                }
            } catch (Exception e) {
                log.error("导入人员身份证异常:{}", e);
                returnList.add(StrUtil.format("导入员工基本信息异常: 出现位置第{}行, 原因:{}检查身份证是否正确", listObject.indexOf(list) + 1, list.get(5).toString()));
                continue;
            }
            empBaseInfo.setSex("男".equals(list.get(6).toString()) ? "1" : "2");
            //民族
            DicItem  dicItem =dicItems.parallelStream().filter(j->StrUtil.equalsIgnoreCase(j.getDicCode(),"nation")&&StrUtil.equals(j.getDicItemName(),list.get(7).toString())).findFirst().orElse(null);
            if (null!=dicItem){
            DicItem dicItem = dicItems.parallelStream().filter(j -> StrUtil.equalsIgnoreCase(j.getDicCode(), "nation") && StrUtil.equals(j.getDicItemName(), list.get(7).toString())).findFirst().orElse(null);
            if (null != dicItem) {
                empBaseInfo.setNation(dicItem.getDicItemCode());
            }
            //婚姻状况
              dicItem =dicItems.parallelStream().filter(j->StrUtil.equalsIgnoreCase(j.getDicCode(),"marriage")&&StrUtil.equals(j.getDicItemName(),list.get(8).toString())).findFirst().orElse(null);
            if (null!=dicItem){
            dicItem = dicItems.parallelStream().filter(j -> StrUtil.equalsIgnoreCase(j.getDicCode(), "marriage") && StrUtil.equals(j.getDicItemName(), list.get(8).toString())).findFirst().orElse(null);
            if (null != dicItem) {
                empBaseInfo.setMarriage(dicItem.getDicItemCode());
            }
@@ -500,36 +573,36 @@
                empBaseInfo.setStature(Integer.valueOf(list.get(9).toString()));
            }
            //政治面貌
            dicItem =dicItems.parallelStream().filter(j->StrUtil.equalsIgnoreCase(j.getDicCode(), "plitical")&&StrUtil.equals(j.getDicItemName(),list.get(10).toString())).findFirst().orElse(null);
            if (null!=dicItem){
            dicItem = dicItems.parallelStream().filter(j -> StrUtil.equalsIgnoreCase(j.getDicCode(), "plitical") && StrUtil.equals(j.getDicItemName(), list.get(10).toString())).findFirst().orElse(null);
            if (null != dicItem) {
                empBaseInfo.setPolitics(dicItem.getDicItemCode());
            }
            if (StringUtils.isNotBlank(list.get(11).toString())) {
                empBaseInfo.setEntryDate(DateUtil.parseDate(list.get(11).toString()));
                empBaseInfo.setEntryDate(DateUtil.parse(list.get(11).toString()));
            }
            //最高学历
            dicItem =dicItems.parallelStream().filter(j->StrUtil.equalsIgnoreCase(j.getDicCode(),"education")&&StrUtil.equals(j.getDicItemName(),list.get(12).toString())).findFirst().orElse(null);
            if (null!=dicItem){
            dicItem = dicItems.parallelStream().filter(j -> StrUtil.equalsIgnoreCase(j.getDicCode(), "education") && StrUtil.equals(j.getDicItemName(), list.get(12).toString())).findFirst().orElse(null);
            if (null != dicItem) {
                empBaseInfo.setEducation(dicItem.getDicItemCode());
            }
            if (StringUtils.isNotBlank(list.get(13).toString())) {
                empBaseInfo.setSeniority(Integer.valueOf(list.get(13).toString()));
                empBaseInfo.setSeniority(list.get(13).toString());
            }
            //籍贯
            dicItem =dicItems.parallelStream().filter(j->StrUtil.equalsIgnoreCase(j.getDicCode(),"nativePlace")&&StrUtil.equals(j.getDicItemName(),list.get(14).toString())).findFirst().orElse(null);
            if (null!=dicItem){
            dicItem = dicItems.parallelStream().filter(j -> StrUtil.equalsIgnoreCase(j.getDicCode(), "nativePlace") && StrUtil.equals(j.getDicItemName(), list.get(14).toString())).findFirst().orElse(null);
            if (null != dicItem) {
                empBaseInfo.setNativePlace(dicItem.getDicItemCode());
            }
            empBaseInfo.setCensusAddress(list.get(15).toString());
            empBaseInfo.setCurrentAddress(list.get(16).toString());
            //员工类型
            dicItem =dicItems.parallelStream().filter(j->StrUtil.equalsIgnoreCase(j.getDicCode(),"empType")&&StrUtil.equals(j.getDicItemName(),list.get(17).toString())).findFirst().orElse(null);
            if (null!=dicItem){
            dicItem = dicItems.parallelStream().filter(j -> StrUtil.equalsIgnoreCase(j.getDicCode(), "empType") && StrUtil.equals(j.getDicItemName(), list.get(17).toString())).findFirst().orElse(null);
            if (null != dicItem) {
                empBaseInfo.setEmpType(dicItem.getDicItemCode());
            }
@@ -540,8 +613,8 @@
            empBaseInfo.setBankName(list.get(22).toString());
            empBaseInfo.setBankNumb(list.get(23).toString());
            //保险类型
            dicItem =dicItems.parallelStream().filter(j->StrUtil.equalsIgnoreCase(j.getDicCode(),"insuranceType")&&StrUtil.equals(j.getDicItemName(),list.get(24).toString())).findFirst().orElse(null);
            if (null!=dicItem){
            dicItem = dicItems.parallelStream().filter(j -> StrUtil.equalsIgnoreCase(j.getDicCode(), "insuranceType") && StrUtil.equals(j.getDicItemName(), list.get(24).toString())).findFirst().orElse(null);
            if (null != dicItem) {
                empBaseInfo.setInsuranceType(dicItem.getDicItemCode());
            }
@@ -549,57 +622,59 @@
            empBaseInfo.setFamily(list.get(26).toString());
            empBaseInfo.setUrgencyPhone(list.get(27).toString());
            //员工手册
            dicItem =dicItems.parallelStream().filter(j->StrUtil.equalsIgnoreCase(j.getDicCode(),"handbookStatus")&&StrUtil.equals(j.getDicItemName(),list.get(28).toString())).findFirst().orElse(null);
            if (null!=dicItem){
            dicItem = dicItems.parallelStream().filter(j -> StrUtil.equalsIgnoreCase(j.getDicCode(), "handbookStatus") && StrUtil.equals(j.getDicItemName(), list.get(28).toString())).findFirst().orElse(null);
            if (null != dicItem) {
                empBaseInfo.setHandbookStatus(dicItem.getDicItemCode());
            }
            //工作证
            dicItem =dicItems.parallelStream().filter(j->StrUtil.equalsIgnoreCase(j.getDicCode(),"empCardStatus")&&StrUtil.equals(j.getDicItemName(),list.get(29).toString())).findFirst().orElse(null);
            if (null!=dicItem){
            dicItem = dicItems.parallelStream().filter(j -> StrUtil.equalsIgnoreCase(j.getDicCode(), "empCardStatus") && StrUtil.equals(j.getDicItemName(), list.get(29).toString())).findFirst().orElse(null);
            if (null != dicItem) {
                empBaseInfo.setEmpCardStatus(dicItem.getDicItemCode());
            }
            //相关证件
            List<DicItem> dicItemList = new ArrayList<>();
            String[] certificateList = list.get(30).toString().split(StringConstant.COMMA);
            if (null != certificateList){
            if (null != certificateList) {
                for (String s : certificateList) {
                    dicItem =   dicItems.parallelStream().filter(j->StrUtil.equalsIgnoreCase(j.getDicCode(),"certificateList")&&StrUtil.equals(j.getDicItemName(),s)).findFirst().orElse(null);
                    if (null!=dicItem){
                    dicItem = dicItems.parallelStream().filter(j -> StrUtil.equalsIgnoreCase(j.getDicCode(), "certificateList") && StrUtil.equals(j.getDicItemName(), s)).findFirst().orElse(null);
                    if (null != dicItem) {
                        dicItemList.add(dicItem);
                    }
                }
            }
            if(CollUtil.isNotEmpty(dicItemList)){
                empBaseInfo.setCertificateList(dicItemList.stream().map(i->i.getDicItemCode()).collect(Collectors.joining(StringConstant.COMMA)));
            if (CollUtil.isNotEmpty(dicItemList)) {
                empBaseInfo.setCertificateList(dicItemList.stream().map(i -> i.getDicItemCode()).collect(Collectors.joining(StringConstant.COMMA)));
            }
            empBaseInfo.setDelFlag(2);
            //入职类型
            dicItem =dicItems.parallelStream().filter(j->StrUtil.equalsIgnoreCase(j.getDicCode(),"lztype")&&StrUtil.equals(j.getDicItemName(),list.get(31).toString())).findFirst().orElse(null);
            if (null!=dicItem){
            dicItem = dicItems.parallelStream().filter(j -> StrUtil.equalsIgnoreCase(j.getDicCode(), "lztype") && StrUtil.equals(j.getDicItemName(), list.get(31).toString())).findFirst().orElse(null);
            if (null != dicItem) {
                empBaseInfo.setEntryType(dicItem.getDicItemCode());
            }
            //档案情况
            dicItem =dicItems.parallelStream().filter(j->StrUtil.equalsIgnoreCase(j.getDicCode(),"archivesStatus")&&StrUtil.equals(j.getDicItemName(),list.get(32).toString())).findFirst().orElse(null);
            if (null!=dicItem){
            dicItem = dicItems.parallelStream().filter(j -> StrUtil.equalsIgnoreCase(j.getDicCode(), "archivesStatus") && StrUtil.equals(j.getDicItemName(), list.get(32).toString())).findFirst().orElse(null);
            if (null != dicItem) {
                empBaseInfo.setArchivesStatus(dicItem.getDicItemCode());
            }
            empBaseInfo.setEmpStatus("0");
            this.save(empBaseInfo);
            boolean saveResult = this.save(empBaseInfo);
            //新入职员工需要增加一条入职记录
            this.addEmpDimissLog(empBaseInfo, "2", empBaseInfo.getEmpId());
        }
    }
    @Override
    //    @Override
    public void getImage(String empId, HttpServletResponse response) throws Exception {
        EmpBaseInfo empBaseInfo = this.getById(empId);
        if (StrUtil.isBlank(empBaseInfo.getImagePath())) {
            return;
        }
        String path = properties.getEmpBaseInfoPath() + empBaseInfo.getEmpId() + ".png";
        String path = properties.getEmpBaseInfoPath() + empBaseInfo.getImagePath();
        try (InputStream inputStream = new FileInputStream(path); OutputStream out = response.getOutputStream()) {
            //byte数组用于存放图片字节数据
@@ -608,9 +683,19 @@
            inputStream.read(buff);
            inputStream.close();
            //设置发送到客户端的响应内容类型
            response.setContentType("image/png");
            String contentType = empBaseInfo.getImagePath().substring(empBaseInfo.getImagePath().lastIndexOf(".") + 1);
            if (contentType.equals("tif")) {
                //设置发送到客户端的响应内容类型
                response.setContentType("image/tiff");
            } else if (contentType.equals("bmp")) {
                response.setContentType("application/x-bmp");
            } else if (contentType.equals("jpg")) {
                response.setContentType("image/jpeg");
            } else if (contentType.equals("gif")) {
                response.setContentType("image/gif");
            } else {
                response.setContentType("image/png");
            }
            out.write(buff);
        }
    }
@@ -627,25 +712,25 @@
            womanOld = sysConfig.get(1).getConfigValue();
        }
        String[] split = remoteDeptService.userRightDepts().split(StringConstant.COMMA);
        List<String> lists= Arrays.asList(split);
        List<String> lists = Arrays.asList(split);
        if ("1".equals(number)) { //在职员工
            iPage = this.empBaseInfoMapper.zzbaseInfoList(page, index, btime, etime, name,lists);
            iPage = this.empBaseInfoMapper.zzbaseInfoList(page, index, btime, etime, name, lists);
        } else if ("2".equals(number)) { //新进员工
            iPage = this.empBaseInfoMapper.xjbaseInfoList(page, index, btime, etime, name,lists);
            iPage = this.empBaseInfoMapper.xjbaseInfoList(page, index, btime, etime, name, lists);
        } else if ("3".equals(number)) { //正式员工
            iPage = this.empBaseInfoMapper.zsbaseInfoList(page, index, btime, etime, name,lists);
            iPage = this.empBaseInfoMapper.zsbaseInfoList(page, index, btime, etime, name, lists);
        } else if ("4".equals(number)) { //临时员工
            iPage = this.empBaseInfoMapper.lsbaseInfoList(page, index, btime, etime, name,lists);
            iPage = this.empBaseInfoMapper.lsbaseInfoList(page, index, btime, etime, name, lists);
        } else if ("5".equals(number)) { //超龄员工
            iPage = this.empBaseInfoMapper.clbaseInfoList(page, index, btime, etime, name, manOld, womanOld,lists);
            iPage = this.empBaseInfoMapper.clbaseInfoList(page, index, btime, etime, name, manOld, womanOld, lists);
        } else if ("6".equals(number)) { //离职员工总数
            iPage = this.empBaseInfoMapper.lzbaseInfoList(page, index, btime, etime, name,lists);
            iPage = this.empBaseInfoMapper.lzbaseInfoList(page, index, btime, etime, name, lists);
        } else if ("7".equals(number)) { //辞职申请人数
            iPage = this.empBaseInfoMapper.cjbaseInfoList(page, index, btime, etime, name,lists);
            iPage = this.empBaseInfoMapper.cjbaseInfoList(page, index, btime, etime, name, lists);
        } else if ("8".equals(number) || "9".equals(number) || "10".equals(number)) { //正常离职人数 ,自动离职人数 ,公司辞退人数
            iPage = this.empBaseInfoMapper.zcbaseInfoList(page, index, btime, etime, name, number,lists);
            iPage = this.empBaseInfoMapper.zcbaseInfoList(page, index, btime, etime, name, number, lists);
        } else if ("11".equals(number)) { //身份证到期
            iPage = this.empBaseInfoMapper.sfzbaseInfoList(page, index, btime, etime, name,lists);
            iPage = this.empBaseInfoMapper.sfzbaseInfoList(page, index, btime, etime, name, lists);
        }
        //设置部门
        List<EmpBaseInfo> list = setDeptName(iPage.getRecords());
@@ -656,17 +741,22 @@
                p.setEmpTypeName("1".equals(p.getEmpType()) ? "正式工" : "临时工");
            }
            if (StringUtils.isNotBlank(p.getDimissionType())) {
                if ("1".equals(p.getDimissionType())) {
                    p.setDimissionTypeName("正常离职");
                } else if ("2".equals(p.getDimissionType())) {
                    p.setDimissionTypeName("自动离职");
                } else if ("3".equals(p.getDimissionType())) {
                    p.setDimissionTypeName("公司劝退");
                } else if ("4".equals(p.getDimissionType())) {
                    p.setDimissionTypeName("公司辞退");
                } else if ("5".equals(p.getDimissionType())) {
                    p.setDimissionTypeName("试用期内");
                }
                // if ("1".equals(p.getDimissionType())) {
                //     p.setDimissionTypeName("正常离职");
                // } else if ("2".equals(p.getDimissionType())) {
                //     p.setDimissionTypeName("自动离职");
                // } else if ("3".equals(p.getDimissionType())) {
                //     p.setDimissionTypeName("公司劝退");
                // } else if ("4".equals(p.getDimissionType())) {
                //     p.setDimissionTypeName("公司辞退");
                // } else if ("5".equals(p.getDimissionType())) {
                //     p.setDimissionTypeName("试用期内");
                // }
                p.setDimissionTypeName(dicItems.stream()
                        .filter(k -> DicCode.IN_OUT_TYPE.equals(k.getDicCode()) && k.getDicItemCode().equals(p.getDimissionType()))
                        .findFirst()
                        .map(DicItem::getDicItemName)
                        .orElse(""));
            }
            p.setInsuranceTypeName("1".equals(p.getInsuranceType()) ? "(深户)五险一档" : "(非深户)五险一档");
            p.setArchivesStatusName("0".equals(p.getArchivesStatus()) ? "未移交" : "已移交");
@@ -710,13 +800,13 @@
        Page<EmpBaseInfo> page = new Page<EmpBaseInfo>(new Long(pageNum), new Long(pageSize));
        IPage<EmpBaseInfo> iPage = null;
        String[] split = remoteDeptService.userRightDepts().split(StringConstant.COMMA);
        List<String> lists= Arrays.asList(split);
        List<String> lists = Arrays.asList(split);
        if ("11".equals(number) || "13".equals(number) || "14".equals(number)) { //有效合同   ,新签合同,续签合同
            iPage = this.empBaseInfoMapper.yxbaseInfoList(page, index, btime, etime, name, number,lists);
            iPage = this.empBaseInfoMapper.yxbaseInfoList(page, index, btime, etime, name, number, lists);
        } else if ("12".equals(number)) { //到期合同
            iPage = this.empBaseInfoMapper.dqbaseInfoList(page, index, btime, etime, name,lists);
            iPage = this.empBaseInfoMapper.dqbaseInfoList(page, index, btime, etime, name, lists);
        } else if ("15".equals(number)) { //解除合同
            iPage = this.empBaseInfoMapper.jcseInfoList(page, index, btime, etime, name,lists);
            iPage = this.empBaseInfoMapper.jcseInfoList(page, index, btime, etime, name, lists);
        }
        //设置部门
        List<EmpBaseInfo> list = setDeptName(iPage.getRecords());
@@ -741,8 +831,8 @@
        IPage<EmpDimissionAttend> iPage = null;
        //q出勤人数   员工加班   员工旷工
        String[] split = remoteDeptService.userRightDepts().split(StringConstant.COMMA);
        List<String> lists= Arrays.asList(split);
        iPage = this.empBaseInfoMapper.empBaseInfoCqList(page, index, btime, etime, name, number,lists);
        List<String> lists = Arrays.asList(split);
        iPage = this.empBaseInfoMapper.empBaseInfoCqList(page, index, btime, etime, name, number, lists);
        return iPage;
    }
@@ -753,8 +843,8 @@
        IPage<EmpLeaveInfo> iPage = null;
        //员工请假
        String[] split = remoteDeptService.userRightDepts().split(StringConstant.COMMA);
        List<String> lists= Arrays.asList(split);
        iPage = this.empBaseInfoMapper.empBaseInfoQjList(page, index, btime, etime, name, number,lists);
        List<String> lists = Arrays.asList(split);
        iPage = this.empBaseInfoMapper.empBaseInfoQjList(page, index, btime, etime, name, number, lists);
        return iPage;
    }
@@ -764,8 +854,8 @@
        IPage<EmpPhysicalExam> iPage = null;
        //员工体检
        String[] split = remoteDeptService.userRightDepts().split(StringConstant.COMMA);
        List<String> lists= Arrays.asList(split);
        iPage = this.empBaseInfoMapper.empBaseInfoTjList(page, index, btime, etime, name, number,lists);
        List<String> lists = Arrays.asList(split);
        iPage = this.empBaseInfoMapper.empBaseInfoTjList(page, index, btime, etime, name, number, lists);
        return iPage;
    }
@@ -775,8 +865,8 @@
        IPage<EmpLaborTrouble> iPage = null;
        //劳资案件
        String[] split = remoteDeptService.userRightDepts().split(StringConstant.COMMA);
        List<String> lists= Arrays.asList(split);
        iPage = this.empBaseInfoMapper.empBaseInfoLzList(page, index, btime, etime, name, number,lists);
        List<String> lists = Arrays.asList(split);
        iPage = this.empBaseInfoMapper.empBaseInfoLzList(page, index, btime, etime, name, number, lists);
        return iPage;
    }
@@ -786,8 +876,8 @@
        IPage<EmpJobChange> iPage = null;
        //调岗
        String[] split = remoteDeptService.userRightDepts().split(StringConstant.COMMA);
        List<String> lists= Arrays.asList(split);
        iPage = this.empBaseInfoMapper.empBaseInfoTgList(page, index, btime, etime, name, number,lists);
        List<String> lists = Arrays.asList(split);
        iPage = this.empBaseInfoMapper.empBaseInfoTgList(page, index, btime, etime, name, number, lists);
        return iPage;
    }
@@ -797,8 +887,8 @@
        IPage<EmpOccupational> iPage = null;
        //工伤案件
        String[] split = remoteDeptService.userRightDepts().split(StringConstant.COMMA);
        List<String> lists= Arrays.asList(split);
        iPage = this.empBaseInfoMapper.empBaseInfoGsList(page, index, btime, etime, name, number,lists);
        List<String> lists = Arrays.asList(split);
        iPage = this.empBaseInfoMapper.empBaseInfoGsList(page, index, btime, etime, name, number, lists);
        return iPage;
    }
@@ -808,8 +898,8 @@
        IPage<EmpAccidentCases> iPage = null;
        //意外险案件
        String[] split = remoteDeptService.userRightDepts().split(StringConstant.COMMA);
        List<String> lists= Arrays.asList(split);
        iPage = this.empBaseInfoMapper.empBaseInfoYwList(page, index, btime, etime, name, number,lists);
        List<String> lists = Arrays.asList(split);
        iPage = this.empBaseInfoMapper.empBaseInfoYwList(page, index, btime, etime, name, number, lists);
        return iPage;
    }
@@ -819,8 +909,8 @@
        IPage<EmpInsurance> iPage = null;
        //社保
        String[] split = remoteDeptService.userRightDepts().split(StringConstant.COMMA);
        List<String> lists= Arrays.asList(split);
        iPage = this.empBaseInfoMapper.empBaseInfoSbList(page, index, btime, etime, name, number,lists);
        List<String> lists = Arrays.asList(split);
        iPage = this.empBaseInfoMapper.empBaseInfoSbList(page, index, btime, etime, name, number, lists);
        return iPage;
    }
@@ -830,8 +920,8 @@
        IPage<EmpUnemployment> iPage = null;
        //失业金
        String[] split = remoteDeptService.userRightDepts().split(StringConstant.COMMA);
        List<String> lists= Arrays.asList(split);
        iPage = this.empBaseInfoMapper.empBaseInfoSyjList(page, index, btime, etime, name, number,lists);
        List<String> lists = Arrays.asList(split);
        iPage = this.empBaseInfoMapper.empBaseInfoSyjList(page, index, btime, etime, name, number, lists);
        return iPage;
    }
@@ -841,8 +931,8 @@
        IPage<EmpBadRecord> iPage = null;
        //不良记录
        String[] split = remoteDeptService.userRightDepts().split(StringConstant.COMMA);
        List<String> lists= Arrays.asList(split);
        iPage = this.empBaseInfoMapper.empBaseInfoBlList(page, index, btime, etime, name, number,lists);
        List<String> lists = Arrays.asList(split);
        iPage = this.empBaseInfoMapper.empBaseInfoBlList(page, index, btime, etime, name, number, lists);
        return iPage;
    }
@@ -855,19 +945,19 @@
            manOld = sysConfig.get(0).getConfigValue();
            womanOld = sysConfig.get(1).getConfigValue();
        }
        QueryWrapper queryWrapper=new QueryWrapper();
        QueryWrapper queryWrapper = new QueryWrapper();
        queryWrapper.in("t1.dept_Id", remoteDeptService.userRightDepts().split(StringConstant.COMMA));
        //在职员工,正式员工,临时员工,超龄员工
        Map<String, Object> stringObjectMap = this.baseMapper.countBaseInfoList(index, btime, etime, manOld, womanOld,queryWrapper);
        Map<String, Object> stringObjectMap = this.baseMapper.countBaseInfoList(index, btime, etime, manOld, womanOld, queryWrapper);
        //正常离职,自动离职,公司辞退    判断条件创建日期
        Map<String, Object> zclzObjectMap = this.baseMapper.countZcygBaseInfoList(index, btime, etime,queryWrapper);
        Map<String, Object> zclzObjectMap = this.baseMapper.countZcygBaseInfoList(index, btime, etime, queryWrapper);
        if (zclzObjectMap != null) {
            stringObjectMap.put("zclz", zclzObjectMap.get("zclz").toString());
            stringObjectMap.put("zdlz", zclzObjectMap.get("zdlz").toString());
            stringObjectMap.put("gsct", zclzObjectMap.get("gsct").toString());
        }
        //新进员工      判断条件入职日期
        Integer xjygObjectMap = this.baseMapper.countXjygBaseInfoList(index, btime, etime,queryWrapper);
        Integer xjygObjectMap = this.baseMapper.countXjygBaseInfoList(index, btime, etime, queryWrapper);
        if (xjygObjectMap != null) {
            stringObjectMap.put("xjyg", xjygObjectMap);
        }
@@ -880,34 +970,34 @@
            stringObjectMap.put("lzyg", empStatus);
        }
        //解除合同        判断条件离职申请日期
        Map<String, Object> lzygObjectMap = this.baseMapper.countLzygBaseInfoList(index, btime, etime,queryWrapper);
        Map<String, Object> lzygObjectMap = this.baseMapper.countLzygBaseInfoList(index, btime, etime, queryWrapper);
        if (lzygObjectMap != null) {
            stringObjectMap.put("jcht", lzygObjectMap.get("jcht").toString());
        }
        //辞职申请员工总数     判断条件辞职申请日期
        Integer czygObjectMap = this.baseMapper.countCzygBaseInfoList(index, btime, etime,queryWrapper);
        Integer czygObjectMap = this.baseMapper.countCzygBaseInfoList(index, btime, etime, queryWrapper);
        if (czygObjectMap != null) {
            stringObjectMap.put("czyg", czygObjectMap);
        }
        //有效合同    判断条件合同签订日期
        Map<String, Object> yxhtObjectMap = this.baseMapper.countYxhtBaseInfoList(index, btime, etime,queryWrapper);
        Map<String, Object> yxhtObjectMap = this.baseMapper.countYxhtBaseInfoList(index, btime, etime, queryWrapper);
        if (yxhtObjectMap != null) {
            stringObjectMap.put("yxht", yxhtObjectMap.get("yxht").toString());
        }
        //新签合同,续签合同    判断条件合同签订日期
        Map<String, Object> xqhtObjectMap = this.baseMapper.countXqhtBaseInfoList(index, btime, etime,queryWrapper);
        Map<String, Object> xqhtObjectMap = this.baseMapper.countXqhtBaseInfoList(index, btime, etime, queryWrapper);
        if (yxhtObjectMap != null) {
            stringObjectMap.put("xinqht", xqhtObjectMap.get("xinqht").toString());
            stringObjectMap.put("xqht", xqhtObjectMap.get("xqht").toString());
        }
        //到期合同     判断条件合同结束时间
        Integer dqhtObjectMap = this.baseMapper.countDqhtBaseInfoList(index, btime, etime,queryWrapper);
        Integer dqhtObjectMap = this.baseMapper.countDqhtBaseInfoList(index, btime, etime, queryWrapper);
        if (dqhtObjectMap != null) {
            stringObjectMap.put("dqht", dqhtObjectMap);
        }
        //出勤人数,员工加班,员工旷工    判断条件考勤月份    本年,本月
        Map<String, Object> cqrsObjectMap = this.baseMapper.countCqrsBaseInfoList(index, btime, etime,queryWrapper);
        Map<String, Object> cqrsObjectMap = this.baseMapper.countCqrsBaseInfoList(index, btime, etime, queryWrapper);
        if (cqrsObjectMap != null) {
            stringObjectMap.put("cqrs", cqrsObjectMap.get("cqrs").toString());
            stringObjectMap.put("ygjb", cqrsObjectMap.get("ygjb").toString());
@@ -915,51 +1005,51 @@
        }
        //员工请假     判断条件到岗时间
        Integer ygqjObjectMap = this.baseMapper.countYgqjBaseInfoList(index, btime, etime,queryWrapper);
        Integer ygqjObjectMap = this.baseMapper.countYgqjBaseInfoList(index, btime, etime, queryWrapper);
        if (ygqjObjectMap != null) {
            stringObjectMap.put("ygqj", ygqjObjectMap);
        }
        //劳资案件     判断条件仲裁日期
        Integer lzajObjectMap = this.baseMapper.countLzajBaseInfoList(index, btime, etime,queryWrapper);
        Integer lzajObjectMap = this.baseMapper.countLzajBaseInfoList(index, btime, etime, queryWrapper);
        if (lzajObjectMap != null) {
            stringObjectMap.put("lzaj", lzajObjectMap);
        }
        //工伤案件,意外险案件     判断条件受伤日期
        Map<String, Object> gsajObjectMap = this.baseMapper.countGsajBaseInfoList(index, btime, etime,queryWrapper);
        Map<String, Object> gsajObjectMap = this.baseMapper.countGsajBaseInfoList(index, btime, etime, queryWrapper);
        if (gsajObjectMap != null) {
            stringObjectMap.put("gsaj", gsajObjectMap.get("gsaj").toString());
            stringObjectMap.put("ywxaj", gsajObjectMap.get("ywxaj").toString());
        }
        //社保申请     判断条件社保申请日期
        Integer sbsqObjectMap = this.baseMapper.countSbsqBaseInfoList(index, btime, etime,queryWrapper);
        Integer sbsqObjectMap = this.baseMapper.countSbsqBaseInfoList(index, btime, etime, queryWrapper);
        if (sbsqObjectMap != null) {
            stringObjectMap.put("sbsq", sbsqObjectMap);
        }
        //失业金领取     判断条件失业金申请日期
        Integer syjObjectMap = this.baseMapper.countSyjBaseInfoList(index, btime, etime,queryWrapper);
        Integer syjObjectMap = this.baseMapper.countSyjBaseInfoList(index, btime, etime, queryWrapper);
        if (syjObjectMap != null) {
            stringObjectMap.put("syj", syjObjectMap);
        }
        //员工体检     判断条件体检日期
        Integer ygtjObjectMap = this.baseMapper.countYgtjBaseInfoList(index, btime, etime,queryWrapper);
        Integer ygtjObjectMap = this.baseMapper.countYgtjBaseInfoList(index, btime, etime, queryWrapper);
        if (ygtjObjectMap != null) {
            stringObjectMap.put("ygtj", ygtjObjectMap);
        }
        //身份证到期     判断条件身份证有效时间
        Integer sfzObjectMap = this.baseMapper.countSfzBaseInfoList(index, btime, etime,queryWrapper);
        Integer sfzObjectMap = this.baseMapper.countSfzBaseInfoList(index, btime, etime, queryWrapper);
        if (sfzObjectMap != null) {
            stringObjectMap.put("sfz", sfzObjectMap);
        }
        //员工调岗     判断条件身份证有效时间
        Integer ygtgObjectMap = this.baseMapper.countYgtgBaseInfoList(index, btime, etime,queryWrapper);
        Integer ygtgObjectMap = this.baseMapper.countYgtgBaseInfoList(index, btime, etime, queryWrapper);
        if (ygtgObjectMap != null) {
            stringObjectMap.put("ygtg", ygtgObjectMap);
        }
        //不良记录     判断条件身份证有效时间
        Integer bljlObjectMap = this.baseMapper.countBljlBaseInfoList(index, btime, etime,queryWrapper);
        Integer bljlObjectMap = this.baseMapper.countBljlBaseInfoList(index, btime, etime, queryWrapper);
        if (bljlObjectMap != null) {
            stringObjectMap.put("bljl", bljlObjectMap);
        }
@@ -1094,11 +1184,24 @@
            queryWrapper.in("a.dimissionType", empBaseInfo.getDimissionType().split(","));
        }
        if (StringUtils.isNotBlank(empBaseInfo.getInOutType())) {
            queryWrapper.and(p->{
            queryWrapper.and(p -> {
                p.in("a.dimissionType", empBaseInfo.getInOutType().split(","));
                p.or().in("a.entryType",empBaseInfo.getInOutType().split(","));
                p.or().in("a.entryType", empBaseInfo.getInOutType().split(","));
            });
            //queryWrapper.in("a.dimissionType", empBaseInfo.getDimissionType().split(","));
        }
        if (StringUtils.isNotBlank(empBaseInfo.getCertificateList())) {
            String[] certificates = empBaseInfo.getCertificateList().split(",");
            Consumer<QueryWrapper<EmpBaseInfo>> consumer = new Consumer<QueryWrapper<EmpBaseInfo>>() {
                @Override
                public void accept(QueryWrapper<EmpBaseInfo> wrapper) {
                    for (int i = 0; i < certificates.length; i++) {
                        String ageBtn = "|" + certificates[i] + "|";
                        wrapper.gt("LOCATE('" + ageBtn + "',CONCAT('|',replace( certificateList, ',', '|,|'),'|'))", 0);
                    }
                }
            };
            queryWrapper.and(consumer);
        }
        queryWrapper.in("c.dept_Id", remoteDeptService.userRightDepts().split(StringConstant.COMMA));
        return queryWrapper;
@@ -1108,6 +1211,7 @@
    public EmpBaseInfo addInEmpBaseInfo(EmpBaseInfo empBaseInfo) {
        EmpBaseInfo dbEmpInfo = this.getEmpBaseInfo(empBaseInfo);
        if (dbEmpInfo == null) {
            empBaseInfo.setDelFlag(0);
            this.createEmpBaseInfo(empBaseInfo);
            return null;
        } else {
@@ -1291,8 +1395,9 @@
    public boolean verifyCertificateNumb(EmpBaseInfo empBaseInfo) {
        QueryWrapper<EmpBaseInfo> queryWrapper = new QueryWrapper<>();
        queryWrapper.lambda().eq(EmpBaseInfo::getCertificateNumb, empBaseInfo.getCertificateNumb())
                .ne(EmpBaseInfo::getDelFlag, 1);;
        if (empBaseInfo.getEmpId()!=null) {
                .ne(EmpBaseInfo::getDelFlag, 1);
        ;
        if (empBaseInfo.getEmpId() != null) {
            queryWrapper.lambda().ne(EmpBaseInfo::getEmpId, empBaseInfo.getEmpId());
        }
@@ -1303,4 +1408,116 @@
    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;
    }
    @Override
    public boolean updateSeniority() {
        return empBaseInfoMapper.updateSeniority() > 0;
    }
    @Override
    public boolean updateDeptName() {
        return empBaseInfoMapper.updateDeptName() > 0;
    }
    @Override
    public boolean updateEmpAge(String userId) {
        List<EmpBaseInfo> empBaseInfoList = new ArrayList<>();
        if (StringUtils.isNotBlank(userId)) {
            EmpBaseInfo empBaseInfo = this.getById(userId);
            empBaseInfoList.add(empBaseInfo);
        } else {
            empBaseInfoList = this.list();
        }
        if (!empBaseInfoList.isEmpty()) {
            empBaseInfoList.parallelStream().forEach(p -> {
                p.setAge(DateUtil.ageOfNow(p.getBirthdate()));
                this.saveOrUpdate(p);
            });
        }
        return false;
    }
    @Override
    public void updateAnnualLeave(String userId) {
        EmpBaseInfo empBaseInfo = this.getById(userId);
        int holiday = calculateHoliday(empBaseInfo.getEntryDate());
        empBaseInfo.setAnnualLeave(holiday);
        baseMapper.update(null, new LambdaUpdateWrapper<EmpBaseInfo>()
                .set(EmpBaseInfo::getAnnualLeave, holiday)
                .eq(EmpBaseInfo::getEmpId, empBaseInfo.getEmpId()));
    }
    @Override
    public void updateAnnualLeave() {
        List<EmpBaseInfo> list = this.list();
        list.parallelStream().forEach(p -> {
            int holiday = calculateHoliday(p.getEntryDate());
            p.setAnnualLeave(holiday);
            baseMapper.update(null, new LambdaUpdateWrapper<EmpBaseInfo>()
                    .set(EmpBaseInfo::getAnnualLeave, holiday)
                    .eq(EmpBaseInfo::getEmpId, p.getEmpId()));
        });
    }
    @Override
    public void updateEmpBaseKeyInfo() {
        List<EmpBaseInfo> list = this.list();
        list.parallelStream().forEach(p -> {
            int holiday = calculateHoliday(p.getEntryDate());
            int age = calculateAge(p.getBirthdate());
            baseMapper.update(null, new LambdaUpdateWrapper<EmpBaseInfo>()
                    .set(EmpBaseInfo::getAnnualLeave, holiday)
                    .set(EmpBaseInfo::getAge, age)
                    .eq(EmpBaseInfo::getEmpId, p.getEmpId()));
        });
    }
    /**
     * 根据设置的参数计算员工的年假
     * @param date 入职日期
     * @return 年假天数
     */
    private int calculateHoliday(Date date) {
        int holiday = 0;
        int joinYear = DateUtil.ageOfNow(date);
        String configValue = redisService.get("annual_leave").toString();
        String[] values = StrUtil.split(configValue, "|");
        String[] condition = StrUtil.split(values[0], ",");
        String[] days = StrUtil.split(values[1], ",");
        if (condition.length == 2) {
            int one = Integer.parseInt(condition[0]);
            int two = Integer.parseInt(condition[1]);
            if (joinYear >= one && joinYear < two) {
                holiday = Integer.parseInt(days[0]);
            } else if (joinYear >= two) {
                holiday = Integer.parseInt(days[1]);
            }
        }
        return holiday;
    }
    private int  calculateAge(Date date){
        return DateUtil.ageOfNow(date);
    }
}