evcs三方对接代码整理
This commit is contained in:
parent
c34091f8cf
commit
365e5a8c5a
@ -12,7 +12,7 @@ import java.util.Map;
|
||||
"ConnectorID",
|
||||
"ConfirmResult"
|
||||
})
|
||||
public class ChargeOrderInfoResponse {
|
||||
public class CDChargeOrder4BonusInfoRes {
|
||||
|
||||
@JsonProperty("StartChargeSeq")
|
||||
private String startChargeSeq;
|
||||
@ -1,11 +1,11 @@
|
||||
package com.xhpc.evcs.domain;
|
||||
package com.xhpc.evcs.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import com.xhpc.evcs.dto.ChargeDetails;
|
||||
import com.xhpc.evcs.domain.EtOrderMapping;
|
||||
import com.xhpc.evcs.domain.XhpcStatisticsTimeInterval;
|
||||
import com.xhpc.evcs.utils.DateUtil;
|
||||
import com.xhpc.order.domain.XhpcHistoryOrder;
|
||||
import lombok.Data;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
|
||||
import javax.persistence.Column;
|
||||
@ -36,8 +36,7 @@ import java.util.List;
|
||||
"MeterValueStart",
|
||||
"MeterValueEnd"
|
||||
})
|
||||
@Data
|
||||
public class CDChargeOrderInfo4Bonus {
|
||||
public class CDChargeOrderInfo4BonusReq {
|
||||
|
||||
@Id
|
||||
@JsonProperty("StartChargeSeq")
|
||||
@ -86,7 +85,7 @@ public class CDChargeOrderInfo4Bonus {
|
||||
@JsonProperty("ChargeDetails")
|
||||
private ChargeDetails[] chargeDetails;
|
||||
|
||||
public CDChargeOrderInfo4Bonus(XhpcHistoryOrder xhpcHistoryOrder, EtOrderMapping etOrderMapping) {
|
||||
public CDChargeOrderInfo4BonusReq(XhpcHistoryOrder xhpcHistoryOrder, EtOrderMapping etOrderMapping) {
|
||||
|
||||
this.startChargeSeq = etOrderMapping.getEvcsOrderNo();
|
||||
this.connectorID = xhpcHistoryOrder.getSerialNumber().substring(0, 16);
|
||||
@ -125,7 +124,7 @@ public class CDChargeOrderInfo4Bonus {
|
||||
return details.toArray(a);
|
||||
}
|
||||
|
||||
public CDChargeOrderInfo4Bonus() {
|
||||
public CDChargeOrderInfo4BonusReq() {
|
||||
|
||||
super();
|
||||
}
|
||||
@ -1,22 +0,0 @@
|
||||
package com.xhpc.evcs.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonAutoDetect;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@JsonAutoDetect(fieldVisibility = JsonAutoDetect.Visibility.ANY, getterVisibility = JsonAutoDetect.Visibility.NONE,
|
||||
setterVisibility = JsonAutoDetect.Visibility.NONE, creatorVisibility = JsonAutoDetect.Visibility.NONE)
|
||||
public class ChargeInfoByBillerOperatorIdRequest {
|
||||
|
||||
@JsonProperty("BillerOperatorId")
|
||||
String billerOperatorId;
|
||||
|
||||
//当该属性 为 0 时表示查询所有订单信息 当该属性为 1 时表示根据billerOperatorId查询(四九订单)
|
||||
//当该属性为 2 时表示查询四九订单信息 这时数据库字段billerOperatorId值为null
|
||||
@JsonProperty("QueryType")
|
||||
Integer queryType = 0;
|
||||
|
||||
}
|
||||
@ -1,13 +1,14 @@
|
||||
package com.xhpc.evcs.domain;
|
||||
package com.xhpc.evcs.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.*;
|
||||
import com.xhpc.evcs.dto.ChargeDetails;
|
||||
import com.xhpc.order.domain.XhpcHistoryOrder;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
|
||||
import javax.persistence.*;
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Transient;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@ -24,10 +25,8 @@ import java.util.Map;
|
||||
"StopReason",
|
||||
"SumPeriod"
|
||||
})
|
||||
@Entity
|
||||
@Setter
|
||||
@Getter
|
||||
@Table(name = "ET_CHARGE_ORDER_INFO")
|
||||
public class ChargeOrderInfo {
|
||||
|
||||
@Id
|
||||
@ -1,4 +1,4 @@
|
||||
package com.xhpc.evcs.domain;
|
||||
package com.xhpc.evcs.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonAutoDetect;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
@ -42,7 +42,7 @@ public class CommonRequest<T> {
|
||||
}
|
||||
|
||||
|
||||
public T anyDataType(Class<T> clz, String key) throws IOException {
|
||||
public T transformDataType(Class<T> clz, String key) throws IOException {
|
||||
|
||||
ObjectMapper mapper = new ObjectMapper();
|
||||
JsonNode jsonNode = mapper.readTree(data);
|
||||
@ -50,7 +50,7 @@ public class CommonRequest<T> {
|
||||
return JSONUtil.readParams(jsonNode.toString(), clz);
|
||||
}
|
||||
|
||||
public T anyDataType(Class<T> clz) throws IOException {
|
||||
public T transformDataType(Class<T> clz) throws IOException {
|
||||
|
||||
ObjectMapper mapper = new ObjectMapper();
|
||||
JsonNode jsonNode = mapper.readTree(data);
|
||||
|
||||
@ -1,18 +1,14 @@
|
||||
package com.xhpc.evcs.domain;
|
||||
package com.xhpc.evcs.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonAutoDetect;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Table;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Entity
|
||||
@Table(name = "ET_COMMON_STATION_INFO")
|
||||
@JsonAutoDetect(fieldVisibility = JsonAutoDetect.Visibility.ANY, getterVisibility = JsonAutoDetect.Visibility.NONE,
|
||||
setterVisibility = JsonAutoDetect.Visibility.NONE, creatorVisibility = JsonAutoDetect.Visibility.NONE)
|
||||
public class CommonStationInfo {
|
||||
@ -1,13 +1,11 @@
|
||||
package com.xhpc.evcs.domain;
|
||||
package com.xhpc.evcs.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.*;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Table;
|
||||
import javax.persistence.Transient;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
@ -20,10 +18,8 @@ import java.util.Objects;
|
||||
})
|
||||
@JsonAutoDetect(fieldVisibility = JsonAutoDetect.Visibility.ANY, getterVisibility = JsonAutoDetect.Visibility.NONE,
|
||||
setterVisibility = JsonAutoDetect.Visibility.NONE, creatorVisibility = JsonAutoDetect.Visibility.NONE)
|
||||
@Entity
|
||||
@Getter
|
||||
@Setter
|
||||
@Table(name = "ET_CONNECTOR_STATUS_INFO")
|
||||
public class ConnectorStatusInfo {
|
||||
|
||||
final static int OFF_LINE = 0;//离网
|
||||
@ -2,7 +2,6 @@ package com.xhpc.evcs.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonAutoDetect;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.xhpc.evcs.domain.ConnectorStatusInfo;
|
||||
import lombok.Data;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
@ -13,7 +12,7 @@ import lombok.Setter;
|
||||
@Data
|
||||
@JsonAutoDetect(fieldVisibility = JsonAutoDetect.Visibility.ANY, getterVisibility = JsonAutoDetect.Visibility.NONE,
|
||||
setterVisibility = JsonAutoDetect.Visibility.NONE, creatorVisibility = JsonAutoDetect.Visibility.NONE)
|
||||
public class CDConnectorStatusInfo4BonusRequest {
|
||||
public class ConnectorStatusInfoReq {
|
||||
|
||||
@JsonProperty("ConnectorStatusInfo")
|
||||
private ConnectorStatusInfo connectorStatusInfo;
|
||||
@ -31,7 +31,7 @@ import lombok.Setter;
|
||||
"SumPeriod",
|
||||
"ChargeDetails"
|
||||
})
|
||||
public class CDEquipChargeStatusCDInfo {
|
||||
public class EquipChargeStatus {
|
||||
|
||||
@JsonProperty("StartChargeSeq")
|
||||
private String startChargeSeq;
|
||||
@ -9,7 +9,7 @@ import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
"StartChargeSeq",
|
||||
"SuccStat"
|
||||
})
|
||||
public class CDEquipmentChargeStatusResponse {
|
||||
public class EquipChargeStatusRes {
|
||||
|
||||
@JsonProperty("SuccStat")
|
||||
private Integer succStat;
|
||||
@ -1,261 +0,0 @@
|
||||
package com.xhpc.evcs.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.*;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
@JsonPropertyOrder({
|
||||
"StartChargeSeqStat",
|
||||
"ConnectorStatus",
|
||||
"CurrentA",
|
||||
"CurrentB",
|
||||
"CurrentC",
|
||||
"VoltageA",
|
||||
"VoltageB",
|
||||
"VoltageC",
|
||||
"Soc",
|
||||
"TotalPower",
|
||||
"ElecMoney",
|
||||
"SeviceMoney",
|
||||
"TotalMoney",
|
||||
"SumPeriod",
|
||||
"StartTime"
|
||||
})
|
||||
public class EquipChargeStatusResponse {
|
||||
|
||||
@JsonProperty("StartChargeSeqStat")
|
||||
private Integer startChargeSeqStat;
|
||||
@JsonProperty("ConnectorStatus")
|
||||
private Integer connectorStatus;
|
||||
@JsonProperty("CurrentA")
|
||||
private Double currentA;
|
||||
@JsonProperty("CurrentB")
|
||||
private Double currentB;
|
||||
@JsonProperty("CurrentC")
|
||||
private Double currentC;
|
||||
@JsonProperty("VoltageA")
|
||||
private Double voltageA;
|
||||
@JsonProperty("VoltageB")
|
||||
private Double voltageB;
|
||||
@JsonProperty("VoltageC")
|
||||
private Double voltageC;
|
||||
@JsonProperty("Soc")
|
||||
private Double soc;
|
||||
@JsonProperty("TotalPower")
|
||||
private Double totalPower;
|
||||
@JsonProperty("ElecMoney")
|
||||
private Double elecMoney;
|
||||
@JsonProperty("SeviceMoney")
|
||||
private Double seviceMoney;
|
||||
@JsonProperty("TotalMoney")
|
||||
private Double totalMoney;
|
||||
@JsonProperty("SumPeriod")
|
||||
private Integer sumPeriod;
|
||||
@JsonProperty("StartTime")
|
||||
private String startTime;
|
||||
@JsonIgnore
|
||||
private Map<String, Object> additionalProperties = new HashMap<String, Object>();
|
||||
|
||||
@JsonProperty("StartTime")
|
||||
public String getStartTime() {
|
||||
|
||||
return startTime;
|
||||
}
|
||||
|
||||
@JsonProperty("StartTime")
|
||||
public void setStartTime(String startTime) {
|
||||
|
||||
this.startTime = startTime;
|
||||
}
|
||||
|
||||
@JsonProperty("StartChargeSeqStat")
|
||||
public Integer getStartChargeSeqStat() {
|
||||
|
||||
return startChargeSeqStat;
|
||||
}
|
||||
|
||||
@JsonProperty("StartChargeSeqStat")
|
||||
public void setStartChargeSeqStat(Integer startChargeSeqStat) {
|
||||
|
||||
this.startChargeSeqStat = startChargeSeqStat;
|
||||
}
|
||||
|
||||
@JsonProperty("ConnectorStatus")
|
||||
public Integer getConnectorStatus() {
|
||||
|
||||
return connectorStatus;
|
||||
}
|
||||
|
||||
@JsonProperty("ConnectorStatus")
|
||||
public void setConnectorStatus(Integer connectorStatus) {
|
||||
|
||||
this.connectorStatus = connectorStatus;
|
||||
}
|
||||
|
||||
@JsonProperty("CurrentA")
|
||||
public Double getCurrentA() {
|
||||
|
||||
return currentA;
|
||||
}
|
||||
|
||||
@JsonProperty("CurrentA")
|
||||
public void setCurrentA(Double currentA) {
|
||||
|
||||
this.currentA = currentA;
|
||||
}
|
||||
|
||||
@JsonProperty("CurrentB")
|
||||
public Double getCurrentB() {
|
||||
|
||||
return currentB;
|
||||
}
|
||||
|
||||
@JsonProperty("CurrentB")
|
||||
public void setCurrentB(Double currentB) {
|
||||
|
||||
this.currentB = currentB;
|
||||
}
|
||||
|
||||
@JsonProperty("CurrentC")
|
||||
public Double getCurrentC() {
|
||||
|
||||
return currentC;
|
||||
}
|
||||
|
||||
@JsonProperty("CurrentC")
|
||||
public void setCurrentC(Double currentC) {
|
||||
|
||||
this.currentC = currentC;
|
||||
}
|
||||
|
||||
@JsonProperty("VoltageA")
|
||||
public Double getVoltageA() {
|
||||
|
||||
return voltageA;
|
||||
}
|
||||
|
||||
@JsonProperty("VoltageA")
|
||||
public void setVoltageA(Double voltageA) {
|
||||
|
||||
this.voltageA = voltageA;
|
||||
}
|
||||
|
||||
@JsonProperty("VoltageB")
|
||||
public Double getVoltageB() {
|
||||
|
||||
return voltageB;
|
||||
}
|
||||
|
||||
@JsonProperty("VoltageB")
|
||||
public void setVoltageB(Double voltageB) {
|
||||
|
||||
this.voltageB = voltageB;
|
||||
}
|
||||
|
||||
@JsonProperty("VoltageC")
|
||||
public Double getVoltageC() {
|
||||
|
||||
return voltageC;
|
||||
}
|
||||
|
||||
@JsonProperty("VoltageC")
|
||||
public void setVoltageC(Double voltageC) {
|
||||
|
||||
this.voltageC = voltageC;
|
||||
}
|
||||
|
||||
@JsonProperty("Soc")
|
||||
public Double getSoc() {
|
||||
|
||||
return soc;
|
||||
}
|
||||
|
||||
@JsonProperty("Soc")
|
||||
public void setSoc(Double soc) {
|
||||
|
||||
this.soc = soc;
|
||||
}
|
||||
|
||||
@JsonProperty("TotalPower")
|
||||
public Double getTotalPower() {
|
||||
|
||||
return totalPower;
|
||||
}
|
||||
|
||||
@JsonProperty("TotalPower")
|
||||
public void setTotalPower(Double totalPower) {
|
||||
|
||||
this.totalPower = totalPower;
|
||||
}
|
||||
|
||||
@JsonProperty("ElecMoney")
|
||||
public Double getElecMoney() {
|
||||
|
||||
return elecMoney;
|
||||
}
|
||||
|
||||
@JsonProperty("ElecMoney")
|
||||
public void setElecMoney(Double elecMoney) {
|
||||
|
||||
this.elecMoney = elecMoney;
|
||||
}
|
||||
|
||||
@JsonProperty("SeviceMoney")
|
||||
public Double getSeviceMoney() {
|
||||
|
||||
return seviceMoney;
|
||||
}
|
||||
|
||||
@JsonProperty("SeviceMoney")
|
||||
public void setSeviceMoney(Double seviceMoney) {
|
||||
|
||||
this.seviceMoney = seviceMoney;
|
||||
}
|
||||
|
||||
@JsonProperty("TotalMoney")
|
||||
public Double getTotalMoney() {
|
||||
|
||||
return totalMoney;
|
||||
}
|
||||
|
||||
@JsonProperty("TotalMoney")
|
||||
public void setTotalMoney(Double totalMoney) {
|
||||
|
||||
this.totalMoney = totalMoney;
|
||||
}
|
||||
|
||||
@JsonProperty("SumPeriod")
|
||||
public Integer getSumPeriod() {
|
||||
|
||||
return sumPeriod;
|
||||
}
|
||||
|
||||
@JsonProperty("SumPeriod")
|
||||
public void setSumPeriod(Integer sumPeriod) {
|
||||
|
||||
this.sumPeriod = sumPeriod;
|
||||
}
|
||||
|
||||
@JsonAnyGetter
|
||||
public Map<String, Object> getAdditionalProperties() {
|
||||
|
||||
return this.additionalProperties;
|
||||
}
|
||||
|
||||
@JsonAnySetter
|
||||
public void setAdditionalProperty(String name, Object value) {
|
||||
|
||||
this.additionalProperties.put(name, value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
|
||||
return new ToStringBuilder(this).append("startChargeSeqStat", startChargeSeqStat).append("connectorStatus",
|
||||
connectorStatus).append("currentA", currentA).append("currentB", currentB).append("currentC", currentC).append("voltageA", voltageA).append("voltageB", voltageB).append("voltageC", voltageC).append("soc", soc).append("totalPower", totalPower).append("elecMoney", elecMoney).append("seviceMoney", seviceMoney).append("totalMoney", totalMoney).append("sumPeriod", sumPeriod).append("additionalProperties", additionalProperties).toString();
|
||||
}
|
||||
|
||||
}
|
||||
@ -14,7 +14,7 @@ public class EvShareQueryChargeInfosPagingRequest {
|
||||
@JsonProperty("BillerOperatorId")
|
||||
String billerOperatorId;
|
||||
|
||||
//当该属性 为 0 时表示查询所有订单信息 当该属性为 1 时表示根据billerOperatorId查询(四九订单)
|
||||
//当该属性 为 0 时表示查询所有订单信息 当该属性为 1 时表示根据billerOperatorId查询
|
||||
//当该属性为 2 时表示查询四九订单信息 这时数据库字段billerOperatorId值为null
|
||||
@JsonProperty("QueryType")
|
||||
Integer queryType = 0;
|
||||
|
||||
@ -14,7 +14,7 @@ public class EvShareQueryChargeInfosRequest {
|
||||
@JsonProperty("BillerOperatorId")
|
||||
String billerOperatorId;
|
||||
|
||||
//当该属性 为 0 时表示查询所有订单信息 当该属性为 1 时表示根据billerOperatorId查询(四九订单)
|
||||
//当该属性 为 0 时表示查询所有订单信息 当该属性为 1 时表示根据billerOperatorId查询
|
||||
//当该属性为 2 时表示查询四九订单信息 这时数据库字段billerOperatorId值为null
|
||||
@JsonProperty("QueryType")
|
||||
Integer queryType = 0;
|
||||
|
||||
@ -10,18 +10,18 @@ import java.util.Map;
|
||||
@JsonPropertyOrder({
|
||||
"Status"
|
||||
})
|
||||
public class Status {
|
||||
public class EvcsStatus {
|
||||
|
||||
@JsonProperty("Status")
|
||||
private Integer status;
|
||||
@JsonIgnore
|
||||
private Map<String, Object> additionalProperties = new HashMap<String, Object>();
|
||||
|
||||
public Status() {
|
||||
public EvcsStatus() {
|
||||
|
||||
}
|
||||
|
||||
public Status(Integer status) {
|
||||
public EvcsStatus(Integer status) {
|
||||
|
||||
this.status = status;
|
||||
}
|
||||
@ -1,4 +1,4 @@
|
||||
package com.xhpc.evcs.domain;
|
||||
package com.xhpc.evcs.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonAutoDetect;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
@ -6,15 +6,10 @@ import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Table;
|
||||
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
@JsonAutoDetect(fieldVisibility = JsonAutoDetect.Visibility.ANY, getterVisibility = JsonAutoDetect.Visibility.NONE,
|
||||
setterVisibility = JsonAutoDetect.Visibility.NONE, creatorVisibility = JsonAutoDetect.Visibility.NONE)
|
||||
@Entity
|
||||
@Table(name = "ET_OPERATOR_INFO")
|
||||
public class OperatorInfo extends CommonOperatorInfo {
|
||||
|
||||
@JsonIgnore()
|
||||
@ -2,7 +2,6 @@ package com.xhpc.evcs.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonAutoDetect;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.xhpc.evcs.domain.StationInfo;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
|
||||
@ -1,13 +1,10 @@
|
||||
package com.xhpc.evcs.domain;
|
||||
package com.xhpc.evcs.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.*;
|
||||
import com.xhpc.evcs.dto.EquipmentInfo;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Table;
|
||||
import javax.persistence.Transient;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
@ -40,8 +37,6 @@ import java.util.Map;
|
||||
@Setter
|
||||
@JsonAutoDetect(fieldVisibility = JsonAutoDetect.Visibility.ANY, getterVisibility = JsonAutoDetect.Visibility.NONE,
|
||||
setterVisibility = JsonAutoDetect.Visibility.NONE, creatorVisibility = JsonAutoDetect.Visibility.NONE)
|
||||
@Entity
|
||||
@Table(name = "ET_STATION_INFO")
|
||||
public class StationInfo extends CommonStationInfo {
|
||||
|
||||
@Transient
|
||||
@ -1,7 +1,6 @@
|
||||
package com.xhpc.evcs.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.*;
|
||||
import com.xhpc.evcs.domain.ConnectorStatusInfo;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
@ -10,6 +10,11 @@
|
||||
<artifactId>evcs-core</artifactId>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.xhpc</groupId>
|
||||
<artifactId>common</artifactId>
|
||||
<version>1.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.xhpc</groupId>
|
||||
<artifactId>evcs-common</artifactId>
|
||||
@ -119,7 +124,6 @@
|
||||
<artifactId>druid-spring-boot-starter</artifactId>
|
||||
<version>${druid.version}</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
||||
@ -1,71 +0,0 @@
|
||||
package com.xhpc.evcs;
|
||||
|
||||
import com.xhpc.evcs.api.CoreDispatcher;
|
||||
import com.xhpc.evcs.domain.ConnectorStatusInfo;
|
||||
import com.xhpc.evcs.dto.CommonRequest;
|
||||
import com.xhpc.evcs.dto.PoleStatusInfo;
|
||||
import com.xhpc.evcs.jpa.ConnectorStatusInfoRepository;
|
||||
import com.xhpc.evcs.utils.ChangePoleStatus;
|
||||
import com.xhpc.evcs.utils.JSONUtil;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.*;
|
||||
|
||||
@Component
|
||||
public class NotificationPoleStatus2Evshare extends CoreDispatcher {
|
||||
|
||||
@Autowired
|
||||
private ConnectorStatusInfoRepository connectorStatusInfoRepository;
|
||||
|
||||
// @Scheduled(fixedRate = 1000 * 60)
|
||||
private void notificationConnectorStatus() throws IOException {
|
||||
|
||||
List<ConnectorStatusInfo> connectorStatusInfos = connectorStatusInfoRepository.findAll();
|
||||
Set<ConnectorStatusInfo> connectorStatusInfoSet = new HashSet<>(connectorStatusInfos.size());
|
||||
CollectionUtils.addAll(connectorStatusInfoSet, connectorStatusInfos);
|
||||
Set<ConnectorStatusInfo> changeStatus = ChangePoleStatus.getChangeStatus(connectorStatusInfoSet);
|
||||
List<PoleStatusInfo> poleStatusInfos = new ArrayList<>();
|
||||
//用于过滤掉集合里重复的充电桩编号
|
||||
Map<String, Integer> infosMap = new HashMap<>();
|
||||
for (ConnectorStatusInfo statusInfo : changeStatus) {
|
||||
String connectorNo = statusInfo.getConnectorID();
|
||||
String poleNo = connectorNo.substring(0, connectorNo.length() - 2); //截掉
|
||||
|
||||
if (statusInfo.getStatus() == 255 || statusInfo.getStatus() == 0) {
|
||||
infosMap.put(poleNo, 2);
|
||||
} else if (statusInfo.getStatus() == 1) {
|
||||
infosMap.put(poleNo, 0);
|
||||
} else {
|
||||
infosMap.put(poleNo, 1);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Set<String> keys = infosMap.keySet();
|
||||
for (String key : keys) {
|
||||
PoleStatusInfo poleStatusInfo = new PoleStatusInfo();
|
||||
poleStatusInfo.setPoleNo(key);
|
||||
poleStatusInfo.setStatus(infosMap.get(key));
|
||||
poleStatusInfos.add(poleStatusInfo);
|
||||
}
|
||||
|
||||
if (poleStatusInfos.size() > 0) {
|
||||
notificationPoleStatus2Evshare(poleStatusInfos);
|
||||
}
|
||||
}
|
||||
|
||||
public String notificationPoleStatus2Evshare(@RequestBody List<PoleStatusInfo> poleStatusInfos) throws IOException {
|
||||
|
||||
String data = JSONUtil.toJSONString(poleStatusInfos);
|
||||
CommonRequest<List<PoleStatusInfo>> commonRequest = new CommonRequest<>();
|
||||
commonRequest.setOperatorId("MA6DFCTD5");
|
||||
commonRequest.setData(data);
|
||||
String responseBody = "";//todo ok(commonRequest, "pole/notification_pole_status");
|
||||
return responseBody;
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,16 +1,9 @@
|
||||
package com.xhpc.evcs.api;
|
||||
|
||||
import com.xhpc.evcs.domain.CDChargeOrderInfo4Bonus;
|
||||
import com.xhpc.evcs.domain.ChargeOrderInfo;
|
||||
import com.xhpc.evcs.domain.StationInfo;
|
||||
import com.xhpc.evcs.dto.ChargeOrderInfoResponse;
|
||||
import com.xhpc.evcs.dto.CommonRequest;
|
||||
import com.xhpc.evcs.dto.CommonResponse;
|
||||
import com.xhpc.evcs.dto.*;
|
||||
import com.xhpc.evcs.encryption.EvcsConst;
|
||||
import com.xhpc.evcs.jpa.ChargeOrderInfoRepository;
|
||||
import com.xhpc.evcs.utils.JSONUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
@ -21,11 +14,8 @@ import java.io.IOException;
|
||||
@RestController()
|
||||
public class ChargeOrderInfoController extends CoreDispatcher {
|
||||
|
||||
@Autowired
|
||||
private ChargeOrderInfoRepository chargeOrderInfoRepository;
|
||||
|
||||
@PostMapping("/v1/notification_charge_order_info")
|
||||
public CommonResponse notificationChargeOrderInfo(@RequestBody CommonRequest<CDChargeOrderInfo4Bonus> commonRequest) throws IOException {
|
||||
public CommonResponse notificationChargeOrderInfo(@RequestBody CommonRequest<CDChargeOrderInfo4BonusReq> commonRequest) throws IOException {
|
||||
|
||||
String operatorID = commonRequest.getOperatorId();
|
||||
StationInfo stationInfo = new StationInfo();
|
||||
@ -38,7 +28,7 @@ public class ChargeOrderInfoController extends CoreDispatcher {
|
||||
// chargeOrderInfoRepository.save(chargeOrderInfo);
|
||||
CommonResponse response = new CommonResponse();
|
||||
response.setRet(EvcsConst.RET_SUCC);
|
||||
ChargeOrderInfoResponse resp = new ChargeOrderInfoResponse();
|
||||
CDChargeOrder4BonusInfoRes resp = new CDChargeOrder4BonusInfoRes();
|
||||
resp.setConfirmResult(0);
|
||||
resp.setConnectorID(chargeOrderInfo.getConnectorID());
|
||||
resp.setStartChargeSeq(chargeOrderInfo.getStartChargeSeq());
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
package com.xhpc.evcs.api;
|
||||
|
||||
import com.xhpc.evcs.domain.StationInfo;
|
||||
import com.xhpc.evcs.dto.*;
|
||||
import com.xhpc.evcs.encryption.EvcsConst;
|
||||
import com.xhpc.evcs.utils.JSONUtil;
|
||||
|
||||
@ -10,7 +10,6 @@ import com.xhpc.evcs.dto.TokenResponse;
|
||||
import com.xhpc.evcs.http.ForbiddenException;
|
||||
import com.xhpc.evcs.http.ServerInternalException;
|
||||
import com.xhpc.evcs.jpa.AuthSecretTokenRepository;
|
||||
import com.xhpc.evcs.jpa.OperatorInfoRepository;
|
||||
import com.xhpc.evcs.utils.JSONUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import okhttp3.OkHttpClient;
|
||||
@ -22,7 +21,6 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.crypto.BadPaddingException;
|
||||
import javax.crypto.IllegalBlockSizeException;
|
||||
import javax.crypto.NoSuchPaddingException;
|
||||
@ -39,9 +37,6 @@ import static com.xhpc.evcs.config.EvcsFilter.encryptReqOut;
|
||||
@Slf4j
|
||||
public class CoreDispatcher {
|
||||
|
||||
@Resource
|
||||
OperatorInfoRepository operatorInfoRepository;
|
||||
|
||||
@Value("http://hlht.cd-test.zcsy-inc.cn/evcs/20160701")
|
||||
private String evcsSrvUrl;
|
||||
@Value("true")
|
||||
|
||||
@ -4,7 +4,7 @@ import com.xhpc.evcs.domain.ChargeOrderInfo;
|
||||
import com.xhpc.evcs.dto.*;
|
||||
import com.xhpc.evcs.encryption.EvcsConst;
|
||||
import com.xhpc.evcs.http.ServerInternalException;
|
||||
import com.xhpc.evcs.jpa.ChargeOrderInfoRepository;
|
||||
import com.xhpc.evcs.jpa.XhpcHistoryOrderRepository;
|
||||
import com.xhpc.evcs.utils.DateUtil;
|
||||
import com.xhpc.evcs.utils.JSONUtil;
|
||||
import com.xhpc.order.domain.XhpcHistoryOrder;
|
||||
@ -20,66 +20,48 @@ import java.util.Date;
|
||||
public class EquipChargeStatusController extends CoreDispatcher {
|
||||
|
||||
@Autowired
|
||||
ChargeOrderInfoRepository chargeOrderInfoRepository;
|
||||
XhpcHistoryOrderRepository xhpcHistoryOrderRepository;
|
||||
|
||||
@PostMapping("/v1/query_equip_charge_status")
|
||||
public CommonResponse QueryEquipChargeStatus(@RequestBody CommonRequest<ChargeInfoRequest> commonRequest) throws IOException {
|
||||
|
||||
CDEquipChargeStatusCDInfo cdResponse = new CDEquipChargeStatusCDInfo();
|
||||
EquipChargeStatus equipChargeStatus = new EquipChargeStatus();
|
||||
String data = commonRequest.getData();
|
||||
ChargeInfoRequest chargeInfoRequest = JSONUtil.readParams(data, ChargeInfoRequest.class);
|
||||
String responseBody = "";
|
||||
String startChargeSeq = chargeInfoRequest.getStartChargeSeq();
|
||||
//这里要做一下转换 给成都市那边的订单号是 运营商ID(9位) + 填0(4位) + 四九订单号 填充够27位
|
||||
if ("0000".equals(startChargeSeq.substring(9, 13))) {
|
||||
startChargeSeq = startChargeSeq.substring(13);
|
||||
chargeInfoRequest.setStartChargeSeq(startChargeSeq);
|
||||
}
|
||||
if (startChargeSeq.length() > 14) {
|
||||
XhpcHistoryOrder xhpcHistoryOrder = chargeOrderInfoRepository.findById(startChargeSeq).orElse(null);
|
||||
// todo 三方对接 到et_order_mapping表查找xh_order_no
|
||||
XhpcHistoryOrder xhpcHistoryOrder = xhpcHistoryOrderRepository.findById(startChargeSeq).orElse(null);
|
||||
ChargeOrderInfo chargeOrderInfo = new ChargeOrderInfo(xhpcHistoryOrder);
|
||||
if (chargeOrderInfo == null) {
|
||||
throw new ServerInternalException("未查询到该订单编号数据");
|
||||
}
|
||||
cdResponse.setStartChargeSeq(chargeOrderInfo.getStartChargeSeq());
|
||||
cdResponse.setStartChargeSeqStat(chargeOrderInfo.getStartChargeSeqStat());
|
||||
cdResponse.setConnectorID(chargeOrderInfo.getConnectorID());
|
||||
cdResponse.setStartTime(chargeOrderInfo.getStartTime());
|
||||
equipChargeStatus.setStartChargeSeq(chargeOrderInfo.getStartChargeSeq());
|
||||
equipChargeStatus.setStartChargeSeqStat(chargeOrderInfo.getStartChargeSeqStat());
|
||||
equipChargeStatus.setConnectorID(chargeOrderInfo.getConnectorID());
|
||||
equipChargeStatus.setStartTime(chargeOrderInfo.getStartTime());
|
||||
String endTime;
|
||||
if (chargeOrderInfo.getEndTime() != null) {
|
||||
endTime = chargeOrderInfo.getEndTime();
|
||||
} else {
|
||||
endTime = DateUtil.date2String(new Date(), "yyyy-MM-dd HH:mm:ss");
|
||||
}
|
||||
cdResponse.setEndTime(endTime);
|
||||
cdResponse.setTotalPower(chargeOrderInfo.getTotalPower());
|
||||
cdResponse.setElecMoney(chargeOrderInfo.getTotalElecMoney());
|
||||
cdResponse.setSeviceMoney(chargeOrderInfo.getTotalSeviceMoney());
|
||||
cdResponse.setTotalMoney(chargeOrderInfo.getTotalMoney());
|
||||
|
||||
equipChargeStatus.setEndTime(endTime);
|
||||
equipChargeStatus.setTotalPower(chargeOrderInfo.getTotalPower());
|
||||
equipChargeStatus.setElecMoney(chargeOrderInfo.getTotalElecMoney());
|
||||
equipChargeStatus.setSeviceMoney(chargeOrderInfo.getTotalSeviceMoney());
|
||||
equipChargeStatus.setTotalMoney(chargeOrderInfo.getTotalMoney());
|
||||
ChargeDetails detail = new ChargeDetails();
|
||||
detail.setDetailStartTime(cdResponse.getStartTime());
|
||||
detail.setDetailStartTime(equipChargeStatus.getStartTime());
|
||||
detail.setDetailEndTime(endTime);
|
||||
detail.setDetailSeviceMoney(cdResponse.getSeviceMoney());
|
||||
detail.setDetailElecMoney(cdResponse.getElecMoney());
|
||||
detail.setDetailPower(cdResponse.getTotalPower());
|
||||
detail.setDetailSeviceMoney(equipChargeStatus.getSeviceMoney());
|
||||
detail.setDetailElecMoney(equipChargeStatus.getElecMoney());
|
||||
detail.setDetailPower(equipChargeStatus.getTotalPower());
|
||||
ChargeDetails[] details = {detail};
|
||||
cdResponse.setChargeDetails(details);
|
||||
|
||||
} else {
|
||||
responseBody = "";//todo ok(chargeInfoRequest, "equip/query_equip_charge_status");
|
||||
cdResponse = JSONUtil.readParams(responseBody, CDEquipChargeStatusCDInfo.class);
|
||||
if (cdResponse.getStartChargeSeq() == null || "".equals(cdResponse.getStartChargeSeq())) {
|
||||
throw new ServerInternalException("未查询到该订单编号数据");
|
||||
} else {
|
||||
String seq = cdResponse.getStartChargeSeq();
|
||||
cdResponse.setStartChargeSeq("MA6DFCTD50000" + seq);
|
||||
}
|
||||
}
|
||||
|
||||
equipChargeStatus.setChargeDetails(details);
|
||||
CommonResponse response = new CommonResponse();
|
||||
response.setRet(EvcsConst.RET_SUCC);
|
||||
response.setData(JSONUtil.toJSONString(cdResponse));
|
||||
response.setData(JSONUtil.toJSONString(equipChargeStatus));
|
||||
return response;
|
||||
}
|
||||
|
||||
|
||||
@ -5,7 +5,7 @@ import com.xhpc.evcs.dto.CommonResponse;
|
||||
import com.xhpc.evcs.dto.NotificationStartChargeResultRequestData;
|
||||
import com.xhpc.evcs.dto.NotificationStartStopChargeResultResponse;
|
||||
import com.xhpc.evcs.encryption.EvcsConst;
|
||||
import com.xhpc.evcs.jpa.ChargeOrderInfoRepository;
|
||||
import com.xhpc.evcs.jpa.XhpcHistoryOrderRepository;
|
||||
import com.xhpc.evcs.utils.JSONUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@ -20,7 +20,7 @@ import java.io.IOException;
|
||||
public class StartChargeResultController extends CoreDispatcher {
|
||||
|
||||
@Autowired
|
||||
private ChargeOrderInfoRepository chargeOrderInfoRepository;
|
||||
private XhpcHistoryOrderRepository xhpcHistoryOrderRepository;
|
||||
|
||||
@PostMapping("/v1/notification_start_charge_result")
|
||||
public CommonResponse notifyStartChargeResult(@RequestBody CommonRequest<NotificationStartChargeResultRequestData> commonRequest) throws IOException {
|
||||
|
||||
@ -1,37 +1,28 @@
|
||||
package com.xhpc.evcs.api;
|
||||
|
||||
import com.xhpc.evcs.domain.ConnectorStatusInfo;
|
||||
import com.xhpc.evcs.domain.StationInfo;
|
||||
import com.xhpc.evcs.dto.CommonRequest;
|
||||
import com.xhpc.evcs.dto.CommonResponse;
|
||||
import com.xhpc.evcs.dto.Status;
|
||||
import com.xhpc.evcs.dto.*;
|
||||
import com.xhpc.evcs.encryption.EvcsConst;
|
||||
import com.xhpc.evcs.jpa.ConnectorStatusInfoRepository;
|
||||
import com.xhpc.evcs.utils.JSONUtil;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.io.IOException;
|
||||
|
||||
@RestController()
|
||||
public class StationStatusController extends CoreDispatcher {
|
||||
|
||||
@Resource
|
||||
ConnectorStatusInfoRepository connectorStatusInfoRepository;
|
||||
|
||||
@PostMapping("/v1/notification_stationStatus")
|
||||
public CommonResponse notificationStationStatus(@RequestBody CommonRequest<ConnectorStatusInfo> commonRequest) throws IOException {
|
||||
|
||||
String operatorID = commonRequest.getOperatorId();
|
||||
StationInfo stationInfo = new StationInfo();
|
||||
stationInfo.setOperatorId(operatorID);
|
||||
ConnectorStatusInfo connectorStatusInfo = commonRequest.anyDataType(ConnectorStatusInfo.class, "ConnectorStatusInfo");
|
||||
connectorStatusInfoRepository.save(connectorStatusInfo);
|
||||
ConnectorStatusInfo connectorStatusInfo = commonRequest.transformDataType(ConnectorStatusInfo.class,
|
||||
"ConnectorStatusInfo");
|
||||
CommonResponse response = new CommonResponse();
|
||||
response.setRet(EvcsConst.RET_SUCC);
|
||||
response.setData(JSONUtil.toJSONString(new Status(0)));
|
||||
response.setData(JSONUtil.toJSONString(new EvcsStatus(0)));
|
||||
return response;
|
||||
}
|
||||
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
package com.xhpc.evcs.api;
|
||||
|
||||
import com.xhpc.common.api.dto.ChargingStationDto;
|
||||
import com.xhpc.evcs.domain.StationInfo;
|
||||
import com.xhpc.evcs.domain.XhpcChargingPile;
|
||||
import com.xhpc.evcs.domain.XhpcChargingStation;
|
||||
import com.xhpc.evcs.dto.*;
|
||||
@ -36,7 +35,7 @@ public class StationsInfoController extends CoreDispatcher {
|
||||
|
||||
assert false;
|
||||
String operatorId = commonRequest.getOperatorId();
|
||||
final PageRequest pageRequest = commonRequest.anyDataType(PageRequest.class);
|
||||
final PageRequest pageRequest = commonRequest.transformDataType(PageRequest.class);
|
||||
List<StationInfo> stations = new ArrayList<>();
|
||||
int pageCount = 1;
|
||||
if (operatorId.equals("765367656")) {
|
||||
|
||||
@ -5,7 +5,7 @@ import com.xhpc.evcs.dto.CommonResponse;
|
||||
import com.xhpc.evcs.dto.NotificationStartStopChargeResultResponse;
|
||||
import com.xhpc.evcs.dto.NotificationStopChargeResultRequestData;
|
||||
import com.xhpc.evcs.encryption.EvcsConst;
|
||||
import com.xhpc.evcs.jpa.ChargeOrderInfoRepository;
|
||||
import com.xhpc.evcs.jpa.XhpcHistoryOrderRepository;
|
||||
import com.xhpc.evcs.utils.JSONUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@ -20,7 +20,7 @@ import java.io.IOException;
|
||||
public class StopChargeResultController extends CoreDispatcher {
|
||||
|
||||
@Autowired
|
||||
private ChargeOrderInfoRepository chargeOrderInfoRepository;
|
||||
private XhpcHistoryOrderRepository xhpcHistoryOrderRepository;
|
||||
|
||||
@PostMapping("/v1/notification_stop_charge_result")
|
||||
public CommonResponse notifyStartChargeResult(@RequestBody CommonRequest<NotificationStopChargeResultRequestData> commonRequest) throws IOException {
|
||||
|
||||
@ -1,16 +1,16 @@
|
||||
package com.xhpc.evcs.cd;
|
||||
|
||||
import com.xhpc.evcs.domain.AuthSecretToken;
|
||||
import com.xhpc.evcs.domain.CDChargeOrderInfo4Bonus;
|
||||
import com.xhpc.evcs.domain.EtOrderMapping;
|
||||
import com.xhpc.evcs.domain.XhpcStatisticsTimeInterval;
|
||||
import com.xhpc.evcs.dto.ChargeOrderInfoResponse;
|
||||
import com.xhpc.evcs.dto.CDChargeOrder4BonusInfoRes;
|
||||
import com.xhpc.evcs.dto.CDChargeOrderInfo4BonusReq;
|
||||
import com.xhpc.evcs.dto.CommonRequest;
|
||||
import com.xhpc.evcs.dto.DTOJsonHelper;
|
||||
import com.xhpc.evcs.jpa.AuthSecretTokenRepository;
|
||||
import com.xhpc.evcs.jpa.ChargeOrderInfoRepository;
|
||||
import com.xhpc.evcs.jpa.EtOrderMappingRepository;
|
||||
import com.xhpc.evcs.jpa.OrderMappingRepository;
|
||||
import com.xhpc.evcs.jpa.StatisticTimeIntervalRepository;
|
||||
import com.xhpc.evcs.jpa.XhpcHistoryOrderRepository;
|
||||
import com.xhpc.evcs.utils.JSONUtil;
|
||||
import com.xhpc.order.domain.XhpcHistoryOrder;
|
||||
import org.slf4j.Logger;
|
||||
@ -30,13 +30,13 @@ import static com.xhpc.evcs.domain.AuthSecretToken.SECRET_TOKEN_TYPE_OUT;
|
||||
public class NotificationChargeOrderInfo4BonusTask extends CDCoreDispatcher {
|
||||
|
||||
@Autowired
|
||||
private ChargeOrderInfoRepository chargeOrderInfoRepository;
|
||||
private XhpcHistoryOrderRepository xhpcHistoryOrderRepository;
|
||||
@Autowired
|
||||
private AuthSecretTokenRepository authSecretTokenRepository;
|
||||
@Autowired
|
||||
private StatisticTimeIntervalRepository statisticTimeIntervalRepository;
|
||||
@Autowired
|
||||
private EtOrderMappingRepository etOrderMappingRepository;
|
||||
private OrderMappingRepository orderMappingRepository;
|
||||
private Logger logger = LoggerFactory.getLogger(NotificationChargeOrderInfo4BonusTask.class);
|
||||
|
||||
@Scheduled(fixedRate = 1000 * 60)
|
||||
@ -48,7 +48,7 @@ public class NotificationChargeOrderInfo4BonusTask extends CDCoreDispatcher {
|
||||
// maybe对接第三方
|
||||
if (authSecretTokenOut != null) {
|
||||
final List<XhpcHistoryOrder> notYetPushOrder =
|
||||
chargeOrderInfoRepository.findByHistoryOrderIdGreaterThanAndStateGreaterThanOrderByHistoryOrderIdAsc(authSecretTokenOut.getLastPushOrder(), 0);
|
||||
xhpcHistoryOrderRepository.findByHistoryOrderIdGreaterThanAndStateGreaterThanOrderByHistoryOrderIdAsc(authSecretTokenOut.getLastPushOrder(), 0);
|
||||
for (XhpcHistoryOrder xhpcHistoryOrder : notYetPushOrder) {
|
||||
List<XhpcStatisticsTimeInterval> statisticTimeIntervalList =
|
||||
statisticTimeIntervalRepository.findByHistoryOrderId(xhpcHistoryOrder.getHistoryOrderId());
|
||||
@ -60,19 +60,20 @@ public class NotificationChargeOrderInfo4BonusTask extends CDCoreDispatcher {
|
||||
|
||||
public void notify(XhpcHistoryOrder xhpcHistoryOrder, AuthSecretToken authSecretTokenOut) throws IOException {
|
||||
|
||||
EtOrderMapping etOrderMapping = saveOrderMapping(xhpcHistoryOrder, etOrderMappingRepository);
|
||||
CDChargeOrderInfo4Bonus cdChargeOrderInfo4Bonus = new CDChargeOrderInfo4Bonus(xhpcHistoryOrder, etOrderMapping);
|
||||
EtOrderMapping etOrderMapping = saveOrderMapping(xhpcHistoryOrder, orderMappingRepository);
|
||||
CDChargeOrderInfo4BonusReq cdChargeOrderInfo4BonusReq = new CDChargeOrderInfo4BonusReq(xhpcHistoryOrder,
|
||||
etOrderMapping);
|
||||
String operatorIdEvcs = xhpcHistoryOrder.getOperatorIdEvcs();
|
||||
operatorIdEvcs = operatorIdEvcs == null ? "MA6DFCTD5" : operatorIdEvcs;
|
||||
String data = JSONUtil.toJSONString(cdChargeOrderInfo4Bonus);
|
||||
String data = JSONUtil.toJSONString(cdChargeOrderInfo4BonusReq);
|
||||
logger.debug(data);
|
||||
CommonRequest<CDChargeOrderInfo4Bonus> commonRequest = new CommonRequest<>();
|
||||
CommonRequest<CDChargeOrderInfo4BonusReq> commonRequest = new CommonRequest<>();
|
||||
commonRequest.setOperatorId(operatorIdEvcs);
|
||||
commonRequest.setData(data);
|
||||
String responseBody = ok(commonRequest, "/notification_charge_order_info_for_bonus", "765367656", operatorIdEvcs);
|
||||
ChargeOrderInfoResponse chargeOrderInfoResponse = DTOJsonHelper.parseResponseData(responseBody,
|
||||
ChargeOrderInfoResponse.class, authSecretTokenOut);
|
||||
if (chargeOrderInfoResponse != null && chargeOrderInfoResponse.getConfirmResult() == 0) {
|
||||
CDChargeOrder4BonusInfoRes cdChargeOrder4BonusInfoRes = DTOJsonHelper.parseResponseData(responseBody,
|
||||
CDChargeOrder4BonusInfoRes.class, authSecretTokenOut);
|
||||
if (cdChargeOrder4BonusInfoRes != null && cdChargeOrder4BonusInfoRes.getConfirmResult() == 0) {
|
||||
authSecretTokenOut.setLastPushOrder(xhpcHistoryOrder.getHistoryOrderId());
|
||||
authSecretTokenRepository.save(authSecretTokenOut);
|
||||
} else {
|
||||
@ -82,15 +83,15 @@ public class NotificationChargeOrderInfo4BonusTask extends CDCoreDispatcher {
|
||||
}
|
||||
|
||||
private EtOrderMapping saveOrderMapping(XhpcHistoryOrder xhpcHistoryOrder,
|
||||
EtOrderMappingRepository etOrderMappingRepository) {
|
||||
OrderMappingRepository orderMappingRepository) {
|
||||
|
||||
String internetSerialNumber = xhpcHistoryOrder.getInternetSerialNumber();
|
||||
String xhOrderNo = xhpcHistoryOrder.getSerialNumber();
|
||||
return saveOrderMapping(xhOrderNo, internetSerialNumber, etOrderMappingRepository);
|
||||
return saveOrderMapping(xhOrderNo, internetSerialNumber, orderMappingRepository);
|
||||
}
|
||||
|
||||
static EtOrderMapping saveOrderMapping(String xhOrderNo, String internetSerialNumber,
|
||||
EtOrderMappingRepository etOrderMappingRepository) {
|
||||
OrderMappingRepository orderMappingRepository) {
|
||||
|
||||
EtOrderMapping om = new EtOrderMapping();
|
||||
om.setXhOrderNo(xhOrderNo);
|
||||
@ -101,12 +102,12 @@ public class NotificationChargeOrderInfo4BonusTask extends CDCoreDispatcher {
|
||||
etOrderMapping.setEvcsOrderNo(internetSerialNumber);
|
||||
} else {
|
||||
Example<EtOrderMapping> example = Example.of(om);
|
||||
etOrderMapping = etOrderMappingRepository.findOne(example).orElse(null);
|
||||
etOrderMapping = orderMappingRepository.findOne(example).orElse(null);
|
||||
if (etOrderMapping == null) {
|
||||
etOrderMapping = new EtOrderMapping();
|
||||
etOrderMapping.setXhOrderNo(xhOrderNo);
|
||||
etOrderMapping.setEvcsOrderNo(transferInternetOrderNo(xhOrderNo));
|
||||
etOrderMapping = etOrderMappingRepository.save(etOrderMapping);
|
||||
etOrderMapping = orderMappingRepository.save(etOrderMapping);
|
||||
}
|
||||
}
|
||||
return etOrderMapping;
|
||||
|
||||
@ -4,10 +4,9 @@ import cn.hutool.core.date.DateField;
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import com.xhpc.common.data.redis.CacheRateModel;
|
||||
import com.xhpc.evcs.domain.AuthSecretToken;
|
||||
import com.xhpc.evcs.domain.CDChargeOrderInfo4Bonus;
|
||||
import com.xhpc.evcs.dto.*;
|
||||
import com.xhpc.evcs.jpa.AuthSecretTokenRepository;
|
||||
import com.xhpc.evcs.jpa.EtOrderMappingRepository;
|
||||
import com.xhpc.evcs.jpa.OrderMappingRepository;
|
||||
import com.xhpc.evcs.jpa.StatisticTimeIntervalRepository;
|
||||
import com.xhpc.evcs.utils.DateUtil;
|
||||
import com.xhpc.evcs.utils.JSONUtil;
|
||||
@ -34,7 +33,7 @@ public class NotificationEquipChargeStatusTask extends CDCoreDispatcher {
|
||||
@Autowired
|
||||
private StatisticTimeIntervalRepository statisticTimeIntervalRepository;
|
||||
@Autowired
|
||||
private EtOrderMappingRepository etOrderMappingRepository;
|
||||
private OrderMappingRepository orderMappingRepository;
|
||||
|
||||
private Logger logger = LoggerFactory.getLogger(NotificationEquipChargeStatusTask.class);
|
||||
|
||||
@ -53,32 +52,32 @@ public class NotificationEquipChargeStatusTask extends CDCoreDispatcher {
|
||||
final String status = cacheGun.get("status").toString();
|
||||
if (isInteger(status)) {
|
||||
final String orderkey = cacheGun.get("orderkey").toString();
|
||||
CDEquipChargeStatusCDInfo equipChargeStatusCD = new CDEquipChargeStatusCDInfo();
|
||||
equipChargeStatusCD.setStartChargeSeq(transferInternetOrderNo(orderkey));
|
||||
equipChargeStatusCD.setStartChargeSeqStat(2);
|
||||
equipChargeStatusCD.setConnectorID(orderkey.substring(6, 22));
|
||||
EquipChargeStatus equipChargeStatus = new EquipChargeStatus();
|
||||
equipChargeStatus.setStartChargeSeq(transferInternetOrderNo(orderkey));
|
||||
equipChargeStatus.setStartChargeSeqStat(2);
|
||||
equipChargeStatus.setConnectorID(orderkey.substring(6, 22));
|
||||
String current = REDIS.getCacheMapValue(gunkey, "current");
|
||||
equipChargeStatusCD.setCurrentA(Integer.parseInt(current == null ? "10" : current, 16) / 100.0);
|
||||
equipChargeStatus.setCurrentA(Integer.parseInt(current == null ? "10" : current, 16) / 100.0);
|
||||
String voltage = REDIS.getCacheMapValue(gunkey, "voltage");
|
||||
equipChargeStatusCD.setVoltageA(Integer.parseInt(voltage == null ? "300" : voltage, 16) / 100.0);
|
||||
equipChargeStatus.setVoltageA(Integer.parseInt(voltage == null ? "300" : voltage, 16) / 100.0);
|
||||
Double soc = REDIS.getCacheMapValue(gunkey, "endSoc");
|
||||
equipChargeStatusCD.setSoc(soc == null ? 0 : soc);
|
||||
equipChargeStatusCD.setStartTime(cacheGun.get("orderstarttime").toString());
|
||||
equipChargeStatusCD.setEndTime(DateUtil.date2String(Calendar.getInstance().getTime(),
|
||||
equipChargeStatus.setSoc(soc == null ? 0 : soc);
|
||||
equipChargeStatus.setStartTime(cacheGun.get("orderstarttime").toString());
|
||||
equipChargeStatus.setEndTime(DateUtil.date2String(Calendar.getInstance().getTime(),
|
||||
DATE_FORMAT_DATE_TIME));
|
||||
equipChargeStatusCD.setChargeModel(3);
|
||||
equipChargeStatusCD.setTotalPower(REDIS.getCacheMapValue(orderkey, "totalPower"));
|
||||
equipChargeStatusCD.setTotalMoney(REDIS.getCacheMapValue(orderkey, "totalMoney"));
|
||||
equipChargeStatus.setChargeModel(3);
|
||||
equipChargeStatus.setTotalPower(REDIS.getCacheMapValue(orderkey, "totalPower"));
|
||||
equipChargeStatus.setTotalMoney(REDIS.getCacheMapValue(orderkey, "totalMoney"));
|
||||
final Long rateModelId = REDIS.getCacheMapValue(gunkey.replace("gun", "pile").substring(0, 19),
|
||||
"rateModelId");
|
||||
final CacheRateModel cacheRateModel = REDIS.getCacheObject("rateModel:" + rateModelId);
|
||||
calculateEm(equipChargeStatusCD, cacheRateModel);
|
||||
notify(equipChargeStatusCD, authSecretTokenOut);
|
||||
calculateEm(equipChargeStatus, cacheRateModel);
|
||||
notify(equipChargeStatus, authSecretTokenOut);
|
||||
String xhOrderNo = orderkey.substring(6);
|
||||
String internetSerialNumber = REDIS.getCacheMapValue(orderkey, "internetSerialNumer"); //todo set it
|
||||
// in redis cache
|
||||
NotificationChargeOrderInfo4BonusTask.saveOrderMapping(xhOrderNo, internetSerialNumber,
|
||||
etOrderMappingRepository);
|
||||
orderMappingRepository);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -90,7 +89,7 @@ public class NotificationEquipChargeStatusTask extends CDCoreDispatcher {
|
||||
return "MA6DFCTD5".concat(DateUtil.getYYYY()).concat(orderKeyOrNo.replace("order:", "").substring(18));
|
||||
}
|
||||
|
||||
private void calculateEm(CDEquipChargeStatusCDInfo equipChargeStatusCD, CacheRateModel cacheRateModel) {
|
||||
private void calculateEm(EquipChargeStatus equipChargeStatusCD, CacheRateModel cacheRateModel) {
|
||||
|
||||
final Date endTime = DateUtil.string2Date(equipChargeStatusCD.getEndTime());
|
||||
final Date startTime = DateUtil.string2Date(equipChargeStatusCD.getStartTime());
|
||||
@ -145,7 +144,7 @@ public class NotificationEquipChargeStatusTask extends CDCoreDispatcher {
|
||||
equipChargeStatusCD.setSeviceMoney(equipChargeStatusCD.getTotalMoney() - firstNElecMoney);
|
||||
}
|
||||
|
||||
private void calculateCD(CDEquipChargeStatusCDInfo equipChargeStatusCD, CacheRateModel cacheRateModel, String rtf,
|
||||
private void calculateCD(EquipChargeStatus equipChargeStatusCD, CacheRateModel cacheRateModel, String rtf,
|
||||
BigDecimal timePeriodRatio, BigDecimal tpPower, ChargeDetails cd) {
|
||||
|
||||
cd.setDetailPower(tpPower.multiply(timePeriodRatio).doubleValue());
|
||||
@ -172,20 +171,20 @@ public class NotificationEquipChargeStatusTask extends CDCoreDispatcher {
|
||||
RoundingMode.HALF_UP).doubleValue());
|
||||
}
|
||||
|
||||
public void notify(CDEquipChargeStatusCDInfo cdEquipChargeStatusCDInfo, AuthSecretToken authSecretTokenOut) throws IOException {
|
||||
public void notify(EquipChargeStatus equipChargeStatus, AuthSecretToken authSecretTokenOut) throws IOException {
|
||||
|
||||
String operatorIdEvcs = "MA6DFCTD5";
|
||||
String data = JSONUtil.toJSONString(cdEquipChargeStatusCDInfo);
|
||||
String data = JSONUtil.toJSONString(equipChargeStatus);
|
||||
logger.debug(data);
|
||||
CommonRequest<CDChargeOrderInfo4Bonus> commonRequest = new CommonRequest<>();
|
||||
CommonRequest<CDChargeOrderInfo4BonusReq> commonRequest = new CommonRequest<>();
|
||||
commonRequest.setOperatorId(operatorIdEvcs);
|
||||
commonRequest.setData(data);
|
||||
String responseBody = ok(commonRequest, "/notification_equip_charge_status", "765367656", operatorIdEvcs);
|
||||
CDEquipmentChargeStatusResponse cdEquipmentChargeStatusResponse = DTOJsonHelper.parseResponseData(responseBody,
|
||||
CDEquipmentChargeStatusResponse.class, authSecretTokenOut);
|
||||
if (cdEquipmentChargeStatusResponse != null && cdEquipmentChargeStatusResponse.getSuccStat() != 0) {
|
||||
EquipChargeStatusRes equipChargeStatusRes = DTOJsonHelper.parseResponseData(responseBody,
|
||||
EquipChargeStatusRes.class, authSecretTokenOut);
|
||||
if (equipChargeStatusRes != null && equipChargeStatusRes.getSuccStat() != 0) {
|
||||
throw new RuntimeException(String.format("push CD equipment order status [%s] failed: %s",
|
||||
cdEquipChargeStatusCDInfo.getStartChargeSeq(), responseBody));
|
||||
equipChargeStatus.getStartChargeSeq(), responseBody));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -2,11 +2,7 @@ package com.xhpc.evcs.cd;
|
||||
|
||||
import com.xhpc.common.api.dto.ChargingStationDto;
|
||||
import com.xhpc.evcs.domain.AuthSecretToken;
|
||||
import com.xhpc.evcs.domain.ConnectorStatusInfo;
|
||||
import com.xhpc.evcs.dto.CDConnectorStatusInfo4BonusRequest;
|
||||
import com.xhpc.evcs.dto.CommonRequest;
|
||||
import com.xhpc.evcs.dto.DTOJsonHelper;
|
||||
import com.xhpc.evcs.dto.Status;
|
||||
import com.xhpc.evcs.dto.*;
|
||||
import com.xhpc.evcs.jpa.AuthSecretTokenRepository;
|
||||
import com.xhpc.evcs.utils.ChangePoleStatus;
|
||||
import com.xhpc.evcs.utils.JSONUtil;
|
||||
@ -84,17 +80,17 @@ public class NotificationStationStatusTask extends CDCoreDispatcher {
|
||||
}
|
||||
}
|
||||
|
||||
public Status notify(ConnectorStatusInfo connectorStatusInfo, AuthSecretToken authSecretTokenOut) throws IOException {
|
||||
public EvcsStatus notify(ConnectorStatusInfo connectorStatusInfo, AuthSecretToken authSecretTokenOut) throws IOException {
|
||||
|
||||
CDConnectorStatusInfo4BonusRequest statusInfo2CDRequest = new CDConnectorStatusInfo4BonusRequest();
|
||||
statusInfo2CDRequest.setConnectorStatusInfo(connectorStatusInfo);
|
||||
String data = JSONUtil.toJSONString(statusInfo2CDRequest);
|
||||
CommonRequest<CDConnectorStatusInfo4BonusRequest> commonRequest = new CommonRequest<>();
|
||||
ConnectorStatusInfoReq connectorStatusInfoReq = new ConnectorStatusInfoReq();
|
||||
connectorStatusInfoReq.setConnectorStatusInfo(connectorStatusInfo);
|
||||
String data = JSONUtil.toJSONString(connectorStatusInfoReq);
|
||||
CommonRequest<ConnectorStatusInfoReq> commonRequest = new CommonRequest<>();
|
||||
commonRequest.setOperatorId(connectorStatusInfo.getOperatorID());
|
||||
commonRequest.setData(data);
|
||||
String responseBody = ok(commonRequest, "/notification_stationStatus", "765367656",
|
||||
connectorStatusInfo.getOperatorID());
|
||||
Status status = DTOJsonHelper.parseResponseData(responseBody, Status.class, authSecretTokenOut);
|
||||
EvcsStatus status = DTOJsonHelper.parseResponseData(responseBody, EvcsStatus.class, authSecretTokenOut);
|
||||
if (status == null || status.getStatus() != 0) {
|
||||
throw new RuntimeException(String.format("push CD notification connector[%s] failed: %s",
|
||||
connectorStatusInfo.getConnectorID(), responseBody));
|
||||
|
||||
@ -16,7 +16,6 @@ import com.xhpc.evcs.encryption.HMAC;
|
||||
import com.xhpc.evcs.http.HttpServletRequestRepeatReadWrapper;
|
||||
import com.xhpc.evcs.http.HttpServletRequestWritableWrapper;
|
||||
import com.xhpc.evcs.jpa.AuthSecretTokenRepository;
|
||||
import com.xhpc.evcs.jpa.OperatorInfoRepository;
|
||||
import com.xhpc.evcs.utils.JSONUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
@ -52,8 +51,6 @@ public class EvcsFilter extends OncePerRequestFilter {
|
||||
|
||||
@Resource
|
||||
private AuthSecretTokenRepository authSecretTokenRepository;
|
||||
@Resource
|
||||
private OperatorInfoRepository operatorInfoRepository;
|
||||
@Value("${xhpc.evcs.encrypt:false}")
|
||||
private boolean encrypt = false;
|
||||
|
||||
|
||||
@ -2,15 +2,12 @@ package com.xhpc.evcs.config;
|
||||
|
||||
import com.xhpc.evcs.dto.CommonRequest;
|
||||
import com.xhpc.evcs.http.HttpServletRequestRepeatReadWrapper;
|
||||
import com.xhpc.evcs.jpa.OperatorInfoRepository;
|
||||
import com.xhpc.evcs.utils.JSONUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.util.ObjectUtils;
|
||||
import org.springframework.web.servlet.HandlerInterceptor;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.persistence.EntityNotFoundException;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.Scanner;
|
||||
@ -19,9 +16,6 @@ import java.util.Scanner;
|
||||
@Slf4j
|
||||
public class EvcsInterceptor implements HandlerInterceptor {
|
||||
|
||||
@Resource
|
||||
OperatorInfoRepository operatorInfoRepository;
|
||||
|
||||
@Override
|
||||
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object o) throws Exception {
|
||||
|
||||
@ -31,9 +25,8 @@ public class EvcsInterceptor implements HandlerInterceptor {
|
||||
if (!ObjectUtils.isEmpty(bodyString)) {
|
||||
CommonRequest commonRequest = JSONUtil.readParams(bodyString, CommonRequest.class);
|
||||
if (commonRequest != null) {
|
||||
// todo 三方对接 查AuthToken表
|
||||
String operatorID = commonRequest.getOperatorId();
|
||||
operatorInfoRepository.findById(operatorID).orElseThrow(() -> new EntityNotFoundException("OperatorInfo" +
|
||||
"::OperatorID[" + operatorID + "] not found."));
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
||||
@ -1,12 +0,0 @@
|
||||
package com.xhpc.evcs.jpa;
|
||||
|
||||
import com.xhpc.evcs.domain.ConnectorStatusInfo;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.repository.query.QueryByExampleExecutor;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
@Repository
|
||||
public interface ConnectorStatusInfoRepository extends JpaRepository<ConnectorStatusInfo, String>,
|
||||
QueryByExampleExecutor<ConnectorStatusInfo> {
|
||||
|
||||
}
|
||||
@ -1,19 +0,0 @@
|
||||
package com.xhpc.evcs.jpa;
|
||||
|
||||
import com.xhpc.evcs.domain.OperatorInfo;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
||||
import org.springframework.data.repository.query.QueryByExampleExecutor;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Repository
|
||||
public interface OperatorInfoRepository extends JpaRepository<OperatorInfo, String>, QueryByExampleExecutor<OperatorInfo>,
|
||||
JpaSpecificationExecutor<OperatorInfo> {
|
||||
|
||||
List<OperatorInfo> findByOperatorRegAddressLike(String host);
|
||||
|
||||
List<OperatorInfo> findByOperatorId(String operatorId);
|
||||
|
||||
}
|
||||
@ -7,7 +7,7 @@ import org.springframework.data.repository.query.QueryByExampleExecutor;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
@Repository
|
||||
public interface EtOrderMappingRepository extends JpaRepository<EtOrderMapping, String>,
|
||||
public interface OrderMappingRepository extends JpaRepository<EtOrderMapping, String>,
|
||||
QueryByExampleExecutor<EtOrderMapping>, JpaSpecificationExecutor<EtOrderMapping> {
|
||||
|
||||
|
||||
@ -9,7 +9,7 @@ import org.springframework.stereotype.Repository;
|
||||
import java.util.List;
|
||||
|
||||
@Repository
|
||||
public interface ChargeOrderInfoRepository extends JpaRepository<XhpcHistoryOrder, String>,
|
||||
public interface XhpcHistoryOrderRepository extends JpaRepository<XhpcHistoryOrder, String>,
|
||||
QueryByExampleExecutor<XhpcHistoryOrder>, JpaSpecificationExecutor<XhpcHistoryOrder> {
|
||||
|
||||
List<XhpcHistoryOrder> findByHistoryOrderIdGreaterThanAndStateGreaterThanOrderByHistoryOrderIdAsc(Long hisOrderId, int i);
|
||||
@ -1,6 +1,6 @@
|
||||
package com.xhpc.evcs.utils;
|
||||
|
||||
import com.xhpc.evcs.domain.ConnectorStatusInfo;
|
||||
import com.xhpc.evcs.dto.ConnectorStatusInfo;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
package com.xhpc.evcs;
|
||||
|
||||
import com.xhpc.evcs.domain.EtOrderMapping;
|
||||
import com.xhpc.evcs.jpa.EtOrderMappingRepository;
|
||||
import com.xhpc.evcs.jpa.OrderMappingRepository;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.test.annotation.Rollback;
|
||||
@ -12,7 +12,7 @@ import javax.annotation.Resource;
|
||||
public class OrderMappingTest {
|
||||
|
||||
@Resource
|
||||
private EtOrderMappingRepository etOrderMappingRepository;
|
||||
private OrderMappingRepository orderMappingRepository;
|
||||
|
||||
@Test
|
||||
@Rollback(false)
|
||||
@ -21,7 +21,7 @@ public class OrderMappingTest {
|
||||
EtOrderMapping o = new EtOrderMapping();
|
||||
o.setXhOrderNo("123");
|
||||
o.setEvcsOrderNo("123");
|
||||
etOrderMappingRepository.save(o);
|
||||
orderMappingRepository.save(o);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user