|
|
@@ -263,6 +263,7 @@ public class DeviceMsgHandle {
|
|
|
if (result == 0x01) {
|
|
|
//启充成功上报充电开启成功
|
|
|
charngingPushFrame.startStatus(deviceConnection, bytes, port, result, 0x00);
|
|
|
+
|
|
|
} else {
|
|
|
//启机不成功,根据设备状态判断,并且要结束充电并上报订单
|
|
|
if (port == 1) {
|
|
|
@@ -291,11 +292,22 @@ public class DeviceMsgHandle {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ //发送一条103消息 等待状态上报
|
|
|
+ try{
|
|
|
+ DeviceParam dataParam = new DeviceParam();
|
|
|
+ dataParam.setDeviceId(imei);
|
|
|
+ dataParam.setCcid(imei);
|
|
|
+ deviceControlerService.sendPortDetailCmd(dataParam);
|
|
|
+ logger.info(statusServiceOne.getPileCode() + ":主动下发103消息");
|
|
|
+ }catch (Exception e){
|
|
|
+ logger.info(statusServiceOne.getPileCode() + ":主动下发103消息异常"+e.getMessage());
|
|
|
+ }
|
|
|
+
|
|
|
} else if (NormalChargeConstant.KEY_END_NOTICE.equals(type)) {
|
|
|
//停止充电通知触发情况:1.急停,收到停充时主动要去发停充,所以这里不能处理急停的交易订单;2.手动停充,正常的远程停止指令
|
|
|
// 1.设备已经在接收到云快充指令的时候进行了停充操作,2.结算订单,上报云快充停止回复
|
|
|
|
|
|
-
|
|
|
try {
|
|
|
|
|
|
JSONObject data = jsonObject.getJSONObject("real_data");
|
|
|
@@ -305,7 +317,7 @@ public class DeviceMsgHandle {
|
|
|
QueryWrapper<OrderStatus> orderStatusQueryWrapper = new QueryWrapper<>();
|
|
|
orderStatusQueryWrapper.eq("device_imei", imei).eq("guns_code", port).orderByDesc("create_time").last("limit 1");
|
|
|
OrderStatus statusServiceOne = orderStatusService.getOne(orderStatusQueryWrapper);
|
|
|
- if (NormalChargeConstant.KEY_END_NOTICE.equals(type)&&statusServiceOne.getReasonStopCharging()!=TransConstant.APP_REMOTE_STOP) {
|
|
|
+ if (statusServiceOne.getReasonStopCharging() != TransConstant.APP_REMOTE_STOP) {
|
|
|
DeviceParam dataParam = new DeviceParam();
|
|
|
dataParam.setDeviceId(imei);
|
|
|
dataParam.setCcid(imei);
|
|
|
@@ -327,7 +339,7 @@ public class DeviceMsgHandle {
|
|
|
JSONObject dataJson = redisCache.getCacheObject(RedisConstant.DEVICE_PORT_STATUS + imei);
|
|
|
Integer port_first_status = dataJson.getInteger("port_first_status");
|
|
|
Integer port_second_status = dataJson.getInteger("port_second_status");
|
|
|
- if (port_first_status == PortStatusConstant.EMERGENCY_STOP || port_first_status == PortStatusConstant.EMERGENCY_STOP) {
|
|
|
+ if (port_first_status == PortStatusConstant.EMERGENCY_STOP || port_second_status == PortStatusConstant.EMERGENCY_STOP) {
|
|
|
return false;
|
|
|
}
|
|
|
}
|