Эх сурвалжийг харах

增加网站文章相关功能,后期拆分为独立的module

hfxc226 2 жил өмнө
parent
commit
1f65143c24
16 өөрчлөгдсөн 399 нэмэгдсэн , 13 устгасан
  1. 86 0
      platform-dao/src/main/java/com/platform/dao/util/TreeUtil.java
  2. 12 0
      platform-rest/src/main/java/com/platform/rest/controller/qykh/QykhHotspotController.java
  3. 12 1
      platform-rest/src/main/java/com/platform/rest/controller/qykh/QykhInformationController.java
  4. 12 1
      platform-rest/src/main/java/com/platform/rest/controller/qykh/QykhPlanController.java
  5. 13 2
      platform-rest/src/main/java/com/platform/rest/controller/qykh/QykhProductController.java
  6. 5 0
      platform-service/src/main/java/com/platform/service/qykh/QykhHotspotService.java
  7. 5 0
      platform-service/src/main/java/com/platform/service/qykh/QykhInformationService.java
  8. 5 0
      platform-service/src/main/java/com/platform/service/qykh/QykhPlanService.java
  9. 5 0
      platform-service/src/main/java/com/platform/service/qykh/QykhProductService.java
  10. 57 0
      platform-service/src/main/java/com/platform/service/qykh/impl/QykhHotspotServiceImpl.java
  11. 55 0
      platform-service/src/main/java/com/platform/service/qykh/impl/QykhInformationServiceImpl.java
  12. 55 0
      platform-service/src/main/java/com/platform/service/qykh/impl/QykhPlanServiceImpl.java
  13. 59 0
      platform-service/src/main/java/com/platform/service/qykh/impl/QykhProductServiceImpl.java
  14. 6 3
      platform-service/src/main/resources/application-serviceDev.yml
  15. 6 3
      platform-service/src/main/resources/application-serviceProd.yml
  16. 6 3
      platform-service/src/main/resources/application-serviceTest.yml

+ 86 - 0
platform-dao/src/main/java/com/platform/dao/util/TreeUtil.java

@@ -16,6 +16,10 @@ import com.platform.dao.entity.upms.SysDict;
 import com.platform.dao.entity.upms.SysMenu;
 import com.platform.dao.pojo.CommonTree;
 import com.platform.dao.pojo.TreeNode;
+import com.platform.dao.vo.query.qykh.HotspotVO;
+import com.platform.dao.vo.query.qykh.InformationVO;
+import com.platform.dao.vo.query.qykh.PlanVO;
+import com.platform.dao.vo.query.qykh.ProductVO;
 import com.platform.dao.vo.query.store.StoreVO;
 import com.platform.dao.vo.sb.SbTypeVO;
 import lombok.experimental.UtilityClass;
@@ -324,6 +328,8 @@ public class TreeUtil {
         return TreeUtil.buildByLoop(trees, root);
     }
 
