فهرست منبع

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

# Conflicts:
#	src/test/java/com/mokamrp/AutoMPPangu.java
leon 4 سال پیش
والد
کامیت
de39471392
19فایلهای تغییر یافته به همراه1029 افزوده شده و 3 حذف شده
  1. 10 0
      pom.xml
  2. 42 0
      src/main/java/com/mokamrp/privates/config/SwaggerConfig.java
  3. 144 0
      src/main/java/com/mokamrp/privates/controller/pangu/FosterwxCashAccountScheduleController.java
  4. 55 0
      src/main/java/com/mokamrp/privates/controller/pangu/FosterwxCashScheduleTaskListController.java
  5. 24 0
      src/main/java/com/mokamrp/privates/entity/pangu/FosterwxCashAccountScheduleHandle.java
  6. 22 0
      src/main/java/com/mokamrp/privates/mapper/pangu/FosterwxCashAccountScheduleMapper.java
  7. 56 0
      src/main/java/com/mokamrp/privates/mapper/pangu/FosterwxCashAccountScheduleMapper.xml
  8. 21 0
      src/main/java/com/mokamrp/privates/mapper/pangu/FosterwxCashScheduleTaskListMapper.java
  9. 31 0
      src/main/java/com/mokamrp/privates/mapper/pangu/FosterwxCashScheduleTaskListMapper.xml
  10. 176 0
      src/main/java/com/mokamrp/privates/mapper/pangu/pojo/FosterwxCashAccountSchedule.java
  11. 245 0
      src/main/java/com/mokamrp/privates/mapper/pangu/pojo/FosterwxCashScheduleTaskList.java
  12. 27 0
      src/main/java/com/mokamrp/privates/service/pangu/FosterwxCashAccountScheduleService.java
  13. 29 0
      src/main/java/com/mokamrp/privates/service/pangu/FosterwxCashScheduleTaskListService.java
  14. 77 0
      src/main/java/com/mokamrp/privates/service/pangu/impl/FosterwxCashAccountScheduleServiceImpl.java
  15. 64 0
      src/main/java/com/mokamrp/privates/service/pangu/impl/FosterwxCashScheduleTaskListServiceImpl.java
  16. 2 0
      src/main/resources/application-local.properties
  17. 2 0
      src/main/resources/application-prod.properties
  18. 1 2
      src/main/resources/application-test.properties
  19. 1 1
      src/test/java/com/mokamrp/AutoMPPangu.java

+ 10 - 0
pom.xml

@@ -188,6 +188,16 @@
             <artifactId>elasticsearch</artifactId>
             <version>6.4.3</version>
         </dependency>
+        <dependency>
+            <groupId>io.springfox</groupId>
+            <artifactId>springfox-boot-starter</artifactId>
+            <version>3.0.0</version>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.plugin</groupId>
+            <artifactId>spring-plugin-core</artifactId>
+            <version>2.0.0.RELEASE</version>
+        </dependency>
     </dependencies>
     <profiles>
         <!--        <profile>-->

+ 42 - 0
src/main/java/com/mokamrp/privates/config/SwaggerConfig.java

@@ -0,0 +1,42 @@
+package com.mokamrp.privates.config;
+
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import springfox.documentation.builders.ApiInfoBuilder;
+import springfox.documentation.builders.PathSelectors;
+import springfox.documentation.builders.RequestHandlerSelectors;
+import springfox.documentation.oas.annotations.EnableOpenApi;
+import springfox.documentation.service.ApiInfo;
+import springfox.documentation.service.Contact;
+import springfox.documentation.spi.DocumentationType;
+import springfox.documentation.spring.web.plugins.Docket;
+
+/**
+ * Swagger配置类
+ */
+@Configuration
+@EnableOpenApi
+public class SwaggerConfig {
+
+    @Bean
+    public Docket docket() {
+        return new Docket(DocumentationType.OAS_30)
+                .apiInfo(apiInfo()).enable(true)
+                .select()
+                //apis: 添加swagger接口提取范围
+                .apis(RequestHandlerSelectors.basePackage("com.mokamrp.privates"))
+                //.apis(RequestHandlerSelectors.withMethodAnnotation(ApiOperation.class))
+                .paths(PathSelectors.any())
+                .build();
+    }
+
+    private ApiInfo apiInfo() {
+        return new ApiInfoBuilder()
+                .title("盘古项目接口文档")
+                .description("盘古项目")
+                .contact(new Contact("作者", "作者URL", "作者Email"))
+                .version("1.0")
+                .build();
+    }
+}

+ 144 - 0
src/main/java/com/mokamrp/privates/controller/pangu/FosterwxCashAccountScheduleController.java

