Procházet zdrojové kódy

任务列表重新生成

lqc před 4 roky
rodič
revize
fa44456a99

+ 1 - 1
src/main/java/com/mokamrp/privates/controller/pangu/FosterwxCashScheduleTaskListController.java

@@ -68,7 +68,7 @@ public class FosterwxCashScheduleTaskListController extends BaseController<Foste
     @PostMapping("/reCreate")
     @ApiOperation("重新生成")
     public Object reCreate(FosterwxCashScheduleTaskList fosterwxCashScheduleTaskList) {
-        //TODO 等typer接口
+        fosterwxCashScheduleTaskListService.reCreate(fosterwxCashScheduleTaskList);
 
         return AjaxResult.success("重新生成成功");
     }

+ 6 - 0
src/main/java/com/mokamrp/privates/service/pangu/FosterwxCashScheduleTaskListService.java

@@ -26,4 +26,10 @@ public interface FosterwxCashScheduleTaskListService extends IService<FosterwxCa
      * @param userId
      */
     void cancelTask(Integer id, Integer userId);
+
+    /**
+     * 重新生成任务  生成失败|检测到公众号封禁重新生成链接
+     * @param fosterwxCashScheduleTaskList
+     */
+    void reCreate(FosterwxCashScheduleTaskList fosterwxCashScheduleTaskList);
 }

+ 17 - 0
src/main/java/com/mokamrp/privates/service/pangu/impl/FosterwxCashScheduleTaskListServiceImpl.java

@@ -73,4 +73,21 @@ public class FosterwxCashScheduleTaskListServiceImpl extends ServiceImpl<Fosterw
             setUpdateAt(LocalDateTime.now());
         }});
     }
+
+    /**
+     * 重新生成任务  生成失败|检测到公众号封禁重新生成链接
+     * @param fosterwxCashScheduleTaskList
+     */
+    @Override
+    public void reCreate(FosterwxCashScheduleTaskList fosterwxCashScheduleTaskList) {
+        // 状态
+        fosterwxCashScheduleTaskList.setStatus(1);
+        // 失败原因
+        fosterwxCashScheduleTaskList.setErrInfo("");
+
+        fosterwxCashScheduleTaskListMapper.updateById(fosterwxCashScheduleTaskList);
+        //TODO 等typer接口
+
+
+    }
 }

+ 26 - 0
src/main/java/com/mokamrp/privates/utils/pangu/redis/task/TaskRedis.java

@@ -0,0 +1,26 @@
+package com.mokamrp.privates.utils.pangu.redis.task;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.redis.core.StringRedisTemplate;
+import org.springframework.stereotype.Component;
+
+@Component
+public class TaskRedis {
+    // 缓存的任务信息数据
+    public static final String PANGU_CASH_TASK_INFO = "pangu_cash_task_info";
+    // 缓存生成的链接
+    public static final String PANGU_CASH_CREATED_URL = "pangu_cash_created_url";
+
+    @Autowired
+    private StringRedisTemplate stringRedisTemplate;
+
+    /**
+     * 缓存给typer制作url所需的数据
+     * @param json
+     */
+    public void createUrlByTyper(String json) {
+
+        // 把数据存放到redis缓存中
+        stringRedisTemplate.opsForList().leftPush(PANGU_CASH_TASK_INFO, json);
+    }
+}