交流刷卡;费率定时任务;naming..
This commit is contained in:
parent
a5323c7df4
commit
722b3b81ff
@ -213,8 +213,8 @@ public class HexUtils {
|
||||
// System.out.println(reverseHexInt("FF00"));
|
||||
// byte[] data1 = toBytes(reverseHex("10270000"));
|
||||
// System.out.println(toInteger(data1, 0, 4));
|
||||
System.out.println(reverseHexInt("6C3E0000"));
|
||||
System.out.println(reverseHexInt("80FA4800"));
|
||||
System.out.println(reverseHexInt("EA600000"));
|
||||
System.out.println(reverseHexInt("000060EA"));
|
||||
System.out.println(reverseHexInt("5D000000"));
|
||||
System.out.println(toHexInt(82));
|
||||
// System.out.println(toHexInt(3800));
|
||||
|
||||
@ -111,11 +111,11 @@ public class RealtimeDataLogic implements ServiceLogic {
|
||||
Map<String, Object> cacheOrder = REDIS.getCacheMap(orderkey);
|
||||
if (!orderNo.equals("00000000000000000000000000000000")) {
|
||||
if (statusInt == 3) {
|
||||
Boolean o = (Boolean) cachePile.get("ac.on");
|
||||
Boolean o = (Boolean) cacheGun.get("ac.on");
|
||||
if (o != null && !o) {
|
||||
R r = pileOrderService.pileStartup(orderNo, 1, "启动充电成功");
|
||||
if (r.getCode() == 200) {
|
||||
cachePile.put("ac.on", true);
|
||||
cacheGun.put("ac.on", true);
|
||||
}
|
||||
}
|
||||
List<CacheRealtimeData> realtimeDataList = (List<CacheRealtimeData>) cacheOrder.get("realtimeDataList");
|
||||
@ -266,7 +266,7 @@ public class RealtimeDataLogic implements ServiceLogic {
|
||||
|
||||
int sumPeriod = Integer.parseInt(hex.substring(0, 2), 16);
|
||||
List<ChargeDetails> cds = new ArrayList<>();
|
||||
for (int i = 10; i < sumPeriod * 16 + 10; i = i + 16) {
|
||||
for (int i = 10; i < sumPeriod * 16 + 10; i = i + 16) { // todo
|
||||
ChargeDetails cd = new ChargeDetails();
|
||||
cd.setDetailPower(HexUtils.reverseHexInt(hex.substring(i, i + 8)) / 100000.0);
|
||||
cd.setDetailElecMoney(HexUtils.reverseHexInt(hex.substring(i + 8, i + 16)) / 100000.0);
|
||||
|
||||
@ -29,10 +29,10 @@ public class RateModelTask {
|
||||
Long rateModelIdStation = stationDto.getRateModelId();
|
||||
if (rateModelIdStation != null) {
|
||||
Set<String> pks = stationDto.getPiles();
|
||||
if (pks != null) for (String pk : pks) {
|
||||
pk = "pile:".concat(pk);
|
||||
Long rateModelIdPile = REDIS.getCacheMapValue(pk, "rateModelId");
|
||||
if (pks != null) for (String pileNo : pks) {
|
||||
Long rateModelIdPile = REDIS.getCacheMapValue(pileNo, "rateModelId");
|
||||
if (!rateModelIdStation.equals(rateModelIdPile)) {
|
||||
String pk = "pile:".concat(pileNo);
|
||||
String gkPattern = ("gun:").concat(pk).concat("*");
|
||||
Collection<String> gks = REDIS.keys(gkPattern);
|
||||
boolean charging = false;
|
||||
@ -43,15 +43,15 @@ public class RateModelTask {
|
||||
}
|
||||
}
|
||||
if (!charging) {
|
||||
ClientHandler handler = getHandler(pk);
|
||||
ClientHandler handler = getHandler(pileNo);
|
||||
if (handler != null && handler.isOpen()) {
|
||||
String rsmsg = RateModelRequestLogic.translate(pk, rateModelIdStation, "0058",
|
||||
String rsmsg = RateModelRequestLogic.translate(pileNo, rateModelIdStation, "0058",
|
||||
REDIS.getCacheMapValue(pk, "version"));
|
||||
try {
|
||||
handler.sendClientBinary(HexUtils.toBytes(rsmsg));
|
||||
log.info("pile[{}] rate model[{}] sent ⚪", pk, rateModelIdStation);
|
||||
log.info("pile[{}] rate model[{}] sent ⚪ {}", pileNo, rateModelIdStation, rsmsg);
|
||||
} catch (IOException e) {
|
||||
log.error("pile[{}] rate model[{}] not sent ×", pk, rateModelIdStation);
|
||||
log.error("pile[{}] rate model[{}] not sent ×", pileNo, rateModelIdStation);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user