| | |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.Parameter; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.flowable.engine.RuntimeService; |
| | | import org.flowable.engine.TaskService; |
| | | import org.flowable.task.api.Task; |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | |
| | | import org.springblade.core.tool.utils.DateUtil; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springblade.core.tool.utils.StringUtil; |
| | | import org.springblade.mdm.flow.constants.FlowContants; |
| | | import org.springblade.mdm.flow.entity.ApproveRecord; |
| | | import org.springblade.mdm.flow.excution.StartDispatcher; |
| | | import org.springblade.mdm.flow.service.ApproveRecordService; |
| | | import org.springblade.mdm.flow.service.FlowCommonService; |
| | | import org.springblade.mdm.flow.vo.TaskAssignVO; |
| | | import org.springblade.mdm.program.entity.ProcessProgRef; |
| | | import org.springblade.mdm.program.service.ProcessProgRefService; |
| | |
| | | |
| | | @Slf4j |
| | | @RestController |
| | | @AllArgsConstructor |
| | | @RequestMapping("/flow/dispatch") |
| | | @Tag(name = "派工流程", description = "派工流程") |
| | | public class DispatchController { |
| | | |
| | | @Autowired |
| | | private StartDispatcher dispatcher; |
| | | @Autowired |
| | | private TaskService taskService; |
| | | @Autowired |
| | | private ProcessProgRefService processProgRefService; |
| | | private final StartDispatcher dispatcher; |
| | | |
| | | @Autowired |
| | | private final TaskService taskService; |
| | | private final RuntimeService runtimeService; |
| | | private final ProcessProgRefService processProgRefService; |
| | | |
| | | private ApproveRecordService approveRecordService; |
| | | private final FlowCommonService flowCommonService; |
| | | /** |
| | | * 新增 |
| | | */ |
| | |
| | | variables = Kv.create(); |
| | | } |
| | | String programIds = null; |
| | | if(variables.containsKey("programIds")){ |
| | | if(variables.containsKey(FlowContants.PROGRAM_IDS_KEY)){ |
| | | programIds = variables.get("programIds").toString(); |
| | | runtimeService.setVariable(taskId, FlowContants.PROGRAM_IDS_KEY, programIds); |
| | | } |
| | | if(StringUtils.isNotEmpty(programIds)) { |
| | | processProgRefService.addRelations(processInstanceId,Func.toLongList(programIds)); |
| | |
| | | .taskId(taskId) |
| | | .singleResult(); |
| | | approveRecordService.saveApproveRecords(task,processInstanceId,operateResult,comment); |
| | | List<Long> programIdList = new ArrayList<>(); |
| | | |
| | | |
| | | |
| | | } |
| | | } |