+
+
     /**
      * 创建设备位置树
      *
@@ -472,4 +478,84 @@ public class TreeUtil {
         return TreeUtil.buildByLoop(trees, root);
     }
 
+    /**
+     * 创建树
+     *
+     * @param voList
+     * @param root
+     * @return
+     */
+    public List<CommonTree> buildQykhHotspotTree(List<HotspotVO> voList, String root) {
+        List<CommonTree> trees = new LinkedList<>();
+        voList.forEach(type -> {
+            CommonTree node = new CommonTree();
+            node.setId(type.getId() + "");
+            node.setKey(type.getId() + "");
+            node.setParentId(type.getHid() + "");
+            node.setTitle(type.getHname());
+            node.setValue(type.getId() + "");
+            trees.add(node);
+        });
+        return TreeUtil.buildByLoop(trees, root);
+    }
+    /**
+     * 创建树
+     *
+     * @param voList
+     * @param root
+     * @return
+     */
+    public List<CommonTree> buildQykhProductTree(List<ProductVO> voList, String root) {
+        List<CommonTree> trees = new LinkedList<>();
+        voList.forEach(type -> {
+            CommonTree node = new CommonTree();
+            node.setId(type.getId() + "");
+            node.setKey(type.getId() + "");
+            node.setParentId(type.getPid() + "");
+            node.setTitle(type.getPname());
+            node.setValue(type.getId() + "");
+            trees.add(node);
+        });
+        return TreeUtil.buildByLoop(trees, root);
+    }
+    /**
+     * 创建树
+     *
+     * @param voList
+     * @param root
+     * @return
+     */
+    public List<CommonTree> buildQykhPlanTree(List<PlanVO> voList, String root) {
+        List<CommonTree> trees = new LinkedList<>();
+        voList.forEach(type -> {
+            CommonTree node = new CommonTree();
+            node.setId(type.getId() + "");
+            node.setKey(type.getId() + "");
+            node.setParentId(type.getPid() + "");
+            node.setTitle(type.getPlanname());
+            node.setValue(type.getId() + "");
+            trees.add(node);
+        });
+        return TreeUtil.buildByLoop(trees, root);
+    }
+    /**
+     * 创建树
+     *
+     * @param voList
+     * @param root
+     * @return
+     */
+    public List<CommonTree> buildQykhInformationTree(List<InformationVO> voList, String root) {
+        List<CommonTree> trees = new LinkedList<>();
+        voList.forEach(type -> {
+            CommonTree node = new CommonTree();
+            node.setId(type.getId() + "");
+            node.setKey(type.getId() + "");
+            node.setParentId(type.getPid() + "");
+            node.setTitle(type.getInforname());
+            node.setValue(type.getId() + "");
+            trees.add(node);
+        });
+        return TreeUtil.buildByLoop(trees, root);
+    }
 }

+ 12 - 0
platform-rest/src/main/java/com/platform/rest/controller/qykh/QykhHotspotController.java

@@ -3,6 +3,8 @@ package com.platform.rest.controller.qykh;
 import com.platform.common.util.R;
 import com.platform.common.validation.group.AddGroup;
 import com.platform.common.validation.group.UpdateGroup;
+import com.platform.dao.dto.sb.SbTypeDTO;
+import com.platform.dao.util.TreeUtil;
 import com.platform.dao.vo.query.qykh.HotspotVO;
 import com.platform.rest.log.annotation.SysLog;
 import com.platform.service.qykh.QykhHotspotService;
@@ -65,5 +67,15 @@ public class QykhHotspotController {
         return new R();
     }
 
+    /**
+     * 获取设备tree
+     *
+     * @param infoAdapterVO
+     * @return R
+     */
+    @GetMapping("tree")
+    public R queryTree(HotspotVO infoAdapterVO) {
+        return new R<>(TreeUtil.buildQykhHotspotTree(qykhPlanDetailsService.selectList(infoAdapterVO), ""));
+    }
 
 }

+ 12 - 1
platform-rest/src/main/java/com/platform/rest/controller/qykh/QykhInformationController.java

@@ -3,6 +3,8 @@ package com.platform.rest.controller.qykh;
 import com.platform.common.util.R;
 import com.platform.common.validation.group.AddGroup;
 import com.platform.common.validation.group.UpdateGroup;
+import com.platform.dao.util.TreeUtil;
+import com.platform.dao.vo.query.qykh.HotspotVO;
 import com.platform.dao.vo.query.qykh.InformationVO;
 import com.platform.rest.log.annotation.SysLog;
 import com.platform.service.qykh.QykhInformationService;
@@ -65,5 +67,14 @@ public class QykhInformationController {
         return new R();
     }
 
-
+    /**
+     * 获取设备tree
+     *
+     * @param infoAdapterVO
+     * @return R
+     */
+    @GetMapping("tree")
+    public R queryTree(InformationVO infoAdapterVO) {
+        return new R<>(TreeUtil.buildQykhInformationTree(qykhPlanDetailsService.selectList(infoAdapterVO), ""));
+    }
 }

