| | |
| | | import java.util.*; |
| | | import java.util.function.Function; |
| | | |
| | | import static com.ruoyi.common.enums.StaffJoinLeaveRecordDimissionReason.StaffJoinLeaveRecordDimissionReasonOther; |
| | | |
| | | @Service |
| | | @AllArgsConstructor |
| | | @Transactional(rollbackFor = Exception.class) |
| | |
| | | staffOnJobMapper.updateById(staffOnJob); |
| | | }else { |
| | | throw new BaseException("没有找到"+staffJoinLeaveRecord.getStaffNo()+"编号的员工,无法新增离职!!!"); |
| | | } |
| | | if (staffJoinLeaveRecord.getDimissionReason()==null){ |
| | | throw new BaseException("离职原因不能为空!!!"); |
| | | } |
| | | if (!StaffJoinLeaveRecordDimissionReasonOther.getCode().equals(staffJoinLeaveRecord.getDimissionReason())){ |
| | | staffJoinLeaveRecord.setDimissionRemark(""); |
| | | } |
| | | } |
| | | return staffJoinLeaveRecordMapper.insert(staffJoinLeaveRecord); |
| | |
| | | }else { |
| | | /*离职*/ |
| | | //离职的编辑不会影响在职表 |
| | | if (staffJoinLeaveRecord.getDimissionReason()==null){ |
| | | throw new BaseException("离职原因不能为空!!!"); |
| | | } |
| | | if (!StaffJoinLeaveRecordDimissionReasonOther.getCode().equals(staffJoinLeaveRecord.getDimissionReason())){ |
| | | staffJoinLeaveRecord.setDimissionRemark(""); |
| | | } |
| | | } |
| | | return staffJoinLeaveRecordMapper.updateById(staffJoinLeaveRecord); |
| | | } |