From 8c834663344b1cc9c2ca569e6911900edd407f73 Mon Sep 17 00:00:00 2001
From: jinlin <jinlin>
Date: 星期四, 06 六月 2024 16:44:14 +0800
Subject: [PATCH] 修改

---
 modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/service/XhProductModelService.java |   27 ++++++++++++++++-----------
 1 files changed, 16 insertions(+), 11 deletions(-)

diff --git a/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/service/XhProductModelService.java b/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/service/XhProductModelService.java
index a5c1c22..5bb44b6 100644
--- a/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/service/XhProductModelService.java
+++ b/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/service/XhProductModelService.java
@@ -6,14 +6,10 @@
 import com.zt.common.utils.TreeUtils;
 import com.zt.life.modules.mainPart.basicInfo.dao.XhProductModelDao;
 import com.zt.life.modules.mainPart.basicInfo.model.ProductImg;
-import com.zt.life.modules.mainPart.basicInfo.model.TyProductModel;
 import com.zt.life.modules.mainPart.basicInfo.model.XhProductModel;
-import com.zt.life.modules.sysPictureBase.model.SysPictureBase;
-import com.zt.modules.sys.model.SysMenu;
 import org.springframework.stereotype.Service;
 import com.zt.common.db.query.QueryFilter;
 
-import javax.annotation.Resource;
 import java.util.List;
 
 
@@ -46,17 +42,24 @@
         super.deleteLogic(ids);
     }
 
-    public List<XhProductModel> getAllTree() {
-        List<XhProductModel> productList = baseDao.selectList(new QueryWrapper<XhProductModel>().eq(Constant.TableColumn.IS_DELETE,
-                Constant.Bool.NO).gt("product_type", 1).orderByAsc(Constant.TableColumn.SORT));
+    public List<XhProductModel> getAllTree(Boolean showXdy) {
+        List<XhProductModel> productList;
+        if (showXdy) {
+            productList = baseDao.selectList(new QueryWrapper<XhProductModel>().eq(Constant.TableColumn.IS_DELETE,
+                    Constant.Bool.NO).gt("product_type", 1).orderByAsc(Constant.TableColumn.SORT));
+        } else {
+            productList = baseDao.selectList(new QueryWrapper<XhProductModel>().eq(Constant.TableColumn.IS_DELETE,
+                    Constant.Bool.NO).gt("product_type", 1).ne("product_type", 10).orderByAsc(Constant.TableColumn.SORT));
+
+        }
         return TreeUtils.build(productList);
     }
 
-    public Integer getNo(Long pid) {
-        if (baseDao.getNo(pid) == null) {
+    public Integer getNo(Long pid, String productType) {
+        if (baseDao.getNo(pid, productType) == null) {
             return 0;
         }
-        return baseDao.getNo(pid);
+        return baseDao.getNo(pid,productType);
     }
 
     public List<XhProductModel> getProductList() {
@@ -65,7 +68,9 @@
     }
 
     public List<ProductImg> getProduct(Long productId) {
-        return baseDao.getProduct(productId);
+        XhProductModel model =this.get(productId);
+        Long parentId = model.getPid();
+        return baseDao.getProduct(productId,parentId);
     }
 
     public List<XhProductModel> getTaskProductList() {

--
Gitblit v1.9.1