Crunchy
2024-07-24 22837aa98ddddb25764d6d97e0e13c3df45df5be
inspect-server/src/main/java/com/yuanchu/mom/service/impl/StandardProductListServiceImpl.java
@@ -58,20 +58,18 @@
    @Override
    public List<StandardProductList> selectStandardProductList(InsSample insSample) {
        String[] models = insSample.getModel().split("-(?=[^-]*$)");//拆分最后一个【-】
        String[] factorys = insSample.getFactory().split(" - ");
        //List<StandardProductList> list = standardProductListMapper.selectList(Wrappers.<StandardProductList>lambdaQuery().eq(StandardProductList::getStandardMethodListId, insSample.getStandardMethodListId()).eq(StandardProductList::getState, 1).eq(StandardProductList::getModel, models[0]).eq(StandardProductList::getSampleType, factorys[2]));
        List<StandardProductList> list = standardProductListMapper.selectDetail(insSample.getStandardMethodListId(), 1, models[0]);
        if (list.size() == 0) {
            if (Objects.equals(insSample.getFactory(), "") || insSample.getFactory() == null) {
                return null;
            }
            String[] split = insSample.getFactory().split(" - ");
            list = standardProductListMapper.selectDetail2(insSample.getStandardMethodListId(), 1, split[0] + " - " + split[1] + " - " + split[2] + " - " + split[3]);
           /* list = standardProductListMapper.selectList(Wrappers.<StandardProductList>lambdaQuery()
                    .eq(StandardProductList::getStandardMethodListId, insSample.getStandardMethodListId())
                    .eq(StandardProductList::getState, 1)
                    .like(StandardProductList::getTree, split[0] + " - " + split[1] + " - " + split[2] + " - " + split[3]));*/
            String tree = split[0] + " - " + split[1] + " - " + split[2] + " - " + split[3] + " - null";
            list = standardProductListMapper.selectDetail2(insSample.getStandardMethodListId(), 1, tree);
            if (list.size()==0){
                String tree1 = split[0] + " - " + split[1] + " - " + split[2] + " - null - " + split[3] ;
                list = standardProductListMapper.selectDetail2(insSample.getStandardMethodListId(), 1, tree1);
            }
        }
        list = list.stream().filter(a -> {
            try {
@@ -237,6 +235,7 @@
        if (page == 1) {
            Integer userId = getLook.selectPowerByMethodAndUserId(null).get("userId");
            CompletableFuture.supplyAsync(() -> {
                System.out.println("开始开始开始开始!!!!!!!!!!");
                if (trees.length == 5) {
                    standardProductListMapper.delete(Wrappers.<StandardProductList>lambdaUpdate().eq(StandardProductList::getStandardMethodListId, id).eq(StandardProductList::getTree, tree));
                } else {
@@ -251,6 +250,7 @@
                    a.setStandardMethodListId(id);
                    return a;
                }).collect(Collectors.toList()));
                System.out.println("结束结束结束结束@@@@@@@@@@@@");
                return null;
            }).thenAccept(res -> {
            }).exceptionally(e -> {