| | |
| | | package com.yuanchu.limslaboratory.controller; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | 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.mapper.ProductMapper; |
| | | import com.yuanchu.limslaboratory.pojo.Material; |
| | | import com.yuanchu.limslaboratory.pojo.Product; |
| | | import com.yuanchu.limslaboratory.pojo.RawMaterial; |
| | | import com.yuanchu.limslaboratory.service.RawMaterialService; |
| | | import com.yuanchu.limslaboratory.service.*; |
| | | import com.yuanchu.limslaboratory.utils.RedisUtil; |
| | | import com.yuanchu.limslaboratory.vo.Result; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Objects; |
| | | |
| | |
| | | |
| | | @Autowired |
| | | private RawMaterialService rawMaterialService; |
| | | |
| | | @Autowired |
| | | private StandardService standardService; |
| | | |
| | | @Autowired |
| | | private MaterialService materialService; |
| | | |
| | | @Resource |
| | | private ProductMapper productMapper; |
| | | |
| | | @Resource |
| | | private InspectionService inspectionService; |
| | | |
| | | @ApiOperation("查询所有检验计划分配") |
| | | @ApiImplicitParams(value = { |
| | |
| | | } |
| | | return Result.fail("删除失败"); |
| | | } |
| | | |
| | | |
| | | @ApiOperation("获取物料名称") |
| | | @GetMapping("/getMaterielName") |
| | | @AuthHandler(type = InterfaceType.SELECT,menuId = MenuEnums.reportForInspection,isAdd = true) |
| | | public Result<?> getMaterielName(){ |
| | | LambdaQueryWrapper<Material> wrapper = new LambdaQueryWrapper<>(); |
| | | wrapper.select(Material::getId, Material::getName, Material::getCode); |
| | | List<Map<String, Object>> maps = materialService.listMaps(wrapper); |
| | | return Result.success(maps); |
| | | } |
| | | |
| | | @ApiOperation("获取规格型号") |
| | | @GetMapping("/specification") |
| | | @AuthHandler(type = InterfaceType.SELECT,menuId = MenuEnums.reportForInspection,isAdd = true) |
| | | public Result<?> getSpecificationIdAndName(String materialId) { |
| | | List<Map<String, Object>> specificationIdAndName = standardService.getSpecificationIdAndName(materialId); |
| | | return Result.success(specificationIdAndName); |
| | | } |
| | | |
| | | @ApiOperation("选择版本") |
| | | @GetMapping("/chooseVer") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "name", value = "产品名称", dataTypeClass = String.class, required = true), |
| | | @ApiImplicitParam(name = "mcode", value = "产品编号", dataTypeClass = String.class, required = true), |
| | | @ApiImplicitParam(name = "specifications", value = "规格型号", dataTypeClass = String.class, required = true) |
| | | }) |
| | | @AuthHandler(type = InterfaceType.SELECT,menuId = MenuEnums.reportForInspection,isAdd = true) |
| | | public Result<?> chooseVer(String name, String mcode, String specifications) { |
| | | return Result.success(inspectionService.chooseVer(name, mcode, specifications)); |
| | | } |
| | | |
| | | |
| | | |
| | | } |