新增刷新按钮

This commit is contained in:
三丙
2025-09-27 19:01:50 +08:00
parent a1e0a09320
commit 2a2fd21bdb
20 changed files with 226 additions and 80 deletions

View File

@@ -82,7 +82,7 @@ public class GunController extends BaseController {
// 通过AttributeService获取充电枪运行状态
ListenableFuture<Optional<AttributeKvEntry>> attributeFuture =
attributeService.find(gun.getId(), AttrKeyEnum.GUN_RUN_STATUS.getCode());
Optional<AttributeKvEntry> attributeResult = attributeFuture.get();
String status = null;
if (attributeResult.isPresent()) {

View File

@@ -94,7 +94,7 @@ public class PileController extends BaseController {
// 通过AttributeService获取充电桩状态
ListenableFuture<Optional<AttributeKvEntry>> attributeFuture =
attributeService.find(pile.getId(), AttrKeyEnum.STATUS.getCode());
Optional<AttributeKvEntry> attributeResult = attributeFuture.get();
String status = null;
if (attributeResult.isPresent()) {

View File

@@ -23,7 +23,7 @@ import sanbing.jcpp.proto.gen.DownlinkProto.*;
/**
* RPC控制器 - 通用化的充电桩下行指令接口
*
*
* @author 九筒
*/
@RestController
@@ -156,7 +156,7 @@ public class RpcController extends BaseController {
/**
* 处理离线卡余额更新指令
*/
private void handleOfflineCardBalanceUpdate(JsonNode parameter) {
private void handleOfflineCardBalanceUpdate(JsonNode parameter) throws Exception {
OfflineCardBalanceUpdateRequest request = JacksonUtil.fromJson(parameter, OfflineCardBalanceUpdateRequest.class);
pileProtocolService.offlineCardBalanceUpdateRequest(request);
}

View File

@@ -12,7 +12,7 @@ import lombok.Data;
/**
* 重启充电桩DTO
*
*
* @author 九筒
*/
@Data

View File

@@ -13,7 +13,7 @@ import sanbing.jcpp.proto.gen.DownlinkProto.SetPricingRequest;
/**
* 设置计费策略DTO
*
*
* @author 九筒
*/
@Data

View File

@@ -14,7 +14,7 @@ import java.math.BigDecimal;
/**
* 启动充电DTO
*
*
* @author 九筒
*/
@Data

View File

@@ -11,7 +11,7 @@ import lombok.Data;
/**
* 停止充电DTO
*
*
* @author 九筒
*/
@Data

View File

@@ -14,7 +14,7 @@ import java.time.LocalDateTime;
/**
* 时间同步DTO
*
*
* @author 九筒
*/
@Data

View File

@@ -13,7 +13,7 @@ import lombok.Data;
/**
* RPC请求参数
*
*
* @author 九筒
*/
@Data

View File

@@ -198,7 +198,7 @@ public class DefaultGunService implements GunService {
// 保存充电枪状态到属性表
saveGunStatusChange(gun.getId(), dbStatus.name(), ts);
log.info("充电枪状态更新成功: 桩编码={}, 枪编号={}, 原状态={}, 新状态={}",
log.info("充电枪状态更新成功: 桩编码={}, 枪编号={}, 原状态={}, 新状态={}",
pileCode, gunNo, currentStatus, dbStatus);
// 根据充电枪状态判断是否需要更新充电桩状态

View File

@@ -630,7 +630,7 @@ public class DefaultPileProtocolService implements PileProtocolService {
String additionalInfo = bmsHandshakeProto.getAdditionalInfo();
log.info("BMS充电握手信息: 交易流水号: {}, 桩编码: {}, 枪号: {}, 车辆VIN: {}, BMS协议版本: {}, " +
"电池类型: {}, 电池容量: {}Ah, 附加信息: {}",
"电池类型: {}, 电池容量: {}Ah, 附加信息: {}",
tradeNo, pileCode, gunNo, carVinCode, bmsProtocolVersion,
bmsBatteryType, bmsPowerCapacity, additionalInfo);

View File

@@ -101,8 +101,8 @@
<!-- 根据充电桩编码和充电枪编号查询充电枪 -->
<select id="selectByPileCodeAndGunNo" resultType="sanbing.jcpp.app.dal.entity.Gun">
SELECT g.* FROM t_gun g
INNER JOIN t_pile p ON g.pile_id = p.id
SELECT g.* FROM t_gun g
INNER JOIN t_pile p ON g.pile_id = p.id
WHERE p.pile_code = #{pileCode}
AND g.gun_no = #{gunNo}
</select>
@@ -139,8 +139,8 @@
<!-- 状态相关属性 -->
a_run_status.str_v as run_status
FROM t_gun g
FROM t_gun g
<!-- LEFT JOIN 获取充电站信息 -->
LEFT JOIN t_station s ON g.station_id = s.id

View File

@@ -36,9 +36,9 @@
<!-- 充电枪数量 - 使用LEFT JOIN优化子查询 -->
COALESCE(g.gun_count, 0) as gun_count
FROM t_pile p
FROM t_pile p
<!-- 单次JOIN获取所有属性避免多次JOIN -->
LEFT JOIN t_attr a ON (
a.entity_id = p.id AND