package com.zhgd.xmgl.async; import com.zhgd.xmgl.modules.project.service.IProjectService; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Lazy; import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Component; /** * @author 邱平毅 * @ClassName AsyncDev * @date 2022/9/30 9:48 * @Version 1.0 */ @Slf4j @Component public class AsyncDev { @Lazy @Autowired AsyncAiAnalyse asyncAiAnalyse; @Autowired IProjectService projectService; @Autowired AsyncCommon asyncCommon; @Async("devExcavationExecutor") // 使用Async 可能导致页面布局混乱 public synchronized void sendDevStatus(String msg, String projectSn) { String title = "设备通知"; asyncCommon.sendMqAndApp(title, msg, title, projectSn, "/pages/projectEnd/projectIndex/projectIndex"); } }