diff --git a/xhpc-modules/xhpc-card/pom.xml b/xhpc-modules/xhpc-card/pom.xml index fc94483f..4a4fbd9f 100644 --- a/xhpc-modules/xhpc-card/pom.xml +++ b/xhpc-modules/xhpc-card/pom.xml @@ -74,8 +74,6 @@ com.ruoyi xhpc-common - 3.0.0 - compile @@ -116,4 +114,4 @@ - \ No newline at end of file + diff --git a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/Calc.java b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/Calc.java index 3f309482..aa0a9740 100644 --- a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/Calc.java +++ b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/Calc.java @@ -19,8 +19,8 @@ public class Calc { test("-1 + 2", 1); test("2 * (3 * (4 + 5)) / 9 / 6", 1); - test("max(1, 2 + 3)", 5); - test("min(3 - 1, 1)", 1); +// test("max(1, 2 + 3)", 5); +// test("min(3 - 1, 1)", 1); Map map = new HashMap<>(); map.put("totalPower", new BigDecimal("400000.000000")); @@ -32,6 +32,14 @@ public class Calc { Expression expression = parser.parseExpression(ruleExpression); String rs = expression.getValue(stdContext, String.class); System.out.println(rs); + ruleExpression = "#totalPower + 500000"; + expression = parser.parseExpression(ruleExpression); + rs = expression.getValue(stdContext, String.class); + System.out.println(rs); + ruleExpression = "#totalPower * 0.03"; + expression = parser.parseExpression(ruleExpression); + rs = expression.getValue(stdContext, String.class); + System.out.println(rs); } private static void test(String s, double x) { diff --git a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcChargeOrderServiceImpl.java b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcChargeOrderServiceImpl.java index df20124a..951bacd5 100644 --- a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcChargeOrderServiceImpl.java +++ b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcChargeOrderServiceImpl.java @@ -313,7 +313,7 @@ public class XhpcChargeOrderServiceImpl extends BaseService implements IXhpcChar }catch (Exception e){ e.printStackTrace(); } - return AjaxResult.error(UserTypeUtil.LOGIN_TYPE, "请重新登录"); + return AjaxResult.error(UserTypeUtil.LOGIN_TYPE, "请确认设备网络状况正常和枪正确插好后重新尝试"); } @Override diff --git a/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/controller/ChargingController.java b/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/controller/ChargingController.java index 29e19c34..bf097f1c 100644 --- a/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/controller/ChargingController.java +++ b/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/controller/ChargingController.java @@ -234,11 +234,6 @@ public class ChargingController { String pileNo = startChargingData.getPileNo(); ClientHandler handler = ChargingPileServer.getHandler(pileNo); if (handler == null) { - try { - handler.closeConnection(); - } catch (Exception e) { - log.error("invalid conn [{}]", handler.getName()); - } return R.fail("充电桩没有连接到上次注册的服务器,请稍后再试一次"); } else if (!handler.isOpen()) { log.error("[{}]({}) connection lost", handler.getName(), pileNo); diff --git a/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/server/ChargingPileServer.java b/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/server/ChargingPileServer.java index bb45c23d..4d7aad20 100644 --- a/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/server/ChargingPileServer.java +++ b/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/server/ChargingPileServer.java @@ -135,10 +135,12 @@ public class ChargingPileServer { pileNo = pileNo.substring(pileNo.length() - 14); } ClientHandler handler = handlerMap.get(pileNo); - if (handler == null || !handler.isOpen()) { + if (handler == null) { + return; + } + if (!handler.isOpen()) { log.error("send message failed. [{}]({}) connection lost", handler.getName(), pileNo); removeHandler(pileNo); - return; } try { handler.sendClientBinary(msg);