|
@ -11,6 +11,7 @@ import com.yihu.jw.entity.util.RSA;
|
|
import com.yihu.jw.security.dao.OauthRsaKeyDao;
|
|
import com.yihu.jw.security.dao.OauthRsaKeyDao;
|
|
import com.yihu.jw.security.dao.WlyyHttpLogDao;
|
|
import com.yihu.jw.security.dao.WlyyHttpLogDao;
|
|
import com.yihu.jw.security.dao.patient.WlyyHospitalSysDictDao;
|
|
import com.yihu.jw.security.dao.patient.WlyyHospitalSysDictDao;
|
|
|
|
import com.yihu.jw.security.utils.AesUtilsByDigitalCloudSign;
|
|
import com.yihu.jw.security.utils.DateUtil;
|
|
import com.yihu.jw.security.utils.DateUtil;
|
|
import com.yihu.jw.security.utils.RSAEncrypt;
|
|
import com.yihu.jw.security.utils.RSAEncrypt;
|
|
import com.yihu.jw.security.utils.WebserviceUtil;
|
|
import com.yihu.jw.security.utils.WebserviceUtil;
|
|
@ -25,6 +26,7 @@ import org.slf4j.LoggerFactory;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
import java.util.Date;
|
|
import java.util.Date;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
@ -121,7 +123,7 @@ public class HcyyService {
|
|
" <callOperator></callOperator> " +
|
|
" <callOperator></callOperator> " +
|
|
" <certificate>"+caKey+"</certificate> " +
|
|
" <certificate>"+caKey+"</certificate> " +
|
|
"</root>";
|
|
"</root>";
|
|
String condition ="{\"apiName\":\""+apiCode+"\",\"version\":\"v1\",\"jsonData\":\""+ StringEscapeUtils.escapeJson(jsonData)+"\"}";
|
|
|
|
|
|
String condition ="{\"apiName\":\""+apiCode+"\",\"version\":\"v1\",\"jsonData\":\""+ jsonData+"\"}";
|
|
String msgBody ="<?xml version=\"1.0\" encoding=\"utf-8\"?>" +
|
|
String msgBody ="<?xml version=\"1.0\" encoding=\"utf-8\"?>" +
|
|
"<root>"+condition+"</root>";
|
|
"<root>"+condition+"</root>";
|
|
|
|
|
|
@ -156,12 +158,13 @@ public class HcyyService {
|
|
}
|
|
}
|
|
OauthRsaKeyDO oauthRsaKeyDO = oauthRsaKeyDOs.get(0);
|
|
OauthRsaKeyDO oauthRsaKeyDO = oauthRsaKeyDOs.get(0);
|
|
String res = "businessSystemId="+businessSystemId+"×tamp="+timestamp;
|
|
String res = "businessSystemId="+businessSystemId+"×tamp="+timestamp;
|
|
String signature = RSAEncrypt.encrypt(res,oauthRsaKeyDO.getPublicKey());
|
|
|
|
JSONObject jsonObject = new JSONObject();
|
|
|
|
|
|
/* String signature = RSAEncrypt.encrypt(res,oauthRsaKeyDO.getPublicKey());*/
|
|
|
|
/* JSONObject jsonObject = new JSONObject();
|
|
jsonObject.put("businessSystemId",businessSystemId);
|
|
jsonObject.put("businessSystemId",businessSystemId);
|
|
jsonObject.put("timestamp",timestamp+"");
|
|
jsonObject.put("timestamp",timestamp+"");
|
|
jsonObject.put("signature","");
|
|
|
|
String result = XMCA_DCS_UnifiedInterface("获取访问令牌接口","authorize/token",jsonObject.toJSONString());
|
|
|
|
|
|
jsonObject.put("signature","");*/
|
|
|
|
String jsonObject = "{\\\"businessSystemId\\\": \\\""+businessSystemId+"\\\",\\\"timestamp\\\": \\\""+timestamp+"\\\",\\\"signature\\\": \\\"\\\"}";
|
|
|
|
String result = XMCA_DCS_UnifiedInterface("获取访问令牌接口","authorize/token",jsonObject);
|
|
if (StringUtils.isNoneBlank(result)){
|
|
if (StringUtils.isNoneBlank(result)){
|
|
JSONObject object = JSONObject.parseObject(result);
|
|
JSONObject object = JSONObject.parseObject(result);
|
|
if (object.getString("code").equalsIgnoreCase("10000")){
|
|
if (object.getString("code").equalsIgnoreCase("10000")){
|
|
@ -181,21 +184,22 @@ public class HcyyService {
|
|
* @return
|
|
* @return
|
|
* @throws Exception
|
|
* @throws Exception
|
|
*/
|
|
*/
|
|
public String getQRCode(){
|
|
|
|
|
|
public String getQRCode(String ip){
|
|
try {
|
|
try {
|
|
String token = token();
|
|
String token = token();
|
|
String clientId = "";
|
|
|
|
|
|
String clientId = ip;
|
|
String businessSerialNo = UUID.randomUUID().toString();
|
|
String businessSerialNo = UUID.randomUUID().toString();
|
|
JSONObject jsonObject = new JSONObject();
|
|
|
|
|
|
/* JSONObject jsonObject = new JSONObject();
|
|
jsonObject.put("token",token);
|
|
jsonObject.put("token",token);
|
|
JSONObject data = new JSONObject();
|
|
JSONObject data = new JSONObject();
|
|
data.put("clientId",clientId);
|
|
data.put("clientId",clientId);
|
|
data.put("userType","1");
|
|
data.put("userType","1");
|
|
jsonObject.put("data",data);
|
|
|
|
|
|
jsonObject.put("data",data.toJSONString());
|
|
jsonObject.put("businessSerialNo",businessSerialNo);
|
|
jsonObject.put("businessSerialNo",businessSerialNo);
|
|
jsonObject.put("accessMode",0);
|
|
|
|
|
|
data.put("accessMode","1");*/
|
|
|
|
String jsonObject ="{\\\"token\\\": \\\""+token+"\\\", \\\"data\\\": \\\"{\\\\\\\"clientId\\\\\\\": \\\\\\\""+clientId+"\\\\\\\",\\\\\\\"userType\\\\\\\": \\\\\\\"1\\\\\\\"}\\\",\\\"businessSerialNo\\\": \\\"" + businessSerialNo + "\\\",\\\"accessMode\\\": \\\"1\\\"}";
|
|
String result = null;
|
|
String result = null;
|
|
result = XMCA_DCS_UnifiedInterface("获取登录小程序码接口","authorize/wxacode",jsonObject.toJSONString());
|
|
|
|
|
|
result = XMCA_DCS_UnifiedInterface("获取登录小程序码接口","authorize/wxacode",jsonObject);
|
|
JSONObject rs = new JSONObject();
|
|
JSONObject rs = new JSONObject();
|
|
JSONObject dataRes = new JSONObject();
|
|
JSONObject dataRes = new JSONObject();
|
|
if (StringUtils.isNoneBlank(result)){
|
|
if (StringUtils.isNoneBlank(result)){
|
|
@ -229,22 +233,22 @@ public class HcyyService {
|
|
* @param qrCode
|
|
* @param qrCode
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
public JSONObject getTokeninfo(String qrCode){
|
|
|
|
|
|
public JSONObject getTokeninfo(String qrCode,String ip){
|
|
try {
|
|
try {
|
|
String token = token();
|
|
String token = token();
|
|
String clientId = "";
|
|
|
|
JSONObject jsonObject = new JSONObject();
|
|
|
|
jsonObject.put("token",token);
|
|
|
|
jsonObject.put("clientId",clientId);
|
|
|
|
jsonObject.put("businessSerialNo",qrCode);
|
|
|
|
String result = XMCA_DCS_UnifiedInterface("获取授权登录状态信息","authorize/getNoticeData",jsonObject.toJSONString());
|
|
|
|
|
|
String clientId = ip;
|
|
|
|
String jsonObject ="{\\\"token\\\": \\\""+token+"\\\",\\\"clientId\\\": \\\""+clientId+"\\\",\\\"businessSerialNo\\\": \\\""+qrCode+"\\\"}";
|
|
|
|
String result = XMCA_DCS_UnifiedInterface("获取授权登录状态信息","authorize/getNoticeData",jsonObject);
|
|
JSONObject object = JSONObject.parseObject(result);
|
|
JSONObject object = JSONObject.parseObject(result);
|
|
if (object.getString("code").equalsIgnoreCase("10000")){
|
|
if (object.getString("code").equalsIgnoreCase("10000")){
|
|
JSONObject data = object.getJSONObject("data");
|
|
|
|
String idCard = data.getString("idCard");
|
|
|
|
String key = (MD5.md5Hex(DateUtil.getDateShort(new Date())+"XMCASZYQ")).substring(5,21);
|
|
|
|
String idcard = AesEncryptUtils.decrypt(idCard,key);
|
|
|
|
data.put("idcard",idcard);
|
|
|
|
|
|
if (StringUtils.isNoneBlank(object.getString("data"))){
|
|
|
|
JSONObject data = object.getJSONObject("data");
|
|
|
|
String idCard = data.getString("idCard");
|
|
|
|
String key = MD5.md5Hex(DateUtil.getStringDateShort()+"XMCASZYQ").substring(5,21).toUpperCase();
|
|
|
|
logger.info("===key===="+key);
|
|
|
|
String idcard = AesUtilsByDigitalCloudSign.decrypt(idCard,key);
|
|
|
|
data.put("idcard",idcard);
|
|
|
|
}
|
|
}
|
|
}
|
|
return object;
|
|
return object;
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|