mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-21 03:25:12 +08:00
Merge branch 'dev-new' into dev-new-rabbitmq
This commit is contained in:
@@ -12,6 +12,7 @@ import com.jsowell.common.constant.CacheConstants;
|
||||
import com.jsowell.common.constant.Constants;
|
||||
import com.jsowell.common.core.domain.ykc.GroundLockData;
|
||||
import com.jsowell.common.core.domain.ykc.RealTimeMonitorData;
|
||||
import com.jsowell.common.core.domain.ykc.YKCFrameTypeCode;
|
||||
import com.jsowell.common.core.page.PageResponse;
|
||||
import com.jsowell.common.core.redis.RedisCache;
|
||||
import com.jsowell.common.enums.ykc.PileConnectorDataBaseStatusEnum;
|
||||
@@ -82,6 +83,9 @@ public class PileConnectorInfoServiceImpl implements PileConnectorInfoService {
|
||||
@Autowired
|
||||
private ThirdPartyStationRelationService thirdPartyStationRelationService;
|
||||
|
||||
@Autowired
|
||||
private PileMsgRecordService pileMsgRecordService;
|
||||
|
||||
@Autowired
|
||||
private PileStationInfoService pileStationInfoService;
|
||||
|
||||
@@ -863,14 +867,25 @@ public class PileConnectorInfoServiceImpl implements PileConnectorInfoService {
|
||||
*/
|
||||
@Override
|
||||
public boolean checkPileOffLine(String pileSn) {
|
||||
boolean flag = false;
|
||||
// 获取桩最后连接时间,最后连接到平台的时间在3分钟之前,判定为离线
|
||||
String lastConnectionTime = redisCache.getCacheObject(CacheConstants.PILE_LAST_CONNECTION + pileSn);
|
||||
if (StringUtils.isBlank(lastConnectionTime)) {
|
||||
// 没有最后连接时间,返回离线
|
||||
return true;
|
||||
flag = true;
|
||||
} else {
|
||||
long l = DateUtils.intervalTime(lastConnectionTime, DateUtils.getDateTime());
|
||||
if (l > 3L) {
|
||||
// 超过3分钟,返回离线
|
||||
flag = true;
|
||||
}
|
||||
}
|
||||
long l = DateUtils.intervalTime(lastConnectionTime, DateUtils.getDateTime());
|
||||
return l > 3L;
|
||||
if (flag) {
|
||||
String type = YKCFrameTypeCode.PILE_LOG_OUT.getCode() + "";
|
||||
String jsonMsg = YKCFrameTypeCode.PILE_LOG_OUT.getValue() + ": 超过3分钟无通信, 判断离线!";
|
||||
pileMsgRecordService.save(pileSn, pileSn, type, jsonMsg, "");
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -225,12 +225,16 @@ public class PileMsgRecordServiceImpl implements PileMsgRecordService {
|
||||
// 枪口编号
|
||||
String pileConnectorCode = jsonObject.getString("pileSn") + jsonObject.getString("connectorCode");
|
||||
|
||||
String stopReason = jsonObject.getString("stopReasonMsg");
|
||||
|
||||
return "订单号:" + orderCode + ", " +
|
||||
"交易流水号:" + transactionCode + ", " +
|
||||
"枪口编号:" + pileConnectorCode + ", " +
|
||||
"充电度数:" + totalElectricity + ", " +
|
||||
"消费金额:" + consumptionAmount + ", " +
|
||||
"开始时间:" + startTime + ", " +
|
||||
"结束时间:" + endTime;
|
||||
"结束时间:" + endTime + ", " +
|
||||
"停止原因:" + stopReason
|
||||
;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,4 +46,9 @@ public class PersonPileConnectorSumInfoVO {
|
||||
* 来源(4G/BT) sourceType
|
||||
*/
|
||||
private String sourceType;
|
||||
|
||||
/**
|
||||
* 停止原因
|
||||
*/
|
||||
private String stopReasonMsg;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user