已添加18个文件
已复制2个文件
已重命名5个文件
已删除3个文件
已修改19个文件
| | |
| | | String PROCESS_INSTANCE_VO = "processInstanceVo"; |
| | | |
| | | /** |
| | | * æµç¨è¡¨åé
置对象 |
| | | * æµç¨å®ä¹é
ç½® |
| | | */ |
| | | String WF_FORM_DEFINITION_VO = "wfFormDefinitionVo"; |
| | | String WF_DEFINITION_CONFIG_VO = "wfDefinitionConfigVo"; |
| | | |
| | | /** |
| | | * æµç¨å起人 |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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); |
| | | } |
| | | } |
| | | |
ÎļþÃû´Ó ruoyi-modules/ruoyi-workflow/src/main/java/org/dromara/workflow/controller/WfFormDefinitionController.java ÐÞ¸Ä |
| | |
| | | |
| | | import lombok.RequiredArgsConstructor; |
| | | import jakarta.validation.constraints.*; |
| | | import org.dromara.workflow.domain.bo.WfDefinitionConfigBo; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.dromara.common.idempotent.annotation.RepeatSubmit; |
| | |
| | | import org.dromara.common.core.domain.R; |
| | | import org.dromara.common.core.validate.AddGroup; |
| | | import org.dromara.common.log.enums.BusinessType; |
| | | import org.dromara.workflow.domain.vo.WfFormDefinitionVo; |
| | | import org.dromara.workflow.domain.bo.WfFormDefinitionBo; |
| | | import org.dromara.workflow.service.IWfFormDefinitionService; |
| | | import org.dromara.workflow.domain.vo.WfDefinitionConfigVo; |
| | | import org.dromara.workflow.service.IWfDefinitionConfigService; |
| | | |
| | | /** |
| | | * 表åé
ç½® |
| | | * |
| | | * @author gssong |
| | | * @author may |
| | | * @date 2024-03-18 |
| | | */ |
| | | @Validated |
| | | @RequiredArgsConstructor |
| | | @RestController |
| | | @RequestMapping("/workflow/formDefinition") |
| | | public class WfFormDefinitionController extends BaseController { |
| | | @RequestMapping("/workflow/definitionConfig") |
| | | public class WfDefinitionConfigController extends BaseController { |
| | | |
| | | private final IWfFormDefinitionService wfFormDefinitionService; |
| | | private final IWfDefinitionConfigService wfDefinitionConfigService; |
| | | |
| | | |
| | | /** |
| | |
| | | * @param definitionId ä¸»é® |
| | | */ |
| | | @GetMapping("/getByDefId/{definitionId}") |
| | | public R<WfFormDefinitionVo> getByDefId(@NotBlank(message = "æµç¨å®ä¹IDä¸è½ä¸ºç©º") |
| | | public R<WfDefinitionConfigVo> getByDefId(@NotBlank(message = "æµç¨å®ä¹IDä¸è½ä¸ºç©º") |
| | | @PathVariable String definitionId) { |
| | | return R.ok(wfFormDefinitionService.getByDefId(definitionId)); |
| | | return R.ok(wfDefinitionConfigService.getByDefId(definitionId)); |
| | | } |
| | | |
| | | /** |
| | |
| | | @Log(title = "表åé
ç½®", businessType = BusinessType.INSERT) |
| | | @RepeatSubmit() |
| | | @PostMapping("/saveOrUpdate") |
| | | public R<Void> saveOrUpdate(@Validated(AddGroup.class) @RequestBody WfFormDefinitionBo bo) { |
| | | return toAjax(wfFormDefinitionService.saveOrUpdate(bo)); |
| | | public R<Void> saveOrUpdate(@Validated(AddGroup.class) @RequestBody WfDefinitionConfigBo bo) { |
| | | return toAjax(wfDefinitionConfigService.saveOrUpdate(bo)); |
| | | } |
| | | |
| | | /** |
| | |
| | | @DeleteMapping("/{ids}") |
| | | public R<Void> remove(@NotEmpty(message = "主é®ä¸è½ä¸ºç©º") |
| | | @PathVariable Long[] ids) { |
| | | return toAjax(wfFormDefinitionService.deleteByIds(List.of(ids))); |
| | | return toAjax(wfDefinitionConfigService.deleteByIds(List.of(ids))); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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))); |
| | | } |
| | | } |
| | |
| | | /** |
| | | * æµç¨åå²ä»»å¡å¯¹è±¡ act_hi_taskinst |
| | | * |
| | | * @author gssong |
| | | * @author may |
| | | * @date 2024-03-02 |
| | | */ |
| | | @Data |
ÎļþÃû´Ó ruoyi-modules/ruoyi-workflow/src/main/java/org/dromara/workflow/domain/WfFormDefinition.java ÐÞ¸Ä |
| | |
| | | /** |
| | | * 表åé
置对象 wf_form_definition |
| | | * |
| | | * @author gssong |
| | | * @author may |
| | | * @date 2024-03-18 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @TableName("wf_form_definition") |
| | | public class WfFormDefinition extends BaseEntity { |
| | | @TableName("wf_definition_config") |
| | | public class WfDefinitionConfig extends BaseEntity { |
| | | |
| | | @Serial |
| | | private static final long serialVersionUID = 1L; |
| | |
| | | private Long id; |
| | | |
| | | /** |
| | | * è·¯ç±å°å |
| | | * 表åID |
| | | */ |
| | | private String path; |
| | | private Long formId; |
| | | |
| | | /** |
| | | * æµç¨å®ä¹ID |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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; |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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; |
| | | |
| | | |
| | | } |
ÎļþÃû´Ó ruoyi-modules/ruoyi-workflow/src/main/java/org/dromara/workflow/domain/bo/WfFormDefinitionBo.java ÐÞ¸Ä |
| | |
| | | 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.core.validate.AddGroup; |
| | | import org.dromara.common.core.validate.EditGroup; |
| | |
| | | /** |
| | | * 表åé
ç½®ä¸å¡å¯¹è±¡ wf_form_definition |
| | | * |
| | | * @author gssong |
| | | * @author may |
| | | * @date 2024-03-18 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @AutoMapper(target = WfFormDefinition.class, reverseConvertGenerate = false) |
| | | public class WfFormDefinitionBo extends BaseEntity { |
| | | @AutoMapper(target = WfDefinitionConfig.class, reverseConvertGenerate = false) |
| | | public class WfDefinitionConfigBo extends BaseEntity { |
| | | |
| | | /** |
| | | * ä¸»é® |
| | |
| | | private Long id; |
| | | |
| | | /** |
| | | * è·¯ç±å°å |
| | | * 表åID |
| | | */ |
| | | @NotBlank(message = "è·¯ç±å°åä¸è½ä¸ºç©º", groups = {AddGroup.class}) |
| | | private String path; |
| | | @NotNull(message = "表åIDä¸è½ä¸ºç©º", groups = {AddGroup.class}) |
| | | private Long formId; |
| | | |
| | | /** |
| | | * æµç¨å®ä¹ID |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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; |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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; |
| | | |
| | | |
| | | } |
| | |
| | | /** |
| | | * 表åé
ç½® |
| | | */ |
| | | private WfFormDefinitionVo wfFormDefinitionVo; |
| | | private WfDefinitionConfigVo wfDefinitionConfigVo; |
| | | |
| | | } |
| | |
| | | /** |
| | | * 表åé
ç½® |
| | | */ |
| | | private WfFormDefinitionVo wfFormDefinitionVo; |
| | | private WfDefinitionConfigVo wfDefinitionConfigVo; |
| | | } |
| | |
| | | /** |
| | | * 表åé
ç½® |
| | | */ |
| | | private WfFormDefinitionVo wfFormDefinitionVo; |
| | | private WfDefinitionConfigVo wfDefinitionConfigVo; |
| | | |
| | | /** |
| | | * èç¹é
ç½® |
| | | */ |
| | | private WfNodeConfigVo wfNodeConfigVo; |
| | | } |
ÎļþÃû´Ó ruoyi-modules/ruoyi-workflow/src/main/java/org/dromara/workflow/domain/vo/WfFormDefinitionVo.java ÐÞ¸Ä |
| | |
| | | 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.ExcelProperty; |
| | | import io.github.linpeilie.annotations.AutoMapper; |
| | |
| | | import java.io.Serializable; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 表åé
ç½®è§å¾å¯¹è±¡ wf_form_definition |
| | | * |
| | | * @author gssong |
| | | * @author may |
| | | * @date 2024-03-18 |
| | | */ |
| | | @Data |
| | | @ExcelIgnoreUnannotated |
| | | @AutoMapper(target = WfFormDefinition.class) |
| | | public class WfFormDefinitionVo implements Serializable { |
| | | @AutoMapper(target = WfDefinitionConfig.class) |
| | | public class WfDefinitionConfigVo implements Serializable { |
| | | |
| | | @Serial |
| | | private static final long serialVersionUID = 1L; |
| | |
| | | private Long id; |
| | | |
| | | /** |
| | | * è·¯ç±å°å |
| | | * 表åID |
| | | */ |
| | | @ExcelProperty(value = "è·¯ç±å°å") |
| | | private String path; |
| | | @ExcelProperty(value = "表åID") |
| | | private Long formId; |
| | | |
| | | /** |
| | | * æµç¨å®ä¹ID |
| | |
| | | @ExcelProperty(value = "夿³¨") |
| | | private String remark; |
| | | |
| | | /** |
| | | * 表å管ç |
| | | */ |
| | | private WfFormManageVo wfFormManageVo; |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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; |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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; |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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; |
| | | } |
| | | } |
| | |
| | | /** |
| | | * æµç¨åå²ä»»å¡Mapperæ¥å£ |
| | | * |
| | | * @author gssong |
| | | * @author may |
| | | * @date 2024-03-02 |
| | | */ |
| | | @InterceptorIgnore(tenantLine = "true") |
| | |
| | | /** |
| | | * ä»»å¡ä¿¡æ¯Mapperæ¥å£ |
| | | * |
| | | * @author gssong |
| | | * @author may |
| | | * @date 2024-03-02 |
| | | */ |
| | | @InterceptorIgnore(tenantLine = "true") |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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> { |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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> { |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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> { |
| | | |
| | | } |
| | |
| | | /** |
| | | * æµç¨åå²ä»»å¡Serviceæ¥å£ |
| | | * |
| | | * @author gssong |
| | | * @author may |
| | | * @date 2024-03-02 |
| | | */ |
| | | public interface IActHiTaskinstService { |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.dromara.workflow.service; |
| | | |
| | | import org.dromara.workflow.domain.vo.WfDefinitionConfigVo; |
| | | import org.dromara.workflow.domain.bo.WfDefinitionConfigBo; |
| | | |
| | | import java.util.Collection; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 表åé
ç½®Serviceæ¥å£ |
| | | * |
| | | * @author may |
| | | * @date 2024-03-18 |
| | | */ |
| | | public interface IWfDefinitionConfigService { |
| | | |
| | | /** |
| | | * æ¥è¯¢è¡¨åé
ç½® |
| | | * |
| | | * @param definitionId æµç¨å®ä¹id |
| | | * @return ç»æ |
| | | */ |
| | | WfDefinitionConfigVo getByDefId(String definitionId); |
| | | |
| | | /** |
| | | * æ¥è¯¢è¡¨åé
ç½®å表 |
| | | * |
| | | * @param definitionIds æµç¨å®ä¹id |
| | | * @return ç»æ |
| | | */ |
| | | List<WfDefinitionConfigVo> queryList(List<String> definitionIds); |
| | | |
| | | |
| | | /** |
| | | * æ°å¢è¡¨åé
ç½® |
| | | * |
| | | * @param bo åæ° |
| | | * @return ç»æ |
| | | */ |
| | | Boolean saveOrUpdate(WfDefinitionConfigBo bo); |
| | | |
| | | /** |
| | | * å é¤ |
| | | * |
| | | * @param ids id |
| | | * @return ç»æ |
| | | */ |
| | | Boolean deleteByIds(Collection<Long> ids); |
| | | |
| | | /** |
| | | * æç
§æµç¨å®ä¹idå é¤ |
| | | * |
| | | * @param ids æµç¨å®ä¹id |
| | | * @return ç»æ |
| | | */ |
| | | Boolean deleteByDefIds(Collection<String> ids); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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); |
| | | } |
| | |
| | | /** |
| | | * æµç¨åå²ä»»å¡Serviceä¸å¡å±å¤ç |
| | | * |
| | | * @author gssong |
| | | * @author may |
| | | * @date 2024-03-02 |
| | | */ |
| | | @RequiredArgsConstructor |
| | |
| | | import cn.hutool.core.util.StrUtil; |
| | | import cn.hutool.core.util.ZipUtil; |
| | | import cn.hutool.json.JSONUtil; |
| | | import com.alibaba.excel.util.StringUtils; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.apache.batik.transcoder.TranscoderInput; |
| | | import org.apache.batik.transcoder.TranscoderOutput; |
| | | import org.apache.batik.transcoder.image.PNGTranscoder; |
| | | import org.apache.commons.io.IOUtils; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.dromara.common.core.exception.ServiceException; |
| | | import org.dromara.common.mybatis.core.page.PageQuery; |
| | | import org.dromara.common.mybatis.core.page.TableDataInfo; |
| | | import org.dromara.common.tenant.helper.TenantHelper; |
| | | 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.WfFormDefinitionBo; |
| | | import org.dromara.workflow.domain.bo.WfDefinitionConfigBo; |
| | | 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.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.flowable.bpmn.model.BpmnModel; |
| | | import org.flowable.bpmn.model.UserTask; |
| | | import org.flowable.engine.RepositoryService; |
| | | import org.flowable.engine.repository.*; |
| | | import org.flowable.validation.ValidationError; |
| | |
| | | import java.io.InputStream; |
| | | import java.net.URLEncoder; |
| | | import java.nio.charset.StandardCharsets; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | import java.util.zip.ZipEntry; |
| | |
| | | public class ActModelServiceImpl implements IActModelService { |
| | | |
| | | private final RepositoryService repositoryService; |
| | | private final IWfFormDefinitionService iWfFormDefinitionService; |
| | | private final IWfDefinitionConfigService iWfDefinitionConfigService; |
| | | private final IWfNodeConfigService iWfNodeConfigService; |
| | | |
| | | /** |
| | | * å页æ¥è¯¢æ¨¡å |
| | |
| | | @Override |
| | | public TableDataInfo<Model> page(ModelBo modelBo, PageQuery pageQuery) { |
| | | ModelQuery query = QueryUtils.modelQuery(); |
| | | if (StringUtils.isNotEmpty(modelBo.getName())) { |
| | | if (StringUtils.isNotBlank(modelBo.getName())) { |
| | | query.modelNameLike("%" + modelBo.getName() + "%"); |
| | | } |
| | | if (StringUtils.isNotEmpty(modelBo.getKey())) { |
| | | if (StringUtils.isNotBlank(modelBo.getKey())) { |
| | | query.modelKey(modelBo.getKey()); |
| | | } |
| | | if (StringUtils.isNotEmpty(modelBo.getCategoryCode())) { |
| | | if (StringUtils.isNotBlank(modelBo.getCategoryCode())) { |
| | | query.modelCategory(modelBo.getCategoryCode()); |
| | | } |
| | | query.orderByLastUpdateTime().desc(); |
| | |
| | | // æ´æ°åç±» |
| | | ProcessDefinition definition = QueryUtils.definitionQuery().deploymentId(deployment.getId()).singleResult(); |
| | | repositoryService.setProcessDefinitionCategory(definition.getId(), model.getCategory()); |
| | | //æ´æ°æµç¨å®ä¹è¡¨å |
| | | if (processDefinition != null) { |
| | | WfFormDefinitionVo definitionVo = iWfFormDefinitionService.getByDefId(processDefinition.getId()); |
| | | WfDefinitionConfigVo definitionVo = iWfDefinitionConfigService.getByDefId(processDefinition.getId()); |
| | | if (definitionVo != null) { |
| | | WfFormDefinitionBo wfFormDefinition = new WfFormDefinitionBo(); |
| | | WfDefinitionConfigBo wfFormDefinition = new WfDefinitionConfigBo(); |
| | | wfFormDefinition.setDefinitionId(definition.getId()); |
| | | wfFormDefinition.setProcessKey(definition.getKey()); |
| | | wfFormDefinition.setPath(definitionVo.getPath()); |
| | | wfFormDefinition.setFormId(ObjectUtil.isNotNull(definitionVo.getFormId()) ? definitionVo.getFormId() : null); |
| | | 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; |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | |
| | | import cn.hutool.core.io.FileUtil; |
| | | import cn.hutool.core.io.IoUtil; |
| | | import cn.hutool.core.util.ObjectUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.SneakyThrows; |
| | | import org.apache.commons.io.IOUtils; |
| | |
| | | import org.dromara.common.tenant.helper.TenantHelper; |
| | | import org.dromara.workflow.common.constant.FlowConstant; |
| | | 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.WfDefinitionConfigBo; |
| | | 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.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.flowable.bpmn.model.UserTask; |
| | | import org.flowable.engine.ProcessMigrationService; |
| | | import org.flowable.engine.RepositoryService; |
| | | import org.flowable.engine.impl.bpmn.deployer.ResourceNameUtil; |
| | |
| | | import java.io.InputStream; |
| | | import java.nio.charset.StandardCharsets; |
| | | import java.util.ArrayList; |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | import java.util.zip.ZipEntry; |
| | | import java.util.zip.ZipInputStream; |
| | |
| | | private final RepositoryService repositoryService; |
| | | private final ProcessMigrationService processMigrationService; |
| | | private final IWfCategoryService wfCategoryService; |
| | | private final IWfFormDefinitionService iWfFormDefinitionService; |
| | | private final IWfDefinitionConfigService iWfDefinitionConfigService; |
| | | private final IWfNodeConfigService iWfNodeConfigService; |
| | | |
| | | /** |
| | | * å页æ¥è¯¢ |
| | |
| | | } |
| | | if (CollUtil.isNotEmpty(definitionList)) { |
| | | List<String> ids = StreamUtils.toList(definitionList, ProcessDefinition::getId); |
| | | List<WfFormDefinitionVo> wfFormDefinitionVos = iWfFormDefinitionService.queryList(ids); |
| | | List<WfDefinitionConfigVo> wfDefinitionConfigVos = iWfDefinitionConfigService.queryList(ids); |
| | | for (ProcessDefinition processDefinition : definitionList) { |
| | | ProcessDefinitionVo processDefinitionVo = BeanUtil.toBean(processDefinition, ProcessDefinitionVo.class); |
| | | if (CollUtil.isNotEmpty(deploymentList)) { |
| | |
| | | processDefinitionVo.setDeploymentTime(e.getDeploymentTime()); |
| | | }); |
| | | } |
| | | if (CollUtil.isNotEmpty(wfFormDefinitionVos)) { |
| | | wfFormDefinitionVos.stream().filter(e -> e.getDefinitionId().equals(processDefinition.getId())).findFirst().ifPresent(processDefinitionVo::setWfFormDefinitionVo); |
| | | if (CollUtil.isNotEmpty(wfDefinitionConfigVos)) { |
| | | wfDefinitionConfigVos.stream().filter(e -> e.getDefinitionId().equals(processDefinition.getId())).findFirst().ifPresent(processDefinitionVo::setWfDefinitionConfigVo); |
| | | } |
| | | processDefinitionVoList.add(processDefinitionVo); |
| | | } |
| | |
| | | } |
| | | if (CollUtil.isNotEmpty(definitionList)) { |
| | | List<String> ids = StreamUtils.toList(definitionList, ProcessDefinition::getId); |
| | | List<WfFormDefinitionVo> wfFormDefinitionVos = iWfFormDefinitionService.queryList(ids); |
| | | List<WfDefinitionConfigVo> wfDefinitionConfigVos = iWfDefinitionConfigService.queryList(ids); |
| | | for (ProcessDefinition processDefinition : definitionList) { |
| | | ProcessDefinitionVo processDefinitionVo = BeanUtil.toBean(processDefinition, ProcessDefinitionVo.class); |
| | | if (CollUtil.isNotEmpty(deploymentList)) { |
| | |
| | | deploymentList.stream().filter(e -> e.getId().equals(processDefinition.getDeploymentId())).findFirst().ifPresent(e -> { |
| | | processDefinitionVo.setDeploymentTime(e.getDeploymentTime()); |
| | | }); |
| | | if (CollUtil.isNotEmpty(wfFormDefinitionVos)) { |
| | | wfFormDefinitionVos.stream().filter(e -> e.getDefinitionId().equals(processDefinition.getId())).findFirst().ifPresent(processDefinitionVo::setWfFormDefinitionVo); |
| | | if (CollUtil.isNotEmpty(wfDefinitionConfigVos)) { |
| | | wfDefinitionConfigVos.stream().filter(e -> e.getDefinitionId().equals(processDefinition.getId())).findFirst().ifPresent(processDefinitionVo::setWfDefinitionConfigVo); |
| | | } |
| | | } |
| | | processDefinitionVoList.add(processDefinitionVo); |
| | |
| | | //å 餿µç¨å®ä¹ |
| | | repositoryService.deleteDeployment(deploymentId); |
| | | //å é¤è¡¨åé
ç½® |
| | | iWfFormDefinitionService.getByDefId(processDefinitionId); |
| | | iWfDefinitionConfigService.deleteByDefIds(Collections.singletonList(processDefinitionId)); |
| | | //å é¤èç¹é
ç½® |
| | | iWfNodeConfigService.deleteByDefIds(Collections.singletonList(processDefinitionId)); |
| | | return true; |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | |
| | | String processName = splitFilename[0]; |
| | | //æµç¨key |
| | | String processKey = splitFilename[1]; |
| | | ProcessDefinition oldProcessDefinition = QueryUtils.definitionQuery().processDefinitionKey(processKey).latestVersion().singleResult(); |
| | | DeploymentBuilder builder = repositoryService.createDeployment(); |
| | | Deployment deployment = builder.addInputStream(filename, zipInputStream) |
| | | .tenantId(TenantHelper.getTenantId()) |
| | | .name(processName).key(processKey).category(categoryCode).deploy(); |
| | | ProcessDefinition definition = QueryUtils.definitionQuery().deploymentId(deployment.getId()).singleResult(); |
| | | repositoryService.setProcessDefinitionCategory(definition.getId(), categoryCode); |
| | | setForm(oldProcessDefinition, definition); |
| | | zipInputStream.closeEntry(); |
| | | } |
| | | } catch (IOException e) { |
| | |
| | | String processName = splitFilename[0]; |
| | | //æµç¨key |
| | | String processKey = splitFilename[1]; |
| | | ProcessDefinition oldProcessDefinition = QueryUtils.definitionQuery().processDefinitionKey(processKey).latestVersion().singleResult(); |
| | | |
| | | DeploymentBuilder builder = repositoryService.createDeployment(); |
| | | Deployment deployment = builder.addInputStream(originalFilename, inputStream) |
| | | .tenantId(TenantHelper.getTenantId()) |
| | |
| | | // æ´æ°åç±» |
| | | ProcessDefinition definition = QueryUtils.definitionQuery().deploymentId(deployment.getId()).singleResult(); |
| | | repositoryService.setProcessDefinitionCategory(definition.getId(), categoryCode); |
| | | setForm(oldProcessDefinition, definition); |
| | | |
| | | } else { |
| | | 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); |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | if (CollUtil.isNotEmpty(list)) { |
| | | 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(); |
| | | TableDataInfo<ProcessInstanceVo> build = TableDataInfo.build(); |
| | |
| | | } |
| | | if (CollUtil.isNotEmpty(list)) { |
| | | 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(); |
| | | TableDataInfo<ProcessInstanceVo> build = TableDataInfo.build(); |
| | |
| | | } |
| | | if (CollUtil.isNotEmpty(list)) { |
| | | 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(); |
| | | TableDataInfo<ProcessInstanceVo> build = TableDataInfo.build(); |
| | |
| | | import org.dromara.workflow.mapper.ActHiTaskinstMapper; |
| | | import org.dromara.workflow.mapper.ActTaskMapper; |
| | | import org.dromara.workflow.service.IActTaskService; |
| | | import org.dromara.workflow.service.IWfNodeConfigService; |
| | | import org.dromara.workflow.service.IWfTaskBackNodeService; |
| | | import org.dromara.workflow.utils.ModelUtils; |
| | | import org.dromara.workflow.utils.QueryUtils; |
| | |
| | | private final ActTaskMapper actTaskMapper; |
| | | private final IWfTaskBackNodeService iWfTaskBackNodeService; |
| | | private final ActHiTaskinstMapper actHiTaskinstMapper; |
| | | private final IWfNodeConfigService iWfNodeConfigService; |
| | | |
| | | /** |
| | | * å¯å¨ä»»å¡ |
| | |
| | | |
| | | List<TaskVo> taskList = page.getRecords(); |
| | | if (CollUtil.isNotEmpty(taskList)) { |
| | | List<String> processDefinitionIds = StreamUtils.toList(taskList, TaskVo::getProcessDefinitionId); |
| | | List<WfNodeConfigVo> wfNodeConfigVoList = iWfNodeConfigService.selectByDefIds(processDefinitionIds); |
| | | for (TaskVo task : taskList) { |
| | | task.setBusinessStatusName(BusinessStatusEnum.findByStatus(task.getBusinessStatus())); |
| | | task.setParticipantVo(WorkflowUtils.getCurrentTaskParticipant(task.getId())); |
| | | 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.setWfFormDefinitionVo(taskList, processDefinitionIds, PROCESS_DEFINITION_ID); |
| | | WorkflowUtils.setWfDefinitionConfigVo(taskList, processDefinitionIds, PROCESS_DEFINITION_ID); |
| | | } |
| | | return TableDataInfo.build(page); |
| | | } |
| | |
| | | processInstanceList = QueryUtils.instanceQuery(processInstanceIds).list(); |
| | | } |
| | | List<TaskVo> list = new ArrayList<>(); |
| | | for (Task task : taskList) { |
| | | TaskVo taskVo = BeanUtil.toBean(task, TaskVo.class); |
| | | if (CollUtil.isNotEmpty(processInstanceList)) { |
| | | processInstanceList.stream().filter(e -> e.getId().equals(task.getProcessInstanceId())).findFirst().ifPresent(e -> { |
| | | taskVo.setBusinessStatus(e.getBusinessStatus()); |
| | | taskVo.setBusinessStatusName(BusinessStatusEnum.findByStatus(taskVo.getBusinessStatus())); |
| | | taskVo.setProcessDefinitionKey(e.getProcessDefinitionKey()); |
| | | taskVo.setProcessDefinitionName(e.getProcessDefinitionName()); |
| | | taskVo.setBusinessKey(e.getBusinessKey()); |
| | | }); |
| | | if (CollUtil.isNotEmpty(taskList)) { |
| | | List<String> processDefinitionIds = StreamUtils.toList(taskList, Task::getProcessDefinitionId); |
| | | List<WfNodeConfigVo> wfNodeConfigVoList = iWfNodeConfigService.selectByDefIds(processDefinitionIds); |
| | | for (Task task : taskList) { |
| | | TaskVo taskVo = BeanUtil.toBean(task, TaskVo.class); |
| | | if (CollUtil.isNotEmpty(processInstanceList)) { |
| | | processInstanceList.stream().filter(e -> e.getId().equals(task.getProcessInstanceId())).findFirst().ifPresent(e -> { |
| | | taskVo.setBusinessStatus(e.getBusinessStatus()); |
| | | 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); |
| | | 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); |
| | | WorkflowUtils.setWfDefinitionConfigVo(list, processDefinitionIds, PROCESS_DEFINITION_ID); |
| | | } |
| | | long count = query.count(); |
| | | TableDataInfo<TaskVo> build = TableDataInfo.build(); |
| | |
| | | |
| | | List<TaskVo> taskList = page.getRecords(); |
| | | if (CollUtil.isNotEmpty(taskList)) { |
| | | List<String> processDefinitionIds = StreamUtils.toList(taskList, TaskVo::getProcessDefinitionId); |
| | | 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); |
| | | } |
| | | } |
| | | 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); |
| | | } |
| | |
| | | Page<TaskVo> page = actTaskMapper.getTaskCopyByPage(pageQuery.build(), queryWrapper); |
| | | |
| | | List<TaskVo> taskList = page.getRecords(); |
| | | for (TaskVo task : taskList) { |
| | | task.setBusinessStatusName(BusinessStatusEnum.findByStatus(task.getBusinessStatus())); |
| | | } |
| | | if (CollUtil.isNotEmpty(taskList)) { |
| | | 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); |
| | | } |
| | |
| | | } |
| | | if (CollUtil.isNotEmpty(taskList)) { |
| | | 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); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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; |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | /** |
| | | * è·åæµç¨å
¨é¨ç¨æ·èç¹ |
| | | * |
| | | * @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); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * è·åæµç¨å
¨é¨èç¹ |
| | | * |
| | | * @param processDefinitionId æµç¨å®ä¹id |
| | |
| | | import org.dromara.workflow.common.enums.TaskStatusEnum; |
| | | import org.dromara.workflow.domain.ActHiProcinst; |
| | | import org.dromara.workflow.domain.ActHiTaskinst; |
| | | import org.dromara.workflow.domain.vo.MultiInstanceVo; |
| | | 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.domain.vo.*; |
| | | import org.dromara.workflow.flowable.cmd.UpdateHiTaskInstCmd; |
| | | import org.dromara.workflow.mapper.ActHiTaskinstMapper; |
| | | import org.dromara.workflow.service.IActHiProcinstService; |
| | | import org.dromara.workflow.service.IWfFormDefinitionService; |
| | | import org.dromara.workflow.service.IWorkflowUserService; |
| | | import org.dromara.workflow.service.*; |
| | | import org.flowable.bpmn.model.BpmnModel; |
| | | import org.flowable.bpmn.model.FlowNode; |
| | | import org.flowable.common.engine.api.delegate.Expression; |
| | |
| | | |
| | | import java.util.*; |
| | | |
| | | import static org.dromara.workflow.common.constant.FlowConstant.PROCESS_INSTANCE_VO; |
| | | import static org.dromara.workflow.common.constant.FlowConstant.WF_FORM_DEFINITION_VO; |
| | | import static org.dromara.workflow.common.constant.FlowConstant.*; |
| | | |
| | | /** |
| | | * 工使µå·¥å
· |
| | |
| | | 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 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); |
| | | |
| | | /** |
| | | * å建ä¸ä¸ªæ°ä»»å¡ |
| | |
| | | * @param idList æµç¨å®ä¹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) { |
| | | 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) { |
| | | for (Object o : collection) { |
| | | String fieldValue = ReflectUtils.invokeGetter(o, fieldName).toString(); |
| | | if (!CollUtil.isEmpty(wfFormDefinitionVoList)) { |
| | | wfFormDefinitionVoList.stream().filter(e -> e.getDefinitionId().equals(fieldValue)).findFirst().ifPresent(e -> { |
| | | ReflectUtils.invokeSetter(o, WF_FORM_DEFINITION_VO, BeanUtil.toBean(e, WfFormDefinitionVo.class)); |
| | | if (!CollUtil.isEmpty(wfDefinitionConfigVoList)) { |
| | | wfDefinitionConfigVoList.stream().filter(e -> e.getDefinitionId().equals(fieldValue)).findFirst().ifPresent(e -> { |
| | | ReflectUtils.invokeSetter(o, WF_DEFINITION_CONFIG_VO, BeanUtil.toBean(e, WfDefinitionConfigVo.class)); |
| | | }); |
| | | } |
| | | } |
copy from ruoyi-modules/ruoyi-workflow/src/main/resources/mapper/workflow/WfFormDefinitionMapper.xml
copy to ruoyi-modules/ruoyi-workflow/src/main/resources/mapper/workflow/WfDefinitionConfigMapper.xml
Îļþ´Ó ruoyi-modules/ruoyi-workflow/src/main/resources/mapper/workflow/WfFormDefinitionMapper.xml ¸´ÖÆ |
| | |
| | | <!DOCTYPE mapper |
| | | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="org.dromara.workflow.mapper.WfFormDefinitionMapper"> |
| | | <mapper namespace="org.dromara.workflow.mapper.WfDefinitionConfigMapper"> |
| | | |
| | | </mapper> |
ÎļþÃû´Ó ruoyi-modules/ruoyi-workflow/src/main/resources/mapper/workflow/WfFormDefinitionMapper.xml ÐÞ¸Ä |
| | |
| | | <!DOCTYPE mapper |
| | | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="org.dromara.workflow.mapper.WfFormDefinitionMapper"> |
| | | <mapper namespace="org.dromara.workflow.mapper.WfFormManageMapper"> |
| | | |
| | | </mapper> |
copy from ruoyi-modules/ruoyi-workflow/src/main/resources/mapper/workflow/WfFormDefinitionMapper.xml
copy to ruoyi-modules/ruoyi-workflow/src/main/resources/mapper/workflow/WfNodeConfigMapper.xml
Îļþ´Ó ruoyi-modules/ruoyi-workflow/src/main/resources/mapper/workflow/WfFormDefinitionMapper.xml ¸´ÖÆ |
| | |
| | | <!DOCTYPE mapper |
| | | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="org.dromara.workflow.mapper.WfFormDefinitionMapper"> |
| | | <mapper namespace="org.dromara.workflow.mapper.WfNodeConfigMapper"> |
| | | |
| | | </mapper> |
| | |
| | | ) |
| | | comment 'èç¹å®¡æ¹è®°å½'; |
| | | |
| | | DROP TABLE if EXISTS wf_form_definition; |
| | | create table wf_form_definition |
| | | DROP TABLE if EXISTS wf_definition_config; |
| | | create table wf_definition_config |
| | | ( |
| | | id bigint not null comment '主é®' |
| | | primary key, |
| | | path varchar(200) default '' not null comment 'è·¯ç±å°å', |
| | | form_id bigint not null comment '表åID', |
| | | definition_id varchar(255) not null comment 'æµç¨å®ä¹ID', |
| | | process_key varchar(255) not null comment 'æµç¨KEY', |
| | | create_dept bigint null comment 'å建é¨é¨', |
| | |
| | | constraint uni_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, '请åç³è¯·èå'); |
| | |
| | | comment on column WF_TASK_BACK_NODE.UPDATE_BY 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 |
| | | CONSTRAINT PK_WF_FORM_DEFINITION |
| | | CONSTRAINT PK_WF_DEFINITION_CONFIG |
| | | PRIMARY KEY, |
| | | PATH VARCHAR2(200) NOT NULL, |
| | | FORM_ID NUMBER(20) NOT NULL, |
| | | DEFINITION_ID VARCHAR2(255) NOT NULL, |
| | | PROCESS_KEY VARCHAR2(255) NOT NULL, |
| | | TENANT_ID VARCHAR2(20), |
| | |
| | | constraint uni_definition_id |
| | | unique (definition_id) |
| | | ); |
| | | comment on table WF_FORM_DEFINITION is '表åé
ç½®' |
| | | comment on column WF_FORM_DEFINITION.ID is '主é®' |
| | | comment on column WF_FORM_DEFINITION.DEFINITION_ID is 'æµç¨å®ä¹ID' |
| | | comment on column WF_FORM_DEFINITION.PROCESS_KEY is 'æµç¨KEY' |
| | | comment on column WF_FORM_DEFINITION.TENANT_ID is 'ç§æ·ç¼å·' |
| | | comment on column WF_FORM_DEFINITION.CREATE_DEPT is 'å建é¨é¨' |
| | | comment on column WF_FORM_DEFINITION.CREATE_BY is 'å建è
' |
| | | comment on column WF_FORM_DEFINITION.CREATE_TIME is 'å建æ¶é´' |
| | | comment on column WF_FORM_DEFINITION.UPDATE_BY is 'æ´æ°è
' |
| | | comment on column WF_FORM_DEFINITION.UPDATE_TIME is 'æ´æ°æ¶é´' |
| | | comment on table WF_DEFINITION_CONFIG is 'æµç¨å®ä¹é
ç½®' |
| | | comment on column WF_DEFINITION_CONFIG.ID is '主é®' |
| | | comment on column WF_DEFINITION_CONFIG.FORM_ID is '表åID' |
| | | comment on column WF_DEFINITION_CONFIG.DEFINITION_ID is 'æµç¨å®ä¹ID' |
| | | comment on column WF_DEFINITION_CONFIG.PROCESS_KEY is 'æµç¨KEY' |
| | | comment on column WF_DEFINITION_CONFIG.TENANT_ID is 'ç§æ·ç¼å·' |
| | | comment on column WF_DEFINITION_CONFIG.CREATE_DEPT is 'å建é¨é¨' |
| | | comment on column WF_DEFINITION_CONFIG.CREATE_BY is 'å建è
' |
| | | comment on column WF_DEFINITION_CONFIG.CREATE_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 (11639, '请åç³è¯·æ¥è¯¢', 11638, 1, '#', '', 1, 0, 'F', '0', '0', 'demo:leave:query', '#', 103, 1, sysdate, NULL, NULL, ''); |
| | |
| | | alter table wf_task_back_node |
| | | owner to postgres; |
| | | |
| | | create table wf_form_definition |
| | | create table wf_definition_config |
| | | ( |
| | | id bigint(20) not null |
| | | constraint pk_wf_form_definition |
| | | constraint pk_wf_definition_config |
| | | primary key, |
| | | path varchar(200) not null, |
| | | form_id bigint(20) not null, |
| | | definition_id varchar(255) not null, |
| | | process_key varchar(255) not null, |
| | | tenant_id varchar(20), |
| | |
| | | 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; |
| | | 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 (11639, '请åç³è¯·æ¥è¯¢', 11638, 1, '#', '', 1, 0, 'F', '0', '0', 'demo:leave:query', '#', 103, 1, now(), NULL, NULL, ''); |
| | |
| | | 'update_time' |
| | | go |
| | | |
| | | create table wf_form_definition |
| | | create table wf_definition_config |
| | | ( |
| | | id bigint(20) not null primary key, |
| | | path nvarchar(200) not null, |
| | | form_id bigint(20) not null, |
| | | definition_id nvarchar(255) |
| | | constraint uni_definition_id |
| | | unique, |
| | |
| | | ) |
| | | |
| | | 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 |
| | | |
| | | 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 |
| | | |
| | | exec sp_addextendedproperty 'MS_Description', N'è·¯ç±å°å', 'SCHEMA', 'dbo', 'TABLE', 'wf_form_definition', 'COLUMN', |
| | | 'path' |
| | | exec sp_addextendedproperty 'MS_Description', N'表åID', 'SCHEMA', 'dbo', 'TABLE', 'wf_definition_config', 'COLUMN', |
| | | 'form_id' |
| | | 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' |
| | | 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' |
| | | 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' |
| | | 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' |
| | | 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 |
| | | |
| | | 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' |
| | | 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 |
| | | |
| | | 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' |
| | | go |
| | | |