易捷云对接代码初始化230719
This commit is contained in:
parent
96a8651c84
commit
2683f94c44
@ -5,7 +5,7 @@
|
||||
type="javax.sql.DataSource" maxActive="30" maxIdle="2" maxWait="10000"
|
||||
username="apzl" password="apzl@2018"
|
||||
driverClassName="com.mysql.jdbc.Driver"
|
||||
url="jdbc:mysql://47.93.34.101:3306/apzl?rewriteBatchedStatements=true&useUnicode=true&characterEncoding=GBK&autoReconnectForPools=true&autoReconnect=true&useSSL=false" />
|
||||
url="jdbc:mysql://47.93.34.101:10323/apzl?rewriteBatchedStatements=true&useUnicode=true&characterEncoding=GBK&autoReconnectForPools=true&autoReconnect=true&useSSL=false" />
|
||||
<!-- 18测试环境 -->
|
||||
<!-- <Resource name="jdbc/als" auth="Container" type="javax.sql.DataSource"
|
||||
maxActive="30" maxIdle="2" maxWait="10000" username="apzl" password="apzl@2018"
|
||||
|
||||
@ -56,7 +56,7 @@
|
||||
reloadSelf();
|
||||
}else{
|
||||
alert(result);
|
||||
reloadSelf();
|
||||
reloadSelf();
|
||||
}
|
||||
}
|
||||
function viewAndEdit(){
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
org.quartz.dataSource.zhulhDS.URL=jdbc:mysql://47.93.34.101:3306/apzl?rewriteBatchedStatements=true&useUnicode=true&characterEncoding=GBK&autoReconnectForPools=true&autoReconnect=true&useSSL=false
|
||||
org.quartz.dataSource.zhulhDS.URL=jdbc:mysql://47.93.34.101:10323/apzl?rewriteBatchedStatements=true&useUnicode=true&characterEncoding=GBK&autoReconnectForPools=true&autoReconnect=true&useSSL=false
|
||||
org.quartz.dataSource.zhulhDS.user=338A48E135315FDBC2DF24EB080903D7
|
||||
org.quartz.dataSource.zhulhDS.key=431DC9744DEF477868F97C4842F87AB3
|
||||
org.quartz.dataSource.zhulhDS.driver=com.mysql.jdbc.Driver
|
||||
|
||||
@ -40,10 +40,10 @@ public abstract class BasicWebAction implements WebAction {
|
||||
|
||||
public static String describe(int flag){
|
||||
switch(flag){
|
||||
case WEB_ACTION_成功:
|
||||
return ACTION_DESC_成功;
|
||||
case WEB_ACTION_suc:
|
||||
return ACTION_DESC_suc;
|
||||
default:
|
||||
return ACTION_DESC_失败;
|
||||
return ACTION_DESC_fail;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -33,7 +33,7 @@ public class UndefinedPolicyAction implements WebAction {
|
||||
*/
|
||||
public int execute(JBOTransaction tx) throws SADREException {
|
||||
// throw new UnsupportedOperationException(this.getClass().getName()+"未定义授权方案不支持执行execute(Transaction)");
|
||||
return WEB_ACTION_ʧ°Ü;
|
||||
return WEB_ACTION_fail;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -26,12 +26,12 @@ import com.amarsoft.are.jbo.JBOTransaction;
|
||||
* logs: 1.
|
||||
*/
|
||||
public interface WebAction {
|
||||
public static final int WEB_ACTION_成功 = 1;
|
||||
public static final int WEB_ACTION_失败 = 0;
|
||||
public static final int WEB_ACTION_未知 = -1;
|
||||
public static final int WEB_ACTION_suc = 1;
|
||||
public static final int WEB_ACTION_fail = 0;
|
||||
public static final int WEB_ACTION_un = -1;
|
||||
|
||||
public static final String ACTION_DESC_成功 = "SUCCESSFUL";
|
||||
public static final String ACTION_DESC_失败 = "FAILED";
|
||||
public static final String ACTION_DESC_suc = "SUCCESSFUL";
|
||||
public static final String ACTION_DESC_fail = "FAILED";
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@ -140,7 +140,7 @@ public class IdentityAlphaVerification {
|
||||
* @return
|
||||
*/
|
||||
public String doIdentityVerification(JBOTransaction tx){
|
||||
String res = null;
|
||||
String res = "";
|
||||
logger.info("IdentityAlphaVerificationDoIdentityVerification --begin--" + UserName+"@"+OrgName+"@"+FlowUnid);
|
||||
try {
|
||||
// TODO: 2023-7-4 整理参数
|
||||
@ -153,15 +153,15 @@ public class IdentityAlphaVerification {
|
||||
// TODO: 2023-7-4 循环参数
|
||||
for(int i=0; i < fullNamesArr.length; i++){
|
||||
logger.info("IdentityAlphaVerificationDoIdentityVerification --【info】--begin-foreach:"+fullNamesArr[i]);
|
||||
// TODO: 2023-7-5 判断是否已实名校验过
|
||||
// TODO: 2023-7-5 判断是否已身份校验过
|
||||
BizObjectManager bom4 = JBOFactory.getBizObjectManager(LC_IDENTITY_CHECK_RESULT_TEMP.CLASS_NAME,tx);
|
||||
BizObject queryResult = bom4.createQuery("select result from O where flowunid=:FLOWUNID and name = '"+fullNamesArr[i]+"'").setParameter("FLOWUNID",FlowUnid).getSingleResult(false);
|
||||
if(null != queryResult){
|
||||
logger.info("IdentityAlphaVerificationDoIdentityVerification --【info】--已实名校验过:"+fullNamesArr[i]);
|
||||
logger.info("IdentityAlphaVerificationDoIdentityVerification --【info】--已身份校验过:"+fullNamesArr[i]);
|
||||
if(i == fullNamesArr.length-1){
|
||||
res += fullNamesArr[i]+ "实名校验成功";
|
||||
res += fullNamesArr[i]+ ":身份校验成功";
|
||||
}else {
|
||||
res += fullNamesArr[i]+ "实名校验成功@";
|
||||
res += fullNamesArr[i]+ ":身份校验成功\n";
|
||||
}
|
||||
continue;
|
||||
}
|
||||
@ -171,12 +171,18 @@ public class IdentityAlphaVerification {
|
||||
// TODO: 2023-7-4 保存结果
|
||||
if(null == httpRes){
|
||||
if(i == fullNamesArr.length-1){
|
||||
res += fullNamesArr[i]+ "易捷云实名校验接口异常,请稍后再试!";
|
||||
res += fullNamesArr[i]+ ":易捷云身份校验接口异常,请稍后再试!";
|
||||
}else {
|
||||
res += fullNamesArr[i]+ "易捷云实名校验接口异常,请稍后再试!@";
|
||||
res += fullNamesArr[i]+ ":易捷云身份校验接口异常,请稍后再试!\n";
|
||||
}
|
||||
logger.info("IdentityAlphaVerificationDoIdentityVerificationError --【info】--易捷云实名校验接口异常,请稍后再试!:"+fullNamesArr[i]);
|
||||
logger.info("IdentityAlphaVerificationDoIdentityVerificationError --【info】--易捷云身份校验接口异常,请稍后再试!:"+fullNamesArr[i]);
|
||||
continue;
|
||||
}else {
|
||||
if(i == fullNamesArr.length-1){
|
||||
res += fullNamesArr[i]+ ":身份校验成功";
|
||||
}else {
|
||||
res += fullNamesArr[i]+ ":身份校验成功\n";
|
||||
}
|
||||
}
|
||||
saveIdentityRes(tx, fullNamesArr[i], certIdsArr[i], httpRes);
|
||||
logger.info("IdentityAlphaVerificationDoIdentityVerification --【info】--end-foreach:"+fullNamesArr[i]);
|
||||
@ -185,7 +191,7 @@ public class IdentityAlphaVerification {
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
logger.error("IdentityAlphaVerificationDoIdentityVerificationError 报错:", e);
|
||||
res = "ERROR";
|
||||
res += "ERROR";
|
||||
}
|
||||
logger.info("IdentityAlphaVerificationDoIdentityVerification --end--" + UserName+"@"+OrgName+"@"+FlowUnid);
|
||||
return res;
|
||||
|
||||
@ -11,19 +11,19 @@ public class Config {
|
||||
public static Map<Integer, String> bizTypeMode = new HashMap<>();
|
||||
|
||||
static {
|
||||
bizTypeMode.put(BizType.X6000, "6000-身份核验");
|
||||
bizTypeMode.put(BizType.X6000, "6000-身份核验");
|
||||
}
|
||||
|
||||
public static class BizType {
|
||||
//调用申请接口
|
||||
//调用申请接口
|
||||
public static final Integer X1000 = 1000;
|
||||
//身份核验
|
||||
//身份核验
|
||||
public static final Integer X6000 = 6000;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 签名工具
|
||||
* 签名工具
|
||||
*/
|
||||
public static SignService signService = new SignService();
|
||||
|
||||
@ -34,7 +34,7 @@ public class Config {
|
||||
|
||||
|
||||
/**
|
||||
* 以下三个为赋码验码过程中的上下文变量
|
||||
* 以下三个为赋码验码过程中的上下文变量
|
||||
*/
|
||||
public static String bsn;
|
||||
public static String randomNumber;
|
||||
@ -46,12 +46,12 @@ public class Config {
|
||||
public static String idExpireDate = "";
|
||||
public static String idIssueDate = "";
|
||||
|
||||
//用户签名私钥
|
||||
//用户签名私钥
|
||||
public static String PRIVATE_KEY = "";
|
||||
|
||||
//平台验签公钥
|
||||
//平台验签公钥
|
||||
public static String PUBLIC_SIGN_KEY = "";
|
||||
//平台加密公钥
|
||||
//平台加密公钥
|
||||
public static String PUBLIC_ENCRYPT_KEY = "";
|
||||
|
||||
//
|
||||
|
||||
@ -22,21 +22,21 @@ public class VerificationConfig {
|
||||
public static class VerificationMode {
|
||||
public static final String X70 = "0x70";
|
||||
public static final String X69 = "0x69";
|
||||
//2项信息(返PID)
|
||||
//2项信息(返PID)
|
||||
public static final String X68 = "0x68";
|
||||
//
|
||||
public static final String X65 = "0x65";
|
||||
//
|
||||
public static final String X66 = "0x66";
|
||||
//4项信息
|
||||
//4项信息
|
||||
public static final String X10 = "0x10";
|
||||
//人像+ 4项信息
|
||||
//人像+ 4项信息
|
||||
public static final String X12 = "0x12";
|
||||
//2项信息
|
||||
//2项信息
|
||||
public static final String X40 = "0x40";
|
||||
//人像+2项信息
|
||||
//人像+2项信息
|
||||
public static final String X42 = "0x42";
|
||||
//4项信息返证件状态
|
||||
//4项信息返证件状态
|
||||
public static final String X18 = "0x18";
|
||||
}
|
||||
}
|
||||
|
||||
@ -24,7 +24,7 @@ public class AESCryptService {
|
||||
try {
|
||||
keyGenerator = KeyGenerator.getInstance(ALGORITHM_KEY);
|
||||
} catch (NoSuchAlgorithmException e) {
|
||||
throw new RuntimeException("没有" + ALGORITHM_KEY + "相关的实现");
|
||||
throw new RuntimeException("没有" + ALGORITHM_KEY + "相关的实现");
|
||||
}
|
||||
keyGenerator.init(AES_KEY_LENGTH, new SecureRandom());
|
||||
}
|
||||
@ -72,7 +72,7 @@ public class AESCryptService {
|
||||
try {
|
||||
cipher.init(mode, key, iv);
|
||||
} catch (InvalidAlgorithmParameterException e) {
|
||||
//正常情况不会出现该异常
|
||||
//正常情况不会出现该异常
|
||||
throw new RuntimeException("un expect algorithm-parameter", e);
|
||||
}
|
||||
return cipher.doFinal(content, start, length);
|
||||
@ -84,7 +84,7 @@ public class AESCryptService {
|
||||
try {
|
||||
cipher = Cipher.getInstance(ALGORITHM_CIPHER);
|
||||
} catch (NoSuchAlgorithmException | NoSuchPaddingException e) {
|
||||
throw new RuntimeException("没有找到'" + ALGORITHM_CIPHER + "'的实现", e);
|
||||
throw new RuntimeException("没有找到'" + ALGORITHM_CIPHER + "'的实现", e);
|
||||
}
|
||||
localCipher.set(cipher);
|
||||
}
|
||||
|
||||
@ -5,14 +5,14 @@ import org.apache.commons.codec.binary.Base64;
|
||||
public class EncodesUtil {
|
||||
|
||||
/**
|
||||
* Base64编码.
|
||||
* Base64±àÂë.
|
||||
*/
|
||||
public static String encodeBase64(byte[] input) {
|
||||
return Base64.encodeBase64String(input);
|
||||
}
|
||||
|
||||
/**
|
||||
* Base64解码.
|
||||
* Base64½âÂë.
|
||||
*/
|
||||
public static byte[] decodeBase64(String input) {
|
||||
return Base64.decodeBase64(input);
|
||||
|
||||
@ -26,7 +26,7 @@ public class HttpUtil {
|
||||
|
||||
// int statusCode = response.getStatusLine().getStatusCode();
|
||||
// if (statusCode != 200) {
|
||||
// throw new RuntimeException("http请求异常" + statusCode);
|
||||
// throw new RuntimeException("httpÇëÇóÒì³£" + statusCode);
|
||||
// }
|
||||
|
||||
return EntityUtils.toString(response.getEntity(), "UTF-8");
|
||||
|
||||
@ -9,11 +9,11 @@ import java.util.Map;
|
||||
public class JSONUtil {
|
||||
|
||||
/**
|
||||
* 将JSON字符串转换为Java对象.
|
||||
* 将JSON字符串转换为Java对象.
|
||||
*
|
||||
* @param jsonStr
|
||||
* @param clazz 目标对象的Class类.
|
||||
* @return Java对象
|
||||
* @param clazz 目标对象的Class类.
|
||||
* @return Java对象
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public static <T> T json2Object(String jsonStr, Class<?> clazz) {
|
||||
@ -25,11 +25,11 @@ public class JSONUtil {
|
||||
}
|
||||
|
||||
/**
|
||||
* 将Java对象转换为json字符串.
|
||||
* 禁用循环引用检测.
|
||||
* 将Java对象转换为json字符串.
|
||||
* 禁用循环引用检测.
|
||||
*
|
||||
* @param obj
|
||||
* @return json字符串.
|
||||
* @return json字符串.
|
||||
*/
|
||||
public static String toJson(Object obj) {
|
||||
try {
|
||||
|
||||
@ -44,9 +44,9 @@ public class SignService {
|
||||
try {
|
||||
enContent = aesService.encrypt(aesKey, iv, plaintext);
|
||||
} catch (IllegalBlockSizeException | BadPaddingException e) {
|
||||
System.out.println("AES加密失败");
|
||||
System.out.println("AES加密失败");
|
||||
} catch (InvalidKeyException e) {
|
||||
System.out.println("AES秘钥不可用");
|
||||
System.out.println("AES秘钥不可用");
|
||||
}
|
||||
|
||||
try {
|
||||
@ -54,7 +54,7 @@ public class SignService {
|
||||
ByteArrayOutputStream bout = new ByteArrayOutputStream();
|
||||
bout.write(aesKey.getEncoded());
|
||||
bout.write(iv.getIV());
|
||||
bout.write(VER); //版本信息,对加解密无任何影响
|
||||
bout.write(VER); //版本信息,对加解密无任何影响
|
||||
byte[] enDes = encryptKey(pubKey, bout.toByteArray());
|
||||
|
||||
//parse
|
||||
@ -63,7 +63,7 @@ public class SignService {
|
||||
bout.write(enContent);
|
||||
return bout.toByteArray();
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException("加密发生错误", e);
|
||||
throw new RuntimeException("加密发生错误", e);
|
||||
}
|
||||
}
|
||||
|
||||
@ -92,7 +92,7 @@ public class SignService {
|
||||
cipher.init(store.getMode(), store.getKey());
|
||||
return cipher;
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException("没有找到" + SYSTEM_CIPHER_ALGORITHM + "的加密算法", e);
|
||||
throw new RuntimeException("没有找到" + SYSTEM_CIPHER_ALGORITHM + "的加密算法", e);
|
||||
}
|
||||
}
|
||||
|
||||
@ -147,7 +147,7 @@ public class SignService {
|
||||
}
|
||||
return signature;
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException("没有找到" + SYSTEM_SIGNATURE_ALGORITHM + "的签名算法", e);
|
||||
throw new RuntimeException("没有找到" + SYSTEM_SIGNATURE_ALGORITHM + "的签名算法", e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user