|
|
@@ -110,29 +110,28 @@ public class UasProcessListener {
|
|
|
}
|
|
|
}
|
|
|
private void sendProcessMessage(UasEvent event, Integer nodeId,String msg) {
|
|
|
-
|
|
|
- JProcandOrProcess process = Try.call(() -> jProcessService.getJProcandOrProcessById(nodeId), 10);
|
|
|
- if (null == process) {
|
|
|
- logger.warn("can not find process {}, {}", nodeId, event);
|
|
|
- return;
|
|
|
- }
|
|
|
- String[] emList = jProcessService.getDealManById(nodeId);
|
|
|
- if (null == emList) {
|
|
|
- return;
|
|
|
- }
|
|
|
- DataCenter dataCenter = DataCenter.INSTANCE;
|
|
|
- String title = process.getJp_launchername() + "的" + process.getJp_name()+msg;
|
|
|
- String description = "单据编号:" + process.getJp_codevalue()+"请您尽快";
|
|
|
try {
|
|
|
- // 根据UAS配置的外部地址发送 开通U审批用U审批推送 没开通用UAS应用推送
|
|
|
- QywxAgent agent = getUasAgent();
|
|
|
- String paramsStr = "{\"master\":\"" + event.getMaster() + "\",\"nodeId\":" + process.getJp_nodeid() + ",\"baseUrl\":\"" + URLEncoder.encode(agent.getOuterUrl(), "utf-8") + "\"}";
|
|
|
- String msgUrl = UrlUtils.generateOAuthUrl(messageSdk.getCorpId(), event.getMaster(), "Uas", agent.getOuterUrl(),
|
|
|
- dataCenter.getOuterUrl() + "api/authorize", "uas/approval/" + URLEncoder.encode(paramsStr, "utf-8"));
|
|
|
- messageSdk.send((!messageSdk.isAgentEnabled("UasAudit")) ? "Uas":"UasAudit", new SendMessageReq()
|
|
|
- .textCard(title, description, msgUrl, "查看详情")
|
|
|
- .toUser(emList));
|
|
|
- } catch (Exception e) {
|
|
|
+ JProcandOrProcess process = jProcessService.getJProcandOrProcessById(nodeId);
|
|
|
+ if (null == process) {
|
|
|
+ logger.warn("send urge message can not find process {}, {}", nodeId, event);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ String[] emList = jProcessService.getDealManById(nodeId);
|
|
|
+ if (null == emList) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ DataCenter dataCenter = DataCenter.INSTANCE;
|
|
|
+ String title = process.getJp_launchername() + "的" + process.getJp_name()+msg;
|
|
|
+ String description = "单据编号:" + process.getJp_codevalue()+"请您尽快处理";
|
|
|
+ // 根据UAS配置的外部地址发送 开通U审批用U审批推送 没开通用UAS应用推送
|
|
|
+ QywxAgent agent = getUasAgent();
|
|
|
+ String paramsStr = "{\"master\":\"" + event.getMaster() + "\",\"nodeId\":" + process.getJp_nodeid() + ",\"baseUrl\":\"" + URLEncoder.encode(agent.getOuterUrl(), "utf-8") + "\"}";
|
|
|
+ String msgUrl = UrlUtils.generateOAuthUrl(messageSdk.getCorpId(), event.getMaster(), "Uas", agent.getOuterUrl(),
|
|
|
+ dataCenter.getOuterUrl() + "api/authorize", "uas/approval/" + URLEncoder.encode(paramsStr, "utf-8"));
|
|
|
+ messageSdk.send((!messageSdk.isAgentEnabled("UasAudit")) ? "Uas":"UasAudit", new SendMessageReq()
|
|
|
+ .textCard(title, description, msgUrl, "查看详情")
|
|
|
+ .toUser(emList));
|
|
|
+ }catch (Exception e){
|
|
|
logger.error("send urge message error", e);
|
|
|
}
|
|
|
}
|