6 小时以前 c653ef74b8b332a530f8d1b54a316d382d0647d1
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
79
80
81
82
83
84
85
86
87
88
package com.ruoyi.basic.controller;
 
import com.ruoyi.basic.dto.SupplierContractRecordDto;
import com.ruoyi.basic.service.SupplierContractRecordService;
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 io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
 
import java.util.List;
 
/**
 * 供应商合同记录Controller
 *
 * @author ruoyi
 * @date 2026-06-24
 */
@Tag(name = "供应商合同记录")
@RestController
@RequestMapping("/basic/supplier-contract")
@RequiredArgsConstructor
public class SupplierContractRecordController extends BaseController {
 
    private final SupplierContractRecordService supplierContractRecordService;
 
    /**
     * 查询供应商合同记录列表
     */
    @Operation(summary = "查询供应商合同记录列表")
    @GetMapping("/list/{supplierId}")
    public AjaxResult list(@PathVariable Long supplierId) {
        List<SupplierContractRecordDto> list = supplierContractRecordService.selectListBySupplierId(supplierId);
        return AjaxResult.success(list);
    }
 
    /**
     * 获取供应商合同记录详细信息
     */
    @Operation(summary = "获取供应商合同记录详细信息")
    @GetMapping("/{id}")
    public AjaxResult getInfo(@PathVariable Long id) {
        return AjaxResult.success(supplierContractRecordService.selectDetailById(id));
    }
 
    /**
     * 新增供应商合同记录
     */
    @Operation(summary = "新增供应商合同记录")
    @Log(title = "供应商合同记录-新增", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody SupplierContractRecordDto dto) {
        int result = supplierContractRecordService.insertSupplierContractRecord(dto);
        return toAjax(result);
    }
 
    /**
     * 修改供应商合同记录
     */
    @Operation(summary = "修改供应商合同记录")
    @Log(title = "供应商合同记录-修改", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody SupplierContractRecordDto dto) {
        return toAjax(supplierContractRecordService.updateSupplierContractRecord(dto));
    }
 
    /**
     * 删除供应商合同记录
     */
    @Operation(summary = "删除供应商合同记录")
    @Log(title = "供应商合同记录-删除", businessType = BusinessType.DELETE)
    @DeleteMapping("/{id}")
    public AjaxResult remove(@PathVariable Long id) {
        return toAjax(supplierContractRecordService.deleteSupplierContractRecord(id));
    }
 
    /**
     * 根据总合同号查询附件(供采购台账等模块使用)
     */
    @Operation(summary = "根据总合同号查询附件")
    @GetMapping("/files/byContractNo")
    public AjaxResult getFilesByContractNo(@RequestParam String masterContractNo) {
        return AjaxResult.success(supplierContractRecordService.selectFilesByMasterContractNo(masterContractNo));
    }
}