|
@ -1166,7 +1166,7 @@ public class SecurityMonitoringOrderService extends BaseJpaService<SecurityMonit
|
|
return new ArrayList<>();
|
|
return new ArrayList<>();
|
|
}else {
|
|
}else {
|
|
for (String team:teams){
|
|
for (String team:teams){
|
|
sql = "select DISTINCT doc.id doctor,CONCAT(doc.`name`,\n" +
|
|
|
|
|
|
sql = "select DISTINCT doc.id doctor,doc.name as doctorName,CONCAT(doc.`name`,\n" +
|
|
"CASE WHEN doc.doctor_level=1 THEN '(社区医生)' ELSE '(助老员)' END) as name,doc.photo,doc.mobile from base_team_member mem " +
|
|
"CASE WHEN doc.doctor_level=1 THEN '(社区医生)' ELSE '(助老员)' END) as name,doc.photo,doc.mobile from base_team_member mem " +
|
|
"INNER JOIN base_doctor doc on mem.doctor_code = doc.id and mem.del=1 and mem.team_code='"+team+"'";
|
|
"INNER JOIN base_doctor doc on mem.doctor_code = doc.id and mem.del=1 and mem.team_code='"+team+"'";
|
|
List<Map<String,Object>>tmp = jdbcTemplate.queryForList(sql);
|
|
List<Map<String,Object>>tmp = jdbcTemplate.queryForList(sql);
|
|
@ -1185,7 +1185,15 @@ public class SecurityMonitoringOrderService extends BaseJpaService<SecurityMonit
|
|
result.put("fall",null);
|
|
result.put("fall",null);
|
|
result.put("deviceSn",null);
|
|
result.put("deviceSn",null);
|
|
result.put("monitorInfo",null);
|
|
result.put("monitorInfo",null);
|
|
if ((StringUtils.isNotBlank(topicItem)&&"preventLost".equals(topicItem))||StringUtils.isBlank(topicItem)){
|
|
|
|
|
|
String sql = " select count(id) from base_security_monitoring_order where patient='"+patient+"' and topic_item='preventFall' and status="+SecurityMonitoringOrderDO.Status.apply.getType();
|
|
|
|
Integer count = jdbcTemplate.queryForObject(sql,Integer.class);
|
|
|
|
if (count>0){
|
|
|
|
result.put("fall",true);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
result.put("fall",false);
|
|
|
|
}
|
|
|
|
if ((StringUtils.isNotBlank(topicItem)&&"preventLost".equals(topicItem))){
|
|
List<DevicePatientDevice> devicePatientDeviceDos = patientDeviceDao.findByUserAndCategoryCode(patient,"4");
|
|
List<DevicePatientDevice> devicePatientDeviceDos = patientDeviceDao.findByUserAndCategoryCode(patient,"4");
|
|
if (devicePatientDeviceDos.size()==0){
|
|
if (devicePatientDeviceDos.size()==0){
|
|
}
|
|
}
|
|
@ -1240,20 +1248,12 @@ public class SecurityMonitoringOrderService extends BaseJpaService<SecurityMonit
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if ((StringUtils.isNotBlank(topicItem)&&"preventFall".equals(topicItem))||StringUtils.isBlank(topicItem)){
|
|
|
|
|
|
if ((StringUtils.isNotBlank(topicItem)&&"preventFall".equals(topicItem))){
|
|
List<DevicePatientDevice> devicePatientDeviceDos = patientDeviceDao.findByUserAndCategoryCode(patient,"12");
|
|
List<DevicePatientDevice> devicePatientDeviceDos = patientDeviceDao.findByUserAndCategoryCode(patient,"12");
|
|
if (devicePatientDeviceDos.size()==0){
|
|
if (devicePatientDeviceDos.size()==0){
|
|
|
|
|
|
}
|
|
}
|
|
else{
|
|
else{
|
|
String sql = " select count(id) from base_security_monitoring_order where patient='"+patient+"' and topic_item='preventFall' and status="+SecurityMonitoringOrderDO.Status.apply.getType();
|
|
|
|
Integer count = jdbcTemplate.queryForObject(sql,Integer.class);
|
|
|
|
if (count>0){
|
|
|
|
result.put("fall",true);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
result.put("fall",false);
|
|
|
|
}
|
|
|
|
try {
|
|
try {
|
|
JSONObject monitorUrl = ysDeviceServicel.getDeviceLiveAddress(patient,devicePatientDeviceDos.get(0).getDeviceSn(),1,null);
|
|
JSONObject monitorUrl = ysDeviceServicel.getDeviceLiveAddress(patient,devicePatientDeviceDos.get(0).getDeviceSn(),1,null);
|
|
result.put("monitorInfoStatus",monitorUrl.getIntValue(ResponseContant.resultFlag));
|
|
result.put("monitorInfoStatus",monitorUrl.getIntValue(ResponseContant.resultFlag));
|