package com.yuanchu.limslaboratory.controller;
|
|
|
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;
|
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;
|
|
@Resource
|
ProductService productService;
|
|
@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("根据项目名查询所有试验方法")
|
@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),
|
})
|
@PutMapping("/upPlan/{id}")
|
public Result upPlan(@PathVariable Integer id ,@RequestBody InspectionProductListDto inspectionProductListDto) {
|
planService.upPlan(id,inspectionProductListDto);
|
return Result.success();
|
}
|
|
@ApiOperation("作废检验计划")
|
@ApiImplicitParams(value = {
|
@ApiImplicitParam(name = "id", value = "检验计划ID", dataTypeClass = Integer.class, required = true),
|
})
|
@PutMapping("/delPlan/{id}")
|
public Result delPlan(@PathVariable Integer id) {
|
planService.delPlan(id);
|
return Result.success();
|
}
|
|
@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("/selectInspection")
|
public Result selectInspection(int pageSize, int countSize, Integer state) {
|
return Result.success(planService.selectInspection(pageSize,countSize,state));
|
}
|
}
|