xyc
2024-08-02 7abc95a191d2c1a9bb9ff8fd7fb05470a0d4e86b
modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/service/XhProductModelService.java
@@ -61,12 +61,18 @@
        super.deleteLogic(ids);
    }
    public List<XhProductModel> getAllTree(Boolean showXdy, Integer ztShow) {
    public List<XhProductModel> getAllTree(Boolean showXdy, Integer ztShow, Long productId) {
        List<XhProductModel> productList = null;
        if (showXdy) {
            if (productId != null) {
                productList = baseDao.selectList(new QueryWrapper<XhProductModel>().eq(Constant.TableColumn.IS_DELETE,
                        Constant.Bool.NO).ne("product_type", 5).and(wrapper -> wrapper.eq("ship_id", productId).or().eq("id", productId)).orderByAsc(Constant.TableColumn.SORT));
            } else {
            productList = baseDao.selectList(new QueryWrapper<XhProductModel>().eq(Constant.TableColumn.IS_DELETE,
                    Constant.Bool.NO).ne("product_type", 5).orderByAsc(Constant.TableColumn.SORT));
            }
        } else {
            if (productId == null) {
            if (ztShow == 1) {
                productList = baseDao.selectList(new QueryWrapper<XhProductModel>().eq(Constant.TableColumn.IS_DELETE,
                        Constant.Bool.NO).lt("product_type", 5).ne("product_type", 10).orderByAsc(Constant.TableColumn.SORT));
@@ -83,7 +89,15 @@
                productList = baseDao.selectList(new QueryWrapper<XhProductModel>().eq(Constant.TableColumn.IS_DELETE,
                        Constant.Bool.NO).gt("product_type", 1).orderByAsc(Constant.TableColumn.SORT));
            }
            } else {
                if (ztShow == 4) {
                    productList = baseDao.selectList(new QueryWrapper<XhProductModel>().eq(Constant.TableColumn.IS_DELETE,
                            Constant.Bool.NO).lt("product_type", 5).ne("product_type", 1).and(wrapper -> wrapper.eq("ship_id", productId).or().eq("id", productId)).orderByAsc(Constant.TableColumn.SORT));
                } else if (ztShow == 5) {
                    productList = baseDao.selectList(new QueryWrapper<XhProductModel>().eq(Constant.TableColumn.IS_DELETE,
                            Constant.Bool.NO).gt("product_type", 1).and(wrapper -> wrapper.eq("ship_id", productId).or().eq("id", productId)).orderByAsc(Constant.TableColumn.SORT));
                }
            }
        }
        return TreeUtils.build(productList);
    }