| | |
| | | String PROCESS_INSTANCE_VO = "processInstanceVo"; |
| | | |
| | | /** |
| | | * æµç¨è¡¨åé
置对象 |
| | | */ |
| | | String WF_FORM_DEFINITION_VO = "wfFormDefinitionVo"; |
| | | |
| | | /** |
| | | * æµç¨å起人 |
| | | */ |
| | | String INITIATOR = "initiator"; |
| | |
| | | String BUSINESS_KEY = "businessKey"; |
| | | |
| | | /** |
| | | * æµç¨å®ä¹id |
| | | */ |
| | | String PROCESS_DEFINITION_ID = "processDefinitionId"; |
| | | |
| | | /** |
| | | * å¼å¯è·³è¿è¡¨è¾¾å¼åé |
| | | */ |
| | | String FLOWABLE_SKIP_EXPRESSION_ENABLED = "_FLOWABLE_SKIP_EXPRESSION_ENABLED"; |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.dromara.workflow.controller; |
| | | |
| | | import java.util.List; |
| | | |
| | | import lombok.RequiredArgsConstructor; |
| | | import jakarta.validation.constraints.*; |
| | | 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.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; |
| | | |
| | | /** |
| | | * 表åé
ç½® |
| | | * |
| | | * @author gssong |
| | | * @date 2024-03-18 |
| | | */ |
| | | @Validated |
| | | @RequiredArgsConstructor |
| | | @RestController |
| | | @RequestMapping("/workflow/formDefinition") |
| | | public class WfFormDefinitionController extends BaseController { |
| | | |
| | | private final IWfFormDefinitionService wfFormDefinitionService; |
| | | |
| | | |
| | | /** |
| | | * è·å表åé
置详ç»ä¿¡æ¯ |
| | | * |
| | | * @param definitionId ä¸»é® |
| | | */ |
| | | @GetMapping("/getByDefId/{definitionId}") |
| | | public R<WfFormDefinitionVo> getByDefId(@NotBlank(message = "æµç¨å®ä¹IDä¸è½ä¸ºç©º") |
| | | @PathVariable String definitionId) { |
| | | return R.ok(wfFormDefinitionService.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)); |
| | | } |
| | | |
| | | /** |
| | | * å é¤è¡¨åé
ç½® |
| | | * |
| | | * @param ids 主é®ä¸² |
| | | */ |
| | | @Log(title = "表åé
ç½®", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{ids}") |
| | | public R<Void> remove(@NotEmpty(message = "主é®ä¸è½ä¸ºç©º") |
| | | @PathVariable Long[] ids) { |
| | | return toAjax(wfFormDefinitionService.deleteByIds(List.of(ids))); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.dromara.workflow.domain; |
| | | |
| | | import org.dromara.common.mybatis.core.domain.BaseEntity; |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.io.Serial; |
| | | |
| | | /** |
| | | * 表åé
置对象 wf_form_definition |
| | | * |
| | | * @author gssong |
| | | * @date 2024-03-18 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @TableName("wf_form_definition") |
| | | public class WfFormDefinition extends BaseEntity { |
| | | |
| | | @Serial |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * ä¸»é® |
| | | */ |
| | | @TableId(value = "id") |
| | | private Long id; |
| | | |
| | | /** |
| | | * è·¯ç±å°å |
| | | */ |
| | | private String path; |
| | | |
| | | /** |
| | | * æµç¨å®ä¹ID |
| | | */ |
| | | private String definitionId; |
| | | |
| | | /** |
| | | * æµç¨KEY |
| | | */ |
| | | private String processKey; |
| | | |
| | | /** |
| | | * 夿³¨ |
| | | */ |
| | | private String remark; |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.dromara.workflow.domain.bo; |
| | | |
| | | import org.dromara.workflow.domain.WfFormDefinition; |
| | | 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_definition |
| | | * |
| | | * @author gssong |
| | | * @date 2024-03-18 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @AutoMapper(target = WfFormDefinition.class, reverseConvertGenerate = false) |
| | | public class WfFormDefinitionBo extends BaseEntity { |
| | | |
| | | /** |
| | | * ä¸»é® |
| | | */ |
| | | @NotNull(message = "主é®ä¸è½ä¸ºç©º", groups = {EditGroup.class}) |
| | | private Long id; |
| | | |
| | | /** |
| | | * è·¯ç±å°å |
| | | */ |
| | | @NotBlank(message = "è·¯ç±å°åä¸è½ä¸ºç©º", groups = {AddGroup.class}) |
| | | private String path; |
| | | |
| | | /** |
| | | * æµç¨å®ä¹ID |
| | | */ |
| | | @NotBlank(message = "æµç¨å®ä¹IDä¸è½ä¸ºç©º", groups = {AddGroup.class}) |
| | | private String definitionId; |
| | | |
| | | /** |
| | | * æµç¨KEY |
| | | */ |
| | | @NotBlank(message = "æµç¨KEYä¸è½ä¸ºç©º", groups = {AddGroup.class}) |
| | | private String processKey; |
| | | |
| | | /** |
| | | * 夿³¨ |
| | | */ |
| | | private String remark; |
| | | |
| | | |
| | | } |
| | |
| | | */ |
| | | private Date deploymentTime; |
| | | |
| | | /** |
| | | * 表åé
ç½® |
| | | */ |
| | | private WfFormDefinitionVo wfFormDefinitionVo; |
| | | |
| | | } |
| | |
| | | * æ¯å¦ä¼ç¾ |
| | | */ |
| | | private Boolean multiInstance; |
| | | |
| | | /** |
| | | * ä¸å¡id |
| | | */ |
| | | private String businessKey; |
| | | |
| | | /** |
| | | * 表åé
ç½® |
| | | */ |
| | | private WfFormDefinitionVo wfFormDefinitionVo; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.dromara.workflow.domain.vo; |
| | | |
| | | import org.dromara.workflow.domain.WfFormDefinition; |
| | | 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_definition |
| | | * |
| | | * @author gssong |
| | | * @date 2024-03-18 |
| | | */ |
| | | @Data |
| | | @ExcelIgnoreUnannotated |
| | | @AutoMapper(target = WfFormDefinition.class) |
| | | public class WfFormDefinitionVo implements Serializable { |
| | | |
| | | @Serial |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * ä¸»é® |
| | | */ |
| | | @ExcelProperty(value = "主é®") |
| | | private Long id; |
| | | |
| | | /** |
| | | * è·¯ç±å°å |
| | | */ |
| | | @ExcelProperty(value = "è·¯ç±å°å") |
| | | private String path; |
| | | |
| | | /** |
| | | * æµç¨å®ä¹ID |
| | | */ |
| | | @ExcelProperty(value = "æµç¨å®ä¹ID") |
| | | private String definitionId; |
| | | |
| | | /** |
| | | * æµç¨KEY |
| | | */ |
| | | @ExcelProperty(value = "æµç¨KEY") |
| | | private String processKey; |
| | | |
| | | /** |
| | | * 夿³¨ |
| | | */ |
| | | @ExcelProperty(value = "夿³¨") |
| | | private String remark; |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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> { |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.dromara.workflow.service; |
| | | |
| | | import org.dromara.workflow.domain.vo.WfFormDefinitionVo; |
| | | import org.dromara.workflow.domain.bo.WfFormDefinitionBo; |
| | | |
| | | import java.util.Collection; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 表åé
ç½®Serviceæ¥å£ |
| | | * |
| | | * @author gssong |
| | | * @date 2024-03-18 |
| | | */ |
| | | public interface IWfFormDefinitionService { |
| | | |
| | | /** |
| | | * æ¥è¯¢è¡¨åé
ç½® |
| | | * |
| | | * @param definitionId æµç¨å®ä¹id |
| | | * @return ç»æ |
| | | */ |
| | | WfFormDefinitionVo getByDefId(String definitionId); |
| | | |
| | | /** |
| | | * æ¥è¯¢è¡¨åé
ç½®å表 |
| | | * |
| | | * @param definitionIds æµç¨å®ä¹id |
| | | * @return ç»æ |
| | | */ |
| | | List<WfFormDefinitionVo> queryList(List<String> definitionIds); |
| | | |
| | | |
| | | /** |
| | | * æ°å¢è¡¨åé
ç½® |
| | | * |
| | | * @param bo åæ° |
| | | * @return ç»æ |
| | | */ |
| | | Boolean saveOrUpdate(WfFormDefinitionBo bo); |
| | | |
| | | /** |
| | | * å é¤ |
| | | * |
| | | * @param ids id |
| | | * @return ç»æ |
| | | */ |
| | | Boolean deleteByIds(Collection<Long> ids); |
| | | } |
| | |
| | | import org.dromara.workflow.domain.WfCategory; |
| | | import org.dromara.workflow.domain.bo.ProcessDefinitionBo; |
| | | import org.dromara.workflow.domain.vo.ProcessDefinitionVo; |
| | | import org.dromara.workflow.domain.vo.WfFormDefinitionVo; |
| | | import org.dromara.workflow.service.IActProcessDefinitionService; |
| | | import org.dromara.workflow.service.IWfCategoryService; |
| | | import org.dromara.workflow.service.IWfFormDefinitionService; |
| | | import org.dromara.workflow.utils.QueryUtils; |
| | | import org.flowable.engine.ProcessMigrationService; |
| | | import org.flowable.engine.RepositoryService; |
| | |
| | | import java.nio.charset.StandardCharsets; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | 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; |
| | | |
| | | /** |
| | | * å页æ¥è¯¢ |
| | |
| | | List<String> deploymentIds = StreamUtils.toList(definitionList, ProcessDefinition::getDeploymentId); |
| | | deploymentList = QueryUtils.deploymentQuery(deploymentIds).list(); |
| | | } |
| | | 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(definitionList)) { |
| | | List<String> ids = StreamUtils.toList(definitionList, ProcessDefinition::getId); |
| | | List<WfFormDefinitionVo> wfFormDefinitionVos = iWfFormDefinitionService.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); |
| | | } |
| | | processDefinitionVoList.add(processDefinitionVo); |
| | | } |
| | | processDefinitionVoList.add(processDefinitionVo); |
| | | } |
| | | // æ»è®°å½æ° |
| | | long total = query.count(); |
| | |
| | | List<ProcessDefinition> definitionList = query.processDefinitionKey(key).list(); |
| | | List<Deployment> deploymentList = null; |
| | | if (CollUtil.isNotEmpty(definitionList)) { |
| | | List<String> deploymentIds = definitionList.stream().map(ProcessDefinition::getDeploymentId).collect(Collectors.toList()); |
| | | List<String> deploymentIds = StreamUtils.toList(definitionList, ProcessDefinition::getDeploymentId); |
| | | deploymentList = QueryUtils.deploymentQuery(deploymentIds).list(); |
| | | } |
| | | 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(definitionList)) { |
| | | List<String> ids = StreamUtils.toList(definitionList, ProcessDefinition::getId); |
| | | List<WfFormDefinitionVo> wfFormDefinitionVos = iWfFormDefinitionService.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); |
| | | } |
| | | } |
| | | processDefinitionVoList.add(processDefinitionVo); |
| | | } |
| | | processDefinitionVoList.add(processDefinitionVo); |
| | | } |
| | | return CollectionUtil.reverse(processDefinitionVoList); |
| | | } |
| | |
| | | Page<TaskVo> page = actTaskMapper.getTaskWaitByPage(pageQuery.build(), queryWrapper); |
| | | |
| | | List<TaskVo> taskList = page.getRecords(); |
| | | 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(taskList)) { |
| | | 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); |
| | | } |
| | | List<String> processDefinitionIds = StreamUtils.toList(taskList, TaskVo::getProcessDefinitionId); |
| | | WorkflowUtils.setWfFormDefinitionVo(taskList, processDefinitionIds, PROCESS_DEFINITION_ID); |
| | | } |
| | | return new TableDataInfo<>(taskList, page.getTotal()); |
| | | } |
| | |
| | | Page<TaskVo> page = actTaskMapper.getTaskFinishByPage(pageQuery.build(), queryWrapper); |
| | | |
| | | List<TaskVo> taskList = page.getRecords(); |
| | | for (TaskVo task : taskList) { |
| | | task.setBusinessStatusName(BusinessStatusEnum.findByStatus(task.getBusinessStatus())); |
| | | if (CollUtil.isNotEmpty(taskList)) { |
| | | for (TaskVo task : taskList) { |
| | | task.setBusinessStatusName(BusinessStatusEnum.findByStatus(task.getBusinessStatus())); |
| | | } |
| | | List<String> processDefinitionIds = StreamUtils.toList(taskList, TaskVo::getProcessDefinitionId); |
| | | WorkflowUtils.setWfFormDefinitionVo(taskList, processDefinitionIds, PROCESS_DEFINITION_ID); |
| | | } |
| | | return new TableDataInfo<>(taskList, page.getTotal()); |
| | | } |
| | |
| | | */ |
| | | @Override |
| | | public TestLeaveVo queryById(Long id) { |
| | | return baseMapper.selectVoById(id); |
| | | TestLeaveVo testLeaveVo = baseMapper.selectVoById(id); |
| | | WorkflowUtils.setProcessInstanceVo(testLeaveVo,String.valueOf(id)); |
| | | return testLeaveVo; |
| | | } |
| | | |
| | | /** |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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; |
| | | } |
| | | } |
| | |
| | | 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.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.flowable.bpmn.model.BpmnModel; |
| | | import org.flowable.bpmn.model.FlowNode; |
| | |
| | | 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; |
| | | |
| | | /** |
| | | * 工使µå·¥å
· |
| | |
| | | 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); |
| | | |
| | | /** |
| | | * å建ä¸ä¸ªæ°ä»»å¡ |
| | |
| | | * @param businessKey ä¸å¡id |
| | | */ |
| | | public static void setProcessInstanceVo(Object obj, String businessKey) { |
| | | if (StringUtils.isBlank(businessKey)) { |
| | | if (StringUtils.isBlank(businessKey) || obj == null) { |
| | | return; |
| | | } |
| | | ActHiProcinst actHiProcinst = ACT_HI_PROCINST_SERVICE.selectByBusinessKey(businessKey); |
| | |
| | | * @param fieldName 主é®å±æ§åç§° |
| | | */ |
| | | public static void setProcessInstanceListVo(Object obj, List<String> idList, String fieldName) { |
| | | if (CollUtil.isEmpty(idList)) { |
| | | if (CollUtil.isEmpty(idList) || obj == null) { |
| | | return; |
| | | } |
| | | List<ActHiProcinst> actHiProcinstList = ACT_HI_PROCINST_SERVICE.selectByBusinessKeyIn(idList); |
| | |
| | | } |
| | | |
| | | /** |
| | | * 设置æµç¨è¡¨åé
ç½® |
| | | * |
| | | * @param obj ä¸å¡å¯¹è±¡ |
| | | * @param idList æµç¨å®ä¹id |
| | | * @param fieldName æµç¨å®ä¹ID屿§åç§° |
| | | */ |
| | | public static void setWfFormDefinitionVo(Object obj, List<String> idList, String fieldName) { |
| | | if (CollUtil.isEmpty(idList) || obj == null) { |
| | | return; |
| | | } |
| | | List<WfFormDefinitionVo> wfFormDefinitionVoList = I_WF_FORM_DEFINITION_SERVICE.queryList(idList); |
| | | 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)); |
| | | }); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * åéæ¶æ¯ |
| | | * |
| | | * @param list ä»»å¡ |
| | |
| | | <result property="businessStatus" column="BUSINESS_STATUS_"/> |
| | | <result property="processDefinitionName" column="processDefinitionName"/> |
| | | <result property="processDefinitionKey" column="processDefinitionName"/> |
| | | <result property="businessKey" column="BUSINESS_KEY_"/> |
| | | |
| | | </resultMap> |
| | | <select id="getTaskWaitByPage" resultMap="TaskVoResult"> |
| | | select * |
| | | from (SELECT RES.*, |
| | | AHP.BUSINESS_STATUS_, |
| | | AHP.BUSINESS_KEY_, |
| | | ARP.NAME_ AS processDefinitionName, |
| | | ARP.KEY_ AS processDefinitionKey |
| | | FROM ACT_RU_TASK RES |
| | |
| | | select * |
| | | from (SELECT HTI.*, |
| | | AHP.BUSINESS_STATUS_, |
| | | AHP.BUSINESS_KEY_, |
| | | ARP.NAME_ AS processDefinitionName, |
| | | ARP.KEY_ AS processDefinitionKey |
| | | FROM ACT_HI_TASKINST HTI |
| | |
| | | select * |
| | | from (SELECT AHT.*, |
| | | AHP.BUSINESS_STATUS_, |
| | | AHP.BUSINESS_KEY_, |
| | | ARP.NAME_ as processDefinitionName, |
| | | ARP.KEY_ as processDefinitionKey |
| | | FROM ACT_HI_TASKINST AHT |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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.WfFormDefinitionMapper"> |
| | | |
| | | </mapper> |
| | |
| | | ) |
| | | comment 'èç¹å®¡æ¹è®°å½'; |
| | | |
| | | create table wf_form_definition |
| | | ( |
| | | id bigint not null comment '主é®' |
| | | primary key, |
| | | path varchar(200) default '' not null comment 'è·¯ç±å°å', |
| | | definition_id varchar(255) not null comment 'æµç¨å®ä¹ID', |
| | | process_key varchar(255) not null comment 'æµç¨KEY', |
| | | 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 'æ´æ°æ¶é´', |
| | | remark varchar(500) default '' null comment '夿³¨', |
| | | tenant_id varchar(20) default '000000' null comment 'ç§æ·ç¼å·', |
| | | constraint uni_definition_id |
| | | unique (definition_id) |
| | | ) |
| | | 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 (11639, '请åç³è¯·æ¥è¯¢', 11638, 1, '#', '', 1, 0, 'F', '0', '0', 'demo:leave:query', '#', 103, 1, sysdate(), NULL, NULL, ''); |