|
@@ -116,11 +116,16 @@ public class BusPatientController implements BaseQueryController<BusPatientEnti
|
|
|
if(CollUtil.isEmpty(patientCodes)){
|
|
if(CollUtil.isEmpty(patientCodes)){
|
|
|
throw new CustomException("请选择一个病患");
|
|
throw new CustomException("请选择一个病患");
|
|
|
}
|
|
}
|
|
|
|
|
+ List<BusPatientEntity> patients = patientService.list(new QueryWrapper<BusPatientEntity>()
|
|
|
|
|
+ .lambda().in(BusPatientEntity::getCode, patientCodes));
|
|
|
|
|
+ if(CollUtil.isEmpty(patients)){
|
|
|
|
|
+ throw new CustomException("病号不存在,请刷新后重试");
|
|
|
|
|
+ }
|
|
|
return R.success(infusionService.count(new QueryWrapper<BusInfusionHistoryEntity>()
|
|
return R.success(infusionService.count(new QueryWrapper<BusInfusionHistoryEntity>()
|
|
|
.lambda()
|
|
.lambda()
|
|
|
.nested(i->i.ne(BusInfusionHistoryEntity::getRunState,DeviceStatusEnum.Shutdown)
|
|
.nested(i->i.ne(BusInfusionHistoryEntity::getRunState,DeviceStatusEnum.Shutdown)
|
|
|
.ne(BusInfusionHistoryEntity::getRunState,DeviceStatusEnum.NoSignal))
|
|
.ne(BusInfusionHistoryEntity::getRunState,DeviceStatusEnum.NoSignal))
|
|
|
- .in(BusInfusionHistoryEntity::getPatientCode,patientCodes)
|
|
|
|
|
|
|
+ .in(BusInfusionHistoryEntity::getPatientId,patients.stream().map(BusPatientEntity::getId).collect(Collectors.toList()))
|
|
|
.eq(BusInfusionHistoryEntity::getFinished,false))!=0);
|
|
.eq(BusInfusionHistoryEntity::getFinished,false))!=0);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -129,8 +134,8 @@ public class BusPatientController implements BaseQueryController<BusPatientEnti
|
|
|
@ApiResponse(code = 4001,message = "病号当前绑定了多个设备,不可结束管理")
|
|
@ApiResponse(code = 4001,message = "病号当前绑定了多个设备,不可结束管理")
|
|
|
@ApiOperation(value = "结束管理",notes = "病患当前绑定主设备必须要在关机、不在服务器、待机中才能结束管理,权限【bus:patient:finished】")
|
|
@ApiOperation(value = "结束管理",notes = "病患当前绑定主设备必须要在关机、不在服务器、待机中才能结束管理,权限【bus:patient:finished】")
|
|
|
public R<Boolean> finished(@PathVariable("monitorType")@ApiParam(value = "是否为无泵管理 false、无泵 true、有泵",defaultValue = "false" ) boolean haveDevice,
|
|
public R<Boolean> finished(@PathVariable("monitorType")@ApiParam(value = "是否为无泵管理 false、无泵 true、有泵",defaultValue = "false" ) boolean haveDevice,
|
|
|
- @RequestBody MonitorFinishedVo monitorFinishedVo,
|
|
|
|
|
- @RequestAttribute("tenantId")@ApiParam(hidden = true) String tenantId){
|
|
|
|
|
|
|
+ @RequestBody MonitorFinishedVo monitorFinishedVo,
|
|
|
|
|
+ @RequestAttribute("tenantId")@ApiParam(hidden = true) String tenantId){
|
|
|
log.info("结束管理,【{}】",JSONUtil.toJsonStr(monitorFinishedVo));
|
|
log.info("结束管理,【{}】",JSONUtil.toJsonStr(monitorFinishedVo));
|
|
|
if(haveDevice){
|
|
if(haveDevice){
|
|
|
R<Boolean> result = monitorFinished(monitorFinishedVo, tenantId);
|
|
R<Boolean> result = monitorFinished(monitorFinishedVo, tenantId);
|
|
@@ -289,7 +294,7 @@ public class BusPatientController implements BaseQueryController<BusPatientEnti
|
|
|
//无泵查看
|
|
//无泵查看
|
|
|
result.setDeviceManual( manualService.getOne(new QueryWrapper<BusDeviceManualEntity>().lambda().eq(BusDeviceManualEntity::getClinicId, clinic.getId())));
|
|
result.setDeviceManual( manualService.getOne(new QueryWrapper<BusDeviceManualEntity>().lambda().eq(BusDeviceManualEntity::getClinicId, clinic.getId())));
|
|
|
}
|
|
}
|
|
|
- }
|
|
|
|
|
|
|
+ }
|
|
|
if(clinic==null){
|
|
if(clinic==null){
|
|
|
throw new CustomException("该临床信息不存在,请刷新后重试");
|
|
throw new CustomException("该临床信息不存在,请刷新后重试");
|
|
|
}
|
|
}
|