+ 12 - 1
platform-rest/src/main/java/com/platform/rest/controller/qykh/QykhPlanController.java

@@ -3,6 +3,8 @@ package com.platform.rest.controller.qykh;
 import com.platform.common.util.R;
 import com.platform.common.validation.group.AddGroup;
 import com.platform.common.validation.group.UpdateGroup;
+import com.platform.dao.util.TreeUtil;
+import com.platform.dao.vo.query.qykh.HotspotVO;
 import com.platform.dao.vo.query.qykh.PlanVO;
 import com.platform.rest.log.annotation.SysLog;
 import com.platform.service.qykh.QykhPlanDetailsService;
@@ -66,5 +68,14 @@ public class QykhPlanController {
         return new R();
     }
 
-
+    /**
+     * 获取设备tree
+     *
+     * @param infoAdapterVO
+     * @return R
+     */
+    @GetMapping("tree")
+    public R queryTree(PlanVO infoAdapterVO) {
+        return new R<>(TreeUtil.buildQykhPlanTree(qykhPlanDetailsService.selectList(infoAdapterVO), ""));
+    }
 }

+ 13 - 2
platform-rest/src/main/java/com/platform/rest/controller/qykh/QykhProductController.java

@@ -3,6 +3,8 @@ package com.platform.rest.controller.qykh;
 import com.platform.common.util.R;
 import com.platform.common.validation.group.AddGroup;
 import com.platform.common.validation.group.UpdateGroup;
+import com.platform.dao.util.TreeUtil;
+import com.platform.dao.vo.query.qykh.HotspotVO;
 import com.platform.dao.vo.query.qykh.ProductVO;
 import com.platform.rest.log.annotation.SysLog;
 import com.platform.service.qykh.QykhPlanDetailsService;
@@ -14,7 +16,7 @@ import org.springframework.web.bind.annotation.*;
 
 @RestController
 @AllArgsConstructor
-@RequestMapping("/qykh/qykh-")
+@RequestMapping("/qykh/products")
 public class QykhProductController {
     private final QykhProductService qykhPlanDetailsService;
     /**
@@ -66,5 +68,14 @@ public class QykhProductController {
         return new R();
     }
 
-
+    /**
+     * 获取设备tree
+     *
+     * @param infoAdapterVO
+     * @return R
+     */
+    @GetMapping("tree")
+    public R queryTree(ProductVO infoAdapterVO) {
+        return new R<>(TreeUtil.buildQykhProductTree(qykhPlanDetailsService.selectList(infoAdapterVO), ""));
+    }
 }

+ 5 - 0
platform-service/src/main/java/com/platform/service/qykh/QykhHotspotService.java

@@ -2,6 +2,9 @@ package com.platform.service.qykh;
 
 import com.platform.dao.bean.MyVOPage;
 import com.platform.dao.vo.query.qykh.HotspotVO;
