| 
					
				 | 
			
			
				@ -1,5 +1,6 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				package com.yihu.wlyy.web.third.gateway.controller.doctor; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.alibaba.fastjson.JSONObject; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.wlyy.entity.doctor.profile.Doctor; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.wlyy.entity.patient.Patient; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.wlyy.service.common.account.DoctorService; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -41,9 +42,14 @@ public class GcDoctorController { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            @ApiParam(name = "code", value = "医生code", required = true) @RequestParam(value = "code", required = true) String code 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    ) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        Doctor doctor = doctorService.findDoctorByCode(code); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        DoctorModel doctorModel = new DoctorModel(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        BeanUtils.copyProperties(doctor, doctorModel); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        return new ResultOneModel(doctorModel); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        DoctorModel doctorModel = null; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if (doctor != null) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            doctorModel = new DoctorModel(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            BeanUtils.copyProperties(doctor, doctorModel); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            return new ResultOneModel(doctorModel); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            return new ResultOneModel(new JSONObject()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @RequestMapping(value = "/doctors", method = RequestMethod.GET) 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -57,11 +63,13 @@ public class GcDoctorController { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    ) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        List<Doctor> doctors = doctorService.findDoctors(hospitalCode, name, level, page, pageSize); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        List<DoctorModel> doctorModelList = new ArrayList<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        doctors.stream().forEach(one -> { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            DoctorModel doctorModel = new DoctorModel(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            BeanUtils.copyProperties(one, doctorModel); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            doctorModelList.add(doctorModel); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        }); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if (doctors != null && doctors.size() > 0) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            doctors.stream().forEach(one -> { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                DoctorModel doctorModel = new DoctorModel(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                BeanUtils.copyProperties(one, doctorModel); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                doctorModelList.add(doctorModel); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            }); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        return new ResultPageListModel(page, pageSize, doctorService.findDoctorCounts(hospitalCode, name, level), doctorModelList); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -72,9 +80,14 @@ public class GcDoctorController { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            @ApiParam(name = "code", value = "患者code", required = true) @RequestParam(value = "code", required = true) String code 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    ) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        Patient patient = patientService.findByCode(code); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        PatientModel patientModel = new PatientModel(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        BeanUtils.copyProperties(patient, patientModel); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        return new ResultOneModel(patientModel); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        PatientModel patientModel = null; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if (patientModel != null) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            patientModel = new PatientModel(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            BeanUtils.copyProperties(patient, patientModel); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            return new ResultOneModel(patientModel); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            return new ResultOneModel(new JSONObject()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				} 
			 |