mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-07-02 21:18:05 +08:00
update 修改充电站名称同步修改组织信息
This commit is contained in:
@@ -692,6 +692,26 @@ public class OrderBasicInfoServiceImpl implements IOrderBasicInfoService {
|
|||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("小程序发送充电停止推送消息 error", e);
|
logger.error("小程序发送充电停止推送消息 error", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
realTimeMonitorDataRedis2DB(orderBasicInfo.getTransactionCode());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 从redis中取出实时记录保存到表中
|
||||||
|
* 当订单完成的时候调用
|
||||||
|
*/
|
||||||
|
private void realTimeMonitorDataRedis2DB(String transactionCode) {
|
||||||
|
if (StringUtils.isBlank(transactionCode)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
List<RealTimeMonitorData> chargingRealTimeData = getChargingRealTimeData(transactionCode);
|
||||||
|
|
||||||
|
// 删除redis中缓存
|
||||||
|
String pileConnectorCode = transactionCode.substring(0, 16);
|
||||||
|
String redisKey = CacheConstants.PILE_REAL_TIME_MONITOR_DATA + pileConnectorCode + "_" + transactionCode;
|
||||||
|
redisCache.deleteObject(redisKey);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -467,8 +467,8 @@ public class PileConnectorInfoServiceImpl implements IPileConnectorInfoService {
|
|||||||
pileConnectorInfoVO.setChargingTime(realTimeMonitorData.getSumChargingTime()); // 已充时长
|
pileConnectorInfoVO.setChargingTime(realTimeMonitorData.getSumChargingTime()); // 已充时长
|
||||||
// 计算实时功率(单位:kw)
|
// 计算实时功率(单位:kw)
|
||||||
BigDecimal instantPowerTemp = outputVoltage.multiply(outputCurrent);
|
BigDecimal instantPowerTemp = outputVoltage.multiply(outputCurrent);
|
||||||
BigDecimal instantPower = instantPowerTemp.divide(new BigDecimal(1000));
|
BigDecimal instantPower = instantPowerTemp.divide(new BigDecimal(1000), 2, BigDecimal.ROUND_HALF_UP);
|
||||||
pileConnectorInfoVO.setInstantPower(instantPower.setScale(2, BigDecimal.ROUND_HALF_UP));
|
pileConnectorInfoVO.setInstantPower(instantPower);
|
||||||
log.info("枪口实时数据:{}", JSONObject.toJSONString(pileConnectorInfoVO));
|
log.info("枪口实时数据:{}", JSONObject.toJSONString(pileConnectorInfoVO));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user