| | |
| | | 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() |
| | |
| | | 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); |
| | | |
| | |
| | | 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; |
| | | } |
| | | |
| | |
| | | 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(","); |
| | | |
| | |
| | | dimissionLog.setReporter(empDimissionLog.getReporter()); |
| | | dimissionLog.setCreator(operatorId); |
| | | dimissionLog.setModifier(operatorId); |
| | | dimissionLog.setDeptName(empDeptNames[i]); |
| | | dimissionLogService.save(dimissionLog); |
| | | } |
| | | |
| | |
| | | } |
| | | if (this.count(new LambdaQueryWrapper<EmpBaseInfo>().eq(EmpBaseInfo::getEmpNumb, list.get(1).toString()).ne(EmpBaseInfo::getDelFlag, 1)) > 0) { |
| | | 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.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())) { |
| | |
| | | @Override |
| | | public void accept(QueryWrapper<EmpBaseInfo> wrapper) { |
| | | for (int i = 0; i < certificates.length; i++) { |
| | | String ageBtn = certificates[i] ; |
| | | wrapper.or().gt("LOCATE('"+ageBtn+"',certificateList)",0); |
| | | String ageBtn = "|" + certificates[i] + "|"; |
| | | wrapper.gt("LOCATE('" + ageBtn + "',CONCAT('|',replace( certificateList, ',', '|,|'),'|'))", 0); |
| | | } |
| | | } |
| | | }; |
| | |
| | | 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.size() > 0) { |
| | | empBaseInfoList.forEach(p -> { |
| | | p.setAge(DateUtil.ageOfNow(p.getBirthdate())); |
| | | this.saveOrUpdate(p); |
| | | }); |
| | | } |
| | | return false; |
| | | } |
| | | } |