فهرست منبع

Merge branch 'dev-lqc' into test

lqc 4 سال پیش
والد
کامیت
17125794a5

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

@@ -8,8 +8,11 @@ import com.mokamrp.privates.entity.pangu.FosterwxCashScheduleTaskListHandle;
 import com.mokamrp.privates.help.AjaxResult;
 import com.mokamrp.privates.interceptor.AuthUser;
 import com.mokamrp.privates.mapper.pangu.pojo.FosterwxCashScheduleTaskList;
+import com.mokamrp.privates.mapper.pangu.pojo.FosterwxCashScheduleTaskMobile;
 import com.mokamrp.privates.mapper.pojo.User;
+import com.mokamrp.privates.service.pangu.FosterwxCashMobileService;
 import com.mokamrp.privates.service.pangu.FosterwxCashScheduleTaskListService;
+import com.mokamrp.privates.service.pangu.FosterwxCashScheduleTaskMobileService;
 import com.mokamrp.privates.service.pangu.FosterwxCashWorkwxTaskListService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
@@ -18,6 +21,7 @@ import org.springframework.validation.BindingResult;
 import org.springframework.web.bind.annotation.*;
 
 import javax.validation.Valid;
+import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
 
@@ -43,6 +47,12 @@ public class FosterwxCashScheduleTaskListController extends BaseController<Foste
     @Autowired
     public FosterwxCashWorkwxTaskListService fosterwxCashWorkwxTaskListService;
 
