| ¶Ô±ÈÐÂÎļþ |
| | |
| | | alter table staff_join_leave_record |
| | | add dimission_reason varchar(255) null, |
| | | add dimission_remark text null; |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.common.enums; |
| | | |
| | | import lombok.AllArgsConstructor; |
| | | |
| | | /** |
| | | * éä»¶è®°å½ç±»åæä¸¾ |
| | | * |
| | | */ |
| | | @AllArgsConstructor |
| | | public enum StaffJoinLeaveRecordDimissionReason { |
| | | StaffJoinLeaveRecordDimissionReasonSalary("salary","èªèµå¾
é"), |
| | | StaffJoinLeaveRecordDimissionReasonCareerDevelopment("career_development","èä¸åå±"), |
| | | StaffJoinLeaveRecordDimissionReasonWorkEnvironment("work_environment","å·¥ä½ç¯å¢"), |
| | | StaffJoinLeaveRecordDimissionReasonPersonalReason("personal_reason","个人åå "), |
| | | StaffJoinLeaveRecordDimissionReasonOther("other","å
¶ä»åå "); |
| | | |
| | | |
| | | private final String code; |
| | | private final String info; |
| | | |
| | | public String getCode() { |
| | | return code; |
| | | } |
| | | |
| | | public String getInfo() { |
| | | return info; |
| | | } |
| | | } |
| | |
| | | @Excel(name = "夿³¨ï¼ç¦å©å¾
éï¼") |
| | | private String remark; |
| | | |
| | | /** |
| | | * 离èåå |
| | | */ |
| | | @Excel(name = "离èåå ",readConverterExp = "salary=èªèµå¾
é,career_development=èä¸åå±,work_environment=å·¥ä½ç¯å¢,personal_reason=个人åå ,other=å
¶ä»") |
| | | private String dimissionReason; |
| | | |
| | | /** |
| | | * 离è夿³¨ |
| | | */ |
| | | @Excel(name = "离è夿³¨") |
| | | private String dimissionRemark; |
| | | |
| | | |
| | | @ApiModelProperty(value = "å建æ¶é´") |
| | | @TableField(fill = FieldFill.INSERT) |
| | |
| | | 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); |
| | | } |