Browse Source

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

hfxc226 2 năm trước cách đây
mục cha
commit
f725da5836

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

@@ -73,7 +73,7 @@ public class TreeUtil {
         });
 
         treeNodes.forEach(treeNode -> {
-            if (StringUtils.isBlank(treeNode.getParentId())) {
+            if (StringUtils.isBlank(treeNode.getParentId()) || "0".equals(treeNode.getParentId())) {
                 trees.add(treeNode);
             } else if (treeNode.getParentId().equals(root)) {
                 trees.add(treeNode);

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

@@ -122,7 +122,6 @@ public class QykhHotspotServiceImpl implements QykhHotspotService {
                 "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() + "%' ");
@@ -132,8 +131,6 @@ public class QykhHotspotServiceImpl implements QykhHotspotService {
             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();

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

@@ -116,7 +116,6 @@ public class QykhInformationServiceImpl implements QykhInformationService {
                 "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() + "%' ");
@@ -126,8 +125,6 @@ public class QykhInformationServiceImpl implements QykhInformationService {
             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);

+ 3 - 5
platform-service/src/main/java/com/platform/service/qykh/impl/QykhPlanServiceImpl.java

@@ -118,8 +118,7 @@ public class QykhPlanServiceImpl implements QykhPlanService {
                 "bannerurl," +
                 "seoid, " +
                 "ord ");
-        StringBuffer countSql = new StringBuffer("select count(*) ");
-        StringBuffer sql = new StringBuffer(" from " + info_table_name + " where 1 = 1 ");
+       StringBuffer sql = new StringBuffer(" from " + info_table_name + " where 1 = 1 ");
         if (StringUtils.isNotBlank(guaranteeInfoDTO.getPlanname())) {
             sql.append("and planname like '%" + guaranteeInfoDTO.getPlanname() + "%' ");
         }
@@ -128,9 +127,8 @@ public class QykhPlanServiceImpl implements QykhPlanService {
             conn = qykhDataSource.getConnection();
             stmt = conn.createStatement();
             // 获取总条数
-            rs = stmt.executeQuery(countSql.append(sql).toString());
-            rs.next();
-            rs = stmt.executeQuery(querySql.append(sql).toString());
+            log.info("sql: " + querySql.append(sql));
+            rs = stmt.executeQuery(querySql.toString());
             // 封装数据
             List<PlanVO> list = packageInfo(rs);
             rs.close();

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

@@ -126,7 +126,6 @@ public class QykhProductServiceImpl implements QykhProductService {
                 "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() + "%' ");
@@ -136,8 +135,6 @@ public class QykhProductServiceImpl implements QykhProductService {
             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);