|
@@ -22,6 +22,7 @@ import com.qmth.teachcloud.common.entity.SysUser;
|
|
|
import com.qmth.teachcloud.common.enums.*;
|
|
|
import com.qmth.teachcloud.common.service.SysOrgService;
|
|
|
import com.qmth.teachcloud.common.service.SysUserService;
|
|
|
+import com.qmth.teachcloud.common.util.JacksonUtil;
|
|
|
import com.qmth.teachcloud.common.util.RedisUtil;
|
|
|
import com.qmth.teachcloud.common.util.ResultUtil;
|
|
|
import com.qmth.teachcloud.common.util.ServletUtil;
|
|
@@ -112,6 +113,9 @@ public class ActivitiServiceImpl implements ActivitiService {
|
|
|
@Resource
|
|
|
MultiWorkFlow multiWorkFlow;
|
|
|
|
|
|
+ @Resource
|
|
|
+ TFCustomFlowService tfCustomFlowService;
|
|
|
+
|
|
|
|
|
|
* 注册流程
|
|
|
*
|
|
@@ -221,7 +225,6 @@ public class ActivitiServiceImpl implements ActivitiService {
|
|
|
} catch (IOException e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
- map.computeIfAbsent(SystemConstant.FLOW_START, v -> true);
|
|
|
map.computeIfAbsent(SystemConstant.PROCESS_DEFINITION_ID, v -> processInstance.getProcessDefinitionId());
|
|
|
map.computeIfAbsent(SystemConstant.FLOW_ID, v -> processInstance.getProcessInstanceId());
|
|
|
map.remove(SystemConstant.MODEL);
|
|
@@ -1476,7 +1479,6 @@ public class ActivitiServiceImpl implements ActivitiService {
|
|
|
model.addProcess(process);
|
|
|
process.setId(id);
|
|
|
|
|
|
- SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
|
|
|
List<CustomFlowDto> customFlowLists = customFlowSaveDto.getCustomFlowLists();
|
|
|
Map<CustomFlowTypeEnum, CustomFlowDto> customFlowTypeEnumCustomFlowDtoMap = new HashMap<>();
|
|
|
FlowTaskLink flowTaskLink = new FlowTaskLink();
|
|
@@ -1589,6 +1591,29 @@ public class ActivitiServiceImpl implements ActivitiService {
|
|
|
return map;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ * 修改启动流程候选人
|
|
|
+ *
|
|
|
+ * @param customFlowId
|
|
|
+ * @param approveId
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ @Transactional
|
|
|
+ public void customFlowStartUpdateApproveId(Long customFlowId, Long approveId) {
|
|
|
+ TFCustomFlow tfCustomFlow = tfCustomFlowService.getById(customFlowId);
|
|
|
+ Optional.ofNullable(tfCustomFlow).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("未找到自定义流程数据"));
|
|
|
+ Map<String, Object> map = JacksonUtil.readJson(tfCustomFlow.getFlowProcessVar(), Map.class);
|
|
|
+ Optional.ofNullable(map).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("自定义流程变量数据为空"));
|
|
|
+ Task task = taskService.createTaskQuery().processInstanceId(String.valueOf(map.get(SystemConstant.FLOW_ID))).singleResult();
|
|
|
+ task.setAssignee(String.valueOf(approveId));
|
|
|
+ taskService.saveTask(task);
|
|
|
+ Map<String, Object> flowProcessVarMap = (Map<String, Object>) map.get(SystemConstant.FLOW_PROCESS_VAR_MAP);
|
|
|
+ Optional.ofNullable(map).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("自定义流程节点变量数据为空"));
|
|
|
+ flowProcessVarMap.put(SystemConstant.APPROVE_ID, approveId);
|
|
|
+ tfCustomFlow.setFlowProcessVar(JacksonUtil.parseJson(map));
|
|
|
+ tfCustomFlowService.updateById(tfCustomFlow);
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
* 开始任务节点
|
|
|
*
|