value
2024-05-18 8e89de5320fbfebc14851fc4fd7ea9231ba28896
inspect-server/src/main/java/com/yuanchu/mom/service/impl/StandardProductListServiceImpl.java
@@ -40,6 +40,9 @@
    @Override
    public int upStandardProductList(StandardProductList list) {
        /*if(list.getId()==null || list.getId().equals("")){
        }*/
        return standardProductListMapper.updateById(list);
    }
@@ -106,12 +109,27 @@
        List<StandardProductList> list = new ArrayList<>();
        if (trees.length == 3) {
            List<StandardTree> treeList = standardTreeMapper.selectList(Wrappers.<StandardTree>lambdaQuery().eq(StandardTree::getLaboratory, trees[1]).eq(StandardTree::getSampleType, trees[2]));
            if(treeList.size()==0){
                StandardTree standardTree = new StandardTree();
                standardTree.setFactory(trees[0]);
                standardTree.setLaboratory(trees[1]);
                standardTree.setSampleType(trees[2]);
                treeList.add(standardTree);
            }
            for (StandardTree standardTree : treeList) {
                String str = tree+" - "+standardTree.getSample()+" - "+standardTree.getModel();
                list.addAll(standardTreeMapper.selectStandardProductListByTree3("\"" + trees[2] + "\"", standardTree.getSample(), standardTree.getModel(), str));
            }
        } else if (trees.length == 4){
            List<StandardTree> treeList = standardTreeMapper.selectList(Wrappers.<StandardTree>lambdaQuery().eq(StandardTree::getLaboratory, trees[1]).eq(StandardTree::getSampleType, trees[2]).eq(StandardTree::getSample, trees[3]));
            if(treeList.size()==0){
                StandardTree standardTree = new StandardTree();
                standardTree.setFactory(trees[0]);
                standardTree.setLaboratory(trees[1]);
                standardTree.setSampleType(trees[2]);
                standardTree.setSample(trees[2]);
                treeList.add(standardTree);
            }
            for (StandardTree standardTree : treeList) {
                String str = tree+" - "+standardTree.getModel();
                list.addAll(standardTreeMapper.selectStandardProductListByTree("\"" + trees[2] + "\"", standardTree.getSample(), standardTree.getModel(), str));
@@ -125,10 +143,14 @@
        for (StandardProductList sp : standardProductLists) {
            for (StandardProductList pl : list) {
                if (Objects.equals(sp.getInspectionItem(), pl.getInspectionItem())
                        && Objects.equals(sp.getInspectionItemSubclass(), pl.getInspectionItemSubclass())
                        && Objects.equals(sp.getModel(), pl.getModel())) {
                        && Objects.equals(sp.getInspectionItemSubclass()==null?"":sp.getInspectionItemSubclass(), pl.getInspectionItemSubclass()==null?"":pl.getInspectionItemSubclass())
                        && Objects.equals(sp.getModel(), pl.getModel()) && Objects.equals(sp.getStructureItemParameterId(), pl.getStructureItemParameterId())) {
                    pl.setId(sp.getId());
                    pl.setState(id==0?1:sp.getState());
                    if(sp.getState()!=null&&!sp.getState().equals("")){
                        pl.setState(sp.getState());
                    }else{
                        pl.setState(id==0?1:0);
                    }
                    pl.setMethodS(sp.getMethodS());
                    if(sp.getAsk()!=null&&!sp.getAsk().equals("")){
                        pl.setAsk(sp.getAsk());