+    @Autowired
+    public FosterwxCashScheduleTaskMobileService fosterwxCashScheduleTaskMobileService;
+
+    @Autowired
+    public FosterwxCashMobileService fosterwxCashMobileService;
+
     /*
      * @fast
      * 默认生成的控制器所继承的父类中有index/add/edit/del四个基础方法,均为post json请求
@@ -104,5 +114,30 @@ public class FosterwxCashScheduleTaskListController extends BaseController<Foste
 
         return AjaxResult.success(fosterwxCashScheduleTaskLists);
     }
+
+    @GetMapping("/previewTask")
+    @ApiOperation(value = "查看任务的发送状态 页面展示的是聚合的数据 需要单独提供查看同一个任务的所有子任务")
+    public Object previewTask(String id) {
+        // 获取详细信息
+        FosterwxCashScheduleTaskList fosterwxCashScheduleTaskList = fosterwxCashScheduleTaskListService.getById(id);
+
+        List<FosterwxCashScheduleTaskList> fosterwxCashScheduleTaskLists = fosterwxCashScheduleTaskListService.list(new LambdaQueryWrapper<FosterwxCashScheduleTaskList>().
+                eq(FosterwxCashScheduleTaskList::getScheduleId, fosterwxCashScheduleTaskList.getScheduleId()).
+                eq(FosterwxCashScheduleTaskList::getTemplateId, fosterwxCashScheduleTaskList.getTemplateId()).
+                eq(FosterwxCashScheduleTaskList::getTaskId, fosterwxCashScheduleTaskList.getTaskId()));
+
+        List<FosterwxCashScheduleTaskMobile> fosterwxCashScheduleTaskMobiles = new ArrayList<>();
+
+        fosterwxCashScheduleTaskLists.forEach(detail -> {
+            fosterwxCashScheduleTaskMobiles.addAll(fosterwxCashScheduleTaskMobileService.list(new LambdaQueryWrapper<FosterwxCashScheduleTaskMobile>().eq(FosterwxCashScheduleTaskMobile::getTaskId, detail.getId())));
+        });
+
+        fosterwxCashScheduleTaskMobiles.forEach(fosterwxCashScheduleTaskMobile -> {
+            fosterwxCashScheduleTaskMobile.setFosterwxCashScheduleTaskList(fosterwxCashScheduleTaskListService.getById(fosterwxCashScheduleTaskMobile.getTaskId()));
+            fosterwxCashScheduleTaskMobile.setFosterwxCashMobile(fosterwxCashMobileService.getById(fosterwxCashScheduleTaskMobile.getMobileId()));
+        });
+
+        return AjaxResult.success(fosterwxCashScheduleTaskMobiles);
+    }
 }
 

+ 34 - 6
src/main/java/com/mokamrp/privates/controller/pangu/FosterwxCashWorkClientController.java

@@ -57,6 +57,9 @@ public class FosterwxCashWorkClientController {
     @Autowired
     private CoralApiService coralApiService;
 
+    @Autowired
+    private FosterwxCashScheduleTaskMobileService fosterwxCashScheduleTaskMobileService;
+
 
     @PostMapping(value = "/getTaskInfo", consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE)
     @ApiOperation(value = "返回凌晨到当前时间的未发送的数据,主体 昵称/团队id 昵称 两两一组必须有数据")
@@ -96,11 +99,20 @@ public class FosterwxCashWorkClientController {
 
         List<FosterwxCashBoxClientInfo> fosterwxCashBoxClientInfoList = new ArrayList<>();
         fosterwxCashScheduleTaskListList.forEach(fosterwxCashScheduleTaskList -> {
-            fosterwxCashScheduleTaskListService.updateById(new FosterwxCashScheduleTaskList() {{
-                setId(fosterwxCashScheduleTaskList.getId());
-                setStatus(5);
-                setUpdateAt(LocalDateTime.now());
-            }});
+            // fosterwxCashScheduleTaskListService.updateById(new FosterwxCashScheduleTaskList() {{
+            //     setId(fosterwxCashScheduleTaskList.getId());
+            //     setStatus(5);
+            //     setUpdateAt(LocalDateTime.now());
+            // }});
+            FosterwxCashScheduleTaskMobile fosterwxCashScheduleTaskMobile = new FosterwxCashScheduleTaskMobile();
+            fosterwxCashScheduleTaskMobile.setTaskId(fosterwxCashScheduleTaskList.getId());
+            fosterwxCashScheduleTaskMobile.setGroupId(fosterwxCashScheduleTaskList.getGroupId());
+            fosterwxCashScheduleTaskMobile.setMobileId(fosterwxMobile.getId());
+            fosterwxCashScheduleTaskMobile.setStatus(2);
+            fosterwxCashScheduleTaskMobile.setCreateAt(LocalDateTime.now());
+            fosterwxCashScheduleTaskMobile.setUpdateAt(LocalDateTime.now());
+
+            fosterwxCashScheduleTaskMobileService.save(fosterwxCashScheduleTaskMobile);
 
             // 获取任务详情
             FosterwxCashWorkwxTaskList fosterwxCashWorkwxTaskList = fosterwxCashWorkwxTaskListService.getOne(new LambdaQueryWrapper<FosterwxCashWorkwxTaskList>().
@@ -181,7 +193,7 @@ public class FosterwxCashWorkClientController {
 
         // 主体 手机号 组
         if (null != handle.getCorpName() && !handle.getCorpName().isEmpty()) {
-            // 获取主信息
+            // 获取主信息
             Corp corp = corpService.getOne(new LambdaQueryWrapper<Corp>().eq(Corp::getName, handle.getCorpName()).last("LIMIT 1"));
             if (null != handle.getMobileNo() && !handle.getMobileNo().isEmpty()) {
                 if (null == corp) return null;
@@ -211,6 +223,14 @@ public class FosterwxCashWorkClientController {
                 return fosterwxMobile;
         }
 
+        // 团队id 手机号 组
+        if (null != handle.getMobileNo() && !handle.getMobileNo().isEmpty() && null != handle.getTeamId() && !handle.getTeamId().isEmpty()) {
+            fosterwxMobile = fosterwxMobileService.getOne(new LambdaQueryWrapper<FosterwxMobile>().eq(FosterwxMobile::getTeamId, handle.getTeamId()).eq(FosterwxMobile::getMobileNo, handle.getMobileNo()).last("LIMIT 1"));
+
+            if (null != fosterwxMobile)
+                return fosterwxMobile;
+        }
+
         return null;
     }
 
@@ -248,4 +268,12 @@ public class FosterwxCashWorkClientController {
 
         return "新增修改成功!";
     }
+
+    @PostMapping(value = "/changeTaskMobileStatus", consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE)
+    @ApiOperation(value = "客户端返回发送状态  根据id更新状态<br>状态(1:待发送;2:发送中;3:已发送;4:已过期;5:发送失败)")
+    public Object changeTaskMobileStatus(FosterwxCashScheduleTaskMobile fosterwxCashScheduleTaskMobile) {
+        fosterwxCashScheduleTaskMobileService.updateById(fosterwxCashScheduleTaskMobile);
+
+        return AjaxResult.success("更新成功!");
+    }
 }

+ 2 - 0
src/main/java/com/mokamrp/privates/entity/pangu/FosterwxCashBoxClientInfo.java

@@ -12,6 +12,8 @@ import lombok.Data;
 public class FosterwxCashBoxClientInfo {
     private Integer taskType;
 
+    private Integer id;
+
     private UrlInfo urlInfo;
 
     private BoxInfo boxInfo;

+ 21 - 0
src/main/java/com/mokamrp/privates/mapper/pangu/FosterwxCashScheduleTaskMobileMapper.java

@@ -0,0 +1,21 @@
+package com.mokamrp.privates.mapper.pangu;
+
+import com.mokamrp.privates.mapper.pangu.pojo.FosterwxCashScheduleTaskMobile;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import org.springframework.stereotype.Component;
+import org.apache.ibatis.annotations.Param;
+import java.util.List;
+
+/**
+ * <p>
+ * 盘古个微养号变现企微任务账户详情 Mapper 接口
+ * </p>
+ *
+ * @author leon
+ * @since 2021-11-09
+ */
+@Component
+public interface FosterwxCashScheduleTaskMobileMapper extends BaseMapper<FosterwxCashScheduleTaskMobile> {
+    public List<FosterwxCashScheduleTaskMobile> getList(Page<FosterwxCashScheduleTaskMobile> pageObj);
+}