@@ -0,0 +1,144 @@
+package com.mokamrp.privates.controller.pangu;
+
+import com.mokamrp.privates.constant.HttpStatus;
+import com.mokamrp.privates.controller.BaseController;
+import com.mokamrp.privates.entity.ResHandle;
+import com.mokamrp.privates.entity.VoltaHandle;
+import com.mokamrp.privates.entity.pangu.FosterwxCashAccountScheduleHandle;
+import com.mokamrp.privates.help.AjaxResult;
+import com.mokamrp.privates.help.Analysis;
+import com.mokamrp.privates.interceptor.AuthUser;
+import com.mokamrp.privates.mapper.pangu.pojo.FosterwxCashAccountSchedule;
+import com.mokamrp.privates.mapper.pojo.User;
+import com.mokamrp.privates.service.pangu.FosterwxCashAccountScheduleService;
+import com.mokamrp.privates.service.pangu.FosterwxCashScheduleTaskListService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.validation.BindingResult;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.validation.Valid;
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+import java.util.*;
+
+
+/**
+ * <p>
+ * 盘古微信变现任务列表 前端控制器
+ * </p>
+ *
+ * @author leon
+ * @since 2021-10-08
+ */
+@RestController
+@RequestMapping("/pangu/fosterwxCashAccountSchedule")
+@Api(tags = "变现-账号排期")
+public class FosterwxCashAccountScheduleController extends BaseController<FosterwxCashAccountSchedule> {
+
+    public static final String REGEX = ",";
+    @Autowired
+    public FosterwxCashAccountScheduleService fosterwxCashAccountScheduleService;
+
+    @Autowired
+    public FosterwxCashScheduleTaskListService fosterwxCashScheduleTaskListService;
+
+    /*
+     * @fast
+     * 默认生成的控制器所继承的父类中有index/add/edit/del四个基础方法,均为post json请求
+     * 如果需要定制化,需要将BaseController中对应的方法复制到当前控制器,然后进行修改
+     */
+
+    @PostMapping("/list")
+    @ApiOperation(value = "获取列表信息")
+    public Object list(@Valid @RequestBody FosterwxCashAccountScheduleHandle handle, BindingResult bindingResult) {
+        if (bindingResult.hasErrors()) {
+            return AjaxResult.error(HttpStatus.ERROR, bindingResult.getFieldError().getDefaultMessage());
+        }
+        ResHandle<List<FosterwxCashAccountSchedule>> res = fosterwxCashAccountScheduleService.getList(handle);
+        return AjaxResult.success(res);
+    }
+
+    @PostMapping("/addPro")
+    @ApiOperation(value = "新建按钮")
+    @Transactional(rollbackFor = Exception.class)
+    public Object addPro(@RequestBody FosterwxCashAccountSchedule fosterwxCashAccountSchedule, @AuthUser User user) {
+        this.onInsert(fosterwxCashAccountSchedule);
+
+        fosterwxCashAccountSchedule.setCreateUid(user.getId());
+        fosterwxCashAccountSchedule.setCreateUser(user.getName());
+        fosterwxCashAccountSchedule.setUpdateUid(user.getId());
+
+        // 待创建
+        fosterwxCashAccountSchedule.setStatus(2);
+        fosterwxCashAccountScheduleService.save(fosterwxCashAccountSchedule);
+
+        return AjaxResult.success("新建成功");
+    }
+
+    @ApiOperation(value = "导入排期按钮")
+    @PostMapping("/importSchedule")
+    @Transactional(rollbackFor = Exception.class)
+    public Object importSchedule(@RequestBody MultipartFile file, @AuthUser User user) {
+        Map<String, Object> map = new HashMap<>(16);
+        Map<Integer, String> feild = new HashMap<>(5);
+        feild.put(0, "scheduleDate");
+        feild.put(1, "groupId");
+        feild.put(2, "templateId");
+        List<Map<String, String>> row = new ArrayList<>();
+        VoltaHandle<ArrayList<Map<String, String>>> voltaRes = Analysis.analysis(file, feild);
+        if (voltaRes.getErr() != null) {
+            return AjaxResult.error(voltaRes.getErr());
+        }
+        row = voltaRes.getData();
+
+        for (Map<String, String> detail : row) {
+            FosterwxCashAccountSchedule fosterwxCashAccountSchedule = new FosterwxCashAccountSchedule();
+            fosterwxCashAccountSchedule.setScheduleDate(LocalDate.parse(detail.get("scheduleDate")));
+            fosterwxCashAccountSchedule.setGroupId(Integer.valueOf(detail.get("groupId")));
+            fosterwxCashAccountSchedule.setTemplateId(Integer.valueOf(detail.get("templateId")));
+            fosterwxCashAccountSchedule.setStatus(2);
+            fosterwxCashAccountSchedule.setCreateUid(user.getId());
+            fosterwxCashAccountSchedule.setCreateUser(user.getName());
+            fosterwxCashAccountSchedule.setUpdateUid(user.getId());
+            fosterwxCashAccountSchedule.setCreateAt(LocalDateTime.now());
+            fosterwxCashAccountSchedule.setUpdateAt(LocalDateTime.now());
+
+            fosterwxCashAccountScheduleService.save(fosterwxCashAccountSchedule);
+        }
+
+        return AjaxResult.success("导入排期成功");
+    }
+
+    @PostMapping("/immediateCreate")
+    @Transactional(rollbackFor = Exception.class)
+    @ApiOperation(value = "立即生成----缺少typer的接口")
+    public Object immediateCreate(FosterwxCashAccountScheduleHandle handle) {
+        Arrays.asList(handle.getIds().split(REGEX)).forEach(id -> fosterwxCashAccountScheduleService.createTask(Integer.valueOf(id)));
+
+        return AjaxResult.success("立即生成成功");
+    }
+
+    @PostMapping("/preview")
+    @ApiOperation(value = "预览按钮---缺少老王的方法")
+    public Object priview(FosterwxCashAccountScheduleHandle handle) {
+        // TODO 等老王的接口
+
+        return AjaxResult.success("");
+    }
+
+    @PostMapping("/cancelTask")
+    @ApiOperation(value = "取消任务按钮")
+    public Object cancelTask(FosterwxCashAccountScheduleHandle handle, @AuthUser User user) {
+        Arrays.asList(handle.getIds().split(REGEX)).forEach(id -> fosterwxCashScheduleTaskListService.cancelTask(Integer.valueOf(id), user.getId()));
+
+        return AjaxResult.success("取消任务成功");
+    }
+}
+

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

