XiaoRuby
2023-07-27 c6c30ead51b2ac1f7ffd4fb7e4b193c5d11d7bdf
inspection-server/src/main/java/com/yuanchu/limslaboratory/controller/PlanController.java
@@ -2,7 +2,11 @@
import com.yuanchu.limslaboratory.pojo.InspectionProductList;
import com.yuanchu.limslaboratory.pojo.Instrument;
import com.yuanchu.limslaboratory.pojo.Product;
import com.yuanchu.limslaboratory.pojo.dto.InspectionProductListDto;
import com.yuanchu.limslaboratory.service.PlanService;
import com.yuanchu.limslaboratory.service.ProductService;
import com.yuanchu.limslaboratory.vo.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
@@ -28,6 +32,9 @@
    @Resource
    private PlanService planService;
    @Resource
    ProductService productService;
    @ApiOperation("查询所有检验计划分配")
    @ApiImplicitParams(value = {
            @ApiImplicitParam(name = "pageSize", value = "页数", dataTypeClass = Integer.class, required = true),
@@ -39,19 +46,29 @@
        return Result.success(planService.selectAllPlan(pageSize, countSize, state));
    }
    @ApiOperation("查询检验计划里面的检验项目")
    @ApiOperation("根据项目名查询所有试验方法")
    @GetMapping("/selectInstrumentByProname")
    public Result selectInstrumentByProname(String name) {
        return Result.success(productService.selectInstrumentByProname(name));
    }
    @ApiOperation("选择试验方法")
    @ApiImplicitParams(value = {
            @ApiImplicitParam(name = "id", value = "样品id", dataTypeClass = Integer.class, required = true)
            @ApiImplicitParam(name = "id", value = "项目id", dataTypeClass = Integer.class, required = true),
    })
    @GetMapping("/selectProductById/{id}")
    public Result selectProductById(@PathVariable Integer id) {
        return Result.success(planService.selectProductById(id));
    @PostMapping("/selectProMethodById")
    public Result selectProMethodById(Integer id) {
        Product product = productService.getById(id);
        return Result.success(product.getMethod());
    }
    @ApiOperation("分配检验计划中分配项目")
    @PostMapping("/upPlan")
    public Result upPlan(@RequestBody InspectionProductList inspectionProductList) {
        planService.upPlan(inspectionProductList);
    @ApiImplicitParams(value = {
            @ApiImplicitParam(name = "id", value = "检验样品ID", dataTypeClass = Integer.class, required = true),
    })
    @PutMapping("/upPlan/{id}")
    public Result upPlan(@PathVariable Integer id ,@RequestBody InspectionProductListDto inspectionProductListDto) {
        planService.upPlan(id,inspectionProductListDto);
        return Result.success();
    }
@@ -61,7 +78,8 @@
    })
    @PutMapping("/delPlan/{id}")
    public Result delPlan(@PathVariable Integer id) {
        return Result.success(planService.delPlan(id));
        planService.delPlan(id);
        return Result.success();
    }
    @ApiOperation("查询成品检验")