|
@ -3,6 +3,7 @@ package com.yihu.wlyy.service.service.guahao;
|
|
import com.alibaba.fastjson.JSON;
|
|
import com.alibaba.fastjson.JSON;
|
|
import com.alibaba.fastjson.serializer.SerializerFeature;
|
|
import com.alibaba.fastjson.serializer.SerializerFeature;
|
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
|
|
import com.yihu.wlyy.service.common.SystemConfig;
|
|
import com.yihu.wlyy.service.common.http.HttpApiException;
|
|
import com.yihu.wlyy.service.common.http.HttpApiException;
|
|
import com.yihu.wlyy.service.common.util.DateUtil;
|
|
import com.yihu.wlyy.service.common.util.DateUtil;
|
|
import com.yihu.wlyy.service.common.util.SOAPUtil;
|
|
import com.yihu.wlyy.service.common.util.SOAPUtil;
|
|
@ -24,8 +25,12 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.io.PrintWriter;
|
|
|
|
import java.io.StringWriter;
|
|
|
|
|
|
import javax.crypto.Cipher;
|
|
|
|
import java.io.*;
|
|
|
|
import java.security.PublicKey;
|
|
|
|
import java.security.interfaces.RSAPublicKey;
|
|
|
|
import java.security.spec.X509EncodedKeySpec;
|
|
|
|
import java.security.KeyFactory;
|
|
import java.text.SimpleDateFormat;
|
|
import java.text.SimpleDateFormat;
|
|
import java.util.*;
|
|
import java.util.*;
|
|
|
|
|
|
@ -1179,7 +1184,7 @@ public class GuahaoService {
|
|
|
|
|
|
int times = 0;
|
|
int times = 0;
|
|
try {
|
|
try {
|
|
re = ZysoftApi.getSingleton().post("imm/"+apistr, params, null,false);
|
|
|
|
|
|
re = api.post("imm/"+apistr, params, null,false);
|
|
|
|
|
|
//---结果验证,并保存日志 ---START
|
|
//---结果验证,并保存日志 ---START
|
|
if (StringUtils.isEmpty(re)) {
|
|
if (StringUtils.isEmpty(re)) {
|
|
@ -1291,10 +1296,37 @@ public class GuahaoService {
|
|
String result = "";
|
|
String result = "";
|
|
Map<String,String> params = new HashMap<>();
|
|
Map<String,String> params = new HashMap<>();
|
|
String condition = "<root><zone>350203</zone><zone>350206</zone><zone>350205</zone><zone>350211</zone><zone>350212</zone><zone>350213</zone></root>";
|
|
String condition = "<root><zone>350203</zone><zone>350206</zone><zone>350205</zone><zone>350211</zone><zone>350212</zone><zone>350213</zone></root>";
|
|
|
|
|
|
|
|
ZysoftApi api = ZysoftApi.getSingleton();
|
|
|
|
|
|
|
|
Cipher cipher = Cipher.getInstance("RSA");
|
|
|
|
RSAPublicKey pubKey = (RSAPublicKey) this.immPublicKeyget(SystemConfig.getInstance().getImmPublicKey());
|
|
|
|
|
|
|
|
cipher.init(Cipher.ENCRYPT_MODE, pubKey);
|
|
|
|
byte[] cipherText = cipher.doFinal(condition.getBytes());
|
|
|
|
condition = new String(cipherText);
|
|
|
|
|
|
|
|
//加密后的东西
|
|
|
|
System.out.println("Condition: " + condition);
|
|
|
|
|
|
params.put("Condition", condition);
|
|
params.put("Condition", condition);
|
|
return immPostSecond("GetOrgImmuneList","计免预约-获取免疫接种机构列表",params);
|
|
return immPostSecond("GetOrgImmuneList","计免预约-获取免疫接种机构列表",params);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public PublicKey immPublicKeyget(String filename) throws Exception {
|
|
|
|
File f = new File(filename);
|
|
|
|
FileInputStream fis = new FileInputStream(f);
|
|
|
|
DataInputStream dis = new DataInputStream(fis);
|
|
|
|
byte[] keyBytes = new byte[(int)f.length()];
|
|
|
|
dis.readFully(keyBytes);
|
|
|
|
dis.close();
|
|
|
|
X509EncodedKeySpec spec = new X509EncodedKeySpec(keyBytes);
|
|
|
|
KeyFactory kf = KeyFactory.getInstance("RSA");
|
|
|
|
return kf.generatePublic(spec);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
* 获取免疫接种号源
|
|
* 获取免疫接种号源
|
|
* @param orgId 机构编码
|
|
* @param orgId 机构编码
|