Răsfoiți Sursa

小程序迁移及部分内容迁移

elis 1 an în urmă
părinte
comite
d5502cab79

+ 4 - 3
nngkxxdp/src/main/java/com/example/nngkxxdp/elk/ElkController.java

@@ -101,7 +101,8 @@ public class ElkController {
     /**
      * 排序字段
      */
-    private String publishTime = "sorttime";
+//    private String publishTime = "sorttime";
+    private String publishTime = "publishtime";
     private String pubTimeStr = "pubtimestr.keyword";
 
     /**
@@ -142,7 +143,6 @@ public class ElkController {
             // 搜索部门
             BoolQueryBuilder boolQueryBuilder2 = new BoolQueryBuilder();
             List<QueryBuilder> should = boolQueryBuilder2.should();
-            should.add(QueryBuilders.matchQuery(deptName, dept));
             if (Blank.notBlank(oldDept)) {
                 for (String depts : oldDept) {
                     if (Blank.notBlank(depts)) {
@@ -150,6 +150,7 @@ public class ElkController {
                     }
                 }
             }
+            should.add(QueryBuilders.matchQuery(deptName, dept));
             list.add(boolQueryBuilder2);
         }
         //搜索领域类型
@@ -194,8 +195,8 @@ public class ElkController {
         }
         // 排序
 //        searchSourceBuilder.sort("title", SortOrder.DESC);
-        searchSourceBuilder.sort("_score", SortOrder.DESC);
         searchSourceBuilder.sort(publishTime, SortOrder.DESC);
+//        searchSourceBuilder.sort("_score", SortOrder.DESC);
         // 开始位置
         searchSourceBuilder.from((page - 1) * limit);
         // 查询条数

+ 2 - 0
nngkxxdp/src/main/java/com/example/nngkxxdp/entity/dos/InfoSendDTO.java

@@ -22,6 +22,8 @@ public class InfoSendDTO implements SendBadyInt{
     private String ChannelId;
     @JsonProperty("DocId")
     private String DocId;
+    @JsonProperty("SiteId")
+    private String SiteId;
     @JsonProperty("CurrUserName")
     private String CurrUserName = "南岸区政务服务办管理员3";
 }

+ 1 - 0
nngkxxdp/src/main/java/com/example/nngkxxdp/hlw/HlwHttpUtil.java

@@ -359,6 +359,7 @@ public class HlwHttpUtil {
         InfoSendDTO infoSendDTO = new InfoSendDTO();
         infoSendDTO.setChannelId(channelId);
         infoSendDTO.setDocId(docId);
+        infoSendDTO.setSiteId("254");
         articleList.setSendBody(infoSendDTO);
         JSONObject jsonObject = JSONUtil.parseObj(articleList);
         //log.info(jsonObject.toJSONString(2));

+ 2 - 0
nngkxxdp/src/main/java/com/example/nngkxxdp/program/service/Impl/MiniLoginServiceImpl.java

@@ -85,6 +85,7 @@ public class MiniLoginServiceImpl implements MiniLoginService {
 
             // 登录获取
             JSONObject jsonObject = new JSONObject(s.get());
+            System.out.println(jsonObject);
             if (ObjectUtil.isNotEmpty(jsonObject.get("errcode"))) {
                 return SendUtil.send(false, "登录失败3");
             }
@@ -103,6 +104,7 @@ public class MiniLoginServiceImpl implements MiniLoginService {
             appletUser.setNickName("微信匿名用户");
             appletUser.setPhone(phoneInfo.getPurePhoneNumber());
             System.out.println("微信总耗时:"+timer.intervalRestart());
+            System.out.println("微信总耗时:"+appletUser.getOpenid());
             // 查询当前用户是否存在改数据库
             Integer integer = appletUserDao.queryUserIsExist(appletUser.getOpenid());
             // 如果不存在则保存

+ 20 - 18
nngkxxdp/src/main/java/com/example/nngkxxdp/task/HlwTask.java

@@ -80,24 +80,27 @@ public class HlwTask {
 
 
     public static void main(String[] args) {
-        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
-        long startTime = System.currentTimeMillis();
-        long count = 0;
-        for (int i = 0; i < 1000000; i++) {
-            for (int j = 0; j < 1000000; j++) {
-                count += 1;
-            }
-        }
-        System.out.println(count);
-        long endTime = System.currentTimeMillis();
-        System.out.println("耗时:" + (endTime - startTime) / 1000 + "秒");
-        System.out.println("耗时:" + (endTime - startTime) / (1000 * 60) + "分");
+//        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+//        long startTime = System.currentTimeMillis();
+//        long count = 0;
+//        for (int i = 0; i < 1000000; i++) {
+//            for (int j = 0; j < 1000000; j++) {
+//                count += 1;
+//            }
+//        }
+//        System.out.println(count);
+//        long endTime = System.currentTimeMillis();
+//        System.out.println("耗时:" + (endTime - startTime) / 1000 + "秒");
+//        System.out.println("耗时:" + (endTime - startTime) / (1000 * 60) + "分");
+
     }
 
-    @Scheduled(cron = "0 0 1 * * ? ")
+//    @Scheduled(cron = "0 0/2 * * * ?")
+    @Scheduled(cron = "0 1 * * * ?")
     public void getAllLeader() throws Exception {
         log.info("获取所有领导信息-任务开始");
-        String[] leaderChannelId = {"145044", "341997", "341998", "341999", "342000", "342002", "342003", "342004", "342005", "344559", "145052", "145046"};
+//        "344559", "145052", "145046"
+        String[] leaderChannelId = {"145044", "460720", "341998", "341999", "342000", "342002", "342003", "342004", "342005"};
         JSONArray jsonArray = new JSONArray();
         for (String channelId : leaderChannelId) {
             JSONObject hlwArticleList = HlwHttpUtil.getHlwArticleList2(1, 1, channelId, HlwHttpUtil.getHlwToken());
@@ -112,7 +115,7 @@ public class HlwTask {
                 }
             } catch (Exception e) {
                 log.info("获取文章失败");
-                return;
+                continue;
             }
 
             JSONObject jsonObject;
@@ -120,7 +123,7 @@ public class HlwTask {
                 jsonObject = JSONUtil.parseObj(data.get(0));
             } catch (Exception e) {
                 log.info("获取文章失败");
-                return;
+                continue;
             }
             String docId = jsonObject.getStr("DOCID");
             String docUrl = jsonObject.getStr("DOCPUBURL");
@@ -130,7 +133,7 @@ public class HlwTask {
                 hlwArticleInfo.set("DOCPUBURL", docUrl.substring(0, docUrl.lastIndexOf("/") + 1));
             } catch (Exception e) {
                 log.info("获取文章详细失败");
-                return;
+                continue;
             }
             jsonArray.add(hlwArticleInfo);
             Thread.sleep(800);
@@ -138,7 +141,6 @@ public class HlwTask {
         redisUtil.set("nazw_hlw_allLeader", jsonArray);
         log.info("获取所有领导信息-成功");
     }
-
     //    @Scheduled(cron = "0 10 0 * * ?")
 //    @Async("threadPoolTaskExecutor")//多个定时器需要用到的线程池
 //    @GetMapping("/getTodayData")

+ 1 - 1
nngkxxdp/src/main/java/com/example/nngkxxdp/task/WxTask.java

@@ -41,7 +41,7 @@ public class WxTask {
     /**
      * TODO 网站更新需将此定时任务取消
      */
-//    @Scheduled(cron = "0 0 0/2 * * ?")
+    @Scheduled(cron = "0 0 0/2 * * ?")
     public void getWxToken(){
         System.err.println("定时开始");
         String post = HttpUtil.post(MiniConstant.ACCESSTOKEN+"?grant_type=client_credential&appid="+MiniConstant.APPID+"&secret="+MiniConstant.SECRET,"");

+ 8 - 3
nngkxxdp/src/main/resources/static/zdjc/pc_sy.html

@@ -465,7 +465,9 @@
                              
                             var  id=data[i]._source.id
                             var url=data[i]._source.policy_original_url
-                            
+                            var urlTitle=data[i]._source.policy_original_title
+                            var questionId=data[i]._source.question_id
+
                             var height
 
                             if(tcontent===''){
@@ -473,7 +475,7 @@
                             }else{
                                 height='<p >'
                             }
-                            html += '<div class="text_one" onclick="openWindow(\'' + id +'\',\''+ url+ '\')">'
+                            html += '<div class="text_one" onclick="openWindow(\'' + id +'\',\''+ url+ '\',\''+ urlTitle+ '\',\''+ questionId+ '\')">'
                                 + '<p>' + title + '<span style="margin-left:30px;font-size: 14px;color: #1abdbd; border: 1px solid #1abdbd;display: inline-block;">' + tag + '</span>' + '</p>'
                                 + height
                                 + tcontent
@@ -745,10 +747,13 @@
         // 	})
         // };
 
-        function openWindow(data, url) {
+        function openWindow(data, url,urlTitle,questionId) {
+            debugger
             if (dataMap[data].content) {
                 sessionStorage.ELK_ARTICLE = JSON.stringify(dataMap[data]);
                 sessionStorage.ELK_URL = JSON.stringify(url);
+                sessionStorage.ELK_URL_TITLE = JSON.stringify(urlTitle);
+                sessionStorage.ELK_JUNP_ID = JSON.stringify(questionId);
                 window.location = 'xq.html';
             } else {
                 window.open(dataMap[data].url, '_blank');

+ 5 - 4
nngkxxdp/src/main/resources/static/zdjc/pc_xq.html

@@ -740,7 +740,8 @@
                 console.log(1)
                 $('.link').removeClass('layui-hide')
                 $('.link').addClass('layui-show')
-                $('.line-right').html(url)
+                let a = "<a href="+url+">"+JSON.parse(sessionStorage.getItem('ELK_URL_TITLE'))+"</a>"
+                $('.line-right').html(a)
                
             } else {
                 $('.link').removeClass('layui-show')
@@ -750,9 +751,9 @@
         }
         getUrl()
 
-        $('.line-right').click(() => {
-            window.open($('.line-right').html())
-        })
+        // $('.line-right').click(() => {
+        //     window.open($('.line-right').html())
+        // })
     </script>
 </body>
 

+ 2 - 2
nnzwminiapp/pages/api/canteen-request.js

@@ -1,5 +1,5 @@
-const baseUrl = "https://www.cqna.gov.cn/mnazw"
-const imgUrl = "https://www.cqna.gov.cn/mnazw/applet/"
+const baseUrl = "https://www.cqna.gov.cn/data"
+const imgUrl = "https://www.cqna.gov.cn/data/upload/applet/"
 
 import {
 	cacheGet

+ 2 - 2
nnzwminiapp/pages/api/request.js

@@ -1,5 +1,5 @@
-const baseUrl = "https://www.cqna.gov.cn/mnazw"
-const imgUrl = "https://www.cqna.gov.cn/mnazw/applet/"
+const baseUrl = "https://www.cqna.gov.cn/data"
+const imgUrl = "https://www.cqna.gov.cn/data/upload/applet/"
 const newImgUrl = "https://www.cqna.gov.cn/data/"
 import {
 	cacheGet,

+ 1 - 1
nnzwminiapp/pages/myCenter/myCenter.wxml

@@ -1,5 +1,5 @@
 <!--pages/myCenter/myCenter.wxml-->
-<view class="bg" style="height: {{scroll_height-30}}rpx;">
+<view class="bg" style="height: {{scroll_height-70}}rpx;">
     <view class="head-bg" style="background-image:url({{imgUrl}}xaoji9.webp);">
         <block wx:if="{{!hasUserInfo}}">
             <image src="{{imgUrl}}/icon/sculpture.png" alt="" class="headPortrait"></image>

+ 1 - 1
nnzwminiapp/pages/nais/nais.wxml

@@ -1,5 +1,5 @@
 <view >
-	<scroll-view style="height: {{scroll_height}}rpx;" scroll-y="true">
+	<scroll-view  style="height: {{scroll_height-200}}rpx;" scroll-y="true">
 		<!-- 南岸概况 -->
 		<view style="position: relative;margin-top: 40rpx;">
 			<image style="width: 250rpx;height: 121rpx;position: absolute;right: -45rpx;top: -10rpx;" src="{{imgUrl}}nais-1-2022-banner.png" />

+ 2 - 2
nnzwminiapp/pagesPublic/pages/api/request.js

@@ -1,5 +1,5 @@
-const baseUrl = "https://www.cqna.gov.cn/mnazw"
-const imgUrl = "https://www.cqna.gov.cn/mnazw/applet/"
+const baseUrl = "https://www.cqna.gov.cn/data"
+const imgUrl = "https://www.cqna.gov.cn/data/upload/applet/"
 
 import {
 	cacheGet