| | |
| | | package com.yuanchu.limslaboratory.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yuanchu.limslaboratory.annotation.AuthHandler; |
| | | import com.yuanchu.limslaboratory.enums.InterfaceType; |
| | | import com.yuanchu.limslaboratory.enums.MenuEnums; |
| | | import com.yuanchu.limslaboratory.pojo.Product; |
| | | import com.yuanchu.limslaboratory.pojo.dto.StandardProductAddDto; |
| | | import com.yuanchu.limslaboratory.service.ProductService; |
| | | import com.yuanchu.limslaboratory.utils.MyUtil; |
| | | import com.yuanchu.limslaboratory.vo.Result; |
| | | import io.swagger.annotations.*; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @Autowired |
| | | private ProductService productService; |
| | | |
| | | @ApiOperation("查询该型号下的项目") |
| | | @ApiOperation("查询该型号下的项目-->选择版本") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "specificationsId", value = "型号ID", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | @GetMapping("/chooseVersion") |
| | | @AuthHandler |
| | | public Result<?> chooseVersion(Integer specificationsId) { |
| | | return Result.success(productService.chooseVersion(specificationsId)); |
| | | } |
| | | |
| | | @ApiOperation("查询该型号下的项目") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "specificationsId", value = "型号ID", dataTypeClass = Integer.class, required = true), |
| | | @ApiImplicitParam(name = "version", value = "版本(默认最新版本)", dataTypeClass = Integer.class,required = true ) |
| | | }) |
| | | @GetMapping("/page") |
| | | public Result<?> pageProductInformation(Integer specificationsId) { |
| | | return Result.success(productService.pageProductInformation(specificationsId)); |
| | | @AuthHandler |
| | | public Result<?> pageProductInformation(Integer specificationsId,Integer version) { |
| | | return Result.success(productService.pageProductInformation(specificationsId,version)); |
| | | } |
| | | |
| | | @ApiOperation("填写标准值与内控值,鼠标移开保存") |
| | |
| | | @ApiImplicitParam(name = "id", value = "标准项目ID", dataTypeClass = Integer.class, required = true), |
| | | @ApiImplicitParam(name = "required", value = "标准值", dataTypeClass = String.class, required = true), |
| | | @ApiImplicitParam(name = "internal", value = "内控值", dataTypeClass = String.class, required = true) |
| | | |
| | | }) |
| | | @PostMapping("/write") |
| | | @AuthHandler |
| | | public Result<?> write(Integer id, String required, String internal) { |
| | | Integer write = productService.write(id, required, internal); |
| | | if (write >= 1){ |
| | |
| | | @ApiImplicitParam(name = "ids", value = "标准项目ID", dataTypeClass = String.class, required = true) |
| | | }) |
| | | @DeleteMapping("/deleteList") |
| | | @AuthHandler |
| | | public Result<?> deleteList(String ids) { |
| | | if(ids==null||ids.equals(""))return Result.fail(); |
| | | MyUtil.PrintLog(ids); |
| | | productService.deleteList(ids); |
| | | return Result.success("删除成功"); |
| | | } |
| | | |
| | | @ApiOperation("添加同一个型号的其他版本") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "specificationsId", value = "型号id", dataTypeClass = Integer.class, required = true), |
| | | @ApiImplicitParam(name = "version", value = "当前版本", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | @PostMapping("/addVersion") |
| | | @AuthHandler |
| | | public Result<?> addVersion(Integer specificationsId,Integer version ) { |
| | | Integer version1 = productService.addVersion(specificationsId,version); |
| | | return Result.success("添加版本"+version1+"成功"); |
| | | } |
| | | |
| | | @ApiOperation("标注库-》添加项目") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "specificationId", value = "型号id", dataTypeClass = Integer.class, required = true), |
| | | @ApiImplicitParam(name = "version", value = "当前版本", dataTypeClass = Integer.class, required = true), |
| | | @ApiImplicitParam(name = "name", value = "项目名", dataTypeClass = String.class, required = true), |
| | | @ApiImplicitParam(name = "father", value = "项目分组", dataTypeClass = String.class, required = true), |
| | | @ApiImplicitParam(name = "unit", value = "单位", dataTypeClass = String.class, required = true), |
| | | }) |
| | | @PostMapping("/addProduct") |
| | | @AuthHandler(type = InterfaceType.ADD,menuId = MenuEnums.index,isAdd = true) |
| | | public Result<?> addProduct(@RequestBody StandardProductAddDto dto){ |
| | | return Result.success(productService.addProduct(dto)); |
| | | } |
| | | |
| | | |
| | | |
| | | } |