|
@@ -96,6 +96,8 @@ public class ChannelServiceImpl implements ChannelService {
|
|
|
private String urlV4;
|
|
|
@Value("${supplier.urlV5}")
|
|
|
private String urlV5;
|
|
|
+ @Value("${supplier.urlV6}")
|
|
|
+ private String urlV6;
|
|
|
@Autowired
|
|
|
SupplierProperties supplierProperties;
|
|
|
@Autowired
|
|
@@ -1603,6 +1605,105 @@ public class ChannelServiceImpl implements ChannelService {
|
|
|
return ret;
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public ChannelTypeHandleResponseObject photoIdentityCheckV6New(HttpServletRequest request, String customBody, int outTime, String decodeType) {
|
|
|
+ ChannelTypeHandleResponseObject ret = new ChannelTypeHandleResponseObject();
|
|
|
+ ret.setIsCharge(Constant.INTERFACE_QUERY_NO_FEE);
|
|
|
+ ret.setCode(Constant.SUCCESS);
|
|
|
+ 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 <= SjjhConstant.PARA_ZERO) {
|
|
|
+ outTime = Constant.HTTPCLIENT_CONNECTTIMEOUT;
|
|
|
+ }
|
|
|
+ // sky 通道跳转机制改动-1 start
|
|
|
+ String channelId = request.getHeader("channelId");
|
|
|
+ String key="url6"+photoIdentityMethod;
|
|
|
+ LocalDateTime now = LocalDateTime.now();
|
|
|
+ String ymd = dateTimeFormatter.format(now);
|
|
|
+ String hashKey = "043-"+ymd;
|
|
|
+ // sky channelId是通道id
|
|
|
+ boolean flag = checkVisitCount(hashKey,key,supplierProperties.getUrl6PhotoUp(),channelId);
|
|
|
+ if(!flag){
|
|
|
+ countOver(ret,returnType);
|
|
|
+ return ret;
|
|
|
+ }
|
|
|
+ // sky 通道跳转机制改动-1 end
|
|
|
+ log.info("supplier10000043.photoIdentityCheckV6New---customBody={},outTime={}", customBody, outTime);
|
|
|
+ if (!decodeType.equals(SjjhConstant.DECODE_TYPE_COMMON)) {
|
|
|
+ customBody = decodeParams(ret, returnType, customBody, decodeType);
|
|
|
+ if (StringUtils.isBlank(customBody)) {
|
|
|
+ //sky 通道跳转机制改动-2 start
|
|
|
+ reduceVisitCount(hashKey,key);
|
|
|
+ //sky 通道跳转机制改动-2 end
|
|
|
+ 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(!checkParm(name,idCode,returnType,ret)){
|
|
|
+ //sky 通道跳转机制改动-3 start
|
|
|
+ reduceVisitCount(hashKey,key);
|
|
|
+ //sky 通道跳转机制改动-3 end
|
|
|
+ return ret;
|
|
|
+ }
|
|
|
+
|
|
|
+ JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
|
|
|
+ factory.setServiceClass(NciicServicesPortType.class);// 设置请求接口
|
|
|
+ factory.setAddress(urlV6);
|
|
|
+ NciicServicesPortType nciicServices = (NciicServicesPortType) factory.create(); // 创建客户端对象
|
|
|
+ // 设置客户端的配置信息,超时等.
|
|
|
+ Client proxy = ClientProxy.getClient(nciicServices);
|
|
|
+
|
|
|
+ common(request,proxy);
|
|
|
+ HTTPConduit conduit = (HTTPConduit) proxy.getConduit();
|
|
|
+ HTTPClientPolicy policy = new HTTPClientPolicy();
|
|
|
+ policy.setConnectionTimeout(outTime); // 连接超时时间
|
|
|
+ policy.setReceiveTimeout(outTime);// 请求超时时间.
|
|
|
+ policy.setConnection(ConnectionType.CLOSE);
|
|
|
+ conduit.setClient(policy);
|
|
|
+
|
|
|
+
|
|
|
+ String paramXml = SjjhConstant.PHOTO_IDENTITY_XML_TEMPLATE_V6
|
|
|
+ .replace("{fsd}", idCode.substring(0, 6))
|
|
|
+ .replace("{ywlx}", SjjhConstant.PARAMETER_YWLX_RS_V2)
|
|
|
+ .replace("{idCode}", idCode)
|
|
|
+ .replace("{name}", name)
|
|
|
+ .replace("{photo}", photo);
|
|
|
+ String result = nciicServices.nciicCompare(SjjhConstant.PHOTO_IDENTITY_SECRET_KEY_V6,paramXml);
|
|
|
+ log.info("photoIdentityCheck上游返回xml:{}", result);
|
|
|
+ //sky 通道跳转机制改动-4 start
|
|
|
+ //upstreamCode = setPhotoIdentityCheckResponse(ret, returnType, result);
|
|
|
+ upstreamCode = setPhotoIdentityCheckResponse(ret, returnType, result,key+SjjhConstant.key_subStr,channelId);
|
|
|
+ //sky 通道跳转机制改动-4 start
|
|
|
+ }catch (WebServiceException exception){
|
|
|
+ log.info("supplier10000043.photoIdentityCheckV6New接口-WebServiceException:{}", exception);
|
|
|
+ ErrorUtils.captureException(exception);
|
|
|
+ ret.setCode(Constant.REQUEST_TIMEOUT);
|
|
|
+ } catch (Exception ioe) {
|
|
|
+ log.info("supplier10000043.photoIdentityCheckV6New接口-Exception:{}", ioe);
|
|
|
+ ErrorUtils.captureException(ioe);
|
|
|
+ ret.setCode(Constant.FAIL);
|
|
|
+ }
|
|
|
+ request.setAttribute(Constant.LOG_UPSTREAM_RESPONSE_CODE, upstreamCode);
|
|
|
+ return ret;
|
|
|
+ }
|
|
|
+
|
|
|
private String setPhotoIdentityCheckResponse(ChannelTypeHandleResponseObject ret, String returnType, String responseXml) {
|
|
|
String resultCode;
|
|
|
|