|
|
@@ -9,6 +9,7 @@ import com.usoftchina.uas.office.entity.DataCenter;
|
|
|
import com.usoftchina.uas.office.jdbc.DataSourceHolder;
|
|
|
import com.usoftchina.uas.office.listener.UasEventListener;
|
|
|
import com.usoftchina.uas.office.qywx.entity.Employee;
|
|
|
+import com.usoftchina.uas.office.qywx.entity.JProcandOrProcess;
|
|
|
import com.usoftchina.uas.office.qywx.entity.JProcess;
|
|
|
import com.usoftchina.uas.office.qywx.manage.entity.QywxAgent;
|
|
|
import com.usoftchina.uas.office.qywx.manage.service.QywxAgentService;
|
|
|
@@ -108,19 +109,19 @@ public class UasProcessListener {
|
|
|
logger.error("send process message error", e);
|
|
|
}
|
|
|
}
|
|
|
- private void sendProcessMessage(UasEvent event, Integer jpId,String msg) {
|
|
|
- JProcess process = Try.call(() -> jProcessService.getById(jpId), 10);
|
|
|
+ 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 {}, {}", jpId, event);
|
|
|
+ logger.warn("can not find process {}, {}", nodeId, event);
|
|
|
return;
|
|
|
}
|
|
|
- Employee employee = getDealMan(process);
|
|
|
- if (null == employee) {
|
|
|
+ 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()+"请您尽快处理";
|
|
|
+ String description = "单据编号:" + process.getJp_codevalue()+"请您尽快";
|
|
|
try {
|
|
|
// 根据UAS配置的外部地址发送 开通U审批用U审批推送 没开通用UAS应用推送
|
|
|
QywxAgent agent = getUasAgent();
|
|
|
@@ -129,7 +130,7 @@ public class UasProcessListener {
|
|
|
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(employee.getEm_qywx()));
|
|
|
+ .toUser(emList));
|
|
|
} catch (Exception e) {
|
|
|
logger.error("send process message error", e);
|
|
|
}
|
|
|
@@ -146,7 +147,6 @@ public class UasProcessListener {
|
|
|
DataSourceHolder.set(MasterHolder.get());
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
public QywxAgent getUasAgent() {
|
|
|
try {
|
|
|
DataSourceHolder.set(DataCenter.INSTANCE);
|