浏览代码

增加人像接口

15810770710@163.com 3 年之前
父节点
当前提交
1563b493c8

+ 47 - 106
pom.xml

@@ -24,7 +24,7 @@
 			<groupId>org.springframework.cloud</groupId>
 		    <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
 		</dependency>
-		
+
 		<dependency>
 			<groupId>org.springframework.boot</groupId>
 			<artifactId>spring-boot-starter-web</artifactId>
@@ -41,19 +41,19 @@
 		</dependency>
 
       <!--链路日志-->
-      <dependency>
-          <groupId>info.aspirecn.rdc</groupId>
-          <artifactId>aspirecloud-commons-sleuthlog-starter</artifactId>
-          <version>5.0.1</version>
-      </dependency>
+          <dependency>
+              <groupId>info.aspirecn.rdc</groupId>
+              <artifactId>aspirecloud-commons-sleuthlog-starter</artifactId>
+              <version>5.0.1</version>
+          </dependency>
+
+          <!--错误日志-->
+          <dependency>
+              <groupId>info.aspirecn.rdc</groupId>
+              <artifactId>aspirecloud-commons-errorlog-starter</artifactId>
+              <version>5.0.2</version>
+          </dependency>
 
-      <!--错误日志-->
-      <dependency>
-          <groupId>info.aspirecn.rdc</groupId>
-          <artifactId>aspirecloud-commons-errorlog-starter</artifactId>
-          <version>5.0.2</version>
-      </dependency>
-		
 		<dependency>
 			<groupId>info.aspirecn.iov.sjjh</groupId>
 			<artifactId>iov-sjjh-servicenode-supplier-10000005-interface</artifactId>
@@ -72,6 +72,32 @@
             <artifactId>fastjson</artifactId>
             <version>1.2.70</version>
         </dependency>
+      <dependency>
+          <groupId>info.aspirecn.iov.sjjh</groupId>
+          <artifactId>iov-sjjh-commons-lang</artifactId>
+          <version>1.0.0</version>
+      </dependency>
+      <dependency>
+          <groupId>io.springfox</groupId>
+          <artifactId>springfox-swagger2</artifactId>
+          <version>2.9.2</version>
+      </dependency>
+
+      <dependency>
+          <groupId>io.springfox</groupId>
+          <artifactId>springfox-swagger-ui</artifactId>
+          <version>2.9.2</version>
+      </dependency>
+      <dependency>
+          <groupId>org.springframework.cloud</groupId>
+          <artifactId>spring-cloud-starter-zipkin</artifactId>
+      </dependency>
+      <dependency>
+          <groupId>org.springframework.cloud</groupId>
+          <artifactId>spring-cloud-starter-openfeign</artifactId>
+          <version>2.2.6.RELEASE</version>
+      </dependency>
+
   </dependencies>
     <dependencyManagement>
         <dependencies>
@@ -89,75 +115,23 @@
             <plugin>
                 <groupId>org.springframework.boot</groupId>
                 <artifactId>spring-boot-maven-plugin</artifactId>
-                <configuration>
-                    <includes>
-                        <include>
-                            <groupId>info.aspirecn.iov.sjjh</groupId>
-                            <artifactId>iov-sjjh-commons-lang</artifactId>
-                        </include>
-                        <include>
-                            <groupId>info.aspirecn.iov.sjjh</groupId>
-                            <artifactId>iov-sjjh-servicenode-supplier-10000005-interface</artifactId>
-                        </include>
-                    </includes>
-                </configuration>
             </plugin>
 
-
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-jar-plugin</artifactId>
-                <configuration>
-                    <archive>
-                        <manifest>
-                            <addClasspath>true</addClasspath>
-                            <classpathPrefix>lib/</classpathPrefix>
-                        </manifest>
-                    </archive>
-                </configuration>
             </plugin>
 
-            <!--   拷贝依赖jar到lib,排除自定义的jar-->
-
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-dependency-plugin</artifactId>
-                <executions>
-                    <execution>
-                        <id>copy-dependencies</id>
-                        <phase>prepare-package</phase>
-                        <goals>
-                            <goal>copy-dependencies</goal>
-                        </goals>
-                        <configuration>
-                            <outputDirectory>${project.build.directory}/lib</outputDirectory>
-                            <excludeGroupIds>
-                                info.aspirecn.iov.sjjh
-                            </excludeGroupIds>
-                        </configuration>
-                    </execution>
-                    <execution>
-                        <id>copy</id>
-                        <phase>install</phase>
-                        <goals>
-                            <goal>copy-dependencies</goal>
-                        </goals>
-                        <configuration>
-                            <outputDirectory>
-                                ${project.build.directory}/lib
-                            </outputDirectory>
-                            <excludeGroupIds>
-                                info.aspirecn.iov.sjjh
-                            </excludeGroupIds>
-                        </configuration>
-                    </execution>
-                </executions>
             </plugin>
 
-			<plugin>
-				<groupId>org.apache.maven.plugins</groupId>
-				<artifactId>maven-resources-plugin</artifactId>
-				<executions>
+
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-resources-plugin</artifactId>
+                <executions>
                     <execution>
                         <id>default-resources</id>
                         <phase>validate</phase>
@@ -172,51 +146,18 @@
                             </delimiters>
                             <resources>
                                 <resource>
-                                    <directory>src/main/resources/config</directory>
-                                    <targetPath>config</targetPath>
-                                    <filtering>true</filtering>
-                                    <includes>
-                                        <include>**</include>
-                                    </includes>
-                                </resource>
-                                <resource>
-                                    <directory>src/main/resources/docker</directory>
-                                    <targetPath>docker</targetPath>
+                                    <directory>src/main/resources</directory>
                                     <filtering>true</filtering>
                                     <includes>
                                         <include>**</include>
                                     </includes>
                                 </resource>
+
                             </resources>
                         </configuration>
                     </execution>
                 </executions>
-			</plugin>
-
-			<plugin>
-				<groupId>com.spotify</groupId>
-				<artifactId>docker-maven-plugin</artifactId>
-				<version>1.2.0</version>
-                <configuration>
-                    <!-- 设置Docker 镜像名称 -->
-                    <imageName>hub.i139.cn/iov-sjjh/${project.artifactId}:${project.version}</imageName>
-                    <!-- 设置Dockerfile存放目录地址 -->
-                    <dockerDirectory>${project.basedir}/src/main/resources/docker</dockerDirectory>
-                    <resources>
-                        <resource>
-                            <targetPath>/</targetPath>
-                            <directory>${project.build.directory}</directory>
-                            <include>${project.build.finalName}.jar</include>
-                        </resource>
-                    </resources>
-                    <!-- 设置和setting.xml中的servers对应的server,里面存放了docker hub仓库的用户名、密码 -->
-                    <serverId>docker-hub</serverId>
-                    <!-- 设置docker hub仓库地址 -->
-                    <registryUrl>https://hub.i139.cn</registryUrl>
-                    <!-- 设置docker remote API地址 -->
-                    <!--<dockerHost>http://docker-in-docker.rdc-plugin:2375</dockerHost>-->
-                </configuration>
-			</plugin>
+            </plugin>
 		</plugins>
 	</build>
 </project>

