Просмотр исходного кода

Merge branch 'dev-lqc' into test

lqc 4 лет назад
Родитель
Сommit
19e830b05b

+ 1 - 1
src/main/java/com/mokamrp/privates/service/pangu/impl/FosterwxCashAccountScheduleServiceImpl.java

@@ -116,7 +116,7 @@ public class FosterwxCashAccountScheduleServiceImpl extends ServiceImpl<Fosterwx
 
                 fosterwxCashScheduleTaskListMapper.insert(fosterwxCashScheduleTaskList);
 
-                if (4 != fosterwxCashTaskList.getTaskType()) {
+                if (4 != fosterwxCashTaskList.getTaskType() && 3 != fosterwxCashTaskList.getTaskType()) {
                     newsList.add(fosterwxCashScheduleTaskList);
                 }
             });

+ 16 - 1
src/main/java/com/mokamrp/privates/task/pangu/SyncFosterwxCash.java

@@ -1,5 +1,6 @@
 package com.mokamrp.privates.task.pangu;
 
+import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.mokamrp.privates.mapper.pangu.pojo.FosterwxCashScheduleTaskList;
 import com.mokamrp.privates.service.pangu.FosterwxCashScheduleTaskListService;
@@ -57,8 +58,22 @@ public class SyncFosterwxCash {
     public void syncCreatedUrlInfo() {
         String urlInfo = taskRedis.getPanguCashTaskInfo();
         while (urlInfo != null) {
+            log.info("typer生成的链接信息{}", urlInfo);
             // 根据获取的信息保存到本地数据库
-            // TODO 需要根据typer返回的redis结构具体生成
+            JSONObject jsonObject = JSONObject.parseObject(urlInfo);
+            if ("success".equals(jsonObject.get("status"))) {
+                fosterwxCashScheduleTaskListService.updateById(new FosterwxCashScheduleTaskList() {{
+                    setId(Integer.valueOf(jsonObject.get("automatic_id").toString()));
+                    setSendUrl(jsonObject.get("article_url").toString());
+                    setStatus(2);
+                }});
+            } else {
+                fosterwxCashScheduleTaskListService.updateById(new FosterwxCashScheduleTaskList() {{
+                    setId(Integer.valueOf(jsonObject.get("automatic_id").toString()));
+                    setErrInfo(jsonObject.get("ret_message").toString());
+                    setStatus(3);
+                }});
+            }
 
             urlInfo = taskRedis.getPanguCashTaskInfo();
         }