wsl 2 년 전
부모
커밋
e6b22e5f0d
1개의 변경된 파일7개의 추가작업 그리고 4개의 파일을 삭제
  1. 7 4
      svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/hz/HzInterfaceService.java

+ 7 - 4
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/hz/HzInterfaceService.java

@ -57,14 +57,17 @@ public class HzInterfaceService {
        return null;
        return null;
    }
    }
    public long expire(String key) {
        return redisTemplate.opsForValue().getOperations().getExpire(key);
    }
    private JSONObject getAreaApi(String date) throws Exception{
    private JSONObject getAreaApi(String date) throws Exception{
        baseHzInterfaceDictEntity dbkey = requestDBKEY();
        baseHzInterfaceDictEntity dbkey = requestDBKEY();
        if(!redisTemplate.hasKey(dbkey.getCode())){
        //判断是否过期 或者 是否不存在
        if(expire(dbkey.getCode()) > 0?false:true||redisTemplate.hasKey(dbkey.getCode())){
            PopBasicInfo();
            PopBasicInfo();
        }
        }
        //String privateKey = redisTemplate.opsForValue().get(dbkey.getCode());
        String requestSecret = redisTemplate.opsForValue().get(dbkey.getCode());
        //请求接口地址(政务网环境根据接口文档地址改动)
        //请求接口地址(政务网环境根据接口文档地址改动)
        String electricityTableSql = "SELECT url FROM base_hz_interface_dict WHERE `status` = 1 AND `code` = 'zfjddjlrdbjk'";
        String electricityTableSql = "SELECT url FROM base_hz_interface_dict WHERE `status` = 1 AND `code` = 'zfjddjlrdbjk'";
@ -72,7 +75,7 @@ public class HzInterfaceService {
        String requestTime = DSLUtils.dateToLong(new Date()) + "";//时间戳
        String requestTime = DSLUtils.dateToLong(new Date()) + "";//时间戳
        String sign = MD5Utils.encoderByMd5(dbkey.getAppKey()+ dbkey.getRequestSecret() + requestTime);
        String sign = MD5Utils.encoderByMd5(dbkey.getAppKey()+ requestSecret + requestTime);
        JSONObject json = new JSONObject();
        JSONObject json = new JSONObject();
        json.put("queryDate",date);
        json.put("queryDate",date);