+import com.platform.dao.vo.sb.SbTypeVO;
+
+import java.util.List;
 
 public interface QykhHotspotService {
 
@@ -38,4 +41,6 @@ public interface QykhHotspotService {
      * @param sql
      */
     void centerInsertBatch(String sql);
+
+    List<HotspotVO> selectList(HotspotVO infoAdapterVO);
 }

+ 5 - 0
platform-service/src/main/java/com/platform/service/qykh/QykhInformationService.java

@@ -1,8 +1,11 @@
 package com.platform.service.qykh;
 
 import com.platform.dao.bean.MyVOPage;
+import com.platform.dao.vo.query.qykh.HotspotVO;
 import com.platform.dao.vo.query.qykh.InformationVO;
 
+import java.util.List;
+
 public interface QykhInformationService {
 
     /**
@@ -38,4 +41,6 @@ public interface QykhInformationService {
      * @param sql
      */
     void centerInsertBatch(String sql);
+
+    List<InformationVO> selectList(InformationVO infoAdapterVO);
 }

+ 5 - 0
platform-service/src/main/java/com/platform/service/qykh/QykhPlanService.java

@@ -1,8 +1,11 @@
 package com.platform.service.qykh;
 
 import com.platform.dao.bean.MyVOPage;
+import com.platform.dao.vo.query.qykh.HotspotVO;
 import com.platform.dao.vo.query.qykh.PlanVO;
 
+import java.util.List;
+
 public interface QykhPlanService {
 
     /**
@@ -38,4 +41,6 @@ public interface QykhPlanService {
      * @param sql
      */
     void centerInsertBatch(String sql);
+
+    List<PlanVO> selectList(PlanVO infoAdapterVO);
 }

+ 5 - 0
platform-service/src/main/java/com/platform/service/qykh/QykhProductService.java

@@ -1,8 +1,11 @@
 package com.platform.service.qykh;
 
 import com.platform.dao.bean.MyVOPage;
+import com.platform.dao.vo.query.qykh.HotspotVO;
 import com.platform.dao.vo.query.qykh.ProductVO;
 
+import java.util.List;
+
 public interface QykhProductService {
 
     /**
@@ -38,4 +41,6 @@ public interface QykhProductService {
      * @param sql
      */
     void centerInsertBatch(String sql);
+
+    List<ProductVO> selectList(ProductVO infoAdapterVO);
 }

+ 57 - 0
platform-service/src/main/java/com/platform/service/qykh/impl/QykhHotspotServiceImpl.java

@@ -103,6 +103,63 @@ public class QykhHotspotServiceImpl implements QykhHotspotService {
         }
     }
 
+    @Override
+    public List<HotspotVO> selectList( HotspotVO guaranteeInfoDTO) {
+        Connection conn = null;
+        Statement stmt = null;
+        ResultSet rs = null;
+        StringBuffer querySql = new StringBuffer("select " +
+                "id," +
+                "level," +
+                "hid," +
+                "pid," +
+                "hname," +
+                "desrc," +
+                "shortdesc," +
+                "hurl," +
+                "ord, " +
+                "oname," +
+                "seoid," +
+                "iszt," +
+                "zturl");
+        StringBuffer countSql = new StringBuffer("select count(*) ");
+        StringBuffer sql = new StringBuffer(" from " + info_table_name + " where 1 = 1 ");
+        if (StringUtils.isNotBlank(guaranteeInfoDTO.getHname())) {
+            sql.append("and hname like '%" + guaranteeInfoDTO.getHname() + "%' ");
+        }
+        sql.append(" order by ord ");
+        try {
+            conn = qykhDataSource.getConnection();
+            stmt = conn.createStatement();
+            // 获取总条数
+            rs = stmt.executeQuery(countSql.append(sql).toString());
+            rs.next();
+            rs = stmt.executeQuery(querySql.append(sql).toString());
+            List<HotspotVO> list = packageInfo(rs);
+            rs.close();
+            stmt.close();
+            conn.close();
+            return list;
+        } catch (SQLException e1) {
+            e1.printStackTrace();
+            throw new DeniedException("获取乾元数据库连接失败" + e1.getCause().getMessage());
+        } finally {
+            try {
+                if (rs != null) {
+                    rs.close();
+                }
+                if (stmt != null) {
+                    stmt.close();
+                }
+                if (conn != null) {
+                    conn.close();
+                }
+            } catch (Exception e) {
+
+            }
+        }
+    }
+
     @Override
     public void modModel(HotspotVO vo) {
         Connection conn = null;

+ 55 - 0
platform-service/src/main/java/com/platform/service/qykh/impl/QykhInformationServiceImpl.java

@@ -100,6 +100,61 @@ public class QykhInformationServiceImpl implements QykhInformationService {
         }
     }
 
