| 
															
																@ -10,12 +10,13 @@ import com.yihu.jw.doctor.service.BaseDoctorInfoService; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																import com.yihu.jw.entity.base.dict.DictHospitalDeptDO; 
															 | 
															
															 | 
															
																import com.yihu.jw.entity.base.dict.DictHospitalDeptDO; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																import com.yihu.jw.entity.base.doctor.BaseDoctorDO; 
															 | 
															
															 | 
															
																import com.yihu.jw.entity.base.doctor.BaseDoctorDO; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																import com.yihu.jw.entity.base.doctor.BaseDoctorHospitalDO; 
															 | 
															
															 | 
															
																import com.yihu.jw.entity.base.doctor.BaseDoctorHospitalDO; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																import com.yihu.jw.entity.base.doctor.BaseDoctorPatientDO; 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																import com.yihu.jw.entity.base.doctor.BaseDoctorVo; 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																import com.yihu.jw.entity.base.org.BaseDoctorPatientFollowDO; 
															 | 
															
															 | 
															
																import com.yihu.jw.entity.base.org.BaseDoctorPatientFollowDO; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																import com.yihu.jw.entity.base.org.BaseOrgDO; 
															 | 
															
															 | 
															
																import com.yihu.jw.entity.base.org.BaseOrgDO; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																import com.yihu.jw.entity.base.patient.BasePatientDO; 
															 | 
															
															 | 
															
																import com.yihu.jw.entity.base.patient.BasePatientDO; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																import com.yihu.jw.entity.base.patient.PatientMedicareCardDO; 
															 | 
															
															 | 
															
																import com.yihu.jw.entity.base.patient.PatientMedicareCardDO; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																import com.yihu.jw.entity.base.wx.BasePatientWechatDo; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																import com.yihu.jw.entity.base.wx.WxWechatDO; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																import com.yihu.jw.entity.hospital.consult.WlyyDoctorClinicRoomDO; 
															 | 
															
															 | 
															
																import com.yihu.jw.entity.hospital.consult.WlyyDoctorClinicRoomDO; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																import com.yihu.jw.entity.hospital.consult.WlyyHospitalSysDictDO; 
															 | 
															
															 | 
															
																import com.yihu.jw.entity.hospital.consult.WlyyHospitalSysDictDO; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																import com.yihu.jw.entity.hospital.consult.WlyyHospitalWaitingRoomDO; 
															 | 
															
															 | 
															
																import com.yihu.jw.entity.hospital.consult.WlyyHospitalWaitingRoomDO; 
															 | 
														
													
												
											
												
													
														
															 | 
															
																@ -74,6 +75,8 @@ import com.yihu.jw.util.date.DateUtil; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																import com.yihu.jw.utils.StringUtil; 
															 | 
															
															 | 
															
																import com.yihu.jw.utils.StringUtil; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																import com.yihu.jw.utils.WebserviceUtil; 
															 | 
															
															 | 
															
																import com.yihu.jw.utils.WebserviceUtil; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																import com.yihu.jw.utils.hibernate.HibenateUtils; 
															 | 
															
															 | 
															
																import com.yihu.jw.utils.hibernate.HibenateUtils; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																import com.yihu.jw.wechat.dao.BasePatientWechatDao; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																import com.yihu.jw.wechat.dao.WechatDao; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																import com.yihu.mysql.query.BaseJpaService; 
															 | 
															
															 | 
															
																import com.yihu.mysql.query.BaseJpaService; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																import com.yihu.utils.security.MD5; 
															 | 
															
															 | 
															
																import com.yihu.utils.security.MD5; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																import com.ylzinfo.ehc.EhcHandler; 
															 | 
															
															 | 
															
																import com.ylzinfo.ehc.EhcHandler; 
															 | 
														
													
												
											
												
													
														
															 | 
															
																@ -217,6 +220,10 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres 
															 | 
														
													
												
													
														
															| 
															 | 
															
																    private BasePatientMedicareCardDao patientMedicareCardDao; 
															 | 
															
															 | 
															
																    private BasePatientMedicareCardDao patientMedicareCardDao; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																    @Autowired 
															 | 
															
															 | 
															
																    @Autowired 
															 | 
														
													
												
													
														
															| 
															 | 
															
																    private PatientMappingDao patientMappingDao; 
															 | 
															
															 | 
															
																    private PatientMappingDao patientMappingDao; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																    @Autowired 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																    private WechatDao wechatDao; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																    @Autowired 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																    private BasePatientWechatDao patientWechatDao; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																    @Value("${demo.flag}") 
															 | 
															
															 | 
															
																    @Value("${demo.flag}") 
															 | 
														
													
												
											
												
													
														
															 | 
															
																@ -3044,7 +3051,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                    "WHERE " + 
															 | 
															
															 | 
															
																                    "WHERE " + 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                    "a.relation_code=b.id " + 
															 | 
															
															 | 
															
																                    "a.relation_code=b.id " + 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                    "AND b.doctor='"+doctor+"' " + 
															 | 
															
															 | 
															
																                    "AND b.doctor='"+doctor+"' " + 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                    "GROUP BY a.score_type"; 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                    "GROUP BY a.score_type ORDER BY  a.score_type ASC "; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																            List<Map<String,Object>> listscore = jdbcTemplate.queryForList(sqlscore); 
															 | 
															
															 | 
															
																            List<Map<String,Object>> listscore = jdbcTemplate.queryForList(sqlscore); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																     
															 | 
															
															 | 
															
																     
															 | 
														
													
												
													
														
															| 
															 | 
															
																            Double doctorScore = new Double("0"); 
															 | 
															
															 | 
															
																            Double doctorScore = new Double("0"); 
															 | 
														
													
												
											
												
													
														
															 | 
															
																@ -4071,6 +4078,8 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        rs.put("idcard",basePatientDO.getIdcard()); 
															 | 
															
															 | 
															
																        rs.put("idcard",basePatientDO.getIdcard()); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        rs.put("age",IdCardUtil.getAgeForIdcard(basePatientDO.getIdcard())); 
															 | 
															
															 | 
															
																        rs.put("age",IdCardUtil.getAgeForIdcard(basePatientDO.getIdcard())); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        rs.put("mobile",basePatientDO.getMobile()); 
															 | 
															
															 | 
															
																        rs.put("mobile",basePatientDO.getMobile()); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																        rs.put("photo",basePatientDO.getPhoto()); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																        rs.put("address",basePatientDO.getAddress()); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        if (patientMedicareCardDO!=null){ 
															 | 
															
															 | 
															
																        if (patientMedicareCardDO!=null){ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																            rs.put("ssc",patientMedicareCardDO.getCode()); 
															 | 
															
															 | 
															
																            rs.put("ssc",patientMedicareCardDO.getCode()); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        }else { 
															 | 
															
															 | 
															
																        }else { 
															 | 
														
													
												
											
												
													
														
															 | 
															
																@ -4157,6 +4166,8 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        rs.put("idcard",basePatientDO.getIdcard()); 
															 | 
															
															 | 
															
																        rs.put("idcard",basePatientDO.getIdcard()); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        rs.put("age",IdCardUtil.getAgeForIdcard(basePatientDO.getIdcard())); 
															 | 
															
															 | 
															
																        rs.put("age",IdCardUtil.getAgeForIdcard(basePatientDO.getIdcard())); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        rs.put("mobile",basePatientDO.getMobile()); 
															 | 
															
															 | 
															
																        rs.put("mobile",basePatientDO.getMobile()); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																        rs.put("photo",basePatientDO.getPhoto()); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																        rs.put("address",basePatientDO.getAddress()); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        if (patientMedicareCardDO!=null){ 
															 | 
															
															 | 
															
																        if (patientMedicareCardDO!=null){ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																            rs.put("ssc",patientMedicareCardDO.getCode()); 
															 | 
															
															 | 
															
																            rs.put("ssc",patientMedicareCardDO.getCode()); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        }else { 
															 | 
															
															 | 
															
																        }else { 
															 | 
														
													
												
											
												
													
														
															 | 
															
																@ -6407,4 +6418,29 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        rs.put("distance",distance); 
															 | 
															
															 | 
															
																        rs.put("distance",distance); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        return MixEnvelop.getSuccess(IotRequestMapping.Common.message_success_find,rs); 
															 | 
															
															 | 
															
																        return MixEnvelop.getSuccess(IotRequestMapping.Common.message_success_find,rs); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																    } 
															 | 
															
															 | 
															
																    } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																    public MixEnvelop selectByUrl(String prescriptionId,String wxId) throws Exception { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																        WxWechatDO wxWechatDO = wechatDao.findById(wxId); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																        if (wxWechatDO==null){ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																            throw new Exception("微信配置不存在!"); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																        } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																        WlyyPrescriptionDO prescriptionDO = prescriptionDao.findOne(prescriptionId); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																        if (prescriptionDO==null){ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																            throw new Exception("处方不存在!"); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																        } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																        List<BasePatientWechatDo> patientWechatDos =patientWechatDao.findByWechatIdAndPatientId(wxId,prescriptionDO.getPatientCode()); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																        if (patientWechatDos==null||patientWechatDos.size()==0){ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																            throw new Exception("openid不存在!"); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																        } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																        BasePatientWechatDo patientWechatDo = patientWechatDos.get(0); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																        PatientMedicareCardDO patientMedicareCardDO = patientMedicareCardDao.findByTypeAndPatientCodeAndDel("A_01",prescriptionDO.getPatientCode(),"1"); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																        if (patientMedicareCardDO==null){ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																            throw new Exception("就诊卡不存在!"); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																        } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																        String url = ylzPayService.createSicardPayUrl(wxWechatDO.getAppOriginId(),patientWechatDo.getOpenid(),patientMedicareCardDO.getCode(),"WX"); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																        com.alibaba.fastjson.JSONObject object = com.alibaba.fastjson.JSONObject.parseObject(url); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																        return MixEnvelop.getSuccess(IotRequestMapping.Common.message_success_find,object); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																    } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																} 
															 | 
															
															 | 
															
																} 
															 |