+ 14 - 0
src/main/java/info/aspirecn/iov/sjjh/shupplier10000005/SjjhConstant.java

@@ -52,4 +52,18 @@ public class SjjhConstant {
     public static final String CTCC_DATA_3 = "3";
     /**电信三要素详版data=4*/
     public static final String CTCC_DATA_4 = "4";
+
+    public static final String DECODE_TYPE_COMMON = "COMMON";
+
+    public static final String DECODE_TYPE_AES = "AES";
+
+    public static final String PARA_ENCODE = "UTF-8";
+
+    public static final String[] PHOTO_CHECK_CHARGE_ARRAY = {"1", "2", "3", "7", "-1", "-3"};
+
+    public static String Charge_Log_Key = "isCharge";
+
+    public static String Charge_Log_ResponseCode = "respnoseCode";
+
+    public static String PHOTO_CHECK_XML = " xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns=\"http://xuanyunxinxi.com/\"";
 }

+ 88 - 0
src/main/java/info/aspirecn/iov/sjjh/shupplier10000005/action/PhotoCheckAction.java

@@ -0,0 +1,88 @@
+package info.aspirecn.iov.sjjh.shupplier10000005.action;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+import info.aspirecn.iov.sjjh.commons.lang.ChannelTypeHandleResponseObject;
+import info.aspirecn.iov.sjjh.commons.lang.Constant;
+import info.aspirecn.iov.sjjh.shupplier10000005.SjjhConstant;
+import info.aspirecn.iov.sjjh.shupplier10000005.service.PhotoIdentityCheckService;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.context.request.RequestContextHolder;
+import org.springframework.web.context.request.ServletRequestAttributes;
+
+import javax.servlet.http.HttpServletRequest;
+
+/**
+ * @author xusonglin
+ * @version V1.0
+ **/
+@Slf4j
+@RestController
+public class PhotoCheckAction implements PhotoCheckActionInterface {
+    /**UTF-8*/
+    private static final String UTF8_ENCODE = "UTF-8";
+    /**日志参数中的错误参数名*/
+    private static final String LOG_ERROR_PARA = "respnoseCode";
+    /**日志参数中的是否收费*/
+    private static final String LOG_FEE_PARA = "isCharge";
+
+    @Autowired
+    private PhotoIdentityCheckService photoIdentityCheckService;
+
+    @Override
+    public ChannelTypeHandleResponseObject photoIdentityCheckAes(
+            @RequestHeader(name = "channelId") String channelId,
+            @RequestParam(name = "outTime", required = true) Integer outTime,
+            @RequestBody String customBody) {
+        HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes())
+                .getRequest();
+
+        //调用service
+        ChannelTypeHandleResponseObject ret;
+        JSONObject jsonObject = JSON.parseObject(customBody);
+        ret = photoIdentityCheckService.photoIdentityCheck(request, customBody, outTime, SjjhConstant.DECODE_TYPE_AES);
+        jsonObject = null;
+
+        //把接口参数、调用结果和是否收费放入访问日志中
+        if (ret.getCode() != Constant.SUCCESS) {
+            request.setAttribute(SjjhConstant.Charge_Log_ResponseCode, Constant.CHANNEL_LOG_ERROR_CODE);
+        } else {
+            request.setAttribute(SjjhConstant.Charge_Log_ResponseCode, Constant.CHANNEL_LOG_SUCCESS_CODE);
+        }
+        request.setAttribute(SjjhConstant.Charge_Log_Key, ret.getIsCharge());
+
+        request.setAttribute(Constant.CHANNEL_TYPE_KEY, Constant.CHANNEL_TYPE_SYNC);
+        return ret;
+    }
+
+    @Override
+    public ChannelTypeHandleResponseObject photoIdentityCheckV2(
+            @RequestHeader(name = "channelId") String channelId,
+            @RequestParam(name = "outTime", required = true) Integer outTime,
+            @RequestBody String customBody) {
+        HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes())
+                .getRequest();
+
+        //调用service
+        ChannelTypeHandleResponseObject ret;
+        JSONObject jsonObject = JSON.parseObject(customBody);
+        ret = photoIdentityCheckService.photoIdentityCheckV2(request, customBody, outTime, SjjhConstant.DECODE_TYPE_AES);
+        jsonObject = null;
+
+        //把接口参数、调用结果和是否收费放入访问日志中
+        if (ret.getCode() != Constant.SUCCESS) {
+            request.setAttribute(SjjhConstant.Charge_Log_ResponseCode, Constant.CHANNEL_LOG_ERROR_CODE);
+        } else {
+            request.setAttribute(SjjhConstant.Charge_Log_ResponseCode, Constant.CHANNEL_LOG_SUCCESS_CODE);
+        }
+        request.setAttribute(SjjhConstant.Charge_Log_Key, ret.getIsCharge());
+
+        request.setAttribute(Constant.CHANNEL_TYPE_KEY, Constant.CHANNEL_TYPE_SYNC);
+        return ret;
+    }
+
+}

+ 29 - 0
src/main/java/info/aspirecn/iov/sjjh/shupplier10000005/service/PhotoIdentityCheckService.java

@@ -0,0 +1,29 @@
+package info.aspirecn.iov.sjjh.shupplier10000005.service;
+
+import info.aspirecn.iov.sjjh.commons.lang.ChannelTypeHandleResponseObject;
+
+import javax.servlet.http.HttpServletRequest;
+
+/**
+ * @author xusonglin
+ * @version V1.0
+ **/
+public interface PhotoIdentityCheckService {
+    /**
+     * 三川木-人像
+     * @param request
+     * @param customBody
+     * @param outTime
+     * @return
+     */
+    ChannelTypeHandleResponseObject photoIdentityCheck(HttpServletRequest request, String customBody, int outTime, String decodeType);
+
+    /**
+     * 三川木-人像-V2
+     * @param request
+     * @param customBody
+     * @param outTime
+     * @return
+     */
+    ChannelTypeHandleResponseObject photoIdentityCheckV2(HttpServletRequest request, String customBody, int outTime, String decodeType);
+}

+ 598 - 0
src/main/java/info/aspirecn/iov/sjjh/shupplier10000005/service/PhotoIdentityCheckServiceImpl.java

