| 
															
																@ -3,8 +3,6 @@ package com.yihu.jw.hospital.prescription.service.entrance; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																import com.alibaba.fastjson.JSON; 
															 | 
															
															 | 
															
																import com.alibaba.fastjson.JSON; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																import com.alibaba.fastjson.JSONArray; 
															 | 
															
															 | 
															
																import com.alibaba.fastjson.JSONArray; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																import com.alibaba.fastjson.JSONObject; 
															 | 
															
															 | 
															
																import com.alibaba.fastjson.JSONObject; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																import com.fasterxml.jackson.databind.ObjectMapper; 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																import com.sun.webkit.dom.CSSStyleRuleImpl; 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																import com.yihu.jw.dict.dao.DictHospitalDeptDao; 
															 | 
															
															 | 
															
																import com.yihu.jw.dict.dao.DictHospitalDeptDao; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																import com.yihu.jw.doctor.dao.BaseDoctorDao; 
															 | 
															
															 | 
															
																import com.yihu.jw.doctor.dao.BaseDoctorDao; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																import com.yihu.jw.doctor.dao.BaseDoctorHospitalDao; 
															 | 
															
															 | 
															
																import com.yihu.jw.doctor.dao.BaseDoctorHospitalDao; 
															 | 
														
													
												
											
												
													
														
															 | 
															
																@ -29,15 +27,11 @@ import com.yihu.jw.hospital.prescription.dao.OutpatientDao; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																import com.yihu.jw.hospital.prescription.dao.PrescriptionDao; 
															 | 
															
															 | 
															
																import com.yihu.jw.hospital.prescription.dao.PrescriptionDao; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																import com.yihu.jw.hospital.prescription.dao.PrescriptionDiagnosisDao; 
															 | 
															
															 | 
															
																import com.yihu.jw.hospital.prescription.dao.PrescriptionDiagnosisDao; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																import com.yihu.jw.hospital.prescription.dao.PrescriptionInfoDao; 
															 | 
															
															 | 
															
																import com.yihu.jw.hospital.prescription.dao.PrescriptionInfoDao; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																import com.yihu.jw.hospital.prescription.service.entrance.util.ConvertUtil; 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																import com.yihu.jw.hospital.prescription.service.entrance.util.MqSdkUtil; 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																import com.yihu.jw.hospital.ykyy.service.YkyyService; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																import com.yihu.jw.patient.dao.BasePatientDao; 
															 | 
															
															 | 
															
																import com.yihu.jw.patient.dao.BasePatientDao; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																import com.yihu.jw.restmodel.hospital.prescription.WlyyOutpatientVO; 
															 | 
															
															 | 
															
																import com.yihu.jw.restmodel.hospital.prescription.WlyyOutpatientVO; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																import com.yihu.jw.restmodel.hospital.prescription.WlyyPrescriptionInfoVO; 
															 | 
															
															 | 
															
																import com.yihu.jw.restmodel.hospital.prescription.WlyyPrescriptionInfoVO; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																import com.yihu.jw.restmodel.hospital.prescription.WlyyPrescriptionVO; 
															 | 
															
															 | 
															
																import com.yihu.jw.restmodel.hospital.prescription.WlyyPrescriptionVO; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																import com.yihu.jw.rm.base.BaseRequestMapping; 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																import com.yihu.jw.rm.hospital.BaseHospitalRequestMapping; 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																import com.yihu.jw.rm.iot.IotRequestMapping; 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																import com.yihu.jw.util.common.IdCardUtil; 
															 | 
															
															 | 
															
																import com.yihu.jw.util.common.IdCardUtil; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																import com.yihu.jw.util.date.DateUtil; 
															 | 
															
															 | 
															
																import com.yihu.jw.util.date.DateUtil; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																import com.yihu.jw.util.http.HttpClientUtil; 
															 | 
															
															 | 
															
																import com.yihu.jw.util.http.HttpClientUtil; 
															 | 
														
													
												
											
												
													
														
															 | 
															
																@ -46,7 +40,6 @@ import com.yihu.jw.utils.hibernate.HibenateUtils; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																import com.yihu.utils.network.HttpResponse; 
															 | 
															
															 | 
															
																import com.yihu.utils.network.HttpResponse; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																import com.yihu.utils.network.HttpUtils; 
															 | 
															
															 | 
															
																import com.yihu.utils.network.HttpUtils; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																import com.yihu.utils.security.MD5; 
															 | 
															
															 | 
															
																import com.yihu.utils.security.MD5; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																import com.ylzinfo.ehc.common.utils.DateUtils; 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																import org.apache.commons.collections.map.HashedMap; 
															 | 
															
															 | 
															
																import org.apache.commons.collections.map.HashedMap; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																import org.apache.commons.lang3.StringUtils; 
															 | 
															
															 | 
															
																import org.apache.commons.lang3.StringUtils; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																import org.slf4j.Logger; 
															 | 
															
															 | 
															
																import org.slf4j.Logger; 
															 | 
														
													
												
											
												
													
														
															 | 
															
																@ -56,7 +49,6 @@ import org.springframework.jdbc.core.JdbcTemplate; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																import org.springframework.stereotype.Service; 
															 | 
															
															 | 
															
																import org.springframework.stereotype.Service; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																import javax.transaction.Transactional; 
															 | 
															
															 | 
															
																import javax.transaction.Transactional; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																import java.io.IOException; 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																import java.util.*; 
															 | 
															
															 | 
															
																import java.util.*; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																/** 
															 | 
															
															 | 
															
																/** 
															 | 
														
													
												
											
												
													
														
															 | 
															
																@ -131,6 +123,9 @@ public class YkyyEntranceService { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																    private PrescriptionInfoDao prescriptionInfoDao; 
															 | 
															
															 | 
															
																    private PrescriptionInfoDao prescriptionInfoDao; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																    @Autowired 
															 | 
															
															 | 
															
																    @Autowired 
															 | 
														
													
												
													
														
															| 
															 | 
															
																    private JdbcTemplate jdbcTemplate; 
															 | 
															
															 | 
															
																    private JdbcTemplate jdbcTemplate; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																     
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																    @Autowired 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																    private YkyyService ykyyService; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																    public List<Map<String, Object>> createSQLQuery(String sql, Map<String, Object> params, Integer page, Integer size){ 
															 | 
															
															 | 
															
																    public List<Map<String, Object>> createSQLQuery(String sql, Map<String, Object> params, Integer page, Integer size){ 
															 | 
														
													
												
											
												
													
														
															 | 
															
																@ -1524,7 +1519,51 @@ public class YkyyEntranceService { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        } 
															 | 
															
															 | 
															
																        } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        return response1.getContent(); 
															 | 
															
															 | 
															
																        return response1.getContent(); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																    } 
															 | 
															
															 | 
															
																    } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																     
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																    /** 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																     * 眼科通App消息推送接口 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																     * @param doctor 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																     * @param patient 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																     * @param orderType 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																     * @return 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																     */ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																    public String sendMesToYkt(String doctor, String patient, String orderType) throws Exception { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																     
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																        DoctorMappingDO doctorMappingDO = doctorMappingDao.findByDoctor(doctor); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																        String yktDoctor =""; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																        if (doctorMappingDO!=null&&StringUtils.isNoneBlank(doctorMappingDO.getMappingCode())){ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																            String doctorResponse = ykyyService.getYktDoctor(doctorMappingDO.getMappingCode()); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																            JSONObject jsonObject = JSONObject.parseObject(doctorResponse); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																            if (jsonObject.getInteger("code")==200){ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                JSONArray array1 = jsonObject.getJSONArray("data"); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                if (array1!=null&&array1.size()!=0){ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                    yktDoctor=array1.getJSONObject(0).getString("DOCTORUSERID"); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																            } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																        }else { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																            throw new Exception("医生映射表不存在!"); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																        } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																         
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																        BasePatientDO basePatientDO = basePatientDao.findById(patient); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																         
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																        if(basePatientDO!=null){ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																            patient = basePatientDO.getUserId(); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																        } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																         
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																        Map<String,Object> params = new HashedMap(); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																        params.put("doctorId",yktDoctor); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																        params.put("patientId",patient); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																        params.put("orderType",orderType); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																        HttpResponse response = HttpUtils.doPost("http://www.yanketong.com:90/api/share/PushNotificationToDoctor",params); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																     
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																        String content = response.getContent(); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																        logger.info("response:"+content); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																        JSONObject rs = JSON.parseObject(content); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																        Integer status = rs.getInteger("code"); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																        if(status!=null&&status == 10000){ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																            return rs.getString("message");//推送失败原因 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																        }else{ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																            return "推送成功"; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																        } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																    } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																} 
															 | 
															
															 | 
															
																} 
															 |