@@ -0,0 +1,55 @@
+package com.mokamrp.privates.controller.pangu;
+
+import com.mokamrp.privates.constant.HttpStatus;
+import com.mokamrp.privates.controller.BaseController;
+import com.mokamrp.privates.entity.PostBasePageHandle;
+import com.mokamrp.privates.entity.ResHandle;
+import com.mokamrp.privates.help.AjaxResult;
+import com.mokamrp.privates.mapper.pangu.pojo.FosterwxCashScheduleTaskList;
+import com.mokamrp.privates.service.pangu.FosterwxCashScheduleTaskListService;
+import io.swagger.annotations.Api;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.validation.BindingResult;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.validation.Valid;
+import java.util.List;
+
+
+/**
+ * <p>
+ * 盘古微信变现排期任务列表 前端控制器
+ * </p>
+ *
+ * @author leon
+ * @since 2021-10-08
+ */
+@RestController
+@RequestMapping("/pangu/fosterwxCashScheduleTaskList")
+@Api(tags = "变现-任务列表")
+public class FosterwxCashScheduleTaskListController extends BaseController<FosterwxCashScheduleTaskList> {
+
+    @Autowired
+    public FosterwxCashScheduleTaskListService fosterwxCashScheduleTaskListService;
+
+    /*
+     * @fast
+     * 默认生成的控制器所继承的父类中有index/add/edit/del四个基础方法,均为post json请求
+     * 如果需要定制化,需要将BaseController中对应的方法复制到当前控制器,然后进行修改
+     */
+
+    @PostMapping("/list")
+    public Object list(@Valid @RequestBody PostBasePageHandle postBasePageHandle, BindingResult bindingResult) {
+        if (bindingResult.hasErrors()) {
+            return AjaxResult.error(HttpStatus.ERROR, bindingResult.getFieldError().getDefaultMessage());
+        }
+        ResHandle<List<FosterwxCashScheduleTaskList>> res = fosterwxCashScheduleTaskListService.getList(postBasePageHandle);
+        return AjaxResult.success(res);
+    }
+
+
+}
+

+ 24 - 0
src/main/java/com/mokamrp/privates/entity/pangu/FosterwxCashAccountScheduleHandle.java

@@ -0,0 +1,24 @@
+package com.mokamrp.privates.entity.pangu;
+
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+import lombok.Data;
+
+/**
+ * <p>
+ * 盘古微信变现任务列表
+ * </p>
+ *
+ * @author luqc
+ * @since 2021-10-08
+ */
+@Data
+public class FosterwxCashAccountScheduleHandle extends Model<FosterwxCashAccountScheduleHandle> {
+    private Integer page;
+    private Integer pageSize;
+    private Integer id;
+    private Integer groupId;
+    private Integer templateId;
+    private Integer createUid;
+    private String createUser;
+    private String ids;
+}

