Przeglądaj źródła

收费明细数据同步

lzm 3 lat temu
rodzic
commit
9d3f377eee

+ 11 - 4
sp-server/src/main/java/com/pj/api/pushfee/task/FeeDetailSyncTask.java

@@ -2,6 +2,8 @@ package com.pj.api.pushfee.task;
 
 import cn.hutool.core.date.DateUtil;
 import cn.hutool.core.util.StrUtil;
+import cn.hutool.json.JSONObject;
+import cn.hutool.json.JSONUtil;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.pj.api.pushfee.tools.EncryptTools;
 import com.pj.api.pushfee.tools.message.api.OdsOrderPayDetailDTO;
@@ -53,6 +55,7 @@ public class FeeDetailSyncTask {
     @Scheduled(fixedRate = 300000)
     public void send() {
 //        if(partConfig.isTestEnv()){
+//            log.info("pushfee_info: 测试环境不传输");
 //            return;
 //        }
         Date startTime;
@@ -103,15 +106,19 @@ public class FeeDetailSyncTask {
         log.info("pushfee_encryptMessage: " + encryptMessage);
 
         //推送数据
+        String response = "";
         try {
-            String response = tools.http.HttpUtils.doPost(URL, encryptMessage);
+            response = tools.http.HttpUtils.doPost(URL, encryptMessage);
             log.info("pushfee_response: " + response);
         } catch (IOException e) {
             e.printStackTrace();
         }
-
-        RedisUtil.set("pushFeeStartTime", DateUtil.format(finishTime, "yyyy-MM-dd HH:mm:ss"));
-        RedisUtil.set("pushFeeTimeSpan", timeSpan+"");
+        JSONObject jsonObject = JSONUtil.parseObj(response);
+        String code = jsonObject.getStr("code");
+        if(StrUtil.equals("200", code)){
+            RedisUtil.set("pushFeeStartTime", DateUtil.format(finishTime, "yyyy-MM-dd HH:mm:ss"));
+            RedisUtil.set("pushFeeTimeSpan", timeSpan+"");
+        }
         log.info("pushfee_startTime: " + RedisUtil.get("pushFeeStartTime"));
     }
 

+ 2 - 2
sp-server/src/main/resources/application-dev.yml

@@ -6,9 +6,9 @@ spring:
     # 数据源配置
     datasource:
         type: com.alibaba.druid.pool.DruidDataSource
-        url: jdbc:mysql://127.0.0.1:3306/pco0726?useUnicode=true&characterEncoding=utf-8&useSSL=true&serverTimezone=GMT%2B8
+        url: jdbc:mysql://127.0.0.1:3307/pco0726?useUnicode=true&characterEncoding=utf-8&useSSL=true&serverTimezone=GMT%2B8
         username: root
-        password: 123456
+        password: 1234
         # 是否打开sql监控台  (生产环境请务必关闭此选项)
         druid:
             stat-view-servlet: