2510966293@qq.com il y a 5 ans
Parent
commit
51fa9c3f94

+ 7 - 0
src/main/java/com/yc/education/controller/admin/ServiceCategoryAdminController.java

@@ -75,6 +75,13 @@ public class ServiceCategoryAdminController {
 
 
         for (ServiceCategory one : listAllSecondService) {
+            // 下面是否还有分类
+            List<ServiceCategory> list = iServiceCategoryService.listServiceCategoryByPid(one.getId());
+            if(list != null && list.size()>0){
+                one.setHaveList(true);
+            }else {
+                one.setHaveList(false);
+            }
             // 一级分类
             for (ServiceCategory two : listAllFirstService) {
                 if(one.getpId().toString().equals(two.getId().toString())){

+ 17 - 0
src/main/java/com/yc/education/model/ServiceCategory.java

@@ -3,6 +3,7 @@ package com.yc.education.model;
 import javax.persistence.*;
 import java.io.Serializable;
 import java.util.Date;
+import java.util.List;
 
 @Table(name = "service_category")
 public class ServiceCategory  implements Serializable {
@@ -16,6 +17,14 @@ public class ServiceCategory  implements Serializable {
     @Transient
     private String ids;
 
+    /**
+    * @Description: 下面有分类
+    * @Author: BlueSky
+    * @CreateTime: 2019/10/16 19:16
+    */
+    @Transient
+    private boolean haveList;
+
     /**
     * @Description: 类型
     * @Author: BlueSky
@@ -134,6 +143,14 @@ public class ServiceCategory  implements Serializable {
         this.threePId = threePId;
     }
 
+    public boolean isHaveList() {
+        return haveList;
+    }
+
+    public void setHaveList(boolean haveList) {
+        this.haveList = haveList;
+    }
+
     /**
      * 获取主键id
      *

+ 1 - 0
src/main/webapp/WEB-INF/jsp/admin/serviceCategoryList.jsp

@@ -112,6 +112,7 @@
                     <td><fmt:formatDate value="${item.createDate}" pattern="yyyy-MM-dd HH:mm:ss"></fmt:formatDate></td>
                     <td>${item.pSort}</td>
                     <td class="f-14 td-manage">
+                        <c:if test="${item.haveList}"><a href="serviceCategoryPidList.html?id=${item.id}"><i class="Hui-iconfont">&#xe667;</i></a></c:if>
                         <a style="text-decoration:none" class="ml-5" href="serviceCategoryUpdate.html?id=${item.id }" title="查看"><i
                                 class="Hui-iconfont">&#xe6df;</i></a>
                         <a href="javascript:del(${item.id })"><i class="Hui-iconfont">&#xe6e2;</i></a>