+ 23 - 0
src/main/java/com/mokamrp/privates/mapper/pangu/FosterwxCashScheduleTaskMobileMapper.xml

@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.mokamrp.privates.mapper.pangu.FosterwxCashScheduleTaskMobileMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.mokamrp.privates.mapper.pangu.pojo.FosterwxCashScheduleTaskMobile">
+        <id column="id" property="id" />
+        <result column="task_id" property="taskId" />
+        <result column="group_id" property="groupId" />
+        <result column="mobile_id" property="mobileId" />
+        <result column="status" property="status" />
+        <result column="create_at" property="createAt" />
+        <result column="update_at" property="updateAt" />
+    </resultMap>
+
+    <!-- 通用查询结果列 -->
+    <sql id="Base_Column_List">
+        id, task_id, group_id, mobile_id, status, create_at, update_at
+    </sql>
+    <select id="getList" resultType="com.mokamrp.privates.mapper.pangu.pojo.FosterwxCashScheduleTaskMobile">
+        SELECT * FROM pan_fosterwx_cash_schedule_task_mobile
+    </select>
+</mapper>

+ 157 - 0
src/main/java/com/mokamrp/privates/mapper/pangu/pojo/FosterwxCashScheduleTaskMobile.java

@@ -0,0 +1,157 @@
+package com.mokamrp.privates.mapper.pangu.pojo;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+
+import java.io.Serializable;
+import java.time.LocalDateTime;
+
+/**
+ * <p>
+ * 盘古个微养号变现企微任务账户详情
+ * </p>
+ *
+ * @author leon
+ * @since 2021-11-09
+ */
+@TableName("pan_fosterwx_cash_schedule_task_mobile")
+public class FosterwxCashScheduleTaskMobile extends Model<FosterwxCashScheduleTaskMobile> {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * ID
+     */
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    /**
+     * 任务id
+     */
+    private Integer taskId;
+
+    /**
+     * 分组
+     */
+    private Integer groupId;
+
+    /**
+     * 账号id
+     */
+    private Integer mobileId;
+
+    /**
+     * 状态(1:待发送;2:发送中;3:已发送;4:已过期;)
+     */
+    private Integer status;
+
+    /**
+     * 创建时间
+     */
+    private LocalDateTime createAt;
+
+    /**
+     * 更新时间
+     */
+    private LocalDateTime updateAt;
+
+    @TableField(exist = false)
+    private FosterwxCashScheduleTaskList fosterwxCashScheduleTaskList;
+
+    @TableField(exist = false)
+    private FosterwxCashMobile fosterwxCashMobile;
+
+
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    public Integer getTaskId() {
+        return taskId;
+    }
+
+    public void setTaskId(Integer taskId) {
+        this.taskId = taskId;
+    }
+
+    public Integer getGroupId() {
+        return groupId;
+    }
+
+    public void setGroupId(Integer groupId) {
+        this.groupId = groupId;
+    }
+
+    public Integer getMobileId() {
+        return mobileId;
+    }
+
+    public void setMobileId(Integer mobileId) {
+        this.mobileId = mobileId;
+    }
+
+    public Integer getStatus() {
+        return status;
+    }
+
+    public void setStatus(Integer status) {
+        this.status = status;
+    }
+
+    public LocalDateTime getCreateAt() {
+        return createAt;
+    }
+
+    public void setCreateAt(LocalDateTime createAt) {
+        this.createAt = createAt;
+    }
+
+    public LocalDateTime getUpdateAt() {
+        return updateAt;
+    }
+
+    public void setUpdateAt(LocalDateTime updateAt) {
+        this.updateAt = updateAt;
+    }
+
+    @Override
+    protected Serializable pkVal() {
+        return this.id;
+    }
+
+    @Override
+    public String toString() {
+        return "FosterwxCashScheduleTaskMobile{" +
+                "id=" + id +
+                ", taskId=" + taskId +
+                ", groupId=" + groupId +
+                ", mobileId=" + mobileId +
+                ", status=" + status +
+                ", createAt=" + createAt +
+                ", updateAt=" + updateAt +
+                "}";
+    }
+
+    public FosterwxCashScheduleTaskList getFosterwxCashScheduleTaskList() {
+        return fosterwxCashScheduleTaskList;
+    }
+
+    public void setFosterwxCashScheduleTaskList(FosterwxCashScheduleTaskList fosterwxCashScheduleTaskList) {
+        this.fosterwxCashScheduleTaskList = fosterwxCashScheduleTaskList;
+    }
+
+    public FosterwxCashMobile getFosterwxCashMobile() {
+        return fosterwxCashMobile;
+    }
+
+    public void setFosterwxCashMobile(FosterwxCashMobile fosterwxCashMobile) {
+        this.fosterwxCashMobile = fosterwxCashMobile;
+    }
+}

