|
|
@ -44,11 +44,11 @@ public abstract class ProcessAbstractService implements ProcessService { |
|
|
|
private ProcessDictService processDictService; |
|
|
|
private ProcessDictService processDictService; |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public R startFlow(String userId, String dictValue, String taskId, String processName, Map<String, Object> variables) { |
|
|
|
public R startFlow(String userId, String dictValue, String businessKey, String processName, Map<String, Object> variables) { |
|
|
|
log.info("开启流程....."); |
|
|
|
log.info("开启流程....."); |
|
|
|
R r = new R(); |
|
|
|
R r = new R(); |
|
|
|
try { |
|
|
|
try { |
|
|
|
R<BladeFlow> result = flowClient.startProcessInstanceContainNameByKey(dictValue, taskId, processName, variables); |
|
|
|
R<BladeFlow> result = flowClient.startProcessInstanceContainNameByKey(dictValue, businessKey, processName, variables); |
|
|
|
r.setSuccess(result.isSuccess()); |
|
|
|
r.setSuccess(result.isSuccess()); |
|
|
|
r.setCode(result.getCode()); |
|
|
|
r.setCode(result.getCode()); |
|
|
|
r.setMsg(result.getMsg()); |
|
|
|
r.setMsg(result.getMsg()); |
|
|
@ -61,7 +61,7 @@ public abstract class ProcessAbstractService implements ProcessService { |
|
|
|
log.error("开启流程失败:{}",result); |
|
|
|
log.error("开启流程失败:{}",result); |
|
|
|
log.error("流程信息为{}",variables); |
|
|
|
log.error("流程信息为{}",variables); |
|
|
|
r.setData(variables); |
|
|
|
r.setData(variables); |
|
|
|
pushStartFailMessage(dictValue,taskId,userId,processName,result.getMsg()); |
|
|
|
pushStartFailMessage(dictValue,businessKey,userId,processName,result.getMsg()); |
|
|
|
} |
|
|
|
} |
|
|
|
return r; |
|
|
|
return r; |
|
|
|
}catch (Exception e){ |
|
|
|
}catch (Exception e){ |
|
|
@ -86,11 +86,11 @@ public abstract class ProcessAbstractService implements ProcessService { |
|
|
|
// return r;
|
|
|
|
// return r;
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
public void pushStartFailMessage(String dictValue,String taskId, String userId, String content,String reason) { |
|
|
|
public void pushStartFailMessage(String dictValue,String businessKey, String userId, String content,String reason) { |
|
|
|
ProcessDict processDict = processDictService.selectDictLabelByKey(dictValue); |
|
|
|
ProcessDict processDict = processDictService.selectDictLabelByKey(dictValue); |
|
|
|
BusinessMessageFlowDTO message = new BusinessMessageFlowDTO(); |
|
|
|
BusinessMessageFlowDTO message = new BusinessMessageFlowDTO(); |
|
|
|
// 计划Id
|
|
|
|
// 计划Id
|
|
|
|
message.setTaskId(taskId); |
|
|
|
message.setTaskId(businessKey); |
|
|
|
message.setBusinessClassify(MessageConstants.BusinessClassifyEnum.BUSINESS.getKey()); |
|
|
|
message.setBusinessClassify(MessageConstants.BusinessClassifyEnum.BUSINESS.getKey()); |
|
|
|
message.setBusinessKey(MessageConstants.BusinessClassifyEnum.BUSINESS.getKey()); |
|
|
|
message.setBusinessKey(MessageConstants.BusinessClassifyEnum.BUSINESS.getKey()); |
|
|
|
// 主题
|
|
|
|
// 主题
|
|
|
@ -113,18 +113,18 @@ public abstract class ProcessAbstractService implements ProcessService { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void pushFailMessage(String taskId, String proessKey, String content,String reason,String deptId) { |
|
|
|
public void pushFailMessage(String businessKey, String proessKey, String content,String reason,String deptId) { |
|
|
|
ProcessDict processDict = processDictService.selectDictLabelByKey(proessKey); |
|
|
|
ProcessDict processDict = processDictService.selectDictLabelByKey(proessKey); |
|
|
|
BusinessMessageFlowDTO message = new BusinessMessageFlowDTO(); |
|
|
|
BusinessMessageFlowDTO message = new BusinessMessageFlowDTO(); |
|
|
|
// BusinessMessageDTO message = new BusinessMessageDTO();
|
|
|
|
// BusinessMessageDTO message = new BusinessMessageDTO();
|
|
|
|
// 计划Id
|
|
|
|
// 计划Id
|
|
|
|
message.setTaskId(taskId); |
|
|
|
message.setTaskId(businessKey); |
|
|
|
message.setBusinessClassify(MessageConstants.BusinessClassifyEnum.BUSINESS.getKey()); |
|
|
|
message.setBusinessClassify(MessageConstants.BusinessClassifyEnum.BUSINESS.getKey()); |
|
|
|
message.setBusinessKey(MessageConstants.BusinessClassifyEnum.BUSINESS.getKey()); |
|
|
|
message.setBusinessKey(MessageConstants.BusinessClassifyEnum.BUSINESS.getKey()); |
|
|
|
// 主题
|
|
|
|
// 主题
|
|
|
|
message.setSubject(MessageConstants.BusinessClassifyEnum.BUSINESS.getDescription()); |
|
|
|
message.setSubject(MessageConstants.BusinessClassifyEnum.BUSINESS.getDescription()); |
|
|
|
// 内容
|
|
|
|
// 内容
|
|
|
|
String res= StringUtil.format("你有一个{}的{}流程流转失败,失败原因为:{}",content, |
|
|
|
String res= StringUtil.format("你有一个流程环节为{}的{}流转失败,失败原因为:{}",content, |
|
|
|
processDict.getDictLabel(), reason); |
|
|
|
processDict.getDictLabel(), reason); |
|
|
|
message.setContent(res); |
|
|
|
message.setContent(res); |
|
|
|
message.setTenantId("200000"); |
|
|
|
message.setTenantId("200000"); |
|
|
|