el NPE
This commit is contained in:
parent
88c7918752
commit
dba9a9551d
@ -74,8 +74,6 @@
|
||||
<dependency>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>xhpc-common</artifactId>
|
||||
<version>3.0.0</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@ -116,4 +114,4 @@
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
</project>
|
||||
|
||||
@ -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<String, Object> 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) {
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user