瀏覽代碼

Merge branch 'test' of http://git.mokasz.com/marketing/moka-private into test

leon 4 年之前
父節點
當前提交
c2b4ae7a13

+ 14 - 5
src/main/java/com/mokamrp/privates/controller/pangu/FosterwxCashAccountScheduleController.java

@@ -13,10 +13,7 @@ import com.mokamrp.privates.interceptor.AuthUser;
 import com.mokamrp.privates.mapper.pangu.pojo.FosterwxCashAccountSchedule;
 import com.mokamrp.privates.mapper.pangu.pojo.FosterwxCashScheduleTaskList;
 import com.mokamrp.privates.mapper.pojo.User;
-import com.mokamrp.privates.service.pangu.FosterwxCashAccountScheduleService;
-import com.mokamrp.privates.service.pangu.FosterwxCashScheduleTaskListService;
-import com.mokamrp.privates.service.pangu.FosterwxCashTaskListService;
-import com.mokamrp.privates.service.pangu.FosterwxCashTaskTemplateService;
+import com.mokamrp.privates.service.pangu.*;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -57,6 +54,9 @@ public class FosterwxCashAccountScheduleController extends BaseController<Foster
     @Autowired
     public FosterwxCashTaskListService fosterwxCashTaskListService;
 
+    @Autowired
+    public FosterwxCashWorkwxTaskCatalogService fosterwxCashWorkwxTaskCatalogService;
+
     /*
      * @fast
      * 默认生成的控制器所继承的父类中有index/add/edit/del四个基础方法,均为post json请求
@@ -117,6 +117,7 @@ public class FosterwxCashAccountScheduleController extends BaseController<Foster
             fosterwxCashAccountSchedule.setTemplateId(Integer.valueOf(detail.get("templateId")));
             fosterwxCashAccountSchedule.setStatus(2);
             fosterwxCashAccountSchedule.setType(type);
+            // 企微任务的情况
             if (2 == type) {
                 fosterwxCashAccountSchedule.setGroupNumEveryTime(Integer.valueOf(detail.get("groupNumEveryTime")));
                 fosterwxCashAccountSchedule.setMessageInterval(Integer.valueOf(detail.get("messageInterval")));
@@ -156,7 +157,15 @@ public class FosterwxCashAccountScheduleController extends BaseController<Foster
         fosterwxCashScheduleTaskListHandle.setScheduleId(handle.getId());
         ResHandle<List<FosterwxCashScheduleTaskList>> resHandle = fosterwxCashScheduleTaskListService.getList(fosterwxCashScheduleTaskListHandle);
 
-        resHandle.getList().forEach(fosterwxCashScheduleTaskList -> fosterwxCashScheduleTaskList.setFosterwxCashTaskList(fosterwxCashTaskListService.getById(fosterwxCashScheduleTaskList.getTaskId())));
+        resHandle.getList().forEach(fosterwxCashScheduleTaskList -> {
+            // 个微任务的情况
+            if (fosterwxCashScheduleTaskList.getType() == 1) {
+                fosterwxCashScheduleTaskList.setFosterwxCashTaskList(fosterwxCashTaskListService.getById(fosterwxCashScheduleTaskList.getTaskId()));
+            } else {
+                // 企微任务
+                fosterwxCashScheduleTaskList.setFosterwxCashWorkwxTaskListList(fosterwxCashWorkwxTaskCatalogService.getTaskByTemplateId(fosterwxCashScheduleTaskList.getTemplateId()));
+            }
+        });
 
         return AjaxResult.success(resHandle);
     }

+ 2 - 1
src/main/java/com/mokamrp/privates/mapper/pangu/FosterwxCashScheduleTaskListMapper.xml

@@ -8,6 +8,7 @@
         <result column="schedule_id" property="scheduleId" />
         <result column="template_id" property="templateId" />
         <result column="task_id" property="taskId" />
+        <result column="child_task_id" property="childTaskId" />
         <result column="group_id" property="groupId" />
         <result column="task_type" property="taskType" />
         <result column="remark" property="remark" />
@@ -27,7 +28,7 @@
 
     <!-- 通用查询结果列 -->
     <sql id="Base_Column_List">
-        id, schedule_id, template_id, task_id, group_id, task_type, remark, task_content, status, err_info, send_time, create_uid, update_uid, create_at, update_at
+        id, schedule_id, template_id, task_id, childTaskId, group_id, task_type, remark, task_content, status, err_info, send_time, create_uid, update_uid, create_at, update_at
     </sql>
     <select id="getList" resultType="com.mokamrp.privates.mapper.pangu.pojo.FosterwxCashScheduleTaskList">
         SELECT

+ 25 - 1
src/main/java/com/mokamrp/privates/mapper/pangu/pojo/FosterwxCashScheduleTaskList.java

@@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.extension.activerecord.Model;
 
 import java.io.Serializable;
 import java.time.LocalDateTime;
+import java.util.List;
 
 /**
  * <p>
@@ -43,6 +44,11 @@ public class FosterwxCashScheduleTaskList extends Model<FosterwxCashScheduleTask
      */
     private Integer taskId;
 
