|
@ -8,6 +8,7 @@ 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.ca.OauthCaConfigDO;
|
|
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;
|
|
@ -119,6 +120,8 @@ public class DsyyEntranceService {
|
|
private JdbcTemplate jdbcTemplate;
|
|
private JdbcTemplate jdbcTemplate;
|
|
@Autowired
|
|
@Autowired
|
|
private HibenateUtils hibenateUtils;
|
|
private HibenateUtils hibenateUtils;
|
|
|
|
@Autowired
|
|
|
|
private OauthCaConfigDao oauthCaConfigDao;
|
|
|
|
|
|
|
|
|
|
private static String key="bvvsf3JA0mUXMU+mVnMaOQ==";
|
|
private static String key="bvvsf3JA0mUXMU+mVnMaOQ==";
|
|
@ -1027,6 +1030,7 @@ public class DsyyEntranceService {
|
|
if (StringUtils.isNoneBlank(chargeCode)){
|
|
if (StringUtils.isNoneBlank(chargeCode)){
|
|
sql+=" and charge_code = '"+chargeCode+"' ";
|
|
sql+=" and charge_code = '"+chargeCode+"' ";
|
|
}
|
|
}
|
|
|
|
sql +=" and group_no ='50105' ";
|
|
JSONArray array = new JSONArray();
|
|
JSONArray array = new JSONArray();
|
|
Map<String,Object> params = new HashedMap();
|
|
Map<String,Object> params = new HashedMap();
|
|
params.put("sql",sql);
|
|
params.put("sql",sql);
|
|
@ -1496,6 +1500,43 @@ public class DsyyEntranceService {
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 获取患者待结算信息
|
|
|
|
*
|
|
|
|
* @param
|
|
|
|
* @return
|
|
|
|
*/
|
|
|
|
public String getSettlement(String cardNo,String registerNo) throws Exception{
|
|
|
|
String api = "getSettlement";
|
|
|
|
String msgHeader ="<?xml version=\"1.0\" encoding=\"utf-8\"?> " +
|
|
|
|
"<root> " +
|
|
|
|
" <serverName>"+api+"</serverName> " +
|
|
|
|
" <format>xml</format>" +
|
|
|
|
" <callOperator></callOperator> " +
|
|
|
|
" <certificate>"+key+"</certificate> " +
|
|
|
|
"</root>";
|
|
|
|
String condition ="";
|
|
|
|
if (StringUtils.isNoneBlank(cardNo)){
|
|
|
|
condition += "<cardNo>"+cardNo+"</cardNo>";
|
|
|
|
}
|
|
|
|
if (StringUtils.isNoneBlank(registerNo)){
|
|
|
|
condition += "<registerNo>"+registerNo+"</registerNo>";
|
|
|
|
}
|
|
|
|
String msgBody ="<?xml version=\"1.0\" encoding=\"utf-8\"?>" +
|
|
|
|
"<root>"+condition+"</root>";
|
|
|
|
Map<String,String> params = new HashedMap();
|
|
|
|
params.put("msgHeader",msgHeader);
|
|
|
|
params.put("msgBody",msgBody);
|
|
|
|
logger.info("getSettlement params:"+params.toString());
|
|
|
|
String xml = getDsyyWebServiceInfo("CallInterface",params,getOperateUrl());
|
|
|
|
XMLSerializer xmlSerializer = new XMLSerializer();
|
|
|
|
String json = xmlSerializer.read(xml).toString();
|
|
|
|
logger.info(" getSettlement json:"+json);
|
|
|
|
return json;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
//=============his webservice 调用结束=========================
|
|
//=============his webservice 调用结束=========================
|
|
|
|
|
|
//========================集成平台调用开始===========================
|
|
//========================集成平台调用开始===========================
|
|
@ -1506,7 +1547,8 @@ public class DsyyEntranceService {
|
|
* @throws Exception
|
|
* @throws Exception
|
|
*/
|
|
*/
|
|
public String authorize()throws Exception{
|
|
public String authorize()throws Exception{
|
|
String condition ="{\"clientId\":\"2019111513540975\",\"responseType\":\"code\"}";
|
|
|
|
|
|
OauthCaConfigDO oauthCaConfigDO = oauthCaConfigDao.findById("oauth_ca_config").get();
|
|
|
|
String condition ="{\"clientId\":\""+oauthCaConfigDO.getClientId()+"\",\"responseType\":\"code\"}";
|
|
WritebackCvalueInterfaceLocator locator = new WritebackCvalueInterfaceLocator();
|
|
WritebackCvalueInterfaceLocator locator = new WritebackCvalueInterfaceLocator();
|
|
String returnStr = locator.getWritebackCvalueInterfaceSoap().authorize(condition);
|
|
String returnStr = locator.getWritebackCvalueInterfaceSoap().authorize(condition);
|
|
return returnStr;
|
|
return returnStr;
|
|
@ -1518,12 +1560,129 @@ public class DsyyEntranceService {
|
|
* @throws Exception
|
|
* @throws Exception
|
|
*/
|
|
*/
|
|
public String tokeninfo(String requestId)throws Exception{
|
|
public String tokeninfo(String requestId)throws Exception{
|
|
String condition ="{\"clientId\":\"2019111513540975\",\"requestId\":\""+requestId+"\"}";
|
|
|
|
|
|
OauthCaConfigDO oauthCaConfigDO = oauthCaConfigDao.findById("oauth_ca_config").get();
|
|
|
|
String condition ="{\"clientId\":\""+oauthCaConfigDO.getClientId()+"\",\"requestId\":\""+requestId+"\"}";
|
|
WritebackCvalueInterfaceLocator locator = new WritebackCvalueInterfaceLocator();
|
|
WritebackCvalueInterfaceLocator locator = new WritebackCvalueInterfaceLocator();
|
|
String returnStr = locator.getWritebackCvalueInterfaceSoap().tokeninfo(condition);
|
|
String returnStr = locator.getWritebackCvalueInterfaceSoap().tokeninfo(condition);
|
|
return returnStr;
|
|
return returnStr;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 数据哈希计算接口
|
|
|
|
* @param content
|
|
|
|
* @return
|
|
|
|
*/
|
|
|
|
public JSONObject computeDigestForAlg(String content){
|
|
|
|
try {
|
|
|
|
WritebackCvalueInterfaceLocator locator = new WritebackCvalueInterfaceLocator();
|
|
|
|
JSONObject object = new JSONObject();
|
|
|
|
object.put("originData",content);
|
|
|
|
String response = locator.getWritebackCvalueInterfaceSoap().computeDigestForAlg(object.toJSONString());
|
|
|
|
logger.info("数据哈希计算接口 :"+response);
|
|
|
|
return JSONObject.parseObject(response);
|
|
|
|
}catch (Exception e){
|
|
|
|
e.printStackTrace();
|
|
|
|
}
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
/***
|
|
|
|
* 数据签名接口
|
|
|
|
* @param templateId 模板ID签名数据摘要数据类型
|
|
|
|
* @param urId 签名流水ID
|
|
|
|
* @param patientName 患者姓名
|
|
|
|
* @param patientAge 患者年龄
|
|
|
|
* @param patientSex 患者性别
|
|
|
|
* @param patientCardType 证件类型
|
|
|
|
* @param recipeTime 开具时间
|
|
|
|
* @param hashValue Hash原文(从签名指纹接口结果中得到的)
|
|
|
|
* @param hashType Hash算法(从签名指纹接口结果中得到的)
|
|
|
|
* @return
|
|
|
|
*/
|
|
|
|
public JSONObject synRecipeInfo(String templateId,String urId,String patientName,String patientAge,String patientSex,String patientCardType,String recipeTime,String hashValue,String hashType,String openId,String patientCard){
|
|
|
|
try {
|
|
|
|
OauthCaConfigDO oauthCaConfigDO = oauthCaConfigDao.findById("oauth_ca_config").orElse(null);
|
|
|
|
String clientId= "";
|
|
|
|
String clientSecret = "";
|
|
|
|
if (oauthCaConfigDO!=null){
|
|
|
|
clientId=oauthCaConfigDO.getClientId();
|
|
|
|
clientSecret=oauthCaConfigDO.getClientSecret();
|
|
|
|
}
|
|
|
|
JSONObject object = new JSONObject();
|
|
|
|
JSONObject msg = new JSONObject();
|
|
|
|
JSONObject head = new JSONObject();
|
|
|
|
head.put("clientId",clientId);
|
|
|
|
head.put("templateId",templateId);
|
|
|
|
head.put("clientSecret",clientSecret);
|
|
|
|
head.put("selfSign",true);
|
|
|
|
msg.put("head",head);
|
|
|
|
JSONObject body = new JSONObject();
|
|
|
|
body.put("urId",urId);
|
|
|
|
body.put("patientName",patientName);
|
|
|
|
body.put("patientAge",patientAge);
|
|
|
|
body.put("patientSex",patientSex);
|
|
|
|
body.put("patientCardType",patientCardType);
|
|
|
|
body.put("recipeTime",recipeTime);
|
|
|
|
body.put("hashValue",hashValue);
|
|
|
|
body.put("hashType",hashType);
|
|
|
|
body.put("patientCard",patientCard);
|
|
|
|
body.put("openId",openId);
|
|
|
|
msg.put("body",body);
|
|
|
|
object.put("msg",msg);
|
|
|
|
object.put("signType",0);
|
|
|
|
logger.info("请求参数:"+object);
|
|
|
|
WritebackCvalueInterfaceLocator locator = new WritebackCvalueInterfaceLocator();
|
|
|
|
String response = locator.getWritebackCvalueInterfaceSoap().synRecipeInfo(object.toJSONString());
|
|
|
|
logger.info("数据签名接口 :"+response);
|
|
|
|
return JSONObject.parseObject(response);
|
|
|
|
}catch (Exception e){
|
|
|
|
e.printStackTrace();
|
|
|
|
}
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
/***
|
|
|
|
* 获取签名结果接口
|
|
|
|
* uniqueId 签名数据唯一标识
|
|
|
|
* @return
|
|
|
|
*/
|
|
|
|
public JSONObject synSignDataSearch(String uniqueId){
|
|
|
|
try {
|
|
|
|
OauthCaConfigDO oauthCaConfigDO = oauthCaConfigDao.findById("oauth_ca_config").orElse(null);
|
|
|
|
String clientId= "";
|
|
|
|
String clientSecret = "";
|
|
|
|
if (oauthCaConfigDO!=null){
|
|
|
|
clientId=oauthCaConfigDO.getClientId();
|
|
|
|
clientSecret=oauthCaConfigDO.getClientSecret();
|
|
|
|
}
|
|
|
|
JSONObject object = new JSONObject();
|
|
|
|
JSONObject head = new JSONObject();
|
|
|
|
head.put("clientId",clientId);
|
|
|
|
head.put("clientSecret",clientSecret);
|
|
|
|
object.put("head",head);
|
|
|
|
JSONObject body = new JSONObject();
|
|
|
|
body.put("uniqueId",uniqueId);
|
|
|
|
object.put("body",body);
|
|
|
|
logger.info("请求参数:"+object);
|
|
|
|
WritebackCvalueInterfaceLocator locator = new WritebackCvalueInterfaceLocator();
|
|
|
|
String response = locator.getWritebackCvalueInterfaceSoap().synSignDataSearch(object.toJSONString());
|
|
|
|
logger.info("数据签名接口 :"+response);
|
|
|
|
return JSONObject.parseObject(response);
|
|
|
|
}catch (Exception e){
|
|
|
|
e.printStackTrace();
|
|
|
|
}
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 发送短信
|
|
|
|
* @param strDllModel
|
|
|
|
* @param strPhoneNO
|
|
|
|
* @param strMsgContent
|
|
|
|
* @return
|
|
|
|
* @throws Exception
|
|
|
|
*/
|
|
public String sendMessage(String strDllModel,String strPhoneNO,String strMsgContent)throws Exception{
|
|
public String sendMessage(String strDllModel,String strPhoneNO,String strMsgContent)throws Exception{
|
|
SendMessge_ServiceLocator locator = new SendMessge_ServiceLocator();
|
|
SendMessge_ServiceLocator locator = new SendMessge_ServiceLocator();
|
|
String returnStr = locator.getSendMessgeSoap().sendMessge(strDllModel,strPhoneNO,strMsgContent);
|
|
String returnStr = locator.getSendMessgeSoap().sendMessge(strDllModel,strPhoneNO,strMsgContent);
|