|
@ -85,7 +85,7 @@ public class LicencesServiceImpl implements LicencesService { |
|
|
if (dataJson.isEmpty()) { |
|
|
if (dataJson.isEmpty()) { |
|
|
throw exception(ENCRYPTION_STR_FORMAT_IS_ERROR); |
|
|
throw exception(ENCRYPTION_STR_FORMAT_IS_ERROR); |
|
|
} |
|
|
} |
|
|
//todo 更新到redis并使用发布订阅通知其他pods
|
|
|
//todo 更新到redis并使用发布订阅通知其他pods拉取过滤路径
|
|
|
redisTemplate.opsForValue().set(LICENCES_UPDATE, dataJson.toJSONString()); |
|
|
redisTemplate.opsForValue().set(LICENCES_UPDATE, dataJson.toJSONString()); |
|
|
redisTemplate.convertAndSend(LICENCES_UPDATE, 1); |
|
|
redisTemplate.convertAndSend(LICENCES_UPDATE, 1); |
|
|
} catch (Exception e) { |
|
|
} catch (Exception e) { |
|
@ -100,17 +100,17 @@ public class LicencesServiceImpl implements LicencesService { |
|
|
setSecretKey(secretKey); |
|
|
setSecretKey(secretKey); |
|
|
List data = new ArrayList(); |
|
|
List data = new ArrayList(); |
|
|
MD5 md5 = MD5.create(); |
|
|
MD5 md5 = MD5.create(); |
|
|
|
|
|
//todo 从数据库表中取业主各子系统到期时间,路径通过拦截器获取第一层进行MD5验证,时间只能用对称加密解析后做对比
|
|
|
data.add(new JSONObject(){{ |
|
|
data.add(new JSONObject(){{ |
|
|
put(md5.digestHex("/MES"),encrypt("2025-10-10 00:00:00",secretKey)); |
|
|
put(md5.digestHex("/MES"),encrypt("2025-10-10 00:00:00",secretKey)); |
|
|
}}.toJSONString()); |
|
|
}}); |
|
|
data.add(new JSONObject(){{ |
|
|
data.add(new JSONObject(){{ |
|
|
put(md5.digestHex("/WMS"),encrypt("2025-10-10 00:00:00",secretKey)); |
|
|
put(md5.digestHex("/WMS"),encrypt("2025-10-10 00:00:00",secretKey)); |
|
|
}}.toJSONString()); |
|
|
}}); |
|
|
setData(encrypt(JSONObject.toJSONString(data),secretKey)); |
|
|
setData(encrypt(JSONObject.toJSONString(data),secretKey)); |
|
|
}}; |
|
|
}}; |
|
|
QrConfig config = new QrConfig(300, 300); |
|
|
QrConfig config = new QrConfig(300, 300); |
|
|
config.setErrorCorrection(com.google.zxing.qrcode.decoder.ErrorCorrectionLevel.M); // 设置纠错级别
|
|
|
config.setErrorCorrection(com.google.zxing.qrcode.decoder.ErrorCorrectionLevel.M); // 设置纠错级别
|
|
|
// 或者直接输出到流
|
|
|
QrCodeUtil.generate(JSONObject.toJSONString(licencesMessage), config, "", response.getOutputStream()); |
|
|
QrCodeUtil.generate(JSONObject.toJSONString(licencesMessage), config, "png", response.getOutputStream()); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|