|
@@ -107,34 +107,33 @@ public class SendUskyJob {
|
|
|
.collect(Collectors.toMap(User::getUsername, User::getName));
|
|
|
log.info("查询到的用户映射: {}", userNames);
|
|
|
|
|
|
- if (!userNamesMap.containsKey(send.getSender())) {
|
|
|
+ if (userNamesMap.containsKey(send.getSender())) {
|
|
|
+ sendJson.put("infoTypeName", "OA审批");
|
|
|
+ sendJson.put("infoType", 3);
|
|
|
+ sendJson.put("infoTitle", "OA审批");
|
|
|
+ sendJson.put("infoContent", userNamesMap.get(send.getSender()) + send.getSubject());
|
|
|
+ sendJson.put("userName", send.getSender());
|
|
|
+ sendJson.put("userNames", Collections.singletonList(send.getReceiver()));
|
|
|
+ sendJson.put("id", send.getId());
|
|
|
+ sendJson.put("approvalResult", approvalResult);
|
|
|
+ sendJson.put("processName", processName);
|
|
|
+ sendJson.put("approvalNode", send.getContent());
|
|
|
+ sendJson.put("realName", userNamesMap.get(send.getSender()));
|
|
|
+
|
|
|
+ String sendJsonString = sendJson.toString();
|
|
|
+ log.info("准备发送 {} 的消息:{} ", send.getSender(), sendJsonString);
|
|
|
+
|
|
|
+ try {
|
|
|
+ // restTemplate.postForObject(USKY_TEST_URL, sendJsonString, String.class);
|
|
|
+ restTemplate.postForObject(USKY_URL, sendJsonString, String.class);
|
|
|
+ log.info("消息发送成功,ID: " + send.getId());
|
|
|
+ successCount++;
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("消息发送失败,ID: " + send.getId(), e);
|
|
|
+ failCount++;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
log.error("用户 {} 的真实姓名未找到", send.getSender());
|
|
|
- continue;
|
|
|
- }
|
|
|
-
|
|
|
- sendJson.put("infoTypeName", "OA审批");
|
|
|
- sendJson.put("infoType", 3);
|
|
|
- sendJson.put("infoTitle", "OA审批");
|
|
|
- sendJson.put("infoContent", userNamesMap.get(send.getSender()) + send.getSubject());
|
|
|
- sendJson.put("userName", send.getSender());
|
|
|
- sendJson.put("userNames", Collections.singletonList(send.getReceiver()));
|
|
|
- sendJson.put("id", send.getId());
|
|
|
- sendJson.put("approvalResult", approvalResult);
|
|
|
- sendJson.put("processName", processName);
|
|
|
- sendJson.put("approvalNode", send.getContent());
|
|
|
- sendJson.put("realName", userNamesMap.get(send.getSender()));
|
|
|
-
|
|
|
- String sendJsonString = sendJson.toString();
|
|
|
- log.info("准备发送 {} 的消息:{} ", send.getSender(), sendJsonString);
|
|
|
-
|
|
|
- try {
|
|
|
- // restTemplate.postForObject(USKY_TEST_URL, sendJsonString, String.class);
|
|
|
- restTemplate.postForObject(USKY_URL, sendJsonString, String.class);
|
|
|
- log.info("消息发送成功,ID: " + send.getId());
|
|
|
- successCount++;
|
|
|
- } catch (Exception e) {
|
|
|
- log.error("消息发送失败,ID: " + send.getId(), e);
|
|
|
- failCount++;
|
|
|
}
|
|
|
}
|
|
|
log.info("消息发送完成,成功数量:" + successCount + ",失败数量:" + failCount);
|