zss
2023-07-27 0e1722e96e5483d560eda8f1cf96282955d4f224
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
package com.yuanchu.limslaboratory.controller;
 
 
import com.yuanchu.limslaboratory.pojo.dto.InspectionRecordsDto;
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 lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.yuanchu.limslaboratory.service.InspectionRecordsService;
 
 
 
/**
 * 检测记录(InspectionRecords)表控制层
 *
 * @author zss
 * @since 2023-07-24 14:05:11
 */
@Api(tags = "检验模块-->检测记录")
@RestController
@RequestMapping("/inspectionRecords")
@Slf4j
public class InspectionRecordsController {
 
    @Autowired
    private InspectionRecordsService inspectionRecordsService;
 
 
    @ApiOperation("根据样品的项目id以及状态(待提交)查询检测记录")
    @ApiImplicitParams(value = {
            @ApiImplicitParam(name = "productId", value = "样品下的项目ID", dataTypeClass = Integer.class, required = true),
            @ApiImplicitParam(name = "submitState", value = "状态(为空=待提交)", dataTypeClass = Integer.class)
    })
    @GetMapping("/selectByProductId/{productId}")
    public Result selectByProductId(@PathVariable Integer productId, Integer submitState) {
        return Result.success(inspectionRecordsService.selectByProductId(productId,submitState));
    }
 
    @ApiOperation("根据样品的项目id以及状态(待提交)修改检测记录")
    @PutMapping("/upByProductId")
    public Result upByProductId(@RequestBody InspectionRecordsDto inspectionRecordsDto) {
        inspectionRecordsService.upByProductId(inspectionRecordsDto);
        return Result.success("修改成功!");
    }
 
    /**
     * 将待提交的的检验项目的检测记录的状态转为待审核
     * @param id
     * @return
     */
    @ApiOperation("保存并提交检验报告")
    @ApiImplicitParams(value = {
            @ApiImplicitParam(name = "id", value = "检验记录ID", dataTypeClass = Integer.class, required = true),
    })
    @PostMapping("/submitRecords/{id}")
    public Result submitRecords(@PathVariable Integer id) {
        inspectionRecordsService.submitRecords(id);
        return Result.success("提交成功!");
    }
 
 
}