+ 22 - 0
src/main/java/com/mokamrp/privates/mapper/pangu/FosterwxCashAccountScheduleMapper.java

@@ -0,0 +1,22 @@
+package com.mokamrp.privates.mapper.pangu;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.mokamrp.privates.mapper.pangu.pojo.FosterwxCashAccountSchedule;
+import org.apache.ibatis.annotations.Param;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+
+/**
+ * <p>
+ * 盘古微信变现任务列表 Mapper 接口
+ * </p>
+ *
+ * @author leon
+ * @since 2021-10-08
+ */
+@Component
+public interface FosterwxCashAccountScheduleMapper extends BaseMapper<FosterwxCashAccountSchedule> {
+    public List<FosterwxCashAccountSchedule> getList(@Param("ew") LambdaQueryWrapper<FosterwxCashAccountSchedule> querryWraper, @Param("pagesize") Integer pagesize, @Param("i") int i);
+}

+ 56 - 0
src/main/java/com/mokamrp/privates/mapper/pangu/FosterwxCashAccountScheduleMapper.xml

@@ -0,0 +1,56 @@
+<?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.FosterwxCashAccountScheduleMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.mokamrp.privates.mapper.pangu.pojo.FosterwxCashAccountSchedule">
+        <id column="id" property="id" />
+        <result column="schedule_date" property="scheduleDate" />
+        <result column="group_id" property="groupId" />
+        <result column="template_id" property="templateId" />
+        <result column="status" property="status" />
+        <result column="create_uid" property="createUid" />
+        <result column="create_user" property="createUser" />
+        <result column="update_uid" property="updateUid" />
+        <result column="create_at" property="createAt" />
+        <result column="update_at" property="updateAt" />
+    </resultMap>
+
+    <!-- 通用查询结果列 -->
+    <sql id="Base_Column_List">
+        id, schedule_date, group_id, template_id, status, create_uid, update_uid, create_at, update_at
+    </sql>
+    <select id="getList" resultType="com.mokamrp.privates.mapper.pangu.pojo.FosterwxCashAccountSchedule">
+        SELECT
+            account_schedule.id,
+            mobile_group.group_name,
+            task_template.template_name,
+            account_schedule.create_user,
+            (
+                SELECT
+                    count( id )
+                FROM
+                    pan_fosterwx_cash_schedule_task_list
+                WHERE
+                    schedule_id = account_schedule.id
+                  AND STATUS IN ( '2', '4', '5', '6' )) AS created_count,
+            (
+                SELECT
+                    count( id )
+                FROM
+                    pan_fosterwx_cash_schedule_task_list
+                WHERE
+                    schedule_id = account_schedule.id
+                  AND STATUS IN ( '5' )) AS sended_count,
+            ( SELECT count( id ) FROM pan_fosterwx_cash_schedule_task_list WHERE schedule_id = account_schedule.id ) AS total_count
+        FROM
+            pan_fosterwx_cash_account_schedule account_schedule
+        LEFT JOIN pan_fosterwx_cash_task_template task_template ON account_schedule.template_id = task_template.id
+        LEFT JOIN pan_fosterwx_cash_mobile_group mobile_group ON account_schedule.group_id = mobile_group.id
+        <where>
+            ${ew.sqlSegment}
+        </where>
+        order by account_schedule.id desc
+        limit #{pagesize} offset #{i}
+    </select>
+</mapper>

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

@@ -0,0 +1,21 @@
+package com.mokamrp.privates.mapper.pangu;
+
+import com.mokamrp.privates.mapper.pangu.pojo.FosterwxCashScheduleTaskList;
+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-10-08
+ */
+@Component
+public interface FosterwxCashScheduleTaskListMapper extends BaseMapper<FosterwxCashScheduleTaskList> {
+    public List<FosterwxCashScheduleTaskList> getList(Page<FosterwxCashScheduleTaskList> pageObj);
+}

+ 31 - 0
src/main/java/com/mokamrp/privates/mapper/pangu/FosterwxCashScheduleTaskListMapper.xml

