| | |
| | | import com.yuanchu.limslaboratory.annotation.AuthHandler; |
| | | import com.yuanchu.limslaboratory.enums.InterfaceType; |
| | | import com.yuanchu.limslaboratory.enums.MenuEnums; |
| | | import com.yuanchu.limslaboratory.mapper.LinkDetectionMapper; |
| | | import com.yuanchu.limslaboratory.pojo.LinkBasicInformation; |
| | | import com.yuanchu.limslaboratory.pojo.LinkDetection; |
| | | import com.yuanchu.limslaboratory.pojo.vo.InspectionVo; |
| | | import com.yuanchu.limslaboratory.service.InspectionService; |
| | | import com.yuanchu.limslaboratory.service.LinkBasicInformationService; |
| | |
| | | |
| | | @Resource |
| | | private InspectionService inspectionService; |
| | | |
| | | @Resource |
| | | private LinkDetectionMapper linkDetectionMapper; |
| | | |
| | | @ApiOperation("链接-->获取链接") |
| | | @GetMapping("/link") |
| | |
| | | @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) |
| | | @ApiImplicitParam(name = "id", value = "id", dataTypeClass = String.class, required = true), |
| | | }) |
| | | @AuthHandler(type = InterfaceType.SELECT,menuId = MenuEnums.commissionInspection,isAdd = true) |
| | | public Result<?> chooseVer(String name, String mcode, String specifications) { |
| | | return Result.success(inspectionService.chooseVer(name, mcode, specifications)); |
| | | public Result<?> chooseVer(String name, String id, String specifications) { |
| | | LinkDetection linkDetection = linkDetectionMapper.selectById(id); |
| | | return Result.success(linkBasicInformationService.chooseVer(linkDetection)); |
| | | } |
| | | |
| | | |
| | |
| | | public Result addInspect(@RequestHeader("X-Token") String token, @Validated @RequestBody InspectionVo inspectionVo) throws Exception { |
| | | Object object = RedisUtil.get(token); |
| | | Map<String, Object> unmarshal = JackSonUtil.unmarshal(JackSonUtil.marshal(object), Map.class); |
| | | LinkDetection linkDetection = linkDetectionMapper.selectById(inspectionVo.getId()); |
| | | return Result.success(inspectionService.addInspect((Integer) unmarshal.get("id"), inspectionVo)); |
| | | } |
| | | |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yuanchu.limslaboratory.pojo.LinkBasicInformation; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.yuanchu.limslaboratory.pojo.LinkDetection; |
| | | import com.yuanchu.limslaboratory.pojo.Specifications; |
| | | import com.yuanchu.limslaboratory.pojo.vo.InspectionVo; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | |
| | | |
| | | Specifications getSpecificationsName(String id); |
| | | |
| | | Object lookProByVer(String name, String mcode, String specifications,Integer version, Integer id); |
| | | List<Map<String,Object>> lookProByVer(String name, String mcode, String specifications,Integer version, Integer id); |
| | | |
| | | Object chooseVer(LinkDetection linkDetection); |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yuanchu.limslaboratory.mapper.LinkDetectionMapper; |
| | | import com.yuanchu.limslaboratory.mapper.ProductMapper; |
| | | import com.yuanchu.limslaboratory.mapper.SpecificationsMapper; |
| | | import com.yuanchu.limslaboratory.pojo.LinkBasicInformation; |
| | | import com.yuanchu.limslaboratory.mapper.LinkBasicInformationMapper; |
| | |
| | | |
| | | @Resource |
| | | private InspectionService inspectionService; |
| | | |
| | | @Resource |
| | | private ProductMapper productMapper; |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | |
| | | } |
| | | |
| | | @Override |
| | | public Object lookProByVer(String name, String mcode, String specifications,Integer version, Integer id) { |
| | | public List<Map<String,Object>> lookProByVer(String name, String mcode, String specifications,Integer version, Integer id) { |
| | | LinkDetection linkDetection = linkDetectionMapper.selectById(id); |
| | | return inspectionService.lookProByVer(name, mcode, specifications, version, linkDetection.getExperiment()); |
| | | System.out.println(linkDetection); |
| | | List<String> experiments = Arrays.stream(linkDetection.getExperiment().split(",")).collect(Collectors.toList()); |
| | | System.out.println(experiments); |
| | | System.out.println("=============================="); |
| | | //根据型号id和项目信息查询项目信息 |
| | | List<Map<String, Object>> products = new ArrayList<>(); |
| | | for (String exper : experiments) { |
| | | List<Map<String, Object>> list = productMapper.selFath(Integer.parseInt(linkDetection.getSpecificationsModels()), exper, version); |
| | | if (ObjectUtils.isEmpty(list)) { |
| | | Map<String, Object> project = productMapper.selNam(Integer.parseInt(linkDetection.getSpecificationsModels()), exper, version); |
| | | products.add(project); |
| | | } |
| | | products.addAll(list); |
| | | } |
| | | return products; |
| | | } |
| | | |
| | | |
| | | |
| | | @Override |
| | | public Object chooseVer( LinkDetection linkDetection) { |
| | | return productMapper.chooseVersion(Integer.parseInt(linkDetection.getSpecificationsModels())); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | ld.experiment experiment, |
| | | ld.samples_number samplesNumber, |
| | | ld.remarks remarks, |
| | | s.name speName |
| | | ld.spe_name speName |
| | | FROM link_basic_information lb left join |
| | | link_detection ld |
| | | on lb.id = ld.link_basic_id |