value
2024-04-28 ecaf6326139d524e71c96b7fa459f452f8498065
inspect-server/src/main/java/com/yuanchu/mom/service/impl/StandardProductListServiceImpl.java
@@ -1,13 +1,13 @@
package com.yuanchu.mom.service.impl;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSONArray;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yuanchu.mom.mapper.StandardProductListMapper;
import com.yuanchu.mom.mapper.StandardTreeMapper;
import com.yuanchu.mom.pojo.InsSample;
import com.yuanchu.mom.pojo.StandardProductList;
import com.yuanchu.mom.service.StandardProductListService;
import com.yuanchu.mom.mapper.StandardProductListMapper;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;
@@ -27,6 +27,8 @@
        implements StandardProductListService {
    private StandardProductListMapper standardProductListMapper;
    private StandardTreeMapper standardTreeMapper;
    @Override
    public int upStandardProductList(StandardProductList list) {
@@ -73,8 +75,16 @@
    }
    @Override
    public List<StandardProductList> selectStandardProductListByMethodId(Integer id) {
        return standardProductListMapper.selectList(Wrappers.<StandardProductList>lambdaQuery().eq(StandardProductList::getStandardMethodListId, id));
    public List<StandardProductList> selectStandardProductListByMethodId(Integer id, String tree) {
        String[] trees = tree.split(" - ");
        List<StandardProductList> list;
        if(tree.length() == 3){
            list = standardTreeMapper.selectStandardProductListByTree(trees[2], trees[3]);
        }else{
            list = standardTreeMapper.selectStandardProductListByTree(trees[2], null);
        }
        List<StandardProductList> standardProductLists = standardProductListMapper.selectList(Wrappers.<StandardProductList>lambdaQuery().eq(StandardProductList::getStandardMethodListId, id));
        return list;
    }
}