+    /*
+     * 子任务id
+     */
+    private Integer childTaskId;
+
     /**
      * 组别id
      */
@@ -83,7 +89,6 @@ public class FosterwxCashScheduleTaskList extends Model<FosterwxCashScheduleTask
      */
     private Integer type;
 
-
     /**
      * 失败原因
      */
@@ -123,6 +128,9 @@ public class FosterwxCashScheduleTaskList extends Model<FosterwxCashScheduleTask
     private FosterwxCashTaskList fosterwxCashTaskList;
 
     @TableField(exist = false)
+    private List<FosterwxCashWorkwxTaskList> fosterwxCashWorkwxTaskListList;
+
+    @TableField(exist = false)
     private String boxGhid;
 
     @TableField(exist = false)
@@ -162,6 +170,14 @@ public class FosterwxCashScheduleTaskList extends Model<FosterwxCashScheduleTask
     public void setTaskId(Integer taskId) {
         this.taskId = taskId;
     }
+    
+    public Integer getChildTaskId() {
+        return childTaskId;
+    }
+
+    public void setChildTaskId(Integer childTaskId) {
+        this.childTaskId = childTaskId;
+    }
 
     public Integer getGroupId() {
         return groupId;
@@ -292,6 +308,14 @@ public class FosterwxCashScheduleTaskList extends Model<FosterwxCashScheduleTask
         this.fosterwxCashTaskList = fosterwxCashTaskList;
     }
 
+    public List<FosterwxCashWorkwxTaskList> getFosterwxCashWorkwxTaskListList() {
+        return fosterwxCashWorkwxTaskListList;
+    }
+
+    public void setFosterwxCashWorkwxTaskListList(List<FosterwxCashWorkwxTaskList> fosterwxCashWorkwxTaskListList) {
+        this.fosterwxCashWorkwxTaskListList = fosterwxCashWorkwxTaskListList;
+    }
+
     public String getBoxGhid() {
         return boxGhid;
     }

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

@@ -5,6 +5,7 @@ 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 com.mokamrp.privates.mapper.pangu.pojo.FosterwxCashWorkwxTaskList;
 
 import java.util.List;
 
@@ -46,4 +47,11 @@ public interface FosterwxCashScheduleTaskListService extends IService<FosterwxCa
      * @param fosterwxCashTaskList
      */
     void editBoxUrl(FosterwxCashScheduleTaskList fosterwxCashScheduleTaskList, FosterwxCashTaskList fosterwxCashTaskList);
+
+    /**
+     * 企微任务 任务类型为小程序是 拼接一个json字符串返回 供前端展示
+     * @param fosterwxCashScheduleTaskList
+     * @param fosterwxCashTaskList
+     */
+    void editWorkBoxUrl(FosterwxCashScheduleTaskList fosterwxCashScheduleTaskList, FosterwxCashWorkwxTaskList fosterwxCashWorkwxTaskList);
 }

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

@@ -10,9 +10,11 @@ import com.mokamrp.privates.mapper.pangu.FosterwxCashScheduleTaskListMapper;
 import com.mokamrp.privates.mapper.pangu.pojo.FosterwxCashAccountSchedule;
 import com.mokamrp.privates.mapper.pangu.pojo.FosterwxCashScheduleTaskList;
 import com.mokamrp.privates.mapper.pangu.pojo.FosterwxCashTaskList;
+import com.mokamrp.privates.mapper.pangu.pojo.FosterwxCashWorkwxTaskList;
 import com.mokamrp.privates.service.pangu.FosterwxCashAccountScheduleService;
 import com.mokamrp.privates.service.pangu.FosterwxCashScheduleTaskListService;
 import com.mokamrp.privates.service.pangu.FosterwxCashTaskTemplateService;
