From 4a5f38b6aee88cc30eb8f8913f36672a81a6af10 Mon Sep 17 00:00:00 2001 From: yuyang <2265829957@qq.com> Date: Fri, 15 Sep 2023 15:09:04 +0800 Subject: [PATCH] =?UTF-8?q?=E6=88=90=E9=83=BD=E5=B8=82=E5=B9=B3=E5=8F=B0?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../xhpc/evcs/cdjgpc/dto/CDChargeDetails.java | 57 ++++ .../dto/CDConnectorChargeStatusInfo.java | 133 ++++++++ .../xhpc/evcs/cdjgpc/dto/CDEquipmentInfo.java | 130 ++++++++ .../com/xhpc/evcs/cdjgpc/dto/CDOrderInfo.java | 174 ++++++++++ .../xhpc/evcs/cdjgpc/dto/CDStationInfo.java | 309 ++++++++++++++++++ .../cdjgpc/dto/CDStationInfoResponse.java | 19 ++ .../evcs/cdjgpc/dto/EquipmentOwnerInfo.java | 42 +++ .../xhpc/evcs/domain/XhpcChargingPile.java | 154 +++++++++ .../CDNotificationStationInfoController.java | 100 ++++++ .../java/com/xhpc/evcs/config/EvcsFilter.java | 3 +- .../xhpc/evcs/config/InterceptorConfig.java | 2 +- ...NotificationChargeOrderInfo4BonusTask.java | 2 +- sql/v2.2.sql | 45 +++ .../XhpcChargingPileController.java | 9 + .../XhpcChargingStationController.java | 9 + .../service/IXhpcChargingPileService.java | 3 + .../service/IXhpcChargingStationService.java | 2 + .../service/XhpcChargingPileServiceImpl.java | 18 + .../XhpcChargingStationServiceImpl.java | 5 + .../mapper/XhpcChargingPileMapper.xml | 28 +- .../mapper/XhpcChargingStationMapper.xml | 74 +++-- .../common/api/ChargingStationService.java | 24 ++ .../com/xhpc/common/api/PowerPileService.java | 3 + .../common/api/dto/ChargingStationDto.java | 20 ++ .../ChargingStationServiceFactory.java | 42 +++ .../api/factory/PowerPileFallbackFactory.java | 5 + .../xhpc/common/domain/XhpcChargingPile.java | 92 ++++++ .../xhpc/general/constant/AliyunTemplate.java | 10 + .../constant/AliyunTemplateKeyWord.java | 5 + .../general/controller/XhpcSmsController.java | 3 + .../general/service/XhpcSmsServiceImpl.java | 38 +++ .../com/xhpc/general/util/sms/SmsUtil.java | 15 +- .../XhpcRefundOriginalOrderController.java | 254 +++++++++----- .../mapper/XhpcRefundOriginalOrderMapper.java | 6 +- .../IXhpcRefundOriginalOrderService.java | 5 + .../XhpcRefundOriginalOrderServiceImpl.java | 172 ++++++---- .../mapper/XhpcRefundOriginalOrderMapper.xml | 111 ++++++- .../pp/controller/ChargingController.java | 33 +- .../xhpc/pp/controller/PileController.java | 70 +++- .../xhpc/pp/controller/StationController.java | 62 +++- .../logic/BmsChargingCompletedDataLogic.java | 4 + .../pp/logic/RemoteStopReplyDataLogic.java | 5 +- .../com/xhpc/pp/logic/ServiceMainLogic.java | 4 + .../pp/mapper/XhpcDeviceMessageMapper.java | 2 + .../pp/server/ChargingPileBinaryHandler.java | 19 +- .../mapper/XhpcDeviceMessageMapper.xml | 130 +++++++- .../resources/mapper/XhpcAppUserMapper.xml | 1 + .../resources/mapper/XhpcCommunityMapper.xml | 2 + 48 files changed, 2261 insertions(+), 194 deletions(-) create mode 100644 evcs-modules/evcs-common/src/main/java/com/xhpc/evcs/cdjgpc/dto/CDChargeDetails.java create mode 100644 evcs-modules/evcs-common/src/main/java/com/xhpc/evcs/cdjgpc/dto/CDConnectorChargeStatusInfo.java create mode 100644 evcs-modules/evcs-common/src/main/java/com/xhpc/evcs/cdjgpc/dto/CDEquipmentInfo.java create mode 100644 evcs-modules/evcs-common/src/main/java/com/xhpc/evcs/cdjgpc/dto/CDOrderInfo.java create mode 100644 evcs-modules/evcs-common/src/main/java/com/xhpc/evcs/cdjgpc/dto/CDStationInfo.java create mode 100644 evcs-modules/evcs-common/src/main/java/com/xhpc/evcs/cdjgpc/dto/CDStationInfoResponse.java create mode 100644 evcs-modules/evcs-common/src/main/java/com/xhpc/evcs/cdjgpc/dto/EquipmentOwnerInfo.java create mode 100644 evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/cdjgpc/api/CDNotificationStationInfoController.java create mode 100644 sql/v2.2.sql create mode 100644 xhpc-modules/xhpc-common/src/main/java/com/xhpc/common/api/ChargingStationService.java create mode 100644 xhpc-modules/xhpc-common/src/main/java/com/xhpc/common/api/factory/ChargingStationServiceFactory.java diff --git a/evcs-modules/evcs-common/src/main/java/com/xhpc/evcs/cdjgpc/dto/CDChargeDetails.java b/evcs-modules/evcs-common/src/main/java/com/xhpc/evcs/cdjgpc/dto/CDChargeDetails.java new file mode 100644 index 00000000..76b43eb1 --- /dev/null +++ b/evcs-modules/evcs-common/src/main/java/com/xhpc/evcs/cdjgpc/dto/CDChargeDetails.java @@ -0,0 +1,57 @@ +package com.xhpc.evcs.cdjgpc.dto; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import lombok.Data; + +/** + * @author yuyang + * @date 2023-09-07 15:41 + */ +@JsonPropertyOrder({ + "DetailStartTime", + "DetailEndTime", + "ElecPrice", + "SevicePrice", + "DetailPower", + "DetailElecMoney", + "DetailSeviceMoney" +}) +@Data +public class CDChargeDetails { + /** + * 开始时间 + */ + @JsonProperty("DetailStartTime") + public String detailStartTime; + /** + * 结束时间 + */ + @JsonProperty("DetailEndTime") + public String detailEndTime; + /** + * 时段电价 + */ + @JsonProperty("ElecPrice") + public Double elecPrice; + /** + * 时段服务 费价格 + */ + @JsonProperty("SevicePrice") + public Double sevicePrice; + /** + * 时段充电量 + */ + @JsonProperty("DetailPower") + public Double detailPower; + /** + * 时段电费 + */ + @JsonProperty("DetailElecMoney") + public Double detailElecMoney; + /** + * 时段服务 费 + */ + @JsonProperty("DetailSeviceMoney") + public Double detailSeviceMoney; +} diff --git a/evcs-modules/evcs-common/src/main/java/com/xhpc/evcs/cdjgpc/dto/CDConnectorChargeStatusInfo.java b/evcs-modules/evcs-common/src/main/java/com/xhpc/evcs/cdjgpc/dto/CDConnectorChargeStatusInfo.java new file mode 100644 index 00000000..f249276e --- /dev/null +++ b/evcs-modules/evcs-common/src/main/java/com/xhpc/evcs/cdjgpc/dto/CDConnectorChargeStatusInfo.java @@ -0,0 +1,133 @@ +package com.xhpc.evcs.cdjgpc.dto; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import lombok.Data; + +/** + * @author yuyang + * @date 2023-09-07 15:16 + */ +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "StartChargeSeq", + "ConnectorID", + "ConnectorStatus", + "Vin", + "CurrentA", + "CurrentB", + "CurrentC", + "VoltageA", + "VoltageB", + "VoltageC", + "Soc", + "StartTime", + "EndTime", + "PushTime", + "LastPushTime", + "TotalPower", + "ElecMoney", + "SeviceMoney", + "TotalMoney" +}) +@Data +public class CDConnectorChargeStatusInfo { + /** + * 充电订单号 + */ + @JsonProperty("StartChargeSeq") + public String startChargeSeq; + /** + * 充电设备接 口编码 + */ + @JsonProperty("ConnectorID") + public String connectorID; + /** + * 充电设备接 口状态 + */ + @JsonProperty("ConnectorStatus") + public Integer connectorStatus; + /** + * 车辆识别码 + */ + @JsonProperty("Vin") + public String vin; + /** + * A 相电流 + */ + @JsonProperty("CurrentA") + public Double currentA; + /** + * B 相电流 + */ + @JsonProperty("CurrentB") + public Double currentB; + /** + * C 相电流 + */ + @JsonProperty("CurrentC") + public Double currentC; + /** + * A 相电压 + */ + @JsonProperty("VoltageA") + public Double voltageA; + /** + * B 相电压 + */ + @JsonProperty("VoltageB") + public Double voltageB; + /** + * C 相电压 + */ + @JsonProperty("VoltageC") + public Double voltageC; + /** + * 电池剩余电量 + */ + @JsonProperty("Soc") + public Double soc; + /** + * 开始充电时间 + */ + @JsonProperty("StartTime") + public String startTime; + /** + * 本次采样时间 + */ + @JsonProperty("EndTime") + public String endTime; + /** + * 本次推送时间 + */ + @JsonProperty("PushTime") + public String pushTime; + /** + * 上次推送时 间 + */ + @JsonProperty("LastPushTime") + public String lastPushTime; + /** + * 累计充电量 + */ + @JsonProperty("TotalPower") + public Double totalPower; + /** + * 累计电费 + */ + @JsonProperty("ElecMoney") + public Double elecMoney; + /** + * 累计服务费 + */ + @JsonProperty("SeviceMoney") + public Double seviceMoney; + /** + * 累计总金额 + */ + @JsonProperty("TotalMoney") + public Double totalMoney; + +} diff --git a/evcs-modules/evcs-common/src/main/java/com/xhpc/evcs/cdjgpc/dto/CDEquipmentInfo.java b/evcs-modules/evcs-common/src/main/java/com/xhpc/evcs/cdjgpc/dto/CDEquipmentInfo.java new file mode 100644 index 00000000..68971d0d --- /dev/null +++ b/evcs-modules/evcs-common/src/main/java/com/xhpc/evcs/cdjgpc/dto/CDEquipmentInfo.java @@ -0,0 +1,130 @@ +package com.xhpc.evcs.cdjgpc.dto; + +import com.fasterxml.jackson.annotation.*; +import com.xhpc.evcs.dto.ConnectorInfo; +import com.xhpc.evcs.dto.EquipmentInfo; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import javax.persistence.Transient; +import java.util.List; + +/** + * @author yuyang + * @date 2023-09-07 14:40 + */ +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "EquipmentID", + "ManufacturerID", + "ManufacturerName", + "EquipmentModel", + "EquipmentProductCode", + "TransformerID", + "ProductionDate", + "ConstructionTime", + "EquipmentType", + "EquipmentStatus", + "EquipmentPurpose", + "EquipmentPower", + "NewNationalStandard", + "ConnectorInfos", + "VinFlag" +}) +@Data +@JsonAutoDetect(fieldVisibility = JsonAutoDetect.Visibility.ANY, getterVisibility = JsonAutoDetect.Visibility.NONE, + setterVisibility = JsonAutoDetect.Visibility.NONE, creatorVisibility = JsonAutoDetect.Visibility.NONE) +public class CDEquipmentInfo { + + /** + * 设备编码 + */ + @JsonProperty("EquipmentID") + public String equipmentID; + /** + * 设备生产商组织机构代码 + */ + @JsonProperty("ManufacturerID") + public String manufacturerID; + /** + * 设备生产商名称 + */ + @JsonProperty("ManufacturerName") + public String manufacturerName; + /** + * 设备型号 + */ + @Transient + @JsonProperty("EquipmentModel") + public String equipmentModel; + /** + * 设备出厂编码 + */ + @JsonProperty("EquipmentProductCode") + public String equipmentProductCode; + /** + * 变压器户号 + */ + @JsonProperty("TransformerID") + public String transformerID; + /** + * 设备名称 + */ +// @JsonProperty("EquipmentName") +// public String equipmentName; + /** + * 设备生产日期 + */ + @JsonProperty("ProductionDate") + public String productionDate; + /** + * 建设时间 + */ + @JsonProperty("ConstructionTime") + public String constructionTime; + /** + * 设备类型 + */ + @JsonProperty("EquipmentType") + public Integer equipmentType; + /** + * 设备状态 + */ + @JsonProperty("EquipmentStatus") + public Integer equipmentStatus; + /** + * 设备用途 + */ + @JsonProperty("EquipmentPurpose") + public Integer equipmentPurpose; + /** + * 额定功率 + */ + @JsonProperty("EquipmentPower") + public Double equipmentPower; + /** + * 新国标 + */ + @JsonProperty("NewNationalStandard") + public Integer newNationalStandard; + /** + * 充电设备 接口列表 + */ + @JsonProperty("ConnectorInfos") + public List connectorInfos; + /** + * 充 电 设 备 经度 + */ +// @JsonProperty("EquipmentLng") +// public Double equipmentLng; + /** + * 充电设备 纬度 + */ +// @JsonProperty("EquipmentLat") +// public Double equipmentLat; + /** + * 是否支持 VIN 码识别 + */ + @JsonProperty("VinFlag") + public Integer vinFlag; +} diff --git a/evcs-modules/evcs-common/src/main/java/com/xhpc/evcs/cdjgpc/dto/CDOrderInfo.java b/evcs-modules/evcs-common/src/main/java/com/xhpc/evcs/cdjgpc/dto/CDOrderInfo.java new file mode 100644 index 00000000..4421a6bf --- /dev/null +++ b/evcs-modules/evcs-common/src/main/java/com/xhpc/evcs/cdjgpc/dto/CDOrderInfo.java @@ -0,0 +1,174 @@ +package com.xhpc.evcs.cdjgpc.dto; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.xhpc.evcs.dto.ConnectorInfo; +import lombok.Data; + +import java.util.List; + +/** + * @author yuyang + * @date 2023-09-07 15:31 + */ +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "OperatorID", + "EquipmentOwnerID", + "StationID", + "EquipmentID", + "ConnectorID", + "StartChargeSeq", + "UserChargeType", + "MobileNumber", + "Money", + "ElectMoney", + "ServiceMoney", + "Elect", + "StartTime", + "EndTime", + "PaymentAmount", + "PayTime", + "PayChannel", + "DiscountInfo", + "StopReason", + "SumPeriod", + "Power", + "ChargeLast", + "MeterValueStart", + "MeterValueEnd", + "ChargeDetails" +}) +@Data +public class CDOrderInfo { + /** + * 运营平台 ID + */ + @JsonProperty("OperatorID") + public String operatorID; + /** + * 设备产权所 属单位 ID + */ + @JsonProperty("EquipmentOwnerID") + public String equipmentOwnerID; + /** + * 充电站 ID + */ + @JsonProperty("StationID") + public String stationID; + /** + * 设备编码 + */ + @JsonProperty("EquipmentID") + public String equipmentID; + /** + * 充电设备接 口编码 + */ + @JsonProperty("ConnectorID") + public String connectorID; + /** + * 充电订单号 + */ + @JsonProperty("StartChargeSeq") + public String startChargeSeq; + /** + * 用户发起充 电类型 + */ + @JsonProperty("UserChargeType") + public String userChargeType; + /** + * 用户手机号 + */ + @JsonProperty("MobileNumber") + public String mobileNumber; + /** + * 本次充电消费总金额 + */ + @JsonProperty("Money") + public Double money; + /** + * 本本次充电电费总金额 + */ + @JsonProperty("ElectMoney") + public Double electMoney; + /** + * 本次充电 服务费金额 + */ + @JsonProperty("ServiceMoney") + public Double serviceMoney; + /** + * 本次充电电量 + */ + @JsonProperty("Elect") + public Double elect; + /** + * 本次充电开始时间 + */ + @JsonProperty("StartTime") + public String startTime; + /** + * 本次充电结束时间 + */ + @JsonProperty("EndTime") + public String endTime; + /** + * 支付金额 + */ + @JsonProperty("PaymentAmount") + public Double paymentAmount; + /** + * 支付时 + */ + @JsonProperty("PayTime") + public String payTime; + /** + * 支付方式 + */ + @JsonProperty("PayChannel") + public Integer payChannel; + /** + * 优惠信息描述 + */ + @JsonProperty("DiscountInfo") + public String discountInfo; + /** + * 充电结束 + * 原因 + */ + @JsonProperty("StopReason") + public Integer stopReason; + /** + * 时段数 N + */ + @JsonProperty("SumPeriod") + public Integer sumPeriod; + /** + * 接口额定功 率 + */ + @JsonProperty("Power") + public Double power; + /** + * 充电时长 + */ + @JsonProperty("ChargeLast") + public Integer chargeLast; + /** + * 电表总起值 + */ + @JsonProperty("MeterValueStart") + public Double meterValueStart; + /** + * 电表总止值 + */ + @JsonProperty("MeterValueEnd") + public Double meterValueEnd; + /** + * 充电明细信息 + */ + @JsonProperty("ChargeDetails") + public List chargeDetails; + + + +} diff --git a/evcs-modules/evcs-common/src/main/java/com/xhpc/evcs/cdjgpc/dto/CDStationInfo.java b/evcs-modules/evcs-common/src/main/java/com/xhpc/evcs/cdjgpc/dto/CDStationInfo.java new file mode 100644 index 00000000..b4377b8f --- /dev/null +++ b/evcs-modules/evcs-common/src/main/java/com/xhpc/evcs/cdjgpc/dto/CDStationInfo.java @@ -0,0 +1,309 @@ +package com.xhpc.evcs.cdjgpc.dto; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.xhpc.evcs.dto.CommonStationInfo; +import lombok.Data; + +import javax.persistence.Transient; +import java.util.Arrays; +import java.util.List; + +/** + * @author yuyang + * @date 2023-09-07 14:13 + */ +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "StationID", + "OperatorID", + "EquipmentOwnerID", + "StationName", + "IsAloneApply", + "AccountNumber", + "Capacity", + "CountryCode", + "AreaCode", + "Address", + "StationTel", + "ServiceTel", + "StationType", + "IsOpen", + "StationStatus", + "ParkNums", + "StationLng", + "StationLat", + "Construction", + "OpenAllDay", + "ServiceFee", + "ParkFree", + "ParkFee", + "Payment", + "EquipmentInfos", + "ParkFeeType", + "ToiletFlag", + "StoreFlag", + "LoungeFlag", + "CanopyFlag", + "PrinterFlag", + "BarrierFlag", + "ParkingLockFlag", + "IsDemandResponse", + "IsSupportOrderlyCharging", + "ISEnergystorage" +}) +@Data +@JsonAutoDetect(fieldVisibility = JsonAutoDetect.Visibility.ANY, getterVisibility = JsonAutoDetect.Visibility.NONE, + setterVisibility = JsonAutoDetect.Visibility.NONE, creatorVisibility = JsonAutoDetect.Visibility.NONE) +public class CDStationInfo extends CommonStationInfo { + + /** + * 是否独立报桩 + */ + @Transient + @JsonProperty("IsAloneApply") + public Integer isAloneApply; + /** + * 户号 + */ + @Transient + @JsonProperty("AccountNumber") + public String accountNumber; + /** + * 容量 + */ + @Transient + @JsonProperty("Capacity") + public Double capacity; + /** + * 充电站省市辖区编码 + */ + @Transient + @JsonProperty("AreaCode") + public String areaCode; + /** + * 详情地址 + */ + @Transient + @JsonProperty("Address") + public String address; + /** + * 详细地址 + */ + @Transient + @JsonProperty("StationTel") + public String stationTel; + /** + * 服务电话 + */ + @Transient + @JsonProperty("ServiceTel") + public String serviceTel; + /** + * 站点类型 + */ + @Transient + @JsonProperty("StationType") + public Integer stationType; + /** + * 小区是否对外开放 + */ + @Transient + @JsonProperty("IsOpen") + public Integer isOpen; + /** + * 站点状态 + */ + @Transient + @JsonProperty("StationStatus") + public Integer stationStatus; + /** + * 车位数量 + */ + @Transient + @JsonProperty("ParkNums") + public Integer parkNums; + /** + * 经度 + */ + @Transient + @JsonProperty("StationLng") + public Double stationLng; + /** + * 纬度 + */ + @Transient + @JsonProperty("StationLat") + public Double stationLat; + /** + * 站点引导 + */ +// @Transient +// @JsonProperty("SiteGuide") +// public String siteGuide; + /** + * 建设场所 + */ + @Transient + @JsonProperty("Construction") + public Integer construction; + /** + * 站点照片 + */ +// @Transient +// @JsonProperty("Pictures") +// public String[] pictures; + /** + * 使用车型描述 + */ +// @Transient +// @JsonProperty("MatchCars") +// public String matchCars; + /** + * 车位楼层及数量描述 + */ +// @Transient +// @JsonProperty("ParkInfo") +// public String parkInfo; + /** + * 停车场产权方 + */ +// @Transient +// @JsonProperty("ParkOwner") +// public String parkOwner; + /** + * 停车场管理方 + */ +// @Transient +// @JsonProperty("ParkManager") +// public String parkManager; + /** + * 全天开放 + */ + @Transient + @JsonProperty("OpenAllDay") + public Integer openAllDay; + /** + * 营业时间 + */ +// @Transient +// @JsonProperty("BusineHours") +// public String busineHours; + /** + * 充 电 电 费 率 + */ +// @Transient +// @JsonProperty("ElectricityFee") +// public String electricityFee; + /** + * 服务费率 + */ + @Transient + @JsonProperty("ServiceFee") + public String serviceFee; + /** + * 免费停车 + */ + @Transient + @JsonProperty("ParkFree") + public Integer parkFree; + /** + * 停车费 + */ + @Transient + @JsonProperty("ParkFee") + public String parkFee; + /** + * 支付方式 + */ + @Transient + @JsonProperty("Payment") + public String payment; + /** + * 是否支持预约 + */ +// @Transient +// @JsonProperty("SupportOrder") +// public Integer supportOrder; + /** + * 备注 + */ +// @Transient +// @JsonProperty("Remark") +// public String remark; + /** + * 充电设备信息列表 + */ + @Transient + @JsonProperty("EquipmentInfos") + public List equipmentInfos = null; + /** + * 停车收费类型 + */ + @Transient + @JsonProperty("ParkFeeType") + public Integer parkFeeType; + /** + * 是否配备卫生间 + */ + @Transient + @JsonProperty("ToiletFlag") + public Integer toiletFlag; + /** + * 是否配备便利店 + */ + @Transient + @JsonProperty("StoreFlag") + public Integer storeFlag; + /** + * 是否配备休息室 + */ + @Transient + @JsonProperty("LoungeFlag") + public Integer loungeFlag; + /** + * 是否配备雨棚 + */ + @Transient + @JsonProperty("CanopyFlag") + public Integer canopyFlag; + /** + * 是否有小票机 + */ + @Transient + @JsonProperty("PrinterFlag") + public Integer printerFlag; + /** + * 是否有道闸 + */ + @Transient + @JsonProperty("BarrierFlag") + public Integer barrierFlag; + /** + * 是否有地锁 + */ + @Transient + @JsonProperty("ParkingLockFlag") + public Integer parkingLockFlag; + /** + * 是否参与需求响应 + */ + @Transient + @JsonProperty("IsDemandResponse") + public Integer isDemandResponse; + /** + * 有序充电场站 + */ + @Transient + @JsonProperty("IsSupportOrderlyCharging") + public Integer isSupportOrderlyCharging; + /** + * 有是否有储能设备 + */ + @Transient + @JsonProperty("ISEnergystorage") + public Integer iSEnergystorage; + +} diff --git a/evcs-modules/evcs-common/src/main/java/com/xhpc/evcs/cdjgpc/dto/CDStationInfoResponse.java b/evcs-modules/evcs-common/src/main/java/com/xhpc/evcs/cdjgpc/dto/CDStationInfoResponse.java new file mode 100644 index 00000000..9d55f852 --- /dev/null +++ b/evcs-modules/evcs-common/src/main/java/com/xhpc/evcs/cdjgpc/dto/CDStationInfoResponse.java @@ -0,0 +1,19 @@ +package com.xhpc.evcs.cdjgpc.dto; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import lombok.Data; + +/** + * @author yuyang + * @date 2023-09-15 11:30 + */ +@JsonPropertyOrder({ + "Status" +}) +@Data +public class CDStationInfoResponse { + + @JsonProperty("Status") + private Integer status; +} diff --git a/evcs-modules/evcs-common/src/main/java/com/xhpc/evcs/cdjgpc/dto/EquipmentOwnerInfo.java b/evcs-modules/evcs-common/src/main/java/com/xhpc/evcs/cdjgpc/dto/EquipmentOwnerInfo.java new file mode 100644 index 00000000..83a935e6 --- /dev/null +++ b/evcs-modules/evcs-common/src/main/java/com/xhpc/evcs/cdjgpc/dto/EquipmentOwnerInfo.java @@ -0,0 +1,42 @@ +package com.xhpc.evcs.cdjgpc.dto; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import lombok.Data; + +import javax.persistence.Entity; +import javax.persistence.Id; + +/** + * 产权单位信息 + * @author yuyang + * @date 2023-09-07 10:57 + */ +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "EquipmentOwnerID", + "FullName", + "ShortName", + "OperatorID", + "Remark" +}) +@Data +@Entity(name = "ET_EQUIPMENT_OWNER_INFO") +@JsonAutoDetect(fieldVisibility = JsonAutoDetect.Visibility.ANY, getterVisibility = JsonAutoDetect.Visibility.NONE, + setterVisibility = JsonAutoDetect.Visibility.NONE, creatorVisibility = JsonAutoDetect.Visibility.NONE) +public class EquipmentOwnerInfo { + + @Id + @JsonProperty("EquipmentOwnerID") + private String equipmentOwnerId; + @JsonProperty("FullName") + String fullName; + @JsonProperty("ShortName") + String shortName; + @JsonProperty("OperatorID") + String operatorID; + @JsonProperty("Remark") + String remark; +} diff --git a/evcs-modules/evcs-common/src/main/java/com/xhpc/evcs/domain/XhpcChargingPile.java b/evcs-modules/evcs-common/src/main/java/com/xhpc/evcs/domain/XhpcChargingPile.java index 66bb267a..a658f152 100644 --- a/evcs-modules/evcs-common/src/main/java/com/xhpc/evcs/domain/XhpcChargingPile.java +++ b/evcs-modules/evcs-common/src/main/java/com/xhpc/evcs/domain/XhpcChargingPile.java @@ -94,6 +94,44 @@ public class XhpcChargingPile extends BaseEntity { @Column(name = "current") private Integer current; + @Column(name = "search_value") + private String searchValue; + /** + * 设备出厂编码 + */ + @Column(name = "equipment_product_code") + private String equipmentProductCode; + /** + * 设备出厂编码 + */ + @Column(name = "transformer_id") + private String transformerID; + /** + * 新国标 + */ + @Column(name = "new_national_standard") + private Integer newNationalStandard; + /** + * 是否支持 VIN 码识别 + */ + @Column(name = "vin_flag") + private Integer vinFlag; + /** + * 设备状态 + */ + @Column(name = "equipment_status") + private Integer equipmentStatus; + /** + * 设备用途 + */ + @Column(name = "equipment_purpose") + private Integer equipmentPurpose; + + @Column(name = "manufacturer_id") + private String manufacturerId; + + private String constructionTime; + public Integer getEquipmentType() { return equipmentType; @@ -374,4 +412,120 @@ public class XhpcChargingPile extends BaseEntity { this.id = id; } + public String getEquipmentProductCode() { + return equipmentProductCode; + } + + public void setEquipmentProductCode(String equipmentProductCode) { + this.equipmentProductCode = equipmentProductCode; + } + + public String getTransformerID() { + return transformerID; + } + + public void setTransformerID(String transformerID) { + this.transformerID = transformerID; + } + + public Integer getNewNationalStandard() { + return newNationalStandard; + } + + public void setNewNationalStandard(Integer newNationalStandard) { + this.newNationalStandard = newNationalStandard; + } + + public Integer getVinFlag() { + return vinFlag; + } + + public void setVinFlag(Integer vinFlag) { + this.vinFlag = vinFlag; + } + + public Integer getEquipmentStatus() { + return equipmentStatus; + } + + public void setEquipmentStatus(Integer equipmentStatus) { + this.equipmentStatus = equipmentStatus; + } + + public Integer getEquipmentPurpose() { + return equipmentPurpose; + } + + public void setEquipmentPurpose(Integer equipmentPurpose) { + this.equipmentPurpose = equipmentPurpose; + } + + public String getManufacturerId() { + return manufacturerId; + } + + public void setManufacturerId(String manufacturerId) { + this.manufacturerId = manufacturerId; + } + + @Override + public String getSearchValue() { + return searchValue; + } + + @Override + public void setSearchValue(String searchValue) { + this.searchValue = searchValue; + } + + public String getConstructionTime() { + return constructionTime; + } + + public void setConstructionTime(String constructionTime) { + this.constructionTime = constructionTime; + } + + @Override + public String toString() { + return "XhpcChargingPile{" + + "id=" + id + + ", chargingStationId=" + chargingStationId + + ", name='" + name + '\'' + + ", nationalStandard='" + nationalStandard + '\'' + + ", power=" + power + + ", auxiliaryPowerSupply=" + auxiliaryPowerSupply + + ", inputVoltage=" + inputVoltage + + ", maxVoltage=" + maxVoltage + + ", minVoltage=" + minVoltage + + ", maxElectricCurrent=" + maxElectricCurrent + + ", minElectricCurrent=" + minElectricCurrent + + ", serialNumber='" + serialNumber + '\'' + + ", type=" + type + + ", programVersion='" + programVersion + '\'' + + ", networkLinkType='" + networkLinkType + '\'' + + ", gunNumber=" + gunNumber + + ", communicationProtocolVersion='" + communicationProtocolVersion + '\'' + + ", communicationOperator='" + communicationOperator + '\'' + + ", simCard='" + simCard + '\'' + + ", status=" + status + + ", delFlag=" + delFlag + + ", rateModelId=" + rateModelId + + ", brandModel='" + brandModel + '\'' + + ", productionDate='" + productionDate + '\'' + + ", manufactureName='" + manufactureName + '\'' + + ", connectorType=" + connectorType + + ", equipmentType=" + equipmentType + + ", current=" + current + + ", searchValue='" + searchValue + '\'' + + ", equipmentProductCode='" + equipmentProductCode + '\'' + + ", transformerID='" + transformerID + '\'' + + ", newNationalStandard=" + newNationalStandard + + ", vinFlag=" + vinFlag + + ", equipmentStatus=" + equipmentStatus + + ", equipmentPurpose=" + equipmentPurpose + + ", manufacturerId='" + manufacturerId + '\'' + + ", constructionTime='" + constructionTime + '\'' + + '}'; + } } diff --git a/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/cdjgpc/api/CDNotificationStationInfoController.java b/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/cdjgpc/api/CDNotificationStationInfoController.java new file mode 100644 index 00000000..47026034 --- /dev/null +++ b/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/cdjgpc/api/CDNotificationStationInfoController.java @@ -0,0 +1,100 @@ +package com.xhpc.evcs.cdjgpc.api; + +import com.xhpc.common.api.dto.ChargingStationDto; +import com.xhpc.common.core.domain.R; +import com.xhpc.common.redis.service.RedisService; +import com.xhpc.evcs.cdjgpc.dto.CDEquipmentInfo; +import com.xhpc.evcs.cdjgpc.dto.CDStationInfo; +import com.xhpc.evcs.cdjgpc.dto.CDStationInfoResponse; +import com.xhpc.evcs.domain.AuthSecretToken; +import com.xhpc.evcs.dto.*; +import com.xhpc.evcs.jpa.AuthSecretTokenRepository; +import com.xhpc.evcs.notification.CoreDispatcher; +import com.xhpc.evcs.utils.JSONUtil; +import lombok.extern.slf4j.Slf4j; +import org.springframework.scheduling.annotation.Scheduled; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RestController; +import static com.xhpc.common.data.redis.StaticBeanUtil.REDIS; +import javax.annotation.Resource; + +import java.util.*; + +import static com.xhpc.evcs.domain.AuthSecretToken.SECRET_TOKEN_TYPE_OUT; + +/** + * @author yuyang + * @date 2023-09-07 16:12 + */ +@Slf4j +@RestController +public class CDNotificationStationInfoController extends CoreDispatcher { + + + @Resource + private AuthSecretTokenRepository authSecretTokenRepository; + + //充电站信息变化推送 + @PostMapping("/v10/getNotificationStationInfo") + public R getNotificationStationInfo(@RequestBody Map map){ + try{ + String chargingStationId = map.get("chargingStationId").toString(); + AuthSecretToken authSecretTokenOut = + authSecretTokenRepository.findByOperatorId3irdptyAndOperatorIdAndSecretTokenType( + "765367656", "MA6DFCTD5", SECRET_TOKEN_TYPE_OUT).orElse(null); //todo + // maybe对接第三方 + if (authSecretTokenOut != null) { + //获取场站信息 + String key = "cdjgpc:station:".concat(chargingStationId)+".notification"; + + CDStationInfo cdStationInfo =REDIS.getCacheObject(key); + CommonRequest commonRequest = new CommonRequest<>(); + Map mapStationInfo =new HashMap<>(); + mapStationInfo.put("StationInfo",cdStationInfo); + String data =JSONUtil.toJSONString(mapStationInfo); + commonRequest.setData(data); + String result =ok(commonRequest,"/notification_stationInfo",authSecretTokenOut,"MA6DFCTD5"); + System.out.println("=======responseBody========"+result); + CDStationInfoResponse cdStationInfoResponse = DTOJsonHelper.parseResponseData(result, CDStationInfoResponse.class, authSecretTokenOut); + System.out.println("=======cdStationInfoResponse========"+cdStationInfoResponse.getStatus()); + } + }catch (Exception e){ + e.printStackTrace(); + } + return R.ok(); + } + + @PostMapping("/v10/getNotificationStationStatus") + public R getNotificationStationStatus(@RequestBody Map map){ + try { + AuthSecretToken authSecretTokenOut = authSecretTokenRepository.findByOperatorId3irdptyAndSecretTokenType("765367656", SECRET_TOKEN_TYPE_OUT).orElse(null); + log.debug("nss pushing to: {}", authSecretTokenOut.getOperatorId3irdpty()); + if (authSecretTokenOut != null) { + ConnectorStatusInfoReq connectorStatusInfoReq = new ConnectorStatusInfoReq(); + ConnectorStatusInfo connectorStatusInfo = new ConnectorStatusInfo(); + connectorStatusInfo.setConnectorID(map.get("connectorID").toString()); + connectorStatusInfo.setStatus(ConnectorStatusInfo.FREE); + connectorStatusInfoReq.setConnectorStatusInfo(connectorStatusInfo); + String data = JSONUtil.toJSONString(connectorStatusInfoReq); + log.info("===============data=================="+data); + CommonRequest commonRequest = new CommonRequest<>(); + commonRequest.setData(data); + String ok = ok(commonRequest, "/notification_stationStatus", authSecretTokenOut); + log.info("===============3333=================="+ok); + } + }catch (Exception e){ + log.info("===============eeee=================="); + e.printStackTrace(); + } + + + return R.ok(); + } + + + + + +} diff --git a/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/config/EvcsFilter.java b/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/config/EvcsFilter.java index 15a14a47..bbbf444c 100644 --- a/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/config/EvcsFilter.java +++ b/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/config/EvcsFilter.java @@ -47,7 +47,8 @@ import java.util.Scanner; @Slf4j //@Component //spring boot way, see https://www.surasint.com/spring-boot-webfilter-instead-of-component/ //@Order(1) not supported, see https://github.com/spring-projects/spring-boot/issues/8276 -@WebFilter(urlPatterns = {"/v1/*", "/v2/*"}, filterName = "v1n2filter") //multiple filters execute by filterName order +//成都市监管平台v10 恒大v20 新电途 v30 快电 v40 小桔v50 +@WebFilter(urlPatterns = {"/v1/*", "/v2/*", "/v10/*"}, filterName = "v1n2filter") //multiple filters execute by filterName order public class EvcsFilter extends OncePerRequestFilter { @Resource diff --git a/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/config/InterceptorConfig.java b/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/config/InterceptorConfig.java index 0ce14f49..190e1ef1 100644 --- a/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/config/InterceptorConfig.java +++ b/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/config/InterceptorConfig.java @@ -11,7 +11,7 @@ public class InterceptorConfig implements WebMvcConfigurer { @Override public void addInterceptors(InterceptorRegistry registry) { - registry.addInterceptor(getEvcsInterceptor()).addPathPatterns("/v1/**"); + registry.addInterceptor(getEvcsInterceptor()).addPathPatterns("/v1/**").addPathPatterns("/v10/**"); } @Bean diff --git a/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/notification/NotificationChargeOrderInfo4BonusTask.java b/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/notification/NotificationChargeOrderInfo4BonusTask.java index 461a17e0..06fc18c9 100644 --- a/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/notification/NotificationChargeOrderInfo4BonusTask.java +++ b/evcs-modules/evcs-core/src/main/java/com/xhpc/evcs/notification/NotificationChargeOrderInfo4BonusTask.java @@ -44,7 +44,7 @@ public class NotificationChargeOrderInfo4BonusTask extends CoreDispatcher { * 推送充电订单信息(运营奖补) * @throws IOException */ - @Scheduled(fixedDelay = 1000 * 60) + //@Scheduled(fixedDelay = 1000 * 60) public void run() throws IOException { AuthSecretToken authSecretTokenOut = authSecretTokenRepository.findByOperatorId3irdptyAndOperatorIdAndSecretTokenType( diff --git a/sql/v2.2.sql b/sql/v2.2.sql new file mode 100644 index 00000000..1cefde0a --- /dev/null +++ b/sql/v2.2.sql @@ -0,0 +1,45 @@ +ALTER TABLE `xhpc_charging_station` + ADD COLUMN `equipment_owner_id` `equipment_owner_id` VARCHAR(10) NULL DEFAULT NULL COMMENT '产权所属单位ID' COLLATE 'utf8mb4_general_ci' AFTER `running_total_power`, + ADD COLUMN `is_alone_apply` INT NULL COMMENT '是否独立报桩' AFTER `equipment_owner_id`, + ADD COLUMN `account_number` VARCHAR(20) NULL COMMENT '户号(国网电费账单 户号)' AFTER `is_alone_apply`, + ADD COLUMN `capacity` `capacity` DOUBLE(10,4) NULL DEFAULT NULL COMMENT '容量(独立电表 申请的功 率)' AFTER `account_number`, + ADD COLUMN `country_code` VARCHAR(4) NULL DEFAULT NULL COMMENT '充电站国家代码' AFTER `capacity`, + ADD COLUMN `is_open` INT(4) NULL DEFAULT NULL COMMENT '小区是否对外开放(0 否 1是)' AFTER `country_area_code`; + ADD COLUMN `is_open` `is_open` INT(4) NULL DEFAULT '0' COMMENT '小区是否对外开放(0 否 1是)' AFTER `country_area_code`, + ADD COLUMN `park_fee_type` INT(10) NULL DEFAULT '3' COMMENT '停车收费类型(0停车收费 1停车免费 2限时免费 3充电限免)' AFTER `is_open`, + ADD COLUMN `toilet_flag` INT(10) NULL DEFAULT '1' COMMENT '是否配备卫生间(0无 1有)' AFTER `park_fee_type`, + ADD COLUMN `store_flag` INT(10) NULL DEFAULT '0' COMMENT '是否配备便利店(0无 1有)' AFTER `toilet_flag`, + ADD COLUMN `lounge_flag` INT(10) NULL DEFAULT '0' COMMENT '是否配备休息室(0无 1有)' AFTER `store_flag`, + ADD COLUMN `canopy_flag` INT(10) NULL DEFAULT '0' COMMENT '是否配备雨棚(0无 1有)' AFTER `lounge_flag`, + ADD COLUMN `printer_flag` INT(10) NULL DEFAULT '0' COMMENT '是否有小票机(0无 1有)' AFTER `canopy_flag`, + ADD COLUMN `barrier_flag` INT(10) NULL DEFAULT '1' COMMENT '是否有道闸(0无 1有)' AFTER `printer_flag`, + ADD COLUMN `parking_lock_flag` INT(10) NULL DEFAULT '0' COMMENT '是否有地锁(0无 1有)' AFTER `barrier_flag`, + ADD COLUMN `is_demand_response` INT(10) NULL DEFAULT '0' COMMENT '是否参与需求响应(0否 1是)' AFTER `parking_lock_flag`, + ADD COLUMN `is_support_orderly_charging` INT(10) NULL DEFAULT '0' COMMENT '有序充电场站(0否 1是)' AFTER `is_demand_response`, + ADD COLUMN `is_energystorage` INT(10) NULL DEFAULT '0' COMMENT '是否有存能设备(0否 1是)' AFTER `is_support_orderly_charging`, + ADD COLUMN `construction_time` VARCHAR(50) NULL DEFAULT NULL COMMENT '建设时间' AFTER `is_energystorage`, + ADD COLUMN `station_status` INT(4) NULL DEFAULT NULL COMMENT '场站建设状态' AFTER `construction_time`, + ADD COLUMN `open_all_day` INT(4) NULL DEFAULT NULL COMMENT '是否全天开放(0 否 1是,为零时营业时间必填)' AFTER `station_status`, + ADD COLUMN `busine_hours` VARCHAR(100) NULL DEFAULT NULL COMMENT '推荐格 式:周一 至周日 00:00-24:00' AFTER `open_all_day`, + ADD COLUMN `service_fee` VARCHAR(100) NULL DEFAULT NULL COMMENT '服务费率' AFTER `busine_hours`, + ADD COLUMN `park_free` INT(4) NULL DEFAULT NULL COMMENT '是否免费停车(0 否 1是)' AFTER `service_fee`, + ADD COLUMN `park_fee` VARCHAR(100) NULL DEFAULT NULL COMMENT '停车费描述' AFTER `park_free`, + ADD COLUMN `payment` VARCHAR(100) NULL DEFAULT NULL COMMENT '支付方式:刷卡、线上、现金 电子钱包:微信/支付宝 ' AFTER `park_fee`; + + + + +ALTER TABLE `xhpc_charging_pile` + ADD COLUMN `equipment_product_code` VARCHAR(30) NULL DEFAULT NULL COMMENT '设备出厂编码(由设备生厂商定义的设备出厂唯一编码)' AFTER `tenant_id`, + ADD COLUMN `transformer_id` VARCHAR(30) NULL DEFAULT NULL COMMENT '变压器户号' AFTER `equipment_product_code`, + ADD COLUMN `new_national_standard` INT(4) NULL DEFAULT NULL COMMENT '是否新国标(0否 1是)' AFTER `construction_time`, + ADD COLUMN `vin_flag` INT(4) NULL DEFAULT NULL COMMENT '是否支持VIN码识别(0否 1是)' AFTER `new_national_standard`, + ADD COLUMN `equipment_status` INT(4) NULL DEFAULT NULL COMMENT '设备状态(0未知 1建设中 5关闭下线 6维护中 50正常使用)' AFTER `vin_flag`, + ADD COLUMN `equipment_purpose` INT(4) NULL DEFAULT NULL COMMENT '设备用户(1公共 50个人 100公交(专用))' AFTER `equipment_status`, + ADD COLUMN `manufacturer_id` VARCHAR(50) NULL DEFAULT NULL COMMENT '设备生产商组织机构代码' AFTER `equipment_purpose`; + + +UPDATE `rycloud`.`xhpc_area` SET `code`='510156' WHERE `code`=510186; + +INSERT INTO `rycloud`.`xhpc_area` (`code`, `pcode`, `name`, `short_name`, `merger_name`, `province`, `city`, `level`, `lng`, `lat`, `letter`, `pinyin`, `first_char`, `status`, `create_user`, `create_dept`, `create_time`, `update_user`, `update_time`, `is_deleted`, `tenant_id`) +VALUES ('510102', '510100', '高新区', '高新区', '四川省/成都市/高新区', '四川省', '成都市', '3', '104.08347', '30.65614', 'JXQ', 'gaoxingqu', 'C', '0', NULL, NULL, '2019-12-19 11:44:50', NULL, '2019-12-19 11:44:50', '0', '000000'); diff --git a/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/controller/XhpcChargingPileController.java b/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/controller/XhpcChargingPileController.java index ddf05f28..778c6edb 100644 --- a/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/controller/XhpcChargingPileController.java +++ b/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/controller/XhpcChargingPileController.java @@ -221,4 +221,13 @@ public class XhpcChargingPileController extends BaseController { return AjaxResult.success(configRateReply); } + + + @GetMapping("/getChargingPileSerialNumber") + public R getChargingPileSerialNumber(String serialNumber){ + + return xhpcChargingPileService.getChargingPileSerialNumber(serialNumber); + } + + } diff --git a/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/controller/XhpcChargingStationController.java b/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/controller/XhpcChargingStationController.java index c239a759..e057aa1c 100644 --- a/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/controller/XhpcChargingStationController.java +++ b/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/controller/XhpcChargingStationController.java @@ -2,6 +2,7 @@ package com.xhpc.charging.station.controller; import com.xhpc.charging.station.service.IXhpcChargingStationService; import com.xhpc.common.api.dto.XhpcChargingStationDto; +import com.xhpc.common.core.domain.R; import com.xhpc.common.core.web.controller.BaseController; import com.xhpc.common.core.web.domain.AjaxResult; import com.xhpc.common.core.web.page.TableDataInfo; @@ -220,4 +221,12 @@ public class XhpcChargingStationController extends BaseController { return xhpcChargingStationService.updateXhpcRateTime(request, xhpcChargingStationDto); } + /** + * 获取场站信息 + */ + + @GetMapping("/getChargingStationServiceById") + public R getChargingStationServiceById(Long stationId){ + return xhpcChargingStationService.getChargingStationServiceById(stationId); + } } diff --git a/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/IXhpcChargingPileService.java b/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/IXhpcChargingPileService.java index 2f5ab0ec..a8037dd9 100644 --- a/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/IXhpcChargingPileService.java +++ b/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/IXhpcChargingPileService.java @@ -1,5 +1,6 @@ package com.xhpc.charging.station.service; +import com.xhpc.common.core.domain.R; import com.xhpc.common.core.web.domain.AjaxResult; import com.xhpc.common.domain.XhpcChargingPile; @@ -86,4 +87,6 @@ public interface IXhpcChargingPileService { */ AjaxResult generateQrCode(Long chargingStationId, Long pileId); + + R getChargingPileSerialNumber(String serialNumber); } diff --git a/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/IXhpcChargingStationService.java b/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/IXhpcChargingStationService.java index ecf4a82a..1b61fa46 100644 --- a/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/IXhpcChargingStationService.java +++ b/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/IXhpcChargingStationService.java @@ -1,6 +1,7 @@ package com.xhpc.charging.station.service; import com.xhpc.common.api.dto.XhpcChargingStationDto; +import com.xhpc.common.core.domain.R; import com.xhpc.common.core.web.domain.AjaxResult; import com.xhpc.common.domain.XhpcChargingStation; import com.xhpc.common.domain.XhpcRate; @@ -253,5 +254,6 @@ public interface IXhpcChargingStationService { Map activityDiscountTime(Long userId, Date startTime, Integer source, Long chargingStationId, String tenantId); + R getChargingStationServiceById(Long stationId); } diff --git a/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/XhpcChargingPileServiceImpl.java b/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/XhpcChargingPileServiceImpl.java index 57861cce..481c944d 100644 --- a/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/XhpcChargingPileServiceImpl.java +++ b/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/XhpcChargingPileServiceImpl.java @@ -286,6 +286,17 @@ public class XhpcChargingPileServiceImpl extends BaseService implements IXhpcCha TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); return AjaxResult.error("添加桩入缓存失败,请稍后在试"); } + }else{ + Long chargingStationId = xhpcChargingPile.getChargingStationId(); + String serialNumber = xhpcChargingPile.getSerialNumber(); + HashSet noSet = new HashSet<>(); + noSet.add(serialNumber); + R r = powerPileService.addPileWhitelist(chargingStationId, xhpcChargingPile.getCommunicationProtocolVersion(), noSet); + if (r.getCode() != 200) { + //数据回滚-手动回滚 + TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); + return AjaxResult.error("添加桩入缓存失败,请稍后在试"); + } } xhpcChargingPileMapper.updaeXhpcChargingPile(xhpcChargingPile); @@ -555,4 +566,11 @@ public class XhpcChargingPileServiceImpl extends BaseService implements IXhpcCha } return AjaxResult.success(); } + + @Override + public R getChargingPileSerialNumber(String serialNumber) { + XhpcChargingPile xhpc = xhpcChargingPileMapper.getXhpcChargingPileBySerialNumber(serialNumber); + return R.ok(xhpc); + } + } diff --git a/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/XhpcChargingStationServiceImpl.java b/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/XhpcChargingStationServiceImpl.java index 93dfa200..08780158 100644 --- a/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/XhpcChargingStationServiceImpl.java +++ b/xhpc-modules/xhpc-charging-station/src/main/java/com/xhpc/charging/station/service/XhpcChargingStationServiceImpl.java @@ -1568,6 +1568,11 @@ public class XhpcChargingStationServiceImpl extends BaseService implements IXhpc return map; } + @Override + public R getChargingStationServiceById(Long stationId) { + Map map = xhpcChargingStationMapper.getXhpcChargingStationMessage(stationId); + return R.ok(map,"获取场站基本信息成功"); + } } diff --git a/xhpc-modules/xhpc-charging-station/src/main/resources/mapper/XhpcChargingPileMapper.xml b/xhpc-modules/xhpc-charging-station/src/main/resources/mapper/XhpcChargingPileMapper.xml index 80050653..f4e84190 100644 --- a/xhpc-modules/xhpc-charging-station/src/main/resources/mapper/XhpcChargingPileMapper.xml +++ b/xhpc-modules/xhpc-charging-station/src/main/resources/mapper/XhpcChargingPileMapper.xml @@ -34,6 +34,13 @@ + + + + + + + select charging_pile_id, @@ -368,6 +375,14 @@ xcp.connector_type connectorType, xcp.current, xcp.equipment_type equipmentType, + xcp.equipment_product_code, + xcp.transformer_id, + xcp.new_national_standard, + xcp.vin_flag, + xcp.equipment_status, + xcp.equipment_purpose, + xcp.manufacturer_id manufacturerId, + xcs.construction_time as constructionTime, xcs.name as charging_station_name from xhpc_charging_pile xcp left join xhpc_charging_station as xcs on xcs.charging_station_id = xcp.charging_station_id @@ -467,7 +482,7 @@ select count(charging_pile_id) from xhpc_charging_pile WHERE charging_station_id =#{chargingStationId} and def_flag=0 - select charging_pile_id, charging_station_id, @@ -502,9 +517,16 @@ manufacture_name manufactureName, connector_type connectorType, current, - equipment_type equipmentType + equipment_type equipmentType, + equipment_product_code, + transformer_id, + new_national_standard, + vin_flag, + equipment_status, + equipment_purpose, + manufacturer_id manufacturerId from xhpc_charging_pile - where serial_number = #{serialNumber} + where serial_number = #{serialNumber} and del_flag =0 + + + INSERT INTO xhpc_refund_order + + + refund_order_number, + + + user_id, + + + open_id, + + + alipay_id, + + + amount, + + + type, + + + examine_status, + + + status, + + + del_flag, + + + create_time, + + + create_by, + + + update_time, + + + update_by, + + + remark, + + + source, + + + tenant_id, + + + + + #{refundOrderNumber}, + + + #{userId}, + + + #{openId}, + + + #{alipayId}, + + + #{amount}, + + + #{type}, + + + #{examineStatus}, + + + #{status}, + + + #{delFlag}, + + + #{createTime}, + + + #{createBy}, + + + #{updateTime}, + + + #{updateBy}, + + + #{remark}, + + + #{source}, + + + #{tenantId}, + + + + + + update xhpc_recharge_order set refund_status=2 where user_id=#{userId} and source =#{source} and (refund_status=0 or refund_status =1) + diff --git a/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/controller/ChargingController.java b/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/controller/ChargingController.java index 19b26d32..4641f37a 100644 --- a/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/controller/ChargingController.java +++ b/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/controller/ChargingController.java @@ -149,8 +149,7 @@ public class ChargingController { @PutMapping("charging/stop/{orderNo}/{pileNo}/{connectorId}/{version}") public R stopCharging(@PathVariable("orderNo") String orderNo, @PathVariable("pileNo") String pileNo, @PathVariable("connectorId") String connectorId, - @PathVariable( - "version") String version) { + @PathVariable("version") String version) { String pkey = "pile:".concat(pileNo); Map cachePile = REDIS.getCacheMap(pkey); @@ -398,8 +397,34 @@ public class ChargingController { public static void main(String[] args) { - Integer f70C0000 = HexUtils.reverseHexInt("0000"); - System.out.println("f70C0000 转化成="+f70C0000); + Integer F401 = HexUtils.reverseHexInt("F401"); + System.out.println("F401 转化成="+F401); + + Integer D007 = HexUtils.reverseHexInt("D007"); + System.out.println("D007 转化成="+D007); + + Integer F620 = HexUtils.reverseHexInt("F620"); + System.out.println("F620 转化成="+F620); + + Integer F03 = HexUtils.reverseHexInt("03"); + System.out.println("F03 转化成="+F03); + + Integer D3C0F = HexUtils.reverseHexInt("3C0F"); + System.out.println("3C0F 转化成="+D3C0F); + + Integer f4C1D = HexUtils.reverseHexInt("4C1D"); + System.out.println("f4C1D 转化成="+f4C1D); + + Integer DC05 = HexUtils.reverseHexInt("DC05"); + System.out.println("DC05 转化成="+DC05); + + Integer A00F = HexUtils.reverseHexInt("A00F"); + System.out.println("A00F 转化成="+A00F); + + Integer FCF3 = HexUtils.reverseHexInt("FCF3"); + System.out.println("FCF3 转化成="+FCF3); + + Integer f70C0001 = HexUtils.reverseHexInt("D8B68A0400"); System.out.println("f70C0001 转化成="+f70C0001); diff --git a/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/controller/PileController.java b/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/controller/PileController.java index 0303a120..ec2d6a02 100644 --- a/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/controller/PileController.java +++ b/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/controller/PileController.java @@ -5,7 +5,9 @@ import com.xhpc.common.api.dto.ChargingStationDto; import com.xhpc.common.core.domain.R; import com.xhpc.common.core.utils.HttpUtils; import com.xhpc.common.enums.StationDeviceEnum; +import com.xhpc.evcs.cdjgpc.dto.CDEquipmentInfo; import com.xhpc.evcs.domain.XhpcChargingPile; +import com.xhpc.evcs.dto.ConnectorInfo; import com.xhpc.pp.domain.XhpcDeviceMessage; import com.xhpc.pp.logic.RateModelRequestLogic; import com.xhpc.pp.logic.RemoteRebootDataLogic; @@ -23,12 +25,7 @@ import org.springframework.web.bind.annotation.RestController; import javax.annotation.Resource; import java.io.IOException; -import java.util.Arrays; -import java.util.Calendar; -import java.util.Collection; -import java.util.Date; -import java.util.Map; -import java.util.Set; +import java.util.*; import java.util.concurrent.TimeUnit; import static cn.hutool.core.date.DatePattern.NORM_DATETIME_FORMAT; @@ -50,7 +47,7 @@ public class PileController { @Resource XhpcDeviceMessageMapper deviceMessageMapper; - + private final String[] GUNNAMES = {"", "A", "B", "C", "D"}; @PostMapping("pile/whitelist/add/{stationId}/{version}") public Object addWhitelist(@PathVariable("stationId") Long stationId, @@ -92,6 +89,7 @@ public class PileController { cachePile.put("nationalStandard", xhpcChargingPile.getNationalStandard().equals("2011") ? 1 : 2); cachePile.put("equipmentType", xhpcChargingPile.getEquipmentType()); REDIS.setCacheMap("pile:".concat(pileNo), cachePile); + getEquipmentInfo(xhpcChargingPile); } } //添加桩和枪信息 @@ -422,4 +420,62 @@ public class PileController { } return R.ok(); } + + + //组装充电设备接口信息 + public void getEquipmentInfo(XhpcChargingPile xhpcChargingPile){ + String serialNumber = xhpcChargingPile.getSerialNumber(); + String skey = "cdjgpc:pile:".concat(serialNumber)+".notification"; + REDIS.deleteObject(skey); + + CDEquipmentInfo cdEquipmentInfo = new CDEquipmentInfo(); + cdEquipmentInfo.setEquipmentID(serialNumber); + cdEquipmentInfo.setManufacturerID(xhpcChargingPile.getManufacturerId()); + cdEquipmentInfo.setManufacturerName(xhpcChargingPile.getManufactureName()); + cdEquipmentInfo.setEquipmentModel(xhpcChargingPile.getBrandModel()); + cdEquipmentInfo.setEquipmentProductCode(xhpcChargingPile.getEquipmentProductCode()); + cdEquipmentInfo.setTransformerID(xhpcChargingPile.getTransformerID()); + cdEquipmentInfo.setProductionDate(xhpcChargingPile.getProductionDate()); + cdEquipmentInfo.setConstructionTime(xhpcChargingPile.getConstructionTime()); + cdEquipmentInfo.setEquipmentType(xhpcChargingPile.getEquipmentType()); + cdEquipmentInfo.setEquipmentStatus(xhpcChargingPile.getEquipmentStatus()); + cdEquipmentInfo.setEquipmentPurpose(xhpcChargingPile.getEquipmentPurpose()); + cdEquipmentInfo.setEquipmentPower(xhpcChargingPile.getPower()); + cdEquipmentInfo.setNewNationalStandard(xhpcChargingPile.getNewNationalStandard()); + cdEquipmentInfo.setVinFlag(xhpcChargingPile.getVinFlag()); + cdEquipmentInfo.setConnectorInfos(getConnectorInfos(serialNumber,xhpcChargingPile)); + REDIS.setCacheObject(skey, cdEquipmentInfo); + + } + + private List getConnectorInfos(String pileNo,XhpcChargingPile xhpcChargingPile) { + final Map cachePile = REDIS.getCacheMap("pile:".concat(pileNo)); + List connectorInfoList = new ArrayList<>(); + Integer gunNumCache = (Integer) cachePile.get("gunNum"); + gunNumCache = gunNumCache == null ? 2 : gunNumCache; + for (int i = 1; i <= gunNumCache; i++) { + String gunId = pileNo.concat(String.format("%02d", i)); + + ConnectorInfo connectorInfo = new ConnectorInfo(); + connectorInfo.setConnectorID(gunId); + String connectorName = REDIS.getCacheMapValue("gun:".concat(gunId), "terminalName"); //todo set them in redis! + connectorInfo.setConnectorName(connectorName == null ? + Integer.parseInt(pileNo.substring(10, 14)) + "号桩-" + GUNNAMES[i] + + "枪" : connectorName); + Integer connectorType = (Integer) cachePile.get("connectorType"); + connectorInfo.setConnectorType(connectorType == null ? 4 : connectorType); + Integer voltageUpperLimits = xhpcChargingPile.getMaxVoltage().intValue(); + connectorInfo.setVoltageUpperLimits(voltageUpperLimits == null ? 750 : voltageUpperLimits); + Integer voltageLowerLimits = xhpcChargingPile.getMinVoltage().intValue(); + connectorInfo.setVoltageLowerLimits(voltageLowerLimits == null ? 300 : voltageLowerLimits); + Integer current = (Integer) cachePile.get("current"); + connectorInfo.setCurrent(current == null ? 250 : current); + Double power = xhpcChargingPile.getPower(); + connectorInfo.setPower(power == null ? 120.0 : power); + Integer nationalStandard = (Integer) cachePile.get("nationalStandard"); + connectorInfo.setNationalStandard(nationalStandard == null ? 2 : nationalStandard); + connectorInfoList.add(connectorInfo); + } + return connectorInfoList; + } } diff --git a/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/controller/StationController.java b/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/controller/StationController.java index ca8636f9..6cd474a0 100644 --- a/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/controller/StationController.java +++ b/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/controller/StationController.java @@ -1,18 +1,29 @@ package com.xhpc.pp.controller; +import com.xhpc.common.api.ChargingStationService; import com.xhpc.common.api.dto.ChargingStationDto; import com.xhpc.common.core.domain.R; import com.xhpc.common.data.redis.CacheRateModel; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RestController; +import com.xhpc.evcs.cdjgpc.dto.CDEquipmentInfo; +import com.xhpc.evcs.cdjgpc.dto.CDStationInfo; +import com.xhpc.pp.mapper.XhpcDeviceMessageMapper; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Set; import static com.xhpc.common.data.redis.StaticBeanUtil.REDIS; @RestController public class StationController { + @Resource + XhpcDeviceMessageMapper deviceMessageMapper; + @PostMapping("station/rateModel/{stationId}/{rateModelId}") public Object setStationRateModel(@PathVariable Long stationId, @PathVariable Long rateModelId, @RequestBody CacheRateModel rateModel) { @@ -23,7 +34,50 @@ public class StationController { REDIS.setCacheObject(skey, cacheStation); String rkey = "rateModel:".concat(rateModelId.toString()); REDIS.setCacheObject(rkey, rateModel); + addNotificationStationInfo(stationId); return R.ok(); } + //组装场站信息 + public void addNotificationStationInfo(Long stationId){ + CDStationInfo xhpcChargingStation = deviceMessageMapper.getXhpcChargingStation(stationId); + if(xhpcChargingStation !=null){ + //场站信息入缓存 + String skey = "cdjgpc:station:".concat(stationId.toString())+".notification"; + REDIS.deleteObject(skey); + xhpcChargingStation.setEquipmentInfos(new ArrayList<>()); + REDIS.setCacheObject(skey, xhpcChargingStation); + } + } + + //组合场站数据 + @GetMapping("station/getNotificationStationInfo/{stationId}") + public R getNotificationStationInfo(Long chargingStationId){ + String key = "cdjgpc:station:".concat(chargingStationId.toString())+".notification"; + CDStationInfo cdStationInfo = REDIS.getCacheObject(key); + cdStationInfo.setEquipmentInfos(new ArrayList<>()); + //查询场站是桩是否对应上 + ChargingStationDto stationDto = REDIS.getCacheObject("station:"+chargingStationId); + Set pks = stationDto.getPiles(); + if (pks != null) { + List cdEquipmentInfos = new ArrayList<>(); + for (String pileNo : pks) { + String pk = "pile:".concat(pileNo); + String skey = "cdjgpc:".concat(pk)+".notification"; + CDEquipmentInfo cdEquipmentInfo = REDIS.getCacheObject(skey); + if(cdEquipmentInfo==null || "".equals(cdEquipmentInfo.getEquipmentID())){ + return R.fail("该场站下面:"+pileNo+"桩未录入"); + } + cdEquipmentInfos.add(cdEquipmentInfo); + } + cdStationInfo.setEquipmentInfos(cdEquipmentInfos); + REDIS.setCacheObject(key, cdStationInfo); + return R.ok(); + } + return R.fail("场站未查询到充电桩信息"); + } + + + + } diff --git a/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/logic/BmsChargingCompletedDataLogic.java b/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/logic/BmsChargingCompletedDataLogic.java index 215beb0c..53c0e3f0 100644 --- a/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/logic/BmsChargingCompletedDataLogic.java +++ b/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/logic/BmsChargingCompletedDataLogic.java @@ -25,6 +25,10 @@ public class BmsChargingCompletedDataLogic implements ServiceLogic { @Override public ServiceResult service(ServiceParameter sp) throws Exception { + log.error("====0X19======getServiceName================"+sp.getServiceName()); + log.error("====0X19======getPileNo================"+sp.getPileNo()); + log.error("====0X19======getParameters================"+sp.getParameters()); + log.error("====0X19======getVersion================"+sp.getVersion()); String remark = "充电桩与 BMS 充电结束阶段报文"; Map req = sp.getParameters(); diff --git a/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/logic/RemoteStopReplyDataLogic.java b/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/logic/RemoteStopReplyDataLogic.java index d928fa5a..572329f6 100644 --- a/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/logic/RemoteStopReplyDataLogic.java +++ b/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/logic/RemoteStopReplyDataLogic.java @@ -29,7 +29,10 @@ public class RemoteStopReplyDataLogic implements ServiceLogic { @Override public ServiceResult service(ServiceParameter sp) throws Exception { - + log.error("=====0X35=====getServiceName================"+sp.getServiceName()); + log.error("=====0X35=====getPileNo================"+sp.getPileNo()); + log.error("=====0X35=====getParameters================"+sp.getParameters()); + log.error("=====0X35=====getVersion================"+sp.getVersion()); Map req = sp.getParameters(); ObjectMapper objectMapper = new ObjectMapper(); RemoteStopReplyData remoteStopReplyData = objectMapper.convertValue(req, RemoteStopReplyData.class); diff --git a/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/logic/ServiceMainLogic.java b/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/logic/ServiceMainLogic.java index d0f0e57c..f72ae17d 100644 --- a/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/logic/ServiceMainLogic.java +++ b/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/logic/ServiceMainLogic.java @@ -21,6 +21,10 @@ public class ServiceMainLogic { private Map serviceLogics; public ServiceResult process(ServiceParameter sp) { + log.error("==========getServiceName================"+sp.getServiceName()); + log.error("==========getPileNo================"+sp.getPileNo()); + log.error("==========getParameters================"+sp.getParameters()); + log.error("==========getVersion================"+sp.getVersion()); ServiceResult result; try { ServiceLogic logic = getServiceLogic(sp.getServiceName()); diff --git a/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/mapper/XhpcDeviceMessageMapper.java b/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/mapper/XhpcDeviceMessageMapper.java index eef6cf5b..be064d3a 100644 --- a/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/mapper/XhpcDeviceMessageMapper.java +++ b/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/mapper/XhpcDeviceMessageMapper.java @@ -1,6 +1,7 @@ package com.xhpc.pp.mapper; +import com.xhpc.evcs.cdjgpc.dto.CDStationInfo; import com.xhpc.evcs.domain.XhpcChargingPile; import com.xhpc.pp.domain.XhpcDeviceMessage; import org.apache.ibatis.annotations.Mapper; @@ -16,4 +17,5 @@ public interface XhpcDeviceMessageMapper { XhpcChargingPile getXhpcChargingPile(@Param("pileNo") String pileNo); + CDStationInfo getXhpcChargingStation(@Param("chargingStationId") Long chargingStationId); } diff --git a/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/server/ChargingPileBinaryHandler.java b/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/server/ChargingPileBinaryHandler.java index bea7fd2d..cd2e7725 100644 --- a/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/server/ChargingPileBinaryHandler.java +++ b/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/server/ChargingPileBinaryHandler.java @@ -78,6 +78,7 @@ public class ChargingPileBinaryHandler implements ClientBinaryHandler { log.error("incorrect input data |{}| len[{}]", dataStr, d.length); } String crc = calcCrc(d); + log.info("====111=====crc==================="+crc+"==========dataStr==============="+dataStr); if (!dataStr.endsWith(crc)) { log.error("incorrect input data crc {}", crc); continue; @@ -93,11 +94,13 @@ public class ChargingPileBinaryHandler implements ClientBinaryHandler { InterruptedException { String serviceName = toHex(data, 5, 6); + log.error("==========ChargingPileBinaryHandler================"+serviceName); String version = ChargingPileServer.getVersion(handler.getName()); Map req = analysis(data, serviceName, version); int seq = HexUtils.toInteger(data, 2, 4); req.put("seqint", seq); String pileNo = (String) req.get("pileNo"); + log.error("==========ChargingPileBinaryHandler====="+serviceName+"======req====="+req.toString()); ServiceParameter sp = new ServiceParameter(serviceName, pileNo, req); ServiceResult result = servicemainLogic.process(sp); String resultCode = result.getCode(); @@ -243,12 +246,20 @@ public class ChargingPileBinaryHandler implements ClientBinaryHandler { } public static void main(String[] args) { - byte[] data ={104, 34, 0, -125, 0, 1, -128, -125, 96, 0, 6, 0, 1, 1, 2, 12, 78, 71, 53, 46, 52, 46, 55, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -89, -69}; +// byte[] data ={104, 34, 0, -125, 0, 1, -128, -125, 96, 0, 6, 0, 1, 1, 2, 12, 78, 71, 53, 46, 52, 46, 55, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -89, -69}; +// +// byte[] datas ={100,101,102,103,104,105,106,107,108,10,11,12,13,14,15,16,17,18,19,109}; +// int i = HexUtils.toInteger(datas, 1, 2) ; +// +// System.out.println(i); + + String dataStr ="68A700C0003B80836000180001012309081438500002808360001800010150C3260E0809175898270E080917C027090000000000000000000000000000350C0000000000000000000000000040420F00000000000000000000000000804F12000000000000000000000000005C3B0400005C3B040000000000000000000000000000534149544552303030303030303030303101409C270E08091740000000000000000000660100006D70"; + String crc ="6D70"; + boolean b = dataStr.endsWith(crc); + + System.out.println("==b=="+b); - byte[] datas ={100,101,102,103,104,105,106,107,108,10,11,12,13,14,15,16,17,18,19,109}; - int i = HexUtils.toInteger(datas, 1, 2) ; - System.out.println(i); } diff --git a/xhpc-modules/xhpc-power-pile/src/main/resources/mapper/XhpcDeviceMessageMapper.xml b/xhpc-modules/xhpc-power-pile/src/main/resources/mapper/XhpcDeviceMessageMapper.xml index c26b2ae5..4f1ad811 100644 --- a/xhpc-modules/xhpc-power-pile/src/main/resources/mapper/XhpcDeviceMessageMapper.xml +++ b/xhpc-modules/xhpc-power-pile/src/main/resources/mapper/XhpcDeviceMessageMapper.xml @@ -17,6 +17,48 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + insert into xhpc_device_message( @@ -49,9 +91,91 @@ where create_time #{expireDate}; - + select + xcp.charging_pile_id as id, + xcp.charging_station_id as chargingStationId, + xcp.name name, + xcp.national_standard as nationalStandard, + xcp.power power, + xcp.auxiliary_power_supply auxiliaryPowerSupply, + xcp.input_voltage inputVoltage, + xcp.max_voltage maxVoltage, + xcp.min_voltage minVoltage, + xcp.max_electric_current maxElectricCurrent, + xcp.min_electric_current minElectricCurrent, + xcp.serial_number serialNumber, + xcp.type type, + xcp.program_version programVersion, + xcp.network_link_type networkLinkType, + xcp.gun_number gunNumber, + xcp.communication_protocol_version communicationProtocolVersion, + xcp.communication_operator communicationOperator, + xcp.sim_card simCard, + xcp.status status, + xcp.del_flag delFlag, + xcp.rate_model_id rateModelId, + xcp.brand_model brandModel, + date_format(xcp.production_date,'%Y-%m-%d') productionDate, + xcp.manufacture_name manufactureName, + xcp.connector_type connectorType, + xcp.equipment_type equipmentType, + xcp.current as current, + xcp.search_value searchValue, + xcp.equipment_product_code equipmentProductCode, + xcp.transformer_id transformerID, + xcp.new_national_standard newNationalStandard, + xcp.vin_flag vinFlag, + xcp.equipment_status equipmentStatus, + xcp.equipment_purpose equipmentPurpose, + xcp.manufacturer_id manufacturerId, + date_format(xcs.construction_time,'%Y-%m-%d') as constructionTime + from xhpc_charging_pile xcp + left join xhpc_charging_station xcs on xcs.charging_station_id = xcp.charging_station_id + where xcp.serial_number =#{pileNo} and xcp.del_flag =0 limit 1 - + diff --git a/xhpc-modules/xhpc-user/src/main/resources/mapper/XhpcAppUserMapper.xml b/xhpc-modules/xhpc-user/src/main/resources/mapper/XhpcAppUserMapper.xml index f4e73bfb..6dad2ed3 100644 --- a/xhpc-modules/xhpc-user/src/main/resources/mapper/XhpcAppUserMapper.xml +++ b/xhpc-modules/xhpc-user/src/main/resources/mapper/XhpcAppUserMapper.xml @@ -192,6 +192,7 @@