Ver Fonte

Merge branch 'dev-lqc' into test

lqc há 4 anos atrás
pai
commit
a219b0faea

+ 8 - 3
src/main/java/com/mokamrp/privates/controller/pangu/FosterwxCashAccountScheduleController.java

@@ -11,9 +11,11 @@ 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.pangu.pojo.FosterwxCashScheduleTaskList;
+import com.mokamrp.privates.mapper.pangu.pojo.FosterwxCashTaskList;
 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.FosterwxCashTaskTemplateService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -51,6 +53,9 @@ public class FosterwxCashAccountScheduleController extends BaseController<Foster
     @Autowired
     public FosterwxCashScheduleTaskListService fosterwxCashScheduleTaskListService;
 
+    @Autowired
+    public FosterwxCashTaskTemplateService fosterwxCashTaskTemplateService;
+
     /*
      * @fast
      * 默认生成的控制器所继承的父类中有index/add/edit/del四个基础方法,均为post json请求
@@ -128,11 +133,11 @@ public class FosterwxCashAccountScheduleController extends BaseController<Foster
     }
 
     @PostMapping("/preview")
-    @ApiOperation(value = "预览按钮---缺少老王的方法")
+    @ApiOperation(value = "预览按钮")
     public Object priview(FosterwxCashAccountScheduleHandle handle) {
-        // TODO 等老王的接口
+        ResHandle<List<FosterwxCashTaskList>> resHandle = fosterwxCashTaskTemplateService.getTaskByTemplateId(handle.getTemplateId());
 
-        return AjaxResult.success("");
+        return AjaxResult.success(resHandle);
     }
 
     @PostMapping("/cancelTask")

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

@@ -4,6 +4,7 @@ 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 com.mokamrp.privates.mapper.pojo.User;
 
 import java.util.List;
 
@@ -22,6 +23,7 @@ public interface FosterwxCashAccountScheduleService extends IService<FosterwxCas
     /**
      * 根据排期id 创建任务列表
      * @param id
+     *
      */
     void createTask(Integer id);
 }

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

@@ -5,13 +5,16 @@ 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.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.service.pangu.FosterwxCashAccountScheduleService;
 import com.mokamrp.privates.service.pangu.FosterwxCashTaskTemplateService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.time.LocalDateTime;
 import java.util.List;
 
 /**
@@ -31,6 +34,9 @@ public class FosterwxCashAccountScheduleServiceImpl extends ServiceImpl<Fosterwx
     @Autowired
     public FosterwxCashTaskTemplateService fosterwxCashTaskTemplateService;
 
+    @Autowired
+    public FosterwxCashScheduleTaskListMapper fosterwxCashScheduleTaskListMapper;
+
     /**
      * 获取数据列表 支持分页
      * @param handle
@@ -63,6 +69,7 @@ public class FosterwxCashAccountScheduleServiceImpl extends ServiceImpl<Fosterwx
     /**
      * 根据id创建任务列表
      * @param id
+     *
      */
     @Override
     public void createTask(Integer id) {
@@ -73,7 +80,23 @@ public class FosterwxCashAccountScheduleServiceImpl extends ServiceImpl<Fosterwx
             ResHandle<List<FosterwxCashTaskList>> resHandle = fosterwxCashTaskTemplateService.getTaskByTemplateId(fosterwxCashAccountSchedule.getId());
 
             resHandle.getList().forEach(fosterwxCashTaskList -> {
+                FosterwxCashScheduleTaskList fosterwxCashScheduleTaskList = new FosterwxCashScheduleTaskList();
+                fosterwxCashScheduleTaskList.setScheduleId(fosterwxCashAccountSchedule.getId());
+                fosterwxCashScheduleTaskList.setTemplateId(fosterwxCashAccountSchedule.getTemplateId());
+                fosterwxCashScheduleTaskList.setGroupId(fosterwxCashAccountSchedule.getGroupId());
+                fosterwxCashScheduleTaskList.setTaskType(fosterwxCashTaskList.getTaskType());
+                fosterwxCashScheduleTaskList.setRemark(fosterwxCashTaskList.getRemark());
+                fosterwxCashScheduleTaskList.setTaskContent("");
+                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);
             });
         }
     }