Explorar o código

Merge branch 'dev-lqc' into test

lqc %!s(int64=4) %!d(string=hai) anos
pai
achega
b8650020d6

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

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
 import com.mokamrp.privates.entity.ResHandle;
 import com.mokamrp.privates.entity.pangu.FosterwxCashScheduleTaskListHandle;
 import com.mokamrp.privates.mapper.pangu.pojo.FosterwxCashScheduleTaskList;
+import com.mokamrp.privates.mapper.pangu.pojo.FosterwxCashTaskList;
 
 import java.util.List;
 
@@ -38,4 +39,11 @@ public interface FosterwxCashScheduleTaskListService extends IService<FosterwxCa
      * @return
      */
     List<FosterwxCashScheduleTaskList> getBannedGhid();
+
+    /**
+     * 任务类型为小程序是 拼接一个json字符串返回 供前端展示
+     * @param fosterwxCashScheduleTaskList
+     * @param fosterwxCashTaskList
+     */
+    String editBoxUrl(FosterwxCashScheduleTaskList fosterwxCashScheduleTaskList, FosterwxCashTaskList fosterwxCashTaskList);
 }

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

@@ -104,7 +104,12 @@ public class FosterwxCashAccountScheduleServiceImpl extends ServiceImpl<Fosterwx
                 fosterwxCashScheduleTaskList.setRemark(fosterwxCashTaskList.getRemark());
                 fosterwxCashScheduleTaskList.setTaskContent("");
                 fosterwxCashScheduleTaskList.setGhId("");
-                fosterwxCashScheduleTaskList.setSendUrl("");
+                // 任务类型为链接是直接赋值
+                if (4 == fosterwxCashTaskList.getTaskType()) {
+                    fosterwxCashScheduleTaskList.setSendUrl(fosterwxCashTaskList.getUrl());
+                } else {
+                    fosterwxCashScheduleTaskList.setSendUrl("");
+                }
                 fosterwxCashScheduleTaskList.setStatus(1);
                 fosterwxCashScheduleTaskList.setErrInfo("");
                 fosterwxCashScheduleTaskList.setSendTime(LocalDateTime.of(fosterwxCashAccountSchedule.getScheduleDate(), fosterwxCashTaskList.getSendAt()));
@@ -119,6 +124,9 @@ public class FosterwxCashAccountScheduleServiceImpl extends ServiceImpl<Fosterwx
                 // 小程序和链接的任务不需要发送到typer
                 if (4 != fosterwxCashTaskList.getTaskType() && 3 != fosterwxCashTaskList.getTaskType()) {
                     newsList.add(fosterwxCashScheduleTaskList);
+                } else if (3 == fosterwxCashTaskList.getTaskType()) {
+                    // 小程序本地生成
+                    fosterwxCashScheduleTaskListService.editBoxUrl(fosterwxCashScheduleTaskList, fosterwxCashTaskList);
                 }
             });
 

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

@@ -8,6 +8,7 @@ import com.mokamrp.privates.entity.pangu.FosterwxCashScheduleTaskListHandle;
 import com.mokamrp.privates.mapper.pangu.FosterwxCashScheduleTaskListMapper;
 import com.mokamrp.privates.mapper.pangu.pojo.FosterwxCashOasBox;
 import com.mokamrp.privates.mapper.pangu.pojo.FosterwxCashScheduleTaskList;
+import com.mokamrp.privates.mapper.pangu.pojo.FosterwxCashTaskList;
 import com.mokamrp.privates.service.pangu.FosterwxCashOasBoxService;
 import com.mokamrp.privates.service.pangu.FosterwxCashScheduleTaskListService;
 import com.mokamrp.privates.service.pangu.FosterwxCashTaskListService;
@@ -154,4 +155,35 @@ public class FosterwxCashScheduleTaskListServiceImpl extends ServiceImpl<Fosterw
 
         return fosterwxCashScheduleTaskLists;
     }
+
+    /**
+     * 任务类型为小程序是 拼接一个json字符串返回 供前端展示
+     * @param fosterwxCashScheduleTaskList
+     * @param fosterwxCashTaskList
+     * @return
+     */
+    @Override
+    public void editBoxUrl(FosterwxCashScheduleTaskList fosterwxCashScheduleTaskList, FosterwxCashTaskList fosterwxCashTaskList) {
+        FosterwxCashOasBox fosterwxCashOasBox = fosterwxCashOasBoxService.getRandBox(fosterwxCashScheduleTaskList.getGroupId());
+        fosterwxCashOasBoxService.addSendTextCnt(fosterwxCashScheduleTaskList.getGroupId(), fosterwxCashOasBox.getGhId());
+
+        // 状态
+        fosterwxCashScheduleTaskList.setStatus(1);
+        // 失败原因
+        fosterwxCashScheduleTaskList.setErrInfo("");
+        // 分配的公众号
+        fosterwxCashScheduleTaskList.setGhId(fosterwxCashOasBox.getGhId());
+
+        // 小程序链接
+        if (8 == fosterwxCashTaskList.getBoxType()) {
+            // 投放版视频
+            // 发文链接
+            fosterwxCashScheduleTaskList.setSendUrl("/pages/index/index?type=tuiguang&videoId=" + fosterwxCashTaskList.getVideoId());
+        } else {
+            // 盘古版视频
+            fosterwxCashScheduleTaskList.setSendUrl(String.format("pages/index/index?type=tuiguang&materialId=%d&categoryId=&d", fosterwxCashTaskList.getVideoId(), fosterwxCashTaskList.getTagId()));
+        }
+
+        fosterwxCashScheduleTaskListMapper.updateById(fosterwxCashScheduleTaskList);
+    }
 }