add 添加表单配置
This commit is contained in:
parent
c859fa4c38
commit
651b2e140b
@ -76,9 +76,9 @@ public interface FlowConstant {
|
|||||||
String PROCESS_INSTANCE_VO = "processInstanceVo";
|
String PROCESS_INSTANCE_VO = "processInstanceVo";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 流程表单配置对象
|
* 流程定义配置
|
||||||
*/
|
*/
|
||||||
String WF_FORM_DEFINITION_VO = "wfFormDefinitionVo";
|
String WF_DEFINITION_CONFIG_VO = "wfDefinitionConfigVo";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 流程发起人
|
* 流程发起人
|
||||||
|
@ -0,0 +1,54 @@
|
|||||||
|
package org.dromara.workflow.common.enums;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Getter;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 任务状态枚举
|
||||||
|
*
|
||||||
|
* @author may
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@AllArgsConstructor
|
||||||
|
public enum FormTypeEnum {
|
||||||
|
/**
|
||||||
|
* 自定义表单
|
||||||
|
*/
|
||||||
|
STATIC("static", "自定义表单"),
|
||||||
|
/**
|
||||||
|
* 动态表单
|
||||||
|
*/
|
||||||
|
DYNAMIC("dynamic", "动态表单");
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类型
|
||||||
|
*/
|
||||||
|
private final String type;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 描述
|
||||||
|
*/
|
||||||
|
private final String desc;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 表单类型
|
||||||
|
*
|
||||||
|
* @param formType 表单类型
|
||||||
|
*/
|
||||||
|
public static String findByType(String formType) {
|
||||||
|
if (StringUtils.isBlank(formType)) {
|
||||||
|
return StrUtil.EMPTY;
|
||||||
|
}
|
||||||
|
|
||||||
|
return Arrays.stream(FormTypeEnum.values())
|
||||||
|
.filter(statusEnum -> statusEnum.getType().equals(formType))
|
||||||
|
.findFirst()
|
||||||
|
.map(FormTypeEnum::getDesc)
|
||||||
|
.orElse(StrUtil.EMPTY);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -4,6 +4,7 @@ import java.util.List;
|
|||||||
|
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import jakarta.validation.constraints.*;
|
import jakarta.validation.constraints.*;
|
||||||
|
import org.dromara.workflow.domain.bo.WfDefinitionConfigBo;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||||
@ -12,23 +13,22 @@ import org.dromara.common.web.core.BaseController;
|
|||||||
import org.dromara.common.core.domain.R;
|
import org.dromara.common.core.domain.R;
|
||||||
import org.dromara.common.core.validate.AddGroup;
|
import org.dromara.common.core.validate.AddGroup;
|
||||||
import org.dromara.common.log.enums.BusinessType;
|
import org.dromara.common.log.enums.BusinessType;
|
||||||
import org.dromara.workflow.domain.vo.WfFormDefinitionVo;
|
import org.dromara.workflow.domain.vo.WfDefinitionConfigVo;
|
||||||
import org.dromara.workflow.domain.bo.WfFormDefinitionBo;
|
import org.dromara.workflow.service.IWfDefinitionConfigService;
|
||||||
import org.dromara.workflow.service.IWfFormDefinitionService;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 表单配置
|
* 表单配置
|
||||||
*
|
*
|
||||||
* @author gssong
|
* @author may
|
||||||
* @date 2024-03-18
|
* @date 2024-03-18
|
||||||
*/
|
*/
|
||||||
@Validated
|
@Validated
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/workflow/formDefinition")
|
@RequestMapping("/workflow/definitionConfig")
|
||||||
public class WfFormDefinitionController extends BaseController {
|
public class WfDefinitionConfigController extends BaseController {
|
||||||
|
|
||||||
private final IWfFormDefinitionService wfFormDefinitionService;
|
private final IWfDefinitionConfigService wfDefinitionConfigService;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -37,9 +37,9 @@ public class WfFormDefinitionController extends BaseController {
|
|||||||
* @param definitionId 主键
|
* @param definitionId 主键
|
||||||
*/
|
*/
|
||||||
@GetMapping("/getByDefId/{definitionId}")
|
@GetMapping("/getByDefId/{definitionId}")
|
||||||
public R<WfFormDefinitionVo> getByDefId(@NotBlank(message = "流程定义ID不能为空")
|
public R<WfDefinitionConfigVo> getByDefId(@NotBlank(message = "流程定义ID不能为空")
|
||||||
@PathVariable String definitionId) {
|
@PathVariable String definitionId) {
|
||||||
return R.ok(wfFormDefinitionService.getByDefId(definitionId));
|
return R.ok(wfDefinitionConfigService.getByDefId(definitionId));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -48,8 +48,8 @@ public class WfFormDefinitionController extends BaseController {
|
|||||||
@Log(title = "表单配置", businessType = BusinessType.INSERT)
|
@Log(title = "表单配置", businessType = BusinessType.INSERT)
|
||||||
@RepeatSubmit()
|
@RepeatSubmit()
|
||||||
@PostMapping("/saveOrUpdate")
|
@PostMapping("/saveOrUpdate")
|
||||||
public R<Void> saveOrUpdate(@Validated(AddGroup.class) @RequestBody WfFormDefinitionBo bo) {
|
public R<Void> saveOrUpdate(@Validated(AddGroup.class) @RequestBody WfDefinitionConfigBo bo) {
|
||||||
return toAjax(wfFormDefinitionService.saveOrUpdate(bo));
|
return toAjax(wfDefinitionConfigService.saveOrUpdate(bo));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -61,6 +61,6 @@ public class WfFormDefinitionController extends BaseController {
|
|||||||
@DeleteMapping("/{ids}")
|
@DeleteMapping("/{ids}")
|
||||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||||
@PathVariable Long[] ids) {
|
@PathVariable Long[] ids) {
|
||||||
return toAjax(wfFormDefinitionService.deleteByIds(List.of(ids)));
|
return toAjax(wfDefinitionConfigService.deleteByIds(List.of(ids)));
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -0,0 +1,114 @@
|
|||||||
|
package org.dromara.workflow.controller;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
|
import jakarta.validation.constraints.*;
|
||||||
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||||
|
import org.dromara.common.log.annotation.Log;
|
||||||
|
import org.dromara.common.web.core.BaseController;
|
||||||
|
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||||
|
import org.dromara.common.core.domain.R;
|
||||||
|
import org.dromara.common.core.validate.AddGroup;
|
||||||
|
import org.dromara.common.core.validate.EditGroup;
|
||||||
|
import org.dromara.common.log.enums.BusinessType;
|
||||||
|
import org.dromara.common.excel.utils.ExcelUtil;
|
||||||
|
import org.dromara.workflow.domain.vo.WfFormManageVo;
|
||||||
|
import org.dromara.workflow.domain.bo.WfFormManageBo;
|
||||||
|
import org.dromara.workflow.service.IWfFormManageService;
|
||||||
|
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 表单管理
|
||||||
|
*
|
||||||
|
* @author may
|
||||||
|
* @date 2024-03-29
|
||||||
|
*/
|
||||||
|
@Validated
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/workflow/formManage")
|
||||||
|
public class WfFormManageController extends BaseController {
|
||||||
|
|
||||||
|
private final IWfFormManageService wfFormManageService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询表单管理列表
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("workflow:formManage:list")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo<WfFormManageVo> list(WfFormManageBo bo, PageQuery pageQuery) {
|
||||||
|
return wfFormManageService.queryPageList(bo, pageQuery);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询表单管理列表
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("workflow:formManage:list")
|
||||||
|
@GetMapping("/list/selectList")
|
||||||
|
public R<List<WfFormManageVo>> selectList() {
|
||||||
|
return R.ok(wfFormManageService.selectList());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出表单管理列表
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("workflow:formManage:export")
|
||||||
|
@Log(title = "表单管理", businessType = BusinessType.EXPORT)
|
||||||
|
@PostMapping("/export")
|
||||||
|
public void export(WfFormManageBo bo, HttpServletResponse response) {
|
||||||
|
List<WfFormManageVo> list = wfFormManageService.queryList(bo);
|
||||||
|
ExcelUtil.exportExcel(list, "表单管理", WfFormManageVo.class, response);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取表单管理详细信息
|
||||||
|
*
|
||||||
|
* @param id 主键
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("workflow:formManage:query")
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public R<WfFormManageVo> getInfo(@NotNull(message = "主键不能为空")
|
||||||
|
@PathVariable Long id) {
|
||||||
|
return R.ok(wfFormManageService.queryById(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增表单管理
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("workflow:formManage:add")
|
||||||
|
@Log(title = "表单管理", businessType = BusinessType.INSERT)
|
||||||
|
@RepeatSubmit()
|
||||||
|
@PostMapping()
|
||||||
|
public R<Void> add(@Validated(AddGroup.class) @RequestBody WfFormManageBo bo) {
|
||||||
|
return toAjax(wfFormManageService.insertByBo(bo));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改表单管理
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("workflow:formManage:edit")
|
||||||
|
@Log(title = "表单管理", businessType = BusinessType.UPDATE)
|
||||||
|
@RepeatSubmit()
|
||||||
|
@PutMapping()
|
||||||
|
public R<Void> edit(@Validated(EditGroup.class) @RequestBody WfFormManageBo bo) {
|
||||||
|
return toAjax(wfFormManageService.updateByBo(bo));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除表单管理
|
||||||
|
*
|
||||||
|
* @param ids 主键串
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("workflow:formManage:remove")
|
||||||
|
@Log(title = "表单管理", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/{ids}")
|
||||||
|
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||||
|
@PathVariable Long[] ids) {
|
||||||
|
return toAjax(wfFormManageService.deleteByIds(List.of(ids)));
|
||||||
|
}
|
||||||
|
}
|
@ -11,7 +11,7 @@ import java.io.Serial;
|
|||||||
/**
|
/**
|
||||||
* 流程历史任务对象 act_hi_taskinst
|
* 流程历史任务对象 act_hi_taskinst
|
||||||
*
|
*
|
||||||
* @author gssong
|
* @author may
|
||||||
* @date 2024-03-02
|
* @date 2024-03-02
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
|
@ -10,13 +10,13 @@ import java.io.Serial;
|
|||||||
/**
|
/**
|
||||||
* 表单配置对象 wf_form_definition
|
* 表单配置对象 wf_form_definition
|
||||||
*
|
*
|
||||||
* @author gssong
|
* @author may
|
||||||
* @date 2024-03-18
|
* @date 2024-03-18
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@TableName("wf_form_definition")
|
@TableName("wf_definition_config")
|
||||||
public class WfFormDefinition extends BaseEntity {
|
public class WfDefinitionConfig extends BaseEntity {
|
||||||
|
|
||||||
@Serial
|
@Serial
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
@ -28,9 +28,9 @@ public class WfFormDefinition extends BaseEntity {
|
|||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 路由地址
|
* 表单ID
|
||||||
*/
|
*/
|
||||||
private String path;
|
private Long formId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 流程定义ID
|
* 流程定义ID
|
@ -0,0 +1,51 @@
|
|||||||
|
package org.dromara.workflow.domain;
|
||||||
|
|
||||||
|
import org.dromara.common.tenant.core.TenantEntity;
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 表单管理对象 wf_form_manage
|
||||||
|
*
|
||||||
|
* @author may
|
||||||
|
* @date 2024-03-29
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@TableName("wf_form_manage")
|
||||||
|
public class WfFormManage extends TenantEntity {
|
||||||
|
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键
|
||||||
|
*/
|
||||||
|
@TableId(value = "id")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 表单名称
|
||||||
|
*/
|
||||||
|
private String formName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 表单类型
|
||||||
|
*/
|
||||||
|
private String formType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 路由地址/表单ID
|
||||||
|
*/
|
||||||
|
private String router;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,56 @@
|
|||||||
|
package org.dromara.workflow.domain;
|
||||||
|
|
||||||
|
import org.dromara.common.tenant.core.TenantEntity;
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 节点配置对象 wf_node_config
|
||||||
|
*
|
||||||
|
* @author may
|
||||||
|
* @date 2024-03-30
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@TableName("wf_node_config")
|
||||||
|
public class WfNodeConfig extends TenantEntity {
|
||||||
|
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键
|
||||||
|
*/
|
||||||
|
@TableId(value = "id")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 表单id
|
||||||
|
*/
|
||||||
|
private Long formId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 表单类型
|
||||||
|
*/
|
||||||
|
private String formType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 节点名称
|
||||||
|
*/
|
||||||
|
private String nodeName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 节点id
|
||||||
|
*/
|
||||||
|
private String nodeId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 流程定义id
|
||||||
|
*/
|
||||||
|
private String definitionId;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -1,6 +1,6 @@
|
|||||||
package org.dromara.workflow.domain.bo;
|
package org.dromara.workflow.domain.bo;
|
||||||
|
|
||||||
import org.dromara.workflow.domain.WfFormDefinition;
|
import org.dromara.workflow.domain.WfDefinitionConfig;
|
||||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||||
import org.dromara.common.core.validate.AddGroup;
|
import org.dromara.common.core.validate.AddGroup;
|
||||||
import org.dromara.common.core.validate.EditGroup;
|
import org.dromara.common.core.validate.EditGroup;
|
||||||
@ -12,13 +12,13 @@ import jakarta.validation.constraints.*;
|
|||||||
/**
|
/**
|
||||||
* 表单配置业务对象 wf_form_definition
|
* 表单配置业务对象 wf_form_definition
|
||||||
*
|
*
|
||||||
* @author gssong
|
* @author may
|
||||||
* @date 2024-03-18
|
* @date 2024-03-18
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@AutoMapper(target = WfFormDefinition.class, reverseConvertGenerate = false)
|
@AutoMapper(target = WfDefinitionConfig.class, reverseConvertGenerate = false)
|
||||||
public class WfFormDefinitionBo extends BaseEntity {
|
public class WfDefinitionConfigBo extends BaseEntity {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 主键
|
* 主键
|
||||||
@ -27,10 +27,10 @@ public class WfFormDefinitionBo extends BaseEntity {
|
|||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 路由地址
|
* 表单ID
|
||||||
*/
|
*/
|
||||||
@NotBlank(message = "路由地址不能为空", groups = {AddGroup.class})
|
@NotNull(message = "表单ID不能为空", groups = {AddGroup.class})
|
||||||
private String path;
|
private Long formId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 流程定义ID
|
* 流程定义ID
|
@ -0,0 +1,53 @@
|
|||||||
|
package org.dromara.workflow.domain.bo;
|
||||||
|
|
||||||
|
import org.dromara.workflow.domain.WfFormManage;
|
||||||
|
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||||
|
import org.dromara.common.core.validate.AddGroup;
|
||||||
|
import org.dromara.common.core.validate.EditGroup;
|
||||||
|
import io.github.linpeilie.annotations.AutoMapper;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import jakarta.validation.constraints.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 表单管理业务对象 wf_form_manage
|
||||||
|
*
|
||||||
|
* @author may
|
||||||
|
* @date 2024-03-29
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@AutoMapper(target = WfFormManage.class, reverseConvertGenerate = false)
|
||||||
|
public class WfFormManageBo extends BaseEntity {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键
|
||||||
|
*/
|
||||||
|
@NotNull(message = "主键不能为空", groups = { EditGroup.class })
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 表单名称
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "表单名称不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
private String formName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 表单类型
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "表单类型不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
private String formType;
|
||||||
|
/**
|
||||||
|
* 路由地址/表单ID
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "路由地址/表单ID不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
private String router;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,58 @@
|
|||||||
|
package org.dromara.workflow.domain.bo;
|
||||||
|
|
||||||
|
import org.dromara.workflow.domain.WfNodeConfig;
|
||||||
|
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||||
|
import org.dromara.common.core.validate.AddGroup;
|
||||||
|
import org.dromara.common.core.validate.EditGroup;
|
||||||
|
import io.github.linpeilie.annotations.AutoMapper;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import jakarta.validation.constraints.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 节点配置业务对象 wf_node_config
|
||||||
|
*
|
||||||
|
* @author may
|
||||||
|
* @date 2024-03-30
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@AutoMapper(target = WfNodeConfig.class, reverseConvertGenerate = false)
|
||||||
|
public class WfNodeConfigBo extends BaseEntity {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键
|
||||||
|
*/
|
||||||
|
@NotNull(message = "主键不能为空", groups = { EditGroup.class })
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 表单id
|
||||||
|
*/
|
||||||
|
private Long formId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 表单类型
|
||||||
|
*/
|
||||||
|
private String formType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 节点名称
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "节点名称不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
private String nodeName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 节点id
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "节点id不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
private String nodeId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 流程定义id
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "流程定义id不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
private String definitionId;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -65,6 +65,6 @@ public class ProcessDefinitionVo implements Serializable {
|
|||||||
/**
|
/**
|
||||||
* 表单配置
|
* 表单配置
|
||||||
*/
|
*/
|
||||||
private WfFormDefinitionVo wfFormDefinitionVo;
|
private WfDefinitionConfigVo wfDefinitionConfigVo;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -96,5 +96,5 @@ public class ProcessInstanceVo implements Serializable {
|
|||||||
/**
|
/**
|
||||||
* 表单配置
|
* 表单配置
|
||||||
*/
|
*/
|
||||||
private WfFormDefinitionVo wfFormDefinitionVo;
|
private WfDefinitionConfigVo wfDefinitionConfigVo;
|
||||||
}
|
}
|
||||||
|
@ -159,5 +159,10 @@ public class TaskVo implements Serializable {
|
|||||||
/**
|
/**
|
||||||
* 表单配置
|
* 表单配置
|
||||||
*/
|
*/
|
||||||
private WfFormDefinitionVo wfFormDefinitionVo;
|
private WfDefinitionConfigVo wfDefinitionConfigVo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 节点配置
|
||||||
|
*/
|
||||||
|
private WfNodeConfigVo wfNodeConfigVo;
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package org.dromara.workflow.domain.vo;
|
package org.dromara.workflow.domain.vo;
|
||||||
|
|
||||||
import org.dromara.workflow.domain.WfFormDefinition;
|
import org.dromara.workflow.domain.WfDefinitionConfig;
|
||||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||||
import com.alibaba.excel.annotation.ExcelProperty;
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
import io.github.linpeilie.annotations.AutoMapper;
|
import io.github.linpeilie.annotations.AutoMapper;
|
||||||
@ -10,17 +10,16 @@ import java.io.Serial;
|
|||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 表单配置视图对象 wf_form_definition
|
* 表单配置视图对象 wf_form_definition
|
||||||
*
|
*
|
||||||
* @author gssong
|
* @author may
|
||||||
* @date 2024-03-18
|
* @date 2024-03-18
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@ExcelIgnoreUnannotated
|
@ExcelIgnoreUnannotated
|
||||||
@AutoMapper(target = WfFormDefinition.class)
|
@AutoMapper(target = WfDefinitionConfig.class)
|
||||||
public class WfFormDefinitionVo implements Serializable {
|
public class WfDefinitionConfigVo implements Serializable {
|
||||||
|
|
||||||
@Serial
|
@Serial
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
@ -32,10 +31,10 @@ public class WfFormDefinitionVo implements Serializable {
|
|||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 路由地址
|
* 表单ID
|
||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "路由地址")
|
@ExcelProperty(value = "表单ID")
|
||||||
private String path;
|
private Long formId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 流程定义ID
|
* 流程定义ID
|
||||||
@ -55,5 +54,10 @@ public class WfFormDefinitionVo implements Serializable {
|
|||||||
@ExcelProperty(value = "备注")
|
@ExcelProperty(value = "备注")
|
||||||
private String remark;
|
private String remark;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 表单管理
|
||||||
|
*/
|
||||||
|
private WfFormManageVo wfFormManageVo;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
@ -0,0 +1,63 @@
|
|||||||
|
package org.dromara.workflow.domain.vo;
|
||||||
|
|
||||||
|
import org.dromara.workflow.domain.WfFormManage;
|
||||||
|
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||||
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
|
import io.github.linpeilie.annotations.AutoMapper;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 表单管理视图对象 wf_form_manage
|
||||||
|
*
|
||||||
|
* @author may
|
||||||
|
* @date 2024-03-29
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@ExcelIgnoreUnannotated
|
||||||
|
@AutoMapper(target = WfFormManage.class)
|
||||||
|
public class WfFormManageVo implements Serializable {
|
||||||
|
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "主键")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 表单名称
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "表单名称")
|
||||||
|
private String formName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 表单类型
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "表单类型")
|
||||||
|
private String formType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 表单类型名称
|
||||||
|
*/
|
||||||
|
private String formTypeName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 路由地址/表单ID
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "路由地址/表单ID")
|
||||||
|
private String router;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "备注")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,69 @@
|
|||||||
|
package org.dromara.workflow.domain.vo;
|
||||||
|
|
||||||
|
import org.dromara.workflow.domain.WfNodeConfig;
|
||||||
|
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||||
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
|
import io.github.linpeilie.annotations.AutoMapper;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 节点配置视图对象 wf_node_config
|
||||||
|
*
|
||||||
|
* @author may
|
||||||
|
* @date 2024-03-30
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@ExcelIgnoreUnannotated
|
||||||
|
@AutoMapper(target = WfNodeConfig.class)
|
||||||
|
public class WfNodeConfigVo implements Serializable {
|
||||||
|
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "主键")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 表单id
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "表单id")
|
||||||
|
private Long formId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 表单类型
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "表单类型")
|
||||||
|
private String formType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 节点名称
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "节点名称")
|
||||||
|
private String nodeName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 节点id
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "节点id")
|
||||||
|
private String nodeId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 流程定义id
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "流程定义id")
|
||||||
|
private String definitionId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 表单管理
|
||||||
|
*/
|
||||||
|
private WfFormManageVo wfFormManageVo;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,114 @@
|
|||||||
|
package org.dromara.workflow.flowable.cmd;
|
||||||
|
|
||||||
|
import org.flowable.bpmn.BpmnAutoLayout;
|
||||||
|
import org.flowable.bpmn.model.*;
|
||||||
|
import org.flowable.bpmn.model.Process;
|
||||||
|
import org.flowable.common.engine.impl.interceptor.Command;
|
||||||
|
import org.flowable.common.engine.impl.interceptor.CommandContext;
|
||||||
|
import org.flowable.engine.impl.cmd.AbstractDynamicInjectionCmd;
|
||||||
|
import org.flowable.engine.impl.dynamic.BaseDynamicSubProcessInjectUtil;
|
||||||
|
import org.flowable.engine.impl.dynamic.DynamicUserTaskBuilder;
|
||||||
|
import org.flowable.engine.impl.persistence.entity.DeploymentEntity;
|
||||||
|
import org.flowable.engine.impl.persistence.entity.ExecutionEntity;
|
||||||
|
import org.flowable.engine.impl.persistence.entity.ProcessDefinitionEntity;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
|
||||||
|
public class CustomInjectUserTaskCmd extends AbstractDynamicInjectionCmd implements Command<Void> {
|
||||||
|
|
||||||
|
private final FlowElement currentElement;
|
||||||
|
private final String processInstanceId;
|
||||||
|
private final DynamicUserTaskBuilder dynamicUserTaskBuilder;
|
||||||
|
|
||||||
|
public CustomInjectUserTaskCmd(String processInstanceId, DynamicUserTaskBuilder dynamicUserTaskBuilder, FlowElement currentElement) {
|
||||||
|
this.currentElement = currentElement;
|
||||||
|
this.processInstanceId = processInstanceId;
|
||||||
|
this.dynamicUserTaskBuilder = dynamicUserTaskBuilder;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void updateBpmnProcess(CommandContext commandContext, Process process, BpmnModel bpmnModel, ProcessDefinitionEntity originalProcessDefinitionEntity, DeploymentEntity newDeploymentEntity) {
|
||||||
|
if (!(this.currentElement instanceof UserTask currentUserTask)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (currentUserTask.getOutgoingFlows().isEmpty() || currentUserTask.getOutgoingFlows().size() > 1) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
SequenceFlow currentOutgoingFlow = currentUserTask.getOutgoingFlows().get(0);
|
||||||
|
FlowElement targetFlowElement = currentOutgoingFlow.getTargetFlowElement();
|
||||||
|
//创建新的任务节点和两条连线
|
||||||
|
UserTask newUserTask = createUserTask(process);
|
||||||
|
SequenceFlow newSequenceFlow1 = new SequenceFlow(currentUserTask.getId(), newUserTask.getId());
|
||||||
|
newSequenceFlow1.setId(dynamicUserTaskBuilder.nextFlowId(process.getFlowElementMap()));
|
||||||
|
SequenceFlow newSequenceFlow2 = new SequenceFlow(newUserTask.getId(), targetFlowElement.getId());
|
||||||
|
newSequenceFlow2.setId(dynamicUserTaskBuilder.nextFlowId(process.getFlowElementMap()));
|
||||||
|
//添加到流程
|
||||||
|
process.addFlowElement(newUserTask);
|
||||||
|
process.addFlowElement(newSequenceFlow1);
|
||||||
|
process.addFlowElement(newSequenceFlow2);
|
||||||
|
process.removeFlowElement(currentOutgoingFlow.getId());
|
||||||
|
//获取开始节点
|
||||||
|
StartEvent startEvent = process.findFlowElementsOfType(StartEvent.class, false).get(0);
|
||||||
|
//绘制新的流程图
|
||||||
|
GraphicInfo elementGraphicInfo = bpmnModel.getGraphicInfo(currentUserTask.getId());
|
||||||
|
if (elementGraphicInfo != null) {
|
||||||
|
double yDiff = 0;
|
||||||
|
double xDiff = 80;
|
||||||
|
if (elementGraphicInfo.getY() < 173) {
|
||||||
|
yDiff = 173 - elementGraphicInfo.getY();
|
||||||
|
elementGraphicInfo.setY(173);
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, GraphicInfo> locationMap = bpmnModel.getLocationMap();
|
||||||
|
for (String locationId : locationMap.keySet()) {
|
||||||
|
if (startEvent.getId().equals(locationId)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
GraphicInfo locationGraphicInfo = locationMap.get(locationId);
|
||||||
|
locationGraphicInfo.setX(locationGraphicInfo.getX() + xDiff);
|
||||||
|
locationGraphicInfo.setY(locationGraphicInfo.getY() + yDiff);
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, List<GraphicInfo>> flowLocationMap = bpmnModel.getFlowLocationMap();
|
||||||
|
for (String flowId : flowLocationMap.keySet()) {
|
||||||
|
List<GraphicInfo> flowGraphicInfoList = flowLocationMap.get(flowId);
|
||||||
|
for (GraphicInfo flowGraphicInfo : flowGraphicInfoList) {
|
||||||
|
flowGraphicInfo.setX(flowGraphicInfo.getX() + xDiff);
|
||||||
|
flowGraphicInfo.setY(flowGraphicInfo.getY() + yDiff);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//移除当前流程连线
|
||||||
|
bpmnModel.removeFlowGraphicInfoList(currentOutgoingFlow.getId());
|
||||||
|
//重新绘制
|
||||||
|
new BpmnAutoLayout(bpmnModel).execute();
|
||||||
|
}
|
||||||
|
BaseDynamicSubProcessInjectUtil.processFlowElements(commandContext, process, bpmnModel, originalProcessDefinitionEntity, newDeploymentEntity);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void updateExecutions(CommandContext commandContext, ProcessDefinitionEntity processDefinitionEntity, ExecutionEntity processInstance, List<ExecutionEntity> childExecutions) {
|
||||||
|
}
|
||||||
|
|
||||||
|
private UserTask createUserTask(Process process) {
|
||||||
|
UserTask userTask = new UserTask();
|
||||||
|
if (dynamicUserTaskBuilder.getId() != null) {
|
||||||
|
userTask.setId(dynamicUserTaskBuilder.getId());
|
||||||
|
} else {
|
||||||
|
userTask.setId(dynamicUserTaskBuilder.nextTaskId(process.getFlowElementMap()));
|
||||||
|
}
|
||||||
|
dynamicUserTaskBuilder.setDynamicTaskId(userTask.getId());
|
||||||
|
|
||||||
|
userTask.setName(dynamicUserTaskBuilder.getName());
|
||||||
|
userTask.setAssignee(dynamicUserTaskBuilder.getAssignee());
|
||||||
|
return userTask;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Void execute(CommandContext commandContext) {
|
||||||
|
createDerivedProcessDefinitionForProcessInstance(commandContext, processInstanceId);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
@ -7,7 +7,7 @@ import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
|||||||
/**
|
/**
|
||||||
* 流程历史任务Mapper接口
|
* 流程历史任务Mapper接口
|
||||||
*
|
*
|
||||||
* @author gssong
|
* @author may
|
||||||
* @date 2024-03-02
|
* @date 2024-03-02
|
||||||
*/
|
*/
|
||||||
@InterceptorIgnore(tenantLine = "true")
|
@InterceptorIgnore(tenantLine = "true")
|
||||||
|
@ -13,7 +13,7 @@ import org.dromara.workflow.domain.vo.TaskVo;
|
|||||||
/**
|
/**
|
||||||
* 任务信息Mapper接口
|
* 任务信息Mapper接口
|
||||||
*
|
*
|
||||||
* @author gssong
|
* @author may
|
||||||
* @date 2024-03-02
|
* @date 2024-03-02
|
||||||
*/
|
*/
|
||||||
@InterceptorIgnore(tenantLine = "true")
|
@InterceptorIgnore(tenantLine = "true")
|
||||||
|
@ -0,0 +1,15 @@
|
|||||||
|
package org.dromara.workflow.mapper;
|
||||||
|
|
||||||
|
import org.dromara.workflow.domain.WfDefinitionConfig;
|
||||||
|
import org.dromara.workflow.domain.vo.WfDefinitionConfigVo;
|
||||||
|
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 表单配置Mapper接口
|
||||||
|
*
|
||||||
|
* @author may
|
||||||
|
* @date 2024-03-18
|
||||||
|
*/
|
||||||
|
public interface WfDefinitionConfigMapper extends BaseMapperPlus<WfDefinitionConfig, WfDefinitionConfigVo> {
|
||||||
|
|
||||||
|
}
|
@ -1,15 +0,0 @@
|
|||||||
package org.dromara.workflow.mapper;
|
|
||||||
|
|
||||||
import org.dromara.workflow.domain.WfFormDefinition;
|
|
||||||
import org.dromara.workflow.domain.vo.WfFormDefinitionVo;
|
|
||||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 表单配置Mapper接口
|
|
||||||
*
|
|
||||||
* @author gssong
|
|
||||||
* @date 2024-03-18
|
|
||||||
*/
|
|
||||||
public interface WfFormDefinitionMapper extends BaseMapperPlus<WfFormDefinition, WfFormDefinitionVo> {
|
|
||||||
|
|
||||||
}
|
|
@ -0,0 +1,15 @@
|
|||||||
|
package org.dromara.workflow.mapper;
|
||||||
|
|
||||||
|
import org.dromara.workflow.domain.WfFormManage;
|
||||||
|
import org.dromara.workflow.domain.vo.WfFormManageVo;
|
||||||
|
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 表单管理Mapper接口
|
||||||
|
*
|
||||||
|
* @author may
|
||||||
|
* @date 2024-03-29
|
||||||
|
*/
|
||||||
|
public interface WfFormManageMapper extends BaseMapperPlus<WfFormManage, WfFormManageVo> {
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,15 @@
|
|||||||
|
package org.dromara.workflow.mapper;
|
||||||
|
|
||||||
|
import org.dromara.workflow.domain.WfNodeConfig;
|
||||||
|
import org.dromara.workflow.domain.vo.WfNodeConfigVo;
|
||||||
|
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 节点配置Mapper接口
|
||||||
|
*
|
||||||
|
* @author may
|
||||||
|
* @date 2024-03-30
|
||||||
|
*/
|
||||||
|
public interface WfNodeConfigMapper extends BaseMapperPlus<WfNodeConfig, WfNodeConfigVo> {
|
||||||
|
|
||||||
|
}
|
@ -4,7 +4,7 @@ package org.dromara.workflow.service;
|
|||||||
/**
|
/**
|
||||||
* 流程历史任务Service接口
|
* 流程历史任务Service接口
|
||||||
*
|
*
|
||||||
* @author gssong
|
* @author may
|
||||||
* @date 2024-03-02
|
* @date 2024-03-02
|
||||||
*/
|
*/
|
||||||
public interface IActHiTaskinstService {
|
public interface IActHiTaskinstService {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package org.dromara.workflow.service;
|
package org.dromara.workflow.service;
|
||||||
|
|
||||||
import org.dromara.workflow.domain.vo.WfFormDefinitionVo;
|
import org.dromara.workflow.domain.vo.WfDefinitionConfigVo;
|
||||||
import org.dromara.workflow.domain.bo.WfFormDefinitionBo;
|
import org.dromara.workflow.domain.bo.WfDefinitionConfigBo;
|
||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -9,10 +9,10 @@ import java.util.List;
|
|||||||
/**
|
/**
|
||||||
* 表单配置Service接口
|
* 表单配置Service接口
|
||||||
*
|
*
|
||||||
* @author gssong
|
* @author may
|
||||||
* @date 2024-03-18
|
* @date 2024-03-18
|
||||||
*/
|
*/
|
||||||
public interface IWfFormDefinitionService {
|
public interface IWfDefinitionConfigService {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询表单配置
|
* 查询表单配置
|
||||||
@ -20,7 +20,7 @@ public interface IWfFormDefinitionService {
|
|||||||
* @param definitionId 流程定义id
|
* @param definitionId 流程定义id
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
WfFormDefinitionVo getByDefId(String definitionId);
|
WfDefinitionConfigVo getByDefId(String definitionId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询表单配置列表
|
* 查询表单配置列表
|
||||||
@ -28,7 +28,7 @@ public interface IWfFormDefinitionService {
|
|||||||
* @param definitionIds 流程定义id
|
* @param definitionIds 流程定义id
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
List<WfFormDefinitionVo> queryList(List<String> definitionIds);
|
List<WfDefinitionConfigVo> queryList(List<String> definitionIds);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -37,7 +37,7 @@ public interface IWfFormDefinitionService {
|
|||||||
* @param bo 参数
|
* @param bo 参数
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
Boolean saveOrUpdate(WfFormDefinitionBo bo);
|
Boolean saveOrUpdate(WfDefinitionConfigBo bo);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除
|
* 删除
|
||||||
@ -46,4 +46,12 @@ public interface IWfFormDefinitionService {
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
Boolean deleteByIds(Collection<Long> ids);
|
Boolean deleteByIds(Collection<Long> ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 按照流程定义id删除
|
||||||
|
*
|
||||||
|
* @param ids 流程定义id
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
Boolean deleteByDefIds(Collection<String> ids);
|
||||||
}
|
}
|
@ -0,0 +1,81 @@
|
|||||||
|
package org.dromara.workflow.service;
|
||||||
|
|
||||||
|
import org.dromara.workflow.domain.vo.WfFormManageVo;
|
||||||
|
import org.dromara.workflow.domain.bo.WfFormManageBo;
|
||||||
|
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||||
|
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 表单管理Service接口
|
||||||
|
*
|
||||||
|
* @author may
|
||||||
|
* @date 2024-03-29
|
||||||
|
*/
|
||||||
|
public interface IWfFormManageService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询表单管理
|
||||||
|
*
|
||||||
|
* @param id 主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
WfFormManageVo queryById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询表单管理
|
||||||
|
*
|
||||||
|
* @param ids 主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
List<WfFormManageVo> queryByIds(List<Long> ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询表单管理列表
|
||||||
|
*
|
||||||
|
* @param bo 参数
|
||||||
|
* @param pageQuery 分页
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
TableDataInfo<WfFormManageVo> queryPageList(WfFormManageBo bo, PageQuery pageQuery);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询表单管理列表
|
||||||
|
*
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
List<WfFormManageVo> selectList();
|
||||||
|
/**
|
||||||
|
* 查询表单管理列表
|
||||||
|
*
|
||||||
|
* @param bo 参数
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
List<WfFormManageVo> queryList(WfFormManageBo bo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增表单管理
|
||||||
|
*
|
||||||
|
* @param bo 参数
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
Boolean insertByBo(WfFormManageBo bo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改表单管理
|
||||||
|
*
|
||||||
|
* @param bo 参数
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
Boolean updateByBo(WfFormManageBo bo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除表单管理信息
|
||||||
|
*
|
||||||
|
* @param ids 主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
Boolean deleteByIds(Collection<Long> ids);
|
||||||
|
}
|
@ -0,0 +1,56 @@
|
|||||||
|
package org.dromara.workflow.service;
|
||||||
|
|
||||||
|
import org.dromara.workflow.domain.WfNodeConfig;
|
||||||
|
import org.dromara.workflow.domain.vo.WfNodeConfigVo;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 节点配置Service接口
|
||||||
|
*
|
||||||
|
* @author may
|
||||||
|
* @date 2024-03-30
|
||||||
|
*/
|
||||||
|
public interface IWfNodeConfigService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询节点配置
|
||||||
|
*
|
||||||
|
* @param id 主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
WfNodeConfigVo queryById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存节点配置
|
||||||
|
*
|
||||||
|
* @param list 参数
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
Boolean saveOrUpdate(List<WfNodeConfig> list);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除节点配置信息
|
||||||
|
*
|
||||||
|
* @param ids 主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
Boolean deleteByIds(Collection<Long> ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 按照流程定义id删除
|
||||||
|
*
|
||||||
|
* @param ids 流程定义id
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
Boolean deleteByDefIds(Collection<String> ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 按照流程定义id查询
|
||||||
|
*
|
||||||
|
* @param ids 流程定义id
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
List<WfNodeConfigVo> selectByDefIds(Collection<String> ids);
|
||||||
|
}
|
@ -8,7 +8,7 @@ import org.dromara.workflow.service.IActHiTaskinstService;
|
|||||||
/**
|
/**
|
||||||
* 流程历史任务Service业务层处理
|
* 流程历史任务Service业务层处理
|
||||||
*
|
*
|
||||||
* @author gssong
|
* @author may
|
||||||
* @date 2024-03-02
|
* @date 2024-03-02
|
||||||
*/
|
*/
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
|
@ -7,27 +7,30 @@ import cn.hutool.core.util.ObjectUtil;
|
|||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import cn.hutool.core.util.ZipUtil;
|
import cn.hutool.core.util.ZipUtil;
|
||||||
import cn.hutool.json.JSONUtil;
|
import cn.hutool.json.JSONUtil;
|
||||||
|
import com.alibaba.excel.util.StringUtils;
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.apache.batik.transcoder.TranscoderInput;
|
import org.apache.batik.transcoder.TranscoderInput;
|
||||||
import org.apache.batik.transcoder.TranscoderOutput;
|
import org.apache.batik.transcoder.TranscoderOutput;
|
||||||
import org.apache.batik.transcoder.image.PNGTranscoder;
|
import org.apache.batik.transcoder.image.PNGTranscoder;
|
||||||
import org.apache.commons.io.IOUtils;
|
import org.apache.commons.io.IOUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
|
||||||
import org.dromara.common.core.exception.ServiceException;
|
import org.dromara.common.core.exception.ServiceException;
|
||||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||||
import org.dromara.common.tenant.helper.TenantHelper;
|
import org.dromara.common.tenant.helper.TenantHelper;
|
||||||
import org.dromara.workflow.common.constant.FlowConstant;
|
import org.dromara.workflow.common.constant.FlowConstant;
|
||||||
|
import org.dromara.workflow.domain.WfNodeConfig;
|
||||||
import org.dromara.workflow.domain.bo.ModelBo;
|
import org.dromara.workflow.domain.bo.ModelBo;
|
||||||
import org.dromara.workflow.domain.bo.WfFormDefinitionBo;
|
import org.dromara.workflow.domain.bo.WfDefinitionConfigBo;
|
||||||
import org.dromara.workflow.domain.vo.ModelVo;
|
import org.dromara.workflow.domain.vo.ModelVo;
|
||||||
import org.dromara.workflow.domain.vo.WfFormDefinitionVo;
|
import org.dromara.workflow.domain.vo.WfDefinitionConfigVo;
|
||||||
import org.dromara.workflow.service.IActModelService;
|
import org.dromara.workflow.service.IActModelService;
|
||||||
import org.dromara.workflow.service.IWfFormDefinitionService;
|
import org.dromara.workflow.service.IWfDefinitionConfigService;
|
||||||
|
import org.dromara.workflow.service.IWfNodeConfigService;
|
||||||
import org.dromara.workflow.utils.ModelUtils;
|
import org.dromara.workflow.utils.ModelUtils;
|
||||||
import org.dromara.workflow.utils.QueryUtils;
|
import org.dromara.workflow.utils.QueryUtils;
|
||||||
import org.flowable.bpmn.model.BpmnModel;
|
import org.flowable.bpmn.model.BpmnModel;
|
||||||
|
import org.flowable.bpmn.model.UserTask;
|
||||||
import org.flowable.engine.RepositoryService;
|
import org.flowable.engine.RepositoryService;
|
||||||
import org.flowable.engine.repository.*;
|
import org.flowable.engine.repository.*;
|
||||||
import org.flowable.validation.ValidationError;
|
import org.flowable.validation.ValidationError;
|
||||||
@ -40,6 +43,7 @@ import java.io.IOException;
|
|||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.net.URLEncoder;
|
import java.net.URLEncoder;
|
||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
import java.util.zip.ZipEntry;
|
import java.util.zip.ZipEntry;
|
||||||
@ -55,7 +59,8 @@ import java.util.zip.ZipOutputStream;
|
|||||||
public class ActModelServiceImpl implements IActModelService {
|
public class ActModelServiceImpl implements IActModelService {
|
||||||
|
|
||||||
private final RepositoryService repositoryService;
|
private final RepositoryService repositoryService;
|
||||||
private final IWfFormDefinitionService iWfFormDefinitionService;
|
private final IWfDefinitionConfigService iWfDefinitionConfigService;
|
||||||
|
private final IWfNodeConfigService iWfNodeConfigService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 分页查询模型
|
* 分页查询模型
|
||||||
@ -66,13 +71,13 @@ public class ActModelServiceImpl implements IActModelService {
|
|||||||
@Override
|
@Override
|
||||||
public TableDataInfo<Model> page(ModelBo modelBo, PageQuery pageQuery) {
|
public TableDataInfo<Model> page(ModelBo modelBo, PageQuery pageQuery) {
|
||||||
ModelQuery query = QueryUtils.modelQuery();
|
ModelQuery query = QueryUtils.modelQuery();
|
||||||
if (StringUtils.isNotEmpty(modelBo.getName())) {
|
if (StringUtils.isNotBlank(modelBo.getName())) {
|
||||||
query.modelNameLike("%" + modelBo.getName() + "%");
|
query.modelNameLike("%" + modelBo.getName() + "%");
|
||||||
}
|
}
|
||||||
if (StringUtils.isNotEmpty(modelBo.getKey())) {
|
if (StringUtils.isNotBlank(modelBo.getKey())) {
|
||||||
query.modelKey(modelBo.getKey());
|
query.modelKey(modelBo.getKey());
|
||||||
}
|
}
|
||||||
if (StringUtils.isNotEmpty(modelBo.getCategoryCode())) {
|
if (StringUtils.isNotBlank(modelBo.getCategoryCode())) {
|
||||||
query.modelCategory(modelBo.getCategoryCode());
|
query.modelCategory(modelBo.getCategoryCode());
|
||||||
}
|
}
|
||||||
query.orderByLastUpdateTime().desc();
|
query.orderByLastUpdateTime().desc();
|
||||||
@ -279,17 +284,36 @@ public class ActModelServiceImpl implements IActModelService {
|
|||||||
// 更新分类
|
// 更新分类
|
||||||
ProcessDefinition definition = QueryUtils.definitionQuery().deploymentId(deployment.getId()).singleResult();
|
ProcessDefinition definition = QueryUtils.definitionQuery().deploymentId(deployment.getId()).singleResult();
|
||||||
repositoryService.setProcessDefinitionCategory(definition.getId(), model.getCategory());
|
repositoryService.setProcessDefinitionCategory(definition.getId(), model.getCategory());
|
||||||
|
//更新流程定义表单
|
||||||
if (processDefinition != null) {
|
if (processDefinition != null) {
|
||||||
WfFormDefinitionVo definitionVo = iWfFormDefinitionService.getByDefId(processDefinition.getId());
|
WfDefinitionConfigVo definitionVo = iWfDefinitionConfigService.getByDefId(processDefinition.getId());
|
||||||
if (definitionVo != null) {
|
if (definitionVo != null) {
|
||||||
WfFormDefinitionBo wfFormDefinition = new WfFormDefinitionBo();
|
WfDefinitionConfigBo wfFormDefinition = new WfDefinitionConfigBo();
|
||||||
wfFormDefinition.setDefinitionId(definition.getId());
|
wfFormDefinition.setDefinitionId(definition.getId());
|
||||||
wfFormDefinition.setProcessKey(definition.getKey());
|
wfFormDefinition.setProcessKey(definition.getKey());
|
||||||
wfFormDefinition.setPath(definitionVo.getPath());
|
wfFormDefinition.setFormId(ObjectUtil.isNotNull(definitionVo.getFormId()) ? definitionVo.getFormId() : null);
|
||||||
wfFormDefinition.setRemark(definitionVo.getRemark());
|
wfFormDefinition.setRemark(definitionVo.getRemark());
|
||||||
iWfFormDefinitionService.saveOrUpdate(wfFormDefinition);
|
iWfDefinitionConfigService.saveOrUpdate(wfFormDefinition);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//更新流程节点配置表单
|
||||||
|
List<UserTask> userTasks = ModelUtils.getuserTaskFlowElements(definition.getId());
|
||||||
|
List<WfNodeConfig> wfNodeConfigList = new ArrayList<>();
|
||||||
|
for (UserTask userTask : userTasks) {
|
||||||
|
if (StringUtils.isNotBlank(userTask.getFormKey()) && userTask.getFormKey().contains(StrUtil.COLON)) {
|
||||||
|
WfNodeConfig wfNodeConfig = new WfNodeConfig();
|
||||||
|
wfNodeConfig.setNodeId(userTask.getId());
|
||||||
|
wfNodeConfig.setNodeName(userTask.getName());
|
||||||
|
wfNodeConfig.setDefinitionId(definition.getId());
|
||||||
|
String[] split = userTask.getFormKey().split(StrUtil.COLON);
|
||||||
|
wfNodeConfig.setFormType(split[0]);
|
||||||
|
wfNodeConfig.setFormId(Long.valueOf(split[1]));
|
||||||
|
wfNodeConfigList.add(wfNodeConfig);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (CollUtil.isNotEmpty(wfNodeConfigList)) {
|
||||||
|
iWfNodeConfigService.saveOrUpdate(wfNodeConfigList);
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
@ -7,6 +7,7 @@ import cn.hutool.core.collection.CollectionUtil;
|
|||||||
import cn.hutool.core.io.FileUtil;
|
import cn.hutool.core.io.FileUtil;
|
||||||
import cn.hutool.core.io.IoUtil;
|
import cn.hutool.core.io.IoUtil;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.SneakyThrows;
|
import lombok.SneakyThrows;
|
||||||
import org.apache.commons.io.IOUtils;
|
import org.apache.commons.io.IOUtils;
|
||||||
@ -18,13 +19,18 @@ import org.dromara.common.mybatis.core.page.TableDataInfo;
|
|||||||
import org.dromara.common.tenant.helper.TenantHelper;
|
import org.dromara.common.tenant.helper.TenantHelper;
|
||||||
import org.dromara.workflow.common.constant.FlowConstant;
|
import org.dromara.workflow.common.constant.FlowConstant;
|
||||||
import org.dromara.workflow.domain.WfCategory;
|
import org.dromara.workflow.domain.WfCategory;
|
||||||
|
import org.dromara.workflow.domain.WfNodeConfig;
|
||||||
import org.dromara.workflow.domain.bo.ProcessDefinitionBo;
|
import org.dromara.workflow.domain.bo.ProcessDefinitionBo;
|
||||||
|
import org.dromara.workflow.domain.bo.WfDefinitionConfigBo;
|
||||||
import org.dromara.workflow.domain.vo.ProcessDefinitionVo;
|
import org.dromara.workflow.domain.vo.ProcessDefinitionVo;
|
||||||
import org.dromara.workflow.domain.vo.WfFormDefinitionVo;
|
import org.dromara.workflow.domain.vo.WfDefinitionConfigVo;
|
||||||
import org.dromara.workflow.service.IActProcessDefinitionService;
|
import org.dromara.workflow.service.IActProcessDefinitionService;
|
||||||
import org.dromara.workflow.service.IWfCategoryService;
|
import org.dromara.workflow.service.IWfCategoryService;
|
||||||
import org.dromara.workflow.service.IWfFormDefinitionService;
|
import org.dromara.workflow.service.IWfDefinitionConfigService;
|
||||||
|
import org.dromara.workflow.service.IWfNodeConfigService;
|
||||||
|
import org.dromara.workflow.utils.ModelUtils;
|
||||||
import org.dromara.workflow.utils.QueryUtils;
|
import org.dromara.workflow.utils.QueryUtils;
|
||||||
|
import org.flowable.bpmn.model.UserTask;
|
||||||
import org.flowable.engine.ProcessMigrationService;
|
import org.flowable.engine.ProcessMigrationService;
|
||||||
import org.flowable.engine.RepositoryService;
|
import org.flowable.engine.RepositoryService;
|
||||||
import org.flowable.engine.impl.bpmn.deployer.ResourceNameUtil;
|
import org.flowable.engine.impl.bpmn.deployer.ResourceNameUtil;
|
||||||
@ -38,6 +44,7 @@ import java.io.IOException;
|
|||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.zip.ZipEntry;
|
import java.util.zip.ZipEntry;
|
||||||
import java.util.zip.ZipInputStream;
|
import java.util.zip.ZipInputStream;
|
||||||
@ -54,7 +61,8 @@ public class ActProcessDefinitionServiceImpl implements IActProcessDefinitionSer
|
|||||||
private final RepositoryService repositoryService;
|
private final RepositoryService repositoryService;
|
||||||
private final ProcessMigrationService processMigrationService;
|
private final ProcessMigrationService processMigrationService;
|
||||||
private final IWfCategoryService wfCategoryService;
|
private final IWfCategoryService wfCategoryService;
|
||||||
private final IWfFormDefinitionService iWfFormDefinitionService;
|
private final IWfDefinitionConfigService iWfDefinitionConfigService;
|
||||||
|
private final IWfNodeConfigService iWfNodeConfigService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 分页查询
|
* 分页查询
|
||||||
@ -85,7 +93,7 @@ public class ActProcessDefinitionServiceImpl implements IActProcessDefinitionSer
|
|||||||
}
|
}
|
||||||
if (CollUtil.isNotEmpty(definitionList)) {
|
if (CollUtil.isNotEmpty(definitionList)) {
|
||||||
List<String> ids = StreamUtils.toList(definitionList, ProcessDefinition::getId);
|
List<String> ids = StreamUtils.toList(definitionList, ProcessDefinition::getId);
|
||||||
List<WfFormDefinitionVo> wfFormDefinitionVos = iWfFormDefinitionService.queryList(ids);
|
List<WfDefinitionConfigVo> wfDefinitionConfigVos = iWfDefinitionConfigService.queryList(ids);
|
||||||
for (ProcessDefinition processDefinition : definitionList) {
|
for (ProcessDefinition processDefinition : definitionList) {
|
||||||
ProcessDefinitionVo processDefinitionVo = BeanUtil.toBean(processDefinition, ProcessDefinitionVo.class);
|
ProcessDefinitionVo processDefinitionVo = BeanUtil.toBean(processDefinition, ProcessDefinitionVo.class);
|
||||||
if (CollUtil.isNotEmpty(deploymentList)) {
|
if (CollUtil.isNotEmpty(deploymentList)) {
|
||||||
@ -94,8 +102,8 @@ public class ActProcessDefinitionServiceImpl implements IActProcessDefinitionSer
|
|||||||
processDefinitionVo.setDeploymentTime(e.getDeploymentTime());
|
processDefinitionVo.setDeploymentTime(e.getDeploymentTime());
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (CollUtil.isNotEmpty(wfFormDefinitionVos)) {
|
if (CollUtil.isNotEmpty(wfDefinitionConfigVos)) {
|
||||||
wfFormDefinitionVos.stream().filter(e -> e.getDefinitionId().equals(processDefinition.getId())).findFirst().ifPresent(processDefinitionVo::setWfFormDefinitionVo);
|
wfDefinitionConfigVos.stream().filter(e -> e.getDefinitionId().equals(processDefinition.getId())).findFirst().ifPresent(processDefinitionVo::setWfDefinitionConfigVo);
|
||||||
}
|
}
|
||||||
processDefinitionVoList.add(processDefinitionVo);
|
processDefinitionVoList.add(processDefinitionVo);
|
||||||
}
|
}
|
||||||
@ -125,7 +133,7 @@ public class ActProcessDefinitionServiceImpl implements IActProcessDefinitionSer
|
|||||||
}
|
}
|
||||||
if (CollUtil.isNotEmpty(definitionList)) {
|
if (CollUtil.isNotEmpty(definitionList)) {
|
||||||
List<String> ids = StreamUtils.toList(definitionList, ProcessDefinition::getId);
|
List<String> ids = StreamUtils.toList(definitionList, ProcessDefinition::getId);
|
||||||
List<WfFormDefinitionVo> wfFormDefinitionVos = iWfFormDefinitionService.queryList(ids);
|
List<WfDefinitionConfigVo> wfDefinitionConfigVos = iWfDefinitionConfigService.queryList(ids);
|
||||||
for (ProcessDefinition processDefinition : definitionList) {
|
for (ProcessDefinition processDefinition : definitionList) {
|
||||||
ProcessDefinitionVo processDefinitionVo = BeanUtil.toBean(processDefinition, ProcessDefinitionVo.class);
|
ProcessDefinitionVo processDefinitionVo = BeanUtil.toBean(processDefinition, ProcessDefinitionVo.class);
|
||||||
if (CollUtil.isNotEmpty(deploymentList)) {
|
if (CollUtil.isNotEmpty(deploymentList)) {
|
||||||
@ -133,8 +141,8 @@ public class ActProcessDefinitionServiceImpl implements IActProcessDefinitionSer
|
|||||||
deploymentList.stream().filter(e -> e.getId().equals(processDefinition.getDeploymentId())).findFirst().ifPresent(e -> {
|
deploymentList.stream().filter(e -> e.getId().equals(processDefinition.getDeploymentId())).findFirst().ifPresent(e -> {
|
||||||
processDefinitionVo.setDeploymentTime(e.getDeploymentTime());
|
processDefinitionVo.setDeploymentTime(e.getDeploymentTime());
|
||||||
});
|
});
|
||||||
if (CollUtil.isNotEmpty(wfFormDefinitionVos)) {
|
if (CollUtil.isNotEmpty(wfDefinitionConfigVos)) {
|
||||||
wfFormDefinitionVos.stream().filter(e -> e.getDefinitionId().equals(processDefinition.getId())).findFirst().ifPresent(processDefinitionVo::setWfFormDefinitionVo);
|
wfDefinitionConfigVos.stream().filter(e -> e.getDefinitionId().equals(processDefinition.getId())).findFirst().ifPresent(processDefinitionVo::setWfDefinitionConfigVo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
processDefinitionVoList.add(processDefinitionVo);
|
processDefinitionVoList.add(processDefinitionVo);
|
||||||
@ -192,7 +200,9 @@ public class ActProcessDefinitionServiceImpl implements IActProcessDefinitionSer
|
|||||||
//删除流程定义
|
//删除流程定义
|
||||||
repositoryService.deleteDeployment(deploymentId);
|
repositoryService.deleteDeployment(deploymentId);
|
||||||
//删除表单配置
|
//删除表单配置
|
||||||
iWfFormDefinitionService.getByDefId(processDefinitionId);
|
iWfDefinitionConfigService.deleteByDefIds(Collections.singletonList(processDefinitionId));
|
||||||
|
//删除节点配置
|
||||||
|
iWfNodeConfigService.deleteByDefIds(Collections.singletonList(processDefinitionId));
|
||||||
return true;
|
return true;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
@ -313,12 +323,14 @@ public class ActProcessDefinitionServiceImpl implements IActProcessDefinitionSer
|
|||||||
String processName = splitFilename[0];
|
String processName = splitFilename[0];
|
||||||
//流程key
|
//流程key
|
||||||
String processKey = splitFilename[1];
|
String processKey = splitFilename[1];
|
||||||
|
ProcessDefinition oldProcessDefinition = QueryUtils.definitionQuery().processDefinitionKey(processKey).latestVersion().singleResult();
|
||||||
DeploymentBuilder builder = repositoryService.createDeployment();
|
DeploymentBuilder builder = repositoryService.createDeployment();
|
||||||
Deployment deployment = builder.addInputStream(filename, zipInputStream)
|
Deployment deployment = builder.addInputStream(filename, zipInputStream)
|
||||||
.tenantId(TenantHelper.getTenantId())
|
.tenantId(TenantHelper.getTenantId())
|
||||||
.name(processName).key(processKey).category(categoryCode).deploy();
|
.name(processName).key(processKey).category(categoryCode).deploy();
|
||||||
ProcessDefinition definition = QueryUtils.definitionQuery().deploymentId(deployment.getId()).singleResult();
|
ProcessDefinition definition = QueryUtils.definitionQuery().deploymentId(deployment.getId()).singleResult();
|
||||||
repositoryService.setProcessDefinitionCategory(definition.getId(), categoryCode);
|
repositoryService.setProcessDefinitionCategory(definition.getId(), categoryCode);
|
||||||
|
setForm(oldProcessDefinition, definition);
|
||||||
zipInputStream.closeEntry();
|
zipInputStream.closeEntry();
|
||||||
}
|
}
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
@ -341,6 +353,8 @@ public class ActProcessDefinitionServiceImpl implements IActProcessDefinitionSer
|
|||||||
String processName = splitFilename[0];
|
String processName = splitFilename[0];
|
||||||
//流程key
|
//流程key
|
||||||
String processKey = splitFilename[1];
|
String processKey = splitFilename[1];
|
||||||
|
ProcessDefinition oldProcessDefinition = QueryUtils.definitionQuery().processDefinitionKey(processKey).latestVersion().singleResult();
|
||||||
|
|
||||||
DeploymentBuilder builder = repositoryService.createDeployment();
|
DeploymentBuilder builder = repositoryService.createDeployment();
|
||||||
Deployment deployment = builder.addInputStream(originalFilename, inputStream)
|
Deployment deployment = builder.addInputStream(originalFilename, inputStream)
|
||||||
.tenantId(TenantHelper.getTenantId())
|
.tenantId(TenantHelper.getTenantId())
|
||||||
@ -348,10 +362,51 @@ public class ActProcessDefinitionServiceImpl implements IActProcessDefinitionSer
|
|||||||
// 更新分类
|
// 更新分类
|
||||||
ProcessDefinition definition = QueryUtils.definitionQuery().deploymentId(deployment.getId()).singleResult();
|
ProcessDefinition definition = QueryUtils.definitionQuery().deploymentId(deployment.getId()).singleResult();
|
||||||
repositoryService.setProcessDefinitionCategory(definition.getId(), categoryCode);
|
repositoryService.setProcessDefinitionCategory(definition.getId(), categoryCode);
|
||||||
|
setForm(oldProcessDefinition, definition);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
throw new ServiceException("文件类型上传错误!");
|
throw new ServiceException("文件类型上传错误!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置表单内容
|
||||||
|
*
|
||||||
|
* @param oldProcessDefinition 部署前最新流程定义
|
||||||
|
* @param definition 部署后最新流程定义
|
||||||
|
*/
|
||||||
|
private void setForm(ProcessDefinition oldProcessDefinition, ProcessDefinition definition) {
|
||||||
|
//更新流程定义表单
|
||||||
|
if (oldProcessDefinition != null) {
|
||||||
|
WfDefinitionConfigVo definitionVo = iWfDefinitionConfigService.getByDefId(oldProcessDefinition.getId());
|
||||||
|
if (definitionVo != null) {
|
||||||
|
WfDefinitionConfigBo wfFormDefinition = new WfDefinitionConfigBo();
|
||||||
|
wfFormDefinition.setDefinitionId(definition.getId());
|
||||||
|
wfFormDefinition.setProcessKey(definition.getKey());
|
||||||
|
wfFormDefinition.setFormId(ObjectUtil.isNotNull(definitionVo.getFormId()) ? definitionVo.getFormId() : null);
|
||||||
|
wfFormDefinition.setRemark(definitionVo.getRemark());
|
||||||
|
iWfDefinitionConfigService.saveOrUpdate(wfFormDefinition);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//更新流程节点配置表单
|
||||||
|
List<UserTask> userTasks = ModelUtils.getuserTaskFlowElements(definition.getId());
|
||||||
|
List<WfNodeConfig> wfNodeConfigList = new ArrayList<>();
|
||||||
|
for (UserTask userTask : userTasks) {
|
||||||
|
if (StringUtils.isNotBlank(userTask.getFormKey()) && userTask.getFormKey().contains(StrUtil.COLON)) {
|
||||||
|
WfNodeConfig wfNodeConfig = new WfNodeConfig();
|
||||||
|
wfNodeConfig.setNodeId(userTask.getId());
|
||||||
|
wfNodeConfig.setNodeName(userTask.getName());
|
||||||
|
wfNodeConfig.setDefinitionId(definition.getId());
|
||||||
|
String[] split = userTask.getFormKey().split(StrUtil.COLON);
|
||||||
|
wfNodeConfig.setFormType(split[0]);
|
||||||
|
wfNodeConfig.setFormId(Long.valueOf(split[1]));
|
||||||
|
wfNodeConfigList.add(wfNodeConfig);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (CollUtil.isNotEmpty(wfNodeConfigList)) {
|
||||||
|
iWfNodeConfigService.saveOrUpdate(wfNodeConfigList);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -122,7 +122,7 @@ public class ActProcessInstanceServiceImpl implements IActProcessInstanceService
|
|||||||
}
|
}
|
||||||
if (CollUtil.isNotEmpty(list)) {
|
if (CollUtil.isNotEmpty(list)) {
|
||||||
List<String> processDefinitionIds = StreamUtils.toList(list, ProcessInstanceVo::getProcessDefinitionId);
|
List<String> processDefinitionIds = StreamUtils.toList(list, ProcessInstanceVo::getProcessDefinitionId);
|
||||||
WorkflowUtils.setWfFormDefinitionVo(list, processDefinitionIds, PROCESS_DEFINITION_ID);
|
WorkflowUtils.setWfDefinitionConfigVo(list, processDefinitionIds, PROCESS_DEFINITION_ID);
|
||||||
}
|
}
|
||||||
long count = query.count();
|
long count = query.count();
|
||||||
TableDataInfo<ProcessInstanceVo> build = TableDataInfo.build();
|
TableDataInfo<ProcessInstanceVo> build = TableDataInfo.build();
|
||||||
@ -164,7 +164,7 @@ public class ActProcessInstanceServiceImpl implements IActProcessInstanceService
|
|||||||
}
|
}
|
||||||
if (CollUtil.isNotEmpty(list)) {
|
if (CollUtil.isNotEmpty(list)) {
|
||||||
List<String> processDefinitionIds = StreamUtils.toList(list, ProcessInstanceVo::getProcessDefinitionId);
|
List<String> processDefinitionIds = StreamUtils.toList(list, ProcessInstanceVo::getProcessDefinitionId);
|
||||||
WorkflowUtils.setWfFormDefinitionVo(list, processDefinitionIds, PROCESS_DEFINITION_ID);
|
WorkflowUtils.setWfDefinitionConfigVo(list, processDefinitionIds, PROCESS_DEFINITION_ID);
|
||||||
}
|
}
|
||||||
long count = query.count();
|
long count = query.count();
|
||||||
TableDataInfo<ProcessInstanceVo> build = TableDataInfo.build();
|
TableDataInfo<ProcessInstanceVo> build = TableDataInfo.build();
|
||||||
@ -669,7 +669,7 @@ public class ActProcessInstanceServiceImpl implements IActProcessInstanceService
|
|||||||
}
|
}
|
||||||
if (CollUtil.isNotEmpty(list)) {
|
if (CollUtil.isNotEmpty(list)) {
|
||||||
List<String> processDefinitionIds = StreamUtils.toList(list, ProcessInstanceVo::getProcessDefinitionId);
|
List<String> processDefinitionIds = StreamUtils.toList(list, ProcessInstanceVo::getProcessDefinitionId);
|
||||||
WorkflowUtils.setWfFormDefinitionVo(list, processDefinitionIds, PROCESS_DEFINITION_ID);
|
WorkflowUtils.setWfDefinitionConfigVo(list, processDefinitionIds, PROCESS_DEFINITION_ID);
|
||||||
}
|
}
|
||||||
long count = query.count();
|
long count = query.count();
|
||||||
TableDataInfo<ProcessInstanceVo> build = TableDataInfo.build();
|
TableDataInfo<ProcessInstanceVo> build = TableDataInfo.build();
|
||||||
|
@ -30,6 +30,7 @@ import org.dromara.workflow.flowable.strategy.FlowTaskEventHandler;
|
|||||||
import org.dromara.workflow.mapper.ActHiTaskinstMapper;
|
import org.dromara.workflow.mapper.ActHiTaskinstMapper;
|
||||||
import org.dromara.workflow.mapper.ActTaskMapper;
|
import org.dromara.workflow.mapper.ActTaskMapper;
|
||||||
import org.dromara.workflow.service.IActTaskService;
|
import org.dromara.workflow.service.IActTaskService;
|
||||||
|
import org.dromara.workflow.service.IWfNodeConfigService;
|
||||||
import org.dromara.workflow.service.IWfTaskBackNodeService;
|
import org.dromara.workflow.service.IWfTaskBackNodeService;
|
||||||
import org.dromara.workflow.utils.ModelUtils;
|
import org.dromara.workflow.utils.ModelUtils;
|
||||||
import org.dromara.workflow.utils.QueryUtils;
|
import org.dromara.workflow.utils.QueryUtils;
|
||||||
@ -76,6 +77,7 @@ public class ActTaskServiceImpl implements IActTaskService {
|
|||||||
private final ActTaskMapper actTaskMapper;
|
private final ActTaskMapper actTaskMapper;
|
||||||
private final IWfTaskBackNodeService iWfTaskBackNodeService;
|
private final IWfTaskBackNodeService iWfTaskBackNodeService;
|
||||||
private final ActHiTaskinstMapper actHiTaskinstMapper;
|
private final ActHiTaskinstMapper actHiTaskinstMapper;
|
||||||
|
private final IWfNodeConfigService iWfNodeConfigService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 启动任务
|
* 启动任务
|
||||||
@ -273,13 +275,17 @@ public class ActTaskServiceImpl implements IActTaskService {
|
|||||||
|
|
||||||
List<TaskVo> taskList = page.getRecords();
|
List<TaskVo> taskList = page.getRecords();
|
||||||
if (CollUtil.isNotEmpty(taskList)) {
|
if (CollUtil.isNotEmpty(taskList)) {
|
||||||
|
List<String> processDefinitionIds = StreamUtils.toList(taskList, TaskVo::getProcessDefinitionId);
|
||||||
|
List<WfNodeConfigVo> wfNodeConfigVoList = iWfNodeConfigService.selectByDefIds(processDefinitionIds);
|
||||||
for (TaskVo task : taskList) {
|
for (TaskVo task : taskList) {
|
||||||
task.setBusinessStatusName(BusinessStatusEnum.findByStatus(task.getBusinessStatus()));
|
task.setBusinessStatusName(BusinessStatusEnum.findByStatus(task.getBusinessStatus()));
|
||||||
task.setParticipantVo(WorkflowUtils.getCurrentTaskParticipant(task.getId()));
|
task.setParticipantVo(WorkflowUtils.getCurrentTaskParticipant(task.getId()));
|
||||||
task.setMultiInstance(WorkflowUtils.isMultiInstance(task.getProcessDefinitionId(), task.getTaskDefinitionKey()) != null);
|
task.setMultiInstance(WorkflowUtils.isMultiInstance(task.getProcessDefinitionId(), task.getTaskDefinitionKey()) != null);
|
||||||
|
if (CollUtil.isNotEmpty(wfNodeConfigVoList)) {
|
||||||
|
wfNodeConfigVoList.stream().filter(e -> e.getDefinitionId().equals(task.getProcessDefinitionId()) && e.getNodeId().equals(task.getTaskDefinitionKey())).findFirst().ifPresent(task::setWfNodeConfigVo);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
List<String> processDefinitionIds = StreamUtils.toList(taskList, TaskVo::getProcessDefinitionId);
|
WorkflowUtils.setWfDefinitionConfigVo(taskList, processDefinitionIds, PROCESS_DEFINITION_ID);
|
||||||
WorkflowUtils.setWfFormDefinitionVo(taskList, processDefinitionIds, PROCESS_DEFINITION_ID);
|
|
||||||
}
|
}
|
||||||
return TableDataInfo.build(page);
|
return TableDataInfo.build(page);
|
||||||
}
|
}
|
||||||
@ -322,25 +328,29 @@ public class ActTaskServiceImpl implements IActTaskService {
|
|||||||
processInstanceList = QueryUtils.instanceQuery(processInstanceIds).list();
|
processInstanceList = QueryUtils.instanceQuery(processInstanceIds).list();
|
||||||
}
|
}
|
||||||
List<TaskVo> list = new ArrayList<>();
|
List<TaskVo> list = new ArrayList<>();
|
||||||
for (Task task : taskList) {
|
if (CollUtil.isNotEmpty(taskList)) {
|
||||||
TaskVo taskVo = BeanUtil.toBean(task, TaskVo.class);
|
List<String> processDefinitionIds = StreamUtils.toList(taskList, Task::getProcessDefinitionId);
|
||||||
if (CollUtil.isNotEmpty(processInstanceList)) {
|
List<WfNodeConfigVo> wfNodeConfigVoList = iWfNodeConfigService.selectByDefIds(processDefinitionIds);
|
||||||
processInstanceList.stream().filter(e -> e.getId().equals(task.getProcessInstanceId())).findFirst().ifPresent(e -> {
|
for (Task task : taskList) {
|
||||||
taskVo.setBusinessStatus(e.getBusinessStatus());
|
TaskVo taskVo = BeanUtil.toBean(task, TaskVo.class);
|
||||||
taskVo.setBusinessStatusName(BusinessStatusEnum.findByStatus(taskVo.getBusinessStatus()));
|
if (CollUtil.isNotEmpty(processInstanceList)) {
|
||||||
taskVo.setProcessDefinitionKey(e.getProcessDefinitionKey());
|
processInstanceList.stream().filter(e -> e.getId().equals(task.getProcessInstanceId())).findFirst().ifPresent(e -> {
|
||||||
taskVo.setProcessDefinitionName(e.getProcessDefinitionName());
|
taskVo.setBusinessStatus(e.getBusinessStatus());
|
||||||
taskVo.setBusinessKey(e.getBusinessKey());
|
taskVo.setBusinessStatusName(BusinessStatusEnum.findByStatus(taskVo.getBusinessStatus()));
|
||||||
});
|
taskVo.setProcessDefinitionKey(e.getProcessDefinitionKey());
|
||||||
|
taskVo.setProcessDefinitionName(e.getProcessDefinitionName());
|
||||||
|
taskVo.setBusinessKey(e.getBusinessKey());
|
||||||
|
});
|
||||||
|
}
|
||||||
|
taskVo.setAssignee(StringUtils.isNotBlank(task.getAssignee()) ? Long.valueOf(task.getAssignee()) : null);
|
||||||
|
taskVo.setParticipantVo(WorkflowUtils.getCurrentTaskParticipant(task.getId()));
|
||||||
|
taskVo.setMultiInstance(WorkflowUtils.isMultiInstance(task.getProcessDefinitionId(), task.getTaskDefinitionKey()) != null);
|
||||||
|
if (CollUtil.isNotEmpty(wfNodeConfigVoList)) {
|
||||||
|
wfNodeConfigVoList.stream().filter(e -> e.getDefinitionId().equals(task.getProcessDefinitionId()) && e.getNodeId().equals(task.getTaskDefinitionKey())).findFirst().ifPresent(taskVo::setWfNodeConfigVo);
|
||||||
|
}
|
||||||
|
list.add(taskVo);
|
||||||
}
|
}
|
||||||
taskVo.setAssignee(StringUtils.isNotBlank(task.getAssignee()) ? Long.valueOf(task.getAssignee()) : null);
|
WorkflowUtils.setWfDefinitionConfigVo(list, processDefinitionIds, PROCESS_DEFINITION_ID);
|
||||||
taskVo.setParticipantVo(WorkflowUtils.getCurrentTaskParticipant(task.getId()));
|
|
||||||
taskVo.setMultiInstance(WorkflowUtils.isMultiInstance(task.getProcessDefinitionId(), task.getTaskDefinitionKey()) != null);
|
|
||||||
list.add(taskVo);
|
|
||||||
}
|
|
||||||
if (CollUtil.isNotEmpty(list)) {
|
|
||||||
List<String> processDefinitionIds = StreamUtils.toList(list, TaskVo::getProcessDefinitionId);
|
|
||||||
WorkflowUtils.setWfFormDefinitionVo(list, processDefinitionIds, PROCESS_DEFINITION_ID);
|
|
||||||
}
|
}
|
||||||
long count = query.count();
|
long count = query.count();
|
||||||
TableDataInfo<TaskVo> build = TableDataInfo.build();
|
TableDataInfo<TaskVo> build = TableDataInfo.build();
|
||||||
@ -366,11 +376,15 @@ public class ActTaskServiceImpl implements IActTaskService {
|
|||||||
|
|
||||||
List<TaskVo> taskList = page.getRecords();
|
List<TaskVo> taskList = page.getRecords();
|
||||||
if (CollUtil.isNotEmpty(taskList)) {
|
if (CollUtil.isNotEmpty(taskList)) {
|
||||||
|
List<String> processDefinitionIds = StreamUtils.toList(taskList, TaskVo::getProcessDefinitionId);
|
||||||
|
List<WfNodeConfigVo> wfNodeConfigVoList = iWfNodeConfigService.selectByDefIds(processDefinitionIds);
|
||||||
for (TaskVo task : taskList) {
|
for (TaskVo task : taskList) {
|
||||||
task.setBusinessStatusName(BusinessStatusEnum.findByStatus(task.getBusinessStatus()));
|
task.setBusinessStatusName(BusinessStatusEnum.findByStatus(task.getBusinessStatus()));
|
||||||
|
if (CollUtil.isNotEmpty(wfNodeConfigVoList)) {
|
||||||
|
wfNodeConfigVoList.stream().filter(e -> e.getDefinitionId().equals(task.getProcessDefinitionId()) && e.getNodeId().equals(task.getTaskDefinitionKey())).findFirst().ifPresent(task::setWfNodeConfigVo);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
List<String> processDefinitionIds = StreamUtils.toList(taskList, TaskVo::getProcessDefinitionId);
|
WorkflowUtils.setWfDefinitionConfigVo(taskList, processDefinitionIds, PROCESS_DEFINITION_ID);
|
||||||
WorkflowUtils.setWfFormDefinitionVo(taskList, processDefinitionIds, PROCESS_DEFINITION_ID);
|
|
||||||
}
|
}
|
||||||
return TableDataInfo.build(page);
|
return TableDataInfo.build(page);
|
||||||
}
|
}
|
||||||
@ -397,12 +411,17 @@ public class ActTaskServiceImpl implements IActTaskService {
|
|||||||
Page<TaskVo> page = actTaskMapper.getTaskCopyByPage(pageQuery.build(), queryWrapper);
|
Page<TaskVo> page = actTaskMapper.getTaskCopyByPage(pageQuery.build(), queryWrapper);
|
||||||
|
|
||||||
List<TaskVo> taskList = page.getRecords();
|
List<TaskVo> taskList = page.getRecords();
|
||||||
for (TaskVo task : taskList) {
|
|
||||||
task.setBusinessStatusName(BusinessStatusEnum.findByStatus(task.getBusinessStatus()));
|
|
||||||
}
|
|
||||||
if (CollUtil.isNotEmpty(taskList)) {
|
if (CollUtil.isNotEmpty(taskList)) {
|
||||||
List<String> processDefinitionIds = StreamUtils.toList(taskList, TaskVo::getProcessDefinitionId);
|
List<String> processDefinitionIds = StreamUtils.toList(taskList, TaskVo::getProcessDefinitionId);
|
||||||
WorkflowUtils.setWfFormDefinitionVo(taskList, processDefinitionIds, PROCESS_DEFINITION_ID);
|
List<WfNodeConfigVo> wfNodeConfigVoList = iWfNodeConfigService.selectByDefIds(processDefinitionIds);
|
||||||
|
for (TaskVo task : taskList) {
|
||||||
|
task.setBusinessStatusName(BusinessStatusEnum.findByStatus(task.getBusinessStatus()));
|
||||||
|
if (CollUtil.isNotEmpty(wfNodeConfigVoList)) {
|
||||||
|
wfNodeConfigVoList.stream().filter(e -> e.getDefinitionId().equals(task.getProcessDefinitionId()) && e.getNodeId().equals(task.getTaskDefinitionKey())).findFirst().ifPresent(task::setWfNodeConfigVo);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
WorkflowUtils.setWfDefinitionConfigVo(taskList, processDefinitionIds, PROCESS_DEFINITION_ID);
|
||||||
|
|
||||||
}
|
}
|
||||||
return TableDataInfo.build(page);
|
return TableDataInfo.build(page);
|
||||||
}
|
}
|
||||||
@ -426,7 +445,7 @@ public class ActTaskServiceImpl implements IActTaskService {
|
|||||||
}
|
}
|
||||||
if (CollUtil.isNotEmpty(taskList)) {
|
if (CollUtil.isNotEmpty(taskList)) {
|
||||||
List<String> processDefinitionIds = StreamUtils.toList(taskList, TaskVo::getProcessDefinitionId);
|
List<String> processDefinitionIds = StreamUtils.toList(taskList, TaskVo::getProcessDefinitionId);
|
||||||
WorkflowUtils.setWfFormDefinitionVo(taskList, processDefinitionIds, PROCESS_DEFINITION_ID);
|
WorkflowUtils.setWfDefinitionConfigVo(taskList, processDefinitionIds, PROCESS_DEFINITION_ID);
|
||||||
}
|
}
|
||||||
return TableDataInfo.build(page);
|
return TableDataInfo.build(page);
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,71 @@
|
|||||||
|
package org.dromara.workflow.service.impl;
|
||||||
|
|
||||||
|
import org.dromara.common.core.utils.MapstructUtils;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.dromara.workflow.domain.WfDefinitionConfig;
|
||||||
|
import org.dromara.workflow.domain.bo.WfDefinitionConfigBo;
|
||||||
|
import org.dromara.workflow.domain.vo.WfDefinitionConfigVo;
|
||||||
|
import org.dromara.workflow.service.IWfDefinitionConfigService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.dromara.workflow.mapper.WfDefinitionConfigMapper;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Collection;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 表单配置Service业务层处理
|
||||||
|
*
|
||||||
|
* @author may
|
||||||
|
* @date 2024-03-18
|
||||||
|
*/
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Service
|
||||||
|
public class WfDefinitionConfigServiceImpl implements IWfDefinitionConfigService {
|
||||||
|
|
||||||
|
private final WfDefinitionConfigMapper baseMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询表单配置
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public WfDefinitionConfigVo getByDefId(String definitionId) {
|
||||||
|
return baseMapper.selectVoOne(new LambdaQueryWrapper<WfDefinitionConfig>().eq(WfDefinitionConfig::getDefinitionId, definitionId));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询表单配置列表
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<WfDefinitionConfigVo> queryList(List<String> definitionIds) {
|
||||||
|
return baseMapper.selectVoList(new LambdaQueryWrapper<WfDefinitionConfig>().in(WfDefinitionConfig::getDefinitionId, definitionIds));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增表单配置
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public Boolean saveOrUpdate(WfDefinitionConfigBo bo) {
|
||||||
|
WfDefinitionConfig add = MapstructUtils.convert(bo, WfDefinitionConfig.class);
|
||||||
|
boolean flag = baseMapper.insertOrUpdate(add);
|
||||||
|
if (baseMapper.insertOrUpdate(add)) {
|
||||||
|
bo.setId(add.getId());
|
||||||
|
}
|
||||||
|
return flag;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除表单配置
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Boolean deleteByIds(Collection<Long> ids) {
|
||||||
|
return baseMapper.deleteBatchIds(ids) > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Boolean deleteByDefIds(Collection<String> ids) {
|
||||||
|
return baseMapper.delete(new LambdaQueryWrapper<WfDefinitionConfig>().in(WfDefinitionConfig::getDefinitionId, ids)) > 0;
|
||||||
|
}
|
||||||
|
}
|
@ -1,66 +0,0 @@
|
|||||||
package org.dromara.workflow.service.impl;
|
|
||||||
|
|
||||||
import org.dromara.common.core.utils.MapstructUtils;
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
import org.dromara.workflow.domain.bo.WfFormDefinitionBo;
|
|
||||||
import org.dromara.workflow.domain.vo.WfFormDefinitionVo;
|
|
||||||
import org.dromara.workflow.domain.WfFormDefinition;
|
|
||||||
import org.dromara.workflow.mapper.WfFormDefinitionMapper;
|
|
||||||
import org.dromara.workflow.service.IWfFormDefinitionService;
|
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Collection;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 表单配置Service业务层处理
|
|
||||||
*
|
|
||||||
* @author gssong
|
|
||||||
* @date 2024-03-18
|
|
||||||
*/
|
|
||||||
@RequiredArgsConstructor
|
|
||||||
@Service
|
|
||||||
public class WfFormDefinitionServiceImpl implements IWfFormDefinitionService {
|
|
||||||
|
|
||||||
private final WfFormDefinitionMapper baseMapper;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询表单配置
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public WfFormDefinitionVo getByDefId(String definitionId) {
|
|
||||||
return baseMapper.selectVoOne(new LambdaQueryWrapper<WfFormDefinition>().eq(WfFormDefinition::getDefinitionId, definitionId));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询表单配置列表
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public List<WfFormDefinitionVo> queryList(List<String> definitionIds) {
|
|
||||||
return baseMapper.selectVoList(new LambdaQueryWrapper<WfFormDefinition>().in(WfFormDefinition::getDefinitionId, definitionIds));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增表单配置
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
@Transactional(rollbackFor = Exception.class)
|
|
||||||
public Boolean saveOrUpdate(WfFormDefinitionBo bo) {
|
|
||||||
WfFormDefinition add = MapstructUtils.convert(bo, WfFormDefinition.class);
|
|
||||||
boolean flag = baseMapper.insertOrUpdate(add);
|
|
||||||
if (baseMapper.insertOrUpdate(add)) {
|
|
||||||
bo.setId(add.getId());
|
|
||||||
}
|
|
||||||
return flag;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量删除表单配置
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public Boolean deleteByIds(Collection<Long> ids) {
|
|
||||||
return baseMapper.deleteBatchIds(ids) > 0;
|
|
||||||
}
|
|
||||||
}
|
|
@ -0,0 +1,111 @@
|
|||||||
|
package org.dromara.workflow.service.impl;
|
||||||
|
|
||||||
|
import org.dromara.common.core.utils.MapstructUtils;
|
||||||
|
import org.dromara.common.core.utils.StringUtils;
|
||||||
|
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||||
|
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.dromara.workflow.common.enums.FormTypeEnum;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.dromara.workflow.domain.bo.WfFormManageBo;
|
||||||
|
import org.dromara.workflow.domain.vo.WfFormManageVo;
|
||||||
|
import org.dromara.workflow.domain.WfFormManage;
|
||||||
|
import org.dromara.workflow.mapper.WfFormManageMapper;
|
||||||
|
import org.dromara.workflow.service.IWfFormManageService;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Collection;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 表单管理Service业务层处理
|
||||||
|
*
|
||||||
|
* @author may
|
||||||
|
* @date 2024-03-29
|
||||||
|
*/
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Service
|
||||||
|
public class WfFormManageServiceImpl implements IWfFormManageService {
|
||||||
|
|
||||||
|
private final WfFormManageMapper baseMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询表单管理
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public WfFormManageVo queryById(Long id) {
|
||||||
|
return baseMapper.selectVoById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<WfFormManageVo> queryByIds(List<Long> ids) {
|
||||||
|
return baseMapper.selectVoBatchIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询表单管理列表
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public TableDataInfo<WfFormManageVo> queryPageList(WfFormManageBo bo, PageQuery pageQuery) {
|
||||||
|
LambdaQueryWrapper<WfFormManage> lqw = buildQueryWrapper(bo);
|
||||||
|
Page<WfFormManageVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||||
|
return TableDataInfo.build(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<WfFormManageVo> selectList() {
|
||||||
|
List<WfFormManageVo> wfFormManageVos = baseMapper.selectVoList(new LambdaQueryWrapper<WfFormManage>().orderByDesc(WfFormManage::getUpdateTime));
|
||||||
|
for (WfFormManageVo wfFormManageVo : wfFormManageVos) {
|
||||||
|
wfFormManageVo.setFormTypeName(FormTypeEnum.findByType(wfFormManageVo.getFormType()));
|
||||||
|
}
|
||||||
|
return wfFormManageVos;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询表单管理列表
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<WfFormManageVo> queryList(WfFormManageBo bo) {
|
||||||
|
LambdaQueryWrapper<WfFormManage> lqw = buildQueryWrapper(bo);
|
||||||
|
return baseMapper.selectVoList(lqw);
|
||||||
|
}
|
||||||
|
|
||||||
|
private LambdaQueryWrapper<WfFormManage> buildQueryWrapper(WfFormManageBo bo) {
|
||||||
|
LambdaQueryWrapper<WfFormManage> lqw = Wrappers.lambdaQuery();
|
||||||
|
lqw.like(StringUtils.isNotBlank(bo.getFormName()), WfFormManage::getFormName, bo.getFormName());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getFormType()), WfFormManage::getFormType, bo.getFormType());
|
||||||
|
return lqw;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增表单管理
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Boolean insertByBo(WfFormManageBo bo) {
|
||||||
|
WfFormManage add = MapstructUtils.convert(bo, WfFormManage.class);
|
||||||
|
boolean flag = baseMapper.insert(add) > 0;
|
||||||
|
if (flag) {
|
||||||
|
bo.setId(add.getId());
|
||||||
|
}
|
||||||
|
return flag;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改表单管理
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Boolean updateByBo(WfFormManageBo bo) {
|
||||||
|
WfFormManage update = MapstructUtils.convert(bo, WfFormManage.class);
|
||||||
|
return baseMapper.updateById(update) > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除表单管理
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Boolean deleteByIds(Collection<Long> ids) {
|
||||||
|
return baseMapper.deleteBatchIds(ids) > 0;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,73 @@
|
|||||||
|
package org.dromara.workflow.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.dromara.common.core.utils.StreamUtils;
|
||||||
|
import org.dromara.workflow.domain.vo.WfFormManageVo;
|
||||||
|
import org.dromara.workflow.service.IWfFormManageService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.dromara.workflow.domain.vo.WfNodeConfigVo;
|
||||||
|
import org.dromara.workflow.domain.WfNodeConfig;
|
||||||
|
import org.dromara.workflow.mapper.WfNodeConfigMapper;
|
||||||
|
import org.dromara.workflow.service.IWfNodeConfigService;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 节点配置Service业务层处理
|
||||||
|
*
|
||||||
|
* @author may
|
||||||
|
* @date 2024-03-30
|
||||||
|
*/
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Service
|
||||||
|
public class WfNodeConfigServiceImpl implements IWfNodeConfigService {
|
||||||
|
|
||||||
|
private final WfNodeConfigMapper baseMapper;
|
||||||
|
private final IWfFormManageService iWfFormManageService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询节点配置
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public WfNodeConfigVo queryById(Long id) {
|
||||||
|
return baseMapper.selectVoById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存节点配置
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Boolean saveOrUpdate(List<WfNodeConfig> list) {
|
||||||
|
return baseMapper.insertOrUpdateBatch(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除节点配置
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Boolean deleteByIds(Collection<Long> ids) {
|
||||||
|
return baseMapper.deleteBatchIds(ids) > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Boolean deleteByDefIds(Collection<String> ids) {
|
||||||
|
return baseMapper.delete(new LambdaQueryWrapper<WfNodeConfig>().in(WfNodeConfig::getDefinitionId, ids)) > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<WfNodeConfigVo> selectByDefIds(Collection<String> ids) {
|
||||||
|
List<WfNodeConfigVo> wfNodeConfigVos = baseMapper.selectVoList(new LambdaQueryWrapper<WfNodeConfig>().in(WfNodeConfig::getDefinitionId, ids));
|
||||||
|
if (CollUtil.isNotEmpty(wfNodeConfigVos)) {
|
||||||
|
List<Long> formIds = StreamUtils.toList(wfNodeConfigVos, WfNodeConfigVo::getFormId);
|
||||||
|
List<WfFormManageVo> wfFormManageVos = iWfFormManageService.queryByIds(formIds);
|
||||||
|
for (WfNodeConfigVo wfNodeConfigVo : wfNodeConfigVos) {
|
||||||
|
wfFormManageVos.stream().filter(e -> ObjectUtil.equals(e.getId(), wfNodeConfigVo.getFormId())).findFirst().ifPresent(wfNodeConfigVo::setWfFormManageVo);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return wfNodeConfigVos;
|
||||||
|
}
|
||||||
|
}
|
@ -163,6 +163,37 @@ public class ModelUtils {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取流程全部用户节点
|
||||||
|
*
|
||||||
|
* @param processDefinitionId 流程定义id
|
||||||
|
*/
|
||||||
|
public static List<UserTask> getuserTaskFlowElements(String processDefinitionId) {
|
||||||
|
BpmnModel bpmnModel = PROCESS_ENGINE.getRepositoryService().getBpmnModel(processDefinitionId);
|
||||||
|
List<UserTask> list = new ArrayList<>();
|
||||||
|
List<Process> processes = bpmnModel.getProcesses();
|
||||||
|
Collection<FlowElement> flowElements = processes.get(0).getFlowElements();
|
||||||
|
buildUserTaskFlowElements(flowElements, list);
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 递归获取所有节点
|
||||||
|
*
|
||||||
|
* @param flowElements 节点信息
|
||||||
|
* @param list 集合
|
||||||
|
*/
|
||||||
|
private static void buildUserTaskFlowElements(Collection<FlowElement> flowElements, List<UserTask> list) {
|
||||||
|
for (FlowElement flowElement : flowElements) {
|
||||||
|
if (flowElement instanceof SubProcess) {
|
||||||
|
Collection<FlowElement> subFlowElements = ((SubProcess) flowElement).getFlowElements();
|
||||||
|
buildUserTaskFlowElements(subFlowElements, list);
|
||||||
|
} else if (flowElement instanceof UserTask) {
|
||||||
|
list.add((UserTask) flowElement);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取流程全部节点
|
* 获取流程全部节点
|
||||||
*
|
*
|
||||||
|
@ -23,15 +23,10 @@ import org.dromara.workflow.common.enums.MessageTypeEnum;
|
|||||||
import org.dromara.workflow.common.enums.TaskStatusEnum;
|
import org.dromara.workflow.common.enums.TaskStatusEnum;
|
||||||
import org.dromara.workflow.domain.ActHiProcinst;
|
import org.dromara.workflow.domain.ActHiProcinst;
|
||||||
import org.dromara.workflow.domain.ActHiTaskinst;
|
import org.dromara.workflow.domain.ActHiTaskinst;
|
||||||
import org.dromara.workflow.domain.vo.MultiInstanceVo;
|
import org.dromara.workflow.domain.vo.*;
|
||||||
import org.dromara.workflow.domain.vo.ParticipantVo;
|
|
||||||
import org.dromara.workflow.domain.vo.ProcessInstanceVo;
|
|
||||||
import org.dromara.workflow.domain.vo.WfFormDefinitionVo;
|
|
||||||
import org.dromara.workflow.flowable.cmd.UpdateHiTaskInstCmd;
|
import org.dromara.workflow.flowable.cmd.UpdateHiTaskInstCmd;
|
||||||
import org.dromara.workflow.mapper.ActHiTaskinstMapper;
|
import org.dromara.workflow.mapper.ActHiTaskinstMapper;
|
||||||
import org.dromara.workflow.service.IActHiProcinstService;
|
import org.dromara.workflow.service.*;
|
||||||
import org.dromara.workflow.service.IWfFormDefinitionService;
|
|
||||||
import org.dromara.workflow.service.IWorkflowUserService;
|
|
||||||
import org.flowable.bpmn.model.BpmnModel;
|
import org.flowable.bpmn.model.BpmnModel;
|
||||||
import org.flowable.bpmn.model.FlowNode;
|
import org.flowable.bpmn.model.FlowNode;
|
||||||
import org.flowable.common.engine.api.delegate.Expression;
|
import org.flowable.common.engine.api.delegate.Expression;
|
||||||
@ -46,8 +41,7 @@ import org.flowable.task.service.impl.persistence.entity.TaskEntity;
|
|||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
import static org.dromara.workflow.common.constant.FlowConstant.PROCESS_INSTANCE_VO;
|
import static org.dromara.workflow.common.constant.FlowConstant.*;
|
||||||
import static org.dromara.workflow.common.constant.FlowConstant.WF_FORM_DEFINITION_VO;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 工作流工具
|
* 工作流工具
|
||||||
@ -61,7 +55,8 @@ public class WorkflowUtils {
|
|||||||
private static final IWorkflowUserService WORKFLOW_USER_SERVICE = SpringUtils.getBean(IWorkflowUserService.class);
|
private static final IWorkflowUserService WORKFLOW_USER_SERVICE = SpringUtils.getBean(IWorkflowUserService.class);
|
||||||
private static final IActHiProcinstService ACT_HI_PROCINST_SERVICE = SpringUtils.getBean(IActHiProcinstService.class);
|
private static final IActHiProcinstService ACT_HI_PROCINST_SERVICE = SpringUtils.getBean(IActHiProcinstService.class);
|
||||||
private static final ActHiTaskinstMapper ACT_HI_TASKINST_MAPPER = SpringUtils.getBean(ActHiTaskinstMapper.class);
|
private static final ActHiTaskinstMapper ACT_HI_TASKINST_MAPPER = SpringUtils.getBean(ActHiTaskinstMapper.class);
|
||||||
private static final IWfFormDefinitionService I_WF_FORM_DEFINITION_SERVICE = SpringUtils.getBean(IWfFormDefinitionService.class);
|
private static final IWfDefinitionConfigService I_WF_FORM_DEFINITION_SERVICE = SpringUtils.getBean(IWfDefinitionConfigService.class);
|
||||||
|
private static final IWfFormManageService I_WF_FORM_MANAGE_SERVICE = SpringUtils.getBean(IWfFormManageService.class);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建一个新任务
|
* 创建一个新任务
|
||||||
@ -304,17 +299,26 @@ public class WorkflowUtils {
|
|||||||
* @param idList 流程定义id
|
* @param idList 流程定义id
|
||||||
* @param fieldName 流程定义ID属性名称
|
* @param fieldName 流程定义ID属性名称
|
||||||
*/
|
*/
|
||||||
public static void setWfFormDefinitionVo(Object obj, List<String> idList, String fieldName) {
|
public static void setWfDefinitionConfigVo(Object obj, List<String> idList, String fieldName) {
|
||||||
if (CollUtil.isEmpty(idList) || obj == null) {
|
if (CollUtil.isEmpty(idList) || obj == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
List<WfFormDefinitionVo> wfFormDefinitionVoList = I_WF_FORM_DEFINITION_SERVICE.queryList(idList);
|
List<WfDefinitionConfigVo> wfDefinitionConfigVoList = I_WF_FORM_DEFINITION_SERVICE.queryList(idList);
|
||||||
|
if (CollUtil.isNotEmpty(wfDefinitionConfigVoList)) {
|
||||||
|
List<Long> formIds = StreamUtils.toList(wfDefinitionConfigVoList, WfDefinitionConfigVo::getFormId);
|
||||||
|
List<WfFormManageVo> wfFormManageVos = I_WF_FORM_MANAGE_SERVICE.queryByIds(formIds);
|
||||||
|
if (CollUtil.isNotEmpty(wfFormManageVos)) {
|
||||||
|
for (WfDefinitionConfigVo wfDefinitionConfigVo : wfDefinitionConfigVoList) {
|
||||||
|
wfFormManageVos.stream().filter(e -> ObjectUtil.equals(wfDefinitionConfigVo.getFormId(), e.getId())).findFirst().ifPresent(wfDefinitionConfigVo::setWfFormManageVo);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
if (obj instanceof Collection<?> collection) {
|
if (obj instanceof Collection<?> collection) {
|
||||||
for (Object o : collection) {
|
for (Object o : collection) {
|
||||||
String fieldValue = ReflectUtils.invokeGetter(o, fieldName).toString();
|
String fieldValue = ReflectUtils.invokeGetter(o, fieldName).toString();
|
||||||
if (!CollUtil.isEmpty(wfFormDefinitionVoList)) {
|
if (!CollUtil.isEmpty(wfDefinitionConfigVoList)) {
|
||||||
wfFormDefinitionVoList.stream().filter(e -> e.getDefinitionId().equals(fieldValue)).findFirst().ifPresent(e -> {
|
wfDefinitionConfigVoList.stream().filter(e -> e.getDefinitionId().equals(fieldValue)).findFirst().ifPresent(e -> {
|
||||||
ReflectUtils.invokeSetter(o, WF_FORM_DEFINITION_VO, BeanUtil.toBean(e, WfFormDefinitionVo.class));
|
ReflectUtils.invokeSetter(o, WF_DEFINITION_CONFIG_VO, BeanUtil.toBean(e, WfDefinitionConfigVo.class));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!DOCTYPE mapper
|
||||||
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="org.dromara.workflow.mapper.WfDefinitionConfigMapper">
|
||||||
|
|
||||||
|
</mapper>
|
@ -2,6 +2,6 @@
|
|||||||
<!DOCTYPE mapper
|
<!DOCTYPE mapper
|
||||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="org.dromara.workflow.mapper.WfFormDefinitionMapper">
|
<mapper namespace="org.dromara.workflow.mapper.WfFormManageMapper">
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!DOCTYPE mapper
|
||||||
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="org.dromara.workflow.mapper.WfNodeConfigMapper">
|
||||||
|
|
||||||
|
</mapper>
|
@ -78,12 +78,12 @@ create table wf_task_back_node
|
|||||||
)
|
)
|
||||||
comment '节点审批记录';
|
comment '节点审批记录';
|
||||||
|
|
||||||
DROP TABLE if EXISTS wf_form_definition;
|
DROP TABLE if EXISTS wf_definition_config;
|
||||||
create table wf_form_definition
|
create table wf_definition_config
|
||||||
(
|
(
|
||||||
id bigint not null comment '主键'
|
id bigint not null comment '主键'
|
||||||
primary key,
|
primary key,
|
||||||
path varchar(200) default '' not null comment '路由地址',
|
form_id bigint not null comment '表单ID',
|
||||||
definition_id varchar(255) not null comment '流程定义ID',
|
definition_id varchar(255) not null comment '流程定义ID',
|
||||||
process_key varchar(255) not null comment '流程KEY',
|
process_key varchar(255) not null comment '流程KEY',
|
||||||
create_dept bigint null comment '创建部门',
|
create_dept bigint null comment '创建部门',
|
||||||
@ -96,8 +96,44 @@ create table wf_form_definition
|
|||||||
constraint uni_definition_id
|
constraint uni_definition_id
|
||||||
unique (definition_id)
|
unique (definition_id)
|
||||||
)
|
)
|
||||||
comment '表单配置';
|
comment '流程定义配置';
|
||||||
|
|
||||||
|
create table wf_form_manage
|
||||||
|
(
|
||||||
|
id bigint not null comment '主键'
|
||||||
|
primary key,
|
||||||
|
form_name varchar(255) not null comment '表单名称',
|
||||||
|
form_type varchar(255) not null comment '表单类型',
|
||||||
|
router varchar(255) not null comment '路由地址/表单ID',
|
||||||
|
remark varchar(500) null comment '备注',
|
||||||
|
tenant_id varchar(20) null comment '租户编号',
|
||||||
|
create_dept bigint null comment '创建部门',
|
||||||
|
create_by bigint null comment '创建者',
|
||||||
|
create_time datetime null comment '创建时间',
|
||||||
|
update_by bigint null comment '更新者',
|
||||||
|
update_time datetime null comment '更新时间'
|
||||||
|
)
|
||||||
|
comment '表单管理';
|
||||||
|
|
||||||
|
insert into wf_form_manage(id, form_name, form_type, router, remark, tenant_id, create_dept, create_by, create_time, update_by, update_time) VALUES (1, '请假申请', 'static', '/demo/leaveEdit/index', NULL, '000000', 103, 1, sysdate(), 1, sysdate());
|
||||||
|
|
||||||
|
create table wf_node_config
|
||||||
|
(
|
||||||
|
id bigint not null comment '主键'
|
||||||
|
primary key,
|
||||||
|
form_id bigint null comment '表单id',
|
||||||
|
form_type varchar(255) null comment '表单类型',
|
||||||
|
node_name varchar(255) not null comment '节点名称',
|
||||||
|
node_id varchar(255) not null comment '节点id',
|
||||||
|
definition_id varchar(255) not null comment '流程定义id',
|
||||||
|
create_dept bigint null comment '创建部门',
|
||||||
|
create_by bigint null comment '创建者',
|
||||||
|
create_time datetime null comment '创建时间',
|
||||||
|
update_by bigint null comment '更新者',
|
||||||
|
update_time datetime null comment '更新时间',
|
||||||
|
tenant_id varchar(20) null comment '租户编号'
|
||||||
|
)
|
||||||
|
comment '节点配置';
|
||||||
|
|
||||||
|
|
||||||
INSERT INTO sys_menu(menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark) VALUES (11638, '请假申请', 5, 1, 'leave', 'workflow/leave/index', 1, 0, 'C', '0', '0', 'demo:leave:list', '#', 103, 1, sysdate(), NULL, NULL, '请假申请菜单');
|
INSERT INTO sys_menu(menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark) VALUES (11638, '请假申请', 5, 1, 'leave', 'workflow/leave/index', 1, 0, 'C', '0', '0', 'demo:leave:list', '#', 103, 1, sysdate(), NULL, NULL, '请假申请菜单');
|
||||||
|
@ -120,12 +120,12 @@ comment on column WF_TASK_BACK_NODE.CREATE_TIME is '创建时间'
|
|||||||
comment on column WF_TASK_BACK_NODE.UPDATE_BY is '更新者'
|
comment on column WF_TASK_BACK_NODE.UPDATE_BY is '更新者'
|
||||||
comment on column WF_TASK_BACK_NODE.UPDATE_TIME is '更新时间'
|
comment on column WF_TASK_BACK_NODE.UPDATE_TIME is '更新时间'
|
||||||
|
|
||||||
create table WF_FORM_DEFINITION
|
create table WF_DEFINITION_CONFIG
|
||||||
(
|
(
|
||||||
ID NUMBER(20) NOT NULL
|
ID NUMBER(20) NOT NULL
|
||||||
CONSTRAINT PK_WF_FORM_DEFINITION
|
CONSTRAINT PK_WF_DEFINITION_CONFIG
|
||||||
PRIMARY KEY,
|
PRIMARY KEY,
|
||||||
PATH VARCHAR2(200) NOT NULL,
|
FORM_ID NUMBER(20) NOT NULL,
|
||||||
DEFINITION_ID VARCHAR2(255) NOT NULL,
|
DEFINITION_ID VARCHAR2(255) NOT NULL,
|
||||||
PROCESS_KEY VARCHAR2(255) NOT NULL,
|
PROCESS_KEY VARCHAR2(255) NOT NULL,
|
||||||
TENANT_ID VARCHAR2(20),
|
TENANT_ID VARCHAR2(20),
|
||||||
@ -137,16 +137,17 @@ create table WF_FORM_DEFINITION
|
|||||||
constraint uni_definition_id
|
constraint uni_definition_id
|
||||||
unique (definition_id)
|
unique (definition_id)
|
||||||
);
|
);
|
||||||
comment on table WF_FORM_DEFINITION is '表单配置'
|
comment on table WF_DEFINITION_CONFIG is '流程定义配置'
|
||||||
comment on column WF_FORM_DEFINITION.ID is '主键'
|
comment on column WF_DEFINITION_CONFIG.ID is '主键'
|
||||||
comment on column WF_FORM_DEFINITION.DEFINITION_ID is '流程定义ID'
|
comment on column WF_DEFINITION_CONFIG.FORM_ID is '表单ID'
|
||||||
comment on column WF_FORM_DEFINITION.PROCESS_KEY is '流程KEY'
|
comment on column WF_DEFINITION_CONFIG.DEFINITION_ID is '流程定义ID'
|
||||||
comment on column WF_FORM_DEFINITION.TENANT_ID is '租户编号'
|
comment on column WF_DEFINITION_CONFIG.PROCESS_KEY is '流程KEY'
|
||||||
comment on column WF_FORM_DEFINITION.CREATE_DEPT is '创建部门'
|
comment on column WF_DEFINITION_CONFIG.TENANT_ID is '租户编号'
|
||||||
comment on column WF_FORM_DEFINITION.CREATE_BY is '创建者'
|
comment on column WF_DEFINITION_CONFIG.CREATE_DEPT is '创建部门'
|
||||||
comment on column WF_FORM_DEFINITION.CREATE_TIME is '创建时间'
|
comment on column WF_DEFINITION_CONFIG.CREATE_BY is '创建者'
|
||||||
comment on column WF_FORM_DEFINITION.UPDATE_BY is '更新者'
|
comment on column WF_DEFINITION_CONFIG.CREATE_TIME is '创建时间'
|
||||||
comment on column WF_FORM_DEFINITION.UPDATE_TIME is '更新时间'
|
comment on column WF_DEFINITION_CONFIG.UPDATE_BY is '更新者'
|
||||||
|
comment on column WF_DEFINITION_CONFIG.UPDATE_TIME is '更新时间'
|
||||||
|
|
||||||
INSERT INTO sys_menu(menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark) VALUES (11638, '请假申请', 5, 1, 'leave', 'workflow/leave/index', 1, 0, 'C', '0', '0', 'demo:leave:list', '#', 103, 1, sysdate, NULL, NULL, '请假申请菜单');
|
INSERT INTO sys_menu(menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark) VALUES (11638, '请假申请', 5, 1, 'leave', 'workflow/leave/index', 1, 0, 'C', '0', '0', 'demo:leave:list', '#', 103, 1, sysdate, NULL, NULL, '请假申请菜单');
|
||||||
INSERT INTO sys_menu(menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark) VALUES (11639, '请假申请查询', 11638, 1, '#', '', 1, 0, 'F', '0', '0', 'demo:leave:query', '#', 103, 1, sysdate, NULL, NULL, '');
|
INSERT INTO sys_menu(menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark) VALUES (11639, '请假申请查询', 11638, 1, '#', '', 1, 0, 'F', '0', '0', 'demo:leave:query', '#', 103, 1, sysdate, NULL, NULL, '');
|
||||||
|
@ -166,12 +166,12 @@ comment on column wf_task_back_node.update_time is '修改时间';
|
|||||||
alter table wf_task_back_node
|
alter table wf_task_back_node
|
||||||
owner to postgres;
|
owner to postgres;
|
||||||
|
|
||||||
create table wf_form_definition
|
create table wf_definition_config
|
||||||
(
|
(
|
||||||
id bigint(20) not null
|
id bigint(20) not null
|
||||||
constraint pk_wf_form_definition
|
constraint pk_wf_definition_config
|
||||||
primary key,
|
primary key,
|
||||||
path varchar(200) not null,
|
form_id bigint(20) not null,
|
||||||
definition_id varchar(255) not null,
|
definition_id varchar(255) not null,
|
||||||
process_key varchar(255) not null,
|
process_key varchar(255) not null,
|
||||||
tenant_id varchar(20),
|
tenant_id varchar(20),
|
||||||
@ -182,32 +182,32 @@ create table wf_form_definition
|
|||||||
update_time timestamp
|
update_time timestamp
|
||||||
);
|
);
|
||||||
|
|
||||||
comment on table wf_form_definition is '表单配置';
|
comment on table wf_definition_config is '流程定义配置';
|
||||||
|
|
||||||
comment on column wf_form_definition.id is '主键';
|
comment on column wf_definition_config.id is '主键';
|
||||||
|
|
||||||
comment on column wf_form_definition.path is '路由地址';
|
comment on column wf_definition_config.form_id is '表单ID';
|
||||||
|
|
||||||
comment on column wf_form_definition.definition_id is '流程定义ID';
|
comment on column wf_definition_config.definition_id is '流程定义ID';
|
||||||
|
|
||||||
comment on column wf_form_definition.process_key is '流程KEY';
|
comment on column wf_definition_config.process_key is '流程KEY';
|
||||||
|
|
||||||
comment on column wf_form_definition.tenant_id is '租户id';
|
comment on column wf_definition_config.tenant_id is '租户id';
|
||||||
|
|
||||||
comment on column wf_form_definition.create_dept is '创建部门';
|
comment on column wf_definition_config.create_dept is '创建部门';
|
||||||
|
|
||||||
comment on column wf_form_definition.create_by is '创建者';
|
comment on column wf_definition_config.create_by is '创建者';
|
||||||
|
|
||||||
comment on column wf_form_definition.create_time is '创建时间';
|
comment on column wf_definition_config.create_time is '创建时间';
|
||||||
|
|
||||||
comment on column wf_form_definition.update_by is '修改者';
|
comment on column wf_definition_config.update_by is '修改者';
|
||||||
|
|
||||||
comment on column wf_form_definition.update_time is '修改时间';
|
comment on column wf_definition_config.update_time is '修改时间';
|
||||||
|
|
||||||
alter table wf_form_definition
|
alter table wf_definition_config
|
||||||
owner to postgres;
|
owner to postgres;
|
||||||
create unique index uni_definition_id
|
create unique index uni_definition_id
|
||||||
on wf_form_definition (definition_id);
|
on wf_definition_config (definition_id);
|
||||||
|
|
||||||
INSERT INTO sys_menu(menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark) VALUES (11638, '请假申请', 5, 1, 'leave', 'workflow/leave/index', 1, 0, 'C', '0', '0', 'demo:leave:list', '#', 103, 1, now(), NULL, NULL, '请假申请菜单');
|
INSERT INTO sys_menu(menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark) VALUES (11638, '请假申请', 5, 1, 'leave', 'workflow/leave/index', 1, 0, 'C', '0', '0', 'demo:leave:list', '#', 103, 1, now(), NULL, NULL, '请假申请菜单');
|
||||||
INSERT INTO sys_menu(menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark) VALUES (11639, '请假申请查询', 11638, 1, '#', '', 1, 0, 'F', '0', '0', 'demo:leave:query', '#', 103, 1, now(), NULL, NULL, '');
|
INSERT INTO sys_menu(menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark) VALUES (11639, '请假申请查询', 11638, 1, '#', '', 1, 0, 'F', '0', '0', 'demo:leave:query', '#', 103, 1, now(), NULL, NULL, '');
|
||||||
|
@ -214,10 +214,10 @@ exec sp_addextendedproperty 'MS_Description', N'更新时间', 'SCHEMA', 'dbo',
|
|||||||
'update_time'
|
'update_time'
|
||||||
go
|
go
|
||||||
|
|
||||||
create table wf_form_definition
|
create table wf_definition_config
|
||||||
(
|
(
|
||||||
id bigint(20) not null primary key,
|
id bigint(20) not null primary key,
|
||||||
path nvarchar(200) not null,
|
form_id bigint(20) not null,
|
||||||
definition_id nvarchar(255)
|
definition_id nvarchar(255)
|
||||||
constraint uni_definition_id
|
constraint uni_definition_id
|
||||||
unique,
|
unique,
|
||||||
@ -231,43 +231,43 @@ create table wf_form_definition
|
|||||||
)
|
)
|
||||||
|
|
||||||
go
|
go
|
||||||
exec sp_addextendedproperty 'MS_Description', N'表单配置', 'SCHEMA', 'dbo', 'TABLE', 'wf_form_definition'
|
exec sp_addextendedproperty 'MS_Description', N'流程定义配置', 'SCHEMA', 'dbo', 'TABLE', 'wf_definition_config'
|
||||||
go
|
go
|
||||||
|
|
||||||
exec sp_addextendedproperty 'MS_Description', N'主键', 'SCHEMA', 'dbo', 'TABLE', 'wf_form_definition', 'COLUMN', 'id'
|
exec sp_addextendedproperty 'MS_Description', N'主键', 'SCHEMA', 'dbo', 'TABLE', 'wf_definition_config', 'COLUMN', 'id'
|
||||||
go
|
go
|
||||||
|
|
||||||
exec sp_addextendedproperty 'MS_Description', N'路由地址', 'SCHEMA', 'dbo', 'TABLE', 'wf_form_definition', 'COLUMN',
|
exec sp_addextendedproperty 'MS_Description', N'表单ID', 'SCHEMA', 'dbo', 'TABLE', 'wf_definition_config', 'COLUMN',
|
||||||
'path'
|
'form_id'
|
||||||
go
|
go
|
||||||
|
|
||||||
exec sp_addextendedproperty 'MS_Description', N'流程定义ID', 'SCHEMA', 'dbo', 'TABLE', 'wf_form_definition', 'COLUMN',
|
exec sp_addextendedproperty 'MS_Description', N'流程定义ID', 'SCHEMA', 'dbo', 'TABLE', 'wf_definition_config', 'COLUMN',
|
||||||
'definition_id'
|
'definition_id'
|
||||||
go
|
go
|
||||||
|
|
||||||
exec sp_addextendedproperty 'MS_Description', N'流程KEY', 'SCHEMA', 'dbo', 'TABLE', 'wf_form_definition', 'COLUMN',
|
exec sp_addextendedproperty 'MS_Description', N'流程KEY', 'SCHEMA', 'dbo', 'TABLE', 'wf_definition_config', 'COLUMN',
|
||||||
'process_key'
|
'process_key'
|
||||||
go
|
go
|
||||||
|
|
||||||
exec sp_addextendedproperty 'MS_Description', N'租户编号', 'SCHEMA', 'dbo', 'TABLE', 'wf_form_definition', 'COLUMN',
|
exec sp_addextendedproperty 'MS_Description', N'租户编号', 'SCHEMA', 'dbo', 'TABLE', 'wf_definition_config', 'COLUMN',
|
||||||
'tenant_id'
|
'tenant_id'
|
||||||
go
|
go
|
||||||
|
|
||||||
exec sp_addextendedproperty 'MS_Description', N'创建部门', 'SCHEMA', 'dbo', 'TABLE', 'wf_form_definition', 'COLUMN',
|
exec sp_addextendedproperty 'MS_Description', N'创建部门', 'SCHEMA', 'dbo', 'TABLE', 'wf_definition_config', 'COLUMN',
|
||||||
'create_dept'
|
'create_dept'
|
||||||
go
|
go
|
||||||
|
|
||||||
exec sp_addextendedproperty 'MS_Description', N'创建者', 'SCHEMA', 'dbo', 'TABLE', 'wf_form_definition', 'COLUMN', 'create_by'
|
exec sp_addextendedproperty 'MS_Description', N'创建者', 'SCHEMA', 'dbo', 'TABLE', 'wf_definition_config', 'COLUMN', 'create_by'
|
||||||
go
|
go
|
||||||
|
|
||||||
exec sp_addextendedproperty 'MS_Description', N'创建时间', 'SCHEMA', 'dbo', 'TABLE', 'wf_form_definition', 'COLUMN',
|
exec sp_addextendedproperty 'MS_Description', N'创建时间', 'SCHEMA', 'dbo', 'TABLE', 'wf_definition_config', 'COLUMN',
|
||||||
'create_time'
|
'create_time'
|
||||||
go
|
go
|
||||||
|
|
||||||
exec sp_addextendedproperty 'MS_Description', N'更新者', 'SCHEMA', 'dbo', 'TABLE', 'wf_form_definition', 'COLUMN', 'update_by'
|
exec sp_addextendedproperty 'MS_Description', N'更新者', 'SCHEMA', 'dbo', 'TABLE', 'wf_definition_config', 'COLUMN', 'update_by'
|
||||||
go
|
go
|
||||||
|
|
||||||
exec sp_addextendedproperty 'MS_Description', N'更新时间', 'SCHEMA', 'dbo', 'TABLE', 'wf_form_definition', 'COLUMN',
|
exec sp_addextendedproperty 'MS_Description', N'更新时间', 'SCHEMA', 'dbo', 'TABLE', 'wf_definition_config', 'COLUMN',
|
||||||
'update_time'
|
'update_time'
|
||||||
go
|
go
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user