|
@ -26,6 +26,7 @@ import com.yihu.jw.restmodel.ResponseContant;
|
|
|
import com.yihu.jw.restmodel.web.Envelop;
|
|
|
import com.yihu.jw.restmodel.web.ObjEnvelop;
|
|
|
import com.yihu.jw.restmodel.web.PageEnvelop;
|
|
|
import com.yihu.jw.util.common.IdCardUtil;
|
|
|
import com.yihu.jw.util.date.DateUtil;
|
|
|
import com.yihu.jw.util.entity.EntityUtils;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
@ -178,6 +179,13 @@ public class DoctorMessageService {
|
|
|
tmpObj = jdbcTemplate.queryForMap(sql);
|
|
|
result.put("deviceLost",tmpObj);
|
|
|
}
|
|
|
if (typeNull||type.equals("15")){//工作提醒
|
|
|
String sql = " select count(1) as 'all',type,DATE_FORMAT(create_time,'%Y-%m-%d %H:%i:%S') create_time from base_system_message " +
|
|
|
" where type='45' and del=1 and receiver='"+doctor+"' order by create_time desc ";
|
|
|
Map<String,Object> tmpObj = new HashMap<>();
|
|
|
tmpObj = jdbcTemplate.queryForMap(sql);
|
|
|
result.put("toDoWorkReminder",tmpObj);
|
|
|
}
|
|
|
return result;
|
|
|
}
|
|
|
|
|
@ -362,6 +370,42 @@ public class DoctorMessageService {
|
|
|
return maps;
|
|
|
}
|
|
|
|
|
|
public PageEnvelop<Map<String,Object>> getToDoWorkReminder(String doctor,Integer page,Integer pageSize){
|
|
|
page = page>0?page-1:0;
|
|
|
String sql = " select mess.id,p.id patientCode,p.name,p.idcard,p.birthday,p.sex,p.photo,residential_area,p.mobile, " +
|
|
|
" '紧急呼叫' as serve_desc,DATE_FORMAT(ord.create_time,'%Y-%m-%d %H:%i:%S') create_time,ord.`status`,mess.`code` orderType " +
|
|
|
" from base_system_message mess INNER JOIN base_emergency_assistance_order ord on mess.relation_code = ord.id " +
|
|
|
" INNER JOIN base_patient p on p.id = ord.patient " +
|
|
|
" where mess.del=1 and mess.type=45 and mess.code=20 and mess.receiver='"+doctor+"' " +
|
|
|
"union ALL " +
|
|
|
"select mess.id,p.id patientCode,p.name,p.idcard,p.birthday,p.sex,p.photo,residential_area,p.mobile, " +
|
|
|
"ord.serve_desc as serve_desc,DATE_FORMAT(ord.create_time,'%Y-%m-%d %H:%i:%S') create_time,ord.`status`, " +
|
|
|
" mess.`code` orderType " +
|
|
|
" from base_system_message mess INNER JOIN base_security_monitoring_order ord on mess.relation_code = ord.id " +
|
|
|
" INNER JOIN base_patient p on p.id = ord.patient " +
|
|
|
" where mess.del=1 and mess.type=45 and mess.code=22 and mess.receiver='"+doctor+"' " +
|
|
|
"ORDER BY create_time desc,id desc limit "+page*pageSize+","+pageSize;
|
|
|
List<Map<String,Object>> list = jdbcTemplate.queryForList(sql);
|
|
|
String sqlCount = " select count(mess.id) total " +
|
|
|
" from base_system_message mess INNER JOIN base_emergency_assistance_order ord on mess.relation_code = ord.id " +
|
|
|
" INNER JOIN base_patient p on p.id = ord.patient " +
|
|
|
" where mess.del=1 and mess.type=45 and mess.code=20 and mess.receiver='"+doctor+"' " +
|
|
|
"union ALL " +
|
|
|
"select count(mess.id) total " +
|
|
|
" from base_system_message mess INNER JOIN base_security_monitoring_order ord on mess.relation_code = ord.id " +
|
|
|
" INNER JOIN base_patient p on p.id = ord.patient " +
|
|
|
" where mess.del=1 and mess.type=45 and mess.code=22 and mess.receiver='"+doctor+"' " ;
|
|
|
List<Map<String,Object>> totalList = jdbcTemplate.queryForList(sqlCount);
|
|
|
Long total = totalList.stream().mapToLong(e->Long.valueOf(e.get("total").toString())).sum();
|
|
|
for (Map<String,Object>tmp:list){
|
|
|
String idcard = null==tmp.get("idcard")?"":tmp.get("idcard").toString();
|
|
|
String birthday = null==tmp.get("birthday")?"":tmp.get("birthday").toString();
|
|
|
Integer age = IdCardUtil.getAgeByIdcardOrBirthday(idcard,DateUtil.strToDate(birthday));
|
|
|
tmp.put("age",age);
|
|
|
}
|
|
|
return PageEnvelop.getSuccessListWithPage("查询成功",list,page,pageSize,total);
|
|
|
}
|
|
|
|
|
|
public Integer todoworkTotal(String doctor){
|
|
|
Integer total=0;
|
|
|
BaseDoctorDO doctorDO = baseDoctorDao.findById(doctor);
|