|  | @ -9265,4 +9265,53 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     public com.alibaba.fastjson.JSONObject selectHospitalInfo(String doctorId){
 | 
	
		
			
				|  |  |         /**
 | 
	
		
			
				|  |  |          * 1、今日待就诊:今日当前家庭医生在当前医院的未完成的协同门诊书
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |          2、下一次就诊时间:当前家庭医生在当前医院下一次未接诊的就诊时间。
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |          3、服务评分:当前医院的综合服务评分
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |          4、在线医生:当前医院在班的专科医生数
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |          5、可预约医生:当前医院有开通协同门诊业务的医生数(包含当前在线)
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |          6、累计就诊:当前医院累计协同门诊的已接诊数量
 | 
	
		
			
				|  |  |          */
 | 
	
		
			
				|  |  |         Date startTime  = DateUtil.strToDateLong(DateUtil.getStringDateShort()+" 00:00:00");
 | 
	
		
			
				|  |  |         Date endTime  = DateUtil.strToDateLong(DateUtil.getStringDateShort()+" 23:59:59");
 | 
	
		
			
				|  |  |         com.alibaba.fastjson.JSONObject jsonObject = new com.alibaba.fastjson.JSONObject();
 | 
	
		
			
				|  |  |         // 1、今日待就诊:今日当前家庭医生在当前医院的未完成的协同门诊书
 | 
	
		
			
				|  |  |         List<WlyyOutpatientDO> outpatientDOS =  outpatientDao.findByGeneralDoctorAndStatusAndDate(doctorId,startTime,endTime,"0,1,2");
 | 
	
		
			
				|  |  |         jsonObject.put("NowWaitTotal",outpatientDOS.size());
 | 
	
		
			
				|  |  |         //2、下一次就诊时间:当前家庭医生在当前医院下一次未接诊的就诊时间。
 | 
	
		
			
				|  |  |         List<WlyyOutpatientDO> outpatientDOList =  outpatientDao.findByGeneralDoctorAndStatus(doctorId,"0");
 | 
	
		
			
				|  |  |         if (outpatientDOList!=null&&outpatientDOList.size()!=0){
 | 
	
		
			
				|  |  |             jsonObject.put("nextTime",DateUtil.dateToStrLong(outpatientDOList.get(0).getRegisterDate()));
 | 
	
		
			
				|  |  |         }else {
 | 
	
		
			
				|  |  |             jsonObject.put("nextTime",null);
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |         //3、服务评分:当前医院的综合服务评分
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |         //在线医生:当前医院在班的专科医生数
 | 
	
		
			
				|  |  |         String sql ="SELECT d.* FROM base_doctor d WHERE (EXISTS (SELECT 1 FROM wlyy_doctor_work_time t WHERE t.doctor = d.id AND t.start_time >=:startTime AND t.end_time <=:endTime ) OR  d.consult_status = '1')";
 | 
	
		
			
				|  |  |         Map<String, Object> params = new HashedMap();
 | 
	
		
			
				|  |  |         params.put("startTime",startTime);
 | 
	
		
			
				|  |  |         params.put("endTime",endTime);
 | 
	
		
			
				|  |  |         List<Map<String, Object>> list = hibenateUtils.createSQLQuery(sql, params);
 | 
	
		
			
				|  |  |         jsonObject.put("onlineDoctors",list.size());
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |         //可预约医生:当前医院有开通协同门诊业务的医生数(包含当前在线)
 | 
	
		
			
				|  |  |         sql += " AND outpatient_type IN('xt') ";
 | 
	
		
			
				|  |  |         List<Map<String, Object>> specialist = hibenateUtils.createSQLQuery(sql, params);
 | 
	
		
			
				|  |  |         jsonObject.put("xtOnlineDoctors",specialist.size());
 | 
	
		
			
				|  |  |         //累计就诊:当前医院累计协同门诊的已接诊数量
 | 
	
		
			
				|  |  |         List<WlyyOutpatientDO> wlyyOutpatientDOList = outpatientDao.findOutpatientListByOutpatientType("xt",new Date());
 | 
	
		
			
				|  |  |         jsonObject.put("xtOupatients",wlyyOutpatientDOList.size());
 | 
	
		
			
				|  |  |         return jsonObject;
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | }
 |