|
|
@@ -2,6 +2,7 @@ package com.zsElectric.boot.business.service.impl;
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.zsElectric.boot.business.converter.BannerInfoConverter;
|
|
|
import com.zsElectric.boot.business.mapper.*;
|
|
|
@@ -759,7 +760,7 @@ public class AppletHomeServiceImpl implements AppletHomeService {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public BigDecimal calculateAvailableChargingAmount(Long connectorId) {
|
|
|
+ public BigDecimal calculateAvailableChargingAmount(String connectorCode) {
|
|
|
// 获取当前登录用户ID
|
|
|
Long userId = SecurityUtils.getUserId();
|
|
|
if (userId == null) {
|
|
|
@@ -798,9 +799,10 @@ public class AppletHomeServiceImpl implements AppletHomeService {
|
|
|
}
|
|
|
|
|
|
// 3. 查询充电接口、设备、站点信息
|
|
|
- ThirdPartyConnectorInfo connectorInfo = thirdPartyConnectorInfoMapper.selectById(connectorId);
|
|
|
+ ThirdPartyConnectorInfo connectorInfo = thirdPartyConnectorInfoMapper.selectOne(Wrappers.<ThirdPartyConnectorInfo>lambdaQuery()
|
|
|
+ .eq(ThirdPartyConnectorInfo::getConnectorId,connectorCode).last("LIMIT 1"));
|
|
|
if (connectorInfo == null) {
|
|
|
- log.warn("充电接口不存在 - connectorId: {}", connectorId);
|
|
|
+ log.warn("充电接口不存在 - connectorId: {}", connectorCode);
|
|
|
return BigDecimal.ZERO;
|
|
|
}
|
|
|
|
|
|
@@ -973,7 +975,7 @@ public class AppletHomeServiceImpl implements AppletHomeService {
|
|
|
|
|
|
log.info("可用充电金额计算完成 - userId: {}, connectorId: {}, userBalance: {}, safetyFee: {}, " +
|
|
|
"totalOpFeeCost: {}, totalValueAddedCost: {}, availableAmount: {}",
|
|
|
- userId, connectorId, userBalance, safetyFee, totalOpFeeCost, totalValueAddedCost, availableAmount);
|
|
|
+ userId, connectorCode, userBalance, safetyFee, totalOpFeeCost, totalValueAddedCost, availableAmount);
|
|
|
|
|
|
return availableAmount;
|
|
|
}
|