修改异常订单
This commit is contained in:
parent
c884e6821a
commit
b5492374fc
@ -0,0 +1,115 @@
|
||||
package com.xhpc.evcs.cdjgpc.domain;
|
||||
|
||||
import com.xhpc.common.core.web.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.persistence.*;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 充电订单
|
||||
*
|
||||
* @author yuyang
|
||||
* @Date 2024-08-16 14:07
|
||||
*/
|
||||
@Table(name = "xhpc_charge_order")
|
||||
@Entity
|
||||
@Data
|
||||
public class XhpcChargeOrder extends BaseEntity {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Column(name = "charge_order_id", nullable = false)
|
||||
private Long id;
|
||||
|
||||
@Column(name = "charging_station_id")
|
||||
private Long chargingStationId;
|
||||
|
||||
@Column(name = "user_id")
|
||||
private Long userId;
|
||||
|
||||
@Column(name = "terminal_id")
|
||||
private Long terminalId;
|
||||
|
||||
@Column(name = "internet_serial_number", length = 50)
|
||||
private String internetSerialNumber;
|
||||
|
||||
@Column(name = "serial_number", length = 50)
|
||||
private String serialNumber;
|
||||
|
||||
@Column(name = "start_soc", length = 50)
|
||||
private String startSoc;
|
||||
|
||||
@Column(name = "end_soc", length = 50)
|
||||
private String endSoc;
|
||||
|
||||
@Column(name = "source")
|
||||
private Integer source;
|
||||
|
||||
@Column(name = "status")
|
||||
private Integer status;
|
||||
|
||||
@Column(name = "del_flag")
|
||||
private Integer delFlag;
|
||||
|
||||
@Column(name = "rate_model_id")
|
||||
private Long rateModelId;
|
||||
|
||||
@Column(name = "charging_mode", length = 50)
|
||||
private String chargingMode;
|
||||
|
||||
@Column(name = "start_time")
|
||||
private Date startTime;
|
||||
|
||||
@Column(name = "end_time")
|
||||
private Date endTime;
|
||||
|
||||
@Column(name = "charging_time", length = 50)
|
||||
private String chargingTime;
|
||||
|
||||
@Column(name = "charging_degree")
|
||||
private BigDecimal chargingDegree;
|
||||
|
||||
@Column(name = "type", length = 50)
|
||||
private String type;
|
||||
|
||||
@Column(name = "erro_remark", length = 50)
|
||||
private String erroRemark;
|
||||
|
||||
@Column(name = "amount_charged")
|
||||
private BigDecimal amountCharged;
|
||||
|
||||
@Column(name = "power", length = 50)
|
||||
private String power;
|
||||
|
||||
@Column(name = "charging_time_number")
|
||||
private Long chargingTimeNumber;
|
||||
|
||||
@Column(name = "driver_id", length = 50)
|
||||
private String driverId;
|
||||
|
||||
@Column(name = "charging_amt")
|
||||
private Long chargingAmt;
|
||||
|
||||
@Column(name = "Plate_num", length = 50)
|
||||
private String plateNum;
|
||||
|
||||
@Column(name = "evcs_order_no", length = 50)
|
||||
private String evcsOrderNo;
|
||||
|
||||
@Column(name = "tenant_id", length = 50)
|
||||
private String tenantId;
|
||||
|
||||
@Column(name = "vin_normal", length = 50)
|
||||
private String vinNormal;
|
||||
|
||||
@Column(name = "station_total_warning_num")
|
||||
private Integer stationTotalWarningNum;
|
||||
|
||||
@Column(name = "charging_capacity")
|
||||
private Integer chargingCapacity;
|
||||
|
||||
@Column(name = "suncha_status")
|
||||
private Integer sunchaStatus;
|
||||
|
||||
}
|
||||
@ -54,8 +54,26 @@ public class CDConnectorInfo {
|
||||
@Column(columnDefinition = "Decimal(10,1)")
|
||||
@JsonProperty("Power")
|
||||
public Double power;
|
||||
|
||||
// @Column(columnDefinition = "Decimal(10,1)")
|
||||
// @JsonProperty("ConstantVoltageUpperLimits")
|
||||
// public Double constantVoltageUpperLimits;
|
||||
//
|
||||
// @Column(columnDefinition = "Decimal(10,1)")
|
||||
// @JsonProperty("ConstantVoltageLowerLimits")
|
||||
// public Double constantVoltageLowerLimits;
|
||||
//
|
||||
// @Column(columnDefinition = "Decimal(10,1)")
|
||||
// @JsonProperty("ConstantCurrentUpperLimits")
|
||||
// public Double constantCurrentUpperLimits;
|
||||
//
|
||||
// @Column(columnDefinition = "Decimal(10,1)")
|
||||
// @JsonProperty("ConstantCurrentLowerLimits")
|
||||
// public Double constantCurrentLowerLimits;
|
||||
|
||||
// @JsonProperty("ParkNo")
|
||||
// public String ParkNo;
|
||||
|
||||
@JsonProperty("NationalStandard")
|
||||
public Integer nationalStandard;
|
||||
/**
|
||||
@ -77,5 +95,6 @@ public class CDConnectorInfo {
|
||||
@JsonProperty("OpreateStatus")
|
||||
public Integer opreateStatus;
|
||||
|
||||
|
||||
// @JsonProperty("OperateHours")
|
||||
// public String operateHours;
|
||||
}
|
||||
|
||||
@ -60,8 +60,22 @@ public class CDConnectorStatusInfo {
|
||||
*/
|
||||
@JsonProperty("Status")
|
||||
public Integer status;
|
||||
|
||||
|
||||
|
||||
|
||||
//
|
||||
// /**
|
||||
// * 接口状态描述
|
||||
// */
|
||||
// @JsonProperty("StatusDesc")
|
||||
// public String statusDesc;
|
||||
//
|
||||
// /**
|
||||
// * 车位状态
|
||||
// */
|
||||
// @JsonProperty("ParkStatus")
|
||||
// public Integer parkStatus;
|
||||
//
|
||||
// /**
|
||||
// * 地锁状态
|
||||
// */
|
||||
// @JsonProperty("LockStatus")
|
||||
// public Integer lockStatus;
|
||||
}
|
||||
|
||||
@ -6,6 +6,7 @@ import com.xhpc.evcs.dto.EquipmentInfo;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Transient;
|
||||
import java.util.List;
|
||||
|
||||
@ -103,6 +104,7 @@ public class CDEquipmentInfo {
|
||||
* 额定功率
|
||||
*/
|
||||
@JsonProperty("EquipmentPower")
|
||||
@Column(columnDefinition = "Decimal(10,1)")
|
||||
public Double equipmentPower;
|
||||
/**
|
||||
* 新国标
|
||||
@ -134,4 +136,10 @@ public class CDEquipmentInfo {
|
||||
*/
|
||||
@JsonProperty("EquipmentClassificatlon")
|
||||
public Integer equipmentClassificatlon;
|
||||
// /**
|
||||
// * 是否支持 V2G
|
||||
// */
|
||||
// @JsonProperty("V2GSupport")
|
||||
// public Integer v2GSupport;
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,93 @@
|
||||
package com.xhpc.evcs.cdjgpc.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.persistence.Column;
|
||||
/**
|
||||
* V2G 实时负荷(1min 时点负荷值)
|
||||
*/
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
@JsonPropertyOrder({
|
||||
"StationID",
|
||||
"OperatorID",
|
||||
"EquipmentOwnerID",
|
||||
"EquipmentID",
|
||||
"ChargeStatus",
|
||||
"TsMin",
|
||||
"TsHour",
|
||||
"TsDay",
|
||||
"TsMonth",
|
||||
"AnalysisReport"
|
||||
})
|
||||
@Data
|
||||
public class CDEquipmentV2GPowerInfo {
|
||||
/**
|
||||
* 充电桩ID
|
||||
*/
|
||||
@JsonProperty("StationID")
|
||||
public String stationID;
|
||||
/**
|
||||
* 运营平台 ID
|
||||
*/
|
||||
@JsonProperty("OperatorID")
|
||||
public String operatorID;
|
||||
/**
|
||||
* 产权所属单位 ID
|
||||
*/
|
||||
@JsonProperty("EquipmentOwnerID")
|
||||
public String equipmentOwnerID;
|
||||
/**
|
||||
* 设备编码
|
||||
*/
|
||||
@JsonProperty("EquipmentID")
|
||||
public String equipmentID;
|
||||
/**
|
||||
* 充放电状态(1.充电 2放电)
|
||||
*/
|
||||
@JsonProperty("ChargeStatus")
|
||||
public Integer chargeStatus;
|
||||
/**
|
||||
* 设备实时负荷值
|
||||
*/
|
||||
@JsonProperty("Power")
|
||||
@Column(columnDefinition = "Decimal(10,2)")
|
||||
public Double power;
|
||||
/**
|
||||
* 时间点 1 分钟一个刻度 yyyymmddhhmm
|
||||
*/
|
||||
@JsonProperty("TsMin")
|
||||
public String tsMin;
|
||||
/**
|
||||
* 时 yyyymmddhh
|
||||
*/
|
||||
@JsonProperty("TsHour")
|
||||
public String tsHour;
|
||||
/**
|
||||
* 日 yyyymmdd
|
||||
*/
|
||||
@JsonProperty("TsDay")
|
||||
public String tsDay;
|
||||
/**
|
||||
* 月 yyyymm
|
||||
*/
|
||||
@JsonProperty("TsMonth")
|
||||
public String tsMonth;
|
||||
/**
|
||||
* 年 yyyy
|
||||
*/
|
||||
@JsonProperty("TsYear")
|
||||
public String tsYear;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -121,6 +121,35 @@ public class CDOrderInfo {
|
||||
@JsonProperty("Elect")
|
||||
@Column(columnDefinition = "Decimal(10,2)")
|
||||
public Double elect;
|
||||
|
||||
// /**
|
||||
// * 尖阶段电量
|
||||
// */
|
||||
// @JsonProperty("CuspElect")
|
||||
// @Column(columnDefinition = "Decimal(10,4)")
|
||||
// public Double cuspElect;
|
||||
//
|
||||
// /**
|
||||
// * 峰阶段电量
|
||||
// */
|
||||
// @JsonProperty("PeakElect")
|
||||
// @Column(columnDefinition = "Decimal(10,4)")
|
||||
// public Double peakElect;
|
||||
//
|
||||
// /**
|
||||
// * 平阶段电量
|
||||
// */
|
||||
// @JsonProperty("FlatElect")
|
||||
// @Column(columnDefinition = "Decimal(10,4)")
|
||||
// public Double flatElect;
|
||||
//
|
||||
// /**
|
||||
// * 谷阶段电量
|
||||
// */
|
||||
// @JsonProperty("ValleyElect")
|
||||
// @Column(columnDefinition = "Decimal(10,4)")
|
||||
// public Double valleyElect;
|
||||
|
||||
/**
|
||||
* 本次充电开始时间
|
||||
*/
|
||||
|
||||
@ -0,0 +1,61 @@
|
||||
package com.xhpc.evcs.cdjgpc.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 调控需求(RequirementInfo)
|
||||
*/
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
@JsonPropertyOrder({
|
||||
"Name",
|
||||
"Area",
|
||||
"Code",
|
||||
"list",
|
||||
"requireDate",
|
||||
"releaseTime",
|
||||
"releaseTime"
|
||||
})
|
||||
@Data
|
||||
public class CDRequirementInfo {
|
||||
/**
|
||||
* 需求名称
|
||||
*/
|
||||
@JsonProperty("Name")
|
||||
public String name;
|
||||
/**
|
||||
* 需求地区
|
||||
*/
|
||||
@JsonProperty("Area")
|
||||
public String area;
|
||||
/**
|
||||
* 需求编号
|
||||
*/
|
||||
@JsonProperty("Code")
|
||||
public String code;
|
||||
/**
|
||||
* 时段责任量 List
|
||||
*/
|
||||
@JsonProperty("list")
|
||||
public List<CDRequirementInfoList> list;
|
||||
/**
|
||||
* 需求日期
|
||||
*/
|
||||
@JsonProperty("RequireDate")
|
||||
public String requireDate;
|
||||
/**
|
||||
* 发布时间
|
||||
*/
|
||||
@JsonProperty("ReleaseTime")
|
||||
public String releaseTime;
|
||||
/**
|
||||
* 下发时间
|
||||
*/
|
||||
@JsonProperty("DeliveryTime")
|
||||
public String deliveryTime;
|
||||
|
||||
}
|
||||
@ -0,0 +1,33 @@
|
||||
package com.xhpc.evcs.cdjgpc.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 调控需求
|
||||
* @author yuyang
|
||||
* @Date 2024-08-20 10:14
|
||||
*/
|
||||
@Data
|
||||
public class CDRequirementInfoList {
|
||||
|
||||
/**
|
||||
* 开始时段
|
||||
*/
|
||||
@JsonProperty("StartTime")
|
||||
public String startTime;
|
||||
|
||||
/**
|
||||
* 结束时段
|
||||
*/
|
||||
@JsonProperty("EndTime")
|
||||
public String endTime;
|
||||
|
||||
/**
|
||||
* 需求时段响
|
||||
* 应量
|
||||
*/
|
||||
@JsonProperty("Res")
|
||||
public String res;
|
||||
|
||||
}
|
||||
@ -405,4 +405,56 @@ public class CDStationInfo extends CommonStationInfo {
|
||||
@Transient
|
||||
@JsonProperty("SwapEquipmentlnfos")
|
||||
public List<CDSwapEquipmentlnfos> swapEquipmentlnfos = null;
|
||||
|
||||
// /**
|
||||
// * 是否支持远程调控
|
||||
// */
|
||||
// @Transient
|
||||
// @JsonProperty("SupportOrder2")
|
||||
// public Integer supportOrder2;
|
||||
//
|
||||
// /**
|
||||
// * 变压器装机容量
|
||||
// */
|
||||
// @Transient
|
||||
// @JsonProperty("InstalledCapacity")
|
||||
// @Column(columnDefinition = "Decimal(10,1)")
|
||||
// public Double installedCapacity;
|
||||
//
|
||||
// /**
|
||||
// * 备用容量
|
||||
// */
|
||||
// @Transient
|
||||
// @JsonProperty("ReserveCapacity")
|
||||
// @Column(columnDefinition = "Decimal(10,1)")
|
||||
// public Double reserveCapacity;
|
||||
//
|
||||
// /**
|
||||
// * 可响应时段
|
||||
// */
|
||||
// @Transient
|
||||
// @JsonProperty("ResponsablePeriod")
|
||||
// public String responsablePeriod;
|
||||
//
|
||||
// /**
|
||||
// * 响应速率(min)
|
||||
// */
|
||||
// @Transient
|
||||
// @JsonProperty("ResponseRate")
|
||||
// public String responseRate;
|
||||
//
|
||||
// /**
|
||||
// * 当年最大可调能力
|
||||
// */
|
||||
// @Transient
|
||||
// @Column(columnDefinition = "Decimal(10,1)")
|
||||
// public String maxAdjustableCapacity;
|
||||
//
|
||||
// /**
|
||||
// * 可调节时长
|
||||
// */
|
||||
// @Transient
|
||||
// @JsonProperty("AdjustTime")
|
||||
// public Integer adjustTime;
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,85 @@
|
||||
package com.xhpc.evcs.cdjgpc.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.persistence.Column;
|
||||
|
||||
/**
|
||||
* 充电站实时负荷(1min 时点负荷值)
|
||||
*/
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
@JsonPropertyOrder({
|
||||
"StationID",
|
||||
"OperatorID",
|
||||
"EquipmentOwnerID",
|
||||
"EleNo",
|
||||
"Power",
|
||||
"TsMin",
|
||||
"TsHour",
|
||||
"TsDay",
|
||||
"TsMonth",
|
||||
"AnalysisReport"
|
||||
})
|
||||
@Data
|
||||
public class CDStationPowerlnfo {
|
||||
|
||||
/**
|
||||
* 充电桩ID
|
||||
*/
|
||||
@JsonProperty("StationID")
|
||||
public String stationID;
|
||||
/**
|
||||
* 运营平台 ID
|
||||
*/
|
||||
@JsonProperty("OperatorID")
|
||||
public String operatorID;
|
||||
/**
|
||||
* 产权所属单位 ID
|
||||
*/
|
||||
@JsonProperty("EquipmentOwnerID")
|
||||
public String equipmentOwnerID;
|
||||
/**
|
||||
* 户号编号
|
||||
*/
|
||||
@JsonProperty("EleNo")
|
||||
//@Column(columnDefinition = "Decimal(10,2)")
|
||||
public String eleNo;
|
||||
/**
|
||||
* 站点实时负荷值
|
||||
*/
|
||||
@JsonProperty("Power")
|
||||
@Column(columnDefinition = "Decimal(10,2)")
|
||||
public Double power;
|
||||
/**
|
||||
* 时间点 1 分钟一个刻度 yyyymmddhhmm
|
||||
*/
|
||||
@JsonProperty("TsMin")
|
||||
public String tsMin;
|
||||
/**
|
||||
* 时 yyyymmddhh
|
||||
*/
|
||||
@JsonProperty("TsHour")
|
||||
public String tsHour;
|
||||
/**
|
||||
* 日 yyyymmdd
|
||||
*/
|
||||
@JsonProperty("TsDay")
|
||||
public String tsDay;
|
||||
/**
|
||||
* 月 yyyymm
|
||||
*/
|
||||
@JsonProperty("TsMonth")
|
||||
public String tsMonth;
|
||||
/**
|
||||
* 年 yyyy
|
||||
*/
|
||||
@JsonProperty("TsYear")
|
||||
public String tsYear;
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,78 @@
|
||||
package com.xhpc.evcs.cdjgpc.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import com.xhpc.evcs.cdjgpc.dto.CDRequirementInfoList;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 调控任务
|
||||
*
|
||||
* @author yuyang
|
||||
* @Date 2024-08-16 10:59
|
||||
*/
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
@JsonPropertyOrder({
|
||||
"TaskName",
|
||||
"TaskCode",
|
||||
"DemandDate",
|
||||
"StationID",
|
||||
"OperatorID",
|
||||
"EquipmentOwnerID",
|
||||
"EleNo",
|
||||
"List",
|
||||
"DeliveryTime"
|
||||
})
|
||||
@Data
|
||||
public class CDTaskInfo {
|
||||
/**
|
||||
* 任务名称
|
||||
*/
|
||||
@JsonProperty("TaskName")
|
||||
public String taskName;
|
||||
/**
|
||||
* 任务编码
|
||||
*/
|
||||
@JsonProperty("TaskCode")
|
||||
public String taskCode;
|
||||
/**
|
||||
* 响应日期 yyyy-MM-dd
|
||||
*/
|
||||
@JsonProperty("DemandDate")
|
||||
public String demandDate;
|
||||
|
||||
/**
|
||||
* 充电桩ID
|
||||
*/
|
||||
@JsonProperty("StationID")
|
||||
public String stationID;
|
||||
/**
|
||||
* 运营平台 ID
|
||||
*/
|
||||
@JsonProperty("OperatorID")
|
||||
public String operatorID;
|
||||
/**
|
||||
* 产权所属单位 ID
|
||||
*/
|
||||
@JsonProperty("EquipmentOwnerID")
|
||||
public String equipmentOwnerID;
|
||||
/**
|
||||
* 所属户号
|
||||
*/
|
||||
@JsonProperty("EleNo")
|
||||
public String eleNo;
|
||||
/**
|
||||
* 时段责任量 List
|
||||
*/
|
||||
@JsonProperty("List")
|
||||
public List<CDRequirementInfoList> list;
|
||||
/**
|
||||
* 下发时间
|
||||
*/
|
||||
@JsonProperty("DeliveryTime")
|
||||
public String deliveryTime;
|
||||
|
||||
}
|
||||
@ -43,6 +43,8 @@ public class AuthSecretToken {
|
||||
|
||||
private Long lastPushOrder;
|
||||
|
||||
private Integer status;
|
||||
|
||||
public AuthSecretToken() {
|
||||
|
||||
}
|
||||
@ -63,6 +65,14 @@ public class AuthSecretToken {
|
||||
this.lastPushOrder = lastPushOrder;
|
||||
}
|
||||
|
||||
public Integer getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(Integer status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "AuthSecretToken{" +
|
||||
@ -79,6 +89,7 @@ public class AuthSecretToken {
|
||||
", tokenExpiry=" + tokenExpiry +
|
||||
", encrypt=" + encrypt +
|
||||
", lastPushOrder=" + lastPushOrder +
|
||||
", status=" + status +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
|
||||
@ -29,6 +29,7 @@ import java.util.Map;
|
||||
"BusineHours",
|
||||
"ElectricityFee",
|
||||
"ServiceFee",
|
||||
"ParkFee",
|
||||
"Payment",
|
||||
"SupportOrder",
|
||||
"EquipmentInfos"
|
||||
@ -76,6 +77,9 @@ public class StationInfo extends CommonStationInfo {
|
||||
@JsonProperty("ServiceFee")
|
||||
public String serviceFee;
|
||||
@Transient
|
||||
@JsonProperty("ParkFee")
|
||||
public String parkFee;
|
||||
@Transient
|
||||
@JsonProperty("Payment")
|
||||
public String payment;
|
||||
@Transient
|
||||
@ -102,10 +106,24 @@ public class StationInfo extends CommonStationInfo {
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
|
||||
return new ToStringBuilder(this).append("stationID", getStationId()).append("operatorID", getOperatorId()).append(
|
||||
"equipmentOwnerID", getEquipmentOwnerId()).append("stationName", getStationName()).append("countryCode",
|
||||
getCountryCode()).append("areaCode", areaCode).append("address", address).append("serviceTel", serviceTel).append("stationType", stationType).append("stationStatus", stationStatus).append("parkNums", parkNums).append("stationLng", stationLng).append("stationLat", stationLat).append("construction", construction).append("busineHours", busineHours).append("electricityFee", electricityFee).append("serviceFee", serviceFee).append("payment", payment).append("supportOrder", supportOrder).append("equipmentInfos", equipmentInfos).append("additionalProperties", additionalProperties).toString();
|
||||
return "StationInfo{" +
|
||||
"areaCode='" + areaCode + '\'' +
|
||||
", address='" + address + '\'' +
|
||||
", serviceTel='" + serviceTel + '\'' +
|
||||
", stationType=" + stationType +
|
||||
", stationStatus=" + stationStatus +
|
||||
", parkNums=" + parkNums +
|
||||
", stationLng=" + stationLng +
|
||||
", stationLat=" + stationLat +
|
||||
", construction=" + construction +
|
||||
", busineHours='" + busineHours + '\'' +
|
||||
", electricityFee='" + electricityFee + '\'' +
|
||||
", serviceFee='" + serviceFee + '\'' +
|
||||
", parkFee='" + parkFee + '\'' +
|
||||
", payment='" + payment + '\'' +
|
||||
", supportOrder=" + supportOrder +
|
||||
", equipmentInfos=" + equipmentInfos +
|
||||
", additionalProperties=" + additionalProperties +
|
||||
'}';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -69,9 +69,7 @@ public class Aes128Cbc {
|
||||
NoSuchAlgorithmException, IllegalBlockSizeException, UnsupportedEncodingException, NoSuchPaddingException,
|
||||
InvalidKeyException {
|
||||
|
||||
System.out.println(decryptString("vTGCo/ntYzY9ZLHnATipTR1WHP4hHjsB5byV2g62bxbNVQkGba8+u07Dv95vihuO+zYV" +
|
||||
"/+9qwTUaSvFGUm0M1T9VMThVlsarbCMsBCgC2KE=",
|
||||
"ojs67l46z3f7rhok", "tet9swfkyojkhaos"
|
||||
System.out.println(decryptString("8LpncubmWiPCzY3V","8LpncubmWiPCzY3V", "av6A8QdnRaVRMXu6"
|
||||
));
|
||||
//ujNoGsWRo5MyPKYOxeofKwgPEng3xF+yhM8DDjwtwHo=
|
||||
System.out.println(encrypt("{\"StationIDs\":[\"1\"]}", "8LpncubmWiPCzY3V", "av6A8QdnRaVRMXu6"));
|
||||
|
||||
@ -155,6 +155,7 @@ public class QueryStationsInfoController {
|
||||
chargingStationDto.setServiceTel(xhpcChargingStation.getServiceTel());
|
||||
//车位数量
|
||||
chargingStationDto.setParkNums(xhpcChargingStation.getParkNums());
|
||||
chargingStationDto.setParkFee(xhpcChargingStation.getParkingInstructions());
|
||||
REDIS.setCacheObject(stationKey, chargingStationDto);
|
||||
}
|
||||
}
|
||||
@ -170,6 +171,7 @@ public class QueryStationsInfoController {
|
||||
stationInfo.setStationLng(chargingStationDto.getLng());
|
||||
stationInfo.setStationLat(chargingStationDto.getLat());
|
||||
stationInfo.setConstruction(chargingStationDto.getConstruction());
|
||||
stationInfo.setParkFee(chargingStationDto.getParkFee());
|
||||
String[] fees = getFees(chargingStationDto.getRateModelId());
|
||||
if (fees != null) {
|
||||
stationInfo.setElectricityFee(fees[0]);
|
||||
|
||||
@ -68,7 +68,7 @@ public class QueryTokenController {
|
||||
if (xhpcInternetUser != null) {
|
||||
String operatorSecret = tokenRequest.getOperatorSecret();
|
||||
AuthSecretToken authSecretTokenIn =
|
||||
authSecretTokenRepository.findByOperatorId3irdptyAndSecretTokenTypeAndOperatorSecret(
|
||||
authSecretTokenRepository.findByStatusAndOperatorId3irdptyAndSecretTokenTypeAndOperatorSecret(1,
|
||||
operatorID, AuthSecretToken.SECRET_TOKEN_TYPE_IN, operatorSecret).orElse(null);
|
||||
if (authSecretTokenIn == null) {
|
||||
resp.setRet("4003");
|
||||
@ -139,7 +139,7 @@ public class QueryTokenController {
|
||||
if (xhpcInternetUser != null) {
|
||||
String operatorSecret = tokenRequest.getOperatorSecret();
|
||||
AuthSecretToken authSecretTokenIn =
|
||||
authSecretTokenRepository.findByOperatorId3irdptyAndSecretTokenTypeAndOperatorSecret(
|
||||
authSecretTokenRepository.findByStatusAndOperatorId3irdptyAndSecretTokenTypeAndOperatorSecret(2,
|
||||
operatorID, AuthSecretToken.SECRET_TOKEN_TYPE_IN, operatorSecret).orElse(null);
|
||||
if (authSecretTokenIn == null) {
|
||||
resp.setRet("4003");
|
||||
@ -195,7 +195,7 @@ public class QueryTokenController {
|
||||
if (xhpcInternetUser != null) {
|
||||
String operatorSecret = tokenRequest.getOperatorSecret();
|
||||
AuthSecretToken authSecretTokenIn =
|
||||
authSecretTokenRepository.findByOperatorId3irdptyAndSecretTokenTypeAndOperatorSecret(
|
||||
authSecretTokenRepository.findByStatusAndOperatorId3irdptyAndSecretTokenTypeAndOperatorSecret(3,
|
||||
operatorID, AuthSecretToken.SECRET_TOKEN_TYPE_IN, operatorSecret).orElse(null);
|
||||
if (authSecretTokenIn == null) {
|
||||
resp.setRet("4003");
|
||||
@ -227,4 +227,5 @@ public class QueryTokenController {
|
||||
}
|
||||
return resp;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -0,0 +1,25 @@
|
||||
package com.xhpc.evcs.cdjgpc.jpa;
|
||||
|
||||
import com.xhpc.evcs.cdjgpc.domain.XhpcChargeOrder;
|
||||
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;
|
||||
|
||||
/**
|
||||
* 充电站实时负荷
|
||||
*
|
||||
* @author yuyang
|
||||
* @Date 2024-08-16 14:04
|
||||
*/
|
||||
@Repository
|
||||
public interface XhpcChargeOrderRepository extends JpaRepository<XhpcChargeOrder, String>,
|
||||
QueryByExampleExecutor<XhpcChargeOrder>, JpaSpecificationExecutor<XhpcChargeOrder> {
|
||||
|
||||
|
||||
//查询充电中的数据
|
||||
List<XhpcChargeOrder> findByStatusAndDelFlagAndChargingStationIdOrderByChargingStationId(Integer status,Integer delflag,Long chargingStationId);
|
||||
|
||||
}
|
||||
@ -39,6 +39,7 @@ public class CDConnectorChargeStatusInfoTask extends CoreDispatcher {
|
||||
private XhpcStationInternetBlacklistRepository xhpcStationInternetBlacklistRepo;
|
||||
private final Logger logger = LoggerFactory.getLogger(CDConnectorChargeStatusInfoTask.class);
|
||||
|
||||
//9099开放定时任务 9009不开放
|
||||
/**
|
||||
* 设备充电中状态变化推送(我们平台推送成都市平台) --已推送
|
||||
* 实时数据没40秒
|
||||
|
||||
@ -29,7 +29,7 @@ import static com.xhpc.common.data.redis.StaticBeanUtil.REDIS;
|
||||
import static com.xhpc.evcs.domain.AuthSecretToken.SECRET_TOKEN_TYPE_OUT;
|
||||
|
||||
/**
|
||||
*
|
||||
* 推送充电订单信息
|
||||
* @author yuyang
|
||||
* @date 2023-09-24 19:27
|
||||
*/
|
||||
@ -42,7 +42,7 @@ public class CDNotificationChargeOrderInfoTask extends CoreDispatcher {
|
||||
|
||||
private final Logger logger = LoggerFactory.getLogger(NotificationChargeOrderInfoTask.class);
|
||||
|
||||
//现阶段不开放
|
||||
//9099开放定时任务 9009不开放
|
||||
//@Scheduled(fixedRate = 1000 * 15)
|
||||
public void run() throws JsonProcessingException {
|
||||
|
||||
|
||||
@ -0,0 +1,108 @@
|
||||
package com.xhpc.evcs.cdjgpc.notification;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.xhpc.common.data.redis.CacheBmsReqChargerOutputData;
|
||||
import com.xhpc.evcs.cdjgpc.dto.CDStationInfo;
|
||||
import com.xhpc.evcs.domain.AuthSecretToken;
|
||||
import com.xhpc.evcs.domain.XhpcStationInternetBlacklist;
|
||||
import com.xhpc.evcs.dto.CommonRequest;
|
||||
import com.xhpc.evcs.jpa.AuthSecretTokenRepository;
|
||||
import com.xhpc.evcs.jpa.XhpcStationInternetBlacklistRepository;
|
||||
import com.xhpc.evcs.notification.CoreDispatcher;
|
||||
import com.xhpc.evcs.cdjgpc.domain.XhpcChargeOrder;
|
||||
import com.xhpc.evcs.cdjgpc.dto.CDEquipmentV2GPowerInfo;
|
||||
import com.xhpc.evcs.cdjgpc.jpa.XhpcChargeOrderRepository;
|
||||
import com.xhpc.evcs.utils.JSONUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.io.IOException;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
|
||||
import static com.xhpc.common.data.redis.StaticBeanUtil.REDIS;
|
||||
import static com.xhpc.evcs.domain.AuthSecretToken.SECRET_TOKEN_TYPE_OUT;
|
||||
|
||||
/**
|
||||
* V2G 实时负荷信息推送
|
||||
* @author yuyang
|
||||
* @Date 2024-08-20 9:19
|
||||
*/
|
||||
@Component
|
||||
@Slf4j
|
||||
public class CDNotificationEquipmentV2GPowerInfoTask extends CoreDispatcher {
|
||||
|
||||
@Resource
|
||||
AuthSecretTokenRepository authSecretTokenRepository;
|
||||
@Resource
|
||||
XhpcChargeOrderRepository xhpcChargeOrderRepository;
|
||||
@Resource
|
||||
private XhpcStationInternetBlacklistRepository xhpcStationInternetBlacklistRepo;
|
||||
|
||||
private final Logger logger = LoggerFactory.getLogger(CDNotificationEquipmentV2GPowerInfoTask.class);
|
||||
|
||||
//9099开放定时任务 9009不开放
|
||||
//@Scheduled(cron = "0 0/1 * * * ? ")
|
||||
public void run() throws IOException {
|
||||
//不参与合作的电站
|
||||
List<XhpcStationInternetBlacklist> xhpcStationInternetBlacklist =xhpcStationInternetBlacklistRepo.findByInternetUserId(6L);
|
||||
List<String> stationKeys = new ArrayList<>(REDIS.keys("station:*"));
|
||||
|
||||
AuthSecretToken authSecretTokenOut =
|
||||
authSecretTokenRepository.findByOperatorId3irdptyAndOperatorIdAndSecretTokenType(
|
||||
"MA6CC2LK7", "MA6DFCTD5", SECRET_TOKEN_TYPE_OUT).orElse(null); //todo
|
||||
|
||||
for (String stationKey : stationKeys) {
|
||||
//查询不合作的电桩
|
||||
for (XhpcStationInternetBlacklist xhpcStationInternetBlack : xhpcStationInternetBlacklist) {
|
||||
if (!stationKey.substring(8).equals(xhpcStationInternetBlack.getChargingStationId().toString())) {
|
||||
// maybe对接第三方
|
||||
if (authSecretTokenOut != null) {
|
||||
String stationId = xhpcStationInternetBlack.getChargingStationId().toString();
|
||||
//获取所有该场站充电中订单
|
||||
List<XhpcChargeOrder> xhpcChargeOrderList = xhpcChargeOrderRepository.findByStatusAndDelFlagAndChargingStationIdOrderByChargingStationId(0, 0,xhpcStationInternetBlack.getChargingStationId());
|
||||
//获取订单bms数据
|
||||
for (int i = 0; i < xhpcChargeOrderList.size(); i++) {
|
||||
XhpcChargeOrder xhpcChargeOrder = xhpcChargeOrderList.get(i);
|
||||
String key = "order:".concat(xhpcChargeOrder.getSerialNumber())+".bms";
|
||||
CacheBmsReqChargerOutputData bms = REDIS.getCacheObject(key);
|
||||
BigDecimal bigDecimal = new BigDecimal(bms.getPileVoltageOutput()).multiply(new BigDecimal(bms.getPileCurrentOutput())).divide(new BigDecimal(1000)).setScale(2, BigDecimal.ROUND_CEILING);
|
||||
//获取场站信息
|
||||
String keys = "cdjgpc:station:".concat(stationId)+".notification";
|
||||
CDStationInfo cdStationInfo =REDIS.getCacheObject(keys);
|
||||
|
||||
CDEquipmentV2GPowerInfo cdEquipmentV2GPowerInfo = new CDEquipmentV2GPowerInfo();
|
||||
cdEquipmentV2GPowerInfo.setStationID(stationId);
|
||||
cdEquipmentV2GPowerInfo.setOperatorID(cdStationInfo.getOperatorId());
|
||||
cdEquipmentV2GPowerInfo.setEquipmentOwnerID(cdStationInfo.getEquipmentOwnerId());
|
||||
cdEquipmentV2GPowerInfo.setEquipmentID(xhpcChargeOrder.getSerialNumber().substring(0,14));
|
||||
cdEquipmentV2GPowerInfo.setChargeStatus(1);
|
||||
cdEquipmentV2GPowerInfo.setPower(bigDecimal.doubleValue());
|
||||
|
||||
String format = DateUtil.format(new Date(), "yyyymmddhhmm");
|
||||
cdEquipmentV2GPowerInfo.setTsMin(format);
|
||||
cdEquipmentV2GPowerInfo.setTsHour(format.substring(0,10));
|
||||
cdEquipmentV2GPowerInfo.setTsDay(format.substring(0,8));
|
||||
cdEquipmentV2GPowerInfo.setTsMonth(format.substring(0,6));
|
||||
cdEquipmentV2GPowerInfo.setTsYear(format.substring(0,4));
|
||||
|
||||
CommonRequest<CDEquipmentV2GPowerInfo> commonRequest = new CommonRequest<>();
|
||||
Map<String,Object> mapStationInfo =new HashMap<>();
|
||||
mapStationInfo.put("EquipmentV2GPowerInfo",cdEquipmentV2GPowerInfo);
|
||||
String data = JSONUtil.toJSONString(mapStationInfo);
|
||||
System.out.println("=======data========"+data);
|
||||
commonRequest.setData(data);
|
||||
String result =ok(commonRequest,"/notification_equipmentV2GPowerInfo",authSecretTokenOut);
|
||||
System.out.println("=====V2G 实时负荷信息推送==result========"+result);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@ -20,6 +20,7 @@ import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.domain.Example;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.io.IOException;
|
||||
@ -59,6 +60,7 @@ public class CDNotificationOrderInfoTask extends CoreDispatcher {
|
||||
*订单信息推送 ---已推送--推送服务使用
|
||||
* @throws IOException
|
||||
*/
|
||||
//9099开放定时任务 9009不开放
|
||||
//@Scheduled(fixedDelay = 1000 * 60)
|
||||
public void run() throws IOException {
|
||||
|
||||
@ -144,6 +146,7 @@ public class CDNotificationOrderInfoTask extends CoreDispatcher {
|
||||
commonRequest.setData(data);
|
||||
String responseBody = ok(commonRequest, "/notification_orderInfo", authSecretTokenOut);
|
||||
logger.info("========新平台推送=======responseBody============================="+cdChargeOrderInfo4BonusReq.getStartChargeSeq());
|
||||
logger.info("========新平台推送=======responseBody============================="+cdChargeOrderInfo4BonusReq.getStartChargeSeq());
|
||||
|
||||
CDCancelOrderResponse cdChargeOrder4BonusInfoRes = DTOJsonHelper.parseResponseData(responseBody,
|
||||
CDCancelOrderResponse.class, authSecretTokenOut);
|
||||
@ -213,4 +216,10 @@ public class CDNotificationOrderInfoTask extends CoreDispatcher {
|
||||
}
|
||||
return etOrderMapping;
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
String operatorId ="MA6DFCTD5";
|
||||
String orderNo ="80836000100002022410110921367394";
|
||||
System.out.println(operatorId.concat(DateUtil.getYYYY()).concat(orderNo.substring(18)));
|
||||
}
|
||||
}
|
||||
|
||||
@ -30,7 +30,7 @@ public class CDNotificationStationFeeTask extends CoreDispatcher {
|
||||
AuthSecretTokenRepository authSecretTokenRepository;
|
||||
private final Logger logger = LoggerFactory.getLogger(CDNotificationStationFeeTask.class);
|
||||
|
||||
//--推送服务使用
|
||||
//9099开放定时任务 9009不开放
|
||||
//@Scheduled(fixedDelay = 1000 * 60)
|
||||
public void run() throws IOException {
|
||||
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
package com.xhpc.evcs.cdjgpc.notification;
|
||||
|
||||
import com.xhpc.common.api.dto.ChargingStationDto;
|
||||
import com.xhpc.common.data.redis.CacheRateModel;
|
||||
import com.xhpc.evcs.cdjgpc.dto.CDEquipmentInfo;
|
||||
import com.xhpc.evcs.cdjgpc.dto.CDStationInfo;
|
||||
import com.xhpc.evcs.domain.AuthSecretToken;
|
||||
@ -30,7 +31,7 @@ public class CDNotificationStationInfoTask extends CoreDispatcher {
|
||||
private XhpcStationInternetBlacklistRepository xhpcStationInternetBlacklistRepo;
|
||||
private final Logger logger = LoggerFactory.getLogger(CDNotificationStationInfoTask.class);
|
||||
|
||||
//推送新平台场站信息
|
||||
//9099开放定时任务 9009不开放
|
||||
//@Scheduled(cron = "0 0 0 1/15 * ? ")
|
||||
public void run() throws IOException {
|
||||
try{
|
||||
@ -53,6 +54,46 @@ public class CDNotificationStationInfoTask extends CoreDispatcher {
|
||||
cdStationInfo.setEquipmentInfos(new ArrayList<>());
|
||||
//查询场站是桩是否对应上
|
||||
ChargingStationDto stationDto = REDIS.getCacheObject("station:"+chargingStationId);
|
||||
CacheRateModel cacheRateModel = REDIS.getCacheObject("rateModel:" + stationDto.getRateModelId());
|
||||
|
||||
StringBuilder price = new StringBuilder();
|
||||
StringBuilder svcPrice = new StringBuilder();
|
||||
|
||||
Integer t1Price = cacheRateModel.getT1Price();
|
||||
Integer t1SvcPrice = cacheRateModel.getT1SvcPrice();
|
||||
Integer t2Price = cacheRateModel.getT2Price();
|
||||
Integer t2SvcPrice = cacheRateModel.getT2SvcPrice();
|
||||
Integer t3Price = cacheRateModel.getT3Price();
|
||||
Integer t3SvcPrice = cacheRateModel.getT3SvcPrice();
|
||||
Integer t4Price = cacheRateModel.getT4Price();
|
||||
Integer t4SvcPrice = cacheRateModel.getT4SvcPrice();
|
||||
|
||||
if(cacheRateModel.getTfPricesSeq() !=null && cacheRateModel.getTfPricesSeq().length>0){
|
||||
price.append("{");
|
||||
svcPrice.append("{");
|
||||
for (int i = 0; i < cacheRateModel.getTfPricesSeq().length; i++) {
|
||||
String time = getTime(i);
|
||||
String s = cacheRateModel.getTfPricesSeq()[i];
|
||||
|
||||
if("00".equals(s)){
|
||||
price.append(time).append(t1Price.toString()).append(",");
|
||||
svcPrice.append(time).append(t1SvcPrice.toString()).append(",");
|
||||
}else if("01".equals(s)){
|
||||
price.append(time).append(t2Price.toString()).append(",");
|
||||
svcPrice.append(time).append(t2SvcPrice.toString()).append(",");
|
||||
}else if("02".equals(s)){
|
||||
price.append(time).append(t3Price.toString()).append(",");
|
||||
svcPrice.append(time).append(t3SvcPrice.toString()).append(",");
|
||||
}else{
|
||||
price.append(time).append(t4Price.toString()).append(",");
|
||||
svcPrice.append(time).append(t4SvcPrice.toString()).append(",");
|
||||
}
|
||||
}
|
||||
price.deleteCharAt(price.length()-1).append("}");
|
||||
svcPrice.deleteCharAt(price.length()-1).append("}");
|
||||
}
|
||||
cdStationInfo.setElectricityFee(price.toString());
|
||||
cdStationInfo.setServiceFee(svcPrice.toString());
|
||||
Set<String> pks = stationDto.getPiles();
|
||||
if (pks != null) {
|
||||
List<CDEquipmentInfo> cdEquipmentInfos = new ArrayList<>();
|
||||
@ -86,4 +127,106 @@ public class CDNotificationStationInfoTask extends CoreDispatcher {
|
||||
}
|
||||
}
|
||||
|
||||
private String getTime(Integer number){
|
||||
String time ="";
|
||||
if(number ==0){
|
||||
time ="00:00:00-00:30:00:";
|
||||
}else if(number ==1) {
|
||||
time = "00:30:00-01:00:00:";
|
||||
}else if(number ==2) {
|
||||
time = "01:00:00-01:30:00:";
|
||||
}else if(number ==3) {
|
||||
time = "01:30:00-02:00:00:";
|
||||
}else if(number ==4) {
|
||||
time = "02:00:00-02:30:00:";
|
||||
}else if(number ==5) {
|
||||
time = "02:30:00-03:00:00:";
|
||||
}else if(number ==6) {
|
||||
time = "03:00:00-03:30:00:";
|
||||
}else if(number ==7) {
|
||||
time = "03:30:00-04:00:00:";
|
||||
}else if(number ==8) {
|
||||
time = "04:00:00-04:30:00:";
|
||||
}else if(number ==9) {
|
||||
time = "04:30:00-05:00:00:";
|
||||
}else if(number ==10) {
|
||||
time = "05:00:00-05:30:00:";
|
||||
}else if(number ==11) {
|
||||
time = "05:30:00-06:00:00:";
|
||||
}else if(number ==12) {
|
||||
time = "06:00:00-06:30:00:";
|
||||
}else if(number ==13) {
|
||||
time = "06:30:00-07:00:00:";
|
||||
}else if(number ==14) {
|
||||
time = "07:00:00-07:30:00:";
|
||||
}else if(number ==15) {
|
||||
time = "07:30:00-08:00:00:";
|
||||
}else if(number ==16) {
|
||||
time = "08:00:00-08:30:00:";
|
||||
}else if(number ==17) {
|
||||
time = "08:30:00-09:00:00:";
|
||||
}else if(number ==18) {
|
||||
time = "09:00:00-09:30:00:";
|
||||
}else if(number ==19) {
|
||||
time = "09:30:00-10:00:00:";
|
||||
}else if(number ==20) {
|
||||
time = "10:00:00-10:30:00:";
|
||||
}else if(number ==21) {
|
||||
time = "10:30:00-11:00:00:";
|
||||
}else if(number ==22) {
|
||||
time = "11:00:00-11:30:00:";
|
||||
}else if(number ==23) {
|
||||
time = "11:30:00-12:00:00:";
|
||||
}else if(number ==24) {
|
||||
time = "12:00:00-12:30:00:";
|
||||
}else if(number ==25) {
|
||||
time = "12:30:00-13:00:00:";
|
||||
}else if(number ==26) {
|
||||
time = "13:00:00-13:30:00:";
|
||||
}else if(number ==27) {
|
||||
time = "13:30:00-14:00:00:";
|
||||
}else if(number ==28) {
|
||||
time = "14:00:00-14:30:00:";
|
||||
}else if(number ==29) {
|
||||
time = "14:30:00-15:00:00:";
|
||||
}else if(number ==30){
|
||||
time ="15:00:00-15:30:00:";
|
||||
}else if(number ==31) {
|
||||
time = "15:30:00-16:00:00:";
|
||||
}else if(number ==32) {
|
||||
time = "16:00:00-16:30:00:";
|
||||
}else if(number ==33) {
|
||||
time = "16:30:00-17:00:00:";
|
||||
}else if(number ==34) {
|
||||
time = "17:00:00-17:30:00:";
|
||||
}else if(number ==35) {
|
||||
time = "17:30:00-18:00:00:";
|
||||
}else if(number ==36) {
|
||||
time = "18:00:00-18:30:00:";
|
||||
}else if(number ==37) {
|
||||
time = "18:30:00-19:00:00:";
|
||||
}else if(number ==38) {
|
||||
time = "19:00:00-19:30:00:";
|
||||
}else if(number ==39) {
|
||||
time = "19:30:00-20:00:00:";
|
||||
}else if(number ==40){
|
||||
time ="20:00:00-20:30:00:";
|
||||
}else if(number ==41) {
|
||||
time = "20:30:00-21:00:00:";
|
||||
}else if(number ==42) {
|
||||
time = "21:00:00-21:30:00:";
|
||||
}else if(number ==43) {
|
||||
time = "21:30:00-22:00:00";
|
||||
}else if(number ==44) {
|
||||
time = "22:00:00-22:30:00:";
|
||||
}else if(number ==45) {
|
||||
time = "22:30:00-23:00:00:";
|
||||
}else if(number ==46) {
|
||||
time = "23:00:00-23:30:00";
|
||||
}else if(number ==47) {
|
||||
time = "23:30:00-24:00:00:";
|
||||
}
|
||||
return time;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,110 @@
|
||||
package com.xhpc.evcs.cdjgpc.notification;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.xhpc.common.data.redis.CacheBmsReqChargerOutputData;
|
||||
import com.xhpc.evcs.cdjgpc.dto.CDStationInfo;
|
||||
import com.xhpc.evcs.domain.AuthSecretToken;
|
||||
import com.xhpc.evcs.domain.XhpcStationInternetBlacklist;
|
||||
import com.xhpc.evcs.dto.CommonRequest;
|
||||
import com.xhpc.evcs.jpa.AuthSecretTokenRepository;
|
||||
import com.xhpc.evcs.jpa.XhpcStationInternetBlacklistRepository;
|
||||
import com.xhpc.evcs.notification.CoreDispatcher;
|
||||
import com.xhpc.evcs.cdjgpc.domain.XhpcChargeOrder;
|
||||
import com.xhpc.evcs.cdjgpc.dto.CDStationPowerlnfo;
|
||||
import com.xhpc.evcs.cdjgpc.jpa.XhpcChargeOrderRepository;
|
||||
import com.xhpc.evcs.utils.JSONUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.io.IOException;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
|
||||
import static com.xhpc.common.data.redis.StaticBeanUtil.REDIS;
|
||||
import static com.xhpc.evcs.domain.AuthSecretToken.SECRET_TOKEN_TYPE_OUT;
|
||||
|
||||
/**
|
||||
* 充电站实时负荷信息推送
|
||||
*
|
||||
* @author yuyang
|
||||
* @Date 2024-08-16 13:57
|
||||
*/
|
||||
@Component
|
||||
@Slf4j
|
||||
public class CDNotificationStationPowerInfoTask extends CoreDispatcher {
|
||||
@Resource
|
||||
AuthSecretTokenRepository authSecretTokenRepository;
|
||||
@Resource
|
||||
XhpcChargeOrderRepository xhpcChargeOrderRepository;
|
||||
@Resource
|
||||
private XhpcStationInternetBlacklistRepository xhpcStationInternetBlacklistRepo;
|
||||
|
||||
private final Logger logger = LoggerFactory.getLogger(CDNotificationStationPowerInfoTask.class);
|
||||
|
||||
//9099开放定时任务 9009不开放
|
||||
//@Scheduled(cron = "0 0/1 * * * ? ")
|
||||
public void run() throws IOException {
|
||||
//不参与合作的电站
|
||||
List<XhpcStationInternetBlacklist> xhpcStationInternetBlacklist =xhpcStationInternetBlacklistRepo.findByInternetUserId(6L);
|
||||
List<String> stationKeys = new ArrayList<>(REDIS.keys("station:*"));
|
||||
|
||||
AuthSecretToken authSecretTokenOut =
|
||||
authSecretTokenRepository.findByOperatorId3irdptyAndOperatorIdAndSecretTokenType(
|
||||
"MA6CC2LK7", "MA6DFCTD5", SECRET_TOKEN_TYPE_OUT).orElse(null); //todo
|
||||
|
||||
for (String stationKey : stationKeys) {
|
||||
//查询不合作的电桩
|
||||
for (XhpcStationInternetBlacklist xhpcStationInternetBlack : xhpcStationInternetBlacklist) {
|
||||
if (!stationKey.substring(8).equals(xhpcStationInternetBlack.getChargingStationId().toString())) {
|
||||
// maybe对接第三方
|
||||
if (authSecretTokenOut != null) {
|
||||
String stationId = xhpcStationInternetBlack.getChargingStationId().toString();
|
||||
//获取所有该场站充电中订单
|
||||
List<XhpcChargeOrder> xhpcChargeOrderList = xhpcChargeOrderRepository.findByStatusAndDelFlagAndChargingStationIdOrderByChargingStationId(0, 0,xhpcStationInternetBlack.getChargingStationId());
|
||||
//获取订单bms数据
|
||||
BigDecimal bigDecimal1 = new BigDecimal(0);
|
||||
for (int i = 0; i < xhpcChargeOrderList.size(); i++) {
|
||||
XhpcChargeOrder xhpcChargeOrder = xhpcChargeOrderList.get(i);
|
||||
String key = "order:".concat(xhpcChargeOrder.getSerialNumber())+".bms";
|
||||
CacheBmsReqChargerOutputData bms = REDIS.getCacheObject(key);
|
||||
BigDecimal bigDecimal = new BigDecimal(bms.getPileVoltageOutput()).multiply(new BigDecimal(bms.getPileCurrentOutput())).divide(new BigDecimal(1000)).setScale(2, BigDecimal.ROUND_CEILING);
|
||||
bigDecimal1 = bigDecimal1.add(bigDecimal);
|
||||
}
|
||||
|
||||
//获取场站信息
|
||||
String key = "cdjgpc:station:".concat(stationId)+".notification";
|
||||
CDStationInfo cdStationInfo =REDIS.getCacheObject(key);
|
||||
|
||||
CDStationPowerlnfo cdStationPowerlnfo = new CDStationPowerlnfo();
|
||||
cdStationPowerlnfo.setStationID(stationId);
|
||||
cdStationPowerlnfo.setOperatorID(cdStationInfo.getOperatorId());
|
||||
cdStationPowerlnfo.setEquipmentOwnerID(cdStationInfo.getEquipmentOwnerId());
|
||||
cdStationPowerlnfo.setEleNo(cdStationInfo.getAccountNumber());
|
||||
cdStationPowerlnfo.setPower(bigDecimal1.doubleValue());
|
||||
|
||||
String format = DateUtil.format(new Date(), "yyyymmddhhmm");
|
||||
cdStationPowerlnfo.setTsMin(format);
|
||||
cdStationPowerlnfo.setTsHour(format.substring(0,10));
|
||||
cdStationPowerlnfo.setTsDay(format.substring(0,8));
|
||||
cdStationPowerlnfo.setTsMonth(format.substring(0,6));
|
||||
cdStationPowerlnfo.setTsYear(format.substring(0,4));
|
||||
|
||||
|
||||
CommonRequest<CDStationPowerlnfo> commonRequest = new CommonRequest<>();
|
||||
Map<String,Object> mapStationInfo =new HashMap<>();
|
||||
mapStationInfo.put("StationPowerInfo",cdStationPowerlnfo);
|
||||
String data = JSONUtil.toJSONString(mapStationInfo);
|
||||
System.out.println("=======data========"+data);
|
||||
commonRequest.setData(data);
|
||||
String result =ok(commonRequest,"/notification_stationPowerInfo",authSecretTokenOut);
|
||||
System.out.println("=====充电站实时负荷信息推送==result========"+result);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -49,7 +49,7 @@ public class CDNotificationStationStatusTask extends CoreDispatcher {
|
||||
private XhpcStationInternetBlacklistRepository xhpcStationInternetBlacklistRepo;
|
||||
@Resource
|
||||
private XhpcTerminalRepository terminalRepository;
|
||||
//--推送服务使用
|
||||
//9099开放定时任务 9009不开放
|
||||
//@Scheduled(fixedRate = 1000 * 45)
|
||||
protected void run() throws IOException {
|
||||
|
||||
|
||||
@ -40,6 +40,9 @@ public class CDSuperviseNotificationOperationStatusInfoTask extends CoreDispatch
|
||||
PowerPileService powerPileService;
|
||||
|
||||
private final Logger logger = LoggerFactory.getLogger(CDSuperviseNotificationOperationStatusInfoTask.class);
|
||||
|
||||
|
||||
//9099开放定时任务 9009不开放
|
||||
//@Scheduled(cron = "0 0 0 * * ? ")
|
||||
//@Scheduled(fixedRate = 1000 * 45)
|
||||
protected void run() throws IOException {
|
||||
|
||||
@ -41,8 +41,8 @@ public class CDSuperviseNotificationRealtimePowerInfoTask extends CoreDispatcher
|
||||
PowerPileService powerPileService;
|
||||
|
||||
private final Logger logger = LoggerFactory.getLogger(CDSuperviseNotificationOperationStatusInfoTask.class);
|
||||
//@Scheduled(cron = "0 0 0 * * ? ")
|
||||
//@Scheduled(fixedRate = 1000 * 45)
|
||||
//9099开放定时任务 9009不开放
|
||||
//@Scheduled(cron = "0 0/15 * * * ? ")
|
||||
protected void run() throws IOException {
|
||||
String replace = UUID.randomUUID().toString().replace("-", "");
|
||||
AuthSecretToken authSecretTokenOut =
|
||||
|
||||
@ -11,6 +11,7 @@ import com.fasterxml.jackson.databind.node.ObjectNode;
|
||||
import com.xhpc.evcs.domain.AuthSecretToken;
|
||||
import com.xhpc.evcs.dto.CommonRequest;
|
||||
import com.xhpc.evcs.dto.CommonResponse;
|
||||
import com.xhpc.evcs.dto.EquipBizRequest;
|
||||
import com.xhpc.evcs.encryption.Aes128Cbc;
|
||||
import com.xhpc.evcs.encryption.EvcsConst;
|
||||
import com.xhpc.evcs.encryption.HMAC;
|
||||
@ -39,16 +40,14 @@ import java.nio.charset.StandardCharsets;
|
||||
import java.security.InvalidAlgorithmParameterException;
|
||||
import java.security.InvalidKeyException;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.Scanner;
|
||||
import java.util.*;
|
||||
|
||||
@SuppressWarnings({"Duplicates"}) //todo
|
||||
@Slf4j
|
||||
//@Component //spring boot way, see https://www.surasint.com/spring-boot-webfilter-instead-of-component/
|
||||
//@Order(1) not supported, see https://github.com/spring-projects/spring-boot/issues/8276
|
||||
//成都市监管平台v10 恒大v20 新电途 v30 快电 v40 小桔v50
|
||||
@WebFilter(urlPatterns = {"/v1/*", "/v2/*", "/v10/*", "/v20/*"}, filterName = "v1n10filter") //multiple filters execute by filterName order
|
||||
//成都市监管平台(蓉成充)v10 v20 川逸充 v30
|
||||
@WebFilter(urlPatterns = {"/v1/*", "/v2/*", "/v10/*", "/v20/*", "/v30/*"}, filterName = "v1n10filter") //multiple filters execute by filterName order
|
||||
public class EvcsFilter extends OncePerRequestFilter {
|
||||
|
||||
@Resource
|
||||
@ -99,28 +98,41 @@ public class EvcsFilter extends OncePerRequestFilter {
|
||||
|
||||
if (servletPath.endsWith("/v1/query_token")) {
|
||||
log.info("================老接口过滤 token========operatorId=========="+operatorId);
|
||||
authSecretTokenIn = authSecretTokenRepository.findByOperatorId3irdptyAndSecretTokenType(operatorId,
|
||||
authSecretTokenIn = authSecretTokenRepository.findByStatusAndOperatorId3irdptyAndSecretTokenType(1,operatorId,
|
||||
AuthSecretToken.SECRET_TOKEN_TYPE_IN).orElse(null);
|
||||
handleQueryToken(request, response, chain, requestWrapper, bodyString, commonRequest,
|
||||
responseWrapper, authSecretTokenIn);
|
||||
}else if (servletPath.endsWith("/v10/query_token")) {
|
||||
log.info("================新接口过滤 token========operatorId=========="+operatorId);
|
||||
authSecretTokenIn = authSecretTokenRepository.findByOperatorId3irdptyAndSecretTokenType(operatorId,
|
||||
log.info("================新监管平台(蓉城充) token========operatorId=========="+operatorId);
|
||||
authSecretTokenIn = authSecretTokenRepository.findByStatusAndOperatorId3irdptyAndSecretTokenType(2,operatorId,
|
||||
AuthSecretToken.SECRET_TOKEN_TYPE_IN).orElse(null);
|
||||
handleQueryToken(request, response, chain, requestWrapper, bodyString, commonRequest,
|
||||
responseWrapper, authSecretTokenIn);
|
||||
}else if (servletPath.endsWith("/v20/query_token")) {
|
||||
log.info("================新接口过滤 token========operatorId=========="+operatorId);
|
||||
authSecretTokenIn = authSecretTokenRepository.findByOperatorId3irdptyAndSecretTokenType(operatorId,
|
||||
log.info("================川逸充 token========operatorId=========="+operatorId);
|
||||
authSecretTokenIn = authSecretTokenRepository.findByStatusAndOperatorId3irdptyAndSecretTokenType(3,operatorId,
|
||||
AuthSecretToken.SECRET_TOKEN_TYPE_IN).orElse(null);
|
||||
handleQueryToken(request, response, chain, requestWrapper, bodyString, commonRequest,
|
||||
responseWrapper, authSecretTokenIn);
|
||||
} else {
|
||||
if (authorization != null && authorization.startsWith("Bearer ")) {
|
||||
String token = authorization.replace("Bearer ", "");
|
||||
authSecretTokenIn =
|
||||
authSecretTokenRepository.findByOperatorId3irdptyAndSecretTokenTypeAndTokenExpiryGreaterThan(
|
||||
operatorId, AuthSecretToken.SECRET_TOKEN_TYPE_IN, now).orElse(null);
|
||||
|
||||
if(servletPath.endsWith("/v1/")){
|
||||
authSecretTokenIn =
|
||||
authSecretTokenRepository.findByStatusAndOperatorId3irdptyAndSecretTokenTypeAndTokenExpiryGreaterThan(1,
|
||||
operatorId, AuthSecretToken.SECRET_TOKEN_TYPE_IN, now).orElse(null);
|
||||
}else if(servletPath.endsWith("/v10/")){
|
||||
authSecretTokenIn =
|
||||
authSecretTokenRepository.findByStatusAndOperatorId3irdptyAndSecretTokenTypeAndTokenExpiryGreaterThan(2,
|
||||
operatorId, AuthSecretToken.SECRET_TOKEN_TYPE_IN, now).orElse(null);
|
||||
}else if(servletPath.endsWith("/v20/")){
|
||||
authSecretTokenIn =
|
||||
authSecretTokenRepository.findByStatusAndOperatorId3irdptyAndSecretTokenTypeAndTokenExpiryGreaterThan(3,
|
||||
operatorId, AuthSecretToken.SECRET_TOKEN_TYPE_IN, now).orElse(null);
|
||||
}
|
||||
|
||||
|
||||
if (authSecretTokenIn == null) {
|
||||
resp.setRet("4002");
|
||||
resp.setMsg("Invalid token(db)");
|
||||
@ -336,4 +348,39 @@ public class EvcsFilter extends OncePerRequestFilter {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
private static CommonRequest<EquipBizRequest> structure() {
|
||||
CommonRequest<EquipBizRequest> commonRequest = new CommonRequest<>();
|
||||
try {
|
||||
EquipBizRequest equipBizRequest = new EquipBizRequest();
|
||||
equipBizRequest.setEquipBizSeq("MA25CNM3800000");
|
||||
equipBizRequest.setConnectorId("8083600001000801");
|
||||
|
||||
String data = JSONUtil.toJSONString(equipBizRequest);
|
||||
System.out.println("========data========"+data);
|
||||
|
||||
|
||||
commonRequest.setData(data);
|
||||
commonRequest.setOperatorId("MA25CNM38");
|
||||
} catch (Exception e) {
|
||||
|
||||
}
|
||||
return commonRequest;
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
try{
|
||||
|
||||
CommonRequest commonRequest = structure();
|
||||
String s = encryptReqOut("8LpncubmWiPCzY3V", "av6A8QdnRaVRMXu6",
|
||||
"Ut5UFdqDthiJyncU", commonRequest);
|
||||
System.out.println("s================"+s);
|
||||
|
||||
|
||||
}catch (Exception e){
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -20,16 +20,37 @@ public interface AuthSecretTokenRepository extends JpaRepository<AuthSecretToken
|
||||
Optional<AuthSecretToken> findByOperatorId3irdptyAndSecretTokenTypeAndTokenExpiryGreaterThan(String operatorId,
|
||||
String secretTokenType,
|
||||
Date time);
|
||||
|
||||
Optional<AuthSecretToken> findByStatusAndOperatorId3irdptyAndSecretTokenTypeAndTokenExpiryGreaterThan(Integer status,
|
||||
String operatorId,
|
||||
String secretTokenType,
|
||||
Date time);
|
||||
|
||||
|
||||
Optional<AuthSecretToken> findByOperatorId3irdptyAndOperatorIdAndSecretTokenType(String operatorId3irdpty,
|
||||
String operatorID,
|
||||
String secretTokenTypeIn);
|
||||
|
||||
|
||||
Optional<AuthSecretToken> findByStatusAndOperatorId3irdptyAndOperatorIdAndSecretTokenType(
|
||||
Integer status,
|
||||
String operatorId3irdpty,
|
||||
String operatorID,
|
||||
String secretTokenTypeIn);
|
||||
|
||||
Optional<AuthSecretToken> findByOperatorId3irdptyAndSecretTokenTypeAndOperatorSecret(String operatorID3irdpty,
|
||||
String secretTokenType,
|
||||
String operatorSecret);
|
||||
|
||||
Optional<AuthSecretToken> findByStatusAndOperatorId3irdptyAndSecretTokenTypeAndOperatorSecret(
|
||||
Integer status,
|
||||
String operatorID3irdpty,
|
||||
String secretTokenType,
|
||||
String operatorSecret);
|
||||
|
||||
Optional<AuthSecretToken> findByOperatorId3irdptyAndSecretTokenType(String operatorId, String secretTokenType);
|
||||
|
||||
Optional<AuthSecretToken> findByStatusAndOperatorId3irdptyAndSecretTokenType(Integer status,String operatorId, String secretTokenType);
|
||||
List<AuthSecretToken> findBySecretTokenType(String secretTokenType);
|
||||
|
||||
|
||||
|
||||
@ -13,8 +13,8 @@ import com.xhpc.evcs.jpa.AuthSecretTokenRepository;
|
||||
import com.xhpc.evcs.jpa.EtDisputeOrdersRepository;
|
||||
import com.xhpc.evcs.jpa.XhpcRateRepository;
|
||||
import com.xhpc.evcs.utils.JSONUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
|
||||
@ -30,13 +30,13 @@ import static com.xhpc.evcs.domain.AuthSecretToken.SECRET_TOKEN_TYPE_OUT;
|
||||
*/
|
||||
public class CheckChargeOrders extends CoreDispatcher {
|
||||
|
||||
@Autowired
|
||||
@Resource
|
||||
private RedisService redisService;
|
||||
@Autowired
|
||||
@Resource
|
||||
private XhpcRateRepository xhpcRateRepository;
|
||||
@Autowired
|
||||
@Resource
|
||||
private AuthSecretTokenRepository authSecretTokenRepository;
|
||||
@Autowired
|
||||
@Resource
|
||||
private EtDisputeOrdersRepository etDisputeOrdersRepository;
|
||||
|
||||
public void checkChargeOrder() throws Exception {
|
||||
|
||||
@ -31,6 +31,7 @@ public class NotificationCancelOrderTask extends CoreDispatcher {
|
||||
//private Logger logger = LoggerFactory.getLogger(NotificationChargeOrderInfoTask.class);
|
||||
|
||||
//推送不开放(evcs 放开)
|
||||
//9009开放定时任务 9099不开放
|
||||
@Scheduled(fixedRate = 1000 * 15)
|
||||
public void run() throws JsonProcessingException {
|
||||
|
||||
|
||||
@ -46,6 +46,7 @@ public class NotificationChargeOrderInfo4BonusTask extends CoreDispatcher {
|
||||
* 推送充电订单信息(运营奖补)(测试环境开)
|
||||
* @throws IOException
|
||||
*/
|
||||
//9099开放定时任务 9009不开放
|
||||
//@Scheduled(fixedDelay = 1000 * 60)
|
||||
public void run() throws IOException {
|
||||
|
||||
|
||||
@ -39,6 +39,7 @@ public class NotificationChargeOrderInfoTask extends CoreDispatcher {
|
||||
|
||||
private final Logger logger = LoggerFactory.getLogger(NotificationChargeOrderInfoTask.class);
|
||||
//推送不开放(evcs 放开)
|
||||
//9009开放定时任务 9099不开放
|
||||
@Scheduled(fixedRate = 1000 * 15)
|
||||
public void run() throws JsonProcessingException {
|
||||
|
||||
|
||||
@ -49,6 +49,7 @@ public class NotificationEquipChargeStatusTask extends CoreDispatcher {
|
||||
* @throws IOException
|
||||
*/
|
||||
//推送不开放
|
||||
//9009开放定时任务 9099不开放
|
||||
@Scheduled(fixedRate = 1000 * 30)
|
||||
public void run() throws IOException {
|
||||
|
||||
|
||||
@ -33,8 +33,9 @@ public class NotificationStartChargeResultTask extends CoreDispatcher {
|
||||
/**
|
||||
* Judging the 3rd whether it has got the start charging task.
|
||||
*/
|
||||
//推送不开放(evcs 放开)
|
||||
@Scheduled(fixedRate = 1000 * 30)
|
||||
//(evcs 放开 30 秒, 测试平台开放 15秒)
|
||||
//9009开放定时任务 9099不开放
|
||||
@Scheduled(fixedRate = 1000 * 15)
|
||||
public void run() throws IOException {
|
||||
|
||||
//Getting the charge orders which from 3rd.
|
||||
|
||||
@ -50,6 +50,7 @@ public class NotificationStationStatusTask extends CoreDispatcher {
|
||||
private XhpcTerminalRepository terminalRepository;
|
||||
|
||||
//推送不开放(evcs 放开)
|
||||
//9009开放定时任务 9099不开放
|
||||
@Scheduled(fixedRate = 1000 * 45)
|
||||
protected void run() throws IOException {
|
||||
|
||||
|
||||
@ -27,6 +27,7 @@ public class NotificationStopChargeResultTask extends CoreDispatcher {
|
||||
private AuthSecretTokenRepository authSecretTokenRepository;
|
||||
|
||||
//(evcs 放开)
|
||||
//9009开放定时任务 9099不开放
|
||||
@Scheduled(fixedRate = 1000 * 3)
|
||||
public void run() throws Exception {
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
# Tomcat
|
||||
# Tomcat 9009 不走推送 9099走推送
|
||||
server:
|
||||
port: 9009
|
||||
|
||||
@ -14,10 +14,10 @@ spring:
|
||||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 120.26.46.180:8858
|
||||
server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 120.26.46.180:8858
|
||||
server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
||||
@ -14,10 +14,10 @@ spring:
|
||||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 120.26.46.180:8858
|
||||
server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 120.26.46.180:8858
|
||||
server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
||||
@ -16,10 +16,10 @@ spring:
|
||||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 120.26.46.180:8858
|
||||
server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 120.26.46.180:8858
|
||||
server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
@ -35,7 +35,7 @@ spring:
|
||||
datasource:
|
||||
ds1:
|
||||
nacos:
|
||||
server-addr: 120.26.46.180:8858
|
||||
server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848
|
||||
dataId: sentinel-ruoyi-gateway
|
||||
groupId: DEFAULT_GROUP
|
||||
data-type: json
|
||||
|
||||
@ -14,10 +14,10 @@ spring:
|
||||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 120.26.46.180:8858
|
||||
server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 120.26.46.180:8858
|
||||
server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
||||
@ -14,10 +14,10 @@ spring:
|
||||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 120.26.46.180:8858
|
||||
server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 120.26.46.180:8858
|
||||
server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
||||
@ -14,10 +14,10 @@ spring:
|
||||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 120.26.46.180:8858
|
||||
server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 120.26.46.180:8858
|
||||
server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
||||
@ -14,10 +14,10 @@ spring:
|
||||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 120.26.46.180:8858
|
||||
server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 120.26.46.180:8858
|
||||
server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
||||
@ -14,10 +14,10 @@ spring:
|
||||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 120.26.46.180:8858
|
||||
server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 120.26.46.180:8858
|
||||
server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
||||
@ -102,6 +102,17 @@
|
||||
<artifactId>ruoyi-common-log</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>org.apache.poi</groupId>-->
|
||||
<!-- <artifactId>poi</artifactId>-->
|
||||
<!-- <version>3.9</version>-->
|
||||
<!-- </dependency>-->
|
||||
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>org.apache.poi</groupId>-->
|
||||
<!-- <artifactId>poi-ooxml</artifactId>-->
|
||||
<!-- <version>3.9</version>-->
|
||||
<!-- </dependency>-->
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
||||
@ -15,6 +15,7 @@ import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@ -31,22 +32,22 @@ public class XhpcTradebillCommonController extends BaseController {
|
||||
|
||||
@Log(title = "上传对账单(OSS方式)", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/oss/upload")
|
||||
public AjaxResult OssUpload(HttpServletRequest request, @RequestBody XhpcTradebillUploadRecordDomain domain) throws Exception{
|
||||
public AjaxResult OssUpload(HttpServletRequest request, HttpServletResponse response, @RequestBody XhpcTradebillUploadRecordDomain domain) throws Exception{
|
||||
LoginUser logUser = logUserUtils.getLogUser(request);
|
||||
domain.setTenantId(logUser.getTenantId());
|
||||
return AjaxResult.success(commonService.ossUpload(domain));
|
||||
return AjaxResult.success(commonService.ossUpload(request,response,domain));
|
||||
}
|
||||
|
||||
|
||||
@Log(title = "上传对账单(文件方式)", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/file/upload")
|
||||
public AjaxResult fileUpload(HttpServletRequest request, MultipartFile file, int type, String startTime, String endTime) throws Exception {
|
||||
public AjaxResult fileUpload(HttpServletRequest request, HttpServletResponse response, MultipartFile file, int type, String startTime, String endTime) throws Exception {
|
||||
if (file ==null || type < 1){
|
||||
return AjaxResult.error("文件或者对账类型为空");
|
||||
}
|
||||
LoginUser logUser = logUserUtils.getLogUser(request);
|
||||
|
||||
return AjaxResult.success(commonService.fileUpload(logUser.getTenantId(), file, type, startTime, endTime));
|
||||
return AjaxResult.success(commonService.fileUpload(request,response,"000000", file, type, startTime, endTime));
|
||||
}
|
||||
|
||||
@GetMapping("/file/getPage")
|
||||
|
||||
@ -35,10 +35,10 @@ public class XhpcTradebillInternetBillController extends BaseController {
|
||||
@RequestParam(required = false) String orderNumber,
|
||||
@RequestParam(required = false) String stationName,
|
||||
@RequestParam(required = false) String internetName,
|
||||
@RequestParam(required = false) Integer status){
|
||||
@RequestParam(required = false) Integer status) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("uploadId", uploadId);
|
||||
params.put("orderNumber",orderNumber);
|
||||
params.put("orderNumber", orderNumber);
|
||||
params.put("stationName", stationName);
|
||||
params.put("internetName", internetName);
|
||||
params.put("status", status);
|
||||
@ -46,19 +46,18 @@ public class XhpcTradebillInternetBillController extends BaseController {
|
||||
}
|
||||
|
||||
|
||||
|
||||
@GetMapping("/checkPage")
|
||||
public TableDataInfo getCheckPage(HttpServletRequest request,
|
||||
@RequestParam(required = false) String tenantId,
|
||||
@RequestParam(required = false) Long operatorId,
|
||||
@RequestParam(required = false) Long chargingStationId,
|
||||
@RequestParam(required = false) Integer uploadId,
|
||||
@RequestParam(required = false) Long operatorId,
|
||||
@RequestParam(required = false) Long chargingStationId,
|
||||
@RequestParam(required = false) Integer uploadId,
|
||||
@RequestParam(required = false) String orderNumber,
|
||||
@RequestParam(required = false) String station,
|
||||
@RequestParam(required = false) String internetName,
|
||||
@RequestParam(required = false) Integer status){
|
||||
@RequestParam(required = false) Integer status) {
|
||||
LoginUser loginUser = logUserUtils.getLogUser(request);
|
||||
if (StringUtils.isEmpty(tenantId)){
|
||||
if (StringUtils.isEmpty(tenantId)) {
|
||||
tenantId = loginUser.getTenantId();
|
||||
}
|
||||
|
||||
@ -67,7 +66,7 @@ public class XhpcTradebillInternetBillController extends BaseController {
|
||||
params.put("operatorId", operatorId);
|
||||
params.put("chargingStationId", chargingStationId);
|
||||
params.put("uploadId", uploadId);
|
||||
params.put("orderNumber",orderNumber);
|
||||
params.put("orderNumber", orderNumber);
|
||||
params.put("stationName", station);
|
||||
params.put("internetName", internetName);
|
||||
params.put("status", status);
|
||||
@ -85,9 +84,9 @@ public class XhpcTradebillInternetBillController extends BaseController {
|
||||
@RequestParam(required = false) String orderNumber,
|
||||
@RequestParam(required = false) String stationName,
|
||||
@RequestParam(required = false) String internetName,
|
||||
@RequestParam(required = false) Integer status){
|
||||
@RequestParam(required = false) Integer status) {
|
||||
LoginUser loginUser = logUserUtils.getLogUser(request);
|
||||
if (StringUtils.isEmpty(tenantId)){
|
||||
if (StringUtils.isEmpty(tenantId)) {
|
||||
tenantId = loginUser.getTenantId();
|
||||
}
|
||||
|
||||
@ -96,7 +95,7 @@ public class XhpcTradebillInternetBillController extends BaseController {
|
||||
params.put("operatorId", operatorId);
|
||||
params.put("chargingStationId", chargingStationId);
|
||||
params.put("uploadId", uploadId);
|
||||
params.put("orderNumber",orderNumber);
|
||||
params.put("orderNumber", orderNumber);
|
||||
params.put("stationName", stationName);
|
||||
params.put("internetName", internetName);
|
||||
params.put("status", status);
|
||||
@ -105,7 +104,7 @@ public class XhpcTradebillInternetBillController extends BaseController {
|
||||
|
||||
|
||||
@GetMapping("/checkInfo/{id}")
|
||||
public AjaxResult getCheckInfo(@PathVariable Integer id){
|
||||
public AjaxResult getCheckInfo(@PathVariable Integer id) {
|
||||
|
||||
return AjaxResult.success(internetBillService.getInfoByPk(id));
|
||||
}
|
||||
@ -113,7 +112,7 @@ public class XhpcTradebillInternetBillController extends BaseController {
|
||||
|
||||
@Log(title = "人工确认流量方对账数据", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/checkInfo")
|
||||
public AjaxResult updateCheckInfo(@RequestBody XhpcTradebillInternetCheckRecordDomain domain){
|
||||
public AjaxResult updateCheckInfo(@RequestBody XhpcTradebillInternetCheckRecordDomain domain) {
|
||||
|
||||
return AjaxResult.success(internetBillService.updateInfoByDomain(domain));
|
||||
}
|
||||
@ -130,7 +129,7 @@ public class XhpcTradebillInternetBillController extends BaseController {
|
||||
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("uploadId", uploadId);
|
||||
params.put("orderNumber",orderNumber);
|
||||
params.put("orderNumber", orderNumber);
|
||||
params.put("stationName", stationName);
|
||||
params.put("internetName", internetName);
|
||||
params.put("status", status);
|
||||
@ -138,4 +137,20 @@ public class XhpcTradebillInternetBillController extends BaseController {
|
||||
internetBillService.export(response, params);
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/getXhpcTradebillUploadRecordcheckPage")
|
||||
public TableDataInfo getXhpcTradebillUploadRecordcheckPage(HttpServletRequest request, HttpServletResponse response) {
|
||||
LoginUser loginUser = logUserUtils.getLogUser(request);
|
||||
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("userId", loginUser.getUserid());
|
||||
params.put("type", 0);
|
||||
if (loginUser.getUserid() != 0) {
|
||||
params.put("type", 1);
|
||||
}
|
||||
startPage();
|
||||
return getDataTable(internetBillService.getXhpcTradebillUploadRecordcheckPage(params));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -4,6 +4,7 @@ import lombok.Data;
|
||||
|
||||
import javax.persistence.Table;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
@ -43,11 +44,28 @@ public class XhpcTradebillUploadRecordDomain implements Serializable {
|
||||
|
||||
private String tenantId;
|
||||
|
||||
|
||||
private BigDecimal platformPower;
|
||||
private BigDecimal platformServer;
|
||||
private BigDecimal platformAmout;
|
||||
private BigDecimal platformDegree;
|
||||
private BigDecimal platformInternetCommission;
|
||||
private BigDecimal platformInternetSvcCommission;
|
||||
private BigDecimal platformInternetDegreeCommission;
|
||||
private BigDecimal platformInternetAmout;
|
||||
private BigDecimal platformActPower;
|
||||
private BigDecimal platformActServicePowe;
|
||||
private BigDecimal platformInternetSettlementAmout;
|
||||
private BigDecimal internetPower;
|
||||
private BigDecimal internetServer;
|
||||
private BigDecimal internetAmout;
|
||||
private BigDecimal internetDegree;
|
||||
private BigDecimal internetSettlementAmout;
|
||||
private Long userId;
|
||||
// === 时间区段内的订单,仅参数使用
|
||||
private String startTime;
|
||||
private String endTime;
|
||||
|
||||
private String reconciliationTime;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
||||
@ -10,7 +10,7 @@ import java.util.Map;
|
||||
@Mapper
|
||||
public interface XhpcDeviceMessageMapper {
|
||||
|
||||
List<Map<String, Object>> selectListByTypeAndSerialNumber(@Param("type") String type,
|
||||
List<Map<String, Object>> selectListByTypeAndSerialNumber(
|
||||
@Param("serialNumber")String serialNumber,
|
||||
@Param("startTime") String startTime,
|
||||
@Param("endTime") String endTime);
|
||||
|
||||
@ -41,4 +41,8 @@ public interface XhpcHistoryOrderMapper {
|
||||
@Param("endTime")String endTime,
|
||||
@Param("chargingMode") String chargingMode,
|
||||
@Param("tenantId")String tenantId);
|
||||
|
||||
//获取平台新电途订单
|
||||
List<Map<String,Object>> getListPage(@Param("totalOrderNos")List<String> totalOrderNos,@Param("type")Integer type);
|
||||
|
||||
}
|
||||
|
||||
@ -25,4 +25,6 @@ public interface XhpcTradebillUploadRecordMapper {
|
||||
int updateByPrimaryKey(XhpcTradebillUploadRecordDomain record);
|
||||
|
||||
List<XhpcTradebillUploadRecordDomain> selectByType(@Param("params") Map params);
|
||||
|
||||
List<XhpcTradebillUploadRecordDomain> getXhpcTradebillUploadRecordcheckPage(@Param("params") Map params);
|
||||
}
|
||||
@ -4,14 +4,16 @@ package com.xhpc.activity.service;
|
||||
import com.xhpc.activity.domain.XhpcTradebillUploadRecordDomain;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public interface CommonService {
|
||||
|
||||
XhpcTradebillUploadRecordDomain ossUpload(XhpcTradebillUploadRecordDomain domain) throws Exception;
|
||||
XhpcTradebillUploadRecordDomain ossUpload(HttpServletRequest request, HttpServletResponse response, XhpcTradebillUploadRecordDomain domain) throws Exception;
|
||||
|
||||
XhpcTradebillUploadRecordDomain fileUpload(String tenantId, MultipartFile file, int type, String startTime, String endTime) throws Exception;
|
||||
XhpcTradebillUploadRecordDomain fileUpload(HttpServletRequest request, HttpServletResponse response,String tenantId, MultipartFile file, int type, String startTime, String endTime) throws Exception;
|
||||
|
||||
List<XhpcTradebillUploadRecordDomain> getFilePage(Map<String, Object> params);
|
||||
}
|
||||
|
||||
@ -4,6 +4,7 @@ package com.xhpc.activity.service;
|
||||
import com.xhpc.activity.domain.XhpcTradebillInternetCheckRecordDomain;
|
||||
import com.xhpc.activity.domain.XhpcTradebillUploadRecordDomain;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.File;
|
||||
import java.util.List;
|
||||
@ -73,7 +74,7 @@ public interface InternetBillService {
|
||||
* @return 对账数据
|
||||
* @throws Exception 异常
|
||||
*/
|
||||
List<XhpcTradebillInternetCheckRecordDomain> getXDTInternetDataList(String fileUrl, String startTime, String endTime, String tenantId) throws Exception;
|
||||
void getXDTInternetDataList(HttpServletRequest request, HttpServletResponse response, String fileUrl, String startTime, String endTime, String tenantId) throws Exception;
|
||||
|
||||
|
||||
/**
|
||||
@ -82,7 +83,7 @@ public interface InternetBillService {
|
||||
* @return 对账数据
|
||||
* @throws Exception 异常
|
||||
*/
|
||||
List<XhpcTradebillInternetCheckRecordDomain> getXDTInternetDataList(File dataFile, String startTime, String endTime, String tenantId) throws Exception;
|
||||
void getXDTInternetDataList(HttpServletRequest request, HttpServletResponse response,File dataFile, String startTime, String endTime, String tenantId) throws Exception;
|
||||
|
||||
|
||||
|
||||
@ -111,4 +112,10 @@ public interface InternetBillService {
|
||||
* @throws Exception 异常
|
||||
*/
|
||||
void export(HttpServletResponse response, Map<String, Object> params) throws Exception;
|
||||
|
||||
|
||||
List<Map<String,Object>> getListPage(List<String> totalOrderNos,Integer type);
|
||||
|
||||
|
||||
List<XhpcTradebillUploadRecordDomain> getXhpcTradebillUploadRecordcheckPage(Map<String, Object> params);
|
||||
}
|
||||
|
||||
@ -16,6 +16,8 @@ import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.File;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
@ -40,7 +42,7 @@ public class CommonServiceImpl implements CommonService {
|
||||
AliOSSProperties ossProperties;
|
||||
|
||||
@Override
|
||||
public XhpcTradebillUploadRecordDomain ossUpload(XhpcTradebillUploadRecordDomain domain) throws Exception {
|
||||
public XhpcTradebillUploadRecordDomain ossUpload(HttpServletRequest request, HttpServletResponse response, XhpcTradebillUploadRecordDomain domain) throws Exception {
|
||||
|
||||
Long userId = SecurityUtils.getUserId();
|
||||
domain.setCreateBy(userId);
|
||||
@ -53,7 +55,7 @@ public class CommonServiceImpl implements CommonService {
|
||||
domain.setFailCount(0);
|
||||
domain.setUncheckCount(0);
|
||||
domain.setCheckedCount(0);
|
||||
uploadRecordMapper.insertSelective(domain);
|
||||
// uploadRecordMapper.insertSelective(domain);
|
||||
|
||||
List<XhpcTradebillPaymentCheckRecordDomain> paymentCheckRecordDomainList = null;
|
||||
List<XhpcTradebillInternetCheckRecordDomain> recordDomainList = null;
|
||||
@ -90,9 +92,9 @@ public class CommonServiceImpl implements CommonService {
|
||||
break;
|
||||
case 7:
|
||||
// 新电途
|
||||
recordDomainList = internetBillService.getXDTInternetDataList(domain.getUrl(), domain.getStartTime(), domain.getEndTime(), domain.getTenantId());
|
||||
insertCount = internetBillService.insertInternetCheckList(domain, recordDomainList);
|
||||
totalMap = computeInternetRecord(recordDomainList);
|
||||
internetBillService.getXDTInternetDataList(request,response,domain.getUrl(), domain.getStartTime(), domain.getEndTime(), domain.getTenantId());
|
||||
// insertCount = internetBillService.insertInternetCheckList(domain, recordDomainList);
|
||||
// totalMap = computeInternetRecord(recordDomainList);
|
||||
break;
|
||||
case 8:
|
||||
// 快电
|
||||
@ -113,7 +115,7 @@ public class CommonServiceImpl implements CommonService {
|
||||
domain.setFailCount(totalMap.get("failCount"));
|
||||
domain.setCheckedCount(totalMap.get("checkCount"));
|
||||
domain.setUncheckCount(totalMap.get("uncheckCount"));
|
||||
uploadRecordMapper.updateByPrimaryKey(domain);
|
||||
//uploadRecordMapper.updateByPrimaryKey(domain);
|
||||
return domain;
|
||||
} catch (Exception exception){
|
||||
exception.printStackTrace();
|
||||
@ -124,7 +126,7 @@ public class CommonServiceImpl implements CommonService {
|
||||
|
||||
|
||||
@Override
|
||||
public XhpcTradebillUploadRecordDomain fileUpload(String tenantId, MultipartFile file, int type, String startTime, String endTime) throws Exception {
|
||||
public XhpcTradebillUploadRecordDomain fileUpload(HttpServletRequest request, HttpServletResponse response,String tenantId, MultipartFile file, int type, String startTime, String endTime) throws Exception {
|
||||
|
||||
XhpcTradebillUploadRecordDomain domain = new XhpcTradebillUploadRecordDomain();
|
||||
// 创建OSSClient实例
|
||||
@ -146,7 +148,7 @@ public class CommonServiceImpl implements CommonService {
|
||||
domain.setEndTime(endTime);
|
||||
domain.setType(type);
|
||||
domain.setTenantId(tenantId);
|
||||
return ossUpload(domain);
|
||||
return ossUpload(request,response,domain);
|
||||
} catch (Exception exception){
|
||||
throw new CustomException("服务错误");
|
||||
}
|
||||
|
||||
@ -7,7 +7,14 @@ import cn.hutool.core.text.csv.CsvReader;
|
||||
import cn.hutool.core.text.csv.CsvUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.poi.excel.ExcelWriter;
|
||||
import com.aliyun.oss.OSS;
|
||||
import com.aliyun.oss.OSSClientBuilder;
|
||||
import com.aliyun.oss.model.PutObjectResult;
|
||||
import com.xhpc.activity.config.AliOSSProperties;
|
||||
import com.xhpc.activity.domain.XhpcTradebillUploadRecordDomain;
|
||||
import com.xhpc.activity.mapper.XhpcTradebillUploadRecordMapper;
|
||||
import com.xhpc.activity.utils.ExcelExp;
|
||||
import com.xhpc.activity.utils.ExcelUtilYu;
|
||||
import com.xhpc.common.core.exception.CustomException;
|
||||
import com.xhpc.common.core.utils.SecurityUtils;
|
||||
import com.xhpc.common.core.utils.poi.ExcelUtil;
|
||||
@ -22,15 +29,20 @@ import com.xhpc.activity.vo.KDTradebillVo;
|
||||
import com.xhpc.activity.vo.XDTTradebillVo;
|
||||
import com.xhpc.activity.vo.XJTradeBillVo;
|
||||
import com.xhpc.common.security.service.TokenService;
|
||||
import com.xhpc.common.util.LogUserUtils;
|
||||
import com.xhpc.common.util.UserTypeUtil;
|
||||
import com.xhpc.system.api.domain.SysUser;
|
||||
import com.xhpc.system.api.model.LoginUser;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.ServletOutputStream;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.math.BigDecimal;
|
||||
@ -42,7 +54,8 @@ import java.util.stream.Collectors;
|
||||
@Slf4j
|
||||
@Service
|
||||
public class InternetBillServiceImpl implements InternetBillService {
|
||||
|
||||
@Resource
|
||||
LogUserUtils logUserUtils;
|
||||
@Resource
|
||||
XhpcTradebillInternetCheckRecordMapper internetCheckRecordMapper;
|
||||
|
||||
@ -52,6 +65,11 @@ public class InternetBillServiceImpl implements InternetBillService {
|
||||
@Resource
|
||||
TokenService tokenService;
|
||||
|
||||
@Resource
|
||||
XhpcTradebillUploadRecordMapper uploadRecordMapper;
|
||||
|
||||
@Resource
|
||||
AliOSSProperties ossProperties;
|
||||
|
||||
@Override
|
||||
public XhpcTradebillInternetCheckRecordDomain getInfoByPk(int pk) {
|
||||
@ -200,10 +218,10 @@ public class InternetBillServiceImpl implements InternetBillService {
|
||||
* @throws Exception 异常
|
||||
*/
|
||||
@Override
|
||||
public List<XhpcTradebillInternetCheckRecordDomain> getXDTInternetDataList(String fileUrl, String startTime, String endTime, String tenantId) throws Exception {
|
||||
public void getXDTInternetDataList(HttpServletRequest request, HttpServletResponse response, String fileUrl, String startTime, String endTime, String tenantId) throws Exception {
|
||||
|
||||
File dataFile = DownloadUtil.downloadFile(fileUrl);
|
||||
return getXDTInternetDataList(dataFile, startTime, endTime, tenantId);
|
||||
getXDTInternetDataList(request,response,dataFile, startTime, endTime, tenantId);
|
||||
}
|
||||
|
||||
|
||||
@ -368,10 +386,10 @@ public class InternetBillServiceImpl implements InternetBillService {
|
||||
* @return 对账数据
|
||||
*/
|
||||
@Override
|
||||
public List<XhpcTradebillInternetCheckRecordDomain> getXDTInternetDataList(File dataFile, String startTime, String endTime, String tenantId) throws Exception {
|
||||
public void getXDTInternetDataList(HttpServletRequest request, HttpServletResponse response, File dataFile, String startTime, String endTime, String tenantId) throws Exception {
|
||||
|
||||
String suffix = dataFile.getName().substring(dataFile.getName().lastIndexOf(".") + 1);
|
||||
List<XhpcTradebillInternetCheckRecordDomain> checkRecordDomainList = new ArrayList<>();
|
||||
XhpcTradebillUploadRecordDomain xhpcTradebillUploadRecordDomain = new XhpcTradebillUploadRecordDomain();
|
||||
List<XDTTradebillVo> xdtTradebillVoList = new ArrayList<>();
|
||||
|
||||
List<String> serialNumberList = new ArrayList<>();
|
||||
@ -395,36 +413,156 @@ public class InternetBillServiceImpl implements InternetBillService {
|
||||
throw new CustomException("文件数据不合规,请检查");
|
||||
}
|
||||
|
||||
// String path = "/www/wwwroot/scxhua.cn/dist/moban/xindiantuzuizhangdan.xlsx";
|
||||
// String path = "/www/wwwroot/scxhua.cn/dist/moban/xindiantuzuizhangdan.xlsx";
|
||||
String path ="H:\\home\\xindiantuzuizhangdan.xlsx";
|
||||
|
||||
//新电途--总电费
|
||||
BigDecimal totalPowerAmount = new BigDecimal(0);
|
||||
//新电途--总服务费
|
||||
BigDecimal totalServerAmount = new BigDecimal(0);
|
||||
//新电途--总电量
|
||||
BigDecimal totalChargingDegree = new BigDecimal(0);
|
||||
//新电途--总流里方结算平台金额
|
||||
BigDecimal totalPayAmount = new BigDecimal(0);
|
||||
//新电途--总订单号
|
||||
List<String> totalOrderNo = new ArrayList<>();
|
||||
for (XDTTradebillVo vo : xdtTradebillVoList) {
|
||||
XhpcTradebillInternetCheckRecordDomain domain = new XhpcTradebillInternetCheckRecordDomain();
|
||||
domain.setPlatformInternetSerialNumber(vo.getOrderNo().trim());
|
||||
domain.setInternetSerialNumber(vo.getOrderNo().trim());
|
||||
domain.setSource("新电途");
|
||||
domain.setInternetName("新电途");
|
||||
domain.setInternetChargeStation(vo.getStationName());
|
||||
|
||||
BigDecimal chargingDegree = vo.getChargingDegree() != null ? BigDecimal.valueOf(vo.getChargingDegree()) : BigDecimal.ZERO;
|
||||
domain.setInternetChargingDegree(chargingDegree);
|
||||
|
||||
BigDecimal orderAmount = vo.getOrderAmount() != null ? BigDecimal.valueOf(vo.getOrderAmount()) : BigDecimal.ZERO;
|
||||
domain.setInternetOrderAmount(orderAmount);
|
||||
|
||||
BigDecimal powerAmount = vo.getPowerAmount() != null ? BigDecimal.valueOf(vo.getPowerAmount()) : BigDecimal.ZERO;
|
||||
domain.setInternetPowerAmount(powerAmount);
|
||||
|
||||
BigDecimal serverAmount = vo.getServerAmount() != null ? BigDecimal.valueOf(vo.getServerAmount()) : BigDecimal.ZERO;
|
||||
domain.setInternetServerAmount(serverAmount);
|
||||
domain.setInternetDiscountAmount(BigDecimal.ZERO);
|
||||
|
||||
BigDecimal payAmount = vo.getPayAmount() != null ? BigDecimal.valueOf(vo.getPayAmount()) : BigDecimal.ZERO;
|
||||
domain.setInternetPayAmount(payAmount);
|
||||
|
||||
serialNumberList.add(domain.getInternetSerialNumber());
|
||||
// getHistoryOrderInfo(domain);
|
||||
checkRecordDomainList.add(domain);
|
||||
if(vo.getPowerAmount()!=null){
|
||||
totalPowerAmount =totalPowerAmount.add(BigDecimal.valueOf(vo.getPowerAmount()));
|
||||
}
|
||||
if(vo.getServerAmount()!=null){
|
||||
totalServerAmount =totalServerAmount.add(BigDecimal.valueOf(vo.getServerAmount()));
|
||||
}
|
||||
if(vo.getChargingDegree()!=null){
|
||||
totalChargingDegree =totalChargingDegree.add(BigDecimal.valueOf(vo.getChargingDegree()));
|
||||
}
|
||||
if(vo.getPayAmount()!=null){
|
||||
totalPayAmount =totalPayAmount.add(BigDecimal.valueOf(vo.getPayAmount()));
|
||||
}
|
||||
totalOrderNo.add(vo.getOrderNo().trim());
|
||||
}
|
||||
getHistoryOrderList(checkRecordDomainList, serialNumberList, "3", startTime, endTime, tenantId);
|
||||
return checkRecordDomainList;
|
||||
//获取平台新电途订单
|
||||
List<Map<String, Object>> listPage = historyOrderMapper.getListPage(totalOrderNo, 3);
|
||||
//平台--总电费
|
||||
BigDecimal totalPlatformPowerAmount = new BigDecimal(0);
|
||||
//平台--总服务费
|
||||
BigDecimal totalPlatformServerAmount = new BigDecimal(0);
|
||||
//平台--总电量
|
||||
BigDecimal totalPlatformChargingDegree = new BigDecimal(0);
|
||||
//平台--流里方总金额抽成
|
||||
BigDecimal totalPlatformInternetCommission = new BigDecimal(0);
|
||||
//平台--流里方服务费抽成
|
||||
BigDecimal totalPlatformInternetSvcCommission = new BigDecimal(0);
|
||||
//平台--流里方电量抽成
|
||||
BigDecimal totalPlatformInternetDegreeCommissione = new BigDecimal(0);
|
||||
//平台--实收电费
|
||||
BigDecimal totalPlatformActPowerPrice = new BigDecimal(0);
|
||||
//平台--实收服务费
|
||||
BigDecimal totalPlatformActServicePrice = new BigDecimal(0);
|
||||
//新电途--总流里方结算平台金额
|
||||
BigDecimal totalPlatformPayAmount = new BigDecimal(0);
|
||||
for (Map<String, Object> vo : listPage) {
|
||||
totalPlatformPowerAmount =totalPlatformPowerAmount.add(new BigDecimal(vo.get("powerPriceTotal").toString()));
|
||||
totalPlatformServerAmount =totalPlatformServerAmount.add(new BigDecimal(vo.get("servicePriceTotal").toString()));
|
||||
totalPlatformChargingDegree =totalPlatformChargingDegree.add(new BigDecimal(vo.get("chargingDegree").toString()));
|
||||
totalPlatformInternetCommission =totalPlatformInternetCommission.add(new BigDecimal(vo.get("internetCommission").toString()));
|
||||
totalPlatformInternetSvcCommission =totalPlatformInternetSvcCommission.add(new BigDecimal(vo.get("internetSvcCommission").toString()));
|
||||
totalPlatformInternetDegreeCommissione =totalPlatformInternetDegreeCommissione.add(new BigDecimal(vo.get("internetDegreeCommission").toString()));
|
||||
totalPlatformActPowerPrice =totalPlatformActPowerPrice.add(new BigDecimal(vo.get("actPowerPrice").toString()));
|
||||
totalPlatformActServicePrice =totalPlatformActServicePrice.add(new BigDecimal(vo.get("actServicePrice").toString()));
|
||||
totalPlatformPayAmount =totalPlatformPayAmount.add(new BigDecimal(vo.get("actPrice").toString()));
|
||||
}
|
||||
|
||||
List<Map<String,Object>> mapList =new ArrayList<>();
|
||||
Map<String,Object> objectMap =new HashMap<>();
|
||||
objectMap.put("PowerAmount",totalPlatformPowerAmount);
|
||||
objectMap.put("ServerAmount",totalPlatformServerAmount);
|
||||
objectMap.put("totalAmount",totalPlatformPowerAmount.add(totalPlatformServerAmount));
|
||||
objectMap.put("ChargingDegree",totalPlatformChargingDegree);
|
||||
objectMap.put("InternetCommission",totalPlatformInternetCommission);
|
||||
objectMap.put("InternetSvcCommission",totalPlatformInternetSvcCommission);
|
||||
objectMap.put("InternetDegreeCommissione",totalPlatformInternetDegreeCommissione);
|
||||
objectMap.put("totalInternetAmount",totalPlatformInternetCommission.add(totalPlatformInternetSvcCommission.add(totalPlatformInternetDegreeCommissione)));
|
||||
objectMap.put("ActPowerPrice",totalPlatformActPowerPrice);
|
||||
objectMap.put("ActServicePrice",totalPlatformActServicePrice);
|
||||
objectMap.put("totalInternetSettlementAmount",totalPlatformActServicePrice.add(totalPlatformActPowerPrice));
|
||||
objectMap.put("totalPowerAmount",totalPowerAmount);
|
||||
objectMap.put("totalServerAmount",totalServerAmount);
|
||||
objectMap.put("InternetSettlementAmount",totalPowerAmount.add(totalServerAmount));
|
||||
objectMap.put("totalChargingDegree",totalChargingDegree);
|
||||
objectMap.put("totalPayAmount",totalPayAmount);
|
||||
mapList.add(objectMap);
|
||||
|
||||
|
||||
List<ExcelExp> list =new ArrayList<>();
|
||||
|
||||
String suzu0[]={"PowerAmount","ServerAmount","totalAmount","ChargingDegree","InternetCommission","InternetSvcCommission","InternetDegreeCommissione","totalInternetAmount","ActPowerPrice","ActServicePrice","totalInternetSettlementAmount","totalPowerAmount","totalServerAmount","InternetSettlementAmount","totalChargingDegree","totalPayAmount"};
|
||||
ExcelExp excelExp0 = new ExcelExp("翔桦与新电途对账统计表", suzu0, mapList, "翔桦与新电途对账统计表");
|
||||
|
||||
String suzu1[]={"orderNo","stationName","city","exceptionType","transactionType","paymentType","settlementType","settlementTime","orderAmount","orderUserAmount","offlineAmount","userAmount","badDebt","placeholderBadDebt","platformBadDebt","businessMoney","platformMoney","platformMoneyDifference","platformIncomeMoney","platformProfitSharingMoney","platformServerMoney","payAmount","chargingDegree","powerAmount","serverAmount","surchargeAmount","settlementRules","stationOrder","notes","orderCreateTime","orderType"};
|
||||
ExcelExp excelExp1 = new ExcelExp("新电途对账单", suzu1, xdtTradebillVoList, "新电途对账单",3);
|
||||
|
||||
String suzu2[]={"serialNumber","internetSerialNumber","chargingStationName","pileSerialNumber","terminalName","power","startSoc","endSoc","powerPriceTotal","servicePriceTotal","totalPrice","activityPowerPriceTotal","activityServicePriceTotal","activityTotalPrice","promotionDiscount","actPrice","internetCommission","internetSvcCommission","internetDegreeCommission","platformCommission","platformSvcCommisssion","operationCommission","operationSvcCommission","actPowerPrice","actServicePrice","actSumPrice","totalPrice","actPrice","chargingTime","chargingDegree","startTime","endTime","chargingModeName"};
|
||||
ExcelExp excelExp2 = new ExcelExp("四川翔桦科技有限公司平台对账单", suzu2, listPage, "四川翔桦科技有限公司平台对账单");
|
||||
|
||||
list.add(excelExp0);
|
||||
list.add(excelExp1);
|
||||
list.add(excelExp2);
|
||||
|
||||
XSSFWorkbook workbook = ExcelUtilYu.importExcelByOriginYu(response, request, "四川翔桦科技有限公司-新电途与平台对账单.xlsx", path, list, 0, "xlsx", "四川翔桦科技有限公司-新电途与平台对账单", 2);
|
||||
|
||||
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
|
||||
workbook.write(byteArrayOutputStream);
|
||||
byte[] byteArray = byteArrayOutputStream.toByteArray();
|
||||
|
||||
String endpoint = "https://oss-cn-hangzhou.aliyuncs.com";
|
||||
|
||||
String bucketName = "xhpc-bucket1";
|
||||
String objectName = "exampledir/四川翔桦科技有限公司-新电途与平台对账单_"+ com.xhpc.common.util.DateUtil.date2String(new Date(), com.xhpc.common.util.DateUtil.DEFAULT_DATE_FORMAT) +".xlsx";
|
||||
OSS ossClient = new OSSClientBuilder().build(endpoint, ossProperties.getAccessKey(), ossProperties.getSecretKey());
|
||||
String url ="https://xhpc-bucket1.oss-cn-hangzhou.aliyuncs.com/"+objectName;
|
||||
try{
|
||||
PutObjectResult putObjectResult = ossClient.putObject(bucketName, objectName, new ByteArrayInputStream(byteArray));
|
||||
System.out.println("putObjectResult="+putObjectResult.toString());
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
}finally {
|
||||
if (ossClient != null) {
|
||||
ossClient.shutdown();
|
||||
}
|
||||
}
|
||||
xhpcTradebillUploadRecordDomain.setSource("平台上传");
|
||||
xhpcTradebillUploadRecordDomain.setFileName("新电途对账单");
|
||||
xhpcTradebillUploadRecordDomain.setDelFlag(0);
|
||||
xhpcTradebillUploadRecordDomain.setUrl(url);
|
||||
xhpcTradebillUploadRecordDomain.setType(7);
|
||||
xhpcTradebillUploadRecordDomain.setStatus(0);
|
||||
xhpcTradebillUploadRecordDomain.setSuccessCount(0);
|
||||
xhpcTradebillUploadRecordDomain.setFailCount(0);
|
||||
xhpcTradebillUploadRecordDomain.setUncheckCount(0);
|
||||
xhpcTradebillUploadRecordDomain.setCheckedCount(0);
|
||||
xhpcTradebillUploadRecordDomain.setPlatformPower(totalPlatformPowerAmount);
|
||||
xhpcTradebillUploadRecordDomain.setPlatformServer(totalPlatformServerAmount);
|
||||
xhpcTradebillUploadRecordDomain.setPlatformAmout(totalPlatformPowerAmount.add(totalPlatformServerAmount));
|
||||
xhpcTradebillUploadRecordDomain.setPlatformDegree(totalPlatformChargingDegree);
|
||||
xhpcTradebillUploadRecordDomain.setPlatformInternetCommission(totalPlatformInternetCommission);
|
||||
xhpcTradebillUploadRecordDomain.setPlatformInternetSvcCommission(totalPlatformInternetSvcCommission);
|
||||
xhpcTradebillUploadRecordDomain.setPlatformInternetDegreeCommission(totalPlatformInternetDegreeCommissione);
|
||||
xhpcTradebillUploadRecordDomain.setPlatformInternetAmout(totalPlatformInternetCommission.add(totalPlatformInternetSvcCommission.add(totalPlatformInternetDegreeCommissione)));
|
||||
xhpcTradebillUploadRecordDomain.setPlatformActPower(totalPlatformActPowerPrice);
|
||||
xhpcTradebillUploadRecordDomain.setPlatformActServicePowe(totalPlatformActServicePrice);
|
||||
xhpcTradebillUploadRecordDomain.setPlatformInternetSettlementAmout(totalPlatformActServicePrice.add(totalPlatformActPowerPrice));
|
||||
xhpcTradebillUploadRecordDomain.setInternetPower(totalPowerAmount);
|
||||
xhpcTradebillUploadRecordDomain.setInternetServer(totalServerAmount);
|
||||
xhpcTradebillUploadRecordDomain.setInternetAmout(totalPowerAmount.add(totalServerAmount));
|
||||
xhpcTradebillUploadRecordDomain.setInternetDegree(totalChargingDegree);
|
||||
xhpcTradebillUploadRecordDomain.setInternetSettlementAmout(totalPayAmount);
|
||||
LoginUser logUser = logUserUtils.getLogUser(request);
|
||||
xhpcTradebillUploadRecordDomain.setUserId(logUser.getUserid());
|
||||
xhpcTradebillUploadRecordDomain.setReconciliationTime(startTime);
|
||||
uploadRecordMapper.insertSelective(xhpcTradebillUploadRecordDomain);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@ -510,7 +648,7 @@ public class InternetBillServiceImpl implements InternetBillService {
|
||||
|
||||
List<Map<String, Object>> list = internetCheckRecordMapper.selectByParams(params);
|
||||
|
||||
// 通过工具类创建writer,默认创建xls格式
|
||||
// 通过工具类创建writer,默认创建xls格式
|
||||
ExcelWriter writer = cn.hutool.poi.excel.ExcelUtil.getWriter(true);
|
||||
writer.addHeaderAlias("internet_name", "流量方名称");
|
||||
writer.addHeaderAlias("user_id", "用户账号");
|
||||
@ -557,6 +695,16 @@ public class InternetBillServiceImpl implements InternetBillService {
|
||||
IoUtil.close(out);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Map<String, Object>> getListPage(List<String> totalOrderNos, Integer type) {
|
||||
return historyOrderMapper.getListPage(totalOrderNos,type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<XhpcTradebillUploadRecordDomain> getXhpcTradebillUploadRecordcheckPage(Map<String, Object> params) {
|
||||
return uploadRecordMapper.getXhpcTradebillUploadRecordcheckPage(params);
|
||||
}
|
||||
|
||||
|
||||
private void getHistoryOrderInfo(XhpcTradebillInternetCheckRecordDomain domain) {
|
||||
|
||||
|
||||
@ -74,7 +74,7 @@ public class PileLogServiceImpl extends BaseService implements PileLogService {
|
||||
|
||||
@Override
|
||||
public List<Map<String, Object>> getPileRunLogPage(String pileId, String startTime, String endTime){
|
||||
return deviceMessageMapper.selectListByTypeAndSerialNumber(StationDeviceEnum.PILE.getCode(), pileId, startTime, endTime);
|
||||
return deviceMessageMapper.selectListByTypeAndSerialNumber( pileId, startTime, endTime);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -187,8 +187,40 @@ public class XhpcClearingCheckoutServiceImpl extends BaseService implements Xhpc
|
||||
|
||||
List<CheckoutBankVo> list = checkoutMapper.selectOrderMapByCheckoutIds(checkoutIds);
|
||||
|
||||
com.xhpc.common.core.utils.poi.ExcelUtil<CheckoutBankVo> util = new com.xhpc.common.core.utils.poi.ExcelUtil<CheckoutBankVo>(CheckoutBankVo.class);
|
||||
util.exportExcel(response, list, "待提现订单列表");
|
||||
BigExcelWriter writer = ExcelUtil.getBigWriter("xhpc_clearing_checkout" + System.currentTimeMillis() + ".xlsx");
|
||||
|
||||
writer.addHeaderAlias("curreyType", "币种");
|
||||
writer.addHeaderAlias("date", "日期");
|
||||
writer.addHeaderAlias("detailFlag", "明细标志");
|
||||
writer.addHeaderAlias("index", "顺序号");
|
||||
writer.addHeaderAlias("payBank", "付款帐号开户行");
|
||||
writer.addHeaderAlias("payBankAccount", "付款帐号/卡号");
|
||||
writer.addHeaderAlias("payBankName", "付款账号名称/卡名称");
|
||||
writer.addHeaderAlias("receiveBank", "收款账号开户行");
|
||||
writer.addHeaderAlias("receiveProvice", "收款账号省份");
|
||||
writer.addHeaderAlias("receiveCity", "收款账号地市");
|
||||
writer.addHeaderAlias("receiveCode", "收款账号地区码");
|
||||
writer.addHeaderAlias("receiveAccount", "收款账号");
|
||||
writer.addHeaderAlias("receiveName", "收款账号名称");
|
||||
writer.addHeaderAlias("amount", "金额");
|
||||
writer.addHeaderAlias("purposes", "汇款用途");
|
||||
writer.addHeaderAlias("remark", "备注信息");
|
||||
writer.addHeaderAlias("transType", "汇款方式");
|
||||
writer.addHeaderAlias("mobile", "收款账户短信通知手机号");
|
||||
writer.addHeaderAlias("customeIndex", "自定义序号");
|
||||
writer.addHeaderAlias("applyCheckNo", "预先审批编号");
|
||||
|
||||
writer.setOnlyAlias(true);
|
||||
writer.write(list, true);
|
||||
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
||||
response.setCharacterEncoding("utf-8");
|
||||
ServletOutputStream out = response.getOutputStream();
|
||||
writer.flush(out, true);
|
||||
writer.close();
|
||||
IoUtil.close(out);
|
||||
|
||||
// com.xhpc.common.core.utils.poi.ExcelUtil<CheckoutBankVo> util = new com.xhpc.common.core.utils.poi.ExcelUtil<CheckoutBankVo>(CheckoutBankVo.class);
|
||||
// util.exportExcel(response, list, "待提现订单列表");
|
||||
|
||||
// ExcelWriter writer = ExcelUtil.getWriter(true);
|
||||
// writer.addHeaderAlias("curreyType", "币种");
|
||||
|
||||
@ -0,0 +1,74 @@
|
||||
package com.xhpc.activity.utils;
|
||||
|
||||
import com.xhpc.activity.vo.XDTTradebillVo;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author yuyang
|
||||
* @date 2023-03-01 15:34
|
||||
*/
|
||||
public class ExcelExp {
|
||||
private String fileName;// sheet的名称
|
||||
private String[] handers;// sheet里的标题
|
||||
private List<Map<String, Object>> dataset;// sheet里的数据集
|
||||
|
||||
private List<XDTTradebillVo> xdtTradebillVoList;// sheet里的数据集
|
||||
private String tableName;
|
||||
|
||||
private Integer type;
|
||||
|
||||
public ExcelExp(String fileName, String[] handers, List<Map<String, Object>> dataset, String tableName) {
|
||||
this.fileName = fileName;
|
||||
this.handers = handers;
|
||||
this.dataset = dataset;
|
||||
this.tableName = tableName;
|
||||
}
|
||||
|
||||
public ExcelExp(String fileName, String[] handers, List<XDTTradebillVo> xdtTradebillVoList, String tableName,Integer type) {
|
||||
this.fileName = fileName;
|
||||
this.handers = handers;
|
||||
this.xdtTradebillVoList = xdtTradebillVoList;
|
||||
this.tableName = tableName;
|
||||
}
|
||||
public String getFileName() {
|
||||
return fileName;
|
||||
}
|
||||
|
||||
public void setFileName(String fileName) {
|
||||
this.fileName = fileName;
|
||||
}
|
||||
|
||||
public String[] getHanders() {
|
||||
return handers;
|
||||
}
|
||||
|
||||
public void setHanders(String[] handers) {
|
||||
this.handers = handers;
|
||||
}
|
||||
|
||||
public List<Map<String, Object>> getDataset() {
|
||||
return dataset;
|
||||
}
|
||||
|
||||
public void setDataset(List<Map<String, Object>> dataset) {
|
||||
this.dataset = dataset;
|
||||
}
|
||||
|
||||
public String getTableName() {
|
||||
return tableName;
|
||||
}
|
||||
|
||||
public void setTableName(String tableName) {
|
||||
this.tableName = tableName;
|
||||
}
|
||||
|
||||
public List<XDTTradebillVo> getXdtTradebillVoList() {
|
||||
return xdtTradebillVoList;
|
||||
}
|
||||
|
||||
public void setXdtTradebillVoList(List<XDTTradebillVo> xdtTradebillVoList) {
|
||||
this.xdtTradebillVoList = xdtTradebillVoList;
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@ -13,94 +13,98 @@ import java.util.Date;
|
||||
@Data
|
||||
public class XDTTradebillVo {
|
||||
|
||||
@Excel(name = "订单时间")
|
||||
@Alias("订单时间")
|
||||
private Date orderTime;
|
||||
|
||||
@Excel(name = "订单号")
|
||||
@Alias("订单号")
|
||||
@Excel(name = "第三方订单号")
|
||||
@Alias("第三方订单号")
|
||||
private String orderNo = "";
|
||||
|
||||
@Excel(name = "订单类型")
|
||||
@Alias("订单类型")
|
||||
private String orderType = "";
|
||||
@Excel(name = "场站")
|
||||
@Alias("场站")
|
||||
private String stationName = "";
|
||||
|
||||
@Excel(name = "城市名称")
|
||||
@Alias("城市名称")
|
||||
private String city = "";
|
||||
|
||||
@Excel(name = "异常类型")
|
||||
@Alias("异常类型")
|
||||
private String exceptionType = "";
|
||||
|
||||
@Excel(name = "城市")
|
||||
@Alias("城市")
|
||||
private String city = "";
|
||||
@Excel(name = "交易类型")
|
||||
@Alias("交易类型")
|
||||
private String transactionType = "";
|
||||
|
||||
@Excel(name = "站点名称")
|
||||
@Alias("站点名称")
|
||||
private String stationName = "";
|
||||
@Excel(name = "付款类型")
|
||||
@Alias("付款类型")
|
||||
private String paymentType = "";
|
||||
|
||||
@Excel(name = "结算状态")
|
||||
@Alias("结算状态")
|
||||
private String settlementType = "";
|
||||
|
||||
@Excel(name = "结算账单日")
|
||||
@Alias("结算账单日")
|
||||
private String settlementTime = "";
|
||||
|
||||
@Excel(name = "结算订单金额")
|
||||
@Alias("结算订单金额")
|
||||
private Double orderAmount = 0.0;
|
||||
|
||||
@Excel(name = "结算用户实付金额")
|
||||
@Alias("结算用户实付金额")
|
||||
private Double orderUserAmount = 0.0;
|
||||
|
||||
@Excel(name = "线下支付金额")
|
||||
@Alias("线下支付金额")
|
||||
private Double offlineAmount = 0.0;
|
||||
|
||||
@Excel(name = "用户待付金额")
|
||||
@Alias("用户待付金额")
|
||||
private Double userAmount = 0.0;
|
||||
|
||||
@Excel(name = "充电坏账承担方")
|
||||
@Alias("充电坏账承担方")
|
||||
private String badDebt = "";
|
||||
|
||||
@Excel(name = "占位坏账承担方")
|
||||
@Alias("占位坏账承担方")
|
||||
private String placeholderBadDebt = "";
|
||||
|
||||
@Excel(name = "平台承担坏账金额")
|
||||
@Alias("平台承担坏账金额")
|
||||
private Double platformBadDebt = 0.0;
|
||||
|
||||
@Excel(name = "商家支出")
|
||||
@Alias("商家支出")
|
||||
private Double businessMoney = 0.0;
|
||||
|
||||
@Excel(name = "平台承担费用")
|
||||
@Alias("平台承担费用")
|
||||
private Double platformMoney = 0.0;
|
||||
|
||||
@Excel(name = "平台费用总税差")
|
||||
@Alias("平台费用总税差")
|
||||
private Double platformMoneyDifference = 0.0;
|
||||
|
||||
@Excel(name = "平台收入金额")
|
||||
@Alias("平台收入金额")
|
||||
private Double platformIncomeMoney = 0.0;
|
||||
|
||||
@Excel(name = "平台分润金额")
|
||||
@Alias("平台分润金额")
|
||||
private Double platformProfitSharingMoney = 0.0;
|
||||
|
||||
@Excel(name = "平台服务费金额")
|
||||
@Alias("平台服务费金额")
|
||||
private Double platformServerMoney = 0.0;
|
||||
|
||||
@Excel(name = "商家结算金额")
|
||||
@Alias("商家结算金额")
|
||||
private Double payAmount = 0.0;
|
||||
|
||||
@Excel(name = "充电量")
|
||||
@Alias("充电量")
|
||||
private Double chargingDegree = 0.0;
|
||||
|
||||
@Excel(name = "订单金额")
|
||||
@Alias("订单金额")
|
||||
private Double orderAmount = 0.0;
|
||||
|
||||
@Excel(name = "运营商承担费用")
|
||||
@Alias("运营商承担费用")
|
||||
private Double operatorCost = 0.0;
|
||||
|
||||
@Excel(name = "新电途承担费用")
|
||||
@Alias("新电途承担费用")
|
||||
private Double xdtCost = 0.0;
|
||||
|
||||
@Excel(name = "本期新电途补贴金额")
|
||||
@Alias("本期新电途补贴金额")
|
||||
private Double xdtSubsidyAmount = 0.0;
|
||||
|
||||
@Excel(name = "历史新电途补贴金额")
|
||||
@Alias("历史新电途补贴金额")
|
||||
private Double xdtHistorySubsidyAmount = 0.0;
|
||||
|
||||
@Excel(name = "本期用户实付金额")
|
||||
@Alias("本期用户实付金额")
|
||||
private Double payAmount = 0.0;
|
||||
|
||||
@Excel(name = "历史用户实付金额")
|
||||
@Alias("历史用户实付金额")
|
||||
private Double payHistoryAmount = 0.0;
|
||||
|
||||
@Excel(name = "未结清金额")
|
||||
@Alias("未结清金额")
|
||||
private Double outStandingAmount = 0.0;
|
||||
|
||||
@Excel(name = "坏账金额")
|
||||
@Alias("坏账金额")
|
||||
private Double badDebtsAmount = 0.0;
|
||||
|
||||
@Excel(name = "新电途线上分润金额")
|
||||
@Alias("新电途线上分润金额")
|
||||
private Double xdtOnlineAmount = 0.0;
|
||||
|
||||
@Excel(name = "新电途线下分润金额")
|
||||
@Alias("新电途线下分润金额")
|
||||
private Double xdtOfflineAmount = 0.0;
|
||||
|
||||
@Excel(name = "本期支付手续费")
|
||||
@Alias("本期支付手续费")
|
||||
private Double handlingFeeAmount = 0.0;
|
||||
|
||||
@Excel(name = "历史支付手续费")
|
||||
@Alias("历史支付手续费")
|
||||
private Double handlingFeeHistoryAmount = 0.0;
|
||||
|
||||
@Excel(name = "平台分润方式")
|
||||
@Alias("平台分润方式")
|
||||
private String profitSharingMethod = "";
|
||||
|
||||
@Excel(name = "自动扣除平台活费用")
|
||||
@Alias("自动扣除平台活费用")
|
||||
private String autoDiscountAmount = "";
|
||||
|
||||
@Excel(name = "充电费")
|
||||
@Alias("充电费")
|
||||
private Double powerAmount = 0.0;
|
||||
@ -113,21 +117,30 @@ public class XDTTradebillVo {
|
||||
@Alias("附加费")
|
||||
private Double surchargeAmount = 0.0;
|
||||
|
||||
@Excel(name = "结算状态")
|
||||
@Alias("结算状态")
|
||||
private String checkedStatus = "";
|
||||
@Excel(name = "结算规则")
|
||||
@Alias("结算规则")
|
||||
private String settlementRules = "";
|
||||
|
||||
@Excel(name = "订单渠道")
|
||||
@Alias("订单渠道")
|
||||
private String orderSource = "";
|
||||
@Excel(name = "占位订单号")
|
||||
@Alias("占位订单号")
|
||||
private String stationOrder = "";
|
||||
|
||||
@Excel(name = "结算日期")
|
||||
@Alias("结算日期")
|
||||
private Date checkoutDate;
|
||||
@Excel(name = "备注")
|
||||
@Alias("备注")
|
||||
private String notes = "";
|
||||
|
||||
@Excel(name = "订单生成时间")
|
||||
@Alias("订单生成时间")
|
||||
private String orderCreateTime = "";
|
||||
|
||||
@Excel(name = "订单类型")
|
||||
@Alias("订单类型")
|
||||
private String orderType = "";
|
||||
|
||||
@Excel(name = "下单平台")
|
||||
@Alias("下单平台")
|
||||
private String orderingPlatform = "";
|
||||
|
||||
@Excel(name = "分润账号")
|
||||
@Alias("分润账号")
|
||||
private String profitSharingAccount = "";
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -19,10 +19,10 @@ spring:
|
||||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 127.0.0.1:8858
|
||||
server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 127.0.0.1:8858
|
||||
server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
||||
@ -76,7 +76,7 @@
|
||||
ifnull(ho.act_price, 0) as 'act_price',
|
||||
ifnull(ho.act_power_price, 0) as 'act_power_price',
|
||||
ifnull(ho.act_service_price, 0) as 'act_service_price',
|
||||
ifnull(ho.act_service_price+ho.act_power_price, 0) as 'actTotalPrice',
|
||||
ifnull(ho.act_power_price+ho.act_service_price, 0) as 'act_total_price',
|
||||
ifnull(ho.internet_commission, 0) as 'internet_commission',
|
||||
ifnull( ho.internet_svc_commission, 0) as 'internet_svc_commission',
|
||||
ifnull(ho.platform_commission, 0) as 'platform_commission',
|
||||
@ -87,7 +87,7 @@
|
||||
ho.create_time, ho.create_by, ho.update_time, ho.update_by, ho.remark, ho.`state`, ho.vin_normal, ho.search_value,
|
||||
ho.operator_id_evcs, ho.charge_model_evcs, ho.connector_power_evcs, ho.meter_value_end_evcs,
|
||||
ho.meter_value_start_evcs, ho.operator_id3rdpty_evcs, ho.start_time, ho.end_time, ho.stop_reason_evcs,
|
||||
ho.total_power as totalPower, ho.user_name_evcs, ho.phone, ho.evcs_order_no, ho.confirm_Result, ho.rate_model_id,
|
||||
ho.total_power, ho.user_name_evcs, ho.phone, ho.evcs_order_no, ho.confirm_Result, ho.rate_model_id,
|
||||
ho.charging_mode,
|
||||
ifnull(ho.internet_degree_commission, 0) as 'internet_degree_commission',
|
||||
ho.`source`, ho.tenant_id, ho.operator_id, ho.operator_name,
|
||||
@ -162,9 +162,7 @@
|
||||
when ho.charging_mode="4" then '小桔'
|
||||
when ho.charging_mode="微信" then '微信'
|
||||
when ho.charging_mode="支付宝" then '支付宝'
|
||||
when ho.charging_mode="App" then 'App'
|
||||
when ho.charging_mode="刷卡" then '刷卡'
|
||||
else 'vin码'
|
||||
else '刷卡'
|
||||
end as 'chargingModeName'
|
||||
from xhpc_clearing_history_order ho
|
||||
left join xhpc_charging_station ct on ct.charging_station_id = ho.charging_station_id
|
||||
@ -250,8 +248,6 @@
|
||||
when ho.charging_mode="4" then "小桔"
|
||||
else "--"
|
||||
end as 'charging_mode_name'
|
||||
|
||||
|
||||
from xhpc_clearing_history_order as ho
|
||||
left join xhpc_charging_station as ct on ct.charging_station_id = ho.charging_station_id
|
||||
left join xhpc_operator as op on op.operator_id = ct.operator_id
|
||||
@ -590,9 +586,7 @@
|
||||
when ho.charging_mode="4" then "小桔"
|
||||
when ho.charging_mode="微信" then "微信"
|
||||
when ho.charging_mode="支付宝" then "支付宝"
|
||||
when ho.charging_mode="App" then "App"
|
||||
when ho.charging_mode="刷卡" then "刷卡"
|
||||
else "vin码"
|
||||
else "刷卡"
|
||||
end chargingModeName
|
||||
from xhpc_clearing_history_order as ho
|
||||
left join xhpc_charging_station as ct on ct.charging_station_id = ho.charging_station_id
|
||||
|
||||
@ -23,12 +23,12 @@
|
||||
update_time as 'updateTime',
|
||||
update_by as 'updateBy'
|
||||
from xhpc_device_message
|
||||
where type=#{type} and serial_number=#{serialNumber}
|
||||
where serial_number=#{serialNumber}
|
||||
<if test="startTime !=null and startTime!=''">
|
||||
and create_time <![CDATA[ >= ]]> #{startTime}
|
||||
and create_time >= #{startTime}
|
||||
</if>
|
||||
<if test="endTime !=null and endTime!=''">
|
||||
and create_time <![CDATA[ <= ]]> #{endTime}
|
||||
and create_time <= #{endTime}
|
||||
</if>
|
||||
order by create_time desc
|
||||
</select>
|
||||
|
||||
@ -217,4 +217,79 @@
|
||||
SELECT GROUP_CONCAT( `history_order_id`) FROM `xhpc_history_order` WHERE state <![CDATA[ <> ]]> 3 and `del_flag` = 0
|
||||
and `history_order_id` in ( SELECT clearing_order_id from `xhpc_clearing_history_order` WHERE `check_status` = 2)
|
||||
</select>
|
||||
|
||||
<select id="getListPage" resultType="map">
|
||||
select
|
||||
ho.history_order_id as historyOrderId,
|
||||
co.charge_order_id as chargeOrderId,
|
||||
ho.serial_number as serialNumber,
|
||||
ct.name as chargingStationName,
|
||||
ter.pile_serial_number as pileSerialNumber,
|
||||
ter.name as terminalName,
|
||||
op.operator_id as operatorId,
|
||||
op.name as operatorName,
|
||||
cp.power as power,
|
||||
cp.type as type,
|
||||
ho.type as orderType,
|
||||
ho.start_soc as startSoc,
|
||||
ho.end_soc as endSoc,
|
||||
ho.vin_normal as vinCode,
|
||||
ho.internet_serial_number as internetSerialNumber,
|
||||
ho.evcs_order_no as evcsOrderNo,
|
||||
ifnull(ho.total_price,0.0) as totalPrice,
|
||||
ifnull(ho.act_price,0.0) as actPrice,
|
||||
ho.confirm_Result as confirmResult,
|
||||
co.charging_time as chargingTime,
|
||||
ho.total_power as chargingDegree,
|
||||
ho.start_time as startTime,
|
||||
ho.end_time as endTime,
|
||||
co.update_time as updateTime,
|
||||
co.source as source,
|
||||
co.Plate_num as plateNum,
|
||||
co.driver_id as internetUserPhone,
|
||||
inu.name as internetName,
|
||||
ifnull(ho.power_price_total,0.0) as powerPriceTotal,
|
||||
ifnull(ho.service_price_total,0.0) as servicePriceTotal,
|
||||
ho.promotion_discount as promotionDiscount,
|
||||
ho.activity_power_price_total as activityPowerPriceTotal,
|
||||
ho.activity_service_price_total as activityServicePriceTotal,
|
||||
ho.activity_total_price as activityTotalPrice,
|
||||
ifnull(ho.act_power_price,0.0) as actPowerPrice,
|
||||
ifnull(ho.act_service_price,0.0) as actServicePrice,
|
||||
(ho.act_power_price+ho.act_service_price) as actSumPrice,
|
||||
ifnull(ho.internet_commission,0.0) as internetCommission,
|
||||
ifnull(ho.internet_svc_commission,0.0) as internetSvcCommission,
|
||||
ifnull(ho.internet_degree_commission,0.0) as internetDegreeCommission,
|
||||
ho.platform_commission as platformCommission,
|
||||
ho.platform_svc_commisssion as platformSvcCommisssion,
|
||||
ho.operation_commission as operationCommission,
|
||||
ho.operation_svc_commission as operationSvcCommission,
|
||||
ho.stop_reason_evcs as stopReasonEvcs,
|
||||
case when ho.charging_mode="1" then "快电"
|
||||
when ho.charging_mode="2" then "恒大"
|
||||
when ho.charging_mode="3" then "新电途"
|
||||
when ho.charging_mode="4" then "小桔"
|
||||
when ho.charging_mode="微信" then "微信"
|
||||
when ho.charging_mode="支付宝" then "支付宝"
|
||||
when ho.charging_mode="App" then "App"
|
||||
when ho.charging_mode="刷卡" then "刷卡"
|
||||
else "vin码"
|
||||
end chargingModeName
|
||||
from xhpc_history_order as ho
|
||||
left join xhpc_charging_station as ct on ct.charging_station_id = ho.charging_station_id
|
||||
left join xhpc_operator as op on op.operator_id = ct.operator_id
|
||||
left join xhpc_terminal as ter on ter.terminal_id = ho.terminal_id
|
||||
left join xhpc_charging_pile as cp on cp.charging_pile_id = ter.charging_pile_id
|
||||
left join xhpc_internet_user as inu on inu.internet_user_id = ho.user_id and ho.internet_serial_number is not null and ho.source=1
|
||||
left join xhpc_charge_order co on co.charge_order_id = ho.charge_order_id
|
||||
where ho.status =0 and ho.del_flag=0 and ho.source =1
|
||||
and ho.user_id =#{type}
|
||||
and ho.internet_serial_number in
|
||||
<foreach collection="totalOrderNos" item="internetSerialNumber" open="(" separator="," close=")">
|
||||
#{internetSerialNumber}
|
||||
</foreach>
|
||||
order by ho.end_time desc
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
|
||||
@ -18,10 +18,31 @@
|
||||
<result column="uncheck_count" jdbcType="INTEGER" property="uncheckCount" />
|
||||
<result column="checked_count" jdbcType="INTEGER" property="checkedCount" />
|
||||
<result column="tenant_id" jdbcType="VARCHAR" property="tenantId" />
|
||||
<result column="platform_power" property="platformPower" />
|
||||
<result column="platform_server" property="platformServer" />
|
||||
<result column="platform_amout" property="platformAmout" />
|
||||
<result column="platform_degree" property="platformDegree" />
|
||||
<result column="platform_internet_commission" property="platformInternetCommission" />
|
||||
<result column="platform_internet_svc_commission" property="platformInternetSvcCommission" />
|
||||
<result column="platform_internet_degree_commission" property="platformInternetDegreeCommission" />
|
||||
<result column="platform_internet_amout" property="platformInternetAmout" />
|
||||
<result column="platform_act_power" property="platformActPower" />
|
||||
<result column="platform_act_service_powe" property="platformActServicePowe" />
|
||||
<result column="platform_internet_settlement_amout" property="platformInternetSettlementAmout" />
|
||||
<result column="internet_power" property="internetPower" />
|
||||
<result column="internet_server" property="internetServer" />
|
||||
<result column="internet_amout" property="internetAmout" />
|
||||
<result column="internet_degree" property="internetDegree" />
|
||||
<result column="internet_settlement_amout" property="internetSettlementAmout" />
|
||||
<result column="user_id" property="userId" />
|
||||
<result column="reconciliation_time" property="reconciliationTime" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
id, create_time, create_by, update_time, update_by, `source`, file_name, url, `type`,
|
||||
`status`, del_flag, success_count, fail_count, uncheck_count, checked_count, tenant_id
|
||||
`status`, del_flag, success_count, fail_count, uncheck_count, checked_count, tenant_id,platform_power,platform_server,
|
||||
platform_amout,platform_degree,platform_internet_commission,platform_internet_svc_commission,platform_internet_degree_commission,
|
||||
platform_internet_amout,platform_act_power,platform_act_service_powe,platform_internet_settlement_amout,internet_power,
|
||||
internet_server,internet_amout,internet_degree,internet_settlement_amout,user_id,reconciliation_time
|
||||
</sql>
|
||||
|
||||
|
||||
@ -48,6 +69,19 @@
|
||||
order by update_time desc
|
||||
</select>
|
||||
|
||||
<select id="getXhpcTradebillUploadRecordcheckPage" resultType="com.xhpc.activity.domain.XhpcTradebillUploadRecordDomain">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from xhpc_tradebill_upload_record
|
||||
<where>
|
||||
<if test="params.userId != 1 and params.type!=0">
|
||||
and user_id = #{params.userId}
|
||||
</if>
|
||||
</where>
|
||||
order by update_time desc
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
@ -114,6 +148,60 @@
|
||||
<if test="tenantId != null">
|
||||
tenant_id,
|
||||
</if>
|
||||
<if test="platformPower != null">
|
||||
platform_power,
|
||||
</if>
|
||||
<if test="platformServer != null">
|
||||
platform_server,
|
||||
</if>
|
||||
<if test="platformAmout != null">
|
||||
platform_amout,
|
||||
</if>
|
||||
<if test="platformDegree != null">
|
||||
platform_degree,
|
||||
</if>
|
||||
<if test="platformInternetCommission != null">
|
||||
platform_internet_commission,
|
||||
</if>
|
||||
<if test="platformInternetSvcCommission != null">
|
||||
platform_internet_svc_commission,
|
||||
</if>
|
||||
<if test="platformInternetDegreeCommission != null">
|
||||
platform_internet_degree_commission,
|
||||
</if>
|
||||
<if test="platformInternetAmout != null">
|
||||
platform_internet_amout,
|
||||
</if>
|
||||
<if test="platformActPower != null">
|
||||
platform_act_power,
|
||||
</if>
|
||||
<if test="platformActServicePowe != null">
|
||||
platform_act_service_powe,
|
||||
</if>
|
||||
<if test="platformInternetSettlementAmout != null">
|
||||
platform_internet_settlement_amout,
|
||||
</if>
|
||||
<if test="internetPower != null">
|
||||
internet_power,
|
||||
</if>
|
||||
<if test="internetServer != null">
|
||||
internet_server,
|
||||
</if>
|
||||
<if test="internetAmout != null">
|
||||
internet_amout,
|
||||
</if>
|
||||
<if test="internetDegree != null">
|
||||
internet_degree,
|
||||
</if>
|
||||
<if test="internetSettlementAmout != null">
|
||||
internet_settlement_amout,
|
||||
</if>
|
||||
<if test="userId != null">
|
||||
user_id,
|
||||
</if>
|
||||
<if test="reconciliationTime != null">
|
||||
reconciliation_time,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
now(),
|
||||
@ -157,6 +245,60 @@
|
||||
<if test="tenantId != null">
|
||||
#{tenantId, jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="platformPower != null">
|
||||
#{platformPower},
|
||||
</if>
|
||||
<if test="platformServer != null">
|
||||
#{platformServer},
|
||||
</if>
|
||||
<if test="platformAmout != null">
|
||||
#{platformAmout},
|
||||
</if>
|
||||
<if test="platformDegree != null">
|
||||
#{platformDegree},
|
||||
</if>
|
||||
<if test="platformInternetCommission != null">
|
||||
#{platformInternetCommission},
|
||||
</if>
|
||||
<if test="platformInternetSvcCommission != null">
|
||||
#{platformInternetSvcCommission},
|
||||
</if>
|
||||
<if test="platformInternetDegreeCommission != null">
|
||||
#{platformInternetDegreeCommission},
|
||||
</if>
|
||||
<if test="platformInternetAmout != null">
|
||||
#{platformInternetAmout},
|
||||
</if>
|
||||
<if test="platformActPower != null">
|
||||
#{platformActPower},
|
||||
</if>
|
||||
<if test="platformActServicePowe != null">
|
||||
#{platformActServicePowe},
|
||||
</if>
|
||||
<if test="platformInternetSettlementAmout != null">
|
||||
#{platformInternetSettlementAmout},
|
||||
</if>
|
||||
<if test="internetPower != null">
|
||||
#{internetPower},
|
||||
</if>
|
||||
<if test="internetServer != null">
|
||||
#{internetServer},
|
||||
</if>
|
||||
<if test="internetAmout != null">
|
||||
#{internetAmout},
|
||||
</if>
|
||||
<if test="internetDegree != null">
|
||||
#{internetDegree},
|
||||
</if>
|
||||
<if test="internetSettlementAmout != null">
|
||||
#{internetSettlementAmout},
|
||||
</if>
|
||||
<if test="userId != null">
|
||||
#{userId},
|
||||
</if>
|
||||
<if test="reconciliationTime != null">
|
||||
#{reconciliationTime},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="com.xhpc.activity.domain.XhpcTradebillUploadRecordDomain">
|
||||
|
||||
@ -14,10 +14,10 @@ spring:
|
||||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 120.26.46.180:8858
|
||||
server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 120.26.46.180:8858
|
||||
server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
||||
@ -119,7 +119,28 @@ public class XhpcTerminalController extends BaseController {
|
||||
// }
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 停用
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Log(title = "终端-停用", businessType = BusinessType.UPDATE)
|
||||
@PostMapping(value = "/updateStatusAll")
|
||||
public AjaxResult updateStatusAll(@RequestBody XhpcTerminal xhpcTerminal) {
|
||||
if(null==xhpcTerminal.getChargingStationId()){
|
||||
return AjaxResult.error("场站数据为空");
|
||||
}
|
||||
if(null==xhpcTerminal.getStatus()){
|
||||
return AjaxResult.error("桩数据状态为空");
|
||||
}
|
||||
if(xhpcTerminal.getStatus()==1){
|
||||
if(null==xhpcTerminal.getPrompt() || xhpcTerminal.getPrompt().length()>50){
|
||||
return AjaxResult.error("桩提示语为空且50字之内");
|
||||
}
|
||||
//停该场站所有桩
|
||||
}
|
||||
return xhpcTerminalService.updateStatusAll(xhpcTerminal.getChargingStationId(), xhpcTerminal.getStatus(),xhpcTerminal.getPrompt());
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@ -54,6 +54,8 @@ public interface XhpcTerminalMapper {
|
||||
*/
|
||||
int updateXhpcTerminal(@Param("name") String name,@Param("serialNumber") String serialNumber,@Param("connectorType") Integer connectorType,@Param("status") Integer status,@Param("terminalId") Long terminalId,@Param("prompt")String prompt);
|
||||
|
||||
int updateXhpcTerminalAll(@Param("name") String name,@Param("serialNumber") String serialNumber,@Param("connectorType") Integer connectorType,@Param("status") Integer status,@Param("chargingStationId") Long chargingStationId,@Param("prompt")String prompt);
|
||||
|
||||
/**
|
||||
* 添加终端
|
||||
*
|
||||
|
||||
@ -33,6 +33,7 @@ public interface IXhpcTerminalService {
|
||||
*/
|
||||
AjaxResult updateStatus(Long terminalId,Integer status,String prompt);
|
||||
|
||||
AjaxResult updateStatusAll(Long chargingStationId,Integer status,String prompt);
|
||||
/**
|
||||
* 查询
|
||||
*/
|
||||
|
||||
@ -74,6 +74,15 @@ public class XhpcTerminalServiceImpl extends BaseService implements IXhpcTermina
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult updateStatusAll(Long chargingStationId, Integer status,String prompt) {
|
||||
|
||||
System.out.println(">>>>>>>>>>chargingStationId>>>>>>>>>"+chargingStationId);
|
||||
System.out.println(">>>>>>>>>>status>>>>>>>>>"+status);
|
||||
xhpcTerminalMapper.updateXhpcTerminalAll(null,null,null,status,chargingStationId,prompt);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult selectXhpcTerminalMessage(Long terminalId) {
|
||||
|
||||
|
||||
@ -14,10 +14,10 @@ spring:
|
||||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 120.26.46.180:8858
|
||||
server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 120.26.46.180:8858
|
||||
server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
||||
@ -140,6 +140,29 @@
|
||||
where terminal_id = #{terminalId}
|
||||
</update>
|
||||
|
||||
<update id="updateXhpcTerminalAll">
|
||||
update xhpc_terminal
|
||||
<set>
|
||||
<if test="name != null and name !=''">
|
||||
name = #{name},
|
||||
</if>
|
||||
<if test="serialNumber != null and serialNumber !=''">
|
||||
serial_number = #{serialNumber},
|
||||
</if>
|
||||
<if test="status != null">
|
||||
status = #{status},
|
||||
</if>
|
||||
<if test="connectorType != null">
|
||||
connector_type = #{connectorType},
|
||||
</if>
|
||||
<if test="prompt != null and prompt !=''">
|
||||
prompt = #{prompt},
|
||||
</if>
|
||||
</set>
|
||||
where charging_station_id = #{chargingStationId} and del_flag =0
|
||||
</update>
|
||||
|
||||
|
||||
<insert id="insertXhpcTerminal" parameterType="com.xhpc.common.domain.XhpcTerminal" useGeneratedKeys="true"
|
||||
keyProperty="terminalId">
|
||||
insert into xhpc_terminal
|
||||
|
||||
@ -75,5 +75,10 @@
|
||||
<artifactId>easyexcel</artifactId>
|
||||
<version>3.0.2</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
|
||||
@ -104,4 +104,12 @@ public interface PowerPileService {
|
||||
//充电桩工作参数设置
|
||||
@PostMapping("/pile/{pileNo}/{powerNumber}/configSettings")
|
||||
R pileConfigSettings(@PathVariable("pileNo") @Param("pileNo")String pileNo,@PathVariable("powerNumber") @Param("powerNumber")String powerNumber);
|
||||
|
||||
|
||||
//需求通知推送(监管平台向我们发送消息)
|
||||
@PostMapping("/station/addRequirementInfo")
|
||||
R addRequirementInfo(@RequestParam("name") String name,@RequestParam("area") String area,@RequestParam("code") String code,@RequestParam("list") String list,@RequestParam("requireDate") String requireDate,@RequestParam("releaseTime") String releaseTime,@RequestParam("deliveryTime") String deliveryTime);
|
||||
|
||||
@PostMapping("/station/addNotificationTask")
|
||||
R addNotificationTask(@RequestParam("taskName") String taskName,@RequestParam("taskCode") String taskCode,@RequestParam("demandDate") String demandDate,@RequestParam("stationID") String stationID,@RequestParam("operatorID") String operatorID,@RequestParam("equipmentOwnerID") String equipmentOwnerID,@RequestParam("eleNo") String eleNo,@RequestParam("list") String list,@RequestParam("deliveryTime") String deliveryTime);
|
||||
}
|
||||
|
||||
@ -16,6 +16,7 @@ public class ChargingStationDto {
|
||||
private String areaCode;
|
||||
private String name;
|
||||
private String serviceTel;
|
||||
private String parkFee;
|
||||
private Integer parkNums;
|
||||
/**
|
||||
* 装机总功率(单位:kw)
|
||||
@ -173,6 +174,14 @@ public class ChargingStationDto {
|
||||
return serviceTel;
|
||||
}
|
||||
|
||||
public String getParkFee() {
|
||||
return parkFee;
|
||||
}
|
||||
|
||||
public void setParkFee(String parkFee) {
|
||||
this.parkFee = parkFee;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ChargingStationDto{" +
|
||||
@ -188,6 +197,7 @@ public class ChargingStationDto {
|
||||
", areaCode='" + areaCode + '\'' +
|
||||
", name='" + name + '\'' +
|
||||
", serviceTel='" + serviceTel + '\'' +
|
||||
", parkFee='" + parkFee + '\'' +
|
||||
", parkNums=" + parkNums +
|
||||
", installedTotalPower=" + installedTotalPower +
|
||||
", runningTotalPower=" + runningTotalPower +
|
||||
|
||||
@ -140,6 +140,16 @@ public class PowerPileFallbackFactory implements FallbackFactory<PowerPileServic
|
||||
public R pileConfigSettings(String pileNo, String powerNumber) {
|
||||
return R.fail(500,"推送充电桩工作参数设置失败:" + cause.getMessage());
|
||||
}
|
||||
|
||||
@Override
|
||||
public R addRequirementInfo(String name, String area, String code, String list, String requireDate, String releaseTime, String deliveryTime) {
|
||||
return R.fail(500,"监管平台推送调控需求失败:" + cause.getMessage());
|
||||
}
|
||||
|
||||
@Override
|
||||
public R addNotificationTask(String taskName, String taskCode, String demandDate, String stationID, String operatorID, String equipmentOwnerID, String eleNo, String list, String deliveryTime) {
|
||||
return R.fail(500,"监管平台推送调控任务失败:" + cause.getMessage());
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@ -0,0 +1,44 @@
|
||||
package com.xhpc.common.data.down;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 调控需求
|
||||
*
|
||||
* @author yuyang
|
||||
* @Date 2024-08-20 11:16
|
||||
*/
|
||||
@Data
|
||||
public class RequirementInfoDto {
|
||||
/**
|
||||
* 需求名称
|
||||
*/
|
||||
public String name;
|
||||
/**
|
||||
* 需求地区
|
||||
*/
|
||||
public String area;
|
||||
/**
|
||||
* 需求编号
|
||||
*/
|
||||
public String code;
|
||||
/**
|
||||
* 时段责任量 List
|
||||
*/
|
||||
public String list;
|
||||
/**
|
||||
* 需求日期
|
||||
*/
|
||||
public String requireDate;
|
||||
/**
|
||||
* 发布时间
|
||||
*/
|
||||
public String releaseTime;
|
||||
/**
|
||||
* 下发时间
|
||||
*/
|
||||
public String deliveryTime;
|
||||
}
|
||||
@ -0,0 +1,20 @@
|
||||
package com.xhpc.common.data.down;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 时段责任量
|
||||
*
|
||||
* @author yuyang
|
||||
* @Date 2024-08-20 11:23
|
||||
*/
|
||||
@Data
|
||||
public class RequirementInfoListDto {
|
||||
|
||||
public String startTime;
|
||||
|
||||
public String endTime;
|
||||
|
||||
public String res;
|
||||
}
|
||||
@ -14,10 +14,10 @@ spring:
|
||||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 120.26.46.180:8858
|
||||
server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 120.26.46.180:8858
|
||||
server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
||||
@ -526,33 +526,71 @@ public class XhpcPileOrderController extends BaseController {
|
||||
xhpcChargeOrderService.updateXhpcChargeOrder(xhpcChargeOrder);
|
||||
return R.fail(500,"无效订单号:"+orderNo);
|
||||
}
|
||||
DateTime startTime = DateUtil.parse(cacheOrderData.getStartTime());
|
||||
DateTime endTime = DateUtil.parse(cacheOrderData.getEndTime());
|
||||
xhpcChargeOrder.setStartTime(startTime);
|
||||
xhpcChargeOrder.setEndTime(endTime);
|
||||
//开始时间不能小于今天2天 结束时间不能大于今天两天
|
||||
Date dateUtil = DateUtil.date();
|
||||
long betweenStart = DateUtil.between(startTime, dateUtil, DateUnit.DAY);
|
||||
if(betweenStart>2){
|
||||
logger.info("开始时间大于本地时间2天>>>>>orderNo:" + orderNo);
|
||||
xhpcChargeOrder.setStatus(2);
|
||||
xhpcChargeOrder.setUpdateTime(new Date());
|
||||
xhpcChargeOrder.setErroRemark("开始时间大于本地时间2天,需要进行时间效验");
|
||||
xhpcChargeOrderService.updateXhpcChargeOrder(xhpcChargeOrder);
|
||||
extracted();
|
||||
return R.fail(500,"无效订单号:"+orderNo);
|
||||
}
|
||||
if(endTime.getTime()-dateUtil.getTime()>120000){
|
||||
logger.info("结束时间大于本地时间2分钟,需要进行时间效验>>>>>orderNo:" + orderNo);
|
||||
xhpcChargeOrder.setStatus(2);
|
||||
xhpcChargeOrder.setUpdateTime(new Date());
|
||||
xhpcChargeOrder.setErroRemark("结束时间大于本地时间2分钟,需要进行时间效验");
|
||||
xhpcChargeOrderService.updateXhpcChargeOrder(xhpcChargeOrder);
|
||||
extracted();
|
||||
return R.fail(500,"无效订单号:"+orderNo);
|
||||
}
|
||||
//结束时间小于开始时间
|
||||
if(startTime.getTime()-endTime.getTime()>0){
|
||||
logger.info("开始时间大于结束时间>>>>>orderNo:" + orderNo);
|
||||
xhpcChargeOrder.setStatus(2);
|
||||
xhpcChargeOrder.setUpdateTime(new Date());
|
||||
xhpcChargeOrder.setErroRemark("开始时间大于结束时间,需要进行时间效验");
|
||||
xhpcChargeOrderService.updateXhpcChargeOrder(xhpcChargeOrder);
|
||||
return R.fail(500,"无效订单号:"+orderNo);
|
||||
}
|
||||
|
||||
//1.订单结束时上报的开始时间小于订单创建时间3分钟 2.订单结束时上报的开始时间大于订单创建时间5分钟
|
||||
long createTimeLong = xhpcChargeOrder.getCreateTime().getTime();
|
||||
|
||||
if(cacheOrderData.getStartTime() !=null || "".equals(cacheOrderData.getStartTime())){
|
||||
long startTimeLong = DateUtil.parse(cacheOrderData.getStartTime()).getTime();
|
||||
if(createTimeLong-startTimeLong>60000){
|
||||
// xhpcChargeOrder.setStatus(2);
|
||||
// xhpcChargeOrder.setChargingDegree(totalPowerQuantity);
|
||||
// xhpcChargeOrder.setUpdateTime(new Date());
|
||||
// xhpcChargeOrder.setErroRemark("结算订单开始充电时间小于订单创建时间1分钟");
|
||||
// xhpcChargeOrderService.updateXhpcChargeOrder(xhpcChargeOrder);
|
||||
// return R.fail(500,"无效订单号:"+orderNo);
|
||||
|
||||
xhpcChargeOrder.setStartTime(xhpcChargeOrder.getCreateTime());
|
||||
xhpcChargeOrderService.updateXhpcChargeOrder(xhpcChargeOrder);
|
||||
if(createTimeLong-startTimeLong>120000){
|
||||
if("15".equals(xhpcChargeOrder.getChargingStationId().toString())){
|
||||
xhpcChargeOrder.setStartTime(xhpcChargeOrder.getCreateTime());
|
||||
xhpcChargeOrder.setErroRemark("结算订单开始充电时间小于订单创建时间2分钟");
|
||||
}else{
|
||||
xhpcChargeOrder.setStatus(2);
|
||||
xhpcChargeOrder.setChargingDegree(totalPowerQuantity);
|
||||
xhpcChargeOrder.setUpdateTime(new Date());
|
||||
xhpcChargeOrder.setErroRemark("结算订单开始充电时间小于订单创建时间2分钟");
|
||||
xhpcChargeOrderService.updateXhpcChargeOrder(xhpcChargeOrder);
|
||||
return R.fail(500,"无效订单号:"+orderNo);
|
||||
}
|
||||
}
|
||||
if(startTimeLong-createTimeLong>180000){
|
||||
// xhpcChargeOrder.setStatus(2);
|
||||
// xhpcChargeOrder.setChargingDegree(totalPowerQuantity);
|
||||
// xhpcChargeOrder.setUpdateTime(new Date());
|
||||
// xhpcChargeOrder.setErroRemark("结算订单开始充电时间大于订单创建时间3分钟");
|
||||
// xhpcChargeOrderService.updateXhpcChargeOrder(xhpcChargeOrder);
|
||||
// return R.fail(500,"无效订单号:"+orderNo);
|
||||
|
||||
xhpcChargeOrder.setStartTime(xhpcChargeOrder.getCreateTime());
|
||||
if("15".equals(xhpcChargeOrder.getChargingStationId().toString())){
|
||||
xhpcChargeOrder.setStartTime(xhpcChargeOrder.getCreateTime());
|
||||
xhpcChargeOrder.setErroRemark("结算订单开始充电时间大于订单创建时间3分钟");
|
||||
}else{
|
||||
xhpcChargeOrder.setStatus(2);
|
||||
xhpcChargeOrder.setChargingDegree(totalPowerQuantity);
|
||||
xhpcChargeOrder.setUpdateTime(new Date());
|
||||
xhpcChargeOrder.setErroRemark("结算订单开始充电时间大于订单创建时间3分钟");
|
||||
xhpcChargeOrderService.updateXhpcChargeOrder(xhpcChargeOrder);
|
||||
return R.fail(500,"无效订单号:"+orderNo);
|
||||
}
|
||||
}
|
||||
}else{
|
||||
xhpcChargeOrder.setStatus(2);
|
||||
@ -581,7 +619,17 @@ public class XhpcPileOrderController extends BaseController {
|
||||
xhpcChargeOrder.setEndTime(date);
|
||||
xhpcChargeOrder.setChargingTime("0分");
|
||||
xhpcChargeOrder.setChargingDegree(bigDecimal1);
|
||||
xhpcChargeOrder.setType("199");
|
||||
try{
|
||||
if(cacheOrderData.getStopReason() !=null && !"".equals(cacheOrderData.getStopReason())){
|
||||
xhpcChargeOrder.setType(cacheOrderData.getStopReason());
|
||||
}else{
|
||||
if(cacheMap.get("stopReasonHex")!=null){
|
||||
xhpcChargeOrder.setType(cacheMap.get("stopReasonHex").toString());
|
||||
}else{
|
||||
xhpcChargeOrder.setType("199");
|
||||
}
|
||||
}
|
||||
}catch (Exception e){}
|
||||
xhpcChargeOrder.setAmountCharged(bigDecimal1);
|
||||
xhpcChargeOrder.setChargingTimeNumber(0L);
|
||||
xhpcChargeOrderService.updateXhpcChargeOrder(xhpcChargeOrder);
|
||||
@ -759,40 +807,6 @@ public class XhpcPileOrderController extends BaseController {
|
||||
int status = cacheOrderData.getStatus();
|
||||
xhpcChargeOrder.setStatus(status);
|
||||
|
||||
DateTime startTime = DateUtil.parse(cacheOrderData.getStartTime());
|
||||
DateTime endTime = DateUtil.parse(cacheOrderData.getEndTime());
|
||||
xhpcChargeOrder.setStartTime(startTime);
|
||||
xhpcChargeOrder.setEndTime(endTime);
|
||||
//开始时间不能小于今天2天 结束时间不能大于今天两天
|
||||
Date dateUtil = DateUtil.date();
|
||||
long betweenStart = DateUtil.between(startTime, dateUtil, DateUnit.DAY);
|
||||
if(betweenStart>2){
|
||||
logger.info("开始时间大于本地时间2天>>>>>orderNo:" + orderNo);
|
||||
xhpcChargeOrder.setStatus(2);
|
||||
xhpcChargeOrder.setUpdateTime(new Date());
|
||||
xhpcChargeOrder.setErroRemark("开始时间大于本地时间2天,需要进行时间效验");
|
||||
xhpcChargeOrderService.updateXhpcChargeOrder(xhpcChargeOrder);
|
||||
extracted();
|
||||
return R.fail(500,"无效订单号:"+orderNo);
|
||||
}
|
||||
if(endTime.getTime()-dateUtil.getTime()>120000){
|
||||
logger.info("结束时间大于本地时间2分钟,需要进行时间效验>>>>>orderNo:" + orderNo);
|
||||
xhpcChargeOrder.setStatus(2);
|
||||
xhpcChargeOrder.setUpdateTime(new Date());
|
||||
xhpcChargeOrder.setErroRemark("结束时间大于本地时间2分钟,需要进行时间效验");
|
||||
xhpcChargeOrderService.updateXhpcChargeOrder(xhpcChargeOrder);
|
||||
extracted();
|
||||
return R.fail(500,"无效订单号:"+orderNo);
|
||||
}
|
||||
//结束时间小于开始时间
|
||||
if(startTime.getTime()-endTime.getTime()>0){
|
||||
logger.info("开始时间大于结束时间>>>>>orderNo:" + orderNo);
|
||||
xhpcChargeOrder.setStatus(2);
|
||||
xhpcChargeOrder.setUpdateTime(new Date());
|
||||
xhpcChargeOrder.setErroRemark("开始时间大于结束时间,需要进行时间效验");
|
||||
xhpcChargeOrderService.updateXhpcChargeOrder(xhpcChargeOrder);
|
||||
return R.fail(500,"无效订单号:"+orderNo);
|
||||
}
|
||||
|
||||
|
||||
//充电时长
|
||||
|
||||
@ -2,18 +2,25 @@ package com.xhpc.order.controller;
|
||||
|
||||
import com.xhpc.common.api.PowerPileService;
|
||||
import com.xhpc.common.core.domain.R;
|
||||
import com.xhpc.common.core.utils.SecurityUtils;
|
||||
import com.xhpc.common.core.web.controller.BaseController;
|
||||
import com.xhpc.common.core.web.domain.AjaxResult;
|
||||
import com.xhpc.common.core.web.page.TableDataInfo;
|
||||
import com.xhpc.common.redis.service.RedisService;
|
||||
import com.xhpc.common.security.service.TokenService;
|
||||
import com.xhpc.common.util.UserTypeUtil;
|
||||
import com.xhpc.order.service.IXhpcChargeOrderService;
|
||||
import com.xhpc.order.service.IXhpcStopChargingOrderService;
|
||||
import com.xhpc.system.api.domain.SysUser;
|
||||
import com.xhpc.system.api.model.LoginUser;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
@ -38,6 +45,9 @@ public class XhpcStopChargingOrderController extends BaseController {
|
||||
@Autowired
|
||||
private IXhpcChargeOrderService xhpcChargeOrderService;
|
||||
|
||||
@Autowired
|
||||
private TokenService tokenService;
|
||||
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(Long userId, Long chargingStationId, Long terminalId){
|
||||
startPage();
|
||||
@ -54,7 +64,6 @@ public class XhpcStopChargingOrderController extends BaseController {
|
||||
//查询缓存是否该终端在充电
|
||||
Map<String, Object> cacheMap = redisService.getCacheMap("gun:" + serialNumber);
|
||||
|
||||
|
||||
Map<String, Object> serialNumberOrder = xhpcChargeOrderService.getSerialNumberOrder(serialNumber);
|
||||
if(cacheMap !=null && serialNumberOrder!=null && serialNumberOrder.get("serialNumber") !=null){
|
||||
if(cacheMap.get("orderkey") !=null){
|
||||
@ -79,4 +88,52 @@ public class XhpcStopChargingOrderController extends BaseController {
|
||||
}
|
||||
return AjaxResult.success("无车辆充电");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 停止充电
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/stopUpAll")
|
||||
public void stopUpAll(Long chargingStationId,Long chargingPileId){
|
||||
if(chargingStationId!=null || chargingPileId !=null ){
|
||||
List<Map<String,Object>> xhpcTerminalList =new ArrayList<>();
|
||||
LoginUser loginUser = tokenService.getLoginUser();
|
||||
SysUser sysUser = loginUser.getSysUser();
|
||||
Long sysUserId = sysUser.getUserId();
|
||||
//桩的统计、该时段金额
|
||||
if(!UserTypeUtil.SYS_USER_TYPE_ADMIN.equals(sysUser.getUserId())){
|
||||
startPage();
|
||||
if(UserTypeUtil.SYS_USER_TYPE_ONE.equals(sysUser.getUserType())){
|
||||
Long logOperatorId = sysUser.getOperatorId();
|
||||
//运营商看自己的场站
|
||||
xhpcTerminalList= xhpcChargeOrderService.getXhpcTerminalList(chargingStationId, chargingPileId,1,logOperatorId);
|
||||
}else{
|
||||
//查询赋值的场站
|
||||
xhpcTerminalList= xhpcChargeOrderService.getXhpcTerminalList(chargingStationId, chargingPileId,2,sysUserId);
|
||||
}
|
||||
}else{
|
||||
xhpcTerminalList= xhpcChargeOrderService.getXhpcTerminalList(chargingStationId, chargingPileId,0,sysUserId);
|
||||
}
|
||||
|
||||
for (int i = 0; i < xhpcTerminalList.size(); i++) {
|
||||
Map<String,Object> map = xhpcTerminalList.get(i);
|
||||
String serialNumber = map.get("serialNumber").toString();
|
||||
//查询缓存是否该终端在充电
|
||||
Map<String, Object> cacheMap = redisService.getCacheMap("gun:" + serialNumber);
|
||||
|
||||
Map<String, Object> serialNumberOrder = xhpcChargeOrderService.getSerialNumberOrder(serialNumber);
|
||||
if(cacheMap !=null && serialNumberOrder!=null && serialNumberOrder.get("serialNumber") !=null){
|
||||
if(cacheMap.get("orderkey") !=null){
|
||||
String serialNumberOrderMap = serialNumberOrder.get("serialNumber").toString();
|
||||
String version ="0A";
|
||||
if(cacheMap.get("version") !=null){
|
||||
version =cacheMap.get("version").toString();
|
||||
}
|
||||
powerPileService.stopCharging(serialNumberOrderMap, serialNumberOrderMap.substring(0,14), serialNumberOrderMap.substring(0,16), version);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -289,5 +289,5 @@ public interface XhpcChargeOrderMapper {
|
||||
//查询是否可以充电
|
||||
int getBlacklistUser(@Param("phone")String phone,@Param("vin")String vin,@Param("plateNnum")String plateNnum,@Param("chargingStationId")Long chargingStationId,@Param("time")String time);
|
||||
|
||||
|
||||
List<Map<String,Object>> getXhpcTerminalList(@Param("chargingStationId")Long chargingStationId,@Param("chargingPileId")Long chargingPileId,@Param("type")Integer type,@Param("userId")Long userId);
|
||||
}
|
||||
|
||||
@ -237,4 +237,10 @@ public interface IXhpcChargeOrderService {
|
||||
String countXhpcRealTimeOrder(Long userId,Integer source,String tenantId);
|
||||
|
||||
int getBlacklistUser(String phone,String vin,String plateNnum,Long chargingStationId,String time);
|
||||
|
||||
/**
|
||||
* 获取终端信息
|
||||
* @return
|
||||
*/
|
||||
List<Map<String,Object>> getXhpcTerminalList(Long chargingStationId,Long chargingPileId,Integer type,Long userId);
|
||||
}
|
||||
|
||||
@ -1916,6 +1916,11 @@ public class XhpcChargeOrderServiceImpl extends BaseService implements IXhpcChar
|
||||
return xhpcChargeOrderMapper.getBlacklistUser(phone, vin, plateNnum, chargingStationId, time);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Map<String,Object>> getXhpcTerminalList(Long chargingStationId, Long chargingPileId,Integer type,Long userId) {
|
||||
return xhpcChargeOrderMapper.getXhpcTerminalList(chargingStationId,chargingPileId,type,userId);
|
||||
}
|
||||
|
||||
//判断双枪启规则
|
||||
private AjaxResult startUpSuncha(Map<String, Object> userMessage,XhpcChargeOrder xhpcChargeOrder,XhpcTerminal xhpcTerminal,String tenantId,Integer source,String terminalSerialNumber,Integer type){
|
||||
|
||||
|
||||
@ -1341,7 +1341,6 @@ public class XhpcRealTimeOrderServiceImpl extends BaseService implements IXhpcRe
|
||||
map.put("amount",subtract);
|
||||
//openid=userMessage.get("weixinOpenId").toString();
|
||||
refundType="0";
|
||||
|
||||
map.put("remark","充电结算自动申请退款");
|
||||
}
|
||||
}
|
||||
@ -1351,6 +1350,11 @@ public class XhpcRealTimeOrderServiceImpl extends BaseService implements IXhpcRe
|
||||
|
||||
int number = xhpcHistoryOrderService.updateXhpcHistoryOrderSerialNumber(xhpcHistoryOrder);
|
||||
if(number==0){
|
||||
if(xhpcHistoryOrder.getChargingStationId()==15){
|
||||
if(xhpcHistoryOrder.getVinNormal()!=null){
|
||||
xhpcHistoryOrder.setVinNormal(new StringBuffer(xhpcHistoryOrder.getVinNormal()).reverse().toString());
|
||||
}
|
||||
}
|
||||
xhpcHistoryOrderService.insert(xhpcHistoryOrder);
|
||||
}
|
||||
xhpcChargeOrderService.updateXhpcChargeOrder(xhpcChargeOrder);
|
||||
|
||||
@ -14,15 +14,15 @@ spring:
|
||||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 120.26.46.180:8858
|
||||
server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 120.26.46.180:8858
|
||||
server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
shared-configs:
|
||||
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
||||
logging:
|
||||
level:
|
||||
com.xhpc.order.mapper: debug
|
||||
#logging:
|
||||
# level:
|
||||
# com.xhpc.order.mapper: debug
|
||||
|
||||
@ -918,4 +918,22 @@
|
||||
and blacklist_id in (select mechanism_id from xhpc_mechanism where source =2 and del_flag =0 and charging_station_id =#{chargingStationId} )
|
||||
and start_time <= #{time} and end_time >= #{time}
|
||||
</select>
|
||||
|
||||
<select id="getXhpcTerminalList" resultType="map">
|
||||
select serial_number as serialNumber
|
||||
from xhpc_terminal
|
||||
where del_flag = 0
|
||||
<if test="'' !=chargingStationId and chargingStationId !=null">
|
||||
and charging_station_id =#{chargingStationId}
|
||||
</if>
|
||||
<if test="''!=chargingPileId and chargingPileId !=null">
|
||||
and charging_pile_id =#{chargingPileId}
|
||||
</if>
|
||||
<if test="type==1">
|
||||
and charging_station_id in (select charging_station_id from xhpc_charging_station where operator_id=#{userId})
|
||||
</if>
|
||||
<if test="type==2">
|
||||
and charging_station_id in (select charging_station_id from xhpc_user_privilege where user_id=#{userId})
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@ -1667,7 +1667,7 @@
|
||||
select
|
||||
count(history_order_id) number
|
||||
from xhpc_history_order
|
||||
where history_order_id> (select last_push_order from et_auth_sec_token where id=2)
|
||||
where history_order_id> (select last_push_order from et_auth_sec_token where id=12)
|
||||
</select>
|
||||
|
||||
<select id="getConfirmResultPage" resultType="map">
|
||||
@ -1694,10 +1694,10 @@
|
||||
LEFT JOIN xhpc_charging_station xcs on xcs.charging_station_id = xho.charging_station_id
|
||||
<if test="status==null">
|
||||
where ((xho.confirm_Result !=0 and xho.source =1)
|
||||
or xho.history_order_id >(select last_push_order from et_auth_sec_token where id=2))
|
||||
or xho.history_order_id >(select last_push_order from et_auth_sec_token where id=12))
|
||||
</if>
|
||||
<if test="status==0">
|
||||
where (xho.history_order_id >(select last_push_order from et_auth_sec_token where id=2) or xho.source !=1)
|
||||
where (xho.history_order_id >(select last_push_order from et_auth_sec_token where id=12) or xho.source !=1)
|
||||
</if>
|
||||
<if test="status==1">
|
||||
where xho.confirm_Result =-1 and xho.source =1
|
||||
|
||||
@ -669,6 +669,7 @@
|
||||
cup.account as customersAccount,
|
||||
cop.name as communityName,
|
||||
cop.account as communityAccount,
|
||||
co.create_time as createTime,
|
||||
apu.phone as appUserPhone
|
||||
from xhpc_charge_order co
|
||||
left join xhpc_charging_station as ct on ct.charging_station_id = co.charging_station_id
|
||||
|
||||
@ -249,6 +249,9 @@ public class XhpcRefundOrderController extends BaseController {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 云快充充电完成自动退款
|
||||
*/
|
||||
|
||||
@ -14,10 +14,10 @@ spring:
|
||||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 120.26.46.180:8858
|
||||
server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 120.26.46.180:8858
|
||||
server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
||||
@ -334,4 +334,20 @@ public class StationController {
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/station/addRequirementInfo")
|
||||
public R addRequirementInfo(@RequestParam("name") String name,@RequestParam("area") String area,@RequestParam("code") String code,@RequestParam("list") String list,@RequestParam("requireDate") String requireDate,@RequestParam("releaseTime") String releaseTime,@RequestParam("deliveryTime") String deliveryTime){
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@PostMapping("/station/addNotificationTask")
|
||||
public R addNotificationTask(@RequestParam("taskName") String taskName,@RequestParam("taskCode") String taskCode,@RequestParam("demandDate") String demandDate,@RequestParam("stationID") String stationID,@RequestParam("operatorID") String operatorID,@RequestParam("equipmentOwnerID") String equipmentOwnerID,@RequestParam("eleNo") String eleNo,@RequestParam("list") String list,@RequestParam("deliveryTime") String deliveryTime){
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -234,11 +234,11 @@ public class CP56Time2a {
|
||||
// System.out.println(String.format("--编码2--:%s", encode));
|
||||
// System.out.println("--解码2--:" + decode(HexUtils.toBytes(encode)));
|
||||
|
||||
String s = cp56toDateStr("1804080B0E22");
|
||||
String s = cp56toDateStr("81461009200A18");
|
||||
|
||||
System.out.println("-111-变为--:" + s);
|
||||
|
||||
String s1 = cp56toDateStr("88903507220418");
|
||||
String s1 = cp56toDateStr("1AB42D09200A18");
|
||||
|
||||
System.out.println("-111-变为--:" + s1);
|
||||
}
|
||||
|
||||
@ -18,10 +18,10 @@ spring:
|
||||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 120.26.46.180:8858
|
||||
server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 120.26.46.180:8858
|
||||
server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
||||
@ -258,11 +258,11 @@ public class XhpcAppUserController extends BaseController {
|
||||
String url = "https://api.weixin.qq.com/sns/jscode2session?appid=" + mapConfig.get("wxAppId").toString() + "&secret=" + mapConfig.get("wxAppSecret").toString() + "&js_code=" + jsCode + "&grant_type=authorization_code";
|
||||
String result = HttpUtils.get(url);
|
||||
JSONObject json = JSON.parseObject(result);
|
||||
//logger.info("========222===========sessionKey:============222===============");
|
||||
logger.info("========222===========sessionKey:============222==============="+json.toString());
|
||||
if (null != json) {
|
||||
String openid = json.getString("openid");
|
||||
String sessionKey = json.getString("session_key");
|
||||
//logger.info("========333===========sessionKey:============333===============");
|
||||
logger.info("========333===========sessionKey:============333===============");
|
||||
if (StringUtils.isEmpty(openid)) {
|
||||
return R.fail(HttpStatus.ERROR_STATUS, "openid获取失败");
|
||||
}
|
||||
@ -280,7 +280,7 @@ public class XhpcAppUserController extends BaseController {
|
||||
if(phoneCode1 !=null &&!phoneCode1.equals("")){
|
||||
map.put("phone", phoneCode1);
|
||||
}
|
||||
logger.info("1111phone:"+ phoneCode1);
|
||||
logger.info("======111==4444===========sessionKey:=======111=====444==============="+phoneCode1);
|
||||
}
|
||||
// JSONObject jsonObject = new JSONObject();
|
||||
// if ((!"".equals(encryptedData) && encryptedData != null) && (!"".equals(iv) && iv != null)) {
|
||||
@ -309,18 +309,18 @@ public class XhpcAppUserController extends BaseController {
|
||||
}
|
||||
R r = settingConfigService.settingConfig(1, tenantId);
|
||||
if (r != null && r.getCode() == 200) {
|
||||
// System.out.println("========444===========sessionKey:============444===============");
|
||||
System.out.println("========444===========sessionKey:============444===============");
|
||||
Map<String, Object> mapConfig = (Map<String, Object>) r.getData();
|
||||
String url = "https://api.weixin.qq.com/sns/jscode2session?appid=" + mapConfig.get("wxAppId").toString() + "&secret=" + mapConfig.get("wxAppSecret").toString() + "&js_code=" + jsCode + "&grant_type=authorization_code";
|
||||
String result = HttpUtils.get(url);
|
||||
JSONObject json = JSON.parseObject(result);
|
||||
//logger.info("========555===========sessionKey:============5555===============");
|
||||
logger.info("========555===========sessionKey:============5555==============="+json.toString());
|
||||
if (null != json) {
|
||||
String openid = json.getString("openid");
|
||||
redisService.setCacheObject("WXToken:" + openid, openid, 115L, TimeUnit.MINUTES);
|
||||
String sessionKey = json.getString("session_key");
|
||||
//logger.info("========666===========sessionKey:============666==============="+sessionKey);
|
||||
//logger.info("========666===========sessionKey:============666===============");
|
||||
logger.info("========666===========sessionKey:============666==============="+sessionKey);
|
||||
logger.info("========666===========sessionKey:============666===============");
|
||||
if (StringUtils.isEmpty(openid)) {
|
||||
return R.fail(HttpStatus.ERROR_STATUS, "openid获取失败");
|
||||
}
|
||||
|
||||
@ -37,4 +37,6 @@ public interface XhpcUserVehicleMapper {
|
||||
int defaultUserVehicleList(@Param("vehicleId")Long vehicleId,@Param("userId") Long userId,@Param("source") Integer source);
|
||||
|
||||
int enlightenedUserVehicle(@Param("vehicleId")Long vehicleId,@Param("status") Integer status);
|
||||
|
||||
int updateVehicleNameUserId(@Param("userId") Long userId,@Param("vehicleName") String vehicleName);
|
||||
}
|
||||
|
||||
@ -45,6 +45,9 @@ public class XhpcUserVehicleServiceImpl extends BaseService implements IXhpcUser
|
||||
xhpcUserVehicle.setDelFlag(0);
|
||||
xhpcUserVehicleMapper.updateUserVehicle(xhpcUserVehicle);
|
||||
}else{
|
||||
|
||||
//查询是否存在相同的车牌号,车牌相同以前的删除
|
||||
xhpcUserVehicleMapper.updateVehicleNameUserId(xhpcUserVehicle.getAppUserId(),xhpcUserVehicle.getVehicleName());
|
||||
int i = xhpcUserVehicleMapper.xhpcUserVehicleInformation(xhpcUserVehicle.getAppUserId(), xhpcUserVehicle.getSource(), 0);
|
||||
if(i==0){
|
||||
xhpcUserVehicle.setType(1);
|
||||
|
||||
@ -14,10 +14,10 @@ spring:
|
||||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 120.26.46.180:8858
|
||||
server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 120.26.46.180:8858
|
||||
server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user