| | |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yuanchu.limslaboratory.mapper.ProductModelMapper; |
| | | import com.yuanchu.limslaboratory.mapper.SpecificationsMapper; |
| | | import com.yuanchu.limslaboratory.pojo.Product; |
| | | import com.yuanchu.limslaboratory.mapper.ProductMapper; |
| | | import com.yuanchu.limslaboratory.pojo.ProductModel; |
| | | import com.yuanchu.limslaboratory.service.ProductService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.yuanchu.limslaboratory.utils.MyUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import com.yuanchu.limslaboratory.service.UserService; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.ObjectUtils; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务实现类 |
| | | * 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author 江苏鵷雏网络科技有限公司 |
| | |
| | | @Resource |
| | | private ProductMapper productMapper; |
| | | |
| | | @Resource |
| | | ProductModelMapper productModelMapper; |
| | | |
| | | |
| | | @Override |
| | | public void deleteProductInformation(List<Integer> SpecificationsId) { |
| | | for (Integer materialId : SpecificationsId){ |
| | |
| | | } |
| | | } |
| | | |
| | | //展示该型号下的检验项目要求 |
| | | @Override |
| | | public IPage<Map<String, Object>> pageProductInformation(String productCodeOrName, Integer specificationsId, Page<Objects> page) { |
| | | IPage<Map<String, Object>> iPage = productMapper.pageProductInformation(productCodeOrName, specificationsId, page); |
| | | List<Map<String, Object>> maps = iPage.getRecords(); |
| | | MyUtil.PrintLog(maps.toString()); |
| | | maps.forEach(map -> { |
| | | int num = Integer.parseInt(map.get("num").toString()); |
| | | boolean children = false; |
| | | if (num > 1){ |
| | | children = true; |
| | | } else { |
| | | Map<String, Object> product = productMapper.selectOneChildren(map.get("father")); |
| | | map.putAll(product); |
| | | } |
| | | map.put("children", children); |
| | | map.remove("num"); |
| | | }); |
| | | return iPage; |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public List<Map<String, Object>> pageProductInformation(Integer specificationsId) { |
| | | return productMapper.pageProductInformation(specificationsId); |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> pageFatherNameProductInformation(String fatherName) { |
| | | LambdaQueryWrapper<Product> wrapper = new LambdaQueryWrapper<>(); |
| | | wrapper.eq(Product::getFather, fatherName); |
| | | wrapper.select(Product::getId, Product::getName, Product::getUnit, Product::getRequired, Product::getInternal); |
| | | return productMapper.selectMaps(wrapper); |
| | | } |
| | | |
| | | } |