|
@@ -669,9 +669,9 @@ public class ActivitiServiceImpl implements ActivitiService {
|
|
|
@Override
|
|
|
@Transactional
|
|
|
public Boolean taskApproverExchange(Long userId, Long taskId) {
|
|
|
+ SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
|
|
|
Task task = taskService.createTaskQuery().taskId(String.valueOf(taskId)).singleResult();
|
|
|
Optional.ofNullable(task).orElseThrow(() -> ExceptionResultEnum.FLOW_TASK_NO_DATA.exception());
|
|
|
-
|
|
|
// if (Objects.nonNull(task.getAssignee()) && task.getAssignee().equals(userId.toString())) {
|
|
|
// throw ExceptionResultEnum.ERROR.exception("不能转给自己!");
|
|
|
// } else {
|
|
@@ -684,12 +684,37 @@ public class ActivitiServiceImpl implements ActivitiService {
|
|
|
// }
|
|
|
// }
|
|
|
// }
|
|
|
+
|
|
|
boolean lock = memoryLock.lock(SystemConstant.LOCK_FLOW_EXCHANGE_PREFIX + taskId, taskId,
|
|
|
SystemConstant.LOCK_FLOW_TIME_OUT);
|
|
|
if (!lock) {
|
|
|
throw ExceptionResultEnum.ERROR.exception("正在转审中,请稍候再试!");
|
|
|
}
|
|
|
try {
|
|
|
+ TFCustomFlowEntity tfCustomFlowEntity = tfCustomFlowEntityService.getOne(
|
|
|
+ new QueryWrapper<TFCustomFlowEntity>().lambda()
|
|
|
+ .eq(TFCustomFlowEntity::getFlowId, Long.parseLong(task.getProcessInstanceId())));
|
|
|
+ Optional.ofNullable(tfCustomFlowEntity)
|
|
|
+ .orElseThrow(() -> ExceptionResultEnum.FLOW_ENTITY_NO_DATA.exception());
|
|
|
+
|
|
|
+ TFCustomFlow tfCustomFlow = tfCustomFlowService.getById(tfCustomFlowEntity.gettFCustomFlowId());
|
|
|
+ Optional.ofNullable(tfCustomFlow).orElseThrow(() -> ExceptionResultEnum.FLOW_CUSTOM_NO_DATA.exception());
|
|
|
+
|
|
|
+ FlowTaskResult flowTaskResultOne = tbSopInfoService.getFormProperties(tfCustomFlowEntity, 1);
|
|
|
+ ServiceScopeEnum scopeEnum = tbSopInfoService.findServiceScope(tfCustomFlow.getType(), flowTaskResultOne);
|
|
|
+
|
|
|
+ FlowResult flowResult = JSONObject.parseObject(tfCustomFlowEntity.getFlowProcessVar(), FlowResult.class);
|
|
|
+ LinkedHashMap<String, FlowTaskResult> setupMap = flowResult.getSetupMap();
|
|
|
+ FlowTaskResult currFlowTaskResult = GsonUtil.fromJson(
|
|
|
+ GsonUtil.toJson(setupMap.get(task.getTaskDefinitionKey())), FlowTaskResult.class);
|
|
|
+
|
|
|
+ if (tfCustomFlow.getType() == TFCustomTypeEnum.OFFICE_SOP_FLOW) {//教务处sop流程待审核人
|
|
|
+ if (Objects.nonNull(scopeEnum) && scopeEnum == ServiceScopeEnum.SCAN
|
|
|
+ && currFlowTaskResult.getSetup().intValue() > 3) {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
BpmnModel bpmnModel = repositoryService.getBpmnModel(task.getProcessDefinitionId());
|
|
|
FlowNode currFlow = (FlowNode) bpmnModel.getMainProcess().getFlowElement(task.getTaskDefinitionKey());
|
|
|
boolean multiInstance = false;
|
|
@@ -747,17 +772,6 @@ public class ActivitiServiceImpl implements ActivitiService {
|
|
|
if (!replace) {
|
|
|
return true;
|
|
|
}
|
|
|
- TFCustomFlowEntity tfCustomFlowEntity = tfCustomFlowEntityService.getOne(
|
|
|
- new QueryWrapper<TFCustomFlowEntity>().lambda()
|
|
|
- .eq(TFCustomFlowEntity::getFlowId, Long.parseLong(task.getProcessInstanceId())));
|
|
|
- Optional.ofNullable(tfCustomFlowEntity)
|
|
|
- .orElseThrow(() -> ExceptionResultEnum.FLOW_ENTITY_NO_DATA.exception());
|
|
|
-
|
|
|
- FlowResult flowResult = JSONObject.parseObject(tfCustomFlowEntity.getFlowProcessVar(), FlowResult.class);
|
|
|
- LinkedHashMap<String, FlowTaskResult> setupMap = flowResult.getSetupMap();
|
|
|
- FlowTaskResult currFlowTaskResult = GsonUtil.fromJson(
|
|
|
- GsonUtil.toJson(setupMap.get(task.getTaskDefinitionKey())), FlowTaskResult.class);
|
|
|
- SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
|
|
|
TFFlowLog tfFlowLog = new TFFlowLog(sysUser.getOrgId(), sysUser.getId(), sysUser.getId(),
|
|
|
currFlowTaskResult.getSetup(), Long.parseLong(task.getProcessInstanceId()),
|
|
|
Long.parseLong(task.getId()), tfCustomFlowEntity.getId(), String.valueOf(userId));
|