CAN_SUB_SIGN_STATUS_LIST = Arrays.asList(PROCESS.result, WAIT_BEFORE_TASK.result);
-
- /**
- * 结果
- *
- * 如果新增时,注意 {@link #isEndResult(Integer)} 是否需要变更
- */
- private final Integer result;
- /**
- * 描述
- */
- private final String desc;
-
- /**
- * 判断该结果是否已经处于 End 最终结果
- *
- * 主要用于一些结果更新的逻辑,如果已经是最终结果,就不再进行更新
- *
- * @param result 结果
- * @return 是否
- */
- public static boolean isEndResult(Integer result) {
- return ObjectUtils.equalsAny(result, APPROVE.getResult(), REJECT.getResult(),
- CANCEL.getResult(), BACK.getResult(),
- SIGN_AFTER.getResult());
- }
-
-}
diff --git a/yudao-module-bpm/yudao-module-bpm-api/src/main/java/cn/iocoder/yudao/module/bpm/enums/task/BpmProcessInstanceStatusEnum.java b/yudao-module-bpm/yudao-module-bpm-api/src/main/java/cn/iocoder/yudao/module/bpm/enums/task/BpmProcessInstanceStatusEnum.java
index 70a31dd34..82a4119b5 100644
--- a/yudao-module-bpm/yudao-module-bpm-api/src/main/java/cn/iocoder/yudao/module/bpm/enums/task/BpmProcessInstanceStatusEnum.java
+++ b/yudao-module-bpm/yudao-module-bpm-api/src/main/java/cn/iocoder/yudao/module/bpm/enums/task/BpmProcessInstanceStatusEnum.java
@@ -1,19 +1,26 @@
package cn.iocoder.yudao.module.bpm.enums.task;
+import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
import lombok.AllArgsConstructor;
import lombok.Getter;
+import java.util.Arrays;
+
/**
- * 流程实例的状态
+ * 流程实例 ProcessInstance 的状态
*
* @author 芋道源码
*/
@Getter
@AllArgsConstructor
-public enum BpmProcessInstanceStatusEnum {
+public enum BpmProcessInstanceStatusEnum implements IntArrayValuable {
- RUNNING(1, "进行中"),
- FINISH(2, "已完成");
+ RUNNING(1, "审批中"),
+ APPROVE(2, "审批通过"),
+ REJECT(3, "审批不通过"),
+ CANCEL(4, "已取消");
+
+ public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(BpmProcessInstanceStatusEnum::getStatus).toArray();
/**
* 状态
@@ -24,4 +31,9 @@ public enum BpmProcessInstanceStatusEnum {
*/
private final String desc;
+ @Override
+ public int[] array() {
+ return new int[0];
+ }
+
}
diff --git a/yudao-module-bpm/yudao-module-bpm-api/src/main/java/cn/iocoder/yudao/module/bpm/enums/task/BpmTaskAddSignTypeEnum.java b/yudao-module-bpm/yudao-module-bpm-api/src/main/java/cn/iocoder/yudao/module/bpm/enums/task/BpmTaskAddSignTypeEnum.java
deleted file mode 100644
index 42c212e28..000000000
--- a/yudao-module-bpm/yudao-module-bpm-api/src/main/java/cn/iocoder/yudao/module/bpm/enums/task/BpmTaskAddSignTypeEnum.java
+++ /dev/null
@@ -1,40 +0,0 @@
-package cn.iocoder.yudao.module.bpm.enums.task;
-
-import lombok.AllArgsConstructor;
-import lombok.Getter;
-
-/**
- * 流程任务 -- 加签类型枚举类型
- */
-@Getter
-@AllArgsConstructor
-public enum BpmTaskAddSignTypeEnum {
-
- /**
- * 向前加签,需要前置任务审批完成,才回到原审批人
- */
- BEFORE("before", "向前加签"),
- /**
- * 向后加签,需要后置任务全部审批完,才会通过原审批人节点
- */
- AFTER("after", "向后加签"),
- /**
- * 创建后置加签时的过度状态,用于控制向后加签生成的任务状态
- */
- AFTER_CHILDREN_TASK("afterChildrenTask", "向后加签生成的子任务");
-
- private final String type;
-
- private final String desc;
-
- public static String formatDesc(String type) {
- for (BpmTaskAddSignTypeEnum value : values()) {
- if (value.type.equals(type)) {
- return value.desc;
- }
- }
- return null;
- }
-
-}
-
\ No newline at end of file
diff --git a/yudao-module-bpm/yudao-module-bpm-api/src/main/java/cn/iocoder/yudao/module/bpm/enums/task/BpmTaskSignTypeEnum.java b/yudao-module-bpm/yudao-module-bpm-api/src/main/java/cn/iocoder/yudao/module/bpm/enums/task/BpmTaskSignTypeEnum.java
new file mode 100644
index 000000000..b01153d79
--- /dev/null
+++ b/yudao-module-bpm/yudao-module-bpm-api/src/main/java/cn/iocoder/yudao/module/bpm/enums/task/BpmTaskSignTypeEnum.java
@@ -0,0 +1,47 @@
+package cn.iocoder.yudao.module.bpm.enums.task;
+
+import cn.hutool.core.util.ArrayUtil;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+/**
+ * 流程任务的加签类型枚举
+ *
+ * @author kehaiyou
+ */
+@Getter
+@AllArgsConstructor
+public enum BpmTaskSignTypeEnum {
+
+ /**
+ * 向前加签,需要前置任务审批完成,才回到原审批人
+ */
+ BEFORE("before", "向前加签"),
+ /**
+ * 向后加签,需要后置任务全部审批完,才会通过原审批人节点
+ */
+ AFTER("after", "向后加签");
+
+ /**
+ * 类型
+ */
+ private final String type;
+ /**
+ * 名字
+ */
+ private final String name;
+
+ public static String nameOfType(String type) {
+ for (BpmTaskSignTypeEnum value : values()) {
+ if (value.type.equals(type)) {
+ return value.name;
+ }
+ }
+ return null;
+ }
+
+ public static BpmTaskSignTypeEnum of(String type) {
+ return ArrayUtil.firstMatch(value -> value.getType().equals(type), values());
+ }
+
+}
diff --git a/yudao-module-bpm/yudao-module-bpm-api/src/main/java/cn/iocoder/yudao/module/bpm/enums/task/BpmTaskStatustEnum.java b/yudao-module-bpm/yudao-module-bpm-api/src/main/java/cn/iocoder/yudao/module/bpm/enums/task/BpmTaskStatustEnum.java
new file mode 100644
index 000000000..eb4af0f62
--- /dev/null
+++ b/yudao-module-bpm/yudao-module-bpm-api/src/main/java/cn/iocoder/yudao/module/bpm/enums/task/BpmTaskStatustEnum.java
@@ -0,0 +1,61 @@
+package cn.iocoder.yudao.module.bpm.enums.task;
+
+import cn.iocoder.yudao.framework.common.util.object.ObjectUtils;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+/**
+ * 流程任务 Task 的状态枚举
+ *
+ * @author jason
+ */
+@Getter
+@AllArgsConstructor
+public enum BpmTaskStatustEnum {
+
+ RUNNING(1, "审批中"),
+ APPROVE(2, "审批通过"),
+ REJECT(3, "审批不通过"),
+ CANCEL(4, "已取消"),
+
+ RETURN(5, "已退回"),
+ DELEGATE(6, "委派中"),
+
+ /**
+ * 使用场景:
+ * 1. 任务被向后【加签】时,它在审批通过后,会变成 APPROVING 这个状态,然后等到【加签】出来的任务都被审批后,才会变成 APPROVE 审批通过
+ */
+ APPROVING(7, "审批通过中"),
+ /**
+ * 使用场景:
+ * 1. 任务被向前【加签】时,它会变成 WAIT 状态,需要等待【加签】出来的任务被审批后,它才能继续变为 RUNNING 继续审批
+ * 2. 任务被向后【加签】时,【加签】出来的任务处于 WAIT 状态,它们需要等待该任务被审批后,它们才能继续变为 RUNNING 继续审批
+ */
+ WAIT(0, "待审批");
+
+ /**
+ * 状态
+ *
+ * 如果新增时,注意 {@link #isEndStatus(Integer)} 是否需要变更
+ */
+ private final Integer status;
+ /**
+ * 名字
+ */
+ private final String name;
+
+ /**
+ * 判断该状态是否已经处于 End 最终状态
+ *
+ * 主要用于一些状态更新的逻辑,如果已经是最终状态,就不再进行更新
+ *
+ * @param status 状态
+ * @return 是否
+ */
+ public static boolean isEndStatus(Integer status) {
+ return ObjectUtils.equalsAny(status,
+ APPROVE.getStatus(), REJECT.getStatus(), CANCEL.getStatus(),
+ RETURN.getStatus(), APPROVING.getStatus());
+ }
+
+}
diff --git a/yudao-module-bpm/yudao-module-bpm-api/src/main/java/cn/iocoder/yudao/module/bpm/event/BpmProcessInstanceResultEvent.java b/yudao-module-bpm/yudao-module-bpm-api/src/main/java/cn/iocoder/yudao/module/bpm/event/BpmProcessInstanceStatusEvent.java
similarity index 65%
rename from yudao-module-bpm/yudao-module-bpm-api/src/main/java/cn/iocoder/yudao/module/bpm/event/BpmProcessInstanceResultEvent.java
rename to yudao-module-bpm/yudao-module-bpm-api/src/main/java/cn/iocoder/yudao/module/bpm/event/BpmProcessInstanceStatusEvent.java
index 8d0b2de55..474a8657d 100644
--- a/yudao-module-bpm/yudao-module-bpm-api/src/main/java/cn/iocoder/yudao/module/bpm/event/BpmProcessInstanceResultEvent.java
+++ b/yudao-module-bpm/yudao-module-bpm-api/src/main/java/cn/iocoder/yudao/module/bpm/event/BpmProcessInstanceStatusEvent.java
@@ -6,14 +6,13 @@ import org.springframework.context.ApplicationEvent;
import javax.validation.constraints.NotNull;
/**
- * 流程实例的结果发生变化的 Event
- * 定位:由于额外增加了 {@link BpmProcessInstanceExtDO#getResult()} 结果,所以增加该事件
+ * 流程实例的状态(结果)发生变化的 Event
*
* @author 芋道源码
*/
@SuppressWarnings("ALL")
@Data
-public class BpmProcessInstanceResultEvent extends ApplicationEvent {
+public class BpmProcessInstanceStatusEvent extends ApplicationEvent {
/**
* 流程实例的编号
@@ -28,15 +27,15 @@ public class BpmProcessInstanceResultEvent extends ApplicationEvent {
/**
* 流程实例的结果
*/
- @NotNull(message = "流程实例的结果不能为空")
- private Integer result;
+ @NotNull(message = "流程实例的状态不能为空")
+ private Integer status;
/**
* 流程实例对应的业务标识
* 例如说,请假
*/
private String businessKey;
- public BpmProcessInstanceResultEvent(Object source) {
+ public BpmProcessInstanceStatusEvent(Object source) {
super(source);
}
diff --git a/yudao-module-bpm/yudao-module-bpm-api/src/main/java/cn/iocoder/yudao/module/bpm/event/BpmProcessInstanceResultEventListener.java b/yudao-module-bpm/yudao-module-bpm-api/src/main/java/cn/iocoder/yudao/module/bpm/event/BpmProcessInstanceStatusEventListener.java
similarity index 63%
rename from yudao-module-bpm/yudao-module-bpm-api/src/main/java/cn/iocoder/yudao/module/bpm/event/BpmProcessInstanceResultEventListener.java
rename to yudao-module-bpm/yudao-module-bpm-api/src/main/java/cn/iocoder/yudao/module/bpm/event/BpmProcessInstanceStatusEventListener.java
index bff99a8c1..f8b1863c6 100644
--- a/yudao-module-bpm/yudao-module-bpm-api/src/main/java/cn/iocoder/yudao/module/bpm/event/BpmProcessInstanceResultEventListener.java
+++ b/yudao-module-bpm/yudao-module-bpm-api/src/main/java/cn/iocoder/yudao/module/bpm/event/BpmProcessInstanceStatusEventListener.java
@@ -4,15 +4,15 @@ import cn.hutool.core.util.StrUtil;
import org.springframework.context.ApplicationListener;
/**
- * {@link BpmProcessInstanceResultEvent} 的监听器
+ * {@link BpmProcessInstanceStatusEvent} 的监听器
*
* @author 芋道源码
*/
-public abstract class BpmProcessInstanceResultEventListener
- implements ApplicationListener {
+public abstract class BpmProcessInstanceStatusEventListener
+ implements ApplicationListener {
@Override
- public final void onApplicationEvent(BpmProcessInstanceResultEvent event) {
+ public final void onApplicationEvent(BpmProcessInstanceStatusEvent event) {
if (!StrUtil.equals(event.getProcessDefinitionKey(), getProcessDefinitionKey())) {
return;
}
@@ -29,6 +29,6 @@ public abstract class BpmProcessInstanceResultEventListener
*
* @param event 事件
*/
- protected abstract void onEvent(BpmProcessInstanceResultEvent event);
+ protected abstract void onEvent(BpmProcessInstanceStatusEvent event);
}
diff --git a/yudao-module-bpm/yudao-module-bpm-biz/pom.xml b/yudao-module-bpm/yudao-module-bpm-biz/pom.xml
index f1ac4c0ee..1ac423e11 100644
--- a/yudao-module-bpm/yudao-module-bpm-biz/pom.xml
+++ b/yudao-module-bpm/yudao-module-bpm-biz/pom.xml
@@ -64,11 +64,19 @@
yudao-spring-boot-starter-test
-
+
cn.iocoder.boot
- yudao-spring-boot-starter-flowable
- ${revision}
+ yudao-spring-boot-starter-excel
+
+
+
+ org.flowable
+ flowable-spring-boot-starter-process
+
+
+ org.flowable
+ flowable-spring-boot-starter-actuator
diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/candidate/vo/BpmTaskCandidateRuleVO.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/candidate/vo/BpmTaskCandidateRuleVO.java
deleted file mode 100644
index 86ee2d596..000000000
--- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/candidate/vo/BpmTaskCandidateRuleVO.java
+++ /dev/null
@@ -1,27 +0,0 @@
-package cn.iocoder.yudao.module.bpm.controller.admin.candidate.vo;
-
-import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.rule.BpmTaskAssignRuleBaseVO;
-import io.swagger.v3.oas.annotations.media.Schema;
-import lombok.Data;
-
-import javax.validation.constraints.NotNull;
-import java.util.Set;
-
-/**
- * 流程任务分配规则 Base VO,提供给添加、修改、详细的子 VO 使用
- * 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成
- *
- * @see BpmTaskAssignRuleBaseVO
- */
-@Data
-public class BpmTaskCandidateRuleVO {
-
- @Schema(description = "规则类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "bpm_task_assign_rule_type")
- @NotNull(message = "规则类型不能为空")
- private Integer type;
-
- @Schema(description = "规则值数组", requiredMode = Schema.RequiredMode.REQUIRED, example = "1,2,3")
- @NotNull(message = "规则值数组不能为空")
- private Set options;
-
-}
diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/BpmCategoryController.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/BpmCategoryController.java
new file mode 100644
index 000000000..322666615
--- /dev/null
+++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/BpmCategoryController.java
@@ -0,0 +1,86 @@
+package cn.iocoder.yudao.module.bpm.controller.admin.definition;
+
+import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
+import cn.iocoder.yudao.framework.common.pojo.CommonResult;
+import cn.iocoder.yudao.framework.common.pojo.PageResult;
+import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
+import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.category.BpmCategoryPageReqVO;
+import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.category.BpmCategoryRespVO;
+import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.category.BpmCategorySaveReqVO;
+import cn.iocoder.yudao.module.bpm.dal.dataobject.definition.BpmCategoryDO;
+import cn.iocoder.yudao.module.bpm.service.definition.BpmCategoryService;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.Parameter;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import jakarta.annotation.Resource;
+import jakarta.validation.Valid;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.Comparator;
+import java.util.List;
+
+import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
+import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertList;
+
+@Tag(name = "管理后台 - BPM 流程分类")
+@RestController
+@RequestMapping("/bpm/category")
+@Validated
+public class BpmCategoryController {
+
+ @Resource
+ private BpmCategoryService categoryService;
+
+ @PostMapping("/create")
+ @Operation(summary = "创建流程分类")
+ @PreAuthorize("@ss.hasPermission('bpm:category:create')")
+ public CommonResult createCategory(@Valid @RequestBody BpmCategorySaveReqVO createReqVO) {
+ return success(categoryService.createCategory(createReqVO));
+ }
+
+ @PutMapping("/update")
+ @Operation(summary = "更新流程分类")
+ @PreAuthorize("@ss.hasPermission('bpm:category:update')")
+ public CommonResult updateCategory(@Valid @RequestBody BpmCategorySaveReqVO updateReqVO) {
+ categoryService.updateCategory(updateReqVO);
+ return success(true);
+ }
+
+ @DeleteMapping("/delete")
+ @Operation(summary = "删除流程分类")
+ @Parameter(name = "id", description = "编号", required = true)
+ @PreAuthorize("@ss.hasPermission('bpm:category:delete')")
+ public CommonResult deleteCategory(@RequestParam("id") Long id) {
+ categoryService.deleteCategory(id);
+ return success(true);
+ }
+
+ @GetMapping("/get")
+ @Operation(summary = "获得流程分类")
+ @Parameter(name = "id", description = "编号", required = true, example = "1024")
+ @PreAuthorize("@ss.hasPermission('bpm:category:query')")
+ public CommonResult getCategory(@RequestParam("id") Long id) {
+ BpmCategoryDO category = categoryService.getCategory(id);
+ return success(BeanUtils.toBean(category, BpmCategoryRespVO.class));
+ }
+
+ @GetMapping("/page")
+ @Operation(summary = "获得流程分类分页")
+ @PreAuthorize("@ss.hasPermission('bpm:category:query')")
+ public CommonResult> getCategoryPage(@Valid BpmCategoryPageReqVO pageReqVO) {
+ PageResult pageResult = categoryService.getCategoryPage(pageReqVO);
+ return success(BeanUtils.toBean(pageResult, BpmCategoryRespVO.class));
+ }
+
+ @GetMapping("/simple-list")
+ @Operation(summary = "获取流程分类的精简信息列表", description = "只包含被开启的分类,主要用于前端的下拉选项")
+ public CommonResult> getCategorySimpleList() {
+ List list = categoryService.getCategoryListByStatus(CommonStatusEnum.ENABLE.getStatus());
+ list.sort(Comparator.comparingInt(BpmCategoryDO::getSort));
+ return success(convertList(list, category -> new BpmCategoryRespVO().setId(category.getId())
+ .setName(category.getName()).setCode(category.getCode())));
+ }
+
+}
\ No newline at end of file
diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/BpmFormController.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/BpmFormController.java
index e5b6f2ceb..b957a75a7 100644
--- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/BpmFormController.java
+++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/BpmFormController.java
@@ -1,23 +1,26 @@
package cn.iocoder.yudao.module.bpm.controller.admin.definition;
-import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.form.*;
-import cn.iocoder.yudao.module.bpm.convert.definition.BpmFormConvert;
-import cn.iocoder.yudao.module.bpm.dal.dataobject.definition.BpmFormDO;
-import cn.iocoder.yudao.module.bpm.service.definition.BpmFormService;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
-import io.swagger.v3.oas.annotations.tags.Tag;
-import io.swagger.v3.oas.annotations.Parameter;
+import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
+import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.form.BpmFormPageReqVO;
+import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.form.BpmFormRespVO;
+import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.form.BpmFormSaveReqVO;
+import cn.iocoder.yudao.module.bpm.dal.dataobject.definition.BpmFormDO;
+import cn.iocoder.yudao.module.bpm.service.definition.BpmFormService;
import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.Parameter;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import jakarta.annotation.Resource;
+import jakarta.validation.Valid;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
-import javax.annotation.Resource;
-import javax.validation.Valid;
import java.util.List;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
+import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertList;
@Tag(name = "管理后台 - 动态表单")
@RestController
@@ -31,14 +34,14 @@ public class BpmFormController {
@PostMapping("/create")
@Operation(summary = "创建动态表单")
@PreAuthorize("@ss.hasPermission('bpm:form:create')")
- public CommonResult createForm(@Valid @RequestBody BpmFormCreateReqVO createReqVO) {
+ public CommonResult createForm(@Valid @RequestBody BpmFormSaveReqVO createReqVO) {
return success(formService.createForm(createReqVO));
}
@PutMapping("/update")
@Operation(summary = "更新动态表单")
@PreAuthorize("@ss.hasPermission('bpm:form:update')")
- public CommonResult updateForm(@Valid @RequestBody BpmFormUpdateReqVO updateReqVO) {
+ public CommonResult updateForm(@Valid @RequestBody BpmFormSaveReqVO updateReqVO) {
formService.updateForm(updateReqVO);
return success(true);
}
@@ -58,14 +61,15 @@ public class BpmFormController {
@PreAuthorize("@ss.hasPermission('bpm:form:query')")
public CommonResult getForm(@RequestParam("id") Long id) {
BpmFormDO form = formService.getForm(id);
- return success(BpmFormConvert.INSTANCE.convert(form));
+ return success(BeanUtils.toBean(form, BpmFormRespVO.class));
}
- @GetMapping("/list-all-simple")
+ @GetMapping({"/list-all-simple", "/simple-list"})
@Operation(summary = "获得动态表单的精简列表", description = "用于表单下拉框")
- public CommonResult> getSimpleForms() {
+ public CommonResult> getFormSimpleList() {
List list = formService.getFormList();
- return success(BpmFormConvert.INSTANCE.convertList2(list));
+ return success(convertList(list, formDO -> // 只返回 id、name 字段
+ new BpmFormRespVO().setId(formDO.getId()).setName(formDO.getName())));
}
@GetMapping("/page")
@@ -73,7 +77,7 @@ public class BpmFormController {
@PreAuthorize("@ss.hasPermission('bpm:form:query')")
public CommonResult> getFormPage(@Valid BpmFormPageReqVO pageVO) {
PageResult pageResult = formService.getFormPage(pageVO);
- return success(BpmFormConvert.INSTANCE.convertPage(pageResult));
+ return success(BeanUtils.toBean(pageResult, BpmFormRespVO.class));
}
}
diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/BpmModelController.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/BpmModelController.java
index 9915cef7e..dcf91260f 100644
--- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/BpmModelController.java
+++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/BpmModelController.java
@@ -1,23 +1,42 @@
package cn.iocoder.yudao.module.bpm.controller.admin.definition;
+import cn.hutool.core.collection.CollUtil;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
+import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils;
import cn.iocoder.yudao.framework.common.util.io.IoUtils;
+import cn.iocoder.yudao.framework.common.util.json.JsonUtils;
+import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.model.*;
import cn.iocoder.yudao.module.bpm.convert.definition.BpmModelConvert;
+import cn.iocoder.yudao.module.bpm.dal.dataobject.definition.BpmCategoryDO;
+import cn.iocoder.yudao.module.bpm.dal.dataobject.definition.BpmFormDO;
+import cn.iocoder.yudao.module.bpm.service.definition.BpmCategoryService;
+import cn.iocoder.yudao.module.bpm.service.definition.BpmFormService;
import cn.iocoder.yudao.module.bpm.service.definition.BpmModelService;
+import cn.iocoder.yudao.module.bpm.service.definition.BpmProcessDefinitionService;
+import cn.iocoder.yudao.module.bpm.service.definition.dto.BpmModelMetaInfoRespDTO;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
+import jakarta.annotation.Resource;
+import jakarta.validation.Valid;
+import org.flowable.engine.repository.Deployment;
+import org.flowable.engine.repository.Model;
+import org.flowable.engine.repository.ProcessDefinition;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
-import javax.annotation.Resource;
-import javax.validation.Valid;
import java.io.IOException;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
+import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertMap;
+import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertSet;
@Tag(name = "管理后台 - 流程模型")
@RestController
@@ -27,11 +46,39 @@ public class BpmModelController {
@Resource
private BpmModelService modelService;
+ @Resource
+ private BpmFormService formService;
+ @Resource
+ private BpmCategoryService categoryService;
+ @Resource
+ private BpmProcessDefinitionService processDefinitionService;
@GetMapping("/page")
@Operation(summary = "获得模型分页")
- public CommonResult> getModelPage(BpmModelPageReqVO pageVO) {
- return success(modelService.getModelPage(pageVO));
+ public CommonResult> getModelPage(BpmModelPageReqVO pageVO) {
+ PageResult pageResult = modelService.getModelPage(pageVO);
+ if (CollUtil.isEmpty(pageResult.getList())) {
+ return success(PageResult.empty(pageResult.getTotal()));
+ }
+
+ // 拼接数据
+ // 获得 Form 表单
+ Set formIds = convertSet(pageResult.getList(), model -> {
+ BpmModelMetaInfoRespDTO metaInfo = JsonUtils.parseObject(model.getMetaInfo(), BpmModelMetaInfoRespDTO.class);
+ return metaInfo != null ? metaInfo.getFormId() : null;
+ });
+ Map formMap = formService.getFormMap(formIds);
+ // 获得 Category Map
+ Map categoryMap = categoryService.getCategoryMap(
+ convertSet(pageResult.getList(), Model::getCategory));
+ // 获得 Deployment Map
+ Set deploymentIds = new HashSet<>();
+ pageResult.getList().forEach(model -> CollectionUtils.addIfNotNull(deploymentIds, model.getDeploymentId()));
+ Map deploymentMap = processDefinitionService.getDeploymentMap(deploymentIds);
+ // 获得 ProcessDefinition Map
+ List processDefinitions = processDefinitionService.getProcessDefinitionListByDeploymentIds(deploymentIds);
+ Map processDefinitionMap = convertMap(processDefinitions, ProcessDefinition::getDeploymentId);
+ return success(BpmModelConvert.INSTANCE.buildModelPage(pageResult, formMap, categoryMap, deploymentMap, processDefinitionMap));
}
@GetMapping("/get")
@@ -39,8 +86,12 @@ public class BpmModelController {
@Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('bpm:model:query')")
public CommonResult getModel(@RequestParam("id") String id) {
- BpmModelRespVO model = modelService.getModel(id);
- return success(model);
+ Model model = modelService.getModel(id);
+ if (model == null) {
+ return null;
+ }
+ byte[] bpmnBytes = modelService.getModelBpmnXML(id);
+ return success(BpmModelConvert.INSTANCE.buildModel(model, bpmnBytes));
}
@PostMapping("/create")
@@ -62,7 +113,7 @@ public class BpmModelController {
@Operation(summary = "导入模型")
@PreAuthorize("@ss.hasPermission('bpm:model:import')")
public CommonResult importModel(@Valid BpmModeImportReqVO importReqVO) throws IOException {
- BpmModelCreateReqVO createReqVO = BpmModelConvert.INSTANCE.convert(importReqVO);
+ BpmModelCreateReqVO createReqVO = BeanUtils.toBean(importReqVO, BpmModelCreateReqVO.class);
// 读取文件
String bpmnXml = IoUtils.readUtf8(importReqVO.getBpmnFile().getInputStream(), false);
return success(modelService.createModel(createReqVO, bpmnXml));
@@ -93,4 +144,5 @@ public class BpmModelController {
modelService.deleteModel(id);
return success(true);
}
+
}
diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/BpmProcessDefinitionController.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/BpmProcessDefinitionController.java
index e77e0bd6d..149737ca0 100644
--- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/BpmProcessDefinitionController.java
+++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/BpmProcessDefinitionController.java
@@ -1,15 +1,26 @@
package cn.iocoder.yudao.module.bpm.controller.admin.definition;
+import cn.hutool.core.collection.CollUtil;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
-import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.process.BpmProcessDefinitionListReqVO;
-import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.process.BpmProcessDefinitionPageItemRespVO;
import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.process.BpmProcessDefinitionPageReqVO;
import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.process.BpmProcessDefinitionRespVO;
+import cn.iocoder.yudao.module.bpm.convert.definition.BpmProcessDefinitionConvert;
+import cn.iocoder.yudao.module.bpm.dal.dataobject.definition.BpmCategoryDO;
+import cn.iocoder.yudao.module.bpm.dal.dataobject.definition.BpmFormDO;
+import cn.iocoder.yudao.module.bpm.dal.dataobject.definition.BpmProcessDefinitionInfoDO;
+import cn.iocoder.yudao.module.bpm.framework.flowable.core.candidate.strategy.BpmTaskCandidateStartUserSelectStrategy;
+import cn.iocoder.yudao.module.bpm.service.definition.BpmCategoryService;
+import cn.iocoder.yudao.module.bpm.service.definition.BpmFormService;
import cn.iocoder.yudao.module.bpm.service.definition.BpmProcessDefinitionService;
-import io.swagger.v3.oas.annotations.tags.Tag;
-import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.Parameter;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import jakarta.annotation.Resource;
+import org.flowable.bpmn.model.BpmnModel;
+import org.flowable.bpmn.model.UserTask;
+import org.flowable.engine.repository.Deployment;
+import org.flowable.engine.repository.ProcessDefinition;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
@@ -17,11 +28,12 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
-import javax.annotation.Resource;
-
+import java.util.Collections;
import java.util.List;
+import java.util.Map;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
+import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertSet;
@Tag(name = "管理后台 - 流程定义")
@RestController
@@ -30,30 +42,73 @@ import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
public class BpmProcessDefinitionController {
@Resource
- private BpmProcessDefinitionService bpmDefinitionService;
+ private BpmProcessDefinitionService processDefinitionService;
+ @Resource
+ private BpmFormService formService;
+ @Resource
+ private BpmCategoryService categoryService;
@GetMapping("/page")
@Operation(summary = "获得流程定义分页")
@PreAuthorize("@ss.hasPermission('bpm:process-definition:query')")
- public CommonResult> getProcessDefinitionPage(
+ public CommonResult> getProcessDefinitionPage(
BpmProcessDefinitionPageReqVO pageReqVO) {
- return success(bpmDefinitionService.getProcessDefinitionPage(pageReqVO));
+ PageResult pageResult = processDefinitionService.getProcessDefinitionPage(pageReqVO);
+ if (CollUtil.isEmpty(pageResult.getList())) {
+ return success(PageResult.empty(pageResult.getTotal()));
+ }
+
+ // 获得 Category Map
+ Map categoryMap = categoryService.getCategoryMap(
+ convertSet(pageResult.getList(), ProcessDefinition::getCategory));
+ // 获得 Deployment Map
+ Map deploymentMap = processDefinitionService.getDeploymentMap(
+ convertSet(pageResult.getList(), ProcessDefinition::getDeploymentId));
+ // 获得 BpmProcessDefinitionInfoDO Map
+ Map processDefinitionMap = processDefinitionService.getProcessDefinitionInfoMap(
+ convertSet(pageResult.getList(), ProcessDefinition::getId));
+ // 获得 Form Map
+ Map formMap = formService.getFormMap(
+ convertSet(processDefinitionMap.values(), BpmProcessDefinitionInfoDO::getFormId));
+ return success(BpmProcessDefinitionConvert.INSTANCE.buildProcessDefinitionPage(
+ pageResult, deploymentMap, processDefinitionMap, formMap, categoryMap));
}
@GetMapping ("/list")
@Operation(summary = "获得流程定义列表")
+ @Parameter(name = "suspensionState", description = "挂起状态", required = true, example = "1") // 参见 Flowable SuspensionState 枚举
@PreAuthorize("@ss.hasPermission('bpm:process-definition:query')")
public CommonResult> getProcessDefinitionList(
- BpmProcessDefinitionListReqVO listReqVO) {
- return success(bpmDefinitionService.getProcessDefinitionList(listReqVO));
+ @RequestParam("suspensionState") Integer suspensionState) {
+ List list = processDefinitionService.getProcessDefinitionListBySuspensionState(suspensionState);
+ if (CollUtil.isEmpty(list)) {
+ return success(Collections.emptyList());
+ }
+
+ // 获得 BpmProcessDefinitionInfoDO Map
+ Map processDefinitionMap = processDefinitionService.getProcessDefinitionInfoMap(
+ convertSet(list, ProcessDefinition::getId));
+ return success(BpmProcessDefinitionConvert.INSTANCE.buildProcessDefinitionList(
+ list, null, processDefinitionMap, null, null));
}
- @GetMapping ("/get-bpmn-xml")
- @Operation(summary = "获得流程定义的 BPMN XML")
- @Parameter(name = "id", description = "编号", required = true, example = "1024")
+ @GetMapping ("/get")
+ @Operation(summary = "获得流程定义")
+ @Parameter(name = "id", description = "流程编号", required = true, example = "1024")
+ @Parameter(name = "key", description = "流程定义标识", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('bpm:process-definition:query')")
- public CommonResult getProcessDefinitionBpmnXML(@RequestParam("id") String id) {
- String bpmnXML = bpmDefinitionService.getProcessDefinitionBpmnXML(id);
- return success(bpmnXML);
+ public CommonResult getProcessDefinition(
+ @RequestParam(value = "id", required = false) String id,
+ @RequestParam(value = "key", required = false) String key) {
+ ProcessDefinition processDefinition = id != null ? processDefinitionService.getProcessDefinition(id)
+ : processDefinitionService.getActiveProcessDefinition(key);
+ if (processDefinition == null) {
+ return success(null);
+ }
+ BpmnModel bpmnModel = processDefinitionService.getProcessDefinitionBpmnModel(processDefinition.getId());
+ List userTaskList = BpmTaskCandidateStartUserSelectStrategy.getStartUserSelectUserTaskList(bpmnModel);
+ return success(BpmProcessDefinitionConvert.INSTANCE.buildProcessDefinition(
+ processDefinition, null, null, null, null, bpmnModel, userTaskList));
}
+
}
diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/BpmProcessExpressionController.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/BpmProcessExpressionController.java
new file mode 100644
index 000000000..4b119f799
--- /dev/null
+++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/BpmProcessExpressionController.java
@@ -0,0 +1,73 @@
+package cn.iocoder.yudao.module.bpm.controller.admin.definition;
+
+import cn.iocoder.yudao.framework.common.pojo.CommonResult;
+import cn.iocoder.yudao.framework.common.pojo.PageResult;
+import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
+import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.expression.BpmProcessExpressionPageReqVO;
+import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.expression.BpmProcessExpressionRespVO;
+import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.expression.BpmProcessExpressionSaveReqVO;
+import cn.iocoder.yudao.module.bpm.dal.dataobject.definition.BpmProcessExpressionDO;
+import cn.iocoder.yudao.module.bpm.service.definition.BpmProcessExpressionService;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.Parameter;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import jakarta.annotation.Resource;
+import jakarta.validation.Valid;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
+
+@Tag(name = "管理后台 - BPM 流程表达式")
+@RestController
+@RequestMapping("/bpm/process-expression")
+@Validated
+public class BpmProcessExpressionController {
+
+ @Resource
+ private BpmProcessExpressionService processExpressionService;
+
+ @PostMapping("/create")
+ @Operation(summary = "创建流程表达式")
+ @PreAuthorize("@ss.hasPermission('bpm:process-expression:create')")
+ public CommonResult createProcessExpression(@Valid @RequestBody BpmProcessExpressionSaveReqVO createReqVO) {
+ return success(processExpressionService.createProcessExpression(createReqVO));
+ }
+
+ @PutMapping("/update")
+ @Operation(summary = "更新流程表达式")
+ @PreAuthorize("@ss.hasPermission('bpm:process-expression:update')")
+ public CommonResult updateProcessExpression(@Valid @RequestBody BpmProcessExpressionSaveReqVO updateReqVO) {
+ processExpressionService.updateProcessExpression(updateReqVO);
+ return success(true);
+ }
+
+ @DeleteMapping("/delete")
+ @Operation(summary = "删除流程表达式")
+ @Parameter(name = "id", description = "编号", required = true)
+ @PreAuthorize("@ss.hasPermission('bpm:process-expression:delete')")
+ public CommonResult deleteProcessExpression(@RequestParam("id") Long id) {
+ processExpressionService.deleteProcessExpression(id);
+ return success(true);
+ }
+
+ @GetMapping("/get")
+ @Operation(summary = "获得流程表达式")
+ @Parameter(name = "id", description = "编号", required = true, example = "1024")
+ @PreAuthorize("@ss.hasPermission('bpm:process-expression:query')")
+ public CommonResult getProcessExpression(@RequestParam("id") Long id) {
+ BpmProcessExpressionDO processExpression = processExpressionService.getProcessExpression(id);
+ return success(BeanUtils.toBean(processExpression, BpmProcessExpressionRespVO.class));
+ }
+
+ @GetMapping("/page")
+ @Operation(summary = "获得流程表达式分页")
+ @PreAuthorize("@ss.hasPermission('bpm:process-expression:query')")
+ public CommonResult> getProcessExpressionPage(
+ @Valid BpmProcessExpressionPageReqVO pageReqVO) {
+ PageResult pageResult = processExpressionService.getProcessExpressionPage(pageReqVO);
+ return success(BeanUtils.toBean(pageResult, BpmProcessExpressionRespVO.class));
+ }
+
+}
\ No newline at end of file
diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/BpmProcessListenerController.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/BpmProcessListenerController.java
new file mode 100644
index 000000000..843f53dba
--- /dev/null
+++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/BpmProcessListenerController.java
@@ -0,0 +1,73 @@
+package cn.iocoder.yudao.module.bpm.controller.admin.definition;
+
+import cn.iocoder.yudao.framework.common.pojo.CommonResult;
+import cn.iocoder.yudao.framework.common.pojo.PageResult;
+import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
+import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.listener.BpmProcessListenerPageReqVO;
+import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.listener.BpmProcessListenerRespVO;
+import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.listener.BpmProcessListenerSaveReqVO;
+import cn.iocoder.yudao.module.bpm.dal.dataobject.definition.BpmProcessListenerDO;
+import cn.iocoder.yudao.module.bpm.service.definition.BpmProcessListenerService;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.Parameter;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import jakarta.annotation.Resource;
+import jakarta.validation.Valid;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
+
+@Tag(name = "管理后台 - BPM 流程监听器")
+@RestController
+@RequestMapping("/bpm/process-listener")
+@Validated
+public class BpmProcessListenerController {
+
+ @Resource
+ private BpmProcessListenerService processListenerService;
+
+ @PostMapping("/create")
+ @Operation(summary = "创建流程监听器")
+ @PreAuthorize("@ss.hasPermission('bpm:process-listener:create')")
+ public CommonResult createProcessListener(@Valid @RequestBody BpmProcessListenerSaveReqVO createReqVO) {
+ return success(processListenerService.createProcessListener(createReqVO));
+ }
+
+ @PutMapping("/update")
+ @Operation(summary = "更新流程监听器")
+ @PreAuthorize("@ss.hasPermission('bpm:process-listener:update')")
+ public CommonResult updateProcessListener(@Valid @RequestBody BpmProcessListenerSaveReqVO updateReqVO) {
+ processListenerService.updateProcessListener(updateReqVO);
+ return success(true);
+ }
+
+ @DeleteMapping("/delete")
+ @Operation(summary = "删除流程监听器")
+ @Parameter(name = "id", description = "编号", required = true)
+ @PreAuthorize("@ss.hasPermission('bpm:process-listener:delete')")
+ public CommonResult deleteProcessListener(@RequestParam("id") Long id) {
+ processListenerService.deleteProcessListener(id);
+ return success(true);
+ }
+
+ @GetMapping("/get")
+ @Operation(summary = "获得流程监听器")
+ @Parameter(name = "id", description = "编号", required = true, example = "1024")
+ @PreAuthorize("@ss.hasPermission('bpm:process-listener:query')")
+ public CommonResult getProcessListener(@RequestParam("id") Long id) {
+ BpmProcessListenerDO processListener = processListenerService.getProcessListener(id);
+ return success(BeanUtils.toBean(processListener, BpmProcessListenerRespVO.class));
+ }
+
+ @GetMapping("/page")
+ @Operation(summary = "获得流程监听器分页")
+ @PreAuthorize("@ss.hasPermission('bpm:process-listener:query')")
+ public CommonResult> getProcessListenerPage(
+ @Valid BpmProcessListenerPageReqVO pageReqVO) {
+ PageResult pageResult = processListenerService.getProcessListenerPage(pageReqVO);
+ return success(BeanUtils.toBean(pageResult, BpmProcessListenerRespVO.class));
+ }
+
+}
\ No newline at end of file
diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/BpmTaskAssignRuleController.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/BpmTaskAssignRuleController.java
deleted file mode 100644
index d730626a6..000000000
--- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/BpmTaskAssignRuleController.java
+++ /dev/null
@@ -1,58 +0,0 @@
-package cn.iocoder.yudao.module.bpm.controller.admin.definition;
-
-import cn.iocoder.yudao.framework.common.pojo.CommonResult;
-import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.rule.BpmTaskAssignRuleCreateReqVO;
-import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.rule.BpmTaskAssignRuleRespVO;
-import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.rule.BpmTaskAssignRuleUpdateReqVO;
-import cn.iocoder.yudao.module.bpm.service.definition.BpmTaskAssignRuleService;
-import io.swagger.v3.oas.annotations.tags.Tag;
-import io.swagger.v3.oas.annotations.Parameter;
-import io.swagger.v3.oas.annotations.Parameters;
-import io.swagger.v3.oas.annotations.Operation;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.*;
-
-import javax.annotation.Resource;
-import javax.validation.Valid;
-import java.util.List;
-
-import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
-
-@Tag(name = "管理后台 - 任务分配规则")
-@RestController
-@RequestMapping("/bpm/task-assign-rule")
-@Validated
-public class BpmTaskAssignRuleController {
-
- @Resource
- private BpmTaskAssignRuleService taskAssignRuleService;
-
- @GetMapping("/list")
- @Operation(summary = "获得任务分配规则列表")
- @Parameters({
- @Parameter(name = "modelId", description = "模型编号", example = "1024"),
- @Parameter(name = "processDefinitionId", description = "流程定义的编号", example = "2048")
- })
- @PreAuthorize("@ss.hasPermission('bpm:task-assign-rule:query')")
- public CommonResult> getTaskAssignRuleList(
- @RequestParam(value = "modelId", required = false) String modelId,
- @RequestParam(value = "processDefinitionId", required = false) String processDefinitionId) {
- return success(taskAssignRuleService.getTaskAssignRuleList(modelId, processDefinitionId));
- }
-
- @PostMapping("/create")
- @Operation(summary = "创建任务分配规则")
- @PreAuthorize("@ss.hasPermission('bpm:task-assign-rule:create')")
- public CommonResult createTaskAssignRule(@Valid @RequestBody BpmTaskAssignRuleCreateReqVO reqVO) {
- return success(taskAssignRuleService.createTaskAssignRule(reqVO));
- }
-
- @PutMapping("/update")
- @Operation(summary = "更新任务分配规则")
- @PreAuthorize("@ss.hasPermission('bpm:task-assign-rule:update')")
- public CommonResult updateTaskAssignRule(@Valid @RequestBody BpmTaskAssignRuleUpdateReqVO reqVO) {
- taskAssignRuleService.updateTaskAssignRule(reqVO);
- return success(true);
- }
-}
diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/BpmUserGroupController.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/BpmUserGroupController.java
index 5e7a54b85..64b80345c 100644
--- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/BpmUserGroupController.java
+++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/BpmUserGroupController.java
@@ -1,27 +1,27 @@
package cn.iocoder.yudao.module.bpm.controller.admin.definition;
-import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.group.BpmUserGroupCreateReqVO;
-import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.group.BpmUserGroupPageReqVO;
-import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.group.BpmUserGroupRespVO;
-import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.group.BpmUserGroupUpdateReqVO;
-import cn.iocoder.yudao.module.bpm.convert.definition.BpmUserGroupConvert;
-import cn.iocoder.yudao.module.bpm.dal.dataobject.definition.BpmUserGroupDO;
-import cn.iocoder.yudao.module.bpm.service.definition.BpmUserGroupService;
import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
-import io.swagger.v3.oas.annotations.tags.Tag;
-import io.swagger.v3.oas.annotations.Parameter;
+import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
+import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.group.BpmUserGroupPageReqVO;
+import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.group.BpmUserGroupRespVO;
+import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.group.BpmUserGroupSaveReqVO;
+import cn.iocoder.yudao.module.bpm.dal.dataobject.definition.BpmUserGroupDO;
+import cn.iocoder.yudao.module.bpm.service.definition.BpmUserGroupService;
import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.Parameter;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import jakarta.annotation.Resource;
+import jakarta.validation.Valid;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
-import javax.annotation.Resource;
-import javax.validation.Valid;
import java.util.List;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
+import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertList;
@Tag(name = "管理后台 - 用户组")
@RestController
@@ -35,14 +35,14 @@ public class BpmUserGroupController {
@PostMapping("/create")
@Operation(summary = "创建用户组")
@PreAuthorize("@ss.hasPermission('bpm:user-group:create')")
- public CommonResult createUserGroup(@Valid @RequestBody BpmUserGroupCreateReqVO createReqVO) {
+ public CommonResult createUserGroup(@Valid @RequestBody BpmUserGroupSaveReqVO createReqVO) {
return success(userGroupService.createUserGroup(createReqVO));
}
@PutMapping("/update")
@Operation(summary = "更新用户组")
@PreAuthorize("@ss.hasPermission('bpm:user-group:update')")
- public CommonResult updateUserGroup(@Valid @RequestBody BpmUserGroupUpdateReqVO updateReqVO) {
+ public CommonResult updateUserGroup(@Valid @RequestBody BpmUserGroupSaveReqVO updateReqVO) {
userGroupService.updateUserGroup(updateReqVO);
return success(true);
}
@@ -62,7 +62,7 @@ public class BpmUserGroupController {
@PreAuthorize("@ss.hasPermission('bpm:user-group:query')")
public CommonResult getUserGroup(@RequestParam("id") Long id) {
BpmUserGroupDO userGroup = userGroupService.getUserGroup(id);
- return success(BpmUserGroupConvert.INSTANCE.convert(userGroup));
+ return success(BeanUtils.toBean(userGroup, BpmUserGroupRespVO.class));
}
@GetMapping("/page")
@@ -70,16 +70,14 @@ public class BpmUserGroupController {
@PreAuthorize("@ss.hasPermission('bpm:user-group:query')")
public CommonResult> getUserGroupPage(@Valid BpmUserGroupPageReqVO pageVO) {
PageResult pageResult = userGroupService.getUserGroupPage(pageVO);
- return success(BpmUserGroupConvert.INSTANCE.convertPage(pageResult));
+ return success(BeanUtils.toBean(pageResult, BpmUserGroupRespVO.class));
}
- @GetMapping("/list-all-simple")
+ @GetMapping("/simple-list")
@Operation(summary = "获取用户组精简信息列表", description = "只包含被开启的用户组,主要用于前端的下拉选项")
- public CommonResult> getSimpleUserGroups() {
- // 获用户门列表,只要开启状态的
+ public CommonResult> getUserGroupSimpleList() {
List list = userGroupService.getUserGroupListByStatus(CommonStatusEnum.ENABLE.getStatus());
- // 排序后,返回给前端
- return success(BpmUserGroupConvert.INSTANCE.convertList2(list));
+ return success(convertList(list, group -> new BpmUserGroupRespVO().setId(group.getId()).setName(group.getName())));
}
}
diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/category/BpmCategoryPageReqVO.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/category/BpmCategoryPageReqVO.java
new file mode 100644
index 000000000..b76e96c31
--- /dev/null
+++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/category/BpmCategoryPageReqVO.java
@@ -0,0 +1,34 @@
+package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.category;
+
+import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
+import cn.iocoder.yudao.framework.common.pojo.PageParam;
+import cn.iocoder.yudao.framework.common.validation.InEnum;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.ToString;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.time.LocalDateTime;
+
+import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
+
+@Schema(description = "管理后台 - BPM 流程分类分页 Request VO")
+@Data
+public class BpmCategoryPageReqVO extends PageParam {
+
+ @Schema(description = "分类名", example = "王五")
+ private String name;
+
+ @Schema(description = "分类标志", example = "OA")
+ private String code;
+
+ @Schema(description = "分类状态", example = "1")
+ @InEnum(CommonStatusEnum.class)
+ private Integer status;
+
+ @Schema(description = "创建时间")
+ @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
+ private LocalDateTime[] createTime;
+
+}
\ No newline at end of file
diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/category/BpmCategoryRespVO.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/category/BpmCategoryRespVO.java
new file mode 100644
index 000000000..7ada55a1d
--- /dev/null
+++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/category/BpmCategoryRespVO.java
@@ -0,0 +1,33 @@
+package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.category;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+
+import java.time.LocalDateTime;
+
+@Schema(description = "管理后台 - BPM 流程分类 Response VO")
+@Data
+public class BpmCategoryRespVO {
+
+ @Schema(description = "分类编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "3167")
+ private Long id;
+
+ @Schema(description = "分类名", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五")
+ private String name;
+
+ @Schema(description = "分类标志", requiredMode = Schema.RequiredMode.REQUIRED, example = "OA")
+ private String code;
+
+ @Schema(description = "分类描述", requiredMode = Schema.RequiredMode.REQUIRED, example = "你猜")
+ private String description;
+
+ @Schema(description = "分类状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
+ private Integer status;
+
+ @Schema(description = "分类排序", requiredMode = Schema.RequiredMode.REQUIRED)
+ private Integer sort;
+
+ @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
+ private LocalDateTime createTime;
+
+}
\ No newline at end of file
diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/category/BpmCategorySaveReqVO.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/category/BpmCategorySaveReqVO.java
new file mode 100644
index 000000000..d1a175ec5
--- /dev/null
+++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/category/BpmCategorySaveReqVO.java
@@ -0,0 +1,37 @@
+package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.category;
+
+import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
+import cn.iocoder.yudao.framework.common.validation.InEnum;
+import io.swagger.v3.oas.annotations.media.Schema;
+import jakarta.validation.constraints.NotEmpty;
+import jakarta.validation.constraints.NotNull;
+import lombok.Data;
+
+@Schema(description = "管理后台 - BPM 流程分类新增/修改 Request VO")
+@Data
+public class BpmCategorySaveReqVO {
+
+ @Schema(description = "分类编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "3167")
+ private Long id;
+
+ @Schema(description = "分类名", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五")
+ @NotEmpty(message = "分类名不能为空")
+ private String name;
+
+ @Schema(description = "分类描述", example = "你猜")
+ private String description;
+
+ @Schema(description = "分类标志", requiredMode = Schema.RequiredMode.REQUIRED, example = "OA")
+ @NotEmpty(message = "分类标志不能为空")
+ private String code;
+
+ @Schema(description = "分类状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
+ @NotNull(message = "分类状态不能为空")
+ @InEnum(CommonStatusEnum.class)
+ private Integer status;
+
+ @Schema(description = "分类排序", requiredMode = Schema.RequiredMode.REQUIRED)
+ @NotNull(message = "分类排序不能为空")
+ private Integer sort;
+
+}
\ No newline at end of file
diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/expression/BpmProcessExpressionPageReqVO.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/expression/BpmProcessExpressionPageReqVO.java
new file mode 100644
index 000000000..37b02f0d9
--- /dev/null
+++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/expression/BpmProcessExpressionPageReqVO.java
@@ -0,0 +1,33 @@
+package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.expression;
+
+import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
+import cn.iocoder.yudao.framework.common.pojo.PageParam;
+import cn.iocoder.yudao.framework.common.validation.InEnum;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.ToString;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.time.LocalDateTime;
+
+import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
+
+@Schema(description = "管理后台 - BPM 流程表达式分页 Request VO")
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ToString(callSuper = true)
+public class BpmProcessExpressionPageReqVO extends PageParam {
+
+ @Schema(description = "表达式名字", example = "李四")
+ private String name;
+
+ @Schema(description = "表达式状态", example = "1")
+ @InEnum(CommonStatusEnum.class)
+ private Integer status;
+
+ @Schema(description = "创建时间")
+ @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
+ private LocalDateTime[] createTime;
+
+}
\ No newline at end of file
diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/expression/BpmProcessExpressionRespVO.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/expression/BpmProcessExpressionRespVO.java
new file mode 100644
index 000000000..d877f60a8
--- /dev/null
+++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/expression/BpmProcessExpressionRespVO.java
@@ -0,0 +1,30 @@
+package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.expression;
+
+import com.alibaba.excel.annotation.ExcelProperty;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+
+import java.time.LocalDateTime;
+
+@Schema(description = "管理后台 - BPM 流程表达式 Response VO")
+@Data
+public class BpmProcessExpressionRespVO {
+
+ @Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "3870")
+ @ExcelProperty("编号")
+ private Long id;
+
+ @Schema(description = "表达式名字", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四")
+ @ExcelProperty("表达式名字")
+ private String name;
+
+ @Schema(description = "表达式状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
+ private Integer status;
+
+ @Schema(description = "表达式", requiredMode = Schema.RequiredMode.REQUIRED)
+ private String expression;
+
+ @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
+ private LocalDateTime createTime;
+
+}
\ No newline at end of file
diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/expression/BpmProcessExpressionSaveReqVO.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/expression/BpmProcessExpressionSaveReqVO.java
new file mode 100644
index 000000000..9c7301a7d
--- /dev/null
+++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/expression/BpmProcessExpressionSaveReqVO.java
@@ -0,0 +1,27 @@
+package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.expression;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import jakarta.validation.constraints.NotEmpty;
+import jakarta.validation.constraints.NotNull;
+import lombok.Data;
+
+@Schema(description = "管理后台 - BPM 流程表达式新增/修改 Request VO")
+@Data
+public class BpmProcessExpressionSaveReqVO {
+
+ @Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "3870")
+ private Long id;
+
+ @Schema(description = "表达式名字", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四")
+ @NotEmpty(message = "表达式名字不能为空")
+ private String name;
+
+ @Schema(description = "表达式状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
+ @NotNull(message = "表达式状态不能为空")
+ private Integer status;
+
+ @Schema(description = "表达式", requiredMode = Schema.RequiredMode.REQUIRED)
+ @NotEmpty(message = "表达式不能为空")
+ private String expression;
+
+}
\ No newline at end of file
diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/form/BpmFormBaseVO.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/form/BpmFormBaseVO.java
deleted file mode 100644
index 50dfd40d8..000000000
--- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/form/BpmFormBaseVO.java
+++ /dev/null
@@ -1,24 +0,0 @@
-package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.form;
-import io.swagger.v3.oas.annotations.media.Schema;
-import lombok.*;
-import javax.validation.constraints.*;
-
-/**
-* 动态表单 Base VO,提供给添加、修改、详细的子 VO 使用
-* 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成
-*/
-@Data
-public class BpmFormBaseVO {
-
- @Schema(description = "表单名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋道")
- @NotNull(message = "表单名称不能为空")
- private String name;
-
- @Schema(description = "表单状态-参见 CommonStatusEnum 枚举", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
- @NotNull(message = "表单状态不能为空")
- private Integer status;
-
- @Schema(description = "备注", example = "我是备注")
- private String remark;
-
-}
diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/form/BpmFormCreateReqVO.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/form/BpmFormCreateReqVO.java
deleted file mode 100644
index d2f743c5b..000000000
--- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/form/BpmFormCreateReqVO.java
+++ /dev/null
@@ -1,22 +0,0 @@
-package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.form;
-import io.swagger.v3.oas.annotations.media.Schema;
-import lombok.*;
-
-import javax.validation.constraints.NotNull;
-import java.util.List;
-
-@Schema(description = "管理后台 - 动态表单创建 Request VO")
-@Data
-@EqualsAndHashCode(callSuper = true)
-@ToString(callSuper = true)
-public class BpmFormCreateReqVO extends BpmFormBaseVO {
-
- @Schema(description = "表单的配置-JSON 字符串", requiredMode = Schema.RequiredMode.REQUIRED)
- @NotNull(message = "表单的配置不能为空")
- private String conf;
-
- @Schema(description = "表单项的数组-JSON 字符串的数组", requiredMode = Schema.RequiredMode.REQUIRED)
- @NotNull(message = "表单项的数组不能为空")
- private List fields;
-
-}
diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/form/BpmFormPageReqVO.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/form/BpmFormPageReqVO.java
index 0227e0ad9..1657f0204 100644
--- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/form/BpmFormPageReqVO.java
+++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/form/BpmFormPageReqVO.java
@@ -8,8 +8,6 @@ import lombok.ToString;
@Schema(description = "管理后台 - 动态表单分页 Request VO")
@Data
-@EqualsAndHashCode(callSuper = true)
-@ToString(callSuper = true)
public class BpmFormPageReqVO extends PageParam {
@Schema(description = "表单名称", example = "芋道")
diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/form/BpmFormRespVO.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/form/BpmFormRespVO.java
index 102f64cf4..1c4eb762c 100644
--- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/form/BpmFormRespVO.java
+++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/form/BpmFormRespVO.java
@@ -1,22 +1,23 @@
package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.form;
-import io.swagger.v3.oas.annotations.media.Schema;
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-import lombok.ToString;
-import javax.validation.constraints.NotNull;
+import io.swagger.v3.oas.annotations.media.Schema;
+import jakarta.validation.constraints.NotNull;
+import lombok.Data;
+
import java.time.LocalDateTime;
import java.util.List;
@Schema(description = "管理后台 - 动态表单 Response VO")
@Data
-@EqualsAndHashCode(callSuper = true)
-@ToString(callSuper = true)
-public class BpmFormRespVO extends BpmFormBaseVO {
+public class BpmFormRespVO {
@Schema(description = "表单编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
private Long id;
+ @Schema(description = "表单名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋道")
+ @NotNull(message = "表单名称不能为空")
+ private String name;
+
@Schema(description = "表单的配置-JSON 字符串", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "表单的配置不能为空")
private String conf;
@@ -25,6 +26,13 @@ public class BpmFormRespVO extends BpmFormBaseVO {
@NotNull(message = "表单项的数组不能为空")
private List fields;
+ @Schema(description = "表单状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
+ @NotNull(message = "表单状态不能为空")
+ private Integer status; // 参见 CommonStatusEnum 枚举
+
+ @Schema(description = "备注", example = "我是备注")
+ private String remark;
+
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
private LocalDateTime createTime;
diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/form/BpmFormSaveReqVO.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/form/BpmFormSaveReqVO.java
new file mode 100644
index 000000000..4da13aaf8
--- /dev/null
+++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/form/BpmFormSaveReqVO.java
@@ -0,0 +1,34 @@
+package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.form;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.*;
+
+import jakarta.validation.constraints.NotNull;
+import java.util.List;
+
+@Schema(description = "管理后台 - 动态表单创建/更新 Request VO")
+@Data
+public class BpmFormSaveReqVO {
+
+ @Schema(description = "表单编号", example = "1024")
+ private Long id;
+
+ @Schema(description = "表单名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋道")
+ @NotNull(message = "表单名称不能为空")
+ private String name;
+
+ @Schema(description = "表单的配置-JSON 字符串", requiredMode = Schema.RequiredMode.REQUIRED)
+ @NotNull(message = "表单的配置不能为空")
+ private String conf;
+
+ @Schema(description = "表单项的数组-JSON 字符串的数组", requiredMode = Schema.RequiredMode.REQUIRED)
+ @NotNull(message = "表单项的数组不能为空")
+ private List fields;
+
+ @Schema(description = "表单状态-参见 CommonStatusEnum 枚举", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
+ @NotNull(message = "表单状态不能为空")
+ private Integer status;
+
+ @Schema(description = "备注", example = "我是备注")
+ private String remark;
+
+}
diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/form/BpmFormSimpleRespVO.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/form/BpmFormSimpleRespVO.java
deleted file mode 100644
index 71d8a1f80..000000000
--- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/form/BpmFormSimpleRespVO.java
+++ /dev/null
@@ -1,16 +0,0 @@
-package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.form;
-
-import io.swagger.v3.oas.annotations.media.Schema;
-import lombok.Data;
-
-@Schema(description = "管理后台 - 流程表单精简 Response VO")
-@Data
-public class BpmFormSimpleRespVO {
-
- @Schema(description = "表单编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
- private Long id;
-
- @Schema(description = "表单名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋道")
- private String name;
-
-}
diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/form/BpmFormUpdateReqVO.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/form/BpmFormUpdateReqVO.java
deleted file mode 100644
index 1ff105df3..000000000
--- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/form/BpmFormUpdateReqVO.java
+++ /dev/null
@@ -1,25 +0,0 @@
-package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.form;
-import io.swagger.v3.oas.annotations.media.Schema;
-import lombok.*;
-import javax.validation.constraints.*;
-import java.util.List;
-
-@Schema(description = "管理后台 - 动态表单更新 Request VO")
-@Data
-@EqualsAndHashCode(callSuper = true)
-@ToString(callSuper = true)
-public class BpmFormUpdateReqVO extends BpmFormBaseVO {
-
- @Schema(description = "表单编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
- @NotNull(message = "表单编号不能为空")
- private Long id;
-
- @Schema(description = "表单的配置-JSON 字符串", requiredMode = Schema.RequiredMode.REQUIRED)
- @NotNull(message = "表单的配置不能为空")
- private String conf;
-
- @Schema(description = "表单项的数组-JSON 字符串的数组", requiredMode = Schema.RequiredMode.REQUIRED)
- @NotNull(message = "表单项的数组不能为空")
- private List fields;
-
-}
diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/group/BpmUserGroupCreateReqVO.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/group/BpmUserGroupCreateReqVO.java
deleted file mode 100644
index 416c4793a..000000000
--- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/group/BpmUserGroupCreateReqVO.java
+++ /dev/null
@@ -1,11 +0,0 @@
-package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.group;
-import io.swagger.v3.oas.annotations.media.Schema;
-import lombok.*;
-
-@Schema(description = "管理后台 - 用户组创建 Request VO")
-@Data
-@EqualsAndHashCode(callSuper = true)
-@ToString(callSuper = true)
-public class BpmUserGroupCreateReqVO extends BpmUserGroupBaseVO {
-
-}
diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/group/BpmUserGroupPageReqVO.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/group/BpmUserGroupPageReqVO.java
index 05f17788a..234ff2849 100644
--- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/group/BpmUserGroupPageReqVO.java
+++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/group/BpmUserGroupPageReqVO.java
@@ -12,10 +12,11 @@ import java.time.LocalDateTime;
@Schema(description = "管理后台 - 用户组分页 Request VO")
@Data
-@EqualsAndHashCode(callSuper = true)
-@ToString(callSuper = true)
public class BpmUserGroupPageReqVO extends PageParam {
+ @Schema(description = "编号", example = "1024")
+ private Long id;
+
@Schema(description = "组名", example = "芋道")
private String name;
diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/group/BpmUserGroupRespVO.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/group/BpmUserGroupRespVO.java
index 0f89e9538..f20722a8d 100644
--- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/group/BpmUserGroupRespVO.java
+++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/group/BpmUserGroupRespVO.java
@@ -1,19 +1,30 @@
package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.group;
import io.swagger.v3.oas.annotations.media.Schema;
-import lombok.*;
+import lombok.Data;
import java.time.LocalDateTime;
+import java.util.Set;
@Schema(description = "管理后台 - 用户组 Response VO")
@Data
-@EqualsAndHashCode(callSuper = true)
-@ToString(callSuper = true)
-public class BpmUserGroupRespVO extends BpmUserGroupBaseVO {
+public class BpmUserGroupRespVO {
@Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
private Long id;
+ @Schema(description = "组名", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋道")
+ private String name;
+
+ @Schema(description = "描述", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋道源码")
+ private String description;
+
+ @Schema(description = "成员编号数组", requiredMode = Schema.RequiredMode.REQUIRED, example = "1,2,3")
+ private Set userIds;
+
+ @Schema(description = "状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
+ private Integer status;
+
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
private LocalDateTime createTime;
diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/group/BpmUserGroupBaseVO.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/group/BpmUserGroupSaveReqVO.java
similarity index 60%
rename from yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/group/BpmUserGroupBaseVO.java
rename to yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/group/BpmUserGroupSaveReqVO.java
index 8e3e9be08..1993cdba0 100644
--- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/group/BpmUserGroupBaseVO.java
+++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/group/BpmUserGroupSaveReqVO.java
@@ -1,29 +1,27 @@
package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.group;
-
import io.swagger.v3.oas.annotations.media.Schema;
-import lombok.Data;
+import jakarta.validation.constraints.NotNull;
+import lombok.*;
-import javax.validation.constraints.NotNull;
import java.util.Set;
-/**
-* 用户组 Base VO,提供给添加、修改、详细的子 VO 使用
-* 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成
-*/
+@Schema(description = "管理后台 - 用户组创建/修改 Request VO")
@Data
-public class BpmUserGroupBaseVO {
+public class BpmUserGroupSaveReqVO {
+
+ @Schema(description = "编号", example = "1024")
+ private Long id;
@Schema(description = "组名", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋道")
@NotNull(message = "组名不能为空")
private String name;
- @Schema(description = "描述", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋道源码")
- @NotNull(message = "描述不能为空")
+ @Schema(description = "描述", example = "芋道源码")
private String description;
@Schema(description = "成员编号数组", requiredMode = Schema.RequiredMode.REQUIRED, example = "1,2,3")
@NotNull(message = "成员编号数组不能为空")
- private Set memberUserIds;
+ private Set userIds;
@Schema(description = "状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
@NotNull(message = "状态不能为空")
diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/group/BpmUserGroupSimpleRespVO.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/group/BpmUserGroupSimpleRespVO.java
deleted file mode 100644
index e5e2060bb..000000000
--- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/group/BpmUserGroupSimpleRespVO.java
+++ /dev/null
@@ -1,20 +0,0 @@
-package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.group;
-
-import io.swagger.v3.oas.annotations.media.Schema;
-import lombok.AllArgsConstructor;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-
-@Schema(description = "管理后台 - 用户组精简信息 Response VO")
-@Data
-@NoArgsConstructor
-@AllArgsConstructor
-public class BpmUserGroupSimpleRespVO {
-
- @Schema(description = "用户组编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
- private Long id;
-
- @Schema(description = "用户组名字", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋道")
- private String name;
-
-}
diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/group/BpmUserGroupUpdateReqVO.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/group/BpmUserGroupUpdateReqVO.java
deleted file mode 100644
index 0b2a9f11b..000000000
--- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/group/BpmUserGroupUpdateReqVO.java
+++ /dev/null
@@ -1,17 +0,0 @@
-package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.group;
-
-import io.swagger.v3.oas.annotations.media.Schema;
-import lombok.*;
-import javax.validation.constraints.*;
-
-@Schema(description = "管理后台 - 用户组更新 Request VO")
-@Data
-@EqualsAndHashCode(callSuper = true)
-@ToString(callSuper = true)
-public class BpmUserGroupUpdateReqVO extends BpmUserGroupBaseVO {
-
- @Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
- @NotNull(message = "编号不能为空")
- private Long id;
-
-}
diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/listener/BpmProcessListenerPageReqVO.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/listener/BpmProcessListenerPageReqVO.java
new file mode 100644
index 000000000..d3b974672
--- /dev/null
+++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/listener/BpmProcessListenerPageReqVO.java
@@ -0,0 +1,30 @@
+package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.listener;
+
+import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
+import cn.iocoder.yudao.framework.common.pojo.PageParam;
+import cn.iocoder.yudao.framework.common.validation.InEnum;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.ToString;
+
+@Schema(description = "管理后台 - BPM 流程监听器分页 Request VO")
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ToString(callSuper = true)
+public class BpmProcessListenerPageReqVO extends PageParam {
+
+ @Schema(description = "监听器名字", example = "赵六")
+ private String name;
+
+ @Schema(description = "监听器类型", example = "execution")
+ private String type;
+
+ @Schema(description = "监听事件", example = "start")
+ private String event;
+
+ @Schema(description = "状态", example = "1")
+ @InEnum(CommonStatusEnum.class)
+ private Integer status;
+
+}
\ No newline at end of file
diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/listener/BpmProcessListenerRespVO.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/listener/BpmProcessListenerRespVO.java
new file mode 100644
index 000000000..f7a484254
--- /dev/null
+++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/listener/BpmProcessListenerRespVO.java
@@ -0,0 +1,36 @@
+package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.listener;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+
+import java.time.LocalDateTime;
+
+@Schema(description = "管理后台 - BPM 流程监听器 Response VO")
+@Data
+public class BpmProcessListenerRespVO {
+
+ @Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "13089")
+ private Long id;
+
+ @Schema(description = "监听器名字", requiredMode = Schema.RequiredMode.REQUIRED, example = "赵六")
+ private String name;
+
+ @Schema(description = "监听器类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "execution")
+ private String type;
+
+ @Schema(description = "监听器状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
+ private Integer status;
+
+ @Schema(description = "监听事件", requiredMode = Schema.RequiredMode.REQUIRED, example = "start")
+ private String event;
+
+ @Schema(description = "监听器值类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "class")
+ private String valueType;
+
+ @Schema(description = "监听器值", requiredMode = Schema.RequiredMode.REQUIRED)
+ private String value;
+
+ @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
+ private LocalDateTime createTime;
+
+}
\ No newline at end of file
diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/listener/BpmProcessListenerSaveReqVO.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/listener/BpmProcessListenerSaveReqVO.java
new file mode 100644
index 000000000..f69d0dfe1
--- /dev/null
+++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/listener/BpmProcessListenerSaveReqVO.java
@@ -0,0 +1,39 @@
+package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.listener;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import jakarta.validation.constraints.NotEmpty;
+import jakarta.validation.constraints.NotNull;
+import lombok.Data;
+
+@Schema(description = "管理后台 - BPM 流程监听器新增/修改 Request VO")
+@Data
+public class BpmProcessListenerSaveReqVO {
+
+ @Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "13089")
+ private Long id;
+
+ @Schema(description = "监听器名字", requiredMode = Schema.RequiredMode.REQUIRED, example = "赵六")
+ @NotEmpty(message = "监听器名字不能为空")
+ private String name;
+
+ @Schema(description = "监听器类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "execution")
+ @NotEmpty(message = "监听器类型不能为空")
+ private String type;
+
+ @Schema(description = "监听器状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
+ @NotNull(message = "监听器状态不能为空")
+ private Integer status;
+
+ @Schema(description = "监听事件", requiredMode = Schema.RequiredMode.REQUIRED, example = "start")
+ @NotEmpty(message = "监听事件不能为空")
+ private String event;
+
+ @Schema(description = "监听器值类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "class")
+ @NotEmpty(message = "监听器值类型不能为空")
+ private String valueType;
+
+ @Schema(description = "监听器值", requiredMode = Schema.RequiredMode.REQUIRED)
+ @NotEmpty(message = "监听器值不能为空")
+ private String value;
+
+}
\ No newline at end of file
diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/model/BpmModeImportReqVO.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/model/BpmModeImportReqVO.java
index 7f5858e79..0b549ca9a 100644
--- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/model/BpmModeImportReqVO.java
+++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/model/BpmModeImportReqVO.java
@@ -10,8 +10,6 @@ import javax.validation.constraints.NotNull;
@Schema(description = "管理后台 - 流程模型的导入 Request VO 相比流程模型的新建来说,只是多了一个 bpmnFile 文件")
@Data
-@EqualsAndHashCode(callSuper = true)
-@ToString(callSuper = true)
public class BpmModeImportReqVO extends BpmModelCreateReqVO {
@Schema(description = "BPMN 文件", requiredMode = Schema.RequiredMode.REQUIRED)
diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/model/BpmModelBaseVO.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/model/BpmModelBaseVO.java
deleted file mode 100644
index 5ae2d3950..000000000
--- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/model/BpmModelBaseVO.java
+++ /dev/null
@@ -1,40 +0,0 @@
-package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.model;
-import io.swagger.v3.oas.annotations.media.Schema;
-import lombok.Data;
-
-import javax.validation.constraints.NotEmpty;
-
-/**
-* 流程模型 Base VO,提供给添加、修改、详细的子 VO 使用
-* 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成
-*/
-@Data
-public class BpmModelBaseVO {
-
- @Schema(description = "流程标识", requiredMode = Schema.RequiredMode.REQUIRED, example = "process_yudao")
- @NotEmpty(message = "流程标识不能为空")
- private String key;
-
- @Schema(description = "流程名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋道")
- @NotEmpty(message = "流程名称不能为空")
- private String name;
-
- @Schema(description = "流程描述", example = "我是描述")
- private String description;
-
- @Schema(description = "流程分类-参见 bpm_model_category 数据字典", example = "1")
- @NotEmpty(message = "流程分类不能为空")
- private String category;
-
- @Schema(description = "表单类型-参见 bpm_model_form_type 数据字典", example = "1")
- private Integer formType;
- @Schema(description = "表单编号-在表单类型为 {@link BpmModelFormTypeEnum#CUSTOM} 时,必须非空", example = "1024")
- private Long formId;
- @Schema(description = "自定义表单的提交路径,使用 Vue 的路由地址-在表单类型为 {@link BpmModelFormTypeEnum#CUSTOM} 时,必须非空",
- example = "/bpm/oa/leave/create")
- private String formCustomCreatePath;
- @Schema(description = "自定义表单的查看路径,使用 Vue 的路由地址-在表单类型为 {@link BpmModelFormTypeEnum#CUSTOM} 时,必须非空",
- example = "/bpm/oa/leave/view")
- private String formCustomViewPath;
-
-}
diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/model/BpmModelPageItemRespVO.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/model/BpmModelPageItemRespVO.java
deleted file mode 100644
index 4fc5b61d4..000000000
--- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/model/BpmModelPageItemRespVO.java
+++ /dev/null
@@ -1,48 +0,0 @@
-package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.model;
-
-import io.swagger.v3.oas.annotations.media.Schema;
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-import lombok.ToString;
-
-import java.time.LocalDateTime;
-
-@Schema(description = "管理后台 - 流程模型的分页的每一项 Response VO")
-@Data
-@EqualsAndHashCode(callSuper = true)
-@ToString(callSuper = true)
-public class BpmModelPageItemRespVO extends BpmModelBaseVO {
-
- @Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
- private String id;
-
- @Schema(description = "表单名字", example = "请假表单")
- private String formName;
-
- @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
- private LocalDateTime createTime;
-
- /**
- * 最新部署的流程定义
- */
- private ProcessDefinition processDefinition;
-
- @Schema(description = "流程定义")
- @Data
- public static class ProcessDefinition {
-
- @Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
- private String id;
-
- @Schema(description = "版本", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
- private Integer version;
-
- @Schema(description = "部署时间", requiredMode = Schema.RequiredMode.REQUIRED)
- private LocalDateTime deploymentTime;
-
- @Schema(description = "中断状态-参见 SuspensionState 枚举", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
- private Integer suspensionState;
-
- }
-
-}
diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/model/BpmModelPageReqVO.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/model/BpmModelPageReqVO.java
index 15283208e..ec14b1aa8 100644
--- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/model/BpmModelPageReqVO.java
+++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/model/BpmModelPageReqVO.java
@@ -9,17 +9,15 @@ import lombok.ToString;
@Schema(description = "管理后台 - 流程模型分页 Request VO")
@Data
-@EqualsAndHashCode(callSuper = true)
-@ToString(callSuper = true)
public class BpmModelPageReqVO extends PageParam {
- @Schema(description = "标识-精准匹配", example = "process1641042089407")
+ @Schema(description = "标识,精准匹配", example = "process1641042089407")
private String key;
- @Schema(description = "名字-模糊匹配", example = "芋道")
+ @Schema(description = "名字,模糊匹配", example = "芋道")
private String name;
- @Schema(description = "流程分类-参见 bpm_model_category 数据字典", example = "1")
+ @Schema(description = "流程分类", example = "1")
private String category;
}
diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/model/BpmModelRespVO.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/model/BpmModelRespVO.java
index df4abf750..aad2015c7 100644
--- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/model/BpmModelRespVO.java
+++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/model/BpmModelRespVO.java
@@ -1,25 +1,57 @@
package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.model;
+import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.process.BpmProcessDefinitionRespVO;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
-import lombok.EqualsAndHashCode;
-import lombok.ToString;
import java.time.LocalDateTime;
-@Schema(description = "管理后台 - 流程模型的创建 Request VO")
+@Schema(description = "管理后台 - 流程模型 Response VO")
@Data
-@EqualsAndHashCode(callSuper = true)
-@ToString(callSuper = true)
-public class BpmModelRespVO extends BpmModelBaseVO {
+public class BpmModelRespVO {
@Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
private String id;
- @Schema(description = "BPMN XML", requiredMode = Schema.RequiredMode.REQUIRED)
- private String bpmnXml;
+ @Schema(description = "流程标识", requiredMode = Schema.RequiredMode.REQUIRED, example = "process_yudao")
+ private String key;
+
+ @Schema(description = "流程名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋道")
+ private String name;
+
+ @Schema(description = "流程图标", example = "https://www.iocoder.cn/yudao.jpg")
+ private String icon;
+
+ @Schema(description = "流程描述", example = "我是描述")
+ private String description;
+
+ @Schema(description = "流程分类编码", example = "1")
+ private String category;
+ @Schema(description = "流程分类名字", example = "请假")
+ private String categoryName;
+
+ @Schema(description = "表单类型-参见 bpm_model_form_type 数据字典", example = "1")
+ private Integer formType;
+
+ @Schema(description = "表单编号", example = "1024")
+ private Long formId; // 在表单类型为 {@link BpmModelFormTypeEnum#CUSTOM} 时,必须非空
+ @Schema(description = "表单名字", example = "请假表单")
+ private String formName;
+
+ @Schema(description = "自定义表单的提交路径", example = "/bpm/oa/leave/create")
+ private String formCustomCreatePath; // 使用 Vue 的路由地址-在表单类型为 {@link BpmModelFormTypeEnum#CUSTOM} 时,必须非空
+ @Schema(description = "自定义表单的查看路径", example = "/bpm/oa/leave/view")
+ private String formCustomViewPath; // ,使用 Vue 的路由地址-在表单类型为 {@link BpmModelFormTypeEnum#CUSTOM} 时,必须非空
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
private LocalDateTime createTime;
+ @Schema(description = "BPMN XML", requiredMode = Schema.RequiredMode.REQUIRED)
+ private String bpmnXml;
+
+ /**
+ * 最新部署的流程定义
+ */
+ private BpmProcessDefinitionRespVO processDefinition;
+
}
diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/model/BpmModelUpdateReqVO.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/model/BpmModelUpdateReqVO.java
index ac8bedd2d..94585af3d 100644
--- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/model/BpmModelUpdateReqVO.java
+++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/model/BpmModelUpdateReqVO.java
@@ -1,9 +1,11 @@
package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.model;
+import cn.iocoder.yudao.framework.common.validation.InEnum;
+import cn.iocoder.yudao.module.bpm.enums.definition.BpmModelFormTypeEnum;
import io.swagger.v3.oas.annotations.media.Schema;
+import jakarta.validation.constraints.NotEmpty;
import lombok.Data;
-
-import javax.validation.constraints.NotEmpty;
+import org.hibernate.validator.constraints.URL;
@Schema(description = "管理后台 - 流程模型的更新 Request VO")
@Data
@@ -16,16 +18,21 @@ public class BpmModelUpdateReqVO {
@Schema(description = "流程名称", example = "芋道")
private String name;
+ @Schema(description = "流程图标", example = "https://www.iocoder.cn/yudao.jpg")
+ @URL(message = "流程图标格式不正确")
+ private String icon;
+
@Schema(description = "流程描述", example = "我是描述")
private String description;
- @Schema(description = "流程分类-参见 bpm_model_category 数据字典", example = "1")
+ @Schema(description = "流程分类", example = "1")
private String category;
@Schema(description = "BPMN XML", requiredMode = Schema.RequiredMode.REQUIRED)
private String bpmnXml;
@Schema(description = "表单类型-参见 bpm_model_form_type 数据字典", example = "1")
+ @InEnum(BpmModelFormTypeEnum.class)
private Integer formType;
@Schema(description = "表单编号-在表单类型为 {@link BpmModelFormTypeEnum#CUSTOM} 时,必须非空", example = "1024")
private Long formId;
diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/model/BpmModelUpdateStateReqVO.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/model/BpmModelUpdateStateReqVO.java
index ac8602787..6ef20c3c7 100644
--- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/model/BpmModelUpdateStateReqVO.java
+++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/model/BpmModelUpdateStateReqVO.java
@@ -13,8 +13,8 @@ public class BpmModelUpdateStateReqVO {
@NotNull(message = "编号不能为空")
private String id;
- @Schema(description = "状态-见 SuspensionState 枚举", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
+ @Schema(description = "状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
@NotNull(message = "状态不能为空")
- private Integer state;
+ private Integer state; // 参见 Flowable SuspensionState 枚举
}
diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/process/BpmProcessDefinitionListReqVO.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/process/BpmProcessDefinitionListReqVO.java
deleted file mode 100644
index 35243d2ac..000000000
--- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/process/BpmProcessDefinitionListReqVO.java
+++ /dev/null
@@ -1,18 +0,0 @@
-package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.process;
-
-import cn.iocoder.yudao.framework.common.pojo.PageParam;
-import io.swagger.v3.oas.annotations.media.Schema;
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-import lombok.ToString;
-
-@Schema(description = "管理后台 - 流程定义列表 Request VO")
-@Data
-@ToString(callSuper = true)
-@EqualsAndHashCode(callSuper = true)
-public class BpmProcessDefinitionListReqVO extends PageParam {
-
- @Schema(description = "中断状态-参见 SuspensionState 枚举", example = "1")
- private Integer suspensionState;
-
-}
diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/process/BpmProcessDefinitionPageItemRespVO.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/process/BpmProcessDefinitionPageItemRespVO.java
deleted file mode 100644
index 901c8aa77..000000000
--- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/process/BpmProcessDefinitionPageItemRespVO.java
+++ /dev/null
@@ -1,22 +0,0 @@
-package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.process;
-
-import io.swagger.v3.oas.annotations.media.Schema;
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-import lombok.ToString;
-
-import java.time.LocalDateTime;
-
-@Schema(description = "管理后台 - 流程定义的分页的每一项 Response VO")
-@Data
-@EqualsAndHashCode(callSuper = true)
-@ToString(callSuper = true)
-public class BpmProcessDefinitionPageItemRespVO extends BpmProcessDefinitionRespVO {
-
- @Schema(description = "表单名字", example = "请假表单")
- private String formName;
-
- @Schema(description = "部署时间", requiredMode = Schema.RequiredMode.REQUIRED)
- private LocalDateTime deploymentTime;
-
-}
diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/process/BpmProcessDefinitionPageReqVO.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/process/BpmProcessDefinitionPageReqVO.java
index f5c7f36d6..828654f1e 100644
--- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/process/BpmProcessDefinitionPageReqVO.java
+++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/process/BpmProcessDefinitionPageReqVO.java
@@ -8,8 +8,6 @@ import lombok.ToString;
@Schema(description = "管理后台 - 流程定义分页 Request VO")
@Data
-@ToString(callSuper = true)
-@EqualsAndHashCode(callSuper = true)
public class BpmProcessDefinitionPageReqVO extends PageParam {
@Schema(description = "标识-精准匹配", example = "process1641042089407")
diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/process/BpmProcessDefinitionRespVO.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/process/BpmProcessDefinitionRespVO.java
index 9df317f50..2fb8dd4dc 100644
--- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/process/BpmProcessDefinitionRespVO.java
+++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/process/BpmProcessDefinitionRespVO.java
@@ -3,7 +3,7 @@ package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.process;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
-import javax.validation.constraints.NotEmpty;
+import java.time.LocalDateTime;
import java.util.List;
@Schema(description = "管理后台 - 流程定义 Response VO")
@@ -17,20 +17,28 @@ public class BpmProcessDefinitionRespVO {
private Integer version;
@Schema(description = "流程名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋道")
- @NotEmpty(message = "流程名称不能为空")
private String name;
+ @Schema(description = "流程标识", requiredMode = Schema.RequiredMode.REQUIRED, example = "yudao")
+ private String key;
+
+ @Schema(description = "流程图标", requiredMode = Schema.RequiredMode.REQUIRED, example = "https://www.iocoder.cn/yudao.jpg")
+ private String icon;
+
@Schema(description = "流程描述", example = "我是描述")
private String description;
- @Schema(description = "流程分类-参见 bpm_model_category 数据字典", example = "1")
- @NotEmpty(message = "流程分类不能为空")
+ @Schema(description = "流程分类", example = "1")
private String category;
+ @Schema(description = "流程分类名字", example = "请假")
+ private String categoryName;
@Schema(description = "表单类型-参见 bpm_model_form_type 数据字典", example = "1")
private Integer formType;
@Schema(description = "表单编号-在表单类型为 {@link BpmModelFormTypeEnum#CUSTOM} 时,必须非空", example = "1024")
private Long formId;
+ @Schema(description = "表单名字", example = "请假表单")
+ private String formName;
@Schema(description = "表单的配置-JSON 字符串。在表单类型为 {@link BpmModelFormTypeEnum#CUSTOM} 时,必须非空", requiredMode = Schema.RequiredMode.REQUIRED)
private String formConf;
@Schema(description = "表单项的数组-JSON 字符串的数组。在表单类型为 {@link BpmModelFormTypeEnum#CUSTOM} 时,必须非空", requiredMode = Schema.RequiredMode.REQUIRED)
@@ -43,6 +51,27 @@ public class BpmProcessDefinitionRespVO {
private String formCustomViewPath;
@Schema(description = "中断状态-参见 SuspensionState 枚举", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
- private Integer suspensionState;
+ private Integer suspensionState; // 参见 SuspensionState 枚举
+
+ @Schema(description = "部署时间")
+ private LocalDateTime deploymentTime; // 需要从对应的 Deployment 读取,非必须返回
+
+ @Schema(description = "BPMN XML")
+ private String bpmnXml; // 需要从对应的 BpmnModel 读取,非必须返回
+
+ @Schema(description = "发起用户需要选择审批人的任务数组")
+ private List startUserSelectTasks; // 需要从对应的 BpmnModel 读取,非必须返回
+
+ @Schema(description = "BPMN UserTask 用户任务")
+ @Data
+ public static class UserTask {
+
+ @Schema(description = "任务标识", requiredMode = Schema.RequiredMode.REQUIRED, example = "sudo")
+ private String id;
+
+ @Schema(description = "任务名", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五")
+ private String name;
+
+ }
}
diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/rule/BpmTaskAssignRuleBaseVO.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/rule/BpmTaskAssignRuleBaseVO.java
deleted file mode 100644
index 31c1c947a..000000000
--- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/rule/BpmTaskAssignRuleBaseVO.java
+++ /dev/null
@@ -1,24 +0,0 @@
-package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.rule;
-
-import io.swagger.v3.oas.annotations.media.Schema;
-import lombok.Data;
-
-import javax.validation.constraints.NotNull;
-import java.util.Set;
-
-/**
- * 流程任务分配规则 Base VO,提供给添加、修改、详细的子 VO 使用
- * 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成
- */
-@Data
-public class BpmTaskAssignRuleBaseVO {
-
- @Schema(description = "规则类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "bpm_task_assign_rule_type")
- @NotNull(message = "规则类型不能为空")
- private Integer type;
-
- @Schema(description = "规则值数组", requiredMode = Schema.RequiredMode.REQUIRED, example = "1,2,3")
- @NotNull(message = "规则值数组不能为空")
- private Set options;
-
-}
diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/rule/BpmTaskAssignRuleCreateReqVO.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/rule/BpmTaskAssignRuleCreateReqVO.java
deleted file mode 100644
index 3461126a5..000000000
--- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/rule/BpmTaskAssignRuleCreateReqVO.java
+++ /dev/null
@@ -1,24 +0,0 @@
-package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.rule;
-
-import io.swagger.v3.oas.annotations.media.Schema;
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-import lombok.ToString;
-
-import javax.validation.constraints.NotEmpty;
-
-@Schema(description = "管理后台 - 流程任务分配规则的创建 Request VO")
-@Data
-@EqualsAndHashCode(callSuper = true)
-@ToString(callSuper = true)
-public class BpmTaskAssignRuleCreateReqVO extends BpmTaskAssignRuleBaseVO {
-
- @Schema(description = "流程模型的编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
- @NotEmpty(message = "流程模型的编号不能为空")
- private String modelId;
-
- @Schema(description = "流程任务定义的编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "2048")
- @NotEmpty(message = "流程任务定义的编号不能为空")
- private String taskDefinitionKey;
-
-}
diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/rule/BpmTaskAssignRuleRespVO.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/rule/BpmTaskAssignRuleRespVO.java
deleted file mode 100644
index ac4f85e78..000000000
--- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/rule/BpmTaskAssignRuleRespVO.java
+++ /dev/null
@@ -1,28 +0,0 @@
-package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.rule;
-
-import io.swagger.v3.oas.annotations.media.Schema;
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-import lombok.ToString;
-
-@Schema(description = "管理后台 - 流程任务分配规则的 Response VO")
-@Data
-@EqualsAndHashCode(callSuper = true)
-@ToString(callSuper = true)
-public class BpmTaskAssignRuleRespVO extends BpmTaskAssignRuleBaseVO {
-
- @Schema(description = "任务分配规则的编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
- private Long id;
-
- @Schema(description = "流程模型的编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "2048")
- private String modelId;
-
- @Schema(description = "流程定义的编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "4096")
- private String processDefinitionId;
-
- @Schema(description = "流程任务定义的编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "2048")
- private String taskDefinitionKey;
- @Schema(description = "流程任务定义的名字", requiredMode = Schema.RequiredMode.REQUIRED, example = "关注芋道")
- private String taskDefinitionName;
-
-}
diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/rule/BpmTaskAssignRuleUpdateReqVO.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/rule/BpmTaskAssignRuleUpdateReqVO.java
deleted file mode 100644
index 47bfb6aeb..000000000
--- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/rule/BpmTaskAssignRuleUpdateReqVO.java
+++ /dev/null
@@ -1,20 +0,0 @@
-package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.rule;
-
-import io.swagger.v3.oas.annotations.media.Schema;
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-import lombok.ToString;
-
-import javax.validation.constraints.NotNull;
-
-@Schema(description = "管理后台 - 流程任务分配规则的更新 Request VO")
-@Data
-@EqualsAndHashCode(callSuper = true)
-@ToString(callSuper = true)
-public class BpmTaskAssignRuleUpdateReqVO extends BpmTaskAssignRuleBaseVO {
-
- @Schema(description = "任务分配规则的编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
- @NotNull(message = "任务分配规则的编号不能为空")
- private Long id;
-
-}
diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/BpmOALeaveController.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/BpmOALeaveController.java
index 770d465b6..144749450 100644
--- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/BpmOALeaveController.java
+++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/BpmOALeaveController.java
@@ -1,23 +1,22 @@
package cn.iocoder.yudao.module.bpm.controller.admin.oa;
+import cn.iocoder.yudao.framework.common.pojo.CommonResult;
+import cn.iocoder.yudao.framework.common.pojo.PageResult;
+import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.BpmOALeaveCreateReqVO;
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.BpmOALeavePageReqVO;
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.BpmOALeaveRespVO;
-import cn.iocoder.yudao.module.bpm.convert.oa.BpmOALeaveConvert;
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOALeaveDO;
-import cn.iocoder.yudao.framework.common.pojo.CommonResult;
-import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.bpm.service.oa.BpmOALeaveService;
-import io.swagger.v3.oas.annotations.tags.Tag;
-import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.Parameter;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import jakarta.annotation.Resource;
+import jakarta.validation.Valid;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
-import javax.annotation.Resource;
-import javax.validation.Valid;
-
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
@@ -49,7 +48,7 @@ public class BpmOALeaveController {
@Parameter(name = "id", description = "编号", required = true, example = "1024")
public CommonResult getLeave(@RequestParam("id") Long id) {
BpmOALeaveDO leave = leaveService.getLeave(id);
- return success(BpmOALeaveConvert.INSTANCE.convert(leave));
+ return success(BeanUtils.toBean(leave, BpmOALeaveRespVO.class));
}
@GetMapping("/page")
@@ -57,7 +56,7 @@ public class BpmOALeaveController {
@Operation(summary = "获得请假申请分页")
public CommonResult> getLeavePage(@Valid BpmOALeavePageReqVO pageVO) {
PageResult pageResult = leaveService.getLeavePage(getLoginUserId(), pageVO);
- return success(BpmOALeaveConvert.INSTANCE.convertPage(pageResult));
+ return success(BeanUtils.toBean(pageResult, BpmOALeaveRespVO.class));
}
}
diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/vo/BpmOALeaveBaseVO.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/vo/BpmOALeaveBaseVO.java
deleted file mode 100644
index d61cdc3e9..000000000
--- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/vo/BpmOALeaveBaseVO.java
+++ /dev/null
@@ -1,33 +0,0 @@
-package cn.iocoder.yudao.module.bpm.controller.admin.oa.vo;
-
-import io.swagger.v3.oas.annotations.media.Schema;
-import lombok.*;
-import java.time.LocalDateTime;
-import javax.validation.constraints.*;
-import org.springframework.format.annotation.DateTimeFormat;
-
-import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
-
-/**
-* 请假申请 Base VO,提供给添加、修改、详细的子 VO 使用
-* 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成
-*/
-@Data
-public class BpmOALeaveBaseVO {
-
- @Schema(description = "请假的开始时间", requiredMode = Schema.RequiredMode.REQUIRED)
- @NotNull(message = "开始时间不能为空")
- @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
- private LocalDateTime startTime;
- @Schema(description = "请假的结束时间", requiredMode = Schema.RequiredMode.REQUIRED)
- @NotNull(message = "结束时间不能为空")
- @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
- private LocalDateTime endTime;
-
- @Schema(description = "请假类型-参见 bpm_oa_type 枚举", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
- private Integer type;
-
- @Schema(description = "原因", requiredMode = Schema.RequiredMode.REQUIRED, example = "阅读芋道源码")
- private String reason;
-
-}
diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/vo/BpmOALeaveCreateReqVO.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/vo/BpmOALeaveCreateReqVO.java
index 9bfd4488f..856a22547 100644
--- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/vo/BpmOALeaveCreateReqVO.java
+++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/vo/BpmOALeaveCreateReqVO.java
@@ -1,16 +1,39 @@
package cn.iocoder.yudao.module.bpm.controller.admin.oa.vo;
-import io.swagger.v3.oas.annotations.media.Schema;
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-import lombok.ToString;
-import javax.validation.constraints.AssertTrue;
+import io.swagger.v3.oas.annotations.media.Schema;
+import jakarta.validation.constraints.AssertTrue;
+import jakarta.validation.constraints.NotNull;
+import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.time.LocalDateTime;
+import java.util.List;
+import java.util.Map;
+
+import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@Schema(description = "管理后台 - 请假申请创建 Request VO")
@Data
-@EqualsAndHashCode(callSuper = true)
-@ToString(callSuper = true)
-public class BpmOALeaveCreateReqVO extends BpmOALeaveBaseVO {
+public class BpmOALeaveCreateReqVO {
+
+ @Schema(description = "请假的开始时间", requiredMode = Schema.RequiredMode.REQUIRED)
+ @NotNull(message = "开始时间不能为空")
+ @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
+ private LocalDateTime startTime;
+
+ @Schema(description = "请假的结束时间", requiredMode = Schema.RequiredMode.REQUIRED)
+ @NotNull(message = "结束时间不能为空")
+ @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
+ private LocalDateTime endTime;
+
+ @Schema(description = "请假类型-参见 bpm_oa_type 枚举", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
+ private Integer type;
+
+ @Schema(description = "原因", requiredMode = Schema.RequiredMode.REQUIRED, example = "阅读芋道源码")
+ private String reason;
+
+ @Schema(description = "发起人自选审批人 Map", example = "{taskKey1: [1, 2]}")
+ private Map> startUserSelectAssignees;
@AssertTrue(message = "结束时间,需要在开始时间之后")
public boolean isEndTimeValid() {
diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/vo/BpmOALeavePageReqVO.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/vo/BpmOALeavePageReqVO.java
index 903a0fcf2..3777564b4 100644
--- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/vo/BpmOALeavePageReqVO.java
+++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/vo/BpmOALeavePageReqVO.java
@@ -1,25 +1,27 @@
package cn.iocoder.yudao.module.bpm.controller.admin.oa.vo;
-import io.swagger.v3.oas.annotations.media.Schema;
-import lombok.*;
-import java.time.LocalDateTime;
+
import cn.iocoder.yudao.framework.common.pojo.PageParam;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.ToString;
import org.springframework.format.annotation.DateTimeFormat;
+import java.time.LocalDateTime;
+
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@Schema(description = "管理后台 - 请假申请分页 Request VO")
@Data
-@EqualsAndHashCode(callSuper = true)
-@ToString(callSuper = true)
public class BpmOALeavePageReqVO extends PageParam {
- @Schema(description = "状态-参见 bpm_process_instance_result 枚举", example = "1")
- private Integer result;
+ @Schema(description = "状态", example = "1")
+ private Integer status; // 参见 BpmProcessInstanceResultEnum 枚举
- @Schema(description = "请假类型-参见 bpm_oa_type", example = "1")
+ @Schema(description = "请假类型,参见 bpm_oa_type", example = "1")
private Integer type;
- @Schema(description = "原因-模糊匹配", example = "阅读芋道源码")
+ @Schema(description = "原因,模糊匹配", example = "阅读芋道源码")
private String reason;
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/vo/BpmOALeaveRespVO.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/vo/BpmOALeaveRespVO.java
index 886211755..dbfe9d90f 100644
--- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/vo/BpmOALeaveRespVO.java
+++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/vo/BpmOALeaveRespVO.java
@@ -1,32 +1,36 @@
package cn.iocoder.yudao.module.bpm.controller.admin.oa.vo;
import io.swagger.v3.oas.annotations.media.Schema;
-import lombok.*;
-import org.springframework.format.annotation.DateTimeFormat;
+import lombok.Data;
-import javax.validation.constraints.NotNull;
import java.time.LocalDateTime;
-import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
-
@Schema(description = "管理后台 - 请假申请 Response VO")
@Data
-@EqualsAndHashCode(callSuper = true)
-@ToString(callSuper = true)
-public class BpmOALeaveRespVO extends BpmOALeaveBaseVO {
+public class BpmOALeaveRespVO {
@Schema(description = "请假表单主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
private Long id;
- @Schema(description = "状态-参见 bpm_process_instance_result 枚举", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
- private Integer result;
+ @Schema(description = "请假类型,参见 bpm_oa_type 枚举", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
+ private Integer type;
+
+ @Schema(description = "原因", requiredMode = Schema.RequiredMode.REQUIRED, example = "阅读芋道源码")
+ private String reason;
@Schema(description = "申请时间", requiredMode = Schema.RequiredMode.REQUIRED)
- @NotNull(message = "申请时间不能为空")
- @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime createTime;
- @Schema(description = "流程id")
+ @Schema(description = "请假的开始时间", requiredMode = Schema.RequiredMode.REQUIRED)
+ private LocalDateTime startTime;
+
+ @Schema(description = "请假的结束时间", requiredMode = Schema.RequiredMode.REQUIRED)
+ private LocalDateTime endTime;
+
+ @Schema(description = "流程编号")
private String processInstanceId;
+ @Schema(description = "审批结果", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
+ private Integer status; // 参见 BpmProcessInstanceStatusEnum 枚举
+
}
diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/BpmProcessInstanceController.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/BpmProcessInstanceController.java
index 98b2c15f9..50fbc9fa8 100644
--- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/BpmProcessInstanceController.java
+++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/BpmProcessInstanceController.java
@@ -1,20 +1,43 @@
package cn.iocoder.yudao.module.bpm.controller.admin.task;
+import cn.hutool.core.collection.CollUtil;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
-import cn.iocoder.yudao.module.bpm.controller.admin.task.vo.instance.*;
+import cn.iocoder.yudao.framework.common.util.number.NumberUtils;
+import cn.iocoder.yudao.module.bpm.controller.admin.task.vo.instance.BpmProcessInstanceCancelReqVO;
+import cn.iocoder.yudao.module.bpm.controller.admin.task.vo.instance.BpmProcessInstanceCreateReqVO;
+import cn.iocoder.yudao.module.bpm.controller.admin.task.vo.instance.BpmProcessInstancePageReqVO;
+import cn.iocoder.yudao.module.bpm.controller.admin.task.vo.instance.BpmProcessInstanceRespVO;
+import cn.iocoder.yudao.module.bpm.convert.task.BpmProcessInstanceConvert;
+import cn.iocoder.yudao.module.bpm.dal.dataobject.definition.BpmCategoryDO;
+import cn.iocoder.yudao.module.bpm.dal.dataobject.definition.BpmProcessDefinitionInfoDO;
+import cn.iocoder.yudao.module.bpm.framework.flowable.core.util.BpmnModelUtils;
+import cn.iocoder.yudao.module.bpm.service.definition.BpmCategoryService;
+import cn.iocoder.yudao.module.bpm.service.definition.BpmProcessDefinitionService;
import cn.iocoder.yudao.module.bpm.service.task.BpmProcessInstanceService;
+import cn.iocoder.yudao.module.bpm.service.task.BpmTaskService;
+import cn.iocoder.yudao.module.system.api.dept.DeptApi;
+import cn.iocoder.yudao.module.system.api.dept.dto.DeptRespDTO;
+import cn.iocoder.yudao.module.system.api.user.AdminUserApi;
+import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
+import jakarta.annotation.Resource;
+import jakarta.validation.Valid;
+import org.flowable.engine.history.HistoricProcessInstance;
+import org.flowable.engine.repository.ProcessDefinition;
+import org.flowable.task.api.Task;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
-import javax.annotation.Resource;
-import javax.validation.Valid;
+import java.util.List;
+import java.util.Map;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
+import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertList;
+import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertSet;
import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
@Tag(name = "管理后台 - 流程实例") // 流程实例,通过流程定义创建的一次“申请”
@@ -25,13 +48,65 @@ public class BpmProcessInstanceController {
@Resource
private BpmProcessInstanceService processInstanceService;
+ @Resource
+ private BpmTaskService taskService;
+ @Resource
+ private BpmProcessDefinitionService processDefinitionService;
+ @Resource
+ private BpmCategoryService categoryService;
+
+ @Resource
+ private AdminUserApi adminUserApi;
+ @Resource
+ private DeptApi deptApi;
@GetMapping("/my-page")
@Operation(summary = "获得我的实例分页列表", description = "在【我的流程】菜单中,进行调用")
@PreAuthorize("@ss.hasPermission('bpm:process-instance:query')")
- public CommonResult> getMyProcessInstancePage(
- @Valid BpmProcessInstanceMyPageReqVO pageReqVO) {
- return success(processInstanceService.getMyProcessInstancePage(getLoginUserId(), pageReqVO));
+ public CommonResult> getProcessInstanceMyPage(
+ @Valid BpmProcessInstancePageReqVO pageReqVO) {
+ PageResult pageResult = processInstanceService.getProcessInstancePage(
+ getLoginUserId(), pageReqVO);
+ if (CollUtil.isEmpty(pageResult.getList())) {
+ return success(PageResult.empty(pageResult.getTotal()));
+ }
+
+ // 拼接返回
+ Map> taskMap = taskService.getTaskMapByProcessInstanceIds(
+ convertList(pageResult.getList(), HistoricProcessInstance::getId));
+ Map processDefinitionMap = processDefinitionService.getProcessDefinitionMap(
+ convertSet(pageResult.getList(), HistoricProcessInstance::getProcessDefinitionId));
+ Map categoryMap = categoryService.getCategoryMap(
+ convertSet(processDefinitionMap.values(), ProcessDefinition::getCategory));
+ return success(BpmProcessInstanceConvert.INSTANCE.buildProcessInstancePage(pageResult,
+ processDefinitionMap, categoryMap, taskMap, null, null));
+ }
+
+ @GetMapping("/manager-page")
+ @Operation(summary = "获得管理流程实例的分页列表", description = "在【流程实例】菜单中,进行调用")
+ @PreAuthorize("@ss.hasPermission('bpm:process-instance:manager-query')")
+ public CommonResult> getProcessInstanceManagerPage(
+ @Valid BpmProcessInstancePageReqVO pageReqVO) {
+ PageResult pageResult = processInstanceService.getProcessInstancePage(
+ null, pageReqVO);
+ if (CollUtil.isEmpty(pageResult.getList())) {
+ return success(PageResult.empty(pageResult.getTotal()));
+ }
+
+ // 拼接返回
+ Map> taskMap = taskService.getTaskMapByProcessInstanceIds(
+ convertList(pageResult.getList(), HistoricProcessInstance::getId));
+ Map processDefinitionMap = processDefinitionService.getProcessDefinitionMap(
+ convertSet(pageResult.getList(), HistoricProcessInstance::getProcessDefinitionId));
+ Map categoryMap = categoryService.getCategoryMap(
+ convertSet(processDefinitionMap.values(), ProcessDefinition::getCategory));
+ // 发起人信息
+ Map userMap = adminUserApi.getUserMap(
+ convertSet(pageResult.getList(), processInstance -> NumberUtils.parseLong(processInstance.getStartUserId())));
+ Map deptMap = deptApi.getDeptMap(
+ convertSet(userMap.values(), AdminUserRespDTO::getDeptId));
+ return success(BpmProcessInstanceConvert.INSTANCE.buildProcessInstancePage(pageResult,
+ processDefinitionMap, categoryMap, taskMap, userMap, deptMap));
}
@PostMapping("/create")
@@ -46,14 +121,42 @@ public class BpmProcessInstanceController {
@Parameter(name = "id", description = "流程实例的编号", required = true)
@PreAuthorize("@ss.hasPermission('bpm:process-instance:query')")
public CommonResult getProcessInstance(@RequestParam("id") String id) {
- return success(processInstanceService.getProcessInstanceVO(id));
+ HistoricProcessInstance processInstance = processInstanceService.getHistoricProcessInstance(id);
+ if (processInstance == null) {
+ return success(null);
+ }
+
+ // 拼接返回
+ ProcessDefinition processDefinition = processDefinitionService.getProcessDefinition(
+ processInstance.getProcessDefinitionId());
+ BpmProcessDefinitionInfoDO processDefinitionInfo = processDefinitionService.getProcessDefinitionInfo(
+ processInstance.getProcessDefinitionId());
+ String bpmnXml = BpmnModelUtils.getBpmnXml(
+ processDefinitionService.getProcessDefinitionBpmnModel(processInstance.getProcessDefinitionId()));
+ AdminUserRespDTO startUser = adminUserApi.getUser(NumberUtils.parseLong(processInstance.getStartUserId()));
+ DeptRespDTO dept = null;
+ if (startUser != null) {
+ dept = deptApi.getDept(startUser.getDeptId());
+ }
+ return success(BpmProcessInstanceConvert.INSTANCE.buildProcessInstance(processInstance,
+ processDefinition, processDefinitionInfo, bpmnXml, startUser, dept));
}
- @DeleteMapping("/cancel")
- @Operation(summary = "取消流程实例", description = "撤回发起的流程")
+ @DeleteMapping("/cancel-by-start-user")
+ @Operation(summary = "用户取消流程实例", description = "取消发起的流程")
@PreAuthorize("@ss.hasPermission('bpm:process-instance:cancel')")
- public CommonResult cancelProcessInstance(@Valid @RequestBody BpmProcessInstanceCancelReqVO cancelReqVO) {
- processInstanceService.cancelProcessInstance(getLoginUserId(), cancelReqVO);
+ public CommonResult cancelProcessInstanceByStartUser(
+ @Valid @RequestBody BpmProcessInstanceCancelReqVO cancelReqVO) {
+ processInstanceService.cancelProcessInstanceByStartUser(getLoginUserId(), cancelReqVO);
+ return success(true);
+ }
+
+ @DeleteMapping("/cancel-by-admin")
+ @Operation(summary = "管理员取消流程实例", description = "管理员撤回流程")
+ @PreAuthorize("@ss.hasPermission('bpm:process-instance:cancel-by-admin')")
+ public CommonResult cancelProcessInstanceByManager(
+ @Valid @RequestBody BpmProcessInstanceCancelReqVO cancelReqVO) {
+ processInstanceService.cancelProcessInstanceByAdmin(getLoginUserId(), cancelReqVO);
return success(true);
}
diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/BpmProcessInstanceCopyController.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/BpmProcessInstanceCopyController.java
index ec7b67e27..e9f0eb444 100644
--- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/BpmProcessInstanceCopyController.java
+++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/BpmProcessInstanceCopyController.java
@@ -3,24 +3,28 @@ package cn.iocoder.yudao.module.bpm.controller.admin.task;
import cn.hutool.core.collection.CollUtil;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
-import cn.iocoder.yudao.module.bpm.controller.admin.task.vo.instance.BpmProcessInstanceCopyCreateReqVO;
-import cn.iocoder.yudao.module.bpm.controller.admin.task.vo.instance.BpmProcessInstanceCopyMyPageReqVO;
-import cn.iocoder.yudao.module.bpm.controller.admin.task.vo.instance.BpmProcessInstanceCopyPageItemRespVO;
-import cn.iocoder.yudao.module.bpm.convert.cc.BpmProcessInstanceCopyConvert;
-import cn.iocoder.yudao.module.bpm.dal.dataobject.cc.BpmProcessInstanceCopyDO;
+import cn.iocoder.yudao.framework.common.util.collection.MapUtils;
+import cn.iocoder.yudao.framework.common.util.date.DateUtils;
+import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
+import cn.iocoder.yudao.module.bpm.controller.admin.task.vo.cc.BpmProcessInstanceCopyRespVO;
+import cn.iocoder.yudao.module.bpm.controller.admin.task.vo.instance.BpmProcessInstanceCopyPageReqVO;
+import cn.iocoder.yudao.module.bpm.dal.dataobject.task.BpmProcessInstanceCopyDO;
+import cn.iocoder.yudao.module.bpm.service.task.BpmProcessInstanceCopyService;
import cn.iocoder.yudao.module.bpm.service.task.BpmProcessInstanceService;
import cn.iocoder.yudao.module.bpm.service.task.BpmTaskService;
-import cn.iocoder.yudao.module.bpm.service.task.cc.BpmProcessInstanceCopyService;
import cn.iocoder.yudao.module.system.api.user.AdminUserApi;
import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
+import jakarta.annotation.Resource;
+import jakarta.validation.Valid;
+import org.flowable.engine.history.HistoricProcessInstance;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.*;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
-import javax.annotation.Resource;
-import javax.validation.Valid;
import java.util.Map;
import java.util.stream.Stream;
@@ -31,47 +35,45 @@ import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUti
@Tag(name = "管理后台 - 流程实例抄送")
@RestController
-@RequestMapping("/bpm/process-instance/cc")
+@RequestMapping("/bpm/process-instance/copy")
@Validated
public class BpmProcessInstanceCopyController {
@Resource
private BpmProcessInstanceCopyService processInstanceCopyService;
@Resource
- private BpmProcessInstanceService bpmProcessInstanceService;
+ private BpmProcessInstanceService processInstanceService;
+ @Resource
+ private BpmTaskService taskService;
@Resource
private AdminUserApi adminUserApi;
- @Resource
- private BpmTaskService bpmTaskService;
-
- @PostMapping("/create")
- @Operation(summary = "抄送流程")
- @PreAuthorize("@ss.hasPermission('bpm:process-instance-cc:create')")
- public CommonResult createProcessInstanceCopy(@Valid @RequestBody BpmProcessInstanceCopyCreateReqVO createReqVO) {
- processInstanceCopyService.createProcessInstanceCopy(getLoginUserId(), createReqVO);
- return success(true);
- }
-
- @GetMapping("/my-page")
+ @GetMapping("/page")
@Operation(summary = "获得抄送流程分页列表")
@PreAuthorize("@ss.hasPermission('bpm:process-instance-cc:query')")
- public CommonResult> getProcessInstanceCopyPage(
- @Valid BpmProcessInstanceCopyMyPageReqVO pageReqVO) {
- PageResult pageResult = processInstanceCopyService.getMyProcessInstanceCopyPage(getLoginUserId(), pageReqVO);
+ public CommonResult> getProcessInstanceCopyPage(
+ @Valid BpmProcessInstanceCopyPageReqVO pageReqVO) {
+ PageResult pageResult = processInstanceCopyService.getProcessInstanceCopyPage(
+ getLoginUserId(), pageReqVO);
if (CollUtil.isEmpty(pageResult.getList())) {
return success(new PageResult<>(pageResult.getTotal()));
}
// 拼接返回
- Map taskNameMap = bpmTaskService.getTaskNameByTaskIds(
+ Map taskNameMap = taskService.getTaskNameByTaskIds(
convertSet(pageResult.getList(), BpmProcessInstanceCopyDO::getTaskId));
- Map processNameMap = bpmProcessInstanceService.getProcessInstanceNameMap(
+ Map processInstanceMap = processInstanceService.getHistoricProcessInstanceMap(
convertSet(pageResult.getList(), BpmProcessInstanceCopyDO::getProcessInstanceId));
Map userMap = adminUserApi.getUserMap(convertListByFlatMap(pageResult.getList(),
copy -> Stream.of(copy.getStartUserId(), Long.parseLong(copy.getCreator()))));
- return success(BpmProcessInstanceCopyConvert.INSTANCE.convertPage(pageResult, taskNameMap, processNameMap, userMap));
+ return success(BeanUtils.toBean(pageResult, BpmProcessInstanceCopyRespVO.class, copyVO -> {
+ MapUtils.findAndThen(userMap, Long.valueOf(copyVO.getCreator()), user -> copyVO.setCreatorName(user.getNickname()));
+ MapUtils.findAndThen(userMap, copyVO.getStartUserId(), user -> copyVO.setStartUserName(user.getNickname()));
+ MapUtils.findAndThen(taskNameMap, copyVO.getTaskId(), copyVO::setTaskName);
+ MapUtils.findAndThen(processInstanceMap, copyVO.getProcessInstanceId(),
+ processInstance -> copyVO.setProcessInstanceStartTime(DateUtils.of(processInstance.getStartTime())));
+ }));
}
}
diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/BpmTaskController.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/BpmTaskController.java
index dcfab78ef..7d72a133b 100644
--- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/BpmTaskController.java
+++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/BpmTaskController.java
@@ -1,21 +1,41 @@
package cn.iocoder.yudao.module.bpm.controller.admin.task;
+import cn.hutool.core.collection.CollUtil;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
+import cn.iocoder.yudao.framework.common.util.number.NumberUtils;
import cn.iocoder.yudao.module.bpm.controller.admin.task.vo.task.*;
+import cn.iocoder.yudao.module.bpm.convert.task.BpmTaskConvert;
+import cn.iocoder.yudao.module.bpm.dal.dataobject.definition.BpmFormDO;
+import cn.iocoder.yudao.module.bpm.service.definition.BpmFormService;
+import cn.iocoder.yudao.module.bpm.service.task.BpmProcessInstanceService;
import cn.iocoder.yudao.module.bpm.service.task.BpmTaskService;
+import cn.iocoder.yudao.module.system.api.dept.DeptApi;
+import cn.iocoder.yudao.module.system.api.dept.dto.DeptRespDTO;
+import cn.iocoder.yudao.module.system.api.user.AdminUserApi;
+import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
+import jakarta.annotation.Resource;
+import jakarta.validation.Valid;
+import org.flowable.bpmn.model.UserTask;
+import org.flowable.engine.history.HistoricProcessInstance;
+import org.flowable.engine.runtime.ProcessInstance;
+import org.flowable.task.api.Task;
+import org.flowable.task.api.history.HistoricTaskInstance;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
-import javax.annotation.Resource;
-import javax.validation.Valid;
+import java.util.Collections;
import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.stream.Stream;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
+import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.*;
import static cn.iocoder.yudao.framework.web.core.util.WebFrameworkUtils.getLoginUserId;
@Tag(name = "管理后台 - 流程任务实例")
@@ -26,19 +46,69 @@ public class BpmTaskController {
@Resource
private BpmTaskService taskService;
+ @Resource
+ private BpmProcessInstanceService processInstanceService;
+ @Resource
+ private BpmFormService formService;
+
+ @Resource
+ private AdminUserApi adminUserApi;
+ @Resource
+ private DeptApi deptApi;
@GetMapping("todo-page")
@Operation(summary = "获取 Todo 待办任务分页")
@PreAuthorize("@ss.hasPermission('bpm:task:query')")
- public CommonResult> getTodoTaskPage(@Valid BpmTaskTodoPageReqVO pageVO) {
- return success(taskService.getTodoTaskPage(getLoginUserId(), pageVO));
+ public CommonResult> getTaskTodoPage(@Valid BpmTaskPageReqVO pageVO) {
+ PageResult pageResult = taskService.getTaskTodoPage(getLoginUserId(), pageVO);
+ if (CollUtil.isEmpty(pageResult.getList())) {
+ return success(PageResult.empty());
+ }
+
+ // 拼接数据
+ Map processInstanceMap = processInstanceService.getProcessInstanceMap(
+ convertSet(pageResult.getList(), Task::getProcessInstanceId));
+ Map userMap = adminUserApi.getUserMap(
+ convertSet(processInstanceMap.values(), instance -> Long.valueOf(instance.getStartUserId())));
+ return success(BpmTaskConvert.INSTANCE.buildTodoTaskPage(pageResult, processInstanceMap, userMap));
}
@GetMapping("done-page")
@Operation(summary = "获取 Done 已办任务分页")
@PreAuthorize("@ss.hasPermission('bpm:task:query')")
- public CommonResult> getDoneTaskPage(@Valid BpmTaskDonePageReqVO pageVO) {
- return success(taskService.getDoneTaskPage(getLoginUserId(), pageVO));
+ public CommonResult> getTaskDonePage(@Valid BpmTaskPageReqVO pageVO) {
+ PageResult pageResult = taskService.getTaskDonePage(getLoginUserId(), pageVO);
+ if (CollUtil.isEmpty(pageResult.getList())) {
+ return success(PageResult.empty());
+ }
+
+ // 拼接数据
+ Map processInstanceMap = processInstanceService.getHistoricProcessInstanceMap(
+ convertSet(pageResult.getList(), HistoricTaskInstance::getProcessInstanceId));
+ Map userMap = adminUserApi.getUserMap(
+ convertSet(processInstanceMap.values(), instance -> Long.valueOf(instance.getStartUserId())));
+ return success(BpmTaskConvert.INSTANCE.buildTaskPage(pageResult, processInstanceMap, userMap, null));
+ }
+
+ @GetMapping("manager-page")
+ @Operation(summary = "获取全部任务的分页", description = "用于【流程任务】菜单")
+ @PreAuthorize("@ss.hasPermission('bpm:task:mananger-query')")
+ public CommonResult> getDoneTaskPage(@Valid BpmTaskPageReqVO pageVO) {
+ PageResult pageResult = taskService.getTaskPage(getLoginUserId(), pageVO);
+ if (CollUtil.isEmpty(pageResult.getList())) {
+ return success(PageResult.empty());
+ }
+
+ // 拼接数据
+ Map processInstanceMap = processInstanceService.getHistoricProcessInstanceMap(
+ convertSet(pageResult.getList(), HistoricTaskInstance::getProcessInstanceId));
+ // 获得 User 和 Dept Map
+ Set userIds = convertSet(processInstanceMap.values(), instance -> Long.valueOf(instance.getStartUserId()));
+ userIds.addAll(convertSet(pageResult.getList(), task -> NumberUtils.parseLong(task.getAssignee())));
+ Map userMap = adminUserApi.getUserMap(userIds);
+ Map deptMap = deptApi.getDeptMap(
+ convertSet(userMap.values(), AdminUserRespDTO::getDeptId));
+ return success(BpmTaskConvert.INSTANCE.buildTaskPage(pageResult, processInstanceMap, userMap, deptMap));
}
@GetMapping("/list-by-process-instance-id")
@@ -47,7 +117,25 @@ public class BpmTaskController {
@PreAuthorize("@ss.hasPermission('bpm:task:query')")
public CommonResult> getTaskListByProcessInstanceId(
@RequestParam("processInstanceId") String processInstanceId) {
- return success(taskService.getTaskListByProcessInstanceId(processInstanceId));
+ List taskList = taskService.getTaskListByProcessInstanceId(processInstanceId);
+ if (CollUtil.isEmpty(taskList)) {
+ return success(Collections.emptyList());
+ }
+
+ // 拼接数据
+ HistoricProcessInstance processInstance = processInstanceService.getHistoricProcessInstance(processInstanceId);
+ // 获得 User 和 Dept Map
+ Set userIds = convertSetByFlatMap(taskList, task ->
+ Stream.of(NumberUtils.parseLong(task.getAssignee()), NumberUtils.parseLong(task.getOwner())));
+ userIds.add(NumberUtils.parseLong(processInstance.getStartUserId()));
+ Map userMap = adminUserApi.getUserMap(userIds);
+ Map deptMap = deptApi.getDeptMap(
+ convertSet(userMap.values(), AdminUserRespDTO::getDeptId));
+ // 获得 Form Map
+ Map formMap = formService.getFormMap(
+ convertSet(taskList, task -> NumberUtils.parseLong(task.getFormKey())));
+ return success(BpmTaskConvert.INSTANCE.buildTaskListByProcessInstanceId(taskList, processInstance,
+ formMap, userMap, deptMap));
}
@PutMapping("/approve")
@@ -66,20 +154,14 @@ public class BpmTaskController {
return success(true);
}
- @PutMapping("/update-assignee")
- @Operation(summary = "更新任务的负责人", description = "用于【流程详情】的【转派】按钮")
- @PreAuthorize("@ss.hasPermission('bpm:task:update')")
- public CommonResult updateTaskAssignee(@Valid @RequestBody BpmTaskUpdateAssigneeReqVO reqVO) {
- taskService.updateTaskAssignee(getLoginUserId(), reqVO);
- return success(true);
- }
-
- @GetMapping("/return-list")
+ @GetMapping("/list-by-return")
@Operation(summary = "获取所有可回退的节点", description = "用于【流程详情】的【回退】按钮")
@Parameter(name = "taskId", description = "当前任务ID", required = true)
@PreAuthorize("@ss.hasPermission('bpm:task:update')")
- public CommonResult> getReturnList(@RequestParam("taskId") String taskId) {
- return success(taskService.getReturnTaskList(taskId));
+ public CommonResult> getTaskListByReturn(@RequestParam("id") String id) {
+ List userTaskList = taskService.getUserTaskListByReturn(id);
+ return success(convertList(userTaskList, userTask -> // 只返回 id 和 name
+ new BpmTaskRespVO().setName(userTask.getName()).setTaskDefinitionKey(userTask.getId())));
}
@PutMapping("/return")
@@ -91,17 +173,25 @@ public class BpmTaskController {
}
@PutMapping("/delegate")
- @Operation(summary = "委派任务", description = "用于【流程详情】的【委派】按钮。和向前【加签】有点像,唯一区别是【委托】没有单独创立任务")
+ @Operation(summary = "委派任务", description = "用于【流程详情】的【委派】按钮")
@PreAuthorize("@ss.hasPermission('bpm:task:update')")
public CommonResult delegateTask(@Valid @RequestBody BpmTaskDelegateReqVO reqVO) {
taskService.delegateTask(getLoginUserId(), reqVO);
return success(true);
}
+ @PutMapping("/transfer")
+ @Operation(summary = "转派任务", description = "用于【流程详情】的【转派】按钮")
+ @PreAuthorize("@ss.hasPermission('bpm:task:update')")
+ public CommonResult transferTask(@Valid @RequestBody BpmTaskTransferReqVO reqVO) {
+ taskService.transferTask(getLoginUserId(), reqVO);
+ return success(true);
+ }
+
@PutMapping("/create-sign")
@Operation(summary = "加签", description = "before 前加签,after 后加签")
@PreAuthorize("@ss.hasPermission('bpm:task:update')")
- public CommonResult createSignTask(@Valid @RequestBody BpmTaskAddSignReqVO reqVO) {
+ public CommonResult createSignTask(@Valid @RequestBody BpmTaskSignCreateReqVO reqVO) {
taskService.createSignTask(getLoginUserId(), reqVO);
return success(true);
}
@@ -109,17 +199,26 @@ public class BpmTaskController {
@DeleteMapping("/delete-sign")
@Operation(summary = "减签")
@PreAuthorize("@ss.hasPermission('bpm:task:update')")
- public CommonResult deleteSignTask(@Valid @RequestBody BpmTaskSubSignReqVO reqVO) {
+ public CommonResult deleteSignTask(@Valid @RequestBody BpmTaskSignDeleteReqVO reqVO) {
taskService.deleteSignTask(getLoginUserId(), reqVO);
return success(true);
}
- @GetMapping("children-list")
- @Operation(summary = "获取能被减签的任务")
- @Parameter(name = "parentId", description = "父级任务 ID", required = true)
- @PreAuthorize("@ss.hasPermission('bpm:task:update')")
- public CommonResult> getChildrenTaskList(@RequestParam("parentId") String parentId) {
- return success(taskService.getChildrenTaskList(parentId));
+ @GetMapping("/list-by-parent-task-id")
+ @Operation(summary = "获得指定父级任务的子任务列表") // 目前用于,减签的时候,获得子任务列表
+ @Parameter(name = "parentTaskId", description = "父级任务编号", required = true)
+ @PreAuthorize("@ss.hasPermission('bpm:task:query')")
+ public CommonResult> getTaskListByParentTaskId(@RequestParam("parentTaskId") String parentTaskId) {
+ List taskList = taskService.getTaskListByParentTaskId(parentTaskId);
+ if (CollUtil.isEmpty(taskList)) {
+ return success(Collections.emptyList());
+ }
+ // 拼接数据
+ Map userMap = adminUserApi.getUserMap(convertSetByFlatMap(taskList,
+ user -> Stream.of(NumberUtils.parseLong(user.getAssignee()), NumberUtils.parseLong(user.getOwner()))));
+ Map deptMap = deptApi.getDeptMap(
+ convertSet(userMap.values(), AdminUserRespDTO::getDeptId));
+ return success(BpmTaskConvert.INSTANCE.buildTaskListByParentTaskId(taskList, userMap, deptMap));
}
}
diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/activity/BpmActivityRespVO.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/activity/BpmActivityRespVO.java
index ab6468204..8f959e093 100644
--- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/activity/BpmActivityRespVO.java
+++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/activity/BpmActivityRespVO.java
@@ -19,7 +19,7 @@ public class BpmActivityRespVO {
@Schema(description = "流程活动的结束时间", requiredMode = Schema.RequiredMode.REQUIRED)
private LocalDateTime endTime;
- @Schema(description = "关联的流程任务的编号-关联的流程任务,只有 UserTask 等类型才有", example = "2048")
- private String taskId;
+ @Schema(description = "关联的流程任务的编号", example = "2048")
+ private String taskId; // 关联的流程任务,只有 UserTask 等类型才有
}
diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/cc/BpmProcessInstanceCopyRespVO.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/cc/BpmProcessInstanceCopyRespVO.java
new file mode 100644
index 000000000..4b397fc1c
--- /dev/null
+++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/cc/BpmProcessInstanceCopyRespVO.java
@@ -0,0 +1,40 @@
+package cn.iocoder.yudao.module.bpm.controller.admin.task.vo.cc;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+
+import java.time.LocalDateTime;
+
+@Schema(description = "管理后台 - 流程实例抄送的分页 Item Response VO")
+@Data
+public class BpmProcessInstanceCopyRespVO {
+
+ @Schema(description = "抄送主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
+ private Long id;
+
+ @Schema(description = "发起人编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "888")
+ private Long startUserId;
+ @Schema(description = "发起人昵称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋道")
+ private String startUserName;
+
+ @Schema(description = "流程实例编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "A233")
+ private String processInstanceId;
+ @Schema(description = "流程实例的名称")
+ private String processInstanceName;
+ @Schema(description = "流程实例的发起时间")
+ private LocalDateTime processInstanceStartTime;
+
+ @Schema(description = "发起抄送的任务编号")
+ private String taskId;
+ @Schema(description = "发起抄送的任务名称")
+ private String taskName;
+
+ @Schema(description = "抄送人")
+ private String creator;
+ @Schema(description = "抄送人昵称")
+ private String creatorName;
+
+ @Schema(description = "抄送时间")
+ private LocalDateTime createTime;
+
+}
diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/instance/BpmProcessInstanceCopyCreateReqVO.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/instance/BpmProcessInstanceCopyCreateReqVO.java
deleted file mode 100644
index 359fa0065..000000000
--- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/instance/BpmProcessInstanceCopyCreateReqVO.java
+++ /dev/null
@@ -1,20 +0,0 @@
-package cn.iocoder.yudao.module.bpm.controller.admin.task.vo.instance;
-
-import io.swagger.v3.oas.annotations.media.Schema;
-import javax.validation.constraints.NotBlank;
-import javax.validation.constraints.NotEmpty;
-import lombok.Data;
-
-@Schema(description = "管理后台 - 流程实例抄送的创建 Request VO")
-@Data
-public class BpmProcessInstanceCopyCreateReqVO {
-
- @Schema(description = "任务编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
- @NotEmpty(message = "任务编号不能为空")
- private String taskId;
-
- @Schema(description = "抄送原因", requiredMode = Schema.RequiredMode.REQUIRED, example = "请帮忙审查下!")
- @NotBlank(message = "抄送原因不能为空")
- private String reason;
-
-}
diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/instance/BpmProcessInstanceCopyPageItemRespVO.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/instance/BpmProcessInstanceCopyPageItemRespVO.java
deleted file mode 100644
index 4b149a65e..000000000
--- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/instance/BpmProcessInstanceCopyPageItemRespVO.java
+++ /dev/null
@@ -1,45 +0,0 @@
-package cn.iocoder.yudao.module.bpm.controller.admin.task.vo.instance;
-
-import io.swagger.v3.oas.annotations.media.Schema;
-import lombok.Data;
-
-import java.time.LocalDateTime;
-
-@Schema(description = "管理后台 - 流程实例抄送的分页 Item Response VO")
-@Data
-public class BpmProcessInstanceCopyPageItemRespVO {
-
- @Schema(description = "抄送主键")
- private Long id;
-
- @Schema(description = "发起人 ID")
- private Long startUserId;
-
- @Schema(description = "发起人别名")
- private String startUserNickname;
-
- @Schema(description = "流程实例的主键")
- private String processInstanceId;
-
- @Schema(description = "流程实例的名称")
- private String processInstanceName;
-
- @Schema(description = "发起抄送的任务编号")
- private String taskId;
-
- @Schema(description = "发起抄送的任务名称")
- private String taskName;
-
- @Schema(description = "抄送原因")
- private String reason;
-
- @Schema(description = "抄送人")
- private String creator;
-
- @Schema(description = "抄送人别名")
- private String creatorNickname;
-
- @Schema(description = "抄送时间")
- private LocalDateTime createTime;
-
-}
diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/instance/BpmProcessInstanceCopyMyPageReqVO.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/instance/BpmProcessInstanceCopyPageReqVO.java
similarity index 72%
rename from yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/instance/BpmProcessInstanceCopyMyPageReqVO.java
rename to yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/instance/BpmProcessInstanceCopyPageReqVO.java
index 7b4effadd..b702afd2b 100644
--- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/instance/BpmProcessInstanceCopyMyPageReqVO.java
+++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/instance/BpmProcessInstanceCopyPageReqVO.java
@@ -3,8 +3,6 @@ package cn.iocoder.yudao.module.bpm.controller.admin.task.vo.instance;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
-import lombok.EqualsAndHashCode;
-import lombok.ToString;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
@@ -13,16 +11,11 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_
@Schema(description = "管理后台 - 流程实例抄送的分页 Request VO")
@Data
-@EqualsAndHashCode(callSuper = true)
-@ToString(callSuper = true)
-public class BpmProcessInstanceCopyMyPageReqVO extends PageParam {
+public class BpmProcessInstanceCopyPageReqVO extends PageParam {
@Schema(description = "流程名称", example = "芋道")
private String processInstanceName;
- @Schema(description = "流程编号", example = "123456768")
- private String processInstanceId;
-
@Schema(description = "创建时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createTime;
diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/instance/BpmProcessInstanceCreateReqVO.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/instance/BpmProcessInstanceCreateReqVO.java
index 93cf541bb..207daeeff 100644
--- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/instance/BpmProcessInstanceCreateReqVO.java
+++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/instance/BpmProcessInstanceCreateReqVO.java
@@ -15,11 +15,10 @@ public class BpmProcessInstanceCreateReqVO {
@NotEmpty(message = "流程定义编号不能为空")
private String processDefinitionId;
- @Schema(description = "变量实例")
+ @Schema(description = "变量实例(动态表单)")
private Map variables;
- // TODO @hai:assignees 复数
- @Schema(description = "提前指派的审批人", requiredMode = Schema.RequiredMode.REQUIRED, example = "{taskKey1: [1, 2]}")
- private Map> assignee;
+ @Schema(description = "发起人自选审批人 Map", example = "{taskKey1: [1, 2]}")
+ private Map> startUserSelectAssignees;
}
diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/instance/BpmProcessInstancePageItemRespVO.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/instance/BpmProcessInstancePageItemRespVO.java
deleted file mode 100644
index 6bb269f1d..000000000
--- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/instance/BpmProcessInstancePageItemRespVO.java
+++ /dev/null
@@ -1,54 +0,0 @@
-package cn.iocoder.yudao.module.bpm.controller.admin.task.vo.instance;
-
-import io.swagger.v3.oas.annotations.media.Schema;
-import lombok.Data;
-
-import java.time.LocalDateTime;
-import java.util.List;
-
-@Schema(description = "管理后台 - 流程实例的分页 Item Response VO")
-@Data
-public class BpmProcessInstancePageItemRespVO {
-
- @Schema(description = "流程实例的编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
- private String id;
-
- @Schema(description = "流程名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋道")
- private String name;
-
- @Schema(description = "流程定义的编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "2048")
- private String processDefinitionId;
-
- @Schema(description = "流程分类-参见 bpm_model_category 数据字典", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
- private String category;
-
- @Schema(description = "流程实例的状态-参见 bpm_process_instance_status", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
- private Integer status;
-
- @Schema(description = "流程实例的结果-参见 bpm_process_instance_result", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
- private Integer result;
-
- @Schema(description = "提交时间", requiredMode = Schema.RequiredMode.REQUIRED)
- private LocalDateTime createTime;
-
- @Schema(description = "结束时间", requiredMode = Schema.RequiredMode.REQUIRED)
- private LocalDateTime endTime;
-
- /**
- * 当前任务
- */
- private List tasks;
-
- @Schema(description = "流程任务")
- @Data
- public static class Task {
-
- @Schema(description = "流程任务的编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
- private String id;
-
- @Schema(description = "任务名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋道")
- private String name;
-
- }
-
-}
diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/instance/BpmProcessInstanceMyPageReqVO.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/instance/BpmProcessInstancePageReqVO.java
similarity index 57%
rename from yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/instance/BpmProcessInstanceMyPageReqVO.java
rename to yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/instance/BpmProcessInstancePageReqVO.java
index 5b5d9fb26..bc658eb87 100644
--- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/instance/BpmProcessInstanceMyPageReqVO.java
+++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/instance/BpmProcessInstancePageReqVO.java
@@ -1,21 +1,19 @@
package cn.iocoder.yudao.module.bpm.controller.admin.task.vo.instance;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
+import cn.iocoder.yudao.framework.common.validation.InEnum;
+import cn.iocoder.yudao.module.bpm.enums.task.BpmProcessInstanceStatusEnum;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
-import lombok.EqualsAndHashCode;
-import lombok.ToString;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
-@Schema(description = "管理后台 - 流程实例的分页 Item Response VO")
+@Schema(description = "管理后台 - 流程实例分页 Request VO")
@Data
-@EqualsAndHashCode(callSuper = true)
-@ToString(callSuper = true)
-public class BpmProcessInstanceMyPageReqVO extends PageParam {
+public class BpmProcessInstancePageReqVO extends PageParam {
@Schema(description = "流程名称", example = "芋道")
private String name;
@@ -23,17 +21,18 @@ public class BpmProcessInstanceMyPageReqVO extends PageParam {
@Schema(description = "流程定义的编号", example = "2048")
private String processDefinitionId;
- @Schema(description = "流程实例的状态-参见 bpm_process_instance_status", example = "1")
+ @Schema(description = "流程实例的状态", example = "1")
+ @InEnum(BpmProcessInstanceStatusEnum.class)
private Integer status;
- @Schema(description = "流程实例的结果-参见 bpm_process_instance_result", example = "2")
- private Integer result;
-
- @Schema(description = "流程分类-参见 bpm_model_category 数据字典", example = "1")
+ @Schema(description = "流程分类", example = "1")
private String category;
@Schema(description = "创建时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createTime;
+ @Schema(description = "发起用户编号", example = "1024")
+ private Long startUserId; // 注意,只有在【流程实例】菜单,才使用该参数
+
}
diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/instance/BpmProcessInstanceRespVO.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/instance/BpmProcessInstanceRespVO.java
index a9cc810f7..ac6b90c7e 100644
--- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/instance/BpmProcessInstanceRespVO.java
+++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/instance/BpmProcessInstanceRespVO.java
@@ -1,5 +1,6 @@
package cn.iocoder.yudao.module.bpm.controller.admin.task.vo.instance;
+import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.process.BpmProcessDefinitionRespVO;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
@@ -17,21 +18,23 @@ public class BpmProcessInstanceRespVO {
@Schema(description = "流程名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋道")
private String name;
- @Schema(description = "流程分类-参见 bpm_model_category 数据字典", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
+ @Schema(description = "流程分类", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
private String category;
+ @Schema(description = "流程分类名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "请假")
+ private String categoryName;
- @Schema(description = "流程实例的状态-参见 bpm_process_instance_status", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
- private Integer status;
+ @Schema(description = "流程实例的状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
+ private Integer status; // 参见 BpmProcessInstanceStatusEnum 枚举
- @Schema(description = "流程实例的结果-参见 bpm_process_instance_result", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
- private Integer result;
-
- @Schema(description = "提交时间", requiredMode = Schema.RequiredMode.REQUIRED)
- private LocalDateTime createTime;
+ @Schema(description = "发起时间", requiredMode = Schema.RequiredMode.REQUIRED)
+ private LocalDateTime startTime;
@Schema(description = "结束时间", requiredMode = Schema.RequiredMode.REQUIRED)
private LocalDateTime endTime;
+ @Schema(description = "持续时间", example = "1000")
+ private Long durationInMillis;
+
@Schema(description = "提交的表单值", requiredMode = Schema.RequiredMode.REQUIRED)
private Map formVariables;
@@ -43,10 +46,17 @@ public class BpmProcessInstanceRespVO {
*/
private User startUser;
+ @Schema(description = "流程定义的编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "2048")
+ private String processDefinitionId;
/**
* 流程定义
*/
- private ProcessDefinition processDefinition;
+ private BpmProcessDefinitionRespVO processDefinition;
+
+ /**
+ * 当前审批中的任务
+ */
+ private List tasks; // 仅在流程实例分页才返回
@Schema(description = "用户信息")
@Data
@@ -64,30 +74,15 @@ public class BpmProcessInstanceRespVO {
}
- @Schema(description = "流程定义信息")
+ @Schema(description = "流程任务")
@Data
- public static class ProcessDefinition {
+ public static class Task {
- @Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
+ @Schema(description = "流程任务的编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
private String id;
- @Schema(description = "表单类型-参见 bpm_model_form_type 数据字典", example = "1")
- private Integer formType;
- @Schema(description = "表单编号-在表单类型为 {@link BpmModelFormTypeEnum#CUSTOM} 时,必须非空", example = "1024")
- private Long formId;
- @Schema(description = "表单的配置-JSON 字符串。在表单类型为 {@link BpmModelFormTypeEnum#CUSTOM} 时,必须非空", requiredMode = Schema.RequiredMode.REQUIRED)
- private String formConf;
- @Schema(description = "表单项的数组-JSON 字符串的数组。在表单类型为 {@link BpmModelFormTypeEnum#CUSTOM} 时,必须非空", requiredMode = Schema.RequiredMode.REQUIRED)
- private List formFields;
- @Schema(description = "自定义表单的提交路径,使用 Vue 的路由地址-在表单类型为 {@link BpmModelFormTypeEnum#CUSTOM} 时,必须非空",
- example = "/bpm/oa/leave/create")
- private String formCustomCreatePath;
- @Schema(description = "自定义表单的查看路径,使用 Vue 的路由地址-在表单类型为 {@link BpmModelFormTypeEnum#CUSTOM} 时,必须非空",
- example = "/bpm/oa/leave/view")
- private String formCustomViewPath;
-
- @Schema(description = "BPMN XML", requiredMode = Schema.RequiredMode.REQUIRED)
- private String bpmnXml;
+ @Schema(description = "任务名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋道")
+ private String name;
}
diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/task/BpmTaskAddSignReqVO.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/task/BpmTaskAddSignReqVO.java
deleted file mode 100644
index cabb91be1..000000000
--- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/task/BpmTaskAddSignReqVO.java
+++ /dev/null
@@ -1,30 +0,0 @@
-package cn.iocoder.yudao.module.bpm.controller.admin.task.vo.task;
-
-import io.swagger.v3.oas.annotations.media.Schema;
-import lombok.Data;
-
-import javax.validation.constraints.NotEmpty;
-import java.util.Set;
-
-// TODO @海洋:类名,应该是 create 哈
-@Schema(description = "管理后台 - 加签流程任务的 Request VO")
-@Data
-public class BpmTaskAddSignReqVO {
-
- @Schema(description = "需要加签的任务 ID")
- @NotEmpty(message = "任务编号不能为空")
- private String id;
-
- @Schema(description = "加签的用户 ID")
- @NotEmpty(message = "加签用户 ID 不能为空")
- private Set userIdList;
-
- @Schema(description = "加签类型,before 向前加签,after 向后加签")
- @NotEmpty(message = "加签类型不能为空")
- private String type;
-
- @Schema(description = "加签原因")
- @NotEmpty(message = "加签原因不能为空")
- private String reason;
-
-}
diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/task/BpmTaskApproveReqVO.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/task/BpmTaskApproveReqVO.java
index a8420c590..0be06a6c8 100644
--- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/task/BpmTaskApproveReqVO.java
+++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/task/BpmTaskApproveReqVO.java
@@ -1,10 +1,11 @@
package cn.iocoder.yudao.module.bpm.controller.admin.task.vo.task;
-import cn.iocoder.yudao.module.bpm.controller.admin.candidate.vo.BpmTaskCandidateRuleVO;
import io.swagger.v3.oas.annotations.media.Schema;
+import jakarta.validation.constraints.NotEmpty;
import lombok.Data;
-import javax.validation.constraints.NotEmpty;
+import java.util.Collection;
+import java.util.Map;
@Schema(description = "管理后台 - 通过流程任务的 Request VO")
@Data
@@ -18,4 +19,10 @@ public class BpmTaskApproveReqVO {
@NotEmpty(message = "审批意见不能为空")
private String reason;
+ @Schema(description = "抄送的用户编号数组", requiredMode = Schema.RequiredMode.REQUIRED, example = "1,2")
+ private Collection copyUserIds;
+
+ @Schema(description = "变量实例(动态表单)", requiredMode = Schema.RequiredMode.REQUIRED)
+ private Map variables;
+
}
diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/task/BpmTaskDelegateReqVO.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/task/BpmTaskDelegateReqVO.java
index 96c42deb8..cd1fce441 100644
--- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/task/BpmTaskDelegateReqVO.java
+++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/task/BpmTaskDelegateReqVO.java
@@ -1,11 +1,10 @@
package cn.iocoder.yudao.module.bpm.controller.admin.task.vo.task;
import io.swagger.v3.oas.annotations.media.Schema;
+import jakarta.validation.constraints.NotEmpty;
+import jakarta.validation.constraints.NotNull;
import lombok.Data;
-import javax.validation.constraints.NotEmpty;
-import javax.validation.constraints.NotNull;
-
@Schema(description = "管理后台 - 委派流程任务的 Request VO")
@Data
public class BpmTaskDelegateReqVO {
diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/task/BpmTaskDonePageItemRespVO.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/task/BpmTaskDonePageItemRespVO.java
deleted file mode 100644
index 8f5144158..000000000
--- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/task/BpmTaskDonePageItemRespVO.java
+++ /dev/null
@@ -1,26 +0,0 @@
-package cn.iocoder.yudao.module.bpm.controller.admin.task.vo.task;
-
-import io.swagger.v3.oas.annotations.media.Schema;
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-import lombok.ToString;
-
-import java.time.LocalDateTime;
-
-@Schema(description = "管理后台 - 流程任务的 Done 已完成的分页项 Response VO")
-@Data
-@EqualsAndHashCode(callSuper = true)
-@ToString(callSuper = true)
-public class BpmTaskDonePageItemRespVO extends BpmTaskTodoPageItemRespVO {
-
- @Schema(description = "结束时间", requiredMode = Schema.RequiredMode.REQUIRED)
- private LocalDateTime endTime;
- @Schema(description = "持续时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "1000")
- private Long durationInMillis;
-
- @Schema(description = "任务结果-参见 bpm_process_instance_result", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
- private Integer result;
- @Schema(description = "审批建议", requiredMode = Schema.RequiredMode.REQUIRED, example = "不请假了!")
- private String reason;
-
-}
diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/task/BpmTaskDonePageReqVO.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/task/BpmTaskDonePageReqVO.java
deleted file mode 100644
index 52daea445..000000000
--- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/task/BpmTaskDonePageReqVO.java
+++ /dev/null
@@ -1,31 +0,0 @@
-package cn.iocoder.yudao.module.bpm.controller.admin.task.vo.task;
-
-import cn.iocoder.yudao.framework.common.pojo.PageParam;
-import io.swagger.v3.oas.annotations.media.Schema;
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-import lombok.ToString;
-import org.springframework.format.annotation.DateTimeFormat;
-
-import java.time.LocalDateTime;
-
-import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
-
-@Schema(description = "管理后台 - 流程任务的 Done 已办的分页 Request VO")
-@Data
-@EqualsAndHashCode(callSuper = true)
-@ToString(callSuper = true)
-public class BpmTaskDonePageReqVO extends PageParam {
-
- @Schema(description = "流程任务名", example = "芋道")
- private String name;
-
- @Schema(description = "开始的创建收间")
- @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
- private LocalDateTime beginCreateTime;
-
- @Schema(description = "结束的创建时间")
- @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
- private LocalDateTime endCreateTime;
-
-}
diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/task/BpmTaskTodoPageReqVO.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/task/BpmTaskPageReqVO.java
similarity index 67%
rename from yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/task/BpmTaskTodoPageReqVO.java
rename to yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/task/BpmTaskPageReqVO.java
index 605007ef5..d90eb632a 100644
--- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/task/BpmTaskTodoPageReqVO.java
+++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/task/BpmTaskPageReqVO.java
@@ -10,13 +10,9 @@ import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
-import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
-
-@Schema(description = "管理后台 - 流程任务的 TODO 待办的分页 Request VO")
+@Schema(description = "管理后台 - 流程任务的的分页 Request VO") // 待办、已办,都使用该分页
@Data
-@EqualsAndHashCode(callSuper = true)
-@ToString(callSuper = true)
-public class BpmTaskTodoPageReqVO extends PageParam {
+public class BpmTaskPageReqVO extends PageParam {
@Schema(description = "流程任务名", example = "芋道")
private String name;
diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/task/BpmTaskRespVO.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/task/BpmTaskRespVO.java
index 1af839e26..7f5177b94 100644
--- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/task/BpmTaskRespVO.java
+++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/task/BpmTaskRespVO.java
@@ -1,47 +1,94 @@
package cn.iocoder.yudao.module.bpm.controller.admin.task.vo.task;
+import cn.iocoder.yudao.module.bpm.controller.admin.task.vo.instance.BpmProcessInstanceRespVO;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
-import lombok.EqualsAndHashCode;
-import lombok.ToString;
+import java.time.LocalDateTime;
import java.util.List;
+import java.util.Map;
-@Schema(description = "管理后台 - 流程任务的 Response VO")
+@Schema(description = "管理后台 - 流程任务 Response VO")
@Data
-@EqualsAndHashCode(callSuper = true)
-@ToString(callSuper = true)
-public class BpmTaskRespVO extends BpmTaskDonePageItemRespVO {
+public class BpmTaskRespVO {
- @Schema(description = "任务定义的标识", requiredMode = Schema.RequiredMode.REQUIRED, example = "user-001")
- private String definitionKey;
+ @Schema(description = "任务编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
+ private String id;
+ @Schema(description = "任务名字", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋道")
+ private String name;
+
+ @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
+ private LocalDateTime createTime;
+
+ @Schema(description = "结束时间", requiredMode = Schema.RequiredMode.REQUIRED)
+ private LocalDateTime endTime;
+
+ @Schema(description = "持续时间", example = "1000")
+ private Long durationInMillis;
+
+ @Schema(description = "任务状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
+ private Integer status; // 参见 BpmTaskStatusEnum 枚举
+
+ @Schema(description = "审批理由", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
+ private String reason;
+
+ /**
+ * 负责人的用户信息
+ */
+ private BpmProcessInstanceRespVO.User ownerUser;
/**
* 审核的用户信息
*/
- private User assigneeUser;
+ private BpmProcessInstanceRespVO.User assigneeUser;
+ @Schema(description = "任务定义的标识", requiredMode = Schema.RequiredMode.REQUIRED, example = "Activity_one")
+ private String taskDefinitionKey;
+
+ @Schema(description = "所属流程实例编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "8888")
+ private String processInstanceId;
/**
- * 父任务ID
+ * 所属流程实例
*/
- private String parentTaskId;
+ private ProcessInstance processInstance;
- @Schema(description = "子任务(由加签生成)", requiredMode = Schema.RequiredMode.REQUIRED, example = "childrenTask")
+ @Schema(description = "父任务编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
+ private String parentTaskId;
+ @Schema(description = "子任务列表(由加签生成)", requiredMode = Schema.RequiredMode.REQUIRED, example = "childrenTask")
private List children;
- @Schema(description = "用户信息")
+ @Schema(description = "表单编号", example = "1024")
+ private Long formId;
+ @Schema(description = "表单名字", example = "请假表单")
+ private String formName;
+ @Schema(description = "表单的配置-JSON 字符串")
+ private String formConf;
+ @Schema(description = "表单项的数组")
+ private List formFields;
+ @Schema(description = "提交的表单值", requiredMode = Schema.RequiredMode.REQUIRED)
+ private Map formVariables;
+
@Data
- public static class User {
+ @Schema(description = "流程实例")
+ public static class ProcessInstance {
- @Schema(description = "用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
- private Long id;
- @Schema(description = "用户昵称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
- private String nickname;
+ @Schema(description = "流程实例编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
+ private String id;
- @Schema(description = "部门编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
- private Long deptId;
- @Schema(description = "部门名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "研发部")
- private String deptName;
+ @Schema(description = "流程实例名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋道")
+ private String name;
+
+ @Schema(description = "提交时间", requiredMode = Schema.RequiredMode.REQUIRED)
+ private LocalDateTime createTime;
+
+ @Schema(description = "流程定义的编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "2048")
+ private String processDefinitionId;
+
+ /**
+ * 发起人的用户信息
+ */
+ private BpmProcessInstanceRespVO.User startUser;
}
+
}
diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/task/BpmTaskReturnReqVO.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/task/BpmTaskReturnReqVO.java
index 983f35cd2..49a2316ca 100644
--- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/task/BpmTaskReturnReqVO.java
+++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/task/BpmTaskReturnReqVO.java
@@ -15,7 +15,7 @@ public class BpmTaskReturnReqVO {
@Schema(description = "回退到的任务 Key", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
@NotEmpty(message = "回退到的任务 Key 不能为空")
- private String targetDefinitionKey;
+ private String targetTaskDefinitionKey;
@Schema(description = "回退意见", requiredMode = Schema.RequiredMode.REQUIRED, example = "我就是想驳回")
@NotEmpty(message = "回退意见不能为空")
diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/task/BpmTaskSignCreateReqVO.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/task/BpmTaskSignCreateReqVO.java
new file mode 100644
index 000000000..71278b37f
--- /dev/null
+++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/task/BpmTaskSignCreateReqVO.java
@@ -0,0 +1,29 @@
+package cn.iocoder.yudao.module.bpm.controller.admin.task.vo.task;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+
+import jakarta.validation.constraints.NotEmpty;
+import java.util.Set;
+
+@Schema(description = "管理后台 - 加签任务的创建(加签) Request VO")
+@Data
+public class BpmTaskSignCreateReqVO {
+
+ @Schema(description = "需要加签的任务编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
+ @NotEmpty(message = "任务编号不能为空")
+ private String id;
+
+ @Schema(description = "加签的用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "888")
+ @NotEmpty(message = "加签用户不能为空")
+ private Set userIds;
+
+ @Schema(description = "加签类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "before")
+ @NotEmpty(message = "加签类型不能为空")
+ private String type; // 参见 BpmTaskSignTypeEnum 枚举
+
+ @Schema(description = "加签原因", requiredMode = Schema.RequiredMode.REQUIRED, example = "需要加签")
+ @NotEmpty(message = "加签原因不能为空")
+ private String reason;
+
+}
diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/task/BpmTaskSubSignReqVO.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/task/BpmTaskSignDeleteReqVO.java
similarity index 50%
rename from yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/task/BpmTaskSubSignReqVO.java
rename to yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/task/BpmTaskSignDeleteReqVO.java
index 731e4804a..721968cc6 100644
--- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/task/BpmTaskSubSignReqVO.java
+++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/task/BpmTaskSignDeleteReqVO.java
@@ -5,16 +5,16 @@ import lombok.Data;
import javax.validation.constraints.NotEmpty;
-// TODO @海洋:类名,应该是 delete 哈
-@Schema(description = "管理后台 - 减签流程任务的 Request VO")
+@Schema(description = "管理后台 - 加签任务的删除(减签) Request VO")
@Data
-public class BpmTaskSubSignReqVO {
+public class BpmTaskSignDeleteReqVO {
- @Schema(description = "被减签的任务 ID")
+ @Schema(description = "被减签的任务编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
@NotEmpty(message = "任务编号不能为空")
private String id;
- @Schema(description = "加签原因")
+ @Schema(description = "加签原因", requiredMode = Schema.RequiredMode.REQUIRED, example = "需要减签")
@NotEmpty(message = "加签原因不能为空")
private String reason;
+
}
diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/task/BpmTaskSimpleRespVO.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/task/BpmTaskSimpleRespVO.java
deleted file mode 100644
index b98a25a22..000000000
--- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/task/BpmTaskSimpleRespVO.java
+++ /dev/null
@@ -1,16 +0,0 @@
-package cn.iocoder.yudao.module.bpm.controller.admin.task.vo.task;
-
-import io.swagger.v3.oas.annotations.media.Schema;
-import lombok.Data;
-
-@Schema(description = "管理后台 - 流程任务的精简 Response VO")
-@Data
-public class BpmTaskSimpleRespVO {
-
- @Schema(description = "任务定义的标识", requiredMode = Schema.RequiredMode.REQUIRED, example = "Activity_one")
- private String definitionKey;
-
- @Schema(description = "任务名词", requiredMode = Schema.RequiredMode.REQUIRED, example = "经理审批")
- private String name;
-
-}
diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/task/BpmTaskSubSignRespVO.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/task/BpmTaskSubSignRespVO.java
deleted file mode 100644
index efecbf582..000000000
--- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/task/BpmTaskSubSignRespVO.java
+++ /dev/null
@@ -1,15 +0,0 @@
-package cn.iocoder.yudao.module.bpm.controller.admin.task.vo.task;
-
-import io.swagger.v3.oas.annotations.media.Schema;
-import lombok.Data;
-
-@Schema(description = "管理后台 - 减签流程任务的 Response VO")
-@Data
-public class BpmTaskSubSignRespVO {
- @Schema(description = "审核的用户信息", requiredMode = Schema.RequiredMode.REQUIRED, example = "小李")
- private BpmTaskRespVO.User assigneeUser;
- @Schema(description = "任务 ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "12312")
- private String id;
- @Schema(description = "任务名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "经理审批")
- private String name;
-}
diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/task/BpmTaskTodoPageItemRespVO.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/task/BpmTaskTodoPageItemRespVO.java
deleted file mode 100644
index 4b57f4777..000000000
--- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/task/BpmTaskTodoPageItemRespVO.java
+++ /dev/null
@@ -1,53 +0,0 @@
-package cn.iocoder.yudao.module.bpm.controller.admin.task.vo.task;
-
-import io.swagger.v3.oas.annotations.media.Schema;
-import lombok.Data;
-
-import java.time.LocalDateTime;
-
-@Schema(description = "管理后台 - 流程任务的 Running 进行中的分页项 Response VO")
-@Data
-public class BpmTaskTodoPageItemRespVO {
-
- @Schema(description = "任务编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
- private String id;
-
- @Schema(description = "任务名字", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋道")
- private String name;
-
- @Schema(description = "接收时间", requiredMode = Schema.RequiredMode.REQUIRED)
- private LocalDateTime claimTime;
-
- @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
- private LocalDateTime createTime;
-
- @Schema(description = "激活状态-参见 SuspensionState 枚举", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
- private Integer suspensionState;
-
- /**
- * 所属流程实例
- */
- private ProcessInstance processInstance;
-
- @Data
- @Schema(description = "流程实例")
- public static class ProcessInstance {
-
- @Schema(description = "流程实例编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
- private String id;
-
- @Schema(description = "流程实例名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋道")
- private String name;
-
- @Schema(description = "发起人的用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
- private Long startUserId;
-
- @Schema(description = "发起人的用户昵称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
- private String startUserNickname;
-
- @Schema(description = "流程定义的编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "2048")
- private String processDefinitionId;
-
- }
-
-}
diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/task/BpmTaskUpdateAssigneeReqVO.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/task/BpmTaskTransferReqVO.java
similarity index 65%
rename from yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/task/BpmTaskUpdateAssigneeReqVO.java
rename to yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/task/BpmTaskTransferReqVO.java
index dfc5fbb93..79f0af456 100644
--- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/task/BpmTaskUpdateAssigneeReqVO.java
+++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/task/vo/task/BpmTaskTransferReqVO.java
@@ -6,9 +6,9 @@ import lombok.Data;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
-@Schema(description = "管理后台 - 流程任务的更新负责人的 Request VO")
+@Schema(description = "管理后台 - 流程任务的转办 Request VO")
@Data
-public class BpmTaskUpdateAssigneeReqVO {
+public class BpmTaskTransferReqVO {
@Schema(description = "任务编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
@NotEmpty(message = "任务编号不能为空")
@@ -18,4 +18,8 @@ public class BpmTaskUpdateAssigneeReqVO {
@NotNull(message = "新审批人的用户编号不能为空")
private Long assigneeUserId;
+ @Schema(description = "转办原因", requiredMode = Schema.RequiredMode.REQUIRED, example = "做不了决定,需要你先帮忙瞅瞅")
+ @NotEmpty(message = "转办原因不能为空")
+ private String reason;
+
}
diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/convert/cc/BpmProcessInstanceCopyConvert.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/convert/cc/BpmProcessInstanceCopyConvert.java
deleted file mode 100644
index f482c71e6..000000000
--- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/convert/cc/BpmProcessInstanceCopyConvert.java
+++ /dev/null
@@ -1,40 +0,0 @@
-package cn.iocoder.yudao.module.bpm.convert.cc;
-
-import cn.iocoder.yudao.framework.common.pojo.PageResult;
-import cn.iocoder.yudao.framework.common.util.collection.MapUtils;
-import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
-import cn.iocoder.yudao.module.bpm.controller.admin.task.vo.instance.BpmProcessInstanceCopyPageItemRespVO;
-import cn.iocoder.yudao.module.bpm.dal.dataobject.cc.BpmProcessInstanceCopyDO;
-import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO;
-import org.mapstruct.Mapper;
-import org.mapstruct.factory.Mappers;
-
-import java.util.List;
-import java.util.Map;
-
-/**
- * 流程抄送 Convert
- *
- * @author 芋艿
- */
-@Mapper
-public interface BpmProcessInstanceCopyConvert {
-
- BpmProcessInstanceCopyConvert INSTANCE = Mappers.getMapper(BpmProcessInstanceCopyConvert.class);
-
- default PageResult convertPage(PageResult page,
- Map taskNameMap,
- Map processInstaneNameMap,
- Map userMap) {
- List list = BeanUtils.toBean(page.getList(),
- BpmProcessInstanceCopyPageItemRespVO.class,
- copy -> {
- MapUtils.findAndThen(userMap, Long.valueOf(copy.getCreator()), user -> user.setNickname(user.getNickname()));
- MapUtils.findAndThen(userMap, copy.getStartUserId(), user -> copy.setStartUserNickname(user.getNickname()));
- MapUtils.findAndThen(taskNameMap, copy.getTaskId(), copy::setTaskName);
- MapUtils.findAndThen(processInstaneNameMap, copy.getProcessInstanceId(), copy::setProcessInstanceName);
- });
- return new PageResult<>(list, page.getTotal());
- }
-
-}
diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/convert/definition/BpmFormConvert.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/convert/definition/BpmFormConvert.java
deleted file mode 100644
index 6ba757417..000000000
--- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/convert/definition/BpmFormConvert.java
+++ /dev/null
@@ -1,34 +0,0 @@
-package cn.iocoder.yudao.module.bpm.convert.definition;
-
-import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.form.BpmFormCreateReqVO;
-import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.form.BpmFormRespVO;
-import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.form.BpmFormSimpleRespVO;
-import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.form.BpmFormUpdateReqVO;
-import cn.iocoder.yudao.module.bpm.dal.dataobject.definition.BpmFormDO;
-import cn.iocoder.yudao.framework.common.pojo.PageResult;
-import org.mapstruct.Mapper;
-import org.mapstruct.factory.Mappers;
-
-import java.util.List;
-
-/**
- * 动态表单 Convert
- *
- * @author 芋艿
- */
-@Mapper
-public interface BpmFormConvert {
-
- BpmFormConvert INSTANCE = Mappers.getMapper(BpmFormConvert.class);
-
- BpmFormDO convert(BpmFormCreateReqVO bean);
-
- BpmFormDO convert(BpmFormUpdateReqVO bean);
-
- BpmFormRespVO convert(BpmFormDO bean);
-
- List convertList2(List list);
-
- PageResult convertPage(PageResult page);
-
-}
diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/convert/definition/BpmModelConvert.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/convert/definition/BpmModelConvert.java
index 9f79032f6..3fe5cc068 100644
--- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/convert/definition/BpmModelConvert.java
+++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/convert/definition/BpmModelConvert.java
@@ -1,19 +1,24 @@
package cn.iocoder.yudao.module.bpm.convert.definition;
+import cn.hutool.core.util.ArrayUtil;
import cn.hutool.core.util.StrUtil;
+import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils;
import cn.iocoder.yudao.framework.common.util.date.DateUtils;
import cn.iocoder.yudao.framework.common.util.json.JsonUtils;
-import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.model.*;
+import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
+import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.model.BpmModelCreateReqVO;
+import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.model.BpmModelRespVO;
+import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.model.BpmModelUpdateReqVO;
+import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.process.BpmProcessDefinitionRespVO;
+import cn.iocoder.yudao.module.bpm.dal.dataobject.definition.BpmCategoryDO;
import cn.iocoder.yudao.module.bpm.dal.dataobject.definition.BpmFormDO;
import cn.iocoder.yudao.module.bpm.service.definition.dto.BpmModelMetaInfoRespDTO;
-import cn.iocoder.yudao.module.bpm.service.definition.dto.BpmProcessDefinitionCreateReqDTO;
import org.flowable.common.engine.impl.db.SuspensionState;
import org.flowable.engine.repository.Deployment;
import org.flowable.engine.repository.Model;
import org.flowable.engine.repository.ProcessDefinition;
import org.mapstruct.Mapper;
-import org.mapstruct.MappingTarget;
import org.mapstruct.factory.Mappers;
import java.util.List;
@@ -30,103 +35,89 @@ public interface BpmModelConvert {
BpmModelConvert INSTANCE = Mappers.getMapper(BpmModelConvert.class);
- default List convertList(List list, Map formMap,
- Map deploymentMap,
- Map processDefinitionMap) {
- return CollectionUtils.convertList(list, model -> {
- BpmModelMetaInfoRespDTO metaInfo = JsonUtils.parseObject(model.getMetaInfo(), BpmModelMetaInfoRespDTO.class);
+ default PageResult buildModelPage(PageResult pageResult,
+ Map formMap,
+ Map categoryMap, Map deploymentMap,
+ Map processDefinitionMap) {
+ List list = CollectionUtils.convertList(pageResult.getList(), model -> {
+ BpmModelMetaInfoRespDTO metaInfo = buildMetaInfo(model);
BpmFormDO form = metaInfo != null ? formMap.get(metaInfo.getFormId()) : null;
+ BpmCategoryDO category = categoryMap.get(model.getCategory());
Deployment deployment = model.getDeploymentId() != null ? deploymentMap.get(model.getDeploymentId()) : null;
ProcessDefinition processDefinition = model.getDeploymentId() != null ? processDefinitionMap.get(model.getDeploymentId()) : null;
- return convert(model, form, deployment, processDefinition);
+ return buildModel0(model, metaInfo, form, category, deployment, processDefinition);
});
+ return new PageResult<>(list, pageResult.getTotal());
}
- default BpmModelPageItemRespVO convert(Model model, BpmFormDO form, Deployment deployment, ProcessDefinition processDefinition) {
- BpmModelPageItemRespVO modelRespVO = new BpmModelPageItemRespVO();
- modelRespVO.setId(model.getId());
- modelRespVO.setCreateTime(DateUtils.of(model.getCreateTime()));
- // 通用 copy
- copyTo(model, modelRespVO);
+ default BpmModelRespVO buildModel(Model model,
+ byte[] bpmnBytes) {
+ BpmModelMetaInfoRespDTO metaInfo = buildMetaInfo(model);
+ BpmModelRespVO modelVO = buildModel0(model, metaInfo, null, null, null, null);
+ if (ArrayUtil.isNotEmpty(bpmnBytes)) {
+ modelVO.setBpmnXml(new String(bpmnBytes));
+ }
+ return modelVO;
+ }
+
+ default BpmModelRespVO buildModel0(Model model,
+ BpmModelMetaInfoRespDTO metaInfo, BpmFormDO form, BpmCategoryDO category,
+ Deployment deployment, ProcessDefinition processDefinition) {
+ BpmModelRespVO modelRespVO = new BpmModelRespVO().setId(model.getId()).setName(model.getName())
+ .setKey(model.getKey()).setCategory(model.getCategory())
+ .setCreateTime(DateUtils.of(model.getCreateTime()));
// Form
+ if (metaInfo != null) {
+ modelRespVO.setFormType(metaInfo.getFormType()).setFormId(metaInfo.getFormId())
+ .setFormCustomCreatePath(metaInfo.getFormCustomCreatePath())
+ .setFormCustomViewPath(metaInfo.getFormCustomViewPath());
+ modelRespVO.setIcon(metaInfo.getIcon()).setDescription(metaInfo.getDescription());
+ }
if (form != null) {
- modelRespVO.setFormId(form.getId());
- modelRespVO.setFormName(form.getName());
+ modelRespVO.setFormId(form.getId()).setFormName(form.getName());
+ }
+ // Category
+ if (category != null) {
+ modelRespVO.setCategoryName(category.getName());
}
// ProcessDefinition
- modelRespVO.setProcessDefinition(this.convert(processDefinition));
- if (modelRespVO.getProcessDefinition() != null) {
+ if (processDefinition != null) {
+ modelRespVO.setProcessDefinition(BeanUtils.toBean(processDefinition, BpmProcessDefinitionRespVO.class));
modelRespVO.getProcessDefinition().setSuspensionState(processDefinition.isSuspended() ?
SuspensionState.SUSPENDED.getStateCode() : SuspensionState.ACTIVE.getStateCode());
- modelRespVO.getProcessDefinition().setDeploymentTime(DateUtils.of(deployment.getDeploymentTime()));
+ if (deployment != null) {
+ modelRespVO.getProcessDefinition().setDeploymentTime(DateUtils.of(deployment.getDeploymentTime()));
+ }
}
return modelRespVO;
}
- default BpmModelRespVO convert(Model model) {
- BpmModelRespVO modelRespVO = new BpmModelRespVO();
- modelRespVO.setId(model.getId());
- modelRespVO.setCreateTime(DateUtils.of(model.getCreateTime()));
- // 通用 copy
- copyTo(model, modelRespVO);
- return modelRespVO;
- }
-
- default void copyTo(Model model, BpmModelBaseVO to) {
- to.setName(model.getName());
- to.setKey(model.getKey());
- to.setCategory(model.getCategory());
- // metaInfo
- BpmModelMetaInfoRespDTO metaInfo = JsonUtils.parseObject(model.getMetaInfo(), BpmModelMetaInfoRespDTO.class);
- copyTo(metaInfo, to);
- }
-
- BpmModelCreateReqVO convert(BpmModeImportReqVO bean);
-
- default BpmProcessDefinitionCreateReqDTO convert2(Model model, BpmFormDO form) {
- BpmProcessDefinitionCreateReqDTO createReqDTO = new BpmProcessDefinitionCreateReqDTO();
- createReqDTO.setModelId(model.getId());
- createReqDTO.setName(model.getName());
- createReqDTO.setKey(model.getKey());
- createReqDTO.setCategory(model.getCategory());
- BpmModelMetaInfoRespDTO metaInfo = JsonUtils.parseObject(model.getMetaInfo(), BpmModelMetaInfoRespDTO.class);
- // metaInfo
- copyTo(metaInfo, createReqDTO);
- // form
- if (form != null) {
- createReqDTO.setFormConf(form.getConf());
- createReqDTO.setFormFields(form.getFields());
- }
- return createReqDTO;
- }
-
- void copyTo(BpmModelMetaInfoRespDTO from, @MappingTarget BpmProcessDefinitionCreateReqDTO to);
-
- void copyTo(BpmModelMetaInfoRespDTO from, @MappingTarget BpmModelBaseVO to);
-
- BpmModelPageItemRespVO.ProcessDefinition convert(ProcessDefinition bean);
-
- default void copy(Model model, BpmModelCreateReqVO bean) {
+ default void copyToCreateModel(Model model, BpmModelCreateReqVO bean) {
model.setName(bean.getName());
model.setKey(bean.getKey());
- model.setMetaInfo(buildMetaInfoStr(null, bean.getDescription(), null, null,
- null, null));
+ model.setMetaInfo(buildMetaInfoStr(null,
+ null, bean.getDescription(),
+ null, null, null, null));
}
- default void copy(Model model, BpmModelUpdateReqVO bean) {
+ default void copyToUpdateModel(Model model, BpmModelUpdateReqVO bean) {
model.setName(bean.getName());
model.setCategory(bean.getCategory());
- model.setMetaInfo(buildMetaInfoStr(JsonUtils.parseObject(model.getMetaInfo(), BpmModelMetaInfoRespDTO.class),
- bean.getDescription(), bean.getFormType(), bean.getFormId(),
- bean.getFormCustomCreatePath(), bean.getFormCustomViewPath()));
+ model.setMetaInfo(buildMetaInfoStr(buildMetaInfo(model),
+ bean.getIcon(), bean.getDescription(),
+ bean.getFormType(), bean.getFormId(), bean.getFormCustomCreatePath(), bean.getFormCustomViewPath()));
}
- default String buildMetaInfoStr(BpmModelMetaInfoRespDTO metaInfo, String description, Integer formType,
- Long formId, String formCustomCreatePath, String formCustomViewPath) {
+ default String buildMetaInfoStr(BpmModelMetaInfoRespDTO metaInfo,
+ String icon, String description,
+ Integer formType, Long formId, String formCustomCreatePath, String formCustomViewPath) {
if (metaInfo == null) {
metaInfo = new BpmModelMetaInfoRespDTO();
}
// 只有非空,才进行设置,避免更新时的覆盖
+ if (StrUtil.isNotEmpty(icon)) {
+ metaInfo.setIcon(icon);
+ }
if (StrUtil.isNotEmpty(description)) {
metaInfo.setDescription(description);
}
@@ -138,4 +129,9 @@ public interface BpmModelConvert {
}
return JsonUtils.toJsonString(metaInfo);
}
+
+ default BpmModelMetaInfoRespDTO buildMetaInfo(Model model) {
+ return JsonUtils.parseObject(model.getMetaInfo(), BpmModelMetaInfoRespDTO.class);
+ }
+
}
diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/convert/definition/BpmProcessDefinitionConvert.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/convert/definition/BpmProcessDefinitionConvert.java
index b52b48ee9..0e767d787 100644
--- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/convert/definition/BpmProcessDefinitionConvert.java
+++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/convert/definition/BpmProcessDefinitionConvert.java
@@ -1,20 +1,23 @@
package cn.iocoder.yudao.module.bpm.convert.definition;
import cn.hutool.core.date.LocalDateTimeUtil;
+import cn.hutool.core.map.MapUtil;
+import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils;
-import cn.iocoder.yudao.framework.common.util.date.DateUtils;
-import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.process.BpmProcessDefinitionPageItemRespVO;
+import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.process.BpmProcessDefinitionRespVO;
+import cn.iocoder.yudao.module.bpm.dal.dataobject.definition.BpmCategoryDO;
import cn.iocoder.yudao.module.bpm.dal.dataobject.definition.BpmFormDO;
-import cn.iocoder.yudao.module.bpm.dal.dataobject.definition.BpmProcessDefinitionExtDO;
-import cn.iocoder.yudao.module.bpm.service.definition.dto.BpmProcessDefinitionCreateReqDTO;
+import cn.iocoder.yudao.module.bpm.dal.dataobject.definition.BpmProcessDefinitionInfoDO;
+import cn.iocoder.yudao.module.bpm.framework.flowable.core.util.BpmnModelUtils;
+import org.flowable.bpmn.model.BpmnModel;
+import org.flowable.bpmn.model.UserTask;
import org.flowable.common.engine.impl.db.SuspensionState;
import org.flowable.engine.repository.Deployment;
import org.flowable.engine.repository.ProcessDefinition;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.MappingTarget;
-import org.mapstruct.Named;
import org.mapstruct.factory.Mappers;
import java.util.List;
@@ -30,55 +33,66 @@ public interface BpmProcessDefinitionConvert {
BpmProcessDefinitionConvert INSTANCE = Mappers.getMapper(BpmProcessDefinitionConvert.class);
- BpmProcessDefinitionPageItemRespVO convert(ProcessDefinition bean);
+ default PageResult buildProcessDefinitionPage(PageResult page,
+ Map deploymentMap,
+ Map processDefinitionInfoMap,
+ Map formMap,
+ Map categoryMap) {
+ List list = buildProcessDefinitionList(page.getList(), deploymentMap, processDefinitionInfoMap, formMap, categoryMap);
+ return new PageResult<>(list, page.getTotal());
+ }
- BpmProcessDefinitionExtDO convert2(BpmProcessDefinitionCreateReqDTO bean);
-
- default List convertList(List list, Map deploymentMap,
- Map processDefinitionDOMap, Map formMap) {
+ default List buildProcessDefinitionList(List list,
+ Map deploymentMap,
+ Map processDefinitionInfoMap,
+ Map formMap,
+ Map categoryMap) {
return CollectionUtils.convertList(list, definition -> {
- Deployment deployment = definition.getDeploymentId() != null ? deploymentMap.get(definition.getDeploymentId()) : null;
- BpmProcessDefinitionExtDO definitionDO = processDefinitionDOMap.get(definition.getId());
- BpmFormDO form = definitionDO != null ? formMap.get(definitionDO.getFormId()) : null;
- return convert(definition, deployment, definitionDO, form);
+ Deployment deployment = MapUtil.get(deploymentMap, definition.getDeploymentId(), Deployment.class);
+ BpmProcessDefinitionInfoDO processDefinitionInfo = MapUtil.get(processDefinitionInfoMap, definition.getId(), BpmProcessDefinitionInfoDO.class);
+ BpmFormDO form = null;
+ if (processDefinitionInfo != null) {
+ form = MapUtil.get(formMap, processDefinitionInfo.getFormId(), BpmFormDO.class);
+ }
+ BpmCategoryDO category = MapUtil.get(categoryMap, definition.getCategory(), BpmCategoryDO.class);
+ return buildProcessDefinition(definition, deployment, processDefinitionInfo, form, category, null, null);
});
}
- default List convertList3(List list,
- Map processDefinitionDOMap) {
- return CollectionUtils.convertList(list, processDefinition -> {
- BpmProcessDefinitionRespVO respVO = convert3(processDefinition);
- BpmProcessDefinitionExtDO processDefinitionExtDO = processDefinitionDOMap.get(processDefinition.getId());
- // 复制通用属性
- copyTo(processDefinitionExtDO, respVO);
- return respVO;
- });
- }
-
- @Mapping(source = "suspended", target = "suspensionState", qualifiedByName = "convertSuspendedToSuspensionState")
- BpmProcessDefinitionRespVO convert3(ProcessDefinition bean);
-
- @Named("convertSuspendedToSuspensionState")
- default Integer convertSuspendedToSuspensionState(boolean suspended) {
- return suspended ? SuspensionState.SUSPENDED.getStateCode() :
- SuspensionState.ACTIVE.getStateCode();
- }
-
- default BpmProcessDefinitionPageItemRespVO convert(ProcessDefinition bean, Deployment deployment,
- BpmProcessDefinitionExtDO processDefinitionExtDO, BpmFormDO form) {
- BpmProcessDefinitionPageItemRespVO respVO = convert(bean);
- respVO.setSuspensionState(bean.isSuspended() ? SuspensionState.SUSPENDED.getStateCode() : SuspensionState.ACTIVE.getStateCode());
+ default BpmProcessDefinitionRespVO buildProcessDefinition(ProcessDefinition definition,
+ Deployment deployment,
+ BpmProcessDefinitionInfoDO processDefinitionInfo,
+ BpmFormDO form,
+ BpmCategoryDO category,
+ BpmnModel bpmnModel,
+ List startUserSelectUserTaskList) {
+ BpmProcessDefinitionRespVO respVO = BeanUtils.toBean(definition, BpmProcessDefinitionRespVO.class);
+ respVO.setSuspensionState(definition.isSuspended() ? SuspensionState.SUSPENDED.getStateCode() : SuspensionState.ACTIVE.getStateCode());
+ // Deployment
if (deployment != null) {
respVO.setDeploymentTime(LocalDateTimeUtil.of(deployment.getDeploymentTime()));
}
- if (form != null) {
- respVO.setFormName(form.getName());
+ // BpmProcessDefinitionInfoDO
+ if (processDefinitionInfo != null) {
+ copyTo(processDefinitionInfo, respVO);
+ // Form
+ if (form != null) {
+ respVO.setFormName(form.getName());
+ }
+ }
+ // Category
+ if (category != null) {
+ respVO.setCategoryName(category.getName());
+ }
+ // BpmnModel
+ if (bpmnModel != null) {
+ respVO.setBpmnXml(BpmnModelUtils.getBpmnXml(bpmnModel));
+ respVO.setStartUserSelectTasks(BeanUtils.toBean(startUserSelectUserTaskList, BpmProcessDefinitionRespVO.UserTask.class));
}
- // 复制通用属性
- copyTo(processDefinitionExtDO, respVO);
return respVO;
}
@Mapping(source = "from.id", target = "to.id", ignore = true)
- void copyTo(BpmProcessDefinitionExtDO from, @MappingTarget BpmProcessDefinitionRespVO to);
+ void copyTo(BpmProcessDefinitionInfoDO from, @MappingTarget BpmProcessDefinitionRespVO to);
+
}
diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/convert/definition/BpmTaskAssignRuleConvert.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/convert/definition/BpmTaskAssignRuleConvert.java
deleted file mode 100644
index c616e90b0..000000000
--- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/convert/definition/BpmTaskAssignRuleConvert.java
+++ /dev/null
@@ -1,40 +0,0 @@
-package cn.iocoder.yudao.module.bpm.convert.definition;
-
-import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils;
-import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.rule.BpmTaskAssignRuleCreateReqVO;
-import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.rule.BpmTaskAssignRuleRespVO;
-import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.rule.BpmTaskAssignRuleUpdateReqVO;
-import cn.iocoder.yudao.module.bpm.dal.dataobject.definition.BpmTaskAssignRuleDO;
-import org.flowable.bpmn.model.UserTask;
-import org.mapstruct.Mapper;
-import org.mapstruct.factory.Mappers;
-
-import java.util.List;
-import java.util.Map;
-
-@Mapper
-public interface BpmTaskAssignRuleConvert {
- BpmTaskAssignRuleConvert INSTANCE = Mappers.getMapper(BpmTaskAssignRuleConvert.class);
-
- default List convertList(List tasks, List rules) {
- Map ruleMap = CollectionUtils.convertMap(rules, BpmTaskAssignRuleDO::getTaskDefinitionKey);
- // 以 UserTask 为主维度,原因是:流程图编辑后,一些规则实际就没用了。
- return CollectionUtils.convertList(tasks, task -> {
- BpmTaskAssignRuleRespVO respVO = convert(ruleMap.get(task.getId()));
- if (respVO == null) {
- respVO = new BpmTaskAssignRuleRespVO();
- respVO.setTaskDefinitionKey(task.getId());
- }
- respVO.setTaskDefinitionName(task.getName());
- return respVO;
- });
- }
-
- BpmTaskAssignRuleRespVO convert(BpmTaskAssignRuleDO bean);
-
- BpmTaskAssignRuleDO convert(BpmTaskAssignRuleCreateReqVO bean);
-
- BpmTaskAssignRuleDO convert(BpmTaskAssignRuleUpdateReqVO bean);
-
- List convertList2(List list);
-}
diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/convert/definition/BpmUserGroupConvert.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/convert/definition/BpmUserGroupConvert.java
deleted file mode 100644
index bbf00ba52..000000000
--- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/convert/definition/BpmUserGroupConvert.java
+++ /dev/null
@@ -1,38 +0,0 @@
-package cn.iocoder.yudao.module.bpm.convert.definition;
-
-import java.util.*;
-
-import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.group.BpmUserGroupCreateReqVO;
-import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.group.BpmUserGroupRespVO;
-import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.group.BpmUserGroupUpdateReqVO;
-import cn.iocoder.yudao.module.bpm.dal.dataobject.definition.BpmUserGroupDO;
-import cn.iocoder.yudao.framework.common.pojo.PageResult;
-
-import org.mapstruct.Mapper;
-import org.mapstruct.Named;
-import org.mapstruct.factory.Mappers;
-
-/**
- * 用户组 Convert
- *
- * @author 芋道源码
- */
-@Mapper
-public interface BpmUserGroupConvert {
-
- BpmUserGroupConvert INSTANCE = Mappers.getMapper(BpmUserGroupConvert.class);
-
- BpmUserGroupDO convert(BpmUserGroupCreateReqVO bean);
-
- BpmUserGroupDO convert(BpmUserGroupUpdateReqVO bean);
-
- BpmUserGroupRespVO convert(BpmUserGroupDO bean);
-
- List convertList(List list);
-
- PageResult convertPage(PageResult page);
-
- @Named("convertList2")
- List convertList2(List list);
-
-}
diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/convert/oa/BpmOALeaveConvert.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/convert/oa/BpmOALeaveConvert.java
deleted file mode 100644
index f87531bfc..000000000
--- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/convert/oa/BpmOALeaveConvert.java
+++ /dev/null
@@ -1,30 +0,0 @@
-package cn.iocoder.yudao.module.bpm.convert.oa;
-
-import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.BpmOALeaveCreateReqVO;
-import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.BpmOALeaveRespVO;
-import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOALeaveDO;
-import cn.iocoder.yudao.framework.common.pojo.PageResult;
-import org.mapstruct.Mapper;
-import org.mapstruct.factory.Mappers;
-
-import java.util.List;
-
-/**
- * 请假申请 Convert
- *
- * @author 芋艿
- */
-@Mapper
-public interface BpmOALeaveConvert {
-
- BpmOALeaveConvert INSTANCE = Mappers.getMapper(BpmOALeaveConvert.class);
-
- BpmOALeaveDO convert(BpmOALeaveCreateReqVO bean);
-
- BpmOALeaveRespVO convert(BpmOALeaveDO bean);
-
- List convertList(List list);
-
- PageResult convertPage(PageResult page);
-
-}
diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/convert/task/BpmProcessInstanceConvert.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/convert/task/BpmProcessInstanceConvert.java
index 41f2184c5..d2b326e11 100644
--- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/convert/task/BpmProcessInstanceConvert.java
+++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/convert/task/BpmProcessInstanceConvert.java
@@ -1,13 +1,15 @@
package cn.iocoder.yudao.module.bpm.convert.task;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
-import cn.iocoder.yudao.framework.common.util.date.DateUtils;
+import cn.iocoder.yudao.framework.common.util.collection.MapUtils;
import cn.iocoder.yudao.framework.common.util.number.NumberUtils;
-import cn.iocoder.yudao.module.bpm.controller.admin.task.vo.instance.BpmProcessInstancePageItemRespVO;
+import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
+import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.process.BpmProcessDefinitionRespVO;
import cn.iocoder.yudao.module.bpm.controller.admin.task.vo.instance.BpmProcessInstanceRespVO;
-import cn.iocoder.yudao.module.bpm.dal.dataobject.definition.BpmProcessDefinitionExtDO;
-import cn.iocoder.yudao.module.bpm.dal.dataobject.task.BpmProcessInstanceExtDO;
-import cn.iocoder.yudao.module.bpm.event.BpmProcessInstanceResultEvent;
+import cn.iocoder.yudao.module.bpm.dal.dataobject.definition.BpmCategoryDO;
+import cn.iocoder.yudao.module.bpm.dal.dataobject.definition.BpmProcessDefinitionInfoDO;
+import cn.iocoder.yudao.module.bpm.event.BpmProcessInstanceStatusEvent;
+import cn.iocoder.yudao.module.bpm.framework.flowable.core.util.FlowableUtils;
import cn.iocoder.yudao.module.bpm.service.message.dto.BpmMessageSendWhenProcessInstanceApproveReqDTO;
import cn.iocoder.yudao.module.bpm.service.message.dto.BpmMessageSendWhenProcessInstanceRejectReqDTO;
import cn.iocoder.yudao.module.system.api.dept.dto.DeptRespDTO;
@@ -29,37 +31,51 @@ import java.util.Map;
*
* @author 芋道源码
*/
-@Mapper(uses = DateUtils.class)
+@Mapper
public interface BpmProcessInstanceConvert {
BpmProcessInstanceConvert INSTANCE = Mappers.getMapper(BpmProcessInstanceConvert.class);
- default PageResult convertPage(PageResult page,
- Map> taskMap) {
- List list = convertList(page.getList());
- list.forEach(respVO -> respVO.setTasks(convertList2(taskMap.get(respVO.getId()))));
- return new PageResult<>(list, page.getTotal());
+ default PageResult buildProcessInstancePage(PageResult pageResult,
+ Map processDefinitionMap,
+ Map categoryMap,
+ Map> taskMap,
+ Map userMap,
+ Map deptMap) {
+ PageResult vpPageResult = BeanUtils.toBean(pageResult, BpmProcessInstanceRespVO.class);
+ for (int i = 0; i < pageResult.getList().size(); i++) {
+ BpmProcessInstanceRespVO respVO = vpPageResult.getList().get(i);
+ respVO.setStatus(FlowableUtils.getProcessInstanceStatus(pageResult.getList().get(i)));
+ MapUtils.findAndThen(processDefinitionMap, respVO.getProcessDefinitionId(),
+ processDefinition -> respVO.setCategory(processDefinition.getCategory()));
+ MapUtils.findAndThen(categoryMap, respVO.getCategory(), category -> respVO.setCategoryName(category.getName()));
+ respVO.setTasks(BeanUtils.toBean(taskMap.get(respVO.getId()), BpmProcessInstanceRespVO.Task.class));
+ // user
+ if (userMap != null) {
+ AdminUserRespDTO startUser = userMap.get(NumberUtils.parseLong(pageResult.getList().get(i).getStartUserId()));
+ respVO.setStartUser(BeanUtils.toBean(startUser, BpmProcessInstanceRespVO.User.class));
+ MapUtils.findAndThen(deptMap, startUser.getDeptId(), dept -> respVO.getStartUser().setDeptName(dept.getName()));
+ }
+ }
+ return vpPageResult;
}
- List convertList(List list);
-
- @Mapping(source = "processInstanceId", target = "id")
- BpmProcessInstancePageItemRespVO convert(BpmProcessInstanceExtDO bean);
-
- List convertList2(List tasks);
-
- default BpmProcessInstanceRespVO convert2(HistoricProcessInstance processInstance, BpmProcessInstanceExtDO processInstanceExt,
- ProcessDefinition processDefinition, BpmProcessDefinitionExtDO processDefinitionExt,
- String bpmnXml, AdminUserRespDTO startUser, DeptRespDTO dept) {
- BpmProcessInstanceRespVO respVO = convert2(processInstance);
- copyTo(processInstanceExt, respVO);
+ default BpmProcessInstanceRespVO buildProcessInstance(HistoricProcessInstance processInstance,
+ ProcessDefinition processDefinition,
+ BpmProcessDefinitionInfoDO processDefinitionExt,
+ String bpmnXml,
+ AdminUserRespDTO startUser,
+ DeptRespDTO dept) {
+ BpmProcessInstanceRespVO respVO = BeanUtils.toBean(processInstance, BpmProcessInstanceRespVO.class);
+ respVO.setStatus(FlowableUtils.getProcessInstanceStatus(processInstance));
+ respVO.setFormVariables(FlowableUtils.getProcessInstanceFormVariable(processInstance));
// definition
- respVO.setProcessDefinition(convert2(processDefinition));
+ respVO.setProcessDefinition(BeanUtils.toBean(processDefinition, BpmProcessDefinitionRespVO.class));
copyTo(processDefinitionExt, respVO.getProcessDefinition());
respVO.getProcessDefinition().setBpmnXml(bpmnXml);
// user
if (startUser != null) {
- respVO.setStartUser(convert2(startUser));
+ respVO.setStartUser(BeanUtils.toBean(startUser, BpmProcessInstanceRespVO.User.class));
if (dept != null) {
respVO.getStartUser().setDeptName(dept.getName());
}
@@ -67,44 +83,27 @@ public interface BpmProcessInstanceConvert {
return respVO;
}
- BpmProcessInstanceRespVO convert2(HistoricProcessInstance bean);
-
@Mapping(source = "from.id", target = "to.id", ignore = true)
- void copyTo(BpmProcessInstanceExtDO from, @MappingTarget BpmProcessInstanceRespVO to);
+ void copyTo(BpmProcessDefinitionInfoDO from, @MappingTarget BpmProcessDefinitionRespVO to);
- BpmProcessInstanceRespVO.ProcessDefinition convert2(ProcessDefinition bean);
-
- @Mapping(source = "from.id", target = "to.id", ignore = true)
- void copyTo(BpmProcessDefinitionExtDO from, @MappingTarget BpmProcessInstanceRespVO.ProcessDefinition to);
-
- BpmProcessInstanceRespVO.User convert2(AdminUserRespDTO bean);
-
- default BpmProcessInstanceResultEvent convert(Object source, HistoricProcessInstance instance, Integer result) {
- BpmProcessInstanceResultEvent event = new BpmProcessInstanceResultEvent(source);
- event.setId(instance.getId());
- event.setProcessDefinitionKey(instance.getProcessDefinitionKey());
- event.setBusinessKey(instance.getBusinessKey());
- event.setResult(result);
- return event;
+ default BpmProcessInstanceStatusEvent buildProcessInstanceStatusEvent(Object source, HistoricProcessInstance instance, Integer status) {
+ return new BpmProcessInstanceStatusEvent(source).setId(instance.getId()).setStatus(status)
+ .setProcessDefinitionKey(instance.getProcessDefinitionKey()).setBusinessKey(instance.getBusinessKey());
}
- default BpmProcessInstanceResultEvent convert(Object source, ProcessInstance instance, Integer result) {
- BpmProcessInstanceResultEvent event = new BpmProcessInstanceResultEvent(source);
- event.setId(instance.getId());
- event.setProcessDefinitionKey(instance.getProcessDefinitionKey());
- event.setBusinessKey(instance.getBusinessKey());
- event.setResult(result);
- return event;
+ default BpmProcessInstanceStatusEvent buildProcessInstanceStatusEvent(Object source, ProcessInstance instance, Integer status) {;
+ return new BpmProcessInstanceStatusEvent(source).setId(instance.getId()).setStatus(status)
+ .setProcessDefinitionKey(instance.getProcessDefinitionKey()).setBusinessKey(instance.getBusinessKey());
}
- default BpmMessageSendWhenProcessInstanceApproveReqDTO convert2ApprovedReq(ProcessInstance instance){
- return new BpmMessageSendWhenProcessInstanceApproveReqDTO()
+ default BpmMessageSendWhenProcessInstanceApproveReqDTO buildProcessInstanceApproveMessage(ProcessInstance instance) {
+ return new BpmMessageSendWhenProcessInstanceApproveReqDTO()
.setStartUserId(NumberUtils.parseLong(instance.getStartUserId()))
.setProcessInstanceId(instance.getId())
.setProcessInstanceName(instance.getName());
}
- default BpmMessageSendWhenProcessInstanceRejectReqDTO convert2RejectReq(ProcessInstance instance, String reason) {
+ default BpmMessageSendWhenProcessInstanceRejectReqDTO buildProcessInstanceRejectMessage(ProcessInstance instance, String reason) {
return new BpmMessageSendWhenProcessInstanceRejectReqDTO()
.setProcessInstanceName(instance.getName())
.setProcessInstanceId(instance.getId())
diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/convert/task/BpmTaskConvert.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/convert/task/BpmTaskConvert.java
index 60ce84021..5f4e915d3 100644
--- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/convert/task/BpmTaskConvert.java
+++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/convert/task/BpmTaskConvert.java
@@ -1,138 +1,142 @@
package cn.iocoder.yudao.module.bpm.convert.task;
-import cn.hutool.core.date.LocalDateTimeUtil;
-import cn.hutool.core.util.ObjectUtil;
+import cn.hutool.core.map.MapUtil;
import cn.hutool.core.util.StrUtil;
+import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils;
-import cn.iocoder.yudao.framework.common.util.collection.MapUtils;
-import cn.iocoder.yudao.framework.common.util.date.DateUtils;
import cn.iocoder.yudao.framework.common.util.number.NumberUtils;
-import cn.iocoder.yudao.module.bpm.controller.admin.task.vo.task.*;
-import cn.iocoder.yudao.module.bpm.dal.dataobject.task.BpmTaskExtDO;
+import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
+import cn.iocoder.yudao.module.bpm.controller.admin.task.vo.instance.BpmProcessInstanceRespVO;
+import cn.iocoder.yudao.module.bpm.controller.admin.task.vo.task.BpmTaskRespVO;
+import cn.iocoder.yudao.module.bpm.dal.dataobject.definition.BpmFormDO;
+import cn.iocoder.yudao.module.bpm.framework.flowable.core.util.FlowableUtils;
import cn.iocoder.yudao.module.bpm.service.message.dto.BpmMessageSendWhenTaskCreatedReqDTO;
import cn.iocoder.yudao.module.system.api.dept.dto.DeptRespDTO;
import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO;
-import org.flowable.bpmn.model.FlowElement;
-import org.flowable.common.engine.impl.db.SuspensionState;
import org.flowable.engine.history.HistoricProcessInstance;
import org.flowable.engine.runtime.ProcessInstance;
import org.flowable.task.api.Task;
import org.flowable.task.api.history.HistoricTaskInstance;
import org.flowable.task.service.impl.persistence.entity.TaskEntityImpl;
-import org.mapstruct.*;
+import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;
import java.util.Date;
import java.util.List;
import java.util.Map;
-import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertMultiMap;
-import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.filterList;
+import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.*;
+import static cn.iocoder.yudao.framework.common.util.collection.MapUtils.findAndThen;
/**
* Bpm 任务 Convert
*
* @author 芋道源码
*/
-@Mapper(uses = DateUtils.class)
+@Mapper
public interface BpmTaskConvert {
BpmTaskConvert INSTANCE = Mappers.getMapper(BpmTaskConvert.class);
- default List convertList1(List tasks,
- Map processInstanceMap,
- Map userMap) {
- return CollectionUtils.convertList(tasks, task -> {
- BpmTaskTodoPageItemRespVO respVO = convert1(task);
- ProcessInstance processInstance = processInstanceMap.get(task.getProcessInstanceId());
- if (processInstance != null) {
- AdminUserRespDTO startUser = userMap.get(NumberUtils.parseLong(processInstance.getStartUserId()));
- respVO.setProcessInstance(convert(processInstance, startUser));
+ default PageResult buildTodoTaskPage(PageResult pageResult,
+ Map processInstanceMap,
+ Map userMap) {
+ return BeanUtils.toBean(pageResult, BpmTaskRespVO.class, taskVO -> {
+ ProcessInstance processInstance = processInstanceMap.get(taskVO.getProcessInstanceId());
+ if (processInstance == null) {
+ return;
}
- return respVO;
+ taskVO.setProcessInstance(BeanUtils.toBean(processInstance, BpmTaskRespVO.ProcessInstance.class));
+ AdminUserRespDTO startUser = userMap.get(NumberUtils.parseLong(processInstance.getStartUserId()));
+ taskVO.getProcessInstance().setStartUser(BeanUtils.toBean(startUser, BpmProcessInstanceRespVO.User.class));
});
}
- @Mapping(source = "suspended", target = "suspensionState", qualifiedByName = "convertSuspendedToSuspensionState")
- BpmTaskTodoPageItemRespVO convert1(Task bean);
-
- @Named("convertSuspendedToSuspensionState")
- default Integer convertSuspendedToSuspensionState(boolean suspended) {
- return suspended ? SuspensionState.SUSPENDED.getStateCode() : SuspensionState.ACTIVE.getStateCode();
- }
-
- default List