zss
2023-07-21 e43043961cc300c722d309240656e268c164fdcd
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
package com.yuanchu.limslaboratory.controller;
 
 
import com.yuanchu.limslaboratory.pojo.Plan;
import com.yuanchu.limslaboratory.service.PlanService;
import com.yuanchu.limslaboratory.vo.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;
 
import javax.annotation.Resource;
 
/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 江苏鵷雏网络科技有限公司
 * @since 2023-07-17
 */
@Api(tags = "检验模块")
@RestController
@RequestMapping("/plan")
public class PlanController {
 
    @Resource
    private PlanService planService;
 
    @ApiOperation("查询所有检验计划表")
    @ApiImplicitParams(value = {
            @ApiImplicitParam(name = "pageSize", value = "页数", dataTypeClass = Integer.class, required = true),
            @ApiImplicitParam(name = "countSize", value = "条数/页", dataTypeClass = Integer.class, required = true),
            @ApiImplicitParam(name = "state", value = "状态(为空=待分配)", dataTypeClass = Integer.class)
    })
    @GetMapping("/selectAllPlan")
    public Result selectAllPlan(int pageSize, int countSize, Integer state) {
        return Result.success(planService.selectAllPlan(pageSize, countSize, state));
    }
 
    @ApiOperation("查询检验计划里面的分配信息")
    @ApiImplicitParams(value = {
            @ApiImplicitParam(name = "id", value = "样品编号", dataTypeClass = Integer.class, required = true)
    })
    @PutMapping("/selectPlanById/{id}")
    public Result selectPlanById(@PathVariable Integer id) {
        return Result.success(planService.selectById(id));
    }
 
    @ApiOperation("作废检验计划")
    @ApiImplicitParams(value = {
            @ApiImplicitParam(name = "id", value = "检验计划ID", dataTypeClass = Integer.class, required = true),
    })
    @PostMapping("/delPlan")
    public Result delPlan(Integer id) {
        return Result.success(planService.delPlan(id));
    }
}