|
|
@@ -1,9 +1,11 @@
|
|
|
package com.nb.web.service.bus.utils;
|
|
|
|
|
|
|
|
|
+import cn.hutool.core.collection.CollectionUtil;
|
|
|
import cn.hutool.json.JSONObject;
|
|
|
import cn.hutool.json.JSONUtil;
|
|
|
import com.nb.web.api.enums.PatientAlarmEnum;
|
|
|
+import com.nb.web.service.bus.mapper.BusPatientMapper;
|
|
|
import com.nb.web.service.bus.service.LocalBusPatientService;
|
|
|
import com.nb.web.service.bus.service.dto.MonitorStatusStatsCountResult;
|
|
|
import com.nb.web.api.feign.result.PatientMonitorResult;
|
|
|
@@ -31,6 +33,7 @@ import java.io.Serializable;
|
|
|
@Slf4j
|
|
|
public class WsPublishUtils implements Serializable{
|
|
|
private final LocalBusPatientService patientService;
|
|
|
+ private final BusPatientMapper patientMapper;
|
|
|
private final RedissonUtil redissonUtil;
|
|
|
|
|
|
private void publish(String topic,TopicMessage msg){
|
|
|
@@ -106,7 +109,7 @@ public class WsPublishUtils implements Serializable{
|
|
|
// @Async
|
|
|
public void publishDeviceRepeat(String tenantId){
|
|
|
Assert.hasText(tenantId,"医院id不能为空");
|
|
|
- JSONObject message = new JSONObject().putOpt("count", patientService.patientAlarmCount(tenantId,PatientAlarmEnum.DEVICE_REPEAT));
|
|
|
+ JSONObject message = new JSONObject().putOpt("count", CollectionUtil.size(patientMapper.selectRepeatDevice(tenantId)));
|
|
|
this.publish(WebSocketConstant.getDeviceRepeat(tenantId).getTopic(),
|
|
|
TopicMessage.of(message,tenantId)
|
|
|
);
|
|
|
@@ -122,7 +125,7 @@ public class WsPublishUtils implements Serializable{
|
|
|
// @Async
|
|
|
public void publishDeviceNone(String tenantId){
|
|
|
Assert.hasText(tenantId,"医院id不能为空");
|
|
|
- JSONObject message = new JSONObject().putOpt("count",patientService.patientAlarmCount(tenantId,PatientAlarmEnum.DEVICE_NONE));
|
|
|
+ JSONObject message = new JSONObject().putOpt("count",CollectionUtil.size(patientMapper.selectNoneDevice(tenantId)));
|
|
|
this.publish(WebSocketConstant.getDeviceNone(tenantId).getTopic(),
|
|
|
TopicMessage.of(message,tenantId)
|
|
|
);
|