value
2023-08-31 0afd6c073589d5221774dab5cf4a9d21415ec0e8
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
package com.yuanchu.limslaboratory.controller;
 
import com.yuanchu.limslaboratory.annotation.AuthHandler;
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.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
 
import javax.annotation.Resource;
 
/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author 江苏鵷雏网络科技有限公司
 * @since 2023-08-09
 */
@Api(tags = "检验模块-->检验计划")
@RestController
@RequestMapping("/plan")
public class PlanController {
 
    @Resource
    private PlanService planService;
 
 
    @ApiOperation("查询所有检验计划")
    @ApiImplicitParams(value = {
            @ApiImplicitParam(name = "code", value = "申请单编号", dataTypeClass = String.class),
            @ApiImplicitParam(name = "beginTime", value = "检验开始时间", dataTypeClass = String.class),
            @ApiImplicitParam(name = "endTime", value = "检验结束时间", dataTypeClass = String.class),
            @ApiImplicitParam(name = "status", value = "检验结果", dataTypeClass = Integer.class)
    })
    @GetMapping("/selectAllPlan")
    @AuthHandler
    public Result selectAllPlan(String code, String beginTime, String endTime, Integer status) {
        return Result.success(planService.selectAllPlan(code, beginTime, endTime, status));
    }
 
    @ApiOperation("分配-->选择检验人")
    @GetMapping("/choosecheck")
    @AuthHandler
    public Result choosecheck() {
        return Result.success(planService.choosecheck());
    }
 
    @ApiOperation("分配--选择设备")
    @GetMapping("/chooseinstum")
    @AuthHandler
    public Result chooseinstum() {
        return Result.success(planService.chooseinstum());
    }
 
    @ApiOperation("分配")
    @ApiImplicitParams(value = {
            @ApiImplicitParam(name = "id", value = "检验项目id", dataTypeClass = Integer.class, required = true),
            @ApiImplicitParam(name = "userId", value = "执行人id", dataTypeClass = Integer.class, required = true),
            @ApiImplicitParam(name = "instrumentId", value = "设备id", dataTypeClass = Integer.class, required = true)
    })
    @PostMapping("/distribution")
    @AuthHandler
    public Result distribution(Integer id, Integer userId, Integer instrumentId) {
        return Result.success(planService.distribution(id, userId, instrumentId));
    }
 
    @ApiOperation("检验")
    @ApiImplicitParams(value = {
            @ApiImplicitParam(name = "id", value = "检验项目id", dataTypeClass = Integer.class, required = true),
            @ApiImplicitParam(name = "value", value = "检验值", dataTypeClass = String.class)
    })
    @PostMapping("/check")
    @AuthHandler
    public Result check(Integer id, String value) {
        return Result.success(planService.check(id, value));
    }
 
    @ApiOperation("上报")
    @ApiImplicitParams(value = {
            @ApiImplicitParam(name = "id", value = "检验单id", dataTypeClass = Integer.class, required = true)
    })
    @PostMapping("/reported")
    @AuthHandler
    public Result reported(Integer id) {
        return Result.success(planService.reported(id));
    }
}