@@ -0,0 +1,31 @@
+<?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.FosterwxCashScheduleTaskListMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.mokamrp.privates.mapper.pangu.pojo.FosterwxCashScheduleTaskList">
+        <id column="id" property="id" />
+        <result column="schedule_id" property="scheduleId" />
+        <result column="template_id" property="templateId" />
+        <result column="group_id" property="groupId" />
+        <result column="task_type" property="taskType" />
+        <result column="remark" property="remark" />
+        <result column="task_content" property="taskContent" />
+        <result column="status" property="status" />
+        <result column="err_info" property="errInfo" />
+        <result column="send_time" property="sendTime" />
+        <result column="create_uid" property="createUid" />
+        <result column="create_user" property="createUser" />
+        <result column="update_uid" property="updateUid" />
+        <result column="create_at" property="createAt" />
+        <result column="update_at" property="updateAt" />
+    </resultMap>
+
+    <!-- 通用查询结果列 -->
+    <sql id="Base_Column_List">
+        id, schedule_id, template_id, 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 * FROM pan_fosterwx_cash_schedule_task_list
+    </select>
+</mapper>

+ 176 - 0
src/main/java/com/mokamrp/privates/mapper/pangu/pojo/FosterwxCashAccountSchedule.java

@@ -0,0 +1,176 @@
+package com.mokamrp.privates.mapper.pangu.pojo;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+import java.time.LocalDate;
+import com.baomidou.mybatisplus.annotation.TableId;
+import java.time.LocalDateTime;
+import java.io.Serializable;
+
+/**
+ * <p>
+ * 盘古微信变现任务列表
+ * </p>
+ *
+ * @author leon
+ * @since 2021-10-08
+ */
+@TableName("pan_fosterwx_cash_account_schedule")
+public class FosterwxCashAccountSchedule extends Model<FosterwxCashAccountSchedule> {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * id
+     */
+      @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    /**
+     * 排期日期
+     */
+    private LocalDate scheduleDate;
+
+    /**
+     * 组别id
+     */
+    private Integer groupId;
+
+    /**
+     * 模板id
+     */
+    private Integer templateId;
+
+    /**
+     * 任务状态(1:正常 0:取消 2:待创建)
+     */
+    private Integer status;
+
+    /**
+     * 创建人
+     */
+    private Integer createUid;
+
+    /**
+     * 创建人名称
+     */
+    private String createUser;
+
+    /**
+     * 更新人
+     */
+    private Integer updateUid;
+
+    /**
+     * 创建时间
+     */
+    private LocalDateTime createAt;
+
+    /**
+     * 更新时间
+     */
+    private LocalDateTime updateAt;
+
+
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    public LocalDate getScheduleDate() {
+        return scheduleDate;
+    }
+
+    public void setScheduleDate(LocalDate scheduleDate) {
+        this.scheduleDate = scheduleDate;
+    }
+
+    public Integer getGroupId() {
+        return groupId;
+    }
+
+    public void setGroupId(Integer groupId) {
+        this.groupId = groupId;
+    }
+
+    public Integer getTemplateId() {
+        return templateId;
+    }
+
+    public void setTemplateId(Integer templateId) {
+        this.templateId = templateId;
+    }
+
+    public Integer getStatus() {
+        return status;
+    }
+
+    public void setStatus(Integer status) {
+        this.status = status;
+    }
+
+    public Integer getCreateUid() {
+        return createUid;
+    }
+
+    public void setCreateUid(Integer createUid) {
+        this.createUid = createUid;
+    }
+
+    public String getCreateUser() {
+        return createUser;
+    }
+
+    public void setCreateUser(String createUser) {
+        this.createUser = createUser;
+    }
+
+    public Integer getUpdateUid() {
+        return updateUid;
+    }
+
+    public void setUpdateUid(Integer updateUid) {
+        this.updateUid = updateUid;
+    }
+
+    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 "FosterwxCashAccountSchedule{" +
+        "id=" + id +
+        ", scheduleDate=" + scheduleDate +
+        ", groupId=" + groupId +
+        ", templateId=" + templateId +
+        ", status=" + status +
+        ", createUid=" + createUid +
+        ", createUser=" + createUser +
+        ", updateUid=" + updateUid +
+        ", createAt=" + createAt +
+        ", updateAt=" + updateAt +
+        "}";
+    }
+}

+ 245 - 0
src/main/java/com/mokamrp/privates/mapper/pangu/pojo/FosterwxCashScheduleTaskList.java

