|
@@ -40,6 +40,11 @@ public class IllegalInfoServiceImpl implements IllegalInfoService {
|
|
|
|
|
|
private static final Log CHARGE_LOGGER = LogFactory.getLog("CHARGE_LOGGER");
|
|
|
|
|
|
+ /**
|
|
|
+ * 社会风险预警-超时返回一致
|
|
|
+ * @param requestParams 姓名 身份证号 流水号
|
|
|
+ * @return 结果
|
|
|
+ */
|
|
|
@Override
|
|
|
public IllegalInfoResult checkIllegalInfo(IllegalInfoRequestParam requestParams) {
|
|
|
String body = JSON.toJSONString(requestParams);
|
|
@@ -220,6 +225,11 @@ public class IllegalInfoServiceImpl implements IllegalInfoService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 社会风险预警-超时跳转接口
|
|
|
+ * @param requestParams 姓名 身份证号 流水号
|
|
|
+ * @return 结果
|
|
|
+ */
|
|
|
@Override
|
|
|
public IllegalInfoResult checkIllegalInfoV2(IllegalInfoRequestParam requestParams) {
|
|
|
String body = JSON.toJSONString(requestParams);
|
|
@@ -260,4 +270,38 @@ public class IllegalInfoServiceImpl implements IllegalInfoService {
|
|
|
}
|
|
|
return illegalInfoResult;
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 社会风险预警
|
|
|
+ * @param requestParams 姓名 身份证号 流水号
|
|
|
+ * @return 结果
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public IllegalInfoResult checkIllegalInfoV3(IllegalInfoRequestParam requestParams) {
|
|
|
+ String body = JSON.toJSONString(requestParams);
|
|
|
+
|
|
|
+ Long startTime = System.currentTimeMillis();
|
|
|
+ String result = OkHttpUtil.doPost(illegalInfoUrl, body, CommonConstant.PERSON_TIME_OUT);
|
|
|
+ log.info("调用上游接口-流水号:{}, 入参:{}, 返回:{}, 时延:{}", requestParams.getTraceId(), body, result, System.currentTimeMillis() - startTime);
|
|
|
+ if (StringUtils.isBlank(result)) {
|
|
|
+ log.info("调用上游接口-流水号:{}, 入参:{}, 请求上游失败无返回", requestParams.getTraceId(), body);
|
|
|
+ stringRedisTemplate.boundValueOps(CommonConstant.PERSON_ILLEGAL_INFO_TIME_OUT).increment();
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+
|
|
|
+ IllegalInfoResult illegalInfoResult = JSON.toJavaObject(JSON.parseObject(result), IllegalInfoResult.class);
|
|
|
+ // 返回4个参数,code0表示结果正常,其他表示异常
|
|
|
+ if (!illegalInfoResult.getCode().equals("0")
|
|
|
+ || illegalInfoResult.getIsDrugs().equals("2")
|
|
|
+ || illegalInfoResult.getIsEscape().equals("2")
|
|
|
+ || illegalInfoResult.getIsPedigree().equals("2")) {
|
|
|
+ // 查询错误,不计费
|
|
|
+ CHARGE_LOGGER.info(JSON.toJSONString(new IllegalInfoChargeObject(illegalInfoResult, false, requestParams.getTraceId())));
|
|
|
+ stringRedisTemplate.boundValueOps(CommonConstant.PERSON_ILLEGAL_INFO_QUERY_FAILED).increment();
|
|
|
+ } else {
|
|
|
+ // 查询成功,计费
|
|
|
+ CHARGE_LOGGER.info(JSON.toJSONString(new IllegalInfoChargeObject(illegalInfoResult, true, requestParams.getTraceId())));
|
|
|
+ }
|
|
|
+ return illegalInfoResult;
|
|
|
+ }
|
|
|
}
|