mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-21 03:25:12 +08:00
Merge branch 'dev' of http://192.168.2.2:8099/jsowell/jsowell-charger-web into dev
This commit is contained in:
@@ -1,72 +0,0 @@
|
||||
package com.jsowell.thirdparty.lianlian.domain;
|
||||
|
||||
import com.alibaba.fastjson2.annotation.JSONField;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 充电设备接口信息
|
||||
*/
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Data
|
||||
public class ConnectorInfo {
|
||||
/**
|
||||
* 充电设备接口编码 Y
|
||||
* 充电设备接口编码,同一对接平台内唯一
|
||||
*/
|
||||
@JSONField(name = "ConnectorID")
|
||||
private String connectorID;
|
||||
|
||||
/**
|
||||
* 充电设备接口名称 N
|
||||
*/
|
||||
// private String ConnectorName;
|
||||
|
||||
/**
|
||||
* 充电设备接口类型 Y
|
||||
* 1:家用插座(模式2)
|
||||
* 2:交流接口插座(模式3,连接方式B )
|
||||
* 3:交流接口插头(带枪线,模式3,连接方式C)
|
||||
* 4:直流接口枪头(带枪线,模式4)
|
||||
*/
|
||||
@JSONField(name = "ConnectorType")
|
||||
private Integer connectorType;
|
||||
|
||||
/**
|
||||
* 额定电压上限(单位:V) Y
|
||||
*/
|
||||
@JSONField(name = "VoltageUpperLimits")
|
||||
private Integer voltageUpperLimits;
|
||||
|
||||
/**
|
||||
* 额定电压下限(单位:V) Y
|
||||
*/
|
||||
@JSONField(name = "VoltageLowerLimits")
|
||||
private Integer voltageLowerLimits;
|
||||
|
||||
/**
|
||||
* 额定电流(单位:A) Y
|
||||
*/
|
||||
@JSONField(name = "Current")
|
||||
private Integer current;
|
||||
|
||||
/**
|
||||
* 额定功率(单位:kW) Y
|
||||
*/
|
||||
@JSONField(name = "Power")
|
||||
private BigDecimal power;
|
||||
|
||||
/**
|
||||
* 车位号 N
|
||||
* 停车场车位编号
|
||||
*/
|
||||
@JSONField(name = "ParkNo")
|
||||
private String parkNo;
|
||||
|
||||
}
|
||||
@@ -1,112 +0,0 @@
|
||||
package com.jsowell.thirdparty.lianlian.domain;
|
||||
|
||||
import com.alibaba.fastjson2.annotation.JSONField;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 充电设备信息
|
||||
*/
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Data
|
||||
public class EquipmentInfo {
|
||||
/**
|
||||
* 设备编码 Y
|
||||
* 设备唯一编码,对同一对接平台,保证唯一
|
||||
*/
|
||||
@JSONField(name = "EquipmentID")
|
||||
private String equipmentID;
|
||||
|
||||
/**
|
||||
* 设备生产商组织机构代码 Y
|
||||
*/
|
||||
@JSONField(name = "ManufacturerID")
|
||||
private String manufacturerID;
|
||||
|
||||
/**
|
||||
* 设备型号 N
|
||||
* 由设备生厂商定义的设备型号
|
||||
*/
|
||||
// private String EquipmentModel;
|
||||
|
||||
/**
|
||||
* 设备名称 N
|
||||
*/
|
||||
// private String EquipmentName;
|
||||
|
||||
/**
|
||||
* 设备生产日期 N
|
||||
* YYYY-MM-DD
|
||||
*/
|
||||
// private String ProductionDate;
|
||||
|
||||
/**
|
||||
* 建设时间 Y
|
||||
* YYYY-MM-DD
|
||||
*/
|
||||
@JSONField(name = "ConstructionTime")
|
||||
private String constructionTime;
|
||||
|
||||
/**
|
||||
* 设备类型(1-直流设备;2-交流设备;3-交直流一体设备) Y
|
||||
*/
|
||||
@JSONField(name = "EquipmentType")
|
||||
private Integer equipmentType;
|
||||
|
||||
/**
|
||||
* 设备状态 Y
|
||||
* 0:未知
|
||||
* 1:建设中
|
||||
* 5:关闭下线
|
||||
* 6:维护中
|
||||
* 50:正常使用
|
||||
*/
|
||||
@JSONField(name = "EquipmentStatus")
|
||||
private Integer equipmentStatus;
|
||||
|
||||
/**
|
||||
* 额定功率(单位:kW) Y
|
||||
*/
|
||||
@JSONField(name = "EquipmentPower")
|
||||
private BigDecimal equipmentPower;
|
||||
|
||||
/**
|
||||
* 新国标(0-否;1-是) Y
|
||||
* 是否新国标
|
||||
*/
|
||||
@JSONField(name = "NewNationalStandard")
|
||||
private Integer newNationalStandard;
|
||||
|
||||
/**
|
||||
* 充电设备接口列表 Y
|
||||
* 该充电设备所有的充电设备接口的信息对象集合
|
||||
*/
|
||||
@JSONField(name = "ConnectorInfos")
|
||||
private List<ConnectorInfo> connectorInfos;
|
||||
|
||||
/**
|
||||
* 充电设备经度 N
|
||||
* GCJ-02坐标系
|
||||
*/
|
||||
// private BigDecimal EquipmentLng;
|
||||
|
||||
/**
|
||||
* 充电设备纬度 N
|
||||
* GCJ-02坐标系
|
||||
*/
|
||||
// private BigDecimal EquipmentLat;
|
||||
|
||||
/**
|
||||
* 是否支持VIN码识别(0-否;1-是) Y
|
||||
*/
|
||||
@JSONField(name = "VinFlag")
|
||||
private Integer vinFlag;
|
||||
|
||||
}
|
||||
@@ -2,6 +2,7 @@ package com.jsowell.thirdparty.lianlian.domain;
|
||||
|
||||
|
||||
import com.alibaba.fastjson2.annotation.JSONField;
|
||||
import com.jsowell.pile.thirdparty.EquipmentInfo;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
@@ -12,6 +13,7 @@ import java.util.List;
|
||||
|
||||
/**
|
||||
* 充电站信息
|
||||
* 第三方平台使用
|
||||
*/
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
|
||||
@@ -18,8 +18,6 @@ public interface LianLianService {
|
||||
* 根据充电站id,推送充电站信息
|
||||
* @param dto
|
||||
*/
|
||||
// String pushStationInfo(PushStationInfoDTO dto);
|
||||
|
||||
String pushStationInfoV2(PushStationInfoDTO dto);
|
||||
|
||||
/**
|
||||
|
||||
@@ -9,6 +9,8 @@ import com.github.pagehelper.PageInfo;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.common.collect.Maps;
|
||||
import com.jsowell.common.constant.Constants;
|
||||
import com.jsowell.pile.thirdparty.ConnectorInfo;
|
||||
import com.jsowell.pile.thirdparty.EquipmentInfo;
|
||||
import com.jsowell.common.core.domain.ykc.RealTimeMonitorData;
|
||||
import com.jsowell.common.enums.lianlian.LianLianPileStatusEnum;
|
||||
import com.jsowell.common.enums.lianlian.PayChannelEnum;
|
||||
@@ -256,11 +258,6 @@ public class LianLianServiceImpl implements LianLianService {
|
||||
// }
|
||||
|
||||
public String pushStationInfoV2(PushStationInfoDTO dto) {
|
||||
// String OperatorID = "987654321";
|
||||
// String SigSecret = "1234567890abcdef"; // 签名秘钥
|
||||
// String DataSecret = "1234567890abcdef"; // 消息密钥
|
||||
// String DataSecretIV = "1234567890abcdef"; // 消息密钥初始化向量
|
||||
// String token = "c548f9276c1c4ea8b88b1f7b1eb7cf07"; //QueryToken类查询接口获取到的token
|
||||
|
||||
// 通过id查询站点相关信息
|
||||
PileStationInfo pileStationInfo = pileStationInfoService.selectPileStationInfoById(dto.getStationId());
|
||||
|
||||
@@ -39,12 +39,18 @@ import java.util.*;
|
||||
public abstract class AbsInterfaceWithPlatformLogic implements InitializingBean {
|
||||
protected final Logger logger = LoggerFactory.getLogger(this.getClass());
|
||||
|
||||
@Autowired
|
||||
protected PileMerchantInfoService pileMerchantInfoService;
|
||||
|
||||
@Autowired
|
||||
protected PileStationInfoService pileStationInfoService;
|
||||
|
||||
@Autowired
|
||||
protected ThirdPartyPlatformConfigService thirdPartyPlatformConfigService;
|
||||
|
||||
@Autowired
|
||||
protected ThirdPartySettingInfoService thirdPartySettingInfoService;
|
||||
|
||||
@Autowired
|
||||
protected PileBillingTemplateService pileBillingTemplateService;
|
||||
|
||||
@@ -54,9 +60,6 @@ public abstract class AbsInterfaceWithPlatformLogic implements InitializingBean
|
||||
@Autowired
|
||||
protected PileConnectorInfoService pileConnectorInfoService;
|
||||
|
||||
@Autowired
|
||||
protected ThirdPartyStationRelationService relationService;
|
||||
|
||||
@Autowired
|
||||
protected PileModelInfoService pileModelInfoService;
|
||||
|
||||
@@ -80,34 +83,40 @@ public abstract class AbsInterfaceWithPlatformLogic implements InitializingBean
|
||||
// =================================================================================== //
|
||||
|
||||
/**
|
||||
* 查询运营商信息 supervise_query_operator_info
|
||||
* 查询运营商信息 query_operator_info
|
||||
* supervise_query_operator_info
|
||||
* @param dto 查询运营商信息DTO
|
||||
* @exception UnsupportedOperationException 未实现异常
|
||||
*/
|
||||
public abstract Map<String, String> queryOperatorInfo(QueryOperatorInfoDTO dto);
|
||||
|
||||
/**
|
||||
* 6.2 查询充电站信息 query_stations_info
|
||||
* 查询充电站信息 query_stations_info
|
||||
* 此接口用于查询对接平台的充电站的信息
|
||||
* @param dto 查询站点信息dto
|
||||
* @exception UnsupportedOperationException 未实现异常
|
||||
*/
|
||||
public abstract Map<String, String> queryStationsInfo(QueryStationInfoDTO dto);
|
||||
|
||||
/**
|
||||
* 6.5 设备接口状态查询 query_station_status
|
||||
* 设备接口状态查询 query_station_status
|
||||
*
|
||||
* @param dto 查询站点信息dto
|
||||
* @exception UnsupportedOperationException 未实现异常
|
||||
*/
|
||||
public abstract Map<String, String> queryStationStatus(QueryStationInfoDTO dto);
|
||||
|
||||
/**
|
||||
* 查询统计信息
|
||||
* 查询统计信息 query_station_stats
|
||||
*
|
||||
* @param dto 查询站点信息dto
|
||||
* @exception UnsupportedOperationException 未实现异常
|
||||
*/
|
||||
public abstract Map<String, String> queryStationStats(QueryStationInfoDTO dto);
|
||||
|
||||
/**
|
||||
* 查询充电电量信息 query_order_info
|
||||
* @exception UnsupportedOperationException 未实现异常
|
||||
*/
|
||||
public abstract Map<String, String> queryOrderInfo(String orderCode);
|
||||
|
||||
@@ -115,6 +124,7 @@ public abstract class AbsInterfaceWithPlatformLogic implements InitializingBean
|
||||
* 请求设备认证 query_equip_auth
|
||||
* 业务信息交换
|
||||
* @param dto 联联平台请求设备认证
|
||||
* @exception UnsupportedOperationException 未实现异常
|
||||
*/
|
||||
public abstract Map<String, String> queryEquipAuth(QueryEquipmentDTO dto);
|
||||
|
||||
@@ -122,6 +132,7 @@ public abstract class AbsInterfaceWithPlatformLogic implements InitializingBean
|
||||
* 请求启动充电 query_start_charge
|
||||
*
|
||||
* @param dto 请求启动充电DTO
|
||||
* @exception UnsupportedOperationException 未实现异常
|
||||
*/
|
||||
public abstract Map<String, String> queryStartCharge(QueryStartChargeDTO dto);
|
||||
|
||||
@@ -129,6 +140,7 @@ public abstract class AbsInterfaceWithPlatformLogic implements InitializingBean
|
||||
* 查询充电状态 query_equip_charge_status
|
||||
*
|
||||
* @param dto 查询充电状态DTO
|
||||
* @exception UnsupportedOperationException 未实现异常
|
||||
*/
|
||||
public abstract Map<String, String> queryEquipChargeStatus(QueryEquipChargeStatusDTO dto);
|
||||
|
||||
@@ -136,21 +148,25 @@ public abstract class AbsInterfaceWithPlatformLogic implements InitializingBean
|
||||
* 请求停止充电 query_stop_charge
|
||||
*
|
||||
* @param dto 请求启动充电DTO
|
||||
* @exception UnsupportedOperationException 未实现异常
|
||||
*/
|
||||
public abstract Map<String, String> queryStopCharge(QueryStartChargeDTO dto);
|
||||
|
||||
/**
|
||||
* 充电站内充电桩空闲状态查询 query_free_pile_number
|
||||
* @exception UnsupportedOperationException 未实现异常
|
||||
*/
|
||||
public abstract Map<String, String> queryFreePileNumber(NXJTQueryStationInfoDTO dto);
|
||||
|
||||
/**
|
||||
* 某车牌号消费记录查询 query_orders_info_by_Plate_number
|
||||
* @exception UnsupportedOperationException 未实现异常
|
||||
*/
|
||||
public abstract Map<String, String> queryOrdersInfoByPlateNumber(NXJTQueryStationInfoDTO dto);
|
||||
|
||||
/**
|
||||
* 某段时间内消费记录查询 query_orders_info
|
||||
* @exception UnsupportedOperationException 未实现异常
|
||||
*/
|
||||
public abstract Map<String, String> queryOrdersInfo(NXJTQueryStationInfoDTO dto);
|
||||
|
||||
@@ -158,6 +174,7 @@ public abstract class AbsInterfaceWithPlatformLogic implements InitializingBean
|
||||
* 查询业务策略信息结果
|
||||
* 请求计费策略 request_equip_business_policy
|
||||
* @param dto 请求启动充电DTO
|
||||
* @exception UnsupportedOperationException 未实现异常
|
||||
*/
|
||||
public abstract Map<String, String> queryEquipBusinessPolicy(QueryStartChargeDTO dto);
|
||||
|
||||
@@ -171,12 +188,14 @@ public abstract class AbsInterfaceWithPlatformLogic implements InitializingBean
|
||||
/**
|
||||
* VIN码充电 insert_start_charge
|
||||
* 华为平台
|
||||
* @exception UnsupportedOperationException 未实现异常
|
||||
*/
|
||||
public abstract Map<String, String> insertStartCharge(QueryStationInfoDTO dto);
|
||||
|
||||
/**
|
||||
* 下发计费策略响应 notification_deliver_equip_business_policy_result
|
||||
* 华为平台
|
||||
* @exception UnsupportedOperationException 未实现异常
|
||||
*/
|
||||
public abstract Map<String, String> notificationDeliverEquipBusinessPolicyResult(QueryStationInfoDTO dto);
|
||||
|
||||
@@ -189,6 +208,7 @@ public abstract class AbsInterfaceWithPlatformLogic implements InitializingBean
|
||||
* 充电站信息变化推送 notification_stationInfo
|
||||
* 新站需要推送。当站点信息发生变化时,推送新的信息通知到市级平台
|
||||
* @param stationId 充电站id
|
||||
* @exception UnsupportedOperationException 未实现异常
|
||||
*/
|
||||
public abstract String notificationStationInfo(String stationId);
|
||||
|
||||
@@ -197,6 +217,7 @@ public abstract class AbsInterfaceWithPlatformLogic implements InitializingBean
|
||||
* 推送充电设备接口状态信息 supervise_notification_station_status
|
||||
* @param pileConnectorCode 充电枪口编号
|
||||
* @param status 枪口状态
|
||||
* @exception UnsupportedOperationException 未实现异常
|
||||
*/
|
||||
public abstract String notificationStationStatus(String pileConnectorCode, String status);
|
||||
|
||||
@@ -204,16 +225,19 @@ public abstract class AbsInterfaceWithPlatformLogic implements InitializingBean
|
||||
* 设备充电中状态变化推送 notification_connector_charge_status
|
||||
* @param pileConnectorCode 充电枪口编号
|
||||
* @param status 枪口状态
|
||||
* @exception UnsupportedOperationException 未实现异常
|
||||
*/
|
||||
public abstract String notificationConnectorChargeStatus(String pileConnectorCode, String status);
|
||||
public abstract String notificationConnectorChargeStatus(String orderCode);
|
||||
|
||||
/**
|
||||
* 订单信息推送 notification_orderInfo
|
||||
* @exception UnsupportedOperationException 未实现异常
|
||||
*/
|
||||
public abstract String notificationOrderInfo(String orderCode);
|
||||
|
||||
/**
|
||||
* 站点费率变化推送 notification_stationFee
|
||||
* @exception UnsupportedOperationException 未实现异常
|
||||
*/
|
||||
public abstract String notificationStationFee(String stationId);
|
||||
|
||||
@@ -224,17 +248,20 @@ public abstract class AbsInterfaceWithPlatformLogic implements InitializingBean
|
||||
* TODO 华为平台文档中的接口,检查一下是否和订单信息推送notification_orderInfo一致
|
||||
* TODO 内蒙古平台文档中的接口,检查一下是否和订单信息推送notification_orderInfo一致
|
||||
* @param orderCode 订单编号
|
||||
* @exception UnsupportedOperationException 未实现异常
|
||||
*/
|
||||
public abstract String notificationChargeOrderInfo(String orderCode);
|
||||
|
||||
/**
|
||||
* 告警信息推送 notification_alarmInfo
|
||||
* @exception UnsupportedOperationException 未实现异常
|
||||
*/
|
||||
public abstract String notificationAlarmInfo();
|
||||
|
||||
/**
|
||||
* 推送启动充电结果 notification_start_charge_result
|
||||
* @param orderCode 订单编号
|
||||
* @exception UnsupportedOperationException 未实现异常
|
||||
*/
|
||||
public abstract String notificationStartChargeResult(String orderCode);
|
||||
|
||||
@@ -242,28 +269,33 @@ public abstract class AbsInterfaceWithPlatformLogic implements InitializingBean
|
||||
* 推送充电状态 notification_equip_charge_status
|
||||
* 推送充电状态信息 supervise_notification_equip_charge_status
|
||||
* @param orderCode 订单编号
|
||||
* @exception UnsupportedOperationException 未实现异常
|
||||
*/
|
||||
public abstract String notificationEquipChargeStatus(String orderCode);
|
||||
public abstract String notificationEquipChargeStatus(String orderCode) throws UnsupportedOperationException;
|
||||
|
||||
/**
|
||||
* 推送停止充电结果 notification_stop_charge_result
|
||||
* @param orderCode 订单编号
|
||||
* @exception UnsupportedOperationException 未实现异常
|
||||
*/
|
||||
public abstract String notificationStopChargeResult(String orderCode);
|
||||
|
||||
/**
|
||||
* 华为平台
|
||||
* 平台充电设备编码同步 notification_operation_system_info
|
||||
* @exception UnsupportedOperationException 未实现异常
|
||||
*/
|
||||
public abstract String notificationOperationSystemInfo(String orderCode);
|
||||
|
||||
/**
|
||||
* 推送充换电站用能统计信息 supervise_notification_operation_stats_info
|
||||
* @exception UnsupportedOperationException 未实现异常
|
||||
*/
|
||||
public abstract String notificationOperationStatsInfo(String stationId);
|
||||
|
||||
/**
|
||||
* 推送充电站历史充电订单信息 supervise_notification_charge_order_info_history
|
||||
* @exception UnsupportedOperationException 未实现异常
|
||||
*/
|
||||
public abstract String notificationChargeOrderInfoHistory(String stationId);
|
||||
|
||||
|
||||
@@ -16,22 +16,22 @@ public class InterfaceWithPlatformLogicFactory {
|
||||
|
||||
/**
|
||||
* 注册
|
||||
* @param str
|
||||
* @param handler
|
||||
* @param code 平台code {@link com.jsowell.common.enums.thirdparty.ThirdPlatformTypeEnum}
|
||||
* @param handler 处理逻辑类
|
||||
*/
|
||||
public static void register(String str, AbsInterfaceWithPlatformLogic handler) {
|
||||
if (StringUtils.isBlank(str) || Objects.isNull(handler)) {
|
||||
public static void register(String code, AbsInterfaceWithPlatformLogic handler) {
|
||||
if (StringUtils.isBlank(code) || Objects.isNull(handler)) {
|
||||
return;
|
||||
}
|
||||
platformMap.put(str, handler);
|
||||
platformMap.put(code, handler);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取
|
||||
* @param name
|
||||
* @return
|
||||
* @param code 平台code {@link com.jsowell.common.enums.thirdparty.ThirdPlatformTypeEnum}
|
||||
* @return 处理逻辑类
|
||||
*/
|
||||
public static AbsInterfaceWithPlatformLogic getPlatformLogic(String name) {
|
||||
return platformMap.get(name);
|
||||
public static AbsInterfaceWithPlatformLogic getPlatformLogic(String code) {
|
||||
return platformMap.get(code);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -80,7 +80,8 @@ public class HaiNanPlatformLogic extends AbsInterfaceWithPlatformLogic {
|
||||
*/
|
||||
@Override
|
||||
public Map<String, String> queryOperatorInfo(QueryOperatorInfoDTO dto) {
|
||||
return null;
|
||||
//方法未实现,抛出异常
|
||||
throw new UnsupportedOperationException("This method is not yet implemented");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -89,7 +90,7 @@ public class HaiNanPlatformLogic extends AbsInterfaceWithPlatformLogic {
|
||||
public Map<String, String> queryStationsInfo(QueryStationInfoDTO dto) {
|
||||
// 查询出要查询的充电站id并set进 dto 的stationIds
|
||||
if (StringUtils.isNotBlank(dto.getThirdPlatformType())) {
|
||||
List<ThirdPartyStationRelation> xdtList = relationService.selectThirdPartyStationRelationList(dto.getThirdPlatformType());
|
||||
List<ThirdPartyStationRelation> xdtList = thirdPartyStationRelationService.selectThirdPartyStationRelationList(dto.getThirdPlatformType());
|
||||
if (CollectionUtils.isNotEmpty(xdtList)) {
|
||||
List<String> stationList = xdtList.stream()
|
||||
.map(x -> String.valueOf(x.getStationId()))
|
||||
@@ -284,8 +285,9 @@ public class HaiNanPlatformLogic extends AbsInterfaceWithPlatformLogic {
|
||||
* @param status 枪口状态
|
||||
*/
|
||||
@Override
|
||||
public String notificationConnectorChargeStatus(String pileConnectorCode, String status) {
|
||||
return null;
|
||||
public String notificationConnectorChargeStatus(String orderCode) {
|
||||
//方法未实现,抛出异常
|
||||
throw new UnsupportedOperationException("This method is not yet implemented");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -295,7 +297,8 @@ public class HaiNanPlatformLogic extends AbsInterfaceWithPlatformLogic {
|
||||
*/
|
||||
@Override
|
||||
public String notificationOrderInfo(String orderCode) {
|
||||
return null;
|
||||
//方法未实现,抛出异常
|
||||
throw new UnsupportedOperationException("This method is not yet implemented");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -305,7 +308,8 @@ public class HaiNanPlatformLogic extends AbsInterfaceWithPlatformLogic {
|
||||
*/
|
||||
@Override
|
||||
public String notificationStationFee(String stationId) {
|
||||
return null;
|
||||
//方法未实现,抛出异常
|
||||
throw new UnsupportedOperationException("This method is not yet implemented");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -361,7 +365,8 @@ public class HaiNanPlatformLogic extends AbsInterfaceWithPlatformLogic {
|
||||
*/
|
||||
@Override
|
||||
public String notificationAlarmInfo() {
|
||||
return null;
|
||||
//方法未实现,抛出异常
|
||||
throw new UnsupportedOperationException("This method is not yet implemented");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -456,7 +461,7 @@ public class HaiNanPlatformLogic extends AbsInterfaceWithPlatformLogic {
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询统计信息
|
||||
* 查询统计信息 query_station_stats
|
||||
*
|
||||
* @param dto
|
||||
*/
|
||||
@@ -561,7 +566,8 @@ public class HaiNanPlatformLogic extends AbsInterfaceWithPlatformLogic {
|
||||
*/
|
||||
@Override
|
||||
public Map<String, String> queryOrderInfo(String orderCode) {
|
||||
return null;
|
||||
//方法未实现,抛出异常
|
||||
throw new UnsupportedOperationException("This method is not yet implemented");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -572,7 +578,8 @@ public class HaiNanPlatformLogic extends AbsInterfaceWithPlatformLogic {
|
||||
*/
|
||||
@Override
|
||||
public String notificationStationInfo(String stationId) {
|
||||
return null;
|
||||
//方法未实现,抛出异常
|
||||
throw new UnsupportedOperationException("This method is not yet implemented");
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -0,0 +1,988 @@
|
||||
package com.jsowell.thirdparty.platform.lianlian.service;
|
||||
|
||||
import cn.hutool.core.util.PageUtil;
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.common.collect.Maps;
|
||||
import com.jsowell.common.constant.Constants;
|
||||
import com.jsowell.common.core.domain.ykc.RealTimeMonitorData;
|
||||
import com.jsowell.common.enums.lianlian.PayChannelEnum;
|
||||
import com.jsowell.common.enums.lianlian.StationPaymentEnum;
|
||||
import com.jsowell.common.enums.thirdparty.BusinessInformationExchangeEnum;
|
||||
import com.jsowell.common.enums.thirdparty.ThirdPlatformTypeEnum;
|
||||
import com.jsowell.common.enums.ykc.OrderPayModeEnum;
|
||||
import com.jsowell.common.enums.ykc.PileConnectorDataBaseStatusEnum;
|
||||
import com.jsowell.common.util.DateUtils;
|
||||
import com.jsowell.common.util.PageUtils;
|
||||
import com.jsowell.common.util.StringUtils;
|
||||
import com.jsowell.pile.domain.*;
|
||||
import com.jsowell.pile.dto.*;
|
||||
import com.jsowell.pile.dto.ningxiajiaotou.NXJTQueryStationInfoDTO;
|
||||
import com.jsowell.pile.thirdparty.EquipmentInfo;
|
||||
import com.jsowell.pile.vo.base.*;
|
||||
import com.jsowell.pile.vo.lianlian.AccumulativeInfoVO;
|
||||
import com.jsowell.pile.vo.lianlian.PushStationFeeVO;
|
||||
import com.jsowell.pile.vo.uniapp.BillingPriceVO;
|
||||
import com.jsowell.pile.vo.web.PileStationVO;
|
||||
import com.jsowell.thirdparty.lianlian.domain.*;
|
||||
import com.jsowell.thirdparty.lianlian.util.Cryptos;
|
||||
import com.jsowell.thirdparty.lianlian.util.Encodes;
|
||||
import com.jsowell.thirdparty.lianlian.util.GBSignUtils;
|
||||
import com.jsowell.thirdparty.lianlian.util.HttpRequestUtil;
|
||||
import com.jsowell.thirdparty.platform.AbsInterfaceWithPlatformLogic;
|
||||
import com.jsowell.thirdparty.platform.InterfaceWithPlatformLogicFactory;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class LianLianPlatformLogic extends AbsInterfaceWithPlatformLogic {
|
||||
// 平台类型
|
||||
private final String platformType = ThirdPlatformTypeEnum.LIAN_LIAN_PLATFORM.getCode();
|
||||
|
||||
@Override
|
||||
public void afterPropertiesSet() throws Exception {
|
||||
InterfaceWithPlatformLogicFactory.register(platformType, this);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询运营商信息 query_operator_info
|
||||
* supervise_query_operator_info
|
||||
*
|
||||
* @param dto 查询运营商信息DTO
|
||||
* @throws UnsupportedOperationException 未实现异常
|
||||
*/
|
||||
@Override
|
||||
public Map<String, String> queryOperatorInfo(QueryOperatorInfoDTO dto) {
|
||||
//方法未实现,抛出异常
|
||||
throw new UnsupportedOperationException("This method is not yet implemented");
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询充电站信息 query_stations_info
|
||||
* 此接口用于查询对接平台的充电站的信息
|
||||
*
|
||||
* @param dto 查询站点信息dto
|
||||
* @throws UnsupportedOperationException 未实现异常
|
||||
*/
|
||||
@Override
|
||||
public Map<String, String> queryStationsInfo(QueryStationInfoDTO dto) {
|
||||
List<StationInfo> resultList = new ArrayList<>();
|
||||
int pageNo = dto.getPageNo() == null ? 1 : dto.getPageNo();
|
||||
int pageSize = dto.getPageSize() == null ? 10 : dto.getPageSize();
|
||||
|
||||
PageUtils.startPage(pageNo, pageSize);
|
||||
List<ThirdPartyStationInfoVO> stationInfos = pileStationInfoService.getStationInfosByThirdParty(dto);
|
||||
if (CollectionUtils.isEmpty(stationInfos)) {
|
||||
// 未查到数据
|
||||
return null;
|
||||
}
|
||||
ThirdPartyPlatformConfig configInfo = thirdPartyPlatformConfigService.getInfoByOperatorId(dto.getOperatorId());
|
||||
if (configInfo == null) {
|
||||
return null;
|
||||
}
|
||||
PageInfo<ThirdPartyStationInfoVO> pageInfo = new PageInfo<>(stationInfos);
|
||||
for (ThirdPartyStationInfoVO pileStationInfo : pageInfo.getList()) {
|
||||
StationInfo stationInfo = new StationInfo();
|
||||
stationInfo.setStationID(String.valueOf(pileStationInfo.getId()));
|
||||
// MerchantInfoVO merchantInfo = pileMerchantInfoService.getMerchantInfo(String.valueOf(pileStationInfo.getMerchantId()));
|
||||
stationInfo.setOperatorID(Constants.OPERATORID_LIANLIAN); // 组织机构代码
|
||||
stationInfo.setEquipmentOwnerID(String.valueOf(pileStationInfo.getMerchantId()));
|
||||
stationInfo.setStationName(pileStationInfo.getStationName());
|
||||
stationInfo.setIsAloneApply(Integer.valueOf(pileStationInfo.getAloneApply()));
|
||||
stationInfo.setIsPublicParkingLot(Integer.valueOf(pileStationInfo.getPublicParking()));
|
||||
stationInfo.setCountryCode(pileStationInfo.getCountryCode());
|
||||
stationInfo.setAreaCode(pileStationInfo.getAreaCode());
|
||||
stationInfo.setAddress(pileStationInfo.getAddress());
|
||||
stationInfo.setServiceTel(pileStationInfo.getStationTel());
|
||||
stationInfo.setStationType(Integer.valueOf(pileStationInfo.getStationType()));
|
||||
stationInfo.setParkNums(Integer.valueOf(pileStationInfo.getParkNums()));
|
||||
stationInfo.setStationLng(new BigDecimal(pileStationInfo.getStationLng()));
|
||||
stationInfo.setStationLat(new BigDecimal(pileStationInfo.getStationLat()));
|
||||
stationInfo.setConstruction(Integer.valueOf(pileStationInfo.getConstruction()));
|
||||
stationInfo.setOpenAllDay(Integer.valueOf(pileStationInfo.getOpenAllDay()));
|
||||
// stationInfo.setMinElectricityPrice(pileStationInfo); // 最低充电电费率
|
||||
// stationInfo.setElectricityFee(); // 电费 xx元/度
|
||||
// stationInfo.setServiceFee(); // 服务费 xx元/度
|
||||
stationInfo.setParkFree(Integer.valueOf(pileStationInfo.getParkFree()));
|
||||
stationInfo.setPayment(pileStationInfo.getPayment());
|
||||
stationInfo.setSupportOrder(Integer.valueOf(pileStationInfo.getSupportOrder()));
|
||||
// stationInfo.setParkFeeType(pileStationInfo); // 停车收费类型
|
||||
stationInfo.setToiletFlag(Integer.valueOf(pileStationInfo.getToiletFlag()));
|
||||
stationInfo.setStoreFlag(Integer.valueOf(pileStationInfo.getStoreFlag()));
|
||||
stationInfo.setRestaurantFlag(Integer.valueOf(pileStationInfo.getRestaurantFlag()));
|
||||
stationInfo.setLoungeFlag(Integer.valueOf(pileStationInfo.getLoungeFlag()));
|
||||
stationInfo.setCanopyFlag(Integer.valueOf(pileStationInfo.getCanopyFlag()));
|
||||
stationInfo.setPrinterFlag(Integer.valueOf(pileStationInfo.getPrinterFlag()));
|
||||
stationInfo.setBarrierFlag(Integer.valueOf(pileStationInfo.getBarrierFlag()));
|
||||
stationInfo.setParkingLockFlag(Integer.valueOf(pileStationInfo.getParkingLockFlag()));
|
||||
|
||||
List<EquipmentInfo> pileList = pileBasicInfoService.getPileList(pileStationInfo);
|
||||
if (CollectionUtils.isNotEmpty(pileList)) {
|
||||
stationInfo.setEquipmentInfos(pileList); // 充电设备信息列表
|
||||
}
|
||||
|
||||
resultList.add(stationInfo);
|
||||
}
|
||||
Map<String, Object> map = new LinkedHashMap<>();
|
||||
map.put("PageNo", pageInfo.getPageNum());
|
||||
map.put("PageCount", pageInfo.getPages());
|
||||
map.put("ItemSize", resultList.size());
|
||||
map.put("StationInfos", resultList);
|
||||
|
||||
// 加密
|
||||
Map<String, String> resultMap = Maps.newLinkedHashMap();
|
||||
// 加密数据
|
||||
byte[] encryptText = Cryptos.aesEncrypt(JSON.toJSONString(map).getBytes(),
|
||||
configInfo.getDataSecret().getBytes(), configInfo.getDataSecretIv().getBytes());
|
||||
String encryptData = Encodes.encodeBase64(encryptText);
|
||||
|
||||
resultMap.put("Data", encryptData);
|
||||
// 生成sig
|
||||
String resultSign = GBSignUtils.sign(resultMap, configInfo.getSignSecret());
|
||||
resultMap.put("Sig", resultSign);
|
||||
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设备接口状态查询 query_station_status
|
||||
*
|
||||
* @param dto 查询站点信息dto
|
||||
* @throws UnsupportedOperationException 未实现异常
|
||||
*/
|
||||
@Override
|
||||
public Map<String, String> queryStationStatus(QueryStationInfoDTO dto) {
|
||||
List<String> stationIds = dto.getStationIds();
|
||||
List<StationStatusInfo> StationStatusInfos = new ArrayList<>();
|
||||
List<Object> ConnectorStatusInfos = new ArrayList<>();
|
||||
ThirdPartyPlatformConfig configInfo = thirdPartyPlatformConfigService.getInfoByOperatorId(dto.getOperatorId());
|
||||
if (configInfo == null) {
|
||||
return null;
|
||||
}
|
||||
ConnectorStatusInfo connectorStatusInfo;
|
||||
for (String stationId : stationIds) {
|
||||
StationStatusInfo stationStatusInfo= new StationStatusInfo();
|
||||
stationStatusInfo.setStationId(stationId);
|
||||
// 根据站点id查询
|
||||
List<ConnectorInfoVO> list = pileConnectorInfoService.getConnectorListForLianLian(Long.parseLong(stationId));
|
||||
for (ConnectorInfoVO connectorInfoVO : list) {
|
||||
|
||||
String connectorStatus = connectorInfoVO.getConnectorStatus();
|
||||
if (StringUtils.equals(connectorStatus, PileConnectorDataBaseStatusEnum.OCCUPIED_CHARGING.getValue())) {
|
||||
// 充电中
|
||||
ConnectorChargeStatusInfo info = new ConnectorChargeStatusInfo();
|
||||
OrderBasicInfo orderBasicInfo = orderBasicInfoService.queryChargingByPileConnectorCode(connectorInfoVO.getPileConnectorCode());
|
||||
if (orderBasicInfo == null) {
|
||||
continue;
|
||||
}
|
||||
List<RealTimeMonitorData> chargingRealTimeData = orderBasicInfoService.getChargingRealTimeData(orderBasicInfo.getTransactionCode());
|
||||
if(CollectionUtils.isNotEmpty(chargingRealTimeData)) {
|
||||
RealTimeMonitorData realTimeMonitorData = chargingRealTimeData.get(0);
|
||||
|
||||
info.setStartChargeSeq(orderBasicInfo.getOrderCode());
|
||||
info.setConnectorID(orderBasicInfo.getPileConnectorCode());
|
||||
info.setConnectorStatus(Integer.valueOf(connectorInfoVO.getConnectorStatus()));
|
||||
info.setCurrentA(new BigDecimal(realTimeMonitorData.getOutputCurrent()));
|
||||
info.setVoltageA(new BigDecimal(realTimeMonitorData.getOutputVoltage()));
|
||||
info.setSoc(new BigDecimal(realTimeMonitorData.getSOC()));
|
||||
info.setStartTime(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, orderBasicInfo.getChargeStartTime()));
|
||||
info.setEndTime(DateUtils.getDateTime()); // 本次采样时间
|
||||
info.setTotalPower(new BigDecimal(realTimeMonitorData.getChargingDegree())); // 累计充电量
|
||||
// info.setElecMoney(); // 累计电费
|
||||
// info.setSeviceMoney(); // 累计服务费
|
||||
info.setTotalMoney(new BigDecimal(realTimeMonitorData.getChargingAmount()));
|
||||
|
||||
ConnectorStatusInfos.add(info);
|
||||
}
|
||||
} else {
|
||||
// 其他
|
||||
connectorStatusInfo = new ConnectorStatusInfo();
|
||||
connectorStatusInfo.setConnectorID(connectorInfoVO.getPileConnectorCode());
|
||||
connectorStatusInfo.setStatus(Integer.parseInt(connectorInfoVO.getConnectorStatus()));
|
||||
|
||||
ConnectorStatusInfos.add(connectorStatusInfo);
|
||||
}
|
||||
}
|
||||
stationStatusInfo.setConnectorStatusInfos(ConnectorStatusInfos);
|
||||
StationStatusInfos.add(stationStatusInfo);
|
||||
}
|
||||
// 将 StationStatusInfos 分页
|
||||
int pageNum = 1;
|
||||
int pageSize = 10;
|
||||
List<StationStatusInfo> collect = StationStatusInfos.stream()
|
||||
.skip((pageNum - 1) * pageSize)
|
||||
.limit(pageSize)
|
||||
.collect(Collectors.toList());
|
||||
|
||||
int total = StationStatusInfos.size();
|
||||
int pages = PageUtil.totalPage(total, pageSize);
|
||||
|
||||
Map<String, Object> map = new LinkedHashMap<>();
|
||||
map.put("Total", total);
|
||||
map.put("StationStatusInfos", collect);
|
||||
|
||||
// 加密
|
||||
Map<String, String> resultMap = Maps.newLinkedHashMap();
|
||||
// 加密数据
|
||||
byte[] encryptText = Cryptos.aesEncrypt(JSON.toJSONString(map).getBytes(),
|
||||
configInfo.getDataSecret().getBytes(), configInfo.getDataSecretIv().getBytes());
|
||||
String encryptData = Encodes.encodeBase64(encryptText);
|
||||
|
||||
resultMap.put("Data", encryptData);
|
||||
// 生成sig
|
||||
String resultSign = GBSignUtils.sign(resultMap, configInfo.getSignSecret());
|
||||
resultMap.put("Sig", resultSign);
|
||||
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询统计信息 query_station_stats
|
||||
*
|
||||
* @param dto 查询站点信息dto
|
||||
* @throws UnsupportedOperationException 未实现异常
|
||||
*/
|
||||
@Override
|
||||
public Map<String, String> queryStationStats(QueryStationInfoDTO dto) {
|
||||
ThirdPartyPlatformConfig configInfo = thirdPartyPlatformConfigService.getInfoByOperatorId(dto.getOperatorId());
|
||||
if (configInfo == null) {
|
||||
return null;
|
||||
}
|
||||
// 根据站点id 查出这段时间的充电量
|
||||
List<AccumulativeInfoVO> list = orderBasicInfoService.getAccumulativeInfoForLianLian(dto);
|
||||
if (CollectionUtils.isEmpty(list)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// 根据充电桩编号分组 key=充电桩编号
|
||||
Map<String, List<AccumulativeInfoVO>> pileMap = list.stream()
|
||||
.collect(Collectors.groupingBy(AccumulativeInfoVO::getPileSn));
|
||||
|
||||
// 存放所有充电桩设备
|
||||
List<EquipmentStatsInfo> equipmentStatsInfoList = Lists.newArrayList();
|
||||
// 站点用电量
|
||||
BigDecimal stationElectricity = BigDecimal.ZERO;
|
||||
// 用于记录枪口用电量 在循环每个枪口的时候初始化
|
||||
BigDecimal pileElec;
|
||||
for (String pileSn : pileMap.keySet()) {
|
||||
// 该充电桩下 所有枪口的用电数据
|
||||
List<AccumulativeInfoVO> accumulativeInfoVOS = pileMap.get(pileSn);
|
||||
if (CollectionUtils.isEmpty(accumulativeInfoVOS)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// 存放充电桩用电量
|
||||
pileElec = BigDecimal.ZERO;
|
||||
|
||||
// key=枪口编号 value 该枪口的用电数据
|
||||
Map<String, List<AccumulativeInfoVO>> collect = accumulativeInfoVOS.stream()
|
||||
.collect(Collectors.groupingBy(AccumulativeInfoVO::getPileConnectorCode));
|
||||
|
||||
List<ConnectorStatsInfo> connectorStatsInfos = Lists.newArrayList();
|
||||
for (Map.Entry<String, List<AccumulativeInfoVO>> entry : collect.entrySet()) {
|
||||
String pileConnectorCode = entry.getKey();
|
||||
List<AccumulativeInfoVO> value = entry.getValue();
|
||||
// 枪口用电量求和
|
||||
BigDecimal connectorElec = value.stream()
|
||||
.map(AccumulativeInfoVO::getConnectorElectricity)
|
||||
.map(BigDecimal::new)
|
||||
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
|
||||
connectorStatsInfos.add(
|
||||
ConnectorStatsInfo.builder()
|
||||
.connectorID(pileConnectorCode)
|
||||
.connectorElectricity(connectorElec)
|
||||
.build()
|
||||
);
|
||||
// 充电桩电量为枪口用电量累计
|
||||
pileElec = pileElec.add(connectorElec);
|
||||
}
|
||||
|
||||
EquipmentStatsInfo build = EquipmentStatsInfo.builder()
|
||||
.equipmentID(pileSn)
|
||||
.equipmentElectricity(pileElec)
|
||||
.connectorStatsInfos(connectorStatsInfos)
|
||||
.build();
|
||||
equipmentStatsInfoList.add(build);
|
||||
|
||||
// 所有充电桩用电量之和
|
||||
stationElectricity = stationElectricity.add(pileElec);
|
||||
}
|
||||
|
||||
StationStatsInfo stationStatsInfo = StationStatsInfo.builder()
|
||||
.stationID(dto.getStationID())
|
||||
.startTime(dto.getStartTime())
|
||||
.endTime(dto.getEndTime())
|
||||
.stationElectricity(stationElectricity)
|
||||
.equipmentStatsInfos(equipmentStatsInfoList) // 设备列表
|
||||
.build();
|
||||
|
||||
Map<String, Object> map = new LinkedHashMap<>();
|
||||
map.put("StationStats", stationStatsInfo);
|
||||
|
||||
// 加密
|
||||
Map<String, String> resultMap = Maps.newLinkedHashMap();
|
||||
// 加密数据
|
||||
byte[] encryptText = Cryptos.aesEncrypt(JSON.toJSONString(map).getBytes(),
|
||||
configInfo.getDataSecret().getBytes(), configInfo.getDataSecretIv().getBytes());
|
||||
String encryptData = Encodes.encodeBase64(encryptText);
|
||||
|
||||
resultMap.put("Data", encryptData);
|
||||
// 生成sig
|
||||
String resultSign = GBSignUtils.sign(resultMap, configInfo.getSignSecret());
|
||||
resultMap.put("Sig", resultSign);
|
||||
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询充电电量信息 query_order_info
|
||||
*
|
||||
* @param orderCode
|
||||
* @throws UnsupportedOperationException 未实现异常
|
||||
*/
|
||||
@Override
|
||||
public Map<String, String> queryOrderInfo(String orderCode) {
|
||||
//方法未实现,抛出异常
|
||||
throw new UnsupportedOperationException("This method is not yet implemented");
|
||||
}
|
||||
|
||||
/**
|
||||
* 请求设备认证 query_equip_auth
|
||||
* 业务信息交换
|
||||
*
|
||||
* @param dto 联联平台请求设备认证
|
||||
* @throws UnsupportedOperationException 未实现异常
|
||||
*/
|
||||
@Override
|
||||
public Map<String, String> queryEquipAuth(QueryEquipmentDTO dto) {
|
||||
//方法未实现,抛出异常
|
||||
throw new UnsupportedOperationException("This method is not yet implemented");
|
||||
}
|
||||
|
||||
/**
|
||||
* 请求启动充电 query_start_charge
|
||||
*
|
||||
* @param dto 请求启动充电DTO
|
||||
* @throws UnsupportedOperationException 未实现异常
|
||||
*/
|
||||
@Override
|
||||
public Map<String, String> queryStartCharge(QueryStartChargeDTO dto) {
|
||||
//方法未实现,抛出异常
|
||||
throw new UnsupportedOperationException("This method is not yet implemented");
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询充电状态 query_equip_charge_status
|
||||
*
|
||||
* @param dto 查询充电状态DTO
|
||||
* @throws UnsupportedOperationException 未实现异常
|
||||
*/
|
||||
@Override
|
||||
public Map<String, String> queryEquipChargeStatus(QueryEquipChargeStatusDTO dto) {
|
||||
//方法未实现,抛出异常
|
||||
throw new UnsupportedOperationException("This method is not yet implemented");
|
||||
}
|
||||
|
||||
/**
|
||||
* 请求停止充电 query_stop_charge
|
||||
*
|
||||
* @param dto 请求启动充电DTO
|
||||
* @throws UnsupportedOperationException 未实现异常
|
||||
*/
|
||||
@Override
|
||||
public Map<String, String> queryStopCharge(QueryStartChargeDTO dto) {
|
||||
//方法未实现,抛出异常
|
||||
throw new UnsupportedOperationException("This method is not yet implemented");
|
||||
}
|
||||
|
||||
/**
|
||||
* 充电站内充电桩空闲状态查询 query_free_pile_number
|
||||
*
|
||||
* @param dto
|
||||
* @throws UnsupportedOperationException 未实现异常
|
||||
*/
|
||||
@Override
|
||||
public Map<String, String> queryFreePileNumber(NXJTQueryStationInfoDTO dto) {
|
||||
//方法未实现,抛出异常
|
||||
throw new UnsupportedOperationException("This method is not yet implemented");
|
||||
}
|
||||
|
||||
/**
|
||||
* 某车牌号消费记录查询 query_orders_info_by_Plate_number
|
||||
*
|
||||
* @param dto
|
||||
* @throws UnsupportedOperationException 未实现异常
|
||||
*/
|
||||
@Override
|
||||
public Map<String, String> queryOrdersInfoByPlateNumber(NXJTQueryStationInfoDTO dto) {
|
||||
//方法未实现,抛出异常
|
||||
throw new UnsupportedOperationException("This method is not yet implemented");
|
||||
}
|
||||
|
||||
/**
|
||||
* 某段时间内消费记录查询 query_orders_info
|
||||
*
|
||||
* @param dto
|
||||
* @throws UnsupportedOperationException 未实现异常
|
||||
*/
|
||||
@Override
|
||||
public Map<String, String> queryOrdersInfo(NXJTQueryStationInfoDTO dto) {
|
||||
//方法未实现,抛出异常
|
||||
throw new UnsupportedOperationException("This method is not yet implemented");
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询业务策略信息结果
|
||||
* 请求计费策略 request_equip_business_policy
|
||||
*
|
||||
* @param dto 请求启动充电DTO
|
||||
* @throws UnsupportedOperationException 未实现异常
|
||||
*/
|
||||
@Override
|
||||
public Map<String, String> queryEquipBusinessPolicy(QueryStartChargeDTO dto) {
|
||||
//方法未实现,抛出异常
|
||||
throw new UnsupportedOperationException("This method is not yet implemented");
|
||||
}
|
||||
|
||||
/**
|
||||
* VIN码充电 insert_start_charge
|
||||
* 华为平台
|
||||
*
|
||||
* @param dto
|
||||
* @throws UnsupportedOperationException 未实现异常
|
||||
*/
|
||||
@Override
|
||||
public Map<String, String> insertStartCharge(QueryStationInfoDTO dto) {
|
||||
//方法未实现,抛出异常
|
||||
throw new UnsupportedOperationException("This method is not yet implemented");
|
||||
}
|
||||
|
||||
/**
|
||||
* 下发计费策略响应 notification_deliver_equip_business_policy_result
|
||||
* 华为平台
|
||||
*
|
||||
* @param dto
|
||||
* @throws UnsupportedOperationException 未实现异常
|
||||
*/
|
||||
@Override
|
||||
public Map<String, String> notificationDeliverEquipBusinessPolicyResult(QueryStationInfoDTO dto) {
|
||||
//方法未实现,抛出异常
|
||||
throw new UnsupportedOperationException("This method is not yet implemented");
|
||||
}
|
||||
|
||||
/**
|
||||
* 充电站信息变化推送 notification_stationInfo
|
||||
* 新站需要推送。当站点信息发生变化时,推送新的信息通知到市级平台
|
||||
*
|
||||
* @param stationId 充电站id
|
||||
* @throws UnsupportedOperationException 未实现异常
|
||||
*/
|
||||
@Override
|
||||
public String notificationStationInfo(String stationId) {
|
||||
// 通过id查询站点相关信息
|
||||
PileStationInfo pileStationInfo = pileStationInfoService.selectPileStationInfoById(Long.parseLong(stationId));
|
||||
// 通过第三方配置类型查询相关配置信息
|
||||
ThirdPartySettingInfo settingInfo = new ThirdPartySettingInfo();
|
||||
settingInfo.setType(platformType);
|
||||
ThirdPartySettingInfo thirdPartySettingInfo = thirdPartySettingInfoService.selectSettingInfo(settingInfo);
|
||||
|
||||
String operatorId = thirdPartySettingInfo.getOperatorId();
|
||||
String operatorSecret = thirdPartySettingInfo.getOperatorSecret();
|
||||
String signSecret = thirdPartySettingInfo.getSignSecret();
|
||||
String dataSecret = thirdPartySettingInfo.getDataSecret();
|
||||
String dataSecretIv = thirdPartySettingInfo.getDataSecretIv();
|
||||
String urlAddress = thirdPartySettingInfo.getUrlAddress();
|
||||
|
||||
// 组装联联平台所需要的数据格式
|
||||
StationInfo info = StationInfo.builder()
|
||||
.stationID("LC" + stationId)
|
||||
.operatorID(operatorId)
|
||||
.stationName(pileStationInfo.getStationName())
|
||||
.isAloneApply(Integer.valueOf(pileStationInfo.getAloneApply()))
|
||||
.isPublicParkingLot(Integer.valueOf(pileStationInfo.getPublicParking()))
|
||||
.countryCode(pileStationInfo.getCountryCode())
|
||||
.address(pileStationInfo.getAddress())
|
||||
.serviceTel(pileStationInfo.getStationTel())
|
||||
.stationType(Integer.valueOf(pileStationInfo.getStationType()))
|
||||
.stationStatus(Integer.valueOf(pileStationInfo.getStationStatus()))
|
||||
.parkNums(Integer.valueOf(pileStationInfo.getParkNums()))
|
||||
.stationLng(new BigDecimal(pileStationInfo.getStationLng()))
|
||||
.stationLat(new BigDecimal(pileStationInfo.getStationLat()))
|
||||
.construction(Integer.valueOf(pileStationInfo.getConstruction()))
|
||||
.openAllDay(Integer.valueOf(pileStationInfo.getOpenAllDay()))
|
||||
.minElectricityPrice(new BigDecimal(Constants.ZERO))
|
||||
.electricityFee(Constants.ZERO)
|
||||
.serviceFee(Constants.ZERO)
|
||||
.parkFree(Integer.valueOf(pileStationInfo.getParkFree()))
|
||||
.supportOrder(Integer.valueOf(pileStationInfo.getSupportOrder()))
|
||||
.parkFeeType(0)
|
||||
.toiletFlag(Integer.valueOf(pileStationInfo.getToiletFlag()))
|
||||
.storeFlag(Integer.valueOf(pileStationInfo.getStoreFlag()))
|
||||
.restaurantFlag(Integer.valueOf(pileStationInfo.getRestaurantFlag()))
|
||||
.loungeFlag(Integer.valueOf(pileStationInfo.getLoungeFlag()))
|
||||
.canopyFlag(Integer.valueOf(pileStationInfo.getCanopyFlag()))
|
||||
.printerFlag(Integer.valueOf(pileStationInfo.getPrinterFlag()))
|
||||
.barrierFlag(Integer.valueOf(pileStationInfo.getBarrierFlag()))
|
||||
.parkingLockFlag(Integer.valueOf(pileStationInfo.getParkingLockFlag()))
|
||||
.build();
|
||||
String areaCode = pileStationInfo.getAreaCode(); // 330000,330200,330213
|
||||
// 根据逗号分组
|
||||
String[] split = StringUtils.split(areaCode, ",");
|
||||
// 只取最后一部分 330213
|
||||
String subAreaCode = split[split.length - 1];
|
||||
info.setAreaCode(subAreaCode);
|
||||
// 截取运营商组织机构代码(去除最后一位后的最后九位)
|
||||
String organizationCode = "";
|
||||
if (StringUtils.equals(ThirdPlatformTypeEnum.LIAN_LIAN_PLATFORM.getCode(), platformType)) {
|
||||
// 联联平台先使用自己运营商的组织机构代码
|
||||
organizationCode = Constants.OPERATORID_LIANLIAN;
|
||||
info.setEquipmentOwnerID(organizationCode);
|
||||
}else {
|
||||
MerchantInfoVO merchantInfo = pileMerchantInfoService.getMerchantInfoVO(String.valueOf(pileStationInfo.getMerchantId()));
|
||||
organizationCode = merchantInfo.getOrganizationCode();
|
||||
if (StringUtils.isNotBlank(organizationCode) && organizationCode.length() == 18) {
|
||||
String equipmentOwnerId = StringUtils.substring(organizationCode, organizationCode.length() - 10, organizationCode.length() - 1);
|
||||
info.setEquipmentOwnerID(equipmentOwnerId);
|
||||
}
|
||||
}
|
||||
if (StringUtils.equals("36", String.valueOf(pileStationInfo.getMerchantId()))) {
|
||||
// 远大
|
||||
info.setEquipmentOwnerID(Constants.OPERATORID_YUAN_DA);
|
||||
}
|
||||
if (StringUtils.equals("35", String.valueOf(pileStationInfo.getMerchantId()))) {
|
||||
// 如果是希晓运营商,则把equipmentOwnerID换成希晓
|
||||
info.setEquipmentOwnerID(Constants.OPERATORID_XI_XIAO);
|
||||
}
|
||||
String payment = StationPaymentEnum.getPaymentByCode(pileStationInfo.getPayment());
|
||||
info.setPayment(payment);
|
||||
if (StringUtils.isNotBlank(pileStationInfo.getParkingNumber())) {
|
||||
info.setIsPublicParkingLot(1);
|
||||
info.setParkingLotNumber(pileStationInfo.getParkingNumber());
|
||||
}
|
||||
// 户号
|
||||
if (StringUtils.isNotBlank(pileStationInfo.getAccountNumber())) {
|
||||
info.setAccountNumber(pileStationInfo.getAccountNumber());
|
||||
}
|
||||
|
||||
// 容量
|
||||
if (StringUtils.isNotBlank(String.valueOf(pileStationInfo.getCapacity()))) {
|
||||
info.setCapacity(pileStationInfo.getCapacity().setScale(4, BigDecimal.ROUND_HALF_UP));
|
||||
}
|
||||
List<EquipmentInfo> pileList = pileBasicInfoService.getPileList(pileStationInfo);
|
||||
if (CollectionUtils.isNotEmpty(pileList)) {
|
||||
info.setEquipmentInfos(pileList); // 充电设备信息列表
|
||||
}
|
||||
|
||||
// 调用联联平台接口
|
||||
String url = urlAddress + "notification_stationInfo";
|
||||
|
||||
String jsonStr = JSON.toJSONString(info);
|
||||
JSONObject data = new JSONObject();
|
||||
data.put("StationInfo", jsonStr);
|
||||
|
||||
String jsonString = JSON.toJSONString(data);
|
||||
System.out.println("jsonString : " + jsonString);
|
||||
|
||||
// 获取令牌
|
||||
String token = getToken(urlAddress, operatorId, operatorSecret, dataSecretIv, signSecret, dataSecret);
|
||||
String result = HttpRequestUtil.sendPost(token, jsonString, url, dataSecret
|
||||
, dataSecretIv, operatorId, signSecret);
|
||||
|
||||
// 新增数据库
|
||||
thirdPartyStationRelationService.insertInfo2DataBase(platformType, stationId);
|
||||
return platformType + ":" + result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设备状态变化推送 notification_stationStatus
|
||||
* 推送充电设备接口状态信息 supervise_notification_station_status
|
||||
*
|
||||
* @param pileConnectorCode 充电枪口编号
|
||||
* @param status 枪口状态
|
||||
* @throws UnsupportedOperationException 未实现异常
|
||||
*/
|
||||
@Override
|
||||
public String notificationStationStatus(String pileConnectorCode, String status) {
|
||||
// 查出该桩所属哪个站点
|
||||
String pileSn = StringUtils.substring(pileConnectorCode, 0, 14);
|
||||
PileStationVO stationVO = pileStationInfoService.getStationInfoByPileSn(pileSn);
|
||||
// 通过站点id查询相关配置信息
|
||||
ThirdPartyStationRelationVO relationInfo = thirdPartyStationRelationService.selectRelationInfo(stationVO.getId());
|
||||
if (relationInfo == null) {
|
||||
return null;
|
||||
}
|
||||
String operatorId = relationInfo.getOperatorId();
|
||||
String operatorSecret = relationInfo.getOperatorSecret();
|
||||
String signSecret = relationInfo.getSignSecret();
|
||||
String dataSecret = relationInfo.getDataSecret();
|
||||
String dataSecretIv = relationInfo.getDataSecretIv();
|
||||
String urlAddress = relationInfo.getUrlAddress();
|
||||
|
||||
String url = urlAddress + BusinessInformationExchangeEnum.NOTIFICATION_STATION_STATUS.getValue();
|
||||
ConnectorStatusInfo info = ConnectorStatusInfo.builder()
|
||||
.connectorID(pileConnectorCode)
|
||||
.status(Integer.parseInt(status))
|
||||
.build();
|
||||
// 调用联联平台接口
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("ConnectorStatusInfo", info);
|
||||
String jsonString = JSON.toJSONString(json);
|
||||
// 获取令牌
|
||||
String token = getToken(urlAddress, operatorId, operatorSecret, dataSecretIv, signSecret, dataSecret);
|
||||
String result = HttpRequestUtil.sendPost(token, jsonString, url, dataSecret, dataSecretIv, operatorId, signSecret);
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设备充电中状态变化推送 notification_connector_charge_status
|
||||
*
|
||||
* @param orderCode 订单编号
|
||||
*/
|
||||
@Override
|
||||
public String notificationConnectorChargeStatus(String orderCode) {
|
||||
// 通过订单号查询信息
|
||||
OrderBasicInfo orderInfo = orderBasicInfoService.getOrderInfoByOrderCode(orderCode);
|
||||
// 根据枪口号查询充电实时状态
|
||||
// OrderBasicInfo orderBasicInfo = orderBasicInfoService.queryChargingByPileConnectorCode(orderInfo.getPileConnectorCode());
|
||||
List<RealTimeMonitorData> list = orderBasicInfoService.getChargingRealTimeData(orderInfo.getTransactionCode());
|
||||
RealTimeMonitorData realTimeMonitorData = list.get(0);
|
||||
// 拼装联联参数
|
||||
ConnectorChargeStatusInfo info = ConnectorChargeStatusInfo.builder()
|
||||
.startChargeSeq(orderCode)
|
||||
.connectorID(orderInfo.getPileConnectorCode())
|
||||
.connectorStatus(Integer.valueOf(realTimeMonitorData.getConnectorStatus()))
|
||||
.currentA(new BigDecimal(realTimeMonitorData.getOutputCurrent()))
|
||||
.voltageA(new BigDecimal(realTimeMonitorData.getOutputVoltage()))
|
||||
.soc(new BigDecimal(realTimeMonitorData.getSOC()))
|
||||
.startTime(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, orderInfo.getChargeStartTime()))
|
||||
.endTime(DateUtils.getDateTime())
|
||||
.totalPower(new BigDecimal(realTimeMonitorData.getChargingDegree()))
|
||||
.elecMoney(new BigDecimal("0")) // TODO
|
||||
.seviceMoney(new BigDecimal("0")) // TODO
|
||||
.totalMoney(new BigDecimal(realTimeMonitorData.getChargingAmount()).setScale(2, BigDecimal.ROUND_HALF_UP))
|
||||
.build();
|
||||
|
||||
// 通过站点id查询相关配置信息
|
||||
ThirdPartyStationRelationVO relationInfo = thirdPartyStationRelationService.selectRelationInfo(orderInfo.getStationId());
|
||||
if (relationInfo == null) {
|
||||
return null;
|
||||
}
|
||||
String operatorId = relationInfo.getOperatorId();
|
||||
String operatorSecret = relationInfo.getOperatorSecret();
|
||||
String signSecret = relationInfo.getSignSecret();
|
||||
String dataSecret = relationInfo.getDataSecret();
|
||||
String dataSecretIv = relationInfo.getDataSecretIv();
|
||||
String urlAddress = relationInfo.getUrlAddress();
|
||||
|
||||
String url = urlAddress + "notification_connector_charge_status";
|
||||
|
||||
// 获取令牌
|
||||
String token = getToken(urlAddress, operatorId, operatorSecret, dataSecretIv, signSecret, dataSecret);
|
||||
if (StringUtils.isBlank(token)) {
|
||||
return null;
|
||||
}
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("ConnectorChargeStatusInfo", info);
|
||||
String jsonString = JSON.toJSONString(json);
|
||||
// 发送请求
|
||||
String result = HttpRequestUtil.sendPost(token, jsonString, url, dataSecret, dataSecretIv, operatorId, signSecret);
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 订单信息推送 notification_orderInfo
|
||||
*
|
||||
* @param orderCode
|
||||
* @throws UnsupportedOperationException 未实现异常
|
||||
*/
|
||||
@Override
|
||||
public String notificationOrderInfo(String orderCode) {
|
||||
|
||||
// 根据订单号查询出信息
|
||||
OrderBasicInfo orderBasicInfo = orderBasicInfoService.getOrderInfoByOrderCode(orderCode);
|
||||
OrderDetail orderDetail = orderBasicInfoService.getOrderDetailByOrderCode(orderCode);
|
||||
|
||||
// 通过站点id查询相关配置信息
|
||||
ThirdPartyStationRelationVO relationInfo = thirdPartyStationRelationService.selectRelationInfo(orderBasicInfo.getStationId());
|
||||
if (relationInfo == null) {
|
||||
return null;
|
||||
}
|
||||
String operatorId = relationInfo.getOperatorId();
|
||||
String operatorSecret = relationInfo.getOperatorSecret();
|
||||
String signSecret = relationInfo.getSignSecret();
|
||||
String dataSecret = relationInfo.getDataSecret();
|
||||
String dataSecretIv = relationInfo.getDataSecretIv();
|
||||
String urlAddress = relationInfo.getUrlAddress();
|
||||
|
||||
String url = urlAddress + "notification_orderInfo";
|
||||
|
||||
// 拼装成联联平台所需格式对象
|
||||
OrderInfo orderInfo = OrderInfo.builder()
|
||||
.operatorID(operatorId)
|
||||
.equipmentOwnerID(Constants.OPERATORID_LIANLIAN)
|
||||
.stationID("LC" + orderBasicInfo.getStationId())
|
||||
.equipmentID(orderBasicInfo.getPileSn())
|
||||
.connectorID(orderBasicInfo.getPileConnectorCode())
|
||||
.startChargeSeq(orderCode)
|
||||
.userChargeType(Constants.one)
|
||||
.money(new BigDecimal(String.valueOf(orderBasicInfo.getOrderAmount())).setScale(2, BigDecimal.ROUND_HALF_UP))
|
||||
.electMoney(new BigDecimal(String.valueOf(orderDetail.getTotalElectricityAmount())).setScale(2, BigDecimal.ROUND_HALF_UP))
|
||||
.serviceMoney(new BigDecimal(String.valueOf(orderDetail.getTotalServiceAmount())).setScale(2, BigDecimal.ROUND_HALF_UP))
|
||||
.elect(new BigDecimal(String.valueOf(orderDetail.getTotalUsedElectricity())).setScale(2, BigDecimal.ROUND_HALF_UP))
|
||||
.startTime(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, orderBasicInfo.getChargeStartTime()))
|
||||
.endTime(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, orderBasicInfo.getChargeEndTime()))
|
||||
.paymentAmount(orderBasicInfo.getPayAmount())
|
||||
// .payChannel()
|
||||
.stopReason(0)
|
||||
// .chargeDetails()
|
||||
.build();
|
||||
if (StringUtils.equals("35", orderBasicInfo.getMerchantId())) {
|
||||
orderInfo.setEquipmentOwnerID(Constants.OPERATORID_XI_XIAO);
|
||||
}
|
||||
// 支付方式
|
||||
if (StringUtils.equals(orderBasicInfo.getPayMode(), OrderPayModeEnum.PAYMENT_OF_WECHATPAY.getValue())) {
|
||||
// 微信支付
|
||||
orderInfo.setPayChannel(Integer.valueOf(PayChannelEnum.WEXIN_PAY.getCode()));
|
||||
} else if (StringUtils.equals(orderBasicInfo.getPayMode(), OrderPayModeEnum.PAYMENT_OF_ALIPAY.getValue())) {
|
||||
// 支付宝支付
|
||||
orderInfo.setPayChannel(Integer.valueOf(PayChannelEnum.ALI_PAY.getCode()));
|
||||
} else {
|
||||
// 其他
|
||||
orderInfo.setPayChannel(Integer.valueOf(PayChannelEnum.OTHER.getCode()));
|
||||
}
|
||||
// 订单详情
|
||||
ChargeDetail detail;
|
||||
|
||||
List<BillingPriceVO> billingList = pileBillingTemplateService.queryBillingPrice(orderBasicInfo.getStationId());
|
||||
// 先将list按照 尖、峰、平、谷 时段排序
|
||||
// List<BillingPriceVO> collect = billingList.stream().sorted(Comparator.comparing(BillingPriceVO::getTimeType)).collect(Collectors.toList());
|
||||
// 再循环该list,拼装对应的充电价格、费率
|
||||
List<ChargeDetail> chargeDetails = new ArrayList<>();
|
||||
for (BillingPriceVO billingPriceVO : billingList) {
|
||||
detail = new ChargeDetail();
|
||||
if (StringUtils.equals(billingPriceVO.getTimeType(), "1")) {
|
||||
// 尖时段
|
||||
detail.setDetailStartTime(billingPriceVO.getStartTime());
|
||||
detail.setDetailEndTime(billingPriceVO.getEndTime());
|
||||
detail.setElecPrice(new BigDecimal(billingPriceVO.getElectricityPrice()).setScale(4, BigDecimal.ROUND_HALF_UP));
|
||||
detail.setSevicePrice(new BigDecimal(billingPriceVO.getServicePrice()).setScale(4, BigDecimal.ROUND_HALF_UP));
|
||||
detail.setDetailPower(orderDetail.getSharpUsedElectricity());
|
||||
detail.setDetailElecMoney(orderDetail.getSharpElectricityPrice());
|
||||
detail.setDetailSeviceMoney(orderDetail.getSharpServicePrice());
|
||||
} else if (StringUtils.equals(billingPriceVO.getTimeType(), "2")) {
|
||||
// 峰时段
|
||||
detail.setDetailStartTime(billingPriceVO.getStartTime());
|
||||
detail.setDetailEndTime(billingPriceVO.getEndTime());
|
||||
detail.setElecPrice(new BigDecimal(billingPriceVO.getElectricityPrice()).setScale(4, BigDecimal.ROUND_HALF_UP));
|
||||
detail.setSevicePrice(new BigDecimal(billingPriceVO.getServicePrice()).setScale(4, BigDecimal.ROUND_HALF_UP));
|
||||
detail.setDetailPower(orderDetail.getPeakUsedElectricity());
|
||||
detail.setDetailElecMoney(orderDetail.getPeakElectricityPrice());
|
||||
detail.setDetailSeviceMoney(orderDetail.getPeakServicePrice());
|
||||
} else if (StringUtils.equals(billingPriceVO.getTimeType(), "3")) {
|
||||
// 平时段
|
||||
detail.setDetailStartTime(billingPriceVO.getStartTime());
|
||||
detail.setDetailEndTime(billingPriceVO.getEndTime());
|
||||
detail.setElecPrice(new BigDecimal(billingPriceVO.getElectricityPrice()).setScale(4, BigDecimal.ROUND_HALF_UP));
|
||||
detail.setSevicePrice(new BigDecimal(billingPriceVO.getServicePrice()).setScale(4, BigDecimal.ROUND_HALF_UP));
|
||||
detail.setDetailPower(orderDetail.getFlatUsedElectricity());
|
||||
detail.setDetailElecMoney(orderDetail.getFlatElectricityPrice());
|
||||
detail.setDetailSeviceMoney(orderDetail.getFlatServicePrice());
|
||||
} else if (StringUtils.equals(billingPriceVO.getTimeType(), "4")) {
|
||||
// 谷时段
|
||||
detail.setDetailStartTime(billingPriceVO.getStartTime());
|
||||
detail.setDetailEndTime(billingPriceVO.getEndTime());
|
||||
detail.setElecPrice(new BigDecimal(billingPriceVO.getElectricityPrice()).setScale(4, BigDecimal.ROUND_HALF_UP));
|
||||
detail.setSevicePrice(new BigDecimal(billingPriceVO.getServicePrice()).setScale(4, BigDecimal.ROUND_HALF_UP));
|
||||
detail.setDetailPower(orderDetail.getValleyUsedElectricity());
|
||||
detail.setDetailElecMoney(orderDetail.getValleyElectricityPrice());
|
||||
detail.setDetailSeviceMoney(orderDetail.getValleyServicePrice());
|
||||
}
|
||||
chargeDetails.add(detail);
|
||||
}
|
||||
orderInfo.setChargeDetails(chargeDetails);
|
||||
|
||||
// 获取令牌
|
||||
String token = getToken(urlAddress, operatorId, operatorSecret, dataSecretIv, signSecret, dataSecret);
|
||||
if (StringUtils.isBlank(token)) {
|
||||
return null;
|
||||
}
|
||||
// 调用联联平台接口
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("OrderInfo", orderInfo);
|
||||
String jsonString = JSON.toJSONString(json);
|
||||
String result = HttpRequestUtil.sendPost(token, jsonString, url, dataSecret, dataSecretIv, operatorId, signSecret);
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 站点费率变化推送 notification_stationFee
|
||||
*
|
||||
* @param stationId
|
||||
* @throws UnsupportedOperationException 未实现异常
|
||||
*/
|
||||
@Override
|
||||
public String notificationStationFee(String stationId) {
|
||||
PushStationFeeVO vo = new PushStationFeeVO();
|
||||
List<PushStationFeeVO.ChargeFeeDetail> chargeFeeDetailList = new ArrayList<>();
|
||||
PushStationFeeVO.ChargeFeeDetail chargeFeeDetail = null;
|
||||
// 根据站点 id 查询出正在使用的计费模板详情
|
||||
List<BillingPriceVO> billingPriceVOList = pileBillingTemplateService.queryBillingPrice(stationId);
|
||||
// 查询设备列表
|
||||
List<PileInfoVO> pileDetailVOS = pileBasicInfoService.queryPileDetailList(Lists.newArrayList(stationId));
|
||||
vo.setOperatorId(Constants.OPERATORID_LIANLIAN);
|
||||
vo.setStationId(stationId);
|
||||
for (PileInfoVO pileInfoVO : pileDetailVOS) {
|
||||
for (BillingPriceVO billingPriceVO : billingPriceVOList) {
|
||||
chargeFeeDetail = new PushStationFeeVO.ChargeFeeDetail();
|
||||
|
||||
chargeFeeDetail.setEquipmentType(Integer.parseInt(pileInfoVO.getSpeedType()));
|
||||
String startTime = billingPriceVO.getStartTime();
|
||||
String endTime = billingPriceVO.getEndTime();
|
||||
|
||||
chargeFeeDetail.setStartTime(startTime);
|
||||
chargeFeeDetail.setEndTime(endTime);
|
||||
chargeFeeDetail.setElectricityFee(new BigDecimal(billingPriceVO.getElectricityPrice()).setScale(2, BigDecimal.ROUND_DOWN));
|
||||
chargeFeeDetail.setServiceFee(new BigDecimal(billingPriceVO.getServicePrice()).setScale(2, BigDecimal.ROUND_DOWN));
|
||||
|
||||
chargeFeeDetailList.add(chargeFeeDetail);
|
||||
}
|
||||
}
|
||||
vo.setChargeFeeDetail(chargeFeeDetailList);
|
||||
|
||||
// 通过站点id查询相关配置信息
|
||||
ThirdPartyStationRelationVO relationInfo = thirdPartyStationRelationService.selectRelationInfo(stationId);
|
||||
if (relationInfo == null) {
|
||||
return null;
|
||||
}
|
||||
String operatorId = relationInfo.getOperatorId();
|
||||
String operatorSecret = relationInfo.getOperatorSecret();
|
||||
String signSecret = relationInfo.getSignSecret();
|
||||
String dataSecret = relationInfo.getDataSecret();
|
||||
String dataSecretIv = relationInfo.getDataSecretIv();
|
||||
String urlAddress = relationInfo.getUrlAddress();
|
||||
|
||||
String url = urlAddress + "notification_stationFee";
|
||||
|
||||
// 获取令牌
|
||||
String token = getToken(urlAddress, operatorId, operatorSecret, dataSecretIv, signSecret, dataSecret);
|
||||
if (StringUtils.isBlank(token)) {
|
||||
return null;
|
||||
}
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("StationFee", vo);
|
||||
String jsonString = JSON.toJSONString(json);
|
||||
// 发送请求
|
||||
String result = HttpRequestUtil.sendPost(token, jsonString, url, dataSecret, dataSecretIv, operatorId, signSecret);
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 充电订单推送 notification_charge_order_info
|
||||
* TODO 海南一张网文档中的接口,检查一下是否和订单信息推送notification_orderInfo一致
|
||||
* TODO 甬城泊车平台文档中的接口,检查一下是否和订单信息推送notification_orderInfo一致
|
||||
* TODO 华为平台文档中的接口,检查一下是否和订单信息推送notification_orderInfo一致
|
||||
* TODO 内蒙古平台文档中的接口,检查一下是否和订单信息推送notification_orderInfo一致
|
||||
*
|
||||
* @param orderCode 订单编号
|
||||
* @throws UnsupportedOperationException 未实现异常
|
||||
*/
|
||||
@Override
|
||||
public String notificationChargeOrderInfo(String orderCode) {
|
||||
//方法未实现,抛出异常
|
||||
throw new UnsupportedOperationException("This method is not yet implemented");
|
||||
}
|
||||
|
||||
/**
|
||||
* 告警信息推送 notification_alarmInfo
|
||||
*
|
||||
* @throws UnsupportedOperationException 未实现异常
|
||||
*/
|
||||
@Override
|
||||
public String notificationAlarmInfo() {
|
||||
//方法未实现,抛出异常
|
||||
throw new UnsupportedOperationException("This method is not yet implemented");
|
||||
}
|
||||
|
||||
/**
|
||||
* 推送启动充电结果 notification_start_charge_result
|
||||
*
|
||||
* @param orderCode 订单编号
|
||||
* @throws UnsupportedOperationException 未实现异常
|
||||
*/
|
||||
@Override
|
||||
public String notificationStartChargeResult(String orderCode) {
|
||||
//方法未实现,抛出异常
|
||||
throw new UnsupportedOperationException("This method is not yet implemented");
|
||||
}
|
||||
|
||||
/**
|
||||
* 推送充电状态 notification_equip_charge_status
|
||||
* 推送充电状态信息 supervise_notification_equip_charge_status
|
||||
*
|
||||
* @param orderCode 订单编号
|
||||
* @throws UnsupportedOperationException 未实现异常
|
||||
*/
|
||||
@Override
|
||||
public String notificationEquipChargeStatus(String orderCode) throws UnsupportedOperationException {
|
||||
//方法未实现,抛出异常
|
||||
throw new UnsupportedOperationException("This method is not yet implemented");
|
||||
}
|
||||
|
||||
/**
|
||||
* 推送停止充电结果 notification_stop_charge_result
|
||||
*
|
||||
* @param orderCode 订单编号
|
||||
* @throws UnsupportedOperationException 未实现异常
|
||||
*/
|
||||
@Override
|
||||
public String notificationStopChargeResult(String orderCode) {
|
||||
//方法未实现,抛出异常
|
||||
throw new UnsupportedOperationException("This method is not yet implemented");
|
||||
}
|
||||
|
||||
/**
|
||||
* 华为平台
|
||||
* 平台充电设备编码同步 notification_operation_system_info
|
||||
*
|
||||
* @param orderCode
|
||||
* @throws UnsupportedOperationException 未实现异常
|
||||
*/
|
||||
@Override
|
||||
public String notificationOperationSystemInfo(String orderCode) {
|
||||
//方法未实现,抛出异常
|
||||
throw new UnsupportedOperationException("This method is not yet implemented");
|
||||
}
|
||||
|
||||
/**
|
||||
* 推送充换电站用能统计信息 supervise_notification_operation_stats_info
|
||||
*
|
||||
* @param stationId
|
||||
* @throws UnsupportedOperationException 未实现异常
|
||||
*/
|
||||
@Override
|
||||
public String notificationOperationStatsInfo(String stationId) {
|
||||
//方法未实现,抛出异常
|
||||
throw new UnsupportedOperationException("This method is not yet implemented");
|
||||
}
|
||||
|
||||
/**
|
||||
* 推送充电站历史充电订单信息 supervise_notification_charge_order_info_history
|
||||
*
|
||||
* @param stationId
|
||||
* @throws UnsupportedOperationException 未实现异常
|
||||
*/
|
||||
@Override
|
||||
public String notificationChargeOrderInfoHistory(String stationId) {
|
||||
//方法未实现,抛出异常
|
||||
throw new UnsupportedOperationException("This method is not yet implemented");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -25,7 +25,7 @@ public class NeiMengGuPlatformLogic extends AbsInterfaceWithPlatformLogic {
|
||||
*/
|
||||
@Override
|
||||
public Map<String, String> queryOperatorInfo(QueryOperatorInfoDTO dto) {
|
||||
return null;
|
||||
throw new UnsupportedOperationException("This method is not yet implemented");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -35,7 +35,7 @@ public class NeiMengGuPlatformLogic extends AbsInterfaceWithPlatformLogic {
|
||||
*/
|
||||
@Override
|
||||
public Map<String, String> queryStationsInfo(QueryStationInfoDTO dto) {
|
||||
return null;
|
||||
throw new UnsupportedOperationException("This method is not yet implemented");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -46,18 +46,17 @@ public class NeiMengGuPlatformLogic extends AbsInterfaceWithPlatformLogic {
|
||||
*/
|
||||
@Override
|
||||
public String notificationStationStatus(String pileConnectorCode, String status) {
|
||||
return null;
|
||||
throw new UnsupportedOperationException("This method is not yet implemented");
|
||||
}
|
||||
|
||||
/**
|
||||
* 设备充电中状态变化推送 notification_connector_charge_status
|
||||
*
|
||||
* @param pileConnectorCode 充电枪口编号
|
||||
* @param status 枪口状态
|
||||
* @param orderCode 订单号
|
||||
*/
|
||||
@Override
|
||||
public String notificationConnectorChargeStatus(String pileConnectorCode, String status) {
|
||||
return null;
|
||||
public String notificationConnectorChargeStatus(String orderCode) {
|
||||
throw new UnsupportedOperationException("This method is not yet implemented");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -67,7 +66,7 @@ public class NeiMengGuPlatformLogic extends AbsInterfaceWithPlatformLogic {
|
||||
*/
|
||||
@Override
|
||||
public String notificationOrderInfo(String orderCode) {
|
||||
return null;
|
||||
throw new UnsupportedOperationException("This method is not yet implemented");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -77,7 +76,7 @@ public class NeiMengGuPlatformLogic extends AbsInterfaceWithPlatformLogic {
|
||||
*/
|
||||
@Override
|
||||
public String notificationStationFee(String stationId) {
|
||||
return null;
|
||||
throw new UnsupportedOperationException("This method is not yet implemented");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -87,7 +86,7 @@ public class NeiMengGuPlatformLogic extends AbsInterfaceWithPlatformLogic {
|
||||
*/
|
||||
@Override
|
||||
public String notificationChargeOrderInfo(String orderCode) {
|
||||
return null;
|
||||
throw new UnsupportedOperationException("This method is not yet implemented");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -95,7 +94,7 @@ public class NeiMengGuPlatformLogic extends AbsInterfaceWithPlatformLogic {
|
||||
*/
|
||||
@Override
|
||||
public String notificationAlarmInfo() {
|
||||
return null;
|
||||
throw new UnsupportedOperationException("This method is not yet implemented");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -105,17 +104,17 @@ public class NeiMengGuPlatformLogic extends AbsInterfaceWithPlatformLogic {
|
||||
*/
|
||||
@Override
|
||||
public Map<String, String> queryStationStatus(QueryStationInfoDTO dto) {
|
||||
return null;
|
||||
throw new UnsupportedOperationException("This method is not yet implemented");
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询统计信息
|
||||
* 查询统计信息 query_station_stats
|
||||
*
|
||||
* @param dto
|
||||
*/
|
||||
@Override
|
||||
public Map<String, String> queryStationStats(QueryStationInfoDTO dto) {
|
||||
return null;
|
||||
throw new UnsupportedOperationException("This method is not yet implemented");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -125,7 +124,7 @@ public class NeiMengGuPlatformLogic extends AbsInterfaceWithPlatformLogic {
|
||||
*/
|
||||
@Override
|
||||
public Map<String, String> queryOrderInfo(String orderCode) {
|
||||
return null;
|
||||
throw new UnsupportedOperationException("This method is not yet implemented");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -136,7 +135,7 @@ public class NeiMengGuPlatformLogic extends AbsInterfaceWithPlatformLogic {
|
||||
*/
|
||||
@Override
|
||||
public Map<String, String> queryEquipAuth(QueryEquipmentDTO dto) {
|
||||
return null;
|
||||
throw new UnsupportedOperationException("This method is not yet implemented");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -146,7 +145,7 @@ public class NeiMengGuPlatformLogic extends AbsInterfaceWithPlatformLogic {
|
||||
*/
|
||||
@Override
|
||||
public Map<String, String> queryEquipBusinessPolicy(QueryStartChargeDTO dto) {
|
||||
return null;
|
||||
throw new UnsupportedOperationException("This method is not yet implemented");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -157,7 +156,7 @@ public class NeiMengGuPlatformLogic extends AbsInterfaceWithPlatformLogic {
|
||||
*/
|
||||
@Override
|
||||
public Map<String, String> insertStartCharge(QueryStationInfoDTO dto) {
|
||||
return null;
|
||||
throw new UnsupportedOperationException("This method is not yet implemented");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -168,7 +167,7 @@ public class NeiMengGuPlatformLogic extends AbsInterfaceWithPlatformLogic {
|
||||
*/
|
||||
@Override
|
||||
public Map<String, String> notificationDeliverEquipBusinessPolicyResult(QueryStationInfoDTO dto) {
|
||||
return null;
|
||||
throw new UnsupportedOperationException("This method is not yet implemented");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -179,7 +178,7 @@ public class NeiMengGuPlatformLogic extends AbsInterfaceWithPlatformLogic {
|
||||
*/
|
||||
@Override
|
||||
public String notificationStationInfo(String stationId) {
|
||||
return null;
|
||||
throw new UnsupportedOperationException("This method is not yet implemented");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -189,7 +188,7 @@ public class NeiMengGuPlatformLogic extends AbsInterfaceWithPlatformLogic {
|
||||
*/
|
||||
@Override
|
||||
public Map<String, String> queryStartCharge(QueryStartChargeDTO dto) {
|
||||
return null;
|
||||
throw new UnsupportedOperationException("This method is not yet implemented");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -199,7 +198,18 @@ public class NeiMengGuPlatformLogic extends AbsInterfaceWithPlatformLogic {
|
||||
*/
|
||||
@Override
|
||||
public String notificationStartChargeResult(String orderCode) {
|
||||
return null;
|
||||
throw new UnsupportedOperationException("This method is not yet implemented");
|
||||
}
|
||||
|
||||
/**
|
||||
* 推送充电状态 notification_equip_charge_status
|
||||
* 推送充电状态信息 supervise_notification_equip_charge_status
|
||||
*
|
||||
* @param orderCode 订单编号
|
||||
*/
|
||||
@Override
|
||||
public String notificationEquipChargeStatus(String orderCode) {
|
||||
throw new UnsupportedOperationException("This method is not yet implemented");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -209,20 +219,11 @@ public class NeiMengGuPlatformLogic extends AbsInterfaceWithPlatformLogic {
|
||||
*/
|
||||
@Override
|
||||
public Map<String, String> queryEquipChargeStatus(QueryEquipChargeStatusDTO dto) {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 推送充电状态
|
||||
*
|
||||
* @param orderCode
|
||||
*/
|
||||
@Override
|
||||
public String notificationEquipChargeStatus(String orderCode) {
|
||||
//方法未实现,抛出异常
|
||||
throw new UnsupportedOperationException("This method is not yet implemented");
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 请求停止充电
|
||||
*
|
||||
@@ -230,7 +231,7 @@ public class NeiMengGuPlatformLogic extends AbsInterfaceWithPlatformLogic {
|
||||
*/
|
||||
@Override
|
||||
public Map<String, String> queryStopCharge(QueryStartChargeDTO dto) {
|
||||
return null;
|
||||
throw new UnsupportedOperationException("This method is not yet implemented");
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user