Przeglądaj źródła

计免预约接口修改

huangwenjie 7 lat temu
rodzic
commit
2b30a30418

+ 18 - 0
patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/common/util/SOAPUtil.java

@ -246,6 +246,24 @@ public class SOAPUtil {
		return new String[] { condition, strCredential, strKey };
	}
	
	/**
	 * 加密计免预约condition
	 * @param condition
	 * @return
	 * @throws UnsupportedEncodingException
	 */
	public static String getImmCondition(String condition) throws UnsupportedEncodingException {
		
		// 对身份证据Compress()压缩
		byte[] pbyteSource = sehrCrypto.sehrCrypto.Compress(condition.getBytes("UTF-16LE"));
		// 采用bKEY对称加密Encrypt()
		byte[] encryptSource = sehrCrypto.sehrCrypto.Encrypt(pbyteSource, bKEY);
		// 再编码EncodeU()
		condition = new String(sehrCrypto.sehrCrypto.EncodeU(encryptSource));
		
		return condition;
	}
}

+ 6 - 9
patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/service/guahao/GuahaoService.java

@ -1304,16 +1304,13 @@ public class GuahaoService {
    public String GetOrgImmuneList()throws Exception  {
        String result = "";
        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>";
        ZysoftApi api = ZysoftApi.getSingleton();
        PublicKey publicKey=immPublicKeyget(api.getImmPublicKey());
        byte[] encryptedBytes = this.encrypt(condition.getBytes(),publicKey);
        condition = new String(encryptedBytes,"utf-8");
        System.out.println(condition);
        params.put("Condition", condition);
        String[] values = SOAPUtil.getCredential("condition", true);
//        System.out.println(condition);
        params.put("Condition", values[0]);
        params.put("Credential", values[1]);
        params.put("Key", values[2]);
        return immPostSecond("GetOrgImmuneList","计免预约-获取免疫接种机构列表",params);
    }