@@ -0,0 +1,245 @@
+package com.mokamrp.privates.mapper.pangu.pojo;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+import com.baomidou.mybatisplus.annotation.TableId;
+import java.time.LocalDateTime;
+import java.io.Serializable;
+
+/**
+ * <p>
+ * 盘古微信变现排期任务列表
+ * </p>
+ *
+ * @author leon
+ * @since 2021-10-08
+ */
+@TableName("pan_fosterwx_cash_schedule_task_list")
+public class FosterwxCashScheduleTaskList extends Model<FosterwxCashScheduleTaskList> {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * id
+     */
+      @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    /**
+     * 排期id
+     */
+    private Integer scheduleId;
+
+    /**
+     * 模板id
+     */
+    private Integer templateId;
+
+    /**
+     * 组别id
+     */
+    private Integer groupId;
+
+    /**
+     * 任务类型(1.发文-小程序卡片2.发文-图文3.小程序4.链接)
+     */
+    private Integer taskType;
+
+    /**
+     * 任务描述
+     */
+    private String remark;
+
+    /**
+     * 任务名称
+     */
+    private String taskContent;
+
+    /**
+     * 状态(1、待生成;2、已生成;3、生成失败;4、待发送;5、已发送;6、已取消)
+     */
+    private Integer status;
+
+    /**
+     * 失败原因
+     */
+    private String errInfo;
+
+    /**
+     * 发送时间
+     */
+    private LocalDateTime sendTime;
+
+    /**
+     * 创建人
+     */
+    private Integer createUid;
+
+    /**
+     * 创建人名称
+     */
+    private String createUser;
+
+    /**
+     * 更新人
+     */
+    private Integer updateUid;
+
+    /**
+     * 创建时间
+     */
+    private LocalDateTime createAt;
+
+    /**
+     * 更新时间
+     */
+    private LocalDateTime updateAt;
+
+
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    public Integer getScheduleId() {
+        return scheduleId;
+    }
+
+    public void setScheduleId(Integer scheduleId) {
+        this.scheduleId = scheduleId;
+    }
+
+    public Integer getTemplateId() {
+        return templateId;
+    }
+
+    public void setTemplateId(Integer templateId) {
+        this.templateId = templateId;
+    }
+
+    public Integer getGroupId() {
+        return groupId;
+    }
+
+    public void setGroupId(Integer groupId) {
+        this.groupId = groupId;
+    }
+
+    public Integer getTaskType() {
+        return taskType;
+    }
+
+    public void setTaskType(Integer taskType) {
+        this.taskType = taskType;
+    }
+
+    public String getRemark() {
+        return remark;
+    }
+
+    public void setRemark(String remark) {
+        this.remark = remark;
+    }
+
+    public String getTaskContent() {
+        return taskContent;
+    }
+
+    public void setTaskContent(String taskContent) {
+        this.taskContent = taskContent;
+    }
+
+    public Integer getStatus() {
+        return status;
+    }
+
+    public void setStatus(Integer status) {
+        this.status = status;
+    }
+
+    public String getErrInfo() {
+        return errInfo;
+    }
+
+    public void setErrInfo(String errInfo) {
+        this.errInfo = errInfo;
+    }
+
+    public LocalDateTime getSendTime() {
+        return sendTime;
+    }
+
+    public void setSendTime(LocalDateTime sendTime) {
+        this.sendTime = sendTime;
+    }
+
+    public Integer getCreateUid() {
+        return createUid;
+    }
+
+    public void setCreateUid(Integer createUid) {
+        this.createUid = createUid;
+    }
+
+    public String getCreateUser() {
+        return createUser;
+    }
+
+    public void setCreateUser(String createUser) {
+        this.createUser = createUser;
+    }
+
+    public Integer getUpdateUid() {
+        return updateUid;
+    }
+
+    public void setUpdateUid(Integer updateUid) {
+        this.updateUid = updateUid;
+    }
+
+    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 "FosterwxCashScheduleTaskList{" +
+        "id=" + id +
+        ", scheduleId=" + scheduleId +
+        ", templateId=" + templateId +
+        ", groupId=" + groupId +
+        ", taskType=" + taskType +
+        ", remark=" + remark +
+        ", taskContent=" + taskContent +
+        ", status=" + status +
+        ", errInfo=" + errInfo +
+        ", sendTime=" + sendTime +
+        ", createUid=" + createUid +
+        ", createUser=" + createUser +
+        ", updateUid=" + updateUid +
+        ", createAt=" + createAt +
+        ", updateAt=" + updateAt +
+        "}";
+    }
+}

+ 27 - 0
src/main/java/com/mokamrp/privates/service/pangu/FosterwxCashAccountScheduleService.java

@@ -0,0 +1,27 @@
+package com.mokamrp.privates.service.pangu;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.mokamrp.privates.entity.ResHandle;
+import com.mokamrp.privates.entity.pangu.FosterwxCashAccountScheduleHandle;
+import com.mokamrp.privates.mapper.pangu.pojo.FosterwxCashAccountSchedule;
+
+import java.util.List;
+
+/**
+ * <p>
+ * 盘古微信变现任务列表 服务类
+ * </p>
+ *
+ * @author leon
+ * @since 2021-10-08
+ */
+public interface FosterwxCashAccountScheduleService extends IService<FosterwxCashAccountSchedule> {
+    //.@leon 获取数据列表
+    public ResHandle<List<FosterwxCashAccountSchedule>> getList(FosterwxCashAccountScheduleHandle handle);
+
+    /**
+     * 根据排期id 创建任务列表
+     * @param id
+     */
+    void createTask(Integer id);
+}

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

