|
@ -1,9 +1,11 @@
|
|
|
package com.yihu.jw.care.util;
|
|
|
|
|
|
import com.yihu.jw.care.dao.device.PatientDeviceDao;
|
|
|
import com.yihu.jw.entity.base.patient.BasePatientDO;
|
|
|
import com.yihu.jw.entity.care.device.DevicePatientDevice;
|
|
|
import com.yihu.jw.entity.hospital.message.SystemMessageDO;
|
|
|
import com.yihu.jw.hospital.message.dao.SystemMessageDao;
|
|
|
import com.yihu.jw.patient.dao.BasePatientDao;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.jdbc.core.JdbcTemplate;
|
|
|
import org.springframework.stereotype.Component;
|
|
@ -25,6 +27,8 @@ public class DeviceLostMessageUtil {
|
|
|
private PatientDeviceDao patientDeviceDao;
|
|
|
@Autowired
|
|
|
private JdbcTemplate jdbcTemplate;
|
|
|
@Autowired
|
|
|
private BasePatientDao patientDao;
|
|
|
|
|
|
/**
|
|
|
* 设备离线通知
|
|
@ -40,7 +44,7 @@ public class DeviceLostMessageUtil {
|
|
|
" WHERE sr.status=1 and m.team_code = r.team_code and sr.id=r.sign_id and m.doctor_code = d.id " +
|
|
|
" and m.del = '1' and sr.patient = '"+deviceDO.getUser()+"' " ;
|
|
|
List<Map<String,Object>> doctors = jdbcTemplate.queryForList(sql);
|
|
|
String deviceName="";
|
|
|
String deviceName="";
|
|
|
for (Map<String,Object> docTmp:doctors){
|
|
|
switch (deviceDO.getCategoryCode()){
|
|
|
case "1":
|
|
@ -74,11 +78,12 @@ public class DeviceLostMessageUtil {
|
|
|
deviceName="随身WiFi离线";
|
|
|
break;
|
|
|
}
|
|
|
BasePatientDO patientDO = patientDao.findById(deviceDO.getUser());
|
|
|
SystemMessageDO messageDO = new SystemMessageDO();
|
|
|
messageDO.setTitle("设备离线通知");
|
|
|
messageDO.setType("43");
|
|
|
messageDO.setSender("system");
|
|
|
messageDO.setSenderName("system");
|
|
|
messageDO.setSender(deviceDO.getUser());
|
|
|
messageDO.setSenderName(patientDO.getName());
|
|
|
messageDO.setRelationCode(id);
|
|
|
messageDO.setReceiver(docTmp.get("id").toString());
|
|
|
messageDO.setReceiverName(docTmp.get("name").toString());
|
|
@ -86,6 +91,7 @@ public class DeviceLostMessageUtil {
|
|
|
messageDO.setData(deviceName);
|
|
|
messageDO.setDel("1");
|
|
|
messageDO.setCreateTime(new Date());
|
|
|
messageDO.setSenderPhoto(patientDO.getPhoto());
|
|
|
messageDOS.add(messageDO);
|
|
|
}
|
|
|
}
|