diff --git a/jsowell-admin/src/main/java/com/jsowell/api/uniapp/customer/PersonPileController.java b/jsowell-admin/src/main/java/com/jsowell/api/uniapp/customer/PersonPileController.java index bd39fc4dc..33c15729b 100644 --- a/jsowell-admin/src/main/java/com/jsowell/api/uniapp/customer/PersonPileController.java +++ b/jsowell-admin/src/main/java/com/jsowell/api/uniapp/customer/PersonPileController.java @@ -18,6 +18,7 @@ import com.jsowell.pile.vo.PileReservationInfoVO; import com.jsowell.pile.vo.uniapp.customer.PersonPileConnectorSumInfoVO; import com.jsowell.pile.vo.uniapp.customer.PersonPileRealTimeVO; import com.jsowell.pile.vo.uniapp.customer.PersonalPileInfoVO; +import com.jsowell.service.OrderService; import com.jsowell.service.PileService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -39,6 +40,9 @@ public class PersonPileController extends BaseController { @Autowired private PileService pileService; + @Autowired + private OrderService orderService; + @Autowired private PileMerchantInfoService pileMerchantInfoService; @@ -482,4 +486,27 @@ public class PersonPileController extends BaseController { logger.info("根据充电桩查询预约状态params:{}, result:{}", dto, JSON.toJSONString(response)); return response; } + + /** + * 保存蓝牙充电记录 + * http://localhost:8080/uniapp/personalPile/saveBluetoothChargingRecord + */ + @PostMapping("/saveBluetoothChargingRecord") + public RestApiResponse saveBluetoothChargingRecord(HttpServletRequest request, @RequestBody BluetoothChargingRecordDTO dto) { + RestApiResponse response = null; + try { + String memberId = getMemberIdByAuthorization(request); + dto.setMemberId(memberId); + orderService.saveBluetoothChargingRecord(dto); + response = new RestApiResponse<>(); + } catch (BusinessException e) { + logger.error("保存蓝牙充电记录error, params:{}", dto, e); + response = new RestApiResponse<>(e.getCode(), e.getMessage()); + } catch (Exception e) { + logger.error("保存蓝牙充电记录error, params:{}", dto, e); + response = new RestApiResponse<>(ReturnCodeEnum.CODE_QUERY_RESERVATION_STATUS_ERROR); + } + logger.info("保存蓝牙充电记录params:{}, result:{}", dto, JSON.toJSONString(response)); + return response; + } } diff --git a/jsowell-admin/src/main/java/com/jsowell/service/OrderService.java b/jsowell-admin/src/main/java/com/jsowell/service/OrderService.java index 6dcc3162f..5fff245d9 100644 --- a/jsowell-admin/src/main/java/com/jsowell/service/OrderService.java +++ b/jsowell-admin/src/main/java/com/jsowell/service/OrderService.java @@ -1445,4 +1445,11 @@ public class OrderService { // } return true; } + + /** + * 保存蓝牙充电记录 + * @param dto + */ + public void saveBluetoothChargingRecord(BluetoothChargingRecordDTO dto) { + } } diff --git a/jsowell-common/src/main/java/com/jsowell/common/util/YKCUtils.java b/jsowell-common/src/main/java/com/jsowell/common/util/YKCUtils.java index 6bb9e544d..ff345ecb4 100644 --- a/jsowell-common/src/main/java/com/jsowell/common/util/YKCUtils.java +++ b/jsowell-common/src/main/java/com/jsowell/common/util/YKCUtils.java @@ -368,6 +368,16 @@ public class YKCUtils { } } - + /** + * 根据的交易码获取当前soc + * @param transactionCode + */ + public static String getCurrentSOC(String transactionCode) { + String hashKey = CacheConstants.GET_THE_SOC + transactionCode; + RedisCache staticRedisCache = StaticRedisCache.staticRedisCache; + Map cacheMap = staticRedisCache.getCacheMap(hashKey); + // 获取最小值和最大值, 两个值中最大的为当前soc + return (String) cacheMap.get("max"); + } } diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/dto/BluetoothChargingRecordDTO.java b/jsowell-pile/src/main/java/com/jsowell/pile/dto/BluetoothChargingRecordDTO.java new file mode 100644 index 000000000..1feae3ff2 --- /dev/null +++ b/jsowell-pile/src/main/java/com/jsowell/pile/dto/BluetoothChargingRecordDTO.java @@ -0,0 +1,138 @@ +package com.jsowell.pile.dto; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Data; + +/** + * 蓝牙充电记录 + */ +@Data +public class BluetoothChargingRecordDTO { + // 会员id + private String memberId; + + // 充电流水号 + @JsonProperty(value = "TrxSN") + private String trxSN; + + // 桩号 + @JsonProperty(value = "PileNo") + private String pileNo; + + // 枪号 + @JsonProperty(value = "PlugNo") + private String plugNo; + + // 启动充电时间 + @JsonProperty(value = "StartTime") + private String startTime; + + // 结束充电时间 + @JsonProperty(value = "EndTime") + private String endTime; + + // 尖单价 + @JsonProperty(value = "PriceSharp") + private String priceSharp; + + // 尖电量 + @JsonProperty(value = "EnergySharp") + private String energySharp; + + // 记损尖电量 + @JsonProperty(value = "LossKwhSharp") + private String lossKwhSharp; + + // 尖金额 + @JsonProperty(value = "MoneySharp") + private String moneySharp; + + // 峰单价 + @JsonProperty(value = "PricePeak") + private String pricePeak; + + // 峰电量 + @JsonProperty(value = "EnergyPeak") + private String energyPeak; + + // 记损峰电量 + @JsonProperty(value = "LossKwhPeak") + private String lossKwhPeak; + + // 峰金额 + @JsonProperty(value = "MoneyPeak") + private String moneyPeak; + + // 平单价 + @JsonProperty(value = "PriceFlat") + private String priceFlat; + + // 平电量 + @JsonProperty(value = "EnergyFlat") + private String energyFlat; + + // 记损平电量 + @JsonProperty(value = "LossKwhFlat") + private String lossKwhFlat; + + // 平金额 + @JsonProperty(value = "MoneyFlat") + private String moneyFlat; + + // 谷单价 + @JsonProperty(value = "PriceValley") + private String priceValley; + + // 谷电量 + @JsonProperty(value = "EnergyValley") + private String energyValley; + + // 记损谷电量 + @JsonProperty(value = "LossKwhValley") + private String lossKwhValley; + + // 谷金额 + @JsonProperty(value = "MoneyValley") + private String moneyValley; + + + // 电表总起值 + @JsonProperty(value = "StartKwh") + private String startKwh; + + // 电表总止值 + @JsonProperty(value = "StopKwh") + private String stopKwh; + + // 总电量 + @JsonProperty(value = "TotalEnergy") + private String totalEnergy; + + // 记损总电量 + @JsonProperty(value = "LossTotalKwh") + private String lossTotalKwh; + + // 消费金额 + @JsonProperty(value = "TotalMoney") + private String totalMoney; + + // 电动汽车唯一标识 + @JsonProperty(value = "VIN") + private String vin; + + // 电动汽车唯一标识 + @JsonProperty(value = "StartMode") + private String startMode; + + // 交易日期时间 + @JsonProperty(value = "TradeTime") + private String tradeTime; + + // 停止原因 + @JsonProperty(value = "StopReason") + private String stopReason; + + // 物理卡号 + @JsonProperty(value = "PCardID") + private String pCardID; +}