|
@@ -142,8 +142,8 @@ public class ActivitiServiceImpl implements ActivitiService {
|
|
@Override
|
|
@Override
|
|
@Transactional
|
|
@Transactional
|
|
public void flowEnd(String flowId) {
|
|
public void flowEnd(String flowId) {
|
|
- try {
|
|
|
|
- if (redisUtil.lock(SystemConstant.REDIS_LOCK_FLOW_PREFIX + flowId, SystemConstant.REDIS_LOCK_FLOW_TIME_OUT)) {
|
|
|
|
|
|
+ if (redisUtil.lock(SystemConstant.REDIS_LOCK_FLOW_PREFIX + flowId, SystemConstant.REDIS_LOCK_FLOW_TIME_OUT)) {
|
|
|
|
+ try {
|
|
Task task = taskService.createTaskQuery().processInstanceId(flowId).singleResult();
|
|
Task task = taskService.createTaskQuery().processInstanceId(flowId).singleResult();
|
|
SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
|
|
SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
|
|
runtimeService.deleteProcessInstance(flowId, FlowGdykdxApproveSetupEnum.END.getTitle());
|
|
runtimeService.deleteProcessInstance(flowId, FlowGdykdxApproveSetupEnum.END.getTitle());
|
|
@@ -213,18 +213,18 @@ public class ActivitiServiceImpl implements ActivitiService {
|
|
examTask.setStatus(ExamStatusEnum.DRAFT);
|
|
examTask.setStatus(ExamStatusEnum.DRAFT);
|
|
examTask.updateInfo(sysUser.getId());
|
|
examTask.updateInfo(sysUser.getId());
|
|
examTaskService.updateById(examTask);
|
|
examTaskService.updateById(examTask);
|
|
- } else {
|
|
|
|
- throw ExceptionResultEnum.ERROR.exception("正在终止中,请稍候再试!");
|
|
|
|
- }
|
|
|
|
- } catch (Exception e) {
|
|
|
|
- e.printStackTrace();
|
|
|
|
- if (e instanceof ApiException) {
|
|
|
|
- ResultUtil.error((ApiException) e, e.getMessage());
|
|
|
|
- } else {
|
|
|
|
- ResultUtil.error(e.getMessage());
|
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ e.printStackTrace();
|
|
|
|
+ if (e instanceof ApiException) {
|
|
|
|
+ ResultUtil.error((ApiException) e, e.getMessage());
|
|
|
|
+ } else {
|
|
|
|
+ ResultUtil.error(e.getMessage());
|
|
|
|
+ }
|
|
|
|
+ } finally {
|
|
|
|
+ redisUtil.releaseLock(SystemConstant.REDIS_LOCK_FLOW_PREFIX + flowId);
|
|
}
|
|
}
|
|
- } finally {
|
|
|
|
- redisUtil.releaseLock(SystemConstant.REDIS_LOCK_FLOW_PREFIX + flowId);
|
|
|
|
|
|
+ } else {
|
|
|
|
+ throw ExceptionResultEnum.ERROR.exception("正在终止中,请稍候再试!");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -259,13 +259,13 @@ public class ActivitiServiceImpl implements ActivitiService {
|
|
@Transactional
|
|
@Transactional
|
|
public Map<String, Object> taskApprove(Map<String, Object> map) {
|
|
public Map<String, Object> taskApprove(Map<String, Object> map) {
|
|
String flowTaskId = null;
|
|
String flowTaskId = null;
|
|
- try {
|
|
|
|
- SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
|
|
|
|
- if (Objects.isNull(map.get(SystemConstant.FLOW_TASK_ID))) {
|
|
|
|
- throw ExceptionResultEnum.ERROR.exception("流程任务id不能为空");
|
|
|
|
- }
|
|
|
|
- flowTaskId = (String) map.get(SystemConstant.FLOW_TASK_ID);
|
|
|
|
- if (redisUtil.lock(SystemConstant.REDIS_LOCK_FLOW_TASK_PREFIX + flowTaskId, SystemConstant.REDIS_LOCK_FLOW_TASK_TIME_OUT)) {
|
|
|
|
|
|
+ SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
|
|
|
|
+ if (Objects.isNull(map.get(SystemConstant.FLOW_TASK_ID))) {
|
|
|
|
+ throw ExceptionResultEnum.ERROR.exception("流程任务id不能为空");
|
|
|
|
+ }
|
|
|
|
+ flowTaskId = (String) map.get(SystemConstant.FLOW_TASK_ID);
|
|
|
|
+ if (redisUtil.lock(SystemConstant.REDIS_LOCK_FLOW_TASK_PREFIX + flowTaskId, SystemConstant.REDIS_LOCK_FLOW_TASK_TIME_OUT)) {
|
|
|
|
+ try {
|
|
Task task = taskService.createTaskQuery().taskId(flowTaskId).singleResult();
|
|
Task task = taskService.createTaskQuery().taskId(flowTaskId).singleResult();
|
|
if (Objects.isNull(task)) {
|
|
if (Objects.isNull(task)) {
|
|
throw ExceptionResultEnum.ERROR.exception("流程任务为空");
|
|
throw ExceptionResultEnum.ERROR.exception("流程任务为空");
|
|
@@ -393,19 +393,19 @@ public class ActivitiServiceImpl implements ActivitiService {
|
|
objectMap.putIfAbsent("examTask", examTask);
|
|
objectMap.putIfAbsent("examTask", examTask);
|
|
objectMap.putIfAbsent("sysUser", sysUser);
|
|
objectMap.putIfAbsent("sysUser", sysUser);
|
|
return objectMap;
|
|
return objectMap;
|
|
- } else {
|
|
|
|
- throw ExceptionResultEnum.ERROR.exception("正在审批中,请稍候再试!");
|
|
|
|
- }
|
|
|
|
- } catch (Exception e) {
|
|
|
|
- log.error("请求出错", e);
|
|
|
|
- e.printStackTrace();
|
|
|
|
- if (e instanceof ApiException) {
|
|
|
|
- ResultUtil.error((ApiException) e, e.getMessage());
|
|
|
|
- } else {
|
|
|
|
- ResultUtil.error(e.getMessage());
|
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ log.error("请求出错", e);
|
|
|
|
+ e.printStackTrace();
|
|
|
|
+ if (e instanceof ApiException) {
|
|
|
|
+ ResultUtil.error((ApiException) e, e.getMessage());
|
|
|
|
+ } else {
|
|
|
|
+ ResultUtil.error(e.getMessage());
|
|
|
|
+ }
|
|
|
|
+ } finally {
|
|
|
|
+ redisUtil.releaseLock(SystemConstant.REDIS_LOCK_FLOW_TASK_PREFIX + flowTaskId);
|
|
}
|
|
}
|
|
- } finally {
|
|
|
|
- redisUtil.releaseLock(SystemConstant.REDIS_LOCK_FLOW_TASK_PREFIX + flowTaskId);
|
|
|
|
|
|
+ } else {
|
|
|
|
+ throw ExceptionResultEnum.ERROR.exception("正在审批中,请稍候再试!");
|
|
}
|
|
}
|
|
return null;
|
|
return null;
|
|
}
|
|
}
|