|
|
@ -77,7 +77,7 @@ public class OaFormService extends MybatisBaseService<OaFormMapper, OaForm> { |
|
|
|
// 将DTO中部分属性复制到oaForm中,忽略不需要的字段(如billNo, orgSidPath)
|
|
|
|
BeanUtil.copyProperties(dto, oaForm, "billNo", "orgPath"); |
|
|
|
try { |
|
|
|
String orgSidPath = dto.getOrgPath(); |
|
|
|
String orgSidPath = dto.getOrgSidPath(); |
|
|
|
// 获取组织信息,根据orgSidPath字段调用外部服务
|
|
|
|
OrgVo orgVo = sysOrganizationFeign.getOrgByPath(orgSidPath).getData(); |
|
|
|
// 如果组织信息为空,返回失败信息
|
|
|
@ -211,7 +211,8 @@ public class OaFormService extends MybatisBaseService<OaFormMapper, OaForm> { |
|
|
|
BeanUtil.copyProperties(ufVo, oaFormFlowDto); |
|
|
|
updateFlow(oaFormFlowDto); |
|
|
|
if ("Event_end".equals(resultBean.getData().getTaskDefKey())) { |
|
|
|
|
|
|
|
// 更新办结日期
|
|
|
|
updateClosingDate(businessSid); |
|
|
|
} else { |
|
|
|
//极光推送
|
|
|
|
oaForm = fetchBySid(businessSid); |
|
|
@ -249,6 +250,12 @@ public class OaFormService extends MybatisBaseService<OaFormMapper, OaForm> { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
private void updateClosingDate(String businessSid) { |
|
|
|
OaForm oaForm = fetchBySid(businessSid); |
|
|
|
oaForm.setFinishTime(new Date()); |
|
|
|
baseMapper.updateById(oaForm); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 获取上一环节 |
|
|
|
* |
|
|
@ -431,6 +438,7 @@ public class OaFormService extends MybatisBaseService<OaFormMapper, OaForm> { |
|
|
|
if (businessTaskId.equals(dto.getTaskId())) { |
|
|
|
FlowTaskVo flowTaskVo = new FlowTaskVo(); |
|
|
|
BeanUtil.copyProperties(dto, flowTaskVo); |
|
|
|
flowTaskVo.setInstanceId(dto.getProcInsId()); |
|
|
|
ResultBean<UpdateFlowFieldVo> resultBean = flowableFeign.breakProcess(flowTaskVo); |
|
|
|
if (!resultBean.getSuccess()) { |
|
|
|
return rb.setMsg(resultBean.getMsg()); |
|
|
@ -503,33 +511,39 @@ public class OaFormService extends MybatisBaseService<OaFormMapper, OaForm> { |
|
|
|
if (r == 1) { |
|
|
|
//启动流程
|
|
|
|
ResultBean<UpdateFlowFieldVo> voResultBean = flowFeign.startProcess(bv); |
|
|
|
UpdateFlowFieldVo ufVo = voResultBean.getData(); |
|
|
|
OaFormFlowDto oaFormFlowDto = new OaFormFlowDto(); |
|
|
|
BeanUtil.copyProperties(ufVo, oaFormFlowDto); |
|
|
|
updateFlow(oaFormFlowDto); |
|
|
|
try { |
|
|
|
ThreadFactory namedThreadFactory = new ThreadFactoryBuilder() |
|
|
|
.setNameFormat("demo-pool-%d").build(); |
|
|
|
ExecutorService pool = new ThreadPoolExecutor(2, 100, |
|
|
|
0L, TimeUnit.MILLISECONDS, |
|
|
|
new LinkedBlockingQueue<Runnable>(1024), namedThreadFactory, new ThreadPoolExecutor.AbortPolicy()); |
|
|
|
Future future1 = pool.submit(() -> { |
|
|
|
//极光推送
|
|
|
|
MessageFlowableQuery messageFlowableQuery = new MessageFlowableQuery(); |
|
|
|
MessageFlowVo messageFlowVo = new MessageFlowVo(); |
|
|
|
BeanUtil.copyProperties(ufVo, messageFlowVo); |
|
|
|
messageFlowableQuery.setUfVo(messageFlowVo); |
|
|
|
messageFlowableQuery.setAppMap((Map<String, Object>) bv.getFormVariables().get("app")); |
|
|
|
messageFlowableQuery.setBusinessSid(dto.getBusinessSid()); |
|
|
|
messageFlowableQuery.setModuleName(oaForm.getFormType()); |
|
|
|
messageFlowableQuery.setMsgContent(oaForm.getCreateByName() + "提交的" + messageFlowableQuery.getModuleName() + ",请审批"); |
|
|
|
messageFlowableQuery.setMsgTitle(oaForm.getFormType()); |
|
|
|
messageFeign.pushMessage(messageFlowableQuery); |
|
|
|
}); |
|
|
|
} catch (Exception e) { |
|
|
|
e.printStackTrace(); |
|
|
|
if (voResultBean.getSuccess()) { |
|
|
|
UpdateFlowFieldVo ufVo = voResultBean.getData(); |
|
|
|
OaFormFlowDto oaFormFlowDto = new OaFormFlowDto(); |
|
|
|
BeanUtil.copyProperties(ufVo, oaFormFlowDto); |
|
|
|
updateFlow(oaFormFlowDto); |
|
|
|
try { |
|
|
|
ThreadFactory namedThreadFactory = new ThreadFactoryBuilder() |
|
|
|
.setNameFormat("demo-pool-%d").build(); |
|
|
|
ExecutorService pool = new ThreadPoolExecutor(2, 100, |
|
|
|
0L, TimeUnit.MILLISECONDS, |
|
|
|
new LinkedBlockingQueue<Runnable>(1024), namedThreadFactory, new ThreadPoolExecutor.AbortPolicy()); |
|
|
|
Future future1 = pool.submit(() -> { |
|
|
|
//极光推送
|
|
|
|
MessageFlowableQuery messageFlowableQuery = new MessageFlowableQuery(); |
|
|
|
MessageFlowVo messageFlowVo = new MessageFlowVo(); |
|
|
|
BeanUtil.copyProperties(ufVo, messageFlowVo); |
|
|
|
messageFlowableQuery.setUfVo(messageFlowVo); |
|
|
|
messageFlowableQuery.setAppMap((Map<String, Object>) bv.getFormVariables().get("app")); |
|
|
|
messageFlowableQuery.setBusinessSid(dto.getBusinessSid()); |
|
|
|
messageFlowableQuery.setModuleName(oaForm.getFormType()); |
|
|
|
messageFlowableQuery.setMsgContent(oaForm.getCreateByName() + "提交的" + messageFlowableQuery.getModuleName() + ",请审批"); |
|
|
|
messageFlowableQuery.setMsgTitle(oaForm.getFormType()); |
|
|
|
messageFeign.pushMessage(messageFlowableQuery); |
|
|
|
}); |
|
|
|
} catch (Exception e) { |
|
|
|
e.printStackTrace(); |
|
|
|
} |
|
|
|
return voResultBean; |
|
|
|
} else { |
|
|
|
return rb.setMsg(voResultBean.getMsg()); |
|
|
|
} |
|
|
|
return voResultBean; |
|
|
|
|
|
|
|
|
|
|
|
} else if (r == 2) { |
|
|
|
BusinessVariablesDto businessVariablesDto = new BusinessVariablesDto(); |
|
|
|
BeanUtil.copyProperties(bv, businessVariablesDto); |
|
|
|