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