@@ -0,0 +1,29 @@
+package com.mokamrp.privates.service.pangu;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.mokamrp.privates.entity.PostBasePageHandle;
+import com.mokamrp.privates.entity.ResHandle;
+import com.mokamrp.privates.mapper.pangu.pojo.FosterwxCashScheduleTaskList;
+
+import java.util.List;
+
+/**
+ * <p>
+ * 盘古微信变现排期任务列表 服务类
+ * </p>
+ *
+ * @author leon
+ * @since 2021-10-08
+ */
+public interface FosterwxCashScheduleTaskListService extends IService<FosterwxCashScheduleTaskList> {
+    //.@leon 获取数据列表
+    public ResHandle<List<FosterwxCashScheduleTaskList>> getList(PostBasePageHandle handle);
+
+
+    /**
+     * 根据排期id 取消任务
+     * @param id
+     * @param userId
+     */
+    void cancelTask(Integer id, Integer userId);
+}

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

@@ -0,0 +1,77 @@
+package com.mokamrp.privates.service.pangu.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.mokamrp.privates.entity.ResHandle;
+import com.mokamrp.privates.entity.pangu.FosterwxCashAccountScheduleHandle;
+import com.mokamrp.privates.mapper.pangu.FosterwxCashAccountScheduleMapper;
+import com.mokamrp.privates.mapper.pangu.pojo.FosterwxCashAccountSchedule;
+import com.mokamrp.privates.mapper.pangu.pojo.FosterwxCashTaskList;
+import com.mokamrp.privates.service.pangu.FosterwxCashAccountScheduleService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * <p>
+ * 盘古微信变现任务列表 服务实现类
+ * </p>
+ *
+ * @author leon
+ * @since 2021-10-08
+ */
+@Service
+public class FosterwxCashAccountScheduleServiceImpl extends ServiceImpl<FosterwxCashAccountScheduleMapper, FosterwxCashAccountSchedule> implements FosterwxCashAccountScheduleService {
+
+    @Autowired
+    public FosterwxCashAccountScheduleMapper fosterwxCashAccountScheduleMapper;
+
+    /**
+     * 获取数据列表 支持分页
+     * @param handle
+     * @return
+     */
+    public ResHandle<List<FosterwxCashAccountSchedule>> getList(FosterwxCashAccountScheduleHandle handle) {
+        Integer pagesize = handle.getPageSize();
+        Integer page = handle.getPage();
+        LambdaQueryWrapper<FosterwxCashAccountSchedule> fosterwxCashAccountScheduleLambdaQueryWrapper = new LambdaQueryWrapper<>();
+        // 任务模板
+        if (null != handle.getTemplateId())
+            fosterwxCashAccountScheduleLambdaQueryWrapper.eq(FosterwxCashAccountSchedule::getTemplateId, handle.getTemplateId());
+        // 创建人
+        if (null != handle.getCreateUid())
+            fosterwxCashAccountScheduleLambdaQueryWrapper.eq(FosterwxCashAccountSchedule::getCreateUid, handle.getCreateUid());
+        // 账号组别
+        if (null != handle.getGroupId())
+            fosterwxCashAccountScheduleLambdaQueryWrapper.eq(FosterwxCashAccountSchedule::getGroupId, handle.getGroupId());
+        // 获取总件数
+        Long maxCount = Long.valueOf(fosterwxCashAccountScheduleMapper.selectCount(fosterwxCashAccountScheduleLambdaQueryWrapper));
+
+        List<FosterwxCashAccountSchedule> list = fosterwxCashAccountScheduleMapper.getList(fosterwxCashAccountScheduleLambdaQueryWrapper, pagesize, (page - 1) * pagesize);
+        ResHandle<List<FosterwxCashAccountSchedule>> res = new ResHandle<>();
+        res.setList(list);
+        res.setTotal(maxCount);
+        return res;
+    }
+
+    /**
+     * 根据id创建任务列表
+     * @param id
+     */
+    @Override
+    public void createTask(Integer id) {
+        FosterwxCashAccountSchedule fosterwxCashAccountSchedule = fosterwxCashAccountScheduleMapper.selectById(id);
+
+        if (null != fosterwxCashAccountSchedule) {
+            // 根据任务模板id获取任务模板详情
+            // TODO 需要老王那边配合写个方法
+            List<FosterwxCashTaskList> fosterwxCashTaskLists = new ArrayList<>();
+
+            fosterwxCashTaskLists.forEach(fosterwxCashTaskList -> {
+
+            });
+        }
+    }
+}

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

