|
|
@@ -123,7 +123,7 @@ public class DeviceInfoListener {
|
|
|
String originClassify = deviceOperator.getClassification();
|
|
|
String classification = device.getClassification();
|
|
|
//默认为主泵,后续判断若不满足主泵条件,则替换为副泵
|
|
|
- device.setMaster(1);
|
|
|
+ device.setMaster(true);
|
|
|
if(classification==null){
|
|
|
log.error("设备号:[{}]分包标识号为空,无法更新开始时间");
|
|
|
classification="-1";
|
|
|
@@ -137,7 +137,7 @@ public class DeviceInfoListener {
|
|
|
String usingId = deviceOperator.getUsingId();
|
|
|
//todo 这部分操作交由上游处理
|
|
|
device.setTenantId(deviceOperator.getTenantId());
|
|
|
- device.setMonitorType(1);
|
|
|
+ device.setMonitorType(true);
|
|
|
boolean first=false;
|
|
|
if(StrUtil.isNullOrUndefined(usingId)){
|
|
|
//设备首次运行,记录开机时间
|
|
|
@@ -157,7 +157,7 @@ public class DeviceInfoListener {
|
|
|
deviceOperator.setUsingId(device.getId());
|
|
|
deviceOperator.setStatus(device.getRunState());
|
|
|
deviceOperator.setStartTime(device.getStartTime());
|
|
|
- deviceOperator.setMaster(device.getMaster()!=null&&device.getMaster() == 1);
|
|
|
+ deviceOperator.setMaster(device.getMaster());
|
|
|
deviceOperator.setPatientCode(device.getPatientCode());
|
|
|
return null;
|
|
|
});
|
|
|
@@ -187,7 +187,7 @@ public class DeviceInfoListener {
|
|
|
Set<DeviceTimeSmallInfo> allDevice = Optional.ofNullable(currentPatientOperator.getAllDevice()).orElse(new HashSet<>());
|
|
|
allDevice.add(DeviceTimeSmallInfo.of(deviceId,device.getStartTime()));
|
|
|
currentPatientOperator.setAllDevice(allDevice);
|
|
|
- if(device.getMaster()==1){
|
|
|
+ if(Boolean.TRUE.equals(device.getMaster())){
|
|
|
currentPatientOperator.setBindDeviceId(deviceId);
|
|
|
}
|
|
|
return null;
|
|
|
@@ -228,7 +228,7 @@ public class DeviceInfoListener {
|
|
|
deviceUsingService
|
|
|
.update(new UpdateWrapper<BusDeviceRunningEntity>().lambda()
|
|
|
.eq(BusDeviceRunningEntity::getDeviceId,master.get().getDeviceId())
|
|
|
- .set(BusDeviceRunningEntity::getMaster,1));
|
|
|
+ .set(BusDeviceRunningEntity::getMaster,true));
|
|
|
suppliers.add(()->{
|
|
|
patientOperator.setBindDeviceId(master.get().getDeviceId());
|
|
|
patientOperator.setAllDevice(remainPatientBindDevices);
|
|
|
@@ -259,10 +259,10 @@ public class DeviceInfoListener {
|
|
|
if (startTime==null||startTime.before(device.getStartTime())) {
|
|
|
log.error("病号:[{}],之前主泵为:[{}],现在主泵为:[{}]",device.getPatientCode(),bindDeviceId,deviceId);
|
|
|
//设置当前上传信息的泵为主泵,将旧泵设置为副泵,并更新病人绑定泵的消息 todo 更新缓存信息
|
|
|
- device.setMaster(1);
|
|
|
- deviceUsingService.update(new UpdateWrapper<BusDeviceRunningEntity>().lambda().eq(BusDeviceRunningEntity::getDeviceId,bindDeviceId).set(BusDeviceRunningEntity::getMaster,0));
|
|
|
+ device.setMaster(true);
|
|
|
+ deviceUsingService.update(new UpdateWrapper<BusDeviceRunningEntity>().lambda().eq(BusDeviceRunningEntity::getDeviceId,bindDeviceId).set(BusDeviceRunningEntity::getMaster,false));
|
|
|
}else {
|
|
|
- device.setMaster(0);
|
|
|
+ device.setMaster(false);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -275,7 +275,7 @@ public class DeviceInfoListener {
|
|
|
*/
|
|
|
private void handleAlarm(String historyId, BusDeviceRunningEntity device, DeviceOperator deviceOperator){
|
|
|
Value value = deviceOperator.getValue(DeviceKeyConstant.ALARM);
|
|
|
- BusDeviceAlarmEntity alarm = new BusDeviceAlarmEntity(device.getDeviceId(),device.getAlarm(),new Date(),0,historyId,device.getClinicId(),device.getClassification());
|
|
|
+ BusDeviceAlarmEntity alarm = new BusDeviceAlarmEntity(device.getDeviceId(),device.getAlarm(),new Date(),false,historyId,device.getClinicId(),device.getClassification());
|
|
|
if(Objects.isNull(value.get())){
|
|
|
if (device.getAlarm()==null) {
|
|
|
//未发生报警且上一信息不为报警信息,将报警信息置为历史信息
|
|
|
@@ -290,8 +290,8 @@ public class DeviceInfoListener {
|
|
|
//报警状态改变为过去式,将报警记录置为历史状态
|
|
|
alarmService.update(new UpdateWrapper<BusDeviceAlarmEntity>().lambda()
|
|
|
.eq(BusDeviceAlarmEntity::getDeviceId,device.getDeviceId())
|
|
|
- .eq(BusDeviceAlarmEntity::getDoing,0)
|
|
|
- .set(BusDeviceAlarmEntity::getDoing,1));
|
|
|
+ .eq(BusDeviceAlarmEntity::getDoing,false)
|
|
|
+ .set(BusDeviceAlarmEntity::getDoing,true));
|
|
|
SpringUtil.publishEvent(new DeviceAlarmEvent(this,alarm,historyId));
|
|
|
} else {
|
|
|
//重复报警
|