mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-22 03:55:17 +08:00
update lianlian
This commit is contained in:
144
jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/lianlian/common/CommonResult.java
vendored
Normal file
144
jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/lianlian/common/CommonResult.java
vendored
Normal file
@@ -0,0 +1,144 @@
|
||||
package com.jsowell.thirdparty.lianlian.common;
|
||||
|
||||
|
||||
import com.jsowell.thirdparty.lianlian.common.enums.ResultCode;
|
||||
|
||||
/**
|
||||
* 接口返回类
|
||||
*
|
||||
* @author 联联充电
|
||||
*/
|
||||
public class CommonResult<T> {
|
||||
|
||||
/**
|
||||
* 状态码
|
||||
*/
|
||||
private long ret;
|
||||
|
||||
/**
|
||||
* 响应信息
|
||||
*/
|
||||
private String msg;
|
||||
|
||||
/**
|
||||
* 返回数据
|
||||
*/
|
||||
private T data;
|
||||
|
||||
private String sig;
|
||||
|
||||
protected CommonResult() {
|
||||
|
||||
}
|
||||
|
||||
protected CommonResult(long ret, String msg, T data, String sig) {
|
||||
this.ret = ret;
|
||||
this.msg = msg;
|
||||
this.data = data;
|
||||
this.sig = sig;
|
||||
}
|
||||
|
||||
/**
|
||||
* 成功返回结果
|
||||
*
|
||||
* @param data 获取的数据
|
||||
* @param <T>
|
||||
* @return
|
||||
*/
|
||||
public static <T> CommonResult<T> success(T data) {
|
||||
return new CommonResult<T>(ResultCode.SUCCESS.getCode(), ResultCode.SUCCESS.getMsg(), data, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* 成功返回结果
|
||||
*
|
||||
* @param data 获取的数据
|
||||
* @param message 提示的信息
|
||||
* @param <T>
|
||||
* @return
|
||||
*/
|
||||
public static <T> CommonResult<T> success(T data, String message) {
|
||||
return new CommonResult<T>(ResultCode.SUCCESS.getCode(), message, data, null);
|
||||
}
|
||||
|
||||
public static <T> CommonResult<T> success(Integer ret, String msg, T data, String sig) {
|
||||
return new CommonResult<T>(ret, msg, data, sig);
|
||||
}
|
||||
|
||||
/**
|
||||
* 失败返回结果
|
||||
*
|
||||
* @param resultCode 错误码
|
||||
* @param <T>
|
||||
* @return
|
||||
*/
|
||||
public static <T> CommonResult<T> failed(ResultCode resultCode) {
|
||||
return new CommonResult<T>(resultCode.getCode(), resultCode.getMsg(), null, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* 失败返回
|
||||
*
|
||||
* @param code 错误码
|
||||
* @param msg 提示信息
|
||||
* @param <T>
|
||||
* @return
|
||||
*/
|
||||
public static <T> CommonResult<T> failed(long code, String msg) {
|
||||
return new CommonResult<T>(code, msg, null, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* 失败返回结果
|
||||
*
|
||||
* @param msg 提示信息
|
||||
* @param <T>
|
||||
* @return
|
||||
*/
|
||||
public static <T> CommonResult<T> failed(String msg) {
|
||||
return failed(ResultCode.ERROR.getCode(), msg);
|
||||
}
|
||||
|
||||
/**
|
||||
* 失败返回结果
|
||||
*
|
||||
* @param <T>
|
||||
* @return
|
||||
*/
|
||||
public static <T> CommonResult<T> failed() {
|
||||
return failed(ResultCode.ERROR);
|
||||
}
|
||||
|
||||
|
||||
public String getMsg() {
|
||||
return msg;
|
||||
}
|
||||
|
||||
public void setMsg(String msg) {
|
||||
this.msg = msg;
|
||||
}
|
||||
|
||||
public T getData() {
|
||||
return data;
|
||||
}
|
||||
|
||||
public void setData(T data) {
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
public long getRet() {
|
||||
return ret;
|
||||
}
|
||||
|
||||
public void setRet(long ret) {
|
||||
this.ret = ret;
|
||||
}
|
||||
|
||||
public String getSig() {
|
||||
return sig;
|
||||
}
|
||||
|
||||
public void setSig(String sig) {
|
||||
this.sig = sig;
|
||||
}
|
||||
}
|
||||
30
jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/lianlian/common/enums/ResultCode.java
vendored
Normal file
30
jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/lianlian/common/enums/ResultCode.java
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
package com.jsowell.thirdparty.lianlian.common.enums;
|
||||
|
||||
/**
|
||||
* 返回结果枚举
|
||||
*/
|
||||
public enum ResultCode {
|
||||
|
||||
/**
|
||||
* 接口返回枚举
|
||||
*/
|
||||
SUCCESS(200, "成功"),
|
||||
ERROR(-1, "失败");
|
||||
|
||||
private int code;
|
||||
|
||||
private String msg;
|
||||
|
||||
ResultCode(int code, String msg) {
|
||||
this.code = code;
|
||||
this.msg = msg;
|
||||
}
|
||||
|
||||
public int getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getMsg() {
|
||||
return msg;
|
||||
}
|
||||
}
|
||||
62
jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/lianlian/domain/ChargeDetail.java
vendored
Normal file
62
jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/lianlian/domain/ChargeDetail.java
vendored
Normal file
@@ -0,0 +1,62 @@
|
||||
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 ChargeDetail {
|
||||
/**
|
||||
* 开始时间 Y
|
||||
* 格式“yyyy-MM-dd HH:mm:ss”
|
||||
*/
|
||||
@JSONField(name = "DetailStartTime")
|
||||
private String detailStartTime;
|
||||
|
||||
/**
|
||||
* 结束时间 Y
|
||||
* 格式“yyyy-MM-dd HH:mm:ss”
|
||||
*/
|
||||
@JSONField(name = "DetailEndTime")
|
||||
private String detailEndTime;
|
||||
|
||||
/**
|
||||
* 时段电价(小数点后4位) Y
|
||||
*/
|
||||
@JSONField(name = "ElecPrice")
|
||||
private BigDecimal elecPrice;
|
||||
|
||||
/**
|
||||
* 时段服务费价格(小数点后4位) Y
|
||||
*/
|
||||
@JSONField(name = "SevicePrice")
|
||||
private BigDecimal sevicePrice;
|
||||
|
||||
/**
|
||||
* 时段充电量(单位:度,小数点后2位) Y
|
||||
*/
|
||||
@JSONField(name = "DetailPower")
|
||||
private BigDecimal detailPower;
|
||||
|
||||
/**
|
||||
* 时段电费(小数点后2位) Y
|
||||
*/
|
||||
@JSONField(name = "DetailElecMoney")
|
||||
private BigDecimal detailElecMoney;
|
||||
|
||||
/**
|
||||
* 时段服务费(小数点后2位) Y
|
||||
*/
|
||||
@JSONField(name = "DetailSeviceMoney")
|
||||
private BigDecimal detailSeviceMoney;
|
||||
}
|
||||
39
jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/lianlian/domain/ChargeOrder.java
vendored
Normal file
39
jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/lianlian/domain/ChargeOrder.java
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
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;
|
||||
|
||||
/**
|
||||
* 单项订单对账信息体
|
||||
*
|
||||
* @author JS-ZZA
|
||||
* @date 2023/5/22 15:39
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
public class ChargeOrder {
|
||||
/**
|
||||
* 充电订单号
|
||||
*/
|
||||
@JSONField(name = "StartChargeSeq")
|
||||
private String startChargeSeq;
|
||||
|
||||
/**
|
||||
* 累计充电量
|
||||
*/
|
||||
@JSONField(name = "TotalPower")
|
||||
private BigDecimal totalPower;
|
||||
|
||||
/**
|
||||
* 累计总金额
|
||||
*/
|
||||
@JSONField(name = "TotalMoney")
|
||||
private BigDecimal totalMoney;
|
||||
}
|
||||
@@ -0,0 +1,140 @@
|
||||
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 ConnectorChargeStatusInfo {
|
||||
/**
|
||||
* 充电订单号 Y
|
||||
* 对接平台系统订单编号
|
||||
*/
|
||||
@JSONField(name = "StartChargeSeq")
|
||||
private String startChargeSeq;
|
||||
|
||||
/**
|
||||
* 充电设备接口编码 Y
|
||||
* 平台下唯一枪口号
|
||||
*/
|
||||
@JSONField(name = "ConnectorID")
|
||||
private String connectorID;
|
||||
|
||||
/**
|
||||
* 充电设备接口状态 Y
|
||||
* 1:空闲
|
||||
* 2:占用(未充电)
|
||||
* 3:占用(充电中)
|
||||
* 4:占用(预约锁定)
|
||||
* 255:故障
|
||||
*/
|
||||
@JSONField(name = "ConnectorStatus")
|
||||
private Integer connectorStatus;
|
||||
|
||||
/**
|
||||
* 车辆识别码 N
|
||||
* 车辆识别号码或车架号码,由17位英数组成
|
||||
*/
|
||||
@JSONField(name = "Vin")
|
||||
private String vin;
|
||||
|
||||
/**
|
||||
* A相电流 Y
|
||||
* 单位:A,默认:0 含直流(输出)
|
||||
*/
|
||||
@JSONField(name = "CurrentA")
|
||||
private BigDecimal currentA;
|
||||
|
||||
/**
|
||||
* B相电流 N
|
||||
* 单位:A,默认:0
|
||||
*/
|
||||
@JSONField(name = "CurrentB")
|
||||
private BigDecimal currentB;
|
||||
|
||||
/**
|
||||
* C相电流 N
|
||||
* 单位:A,默认:0
|
||||
*/
|
||||
@JSONField(name = "CurrentC")
|
||||
private BigDecimal currentC;
|
||||
|
||||
/**
|
||||
* A相电压 Y
|
||||
* 单位:V,默认:0含直流(输出)
|
||||
*/
|
||||
@JSONField(name = "VoltageA")
|
||||
private BigDecimal voltageA;
|
||||
|
||||
/**
|
||||
* B相电压 N
|
||||
* 单位:V,默认:0
|
||||
*/
|
||||
@JSONField(name = "VoltageB")
|
||||
private BigDecimal voltageB;
|
||||
|
||||
/**
|
||||
* C相电压 N
|
||||
* 单位:V,默认:0
|
||||
*/
|
||||
@JSONField(name = "VoltageC")
|
||||
private BigDecimal voltageC;
|
||||
|
||||
/**
|
||||
* 电池剩余电量(默认:0) Y
|
||||
*/
|
||||
@JSONField(name = "Soc")
|
||||
private BigDecimal soc;
|
||||
|
||||
/**
|
||||
* 开始充电时间 Y
|
||||
* 格式“yyyy-MM-dd HH:mm:ss”
|
||||
*/
|
||||
@JSONField(name = "StartTime")
|
||||
private String startTime;
|
||||
|
||||
/**
|
||||
* 本次采样时间 Y
|
||||
* 格式“yyyy-MM-dd HH:mm:ss”
|
||||
*/
|
||||
@JSONField(name = "EndTime")
|
||||
private String endTime;
|
||||
|
||||
/**
|
||||
* 累计充电量 Y
|
||||
* 单位:度,小数点后2位
|
||||
*/
|
||||
@JSONField(name = "TotalPower")
|
||||
private BigDecimal totalPower;
|
||||
|
||||
/**
|
||||
* 累计电费 Y
|
||||
* 单位:元,小数点后2位
|
||||
*/
|
||||
@JSONField(name = "ElecMoney")
|
||||
private BigDecimal elecMoney;
|
||||
|
||||
/**
|
||||
* 累计服务费 Y
|
||||
* 单位:元,小数点后2位
|
||||
*/
|
||||
@JSONField(name = "SeviceMoney")
|
||||
private BigDecimal seviceMoney;
|
||||
|
||||
/**
|
||||
* 累计总金额 Y
|
||||
* 单位:元,小数点后2位
|
||||
*/
|
||||
@JSONField(name = "TotalMoney")
|
||||
private BigDecimal totalMoney;
|
||||
}
|
||||
71
jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/lianlian/domain/ConnectorInfo.java
vendored
Normal file
71
jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/lianlian/domain/ConnectorInfo.java
vendored
Normal file
@@ -0,0 +1,71 @@
|
||||
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
|
||||
* 停车场车位编号
|
||||
*/
|
||||
// private String ParkNo;
|
||||
|
||||
}
|
||||
29
jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/lianlian/domain/ConnectorStatsInfo.java
vendored
Normal file
29
jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/lianlian/domain/ConnectorStatsInfo.java
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
package com.jsowell.thirdparty.lianlian.domain;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 充电设备接口统计信息
|
||||
*/
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Data
|
||||
public class ConnectorStatsInfo {
|
||||
/**
|
||||
* 充电设备接口编码 Y
|
||||
* 充电设备接口编码,同一对接平台内唯一
|
||||
*/
|
||||
private String ConnectorID;
|
||||
|
||||
/**
|
||||
* 充电设备接口累计电量
|
||||
* 累计电量,单位kWh,精度0.1
|
||||
*/
|
||||
private BigDecimal ConnectorElectricity;
|
||||
}
|
||||
45
jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/lianlian/domain/ConnectorStatusInfo.java
vendored
Normal file
45
jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/lianlian/domain/ConnectorStatusInfo.java
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
package com.jsowell.thirdparty.lianlian.domain;
|
||||
|
||||
import com.alibaba.fastjson2.annotation.JSONField;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 充电设备接口状态信息
|
||||
*/
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Data
|
||||
public class ConnectorStatusInfo {
|
||||
/**
|
||||
* 充电设备接口编码 Y
|
||||
* 充电设备接口编码,同一对接平台内唯一
|
||||
*/
|
||||
@JSONField(name = "ConnectorID")
|
||||
private String connectorID;
|
||||
|
||||
/**
|
||||
* 充电设备接口状态 Y
|
||||
* 0:离网
|
||||
* 1:空闲
|
||||
* 2:占用(未充电)
|
||||
* 3:占用(充电中)
|
||||
* 4:占用(预约锁定)
|
||||
* 255:故障
|
||||
*/
|
||||
@JSONField(name = "Status")
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 车位状态(0-未知;10-空闲;50-占用) N
|
||||
*/
|
||||
private String ParkStatus;
|
||||
|
||||
/**
|
||||
* 地锁状态(0-未知;10-已解锁;50-占用) N
|
||||
*/
|
||||
private String LockStatus;
|
||||
}
|
||||
112
jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/lianlian/domain/EquipmentInfo.java
vendored
Normal file
112
jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/lianlian/domain/EquipmentInfo.java
vendored
Normal file
@@ -0,0 +1,112 @@
|
||||
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;
|
||||
|
||||
}
|
||||
36
jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/lianlian/domain/EquipmentStatsInfo.java
vendored
Normal file
36
jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/lianlian/domain/EquipmentStatsInfo.java
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
package com.jsowell.thirdparty.lianlian.domain;
|
||||
|
||||
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 EquipmentStatsInfo {
|
||||
/**
|
||||
* 设备编码 Y
|
||||
* 设备唯一编码,对同一对接平台,保证唯一
|
||||
*/
|
||||
private String EquipmentID;
|
||||
|
||||
/**
|
||||
* 充电设备累计电量 Y
|
||||
* 累计电量,单位kWh,精度0.1
|
||||
*/
|
||||
private BigDecimal EquipmentElectricity;
|
||||
|
||||
/**
|
||||
* 充电设备接口统计信息列表 Y
|
||||
* 充设备的所有充电设备接口统计对象集合
|
||||
*/
|
||||
private List<ConnectorStatsInfo> ConnectorStatsInfos;
|
||||
}
|
||||
45
jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/lianlian/domain/OperatorInfo.java
vendored
Normal file
45
jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/lianlian/domain/OperatorInfo.java
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
package com.jsowell.thirdparty.lianlian.domain;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 充电对接平台信息
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class OperatorInfo {
|
||||
/**
|
||||
* 对接平台ID(组织机构代码) Y
|
||||
*/
|
||||
private String OperatorID;
|
||||
|
||||
/**
|
||||
* 对接平台名称(机构全称) Y
|
||||
*/
|
||||
private String OperatorName;
|
||||
|
||||
/**
|
||||
* 对接平台电话(对接平台客服电话1) Y
|
||||
*/
|
||||
private String OperatorTel1;
|
||||
|
||||
/**
|
||||
* 对接平台电话2(对接平台客服电话2 ) N
|
||||
*/
|
||||
private String OperatorTel2;
|
||||
|
||||
/**
|
||||
* 对接平台注册地址 N
|
||||
*/
|
||||
private String OperatorRegAddress;
|
||||
|
||||
/**
|
||||
* 备注 N
|
||||
*/
|
||||
private String OperatorNote;
|
||||
}
|
||||
172
jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/lianlian/domain/OrderInfo.java
vendored
Normal file
172
jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/lianlian/domain/OrderInfo.java
vendored
Normal file
@@ -0,0 +1,172 @@
|
||||
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 OrderInfo {
|
||||
/**
|
||||
* 对接平台ID Y
|
||||
* 组织机构代码
|
||||
*/
|
||||
@JSONField(name = "OperatorID")
|
||||
private String operatorID;
|
||||
|
||||
/**
|
||||
* 设备所属运营商ID Y
|
||||
* 设备所属运营商组织机构代码
|
||||
*/
|
||||
@JSONField(name = "EquipmentOwnerID")
|
||||
private String equipmentOwnerID;
|
||||
|
||||
/**
|
||||
* 充电站ID Y
|
||||
* 对接平台自定义的唯一编码
|
||||
*/
|
||||
@JSONField(name = "StationID")
|
||||
private String stationID;
|
||||
|
||||
/**
|
||||
* 设备编码 Y
|
||||
* 设备唯一编码,对同一对接平台,保证唯一
|
||||
*/
|
||||
@JSONField(name = "EquipmentID")
|
||||
private String equipmentID;
|
||||
|
||||
/**
|
||||
* 充电设备接口编码 Y
|
||||
* 充电设备接口编码,同一对接平台内唯一
|
||||
*/
|
||||
@JSONField(name = "ConnectorID")
|
||||
private String connectorID;
|
||||
|
||||
/**
|
||||
* 充电订单号 Y
|
||||
* 对接平台系统订单编号
|
||||
*/
|
||||
@JSONField(name = "StartChargeSeq")
|
||||
private String startChargeSeq;
|
||||
|
||||
/**
|
||||
* 用户发起充电类型 Y
|
||||
* 1:本平台注册用户
|
||||
* 2:卡用户
|
||||
* 3:互联互通用户
|
||||
* 10:其他
|
||||
*/
|
||||
@JSONField(name = "UserChargeType")
|
||||
private Integer userChargeType;
|
||||
|
||||
/**
|
||||
* 用户手机号 N
|
||||
* 若用户发起充电类型为 APP,用户手机号必填
|
||||
*/
|
||||
@JSONField(name = "MobileNumber")
|
||||
private String mobileNumber;
|
||||
|
||||
/**
|
||||
* 本次充电消费总金额(单位:元,保留小数点后2位) Y
|
||||
*/
|
||||
@JSONField(name = "Money")
|
||||
private BigDecimal money;
|
||||
|
||||
/**
|
||||
* 本次充电电费总金额(单位:元,保留小数点后2位) Y
|
||||
*/
|
||||
@JSONField(name = "ElectMoney")
|
||||
private BigDecimal electMoney;
|
||||
|
||||
/**
|
||||
* 本次充电服务费金额(单位:元,保留小数点后2位) Y
|
||||
*/
|
||||
@JSONField(name = "ServiceMoney")
|
||||
private BigDecimal serviceMoney;
|
||||
|
||||
/**
|
||||
* 本次充电电量 Y
|
||||
* 单位kWh,精度0.01,保留小数点后2位
|
||||
*/
|
||||
@JSONField(name = "Elect")
|
||||
private BigDecimal elect;
|
||||
|
||||
/**
|
||||
* 本次充电开始时间 Y
|
||||
* 格式“yyyy-MM-dd HH:mm:ss”
|
||||
*/
|
||||
@JSONField(name = "StartTime")
|
||||
private String startTime;
|
||||
|
||||
/**
|
||||
* 本次充电结束时间 Y
|
||||
* 格式“yyyy-MM-dd HH:mm:ss”
|
||||
*/
|
||||
@JSONField(name = "EndTime")
|
||||
private String endTime;
|
||||
|
||||
/**
|
||||
* 支付金额 Y
|
||||
*/
|
||||
@JSONField(name = "PaymentAmount")
|
||||
private BigDecimal paymentAmount;
|
||||
|
||||
/**
|
||||
* 支付时间 N
|
||||
*/
|
||||
@JSONField(name = "PayTime")
|
||||
private String payTime;
|
||||
|
||||
/**
|
||||
* 支付方式 Y
|
||||
* 1:支付宝
|
||||
* 2:微信支付
|
||||
* 3:交通卡
|
||||
* 4:预充卡
|
||||
* 5:银联
|
||||
* 6:其他自定义
|
||||
*/
|
||||
@JSONField(name = "PayChannel")
|
||||
private Integer payChannel;
|
||||
|
||||
/**
|
||||
* 优惠信息描述 N
|
||||
* 描述支付的相关优惠信息,如优惠券,折扣等
|
||||
*/
|
||||
@JSONField(name = "DiscountInfo")
|
||||
private String discountInfo;
|
||||
|
||||
/**
|
||||
* 充电结束原因 Y
|
||||
* 0:用户手动停止充电
|
||||
* 1:客户归属地运营商平台停止充电
|
||||
* 2:BMS停止充电
|
||||
* 3:充电机设备故障
|
||||
* 4:连接器断开
|
||||
* 5-99自定义
|
||||
*/
|
||||
@JSONField(name = "StopReason")
|
||||
private Integer stopReason;
|
||||
|
||||
/**
|
||||
* 时段数N,范围:0~32 N
|
||||
*/
|
||||
@JSONField(name = "SumPeriod")
|
||||
private Integer sumPeriod;
|
||||
|
||||
/**
|
||||
* 充电明细信息 Y
|
||||
*/
|
||||
@JSONField(name = "ChargeDetails")
|
||||
private List<ChargeDetail> chargeDetails;
|
||||
}
|
||||
352
jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/lianlian/domain/StationInfo.java
vendored
Normal file
352
jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/lianlian/domain/StationInfo.java
vendored
Normal file
@@ -0,0 +1,352 @@
|
||||
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 StationInfo {
|
||||
/**
|
||||
* 充电站ID Y
|
||||
* 对接平台自定义的唯一编码
|
||||
*/
|
||||
@JSONField(name = "StationID")
|
||||
private String stationID;
|
||||
|
||||
/**
|
||||
* 对接平台ID Y
|
||||
* 组织机构代码
|
||||
*/
|
||||
@JSONField(name = "OperatorID")
|
||||
private String operatorID;
|
||||
|
||||
/**
|
||||
* 设备所属运营商ID Y
|
||||
* 设备所属运营商组织机构代码
|
||||
*/
|
||||
@JSONField(name = "EquipmentOwnerID")
|
||||
private String equipmentOwnerID;
|
||||
|
||||
/**
|
||||
* 充电站名称 Y
|
||||
* 充电站名称的描述
|
||||
*/
|
||||
@JSONField(name = "StationName")
|
||||
private String stationName;
|
||||
|
||||
/**
|
||||
* 是否独立报桩 (0-否;1-是) Y
|
||||
* 如果是独立报桩需要填写户号以及容量
|
||||
*/
|
||||
@JSONField(name = "IsAloneApply")
|
||||
private Integer isAloneApply;
|
||||
|
||||
/**
|
||||
* 户号 N
|
||||
* 国网电费账单户号
|
||||
*/
|
||||
// private String AccountNumber;
|
||||
|
||||
/**
|
||||
* 容量(单位KW) N
|
||||
* 独立电表申请的功率
|
||||
*/
|
||||
// private BigDecimal Capacity;
|
||||
|
||||
/**
|
||||
* 是否是公共停车场库 (0-否;1-是) Y
|
||||
* 如果是公共停车场库需要填写场库编号
|
||||
*/
|
||||
@JSONField(name = "IsPublicParkingLot")
|
||||
private Integer isPublicParkingLot;
|
||||
|
||||
/**
|
||||
* 停车场库编号 N
|
||||
* 公共停车场库编号
|
||||
*/
|
||||
// private String ParkingLotNumber;
|
||||
|
||||
/**
|
||||
* 充电站国家代码 Y
|
||||
* 比如CN
|
||||
*/
|
||||
@JSONField(name = "CountryCode")
|
||||
private String countryCode;
|
||||
|
||||
/**
|
||||
* 充电站省市辖区编码 Y
|
||||
* 填写内容为参照 GB/T2260-2015
|
||||
*/
|
||||
@JSONField(name = "AreaCode")
|
||||
private String areaCode;
|
||||
|
||||
/**
|
||||
* 详细地址 Y
|
||||
*/
|
||||
@JSONField(name = "Address")
|
||||
private String address;
|
||||
|
||||
/**
|
||||
* 站点电话 N
|
||||
* 能够联系场站工作人员进行协助的联系电话
|
||||
*/
|
||||
// private String StationTel;
|
||||
|
||||
/**
|
||||
* 服务电话 Y
|
||||
* 平台服务电话,例如400 的电话
|
||||
*/
|
||||
@JSONField(name = "ServiceTel")
|
||||
private String serviceTel;
|
||||
|
||||
/**
|
||||
* 站点类型 Y
|
||||
* 1-公共
|
||||
* 50-个人
|
||||
* 100-公交(专用)
|
||||
* 101-环卫(专用)
|
||||
* 102-物流(专用)
|
||||
* 103-出租车(专用)
|
||||
* 104-分时租赁(专用)
|
||||
* 105-小区共享(专用)
|
||||
* 106-单位(专用)
|
||||
* 255-其他
|
||||
*/
|
||||
@JSONField(name = "StationType")
|
||||
private Integer stationType;
|
||||
|
||||
/**
|
||||
* 站点状态 Y
|
||||
* 0:未知
|
||||
* 1:建设中
|
||||
* 5:关闭下线
|
||||
* 6:维护中
|
||||
* 50:正常使用
|
||||
*/
|
||||
@JSONField(name = "StationStatus")
|
||||
private Integer stationStatus;
|
||||
|
||||
/**
|
||||
* 车位数量 Y
|
||||
* 可停放进行充电的车位总数(默认:0-未知)
|
||||
*/
|
||||
@JSONField(name = "ParkNums")
|
||||
private Integer parkNums;
|
||||
|
||||
/**
|
||||
* 经度 Y
|
||||
* GCJ-02坐标系
|
||||
*/
|
||||
@JSONField(name = "StationLng")
|
||||
private BigDecimal stationLng;
|
||||
|
||||
/**
|
||||
* 纬度 Y
|
||||
* GCJ-02坐标系
|
||||
*/
|
||||
@JSONField(name = "StationLat")
|
||||
private BigDecimal stationLat;
|
||||
|
||||
/**
|
||||
* 站点引导 N
|
||||
* 描述性文字,用于引导车主找到充电车位
|
||||
*/
|
||||
// private String SiteGuide;
|
||||
|
||||
/**
|
||||
* 建设场所 Y
|
||||
* 1:居民区
|
||||
* 2:公共机构
|
||||
* 3:企事业单位
|
||||
* 4:写字楼
|
||||
* 5:工业园区
|
||||
* 6:交通枢纽
|
||||
* 7:大型文体设施
|
||||
* 8:城市绿地
|
||||
* 9:大型建筑配建停车场
|
||||
* 10:路边停车位
|
||||
* 11:城际高速服务区
|
||||
* 12:风景区
|
||||
* 13:公交场站
|
||||
* 14:加油加气站
|
||||
* 15:出租车
|
||||
* 255:其他
|
||||
*/
|
||||
@JSONField(name = "Construction")
|
||||
private Integer construction;
|
||||
|
||||
/**
|
||||
* 站点照片 N
|
||||
* 充电设备照片、充电车位照片、停车场入口照片
|
||||
*/
|
||||
// private List<String> Pictures;
|
||||
|
||||
/**
|
||||
* 使用车型描述 N
|
||||
* 描述该站点接受的车大小以及类型,如大巴、物流车、私家乘用车、出租车等
|
||||
*/
|
||||
// private String MatchCars;
|
||||
|
||||
/**
|
||||
* 车位楼层及数量描述 N
|
||||
* 车位楼层以及数量信息
|
||||
*/
|
||||
// private String ParkInfo;
|
||||
|
||||
/**
|
||||
* 停车场产权方 N
|
||||
* 停车场产权人
|
||||
*/
|
||||
// private String ParkOwner;
|
||||
|
||||
/**
|
||||
* 停车场管理方 N
|
||||
* 停车场管理人(如:XX 物业)
|
||||
*/
|
||||
// private String ParkManager;
|
||||
|
||||
/**
|
||||
* 全天开放 Y
|
||||
* 是否全天开放(0-否;1-是),如果为0,则营业时间必填
|
||||
*/
|
||||
@JSONField(name = "OpenAllDay")
|
||||
private Integer openAllDay;
|
||||
|
||||
/**
|
||||
* 营业时间 N
|
||||
* 营业时间描述,推荐格式:周一至周日00:00-24:00
|
||||
*/
|
||||
// private String BusinessHours;
|
||||
|
||||
/**
|
||||
* 最低单价 Y
|
||||
* 最低充电电费率
|
||||
*/
|
||||
@JSONField(name = "MinElectricityPrice")
|
||||
private BigDecimal minElectricityPrice;
|
||||
|
||||
/**
|
||||
* 充电电费率 Y
|
||||
* 充电费描述,推荐格式:XX 元/度
|
||||
*/
|
||||
@JSONField(name = "ElectricityFee")
|
||||
private String electricityFee;
|
||||
|
||||
/**
|
||||
* 服务费率 Y
|
||||
* 服务费率描述,推荐格式:XX 元/度
|
||||
*/
|
||||
@JSONField(name = "ServiceFee")
|
||||
private String serviceFee;
|
||||
|
||||
/**
|
||||
* 免费停车 Y
|
||||
* 是否停车免费(0-否;1-是)
|
||||
*/
|
||||
@JSONField(name = "ParkFree")
|
||||
private Integer parkFree;
|
||||
|
||||
/**
|
||||
* 停车费 N
|
||||
* 停车费率描述
|
||||
*/
|
||||
// private String ParkFee;
|
||||
|
||||
/**
|
||||
* 支付方式 Y
|
||||
* 支付方式:刷卡、线上、现金 其中电子钱包类卡为刷卡,身份鉴权卡、微信/ 支付宝、APP为线上
|
||||
*/
|
||||
@JSONField(name = "Payment")
|
||||
private String payment;
|
||||
|
||||
/**
|
||||
* 是否支持预约 Y
|
||||
* 充电设备是否需要提前预约后才能使用。(0-不支持预约;1-支持预约) 不填默认为0
|
||||
*/
|
||||
@JSONField(name = "SupportOrder")
|
||||
private Integer supportOrder;
|
||||
|
||||
/**
|
||||
* 备注 N
|
||||
* 其他备注信息
|
||||
*/
|
||||
// private String Remark;
|
||||
|
||||
/**
|
||||
* 充电设备信息列表 Y
|
||||
* 该充电站所有充电设备信息对象集合
|
||||
*/
|
||||
@JSONField(name = "EquipmentInfos")
|
||||
private List<EquipmentInfo> equipmentInfos;
|
||||
|
||||
/**
|
||||
* 停车收费类型 Y
|
||||
* 0:停车收费;
|
||||
* 1:停车免费;
|
||||
* 2:限时免费;
|
||||
* 3:充电限免
|
||||
*/
|
||||
@JSONField(name = "ParkFeeType")
|
||||
private Integer parkFeeType;
|
||||
|
||||
/**
|
||||
* 是否靠近卫生间(0-否;1-是) Y
|
||||
*/
|
||||
@JSONField(name = "ToiletFlag")
|
||||
private Integer toiletFlag;
|
||||
|
||||
/**
|
||||
* 是否靠近便利店(0-否;1-是) Y
|
||||
*/
|
||||
@JSONField(name = "StoreFlag")
|
||||
private Integer storeFlag;
|
||||
|
||||
/**
|
||||
* 是否靠近餐厅(0-否;1-是) Y
|
||||
*/
|
||||
@JSONField(name = "RestaurantFlag")
|
||||
private Integer restaurantFlag;
|
||||
|
||||
/**
|
||||
* 是否靠近休息室(0-否;1-是) Y
|
||||
*/
|
||||
@JSONField(name = "LoungeFlag")
|
||||
private Integer loungeFlag;
|
||||
|
||||
/**
|
||||
* 是否有雨棚(0-否;1-是) Y
|
||||
*/
|
||||
@JSONField(name = "CanopyFlag")
|
||||
private Integer canopyFlag;
|
||||
|
||||
/**
|
||||
* 是否有小票机(0-否;1-是) Y
|
||||
*/
|
||||
@JSONField(name = "PrinterFlag")
|
||||
private Integer printerFlag;
|
||||
|
||||
/**
|
||||
* 是否有道闸(0-否;1-是) Y
|
||||
*/
|
||||
@JSONField(name = "BarrierFlag")
|
||||
private Integer barrierFlag;
|
||||
|
||||
/**
|
||||
* 是否有地锁(0-否;1-是) Y
|
||||
*/
|
||||
@JSONField(name = "ParkingLockFlag")
|
||||
private Integer parkingLockFlag;
|
||||
|
||||
}
|
||||
46
jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/lianlian/domain/StationStatsInfo.java
vendored
Normal file
46
jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/lianlian/domain/StationStatsInfo.java
vendored
Normal file
@@ -0,0 +1,46 @@
|
||||
package com.jsowell.thirdparty.lianlian.domain;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 充电站统计信息
|
||||
*
|
||||
* @author JS-ZZA
|
||||
* @date 2023/4/15 9:29
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Builder
|
||||
public class StationStatsInfo {
|
||||
/**
|
||||
* 充电站 ID
|
||||
*/
|
||||
private String StationID;
|
||||
|
||||
/**
|
||||
* 统计的开始时间
|
||||
*/
|
||||
private String StartTime;
|
||||
|
||||
/**
|
||||
* 统计的结束时间
|
||||
*/
|
||||
private String EndTime;
|
||||
|
||||
/**
|
||||
* 充电站累计电量
|
||||
*/
|
||||
private BigDecimal StationElectricity;
|
||||
|
||||
/**
|
||||
* 充电设备统计信息列表
|
||||
*/
|
||||
private List<EquipmentStatsInfo> equipmentStatsInfos;
|
||||
}
|
||||
29
jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/lianlian/domain/StationStatusInfo.java
vendored
Normal file
29
jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/lianlian/domain/StationStatusInfo.java
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
package com.jsowell.thirdparty.lianlian.domain;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 充电站状态信息
|
||||
*/
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Data
|
||||
public class StationStatusInfo {
|
||||
/**
|
||||
* 充电站ID Y
|
||||
* 对接平台自定义的唯一编码,不足长度在前方补0
|
||||
*/
|
||||
private String StationID;
|
||||
|
||||
/**
|
||||
* 充电设备接口状态列表 Y
|
||||
* 所有充电设备接口的状态
|
||||
*/
|
||||
private List<?> ConnectorStatusInfos;
|
||||
}
|
||||
153
jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/lianlian/service/LianLianService.java
vendored
Normal file
153
jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/lianlian/service/LianLianService.java
vendored
Normal file
@@ -0,0 +1,153 @@
|
||||
package com.jsowell.thirdparty.lianlian.service;
|
||||
|
||||
import com.jsowell.pile.dto.*;
|
||||
import com.jsowell.thirdparty.lianlian.domain.StationStatsInfo;
|
||||
import com.jsowell.thirdparty.lianlian.vo.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface LianLianService {
|
||||
|
||||
/**
|
||||
* 根据运营商id,推送运营商信息
|
||||
* @param merchantId
|
||||
*/
|
||||
void pushMerchantInfo(Long merchantId);
|
||||
|
||||
/**
|
||||
* 根据充电站id,推送充电站信息
|
||||
* @param dto
|
||||
*/
|
||||
String pushStationInfo(LianLianPushStationInfoDTO dto);
|
||||
|
||||
/**
|
||||
* 联联平台获取充电站信息
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
LianLianPageResponse query_stations_info(QueryStationInfoDTO dto);
|
||||
|
||||
/**
|
||||
* 设备接口状态查询
|
||||
* 此接口用于批量查询设备实时状态
|
||||
*
|
||||
* @param StationIDs
|
||||
* @return
|
||||
*/
|
||||
LianLianPageResponse query_station_status(List<String> StationIDs);
|
||||
|
||||
|
||||
/**
|
||||
* 查询统计信息
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
StationStatsInfo query_station_stats(QueryStationInfoDTO dto);
|
||||
|
||||
|
||||
/**
|
||||
* 请求设备认证
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
EquipmentAuthVO query_equip_auth(QueryEquipmentDTO dto);
|
||||
|
||||
/**
|
||||
* 请求开始充电
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
QueryStartChargeVO query_start_charge(QueryStartChargeDTO dto);
|
||||
|
||||
/**
|
||||
* 查询充电状态
|
||||
* @param startChargeSeq
|
||||
*/
|
||||
QueryChargingStatusVO query_equip_charge_status(String startChargeSeq);
|
||||
|
||||
/**
|
||||
* 请求停止充电
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
QueryStopChargeVO query_stop_charge(QueryStartChargeDTO dto);
|
||||
|
||||
/**
|
||||
* 联联平台获取令牌
|
||||
* @param urlAddress
|
||||
* @param operatorId
|
||||
* @param operatorSecret
|
||||
* @return
|
||||
*/
|
||||
String getToken(String urlAddress, String operatorId, String operatorSecret);
|
||||
|
||||
/**
|
||||
* 推送联联平台 设备状态变化推送
|
||||
* @param pileConnectorCode
|
||||
* @param status
|
||||
* @return
|
||||
*/
|
||||
String pushConnectorStatus(String pileConnectorCode, String status);
|
||||
|
||||
/**
|
||||
* 推送订单信息
|
||||
* @param orderCode
|
||||
* @return
|
||||
*/
|
||||
String pushOrderInfo(String orderCode);
|
||||
|
||||
/**
|
||||
* 推送启动充电结果
|
||||
* @return
|
||||
*/
|
||||
String pushStartChargeResult(String orderCode);
|
||||
|
||||
/**
|
||||
* 推送充电状态
|
||||
* @param orderCode
|
||||
* @return
|
||||
*/
|
||||
String pushChargeStatus(String orderCode);
|
||||
|
||||
/**
|
||||
* 推送停止充电结果(仅在 交易记录的帧类型中调用)
|
||||
* @param orderCode
|
||||
* @return
|
||||
*/
|
||||
String pushStopChargeResult(String orderCode);
|
||||
|
||||
/**
|
||||
* 推送充电订单信息
|
||||
* @param orderCode
|
||||
* @return
|
||||
*/
|
||||
String pushChargeOrderInfo(String orderCode);
|
||||
|
||||
/**
|
||||
* 推送订单结算信息
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
String pushOrderSettlementInfo(PushOrderSettlementDTO dto);
|
||||
|
||||
/**
|
||||
* 查询订单结算信息
|
||||
* @param orderCode
|
||||
* @return
|
||||
*/
|
||||
String queryOrderSettlementInfo(String orderCode);
|
||||
|
||||
/**
|
||||
* 推送订单对账结果信息
|
||||
* @param orderCode
|
||||
* @return
|
||||
*/
|
||||
String pushOrderReconciliationInfo(String orderCode);
|
||||
|
||||
/**
|
||||
* 设备充电中状态变化推送
|
||||
* @param orderCode
|
||||
* @return
|
||||
*/
|
||||
String pushPileChargeStatusChange(String orderCode);
|
||||
}
|
||||
1291
jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/lianlian/service/impl/LianLianServiceImpl.java
vendored
Normal file
1291
jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/lianlian/service/impl/LianLianServiceImpl.java
vendored
Normal file
File diff suppressed because it is too large
Load Diff
248
jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/lianlian/util/Cryptos.java
vendored
Normal file
248
jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/lianlian/util/Cryptos.java
vendored
Normal file
@@ -0,0 +1,248 @@
|
||||
/**
|
||||
*/
|
||||
package com.jsowell.thirdparty.lianlian.util;
|
||||
|
||||
import javax.crypto.Cipher;
|
||||
import javax.crypto.KeyGenerator;
|
||||
import javax.crypto.Mac;
|
||||
import javax.crypto.SecretKey;
|
||||
import javax.crypto.spec.IvParameterSpec;
|
||||
import javax.crypto.spec.SecretKeySpec;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.security.GeneralSecurityException;
|
||||
import java.security.SecureRandom;
|
||||
import java.util.Arrays;
|
||||
|
||||
public class Cryptos {
|
||||
|
||||
private static final String AES = "AES";
|
||||
private static final String AES_CBC = "AES/CBC/PKCS5Padding";
|
||||
private static final String HMACSHA1 = "HmacSHA1";
|
||||
|
||||
private static final String DEFAULT_URL_ENCODING = "UTF-8";
|
||||
private static final int DEFAULT_HMACSHA1_KEYSIZE = 160; //RFC2401
|
||||
private static final int DEFAULT_AES_KEYSIZE = 128;
|
||||
private static final int DEFAULT_IVSIZE = 16;
|
||||
|
||||
private static final byte[] DEFAULT_KEY = new byte[]{-97,88,-94,9,70,-76,126,25,0,3,-20,113,108,28,69,125};
|
||||
|
||||
private static SecureRandom random = new SecureRandom();
|
||||
|
||||
//-- HMAC-SHA1 funciton --//
|
||||
/**
|
||||
* 使用HMAC-SHA1进行消息签名, 返回字节数组,长度为20字节.
|
||||
*
|
||||
* @param input 原始输入字符数组
|
||||
* @param key HMAC-SHA1密钥
|
||||
*/
|
||||
public static byte[] hmacSha1(byte[] input, byte[] key) {
|
||||
try {
|
||||
SecretKey secretKey = new SecretKeySpec(key, HMACSHA1);
|
||||
Mac mac = Mac.getInstance(HMACSHA1);
|
||||
mac.init(secretKey);
|
||||
return mac.doFinal(input);
|
||||
} catch (GeneralSecurityException e) {
|
||||
throw Exceptions.unchecked(e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验HMAC-SHA1签名是否正确.
|
||||
*
|
||||
* @param expected 已存在的签名
|
||||
* @param input 原始输入字符串
|
||||
* @param key 密钥
|
||||
*/
|
||||
public static boolean isMacValid(byte[] expected, byte[] input, byte[] key) {
|
||||
byte[] actual = hmacSha1(input, key);
|
||||
return Arrays.equals(expected, actual);
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成HMAC-SHA1密钥,返回字节数组,长度为160位(20字节).
|
||||
* HMAC-SHA1算法对密钥无特殊要求, RFC2401建议最少长度为160位(20字节).
|
||||
*/
|
||||
public static byte[] generateHmacSha1Key() {
|
||||
try {
|
||||
KeyGenerator keyGenerator = KeyGenerator.getInstance(HMACSHA1);
|
||||
keyGenerator.init(DEFAULT_HMACSHA1_KEYSIZE);
|
||||
SecretKey secretKey = keyGenerator.generateKey();
|
||||
return secretKey.getEncoded();
|
||||
} catch (GeneralSecurityException e) {
|
||||
throw Exceptions.unchecked(e);
|
||||
}
|
||||
}
|
||||
|
||||
//-- AES funciton --//
|
||||
|
||||
/**
|
||||
* 使用AES加密原始字符串.
|
||||
*
|
||||
* @param input 原始输入字符数组
|
||||
*/
|
||||
public static String aesEncrypt(String input) {
|
||||
try {
|
||||
return Encodes.encodeHex(aesEncrypt(input.getBytes(DEFAULT_URL_ENCODING), DEFAULT_KEY));
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 使用AES加密原始字符串.
|
||||
*
|
||||
* @param input 原始输入字符数组
|
||||
* @param key 符合AES要求的密钥
|
||||
*/
|
||||
public static String aesEncrypt(String input, String key) {
|
||||
try {
|
||||
return Encodes.encodeHex(aesEncrypt(input.getBytes(DEFAULT_URL_ENCODING), Encodes.decodeHex(key)));
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 使用AES加密原始字符串.
|
||||
*
|
||||
* @param input 原始输入字符数组
|
||||
* @param key 符合AES要求的密钥
|
||||
*/
|
||||
public static byte[] aesEncrypt(byte[] input, byte[] key) {
|
||||
return aes(input, key, Cipher.ENCRYPT_MODE);
|
||||
}
|
||||
|
||||
/**
|
||||
* 使用AES加密原始字符串.
|
||||
*
|
||||
* @param input 原始输入字符数组
|
||||
* @param key 符合AES要求的密钥
|
||||
* @param iv 初始向量
|
||||
*/
|
||||
public static byte[] aesEncrypt(byte[] input, byte[] key, byte[] iv) {
|
||||
return aes(input, key, iv, Cipher.ENCRYPT_MODE);
|
||||
}
|
||||
|
||||
/**
|
||||
* 使用AES解密字符串, 返回原始字符串.
|
||||
*
|
||||
* @param input Hex编码的加密字符串
|
||||
*/
|
||||
public static String aesDecrypt(String input) {
|
||||
try {
|
||||
return new String(aesDecrypt(Encodes.decodeHex(input), DEFAULT_KEY), DEFAULT_URL_ENCODING);
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 使用AES解密字符串, 返回原始字符串.
|
||||
*
|
||||
* @param input Hex编码的加密字符串
|
||||
* @param key 符合AES要求的密钥
|
||||
*/
|
||||
public static String aesDecrypt(String input, String key) {
|
||||
try {
|
||||
return new String(aesDecrypt(Encodes.decodeHex(input), Encodes.decodeHex(key)), DEFAULT_URL_ENCODING);
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 使用AES解密字符串, 返回原始字符串.
|
||||
*
|
||||
* @param input Hex编码的加密字符串
|
||||
* @param key 符合AES要求的密钥
|
||||
*/
|
||||
public static byte[] aesDecrypt(byte[] input, byte[] key) {
|
||||
return aes(input, key, Cipher.DECRYPT_MODE);
|
||||
}
|
||||
|
||||
/**
|
||||
* 使用AES解密字符串, 返回原始字符串.
|
||||
*
|
||||
* @param input Hex编码的加密字符串
|
||||
* @param key 符合AES要求的密钥
|
||||
* @param iv 初始向量
|
||||
*/
|
||||
public static byte[] aesDecrypt(byte[] input, byte[] key, byte[] iv) {
|
||||
return aes(input, key, iv, Cipher.DECRYPT_MODE);
|
||||
}
|
||||
|
||||
/**
|
||||
* 使用AES加密或解密无编码的原始字节数组, 返回无编码的字节数组结果.
|
||||
*
|
||||
* @param input 原始字节数组
|
||||
* @param key 符合AES要求的密钥
|
||||
* @param mode Cipher.ENCRYPT_MODE 或 Cipher.DECRYPT_MODE
|
||||
*/
|
||||
private static byte[] aes(byte[] input, byte[] key, int mode) {
|
||||
try {
|
||||
SecretKey secretKey = new SecretKeySpec(key, AES);
|
||||
Cipher cipher = Cipher.getInstance(AES);
|
||||
cipher.init(mode, secretKey);
|
||||
return cipher.doFinal(input);
|
||||
} catch (GeneralSecurityException e) {
|
||||
throw Exceptions.unchecked(e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 使用AES加密或解密无编码的原始字节数组, 返回无编码的字节数组结果.
|
||||
*
|
||||
* @param input 原始字节数组
|
||||
* @param key 符合AES要求的密钥
|
||||
* @param iv 初始向量
|
||||
* @param mode Cipher.ENCRYPT_MODE 或 Cipher.DECRYPT_MODE
|
||||
*/
|
||||
private static byte[] aes(byte[] input, byte[] key, byte[] iv, int mode) {
|
||||
try {
|
||||
SecretKey secretKey = new SecretKeySpec(key, AES);
|
||||
IvParameterSpec ivSpec = new IvParameterSpec(iv);
|
||||
Cipher cipher = Cipher.getInstance(AES_CBC);
|
||||
cipher.init(mode, secretKey, ivSpec);
|
||||
return cipher.doFinal(input);
|
||||
} catch (GeneralSecurityException e) {
|
||||
throw Exceptions.unchecked(e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成AES密钥,返回字节数组, 默认长度为128位(16字节).
|
||||
*/
|
||||
public static String generateAesKeyString() {
|
||||
return Encodes.encodeHex(generateAesKey(DEFAULT_AES_KEYSIZE));
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成AES密钥,返回字节数组, 默认长度为128位(16字节).
|
||||
*/
|
||||
public static byte[] generateAesKey() {
|
||||
return generateAesKey(DEFAULT_AES_KEYSIZE);
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成AES密钥,可选长度为128,192,256位.
|
||||
*/
|
||||
public static byte[] generateAesKey(int keysize) {
|
||||
try {
|
||||
KeyGenerator keyGenerator = KeyGenerator.getInstance(AES);
|
||||
keyGenerator.init(keysize);
|
||||
SecretKey secretKey = keyGenerator.generateKey();
|
||||
return secretKey.getEncoded();
|
||||
} catch (GeneralSecurityException e) {
|
||||
throw Exceptions.unchecked(e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成随机向量,默认大小为cipher.getBlockSize(), 16字节.
|
||||
*/
|
||||
public static byte[] generateIV() {
|
||||
byte[] bytes = new byte[DEFAULT_IVSIZE];
|
||||
random.nextBytes(bytes);
|
||||
return bytes;
|
||||
}
|
||||
}
|
||||
113
jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/lianlian/util/Digests.java
vendored
Normal file
113
jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/lianlian/util/Digests.java
vendored
Normal file
@@ -0,0 +1,113 @@
|
||||
/**
|
||||
*/
|
||||
package com.jsowell.thirdparty.lianlian.util;
|
||||
|
||||
import org.apache.commons.lang3.Validate;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.security.GeneralSecurityException;
|
||||
import java.security.MessageDigest;
|
||||
import java.security.SecureRandom;
|
||||
|
||||
public class Digests {
|
||||
|
||||
private static final String SHA1 = "SHA-1";
|
||||
private static final String MD5 = "MD5";
|
||||
|
||||
private static SecureRandom random = new SecureRandom();
|
||||
|
||||
/**
|
||||
* 对输入字符串进行md5散列.
|
||||
*/
|
||||
public static byte[] md5(byte[] input) {
|
||||
return digest(input, MD5, null, 1);
|
||||
}
|
||||
public static byte[] md5(byte[] input, int iterations) {
|
||||
return digest(input, MD5, null, iterations);
|
||||
}
|
||||
|
||||
/**
|
||||
* 对输入字符串进行sha1散列.
|
||||
*/
|
||||
public static byte[] sha1(byte[] input) {
|
||||
return digest(input, SHA1, null, 1);
|
||||
}
|
||||
|
||||
public static byte[] sha1(byte[] input, byte[] salt) {
|
||||
return digest(input, SHA1, salt, 1);
|
||||
}
|
||||
|
||||
public static byte[] sha1(byte[] input, byte[] salt, int iterations) {
|
||||
return digest(input, SHA1, salt, iterations);
|
||||
}
|
||||
|
||||
/**
|
||||
* 对字符串进行散列, 支持md5与sha1算法.
|
||||
*/
|
||||
private static byte[] digest(byte[] input, String algorithm, byte[] salt, int iterations) {
|
||||
try {
|
||||
MessageDigest digest = MessageDigest.getInstance(algorithm);
|
||||
|
||||
if (salt != null) {
|
||||
digest.update(salt);
|
||||
}
|
||||
|
||||
byte[] result = digest.digest(input);
|
||||
|
||||
for (int i = 1; i < iterations; i++) {
|
||||
digest.reset();
|
||||
result = digest.digest(result);
|
||||
}
|
||||
return result;
|
||||
} catch (GeneralSecurityException e) {
|
||||
throw Exceptions.unchecked(e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成随机的Byte[]作为salt.
|
||||
*
|
||||
* @param numBytes byte数组的大小
|
||||
*/
|
||||
public static byte[] generateSalt(int numBytes) {
|
||||
Validate.isTrue(numBytes > 0, "numBytes argument must be a positive integer (1 or larger)", numBytes);
|
||||
|
||||
byte[] bytes = new byte[numBytes];
|
||||
random.nextBytes(bytes);
|
||||
return bytes;
|
||||
}
|
||||
|
||||
/**
|
||||
* 对文件进行md5散列.
|
||||
*/
|
||||
public static byte[] md5(InputStream input) throws IOException {
|
||||
return digest(input, MD5);
|
||||
}
|
||||
|
||||
/**
|
||||
* 对文件进行sha1散列.
|
||||
*/
|
||||
public static byte[] sha1(InputStream input) throws IOException {
|
||||
return digest(input, SHA1);
|
||||
}
|
||||
|
||||
private static byte[] digest(InputStream input, String algorithm) throws IOException {
|
||||
try {
|
||||
MessageDigest messageDigest = MessageDigest.getInstance(algorithm);
|
||||
int bufferLength = 8 * 1024;
|
||||
byte[] buffer = new byte[bufferLength];
|
||||
int read = input.read(buffer, 0, bufferLength);
|
||||
|
||||
while (read > -1) {
|
||||
messageDigest.update(buffer, 0, read);
|
||||
read = input.read(buffer, 0, bufferLength);
|
||||
}
|
||||
|
||||
return messageDigest.digest();
|
||||
} catch (GeneralSecurityException e) {
|
||||
throw Exceptions.unchecked(e);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
142
jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/lianlian/util/Encodes.java
vendored
Normal file
142
jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/lianlian/util/Encodes.java
vendored
Normal file
@@ -0,0 +1,142 @@
|
||||
/**
|
||||
* Copyright (c) 2005-2012 springside.org.cn
|
||||
*/
|
||||
package com.jsowell.thirdparty.lianlian.util;
|
||||
|
||||
import org.apache.commons.codec.DecoderException;
|
||||
import org.apache.commons.codec.binary.Base64;
|
||||
import org.apache.commons.codec.binary.Hex;
|
||||
import org.apache.commons.lang3.StringEscapeUtils;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLDecoder;
|
||||
import java.net.URLEncoder;
|
||||
|
||||
public class Encodes {
|
||||
|
||||
private static final String DEFAULT_URL_ENCODING = "UTF-8";
|
||||
private static final char[] BASE62 = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".toCharArray();
|
||||
|
||||
/**
|
||||
* Hex编码.
|
||||
*/
|
||||
public static String encodeHex(byte[] input) {
|
||||
return new String(Hex.encodeHex(input));
|
||||
}
|
||||
|
||||
/**
|
||||
* Hex解码.
|
||||
*/
|
||||
public static byte[] decodeHex(String input) {
|
||||
try {
|
||||
return Hex.decodeHex(input.toCharArray());
|
||||
} catch (DecoderException e) {
|
||||
throw Exceptions.unchecked(e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Base64编码.
|
||||
*/
|
||||
public static String encodeBase64(byte[] input) {
|
||||
return new String(Base64.encodeBase64(input));
|
||||
}
|
||||
|
||||
/**
|
||||
* Base64编码.
|
||||
*/
|
||||
public static String encodeBase64(String input) {
|
||||
try {
|
||||
return new String(Base64.encodeBase64(input.getBytes(DEFAULT_URL_ENCODING)));
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
// /**
|
||||
// * Base64编码, URL安全(将Base64中的URL非法字符'+'和'/'转为'-'和'_', 见RFC3548).
|
||||
// */
|
||||
// public static String encodeUrlSafeBase64(byte[] input) {
|
||||
// return Base64.encodeBase64URLSafe(input);
|
||||
// }
|
||||
|
||||
/**
|
||||
* Base64解码.
|
||||
*/
|
||||
public static byte[] decodeBase64(String input) {
|
||||
return Base64.decodeBase64(input.getBytes());
|
||||
}
|
||||
|
||||
/**
|
||||
* Base64解码.
|
||||
*/
|
||||
public static String decodeBase64String(String input) {
|
||||
try {
|
||||
return new String(Base64.decodeBase64(input.getBytes()), DEFAULT_URL_ENCODING);
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Base62编码。
|
||||
*/
|
||||
public static String encodeBase62(byte[] input) {
|
||||
char[] chars = new char[input.length];
|
||||
for (int i = 0; i < input.length; i++) {
|
||||
chars[i] = BASE62[((input[i] & 0xFF) % BASE62.length)];
|
||||
}
|
||||
return new String(chars);
|
||||
}
|
||||
|
||||
/**
|
||||
* Html 转码.
|
||||
*/
|
||||
public static String escapeHtml(String html) {
|
||||
return StringEscapeUtils.escapeHtml4(html);
|
||||
}
|
||||
|
||||
/**
|
||||
* Html 解码.
|
||||
*/
|
||||
public static String unescapeHtml(String htmlEscaped) {
|
||||
return StringEscapeUtils.unescapeHtml4(htmlEscaped);
|
||||
}
|
||||
|
||||
/**
|
||||
* Xml 转码.
|
||||
*/
|
||||
public static String escapeXml(String xml) {
|
||||
return StringEscapeUtils.escapeXml10(xml);
|
||||
}
|
||||
|
||||
/**
|
||||
* Xml 解码.
|
||||
*/
|
||||
public static String unescapeXml(String xmlEscaped) {
|
||||
return StringEscapeUtils.unescapeXml(xmlEscaped);
|
||||
}
|
||||
|
||||
/**
|
||||
* URL 编码, Encode默认为UTF-8.
|
||||
*/
|
||||
public static String urlEncode(String part) {
|
||||
try {
|
||||
return URLEncoder.encode(part, DEFAULT_URL_ENCODING);
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
throw Exceptions.unchecked(e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* URL 解码, Encode默认为UTF-8.
|
||||
*/
|
||||
public static String urlDecode(String part) {
|
||||
|
||||
try {
|
||||
return URLDecoder.decode(part, DEFAULT_URL_ENCODING);
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
throw Exceptions.unchecked(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
72
jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/lianlian/util/Exceptions.java
vendored
Normal file
72
jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/lianlian/util/Exceptions.java
vendored
Normal file
@@ -0,0 +1,72 @@
|
||||
package com.jsowell.thirdparty.lianlian.util;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.io.PrintWriter;
|
||||
import java.io.StringWriter;
|
||||
|
||||
/**
|
||||
* 关于异常的工具类.
|
||||
*/
|
||||
public class Exceptions {
|
||||
private static Logger logger = LoggerFactory.getLogger(Exceptions.class);
|
||||
|
||||
/**
|
||||
* 将CheckedException转换为UncheckedException.
|
||||
*/
|
||||
public static RuntimeException unchecked(Exception e) {
|
||||
if (e instanceof RuntimeException) {
|
||||
return (RuntimeException) e;
|
||||
} else {
|
||||
return new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 将ErrorStack转化为String.
|
||||
*/
|
||||
public static String getStackTraceAsString(Throwable e) {
|
||||
if (e == null) {
|
||||
return "";
|
||||
}
|
||||
StringWriter stringWriter = new StringWriter();
|
||||
e.printStackTrace(new PrintWriter(stringWriter));
|
||||
return stringWriter.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断异常是否由某些底层的异常引起.
|
||||
*/
|
||||
public static boolean isCausedBy(Exception ex, Class<? extends Exception>... causeExceptionClasses) {
|
||||
Throwable cause = ex.getCause();
|
||||
while (cause != null) {
|
||||
for (Class<? extends Exception> causeClass : causeExceptionClasses) {
|
||||
if (causeClass.isInstance(cause)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
cause = cause.getCause();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 在request中获取异常类
|
||||
*
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
public static Throwable getThrowable(HttpServletRequest request) {
|
||||
Throwable ex = null;
|
||||
if (request.getAttribute("exception") != null) {
|
||||
ex = (Throwable) request.getAttribute("exception");
|
||||
} else if (request.getAttribute("javax.servlet.error.exception") != null) {
|
||||
ex = (Throwable) request.getAttribute("javax.servlet.error.exception");
|
||||
}
|
||||
return ex;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
58
jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/lianlian/util/GBSignUtils.java
vendored
Normal file
58
jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/lianlian/util/GBSignUtils.java
vendored
Normal file
@@ -0,0 +1,58 @@
|
||||
package com.jsowell.thirdparty.lianlian.util;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import javax.crypto.Mac;
|
||||
import javax.crypto.SecretKey;
|
||||
import javax.crypto.spec.SecretKeySpec;
|
||||
import java.util.Map;
|
||||
|
||||
public class GBSignUtils {
|
||||
|
||||
public static final Logger logger = LoggerFactory.getLogger(GBSignUtils.class);
|
||||
|
||||
public static String sign(Map<String, String> paramValues, String secret) {
|
||||
try {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (String value : paramValues.values()) {
|
||||
if (StringUtils.isNotBlank(value)) {
|
||||
sb.append(value);
|
||||
}
|
||||
}
|
||||
logger.debug("需要签名的内容:{},密钥{}", sb.toString(), secret);
|
||||
byte[] md5Digest = HmacMD5Encrypt(sb.toString(), secret);
|
||||
String result = Encodes.encodeHex(md5Digest).toUpperCase();
|
||||
logger.debug("HmacSHA1的签名内容:{}", result);
|
||||
return result;
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException("数据签名出错", e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 使用 HMAC-MD5 签名方法对对encryptText进行签名
|
||||
*
|
||||
* @param encryptText
|
||||
* 被签名的字符串
|
||||
* @param encryptKey
|
||||
* 密钥
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public static byte[] HmacMD5Encrypt(String encryptText, String encryptKey) throws Exception {
|
||||
byte[] data = encryptKey.getBytes("UTF-8");
|
||||
// 根据给定的字节数组构造一个密钥,第二参数指定一个密钥算法的名称
|
||||
SecretKey secretKey = new SecretKeySpec(data, "HmacMD5");
|
||||
// 生成一个指定 Mac 算法 的 Mac 对象
|
||||
Mac mac = Mac.getInstance("HmacMD5");
|
||||
// 用给定密钥初始化 Mac 对象
|
||||
mac.init(secretKey);
|
||||
|
||||
byte[] text = encryptText.getBytes("UTF-8");
|
||||
// 完成 Mac 操作
|
||||
return mac.doFinal(text);
|
||||
}
|
||||
|
||||
}
|
||||
143
jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/lianlian/util/HttpRequestUtil.java
vendored
Normal file
143
jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/lianlian/util/HttpRequestUtil.java
vendored
Normal file
@@ -0,0 +1,143 @@
|
||||
package com.jsowell.thirdparty.lianlian.util;
|
||||
|
||||
import cn.hutool.http.HttpRequest;
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.google.common.collect.Maps;
|
||||
import com.jsowell.common.util.DateUtils;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.http.HttpEntity;
|
||||
import org.apache.http.client.config.RequestConfig;
|
||||
import org.apache.http.client.methods.CloseableHttpResponse;
|
||||
import org.apache.http.client.methods.HttpPost;
|
||||
import org.apache.http.entity.StringEntity;
|
||||
import org.apache.http.impl.client.CloseableHttpClient;
|
||||
import org.apache.http.impl.client.HttpClients;
|
||||
import org.apache.http.util.EntityUtils;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author 联联充电
|
||||
*/
|
||||
@Slf4j
|
||||
@SuppressWarnings(value = "unused")
|
||||
public class HttpRequestUtil {
|
||||
|
||||
|
||||
/**
|
||||
* httpClient--post请求--http
|
||||
*
|
||||
* @param url
|
||||
* @param json
|
||||
* @return
|
||||
*/
|
||||
public static String httpPost(String url, String json, String token) {
|
||||
CloseableHttpClient httpClient = HttpClients.createDefault();
|
||||
CloseableHttpResponse response = null;
|
||||
try {
|
||||
//创建httpPost
|
||||
HttpPost httpPost = new HttpPost(url);
|
||||
|
||||
//设置Content-Type
|
||||
httpPost.setHeader("Content-Type", "application/json");
|
||||
httpPost.setHeader("Authorization", token);
|
||||
|
||||
//写入json数据
|
||||
httpPost.setEntity(new StringEntity(json));
|
||||
|
||||
RequestConfig requestConfig = RequestConfig.custom()
|
||||
.setConnectTimeout(50000)
|
||||
.setConnectionRequestTimeout(50000)
|
||||
.setSocketTimeout(50000)
|
||||
.build();
|
||||
httpPost.setConfig(requestConfig);
|
||||
|
||||
//发起请求,获取response对象
|
||||
response = httpClient.execute(httpPost);
|
||||
|
||||
//获取结果状态码
|
||||
int resultCode = response.getStatusLine().getStatusCode();
|
||||
if (resultCode == 200) {
|
||||
//获取返回数据实体对象
|
||||
HttpEntity entity = response.getEntity();
|
||||
|
||||
//转化为字符串
|
||||
String result = EntityUtils.toString(entity, "UTF-8");
|
||||
//封装统一的返回数据接收类
|
||||
//ResponseMsg responseMsg = (ResponseMsg) JSON.parse(result);
|
||||
return result;
|
||||
} else {
|
||||
log.info("http请求失败");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.info("http请求异常");
|
||||
} finally {
|
||||
try {
|
||||
if (httpClient != null) {
|
||||
httpClient.close();
|
||||
}
|
||||
if (response != null) {
|
||||
response.close();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.info(e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 联联平台发送请求
|
||||
*
|
||||
* @param token 联联平台令牌
|
||||
* @param data 要传输的JsonString格式数据
|
||||
* @param url 请求地址
|
||||
* @param dataSecret 消息密钥
|
||||
* @param dataSecretIV 消息密钥初始化向量
|
||||
* @param operatorId 运营商id
|
||||
* @param sigSecret 签名密钥
|
||||
* @return
|
||||
*/
|
||||
public static String sendPost(String token, String data, String url, String dataSecret,
|
||||
String dataSecretIV, String operatorId, String sigSecret){
|
||||
//加密
|
||||
byte[] encryptText = Cryptos.aesEncrypt(data.getBytes(),
|
||||
dataSecret.getBytes(), dataSecretIV.getBytes());
|
||||
String encryptData = Encodes.encodeBase64(encryptText);
|
||||
System.out.println("加密数据:" + encryptData);
|
||||
|
||||
Map<String, String> params = Maps.newLinkedHashMap();
|
||||
params.put("OperatorID", operatorId);
|
||||
params.put("Data", encryptData);
|
||||
params.put("TimeStamp", DateUtils.parseDateToStr(DateUtils.YYYYMMDDHHMMSS, new Date()));
|
||||
params.put("Seq", "001");
|
||||
String sign = GBSignUtils.sign(params, sigSecret);
|
||||
params.put("Sig", sign);
|
||||
|
||||
String postData = JSON.toJSONString(params);
|
||||
System.out.println("最终提交数据:" + postData);
|
||||
|
||||
String hutoolRequest = HttpRequest.post(url).header("Authorization", "Bearer " + token).body(postData).execute().body();
|
||||
|
||||
System.out.println("接收到返回数据:" + hutoolRequest);
|
||||
|
||||
Map<String, String> map = (Map<String, String>) JSON.parse(hutoolRequest);
|
||||
|
||||
String rData = map.get("Data");
|
||||
String resultMsg = map.get("Msg");
|
||||
|
||||
byte[] plainText = Cryptos.aesDecrypt(Encodes.decodeBase64(rData),
|
||||
dataSecret.getBytes(), dataSecretIV.getBytes());
|
||||
String plainData = "";
|
||||
try {
|
||||
plainData = new String(plainText, "UTF-8");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
System.out.println("解密数据:" + plainData);
|
||||
return resultMsg;
|
||||
}
|
||||
}
|
||||
48
jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/lianlian/util/LianLianUtils.java
vendored
Normal file
48
jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/lianlian/util/LianLianUtils.java
vendored
Normal file
@@ -0,0 +1,48 @@
|
||||
package com.jsowell.thirdparty.lianlian.util;
|
||||
|
||||
import com.jsowell.common.constant.Constants;
|
||||
import com.jsowell.common.util.BytesUtil;
|
||||
import com.jsowell.common.util.DateUtils;
|
||||
|
||||
import javax.crypto.Mac;
|
||||
import javax.crypto.SecretKey;
|
||||
import javax.crypto.spec.SecretKeySpec;
|
||||
import java.util.Locale;
|
||||
|
||||
/**
|
||||
* 联联平台工具类
|
||||
*
|
||||
* @author JS-ZZA
|
||||
* @date 2023/5/6 14:22
|
||||
*/
|
||||
public class LianLianUtils {
|
||||
static final String ALGORITHM_MAC = "HmacMD5";
|
||||
|
||||
/** 密钥 **/
|
||||
static final String MAC_KEY = "TmsdVaFVTtjzZbLi";
|
||||
|
||||
|
||||
/**
|
||||
* HMAC加密
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public static String encryptionHMAC(String source) throws Exception {
|
||||
SecretKey secretKey = new SecretKeySpec(MAC_KEY.getBytes("UTF-8"), ALGORITHM_MAC);
|
||||
Mac mac = Mac.getInstance(ALGORITHM_MAC);
|
||||
mac.init(secretKey);
|
||||
mac.update(source.getBytes("UTF-8"));
|
||||
return BytesUtil.binary(mac.doFinal(), 16).toUpperCase(Locale.ROOT);
|
||||
}
|
||||
|
||||
/**
|
||||
* 拼接参数
|
||||
* @param Data
|
||||
* @return
|
||||
*/
|
||||
public static String connectData(String Data){
|
||||
String timeStamp = DateUtils.dateTimeNow(DateUtils.YYYYMMDDHHMMSS);
|
||||
String number = "0001";
|
||||
return Constants.OPERATORID_LIANLIAN + Data + timeStamp + number;
|
||||
}
|
||||
}
|
||||
116
jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/lianlian/util/SignUtils.java
vendored
Normal file
116
jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/lianlian/util/SignUtils.java
vendored
Normal file
@@ -0,0 +1,116 @@
|
||||
package com.jsowell.thirdparty.lianlian.util;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.security.GeneralSecurityException;
|
||||
import java.security.MessageDigest;
|
||||
import java.util.*;
|
||||
|
||||
public class SignUtils {
|
||||
|
||||
private static String UTF_8 = "UTF-8";
|
||||
|
||||
/**
|
||||
* 使用<code>secret</code>对paramValues按以下算法进行签名: <br/>
|
||||
* uppercase(hex(sha1(secretkey1value1key2value2...secret))
|
||||
*
|
||||
* @param paramValues
|
||||
* 参数列表
|
||||
* @param secret
|
||||
* @return
|
||||
*/
|
||||
public static String sign(Map<String, String> paramValues, String secret) {
|
||||
return sign(paramValues, null, secret);
|
||||
}
|
||||
|
||||
/**
|
||||
* 对paramValues进行签名,其中ignoreParamNames这些参数不参与签名
|
||||
*
|
||||
* @param paramValues
|
||||
* @param ignoreParamNames
|
||||
* @param secret
|
||||
* @return
|
||||
*/
|
||||
public static String sign(Map<String, String> paramValues, List<String> ignoreParamNames, String secret) {
|
||||
try {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
List<String> paramNames = new ArrayList<String>(paramValues.size());
|
||||
paramNames.addAll(paramValues.keySet());
|
||||
if (ignoreParamNames != null && ignoreParamNames.size() > 0) {
|
||||
for (String ignoreParamName : ignoreParamNames) {
|
||||
paramNames.remove(ignoreParamName);
|
||||
}
|
||||
}
|
||||
Collections.sort(paramNames);
|
||||
|
||||
sb.append(secret);
|
||||
for (String paramName : paramNames) {
|
||||
sb.append(paramName).append(paramValues.get(paramName));
|
||||
}
|
||||
sb.append(secret);
|
||||
System.out.println("原始的签名:" + sb.toString());
|
||||
byte[] sha1Digest = getSHA1Digest(sb.toString());
|
||||
System.out.println("sha-1的二进制码:" + String.valueOf(sha1Digest));
|
||||
return byte2hex(sha1Digest);
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
public static String utf8Encoding(String value, String sourceCharsetName) {
|
||||
try {
|
||||
return new String(value.getBytes(sourceCharsetName), UTF_8);
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
throw new IllegalArgumentException(e);
|
||||
}
|
||||
}
|
||||
|
||||
private static byte[] getSHA1Digest(String data) throws IOException {
|
||||
byte[] bytes = null;
|
||||
try {
|
||||
MessageDigest md = MessageDigest.getInstance("SHA-1");
|
||||
bytes = md.digest(data.getBytes(UTF_8));
|
||||
} catch (GeneralSecurityException gse) {
|
||||
throw new IOException(gse.getMessage()) ;
|
||||
}
|
||||
return bytes;
|
||||
}
|
||||
|
||||
// private static byte[] getMD5Digest(String data) throws IOException {
|
||||
// byte[] bytes = null;
|
||||
// try {
|
||||
// MessageDigest md = MessageDigest.getInstance("MD5");
|
||||
// bytes = md.digest(data.getBytes(UTF_8));
|
||||
// } catch (GeneralSecurityException gse) {
|
||||
// throw new IOException(gse.getMessage());
|
||||
// }
|
||||
// return bytes;
|
||||
// }
|
||||
|
||||
/**
|
||||
* 二进制转十六进制字符串
|
||||
*
|
||||
* @param bytes
|
||||
* @return
|
||||
*/
|
||||
private static String byte2hex(byte[] bytes) {
|
||||
StringBuilder sign = new StringBuilder();
|
||||
for (int i = 0; i < bytes.length; i++) {
|
||||
String hex = Integer.toHexString(bytes[i] & 0xFF);
|
||||
if (hex.length() == 1) {
|
||||
sign.append("0");
|
||||
}
|
||||
sign.append(hex.toUpperCase());
|
||||
}
|
||||
System.out.println("最终的签名:" + sign);
|
||||
return sign.toString();
|
||||
}
|
||||
|
||||
public static String getUUID() {
|
||||
UUID uuid = UUID.randomUUID();
|
||||
return uuid.toString().toUpperCase();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
52
jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/lianlian/vo/EquipmentAuthVO.java
vendored
Normal file
52
jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/lianlian/vo/EquipmentAuthVO.java
vendored
Normal file
@@ -0,0 +1,52 @@
|
||||
package com.jsowell.thirdparty.lianlian.vo;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 请求设备认证VO
|
||||
*
|
||||
* @author JS-ZZA
|
||||
* @date 2023/4/19 9:57
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
public class EquipmentAuthVO {
|
||||
|
||||
/**
|
||||
* 设备认证流水号
|
||||
* 格式“运营商 ID+yyyyMMddHHmmss+4 位随机数”
|
||||
*/
|
||||
private String EquipAuthSeq;
|
||||
|
||||
/**
|
||||
* 充电设备接口编码
|
||||
*/
|
||||
private String ConnectorID;
|
||||
|
||||
/**
|
||||
* 成功状态
|
||||
* 0:成功;
|
||||
* 1:失败
|
||||
*/
|
||||
private int SuccStat;
|
||||
|
||||
/**
|
||||
* 失败原因
|
||||
* 0:无;
|
||||
* 1:此设备尚未插枪;
|
||||
* 2:设备检测失败:
|
||||
* 3~99:自定义
|
||||
*/
|
||||
private int FailReason;
|
||||
|
||||
/**
|
||||
* 失败原因描述
|
||||
* 如果设备认证失败则必传,描述力求简单明了,用户一看即懂
|
||||
*/
|
||||
private String FailReasonMsg;
|
||||
}
|
||||
43
jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/lianlian/vo/LianLianPageResponse.java
vendored
Normal file
43
jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/lianlian/vo/LianLianPageResponse.java
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
package com.jsowell.thirdparty.lianlian.vo;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 联联平台分页反参
|
||||
*
|
||||
* @author JS-ZZA
|
||||
* @date 2023/4/10 15:24
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Builder
|
||||
public class LianLianPageResponse implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -8425633122529553009L;
|
||||
/**
|
||||
* 当前页数
|
||||
*/
|
||||
private int PageNo;
|
||||
|
||||
/**
|
||||
* 页码总数
|
||||
*/
|
||||
private int PageCount;
|
||||
|
||||
/**
|
||||
* 总记录条数
|
||||
*/
|
||||
private int ItemSize;
|
||||
|
||||
/**
|
||||
* 数据集合
|
||||
*/
|
||||
private List<?> list;
|
||||
}
|
||||
43
jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/lianlian/vo/LianLianResultVO.java
vendored
Normal file
43
jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/lianlian/vo/LianLianResultVO.java
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
package com.jsowell.thirdparty.lianlian.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 联联平台接口返回对象
|
||||
*
|
||||
* @author JS-ZZA
|
||||
* @date 2023/5/10 8:36
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
public class LianLianResultVO {
|
||||
/**
|
||||
* 系统错误码
|
||||
*/
|
||||
@JsonProperty("Ret")
|
||||
int ret = 0;
|
||||
|
||||
/**
|
||||
* 返回提示信息
|
||||
*/
|
||||
@JsonProperty("Msg")
|
||||
String msg = "";
|
||||
|
||||
/**
|
||||
* 返回结果
|
||||
*/
|
||||
@JsonProperty("Data")
|
||||
Object data;
|
||||
|
||||
/**
|
||||
* 签名
|
||||
*/
|
||||
@JsonProperty("Sig")
|
||||
String sig;
|
||||
}
|
||||
168
jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/lianlian/vo/QueryChargingStatusVO.java
vendored
Normal file
168
jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/lianlian/vo/QueryChargingStatusVO.java
vendored
Normal file
@@ -0,0 +1,168 @@
|
||||
package com.jsowell.thirdparty.lianlian.vo;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 查询充电状态VO
|
||||
*
|
||||
* @author JS-ZZA
|
||||
* @date 2023/4/24 14:33
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
public class QueryChargingStatusVO {
|
||||
|
||||
/**
|
||||
* 充电订单号
|
||||
*/
|
||||
private String StartChargeSeq;
|
||||
|
||||
/**
|
||||
* 充电订单状态
|
||||
*/
|
||||
private int StartChargeSeqStat;
|
||||
|
||||
/**
|
||||
* 充电设备接口编码
|
||||
*/
|
||||
private String ConnectorID;
|
||||
|
||||
/**
|
||||
* 充电设备接口状态
|
||||
*/
|
||||
private int ConnectorStatus;
|
||||
|
||||
/**
|
||||
* 车辆识别码
|
||||
*/
|
||||
private String Vin;
|
||||
|
||||
/**
|
||||
* A 相电流
|
||||
*/
|
||||
private BigDecimal CurrentA;
|
||||
|
||||
/**
|
||||
* B 相电流
|
||||
*/
|
||||
private BigDecimal CurrentB;
|
||||
|
||||
/**
|
||||
* C 相电流
|
||||
*/
|
||||
private BigDecimal CurrentC;
|
||||
|
||||
/**
|
||||
* A 相电压
|
||||
*/
|
||||
private BigDecimal VoltageA;
|
||||
|
||||
/**
|
||||
* B 相电压
|
||||
*/
|
||||
private BigDecimal VoltageB;
|
||||
|
||||
/**
|
||||
* C 相电压
|
||||
*/
|
||||
private BigDecimal VoltageC;
|
||||
|
||||
/**
|
||||
* 电池剩余电量
|
||||
*/
|
||||
private BigDecimal Soc;
|
||||
|
||||
/**
|
||||
* 开始充电时间
|
||||
*/
|
||||
private String StartTime;
|
||||
|
||||
/**
|
||||
* 本次采样时间
|
||||
*/
|
||||
private String EndTime;
|
||||
|
||||
/**
|
||||
* 累计充电量
|
||||
*/
|
||||
private BigDecimal TotalPower;
|
||||
|
||||
/**
|
||||
* 累计电费
|
||||
*/
|
||||
private BigDecimal ElecMoney;
|
||||
|
||||
/**
|
||||
* 累计服务费
|
||||
*/
|
||||
private BigDecimal SeviceMoney;
|
||||
|
||||
/**
|
||||
* 累计总金额
|
||||
*/
|
||||
private BigDecimal TotalMoney;
|
||||
|
||||
/**
|
||||
* 是否可申请停车费减免
|
||||
*/
|
||||
private int ParkingFeeDiscount;
|
||||
|
||||
/**
|
||||
* 时段数 N 范围:0~32
|
||||
*/
|
||||
private int SumPeriod;
|
||||
|
||||
/**
|
||||
* 充电明细信息
|
||||
*/
|
||||
private List<ChargeDetail> ChargeDetails;
|
||||
|
||||
/**
|
||||
* 充电明细信息体
|
||||
*/
|
||||
@Data
|
||||
public static class ChargeDetail {
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
private String DetailStartTime;
|
||||
|
||||
/**
|
||||
* 结束时间
|
||||
*/
|
||||
private String DetailEndTime;
|
||||
|
||||
/**
|
||||
* 时段电价
|
||||
*/
|
||||
private BigDecimal ElecPrice;
|
||||
|
||||
/**
|
||||
* 时段服务费价格
|
||||
*/
|
||||
private BigDecimal SevicePrice;
|
||||
|
||||
/**
|
||||
* 时段充电量
|
||||
*/
|
||||
private BigDecimal DetailPower;
|
||||
|
||||
/**
|
||||
* 时段电费
|
||||
*/
|
||||
private BigDecimal DetailElecMoney;
|
||||
|
||||
/**
|
||||
* 时段服务费
|
||||
*/
|
||||
private BigDecimal DetailSeviceMoney;
|
||||
}
|
||||
}
|
||||
43
jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/lianlian/vo/QueryStartChargeVO.java
vendored
Normal file
43
jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/lianlian/vo/QueryStartChargeVO.java
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
package com.jsowell.thirdparty.lianlian.vo;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 请求启动充电VO
|
||||
*
|
||||
* @author JS-ZZA
|
||||
* @date 2023/4/28 14:33
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
public class QueryStartChargeVO {
|
||||
/**
|
||||
* 充电订单号
|
||||
*/
|
||||
private String StartChargeSeq;
|
||||
|
||||
/**
|
||||
* 充电订单状态
|
||||
*/
|
||||
private int StartChargeSeqStat;
|
||||
|
||||
/**
|
||||
* 充电设备接口编码
|
||||
*/
|
||||
private String ConnectorID;
|
||||
|
||||
/**
|
||||
* 成功状态
|
||||
*/
|
||||
private int SuccStat;
|
||||
|
||||
/**
|
||||
* 失败原因
|
||||
*/
|
||||
private int FailReason;
|
||||
}
|
||||
38
jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/lianlian/vo/QueryStopChargeVO.java
vendored
Normal file
38
jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/lianlian/vo/QueryStopChargeVO.java
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
package com.jsowell.thirdparty.lianlian.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 请求停止充电
|
||||
*
|
||||
* @author JS-ZZA
|
||||
* @date 2023/4/25 11:21
|
||||
*/
|
||||
@Data
|
||||
public class QueryStopChargeVO {
|
||||
|
||||
/**
|
||||
* 充电订单号
|
||||
*/
|
||||
private String StartChargeSeq;
|
||||
|
||||
/**
|
||||
* 充电订单状态 1、启动中 ;2、充电中;3、停止中;4、已结束;5、未知
|
||||
*/
|
||||
private int StartChargeSeqStat;
|
||||
|
||||
/**
|
||||
* 成功状态 0:成功; 1:失败
|
||||
*/
|
||||
private int SuccStat;
|
||||
|
||||
/**
|
||||
* 失败原因
|
||||
* 0:无;
|
||||
* 1:此设备不存在;
|
||||
* 2:此设备离线:
|
||||
* 3:设备已停止充电;
|
||||
* 4~99:自定义
|
||||
*/
|
||||
private int FailReason;
|
||||
}
|
||||
Reference in New Issue
Block a user