| 
					
				 | 
			
			
				@ -2,6 +2,8 @@ package com.yihu.wlyy.web.gateway.controller.patient; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.wlyy.entity.doctor.profile.Doctor; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.wlyy.entity.patient.Patient; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.wlyy.entity.patient.SignFamily; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.wlyy.repository.patient.SignFamilyDao; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.wlyy.service.common.account.DoctorService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.wlyy.service.common.account.PatientService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.wlyy.web.gateway.vo.DoctorModel; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -27,6 +29,8 @@ import org.springframework.web.bind.annotation.*; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				public class GcPatientController { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @Autowired 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    private PatientService patientService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @Autowired 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    private SignFamilyDao signFamilyDao; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @RequestMapping(value = "/patient", method = RequestMethod.GET) 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -36,8 +40,27 @@ public class GcPatientController { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    ) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        Patient patient = patientService.findByCode(code); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        PatientModel patientModel = new PatientModel(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        SignFamily signFamily = signFamilyDao.findSignByPatient(patient.getCode()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        BeanUtils.copyProperties(patient, patientModel); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if (signFamily != null) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            patientModel.setIsSign(1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            patientModel.setIsSign(0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        return new ResultOneModel(patientModel); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @RequestMapping(value = "/patientHasSign", method = RequestMethod.GET) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @ApiOperation("判断患者是否签约") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public ResultOneModel<Integer> patientHasSign( 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            @ApiParam(name = "code", value = "患者code", required = true) @RequestParam(value = "code", required = true) String code 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    ) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        Integer isSign = 0; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        SignFamily signFamily = signFamilyDao.findSignByPatient(code); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if (signFamily != null) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            isSign = 1; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        return new ResultOneModel(isSign); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				} 
			 |