diff --git a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/tasktask/controller/TaskTaskController.java b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/tasktask/controller/TaskTaskController.java index c132ae5..eb2629b 100644 --- a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/tasktask/controller/TaskTaskController.java +++ b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/tasktask/controller/TaskTaskController.java @@ -10,8 +10,10 @@ import java.net.URLDecoder; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import liquibase.pro.packaged.E; import org.apache.commons.lang.StringUtils; import org.apache.shiro.SecurityUtils; +import org.flowable.task.api.Task; import org.jeecg.common.api.vo.Result; import org.jeecg.common.system.query.QueryGenerator; import org.jeecg.common.system.query.QueryRuleEnum; @@ -37,6 +39,7 @@ import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; import org.jeecg.common.system.base.controller.JeecgController; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.util.CollectionUtils; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartHttpServletRequest; @@ -192,6 +195,17 @@ public class TaskTaskController extends JeecgController> queryByBusinessId(@RequestParam(name = "businessId", required = true) String businessId) throws Exception { + List taskTaskList = taskTaskService.getTaskTaskListByBusinessId(businessId); + if (CollectionUtils.isEmpty(taskTaskList)) { + return Result.error("未找到对应数据"); + } + return Result.OK(taskTaskList); + } + /** * 导出excel * diff --git a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/tasktask/service/ITaskTaskService.java b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/tasktask/service/ITaskTaskService.java index 548f294..4067099 100644 --- a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/tasktask/service/ITaskTaskService.java +++ b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/tasktask/service/ITaskTaskService.java @@ -4,6 +4,8 @@ import org.jeecg.common.api.vo.Result; import org.jeecg.modules.tasktask.entity.TaskTask; import com.baomidou.mybatisplus.extension.service.IService; +import java.util.List; + /** * @Description: 事项任务计划表(发起流程) * @Author: jeecg-boot @@ -14,4 +16,5 @@ public interface ITaskTaskService extends IService { boolean singleFlowStart(TaskTask taskTask,String userName) throws Exception; boolean multiFlowStart(TaskTask taskTask,String userName,Integer intervalType, Integer startCount) throws Exception; Result handleFlowStart(TaskTask taskTask, String username, Integer intervalType, Integer startCount)throws Exception; + List getTaskTaskListByBusinessId(String businessId) throws Exception; } diff --git a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/tasktask/service/impl/TaskTaskServiceImpl.java b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/tasktask/service/impl/TaskTaskServiceImpl.java index 0cf1f36..3e41091 100644 --- a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/tasktask/service/impl/TaskTaskServiceImpl.java +++ b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/tasktask/service/impl/TaskTaskServiceImpl.java @@ -1,6 +1,7 @@ package org.jeecg.modules.tasktask.service.impl; import com.alibaba.fastjson.JSON; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import org.apache.commons.lang.StringUtils; import org.apache.shiro.util.Assert; import org.jeecg.common.api.vo.Result; @@ -121,4 +122,13 @@ public class TaskTaskServiceImpl extends ServiceImpl i return Result.ok(); } + public List getTaskTaskListByBusinessId(String businessId) throws Exception{ + if (StringUtils.isBlank(businessId)) { + return Collections.emptyList(); + } + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(TaskTask::getBusinessId, businessId); + // 2. 查询不到数据 → MP 本身会返回空集合,不是 null + return this.list(queryWrapper); + } }