+import com.mokamrp.privates.service.pangu.FosterwxCashWorkwxTaskCatalogService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
@@ -43,6 +45,9 @@ public class FosterwxCashAccountScheduleServiceImpl extends ServiceImpl<Fosterwx
     @Autowired
     public FosterwxCashScheduleTaskListService fosterwxCashScheduleTaskListService;
 
+    @Autowired
+    public FosterwxCashWorkwxTaskCatalogService fosterwxCashWorkwxTaskCatalogService;
+
     /**
      * 获取数据列表 支持分页
      * @param handle
@@ -106,61 +111,14 @@ public class FosterwxCashAccountScheduleServiceImpl extends ServiceImpl<Fosterwx
             // 该接口由立即生成和任务链接生成失败后两种调用方式 因此 在生成任务之前要删除旧任务
             fosterwxCashScheduleTaskListMapper.delete(new LambdaQueryWrapper<FosterwxCashScheduleTaskList>().eq(FosterwxCashScheduleTaskList::getScheduleId, id));
 
-            // 根据任务模板id获取任务模板详情
-            ResHandle<List<FosterwxCashTaskList>> resHandle = fosterwxCashTaskTemplateService.getTaskByTemplateId(fosterwxCashAccountSchedule.getTemplateId());
-
             List<FosterwxCashScheduleTaskList> newsList = new ArrayList<>();
-            resHandle.getList().forEach(fosterwxCashTaskList -> {
-                // 创建任务
-                FosterwxCashScheduleTaskList fosterwxCashScheduleTaskList = new FosterwxCashScheduleTaskList();
-                fosterwxCashScheduleTaskList.setScheduleId(fosterwxCashAccountSchedule.getId());
-                fosterwxCashScheduleTaskList.setTemplateId(fosterwxCashAccountSchedule.getTemplateId());
-                fosterwxCashScheduleTaskList.setTaskId(fosterwxCashTaskList.getId());
-                fosterwxCashScheduleTaskList.setGroupId(fosterwxCashAccountSchedule.getGroupId());
-                fosterwxCashScheduleTaskList.setTaskType(fosterwxCashTaskList.getTaskType());
-                fosterwxCashScheduleTaskList.setRemark(fosterwxCashTaskList.getRemark());
-                fosterwxCashScheduleTaskList.setTaskContent("");
-                fosterwxCashScheduleTaskList.setGhId("");
-                // 任务类型为链接是直接赋值
-                if (4 == fosterwxCashTaskList.getTaskType()) {
-                    fosterwxCashScheduleTaskList.setSendUrl(fosterwxCashTaskList.getUrl());
-                    fosterwxCashScheduleTaskList.setStatus(4);
-                    fosterwxCashScheduleTaskList.setErrInfo("");
-                } else {
-                    fosterwxCashScheduleTaskList.setSendUrl("");
-                    fosterwxCashScheduleTaskList.setStatus(1);
-                    fosterwxCashScheduleTaskList.setErrInfo("");
-                }
-
-                fosterwxCashScheduleTaskList.setSendTime(LocalDateTime.of(fosterwxCashAccountSchedule.getScheduleDate(), fosterwxCashTaskList.getSendAt()));
-                fosterwxCashScheduleTaskList.setCreateUid(fosterwxCashAccountSchedule.getCreateUid());
-                fosterwxCashScheduleTaskList.setCreateUser(fosterwxCashAccountSchedule.getCreateUser());
-                fosterwxCashScheduleTaskList.setUpdateUid(fosterwxCashAccountSchedule.getCreateUid());
-                fosterwxCashScheduleTaskList.setCreateAt(LocalDateTime.now());
-                fosterwxCashScheduleTaskList.setUpdateAt(LocalDateTime.now());
-
-                fosterwxCashScheduleTaskListMapper.insert(fosterwxCashScheduleTaskList);
-
-                // 小程序和链接的任务不需要发送到typer
-                switch (fosterwxCashTaskList.getTaskType()) {
-                    case 1:
-                        // 发文-小程序
-                        fosterwxCashScheduleTaskListService.editBoxUrl(fosterwxCashScheduleTaskList, fosterwxCashTaskList);
-                    case 2:
-                        newsList.add(fosterwxCashScheduleTaskList);
-                        break;
-                    case 3:
-                        // 小程序本地生成
-                        fosterwxCashScheduleTaskListService.editBoxUrl(fosterwxCashScheduleTaskList, fosterwxCashTaskList);
-                        break;
-                    case 4:
-                        // 任务类型为链接是 不需要操作
-                        break;
-                    default:
-                        break;
-
-                }
-            });
+            if (fosterwxCashAccountSchedule.getType() == 1) {
+                // 创建个微任务
+                newsList = createFosterwxTaskList(fosterwxCashAccountSchedule);
+            } else {
+                // 创建企微任务
+                newsList = createFosterwxWorkTaskList(fosterwxCashAccountSchedule);
+            }
 
             // 任务列表创建完成后 账号排期状态设置成正常
             fosterwxCashAccountSchedule.setStatus(1);
@@ -171,4 +129,139 @@ public class FosterwxCashAccountScheduleServiceImpl extends ServiceImpl<Fosterwx
         }
         return null;
     }
+
+    /**
+     * 创建企微任务
+     * @since: 1.18.1
+     * @param: [fosterwxCashAccountSchedule]
+     * @return: java.util.List<com.mokamrp.privates.mapper.pangu.pojo.FosterwxCashScheduleTaskList>
+     * @author: lqc
+     * @date: 2021/10/25
+     */
+    private List<FosterwxCashScheduleTaskList> createFosterwxWorkTaskList(FosterwxCashAccountSchedule fosterwxCashAccountSchedule) {
+        // 根据任务模板id获取任务模板详情
+        List<FosterwxCashWorkwxTaskList> resHandle = fosterwxCashWorkwxTaskCatalogService.getTaskByTemplateId(fosterwxCashAccountSchedule.getTemplateId());
+
+        List<FosterwxCashScheduleTaskList> newsList = new ArrayList<>();
+        resHandle.forEach(fosterwxCashWorkwxTaskList -> {
+            // 创建任务
+            FosterwxCashScheduleTaskList fosterwxCashScheduleTaskList = new FosterwxCashScheduleTaskList();
+            fosterwxCashScheduleTaskList.setScheduleId(fosterwxCashAccountSchedule.getId());
+            fosterwxCashScheduleTaskList.setTemplateId(fosterwxCashAccountSchedule.getTemplateId());
+            fosterwxCashScheduleTaskList.setTaskId(fosterwxCashWorkwxTaskList.getCatalogId());
+            fosterwxCashScheduleTaskList.setChildTaskId(fosterwxCashWorkwxTaskList.getId());
+            fosterwxCashScheduleTaskList.setGroupId(fosterwxCashAccountSchedule.getGroupId());
+            fosterwxCashScheduleTaskList.setTaskType(fosterwxCashWorkwxTaskList.getTaskType());
+            fosterwxCashScheduleTaskList.setRemark(fosterwxCashWorkwxTaskList.getRemark());
+            fosterwxCashScheduleTaskList.setTaskContent("");
+            fosterwxCashScheduleTaskList.setGhId("");
+            // 任务类型为链接是直接赋值
+            if (4 == fosterwxCashWorkwxTaskList.getTaskType()) {
+                fosterwxCashScheduleTaskList.setSendUrl(fosterwxCashWorkwxTaskList.getUrl());
+                fosterwxCashScheduleTaskList.setStatus(4);
+                fosterwxCashScheduleTaskList.setErrInfo("");
+            } else {
+                fosterwxCashScheduleTaskList.setSendUrl("");
+                fosterwxCashScheduleTaskList.setStatus(1);
+                fosterwxCashScheduleTaskList.setErrInfo("");
+            }
+
+            fosterwxCashScheduleTaskList.setSendTime(LocalDateTime.of(fosterwxCashAccountSchedule.getScheduleDate(), fosterwxCashWorkwxTaskList.getSendAt()));
+            fosterwxCashScheduleTaskList.setCreateUid(fosterwxCashAccountSchedule.getCreateUid());
+            fosterwxCashScheduleTaskList.setCreateUser(fosterwxCashAccountSchedule.getCreateUser());
+            fosterwxCashScheduleTaskList.setUpdateUid(fosterwxCashAccountSchedule.getCreateUid());
+            fosterwxCashScheduleTaskList.setCreateAt(LocalDateTime.now());
+            fosterwxCashScheduleTaskList.setUpdateAt(LocalDateTime.now());
+
+            fosterwxCashScheduleTaskListMapper.insert(fosterwxCashScheduleTaskList);
+
+            // 小程序和链接的任务不需要发送到typer
+            switch (fosterwxCashWorkwxTaskList.getTaskType()) {
+                case 1:
+                    // 发文-小程序
+                    fosterwxCashScheduleTaskListService.editWorkBoxUrl(fosterwxCashScheduleTaskList, fosterwxCashWorkwxTaskList);
+                case 2:
+                    newsList.add(fosterwxCashScheduleTaskList);
+                    break;
+                case 3:
+                    // 小程序本地生成
+                    fosterwxCashScheduleTaskListService.editWorkBoxUrl(fosterwxCashScheduleTaskList, fosterwxCashWorkwxTaskList);
+                    break;
+                case 4:
+                    // 任务类型为链接是 不需要操作
+                    break;
+                default:
+                    break;
+
+            }
+        });
+        return newsList;
+    }
+
+    /**
+     * 创建个微任务
+     * @since: 1.18.1
+     * @param: [fosterwxCashAccountSchedule]
+     * @return: java.util.List<com.mokamrp.privates.mapper.pangu.pojo.FosterwxCashScheduleTaskList>
+     * @author: lqc
+     * @date: 2021/10/25
+     */
+    private List<FosterwxCashScheduleTaskList> createFosterwxTaskList(FosterwxCashAccountSchedule fosterwxCashAccountSchedule) {
+        // 根据任务模板id获取任务模板详情
+        ResHandle<List<FosterwxCashTaskList>> resHandle = fosterwxCashTaskTemplateService.getTaskByTemplateId(fosterwxCashAccountSchedule.getTemplateId());
+
+        List<FosterwxCashScheduleTaskList> newsList = new ArrayList<>();
+        resHandle.getList().forEach(fosterwxCashTaskList -> {
+            // 创建任务
+            FosterwxCashScheduleTaskList fosterwxCashScheduleTaskList = new FosterwxCashScheduleTaskList();
+            fosterwxCashScheduleTaskList.setScheduleId(fosterwxCashAccountSchedule.getId());
+            fosterwxCashScheduleTaskList.setTemplateId(fosterwxCashAccountSchedule.getTemplateId());
+            fosterwxCashScheduleTaskList.setTaskId(fosterwxCashTaskList.getId());
+            fosterwxCashScheduleTaskList.setGroupId(fosterwxCashAccountSchedule.getGroupId());
+            fosterwxCashScheduleTaskList.setTaskType(fosterwxCashTaskList.getTaskType());
+            fosterwxCashScheduleTaskList.setRemark(fosterwxCashTaskList.getRemark());
+            fosterwxCashScheduleTaskList.setTaskContent("");
+            fosterwxCashScheduleTaskList.setGhId("");
+            // 任务类型为链接是直接赋值
+            if (4 == fosterwxCashTaskList.getTaskType()) {
+                fosterwxCashScheduleTaskList.setSendUrl(fosterwxCashTaskList.getUrl());
+                fosterwxCashScheduleTaskList.setStatus(4);
+                fosterwxCashScheduleTaskList.setErrInfo("");
+            } else {
+                fosterwxCashScheduleTaskList.setSendUrl("");
+                fosterwxCashScheduleTaskList.setStatus(1);
+                fosterwxCashScheduleTaskList.setErrInfo("");
+            }
+
+            fosterwxCashScheduleTaskList.setSendTime(LocalDateTime.of(fosterwxCashAccountSchedule.getScheduleDate(), fosterwxCashTaskList.getSendAt()));
+            fosterwxCashScheduleTaskList.setCreateUid(fosterwxCashAccountSchedule.getCreateUid());
+            fosterwxCashScheduleTaskList.setCreateUser(fosterwxCashAccountSchedule.getCreateUser());
+            fosterwxCashScheduleTaskList.setUpdateUid(fosterwxCashAccountSchedule.getCreateUid());
+            fosterwxCashScheduleTaskList.setCreateAt(LocalDateTime.now());
+            fosterwxCashScheduleTaskList.setUpdateAt(LocalDateTime.now());
+
+            fosterwxCashScheduleTaskListMapper.insert(fosterwxCashScheduleTaskList);
+
+            // 小程序和链接的任务不需要发送到typer
+            switch (fosterwxCashTaskList.getTaskType()) {
+                case 1:
+                    // 发文-小程序
+                    fosterwxCashScheduleTaskListService.editBoxUrl(fosterwxCashScheduleTaskList, fosterwxCashTaskList);
+                case 2:
+                    newsList.add(fosterwxCashScheduleTaskList);
+                    break;
+                case 3:
+                    // 小程序本地生成
+                    fosterwxCashScheduleTaskListService.editBoxUrl(fosterwxCashScheduleTaskList, fosterwxCashTaskList);
+                    break;
+                case 4:
+                    // 任务类型为链接是 不需要操作
+                    break;
+                default:
+                    break;
+
+            }
+        });
+        return newsList;
+    }
 }

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

