| | |
| | | import cc.mrbird.febs.common.core.utils.MyUtil; |
| | | import cc.mrbird.febs.server.hr.entity.EmpDimissionLog; |
| | | import cc.mrbird.febs.server.hr.entity.EmpJobChange; |
| | | import cc.mrbird.febs.server.hr.feign.IRemoteUserService; |
| | | import cc.mrbird.febs.server.hr.properties.FebsServerHrProperties; |
| | | import cc.mrbird.febs.server.hr.service.IEmpDimissionLogService; |
| | | import cc.mrbird.febs.server.hr.service.IEmpJobChangeService; |
| | |
| | | @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) |
| | | class EmpBaseInfoServiceImpl extends ServiceImpl<EmpBaseInfoMapper, EmpBaseInfo> implements IEmpBaseInfoService { |
| | | private final RedisService redisService; |
| | | private final IRemoteDeptService remoteDeptService; |
| | | private final IRemoteUserService iRemoteUserService; |
| | | private final EmpBaseInfoMapper empBaseInfoMapper; |
| | | private final IEmpDimissionLogService dimissionLogService; |
| | | private final IEmpJobChangeService jobChangeService; |
| | |
| | | @Override |
| | | public boolean verifyEmpNumb(EmpBaseInfo empBaseInfo) { |
| | | QueryWrapper<EmpBaseInfo> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.lambda().eq(EmpBaseInfo::getEmpNumb, empBaseInfo.getEmpNumb()); |
| | | EmpBaseInfo tempEmpBaseInfo = this.getOne(queryWrapper); |
| | | if (tempEmpBaseInfo == null) { |
| | | queryWrapper.lambda().eq(EmpBaseInfo::getEmpNumb, empBaseInfo.getEmpNumb()).ne(EmpBaseInfo::getDelFlag,1); |
| | | if (this.count(queryWrapper)<=0) { |
| | | return false; |
| | | } |
| | | return !empBaseInfo.getEmpNumb().equals(tempEmpBaseInfo.getEmpNumb()); |
| | | return true; |
| | | } |
| | | |
| | | @Override |
| | |
| | | dimissionLog.setReporter(empDimissionLog.getReporter()); |
| | | dimissionLog.setCreator(operatorId); |
| | | dimissionLog.setModifier(operatorId); |
| | | |
| | | dimissionLogService.save(dimissionLog); |
| | | } |
| | | EmpBaseInfo empBaseInfo = this.getById(dimissionLog.getEmpId()); |
| | | //禁用账户 |
| | | iRemoteUserService.updateStatus(empBaseInfo.getCertificateNumb()); |
| | | return empBaseInfoMapper.closeEmpArchives(list, empDimissionLog.getDimissionType(), empDimissionLog.getDimissionDate(), empDimissionLog.getRemark(), operatorId) > 0; |
| | | } |
| | | |
| | |
| | | if (StringUtils.isNotBlank(empBaseInfo.getInsuranceType())) { |
| | | p.or().in(EmpBaseInfo::getInsuranceType, empBaseInfo.getInsuranceType().split(",")); |
| | | } |
| | | if (StringUtils.isNotBlank(empBaseInfo.getHandbookStatus())) { |
| | | p.or().in(EmpBaseInfo::getHandbookStatus, empBaseInfo.getHandbookStatus().split(",")); |
| | | } |
| | | if (StringUtils.isNotBlank(empBaseInfo.getEmpCardStatus())) { |
| | | p.or().in(EmpBaseInfo::getEmpCardStatus, empBaseInfo.getEmpCardStatus().split(",")); |
| | | } |
| | | }); |
| | | } |
| | | return queryWrapper; |
| | | } |
| | | |
| | | @Override |
| | | public EmpBaseInfo addInEmpBaseInfo(EmpBaseInfo empBaseInfo) { |
| | | EmpBaseInfo dbEmpInfo = this.getEmpBaseInfo(empBaseInfo); |
| | | if(dbEmpInfo==null){ |
| | | this.createEmpBaseInfo(empBaseInfo); |
| | | return null; |
| | | } else { |
| | | return dbEmpInfo; |
| | | } |
| | | } |
| | | } |