| | |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.staff.dto.StaffOnJobDto; |
| | | import com.ruoyi.staff.pojo.StaffJoinLeaveRecord; |
| | | import com.ruoyi.staff.pojo.StaffOnJob; |
| | | import com.ruoyi.staff.service.IStaffJoinLeaveRecordService; |
| | | import com.ruoyi.staff.service.IStaffOnJobService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import javax.validation.Valid; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/staff/staffOnJob") |
| | | @Api(tags = "员工台账/合同管理") |
| | | public class StaffOnJobController { |
| | | |
| | | @Resource |
| | |
| | | } |
| | | |
| | | /** |
| | | * 在职员工详情 |
| | | * @param staffNo |
| | | * 新增入职 |
| | | * @param staffOnJob |
| | | * @return |
| | | */ |
| | | @GetMapping("/staffNo") |
| | | public AjaxResult staffOnJobDetail(String staffNo) { |
| | | return AjaxResult.success(staffOnJobService.staffOnJobDetail(staffNo)); |
| | | @PostMapping("") |
| | | public AjaxResult add(@RequestBody StaffOnJobDto staffOnJob) { |
| | | return AjaxResult.success(staffOnJobService.add(staffOnJob)); |
| | | } |
| | | |
| | | /** |
| | | * 更新入职信息 |
| | | * @param staffOnJobDto |
| | | * @return |
| | | */ |
| | | @PutMapping("/{id}") |
| | | public AjaxResult update(@PathVariable("id") Long id, @RequestBody StaffOnJobDto staffOnJobDto) { |
| | | return AjaxResult.success(staffOnJobService.update(id, staffOnJobDto)); |
| | | } |
| | | |
| | | /** |
| | | * 删除入职 |
| | | * @param ids |
| | | * @return |
| | | */ |
| | | @DeleteMapping("/del") |
| | | public AjaxResult delStaffOnJobs(@RequestBody List<Integer> ids) { |
| | | if(CollectionUtils.isEmpty(ids)){ |
| | | return AjaxResult.error("请选择至少一条数据"); |
| | | } |
| | | return AjaxResult.success(staffOnJobService.delStaffOnJobs(ids)); |
| | | } |
| | | |
| | | /** |
| | | * 在职员工详情 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @GetMapping("/{id}") |
| | | public AjaxResult staffJoinLeaveRecordDetail(@PathVariable("id") Long id) { |
| | | return AjaxResult.success(staffOnJobService.staffOnJobDetail(id)); |
| | | } |
| | | |
| | | /** |
| | | * 在职员工导入 |
| | | */ |
| | |
| | | * @param staffOnJob |
| | | */ |
| | | @PostMapping("/exportCopy") |
| | | public String exportCopy(HttpServletResponse response,StaffOnJob staffOnJob) throws Exception{ |
| | | return staffOnJobService.exportCopy(response, staffOnJob); |
| | | @ApiOperation("word模板合同在职员工导出") |
| | | public AjaxResult exportCopy(HttpServletResponse response,@RequestBody StaffOnJob staffOnJob) throws Exception{ |
| | | return AjaxResult.success(staffOnJobService.exportCopy(response, staffOnJob)); |
| | | } |
| | | |
| | | |