Crunchy
2024-05-16 58a75277a83e48baa8ff9906e27975960659ff8a
inspect-server/src/main/java/com/yuanchu/mom/service/impl/StandardProductListServiceImpl.java
@@ -16,9 +16,7 @@
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.*;
import java.util.concurrent.CompletableFuture;
import java.util.stream.Collectors;
@@ -103,7 +101,7 @@
    }
    @Override
    public List<StandardProductList> selectStandardProductListByMethodId(Integer id, String tree) {
    public Map<String, Object> selectStandardProductListByMethodId(Integer id, String tree, Integer page) {
        String[] trees = tree.split(" - ");
        List<StandardProductList> list = new ArrayList<>();
        if (trees.length == 3) {
@@ -154,6 +152,7 @@
                }
            }
        }
        if(page == 1){
        Integer userId = getLook.selectPowerByMethodAndUserId(null).get("userId");
        CompletableFuture.supplyAsync(() -> {
            standardProductListMapper.delete(Wrappers.<StandardProductList>lambdaUpdate().eq(StandardProductList::getStandardMethodListId, id).like(StandardProductList::getTree, tree));
@@ -172,7 +171,15 @@
            e.printStackTrace();
            return null;
        });
        return list;
        }
        Map<String, Object> map = new HashMap<>();
        try {
            map.put("productList", list.subList((page - 1)*50, page * 50));
        }catch (IndexOutOfBoundsException e){
            map.put("productList", list.subList((page - 1)*50, list.size()));
        }
        map.put("total", list.size());
        return map;
    }
}