|
|
@@ -5,6 +5,7 @@ import cn.dev33.satoken.annotation.SaCheckPermission;
|
|
|
import cn.dev33.satoken.annotation.SaMode;
|
|
|
import cn.dev33.satoken.stp.StpLogic;
|
|
|
import cn.hutool.core.collection.CollUtil;
|
|
|
+import cn.hutool.core.text.CharSequenceUtil;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
import cn.hutool.json.JSONUtil;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
@@ -272,26 +273,25 @@ public class BusPatientController implements BaseQueryController<BusPatientEnti
|
|
|
if (StrUtil.isEmpty(vo.getPatientId())) {
|
|
|
throw new CustomException("病号id不能为空");
|
|
|
}
|
|
|
- return R.success(patientService.lookPatientDetail(vo.getPatientId()));
|
|
|
-// String infusionId=vo.getInfusionId();
|
|
|
-// if(CharSequenceUtil.isAllBlank(infusionId)){
|
|
|
-// BusPatientEntity patient = patientService.getById(vo.getPatientId());
|
|
|
-// if(patient==null){
|
|
|
-// throw new CustomException("该病号信息不存在,请刷新后重试");
|
|
|
-// }
|
|
|
-// clinic = clinicService.getById(patient.getClinicId());
|
|
|
-// infusionId=patient.getInfusionId();
|
|
|
-// }else {
|
|
|
-// clinic= clinicService.getById(vo.getClinicId());
|
|
|
-// }
|
|
|
-// BusInfusionHistoryEntity infusion =infusionService.getById(infusionId);
|
|
|
-// Optional.ofNullable(deviceService.getByDeviceId(infusion.getDeviceId()))
|
|
|
-// .map(device-> {
|
|
|
-// 填充泵别名
|
|
|
-// infusion.setAlias(device.getAlias());
|
|
|
-// return device;
|
|
|
-// });
|
|
|
-// result.setInfusion(infusion);
|
|
|
+ String infusionId=vo.getInfusionId();
|
|
|
+ if(CharSequenceUtil.isAllBlank(infusionId)){
|
|
|
+ BusPatientEntity patient = patientService.getById(vo.getPatientId());
|
|
|
+ if(patient==null){
|
|
|
+ throw new CustomException("该病号信息不存在,请刷新后重试");
|
|
|
+ }
|
|
|
+ clinic = clinicService.getById(patient.getClinicId());
|
|
|
+ infusionId=patient.getInfusionId();
|
|
|
+ }else {
|
|
|
+ clinic= clinicService.getById(vo.getClinicId());
|
|
|
+ }
|
|
|
+ BusInfusionHistoryEntity infusion =infusionService.getById(infusionId);
|
|
|
+ Optional.ofNullable(deviceService.getByDeviceId(infusion.getDeviceId()))
|
|
|
+ .map(device-> {
|
|
|
+ //填充泵别名
|
|
|
+ infusion.setAlias(device.getAlias());
|
|
|
+ return device;
|
|
|
+ });
|
|
|
+ result.setInfusion(infusion);
|
|
|
}else {
|
|
|
String clinicId = vo.getClinicId();
|
|
|
clinic = clinicService.getById(clinicId);
|