|
|
@@ -9,6 +9,7 @@ import cn.hutool.crypto.SignUtil;
|
|
|
import cn.hutool.crypto.asymmetric.Sign;
|
|
|
import cn.hutool.crypto.asymmetric.SignAlgorithm;
|
|
|
import cn.hutool.extra.spring.SpringUtil;
|
|
|
+import com.baomidou.mybatisplus.annotation.IEnum;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
|
|
@@ -27,6 +28,7 @@ import com.coffee.bus.registry.patient.PatientRegistry;
|
|
|
import com.coffee.bus.registry.patient.bean.DeviceTimeSmallInfo;
|
|
|
import com.coffee.bus.registry.patient.bean.PatientCacheInfo;
|
|
|
import com.coffee.bus.service.*;
|
|
|
+import com.coffee.bus.websocket.DeviceConflictHandler;
|
|
|
import com.coffee.common.config.websocket.WebSocketConstant;
|
|
|
import com.coffee.common.enums.SexEnum;
|
|
|
import lombok.AllArgsConstructor;
|
|
|
@@ -454,7 +456,7 @@ public class DeviceInfoListener {
|
|
|
|
|
|
public static int count=1;
|
|
|
public static long mark=System.currentTimeMillis();
|
|
|
-// @Scheduled(cron = "0/20 * * * * ?")
|
|
|
+ @Scheduled(cron = "0/10 * * * * ?")
|
|
|
public void send() throws InterruptedException {
|
|
|
// List<BusDeviceRunningEntity> list = deviceUsingService.list();
|
|
|
// list.forEach(pump->{
|
|
|
@@ -485,6 +487,7 @@ public class DeviceInfoListener {
|
|
|
pump.setPcaTotalCount(pump.getPcaInvalidCount()+pump.getPcaValidCount());
|
|
|
pump.setContinueDose(BigDecimal.valueOf(RandomUtil.randomInt(100)));
|
|
|
|
|
|
+ pump.setAlarm(DeviceAlarmEnum.Bubble);
|
|
|
pump.setPulseDose(RandomUtil.randomInt(100));
|
|
|
pump.setPulseLockTime(RandomUtil.randomInt(100));
|
|
|
pump.setPulseFirstLockTime(RandomUtil.randomInt(100));
|
|
|
@@ -500,116 +503,117 @@ public class DeviceInfoListener {
|
|
|
|
|
|
SpringUtil.publishEvent(new DeviceInfoEvent(this,pump,pump.getDeviceId()));
|
|
|
|
|
|
- Thread.sleep(5000);
|
|
|
-
|
|
|
- BusDeviceRunningEntity pump1 = new BusDeviceRunningEntity();
|
|
|
- pump1.setDeviceId("456");
|
|
|
- pump1.setType(DeviceTypeEnum.continuous);
|
|
|
- pump1.setClassification(String.valueOf(mark));
|
|
|
- pump1.setPatientCode("456");
|
|
|
- pump1.setTotalDose(RandomUtil.randomInt(100));
|
|
|
- pump1.setFirstDose(RandomUtil.randomInt(100));
|
|
|
- pump1.setRemainDose(BigDecimal.valueOf(RandomUtil.randomInt(100)));
|
|
|
- pump1.setInputDose(BigDecimal.valueOf(RandomUtil.randomInt(100)));
|
|
|
- pump1.setAppendDose(BigDecimal.valueOf(RandomUtil.randomInt(100)));
|
|
|
- pump1.setAppendLockTime(BigDecimal.valueOf(RandomUtil.randomInt(100)));
|
|
|
- pump1.setMaxDose(BigDecimal.valueOf(RandomUtil.randomInt(100)));
|
|
|
- pump1.setSelfControlCount(RandomUtil.randomInt(100));
|
|
|
- pump1.setSelfControlLockTime(RandomUtil.randomInt(100));
|
|
|
- pump1.setFirstDose(RandomUtil.randomInt(100));
|
|
|
- pump1.setRemainDose(BigDecimal.valueOf(RandomUtil.randomInt(100)));
|
|
|
- pump1.setContinueDose(BigDecimal.valueOf(RandomUtil.randomInt(100)));
|
|
|
- pump1.setSelfControlLockTime(RandomUtil.randomInt(100));
|
|
|
- pump1.setPcaValidCount(RandomUtil.randomInt(100));
|
|
|
- pump1.setPcaInvalidCount(RandomUtil.randomInt(100));
|
|
|
- pump1.setPcaTotalCount(pump.getPcaInvalidCount()+pump.getPcaValidCount());
|
|
|
- pump1.setContinueDose(BigDecimal.valueOf(RandomUtil.randomInt(100)));
|
|
|
-
|
|
|
- pump1.setPulseDose(RandomUtil.randomInt(100));
|
|
|
- pump1.setPulseLockTime(RandomUtil.randomInt(100));
|
|
|
- pump1.setPulseFirstLockTime(RandomUtil.randomInt(100));
|
|
|
- pump1.setFlowAdjustRate(BigDecimal.valueOf(RandomUtil.randomInt(100)));
|
|
|
- pump1.setFlowCount(BigDecimal.valueOf(RandomUtil.randomInt(100)));
|
|
|
- pump1.setFlowDownCycle(BigDecimal.valueOf(RandomUtil.randomInt(100)));
|
|
|
- pump1.setFlowDownLimit(BigDecimal.valueOf(RandomUtil.randomInt(100)));
|
|
|
- pump1.setFlowUpCycle(BigDecimal.valueOf(RandomUtil.randomInt(100)));
|
|
|
- pump1.setFlowUpLimit(BigDecimal.valueOf(RandomUtil.randomInt(100)));
|
|
|
-
|
|
|
- pump1.setUploadTime(new Date());
|
|
|
- Thread.sleep(5000);
|
|
|
-
|
|
|
- BusDeviceRunningEntity pump2 = new BusDeviceRunningEntity();
|
|
|
- pump2.setType(DeviceTypeEnum.continuous);
|
|
|
- pump2.setDeviceId("456");
|
|
|
- pump2.setClassification(String.valueOf(mark));
|
|
|
- pump2.setPatientCode("789");
|
|
|
- pump2.setTotalDose(RandomUtil.randomInt(100));
|
|
|
- pump2.setFirstDose(RandomUtil.randomInt(100));
|
|
|
- pump2.setRemainDose(BigDecimal.valueOf(RandomUtil.randomInt(100)));
|
|
|
- pump2.setInputDose(BigDecimal.valueOf(RandomUtil.randomInt(100)));
|
|
|
- pump2.setAppendDose(BigDecimal.valueOf(RandomUtil.randomInt(100)));
|
|
|
- pump2.setAppendLockTime(BigDecimal.valueOf(RandomUtil.randomInt(100)));
|
|
|
- pump2.setMaxDose(BigDecimal.valueOf(RandomUtil.randomInt(100)));
|
|
|
- pump2.setSelfControlCount(RandomUtil.randomInt(100));
|
|
|
- pump2.setSelfControlLockTime(RandomUtil.randomInt(100));
|
|
|
- pump2.setFirstDose(RandomUtil.randomInt(100));
|
|
|
- pump2.setRemainDose(BigDecimal.valueOf(RandomUtil.randomInt(100)));
|
|
|
- pump2.setContinueDose(BigDecimal.valueOf(RandomUtil.randomInt(100)));
|
|
|
- pump2.setSelfControlLockTime(RandomUtil.randomInt(100));
|
|
|
- pump2.setPcaValidCount(RandomUtil.randomInt(100));
|
|
|
- pump2.setPcaInvalidCount(RandomUtil.randomInt(100));
|
|
|
- pump2.setPcaTotalCount(pump.getPcaInvalidCount()+pump.getPcaValidCount());
|
|
|
- pump2.setContinueDose(BigDecimal.valueOf(RandomUtil.randomInt(100)));
|
|
|
-
|
|
|
- pump2.setPulseDose(RandomUtil.randomInt(100));
|
|
|
- pump2.setPulseLockTime(RandomUtil.randomInt(100));
|
|
|
- pump2.setPulseFirstLockTime(RandomUtil.randomInt(100));
|
|
|
- pump2.setFlowAdjustRate(BigDecimal.valueOf(RandomUtil.randomInt(100)));
|
|
|
- pump2.setFlowCount(BigDecimal.valueOf(RandomUtil.randomInt(100)));
|
|
|
- pump2.setFlowDownCycle(BigDecimal.valueOf(RandomUtil.randomInt(100)));
|
|
|
- pump2.setFlowDownLimit(BigDecimal.valueOf(RandomUtil.randomInt(100)));
|
|
|
- pump2.setFlowUpCycle(BigDecimal.valueOf(RandomUtil.randomInt(100)));
|
|
|
- pump2.setFlowUpLimit(BigDecimal.valueOf(RandomUtil.randomInt(100)));
|
|
|
-
|
|
|
- pump2.setUploadTime(new Date());
|
|
|
-
|
|
|
- Thread.sleep(5000);
|
|
|
-
|
|
|
- BusDeviceRunningEntity pump3 = new BusDeviceRunningEntity();
|
|
|
- pump3.setDeviceId("456");
|
|
|
- pump3.setClassification(String.valueOf(mark));
|
|
|
- pump3.setType(DeviceTypeEnum.continuous);
|
|
|
- pump3.setPatientCode("456");
|
|
|
- pump3.setTotalDose(RandomUtil.randomInt(100));
|
|
|
- pump3.setFirstDose(RandomUtil.randomInt(100));
|
|
|
- pump3.setRemainDose(BigDecimal.valueOf(RandomUtil.randomInt(100)));
|
|
|
- pump3.setInputDose(BigDecimal.valueOf(RandomUtil.randomInt(100)));
|
|
|
- pump3.setAppendDose(BigDecimal.valueOf(RandomUtil.randomInt(100)));
|
|
|
- pump3.setAppendLockTime(BigDecimal.valueOf(RandomUtil.randomInt(100)));
|
|
|
- pump3.setMaxDose(BigDecimal.valueOf(RandomUtil.randomInt(100)));
|
|
|
- pump3.setSelfControlCount(RandomUtil.randomInt(100));
|
|
|
- pump3.setSelfControlLockTime(RandomUtil.randomInt(100));
|
|
|
- pump3.setFirstDose(RandomUtil.randomInt(100));
|
|
|
- pump3.setRemainDose(BigDecimal.valueOf(RandomUtil.randomInt(100)));
|
|
|
- pump3.setContinueDose(BigDecimal.valueOf(RandomUtil.randomInt(100)));
|
|
|
- pump3.setSelfControlLockTime(RandomUtil.randomInt(100));
|
|
|
- pump3.setPcaValidCount(RandomUtil.randomInt(100));
|
|
|
- pump3.setPcaInvalidCount(RandomUtil.randomInt(100));
|
|
|
- pump3.setPcaTotalCount(pump.getPcaInvalidCount()+pump.getPcaValidCount());
|
|
|
- pump3.setContinueDose(BigDecimal.valueOf(RandomUtil.randomInt(100)));
|
|
|
-
|
|
|
- pump3.setPulseDose(RandomUtil.randomInt(100));
|
|
|
- pump3.setPulseLockTime(RandomUtil.randomInt(100));
|
|
|
- pump3.setPulseFirstLockTime(RandomUtil.randomInt(100));
|
|
|
- pump3.setFlowAdjustRate(BigDecimal.valueOf(RandomUtil.randomInt(100)));
|
|
|
- pump3.setFlowCount(BigDecimal.valueOf(RandomUtil.randomInt(100)));
|
|
|
- pump3.setFlowDownCycle(BigDecimal.valueOf(RandomUtil.randomInt(100)));
|
|
|
- pump3.setFlowDownLimit(BigDecimal.valueOf(RandomUtil.randomInt(100)));
|
|
|
- pump3.setFlowUpCycle(BigDecimal.valueOf(RandomUtil.randomInt(100)));
|
|
|
- pump3.setFlowUpLimit(BigDecimal.valueOf(RandomUtil.randomInt(100)));
|
|
|
-
|
|
|
- pump3.setUploadTime(new Date());
|
|
|
- SpringUtil.publishEvent(new DeviceInfoEvent(this,pump3,pump3.getDeviceId()));
|
|
|
+// Thread.sleep(5000);
|
|
|
+//
|
|
|
+// BusDeviceRunningEntity pump1 = new BusDeviceRunningEntity();
|
|
|
+// pump1.setDeviceId("456");
|
|
|
+// pump1.setType(DeviceTypeEnum.continuous);
|
|
|
+// pump1.setClassification(String.valueOf(mark));
|
|
|
+// pump1.setPatientCode("456");
|
|
|
+// pump1.setTotalDose(RandomUtil.randomInt(100));
|
|
|
+// pump1.setFirstDose(RandomUtil.randomInt(100));
|
|
|
+// pump1.setRemainDose(BigDecimal.valueOf(RandomUtil.randomInt(100)));
|
|
|
+// pump1.setInputDose(BigDecimal.valueOf(RandomUtil.randomInt(100)));
|
|
|
+// pump1.setAppendDose(BigDecimal.valueOf(RandomUtil.randomInt(100)));
|
|
|
+// pump1.setAppendLockTime(BigDecimal.valueOf(RandomUtil.randomInt(100)));
|
|
|
+// pump1.setMaxDose(BigDecimal.valueOf(RandomUtil.randomInt(100)));
|
|
|
+// pump1.setSelfControlCount(RandomUtil.randomInt(100));
|
|
|
+// pump1.setSelfControlLockTime(RandomUtil.randomInt(100));
|
|
|
+// pump1.setFirstDose(RandomUtil.randomInt(100));
|
|
|
+// pump1.setRemainDose(BigDecimal.valueOf(RandomUtil.randomInt(100)));
|
|
|
+// pump1.setContinueDose(BigDecimal.valueOf(RandomUtil.randomInt(100)));
|
|
|
+// pump1.setSelfControlLockTime(RandomUtil.randomInt(100));
|
|
|
+// pump1.setPcaValidCount(RandomUtil.randomInt(100));
|
|
|
+// pump1.setPcaInvalidCount(RandomUtil.randomInt(100));
|
|
|
+// pump1.setPcaTotalCount(pump.getPcaInvalidCount()+pump.getPcaValidCount());
|
|
|
+// pump1.setContinueDose(BigDecimal.valueOf(RandomUtil.randomInt(100)));
|
|
|
+//
|
|
|
+//
|
|
|
+// pump1.setPulseDose(RandomUtil.randomInt(100));
|
|
|
+// pump1.setPulseLockTime(RandomUtil.randomInt(100));
|
|
|
+// pump1.setPulseFirstLockTime(RandomUtil.randomInt(100));
|
|
|
+// pump1.setFlowAdjustRate(BigDecimal.valueOf(RandomUtil.randomInt(100)));
|
|
|
+// pump1.setFlowCount(BigDecimal.valueOf(RandomUtil.randomInt(100)));
|
|
|
+// pump1.setFlowDownCycle(BigDecimal.valueOf(RandomUtil.randomInt(100)));
|
|
|
+// pump1.setFlowDownLimit(BigDecimal.valueOf(RandomUtil.randomInt(100)));
|
|
|
+// pump1.setFlowUpCycle(BigDecimal.valueOf(RandomUtil.randomInt(100)));
|
|
|
+// pump1.setFlowUpLimit(BigDecimal.valueOf(RandomUtil.randomInt(100)));
|
|
|
+//
|
|
|
+// pump1.setUploadTime(new Date());
|
|
|
+// Thread.sleep(5000);
|
|
|
+//
|
|
|
+// BusDeviceRunningEntity pump2 = new BusDeviceRunningEntity();
|
|
|
+// pump2.setType(DeviceTypeEnum.continuous);
|
|
|
+// pump2.setDeviceId("456");
|
|
|
+// pump2.setClassification(String.valueOf(mark));
|
|
|
+// pump2.setPatientCode("789");
|
|
|
+// pump2.setTotalDose(RandomUtil.randomInt(100));
|
|
|
+// pump2.setFirstDose(RandomUtil.randomInt(100));
|
|
|
+// pump2.setRemainDose(BigDecimal.valueOf(RandomUtil.randomInt(100)));
|
|
|
+// pump2.setInputDose(BigDecimal.valueOf(RandomUtil.randomInt(100)));
|
|
|
+// pump2.setAppendDose(BigDecimal.valueOf(RandomUtil.randomInt(100)));
|
|
|
+// pump2.setAppendLockTime(BigDecimal.valueOf(RandomUtil.randomInt(100)));
|
|
|
+// pump2.setMaxDose(BigDecimal.valueOf(RandomUtil.randomInt(100)));
|
|
|
+// pump2.setSelfControlCount(RandomUtil.randomInt(100));
|
|
|
+// pump2.setSelfControlLockTime(RandomUtil.randomInt(100));
|
|
|
+// pump2.setFirstDose(RandomUtil.randomInt(100));
|
|
|
+// pump2.setRemainDose(BigDecimal.valueOf(RandomUtil.randomInt(100)));
|
|
|
+// pump2.setContinueDose(BigDecimal.valueOf(RandomUtil.randomInt(100)));
|
|
|
+// pump2.setSelfControlLockTime(RandomUtil.randomInt(100));
|
|
|
+// pump2.setPcaValidCount(RandomUtil.randomInt(100));
|
|
|
+// pump2.setPcaInvalidCount(RandomUtil.randomInt(100));
|
|
|
+// pump2.setPcaTotalCount(pump.getPcaInvalidCount()+pump.getPcaValidCount());
|
|
|
+// pump2.setContinueDose(BigDecimal.valueOf(RandomUtil.randomInt(100)));
|
|
|
+//
|
|
|
+// pump2.setPulseDose(RandomUtil.randomInt(100));
|
|
|
+// pump2.setPulseLockTime(RandomUtil.randomInt(100));
|
|
|
+// pump2.setPulseFirstLockTime(RandomUtil.randomInt(100));
|
|
|
+// pump2.setFlowAdjustRate(BigDecimal.valueOf(RandomUtil.randomInt(100)));
|
|
|
+// pump2.setFlowCount(BigDecimal.valueOf(RandomUtil.randomInt(100)));
|
|
|
+// pump2.setFlowDownCycle(BigDecimal.valueOf(RandomUtil.randomInt(100)));
|
|
|
+// pump2.setFlowDownLimit(BigDecimal.valueOf(RandomUtil.randomInt(100)));
|
|
|
+// pump2.setFlowUpCycle(BigDecimal.valueOf(RandomUtil.randomInt(100)));
|
|
|
+// pump2.setFlowUpLimit(BigDecimal.valueOf(RandomUtil.randomInt(100)));
|
|
|
+//
|
|
|
+// pump2.setUploadTime(new Date());
|
|
|
+//
|
|
|
+// Thread.sleep(5000);
|
|
|
+//
|
|
|
+// BusDeviceRunningEntity pump3 = new BusDeviceRunningEntity();
|
|
|
+// pump3.setDeviceId("456");
|
|
|
+// pump3.setClassification(String.valueOf(mark));
|
|
|
+// pump3.setType(DeviceTypeEnum.continuous);
|
|
|
+// pump3.setPatientCode("456");
|
|
|
+// pump3.setTotalDose(RandomUtil.randomInt(100));
|
|
|
+// pump3.setFirstDose(RandomUtil.randomInt(100));
|
|
|
+// pump3.setRemainDose(BigDecimal.valueOf(RandomUtil.randomInt(100)));
|
|
|
+// pump3.setInputDose(BigDecimal.valueOf(RandomUtil.randomInt(100)));
|
|
|
+// pump3.setAppendDose(BigDecimal.valueOf(RandomUtil.randomInt(100)));
|
|
|
+// pump3.setAppendLockTime(BigDecimal.valueOf(RandomUtil.randomInt(100)));
|
|
|
+// pump3.setMaxDose(BigDecimal.valueOf(RandomUtil.randomInt(100)));
|
|
|
+// pump3.setSelfControlCount(RandomUtil.randomInt(100));
|
|
|
+// pump3.setSelfControlLockTime(RandomUtil.randomInt(100));
|
|
|
+// pump3.setFirstDose(RandomUtil.randomInt(100));
|
|
|
+// pump3.setRemainDose(BigDecimal.valueOf(RandomUtil.randomInt(100)));
|
|
|
+// pump3.setContinueDose(BigDecimal.valueOf(RandomUtil.randomInt(100)));
|
|
|
+// pump3.setSelfControlLockTime(RandomUtil.randomInt(100));
|
|
|
+// pump3.setPcaValidCount(RandomUtil.randomInt(100));
|
|
|
+// pump3.setPcaInvalidCount(RandomUtil.randomInt(100));
|
|
|
+// pump3.setPcaTotalCount(pump.getPcaInvalidCount()+pump.getPcaValidCount());
|
|
|
+// pump3.setContinueDose(BigDecimal.valueOf(RandomUtil.randomInt(100)));
|
|
|
+//
|
|
|
+// pump3.setPulseDose(RandomUtil.randomInt(100));
|
|
|
+// pump3.setPulseLockTime(RandomUtil.randomInt(100));
|
|
|
+// pump3.setPulseFirstLockTime(RandomUtil.randomInt(100));
|
|
|
+// pump3.setFlowAdjustRate(BigDecimal.valueOf(RandomUtil.randomInt(100)));
|
|
|
+// pump3.setFlowCount(BigDecimal.valueOf(RandomUtil.randomInt(100)));
|
|
|
+// pump3.setFlowDownCycle(BigDecimal.valueOf(RandomUtil.randomInt(100)));
|
|
|
+// pump3.setFlowDownLimit(BigDecimal.valueOf(RandomUtil.randomInt(100)));
|
|
|
+// pump3.setFlowUpCycle(BigDecimal.valueOf(RandomUtil.randomInt(100)));
|
|
|
+// pump3.setFlowUpLimit(BigDecimal.valueOf(RandomUtil.randomInt(100)));
|
|
|
+//
|
|
|
+// pump3.setUploadTime(new Date());
|
|
|
+// SpringUtil.publishEvent(new DeviceInfoEvent(this,pump3,pump3.getDeviceId()));
|
|
|
// });
|
|
|
Thread.sleep(5000);
|
|
|
String now = DateUtil.yesterday().toString();
|
|
|
@@ -628,4 +632,11 @@ public class DeviceInfoListener {
|
|
|
SpringUtil.publishEvent(new HisEvent(this,Arrays.asList(clinic),clinic.getTenantId()));
|
|
|
|
|
|
}
|
|
|
+
|
|
|
+ public static void main(String[] args) {
|
|
|
+ DeviceAlarmEnum[] enumConstants = DeviceAlarmEnum.class.getEnumConstants();
|
|
|
+ for (DeviceAlarmEnum enumConstant : enumConstants) {
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|