|
@ -101,6 +101,8 @@ public class PatientInfoPlatFormService {
|
|
|
private DeviceDao deviceDao;
|
|
|
@Value("${spring.profiles.active}")
|
|
|
private String profiles;
|
|
|
@Value("${wechat.id}")
|
|
|
private String wxId;
|
|
|
|
|
|
|
|
|
/**
|
|
@ -720,7 +722,7 @@ public class PatientInfoPlatFormService {
|
|
|
/**
|
|
|
*获取设备详情
|
|
|
*/
|
|
|
public List<Map<String,Object>> getPatientDeviceInfoWithDetail(String patient,String deviceSn,String warnTime,Integer isShow){
|
|
|
public List<Map<String,Object>> getPatientDeviceInfoWithDetail(String patient,String deviceSn,String warnTime,Integer isShow) throws Exception {
|
|
|
//已绑定设备
|
|
|
List<Map<String,Object>> list = new ArrayList<>();
|
|
|
String sql = "select dd.photo,pd.device_sn,dd.brands,dd.category_code,dd.model,pd.device_name,date_format(pd.czrq,'%Y-%m-%d %H:%i:%S' ) deviceTime,dd.device_type as deviceType " +
|
|
@ -749,9 +751,9 @@ public class PatientInfoPlatFormService {
|
|
|
list.add(resultMap);
|
|
|
}
|
|
|
|
|
|
//查找所有设备
|
|
|
/* //查找所有设备
|
|
|
if("hzkxtest".equals(profiles)){
|
|
|
List<Device> deviceList = deviceDao.findAll();
|
|
|
*//*List<Device> deviceList = deviceDao.findAll();
|
|
|
Map<String,List<Device>> deviceMap = deviceList.stream().collect(Collectors.groupingBy(Device::getName));
|
|
|
for (String deviceName:deviceMap.keySet()){
|
|
|
if(map.get(deviceName)==null){
|
|
@ -760,11 +762,11 @@ public class PatientInfoPlatFormService {
|
|
|
devicetmp.put("category_code",deviceMap.get(deviceName).get(0).getCategoryCode());
|
|
|
devicetmp.put("deviceType",deviceMap.get(deviceName).get(0).getDeviceType());
|
|
|
devicetmp.put("device_name",deviceName);
|
|
|
devicetmp.put("detailInfo",new JSONObject());
|
|
|
devicetmp.put("detailInfo",getDeviceIndexAndOrder(deviceMap.get(deviceName).get(0).getCategoryCode(),deviceMap.get(deviceName).get(0).get,patient,warnTime););
|
|
|
list.add(devicetmp);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}*//*
|
|
|
}*/
|
|
|
return list;
|
|
|
}
|
|
|
|
|
@ -935,7 +937,7 @@ public class PatientInfoPlatFormService {
|
|
|
* 血压2:最近一次收缩压,舒张压、在线状态
|
|
|
* 血糖1:最近一次血糖、在线状态
|
|
|
*/
|
|
|
public Map<String,Object> getDeviceIndexAndOrder(String category_code,String deviceSn,String patient,String filterTime){
|
|
|
public Map<String,Object> getDeviceIndexAndOrder(String category_code,String deviceSn,String patient,String filterTime) throws Exception {
|
|
|
|
|
|
String dictSql = "SELECT * from base_yujing_dict where del =1";
|
|
|
List<BaseYujingDict> dictList = jdbcTemplate.query(dictSql, new BeanPropertyRowMapper<>(BaseYujingDict.class));
|
|
@ -1188,13 +1190,24 @@ public class PatientInfoPlatFormService {
|
|
|
detailInfo.put("monitorInfo", "未获取到当天录像信息");
|
|
|
}
|
|
|
}else {
|
|
|
com.alibaba.fastjson.JSONObject tmp = ysDeviceService.getDeviceLiveAddress(patient, deviceSn, 1, null);
|
|
|
detailInfo.put("monitorInfoStatus", tmp.getIntValue(ResponseContant.resultFlag));
|
|
|
if (tmp.getIntValue(ResponseContant.resultFlag) == ResponseContant.fail) {
|
|
|
detailInfo.put("monitorInfo", tmp.getString(ResponseContant.resultMsg));
|
|
|
} else {
|
|
|
detailInfo.put("monitorInfo", tmp.getJSONObject(ResponseContant.resultMsg));
|
|
|
if (wxId.equalsIgnoreCase("hz_kx_wx")) {
|
|
|
com.alibaba.fastjson.JSONObject tmp = ysDeviceService.getKxDeviceLiveAddress(patient, deviceSn, 1, null);
|
|
|
detailInfo.put("monitorInfoStatus", tmp.getIntValue(ResponseContant.resultFlag));
|
|
|
if (tmp.getIntValue(ResponseContant.resultFlag) == ResponseContant.fail) {
|
|
|
detailInfo.put("monitorInfo", tmp.getString(ResponseContant.resultMsg));
|
|
|
} else {
|
|
|
detailInfo.put("monitorInfo", tmp.getJSONObject(ResponseContant.resultMsg));
|
|
|
}
|
|
|
}else {
|
|
|
com.alibaba.fastjson.JSONObject tmp = ysDeviceService.getDeviceLiveAddress(patient, deviceSn, 1, null);
|
|
|
detailInfo.put("monitorInfoStatus", tmp.getIntValue(ResponseContant.resultFlag));
|
|
|
if (tmp.getIntValue(ResponseContant.resultFlag) == ResponseContant.fail) {
|
|
|
detailInfo.put("monitorInfo", tmp.getString(ResponseContant.resultMsg));
|
|
|
} else {
|
|
|
detailInfo.put("monitorInfo", tmp.getJSONObject(ResponseContant.resultMsg));
|
|
|
}
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
break;
|