| | |
| | | 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.IEmpContractInfoService; |
| | | import cc.mrbird.febs.server.hr.service.IEmpDimissionLogService; |
| | | import cc.mrbird.febs.server.hr.service.IEmpJobChangeService; |
| | | import cn.hutool.core.date.DateUnit; |
| | |
| | | private final EmpBaseInfoMapper empBaseInfoMapper; |
| | | private final IEmpDimissionLogService dimissionLogService; |
| | | private final IEmpJobChangeService jobChangeService; |
| | | private final IEmpContractInfoService empContractInfoService; |
| | | private final FebsServerHrProperties properties; |
| | | private final String operatorId = Optional.ofNullable(FebsUtil.getCurrentUser()) |
| | | .map(u -> u.getUserId().toString()) |
| | |
| | | String[] str = empDimissionLog.getEmpIds().split(","); |
| | | List<String> list = new ArrayList<>(Arrays.asList(str)); |
| | | String[] strDate = empDimissionLog.getEntryDates().split(","); |
| | | |
| | | EmpDimissionLog dimissionLog = null; |
| | | for (int i = 0, k = str.length; i < k; i++) { |
| | | dimissionLog = new EmpDimissionLog(); |
| | |
| | | dimissionLog.setModifier(operatorId); |
| | | dimissionLogService.save(dimissionLog); |
| | | } |
| | | EmpBaseInfo empBaseInfo = this.getById(dimissionLog.getEmpId()); |
| | | |
| | | if (StrUtil.isNotBlank(empDimissionLog.getAfterOperation())) { |
| | | String[] strAfterOperation = empDimissionLog.getAfterOperation().split(","); |
| | | int flag = 0; |
| | | for (String s : strAfterOperation) { |
| | | flag = flag + Integer.parseInt(s); |
| | | } |
| | | switch (flag) { |
| | | case 1: |
| | | //解除合同 |
| | | empContractInfoService.terminateContract(empDimissionLog.getEmpIds(), operatorId); |
| | | break; |
| | | case 2: |
| | | //禁用账户 |
| | | iRemoteUserService.updateStatus(empBaseInfo.getCertificateNumb()); |
| | | iRemoteUserService.updateStatus(empDimissionLog.getCertificateNumb()); |
| | | break; |
| | | case 3: |
| | | empContractInfoService.terminateContract(empDimissionLog.getEmpIds(), operatorId); |
| | | iRemoteUserService.updateStatus(empDimissionLog.getCertificateNumb()); |
| | | break; |
| | | } |
| | | } |
| | | return empBaseInfoMapper.closeEmpArchives(list, empDimissionLog.getDimissionType(), empDimissionLog.getDimissionDate(), empDimissionLog.getRemark(), operatorId) > 0; |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | /** |
| | | * |
| | | * 检查是否是带条件查询 |
| | | * |
| | | * <p> |
| | | * date 2021-02-26 13:49 |
| | | * @author: luoyibo |
| | | * |
| | | * @param empBaseInfo 人员参数 |
| | | * @return boolean |
| | | * @author: luoyibo |
| | | */ |
| | | private boolean checkQueryCondition(EmpBaseInfo empBaseInfo){ |
| | | int hasCondition = 0; |