Browse Source

1、二维码图片识别解析逻辑调测

2、方法名变更
master
bjang03 6 months ago
parent
commit
01afee874e
  1. 1
      win-module-eam/win-module-eam-biz/src/main/java/com/win/module/eam/controller/licences/LicencesController.java
  2. 10
      win-module-eam/win-module-eam-biz/src/main/java/com/win/module/eam/service/licences/LicencesServiceImpl.java

1
win-module-eam/win-module-eam-biz/src/main/java/com/win/module/eam/controller/licences/LicencesController.java

@ -1,6 +1,5 @@
package com.win.module.eam.controller.licences; package com.win.module.eam.controller.licences;
import cn.hutool.extra.qrcode.QrCodeUtil;
import com.win.framework.common.pojo.CommonResult; import com.win.framework.common.pojo.CommonResult;
import com.win.module.eam.controller.licences.vo.GenerateLicenceReqVO; import com.win.module.eam.controller.licences.vo.GenerateLicenceReqVO;
import com.win.module.eam.service.licences.LicencesService; import com.win.module.eam.service.licences.LicencesService;

10
win-module-eam/win-module-eam-biz/src/main/java/com/win/module/eam/service/licences/LicencesServiceImpl.java

@ -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());
} }
} }

Loading…
Cancel
Save