@@ -9,6 +9,7 @@ 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.mapper.pangu.pojo.FosterwxCashWorkwxTaskList;
 import com.mokamrp.privates.service.CoralApiService;
 import com.mokamrp.privates.service.pangu.FosterwxCashOasBoxService;
 import com.mokamrp.privates.service.pangu.FosterwxCashScheduleTaskListService;
@@ -90,7 +91,7 @@ public class FosterwxCashScheduleTaskListServiceImpl extends ServiceImpl<Fosterw
     @Override
     public void cancelTask(Integer id, Integer userId) {
         fosterwxCashScheduleTaskListMapper.updateById(new FosterwxCashScheduleTaskList() {{
-            setId(id);
+            setScheduleId(id);
             setStatus(6);
             setUpdateUid(userId);
             setUpdateAt(LocalDateTime.now());
@@ -215,4 +216,48 @@ public class FosterwxCashScheduleTaskListServiceImpl extends ServiceImpl<Fosterw
 
         fosterwxCashScheduleTaskListMapper.updateById(fosterwxCashScheduleTaskList);
     }
+
+    @Override
+    public void editWorkBoxUrl(FosterwxCashScheduleTaskList fosterwxCashScheduleTaskList, FosterwxCashWorkwxTaskList fosterwxCashWorkwxTaskList) {
+        FosterwxCashOasBox fosterwxCashOasBox = fosterwxCashOasBoxService.getRandBox(fosterwxCashScheduleTaskList.getGroupId());
+        if (null == fosterwxCashOasBox) {
+            // 状态
+            fosterwxCashScheduleTaskList.setStatus(3);
+            // 失败原因
+            fosterwxCashScheduleTaskList.setErrInfo("该分组下没有可用的公众号");
+
+            fosterwxCashScheduleTaskListMapper.updateById(fosterwxCashScheduleTaskList);
+        }
+
+        fosterwxCashOasBoxService.addSendTextCnt(fosterwxCashScheduleTaskList.getGroupId(), fosterwxCashOasBox.getGhId());
+
+        // 状态
+        fosterwxCashScheduleTaskList.setStatus(1);
+        // 失败原因
+        fosterwxCashScheduleTaskList.setErrInfo("");
+        // 分配的公众号
+        if (3 == fosterwxCashWorkwxTaskList.getTaskType()) {
+            fosterwxCashScheduleTaskList.setGhId(fosterwxCashOasBox.getGhId());
+        } else if (1 == fosterwxCashWorkwxTaskList.getTaskType()) {
+            fosterwxCashScheduleTaskList.setBoxGhid(fosterwxCashOasBox.getGhId());
+        }
+
+        // 小程序链接
+        String sendUrl = "";
+        if (8 == fosterwxCashWorkwxTaskList.getBoxType()) {
+            // 投放版视频
+            // 发文链接
+            sendUrl = "/pages/index/index?type=tuiguang&videoId=" + fosterwxCashWorkwxTaskList.getVideoId();
+        } else {
+            // 盘古版视频
+            sendUrl = String.format("pages/index/index?type=tuiguang&materialId=%d&categoryId=&d", fosterwxCashWorkwxTaskList.getVideoId(), fosterwxCashWorkwxTaskList.getTagId());
+        }
+
+        fosterwxCashScheduleTaskList.setSendUrl(sendUrl);
+        if (1 == fosterwxCashWorkwxTaskList.getTaskType()) {
+            fosterwxCashScheduleTaskList.setBoxUrl(sendUrl);
+        }
+
+        fosterwxCashScheduleTaskListMapper.updateById(fosterwxCashScheduleTaskList);
+    }
 }