+    @Override
+    public List<InformationVO> selectList(InformationVO guaranteeInfoDTO) {
+        Connection conn = null;
+        Statement stmt = null;
+        ResultSet rs = null;
+        StringBuffer querySql = new StringBuffer("select " +
+                "id," +
+                "inforname," +
+                "infordes," +
+                "pid," +
+                "level," +
+                "purl," +
+                "seoid, " +
+                "ord,  " +
+                "addtime," +
+                "updatetime");
+        StringBuffer countSql = new StringBuffer("select count(*) ");
+        StringBuffer sql = new StringBuffer(" from " + info_table_name + " where 1 = 1 ");
+        if (StringUtils.isNotBlank(guaranteeInfoDTO.getInforname())) {
+            sql.append("and inforname like '%" + guaranteeInfoDTO.getInforname() + "%' ");
+        }
+        sql.append(" order by ord ");
+        try {
+            conn = qykhDataSource.getConnection();
+            stmt = conn.createStatement();
+            // 获取总条数
+            rs = stmt.executeQuery(countSql.append(sql).toString());
+            rs.next();
+            rs = stmt.executeQuery(querySql.append(sql).toString());
+            // 封装数据
+            List<InformationVO> list = packageInfo(rs);
+            rs.close();
+            stmt.close();
+            conn.close();
+            return list;
+        } catch (SQLException e1) {
+            e1.printStackTrace();
+            throw new DeniedException("获取乾元数据库连接失败" + e1.getCause().getMessage());
+        } finally {
+            try {
+                if (rs != null) {
+                    rs.close();
+                }
+                if (stmt != null) {
+                    stmt.close();
+                }
+                if (conn != null) {
+                    conn.close();
+                }
+            } catch (Exception e) {
+
+            }
+        }
+    }
+
     @Override
     public void modModel(InformationVO vo) {
         Connection conn = null;

+ 55 - 0
platform-service/src/main/java/com/platform/service/qykh/impl/QykhPlanServiceImpl.java

@@ -102,6 +102,61 @@ public class QykhPlanServiceImpl implements QykhPlanService {
         }
     }
 
+    @Override
+    public List<PlanVO> selectList(PlanVO guaranteeInfoDTO) {
+        Connection conn = null;
+        Statement stmt = null;
+        ResultSet rs = null;
+        StringBuffer querySql = new StringBuffer("select " +
+                "id," +
+                "planname," +
+                "plandes," +
+                "shortdesc," +
+                "pid," +
+                "level," +
+                "purl," +
+                "bannerurl," +
+                "seoid, " +
+                "ord ");
+        StringBuffer countSql = new StringBuffer("select count(*) ");
+        StringBuffer sql = new StringBuffer(" from " + info_table_name + " where 1 = 1 ");
+        if (StringUtils.isNotBlank(guaranteeInfoDTO.getPlanname())) {
+            sql.append("and planname like '%" + guaranteeInfoDTO.getPlanname() + "%' ");
+        }
+        sql.append(" order by ord ");
+        try {
+            conn = qykhDataSource.getConnection();
+            stmt = conn.createStatement();
+            // 获取总条数
+            rs = stmt.executeQuery(countSql.append(sql).toString());
+            rs.next();
+            rs = stmt.executeQuery(querySql.append(sql).toString());
+            // 封装数据
+            List<PlanVO> list = packageInfo(rs);
+            rs.close();
+            stmt.close();
+            conn.close();
+            return list;
+        } catch (SQLException e1) {
+            e1.printStackTrace();
+            throw new DeniedException("获取乾元数据库连接失败" + e1.getCause().getMessage());
+        } finally {
+            try {
+                if (rs != null) {
+                    rs.close();
+                }
+                if (stmt != null) {
+                    stmt.close();
+                }
+                if (conn != null) {
+                    conn.close();
+                }
+            } catch (Exception e) {
+
+            }
+        }
+    }
+
     @Override
     public void modModel(PlanVO vo) {
         Connection conn = null;

+ 59 - 0
platform-service/src/main/java/com/platform/service/qykh/impl/QykhProductServiceImpl.java

@@ -106,6 +106,65 @@ public class QykhProductServiceImpl implements QykhProductService {
         }
     }
 
