| | |
| | | |
| | | 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) |
| | | public String addLinkBasicInformation(LinkBasicInformation linkBasicInformation) { |
| | |
| | | QueryWrapper<LinkBasicInformation> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.lambda().select(LinkBasicInformation::getId).eq(LinkBasicInformation::getUid, linkBasicInformation.getUid()); |
| | | LinkBasicInformation linkBasicInformation1 = linkBasicInformationMapper.selectOne(queryWrapper); |
| | | Optional.ofNullable(linkBasicInformation1.getId()).ifPresent(l->{ |
| | | Optional<Integer> optionalId = Optional.ofNullable(linkBasicInformation1) |
| | | .map(LinkBasicInformation::getId); |
| | | optionalId.ifPresent(l->{ |
| | | //执行删除 |
| | | linkDetectionMapper.deleteByLinkbasic(linkBasicInformation1.getId()); |
| | | linkBasicInformationMapper.deleteByID(linkBasicInformation1.getId()); |
| | |
| | | } |
| | | |
| | | @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())); |
| | | } |
| | | |
| | | |
| | | } |