xuhy
2 天以前 9961fd3e734552a21a30c12cea39ebf3ff57227f
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
package com.ruoyi.web.controller.api;
 
 
import com.alibaba.fastjson.JSON;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.basic.PageInfo;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.framework.web.service.TokenService;
import com.ruoyi.system.dto.TInspectionReportDTO;
import com.ruoyi.system.model.TInspectionReport;
import com.ruoyi.system.query.TInspectionReportQuery;
import com.ruoyi.system.service.ISysUserService;
import com.ruoyi.system.service.TInspectionReportService;
import com.ruoyi.system.vo.TInspectionReportVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
 
import java.util.List;
 
/**
 * <p>
 * 检验报告 前端控制器
 * </p>
 *
 * @author xiaochen
 * @since 2025-04-08
 */
@Api(tags = "检验报告管理")
@RestController
@RequestMapping("")
public class TInspectionReportController {
 
    private final TInspectionReportService inspectionReportService;
    private final TokenService tokenService;
    private final ISysUserService sysUserService;
    @Autowired
    public TInspectionReportController(TInspectionReportService inspectionReportService, TokenService tokenService, ISysUserService sysUserService) {
        this.inspectionReportService = inspectionReportService;
        this.tokenService = tokenService;
        this.sysUserService = sysUserService;
    }
 
    /**
     * 获取检验报告管理列表
     */
    //@PreAuthorize("@ss.hasPermi('system:inspectionReport:list')")
    @ApiOperation(value = "获取检验报告分页列表",  response = TInspectionReportQuery.class)
    @PostMapping(value = "/api/t-inspection-report/pageList")
    public R<PageInfo<TInspectionReportVO>> pageList(@RequestBody String param) {
        TInspectionReportQuery query = JSON.parseObject(param, TInspectionReportQuery.class);
        return R.ok(inspectionReportService.pageList(query));
    }
 
    /**
     * 添加检验报告管理
     */
    //@PreAuthorize("@ss.hasPermi('system:inspectionReport:add')")
    @Log(title = "检验报告信息-新增检验报告", businessType = BusinessType.INSERT)
    @ApiOperation(value = "添加检验报告",response = TInspectionReportDTO.class)
    @PostMapping(value = "/api/t-inspection-report/add")
    public R<Boolean> add(@RequestBody String param) {
        TInspectionReportDTO dto = JSON.parseObject(param,TInspectionReportDTO.class);
        inspectionReportService.save(dto);
        return R.ok();
    }
 
    /**
     * 修改检验报告
     */
    //@PreAuthorize("@ss.hasPermi('system:inspectionReport:edit')")
    @Log(title = "检验报告信息-修改检验报告", businessType = BusinessType.UPDATE)
    @ApiOperation(value = "修改检验报告")
    @PostMapping(value = "/api/t-inspection-report/update")
    public R<Boolean> update(@RequestBody String param) {
        TInspectionReportDTO dto = JSON.parseObject(param,TInspectionReportDTO.class);
        inspectionReportService.updateById(dto);
        return R.ok();
    }
 
    /**
     * 查看检验报告详情
     */
    //@PreAuthorize("@ss.hasPermi('system:inspectionReport:detail')")
    @ApiOperation(value = "查看检验报告详情")
    @GetMapping(value = "/open/t-inspection-report/getDetailById")
    public R<TInspectionReportVO> getDetailById(@RequestParam String id) {
        TInspectionReport inspectionReport = inspectionReportService.getById(id);
        TInspectionReportVO inspectionReportVO = new TInspectionReportVO();
        BeanUtils.copyProperties(inspectionReport, inspectionReportVO);
        return R.ok(inspectionReportVO);
    }
 
    /**
     * 删除检验报告
     */
    //@PreAuthorize("@ss.hasPermi('system:inspectionReport:delete')")
    @Log(title = "检验报告信息-删除检验报告", businessType = BusinessType.DELETE)
    @ApiOperation(value = "删除检验报告")
    @DeleteMapping(value = "/open/t-inspection-report/deleteById")
    public R<Boolean> deleteById(@RequestParam String id) {
        return R.ok(inspectionReportService.removeById(id));
    }
 
    /**
     * 批量删除检验报告
     */
    //@PreAuthorize("@ss.hasPermi('system:inspectionReport:delete')")
    @Log(title = "检验报告信息-删除检验报告", businessType = BusinessType.DELETE)
    @ApiOperation(value = "批量删除检验报告")
    @DeleteMapping(value = "/open/t-inspection-report/deleteByIds")
    public R<Boolean> deleteByIds(@RequestBody List<String> ids) {
        return R.ok(inspectionReportService.removeByIds(ids));
    }
 
}