|
@ -345,8 +345,8 @@ public class MessageService extends BaseService {
|
|
/**
|
|
/**
|
|
* 获取超标指标消息--根据患者分组
|
|
* 获取超标指标消息--根据患者分组
|
|
*/
|
|
*/
|
|
public List<Map<String, Object>> getHealthIndexMessage(String doctor) throws Exception {
|
|
|
|
List<Map<String, Object>> re = new ArrayList<>();
|
|
|
|
|
|
public Map<String,List<Map<String, Object>>> getHealthIndexMessage(String doctor) throws Exception {
|
|
|
|
|
|
String sql = "select a.sender,a.tz_type,count(1) count,max(date_format(a.create_time,'%Y-%m-%d %H:%i:%s')) last_time,a.has_read from wlyy_Message a where a.receiver='" + doctor + "' and a.type='2' group by a.sender,a.tz_type,a.has_read order by last_time desc";
|
|
String sql = "select a.sender,a.tz_type,count(1) count,max(date_format(a.create_time,'%Y-%m-%d %H:%i:%s')) last_time,a.has_read from wlyy_Message a where a.receiver='" + doctor + "' and a.type='2' group by a.sender,a.tz_type,a.has_read order by last_time desc";
|
|
List<Map<String, Object>> list = jdbcTemplate.queryForList(sql);
|
|
List<Map<String, Object>> list = jdbcTemplate.queryForList(sql);
|
|
|
|
|
|
@ -394,7 +394,7 @@ public class MessageService extends BaseService {
|
|
System.out.print("not exit patient!code:" + patientCode);
|
|
System.out.print("not exit patient!code:" + patientCode);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
List<Map<String, Object>> re = new ArrayList<>();
|
|
for (Map<String, Object> item : map.values()) {
|
|
for (Map<String, Object> item : map.values()) {
|
|
Map<String, Object> obj = new HashMap<>();
|
|
Map<String, Object> obj = new HashMap<>();
|
|
String type = String.valueOf(item.get("type")); //1血糖,2血压,3体重,4腰
|
|
String type = String.valueOf(item.get("type")); //1血糖,2血压,3体重,4腰
|
|
@ -407,6 +407,7 @@ public class MessageService extends BaseService {
|
|
obj.put("sex", item.get("sex"));
|
|
obj.put("sex", item.get("sex"));
|
|
obj.put("birthday", item.get("birthday"));
|
|
obj.put("birthday", item.get("birthday"));
|
|
obj.put("photo", item.get("photo"));
|
|
obj.put("photo", item.get("photo"));
|
|
|
|
obj.put("count",count1);
|
|
if ("1".equals(type)) {
|
|
if ("1".equals(type)) {
|
|
if(count1>0){
|
|
if(count1>0){
|
|
obj.put("message", "有" + count1 + "条血糖异常未读消息");
|
|
obj.put("message", "有" + count1 + "条血糖异常未读消息");
|
|
@ -422,6 +423,7 @@ public class MessageService extends BaseService {
|
|
} else {
|
|
} else {
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
|
|
|
|
re.add(obj);
|
|
re.add(obj);
|
|
}
|
|
}
|
|
Collections.sort(re, new Comparator<Map<String, Object>>() {
|
|
Collections.sort(re, new Comparator<Map<String, Object>>() {
|
|
@ -431,8 +433,18 @@ public class MessageService extends BaseService {
|
|
return time2.compareTo(time1);
|
|
return time2.compareTo(time1);
|
|
}
|
|
}
|
|
});
|
|
});
|
|
|
|
|
|
return re;
|
|
|
|
|
|
Map<String,List<Map<String, Object>>> result = new LinkedHashMap();
|
|
|
|
for(Map<String, Object> one:re){
|
|
|
|
String key = DateUtil.dateToStr(DateUtil.stringToDate(one.get("time")+"",DateUtil.YYYY_MM_DD_HH_MM_SS),DateUtil.YYYY_MM_DD);
|
|
|
|
if(result.containsKey(key)&&result.get(key)!=null){
|
|
|
|
List<Map<String, Object>> temp = result.get(key);
|
|
|
|
temp.add(one);
|
|
|
|
result.put(key,temp);
|
|
|
|
}else{
|
|
|
|
result.put(key,new ArrayList<>(Arrays.asList(one)));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return result;
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@ -456,7 +468,7 @@ public class MessageService extends BaseService {
|
|
map.put("type", type);
|
|
map.put("type", type);
|
|
map.put("read", String.valueOf(item.getRead()));
|
|
map.put("read", String.valueOf(item.getRead()));
|
|
map.put("sex", String.valueOf(item.getSex()));
|
|
map.put("sex", String.valueOf(item.getSex()));
|
|
|
|
|
|
|
|
map.put("tzCode", String.valueOf(item.getTzCode()));
|
|
map.put("czrq", DateUtil.dateToStrLong(item.getCreateTime()));
|
|
map.put("czrq", DateUtil.dateToStrLong(item.getCreateTime()));
|
|
|
|
|
|
DevicePatientHealthIndex data =devicePatientHealthIndexDao.findOne(Long.valueOf(item.getTzCode()));
|
|
DevicePatientHealthIndex data =devicePatientHealthIndexDao.findOne(Long.valueOf(item.getTzCode()));
|