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");
|
||||
if (orderkey != null && orderNo.equals(orderkey.substring(6))) {// && (sts == null)) {
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
@ -73,19 +73,11 @@ public class OrderDataLogic implements ServiceLogic {
|
||||
String resultStr =
|
||||
"6815".concat(req.get("seqhex").toString()).concat("0040").concat(orderNo).concat(ServiceResult.HEX_00);
|
||||
resultStr = resultStr.concat(CRCCalculator.calcCrc(resultStr));
|
||||
if (orderNo.equals("00000000000000000000000000000000")) {
|
||||
return new ServiceResult(HexUtils.toBytes(resultStr), ServiceResult.OK);
|
||||
}
|
||||
final R r = pileOrderService.pileEndOrder(orderNo);
|
||||
if (r.getCode() == 200)
|
||||
return new ServiceResult(HexUtils.toBytes(resultStr), ServiceResult.OK);
|
||||
else {
|
||||
String msg = r.getMsg();
|
||||
if (msg != null && msg.contains("无效订单")) {
|
||||
chargingController.stopInvalidOrder(orderNo);
|
||||
}
|
||||
return new ServiceResult(ServiceResult.FAIL);
|
||||
if (orderNo.equals("00000000000000000000000000000000") || (r.getMsg() != null && r.getMsg().contains("无效订单"))) {
|
||||
log.error(">>INVALID order [{}] detected. MUST check the system.<<", orderNo);
|
||||
}
|
||||
return new ServiceResult(HexUtils.toBytes(resultStr), ServiceResult.OK);
|
||||
}
|
||||
|
||||
private CacheOrderData translate(OrderData orderData) throws InvocationTargetException, IllegalAccessException, InstantiationException {
|
||||
|
||||
@ -34,7 +34,7 @@ public class ChargingPileEventHandler implements ClientEventHandler {
|
||||
String pileNo = ChargingPileServer.getPileNo(handler);
|
||||
if (pileNo != null) {
|
||||
ChargingPileServer.disconnPileNGuns(pileNo);
|
||||
log.debug("<- ({}) - [{}] - {} ->", pileNo, handler.getName(),
|
||||
log.debug("<- ({}) -disconn- [{}] - {} ->", pileNo, handler.getName(),
|
||||
handler.getSocket().getRemoteSocketAddress().toString());
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user