Prechádzať zdrojové kódy

Merge branch 'dev' of huangwenjie/patient-co-management into dev

huangwenjie 7 rokov pred
rodič
commit
090b573e85

+ 5 - 0
patient-co-service/wlyy_service/pom.xml

@ -189,6 +189,11 @@
            <artifactId>commons-discovery</artifactId>
            <version>0.5</version>
        </dependency>
        <dependency>
            <groupId>org.assertj</groupId>
            <artifactId>assertj-core</artifactId>
            <version>2.5.0</version>
        </dependency>
        <!-- 智业接口引用 END -->
    </dependencies>

+ 3 - 4
patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/common/SystemConfig.java

@ -69,10 +69,9 @@ public class SystemConfig {
        return  getSystemProperties().getProperty("gateway_licence");
    }
    public String getPublicKey()
    {
        return  getSystemProperties().getProperty("gateway_public_key");
    }
    public String getPublicKey() { return  getSystemProperties().getProperty("gateway_public_key"); }
    
    public String getImmPublicKey() { return  getSystemProperties().getProperty("imm_public_key"); }
    public String getJwHospital()
    {

+ 14 - 1
patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/service/ZysoftApi.java

@ -23,7 +23,20 @@ public class ZysoftApi extends AbstractApiExecuter {
    private static byte[]  publicKey;
    private static byte[]  zkzlPublicKey;
    private static byte[]  zkzlPrivateKey;
    private static byte[]  immPublicKey;
    
    
    /**
     * 获取计免预约参数加密的公钥
     */
    private static byte[]  getImmPublicKey() throws Exception{
    
        if(immPublicKey == null){
            publicKey =  sehrCrypto.sehrCrypto.ReadFileBytes(ZysoftApi.class.getClassLoader().getResource(SystemConfig.getInstance().getPublicKey()).toURI().getPath());
        }
        return immPublicKey;
    }
    
    /**
     * 智业公钥
     */

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

@ -3,6 +3,7 @@ package com.yihu.wlyy.service.service.guahao;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.serializer.SerializerFeature;
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.util.DateUtil;
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.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.util.*;
@ -1179,7 +1184,7 @@ public class GuahaoService {
        
        int times = 0;
        try {
            re = ZysoftApi.getSingleton().post("imm/"+apistr, params, null,false);
            re = api.post("imm/"+apistr, params, null,false);
    
            //---结果验证,并保存日志 ---START
            if (StringUtils.isEmpty(re)) {
@ -1291,10 +1296,37 @@ public class GuahaoService {
        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();
    
        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);
        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 机构编码

BIN
patient-co-service/wlyy_service/src/main/resources/ImmPublicTest.key


+ 18 - 16
patient-co-service/wlyy_service/src/main/resources/system.properties

@ -1,20 +1,22 @@
###基卫测试环境服务
#gateway_url = http://117.25.173.18:18280/
#gateway_licence = 5YGl5bq45LmL7Lev
#gateway_public_key = PublicKeyTest.key
#jw_hospital = 350211B1013
#jw_licence = 5YGl5bq45LmL7Lev
#ca_url = http://117.29.183.114:8081/XMCAService?wsdl
#ca_namespace = http://platfomservice.xmca.com/
gateway_url = http://117.25.173.18:18280/
gateway_licence = 5YGl5bq45LmL7Lev
gateway_public_key = PublicKeyTest.key
imm_public_key=ImmPublicTest.key
jw_hospital = 350211B1013
jw_licence = 5YGl5bq45LmL7Lev
ca_url = http://117.29.183.114:8081/XMCAService?wsdl
ca_namespace = http://platfomservice.xmca.com/
##基卫服务
guahao_url =  http://10.95.18.10/urp.service/urp.open.service/ReservationPulic.asmx
guahao_namespace = http://www.zysoft.com.cn/
gateway_url = http://10.95.21.21:18280/
gateway_licence = 5YGl5bq45LmL7Lev
gateway_public_key = PublicGov.key
jw_hospital = 350211B1004
jw_licence = 5YGl5bq35LmL6LevMzUwMjExQjEwMDQ=
ca_url = http://10.95.21.21:18280/base/XMCA6_UnifiedCallInterface
ca_namespace = http://platfomservice.xmca.com/
#guahao_url =  http://10.95.18.10/urp.service/urp.open.service/ReservationPulic.asmx
#guahao_namespace = http://www.zysoft.com.cn/
#gateway_url = http://10.95.21.21:18280/
#gateway_licence = 5YGl5bq45LmL7Lev
#gateway_public_key = PublicGov.key
#imm_public_key=ImmPublic.key
#jw_hospital = 350211B1004
#jw_licence = 5YGl5bq35LmL6LevMzUwMjExQjEwMDQ=
#ca_url = http://10.95.21.21:18280/base/XMCA6_UnifiedCallInterface
#ca_namespace = http://platfomservice.xmca.com/

+ 1 - 5
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/imm/ChildFamilyImmuneService.java

@ -45,11 +45,7 @@ public class ChildFamilyImmuneService extends BaseService {
	public void addFamilyMembers(ChildInfo childInfo, String uid, String idcard, String ssc,Integer relation) throws Exception {
		
		ChildFamilyImmune childFamilyImmune = new ChildFamilyImmune();
		if(childInfo.getId() == null
				|| StringUtils.isBlank(childInfo.getIdcard())
					|| StringUtils.isBlank(childInfo.getSsc())){
			childInfo.setIdcard(idcard);
			childInfo.setSsc(ssc);
		if(childInfo.getId() == null){
			childInfoDao.save(childInfo);
		}else{
			childFamilyImmune = childFamilyImmuneDao.findByfaAndChildCodeAndFamilyCode(childInfo.getCode(),uid);

+ 2 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/family/FamilyMemberController.java

@ -494,11 +494,11 @@ public class FamilyMemberController extends WeixinBaseController {
    
            ChildInfo childInfo  = childInfoService.getByBarCode(barCode);
            
            if(!idcard.equals(childInfo.getIdcard()) && StringUtils.isNotBlank(childInfo.getIdcard())){
            if(StringUtils.isNotBlank(idcard) && !idcard.equals(childInfo.getIdcard()) && StringUtils.isNotBlank(childInfo.getIdcard())){
                return error(-1, "输入的新生儿身份证信息不一致,无法绑定");
            }
    
            if(!ssc.equals(childInfo.getSsc()) && StringUtils.isNotBlank(childInfo.getSsc())){
            if(StringUtils.isNotBlank(ssc)&& !ssc.equals(childInfo.getSsc()) && StringUtils.isNotBlank(childInfo.getSsc())){
                return error(-1, "输入的新生儿社保卡不一致,无法绑定");
            }