|
@ -6,6 +6,9 @@ import javax.transaction.Transactional;
|
|
|
|
|
|
import com.yihu.wlyy.entity.message.Message;
|
|
|
import com.yihu.wlyy.entity.patient.Patient;
|
|
|
import com.yihu.wlyy.health.entity.DevicePatientHealthIndex;
|
|
|
import com.yihu.wlyy.health.repository.DevicePatientHealthIndexDao;
|
|
|
import com.yihu.wlyy.repository.deviece.DeviceDao;
|
|
|
import com.yihu.wlyy.repository.message.MessageDao;
|
|
|
import com.yihu.wlyy.repository.patient.PatientDao;
|
|
|
import com.yihu.wlyy.util.DateUtil;
|
|
@ -51,6 +54,9 @@ public class MessageService extends BaseService {
|
|
|
private JdbcTemplate jdbcTemplate;
|
|
|
@Autowired
|
|
|
private PatientDao patientDao;
|
|
|
@Autowired
|
|
|
private DevicePatientHealthIndexDao devicePatientHealthIndexDao;
|
|
|
|
|
|
|
|
|
/**
|
|
|
* IM消息数量
|
|
@ -273,7 +279,7 @@ public class MessageService extends BaseService {
|
|
|
*/
|
|
|
public List<Map<String, Object>> getHealthIndexMessage(String doctor) throws Exception {
|
|
|
List<Map<String, Object>> re = new ArrayList<>();
|
|
|
String sql = "select a.sender,a.tz_type,count(1) count,max(date_format(a.czrq,'%Y-%c-%d %h:%i:%s')) last_time from wlyy_Message a where a.receiver='" + doctor + "' and a.has_read='1' and a.type='2' group by a.sender,a.tz_type order by last_time desc";
|
|
|
String sql = "select a.sender,a.tz_type,count(1) count,max(date_format(a.czrq,'%Y-%c-%d %H:%i:%s')) last_time from wlyy_Message a where a.receiver='" + doctor + "' and a.has_read='1' and a.type='2' group by a.sender,a.tz_type order by last_time desc";
|
|
|
List<Map<String, Object>> list = jdbcTemplate.queryForList(sql);
|
|
|
|
|
|
for (Map<String, Object> item : list) {
|
|
@ -329,7 +335,16 @@ public class MessageService extends BaseService {
|
|
|
map.put("read", String.valueOf(item.getRead()));
|
|
|
map.put("sex", String.valueOf(item.getSex()));
|
|
|
map.put("value1", String.valueOf(item.getValue1()));
|
|
|
map.put("value2", String.valueOf(item.getValue2()));
|
|
|
String value2 = String.valueOf(item.getValue2().intValue());
|
|
|
map.put("value2",value2);
|
|
|
|
|
|
//获取上次血糖值
|
|
|
if("1".equals(type))
|
|
|
{
|
|
|
String preValue = devicePatientHealthIndexDao.getPreValue(item.getSender(),Long.valueOf(item.getTzCode()),value2);
|
|
|
map.put("preValue",preValue);
|
|
|
}
|
|
|
|
|
|
map.put("czrq", DateUtil.dateToStrLong(item.getCzrq()));
|
|
|
re.add(map);
|
|
|
|