|
@@ -62,7 +62,7 @@ public class ItfwServer {
|
|
|
* @return
|
|
|
*/
|
|
|
public String baseAgentApi(AgentApiParam param, Integer timeout) {
|
|
|
- return HttpUtil.post(baseUrl, JSON.toJSONString(param), timeout * 1000);
|
|
|
+ return HttpUtil.post(baseUrl, JSON.toJSONString(param), timeout);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -88,7 +88,7 @@ public class ItfwServer {
|
|
|
PctjkmProperties properties = new PctjkmProperties();
|
|
|
BeanUtil.copyProperties(pctjkmProperties, properties);
|
|
|
properties.setQuery(new BarcodeQueryDTO().setBar_code(barCode));
|
|
|
- log.info("健康码请求第三方健康码入参信息:{}", JSON.toJSONString(properties));
|
|
|
+ log.info("健康码请求第三方接口入参信息:{}", JSON.toJSONString(properties));
|
|
|
String body = this.baseAgentApi(properties, timeout);
|
|
|
log.info("请求健康码服务响应信息:{}", body);
|
|
|
if (StrUtil.isEmpty(body)) {
|
|
@@ -117,7 +117,7 @@ public class ItfwServer {
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
- String cacheKey = new StringBuilder().append(idNumber).append(ItfwConstant.PCTZDRY_KEY).toString();
|
|
|
+ String cacheKey = idNumber + ':' + ItfwConstant.PCTZDRY_KEY;
|
|
|
String cacheValue = stringRedisTemplate.opsForValue().get(cacheKey);
|
|
|
if (StrUtil.isNotEmpty(cacheValue)) {
|
|
|
log.info("重点人员服务走缓存读取,响应内容: {}", cacheValue);
|
|
@@ -174,7 +174,7 @@ public class ItfwServer {
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
- String cacheKey = new StringBuilder().append(idNumber).append(ItfwConstant.PCTZT_KEY).toString();
|
|
|
+ String cacheKey = idNumber + ':' + ItfwConstant.PCTZT_KEY;
|
|
|
String cacheValue = stringRedisTemplate.opsForValue().get(cacheKey);
|
|
|
if (StrUtil.isNotEmpty(cacheValue)) {
|
|
|
log.info("人员劣迹服务走缓存读取,响应内容: {}", cacheValue);
|
|
@@ -232,7 +232,7 @@ public class ItfwServer {
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
- String cacheKey = new StringBuilder().append(idNumber).append(ItfwConstant.PCTZFBA_KEY).toString();
|
|
|
+ String cacheKey = idNumber + ':' + ItfwConstant.PCTZFBA_KEY;
|
|
|
String cacheValue = stringRedisTemplate.opsForValue().get(cacheKey);
|
|
|
if (StrUtil.isNotEmpty(cacheValue)) {
|
|
|
log.info("执法办案服务走缓存读取,响应内容: {}", cacheValue);
|
|
@@ -293,7 +293,7 @@ public class ItfwServer {
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
- String cacheKey = new StringBuilder().append(idNumber).append(ItfwConstant.PCTDFK_KEY).toString();
|
|
|
+ String cacheKey = idNumber + ':' + ItfwConstant.PCTDFK_KEY;
|
|
|
String cacheValue = stringRedisTemplate.opsForValue().get(cacheKey);
|
|
|
if (StrUtil.isNotEmpty(cacheValue)) {
|
|
|
log.info("打防控信息服务走缓存读取,响应内容: {}", cacheValue);
|
|
@@ -350,7 +350,7 @@ public class ItfwServer {
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
- String cacheKey = new StringBuilder().append(idNumber).append(ItfwConstant.PCTJSRY_KEY).toString();
|
|
|
+ String cacheKey = idNumber + ':' + ItfwConstant.PCTJSRY_KEY;
|
|
|
String cacheValue = stringRedisTemplate.opsForValue().get(cacheKey);
|
|
|
if (StrUtil.isNotEmpty(cacheValue)) {
|
|
|
log.info("监所人员服务走缓存读取,响应内容: {}", cacheValue);
|
|
@@ -410,7 +410,7 @@ public class ItfwServer {
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
- String cacheKey = new StringBuilder().append(idNumber).append(ItfwConstant.PCTXDRY_KEY).toString();
|
|
|
+ String cacheKey = idNumber + ':' + ItfwConstant.PCTXDRY_KEY;
|
|
|
String cacheValue = stringRedisTemplate.opsForValue().get(cacheKey);
|
|
|
if (StrUtil.isNotEmpty(cacheValue)) {
|
|
|
log.info("吸毒人员服务走缓存读取,响应内容: {}", cacheValue);
|
|
@@ -471,7 +471,7 @@ public class ItfwServer {
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
- String cacheKey = new StringBuilder().append(idNumber).append(ItfwConstant.PCTQKRY_KEY).toString();
|
|
|
+ String cacheKey = idNumber + ':' + ItfwConstant.PCTQKRY_KEY;
|
|
|
String cacheValue = stringRedisTemplate.opsForValue().get(cacheKey);
|
|
|
if (StrUtil.isNotEmpty(cacheValue)) {
|
|
|
log.info("前科人员服务走缓存读取,响应内容: {}", cacheValue);
|
|
@@ -525,13 +525,13 @@ public class ItfwServer {
|
|
|
* @return
|
|
|
*/
|
|
|
private Integer times(String key) {
|
|
|
- String cacheKey = new StringBuilder().append(key).append(":times").toString();
|
|
|
- Integer times = 1;
|
|
|
+ String cacheKey = key + ":times";
|
|
|
+ int times = 1;
|
|
|
String timesStr = stringRedisTemplate.opsForValue().get(cacheKey);
|
|
|
if (timesStr == null) {
|
|
|
stringRedisTemplate.opsForValue().set(cacheKey, String.valueOf(times));//,DateUtil.endOfDay(DateUtil.date()).getTime() - DateUtil.date().getTime(), TimeUnit.MILLISECONDS);
|
|
|
} else {
|
|
|
- times = Integer.valueOf(timesStr) + 1;
|
|
|
+ times = Integer.parseInt(timesStr) + 1;
|
|
|
if (times > WebConstant.TIMEOUT_TIMES) {
|
|
|
Set<String> keys = stringRedisTemplate.keys(cacheKey + "*");
|
|
|
stringRedisTemplate.delete(keys);
|
|
@@ -554,7 +554,7 @@ public class ItfwServer {
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
- String cacheKey = new StringBuilder().append(idNumber).append(ItfwConstant.PCTRCHL_KEY).toString();
|
|
|
+ String cacheKey = idNumber + ':' + ItfwConstant.PCTRCHL_KEY;
|
|
|
String cacheValue = stringRedisTemplate.opsForValue().get(cacheKey);
|
|
|
if (StrUtil.isNotEmpty(cacheValue)) {
|
|
|
log.info("人车核录服务走缓存读取,响应内容: {}", cacheValue);
|
|
@@ -605,4 +605,5 @@ public class ItfwServer {
|
|
|
stringRedisTemplate.opsForValue().set(cacheKey, JSON.toJSONString(pctrchlDTO), DateUtil.endOfDay(DateUtil.date()).getTime() - DateUtil.date().getTime(), TimeUnit.MILLISECONDS);
|
|
|
return pctrchlDTO;
|
|
|
}
|
|
|
+
|
|
|
}
|