|
|
@@ -10,14 +10,12 @@ import com.mokamrp.privates.interceptor.AuthUser;
|
|
|
import com.mokamrp.privates.mapper.pangu.pojo.FosterwxCashScheduleTaskList;
|
|
|
import com.mokamrp.privates.mapper.pojo.User;
|
|
|
import com.mokamrp.privates.service.pangu.FosterwxCashScheduleTaskListService;
|
|
|
+import com.mokamrp.privates.service.pangu.FosterwxCashWorkwxTaskListService;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
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 org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import javax.validation.Valid;
|
|
|
import java.util.Arrays;
|
|
|
@@ -42,6 +40,9 @@ public class FosterwxCashScheduleTaskListController extends BaseController<Foste
|
|
|
@Autowired
|
|
|
public FosterwxCashScheduleTaskListService fosterwxCashScheduleTaskListService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ public FosterwxCashWorkwxTaskListService fosterwxCashWorkwxTaskListService;
|
|
|
+
|
|
|
/*
|
|
|
* @fast
|
|
|
* 默认生成的控制器所继承的父类中有index/add/edit/del四个基础方法,均为post json请求
|
|
|
@@ -55,6 +56,11 @@ public class FosterwxCashScheduleTaskListController extends BaseController<Foste
|
|
|
return AjaxResult.error(HttpStatus.ERROR, bindingResult.getFieldError().getDefaultMessage());
|
|
|
}
|
|
|
ResHandle<List<FosterwxCashScheduleTaskList>> res = fosterwxCashScheduleTaskListService.getList(handle);
|
|
|
+
|
|
|
+ res.getList().forEach(fosterwxCashScheduleTaskList -> {
|
|
|
+ FosterwxCashScheduleTaskList detail = fosterwxCashScheduleTaskListService.getById(fosterwxCashScheduleTaskList.getId());
|
|
|
+ fosterwxCashScheduleTaskList.setFosterwxCashWorkwxTaskList(fosterwxCashWorkwxTaskListService.getById(detail.getChildTaskId()));
|
|
|
+ });
|
|
|
return AjaxResult.success(res);
|
|
|
}
|
|
|
|
|
|
@@ -65,14 +71,37 @@ public class FosterwxCashScheduleTaskListController extends BaseController<Foste
|
|
|
Arrays.asList(handle.getIds().split(REGEX)).forEach(id -> fosterwxCashScheduleTaskListService.cancelTask(Integer.valueOf(id), user.getId()));
|
|
|
} else {
|
|
|
Arrays.asList(handle.getIds().split(REGEX)).forEach(id -> {
|
|
|
- FosterwxCashScheduleTaskList fosterwxCashScheduleTaskList = fosterwxCashScheduleTaskListService.getById(id);
|
|
|
- List<FosterwxCashScheduleTaskList> fosterwxCashScheduleTaskListList = fosterwxCashScheduleTaskListService.list(new LambdaQueryWrapper<FosterwxCashScheduleTaskList>().eq(FosterwxCashScheduleTaskList::getTaskId, fosterwxCashScheduleTaskList.getTaskId()));
|
|
|
+ // 企微任务列表 页面的取消任务是全部取消 预览页面的取消任务是精准取消
|
|
|
+ if (handle.getIsAllDel() == 1) {
|
|
|
+ FosterwxCashScheduleTaskList fosterwxCashScheduleTaskList = fosterwxCashScheduleTaskListService.getById(id);
|
|
|
+ List<FosterwxCashScheduleTaskList> fosterwxCashScheduleTaskListList = fosterwxCashScheduleTaskListService.list(new LambdaQueryWrapper<FosterwxCashScheduleTaskList>().eq(FosterwxCashScheduleTaskList::getTaskId, fosterwxCashScheduleTaskList.getTaskId()));
|
|
|
|
|
|
- fosterwxCashScheduleTaskListList.forEach(detail -> fosterwxCashScheduleTaskListService.cancelTask(detail.getId(), user.getId()));
|
|
|
+ fosterwxCashScheduleTaskListList.forEach(detail -> fosterwxCashScheduleTaskListService.cancelTask(detail.getId(), user.getId()));
|
|
|
+ } else {
|
|
|
+ fosterwxCashScheduleTaskListService.cancelTask(Integer.valueOf(id), user.getId());
|
|
|
+ }
|
|
|
});
|
|
|
}
|
|
|
|
|
|
return AjaxResult.success("取消任务成功");
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ @GetMapping("/preview")
|
|
|
+ @ApiOperation(value = "给企微任务列表使用的预览接口 页面展示的是聚合的数据 需要单独提供查看同一个任务的所有子任务")
|
|
|
+ public Object preview(String id) {
|
|
|
+ // 获取详细信息
|
|
|
+ FosterwxCashScheduleTaskList fosterwxCashScheduleTaskList = fosterwxCashScheduleTaskListService.getById(id);
|
|
|
+
|
|
|
+ List<FosterwxCashScheduleTaskList> fosterwxCashScheduleTaskLists = fosterwxCashScheduleTaskListService.list(new LambdaQueryWrapper<FosterwxCashScheduleTaskList>().
|
|
|
+ eq(FosterwxCashScheduleTaskList::getTemplateId, fosterwxCashScheduleTaskList.getTemplateId()).
|
|
|
+ eq(FosterwxCashScheduleTaskList::getTaskId, fosterwxCashScheduleTaskList.getTaskId()));
|
|
|
+
|
|
|
+ fosterwxCashScheduleTaskLists.forEach(detail -> {
|
|
|
+ detail.setFosterwxCashWorkwxTaskList(fosterwxCashWorkwxTaskListService.getById(detail.getChildTaskId()));
|
|
|
+ });
|
|
|
+
|
|
|
+ return AjaxResult.success(fosterwxCashScheduleTaskLists);
|
|
|
+ }
|
|
|
}
|
|
|
|