|  | @ -2,6 +2,11 @@ package com.yihu.jw.healthCare.service;
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | import com.alibaba.fastjson.JSONObject;
 | 
	
		
			
				|  |  | import com.yihu.jw.doctor.dao.BaseDoctorDao;
 | 
	
		
			
				|  |  | import com.yihu.jw.doctor.dao.BaseDoctorHospitalDao;
 | 
	
		
			
				|  |  | import com.yihu.jw.doctor.service.BaseDoctorHosService;
 | 
	
		
			
				|  |  | import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
 | 
	
		
			
				|  |  | import com.yihu.jw.entity.base.doctor.BaseDoctorHospitalDO;
 | 
	
		
			
				|  |  | import com.yihu.jw.entity.hospital.consult.WlyyHospitalSysDictDO;
 | 
	
		
			
				|  |  | import com.yihu.jw.healthCare.utils.AES;
 | 
	
		
			
				|  |  | import com.yihu.jw.healthCare.utils.MD5;
 | 
	
	
		
			
				|  | @ -29,7 +34,10 @@ public class HealthCareService {
 | 
	
		
			
				|  |  |     private Logger logger = LoggerFactory.getLogger(HealthCareService.class);
 | 
	
		
			
				|  |  |     @Autowired
 | 
	
		
			
				|  |  |     private WlyyHospitalSysDictDao hospitalSysDictDao;
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     @Autowired
 | 
	
		
			
				|  |  |     private BaseDoctorHospitalDao doctorHospitalDao;
 | 
	
		
			
				|  |  |     @Autowired
 | 
	
		
			
				|  |  |     private BaseDoctorDao doctorDao;
 | 
	
		
			
				|  |  |     @Autowired
 | 
	
		
			
				|  |  |     private HttpClientUtil httpClientUtil;
 | 
	
		
			
				|  |  | 
 | 
	
	
		
			
				|  | @ -93,6 +101,62 @@ public class HealthCareService {
 | 
	
		
			
				|  |  |         return response;
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     /**
 | 
	
		
			
				|  |  |      * 2.3.1	医师身份验证(处方权,多点执业等)
 | 
	
		
			
				|  |  |      */
 | 
	
		
			
				|  |  |     public void doctorAuthentication(String doctorId) throws Exception{
 | 
	
		
			
				|  |  |         BaseDoctorDO doctorDO = doctorDao.findOne(doctorId);
 | 
	
		
			
				|  |  |         List<BaseDoctorHospitalDO> doctorHospitalDOS = doctorHospitalDao.findByDoctorCode(doctorId);
 | 
	
		
			
				|  |  |         if(doctorHospitalDOS.size()<=0){
 | 
	
		
			
				|  |  |             throw new Exception("未找到医生科室编码");
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |         BaseDoctorHospitalDO doctorHospitalDO = doctorHospitalDOS.get(0);
 | 
	
		
			
				|  |  |         JSONObject data = new JSONObject();
 | 
	
		
			
				|  |  |         data.put("his_dept_code",doctorHospitalDO.getDeptCode());//his内部科室编码
 | 
	
		
			
				|  |  |         data.put("his_dept_name",doctorHospitalDO.getDeptName());//his内部科室名称
 | 
	
		
			
				|  |  | //        data.put("dept_code","");//医保科室编码	String	N
 | 
	
		
			
				|  |  | //        data.put("dept_name","");//医保科室名称	String	N
 | 
	
		
			
				|  |  |         data.put("name",doctorDO.getName());//医师姓名
 | 
	
		
			
				|  |  |         data.put("idcard",doctorDO.getIdcard());//医师证件号
 | 
	
		
			
				|  |  |         data.put("cert_type","");//医师证件类型
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |         requestYlz(data.toJSONString(),"N20.17.02.01");
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     /**
 | 
	
		
			
				|  |  |      * 2.3.2	医师人脸签到表单地址
 | 
	
		
			
				|  |  |      * @param doctorId
 | 
	
		
			
				|  |  |      * @throws Exception
 | 
	
		
			
				|  |  |      */
 | 
	
		
			
				|  |  |     public void doctorFaceCheckInAddress(String doctorId)throws Exception{
 | 
	
		
			
				|  |  |         WlyyHospitalSysDictDO hospitalSysDictDO = hospitalSysDictDao.findOne("ylzConfigFaceReturnUrl");
 | 
	
		
			
				|  |  |         if(hospitalSysDictDO == null){
 | 
	
		
			
				|  |  |             throw new Exception("未配置回调地址");
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |         BaseDoctorDO doctorDO = doctorDao.findOne(doctorId);
 | 
	
		
			
				|  |  |         JSONObject data = new JSONObject();
 | 
	
		
			
				|  |  |         data.put("name",doctorDO.getName());//医师姓名
 | 
	
		
			
				|  |  |         data.put("idcard",doctorDO.getIdcard());//医师证件号
 | 
	
		
			
				|  |  |         data.put("cert_type","");//医师证件类型
 | 
	
		
			
				|  |  |         data.put("redirect_url",hospitalSysDictDO.getDictValue());//回调地址
 | 
	
		
			
				|  |  |         requestYlz(data.toJSONString(),"N20.17.02.02");
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     /**
 | 
	
		
			
				|  |  |      * 2.3.3	获取医师人脸签到数据
 | 
	
		
			
				|  |  |      */
 | 
	
		
			
				|  |  |     public void doctorFaceCheckInData(String doctorId)throws Exception{
 | 
	
		
			
				|  |  |         BaseDoctorDO doctorDO = doctorDao.findOne(doctorId);
 | 
	
		
			
				|  |  |         JSONObject data = new JSONObject();
 | 
	
		
			
				|  |  |         data.put("name",doctorDO.getName());//医师姓名
 | 
	
		
			
				|  |  |         data.put("idcard",doctorDO.getIdcard());//医师证件号
 | 
	
		
			
				|  |  |         data.put("cert_type","");//医师证件类型
 | 
	
		
			
				|  |  |         requestYlz(data.toJSONString(),"N20.17.02.05");
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     public String getYlzToken() throws Exception {
 | 
	
		
			
				|  |  |         String token = null;
 | 
	
		
			
				|  |  |         initConfig();
 |