| | |
| | | //设置部门 |
| | | // 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() |
| | |
| | | .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; |
| | | } |
| | |
| | | empBaseInfo.setModifier(operatorId); |
| | | this.saveOrUpdate(empBaseInfo); |
| | | |
| | | addEmpDimissLog(empBaseInfo, operatorId, empId); |
| | | } |
| | | |
| | | /** |
| | | * |
| | | * 增加员工后同步增加入职记录 |
| | | * |
| | | * date 2021-07-30 09:12 |
| | | * @author: luoyibo |
| | | * @param empBaseInfo 员工信息 |
| | | * @param operatorId 操作员Id |
| | | * @param empId 员工Id |
| | | * @return void |
| | | */ |
| | | private void addEmpDimissLog(EmpBaseInfo empBaseInfo, String operatorId, Long empId) { |
| | | EmpDimissionLog dimissionLog = new EmpDimissionLog(); |
| | | dimissionLog.setCloseId(SequenceUtil.generateId(0L, ModuleCode.HR_EMPLOYEE)); |
| | | dimissionLog.setEmpId(empId); |
| | |
| | | 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()); |
| | |
| | | } |
| | | |
| | | if (StringUtils.isNotBlank(list.get(11).toString())) { |
| | | empBaseInfo.setEntryDate(DateUtil.parseDate(list.get(11).toString())); |
| | | empBaseInfo.setEntryDate(DateUtil.parse(list.get(11).toString())); |
| | | } |
| | | |
| | | //最高学历 |
| | |
| | | } |
| | | empBaseInfo.setEmpStatus("0"); |
| | | this.save(empBaseInfo); |
| | | //新入职员工需要增加一条入职记录 |
| | | this.addEmpDimissLog(empBaseInfo,"2",empBaseInfo.getEmpId()); |
| | | } |
| | | } |
| | | |
| | |
| | | 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()) ? "未移交" : "已移交"); |
| | |
| | | }); |
| | | //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; |
| | | } |
| | |
| | | } |
| | | return tempName; |
| | | } |
| | | |
| | | @Override |
| | | public boolean updateSeniority() { |
| | | return empBaseInfoMapper.updateSeniority() > 0; |
| | | } |
| | | |
| | | @Override |
| | | public boolean updateDeptName() { |
| | | return empBaseInfoMapper.updateDeptName() > 0; |
| | | } |
| | | } |