| | |
| | | private final EmpRemarkInfoMapper empRemarkInfoMapper; |
| | | private final IRemoteDicItemService remoteDicItemService; |
| | | |
| | | private final String operatorId = Optional.of(FebsUtil.getUserId()).orElse("1"); |
| | | // private final String operatorId = Optional.of(FebsUtil.getUserId()).orElse("1"); |
| | | |
| | | @Override |
| | | public IPage<EmpBaseInfo> findEmpBaseInfos(QueryRequest request, EmpBaseInfo empBaseInfo) { |
| | |
| | | .findFirst() |
| | | .map(DicItem::getDicItemName) |
| | | .orElse("未知")); |
| | | p.setEntryTypeName(dicItems.stream() |
| | | .filter(k -> DicCode.IN_OUT_TYPE.equals(k.getDicCode()) && k.getDicItemCode().equals(p.getEntryType())) |
| | | .findFirst() |
| | | .map(DicItem::getDicItemName) |
| | | .orElse("未知")); |
| | | p.setDimissionTypeName(dicItems.stream() |
| | | .filter(k -> DicCode.IN_OUT_TYPE.equals(k.getDicCode()) && k.getDicItemCode().equals(p.getDimissionType())) |
| | | .findFirst() |
| | | .map(DicItem::getDicItemName) |
| | | .orElse("未知")); |
| | | }); |
| | | iPage.setRecords(list); |
| | | return iPage; |
| | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void createEmpBaseInfo(EmpBaseInfo empBaseInfo) { |
| | | String operatorId = Optional.of(FebsUtil.getUserId()).orElse("1"); |
| | | EmpBaseInfo dbInfo = this.getEmpBaseInfo(empBaseInfo); |
| | | if (dbInfo == null) { |
| | | empBaseInfo.setEmpId(SequenceUtil.generateId(0L, ModuleCode.HR_EMPLOYEE)); |
| | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void updateEmpBaseInfo(EmpBaseInfo empBaseInfo) { |
| | | String operatorId = Optional.of(FebsUtil.getUserId()).orElse("1"); |
| | | if (StrUtil.isNotBlank(empBaseInfo.getImagePath())) { |
| | | String path = properties.getEmpBaseInfoPath() + empBaseInfo.getEmpId() + ".png"; |
| | | if (MyUtil.generateImage(empBaseInfo.getImagePath(), path)) { |
| | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void logicDelEmpBaseInfo(String ids) { |
| | | String operatorId = Optional.of(FebsUtil.getUserId()).orElse("1"); |
| | | String[] str = ids.split(","); |
| | | List<String> list = new ArrayList<>(Arrays.asList(str)); |
| | | empBaseInfoMapper.logicDeleteByIds(list, operatorId); |
| | |
| | | |
| | | @Override |
| | | public boolean momentToNormal(String ids) { |
| | | String operatorId = Optional.of(FebsUtil.getUserId()).orElse("1"); |
| | | String[] str = ids.split(","); |
| | | List<String> list = new ArrayList<>(Arrays.asList(str)); |
| | | return empBaseInfoMapper.momentToNormal(list, operatorId) > 0; |
| | |
| | | */ |
| | | @Override |
| | | public boolean closeEmpArchives(EmpDimissionLog empDimissionLog) { |
| | | String operatorId = Optional.of(FebsUtil.getUserId()).orElse("1"); |
| | | String[] str = empDimissionLog.getEmpIds().split(","); |
| | | List<String> list = new ArrayList<>(Arrays.asList(str)); |
| | | String[] strDate = empDimissionLog.getEntryDates().split(","); |
| | |
| | | switch (flag) { |
| | | case 1: |
| | | //解除合同 |
| | | |
| | | empContractInfoMapper.terminateContract(new ArrayList<>(Arrays.asList(empDimissionLog.getEmpIds().split(StringConstant.COMMA))), operatorId); |
| | | break; |
| | | case 2: |
| | |
| | | */ |
| | | @Override |
| | | public boolean changeEmpJob(EmpJobChange empJobChange) { |
| | | String operatorId = Optional.of(FebsUtil.getUserId()).orElse("1"); |
| | | String[] str = empJobChange.getEmpIds().split(","); |
| | | List<String> list = new ArrayList<>(Arrays.asList(str)); |
| | | String[] strName = empJobChange.getEmpNames().split(","); |
| | |
| | | if (StringUtils.isNotBlank(empBaseInfo.getCertificateNumb())) { |
| | | hasCondition = hasCondition | 1; |
| | | } |
| | | if (StringUtils.isNotBlank(empBaseInfo.getEntryDateStr())) { |
| | | hasCondition = hasCondition | 1; |
| | | } |
| | | if (StringUtils.isNotBlank(empBaseInfo.getDimissionDateStr())) { |
| | | hasCondition = hasCondition | 1; |
| | | } |
| | | if (StringUtils.isNotBlank(empBaseInfo.getSex())) { |
| | | hasCondition = hasCondition | 1; |
| | | } |
| | | if (StringUtils.isNotBlank(empBaseInfo.getEducation())) { |
| | | hasCondition = hasCondition | 1; |
| | | } |
| | | if (StringUtils.isNotBlank(empBaseInfo.getPolitics())) { |
| | | hasCondition = hasCondition | 1; |
| | | } |
| | | if (StringUtils.isNotBlank(empBaseInfo.getAgeStr())) { |
| | | hasCondition = hasCondition | 1; |
| | | } |
| | | if (StringUtils.isNotBlank(empBaseInfo.getArchivesStatus())) { |
| | | hasCondition = hasCondition | 1; |
| | | } |
| | | if (StringUtils.isNotBlank(empBaseInfo.getInsuranceType())) { |
| | | hasCondition = hasCondition | 1; |
| | | } |
| | | return hasCondition == 1; |
| | | } |
| | | |
| | |
| | | //人员的状态,0-在职 1-离职 2-退休 |
| | | if (StringUtils.isNotBlank(empBaseInfo.getEmpStatus())) { |
| | | queryWrapper.in("a.EmpStatus", empBaseInfo.getEmpStatus().split(",")); |
| | | } else { |
| | | queryWrapper.in("a.EmpStatus", 0); |
| | | } |
| | | if (StringUtils.isNotBlank(empBaseInfo.getEmpCardStatus())) { |
| | | queryWrapper.in("a.empCardStatus", empBaseInfo.getEmpCardStatus().split(",")); |
| | |
| | | if (StringUtils.isNotBlank(empBaseInfo.getHandbookStatus())) { |
| | | queryWrapper.in("a.handBookStatus", empBaseInfo.getHandbookStatus().split(",")); |
| | | } |
| | | // 下面的条件就是人员的属性条件,条件之间是或的关系 |
| | | if (this.checkQueryCondition(empBaseInfo)) { |
| | | // 关键词查询,是或的关系 |
| | | if (StringUtils.isNotBlank(empBaseInfo.getBaseKey())) { |
| | | queryWrapper.and(p -> { |
| | | p.like("a.EmpNumb", empBaseInfo.getBaseKey()); |
| | | p.or().like("a.EmpName", empBaseInfo.getBaseKey()); |
| | | p.or().like("a.DeptName", empBaseInfo.getBaseKey()); |
| | | p.or().like("a.CertificateNumb", empBaseInfo.getBaseKey()); |
| | | p.or().like("a.archivesNumb", empBaseInfo.getBaseKey()); |
| | | p.or().like("a.stature", empBaseInfo.getBaseKey()); |
| | | p.or().like("a.seniority", empBaseInfo.getBaseKey()); |
| | | p.or().like("a.nativePlace", empBaseInfo.getBaseKey()); |
| | | p.or().like("a.censusAddress", empBaseInfo.getBaseKey()); |
| | | p.or().like("a.guardNumb", empBaseInfo.getBaseKey()); |
| | | p.or().like("a.telePhone", empBaseInfo.getBaseKey()); |
| | | p.or().like("a.socialNumb", empBaseInfo.getBaseKey()); |
| | | p.or().like("a.bankName", empBaseInfo.getBaseKey()); |
| | | p.or().like("a.bankNumb", empBaseInfo.getBaseKey()); |
| | | p.or().like("a.family", empBaseInfo.getBaseKey()); |
| | | p.or().like("a.certificateList", empBaseInfo.getBaseKey()); |
| | | }); |
| | | } |
| | | |
| | | if (StringUtils.isNotBlank(empBaseInfo.getEmpNumb())) { |
| | | p.like("a.EmpNumb", empBaseInfo.getEmpNumb()); |
| | | queryWrapper.like("a.EmpNumb", empBaseInfo.getEmpNumb()); |
| | | } |
| | | if (StringUtils.isNotBlank(empBaseInfo.getEmpName())) { |
| | | p.or().like("a.EmpName", empBaseInfo.getEmpName()); |
| | | queryWrapper.like("a.EmpName", empBaseInfo.getEmpName()); |
| | | } |
| | | if (StringUtils.isNotBlank(empBaseInfo.getDeptName())) { |
| | | p.or().like("a.DeptName", empBaseInfo.getDeptName()); |
| | | queryWrapper.like("a.DeptName", empBaseInfo.getDeptName()); |
| | | } |
| | | if (StringUtils.isNotBlank(empBaseInfo.getCertificateNumb())) { |
| | | p.or().like("a.CertificateNumb", empBaseInfo.getCertificateNumb()); |
| | | queryWrapper.like("a.CertificateNumb", empBaseInfo.getCertificateNumb()); |
| | | } |
| | | }); |
| | | if (StringUtils.isNotBlank(empBaseInfo.getEntryDateStr())) { |
| | | queryWrapper.between("a.EntryDate", empBaseInfo.getEntryDateStr().split(",")[0], empBaseInfo.getEntryDateStr().split(",")[1]); |
| | | } |
| | | if (StringUtils.isNotBlank(empBaseInfo.getDimissionDateStr())) { |
| | | queryWrapper.between("a.DimissionDate", empBaseInfo.getDimissionDateStr().split(",")[0], empBaseInfo.getDimissionDateStr().split(",")[1]); |
| | | } |
| | | if (StringUtils.isNotBlank(empBaseInfo.getSex())) { |
| | | queryWrapper.in("a.Sex", empBaseInfo.getSex().split(",")); |
| | | } |
| | | if (StringUtils.isNotBlank(empBaseInfo.getEducation())) { |
| | | queryWrapper.in("a.Education", empBaseInfo.getEducation().split(",")); |
| | | } |
| | | if (StringUtils.isNotBlank(empBaseInfo.getPolitics())) { |
| | | queryWrapper.in("a.Politics", empBaseInfo.getPolitics().split(",")); |
| | | } |
| | | if (StringUtils.isNotBlank(empBaseInfo.getAgeStr())) { |
| | | String[] ages = empBaseInfo.getAgeStr().split(","); |
| | | Consumer<QueryWrapper<EmpBaseInfo>> consumer = new Consumer<QueryWrapper<EmpBaseInfo>>() { |
| | | @Override |
| | | public void accept(QueryWrapper<EmpBaseInfo> wrapper) { |
| | | for (int i = 0; i < ages.length; i++) { |
| | | String ageBtn = ages[i]; |
| | | wrapper.or().between("a.Age", ageBtn.split("-")[0], ageBtn.split("-")[1]); |
| | | } |
| | | } |
| | | }; |
| | | queryWrapper.and(consumer); |
| | | } |
| | | if (StringUtils.isNotBlank(empBaseInfo.getArchivesStatus())) { |
| | | queryWrapper.in("a.ArchivesStatus", empBaseInfo.getArchivesStatus().split(",")); |
| | | } |
| | | if (StringUtils.isNotBlank(empBaseInfo.getInsuranceType())) { |
| | | queryWrapper.in("a.InsuranceType", empBaseInfo.getInsuranceType().split(",")); |
| | | } |
| | | if (StringUtils.isNotBlank(empBaseInfo.getHandbookStatus())) { |
| | | queryWrapper.in("a.HandbookStatus", empBaseInfo.getHandbookStatus().split(",")); |
| | | } |
| | | if (StringUtils.isNotBlank(empBaseInfo.getEmpCardStatus())) { |
| | | queryWrapper.in("a.EmpCardStatus", empBaseInfo.getEmpCardStatus().split(",")); |
| | | } |
| | | if (StringUtils.isNotBlank(empBaseInfo.getEmpType())) { |
| | | queryWrapper.in("a.empType", empBaseInfo.getEmpType().split(",")); |
| | | } |
| | | if (StringUtils.isNotBlank(empBaseInfo.getEntryType())) { |
| | | queryWrapper.in("a.entryType", empBaseInfo.getEntryType().split(",")); |
| | | } |
| | | if (StringUtils.isNotBlank(empBaseInfo.getDimissionType())) { |
| | | queryWrapper.in("a.dimissionType", empBaseInfo.getDimissionType().split(",")); |
| | | } |
| | | queryWrapper.in("c.dept_Id", remoteDeptService.userRightDepts().split(StringConstant.COMMA)); |
| | | return queryWrapper; |
| | |
| | | exportField = FebsUtil. reflectAnnotation(EmpRemarkInfo.class); |
| | | List<Map<String, Object>> allListEmpRemarkInfo = PoiExportExcel.getDataList(exportField, empRemarkInfoIPage.getRecords(), listMapDicItem); |
| | | allList.add(allListEmpRemarkInfo.get(0)); |
| | | |
| | | |
| | | |
| | | List<String> sheetNames = new ArrayList<>(); |