|  | @ -34,6 +34,7 @@ import org.apache.commons.lang3.StringUtils;
 | 
	
		
			
				|  |  | import org.slf4j.Logger;
 | 
	
		
			
				|  |  | import org.slf4j.LoggerFactory;
 | 
	
		
			
				|  |  | import org.springframework.beans.factory.annotation.Autowired;
 | 
	
		
			
				|  |  | import org.springframework.beans.factory.annotation.Value;
 | 
	
		
			
				|  |  | import org.springframework.data.redis.core.StringRedisTemplate;
 | 
	
		
			
				|  |  | import org.springframework.web.bind.annotation.*;
 | 
	
		
			
				|  |  | 
 | 
	
	
		
			
				|  | @ -84,6 +85,9 @@ public class DoctorConsultEndpoint extends EnvelopRestEndpoint {
 | 
	
		
			
				|  |  | 	public BasePatientDao basePatientDao;
 | 
	
		
			
				|  |  | 	@Autowired
 | 
	
		
			
				|  |  | 	private WxTemplateService wxTemplateService;
 | 
	
		
			
				|  |  | 	
 | 
	
		
			
				|  |  | 	@Value("${wechat.id}")
 | 
	
		
			
				|  |  | 	private String wxId;
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | 	
 | 
	
		
			
				|  |  | 	
 | 
	
	
		
			
				|  | @ -174,18 +178,21 @@ public class DoctorConsultEndpoint extends EnvelopRestEndpoint {
 | 
	
		
			
				|  |  | 			JSONObject result = new JSONObject();
 | 
	
		
			
				|  |  | 			synchronized (outpatientCode.intern()){
 | 
	
		
			
				|  |  | 				
 | 
	
		
			
				|  |  | 				//1.调用挂号接口
 | 
	
		
			
				|  |  | 				logger.info("调用挂号接口====START");
 | 
	
		
			
				|  |  | 				net.sf.json.JSONObject res = prescriptionService.registerOutPatient(outpatientCode,doctorCode);
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | 				String rsCode = (String)res.get("@RESULT");
 | 
	
		
			
				|  |  | 				if("0".equals(rsCode)||"-2".equals(rsCode)){
 | 
	
		
			
				|  |  | 					//挂号成功,已经挂号
 | 
	
		
			
				|  |  | 				}else{
 | 
	
		
			
				|  |  | 					String mes = (String)res.get("@MSG");
 | 
	
		
			
				|  |  | 					failed(mes);
 | 
	
		
			
				|  |  | 				if(!"xm_ykyy_wx".equals(wxId)){//中山医院-心脏中心需要挂号
 | 
	
		
			
				|  |  | 					//1.调用挂号接口
 | 
	
		
			
				|  |  | 					logger.info("调用挂号接口====START");
 | 
	
		
			
				|  |  | 					net.sf.json.JSONObject res = prescriptionService.registerOutPatient(outpatientCode,doctorCode);
 | 
	
		
			
				|  |  | 					
 | 
	
		
			
				|  |  | 					String rsCode = (String)res.get("@RESULT");
 | 
	
		
			
				|  |  | 					if("0".equals(rsCode)||"-2".equals(rsCode)){
 | 
	
		
			
				|  |  | 						//挂号成功,已经挂号
 | 
	
		
			
				|  |  | 					}else{
 | 
	
		
			
				|  |  | 						String mes = (String)res.get("@MSG");
 | 
	
		
			
				|  |  | 						failed(mes);
 | 
	
		
			
				|  |  | 					}
 | 
	
		
			
				|  |  | 					logger.info("调用挂号接口====END");
 | 
	
		
			
				|  |  | 				}
 | 
	
		
			
				|  |  | 				logger.info("调用挂号接口====END");
 | 
	
		
			
				|  |  | 				
 | 
	
		
			
				|  |  | 				
 | 
	
		
			
				|  |  | 				//2.
 | 
	
		
			
				|  |  | 				result = imService.addPrescriptionConsult(outpatientCode, patientCode,doctorCode,consult,reason,type);
 |