|
@ -8,15 +8,12 @@ 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;
|
|
import com.yihu.jw.doctor.dao.BaseDoctorRoleDao;
|
|
import com.yihu.jw.doctor.dao.BaseDoctorRoleDao;
|
|
import com.yihu.jw.entity.base.dict.DictDoctorDutyDO;
|
|
|
|
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.BaseDoctorRoleDO;
|
|
import com.yihu.jw.entity.base.doctor.BaseDoctorRoleDO;
|
|
import com.yihu.jw.entity.base.patient.BasePatientDO;
|
|
import com.yihu.jw.entity.base.patient.BasePatientDO;
|
|
import com.yihu.jw.entity.base.wx.BasePatientWechatDo;
|
|
|
|
import com.yihu.jw.entity.hospital.consult.WlyyHospitalSysDictDO;
|
|
import com.yihu.jw.entity.hospital.consult.WlyyHospitalSysDictDO;
|
|
import com.yihu.jw.entity.hospital.dict.WlyyChargeDictDO;
|
|
|
|
import com.yihu.jw.entity.hospital.httplog.WlyyHttpLogDO;
|
|
import com.yihu.jw.entity.hospital.httplog.WlyyHttpLogDO;
|
|
import com.yihu.jw.entity.hospital.mapping.DoctorMappingDO;
|
|
import com.yihu.jw.entity.hospital.mapping.DoctorMappingDO;
|
|
import com.yihu.jw.entity.hospital.mapping.PatientMappingDO;
|
|
import com.yihu.jw.entity.hospital.mapping.PatientMappingDO;
|
|
@ -29,26 +26,21 @@ import com.yihu.jw.hospital.mapping.dao.PatientMappingDao;
|
|
import com.yihu.jw.hospital.prescription.dao.*;
|
|
import com.yihu.jw.hospital.prescription.dao.*;
|
|
import com.yihu.jw.oauth.OauthRsaKeyDao;
|
|
import com.yihu.jw.oauth.OauthRsaKeyDao;
|
|
import com.yihu.jw.patient.dao.BasePatientDao;
|
|
import com.yihu.jw.patient.dao.BasePatientDao;
|
|
import com.yihu.jw.restmodel.hospital.prescription.WlyyInspectionVO;
|
|
|
|
import com.yihu.jw.restmodel.hospital.prescription.WlyyPrescriptionDiagnosisVO;
|
|
|
|
import com.yihu.jw.restmodel.hospital.prescription.WlyyPrescriptionInfoVO;
|
|
|
|
import com.yihu.jw.restmodel.hospital.prescription.WlyyPrescriptionVO;
|
|
|
|
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.encrypt.MD5;
|
|
import com.yihu.jw.util.encrypt.MD5;
|
|
import com.yihu.jw.util.http.HttpClientUtil;
|
|
import com.yihu.jw.util.http.HttpClientUtil;
|
|
import com.yihu.jw.util.network.HttpResponse;
|
|
import com.yihu.jw.util.network.HttpResponse;
|
|
import com.yihu.jw.util.network.HttpUtils;
|
|
import com.yihu.jw.util.network.HttpUtils;
|
|
import com.yihu.jw.util.wechat.wxhttp.HttpUtil;
|
|
|
|
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.BasePatientWechatDao;
|
|
import net.sf.json.xml.XMLSerializer;
|
|
import net.sf.json.xml.XMLSerializer;
|
|
|
|
import okhttp3.*;
|
|
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;
|
|
import org.slf4j.LoggerFactory;
|
|
import org.slf4j.LoggerFactory;
|
|
import org.springframework.beans.BeanUtils;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.jdbc.core.JdbcTemplate;
|
|
import org.springframework.jdbc.core.JdbcTemplate;
|
|
@ -57,6 +49,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
import java.text.SimpleDateFormat;
|
|
import java.text.SimpleDateFormat;
|
|
import java.util.*;
|
|
import java.util.*;
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
/**
|
|
* 第三医院内网his对接服务
|
|
* 第三医院内网his对接服务
|
|
@ -985,24 +978,125 @@ public class DsyyEntranceService {
|
|
* @throws Exception
|
|
* @throws Exception
|
|
*/
|
|
*/
|
|
public String authorize()throws Exception{
|
|
public String authorize()throws Exception{
|
|
|
|
// test1();
|
|
|
|
// test();
|
|
String api = "authorize";
|
|
String api = "authorize";
|
|
String msgHeader ="";
|
|
String msgHeader ="";
|
|
String condition ="<![CDATA[{\"clientId\":\"12222222\",\"responseType\":\"code\"}]]";
|
|
|
|
String msgBody ="<?xml version=\"1.0\" encoding=\"utf-8\"?>" +
|
|
|
|
"<authorize><pinput>"+condition+"</pinput></authorize>";
|
|
|
|
|
|
String condition ="<![CDATA[{\"clientId\":\"12222222\",\"responseType\":\"code\"}]]>";
|
|
|
|
// String msgBody ="<?xml version=\"1.0\" encoding=\"utf-8\"?>" +
|
|
|
|
String msgBody = "<authorize><pinput>"+condition+"</pinput></authorize>";
|
|
WlyyHttpLogDO wlyyHttpLogDO = new WlyyHttpLogDO();
|
|
WlyyHttpLogDO wlyyHttpLogDO = new WlyyHttpLogDO();
|
|
Map<String,String> params = new HashedMap();
|
|
Map<String,String> params = new HashedMap();
|
|
params.put("Header",msgHeader);
|
|
params.put("Header",msgHeader);
|
|
params.put("Body",msgBody);
|
|
params.put("Body",msgBody);
|
|
wlyyHttpLogDO.setRequest(params.toString());
|
|
wlyyHttpLogDO.setRequest(params.toString());
|
|
logger.info("authorize params:"+params.toString());
|
|
logger.info("authorize params:"+params.toString());
|
|
String xml = getDsyyJhWebServiceInfo("WritebackCvalueInterface",params,getJhServiceUrl());
|
|
|
|
|
|
String xml = getDsyyJhWebServiceInfo(api,params,getJhServiceUrl());
|
|
XMLSerializer xmlSerializer = new XMLSerializer();
|
|
XMLSerializer xmlSerializer = new XMLSerializer();
|
|
String json = xmlSerializer.read(xml).toString();
|
|
String json = xmlSerializer.read(xml).toString();
|
|
logger.info("authorize json:"+json);
|
|
logger.info("authorize json:"+json);
|
|
return json;
|
|
return json;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// public void test1(){
|
|
|
|
// try {
|
|
|
|
// String condition ="<![CDATA[{\"clientId\":\"12222222\",\"responseType\":\"code\"}]]>";
|
|
|
|
// String msgBody = "<authorize><pinput>"+condition+"</pinput></authorize>";
|
|
|
|
// WritebackCvalueInterfaceLocator locator = new WritebackCvalueInterfaceLocator();
|
|
|
|
// String returnStr = locator.getWritebackCvalueInterfaceSoap().authorize(condition);
|
|
|
|
// System.out.println("==========test1====================="+returnStr);
|
|
|
|
// }catch (Exception e){
|
|
|
|
// e.printStackTrace();
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
|
|
|
|
public void test(){
|
|
|
|
try {
|
|
|
|
OkHttpClient client = new OkHttpClient().newBuilder()
|
|
|
|
.build();
|
|
|
|
MediaType mediaType = MediaType.parse("Content-Type");
|
|
|
|
RequestBody body = RequestBody.create(mediaType, "<soapenv:Envelope " +
|
|
|
|
"xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\"" +
|
|
|
|
" xmlns:good=\"http://goodwillcis.com\"> " +
|
|
|
|
" <soapenv:Header/> <soapenv:Body> " +
|
|
|
|
" <good:authorize> " +
|
|
|
|
"<good:pInput><![CDATA[{\"clientId\":\"12222222\",\"responseType\":\"code\"}]]></good:pInput> " +
|
|
|
|
" </good:authorize> " +
|
|
|
|
" </soapenv:Body> </soapenv:Envelope>");
|
|
|
|
Request request = new Request.Builder()
|
|
|
|
.url("http://10.95.8.41:80/csp/jhip/JHIP.BJCA.BS.BJCAServicesBS.cls")
|
|
|
|
.method("POST", body)
|
|
|
|
.addHeader("Content-Type", "Content-Type")
|
|
|
|
.addHeader("SOAPAction", "\"#authorize\"")
|
|
|
|
.build();
|
|
|
|
Response response = client.newCall(request).execute();
|
|
|
|
System.out.println("==============================="+response.code());
|
|
|
|
System.out.println("==============================="+response.body().string());
|
|
|
|
System.out.println("==============================="+response.message());
|
|
|
|
}catch (Exception e){
|
|
|
|
e.printStackTrace();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//发送短信
|
|
|
|
public String SendMessage(String strDllModel,String strPhoneNO,String strMsgContent) throws Exception {
|
|
|
|
String api = "SendMessage";
|
|
|
|
String msgHeader ="";
|
|
|
|
String condition ="<![CDATA[{\"strDllModel\":\"\",\"strPhoneNO\":\"13559485270\",\"strMsgContent\":\"测试短信\"}]]>";
|
|
|
|
WlyyHttpLogDO wlyyHttpLogDO = new WlyyHttpLogDO();
|
|
|
|
Map<String,String> params = new HashedMap();
|
|
|
|
params.put("Header",msgHeader);
|
|
|
|
params.put("strDllModel",strDllModel);
|
|
|
|
params.put("strPhoneNO",strPhoneNO);
|
|
|
|
params.put("strMsgContent",strMsgContent);
|
|
|
|
wlyyHttpLogDO.setRequest(params.toString());
|
|
|
|
logger.info("SendMessage params:"+params.toString());
|
|
|
|
List<WlyyHospitalSysDictDO> distList = wlyyHospitalSysDictDao.findByDictName("DX_SMS_SERVICE");
|
|
|
|
Map<String,String> dictMap = distList.stream().collect(Collectors.toMap(WlyyHospitalSysDictDO::getDictCode,WlyyHospitalSysDictDO::getDictValue));
|
|
|
|
String msgUrl = dictMap.get("SMS_SERVICE_URL");
|
|
|
|
String soapaction = dictMap.get("SMS_SERVICE_SOAPACTION");
|
|
|
|
String xml = getDsyyJhWebServiceInfo(api,params,msgUrl);
|
|
|
|
XMLSerializer xmlSerializer = new XMLSerializer();
|
|
|
|
String json = xmlSerializer.read(xml).toString();
|
|
|
|
logger.info("SendMessage json:"+json);
|
|
|
|
return json;
|
|
|
|
/* String operationName = "SendMessage";// 调用方法名
|
|
|
|
org.apache.axis.client.Service service = new org.apache.axis.client.Service();
|
|
|
|
String response = "";
|
|
|
|
if (StringUtils.isBlank(strDllModel)){
|
|
|
|
strDllModel="";
|
|
|
|
}
|
|
|
|
List<WlyyHospitalSysDictDO> distList = wlyyHospitalSysDictDao.findByDictName("DX_SMS_SERVICE");
|
|
|
|
Map<String,String> dictMap = distList.stream().collect(Collectors.toMap(WlyyHospitalSysDictDO::getDictCode,WlyyHospitalSysDictDO::getDictValue));
|
|
|
|
String msgUrl = dictMap.get("SMS_SERVICE_URL");
|
|
|
|
String soapaction = dictMap.get("SMS_SERVICE_SOAPACTION");
|
|
|
|
Object[] obj = new Object[]{};
|
|
|
|
try {
|
|
|
|
Call call = (Call) service.createCall();
|
|
|
|
call.setTargetEndpointAddress(msgUrl);
|
|
|
|
call.setOperationName(new QName(soapaction, operationName)); // 设置要调用哪个方法
|
|
|
|
call.addParameter(new QName(soapaction, "strDllModel"), // 设置要传递的参数
|
|
|
|
org.apache.axis.encoding.XMLType.XSD_STRING,
|
|
|
|
javax.xml.rpc.ParameterMode.IN);
|
|
|
|
call.addParameter(new QName(soapaction, "strPhoneNO"),
|
|
|
|
org.apache.axis.encoding.XMLType.XSD_STRING,
|
|
|
|
javax.xml.rpc.ParameterMode.IN);
|
|
|
|
call.addParameter(new QName(soapaction, "strMsgContent"),
|
|
|
|
org.apache.axis.encoding.XMLType.XSD_STRING,
|
|
|
|
javax.xml.rpc.ParameterMode.IN);
|
|
|
|
call.setReturnType(org.apache.axis.encoding.XMLType.XSD_STRING);// (标准的类型)
|
|
|
|
call.setUseSOAPAction(true);
|
|
|
|
call.setSOAPActionURI(soapaction +"/"+ "JHIP.SMS.BS.SendMessge");
|
|
|
|
// obj = new Object[]{strMoID, strMobiles, strContent, strApiCode, NAME, PWD, strSender};
|
|
|
|
obj = new Object[]{strDllModel, strPhoneNO, strMsgContent};
|
|
|
|
response = (String) call.invoke(obj);
|
|
|
|
//response 返回字符串的不以error开头,则表示成功
|
|
|
|
return response;
|
|
|
|
}catch (Exception e) {
|
|
|
|
e.printStackTrace();
|
|
|
|
throw new Exception("短信下发失败");
|
|
|
|
}*/
|
|
|
|
}
|
|
//========================集成平台调用结束===========================
|
|
//========================集成平台调用结束===========================
|
|
|
|
|
|
public String replaceHtml(String demoData,String oldChar,String newChar){
|
|
public String replaceHtml(String demoData,String oldChar,String newChar){
|