This commit is contained in:
zz 2021-12-07 23:45:09 +08:00
parent 6507640b14
commit 30acfe8ce9

View File

@ -31,7 +31,7 @@ public class RateModelTask {
Set<String> pks = stationDto.getPiles(); Set<String> pks = stationDto.getPiles();
if (pks != null) for (String pk : pks) { if (pks != null) for (String pk : pks) {
Long rateModelIdPile = REDIS.getCacheMapValue(pk, "rateModelId"); Long rateModelIdPile = REDIS.getCacheMapValue(pk, "rateModelId");
if (rateModelIdPile == null || !rateModelIdStation.equals(rateModelIdPile)) { if (!rateModelIdStation.equals(rateModelIdPile)) {
String gkPattern = ("gun:").concat(pk).concat("*"); String gkPattern = ("gun:").concat(pk).concat("*");
Collection<String> gks = REDIS.keys(gkPattern); Collection<String> gks = REDIS.keys(gkPattern);
boolean charging = false; boolean charging = false;
@ -47,8 +47,9 @@ public class RateModelTask {
String rsmsg = RateModelRequestLogic.translate(pk.substring(5), rateModelIdStation, "0058"); String rsmsg = RateModelRequestLogic.translate(pk.substring(5), rateModelIdStation, "0058");
try { try {
handler.sendClientBinary(HexUtils.toBytes(rsmsg)); handler.sendClientBinary(HexUtils.toBytes(rsmsg));
log.info("pile[{}] rate model[{}] sent ⚪", pk, rateModelIdPile);
} catch (IOException e) { } catch (IOException e) {
log.error("{} rate model not sent.", pk); log.error("pile[{}] rate model[{}] not sent ×", pk, rateModelIdPile);
} }
} }
} }