| 
					
				 | 
			
			
				@ -15,6 +15,7 @@ import com.yihu.jw.restmodel.web.ListEnvelop; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.restmodel.web.ObjEnvelop; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.rm.hospital.BaseHospitalRequestMapping; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.sms.service.ZhongShanSMSService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.util.date.DateUtil; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import io.swagger.annotations.Api; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import io.swagger.annotations.ApiOperation; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -41,6 +42,9 @@ public class DoctorConsultEndpoint extends EnvelopRestEndpoint { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					@Autowired 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					private ImService imService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					@Autowired 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					private ZhongShanSMSService smsService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					@Autowired 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					private PrescriptionService prescriptionService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -49,6 +53,7 @@ public class DoctorConsultEndpoint extends EnvelopRestEndpoint { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					@Autowired 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					private OutpatientDao outpatientDao; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					@GetMapping (value = BaseHospitalRequestMapping.DodtorIM.findWaitingRoomOutpatientByDoctor) 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -269,48 +274,6 @@ public class DoctorConsultEndpoint extends EnvelopRestEndpoint { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						return success("请求成功"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					@GetMapping(value = BaseHospitalRequestMapping.DodtorIM.doctorIndexConsultCount) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					@ApiOperation(value = "复诊图文咨询人数,视频咨询人数、协同门诊人数,可抢单人数", notes = "复诊图文咨询人数,视频咨询人数、协同门诊人数,可抢单人数") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					public Envelop doctorIndexConsultCount(@ApiParam(name = "doctor", value = "医生CODE") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					                                           @RequestParam(value = "doctor",required = true) String doctor){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						//专家咨询 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						Integer zjCount = imService.sessionCountByType(doctor,1,0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						//复诊咨询 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						Integer imgCount = imService.sessionCountByType(doctor,9,0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						//正在进行中的视频复诊 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						Long _videoOnlineCount = prescriptionService.doctorIndexConsultCount(doctor); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						Integer videoCount = _videoOnlineCount.intValue(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						//获取候诊居民数量(包含进行中的) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						Long _waitVideoCount = prescriptionService.getWaitVideoCount(doctor); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						Integer waitVideoCount = _waitVideoCount.intValue(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						JSONObject result = new JSONObject(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						result.put("zjCount",zjCount); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						imgCount = imgCount - videoCount; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						if(imgCount <=0){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
							imgCount = 0; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						result.put("zjCount",zjCount);//专家咨询数量 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						result.put("imgCount",imgCount);//图文复诊数量 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						result.put("videoCount",waitVideoCount+_videoOnlineCount);//视频复诊数量 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						result.put("xtCount",0);//协同门诊候诊数量 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						JSONObject resultPick = prescriptionService.findWaitingRoomOutpatientNumberByDoctor(doctor); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						result.put("imgPickCount",resultPick.getIntValue("twCount")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						result.put("videoPickCount",resultPick.getIntValue("spCount")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						result.put("xtPickCount",resultPick.getIntValue("xtCount")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						return success("请求成功",result); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					@GetMapping(value = BaseHospitalRequestMapping.DodtorIM.records) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					@ApiOperation(value = "医生咨询记录查询") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					public Envelop records( 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -439,9 +402,104 @@ public class DoctorConsultEndpoint extends EnvelopRestEndpoint { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					                                        @ApiParam(name = "reviver", value = "接受者") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					                                        @RequestParam(value = "reviver", required = false)String reviver 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					                                        )throws Exception{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						imService.testSendWaiSocketMessage(sender,reviver); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				//		imService.testSendWaiSocketMessage(sender,reviver); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						smsService.ZhongShangSendSMS("18205968966","测试发送短信"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						return success("请求成功"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					@GetMapping(value = BaseHospitalRequestMapping.DodtorIM.doctorIndexConsultCount) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					@ApiOperation(value = "复诊图文咨询人数,视频咨询人数、协同门诊人数,可抢单人数", notes = "复诊图文咨询人数,视频咨询人数、协同门诊人数,可抢单人数") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					public Envelop doctorIndexConsultCount(@ApiParam(name = "doctor", value = "医生CODE") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					                                       @RequestParam(value = "doctor",required = true) String doctor){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						//专家咨询 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						Integer zjCount = imService.sessionCountByType(doctor,1,0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						//复诊咨询 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						Integer imgCount = imService.sessionCountByType(doctor,9,0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						//正在进行中的视频复诊 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						Long _videoOnlineCount = prescriptionService.doctorIndexConsultCount(doctor); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						Integer videoCount = _videoOnlineCount.intValue(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						//获取候诊居民数量(包含进行中的) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						Long _waitVideoCount = prescriptionService.getWaitVideoCount(doctor); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						Integer waitVideoCount = _waitVideoCount.intValue(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						JSONObject result = new JSONObject(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						result.put("zjCount",zjCount); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						imgCount = imgCount - videoCount; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						if(imgCount <=0){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
							imgCount = 0; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						result.put("zjCount",zjCount);//专家咨询数量 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						result.put("imgCount",imgCount);//图文复诊数量 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						result.put("videoCount",waitVideoCount+_videoOnlineCount);//视频复诊数量 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						result.put("xtCount",0);//协同门诊候诊数量 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						JSONObject resultPick = prescriptionService.findWaitingRoomOutpatientNumberByDoctor(doctor); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						result.put("imgPickCount",resultPick.getIntValue("twCount")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						result.put("videoPickCount",resultPick.getIntValue("spCount")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						result.put("xtPickCount",resultPick.getIntValue("xtCount")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						return success("请求成功",result); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					@GetMapping(value = BaseHospitalRequestMapping.DodtorIM.doctorSpecialistConsultCount) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					@ApiOperation(value = "医生端:进行中的专家咨询数量", notes = "医生端:进行中的专家咨询数量") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					public Envelop doctorSpecialistConsultCount(@ApiParam(name = "doctor", value = "医生CODE") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					                                       @RequestParam(value = "doctor",required = true) String doctor){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						//专家咨询 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						Integer zjCount = imService.sessionCountByType(doctor,1,0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						JSONObject result = new JSONObject(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						result.put("zjCount",zjCount);//专家咨询数量 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						return success("请求成功",result); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					@GetMapping(value = BaseHospitalRequestMapping.DodtorIM.doctorReviewConsultCount) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					@ApiOperation(value = "医生端:图文复诊、视频复诊咨询数量", notes = "医生端:图文复诊、视频复诊咨询数量") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					public Envelop doctorReviewConsultCount(@ApiParam(name = "doctor", value = "医生CODE") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					                                            @RequestParam(value = "doctor",required = true) String doctor){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						//复诊咨询 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						Integer imgCount = imService.sessionCountByType(doctor,9,0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						//正在进行中的视频复诊 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						Long _videoOnlineCount = prescriptionService.doctorIndexConsultCount(doctor); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						Integer videoCount = _videoOnlineCount.intValue(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						//获取候诊居民数量(包含进行中的) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						Long _waitVideoCount = prescriptionService.getWaitVideoCount(doctor); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						Integer waitVideoCount = _waitVideoCount.intValue(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						JSONObject result = new JSONObject(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						imgCount = imgCount - videoCount; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						if(imgCount <=0){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
							imgCount = 0; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						result.put("imgCount",imgCount);//图文复诊数量 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						result.put("videoCount",waitVideoCount+_videoOnlineCount);//视频复诊数量 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						result.put("xtCount",0);//协同门诊候诊数量 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						return success("请求成功",result); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					@GetMapping(value = BaseHospitalRequestMapping.DodtorIM.doctorPickCount) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					@ApiOperation(value = "医生端:可抢单数量", notes = "医生端:可抢单数量") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					public Envelop doctorPickCount(@ApiParam(name = "doctor", value = "医生CODE") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					                                        @RequestParam(value = "doctor",required = true) String doctor){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						JSONObject resultPick = prescriptionService.findWaitingRoomOutpatientNumberByDoctor(doctor); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						JSONObject result = new JSONObject(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						result.put("imgPickCount",resultPick.getIntValue("twCount")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						result.put("videoPickCount",resultPick.getIntValue("spCount")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						result.put("xtPickCount",resultPick.getIntValue("xtCount")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
						return success("请求成功",result); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					 
			 | 
		
	
		
			
				 | 
				 | 
			
			
					 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				} 
			 |