top lose invalid order, not to stop it.
This commit is contained in:
parent
4e7db743fb
commit
b9afafac6a
@ -345,7 +345,7 @@ public class ChargingController {
|
|||||||
// Integer sts = REDIS.getCacheMapValue(orderkey, "sts");
|
// Integer sts = REDIS.getCacheMapValue(orderkey, "sts");
|
||||||
if (orderkey != null && orderNo.equals(orderkey.substring(6))) {// && (sts == null)) {
|
if (orderkey != null && orderNo.equals(orderkey.substring(6))) {// && (sts == null)) {
|
||||||
handler.sendClientBinary(msg);
|
handler.sendClientBinary(msg);
|
||||||
log.error("invalid orderNo [{}], stop msg sent to pile |{}|", pileNo, HexUtils.toHex(msg));
|
log.error("invalid orderNo [{}], stop msg sent to pile |{}|", orderNo, HexUtils.toHex(msg));
|
||||||
// REDIS.setCacheMapValue(orderkey, "sts", 1);
|
// REDIS.setCacheMapValue(orderkey, "sts", 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -73,19 +73,11 @@ public class OrderDataLogic implements ServiceLogic {
|
|||||||
String resultStr =
|
String resultStr =
|
||||||
"6815".concat(req.get("seqhex").toString()).concat("0040").concat(orderNo).concat(ServiceResult.HEX_00);
|
"6815".concat(req.get("seqhex").toString()).concat("0040").concat(orderNo).concat(ServiceResult.HEX_00);
|
||||||
resultStr = resultStr.concat(CRCCalculator.calcCrc(resultStr));
|
resultStr = resultStr.concat(CRCCalculator.calcCrc(resultStr));
|
||||||
if (orderNo.equals("00000000000000000000000000000000")) {
|
|
||||||
return new ServiceResult(HexUtils.toBytes(resultStr), ServiceResult.OK);
|
|
||||||
}
|
|
||||||
final R r = pileOrderService.pileEndOrder(orderNo);
|
final R r = pileOrderService.pileEndOrder(orderNo);
|
||||||
if (r.getCode() == 200)
|
if (orderNo.equals("00000000000000000000000000000000") || (r.getMsg() != null && r.getMsg().contains("无效订单"))) {
|
||||||
return new ServiceResult(HexUtils.toBytes(resultStr), ServiceResult.OK);
|
log.error(">>INVALID order [{}] detected. MUST check the system.<<", orderNo);
|
||||||
else {
|
|
||||||
String msg = r.getMsg();
|
|
||||||
if (msg != null && msg.contains("无效订单")) {
|
|
||||||
chargingController.stopInvalidOrder(orderNo);
|
|
||||||
}
|
|
||||||
return new ServiceResult(ServiceResult.FAIL);
|
|
||||||
}
|
}
|
||||||
|
return new ServiceResult(HexUtils.toBytes(resultStr), ServiceResult.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
private CacheOrderData translate(OrderData orderData) throws InvocationTargetException, IllegalAccessException, InstantiationException {
|
private CacheOrderData translate(OrderData orderData) throws InvocationTargetException, IllegalAccessException, InstantiationException {
|
||||||
|
|||||||
@ -34,7 +34,7 @@ public class ChargingPileEventHandler implements ClientEventHandler {
|
|||||||
String pileNo = ChargingPileServer.getPileNo(handler);
|
String pileNo = ChargingPileServer.getPileNo(handler);
|
||||||
if (pileNo != null) {
|
if (pileNo != null) {
|
||||||
ChargingPileServer.disconnPileNGuns(pileNo);
|
ChargingPileServer.disconnPileNGuns(pileNo);
|
||||||
log.debug("<- ({}) - [{}] - {} ->", pileNo, handler.getName(),
|
log.debug("<- ({}) -disconn- [{}] - {} ->", pileNo, handler.getName(),
|
||||||
handler.getSocket().getRemoteSocketAddress().toString());
|
handler.getSocket().getRemoteSocketAddress().toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user