|
@ -713,7 +713,7 @@ public class PatientInfoPlatFormService {
|
|
|
/**
|
|
|
*获取设备详情
|
|
|
*/
|
|
|
public List<Map<String,Object>> getPatientDeviceInfoWithDetail(String patient,String deviceSn,String warnTime){
|
|
|
public List<Map<String,Object>> getPatientDeviceInfoWithDetail(String patient,String deviceSn,String warnTime,Integer isShow){
|
|
|
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 " +
|
|
|
"from dm_device dd INNER JOIN wlyy_patient_device pd on dd.category_code = pd.category_code INNER JOIN wlyy_devices wd on dd.model = wd.device_model and pd.device_sn = wd.device_code \n" +
|
|
@ -733,9 +733,11 @@ public class PatientInfoPlatFormService {
|
|
|
Map<String,Object> detailInfo = getDeviceIndexAndOrder(category_code,deviceSN,patient,warnTime);
|
|
|
tmp.put("detailInfo",detailInfo);
|
|
|
}
|
|
|
Map<String,Object> resultMap = deviceIndexInfo(list);
|
|
|
|
|
|
list.add(resultMap);
|
|
|
if (null!=isShow&&1==isShow){
|
|
|
Map<String,Object> resultMap = deviceIndexInfo(list);
|
|
|
list.add(resultMap);
|
|
|
}
|
|
|
|
|
|
return list;
|
|
|
}
|
|
@ -761,13 +763,16 @@ public class PatientInfoPlatFormService {
|
|
|
switch (categoryCode) {
|
|
|
case 4:
|
|
|
deviceOnLineMap.put("deviceName",device_name);
|
|
|
if (detailInfo.get("wear_flagName").toString().equals("未佩戴")){
|
|
|
boolean wearFlagNameBoolean = detailInfo.containsKey("wear_flagName");
|
|
|
if (wearFlagNameBoolean&&detailInfo.get("wear_flagName").toString().equals("未佩戴")){
|
|
|
deviceStatus +=1;
|
|
|
deviceOnLineMap.put("deviceStatusCode",2);
|
|
|
}else {
|
|
|
deviceOnLineMap.put("deviceStatusCode",0);
|
|
|
}
|
|
|
deviceOnLineMap.put("deviceStatus",detailInfo.get("wear_flagName").toString());
|
|
|
if (wearFlagNameBoolean) {
|
|
|
deviceOnLineMap.put("deviceStatus",detailInfo.get("wear_flagName").toString());
|
|
|
}
|
|
|
//Map heartRate = detailInfo.get("heartRate").equals("暂无数据?")?(Map) detailInfo.get("heartRate"):new HashMap<>();
|
|
|
|
|
|
Map<String,Object> heartRate = !detailInfo.get("heartRate").equals("暂无数据?")?(Map) detailInfo.get("heartRate"): (Map)new HashMap(){{put("value1_status","暂无数据?");put("value1",0);}};
|
|
@ -780,7 +785,10 @@ public class PatientInfoPlatFormService {
|
|
|
oldCheckInfoMap.put("heartStatus",heartRate.get("value1_status"));
|
|
|
}
|
|
|
oldCheckInfoMap.put("heart",heartRate.get("value1"));
|
|
|
oldCheckInfoMap.put("leaveHome",detailInfo.get("homeRange"));
|
|
|
|
|
|
if (!detailInfo.get("homeRange").equals("暂无数据?")) {
|
|
|
oldCheckInfoMap.put("leaveHome",detailInfo.get("homeRange"));
|
|
|
}
|
|
|
oldCheckInfoMap.put("address",location.get("address"));
|
|
|
if (!detailInfo.get("steps_status").equals("暂无数据?")||!steps.get("steps").equals(0)) {
|
|
|
oldCheckInfoMap.put("stepsStatus",detailInfo.get("steps_status"));
|
|
@ -874,7 +882,7 @@ public class PatientInfoPlatFormService {
|
|
|
public List<Map<String, Object>> patientDeviceNameList(String patient){
|
|
|
|
|
|
String sql = "SELECT dd.category_code,dd.model,pd.device_name,dd.device_type AS deviceType FROM dm_device dd " +
|
|
|
" INNER JOIN wlyy_patient_device pd ON dd.category_code = pd.category_code INNER JOIN wlyy_devices wd ON dd.model = wd.device_model " +
|
|
|
" INNER JOIN wlyy_patient_device pd ON dd.category_code = pd.category_code AND pd.category_code <> '17' INNER JOIN wlyy_devices wd ON dd.model = wd.device_model " +
|
|
|
" AND pd.device_sn = wd.device_code WHERE 1 = 1 AND pd.del = 0 AND pd.`user` = '"+patient+"' " +
|
|
|
" GROUP BY dd.category_code ORDER BY dd.device_type DESC,pd.czrq ASC";
|
|
|
|
|
@ -1087,7 +1095,7 @@ public class PatientInfoPlatFormService {
|
|
|
}else {
|
|
|
detailInfo.put("isAtHome",dict(dictList,"ty4"));
|
|
|
}
|
|
|
detailInfo.put("homeRange",homeDistance * 1000);
|
|
|
detailInfo.put("homeRange",Math.floor(homeDistance * 1000));
|
|
|
}else {
|
|
|
detailInfo.put("homeRange",zwsj);
|
|
|
detailInfo.put("isAtHome",zwsj);
|