|  | @ -39,6 +39,7 @@ import org.springframework.web.bind.annotation.*;
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | import java.util.Date;
 | 
	
		
			
				|  |  | import java.util.List;
 | 
	
		
			
				|  |  | import java.util.Map;
 | 
	
		
			
				|  |  | import java.util.UUID;
 | 
	
		
			
				|  |  | import java.util.concurrent.TimeUnit;
 | 
	
		
			
				|  |  | 
 | 
	
	
		
			
				|  | @ -364,52 +365,16 @@ public class DoctorConsultEndpoint extends EnvelopRestEndpoint {
 | 
	
		
			
				|  |  | 			@ApiParam(name = "pagesize", value = "分页大小")
 | 
	
		
			
				|  |  | 			@RequestParam(value = "pagesize",required = false) int pagesize
 | 
	
		
			
				|  |  | 	)throws Exception{
 | 
	
		
			
				|  |  | 		JSONArray array = new JSONArray();
 | 
	
		
			
				|  |  | 		List<ConsultVO> data = imService.findConsultRecordByDoctor(doctor, id,type,status, page,pagesize, title,start_time,end_time);
 | 
	
		
			
				|  |  | 		List<Map<String,Object>>  data = imService.findConsultRecordByDoctor(doctor, id,type,status, page,pagesize, title,start_time,end_time);
 | 
	
		
			
				|  |  | 		
 | 
	
		
			
				|  |  | 		if (data != null) {
 | 
	
		
			
				|  |  | 			for (ConsultVO consult : data) {
 | 
	
		
			
				|  |  | 				if (consult == null) {
 | 
	
		
			
				|  |  | 					continue;
 | 
	
		
			
				|  |  | 				}
 | 
	
		
			
				|  |  | 				JSONObject json = new JSONObject();
 | 
	
		
			
				|  |  | 				json.put("id", consult.getId());
 | 
	
		
			
				|  |  | 				// 设置咨询类型:1专家咨询,9在线复诊,待扩展,13协同门诊
 | 
	
		
			
				|  |  | 				json.put("type", consult.getType());
 | 
	
		
			
				|  |  | 				
 | 
	
		
			
				|  |  | 			for(Map<String,Object> consult :data){
 | 
	
		
			
				|  |  | 				//如果是协同门诊,多返回全科医生的详细信息
 | 
	
		
			
				|  |  | 				if(13 == consult.getType() && StringUtils.isNoneBlank(consult.getGeneralDoctor())){
 | 
	
		
			
				|  |  | 					BaseDoctorDO baseDoctorDO = baseDoctorDao.findById(consult.getGeneralDoctor());
 | 
	
		
			
				|  |  | 					json.put("generalDoctorName", baseDoctorDO.getName());
 | 
	
		
			
				|  |  | 				if(13 == Integer.parseInt((String)consult.get("type")) && StringUtils.isNoneBlank((String)consult.get("generalDoctor"))){
 | 
	
		
			
				|  |  | 					BaseDoctorDO baseDoctorDO = baseDoctorDao.findById((String)consult.get("generalDoctor"));
 | 
	
		
			
				|  |  | 					consult.put("generalDoctorName", baseDoctorDO.getName());
 | 
	
		
			
				|  |  | 				}
 | 
	
		
			
				|  |  | 				
 | 
	
		
			
				|  |  | 				// 设置显示标题
 | 
	
		
			
				|  |  | 				json.put("title", consult.getTitle());
 | 
	
		
			
				|  |  | 				// 设置主诉
 | 
	
		
			
				|  |  | 				json.put("symptoms", consult.getSymptoms());
 | 
	
		
			
				|  |  | 				// 咨询状态
 | 
	
		
			
				|  |  | 				json.put("status", consult.getStatus());
 | 
	
		
			
				|  |  | 				// 设置咨询日期
 | 
	
		
			
				|  |  | 				json.put("czrq", DateUtil.dateToStrLong(consult.getCzrq()));
 | 
	
		
			
				|  |  | 				//是否评价
 | 
	
		
			
				|  |  | 				json.put("evaluate", consult.getEvaluate());
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | 				//患者ID
 | 
	
		
			
				|  |  | 				json.put("patientId", consult.getPatientId());
 | 
	
		
			
				|  |  | 				//患者性别
 | 
	
		
			
				|  |  | 				json.put("patientsex", consult.getPatientsex());
 | 
	
		
			
				|  |  | 				//患者姓名
 | 
	
		
			
				|  |  | 				json.put("patientName", consult.getPatientName());
 | 
	
		
			
				|  |  | 				//患者年龄
 | 
	
		
			
				|  |  | 				json.put("patientAge", DateUtil.getAgeForIdcard(consult.getPatientIdcard()));
 | 
	
		
			
				|  |  | 				//就诊记录ID
 | 
	
		
			
				|  |  | 				json.put("outpatientId", consult.getOutpatientid());
 | 
	
		
			
				|  |  | 				//图文或者视频类型
 | 
	
		
			
				|  |  | 				json.put("consultType", consult.getConsultType());
 | 
	
		
			
				|  |  | 				//诊断
 | 
	
		
			
				|  |  | 				json.put("icd10Name", consult.getIcd10Name());
 | 
	
		
			
				|  |  | 				
 | 
	
		
			
				|  |  | 				array.add(json);
 | 
	
		
			
				|  |  | 			}
 | 
	
		
			
				|  |  | 		}
 | 
	
		
			
				|  |  | 		
 | 
	
	
		
			
				|  | @ -417,7 +382,7 @@ public class DoctorConsultEndpoint extends EnvelopRestEndpoint {
 | 
	
		
			
				|  |  | 		
 | 
	
		
			
				|  |  | 		JSONObject result = new JSONObject();
 | 
	
		
			
				|  |  | 		result.put("total",total);
 | 
	
		
			
				|  |  | 		result.put("list",array);
 | 
	
		
			
				|  |  | 		result.put("list",data);
 | 
	
		
			
				|  |  | 		return success(result);
 | 
	
		
			
				|  |  | 	}
 | 
	
		
			
				|  |  | 	
 | 
	
	
		
			
				|  | @ -614,71 +579,24 @@ public class DoctorConsultEndpoint extends EnvelopRestEndpoint {
 | 
	
		
			
				|  |  | 			@ApiParam(name = "pagesize", value = "分页大小")
 | 
	
		
			
				|  |  | 			@RequestParam(value = "pagesize",required = false) int pagesize
 | 
	
		
			
				|  |  | 	)throws Exception{
 | 
	
		
			
				|  |  | 		JSONArray array = new JSONArray();
 | 
	
		
			
				|  |  | 		List<ConsultVO> data = imService.findexpertConsultRecordByDoctor(doctor, id,type,status, page,pagesize, title,start_time,end_time,patient);
 | 
	
		
			
				|  |  | 		List<Map<String,Object>>  data = imService.findexpertConsultRecordByDoctor(doctor, id,type,status, page,pagesize, title,start_time,end_time,patient);
 | 
	
		
			
				|  |  | 		
 | 
	
		
			
				|  |  | 		if (data != null) {
 | 
	
		
			
				|  |  | 			for (ConsultVO consult : data) {
 | 
	
		
			
				|  |  | 				if (consult == null) {
 | 
	
		
			
				|  |  | 					continue;
 | 
	
		
			
				|  |  | 				}
 | 
	
		
			
				|  |  | 				JSONObject json = new JSONObject();
 | 
	
		
			
				|  |  | 				json.put("id", consult.getId());
 | 
	
		
			
				|  |  | 				// 设置咨询类型:1专家咨询,9在线复诊,待扩展,13协同门诊
 | 
	
		
			
				|  |  | 				json.put("type", consult.getType());
 | 
	
		
			
				|  |  | 			for (Map<String,Object> consult : data) {
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | 				
 | 
	
		
			
				|  |  | 				//如果是协同门诊,多返回全科医生的详细信息
 | 
	
		
			
				|  |  | 				if(13 == consult.getType() && StringUtils.isNoneBlank(consult.getGeneralDoctor())){
 | 
	
		
			
				|  |  | 					BaseDoctorDO baseDoctorDO = baseDoctorDao.findById(consult.getGeneralDoctor());
 | 
	
		
			
				|  |  | 					json.put("generalDoctorName", baseDoctorDO.getName());
 | 
	
		
			
				|  |  | 				if(13 == Integer.parseInt((String)consult.get("type")) && StringUtils.isNoneBlank((String)consult.get("generalDoctor"))){
 | 
	
		
			
				|  |  | 					BaseDoctorDO baseDoctorDO = baseDoctorDao.findById((String)consult.get("generalDoctor"));
 | 
	
		
			
				|  |  | 					consult.put("generalDoctorName", baseDoctorDO.getName());
 | 
	
		
			
				|  |  | 				}
 | 
	
		
			
				|  |  | 				
 | 
	
		
			
				|  |  | 				List<BaseDoctorHospitalDO> hospitalDOs =  baseDoctorHospitalDao.findByDoctorCode(doctor);
 | 
	
		
			
				|  |  | 				if(hospitalDOs!=null&&hospitalDOs.size()>0){
 | 
	
		
			
				|  |  | 					json.put("hospital",hospitalDOs.get(0));
 | 
	
		
			
				|  |  | //					BaseOrgDO org = baseOrgDao.findByCode(hospitalDOs.get(0).getOrgCode());
 | 
	
		
			
				|  |  | //					rs.put("winNo",org.getWinNo());
 | 
	
		
			
				|  |  | //					json.put("deptName",hospitalDOs.get(0).getDeptName());
 | 
	
		
			
				|  |  | //					json.put("dept",hospitalDOs.get(0).getDeptCode());
 | 
	
		
			
				|  |  | 					consult.put("hospital",hospitalDOs.get(0));
 | 
	
		
			
				|  |  | 				}else{
 | 
	
		
			
				|  |  | 					json.put("hospital",null);
 | 
	
		
			
				|  |  | //					json.put("winNo",null);
 | 
	
		
			
				|  |  | //					json.put("deptName",null);
 | 
	
		
			
				|  |  | //					json.put("dept",null);
 | 
	
		
			
				|  |  | 					consult.put("hospital",null);
 | 
	
		
			
				|  |  | 				}
 | 
	
		
			
				|  |  | 				
 | 
	
		
			
				|  |  | 				//医生职称
 | 
	
		
			
				|  |  | 				json.put("jobTitleName", consult.getJobTitleName());
 | 
	
		
			
				|  |  | 				//医生名称
 | 
	
		
			
				|  |  | 				json.put("doctorName", consult.getDoctorName());
 | 
	
		
			
				|  |  | 				
 | 
	
		
			
				|  |  | 				// 设置显示标题
 | 
	
		
			
				|  |  | 				json.put("title", consult.getTitle());
 | 
	
		
			
				|  |  | 				// 设置主诉
 | 
	
		
			
				|  |  | 				json.put("symptoms", consult.getSymptoms());
 | 
	
		
			
				|  |  | 				// 咨询状态
 | 
	
		
			
				|  |  | 				json.put("status", consult.getStatus());
 | 
	
		
			
				|  |  | 				// 设置咨询日期
 | 
	
		
			
				|  |  | 				json.put("czrq", DateUtil.dateToStrLong(consult.getCzrq()));
 | 
	
		
			
				|  |  | 				//是否评价
 | 
	
		
			
				|  |  | 				json.put("evaluate", consult.getEvaluate());
 | 
	
		
			
				|  |  | 				
 | 
	
		
			
				|  |  | 				//患者ID
 | 
	
		
			
				|  |  | 				json.put("patientId", consult.getPatientId());
 | 
	
		
			
				|  |  | 				//患者性别
 | 
	
		
			
				|  |  | 				json.put("patientsex", consult.getPatientsex());
 | 
	
		
			
				|  |  | 				//患者姓名
 | 
	
		
			
				|  |  | 				json.put("patientName", consult.getPatientName());
 | 
	
		
			
				|  |  | 				//患者年龄
 | 
	
		
			
				|  |  | 				json.put("patientAge", DateUtil.getAgeForIdcard(consult.getPatientIdcard()));
 | 
	
		
			
				|  |  | 				//就诊记录ID
 | 
	
		
			
				|  |  | 				json.put("outpatientId", consult.getOutpatientid());
 | 
	
		
			
				|  |  | 				//图文或者视频类型
 | 
	
		
			
				|  |  | 				json.put("consultType", consult.getConsultType());
 | 
	
		
			
				|  |  | 				//诊断
 | 
	
		
			
				|  |  | 				json.put("icd10Name", consult.getIcd10Name());
 | 
	
		
			
				|  |  | 				
 | 
	
		
			
				|  |  | 				array.add(json);
 | 
	
		
			
				|  |  | 			}
 | 
	
		
			
				|  |  | 		}
 | 
	
		
			
				|  |  | 		
 | 
	
	
		
			
				|  | @ -686,7 +604,7 @@ public class DoctorConsultEndpoint extends EnvelopRestEndpoint {
 | 
	
		
			
				|  |  | 		
 | 
	
		
			
				|  |  | 		JSONObject result = new JSONObject();
 | 
	
		
			
				|  |  | 		result.put("total",total);
 | 
	
		
			
				|  |  | 		result.put("list",array);
 | 
	
		
			
				|  |  | 		result.put("list",data);
 | 
	
		
			
				|  |  | 		return success(result);
 | 
	
		
			
				|  |  | 	}
 | 
	
		
			
				|  |  | 	
 |