|
@ -61,7 +61,7 @@ public class DetectionPlatformService {
|
|
List<Map<String,Object>> list = jdbcTemplate.queryForList(sql);
|
|
List<Map<String,Object>> list = jdbcTemplate.queryForList(sql);
|
|
return PageEnvelop.getSuccessListWithPage("查询成功",list,page,pageSize,count);
|
|
return PageEnvelop.getSuccessListWithPage("查询成功",list,page,pageSize,count);
|
|
}else {
|
|
}else {
|
|
String sql = " select '22' as 'OrderType',ord.id,ord.patient,p.name,ord.serve_desc,DATE_FORMAT(ord.create_time,'%Y-%m-%d %H:%i:%S') create_time,ord.`status` \n" +
|
|
|
|
|
|
String sql = " select '22' as 'OrderType',ord.id,ord.patient,p.name,ord.serve_desc,DATE_FORMAT(ord.create_time,'%Y-%m-%d %H:%i:%S') create_time,ord.`status`,ord.doctor,ord.doctor_name \n" +
|
|
"from base_security_monitoring_order ord INNER JOIN base_patient p on ord.patient = p.id order by create_time desc ";
|
|
"from base_security_monitoring_order ord INNER JOIN base_patient p on ord.patient = p.id order by create_time desc ";
|
|
String countSql = "select count(id) from ("+sql+")A ";
|
|
String countSql = "select count(id) from ("+sql+")A ";
|
|
long count = jdbcTemplate.queryForObject(countSql,long.class);
|
|
long count = jdbcTemplate.queryForObject(countSql,long.class);
|
|
@ -169,6 +169,7 @@ public class DetectionPlatformService {
|
|
|
|
|
|
public JSONArray getDeviceByCondition(String categoryCode , String user){
|
|
public JSONArray getDeviceByCondition(String categoryCode , String user){
|
|
JSONArray jsonArray = new JSONArray();
|
|
JSONArray jsonArray = new JSONArray();
|
|
|
|
JSONArray arrayAll = new JSONArray();
|
|
List<DevicePatientDevice> patientDevices = patientDeviceDao.findAllGroupUser();
|
|
List<DevicePatientDevice> patientDevices = patientDeviceDao.findAllGroupUser();
|
|
if (StringUtils.isNotBlank(categoryCode)) { //categoryCode != null 根据设备类型查询
|
|
if (StringUtils.isNotBlank(categoryCode)) { //categoryCode != null 根据设备类型查询
|
|
patientDevices = patientDeviceDao.findAllByCategoryCode(categoryCode);
|
|
patientDevices = patientDeviceDao.findAllByCategoryCode(categoryCode);
|
|
@ -187,7 +188,6 @@ public class DetectionPlatformService {
|
|
// List<Map<String , Object>> userList = jdbcTemplate.queryForList(userSql);
|
|
// List<Map<String , Object>> userList = jdbcTemplate.queryForList(userSql);
|
|
if (patientDevices.size() > 0) {
|
|
if (patientDevices.size() > 0) {
|
|
for (int i=0;i<patientDevices.size();i++) {
|
|
for (int i=0;i<patientDevices.size();i++) {
|
|
JSONArray arrayAll = new JSONArray();
|
|
|
|
JSONArray array = new JSONArray();
|
|
JSONArray array = new JSONArray();
|
|
JSONObject userObj = new JSONObject();
|
|
JSONObject userObj = new JSONObject();
|
|
userObj.put("patient",patientDevices.get(i).getUser());
|
|
userObj.put("patient",patientDevices.get(i).getUser());
|
|
@ -222,13 +222,12 @@ public class DetectionPlatformService {
|
|
userObj.put("deviceInfo",array);
|
|
userObj.put("deviceInfo",array);
|
|
arrayAll.add(userObj);
|
|
arrayAll.add(userObj);
|
|
}
|
|
}
|
|
jsonArray.add(arrayAll);
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
return jsonArray;
|
|
|
|
|
|
return arrayAll;
|
|
}
|
|
}
|
|
return jsonArray;
|
|
|
|
|
|
return arrayAll;
|
|
}
|
|
}
|
|
|
|
|
|
public JSONObject getDeviceInfo(String deviceSn) throws Exception{
|
|
public JSONObject getDeviceInfo(String deviceSn) throws Exception{
|
|
@ -252,8 +251,10 @@ public class DetectionPlatformService {
|
|
object.put("idcard",patientInfoList.get(0).get("idcard"));
|
|
object.put("idcard",patientInfoList.get(0).get("idcard"));
|
|
object.put("address",patientInfoList.get(0).get("address"));
|
|
object.put("address",patientInfoList.get(0).get("address"));
|
|
String dataSql= "";
|
|
String dataSql= "";
|
|
|
|
String recordSql = "";
|
|
List<Map<String , Object>> dataList = new ArrayList<>();
|
|
List<Map<String , Object>> dataList = new ArrayList<>();
|
|
switch (categoryCode) {
|
|
|
|
|
|
List<Map<String , Object>> recordList = new ArrayList<>();
|
|
|
|
switch (categoryCode) { //设备数据
|
|
// 1=血糖仪 2=血压计 14=燃气报警器 15=烟雾报警器
|
|
// 1=血糖仪 2=血压计 14=燃气报警器 15=烟雾报警器
|
|
// 4=智能手表 7=居家安全报警器 16=智能拐杖 13=智能床带/睡眠带
|
|
// 4=智能手表 7=居家安全报警器 16=智能拐杖 13=智能床带/睡眠带
|
|
case "1" :
|
|
case "1" :
|
|
@ -270,11 +271,17 @@ public class DetectionPlatformService {
|
|
dataSql = "SELECT record_time recordDate,`value`,unit,device_type FROM base_device_health_index WHERE device_sn = '"+deviceSn+"' ORDER BY record_time DESC LIMIT 10 ";
|
|
dataSql = "SELECT record_time recordDate,`value`,unit,device_type FROM base_device_health_index WHERE device_sn = '"+deviceSn+"' ORDER BY record_time DESC LIMIT 10 ";
|
|
dataList = jdbcTemplate.queryForList(dataSql);
|
|
dataList = jdbcTemplate.queryForList(dataSql);
|
|
object.put("data",dataList);
|
|
object.put("data",dataList);
|
|
|
|
recordSql = "SELECT * FROM base_device_health_index WHERE device_sn = '"+deviceSn+"' order by record_time desc ";
|
|
|
|
recordList = jdbcTemplate.queryForList(recordSql);
|
|
|
|
object.put("record",recordList);
|
|
break;
|
|
break;
|
|
case "15" :
|
|
case "15" :
|
|
dataSql = "SELECT record_time recordDate,`value`,unit,device_type FROM base_device_health_index WHERE device_sn = '"+deviceSn+"' ORDER BY record_time DESC LIMIT 10 ";
|
|
dataSql = "SELECT record_time recordDate,`value`,unit,device_type FROM base_device_health_index WHERE device_sn = '"+deviceSn+"' ORDER BY record_time DESC LIMIT 10 ";
|
|
dataList = jdbcTemplate.queryForList(dataSql);
|
|
dataList = jdbcTemplate.queryForList(dataSql);
|
|
object.put("data",dataList);
|
|
object.put("data",dataList);
|
|
|
|
recordSql = "SELECT * FROM base_device_health_index WHERE device_sn = '"+deviceSn+"' order by record_time desc ";
|
|
|
|
recordList = jdbcTemplate.queryForList(recordSql);
|
|
|
|
object.put("record",recordList);
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|