Parcourir la source

fix 重复泵

18339543638 il y a 3 ans
Parent
commit
ac653916ae

+ 1 - 1
nb-im/src/main/java/com/nb/im/service/LocalImRoomUserService.java

@@ -42,7 +42,7 @@ public class LocalImRoomUserService extends BaseService<ChatRoomUserMapper, ImRo
         result.setTop(false);
         result.setUserId(partId);
         result.setUserType(partType);
-        result.setLastSendTime(new Date());
+//        result.setLastSendTime(new Date());
         this.save(result);
         return result;
     }

+ 5 - 1
nb-service/web-service/src/main/java/com/nb/web/service/bus/service/LocalBusInfusionHistoryService.java

@@ -187,9 +187,9 @@ public class LocalBusInfusionHistoryService extends BaseService<BusInfusionHisto
             infusionIds =deviceIds.stream().map(deviceRegistry::getOperator).map(DeviceOperator::getInfusionId).collect(Collectors.toList());
         }
         log.info("结束临床信息:{}", JSONUtil.toJsonStr(manualUndoConfig));
+        BusPatientEntity patient = patientService.getById(manualUndoConfig.getPatientId());
         if(!finishClinic){
             if(Boolean.TRUE.equals(manualUndoConfig.getMonitorType())){
-                BusPatientEntity patient = patientService.getById(manualUndoConfig.getPatientId());
                 if(patient==null){
                     throw new CustomException("所选住院号有误,请重新选择");
                 }
@@ -233,6 +233,10 @@ public class LocalBusInfusionHistoryService extends BaseService<BusInfusionHisto
                         .set(BusInfusionHistoryEntity::getUndoTime,undo.getUndoTime())
                         .set(BusInfusionHistoryEntity::getUndoTime,undo.getUndoTime()));
             }
+            patientService.update(new UpdateWrapper<BusPatientEntity>()
+                    .lambda()
+                    .eq(BusPatientEntity::getId,patient.getId())
+                    .set(BusPatientEntity::getAlarm,PatientAlarmEnum.NONE));
             clinicService.finish(manualUndoConfig.getClinicId(),manualUndoConfig.getTenantId());
         }
     }

+ 5 - 2
nb-service/web-service/src/main/java/com/nb/web/service/bus/service/constant/LocalBusConAlarmService.java

@@ -26,8 +26,10 @@ public class LocalBusConAlarmService extends AbstractConstantService<BusConAlarm
         if(entity.getType()==null){
             throw new CustomException("报警类型不能为空");
         }
-        if (this.getOne(new QueryWrapper<BusConAlarmEntity>().lambda().eq(BusConAlarmEntity::getCause,entity.getCause())
-        .eq(BusConAlarmEntity::getType,entity.getType()))!=null) {
+        if (this.getOne(new QueryWrapper<BusConAlarmEntity>().lambda()
+                .eq(BusConAlarmEntity::getCause,entity.getCause())
+                .eq(StrUtil.isNotEmpty(entity.getTenantId()),BusConAlarmEntity::getTenantId,entity.getTenantId())
+                .eq(BusConAlarmEntity::getType,entity.getType()))!=null) {
             throw new CustomException("报警原因不能重复");
         }
     }
@@ -45,6 +47,7 @@ public class LocalBusConAlarmService extends AbstractConstantService<BusConAlarm
         }
         if (this.getOne(new QueryWrapper<BusConAlarmEntity>().lambda().eq(BusConAlarmEntity::getCause,entity.getCause())
                 .ne(BusConAlarmEntity::getId,entity.getId())
+                .eq(StrUtil.isNotEmpty(entity.getTenantId()),BusConAlarmEntity::getTenantId,entity.getTenantId())
                 .eq(BusConAlarmEntity::getType,entity.getType()))!=null) {
             throw new CustomException("报警原因不能重复");
         }