@@ -0,0 +1,64 @@
+package com.mokamrp.privates.service.pangu.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.mokamrp.privates.entity.PostBasePageHandle;
+import com.mokamrp.privates.entity.ResHandle;
+import com.mokamrp.privates.mapper.pangu.FosterwxCashScheduleTaskListMapper;
+import com.mokamrp.privates.mapper.pangu.pojo.FosterwxCashScheduleTaskList;
+import com.mokamrp.privates.service.pangu.FosterwxCashScheduleTaskListService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.time.LocalDateTime;
+import java.util.List;
+
+/**
+ * <p>
+ * 盘古微信变现排期任务列表 服务实现类
+ * </p>
+ *
+ * @author leon
+ * @since 2021-10-08
+ */
+@Service
+public class FosterwxCashScheduleTaskListServiceImpl extends ServiceImpl<FosterwxCashScheduleTaskListMapper, FosterwxCashScheduleTaskList> implements FosterwxCashScheduleTaskListService {
+
+    @Autowired
+    public FosterwxCashScheduleTaskListMapper fosterwxCashScheduleTaskListMapper;
+
+    /**
+     * 获取数据列表 支持分页
+     * @param handle
+     * @return
+     */
+    public ResHandle<List<FosterwxCashScheduleTaskList>> getList(PostBasePageHandle handle) {
+        Integer pagesize = handle.getPagesize();
+        Integer page = handle.getPage();
+        Page<FosterwxCashScheduleTaskList> pageObj = new Page<FosterwxCashScheduleTaskList>(page, pagesize);
+        List<FosterwxCashScheduleTaskList> list = fosterwxCashScheduleTaskListMapper.getList(pageObj);
+        ResHandle<List<FosterwxCashScheduleTaskList>> res = new ResHandle<>();
+        res.setList(list);
+        res.setTotal(pageObj.getTotal());
+        return res;
+    }
+
+    /**
+     * 根据排期id 取消任务
+     * @param id
+     * @param userId
+     */
+    @Override
+    public void cancelTask(Integer id, Integer userId) {
+        LambdaQueryWrapper<FosterwxCashScheduleTaskList> fosterwxCashScheduleTaskListLambdaQueryWrapper = new LambdaQueryWrapper<>();
+        fosterwxCashScheduleTaskListLambdaQueryWrapper.eq(FosterwxCashScheduleTaskList::getScheduleId, id);
+        fosterwxCashScheduleTaskListLambdaQueryWrapper.notIn(FosterwxCashScheduleTaskList::getStatus, 3, 5, 6);
+
+        fosterwxCashScheduleTaskListMapper.update(new FosterwxCashScheduleTaskList() {{
+            setStatus(6);
+            setUpdateUid(userId);
+            setUpdateAt(LocalDateTime.now());
+        }}, fosterwxCashScheduleTaskListLambdaQueryWrapper);
+    }
+}

+ 2 - 0
src/main/resources/application-local.properties

@@ -86,3 +86,5 @@ typer.url=https://test.typer.mokamrp.com/api
 
 #定时任务全局开关,本地环境无需开启
 cronjob.power=true
+
+springfox.documentation.swagger-ui.enabled=true

+ 2 - 0
src/main/resources/application-prod.properties

@@ -80,3 +80,5 @@ typer.url=http://new-typer-combine-svc/api
 
 #定时任务全局开关,线上环境需要开启
 cronjob.power=true
+
+springfox.documentation.swagger-ui.enabled=false

+ 1 - 2
src/main/resources/application-test.properties

@@ -79,5 +79,4 @@ typer.url=http://new-typer-combine-svc/api
 #定时任务全局开关,线上环境需要开启
 cronjob.power=false
 
-
-
+springfox.documentation.swagger-ui.enabled=true

+ 1 - 1
src/test/java/com/mokamrp/AutoMPPangu.java

@@ -48,7 +48,7 @@ public class AutoMPPangu {
 				.setColumnNaming(NamingStrategy.underline_to_camel)
 				.setNaming(NamingStrategy.underline_to_camel) // 数据库表映射到实体的命名策略,下划线转驼峰命名
 				.setTablePrefix("pan_") //表名前缀
-				.setInclude("pan_fosterwx_cash_oas_box");  //生成的表
+				.setInclude("pan_fosterwx_cash_account_schedule");
 		//4. 包名策略配置
 		PackageConfig pkConfig = new PackageConfig();
 		pkConfig.setParent("com.mokamrp.privates")