1
This commit is contained in:
@@ -745,6 +745,22 @@ public class TencentDocController extends BaseController {
|
||||
// 不影响主流程,继续返回成功
|
||||
}
|
||||
|
||||
// 14. 发送微信推送通知(手动执行)
|
||||
try {
|
||||
Map<String, Object> successLog = new java.util.HashMap<>();
|
||||
successLog.put("orderNo", thirdPartyOrderNo);
|
||||
successLog.put("row", targetRow);
|
||||
successLog.put("logisticsLink", logisticsLink);
|
||||
|
||||
List<Map<String, Object>> successLogs = new java.util.ArrayList<>();
|
||||
successLogs.add(successLog);
|
||||
|
||||
sendWeChatNotification(successLogs, 1, 0, 0, true);
|
||||
} catch (Exception e) {
|
||||
log.error("发送微信推送失败", e);
|
||||
// 不影响主流程,继续返回成功
|
||||
}
|
||||
|
||||
JSONObject result = new JSONObject();
|
||||
result.put("thirdPartyOrderNo", thirdPartyOrderNo);
|
||||
result.put("logisticsLink", logisticsLink);
|
||||
@@ -2045,6 +2061,19 @@ public class TencentDocController extends BaseController {
|
||||
* @param errorCount 错误数量
|
||||
*/
|
||||
private void sendWeChatNotification(List<Map<String, Object>> successLogs, int filledCount, int skippedCount, int errorCount) {
|
||||
sendWeChatNotification(successLogs, filledCount, skippedCount, errorCount, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送微信推送通知(同步成功日志)
|
||||
*
|
||||
* @param successLogs 成功日志列表
|
||||
* @param filledCount 成功填充数量
|
||||
* @param skippedCount 跳过数量
|
||||
* @param errorCount 错误数量
|
||||
* @param isManual 是否为手动执行
|
||||
*/
|
||||
private void sendWeChatNotification(List<Map<String, Object>> successLogs, int filledCount, int skippedCount, int errorCount, boolean isManual) {
|
||||
try {
|
||||
// 微信推送服务配置
|
||||
String wxSendBaseUrl = "https://wxts.van333.cn";
|
||||
@@ -2053,10 +2082,19 @@ public class TencentDocController extends BaseController {
|
||||
|
||||
// 构建推送内容
|
||||
StringBuilder content = new StringBuilder();
|
||||
content.append("【腾讯文档同步成功】\n\n");
|
||||
if (isManual) {
|
||||
content.append("【手动执行-腾讯文档同步成功】\n\n");
|
||||
} else {
|
||||
content.append("【批量同步-腾讯文档同步成功】\n\n");
|
||||
}
|
||||
content.append(String.format("✓ 成功填充: %d 条\n", filledCount));
|
||||
if (skippedCount > 0) {
|
||||
content.append(String.format("⊘ 跳过: %d 条\n", skippedCount));
|
||||
content.append(String.format("✗ 错误: %d 条\n\n", errorCount));
|
||||
}
|
||||
if (errorCount > 0) {
|
||||
content.append(String.format("✗ 错误: %d 条\n", errorCount));
|
||||
}
|
||||
content.append("\n");
|
||||
|
||||
if (!successLogs.isEmpty()) {
|
||||
content.append("【成功详情】\n");
|
||||
|
||||
Reference in New Issue
Block a user