| | |
| | | package com.ruoyi.basic.service.impl; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.basic.mapper.WorkShopFileMapper; |
| | | import com.ruoyi.basic.pojo.WorkShopFile; |
| | | import com.ruoyi.basic.mapper.*; |
| | | import com.ruoyi.basic.pojo.*; |
| | | import com.ruoyi.basic.service.WorkShopFileService; |
| | | import com.ruoyi.common.utils.file.MinioUtils; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | |
| | | |
| | | @Resource |
| | | private WorkShopFileMapper workShopFileMapper; |
| | | |
| | | @Resource |
| | | private ProductPartMapper productPartMapper; |
| | | |
| | | @Resource |
| | | private ProductMapper productMapper; |
| | | @Resource |
| | | private StructureTestObjectPartMapper structureTestObjectPartMapper; |
| | | |
| | | @Resource |
| | | private StructureTestObjectMapper structureTestObjectMapper; |
| | | |
| | | @Resource |
| | | private MinioUtils minioUtils; |
| | |
| | | return 0; |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public IPage<WorkShopFile> partFileList(Page page, String partNo) { |
| | | StructureTestObject structureTestObject = findStructureTestObjectByPartNo(partNo); |
| | | if (structureTestObject != null && structureTestObject.getWorkShopId() != null) { |
| | | return workShopFileMapper.selectPage(page, new LambdaQueryWrapper<WorkShopFile>().eq(WorkShopFile::getWorkShopId, structureTestObject.getWorkShopId())); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | private StructureTestObject findStructureTestObjectByPartNo(String partNo) { |
| | | ProductPart productPart = productPartMapper.selectOne(new LambdaQueryWrapper<ProductPart>().eq(ProductPart::getPartNo, partNo)); |
| | | if (productPart != null) { |
| | | Product product = productMapper.selectById(productPart.getProductId()); |
| | | if (product != null) { |
| | | return structureTestObjectMapper.selectById(product.getObjectId()); |
| | | } |
| | | } |
| | | StructureTestObjectPart structureTestObjectPart = structureTestObjectPartMapper.selectOne(new LambdaQueryWrapper<StructureTestObjectPart>().eq(StructureTestObjectPart::getPartNo, partNo)); |
| | | if (structureTestObjectPart != null) { |
| | | return structureTestObjectMapper.selectById(structureTestObjectPart.getTestObjectId()); |
| | | } |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | |