huang
16 小时以前 9c489617b002e71859597097c9d1d2f1b9fc0e56
mes-processes/mes-plcSend/src/main/java/com/mes/task/service/impl/TaskStatusNotificationServiceImpl.java
@@ -5,6 +5,7 @@
import com.mes.task.entity.TaskStepDetail;
import com.mes.task.service.TaskStatusNotificationService;
import lombok.extern.slf4j.Slf4j;
import org.apache.catalina.connector.ClientAbortException;
import org.springframework.stereotype.Service;
import org.springframework.web.servlet.mvc.method.annotation.SseEmitter;
@@ -205,7 +206,7 @@
                    .data(createMessage("", data)));
            } catch (IOException e) {
                // 客户端断开连接是正常情况,使用DEBUG级别
                if (e instanceof org.apache.catalina.connector.ClientAbortException) {
                if (e instanceof ClientAbortException) {
                    log.debug("客户端断开SSE连接: taskId={}, event={}", taskId, eventName);
                } else {
                    log.warn("发送SSE消息失败: taskId={}, event={}", taskId, eventName, e);
@@ -234,7 +235,7 @@
                    .data(createMessage("", data)));
            } catch (IOException e) {
                // 客户端断开连接是正常情况,使用DEBUG级别
                if (e instanceof org.apache.catalina.connector.ClientAbortException) {
                if (e instanceof ClientAbortException) {
                    log.debug("客户端断开SSE连接: event={}", eventName);
                } else {
                    log.warn("发送SSE消息失败: event={}", eventName, e);
@@ -315,7 +316,7 @@
     */
    private String createMessage(String message, Map<String, Object> data) {
        try {
            Map<String, Object> result = new java.util.HashMap<>();
            Map<String, Object> result = new HashMap<>();
            result.put("timestamp", System.currentTimeMillis());
            if (message != null && !message.isEmpty()) {
                result.put("message", message);