@@ -0,0 +1,598 @@
+package info.aspirecn.iov.sjjh.shupplier10000005.service;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException;
+import info.aspirecn.iov.sjjh.commons.lang.ChannelTypeHandleResponseObject;
+import info.aspirecn.iov.sjjh.commons.lang.Constant;
+import info.aspirecn.iov.sjjh.commons.lang.PatternTools;
+import info.aspirecn.iov.sjjh.shupplier10000005.SjjhConstant;
+import info.aspirecn.iov.sjjh.shupplier10000005.util.AesUtil;
+import info.aspirecn.iov.sjjh.shupplier10000005.util.MD5Util;
+import info.aspirecn.iov.sjjh.shupplier10000005.vo.*;
+import info.aspirecn.rdc.aspirecloud.node.except.utils.ErrorUtils;
+import lombok.extern.slf4j.Slf4j;
+import okhttp3.*;
+import org.apache.commons.lang3.ArrayUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.tomcat.util.codec.binary.Base64;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Service;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.Unmarshaller;
+import java.io.IOException;
+import java.io.StringReader;
+import java.net.SocketTimeoutException;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.concurrent.TimeUnit;
+
+/**
+ * @author xusonglin
+ * @version V1.0
+ **/
+@Slf4j
+@Service
+public class PhotoIdentityCheckServiceImpl implements PhotoIdentityCheckService {
+    @Value("${custom.photo-api}")
+    private String photoIdentityCheckApi;
+    @Value("${custom.aesDecryptKey}")
+    private String aesDecryptKey;
+    @Value("${custom.jkxyUrl}")
+    private String jkxyUrl;
+    @Value("${custom.app.key}")
+    private String appKey;
+    @Value("${custom.secret.key}")
+    private String secretKey;
+    @Value("${custom.photoCheck.url}")
+    private String photoCheckUrl;
+    @Value("${custom.photoCheck.hashcode}")
+    private String photoCheckHashCode;
+    @Value("${custom.photoCheck.key}")
+    private String photoCheckKey;
+    @Autowired
+    private ObjectMapper objectMapper;
+
+    @Override
+    public ChannelTypeHandleResponseObject photoIdentityCheck(HttpServletRequest request, String customBody, int outTime, String decodeType) {
+        ChannelTypeHandleResponseObject ret = new ChannelTypeHandleResponseObject();
+        ret.setIsCharge(Constant.INTERFACE_QUERY_NO_FEE);
+        String upstreamCode = Constant.LOG_UPSTREAM_DEFAULT_RESPONSE_CODE;
+        request.setAttribute(Constant.LOG_UPSTREAM_RESPONSE_CODE, upstreamCode);
+        String returnType = request.getHeader(Constant.CUSTOMER_RETURN_TYPE_PARA);
+        if (StringUtils.isBlank(returnType)) {
+            returnType = Constant.CUSTOMER_RETURN_ZW;
+        }
+        if (outTime <= 0) {
+            outTime = Constant.HTTPCLIENT_CONNECTTIMEOUT;
+        }
+        log.info("supplier10000005.photoIdentityCheck---customBody={},outTime={}", customBody, outTime);
+        if (!decodeType.equals(SjjhConstant.DECODE_TYPE_COMMON)) {
+            customBody = decodeParams(ret, returnType, customBody, decodeType);
+            if (StringUtils.isBlank(customBody)) {
+                ret.setCode(Constant.SUCCESS);
+                request.setAttribute(Constant.LOG_UPSTREAM_RESPONSE_CODE, upstreamCode);
+                return ret;
+            }
+        }
+        try {
+            JSONObject jsonObject = JSON.parseObject(customBody);
+            String name = jsonObject.getString("name");//requestObject.getName();
+            String idCode = jsonObject.getString("idCode");
+            String photo = jsonObject.getString("photo");
+            customBody = null;
+            jsonObject.put("photo", "图片base64");
+            request.setAttribute(Constant.CHANNEL_LOG_QUERY,
+                    Base64.encodeBase64String(jsonObject.toJSONString().getBytes(SjjhConstant.PARA_ENCODE)));
+            jsonObject = null;
+
+            if(!checkParam(name,idCode,returnType,ret)){
+                return ret;
+            }
+
+            PhotoIdentityCheckRequestObject.PhotoIdentityCheckRequestData dataObject = new PhotoIdentityCheckRequestObject.PhotoIdentityCheckRequestData();
+            dataObject.setName(name);
+            dataObject.setId_number(idCode);
+            dataObject.setImgstr(photo);
+            photo = null;
+
+            PhotoIdentityCheckRequestObject requestObject = new PhotoIdentityCheckRequestObject();
+            requestObject.setApi(photoIdentityCheckApi);
+            requestObject.setAppKey(appKey);
+            requestObject.setAppSecret(secretKey);
+            requestObject.setData(dataObject);
+            dataObject = null;
+
+            MediaType mediaType = MediaType.parse("application/json; charset=utf-8");
+            RequestBody requestBody = RequestBody.create(mediaType, JSON.toJSONString(requestObject));
+            requestObject = null;
+            Request okRequest = new Request.Builder()
+                    .post(requestBody)
+                    .url(jkxyUrl)
+                    .build();
+            OkHttpClient client = new OkHttpClient.Builder()
+                    .connectTimeout(outTime, TimeUnit.MILLISECONDS)
+                    .readTimeout(outTime, TimeUnit.MILLISECONDS)
+                    .writeTimeout(outTime, TimeUnit.MILLISECONDS)
+                    .build();
+            Response response = client.newCall(okRequest).execute();
+            String responseContext = "";
+            if (response.body() != null) {
+                responseContext = response.body().string();
+            }
+            log.info("supplier10000005.scmDecodeIdCode接口responseContext={}", responseContext);
+            if (StringUtils.isNotBlank(responseContext)) {
+                ret.setCode(Constant.SUCCESS);
+                upstreamCode = setPhotoIdentityCheckResponse(ret, returnType, responseContext);
+                response.close();
+            } else {
+                ret.setCode(Constant.FAIL);
+            }
+        } catch (SocketTimeoutException ste) {
+            ErrorUtils.captureException(ste);
+            log.info("supplier10000005.photoIdentityCheck接口SocketTimeoutException={}", ste);
+            ret.setCode(Constant.REQUEST_TIMEOUT);
+        } catch (Exception ioe) {
+            ErrorUtils.captureException(ioe);
+            log.info("supplier10000005.photoIdentityCheck接口Exception={}", ioe);
+            ret.setCode(Constant.FAIL);
+        }
+
+        //上游返回码
+        request.setAttribute(Constant.LOG_UPSTREAM_RESPONSE_CODE, upstreamCode);
+        return ret;
+    }
+
+    private String setPhotoIdentityCheckResponse(ChannelTypeHandleResponseObject ret, String returnType, String result) {
+        JSONObject resultObject = new JSONObject();
+        JSONObject responseObject = JSON.parseObject(result);
+        String resultCode = responseObject.getString("data");
+        if (responseObject.getString("data").equals("2")) {
+            // 照片质量不合格
+            if (Constant.CUSTOMER_RETURN_JK.equals(returnType)) {
+                ret.setResultCode(Constant.JK_RETURN_CODE_1149);
+            } else {
+                ret.setResultCode(Constant.ZW_RETURN_CODE_74);
+            }
+            resultObject.put("message", Constant.RETURN_MESSAGE_74);
+            resultObject.put("verificationScore", "");
+            ret.setResultBody(resultObject.toJSONString());
+            ret.setResultDesc(resultObject.toJSONString());
+            return resultCode;
+        }
+
+        if (responseObject.getString("data").equals("3")) {
+            // 查询错误
+            if (Constant.CUSTOMER_RETURN_JK.equals(returnType)) {
+                ret.setResultCode(Constant.JK_RETURN_CODE_OTHER_ERROR);
+            } else {
+                ret.setResultCode(Constant.OTHER_ERROR_CODE);
+            }
+            ret.setResultBody(Constant.OTHER_ERROR);
+            ret.setResultDesc(Constant.OTHER_ERROR);
+            return resultCode;
+        }
+
+        // 有核验结果,解析msg
+        JSONObject responseMsg = JSON.parseObject(responseObject.getString("msg"));
+        String validateResult = responseMsg.getString("Validate_Result");
+        String similarity = responseMsg.getString("Similarity");
+        if (ArrayUtils.contains(SjjhConstant.PHOTO_CHECK_CHARGE_ARRAY, validateResult)) {
+            ret.setIsCharge(Constant.IS_CHARGE);
+        }
+        resultObject.put("verificationScore", similarity);
+        resultCode = resultCode + "-" + validateResult;
+        if (validateResult.equals("-1")) {
+            // 身份证号与姓名不匹配
+            if (Constant.CUSTOMER_RETURN_JK.equals(returnType)) {
+                ret.setResultCode(Constant.JK_RETURN_CODE_1146);
+            } else {
+                ret.setResultCode(Constant.ZW_RETURN_CODE_71);
+            }
+            resultObject.put("message", Constant.RETURN_MESSAGE_71);
+            ret.setResultBody(resultObject.toJSONString());
+            ret.setResultDesc(resultObject.toJSONString());
+
+        } else if (validateResult.equals("-2")) {
+            // 库中无此号
+            if (Constant.CUSTOMER_RETURN_JK.equals(returnType)) {
+                ret.setResultCode(Constant.JK_RETURN_CODE_NO_INFO);
+            } else {
+                ret.setResultCode(Constant.UN_FIND_NUM_CODE);
+            }
+            ret.setResultBody(Constant.UN_FIND_NUM);
+            ret.setResultDesc(Constant.UN_FIND_NUM);
+
+        } else if (validateResult.equals("-3")) {
+            // 身份证号与姓名匹配,库中无照片
+            if (Constant.CUSTOMER_RETURN_JK.equals(returnType)) {
+                ret.setResultCode(Constant.JK_RETURN_CODE_1147);
+            } else {
+                ret.setResultCode(Constant.ZW_RETURN_CODE_72);
+            }
+            resultObject.put("message", Constant.RETURN_MESSAGE_72);
+            ret.setResultBody(resultObject.toJSONString());
+            ret.setResultDesc(resultObject.toJSONString());
+
+        } else if (validateResult.equals("1")) {
+            // 身份证号与姓名匹配,照片系统判断为同一人
+            if (Constant.CUSTOMER_RETURN_JK.equals(returnType)) {
+                ret.setResultCode(Constant.JK_RETURN_CODE_1143);
+            } else {
+                ret.setResultCode(Constant.ZW_RETURN_CODE_68);
+            }
+            resultObject.put("message", Constant.RETURN_MESSAGE_68);
+            ret.setResultBody(resultObject.toJSONString());
+            ret.setResultDesc(resultObject.toJSONString());
+
+        } else if (validateResult.equals("2")) {
+            // 身份证号与姓名匹配,照片不能确定是否为同一人
+            if (Constant.CUSTOMER_RETURN_JK.equals(returnType)) {
+                ret.setResultCode(Constant.JK_RETURN_CODE_1144);
+            } else {
+                ret.setResultCode(Constant.ZW_RETURN_CODE_69);
+            }
+            resultObject.put("message", Constant.RETURN_MESSAGE_69);
+            ret.setResultBody(resultObject.toJSONString());
+            ret.setResultDesc(resultObject.toJSONString());
+
+        } else if (validateResult.equals("3")) {
+            // 身份证号与姓名匹配,照片系统判断为不同人
+            if (Constant.CUSTOMER_RETURN_JK.equals(returnType)) {
+                ret.setResultCode(Constant.JK_RETURN_CODE_1145);
+            } else {
+                ret.setResultCode(Constant.ZW_RETURN_CODE_70);
+            }
+            resultObject.put("message", Constant.RETURN_MESSAGE_70);
+            ret.setResultBody(resultObject.toJSONString());
+            ret.setResultDesc(resultObject.toJSONString());
+
+        } else if (validateResult.equals("7")) {
+            // 身份证号与姓名匹配,照片检测失败
+            if (Constant.CUSTOMER_RETURN_JK.equals(returnType)) {
+                ret.setResultCode(Constant.JK_RETURN_CODE_1148);
+            } else {
+                ret.setResultCode(Constant.ZW_RETURN_CODE_73);
+            }
+            resultObject.put("message", Constant.RETURN_MESSAGE_73);
+            ret.setResultBody(resultObject.toJSONString());
+            ret.setResultDesc(resultObject.toJSONString());
+
+        } else {
+            // 照片质量不合格,请重新上传
+            if (Constant.CUSTOMER_RETURN_JK.equals(returnType)) {
+                ret.setResultCode(Constant.JK_RETURN_CODE_1149);
+            } else {
+                ret.setResultCode(Constant.ZW_RETURN_CODE_74);
+            }
+            resultObject.put("message", Constant.RETURN_MESSAGE_74);
+            resultObject.put("verificationScore", "");
+            ret.setResultBody(resultObject.toJSONString());
+            ret.setResultDesc(resultObject.toJSONString());
+        }
+
+        return resultCode;
+
+    }
+    private String decodeParams(ChannelTypeHandleResponseObject ret, String returnType, String customBody, String decodeType) {
+        JSONObject requestParamObject = JSONObject.parseObject(customBody);
+        if (decodeType.equals(SjjhConstant.DECODE_TYPE_AES)) {
+            if (requestParamObject.get("params") == null) {
+                if (Constant.CUSTOMER_RETURN_ZW.equals(returnType)) {
+                    ret.setResultCode(Constant.INVALID_PARAMETER_CODE);
+                    ret.setResultBody(Constant.INVALID_PARAMETER);
+                    ret.setResultDesc(Constant.INVALID_PARAMETER);
+                } else {
+                    ret.setResultCode(Constant.JK_RETURN_CODE_INVALID_PARAMETER);
+                    ret.setResultBody(Constant.INVALID_PARAMETER);
+                    ret.setResultDesc(Constant.INVALID_PARAMETER);
+                }
+                return "";
+            }
+
+            try {
+                customBody = AesUtil.decryAES(aesDecryptKey, requestParamObject.getString("params"));
+                if (StringUtils.isBlank(customBody)) {
+                    if (Constant.CUSTOMER_RETURN_ZW.equals(returnType)) {
+                        ret.setResultCode(Constant.ZW_RETURN_CODE_133);
+                    } else {
+                        ret.setResultCode(Constant.JK_RETURN_CODE_9931);
+                    }
+                    ret.setResultBody(Constant.RETURN_MESSAGE_133);
+                    ret.setResultDesc(Constant.RETURN_MESSAGE_133);
+                    return "";
+                }
+                requestParamObject = null;
+                return customBody;
+            } catch (Exception e) {
+                ErrorUtils.captureException(e);
+                if (Constant.CUSTOMER_RETURN_ZW.equals(returnType)) {
+                    ret.setResultCode(Constant.ZW_RETURN_CODE_133);
+                } else {
+                    ret.setResultCode(Constant.JK_RETURN_CODE_9931);
+                }
+                ret.setResultBody(Constant.RETURN_MESSAGE_133);
+                ret.setResultDesc(Constant.RETURN_MESSAGE_133);
+                return "";
+            }
+        }
+        return customBody;
+    }
+
+    public boolean checkParam(String name,String idCode,String returnType,ChannelTypeHandleResponseObject ret){
+        if (StringUtils.isBlank(name) || StringUtils.isBlank(idCode)) {
+            if (Constant.CUSTOMER_RETURN_ZW.equals(returnType)) {
+                ret.setResultCode(Constant.INVALID_PARAMETER_CODE);
+                ret.setResultBody(Constant.PARAMETER_NAME_ERROR);
+                ret.setResultDesc(Constant.PARAMETER_NAME_ERROR);
+            } else {
+                ret.setResultCode(Constant.JK_RETURN_CODE_INVALID_PARAMETER);
+                ret.setResultBody(Constant.PARAMETER_NAME_ERROR);
+                ret.setResultDesc(Constant.PARAMETER_NAME_ERROR);
+            }
+            return false;
+        } else if (StringUtils.isBlank(name) ||
+                !PatternTools.checkResult(Constant.PATTERN_SPECIAL_CN_NAME_REGEX, name)) {
+            if (Constant.CUSTOMER_RETURN_ZW.equals(returnType)) {
+                ret.setResultCode(Constant.NAME_FORMAT_ERROR_CODE);
+                ret.setResultDesc(Constant.NAME_FORMAT_ERROR);
+                ret.setResultBody(Constant.NAME_FORMAT_ERROR);
+            } else {
+                ret.setResultCode(Constant.JK_NAME_FORMAT_ERROR_CODE);
+                ret.setResultDesc(Constant.JK_NAME_FORMAT_ERROR);
+                ret.setResultBody(Constant.JK_NAME_FORMAT_ERROR);
+            }
+            return false;
+        } else if (StringUtils.isBlank(idCode)
+                || !PatternTools.checkResult(Constant.PATTERN_SPECIAL_ID_NUMBER_REGEX, idCode)) {
+            if (Constant.CUSTOMER_RETURN_ZW.equals(returnType)) {
+                ret.setResultCode(Constant.IDCODE_FORMAT_ERROR_CODE);
+                ret.setResultDesc(Constant.IDCODE_FORMAT_ERROR);
+                ret.setResultBody(Constant.IDCODE_FORMAT_ERROR);
+            } else {
+                ret.setResultCode(Constant.JK_IDCODE_FORMAT_ERROR_CODE);
+                ret.setResultDesc(Constant.JK_IDCODE_FORMAT_ERROR);
+                ret.setResultBody(Constant.JK_IDCODE_FORMAT_ERROR);
+            }
+            return false;
+        }
+        return true;
+    }
+
+    @Override
+    public ChannelTypeHandleResponseObject photoIdentityCheckV2(HttpServletRequest request, String customBody, int outTime, String decodeType) {
+        ChannelTypeHandleResponseObject ret = new ChannelTypeHandleResponseObject();
+        ret.setIsCharge(Constant.INTERFACE_QUERY_NO_FEE);
+        String upstreamCode = Constant.LOG_UPSTREAM_DEFAULT_RESPONSE_CODE;
+        request.setAttribute(Constant.LOG_UPSTREAM_RESPONSE_CODE, upstreamCode);
+        String returnType = request.getHeader(Constant.CUSTOMER_RETURN_TYPE_PARA);
+        if (StringUtils.isBlank(returnType)) {
+            returnType = Constant.CUSTOMER_RETURN_ZW;
+        }
+        if (outTime <= 0) {
+            outTime = Constant.HTTPCLIENT_CONNECTTIMEOUT;
+        }
+        log.info("supplier10000005.photoIdentityCheckV2---customBody={},outTime={}", customBody, outTime);
+        if (!decodeType.equals(SjjhConstant.DECODE_TYPE_COMMON)) {
+            customBody = decodeParams(ret, returnType, customBody, decodeType);
+            if (StringUtils.isBlank(customBody)) {
+                ret.setCode(Constant.SUCCESS);
+                request.setAttribute(Constant.LOG_UPSTREAM_RESPONSE_CODE, upstreamCode);
+                return ret;
+            }
+        }
+        try {
+            JSONObject jsonObject = JSON.parseObject(customBody);
+            String name = jsonObject.getString("name");//requestObject.getName();
+            String idCode = jsonObject.getString("idCode");
+            String photo = jsonObject.getString("photo");
+            customBody = null;
+            jsonObject.put("photo", "图片base64");
+            request.setAttribute(Constant.CHANNEL_LOG_QUERY,
+                    Base64.encodeBase64String(jsonObject.toJSONString().getBytes(SjjhConstant.PARA_ENCODE)));
+            jsonObject = null;
+
+            if(!checkParam(name,idCode,returnType,ret)){
+                return ret;
+            }
+
+            SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
+            String sign = MD5Util.MD5(photoCheckHashCode + name + photo + idCode + photoCheckKey + sdf.format(new Date())).toLowerCase();
+            FormBody formBody = new FormBody.Builder()
+                    .add("passName", name)
+                    .add("hashcode", photoCheckHashCode)
+                    .add("pid", idCode)
+                    .add("photo", photo)
+                    .add("sign", sign)
+                    .build();
+            photo = null;
+            Request okRequest = new Request.Builder()
+                    .post(formBody)
+                    .url(photoCheckUrl)
+                    .build();
+            OkHttpClient client = new OkHttpClient.Builder()
+                    .connectTimeout(outTime, TimeUnit.MILLISECONDS)
+                    .readTimeout(outTime, TimeUnit.MILLISECONDS)
+                    .writeTimeout(outTime, TimeUnit.MILLISECONDS)
+                    .build();
+            Response response = client.newCall(okRequest).execute();
+            String responseContext = "";
+            if (response.body() != null) {
+                responseContext = response.body().string();
+            }
+            formBody = null;
+            log.info("supplier10000005.photoIdentityCheckV2接口responseContext={}", responseContext);
+            if (StringUtils.isNotBlank(responseContext)) {
+                ret.setCode(Constant.SUCCESS);
+                upstreamCode = setPhotoIdentityCheckV2Response(ret, returnType, responseContext);
+                response.close();
+            } else {
+                ret.setCode(Constant.FAIL);
+            }
+        } catch (SocketTimeoutException ste) {
+            ErrorUtils.captureException(ste);
+            log.info("supplier10000005.photoIdentityCheckV2接口SocketTimeoutException={}", ste);
+            ret.setCode(Constant.REQUEST_TIMEOUT);
+        } catch (Exception ioe) {
+            ErrorUtils.captureException(ioe);
+            log.info("supplier10000005.photoIdentityCheckV2接口Exception={}", ioe);
+            ret.setCode(Constant.FAIL);
+        }
+
+        //上游返回码
+        request.setAttribute(Constant.LOG_UPSTREAM_RESPONSE_CODE, upstreamCode);
+        return ret;
+    }
+
+    private String setPhotoIdentityCheckV2Response(ChannelTypeHandleResponseObject ret, String returnType, String result) {
+        PhotoIdentityCheckV2ResponseObject photoIdentityCheckV2ResponseObject = new PhotoIdentityCheckV2ResponseObject();
+        try {
+            JAXBContext context = JAXBContext.newInstance(PhotoIdentityCheckV2ResponseObject.class);
+            Unmarshaller unmarshaller = context.createUnmarshaller();
+            log.info(result);
+            photoIdentityCheckV2ResponseObject = (PhotoIdentityCheckV2ResponseObject) unmarshaller.unmarshal
+                    (new StringReader(result.replace(SjjhConstant.PHOTO_CHECK_XML, "")));
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+
+        String errorCode = photoIdentityCheckV2ResponseObject.getErrorRes().getErrorCode();
+        String resultCode = errorCode;
+        JSONObject resultObject = new JSONObject();
+        if (errorCode.equals("502")) {
+            // 照片质量不合格
+            if (Constant.CUSTOMER_RETURN_JK.equals(returnType)) {
+                ret.setResultCode(Constant.JK_RETURN_CODE_1149);
+            } else {
+                ret.setResultCode(Constant.ZW_RETURN_CODE_74);
+            }
+            resultObject.put("message", Constant.RETURN_MESSAGE_74);
+            resultObject.put("verificationScore", "");
+            ret.setResultBody(resultObject.toJSONString());
+            ret.setResultDesc(resultObject.toJSONString());
+        } else if (errorCode.equals("200")) {
+            String validateResult = photoIdentityCheckV2ResponseObject.getResult().getValidateResult();
+            String similarity = photoIdentityCheckV2ResponseObject.getResult().getSimilarity() == null ?
+                    "" : photoIdentityCheckV2ResponseObject.getResult().getSimilarity();
+            if (ArrayUtils.contains(SjjhConstant.PHOTO_CHECK_CHARGE_ARRAY, validateResult)) {
+                ret.setIsCharge(Constant.IS_CHARGE);
+            }
+            resultObject.put("verificationScore", similarity);
+            resultCode = resultCode + "-" + validateResult;
+            if (validateResult.equals("-1")) {
+                // 身份证号与姓名不匹配
+                if (Constant.CUSTOMER_RETURN_JK.equals(returnType)) {
+                    ret.setResultCode(Constant.JK_RETURN_CODE_1146);
+                } else {
+                    ret.setResultCode(Constant.ZW_RETURN_CODE_71);
+                }
+                resultObject.put("message", Constant.RETURN_MESSAGE_71);
+                ret.setResultBody(resultObject.toJSONString());
+                ret.setResultDesc(resultObject.toJSONString());
+
+            } else if (validateResult.equals("-2")) {
+                // 库中无此号
+                if (Constant.CUSTOMER_RETURN_JK.equals(returnType)) {
+                    ret.setResultCode(Constant.JK_RETURN_CODE_NO_INFO);
+                } else {
+                    ret.setResultCode(Constant.UN_FIND_NUM_CODE);
+                }
+                ret.setResultBody(Constant.UN_FIND_NUM);
+                ret.setResultDesc(Constant.UN_FIND_NUM);
+
+            } else if (validateResult.equals("-3")) {
+                // 身份证号与姓名匹配,库中无照片
+                if (Constant.CUSTOMER_RETURN_JK.equals(returnType)) {
+                    ret.setResultCode(Constant.JK_RETURN_CODE_1147);
+                } else {
+                    ret.setResultCode(Constant.ZW_RETURN_CODE_72);
+                }
+                resultObject.put("message", Constant.RETURN_MESSAGE_72);
+                ret.setResultBody(resultObject.toJSONString());
+                ret.setResultDesc(resultObject.toJSONString());
+
+            } else if (validateResult.equals("1")) {
+                // 身份证号与姓名匹配,照片系统判断为同一人
+                if (Constant.CUSTOMER_RETURN_JK.equals(returnType)) {
+                    ret.setResultCode(Constant.JK_RETURN_CODE_1143);
+                } else {
+                    ret.setResultCode(Constant.ZW_RETURN_CODE_68);
+                }
+                resultObject.put("message", Constant.RETURN_MESSAGE_68);
+                ret.setResultBody(resultObject.toJSONString());
+                ret.setResultDesc(resultObject.toJSONString());
+
+            } else if (validateResult.equals("2")) {
+                // 身份证号与姓名匹配,照片不能确定是否为同一人
+                if (Constant.CUSTOMER_RETURN_JK.equals(returnType)) {
+                    ret.setResultCode(Constant.JK_RETURN_CODE_1144);
+                } else {
+                    ret.setResultCode(Constant.ZW_RETURN_CODE_69);
+                }
+                resultObject.put("message", Constant.RETURN_MESSAGE_69);
+                ret.setResultBody(resultObject.toJSONString());
+                ret.setResultDesc(resultObject.toJSONString());
+
+            } else if (validateResult.equals("3")) {
+                // 身份证号与姓名匹配,照片系统判断为不同人
+                if (Constant.CUSTOMER_RETURN_JK.equals(returnType)) {
+                    ret.setResultCode(Constant.JK_RETURN_CODE_1145);
+                } else {
+                    ret.setResultCode(Constant.ZW_RETURN_CODE_70);
+                }
+                resultObject.put("message", Constant.RETURN_MESSAGE_70);
+                ret.setResultBody(resultObject.toJSONString());
+                ret.setResultDesc(resultObject.toJSONString());
+
+            } else if (validateResult.equals("7")) {
+                // 身份证号与姓名匹配,照片检测失败
+                if (Constant.CUSTOMER_RETURN_JK.equals(returnType)) {
+                    ret.setResultCode(Constant.JK_RETURN_CODE_1148);
+                } else {
+                    ret.setResultCode(Constant.ZW_RETURN_CODE_73);
+                }
+                resultObject.put("message", Constant.RETURN_MESSAGE_73);
+                ret.setResultBody(resultObject.toJSONString());
+                ret.setResultDesc(resultObject.toJSONString());
+
+            } else {
+                // 照片质量不合格,请重新上传
+                if (Constant.CUSTOMER_RETURN_JK.equals(returnType)) {
+                    ret.setResultCode(Constant.JK_RETURN_CODE_1149);
+                } else {
+                    ret.setResultCode(Constant.ZW_RETURN_CODE_74);
+                }
+                resultObject.put("message", Constant.RETURN_MESSAGE_74);
+                resultObject.put("verificationScore", "");
+                ret.setResultBody(resultObject.toJSONString());
+                ret.setResultDesc(resultObject.toJSONString());
+            }
+        } else if (errorCode.equals("501")) {
+            // 库中无此号
+            if (Constant.CUSTOMER_RETURN_JK.equals(returnType)) {
+                ret.setResultCode(Constant.JK_RETURN_CODE_NO_INFO);
+            } else {
+                ret.setResultCode(Constant.UN_FIND_NUM_CODE);
+            }
+            ret.setResultBody(Constant.UN_FIND_NUM);
+            ret.setResultDesc(Constant.UN_FIND_NUM);
+        } else {
+            // 查询错误
+            if (Constant.CUSTOMER_RETURN_JK.equals(returnType)) {
+                ret.setResultCode(Constant.JK_RETURN_CODE_OTHER_ERROR);
+            } else {
+                ret.setResultCode(Constant.OTHER_ERROR_CODE);
+            }
+            ret.setResultBody(Constant.OTHER_ERROR);
+            ret.setResultDesc(Constant.OTHER_ERROR);
+            return errorCode;
+        }
+
+        return resultCode;
+
+    }
+}

文件差异内容过多而无法显示
+ 83 - 0
src/main/java/info/aspirecn/iov/sjjh/shupplier10000005/util/AesUtil.java


+ 31 - 0
src/main/java/info/aspirecn/iov/sjjh/shupplier10000005/util/MD5Util.java

@@ -0,0 +1,31 @@
+package info.aspirecn.iov.sjjh.shupplier10000005.util;
+
+import java.security.MessageDigest;
+
+/**
+ * @author xusonglin
+ * @version V1.0
+ **/
+public class MD5Util {
+    public final static String MD5(String s) {
+        char hexDigits[] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'};
+        try {
+            byte[] btInput = s.getBytes();
+            MessageDigest mdInst = MessageDigest.getInstance("MD5");
+            mdInst.update(btInput);
+            byte[] md = mdInst.digest();
+            int j = md.length;
+            char str[] = new char[j * 2];
+            int k = 0;
+            for (int i = 0; i < j; i++) {
+                byte byte0 = md[i];
+                str[k++] = hexDigits[byte0 >>> 4 & 0xf];
+                str[k++] = hexDigits[byte0 & 0xf];
+            }
+            return new String(str);
+        } catch (Exception e) {
+            e.printStackTrace();
+            return null;
+        }
+    }
+}

+ 34 - 0
src/main/java/info/aspirecn/iov/sjjh/shupplier10000005/vo/PhotoIdentityCheckRequestObject.java

@@ -0,0 +1,34 @@
+package info.aspirecn.iov.sjjh.shupplier10000005.vo;
+
+import lombok.Data;
+import lombok.ToString;
+
+/**
+ * @author xusonglin
+ * @version V1.0
+ **/
+@Data
+@ToString
+public class PhotoIdentityCheckRequestObject {
+    /**接口名*/
+    private String api;
+    /**appkey*/
+    private String appKey;
+    /**密钥*/
+    private String appSecret;
+    /**被查询人对象*/
+    private PhotoIdentityCheckRequestObject.PhotoIdentityCheckRequestData data;
+
+    @Data
+    @ToString(callSuper = true, includeFieldNames = true)
+    public static class PhotoIdentityCheckRequestData {
+        /**姓名*/
+        private String name;
+        /**身份证号*/
+        private String id_number;
+        /**照片*/
+        private String imgstr;
+        /**sign*/
+        private String sign;
+    }
+}

+ 27 - 0
src/main/java/info/aspirecn/iov/sjjh/shupplier10000005/vo/PhotoIdentityCheckResponseObject.java

@@ -0,0 +1,27 @@
+package info.aspirecn.iov.sjjh.shupplier10000005.vo;
+
+import com.alibaba.fastjson.annotation.JSONField;
+import lombok.Data;
+import lombok.ToString;
+
+/**
+ * @author xusonglin
+ * @version V1.0
+ **/
+@Data
+@ToString
+public class PhotoIdentityCheckResponseObject {
+    private String data;
+    private String code;
+    private String requestId;
+    private PhotoIdentityCheckResponseMsg msg;
+
+    @Data
+    @ToString
+    public static class PhotoIdentityCheckResponseMsg {
+        @JSONField(name = "Validate_Result")
+        private String validateResult;
+        @JSONField(name = "Similarity")
+        private String similarity;
+    }
+}

+ 20 - 0
src/main/java/info/aspirecn/iov/sjjh/shupplier10000005/vo/PhotoIdentityCheckV2RequestObject.java

@@ -0,0 +1,20 @@
+package info.aspirecn.iov.sjjh.shupplier10000005.vo;
+
+import lombok.Data;
+import lombok.ToString;
+
+import java.io.Serializable;
+
+/**
+ * @author xusonglin
+ * @version V1.0
+ **/
+@Data
+@ToString
+public class PhotoIdentityCheckV2RequestObject{
+    private String hashcode;
+    private String passName;
+    private String pid;
+    private String photo;
+    private String sign;
+}

+ 87 - 0
src/main/java/info/aspirecn/iov/sjjh/shupplier10000005/vo/PhotoIdentityCheckV2ResponseObject.java

@@ -0,0 +1,87 @@
+package info.aspirecn.iov.sjjh.shupplier10000005.vo;
+
+import lombok.Data;
+import lombok.Getter;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+import java.util.List;
+
+/**
+ * @description:
+ * @author: xusonglin
+ * @create: 2020/6/16 13:33
+ * @version: V1.0
+ **/
+@Data
+@XmlRootElement(name = "XY_IdcardPhoto")
+@XmlAccessorType(value = XmlAccessType.FIELD)
+public class PhotoIdentityCheckV2ResponseObject {
+    @XmlElement(name = "ErrorRes")
+    private ErrorRes errorRes;
+    @XmlElement(name = "result")
+    private Result result;
+
+    @Getter
+    public static class ErrorRes {
+        @Getter
+        @XmlElement(name = "Err_code")
+        private String errorCode;
+        @Getter
+        @XmlElement(name = "Err_content")
+        private String errorContent;
+    }
+    @Getter
+    public static class Result {
+        @Getter
+        @XmlElement(name = "Validate_Result")
+        private String validateResult;
+        @Getter
+        @XmlElement(name = "Similarity")
+        private String similarity;
+    }
+    @Getter
+    public static class PhotoIdentityResponseRow {
+        @Getter
+        @XmlElement(name = "INPUT")
+        private PhotoIdentityResponseInput input;
+        @Getter
+        @XmlElement(name = "OUTPUT")
+        private PhotoIdentityResponseOutput output;
+    }
+
+    @Getter
+    public static class PhotoIdentityResponseInput {
+        @Getter
+        @XmlElement(name = "gmsfhm")
+        private String idCode;
+        @Getter
+        @XmlElement(name = "xm")
+        private String name;
+    }
+
+    @Getter
+    public static class PhotoIdentityResponseOutput {
+        @Getter
+        @XmlElement(name = "ITEM")
+        private List<PhotoIdentityResponseItem> items;
+    }
+
+    @Getter
+    public static class PhotoIdentityResponseItem {
+        @Getter
+        @XmlElement(name = "result_gmsfhm")
+        private String idCodeResult;
+        @Getter
+        @XmlElement(name = "result_xm")
+        private String nameResult;
+        @Getter
+        @XmlElement(name = "result_fx")
+        private String photoResult;
+        @Getter
+        @XmlElement(name = "result_fs")
+        private String photoResultScore;
+    }
+}

+ 114 - 0
src/main/resources/config/application.yml

@@ -0,0 +1,114 @@
+server:
+  tomcat:
+    accesslog:
+      buffered: false
+      enabled: true
+      pattern: '{"DateTime":"%{yyyy-MM-dd''T''HH:mm:ss.SSSZZ}t","ClientIP":"%a","Method":"%m","URI":"%U","RequestProtocol":"%H","ResponseCode":%s,
+                "ResponseTime":%D,"UserAgent":"%{user-agent}i","X-Forwarded-For":"%{x-forwarded-for}r","X-User-IP":"%{X-User-IP}i","traceId":"%{x-b3-traceid}i","id":"%{x-b3-spanid}r",
+                "parentId":"%{x-b3-parentspanid}i","ApplicationName":"${spring.application.name}","MG-IsCharge":%{isCharge}r,
+                "MG-ChannelId":%{channelId}i,"MG-CustomBody":"%{x-requestQuery}r","MG-ResultBody":"%{resultBody}o",
+                "MG-ResponseCode":%{respnoseCode}r,"MG-Upstream-ResponseCode":"%{upResponseCode}r","MG-SellingPrice":%{price}i,"req_type":"%{req_type}r","MG-ProductId":%{productId}i,"MG-UserId":%{userid}i}'
+      prefix: access_${HOSTNAME}_${spring.application.name}_${server.port}
+      directory: ${logging.path}
+  servlet:
+    context-path: /
+
+spring:
+  cloud:
+    config:
+      overrideSystemProperties: true
+      allowOverride: true
+      overrideNone: true
+  sleuth:
+    sampler:
+      probability: 1
+    web:
+      additional-skip-pattern: /api/v2/spans
+  zipkin:
+    base-url: http://127.0.0.1:${server.port}
+
+  mvc:
+    favicon:
+      enabled: false
+
+#management
+management:
+  endpoints:
+    enabled-by-default: true
+    web:
+      exposure:
+        include: '*'
+  endpoint:
+    health:
+      show-details: always
+    shutdown:
+      enabled: true
+
+#logging
+logging:
+  path: /Users/jkxy/root-logs/apps/var/jakarta/logs
+  level:
+    root: INFO
+    red:
+      microcloud: DEBUG
+  config: classpath:config/logback-spring.xml
+  file: ${logging.path}/catalina_${spring.cloud.client.hostname}_${spring.application.name}_${server.port}.out
+
+#error logging
+#sleuth logging
+rdc:
+  logging:
+    error-file: ${logging.path}/error_${spring.cloud.client.hostname}_${spring.application.name}_${server.port}.log
+    sleuth-file: ${logging.path}/sleuth_${spring.cloud.client.hostname}_${spring.application.name}_${server.port}.log
+
+#eureka
+eureka:
+  instance:
+    prefer-ip-address: true
+    instance-id: ${spring.cloud.client.ipaddress}:${server.port}
+    metadata-map:
+      management:
+        server:
+          port: ${management.server.port}
+    health-check-url: http://${spring.cloud.client.ipaddress}:${management.server.port}${eureka.instance.health-check-url-path}
+    health-check-url-path: /actuator/health
+  client:
+    serviceUrl:
+      defaultZone: http://localhost:8888/eureka
+
+  #info
+
+#custom
+custom:
+  url: http://jkxy.h11.site/gateway?api=credit.sec.data
+  app:
+    key: JIAO_KE
+  secret:
+    key: D78C393359BF128715C65D91C67051478A4DFC13
+  api: IDCARD_2ND_V4
+  yd1-api: CMCC_3RD_V1
+  yd2-api: CMCC_3RD_V2
+  yd3-api: CMCC_3RD_V6
+  yd4-api: CMCC_3RD_V4
+  yd-online-time: MOBILE_ONLINE_CHECK_V1
+  yd-online-status: MOBILE_STATUS_CHECK_V1
+  dianxin-api: CTCC_3RD_V2
+  dx-online-time: CTCC_ONLINE_CHECK_V1
+  dx-online-status: CTCC_STATUS_CHECK_V1
+  liantong-api: CUCC_3RD_V1
+  lt-online-time: CUCC_ONLINE_CHECK_V1
+  lt-online-status: CUCC_STATUS_CHECK_V1
+  yin-hang-three: BANK_3RD_V1
+  yin-hang-four: BANK_4TH_V1
+  sleepTime: 5000
+  decode-three-element: CMCC_3RD_DECRYPT
+  ctcc-detail: CTCC_3RD_DETAIL_V1
+  jkxyUrl: http://jkxy.h11.site/gateway?api=credit.sec.data
+  photo-api: PORTRAIT_CHECK_V1
+  aesDecryptKey: C1AA8eh0116128nn
+  photoCheck:
+    url: http://47.101.143.14:85/ws/verification/IdCardPhoto.asmx/IdCard_Photo
+    hashcode: ea655a74532f4831a71e1458baa0b25c
+    key: T4lyPc
+swagger:
+  show: true