|
@@ -244,9 +244,7 @@ public class ActivitiServiceImpl implements ActivitiService {
|
|
|
Optional.ofNullable(flowApproveParam.getCrmNo())
|
|
|
.orElseThrow(() -> ExceptionResultEnum.CRM_NO_NO_DATA.exception());
|
|
|
|
|
|
- tfCustomFlow = tfCustomFlowService.getOne(new QueryWrapper<TFCustomFlow>().lambda()
|
|
|
- .eq(TFCustomFlow::getFlowDeploymentId, flowApproveParam.getFlowDeploymentId()));
|
|
|
- Optional.ofNullable(tfCustomFlow).orElseThrow(() -> ExceptionResultEnum.FLOW_CUSTOM_NO_DATA.exception());
|
|
|
+ tfCustomFlow = tfCustomFlowService.findByFlowDeploymentId(flowApproveParam.getFlowDeploymentId());
|
|
|
Optional.ofNullable(tfCustomFlow.getFlowProcessVar())
|
|
|
.orElseThrow(() -> ExceptionResultEnum.FLOW_PROCESS_VAR_NO_DATA.exception());
|
|
|
|
|
@@ -294,18 +292,10 @@ public class ActivitiServiceImpl implements ActivitiService {
|
|
|
if (Objects.isNull(taskTemp)) {
|
|
|
taskList = taskService.createTaskQuery().processInstanceId(processFlowId).list();
|
|
|
} else {
|
|
|
- tfCustomFlowEntity = tfCustomFlowEntityService.getOne(new QueryWrapper<TFCustomFlowEntity>().lambda()
|
|
|
- .eq(TFCustomFlowEntity::getFlowId, Long.parseLong(processFlowId)));
|
|
|
- Optional.ofNullable(tfCustomFlowEntity)
|
|
|
- .orElseThrow(() -> ExceptionResultEnum.FLOW_ENTITY_NO_DATA.exception());
|
|
|
+ tfCustomFlowEntity = tfCustomFlowEntityService.findByFlowId(Long.parseLong(processFlowId));
|
|
|
flowResult = JSONObject.parseObject(tfCustomFlowEntity.getFlowProcessVar(), FlowResult.class);
|
|
|
-
|
|
|
tfCustomFlow = tfCustomFlowService.getById(tfCustomFlowEntity.gettFCustomFlowId());
|
|
|
-
|
|
|
- tfFlowApprove = tfFlowApproveService.getOne(new QueryWrapper<TFFlowApprove>().lambda()
|
|
|
- .eq(TFFlowApprove::getFlowId, Long.parseLong(processFlowId)));
|
|
|
- Optional.ofNullable(tfFlowApprove)
|
|
|
- .orElseThrow(() -> ExceptionResultEnum.FLOW_APPROVE_NO_DATA.exception());
|
|
|
+ tfFlowApprove = tfFlowApproveService.findByFlowId(Long.parseLong(processFlowId));
|
|
|
taskList.add(taskTemp);
|
|
|
}
|
|
|
List<TFFlowLog> tfFlowLogList = new ArrayList<>();
|
|
@@ -534,10 +524,7 @@ public class ActivitiServiceImpl implements ActivitiService {
|
|
|
TFCustomFlow tfCustomFlow = null;
|
|
|
List<Task> taskList = null;
|
|
|
if (Objects.nonNull(flowDeploymentId)) {
|
|
|
- tfCustomFlow = tfCustomFlowService.getOne(
|
|
|
- new QueryWrapper<TFCustomFlow>().lambda().eq(TFCustomFlow::getFlowDeploymentId, flowDeploymentId));
|
|
|
- Optional.ofNullable(tfCustomFlow)
|
|
|
- .orElseThrow(() -> ExceptionResultEnum.FLOW_DEPLOYMENT_NO_DATA.exception());
|
|
|
+ tfCustomFlow = tfCustomFlowService.findByFlowDeploymentId(flowDeploymentId);
|
|
|
if (Objects.isNull(tfCustomFlow.getFlowDefinitionId())) {
|
|
|
String processDefinitionId = this.findProcessDefinitionIdByDeploymentId(flowDeploymentId);
|
|
|
tfCustomFlow.setFlowDefinitionId(processDefinitionId);
|
|
@@ -705,15 +692,9 @@ public class ActivitiServiceImpl implements ActivitiService {
|
|
|
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());
|
|
|
-
|
|
|
+ TFCustomFlowEntity tfCustomFlowEntity = tfCustomFlowEntityService.findByFlowId(
|
|
|
+ Long.parseLong(task.getProcessInstanceId()));
|
|
|
+ TFCustomFlow tfCustomFlow = tfCustomFlowService.findById(tfCustomFlowEntity.gettFCustomFlowId());
|
|
|
// FlowTaskResult flowTaskResultOne = tbSopInfoService.getFormProperties(tfCustomFlowEntity, 1);
|
|
|
// ServiceScopeEnum scopeEnum = tbSopInfoService.findServiceScope(tfCustomFlow.getType(), flowTaskResultOne);
|
|
|
|
|
@@ -834,23 +815,15 @@ public class ActivitiServiceImpl implements ActivitiService {
|
|
|
throw ExceptionResultEnum.ERROR.exception("正在终止中,请稍候再试!");
|
|
|
}
|
|
|
try {
|
|
|
- TFFlowApprove tfFlowApprove = tfFlowApproveService.getOne(
|
|
|
- new QueryWrapper<TFFlowApprove>().lambda().eq(TFFlowApprove::getFlowId, flowId));
|
|
|
- Optional.ofNullable(tfFlowApprove).orElseThrow(() -> ExceptionResultEnum.FLOW_APPROVE_NO_DATA.exception());
|
|
|
-
|
|
|
+ TFFlowApprove tfFlowApprove = tfFlowApproveService.findByFlowId(flowId);
|
|
|
if (tfFlowApprove.getStatus() == FlowStatusEnum.FINISH) {
|
|
|
throw ExceptionResultEnum.ERROR.exception("已结束的流程不能作废");
|
|
|
} else if (tfFlowApprove.getStatus() == FlowStatusEnum.END) {
|
|
|
throw ExceptionResultEnum.ERROR.exception("该流程已作废");
|
|
|
}
|
|
|
|
|
|
- TFCustomFlowEntity tfCustomFlowEntity = tfCustomFlowEntityService.getOne(
|
|
|
- new QueryWrapper<TFCustomFlowEntity>().lambda().eq(TFCustomFlowEntity::getFlowId, flowId));
|
|
|
- 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());
|
|
|
+ TFCustomFlowEntity tfCustomFlowEntity = tfCustomFlowEntityService.findByFlowId(flowId);
|
|
|
+ TFCustomFlow tfCustomFlow = tfCustomFlowService.findById(tfCustomFlowEntity.gettFCustomFlowId());
|
|
|
|
|
|
if (tfCustomFlow.getType() == TFCustomTypeEnum.OFFICE_SOP_FLOW && tfFlowApprove.getSetup().intValue() >= 4
|
|
|
&& tfFlowApprove.getSetup().intValue() < 8) {
|
|
@@ -949,23 +922,16 @@ public class ActivitiServiceImpl implements ActivitiService {
|
|
|
}
|
|
|
TFCustomFlowEntity tfCustomFlowEntity = null;
|
|
|
if (Objects.nonNull(flowId)) {
|
|
|
- tfCustomFlowEntity = tfCustomFlowEntityService.getOne(
|
|
|
- new QueryWrapper<TFCustomFlowEntity>().lambda().eq(TFCustomFlowEntity::getFlowId, flowId));
|
|
|
+ tfCustomFlowEntity = tfCustomFlowEntityService.findByFlowId(flowId);
|
|
|
} else {
|
|
|
- tfCustomFlowEntity = tfCustomFlowEntityService.getOne(
|
|
|
- new QueryWrapper<TFCustomFlowEntity>().lambda().eq(TFCustomFlowEntity::getCode, code));
|
|
|
+ tfCustomFlowEntity = tfCustomFlowEntityService.findByCode(code);
|
|
|
}
|
|
|
- Optional.ofNullable(tfCustomFlowEntity).orElseThrow(() -> ExceptionResultEnum.FLOW_ENTITY_NO_DATA.exception());
|
|
|
flowId = Objects.isNull(flowId) ? tfCustomFlowEntity.getFlowId() : flowId;
|
|
|
|
|
|
- TFCustomFlow tfCustomFlow = tfCustomFlowService.getById(tfCustomFlowEntity.gettFCustomFlowId());
|
|
|
- Optional.ofNullable(tfCustomFlow).orElseThrow(() -> ExceptionResultEnum.FLOW_CUSTOM_NO_DATA.exception());
|
|
|
+ TFCustomFlow tfCustomFlow = tfCustomFlowService.findById(tfCustomFlowEntity.gettFCustomFlowId());
|
|
|
|
|
|
//获取当前流程节点
|
|
|
- TFFlowApprove tfFlowApprove = tfFlowApproveService.getOne(
|
|
|
- new QueryWrapper<TFFlowApprove>().lambda().eq(TFFlowApprove::getFlowId, flowId));
|
|
|
- Optional.ofNullable(tfFlowApprove).orElseThrow(() -> ExceptionResultEnum.FLOW_APPROVE_NO_DATA.exception());
|
|
|
-
|
|
|
+ TFFlowApprove tfFlowApprove = tfFlowApproveService.findByFlowId(flowId);
|
|
|
FlowResult flowResult = JSONObject.parseObject(tfCustomFlowEntity.getFlowProcessVar(), FlowResult.class);
|
|
|
LinkedHashMap<String, FlowTaskResult> setupMap = flowResult.getSetupMap();
|
|
|
|
|
@@ -1098,11 +1064,8 @@ public class ActivitiServiceImpl implements ActivitiService {
|
|
|
throw ExceptionResultEnum.ERROR.exception("流程任务数据为空!");
|
|
|
}
|
|
|
Long flowId = Long.parseLong(taskList.get(0).getProcessInstanceId());
|
|
|
- TFCustomFlowEntity tfCustomFlowEntity = tfCustomFlowEntityService.getOne(
|
|
|
- new QueryWrapper<TFCustomFlowEntity>().lambda().eq(TFCustomFlowEntity::getFlowId, flowId));
|
|
|
- Optional.ofNullable(tfCustomFlowEntity).orElseThrow(() -> ExceptionResultEnum.FLOW_ENTITY_NO_DATA.exception());
|
|
|
- tfCustomFlow = tfCustomFlowService.getById(tfCustomFlowEntity.gettFCustomFlowId());
|
|
|
- Optional.ofNullable(tfCustomFlow).orElseThrow(() -> ExceptionResultEnum.FLOW_DEPLOYMENT_NO_DATA.exception());
|
|
|
+ TFCustomFlowEntity tfCustomFlowEntity = tfCustomFlowEntityService.findByFlowId(flowId);
|
|
|
+ tfCustomFlow = tfCustomFlowService.findById(tfCustomFlowEntity.gettFCustomFlowId());
|
|
|
|
|
|
flowResult = JSONObject.parseObject(tfCustomFlowEntity.getFlowProcessVar(), FlowResult.class);
|
|
|
LinkedHashMap<String, FlowTaskResult> setupMap = flowResult.getSetupMap();
|