TWW
2025-08-08 6873d560b235e04a2e95c8240f00dc8e8b6e1ac6
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
package com.ruoyi.personnelManagement.controller;
 
import java.io.IOException;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
 
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.framework.aspectj.lang.annotation.Log;
import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
import com.ruoyi.framework.web.controller.BaseController;
import com.ruoyi.framework.web.domain.AjaxResult;
import com.ruoyi.framework.web.page.TableDataInfo;
import com.ruoyi.other.service.TempFileService;
import com.ruoyi.quality.pojo.QualityInspectFile;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.jetbrains.annotations.Contract;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
 
import com.ruoyi.personnelManagement.pojo.EmployeeContract;
import com.ruoyi.personnelManagement.service.IEmployeeContractService;
import org.springframework.web.multipart.MultipartFile;
 
/**
 * 员工合同信息Controller
 * 
 * @author ruoyi
 * @date 2025-08-08
 */
@RestController
@RequestMapping("/contractManagement/contract")
@Api(tags = "员工合同信息的接口")
public class EmployeeContractController extends BaseController
{
    @Autowired
    private IEmployeeContractService employeeContractService;
    @Autowired
    private TempFileService tempFileService;
 
    /**
     * 查询员工合同信息列表
     */
    @GetMapping("/list")
    public AjaxResult contractListPage(Page page, EmployeeContract employeeContract) {
        return AjaxResult.success(employeeContractService.contractList(page, employeeContract));
    }
 
    /**
     * 上传员工合同
     */
 
    @PostMapping("/upload")
    public AjaxResult uploadFile(@RequestBody EmployeeContract employeeContract) {
    return AjaxResult.success(employeeContractService.save(employeeContract));
    }
 
    @DeleteMapping("/delete")
    public AjaxResult deleteContract(@RequestBody List<Integer> ids) {
        if(CollectionUtils.isEmpty(ids)){
            return AjaxResult.error("请选择至少一条数据");
        }
        //删除附件
        return AjaxResult.success(employeeContractService.removeBatchByIds(ids));
    }
 
}