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