From f1208474f771a1c233d7425c8ed13fbaa0d521ac Mon Sep 17 00:00:00 2001 From: baoshiwei <baoshiwei@shlanbao.cn> Date: 星期三, 12 三月 2025 09:35:13 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/5.X' into 5.X --- ruoyi-modules/ruoyi-workflow/src/main/java/org/dromara/workflow/controller/FlwTaskController.java | 201 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 201 insertions(+), 0 deletions(-) diff --git a/ruoyi-modules/ruoyi-workflow/src/main/java/org/dromara/workflow/controller/FlwTaskController.java b/ruoyi-modules/ruoyi-workflow/src/main/java/org/dromara/workflow/controller/FlwTaskController.java new file mode 100644 index 0000000..463916b --- /dev/null +++ b/ruoyi-modules/ruoyi-workflow/src/main/java/org/dromara/workflow/controller/FlwTaskController.java @@ -0,0 +1,201 @@ +package org.dromara.workflow.controller; + +import lombok.RequiredArgsConstructor; +import org.dromara.common.core.domain.R; +import org.dromara.common.core.domain.dto.StartProcessReturnDTO; +import org.dromara.common.core.domain.dto.UserDTO; +import org.dromara.common.core.validate.AddGroup; +import org.dromara.common.idempotent.annotation.RepeatSubmit; +import org.dromara.common.log.annotation.Log; +import org.dromara.common.log.enums.BusinessType; +import org.dromara.common.mybatis.core.page.PageQuery; +import org.dromara.common.mybatis.core.page.TableDataInfo; +import org.dromara.common.web.core.BaseController; +import org.dromara.warm.flow.core.entity.Node; +import org.dromara.workflow.common.ConditionalOnEnable; +import org.dromara.workflow.domain.bo.*; +import org.dromara.workflow.domain.vo.FlowHisTaskVo; +import org.dromara.workflow.domain.vo.FlowTaskVo; +import org.dromara.workflow.service.IFlwTaskService; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +/** + * 浠诲姟绠$悊 鎺у埗灞� + * + * @author may + */ +@ConditionalOnEnable +@Validated +@RequiredArgsConstructor +@RestController +@RequestMapping("/workflow/task") +public class FlwTaskController extends BaseController { + + private final IFlwTaskService flwTaskService; + + /** + * 鍚姩浠诲姟 + * + * @param startProcessBo 鍚姩娴佺▼鍙傛暟 + */ + @Log(title = "浠诲姟绠$悊", businessType = BusinessType.INSERT) + @RepeatSubmit() + @PostMapping("/startWorkFlow") + public R<StartProcessReturnDTO> startWorkFlow(@Validated(AddGroup.class) @RequestBody StartProcessBo startProcessBo) { + StartProcessReturnDTO startProcessReturn = flwTaskService.startWorkFlow(startProcessBo); + return R.ok("鎻愪氦鎴愬姛", startProcessReturn); + } + + /** + * 鍔炵悊浠诲姟 + * + * @param completeTaskBo 鍔炵悊浠诲姟鍙傛暟 + */ + @Log(title = "浠诲姟绠$悊", businessType = BusinessType.INSERT) + @RepeatSubmit() + @PostMapping("/completeTask") + public R<Void> completeTask(@Validated(AddGroup.class) @RequestBody CompleteTaskBo completeTaskBo) { + return toAjax(flwTaskService.completeTask(completeTaskBo)); + } + + /** + * 鏌ヨ褰撳墠鐢ㄦ埛鐨勫緟鍔炰换鍔� + * + * @param flowTaskBo 鍙傛暟 + * @param pageQuery 鍒嗛〉 + */ + @GetMapping("/pageByTaskWait") + public TableDataInfo<FlowTaskVo> pageByTaskWait(FlowTaskBo flowTaskBo, PageQuery pageQuery) { + return flwTaskService.pageByTaskWait(flowTaskBo, pageQuery); + } + + /** + * 鏌ヨ褰撳墠鐢ㄦ埛鐨勫凡鍔炰换鍔� + * + * @param flowTaskBo 鍙傛暟 + * @param pageQuery 鍒嗛〉 + */ + + @GetMapping("/pageByTaskFinish") + public TableDataInfo<FlowHisTaskVo> pageByTaskFinish(FlowTaskBo flowTaskBo, PageQuery pageQuery) { + return flwTaskService.pageByTaskFinish(flowTaskBo, pageQuery); + } + + /** + * 鏌ヨ寰呭姙浠诲姟 + * + * @param flowTaskBo 鍙傛暟 + * @param pageQuery 鍒嗛〉 + */ + @GetMapping("/pageByAllTaskWait") + public TableDataInfo<FlowTaskVo> pageByAllTaskWait(FlowTaskBo flowTaskBo, PageQuery pageQuery) { + return flwTaskService.pageByAllTaskWait(flowTaskBo, pageQuery); + } + + /** + * 鏌ヨ宸插姙浠诲姟 + * + * @param flowTaskBo 鍙傛暟 + * @param pageQuery 鍒嗛〉 + */ + @GetMapping("/pageByAllTaskFinish") + public TableDataInfo<FlowHisTaskVo> pageByAllTaskFinish(FlowTaskBo flowTaskBo, PageQuery pageQuery) { + return flwTaskService.pageByAllTaskFinish(flowTaskBo, pageQuery); + } + + /** + * 鏌ヨ褰撳墠鐢ㄦ埛鐨勬妱閫� + * + * @param flowTaskBo 鍙傛暟 + * @param pageQuery 鍒嗛〉 + */ + @GetMapping("/pageByTaskCopy") + public TableDataInfo<FlowTaskVo> pageByTaskCopy(FlowTaskBo flowTaskBo, PageQuery pageQuery) { + return flwTaskService.pageByTaskCopy(flowTaskBo, pageQuery); + } + + /** + * 鏍规嵁taskId鏌ヨ浠h〃浠诲姟 + * + * @param taskId 浠诲姟id + */ + @GetMapping("/getTask/{taskId}") + public R<FlowTaskVo> getTask(@PathVariable Long taskId) { + return R.ok(flwTaskService.selectById(taskId)); + } + + /** + * 缁堟浠诲姟 + * + * @param bo 鍙傛暟 + */ + @Log(title = "浠诲姟绠$悊", businessType = BusinessType.INSERT) + @RepeatSubmit() + @PostMapping("/terminationTask") + public R<Boolean> terminationTask(@RequestBody FlowTerminationBo bo) { + return R.ok(flwTaskService.terminationTask(bo)); + } + + /** + * 浠诲姟鎿嶄綔 + * + * @param bo 鍙傛暟 + * @param taskOperation 鎿嶄綔绫诲瀷锛屽娲� delegateTask銆佽浆鍔� transferTask銆佸姞绛� addSignature銆佸噺绛� reductionSignature + */ + @Log(title = "浠诲姟绠$悊", businessType = BusinessType.UPDATE) + @RepeatSubmit + @PostMapping("/taskOperation/{taskOperation}") + public R<Void> taskOperation(@Validated @RequestBody TaskOperationBo bo, @PathVariable String taskOperation) { + return toAjax(flwTaskService.taskOperation(bo, taskOperation)); + } + + /** + * 淇敼浠诲姟鍔炵悊浜� + * + * @param taskIdList 浠诲姟id + * @param userId 鍔炵悊浜篿d + */ + @Log(title = "浠诲姟绠$悊", businessType = BusinessType.UPDATE) + @RepeatSubmit() + @PutMapping("/updateAssignee/{userId}") + public R<Void> updateAssignee(@RequestBody List<Long> taskIdList, @PathVariable String userId) { + return toAjax(flwTaskService.updateAssignee(taskIdList, userId)); + } + + /** + * 椹冲洖瀹℃壒 + * + * @param bo 鍙傛暟 + */ + @Log(title = "浠诲姟绠$悊", businessType = BusinessType.INSERT) + @RepeatSubmit() + @PostMapping("/backProcess") + public R<Void> backProcess(@Validated({AddGroup.class}) @RequestBody BackProcessBo bo) { + return toAjax(flwTaskService.backProcess(bo)); + } + + /** + * 鑾峰彇鍙┏鍥炵殑鍓嶇疆鑺傜偣 + * + * @param definitionId 娴佺▼瀹氫箟id + * @param nowNodeCode 褰撳墠鑺傜偣 + */ + @GetMapping("/getBackTaskNode/{definitionId}/{nowNodeCode}") + public R<List<Node>> getBackTaskNode(@PathVariable Long definitionId, @PathVariable String nowNodeCode) { + return R.ok(flwTaskService.getBackTaskNode(definitionId, nowNodeCode)); + } + + /** + * 鑾峰彇褰撳墠浠诲姟鐨勬墍鏈夊姙鐞嗕汉 + * + * @param taskId 浠诲姟id + */ + @GetMapping("/currentTaskAllUser/{taskId}") + public R<List<UserDTO>> currentTaskAllUser(@PathVariable Long taskId) { + return R.ok(flwTaskService.currentTaskAllUser(taskId)); + } + +} -- Gitblit v1.9.3