+    @Override
+    public List<ProductVO> selectList( ProductVO guaranteeInfoDTO) {
+        Connection conn = null;
+        Statement stmt = null;
+        ResultSet rs = null;
+        StringBuffer querySql = new StringBuffer("select " +
+                "id," +
+                "level," +
+                "pid," +
+                "pname," +
+                "desrc," +
+                "shortdesc," +
+                "purl," +
+                "bannerurl," +
+                "ord, " +
+                "oname," +
+                "seoid," +
+                "iszt," +
+                "zturl, " +
+                "iszhutui ");
+        StringBuffer countSql = new StringBuffer("select count(*) ");
+        StringBuffer sql = new StringBuffer(" from " + info_table_name + " where 1 = 1 ");
+        if (StringUtils.isNotBlank(guaranteeInfoDTO.getPname())) {
+            sql.append("and pname like '%" + guaranteeInfoDTO.getPname() + "%' ");
+        }
+        sql.append(" order by ord ");
+        try {
+            conn = qykhDataSource.getConnection();
+            stmt = conn.createStatement();
+            // 获取总条数
+            rs = stmt.executeQuery(countSql.append(sql).toString());
+            rs.next();
+            rs = stmt.executeQuery(querySql.append(sql).toString());
+            // 封装数据
+            List<ProductVO> list = packageInfo(rs);
+            rs.close();
+            stmt.close();
+            conn.close();
+            return list;
+        } catch (SQLException e1) {
+            e1.printStackTrace();
+            throw new DeniedException("获取乾元数据库连接失败" + e1.getCause().getMessage());
+        } finally {
+            try {
+                if (rs != null) {
+                    rs.close();
+                }
+                if (stmt != null) {
+                    stmt.close();
+                }
+                if (conn != null) {
+                    conn.close();
+                }
+            } catch (Exception e) {
+
+            }
+        }
+    }
+
     @Override
     public void modModel(ProductVO vo) {
         Connection conn = null;

+ 6 - 3
platform-service/src/main/resources/application-serviceDev.yml

@@ -1,6 +1,9 @@
 qykh:
-  plandetails: qykh_plandetails
-  product_help: qykh_product_help
   product: qykh_product
+  product_help: qykh_product_help
   plan: qykh_plan
-  hotspot_help: qykh_hotspot_help
+  plandetails: qykh_plandetails
+  hotspot: qykh_hotspot
+  hotspot_help: qykh_hotspot_help
+  information: qykh_information
+  information_help: qykh_information_help

+ 6 - 3
platform-service/src/main/resources/application-serviceProd.yml

@@ -1,6 +1,9 @@
 qykh:
-  plandetails: qykh_plandetails
-  product_help: qykh_product_help
   product: qykh_product
+  product_help: qykh_product_help
   plan: qykh_plan
-  hotspot_help: qykh_hotspot_help
+  plandetails: qykh_plandetails
+  hotspot: qykh_hotspot
+  hotspot_help: qykh_hotspot_help
+  information: qykh_information
+  information_help: qykh_information_help

+ 6 - 3
platform-service/src/main/resources/application-serviceTest.yml

@@ -1,6 +1,9 @@
 qykh:
-  plandetails: qykh_plandetails
-  product_help: qykh_product_help
   product: qykh_product
+  product_help: qykh_product_help
   plan: qykh_plan
-  hotspot_help: qykh_hotspot_help
+  plandetails: qykh_plandetails
+  hotspot: qykh_hotspot
+  hotspot_help: qykh_hotspot_help
+  information: qykh_information
+  information_help: qykh_information_help