16进制错误码改成10进制
This commit is contained in:
parent
4ad5250026
commit
7fe4118083
@ -300,9 +300,6 @@ public class SydApiBaseFunction implements SydApi {
|
||||
@Override
|
||||
public byte[] SYD_SM4_ShortData(int iKeyIndex, byte[] pcData, int iFlag) {
|
||||
|
||||
if (iKeyIndex < 0) {
|
||||
throw new SydApiException(0x01000001);
|
||||
}
|
||||
if ( log.isDebugEnabled() ) {
|
||||
log.debug("SYD_SM4_ShortData方法接收参数:iKeyIndex:{},pcData:{},iFlag:{}", iKeyIndex, Arrays.toString(pcData), iFlag);
|
||||
}
|
||||
@ -351,6 +348,10 @@ public class SydApiBaseFunction implements SydApi {
|
||||
log.error("HA 重试");
|
||||
continue;
|
||||
}
|
||||
SydApiException exception = dealException(e);
|
||||
if(exception != null){
|
||||
throw exception;
|
||||
}
|
||||
throw e;
|
||||
}
|
||||
} else {
|
||||
@ -375,6 +376,10 @@ public class SydApiBaseFunction implements SydApi {
|
||||
log.error("HA 重试");
|
||||
continue;
|
||||
}
|
||||
SydApiException exception = dealException(e);
|
||||
if(exception != null){
|
||||
throw exception;
|
||||
}
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
@ -426,9 +431,6 @@ public class SydApiBaseFunction implements SydApi {
|
||||
String[] keys = new String[iKeyIndex.length];
|
||||
updateLastUseTime();
|
||||
for (int i = 0; i < iKeyIndex.length; i++) {
|
||||
if (iKeyIndex[i] < 0) {
|
||||
throw new SydApiException(0x01000001);
|
||||
}
|
||||
keys[i] = "SK" + SYMUtil.genPrivateKeyMark("000000", "00A", String.format("%08d", iKeyIndex[i]));
|
||||
}
|
||||
|
||||
@ -451,6 +453,10 @@ public class SydApiBaseFunction implements SydApi {
|
||||
log.error("HA 重试");
|
||||
continue;
|
||||
}
|
||||
SydApiException exception = dealException(e);
|
||||
if(exception != null){
|
||||
throw exception;
|
||||
}
|
||||
throw e;
|
||||
}
|
||||
} else {
|
||||
@ -468,6 +474,10 @@ public class SydApiBaseFunction implements SydApi {
|
||||
log.error("HA 重试");
|
||||
continue;
|
||||
}
|
||||
SydApiException exception = dealException(e);
|
||||
if(exception != null){
|
||||
throw exception;
|
||||
}
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
@ -486,10 +496,6 @@ public class SydApiBaseFunction implements SydApi {
|
||||
log.debug("SYD_SM4_LongData方法接收参数:iKeyIndex:{},pcData:{},iPkgNum:{},iFlag:{}", iKeyIndex, Arrays.toString(pcData), iPkgNum, iFlag);
|
||||
}
|
||||
|
||||
if (iKeyIndex < 0) {
|
||||
throw new SydApiException(0x01000001);
|
||||
}
|
||||
|
||||
if(iFlag != Consts.ECB_ENC && iFlag != Consts.ECB_DEC){
|
||||
throw new SydApiException("加解密标识错误", 0x01000001);
|
||||
}
|
||||
@ -537,6 +543,10 @@ public class SydApiBaseFunction implements SydApi {
|
||||
log.error("HA 重试");
|
||||
continue;
|
||||
}
|
||||
SydApiException exception = dealException(e);
|
||||
if(exception != null){
|
||||
throw exception;
|
||||
}
|
||||
throw e;
|
||||
}
|
||||
} else {
|
||||
@ -564,6 +574,10 @@ public class SydApiBaseFunction implements SydApi {
|
||||
log.error("HA 重试");
|
||||
continue;
|
||||
}
|
||||
SydApiException exception = dealException(e);
|
||||
if(exception != null){
|
||||
throw exception;
|
||||
}
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
@ -630,6 +644,10 @@ public class SydApiBaseFunction implements SydApi {
|
||||
log.error("HA 重试");
|
||||
continue;
|
||||
}
|
||||
SydApiException exception = dealException(e);
|
||||
if(exception != null){
|
||||
throw exception;
|
||||
}
|
||||
throw e;
|
||||
}
|
||||
} else {
|
||||
@ -651,6 +669,10 @@ public class SydApiBaseFunction implements SydApi {
|
||||
log.error("HA 重试");
|
||||
continue;
|
||||
}
|
||||
SydApiException exception = dealException(e);
|
||||
if(exception != null){
|
||||
throw exception;
|
||||
}
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
@ -723,6 +745,10 @@ public class SydApiBaseFunction implements SydApi {
|
||||
log.error("HA 重试");
|
||||
continue;
|
||||
}
|
||||
SydApiException exception = dealException(e);
|
||||
if(exception != null){
|
||||
throw exception;
|
||||
}
|
||||
throw e;
|
||||
}
|
||||
} else {
|
||||
@ -752,6 +778,10 @@ public class SydApiBaseFunction implements SydApi {
|
||||
log.error("HA 重试");
|
||||
continue;
|
||||
}
|
||||
SydApiException exception = dealException(e);
|
||||
if(exception != null){
|
||||
throw exception;
|
||||
}
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
@ -821,6 +851,10 @@ public class SydApiBaseFunction implements SydApi {
|
||||
log.error("HA 重试");
|
||||
continue;
|
||||
}
|
||||
SydApiException exception = dealException(e);
|
||||
if(exception != null){
|
||||
throw exception;
|
||||
}
|
||||
throw e;
|
||||
}
|
||||
} else {
|
||||
@ -835,6 +869,10 @@ public class SydApiBaseFunction implements SydApi {
|
||||
log.error("HA 重试");
|
||||
continue;
|
||||
}
|
||||
SydApiException exception = dealException(e);
|
||||
if(exception != null){
|
||||
throw exception;
|
||||
}
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
@ -1252,9 +1290,6 @@ public class SydApiBaseFunction implements SydApi {
|
||||
String[] keys = new String[iKeyIndex.length];
|
||||
updateLastUseTime();
|
||||
for (int i = 0; i < iKeyIndex.length; i++) {
|
||||
if (iKeyIndex[i] < 0) {
|
||||
throw new SydApiException(0x01000001);
|
||||
}
|
||||
keys[i] = "SK" + SYMUtil.genPrivateKeyMark("000000", "00A", String.format("%08d", iKeyIndex[i]));
|
||||
}
|
||||
SydApiException le = new SydApiException(-1);
|
||||
@ -1280,6 +1315,10 @@ public class SydApiBaseFunction implements SydApi {
|
||||
log.error("HA 重试");
|
||||
continue;
|
||||
}
|
||||
SydApiException exception = dealException(e);
|
||||
if(exception != null){
|
||||
throw exception;
|
||||
}
|
||||
throw e;
|
||||
}
|
||||
} else {
|
||||
@ -1301,6 +1340,10 @@ public class SydApiBaseFunction implements SydApi {
|
||||
log.error("HA 重试");
|
||||
continue;
|
||||
}
|
||||
SydApiException exception = dealException(e);
|
||||
if(exception != null){
|
||||
throw exception;
|
||||
}
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
@ -1437,4 +1480,20 @@ public class SydApiBaseFunction implements SydApi {
|
||||
protected void finalize() throws Throwable {
|
||||
this.SYD_Disconnect_Ex();
|
||||
}
|
||||
|
||||
//底层jar返回的错误吗和文档对不上,修改下
|
||||
private SydApiException dealException(SydApiException e){
|
||||
SydApiException exception = null;
|
||||
switch (e.getRetCode()){
|
||||
case 21:
|
||||
exception = new SydApiException(0x21);
|
||||
break;
|
||||
case 44:
|
||||
exception = new SydApiException(0x44);
|
||||
break;
|
||||
}
|
||||
|
||||
return exception;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user