+ 20 - 0
src/main/java/com/mokamrp/privates/service/pangu/FosterwxCashScheduleTaskMobileService.java

@@ -0,0 +1,20 @@
+package com.mokamrp.privates.service.pangu;
+
+import com.mokamrp.privates.mapper.pangu.pojo.FosterwxCashScheduleTaskMobile;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.mokamrp.privates.entity.PostBasePageHandle;
+import com.mokamrp.privates.entity.ResHandle;
+import java.util.List;
+import java.util.Map;
+/**
+ * <p>
+ * 盘古个微养号变现企微任务账户详情 服务类
+ * </p>
+ *
+ * @author leon
+ * @since 2021-11-09
+ */
+public interface FosterwxCashScheduleTaskMobileService extends IService<FosterwxCashScheduleTaskMobile> {
+    //.@leon 获取数据列表
+    public ResHandle<List<FosterwxCashScheduleTaskMobile>> getList(PostBasePageHandle handle);
+}

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

@@ -158,7 +158,7 @@ public class FosterwxCashAccountScheduleServiceImpl extends ServiceImpl<Fosterwx
             // 任务类型为链接是直接赋值
             if (4 == fosterwxCashWorkwxTaskList.getTaskType() || 3 == fosterwxCashWorkwxTaskList.getTaskType()) {
                 fosterwxCashScheduleTaskList.setSendUrl(fosterwxCashWorkwxTaskList.getUrl());
-                fosterwxCashScheduleTaskList.setStatus(4);
+                fosterwxCashScheduleTaskList.setStatus(2);
                 fosterwxCashScheduleTaskList.setErrInfo("");
             } else {
                 fosterwxCashScheduleTaskList.setSendUrl("");

+ 43 - 0
src/main/java/com/mokamrp/privates/service/pangu/impl/FosterwxCashScheduleTaskMobileServiceImpl.java

@@ -0,0 +1,43 @@
+package com.mokamrp.privates.service.pangu.impl;
+
+import com.mokamrp.privates.mapper.pangu.pojo.FosterwxCashScheduleTaskMobile;
+import com.mokamrp.privates.mapper.pangu.FosterwxCashScheduleTaskMobileMapper;
+import com.mokamrp.privates.service.pangu.FosterwxCashScheduleTaskMobileService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+import com.mokamrp.privates.entity.PostBasePageHandle;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import com.mokamrp.privates.entity.ResHandle;
+import java.util.*;
+
+/**
+ * <p>
+ * 盘古个微养号变现企微任务账户详情 服务实现类
+ * </p>
+ *
+ * @author leon
+ * @since 2021-11-09
+ */
+@Service
+public class FosterwxCashScheduleTaskMobileServiceImpl extends ServiceImpl<FosterwxCashScheduleTaskMobileMapper, FosterwxCashScheduleTaskMobile> implements FosterwxCashScheduleTaskMobileService {
+
+    @Autowired
+    public FosterwxCashScheduleTaskMobileMapper fosterwxCashScheduleTaskMobileMapper;
+    /**
+     * 获取数据列表 支持分页
+     * @param handle
+     * @return
+     */
+    public ResHandle<List<FosterwxCashScheduleTaskMobile>> getList(PostBasePageHandle handle) {
+        Integer pagesize = handle.getPagesize();
+        Integer page = handle.getPage();
+        Page<FosterwxCashScheduleTaskMobile> pageObj = new Page<FosterwxCashScheduleTaskMobile>(page, pagesize);
+        List<FosterwxCashScheduleTaskMobile> list = fosterwxCashScheduleTaskMobileMapper.getList(pageObj);
+        ResHandle<List<FosterwxCashScheduleTaskMobile>> res = new ResHandle<>();
+        res.setList(list);
+        res.setTotal(pageObj.getTotal());
+        return res;
+    }
+}

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

@@ -46,7 +46,7 @@ public class SyncFosterwxCash {
                 fosterwxCashScheduleTaskListService.updateById(new FosterwxCashScheduleTaskList() {{
                     setId(Integer.valueOf(jsonObject.get("automatic_id").toString()));
                     setSendUrl(jsonObject.get("article_url").toString());
-                    setStatus(4);
+                    setStatus(2);
                 }});
             } else {
                 fosterwxCashScheduleTaskListService.updateById(new FosterwxCashScheduleTaskList() {{