|
@@ -59,6 +59,7 @@ import org.springframework.cache.annotation.CacheEvict;
|
|
|
import org.springframework.cache.annotation.Cacheable;
|
|
import org.springframework.cache.annotation.Cacheable;
|
|
|
import org.springframework.cache.annotation.Caching;
|
|
import org.springframework.cache.annotation.Caching;
|
|
|
import org.springframework.context.annotation.Lazy;
|
|
import org.springframework.context.annotation.Lazy;
|
|
|
|
|
+import org.springframework.messaging.simp.SimpMessagingTemplate;
|
|
|
import org.springframework.scheduling.annotation.Async;
|
|
import org.springframework.scheduling.annotation.Async;
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
@@ -80,7 +81,8 @@ import static com.yanfan.common.utils.SecurityUtils.*;
|
|
|
@Service
|
|
@Service
|
|
|
public class DeviceServiceImpl implements IDeviceService {
|
|
public class DeviceServiceImpl implements IDeviceService {
|
|
|
private static final Logger log = LoggerFactory.getLogger(DeviceServiceImpl.class);
|
|
private static final Logger log = LoggerFactory.getLogger(DeviceServiceImpl.class);
|
|
|
-
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private SimpMessagingTemplate messagingTemplate;
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private DeviceMapper deviceMapper;
|
|
private DeviceMapper deviceMapper;
|
|
|
@Autowired
|
|
@Autowired
|
|
@@ -483,7 +485,13 @@ public class DeviceServiceImpl implements IDeviceService {
|
|
|
tdLogDto.setSerialNumber(input.getDeviceNumber());
|
|
tdLogDto.setSerialNumber(input.getDeviceNumber());
|
|
|
tdLogDto.setList(deviceLogList);
|
|
tdLogDto.setList(deviceLogList);
|
|
|
log.debug("llllllllllllllll{},mmmmmmmmmmmm{}", JSON.toJSONString(deviceLogList), input.getDeviceNumber());
|
|
log.debug("llllllllllllllll{},mmmmmmmmmmmm{}", JSON.toJSONString(deviceLogList), input.getDeviceNumber());
|
|
|
- logService.saveBatch(tdLogDto);
|
|
|
|
|
|
|
+ Device device1 = deviceMapper.selectDeviceBySerialNumber(input.getDeviceNumber());
|
|
|
|
|
+ if ("连续油管".equals(device1.getProductName())){
|
|
|
|
|
+ //如果是连油设备发送ws
|
|
|
|
|
+ String destination = String.format("/topic/device/%s", input.getDeviceNumber());
|
|
|
|
|
+ messagingTemplate.convertAndSend(destination, JSON.toJSONString(deviceLogList));
|
|
|
|
|
+ }
|
|
|
|
|
+ logService.saveBatch(tdLogDto);
|
|
|
// }
|
|
// }
|
|
|
//});
|
|
//});
|
|
|
}
|
|
}
|