yeshijie 7 lat temu
rodzic
commit
7dcf896f9b

+ 8 - 4
patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/service/ZysoftBaseService.java

@ -50,6 +50,10 @@ public class ZysoftBaseService {
    private String internet;
    @Value("${zysoftApi.base}")
    private String base;
    @Value("${zysoftApi.imm}")
    private String imm;
    @Value("${zyapi.openCrypto}")
    private Boolean openCrypto;
    public String getCode() {
        return UUID.randomUUID().toString().replaceAll("-", "");
@ -146,13 +150,13 @@ public class ZysoftBaseService {
        int times = 0;
        try {
            re = ZysoftApi.getSingleton().get(baseApi, paramsList, null,true);
            re = ZysoftApi.getSingleton().get(baseApi, paramsList, null,openCrypto);
            if(needRetry)
            {
                while(retryTimes>0 && re.contains("接口调用传入的参数[msgHeader]格式不正确"))    //基卫bug预防,重调接口
                {
                    re = ZysoftApi.getSingleton().post(baseApi, paramsList, null,true);
                    re = ZysoftApi.getSingleton().post(baseApi, paramsList, null,openCrypto);
                    retryTimes --;
                    times++;
                }
@ -221,13 +225,13 @@ public class ZysoftBaseService {
        int times = 0;
        try {
            re = ZysoftApi.getSingleton().post(baseApi, paramsList, null,true);
            re = ZysoftApi.getSingleton().post(baseApi, paramsList, null,openCrypto);
            if(needRetry)
            {
                int maxTimes = retryTimes;
                while(maxTimes>0 && re.contains("接口调用传入的参数[msgHeader]格式不正确"))    //基卫bug预防,重调接口
                {
                    re = ZysoftApi.getSingleton().post(baseApi, paramsList, null,true);
                    re = ZysoftApi.getSingleton().post(baseApi, paramsList, null,openCrypto);
                    maxTimes --;
                    times++;
                }

+ 8 - 6
patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/service/ZysoftService.java

@ -9,6 +9,7 @@ import com.yihu.wlyy.service.entity.DoctorMapping;
import com.zoe.phip.ssp.sdk.ApiException;
import net.sf.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import java.io.PrintWriter;
@ -29,7 +30,8 @@ public class ZysoftService {
    @Autowired
    private ObjectMapper objectMapper;
    @Value("${zyapi.openCrypto}")
    private Boolean openCrypto;
    //默认重复次数
    private int retryTimes = 3;
@ -58,13 +60,13 @@ public class ZysoftService {
        int times = 0;
        try {
            re = ZysoftApi.getSingleton().get("base/CallEhrInterface", paramsList, null,true);
            re = ZysoftApi.getSingleton().get("base/CallEhrInterface", paramsList, null,openCrypto);
            if(needRetry)
            {
                while(retryTimes>0 && re.contains("接口调用传入的参数[msgHeader]格式不正确"))    //基卫bug预防,重调接口
                {
                    re = ZysoftApi.getSingleton().post("base/CallEhrInterface", paramsList, null,true);
                    re = ZysoftApi.getSingleton().post("base/CallEhrInterface", paramsList, null,openCrypto);
                    retryTimes --;
                    times++;
                }
@ -130,13 +132,13 @@ public class ZysoftService {
        int times = 0;
        try {
            re = ZysoftApi.getSingleton().post("base/CallEhrInterface", paramsList, null,true);
            re = ZysoftApi.getSingleton().post("base/CallEhrInterface", paramsList, null,openCrypto);
            if(needRetry)
            {
                int maxTimes = retryTimes;
                while(maxTimes>0 && re.contains("接口调用传入的参数[msgHeader]格式不正确"))    //基卫bug预防,重调接口
                {
                    re = ZysoftApi.getSingleton().post("base/CallEhrInterface", paramsList, null,true);
                    re = ZysoftApi.getSingleton().post("base/CallEhrInterface", paramsList, null,openCrypto);
                    maxTimes --;
                    times++;
                }
@ -200,7 +202,7 @@ public class ZysoftService {
        String error = "";
        try {
            re = ZysoftApi.getSingleton().post("base/CallEhrInterface", paramsList, null,true);
            re = ZysoftApi.getSingleton().post("base/CallEhrInterface", paramsList, null,openCrypto);
            Map<String,String> map = objectMapper.readValue(re,Map.class);
            String code = map.get("CODE");