Merge branch 'dev-zzx' into dev-new

This commit is contained in:
Lemon
2024-12-11 11:26:10 +08:00
19 changed files with 704 additions and 226 deletions

View File

@@ -1,10 +1,11 @@
package com.jsowell.api.thirdparty; package com.jsowell.api.thirdparty;
import com.alibaba.fastjson2.JSON; import com.alibaba.fastjson2.JSON;
import com.jsowell.common.annotation.Anonymous; import com.jsowell.common.annotation.Anonymous;
import com.jsowell.common.core.domain.AjaxResult;
import com.jsowell.common.enums.thirdparty.ThirdPartyReturnCodeEnum; import com.jsowell.common.enums.thirdparty.ThirdPartyReturnCodeEnum;
import com.jsowell.common.exception.BusinessException; import com.jsowell.common.exception.BusinessException;
import com.jsowell.common.response.RestApiResponse;
import com.jsowell.pile.dto.QueryOperatorInfoDTO; import com.jsowell.pile.dto.QueryOperatorInfoDTO;
import com.jsowell.pile.dto.QueryStationInfoDTO; import com.jsowell.pile.dto.QueryStationInfoDTO;
import com.jsowell.pile.thirdparty.CommonParamsDTO; import com.jsowell.pile.thirdparty.CommonParamsDTO;
@@ -12,12 +13,10 @@ import com.jsowell.thirdparty.lianlian.common.CommonResult;
import com.jsowell.thirdparty.platform.service.ThirdPartyPlatformService; import com.jsowell.thirdparty.platform.service.ThirdPartyPlatformService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.Map; import java.util.Map;
/** /**
@@ -33,6 +32,7 @@ public class GuiZhouPlatformController extends ThirdPartyBaseController {
@Qualifier("guiZhouPlatformServiceImpl") @Qualifier("guiZhouPlatformServiceImpl")
private ThirdPartyPlatformService platformLogic; private ThirdPartyPlatformService platformLogic;
/** /**
* getToken * getToken
*/ */
@@ -150,4 +150,63 @@ public class GuiZhouPlatformController extends ThirdPartyBaseController {
} }
return CommonResult.failed("查询充电站状态信息发生异常"); return CommonResult.failed("查询充电站状态信息发生异常");
} }
/**
* 历史充电订单信息推送
*/
@GetMapping("/v1/supervise_notification_charge_order_info_history/{orderCode}")
public RestApiResponse<?> notificationChargeOrderInfoHistory(@PathVariable("orderCode") String orderCode) {
RestApiResponse<?> response = null;
String result = null;
try {
result = platformLogic.notificationChargeOrderInfoHistory(orderCode);
response = new RestApiResponse<>(result);
} catch (Exception e) {
logger.error("贵州平台推送充电站历史充电订单信息 error", e);
return new RestApiResponse<>(e);
}
logger.info("贵州平台推送充电站历史充电订单信息 result:{}", result);
return response;
}
/**
* 推送充换电站用能统计信息
* @param stationId
* @return
*/
@GetMapping("/v1/supervise_notification_operation_stats_info/{stationId}")
public RestApiResponse<?> notificationOperationStatsInfo(@PathVariable("stationId") String stationId) {
RestApiResponse<?> response = null;
String result = null;
try {
result = platformLogic.notificationOperationStatsInfo(stationId);
response = new RestApiResponse<>(result);
} catch (Exception e) {
logger.error("贵州平台推送充换电站用能统计信息 error", e);
return new RestApiResponse<>(e);
}
logger.info("贵州平台推送充换电站用能统计信息 result:{}", result);
return response;
}
/**
* 推送充换电站实时功率
* @param stationIds
* @return
*/
@GetMapping("/v1/supervise_notification_realtime_power_info/{stationIds}")
public RestApiResponse<?> notificationPowerInfo(@PathVariable("stationIds") List<String> stationIds) {
RestApiResponse<?> response = null;
String result = null;
try {
result = platformLogic.notificationPowerInfo(stationIds);
response = new RestApiResponse<>(result);
} catch (Exception e) {
logger.error("贵州平台推送充换电站用能统计信息 error", e);
return new RestApiResponse<>(e);
}
logger.info("贵州平台推送充换电站用能统计信息 result:{}", result);
return response;
}
} }

View File

@@ -95,6 +95,7 @@ public class Constants {
public static final String OPERATORID_LIANLIAN = "MA1JLFUU8"; public static final String OPERATORID_LIANLIAN = "MA1JLFUU8";
public static final String OPERATORID_JIANG_SU = "MA1X78KH5"; public static final String OPERATORID_JIANG_SU = "MA1X78KH5";
public static final String OPERATORID_GUI_ZHOU = "MAC9K4RRX";
public static final String MANUFACTURER_NAME = "举视(江苏)新能源设备制造有限公司"; public static final String MANUFACTURER_NAME = "举视(江苏)新能源设备制造有限公司";

View File

@@ -1,5 +1,6 @@
package com.jsowell.pile.domain; package com.jsowell.pile.domain;
import com.alibaba.fastjson2.annotation.JSONField;
import com.jsowell.common.annotation.Excel; import com.jsowell.common.annotation.Excel;
import com.jsowell.common.core.domain.BaseEntity; import com.jsowell.common.core.domain.BaseEntity;
import lombok.Data; import lombok.Data;
@@ -8,6 +9,7 @@ import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle; import org.apache.commons.lang3.builder.ToStringStyle;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.List;
/** /**
* 充电站信息对象 pile_station_info * 充电站信息对象 pile_station_info
@@ -336,6 +338,57 @@ public class PileStationInfo extends BaseEntity {
@Excel(name = "是否有地锁(0-无1-有)") @Excel(name = "是否有地锁(0-无1-有)")
private String parkingLockFlag; private String parkingLockFlag;
/**
*服务车型描述
*/
@Excel(name = "服务车型描述")
private List<String> swapMatchCars;
/**
*是否为通用类型
*/
@Excel(name = "是否为通用类型(1-通用 ; 2-非通用)")
private Integer generalApplicationType;
/**
*充换电站方位
* 1地面-停车场
* 2地面-路侧
* 3地下停车场
* 4立体式停车楼
*/
@Excel(name = "充换电站方位")
private Integer stationOrientation;
/**
* 充换电站建筑面积
*/
@Excel(name = "充换电站建筑面积")
private String stationArea;
/**
* 充换电站人工值守
*/
@Excel(name = "是否有充换电站人工值守(0-无 ; 1-有)")
private String havePerson;
/**
* 周边配套设施
* 1卫生间
* 2便利店
* 3餐厅
* 4休息室
* 5雨棚
*/
@Excel(name = "周边配套设施")
private String supportingFacilities;
/**
* 站点额定总功率
*/
@Excel(name = "站点额定总功率")
private BigDecimal ratedPower;
/** /**
* 删除标识0-正常1-删除) * 删除标识0-正常1-删除)
*/ */
@@ -386,6 +439,9 @@ public class PileStationInfo extends BaseEntity {
.append("barrierFlag", barrierFlag) .append("barrierFlag", barrierFlag)
.append("parkingLockFlag", parkingLockFlag) .append("parkingLockFlag", parkingLockFlag)
.append("delFlag", delFlag) .append("delFlag", delFlag)
.append("swapMatchCars", swapMatchCars)
.append("generalApplicationType",generalApplicationType)
.append("ratedPower",ratedPower)
.toString(); .toString();
} }
} }

View File

@@ -112,7 +112,6 @@ public interface PileBasicInfoService {
/** /**
* 通过桩sn查询basic信息 * 通过桩sn查询basic信息
* *
* @param id 桩id
* @return 结果集合 * @return 结果集合
*/ */
PileDetailVO selectPileDetailByPileSn(String pileSn); PileDetailVO selectPileDetailByPileSn(String pileSn);
@@ -233,7 +232,6 @@ public interface PileBasicInfoService {
/** /**
* 获取充电桩列表 * 获取充电桩列表
* 提供给联联平台 * 提供给联联平台
* @param pileStationInfo
* @return * @return
*/ */
// List<EquipmentInfo> getPileList(PileStationInfo pileStationInfo); // List<EquipmentInfo> getPileList(PileStationInfo pileStationInfo);

View File

@@ -1225,6 +1225,7 @@ public class PileBasicInfoServiceImpl implements PileBasicInfoService {
String pileSn = pileBasicInfo.getSn(); String pileSn = pileBasicInfo.getSn();
equipmentInfo.setEquipmentID(pileSn); equipmentInfo.setEquipmentID(pileSn);
equipmentInfo.setEquipmentClassification(1);
equipmentInfo.setManufacturerID(Constants.OPERATORID_LIANLIAN); equipmentInfo.setManufacturerID(Constants.OPERATORID_LIANLIAN);
equipmentInfo.setManufacturerName(Constants.MANUFACTURER_NAME); equipmentInfo.setManufacturerName(Constants.MANUFACTURER_NAME);
equipmentInfo.setConstructionTime(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD, pileBasicInfo.getCreateTime())); equipmentInfo.setConstructionTime(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD, pileBasicInfo.getCreateTime()));
@@ -1322,6 +1323,7 @@ public class PileBasicInfoServiceImpl implements PileBasicInfoService {
connectorInfo.setParkNo(pileConnectorInfo.getParkNo()); connectorInfo.setParkNo(pileConnectorInfo.getParkNo());
} }
connectorInfo.setVoltageUpperLimits(Integer.valueOf(modelInfo.getRatedVoltage())); connectorInfo.setVoltageUpperLimits(Integer.valueOf(modelInfo.getRatedVoltage()));
connectorInfo.setEquipmentClassification(1);
connectorInfo.setVoltageLowerLimits(Integer.valueOf(modelInfo.getRatedVoltage())); connectorInfo.setVoltageLowerLimits(Integer.valueOf(modelInfo.getRatedVoltage()));
connectorInfo.setCurrent(Integer.valueOf(modelInfo.getRatedCurrent())); connectorInfo.setCurrent(Integer.valueOf(modelInfo.getRatedCurrent()));
connectorInfo.setConnectorName(pileConnectorInfo.getPileConnectorCode()); connectorInfo.setConnectorName(pileConnectorInfo.getPileConnectorCode());

View File

@@ -23,6 +23,14 @@ public class ConnectorInfo {
@JSONField(name = "ConnectorID") @JSONField(name = "ConnectorID")
private String connectorID; private String connectorID;
/**
* 设备接口分类
* 1车辆充电设备接口
* 2换电站内的电池箱 充电设备接口
*/
@JSONField(name = "EquipmentClassification")
private Integer equipmentClassification;
/** /**
* 充电设备接口名称 N * 充电设备接口名称 N
*/ */
@@ -51,12 +59,36 @@ public class ConnectorInfo {
@JSONField(name = "VoltageLowerLimits") @JSONField(name = "VoltageLowerLimits")
private Integer voltageLowerLimits; private Integer voltageLowerLimits;
/**
*恒功率电压上限
*/
@JSONField(name = "ConstantVoltageUpperLimits")
private Integer constantVoltageUpperLimits;
/**
*恒功率电压下限
*/
@JSONField(name = "ConstantVoltageLowerLimits")
private Integer constantVoltageLowerLimits;
/** /**
* 额定电流(单位A) Y * 额定电流(单位A) Y
*/ */
@JSONField(name = "Current") @JSONField(name = "Current")
private Integer current; private Integer current;
/**
*恒功率电流上限
*/
@JSONField(name = "ConstantCurrentUpperLimits")
private Integer ConstantCurrentUpperLimits;
/**
*恒功率电流下限
*/
@JSONField(name = "ConstantCurrentLowerLimits")
private Integer ConstantCurrentLowerLimits;
/** /**
* 额定功率(单位kW) Y * 额定功率(单位kW) Y
*/ */
@@ -105,4 +137,10 @@ public class ConnectorInfo {
@JSONField(name = "AuxPower") @JSONField(name = "AuxPower")
private Integer auxPower; private Integer auxPower;
/**
* 运营时间
*/
@JSONField(name = "OpreateHours")
private String opreateHours;
} }

View File

@@ -24,6 +24,13 @@ public class EquipmentInfo {
@JSONField(name = "EquipmentID") @JSONField(name = "EquipmentID")
private String equipmentID; private String equipmentID;
/**
* 设备唯一编码
*设备生产商组织机构代 码 9 位+设备出厂唯一 编码
*/
@JSONField(name = "EquipmentUniqueNumber")
private String equipmentUniqueNumber;
/** /**
* 设备生产商组织机构代码 Y * 设备生产商组织机构代码 Y
*/ */
@@ -69,6 +76,13 @@ public class EquipmentInfo {
@JSONField(name = "EquipmentType") @JSONField(name = "EquipmentType")
private Integer equipmentType; private Integer equipmentType;
/**
* 设备分类
* 1车辆充电设备 2换电站内的电池箱 充电设备
*/
@JSONField(name = "EquipmentClassification")
private Integer equipmentClassification;
/** /**
* 设备状态 Y * 设备状态 Y
* 0未知 * 0未知
@@ -93,6 +107,13 @@ public class EquipmentInfo {
@JSONField(name = "NewNationalStandard") @JSONField(name = "NewNationalStandard")
private Integer newNationalStandard; private Integer newNationalStandard;
/**
* 充电设备接口列表 Y
* 该充电设备所有的充电设备接口的信息对象集合
*/
@JSONField(name = "SupConnectorInfos")
private List<ConnectorInfo> supconnectorInfos;
/** /**
* 充电设备接口列表 Y * 充电设备接口列表 Y
* 该充电设备所有的充电设备接口的信息对象集合 * 该充电设备所有的充电设备接口的信息对象集合
@@ -104,13 +125,15 @@ public class EquipmentInfo {
* 充电设备经度 N * 充电设备经度 N
* GCJ-02坐标系 * GCJ-02坐标系
*/ */
// private BigDecimal EquipmentLng; @JSONField(name = "EquipmentLng")
private BigDecimal equipmentLng;
/** /**
* 充电设备纬度 N * 充电设备纬度 N
* GCJ-02坐标系 * GCJ-02坐标系
*/ */
// private BigDecimal EquipmentLat; @JSONField(name = "EquipmentLat")
private BigDecimal equipmentLat;
/** /**
* 是否支持VIN码识别(0-否1-是) Y * 是否支持VIN码识别(0-否1-是) Y

View File

@@ -186,6 +186,14 @@ public class BaseStationInfo {
@JSONField(name = "MatchCars") @JSONField(name = "MatchCars")
private String matchCars; private String matchCars;
/**
* 服务车型描述
* 描述换电站可服务的车系车型(厂牌型号)
* 注:站点分类为 2 或 3 时,此字段必填,为 1 时非必填。
*/
@JSONField(name = "SwapMatchCars")
private List<String> swapMatchCars;
/** /**
* 车位楼层及数量描述 N * 车位楼层及数量描述 N
* 车位楼层以及数量信息 * 车位楼层以及数量信息
@@ -256,4 +264,11 @@ public class BaseStationInfo {
@JSONField(name = "EquipmentInfos") @JSONField(name = "EquipmentInfos")
private List<EquipmentInfo> equipmentInfos; private List<EquipmentInfo> equipmentInfos;
/**
* 充电设备信息列表 Y
* 该充电站所有充电设备信息对象集合
*/
@JSONField(name = "SupEquipmentInfos")
private List<EquipmentInfo> supequipmentInfos;
} }

View File

@@ -2968,8 +2968,10 @@
JOIN pile_merchant_info t3 on t1.merchant_id = t3.id JOIN pile_merchant_info t3 on t1.merchant_id = t3.id
WHERE WHERE
t1.station_id = #{stationId,jdbcType=VARCHAR} t1.station_id = #{stationId,jdbcType=VARCHAR}
AND t1.charge_start_time <![CDATA[ >= ]]> DATE_SUB( CURDATE(), INTERVAL 1 DAY ) -- AND t1.charge_start_time <![CDATA[ >= ]]> DATE_SUB( CURDATE(), INTERVAL 1 DAY )
AND t1.charge_start_time <![CDATA[ < ]]> CURDATE() -- AND t1.charge_start_time <![CDATA[ < ]]> CURDATE()
AND t1.charge_start_time <![CDATA[ >= ]]> '2024-07-08'
AND t1.charge_start_time <![CDATA[ < ]]> '2024-8-19'
</select> </select>
<select id="queryOrderByOccupyTime" resultType="com.jsowell.pile.vo.web.OrderListVO"> <select id="queryOrderByOccupyTime" resultType="com.jsowell.pile.vo.web.OrderListVO">

View File

@@ -33,6 +33,14 @@ public class ConnectorStatusInfo {
@JSONField(name = "Status") @JSONField(name = "Status")
private Integer status; private Integer status;
/**
* 设备接口分类
* 1车辆充电设备接口
* 2换电站内的电池箱 充电设备接口
*/
@JSONField(name = "EquipmentClassification")
private int equipmentClassification;
/** /**
* 车位状态(0-未知10-空闲50-占用) N * 车位状态(0-未知10-空闲50-占用) N
*/ */
@@ -60,4 +68,11 @@ public class ConnectorStatusInfo {
@JSONField(name = "EquipmentID") @JSONField(name = "EquipmentID")
private String equipmentId; private String equipmentId;
/**
* 状态更新时间
* 本次状态变化的时间格式“yyyy-MM-dd HH:mm:ss”
*/
@JSONField(name = "UpdateTime")
private String updateTime;
} }

View File

@@ -1,6 +1,7 @@
package com.jsowell.thirdparty.platform.common; package com.jsowell.thirdparty.platform.common;
import com.alibaba.fastjson2.annotation.JSONField; import com.alibaba.fastjson2.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Builder; import lombok.Builder;
import lombok.Data; import lombok.Data;
@@ -67,6 +68,11 @@ public class SupStationPowerInfo {
@JSONField(name = "EquipmentPowerInfos") @JSONField(name = "EquipmentPowerInfos")
private List<EquipmentPowerInfo> equipmentPowerInfos; private List<EquipmentPowerInfo> equipmentPowerInfos;
/**
* 充电设备功率信息列表
*/
@JSONField(name = "SupEquipmentPowerInfos")
private List<EquipmentPowerInfo> supEquipmentPowerInfos;
@Data @Data
public static class EquipmentPowerInfo{ public static class EquipmentPowerInfo{
@@ -104,6 +110,11 @@ public class SupStationPowerInfo {
@JSONField(name = "ConnectorPowerInfos") @JSONField(name = "ConnectorPowerInfos")
private List<ConnectorPowerInfo> connectorPowerInfos; private List<ConnectorPowerInfo> connectorPowerInfos;
/**
* 充电设备接口实时功率列表
*/
@JSONField(name = "SupConnectorPowerInfos")
private List<ConnectorPowerInfo> supConnectorPowerInfos;
@Data @Data
public static class ConnectorPowerInfo{ public static class ConnectorPowerInfo{
@@ -136,4 +147,74 @@ public class SupStationPowerInfo {
private BigDecimal connectorRealTimePower; private BigDecimal connectorRealTimePower;
} }
} }
@Data
private static class SupEquipmentPowerInfo{
/**
* 充电设备编码
*/
@JSONField(name = "EquipmentID")
private String equipmentID;
/**
* 设备分类
* 1车辆充电设备
* 2换电站内的电池箱充电设备
*/
@JSONField(name = "EquipmentClassification")
private Integer equipmentClassification;
/**
* 统计时间
* 格式yyyy-MM-dd HH:mm:ss
*/
@JSONField(name = "DataTime")
private String dataTime;
/**
* 充电设备实时功率
* 保留一位小数
*/
@JSONField(name = "EquipRealTimePower")
private BigDecimal equipRealTimePower;
/**
* 充电设备接口实时功率列表
*/
@JSONField(name = "ConnectorPowerInfos")
private List<SupConnectorPowerInfo> connectorPowerInfos;
@Data
private static class SupConnectorPowerInfo{
/**
* 充电设备接口编码
*/
@JsonProperty(value = "ConnectorID")
private String connectorID;
/**
* 设备分类
* 1车辆充电设备
* 2换电站内的电池箱充电设备
*/
@JSONField(name = "EquipmentClassification")
private Integer equipmentClassification;
/**
* 统计时间
* 格式yyyy-MM-dd HH:mm:ss
*/
@JSONField(name = "DataTime")
private String dataTime;
/**
* 充电设备接口实时功率
* 保留一位小数
*/
@JSONField(name = "ConnectorRealTimePower")
private BigDecimal connectorRealTimePower;
}
}
} }

View File

@@ -26,6 +26,15 @@ public class ChargeOrderInfo {
@JSONField(name = "OperatorID") @JSONField(name = "OperatorID")
private String operatorID; private String operatorID;
/**
* 设备分类
* 1车辆充电设备
* 2换电站内的电池箱充电设备
*/
@JSONField(name = "EquipmentClassification")
private Integer equipmentClassification;
/** /**
* 设备所属方 * 设备所属方
* IDEquipmentOwnerID * IDEquipmentOwnerID
@@ -233,6 +242,17 @@ public class ChargeOrderInfo {
@JSONField(name = "TotalSeviceMoney") @JSONField(name = "TotalSeviceMoney")
private BigDecimal totalSeviceMoney; private BigDecimal totalSeviceMoney;
/**
* 总服务费
* TotalSeviceMoney
* 本单总服务费单位小数点后4位
* 是
* 浮点数
* ≤8字符小数点后4位
*/
@JSONField(name = "TotalServiceMoney")
private BigDecimal totalServiceMoney;
/** /**
* 累计总金额 * 累计总金额
* TotalMoney * TotalMoney

View File

@@ -81,6 +81,47 @@ public class SupChargeOrderInfo {
@JSONField(name = "OrderNo") @JSONField(name = "OrderNo")
private String orderNo; private String orderNo;
/**
* 设备接口分类
* 1车辆充电设备接 口
* 2换电站内的电池 箱充电设备接口
*/
@JSONField(name = "EquipmentClassification")
private Integer equipmentClassification;
/**
* 换电订单编 号
* 换电订单唯一标识 注:设备接口分类为 2 的,该字段为必填
*/
@JSONField(name = "SwapOrderID")
private Integer swapOrderID;
/**
* 充电开始 SOC
*/
@JSONField(name = "StartSOC")
private String startSOC;
/**
* 充电结束 SOC
*/
@JSONField(name = "EndSOC")
private String endSOC;
/**
* 电池箱编码
*/
@JSONField(name = "BatteryPackID")
private String batteryPackID;
/**
* 是否有调仓
* 0否 1
* 注:设备接口分类为 2 时,该字段为必填 项;设备接口分类为 1 时,该字段为非必 填项
*/
@JSONField(name = "BatteryCabinChange")
private String batteryCabinChange;
/** /**
* 车牌号 * 车牌号
* LicensePlate * LicensePlate

View File

@@ -52,6 +52,18 @@ public class SupEquipChargeStatusInfo {
@JSONField(name = "OrderNo") @JSONField(name = "OrderNo")
private String orderNo; private String orderNo;
/**
* 车牌号
*/
@JSONField(name = "LicensePlate")
private String licensePlate;
/**
* 车牌号
*/
@JSONField(name = "VIN")
private String vin;
/** /**
* 充电订单状态 * 充电订单状态
* 1、启动中 * 1、启动中
@@ -110,6 +122,32 @@ public class SupEquipChargeStatusInfo {
@JSONField(name = "VoltageA") @JSONField(name = "VoltageA")
private BigDecimal voltageA; private BigDecimal voltageA;
/**
* B相电流
* 小数点后1位
*/
@JSONField(name = "CurrentB")
private BigDecimal currentB;
/**
* B相电压
*/
@JSONField(name = "VoltageB")
private BigDecimal voltageB;
/**
* C相电流
* 小数点后1位
*/
@JSONField(name = "CurrentC")
private BigDecimal currentC;
/**
* C相电压
*/
@JSONField(name = "VoltageC")
private BigDecimal voltageC;
/** /**
* 电池剩余电量 * 电池剩余电量
* 小数点后1位 * 小数点后1位
@@ -131,11 +169,38 @@ public class SupEquipChargeStatusInfo {
/** /**
* 累计充电量 * 累计充电量
* 小数点后4位
*/ */
@JSONField(name = "TotalPower") @JSONField(name = "TotalPower")
private BigDecimal totalPower; private BigDecimal totalPower;
/**
* 累计电费
* 小数点后2位
*/
@JSONField(name = "ElecMoney")
private String elecMoney;
/**
* 累计服务费
* 小数点后2位
*/
@JSONField(name = "ServiceMoney")
private String serviceMoney;
/**
* 时段数
* 参数范围0 32
*/
@JSONField(name = "SumPeriod")
public Integer sumPeriod;
/**
* 充电明细信息
* 单时段充电明细信 息,参照公共对象: 充电明细信息
*/
@JSONField(name = "ChargeDetails")
private List<SupChargeDetails> chargeDetails;
/** /**
* 上报时间 * 上报时间
*/ */
@@ -162,6 +227,6 @@ public class SupEquipChargeStatusInfo {
@JSONField(name = "StartChargeSeqStat") @JSONField(name = "StartChargeSeqStat")
private Integer startChargeSeqStat; private Integer startChargeSeqStat;
@JSONField(name = "ChargeDetails") //@JSONField(name = "ChargeDetails")
private List<ChargeDetail> chargeDetails; //private List<ChargeDetail> chargeDetails;
} }

View File

@@ -30,7 +30,7 @@ public class SupStationInfo extends StationInfo {
* 2换电站内的电池箱充电设备接口 * 2换电站内的电池箱充电设备接口
*/ */
@JSONField(name = "EquipmentClassification") @JSONField(name = "EquipmentClassification")
private Integer equipmentClassification; private String equipmentClassification;
/** /**
* 充换电站所在县以下行政区划代码 * 充换电站所在县以下行政区划代码
@@ -49,6 +49,16 @@ public class SupStationInfo extends StationInfo {
@JSONField(name = "StationClassification") @JSONField(name = "StationClassification")
private int stationClassification; private int stationClassification;
/**
* 通用类型
* 1通用可为 3 种或 3 种以上的车型进行换电)
* 2非通用
* 注:站点分类为 2 或 3 时,此字段必填,为 1 时非必填。
*/
@JSONField(name = "GeneralApplicationType")
private Integer generalApplicationType;
/** /**
* 7*24小时营业 * 7*24小时营业
* 0 * 0
@@ -99,5 +109,41 @@ public class SupStationInfo extends StationInfo {
@JSONField(name = "BuildTime") @JSONField(name = "BuildTime")
private String BuildTime; private String BuildTime;
/**
* 充换电站方位
* 1地面-停车场
* 2地面-路侧
* 3地下停车场
* 4立体式停车楼
*/
@JSONField(name = "StationOrientation")
private String stationOrientation;
/**
* 充换电站建筑面积
* 该充电场站建设用 地面积
*/
@JSONField(name = "StationArea")
private String stationArea;
/**
* 充换电站人工值守
* 0
* 1
*/
@JSONField(name = "HavePerson")
private String havePerson;
/**
* 周边配套设施
* 1卫生间
* 2便利店
* 3餐厅
* 4休息室
* 5雨棚
*/
@JSONField(name = "SupportingFacilities")
private String supportingFacilities;
private List<PolicyInfo> PolicyInfos; private List<PolicyInfo> PolicyInfos;
} }

View File

@@ -64,6 +64,12 @@ public class SupStationPowerInfo {
@JSONField(name = "EquipmentPowerInfos") @JSONField(name = "EquipmentPowerInfos")
private List<EquipmentPowerInfo> equipmentPowerInfos; private List<EquipmentPowerInfo> equipmentPowerInfos;
/**
* 充电设备功率信息列表
*/
@JSONField(name = "SupEquipmentPowerInfos")
private List<EquipmentPowerInfo> supequipmentPowerInfos;
@Data @Data
public static class EquipmentPowerInfo{ public static class EquipmentPowerInfo{
@@ -100,6 +106,12 @@ public class SupStationPowerInfo {
@JSONField(name = "ConnectorPowerInfos") @JSONField(name = "ConnectorPowerInfos")
private List<ConnectorPowerInfo> connectorPowerInfos; private List<ConnectorPowerInfo> connectorPowerInfos;
/**
* 充电设备接口功率信息列表
*/
@JSONField(name = "SupConnectorPowerInfos")
private List<ConnectorPowerInfo> supconnectorPowerInfos;
@Data @Data
public static class ConnectorPowerInfo{ public static class ConnectorPowerInfo{

View File

@@ -105,8 +105,12 @@ public class SupStationStatsInfo {
private List<EquipmentStatsInfo> equipmentStatsInfos; private List<EquipmentStatsInfo> equipmentStatsInfos;
@JSONField(name = "SupEquipmentStatsInfos")
private List<EquipmentStatsInfo> supEquipmentStatsInfos;
@Data @Data
public static class EquipmentStatsInfo{ public static class EquipmentStatsInfo {
/** /**
* 充电设备编码 * 充电设备编码
@@ -152,9 +156,14 @@ public class SupStationStatsInfo {
@JSONField(name = "ConnectorStatsInfos") @JSONField(name = "ConnectorStatsInfos")
private List<ConnectorStatsInfo> connectorStatsInfos; private List<ConnectorStatsInfo> connectorStatsInfos;
@Data /**
public static class ConnectorStatsInfo{ * 充电设备接口运行统计信息列表
*/
@JSONField(name = "SupConnectorStatsInfos")
private List<ConnectorStatsInfo> supconnectorStatsInfos;
@Data
public static class ConnectorStatsInfo {
/** /**
* 充电设备接口编码 * 充电设备接口编码
* 1车辆充电设备 * 1车辆充电设备
@@ -194,7 +203,5 @@ public class SupStationStatsInfo {
private Integer connectorTotalWarningNum; private Integer connectorTotalWarningNum;
} }
} }
} }

View File

@@ -456,7 +456,7 @@ public interface ThirdPartyPlatformService extends InitializingBean {
String response = HttpUtil.post(requestUrl, tokenRequest); String response = HttpUtil.post(requestUrl, tokenRequest);
LianLianResultVO result = JSON.parseObject(response, LianLianResultVO.class); LianLianResultVO result = JSON.parseObject(response, LianLianResultVO.class);
// logger.info("获取令牌 result:{}", result); // logger.info("获取令牌 result:{}", result);
if (result.getRet() == 0) { if (result.getRet() == 0) {
// 解密data // 解密data

View File

@@ -11,21 +11,19 @@ import com.jsowell.common.constant.Constants;
import com.jsowell.common.core.domain.ykc.RealTimeMonitorData; import com.jsowell.common.core.domain.ykc.RealTimeMonitorData;
import com.jsowell.common.core.redis.RedisCache; import com.jsowell.common.core.redis.RedisCache;
import com.jsowell.common.enums.lianlian.StationPaymentEnum; import com.jsowell.common.enums.lianlian.StationPaymentEnum;
import com.jsowell.common.enums.thirdparty.BusinessInformationExchangeEnum;
import com.jsowell.common.enums.thirdparty.ThirdPlatformTypeEnum; import com.jsowell.common.enums.thirdparty.ThirdPlatformTypeEnum;
import com.jsowell.common.enums.ykc.BillingTimeTypeEnum; import com.jsowell.common.enums.ykc.BillingTimeTypeEnum;
import com.jsowell.common.enums.ykc.OrderStatusEnum;
import com.jsowell.common.enums.ykc.PileConnectorDataBaseStatusEnum; import com.jsowell.common.enums.ykc.PileConnectorDataBaseStatusEnum;
import com.jsowell.common.enums.ykc.ReturnCodeEnum; import com.jsowell.common.enums.ykc.ReturnCodeEnum;
import com.jsowell.common.exception.BusinessException; import com.jsowell.common.exception.BusinessException;
import com.jsowell.common.util.*; import com.jsowell.common.util.*;
import com.jsowell.pile.domain.*; import com.jsowell.pile.domain.*;
import com.jsowell.pile.dto.PushRealTimeInfoDTO;
import com.jsowell.pile.dto.QueryConnectorListDTO; import com.jsowell.pile.dto.QueryConnectorListDTO;
import com.jsowell.pile.dto.QueryOperatorInfoDTO; import com.jsowell.pile.dto.QueryOperatorInfoDTO;
import com.jsowell.pile.dto.QueryStationInfoDTO; import com.jsowell.pile.dto.QueryStationInfoDTO;
import com.jsowell.pile.service.*; import com.jsowell.pile.service.*;
import com.jsowell.pile.thirdparty.CommonParamsDTO; import com.jsowell.pile.thirdparty.CommonParamsDTO;
import com.jsowell.pile.thirdparty.ConnectorInfo;
import com.jsowell.pile.thirdparty.EquipmentInfo; import com.jsowell.pile.thirdparty.EquipmentInfo;
import com.jsowell.pile.util.MerchantUtils; import com.jsowell.pile.util.MerchantUtils;
import com.jsowell.pile.vo.SupStationStatsVO; import com.jsowell.pile.vo.SupStationStatsVO;
@@ -33,12 +31,10 @@ import com.jsowell.pile.vo.ThirdPartySecretInfoVO;
import com.jsowell.pile.vo.base.ConnectorInfoVO; import com.jsowell.pile.vo.base.ConnectorInfoVO;
import com.jsowell.pile.vo.base.MerchantInfoVO; import com.jsowell.pile.vo.base.MerchantInfoVO;
import com.jsowell.pile.vo.base.ThirdPartyStationInfoVO; import com.jsowell.pile.vo.base.ThirdPartyStationInfoVO;
import com.jsowell.pile.vo.base.ThirdPartyStationRelationVO;
import com.jsowell.pile.vo.uniapp.customer.BillingPriceVO; import com.jsowell.pile.vo.uniapp.customer.BillingPriceVO;
import com.jsowell.pile.vo.web.PileConnectorInfoVO; import com.jsowell.pile.vo.web.PileConnectorInfoVO;
import com.jsowell.pile.vo.web.PileMerchantInfoVO; import com.jsowell.pile.vo.web.PileMerchantInfoVO;
import com.jsowell.pile.vo.web.PileModelInfoVO;
import com.jsowell.pile.vo.web.PileStationVO;
import com.jsowell.thirdparty.lianlian.domain.ConnectorChargeStatusInfo;
import com.jsowell.thirdparty.lianlian.domain.ConnectorStatusInfo; import com.jsowell.thirdparty.lianlian.domain.ConnectorStatusInfo;
import com.jsowell.thirdparty.lianlian.domain.StationStatusInfo; import com.jsowell.thirdparty.lianlian.domain.StationStatusInfo;
import com.jsowell.thirdparty.lianlian.vo.AccessTokenVO; import com.jsowell.thirdparty.lianlian.vo.AccessTokenVO;
@@ -46,7 +42,6 @@ import com.jsowell.thirdparty.platform.domain.*;
import com.jsowell.thirdparty.platform.factory.ThirdPartyPlatformFactory; import com.jsowell.thirdparty.platform.factory.ThirdPartyPlatformFactory;
import com.jsowell.thirdparty.platform.service.ThirdPartyPlatformService; import com.jsowell.thirdparty.platform.service.ThirdPartyPlatformService;
import com.jsowell.thirdparty.platform.util.Cryptos; import com.jsowell.thirdparty.platform.util.Cryptos;
import com.jsowell.thirdparty.platform.util.GBSignUtils;
import com.jsowell.thirdparty.platform.util.HttpRequestUtil; import com.jsowell.thirdparty.platform.util.HttpRequestUtil;
import com.jsowell.thirdparty.platform.util.ThirdPartyPlatformUtils; import com.jsowell.thirdparty.platform.util.ThirdPartyPlatformUtils;
import com.jsowell.thirdparty.service.ThirdpartySecretInfoService; import com.jsowell.thirdparty.service.ThirdpartySecretInfoService;
@@ -60,6 +55,7 @@ import org.springframework.stereotype.Service;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.math.RoundingMode; import java.math.RoundingMode;
import java.text.DecimalFormat;
import java.util.*; import java.util.*;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
import java.util.function.Function; import java.util.function.Function;
@@ -83,14 +79,10 @@ public class GuiZhouPlatformServiceImpl implements ThirdPartyPlatformService {
@Autowired @Autowired
private PileMerchantInfoService pileMerchantInfoService; private PileMerchantInfoService pileMerchantInfoService;
@Autowired @Autowired
private ThirdPartyPlatformConfigService thirdPartyPlatformConfigService;
@Autowired
private PileConnectorInfoService pileConnectorInfoService; private PileConnectorInfoService pileConnectorInfoService;
@Autowired @Autowired
private OrderBasicInfoService orderBasicInfoService; private OrderBasicInfoService orderBasicInfoService;
@Autowired @Autowired
private PileModelInfoService pileModelInfoService;
@Autowired
private PileBillingTemplateService pileBillingTemplateService; private PileBillingTemplateService pileBillingTemplateService;
@Autowired @Autowired
private RedisCache redisCache; private RedisCache redisCache;
@@ -227,7 +219,7 @@ public class GuiZhouPlatformServiceImpl implements ThirdPartyPlatformService {
String stationId = String.valueOf(pileStationInfo.getId()); String stationId = String.valueOf(pileStationInfo.getId());
stationInfo.setStationID(stationId); stationInfo.setStationID(stationId);
// MerchantInfoVO merchantInfo = pileMerchantInfoService.getMerchantInfo(String.valueOf(pileStationInfo.getMerchantId())); // MerchantInfoVO merchantInfo = pileMerchantInfoService.getMerchantInfo(String.valueOf(pileStationInfo.getMerchantId()));
stationInfo.setOperatorID(Constants.OPERATORID_LIANLIAN); // 组织机构代码 stationInfo.setOperatorID(Constants.OPERATORID_JIANG_SU); // 组织机构代码
stationInfo.setEquipmentOwnerID(String.valueOf(pileStationInfo.getMerchantId())); stationInfo.setEquipmentOwnerID(String.valueOf(pileStationInfo.getMerchantId()));
stationInfo.setStationName(pileStationInfo.getStationName()); stationInfo.setStationName(pileStationInfo.getStationName());
stationInfo.setIsAloneApply(Integer.valueOf(pileStationInfo.getAloneApply())); stationInfo.setIsAloneApply(Integer.valueOf(pileStationInfo.getAloneApply()));
@@ -248,7 +240,18 @@ public class GuiZhouPlatformServiceImpl implements ThirdPartyPlatformService {
// stationInfo.setServiceFee(); // 服务费 xx元/度 // stationInfo.setServiceFee(); // 服务费 xx元/度
stationInfo.setParkFree(Integer.valueOf(pileStationInfo.getParkFree())); stationInfo.setParkFree(Integer.valueOf(pileStationInfo.getParkFree()));
stationInfo.setPayment(pileStationInfo.getPayment()); stationInfo.setPayment(pileStationInfo.getPayment());
stationInfo.setStationClassification(1);
stationInfo.setSupportOrder(Integer.valueOf(pileStationInfo.getSupportOrder())); stationInfo.setSupportOrder(Integer.valueOf(pileStationInfo.getSupportOrder()));
stationInfo.setStationStatus(Integer.valueOf(pileStationInfo.getStationStatus()));
stationInfo.setParkNums(Integer.valueOf(pileStationInfo.getParkNums()));
stationInfo.setRoundTheClock(Constants.ONE);
stationInfo.setParkType("255");
stationInfo.setElectricityType(1);
stationInfo.setCapacity(pileStationInfo.getCapacity().setScale(2, RoundingMode.HALF_UP));
stationInfo.setRatedPower(pileStationInfo.getRatedPower().setScale(1, RoundingMode.HALF_UP));
stationInfo.setOfficialRunTime(DateUtils.dateTime(pileStationInfo.getCreateTime()));
stationInfo.setVideoMonitor(0);
// stationInfo.setParkFeeType(pileStationInfo); // 停车收费类型 // stationInfo.setParkFeeType(pileStationInfo); // 停车收费类型
stationInfo.setBusinessExpandType(Integer.parseInt(pileStationInfo.getAloneApply())); stationInfo.setBusinessExpandType(Integer.parseInt(pileStationInfo.getAloneApply()));
stationInfo.setToiletFlag(Integer.valueOf(pileStationInfo.getToiletFlag())); stationInfo.setToiletFlag(Integer.valueOf(pileStationInfo.getToiletFlag()));
@@ -264,7 +267,15 @@ public class GuiZhouPlatformServiceImpl implements ThirdPartyPlatformService {
stationInfo.setEquipmentInfos(pileList); // 充电设备信息列表 stationInfo.setEquipmentInfos(pileList); // 充电设备信息列表
} }
resultList.add(stationInfo); resultList.add(stationInfo);
// areaCodeCountryside
GeoCodeInfo geoCode = TermRelationTreeCoordinate.completeGeoCode(pileStationInfo.getAddress());
if (geoCode != null) {
String areaCodeCountryside = geoCode.getCounty_code();
stationInfo.setAreaCodeCountryside(areaCodeCountryside);
} }
}
Map<String, Object> map = new LinkedHashMap<>(); Map<String, Object> map = new LinkedHashMap<>();
map.put("PageNo", pageInfo.getPageNum()); map.put("PageNo", pageInfo.getPageNum());
map.put("PageCount", pageInfo.getPages()); map.put("PageCount", pageInfo.getPages());
@@ -296,13 +307,21 @@ public class GuiZhouPlatformServiceImpl implements ThirdPartyPlatformService {
// 组装所需要的数据格式 // 组装所需要的数据格式
SupStationInfo info = SupStationInfo.builder() SupStationInfo info = SupStationInfo.builder()
.stationID(stationId) .stationID(stationId)
.equipmentClassification(Constants.ONE)
.generalApplicationType(2)
.operatorID(operatorId) .operatorID(operatorId)
.stationName(pileStationInfo.getStationName()) .stationName(pileStationInfo.getStationName())
.periodFee(1) // 峰谷分时 0-否1-是
.parkType("255") // 255-参考场地实际收费标准
.roundTheClock(Constants.ONE)
.electricityType(1) // 用电类型 1-商业用电
.videoMonitor(0) // 视频监控配套情况 0-无1-有
.isAloneApply(Integer.valueOf(pileStationInfo.getAloneApply())) .isAloneApply(Integer.valueOf(pileStationInfo.getAloneApply()))
.isPublicParkingLot(Integer.valueOf(pileStationInfo.getPublicParking())) .isPublicParkingLot(Integer.valueOf(pileStationInfo.getPublicParking()))
.countryCode(pileStationInfo.getCountryCode()) .countryCode(pileStationInfo.getCountryCode())
.address(pileStationInfo.getAddress()) .address(pileStationInfo.getAddress())
.serviceTel(pileStationInfo.getStationTel()) .serviceTel(pileStationInfo.getStationTel())
.stationClassification(1)
.stationType(Integer.valueOf(pileStationInfo.getStationType())) .stationType(Integer.valueOf(pileStationInfo.getStationType()))
.stationStatus(Integer.valueOf(pileStationInfo.getStationStatus())) .stationStatus(Integer.valueOf(pileStationInfo.getStationStatus()))
.parkNums(Integer.valueOf(pileStationInfo.getParkNums())) .parkNums(Integer.valueOf(pileStationInfo.getParkNums()))
@@ -316,8 +335,10 @@ public class GuiZhouPlatformServiceImpl implements ThirdPartyPlatformService {
.parkFree(Integer.valueOf(pileStationInfo.getParkFree())) .parkFree(Integer.valueOf(pileStationInfo.getParkFree()))
.supportOrder(Integer.valueOf(pileStationInfo.getSupportOrder())) .supportOrder(Integer.valueOf(pileStationInfo.getSupportOrder()))
.parkFeeType(0) .parkFeeType(0)
.periodFee(1) // 峰谷分时 0-否1-是 .ratedPower(BigDecimal.ONE)//站点额定总功率
.equipmentClassification(1) .officialRunTime(DateUtils.dateTime(pileStationInfo.getCreateTime()))//正式投运时间
.businessExpandType(1)//报装类型
.toiletFlag(Integer.valueOf(pileStationInfo.getToiletFlag())) .toiletFlag(Integer.valueOf(pileStationInfo.getToiletFlag()))
.storeFlag(Integer.valueOf(pileStationInfo.getStoreFlag())) .storeFlag(Integer.valueOf(pileStationInfo.getStoreFlag()))
.restaurantFlag(Integer.valueOf(pileStationInfo.getRestaurantFlag())) .restaurantFlag(Integer.valueOf(pileStationInfo.getRestaurantFlag()))
@@ -333,20 +354,8 @@ public class GuiZhouPlatformServiceImpl implements ThirdPartyPlatformService {
// 只取最后一部分 330213 // 只取最后一部分 330213
String subAreaCode = split[split.length - 1]; String subAreaCode = split[split.length - 1];
info.setAreaCode(subAreaCode); info.setAreaCode(subAreaCode);
// 截取运营商组织机构代码(去除最后一位后的最后九位)
String organizationCode = ""; info.setEquipmentOwnerID(Constants.OPERATORID_GUI_ZHOU);
if (StringUtils.equals(ThirdPlatformTypeEnum.LIAN_LIAN_PLATFORM.getTypeCode(), thirdPlatformType)) {
// 联联平台先使用自己运营商的组织机构代码
organizationCode = Constants.OPERATORID_LIANLIAN;
info.setEquipmentOwnerID(organizationCode);
} else {
MerchantInfoVO merchantInfo = pileMerchantInfoService.getMerchantInfoVO(String.valueOf(pileStationInfo.getMerchantId()));
organizationCode = merchantInfo.getOrganizationCode();
if (StringUtils.isNotBlank(organizationCode) && organizationCode.length() == 18) {
String equipmentOwnerId = StringUtils.substring(organizationCode, organizationCode.length() - 10, organizationCode.length() - 1);
info.setEquipmentOwnerID(equipmentOwnerId);
}
}
info.setPayment(StationPaymentEnum.getPaymentByCode(pileStationInfo.getPayment())); info.setPayment(StationPaymentEnum.getPaymentByCode(pileStationInfo.getPayment()));
if (StringUtils.isNotBlank(pileStationInfo.getParkingNumber())) { if (StringUtils.isNotBlank(pileStationInfo.getParkingNumber())) {
@@ -360,7 +369,7 @@ public class GuiZhouPlatformServiceImpl implements ThirdPartyPlatformService {
// 容量 // 容量
if (StringUtils.isNotBlank(String.valueOf(pileStationInfo.getCapacity()))) { if (StringUtils.isNotBlank(String.valueOf(pileStationInfo.getCapacity()))) {
info.setCapacity(pileStationInfo.getCapacity().setScale(4, RoundingMode.HALF_UP)); info.setCapacity(pileStationInfo.getCapacity().setScale(2, RoundingMode.HALF_UP));
} }
List<EquipmentInfo> pileList = pileBasicInfoService.getPileListForLianLian(stationId); List<EquipmentInfo> pileList = pileBasicInfoService.getPileListForLianLian(stationId);
if (CollectionUtils.isNotEmpty(pileList)) { if (CollectionUtils.isNotEmpty(pileList)) {
@@ -371,6 +380,7 @@ public class GuiZhouPlatformServiceImpl implements ThirdPartyPlatformService {
GeoCodeInfo geoCode = TermRelationTreeCoordinate.completeGeoCode(pileStationInfo.getAddress()); GeoCodeInfo geoCode = TermRelationTreeCoordinate.completeGeoCode(pileStationInfo.getAddress());
if (geoCode != null) { if (geoCode != null) {
String areaCodeCountryside = geoCode.getCounty_code(); String areaCodeCountryside = geoCode.getCounty_code();
areaCodeCountryside = "123456789101";
info.setAreaCodeCountryside(areaCodeCountryside); info.setAreaCodeCountryside(areaCodeCountryside);
} }
@@ -398,54 +408,37 @@ public class GuiZhouPlatformServiceImpl implements ThirdPartyPlatformService {
public Map<String, String> queryStationStatus(QueryStationInfoDTO dto) { public Map<String, String> queryStationStatus(QueryStationInfoDTO dto) {
List<String> stationIds = dto.getStationIds(); List<String> stationIds = dto.getStationIds();
List<StationStatusInfo> StationStatusInfos = new ArrayList<>(); List<StationStatusInfo> StationStatusInfos = new ArrayList<>();
List<Object> ConnectorStatusInfos = new ArrayList<>(); List<Object> connectorStatusInfos = new ArrayList<>();
ThirdPartyPlatformConfig configInfo = thirdPartyPlatformConfigService.getInfoByOperatorId(dto.getOperatorId()); ThirdPartySecretInfoVO thirdPartySecretInfoVO = thirdpartySecretInfoService.queryByThirdPlatformType(thirdPlatformType);
if (configInfo == null) { if (thirdPartySecretInfoVO == null) {
return null; return null;
} }
ConnectorStatusInfo connectorStatusInfo; ConnectorStatusInfo connectorStatusInfo;
for (String stationId : stationIds) { for (String stationId : stationIds) {
PileMerchantInfoVO pileMerchantInfoVO = pileMerchantInfoService.queryMerchantInfoByStationId(stationId);
StationStatusInfo stationStatusInfo = new StationStatusInfo(); StationStatusInfo stationStatusInfo = new StationStatusInfo();
stationStatusInfo.setStationId(stationId); stationStatusInfo.setStationId(stationId);
stationStatusInfo.setOperatorId(Constants.OPERATORID_JIANG_SU);
stationStatusInfo.setStationStatus(50);
String equipmentOwnerID = ThirdPartyPlatformUtils.extractEquipmentOwnerID(pileMerchantInfoVO.getOrganizationCode());
stationStatusInfo.setEquipmentOwnerId(equipmentOwnerID);
// 根据站点id查询 // 根据站点id查询
List<ConnectorInfoVO> list = pileConnectorInfoService.getConnectorListForLianLian(Long.parseLong(stationId)); List<ConnectorInfoVO> list = pileConnectorInfoService.getConnectorListForLianLian(Long.parseLong(stationId));
for (ConnectorInfoVO connectorInfoVO : list) { for (ConnectorInfoVO connectorInfoVO : list) {
String connectorStatus = connectorInfoVO.getConnectorStatus();
if (StringUtils.equals(connectorStatus, PileConnectorDataBaseStatusEnum.OCCUPIED_CHARGING.getValue())) {
// 充电中
ConnectorChargeStatusInfo info = new ConnectorChargeStatusInfo();
OrderBasicInfo orderBasicInfo = orderBasicInfoService.queryChargingByPileConnectorCode(connectorInfoVO.getPileConnectorCode());
if (orderBasicInfo == null) {
continue;
}
List<RealTimeMonitorData> chargingRealTimeData = orderBasicInfoService.getChargingRealTimeData(orderBasicInfo.getTransactionCode());
if (CollectionUtils.isNotEmpty(chargingRealTimeData)) {
RealTimeMonitorData realTimeMonitorData = chargingRealTimeData.get(0);
info.setStartChargeSeq(orderBasicInfo.getOrderCode());
info.setConnectorID(orderBasicInfo.getPileConnectorCode());
info.setConnectorStatus(Integer.valueOf(connectorInfoVO.getConnectorStatus()));
info.setCurrentA(new BigDecimal(realTimeMonitorData.getOutputCurrent()));
info.setVoltageA(new BigDecimal(realTimeMonitorData.getOutputVoltage()));
info.setSoc(new BigDecimal(realTimeMonitorData.getSOC()));
info.setStartTime(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, orderBasicInfo.getChargeStartTime()));
info.setEndTime(DateUtils.getDateTime()); // 本次采样时间
info.setTotalPower(new BigDecimal(realTimeMonitorData.getChargingDegree())); // 累计充电量
info.setTotalMoney(new BigDecimal(realTimeMonitorData.getChargingAmount()));
ConnectorStatusInfos.add(info);
}
} else {
// 其他
connectorStatusInfo = new ConnectorStatusInfo(); connectorStatusInfo = new ConnectorStatusInfo();
String connectorStatus = connectorInfoVO.getConnectorStatus();
connectorStatusInfo.setEquipmentClassification(1);
connectorStatusInfo.setStationId(stationId);
connectorStatusInfo.setConnectorID(connectorInfoVO.getPileConnectorCode()); connectorStatusInfo.setConnectorID(connectorInfoVO.getPileConnectorCode());
connectorStatusInfo.setStatus(Integer.parseInt(connectorInfoVO.getConnectorStatus())); connectorStatusInfo.setEquipmentOwnerId(equipmentOwnerID);
connectorStatusInfo.setOperatorId(Constants.OPERATORID_JIANG_SU);
connectorStatusInfo.setEquipmentId(connectorInfoVO.getPileSn());
connectorStatusInfo.setStatus(Integer.parseInt(connectorStatus));
connectorStatusInfo.setUpdateTime(DateUtils.getDateTime());
ConnectorStatusInfos.add(connectorStatusInfo); connectorStatusInfos.add(connectorStatusInfo);
} }
} stationStatusInfo.setConnectorStatusInfos(connectorStatusInfos);
stationStatusInfo.setConnectorStatusInfos(ConnectorStatusInfos);
StationStatusInfos.add(stationStatusInfo); StationStatusInfos.add(stationStatusInfo);
} }
// 将 StationStatusInfos 分页 // 将 StationStatusInfos 分页
@@ -456,58 +449,55 @@ public class GuiZhouPlatformServiceImpl implements ThirdPartyPlatformService {
.limit(pageSize) .limit(pageSize)
.collect(Collectors.toList()); .collect(Collectors.toList());
int total = StationStatusInfos.size();
int pages = PageUtil.totalPage(total, pageSize);
Map<String, Object> map = new LinkedHashMap<>(); Map<String, Object> map = new LinkedHashMap<>();
map.put("Total", total);
map.put("StationStatusInfos", collect); map.put("StationStatusInfos", collect);
Map<String, String> resultMap = Maps.newLinkedHashMap(); Map<String, String> resultMap = ThirdPartyPlatformUtils.generateResultMap(map, thirdPartySecretInfoVO);
// 加密数据
String encryptData = Cryptos.aesEncrypt(JSON.toJSONString(map), configInfo.getDataSecret(), configInfo.getDataSecretIv());
resultMap.put("Data", encryptData);
// 生成sig
String resultSign = GBSignUtils.sign(resultMap, configInfo.getSignSecret());
resultMap.put("Sig", resultSign);
return resultMap; return resultMap;
} }
/** /**
* 设备状态变化推送 notification_stationStatus * 推送充电设备接口状态信息
* 推送充电设备接口状态信息 supervise_notification_station_status * supervise_notification_connector_status
*
* @param dto
* @throws UnsupportedOperationException 未实现异常
*/ */
@Override @Override
public String notificationStationStatus(PushRealTimeInfoDTO dto) { public String notificationStationStatus(String stationId, String pileConnectorCode, String status, ThirdPartySecretInfoVO secretInfoVO) {
String status = dto.getStatus(); // 查询充电枪口状态
String pileConnectorCode = dto.getPileConnectorCode(); PileConnectorInfoVO connectorInfo = pileConnectorInfoService.getPileConnectorInfoByConnectorCode(pileConnectorCode);
if (Objects.isNull(connectorInfo)) {
throw new BusinessException(ReturnCodeEnum.CODE_CONNECTOR_INFO_NULL_ERROR);
}
// 查出该桩所属哪个站点 String merchantId = connectorInfo.getMerchantId();
// String pileSn = StringUtils.substring(pileConnectorCode, 0, 14); MerchantInfoVO merchantInfoVO = pileMerchantInfoService.getMerchantInfoVO(merchantId);
String pileSn = YKCUtils.getPileSn(pileConnectorCode); if (Objects.isNull(merchantInfoVO)) {
PileStationVO stationVO = pileStationInfoService.getStationInfoByPileSn(pileSn); throw new BusinessException(ReturnCodeEnum.CODE_CONNECTOR_INFO_NULL_ERROR);
// 通过站点id查询相关配置信息 }
ThirdPartySecretInfoVO thirdPartySecretInfoVO = getGuiZhouPlatformSecretInfo();
String operatorId = thirdPartySecretInfoVO.getOurOperatorId(); SupConnectorStatusInfo info = SupConnectorStatusInfo.builder()
String operatorSecret = thirdPartySecretInfoVO.getTheirOperatorSecret(); .operatorID(Constants.OPERATORID_JIANG_SU)
String signSecret = thirdPartySecretInfoVO.getTheirSigSecret(); .equipmentOwnerID(MerchantUtils.getOperatorID(merchantInfoVO.getOrganizationCode()))
String dataSecret = thirdPartySecretInfoVO.getTheirDataSecret(); .stationID(connectorInfo.getStationId())
String dataSecretIv = thirdPartySecretInfoVO.getTheirDataSecretIv(); .equipmentID(connectorInfo.getPileSn())
String urlAddress = thirdPartySecretInfoVO.getTheirUrlPrefix();
String url = urlAddress + BusinessInformationExchangeEnum.NOTIFICATION_STATION_STATUS.getValue();
ConnectorStatusInfo info = ConnectorStatusInfo.builder()
.connectorID(pileConnectorCode) .connectorID(pileConnectorCode)
.status(Integer.parseInt(status)) .status(Integer.parseInt(status))
.statusDesc(PileConnectorDataBaseStatusEnum.getStatusDescription(status))
.parkStatus(Constants.zero)
.lockStatus(Constants.zero)
.updateTime(DateUtils.getDateTime())
.equipmentClassification(Constants.ONE)
.build(); .build();
// 调用联联平台接口 // 调用联联平台接口
JSONObject json = new JSONObject(); String operatorId = Constants.OPERATORID_JIANG_SU;
json.put("ConnectorStatusInfo", info); String operatorSecret = secretInfoVO.getTheirOperatorSecret();
String jsonString = JSON.toJSONString(json); String signSecret = secretInfoVO.getTheirSigSecret();
String dataSecret = secretInfoVO.getTheirDataSecret();
String dataSecretIv = secretInfoVO.getTheirDataSecretIv();
String urlAddress = secretInfoVO.getTheirUrlPrefix();
String url = urlAddress + "supervise_notification_station_status";
String jsonString = JSON.toJSONString(info);
// 获取令牌 // 获取令牌
String token = getToken(urlAddress, operatorId, operatorSecret, dataSecretIv, signSecret, dataSecret); String token = getToken(urlAddress, operatorId, operatorSecret, dataSecretIv, signSecret, dataSecret);
String result = HttpRequestUtil.sendPost(token, jsonString, url, dataSecret, dataSecretIv, operatorId, signSecret); String result = HttpRequestUtil.sendPost(token, jsonString, url, dataSecret, dataSecretIv, operatorId, signSecret);
@@ -525,11 +515,6 @@ public class GuiZhouPlatformServiceImpl implements ThirdPartyPlatformService {
public String notificationEquipChargeStatus(String orderCode) { public String notificationEquipChargeStatus(String orderCode) {
// 根据订单号查询订单信息 // 根据订单号查询订单信息
OrderBasicInfo orderInfo = orderBasicInfoService.getOrderInfoByOrderCode(orderCode); OrderBasicInfo orderInfo = orderBasicInfoService.getOrderInfoByOrderCode(orderCode);
// 查询枪口状态
PileConnectorInfoVO info = pileConnectorInfoService.getPileConnectorInfoByConnectorCode(orderInfo.getPileConnectorCode());
BigDecimal current = info.getCurrent() == null ? BigDecimal.ZERO : info.getCurrent();
BigDecimal voltage = info.getVoltage() == null ? BigDecimal.ZERO : info.getVoltage();
String soc = info.getSOC() == null ? Constants.ZERO : info.getSOC();
// 查询相关配置信息 // 查询相关配置信息
ThirdPartySecretInfoVO guiZhouPlatformSecretInfo = getGuiZhouPlatformSecretInfo(); ThirdPartySecretInfoVO guiZhouPlatformSecretInfo = getGuiZhouPlatformSecretInfo();
@@ -540,35 +525,69 @@ public class GuiZhouPlatformServiceImpl implements ThirdPartyPlatformService {
String dataSecretIv = guiZhouPlatformSecretInfo.getTheirDataSecretIv(); String dataSecretIv = guiZhouPlatformSecretInfo.getTheirDataSecretIv();
String urlAddress = guiZhouPlatformSecretInfo.getTheirUrlPrefix(); String urlAddress = guiZhouPlatformSecretInfo.getTheirUrlPrefix();
List<RealTimeMonitorData> chargingRealTimeData = orderBasicInfoService.getChargingRealTimeData(orderInfo.getTransactionCode());
RealTimeMonitorData realTimeMonitorData;
if (CollectionUtils.isEmpty(chargingRealTimeData)) {
realTimeMonitorData = RealTimeMonitorData.builder()
.chargingDegree("0")
.build();
chargingRealTimeData.add(realTimeMonitorData);
} else {
realTimeMonitorData = chargingRealTimeData.get(0);
}
// 查询枪口状态
PileConnectorInfoVO info = pileConnectorInfoService.getPileConnectorInfoByConnectorCode(orderInfo.getPileConnectorCode());
if (Objects.isNull(info)) {
throw new BusinessException(ReturnCodeEnum.CODE_CONNECTOR_INFO_NULL_ERROR);
}
String merchantId = info.getMerchantId();
MerchantInfoVO merchantInfoVO = pileMerchantInfoService.getMerchantInfoVO(merchantId);
if (Objects.isNull(merchantInfoVO)) {
throw new BusinessException(ReturnCodeEnum.CODE_CONNECTOR_INFO_NULL_ERROR);
}
String orderStatus = orderInfo.getOrderStatus();
if (StringUtils.equals(OrderStatusEnum.IN_THE_CHARGING.getValue(), orderStatus)) {
// 充电中
orderStatus = "2";
} else if (StringUtils.equals(OrderStatusEnum.ORDER_COMPLETE.getValue(), orderStatus)) {
// 充电完成
orderStatus = "4";
}
BigDecimal current = info.getCurrent() == null ? BigDecimal.ZERO : info.getCurrent();
BigDecimal voltage = info.getVoltage() == null ? BigDecimal.ZERO : info.getVoltage();
String soc = info.getSOC() == null ? Constants.ZERO : info.getSOC();
String dateTime = DateUtils.getDateTime(); String dateTime = DateUtils.getDateTime();
SupEquipChargeStatusInfo supEquipChargeStatusInfo = SupEquipChargeStatusInfo.builder() SupEquipChargeStatusInfo supEquipChargeStatusInfo = SupEquipChargeStatusInfo.builder()
.operatorID(Constants.OPERATORID_JIANG_SU) .operatorID(Constants.OPERATORID_JIANG_SU)
.equipmentOwnerID(Constants.OPERATORID_JIANG_SU) .equipmentOwnerID(Constants.OPERATORID_GUI_ZHOU)
.stationID(orderInfo.getStationId()) .stationID(orderInfo.getStationId())
.equipmentID(orderInfo.getPileSn()) .equipmentID(orderInfo.getPileSn())
.startChargeSeqStat(Integer.parseInt(orderStatus))
.connectorID(orderInfo.getPileConnectorCode()) .connectorID(orderInfo.getPileConnectorCode())
.orderNo(orderInfo.getOrderCode()) .orderNo(orderInfo.getOrderCode())
.orderStatus(2) .orderStatus(2)
.equipmentClassification(1) .equipmentClassification(1)
.pushTimeStamp(dateTime) .pushTimeStamp(dateTime)
.connectorStatus(info.getStatus()) // 3-充电中 .connectorStatus(3) // 3-充电中
.currentA(current.setScale(1, BigDecimal.ROUND_HALF_UP)) .currentA(current.setScale(1, BigDecimal.ROUND_HALF_UP))
.voltageA(voltage.setScale(1, BigDecimal.ROUND_HALF_UP)) .voltageA(voltage.setScale(1, BigDecimal.ROUND_HALF_UP))
.soc(new BigDecimal(soc)) .soc(new BigDecimal(soc))
// .currentA(BigDecimal.ONE)
// .voltageA(BigDecimal.ONE)
// .soc(BigDecimal.ZERO)
.startTime(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, orderInfo.getChargeStartTime())) .startTime(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, orderInfo.getChargeStartTime()))
.endTime(dateTime) .endTime(dateTime)
.totalPower(info.getChargingDegree()) .totalPower(new BigDecimal(realTimeMonitorData.getChargingDegree()))
.eventTime(dateTime) .eventTime(dateTime)
.chargeVoltage(voltage.setScale(1, BigDecimal.ROUND_HALF_UP)) .chargeVoltage(voltage.setScale(1, BigDecimal.ROUND_HALF_UP))
.chargeCurrent(current.setScale(1, BigDecimal.ROUND_HALF_UP)) .chargeCurrent(current.setScale(1, BigDecimal.ROUND_HALF_UP))
.build(); .build();
// 查询运营商信息 supEquipChargeStatusInfo.setEquipmentOwnerID(Constants.OPERATORID_GUI_ZHOU);
PileMerchantInfoVO pileMerchantInfoVO = pileMerchantInfoService.queryMerchantInfoByStationId(orderInfo.getStationId()); if (StringUtils.isNotBlank(info.getSOC())) {
String organizationCode = pileMerchantInfoVO.getOrganizationCode(); supEquipChargeStatusInfo.setSoc(new BigDecimal(info.getSOC()));
if (StringUtils.isNotBlank(organizationCode) && organizationCode.length() == 18) {
String equipmentOwnerId = StringUtils.substring(organizationCode, organizationCode.length() - 10, organizationCode.length() - 1);
supEquipChargeStatusInfo.setEquipmentOwnerID(equipmentOwnerId);
} }
String url = urlAddress + "supervise_notification_equip_charge_status"; String url = urlAddress + "supervise_notification_equip_charge_status";
@@ -612,19 +631,9 @@ public class GuiZhouPlatformServiceImpl implements ThirdPartyPlatformService {
// 拼装成平台所需格式对象 // 拼装成平台所需格式对象
ChargeOrderInfo orderInfo = transformChargeOrderInfo(orderBasicInfo, orderDetail); ChargeOrderInfo orderInfo = transformChargeOrderInfo(orderBasicInfo, orderDetail);
orderInfo.setOperatorID(operatorId); orderInfo.setOperatorID(operatorId);
String equipmentOwnerID; orderInfo.setEquipmentOwnerID(Constants.OPERATORID_GUI_ZHOU);
if (MerchantUtils.isXiXiaoMerchant(orderBasicInfo.getMerchantId())) { orderInfo.setTotalServiceMoney(orderInfo.getTotalSeviceMoney());
equipmentOwnerID = Constants.OPERATORID_XI_XIAO; orderInfo.setTotalElecMoney(orderDetail.getTotalElectricityAmount());
} else {
PileMerchantInfoVO pileMerchantInfoVO = pileMerchantInfoService.queryMerchantInfoByStationId(orderInfo.getStationID());
String organizationCode = pileMerchantInfoVO.getOrganizationCode();
if (StringUtils.isNotBlank(organizationCode) && organizationCode.length() == 18) {
equipmentOwnerID = ThirdPartyPlatformUtils.extractEquipmentOwnerID(pileMerchantInfoVO.getOrganizationCode());
} else {
equipmentOwnerID = Constants.OPERATORID_JIANG_SU;
}
}
orderInfo.setEquipmentOwnerID(equipmentOwnerID);
List<BillingPriceVO> billingList = pileBillingTemplateService.queryBillingPrice(orderBasicInfo.getStationId()); List<BillingPriceVO> billingList = pileBillingTemplateService.queryBillingPrice(orderBasicInfo.getStationId());
// 先将list按照 尖、峰、平、谷 时段排序 // 先将list按照 尖、峰、平、谷 时段排序
@@ -655,27 +664,21 @@ public class GuiZhouPlatformServiceImpl implements ThirdPartyPlatformService {
// 根据订单号查询出信息 // 根据订单号查询出信息
OrderBasicInfo orderBasicInfo = orderBasicInfoService.getOrderInfoByOrderCode(orderCode); OrderBasicInfo orderBasicInfo = orderBasicInfoService.getOrderInfoByOrderCode(orderCode);
ThirdPartySecretInfoVO guiZhouPlatformSecretInfo = getGuiZhouPlatformSecretInfo();
OrderDetail orderDetail = orderBasicInfoService.getOrderDetailByOrderCode(orderCode); OrderDetail orderDetail = orderBasicInfoService.getOrderDetailByOrderCode(orderCode);
String operatorId = guiZhouPlatformSecretInfo.getTheirOperatorId(); String operatorId = Constants.OPERATORID_JIANG_SU;
String operatorSecret = guiZhouPlatformSecretInfo.getTheirOperatorSecret(); String operatorSecret = getGuiZhouPlatformSecretInfo().getTheirOperatorSecret();
String signSecret = guiZhouPlatformSecretInfo.getTheirSigSecret(); String signSecret = getGuiZhouPlatformSecretInfo().getTheirSigSecret();
String dataSecret = guiZhouPlatformSecretInfo.getTheirDataSecret(); String dataSecret = getGuiZhouPlatformSecretInfo().getTheirDataSecret();
String dataSecretIv = guiZhouPlatformSecretInfo.getTheirDataSecretIv(); String dataSecretIv = getGuiZhouPlatformSecretInfo().getTheirDataSecretIv();
String urlAddress = guiZhouPlatformSecretInfo.getTheirUrlPrefix(); String urlAddress = getGuiZhouPlatformSecretInfo().getTheirUrlPrefix();
String url = urlAddress + "supervise_notification_charge_order_info_history"; String url = urlAddress + "supervise_notification_charge_order_info_history";
ChargeOrderInfo orderInfo = transformChargeOrderInfo(orderBasicInfo, orderDetail); ChargeOrderInfo orderInfo = transformChargeOrderInfo(orderBasicInfo, orderDetail);
orderInfo.setOperatorID(operatorId); orderInfo.setOperatorID(operatorId);
String equipmentOwnerID; orderInfo.setEquipmentOwnerID(Constants.OPERATORID_GUI_ZHOU);
if (MerchantUtils.isXiXiaoMerchant(orderBasicInfo.getMerchantId())) {
equipmentOwnerID = Constants.OPERATORID_XI_XIAO;
} else {
equipmentOwnerID = Constants.OPERATORID_LIANLIAN;
}
orderInfo.setEquipmentOwnerID(equipmentOwnerID);
List<BillingPriceVO> billingList = pileBillingTemplateService.queryBillingPrice(orderBasicInfo.getStationId()); List<BillingPriceVO> billingList = pileBillingTemplateService.queryBillingPrice(orderBasicInfo.getStationId());
// 先将list按照 尖、峰、平、谷 时段排序 // 先将list按照 尖、峰、平、谷 时段排序
@@ -690,9 +693,7 @@ public class GuiZhouPlatformServiceImpl implements ThirdPartyPlatformService {
return null; return null;
} }
// 调用联联平台接口 // 调用联联平台接口
JSONObject json = new JSONObject(); String jsonString = JSON.toJSONString(orderInfo);
json.put("ChargeOrderInfo", orderInfo);
String jsonString = JSON.toJSONString(json);
String result = HttpRequestUtil.sendPost(token, jsonString, url, dataSecret, dataSecretIv, operatorId, signSecret); String result = HttpRequestUtil.sendPost(token, jsonString, url, dataSecret, dataSecretIv, operatorId, signSecret);
return result; return result;
} }
@@ -705,17 +706,11 @@ public class GuiZhouPlatformServiceImpl implements ThirdPartyPlatformService {
*/ */
@Override @Override
public String notificationOperationStatsInfo(String stationId) { public String notificationOperationStatsInfo(String stationId) {
SupStationStatsInfo. SupStationStatsInfo.EquipmentStatsInfo equipmentStatsInfo = new SupStationStatsInfo.EquipmentStatsInfo();
EquipmentStatsInfo equipmentStatsInfo = new SupStationStatsInfo.EquipmentStatsInfo(); List<SupStationStatsInfo.EquipmentStatsInfo> equipmentStatsInfoList = new ArrayList<>();
List<SupStationStatsInfo.
EquipmentStatsInfo> equipmentStatsInfoList = new ArrayList<>();
SupStationStatsInfo. SupStationStatsInfo.EquipmentStatsInfo.ConnectorStatsInfo connectorStatsInfo = null;
EquipmentStatsInfo. List<SupStationStatsInfo.EquipmentStatsInfo.ConnectorStatsInfo> connectorStatsInfoList = new ArrayList<>();
ConnectorStatsInfo connectorStatsInfo = null;
List<SupStationStatsInfo.
EquipmentStatsInfo.
ConnectorStatsInfo> connectorStatsInfoList = new ArrayList<>();
// 根据站点id查询订单记录 (新建Service方法) // 根据站点id查询订单记录 (新建Service方法)
List<SupStationStatsVO> orderVOS = orderBasicInfoService.queryOrderListByStationId(stationId); List<SupStationStatsVO> orderVOS = orderBasicInfoService.queryOrderListByStationId(stationId);
@@ -724,13 +719,12 @@ public class GuiZhouPlatformServiceImpl implements ThirdPartyPlatformService {
int stationChargeTime = Constants.zero; // 充电站累计充电次数 int stationChargeTime = Constants.zero; // 充电站累计充电次数
for (SupStationStatsVO orderVO : orderVOS) { for (SupStationStatsVO orderVO : orderVOS) {
// 充电站累计用电量 // 充电站累计用电量
BigDecimal totalPower = orderVO.getTotalPower(); BigDecimal totalPower = (orderVO.getTotalPower() != null) ? orderVO.getTotalPower() : BigDecimal.ZERO;
if (totalPower == null || orderVO.getChargingTime() == null) { Integer chargingTime = (orderVO.getChargingTime() != null) ? orderVO.getChargingTime() : Constants.zero;
continue;
}
stationTotalElectricity = stationTotalElectricity.add(totalPower); stationTotalElectricity = stationTotalElectricity.add(totalPower);
// 充电站累计充电时长(分钟) // 充电站累计充电时长(分钟)
stationChargeTime += orderVO.getChargingTime(); stationChargeTime += chargingTime;
} }
// 根据枪口排序,分组,将充电时长和充电量累加 // 根据枪口排序,分组,将充电时长和充电量累加
@@ -752,7 +746,6 @@ public class GuiZhouPlatformServiceImpl implements ThirdPartyPlatformService {
// key : pileConnectorCode // key : pileConnectorCode
// value: SupStationStatsVO // value: SupStationStatsVO
for (Map.Entry<String, SupStationStatsVO> entry : sortedMap.entrySet()) { for (Map.Entry<String, SupStationStatsVO> entry : sortedMap.entrySet()) {
String pileConnectorCode = entry.getKey(); String pileConnectorCode = entry.getKey();
SupStationStatsVO vo = entry.getValue(); SupStationStatsVO vo = entry.getValue();
@@ -762,9 +755,9 @@ public class GuiZhouPlatformServiceImpl implements ThirdPartyPlatformService {
connectorStatsInfo.setConnectorId(pileConnectorCode); connectorStatsInfo.setConnectorId(pileConnectorCode);
connectorStatsInfo.setEquipmentClassification(1); connectorStatsInfo.setEquipmentClassification(1);
connectorStatsInfo.setConnectorElectricity(vo.getTotalPower()); connectorStatsInfo.setConnectorElectricity((vo.getTotalPower() != null) ? vo.getTotalPower() : BigDecimal.ZERO);
connectorStatsInfo.setConnectorTotalChargeTime(vo.getChargingTime()); connectorStatsInfo.setConnectorTotalChargeTime((vo.getChargingTime() != null) ? vo.getChargingTime() : Constants.zero);
// TODO connectorStatsInfo.setConnectorTotalChargeNum(); connectorStatsInfo.setConnectorTotalChargeNum(orderVOS.size());
connectorStatsInfo.setConnectorTotalWarningNum(0); connectorStatsInfo.setConnectorTotalWarningNum(0);
// 对比这次循环到的桩编号和上次的桩编号如果是同一台桩将数据进行汇总如果不是新建桩数据并将之前的累计数据清0 // 对比这次循环到的桩编号和上次的桩编号如果是同一台桩将数据进行汇总如果不是新建桩数据并将之前的累计数据清0
@@ -779,21 +772,21 @@ public class GuiZhouPlatformServiceImpl implements ThirdPartyPlatformService {
equipmentStatsInfo.setEquipmentId(pileSn); equipmentStatsInfo.setEquipmentId(pileSn);
equipmentStatsInfo.setEquipmentClassification(1); equipmentStatsInfo.setEquipmentClassification(1);
equipmentStatsInfo.setEquipmentElectricity(vo.getTotalPower()); equipmentStatsInfo.setEquipmentElectricity((vo.getTotalPower() != null) ? vo.getTotalPower() : BigDecimal.ZERO);
equipmentStatsInfo.setEquipmentTotalChargeTime(vo.getChargingTime()); equipmentStatsInfo.setEquipmentTotalChargeTime((vo.getChargingTime() != null) ? vo.getChargingTime() : Constants.zero);
// TODO equipmentStatsInfo.setEquipmentTotalChargeNum(); equipmentStatsInfo.setEquipmentTotalChargeNum(orderVOS.size());
equipmentStatsInfo.setEquipmentTotalWarningNum(0);
pileTotalPower = pileTotalPower.add(vo.getTotalPower()); pileTotalPower = pileTotalPower.add((vo.getTotalPower() != null) ? vo.getTotalPower() : BigDecimal.ZERO);
pileChargeTime += vo.getChargingTime(); pileChargeTime += (vo.getChargingTime() != null) ? vo.getChargingTime() : Constants.zero;
connectorStatsInfoList.add(connectorStatsInfo); connectorStatsInfoList.add(connectorStatsInfo);
equipmentStatsInfo.setConnectorStatsInfos(connectorStatsInfoList); equipmentStatsInfo.setConnectorStatsInfos(connectorStatsInfoList);
equipmentStatsInfoList.add(equipmentStatsInfo); equipmentStatsInfoList.add(equipmentStatsInfo);
} else { } else {
// 同一台桩,枪口号不同,累加桩数据,将枪口数据新建 // 同一台桩,枪口号不同,累加桩数据,将枪口数据新建
pileTotalPower = pileTotalPower.add((vo.getTotalPower() != null) ? vo.getTotalPower() : BigDecimal.ZERO);
pileTotalPower = pileTotalPower.add(vo.getTotalPower()); pileChargeTime += (vo.getChargingTime() != null) ? vo.getChargingTime() : Constants.zero;
pileChargeTime += vo.getChargingTime();
equipmentStatsInfo.setEquipmentElectricity(pileTotalPower); // 第一次判断时一定不会进入到这里,所以不用判断 equipmentStatsInfo 是否为 null equipmentStatsInfo.setEquipmentElectricity(pileTotalPower); // 第一次判断时一定不会进入到这里,所以不用判断 equipmentStatsInfo 是否为 null
equipmentStatsInfo.setEquipmentTotalChargeTime(pileChargeTime); equipmentStatsInfo.setEquipmentTotalChargeTime(pileChargeTime);
@@ -802,7 +795,6 @@ public class GuiZhouPlatformServiceImpl implements ThirdPartyPlatformService {
equipmentStatsInfo.setConnectorStatsInfos(connectorStatsInfoList); equipmentStatsInfo.setConnectorStatsInfos(connectorStatsInfoList);
equipmentStatsInfoList.add(equipmentStatsInfo); equipmentStatsInfoList.add(equipmentStatsInfo);
} }
} }
// 创建对象 // 创建对象
@@ -821,7 +813,7 @@ public class GuiZhouPlatformServiceImpl implements ThirdPartyPlatformService {
.stationTotalChargeTime(stationChargeTime) .stationTotalChargeTime(stationChargeTime)
.stationTotalWarningNum(0) .stationTotalWarningNum(0)
.equipmentStatsInfos(equipmentStatsInfoList) .equipmentStatsInfos(equipmentStatsInfoList)
.equipmentOwnerId(Constants.OPERATORID_GUI_ZHOU)
.build(); .build();
JSONObject json = new JSONObject(); JSONObject json = new JSONObject();
json.put("StationStatsInfos", supStationStatsInfo); json.put("StationStatsInfos", supStationStatsInfo);
@@ -846,37 +838,31 @@ public class GuiZhouPlatformServiceImpl implements ThirdPartyPlatformService {
return result; return result;
} }
/** /**
* 推送充换电站实时功率 supervise_notification_realtime_power_info * 推送充换电站实时功率 supervise_notification_realtime_power_info
* *
* @return * @return
*/ */
public String notificationPowerInfo(List<String> stationIds) { public String notificationPowerInfo(List<String> stationIds) {
com.jsowell.thirdparty.platform.common.SupStationPowerInfo supStationPowerInfo = null;
List<com.jsowell.thirdparty.platform.common.SupStationPowerInfo> list = new ArrayList<>(); List<com.jsowell.thirdparty.platform.common.SupStationPowerInfo> list = new ArrayList<>();
String dateTimeNow = DateUtils.dateTimeNow(DateUtils.YYYY_MM_DD_HH_MM_SS); String dateTimeNow = DateUtils.dateTimeNow(DateUtils.YYYY_MM_DD_HH_MM_SS);
List<com.jsowell.thirdparty.platform.common.SupStationPowerInfo.EquipmentPowerInfo> supPileInfoList = null;
com.jsowell.thirdparty.platform.common.SupStationPowerInfo.EquipmentPowerInfo supPileInfo = null;
List<com.jsowell.thirdparty.platform.common.SupStationPowerInfo.EquipmentPowerInfo.ConnectorPowerInfo> connectorPowerInfoList;
com.jsowell.thirdparty.platform.common.SupStationPowerInfo.EquipmentPowerInfo.ConnectorPowerInfo connectorPowerInfo;
for (String stationId : stationIds) { for (String stationId : stationIds) {
BigDecimal stationPower = BigDecimal.ZERO; BigDecimal stationPower = BigDecimal.ZERO;
supStationPowerInfo = new com.jsowell.thirdparty.platform.common.SupStationPowerInfo(); com.jsowell.thirdparty.platform.common.SupStationPowerInfo supStationPowerInfo = new com.jsowell.thirdparty.platform.common.SupStationPowerInfo();
supStationPowerInfo.setOperatorID(Constants.OPERATORID_JIANG_SU); supStationPowerInfo.setOperatorID(Constants.OPERATORID_JIANG_SU);
supStationPowerInfo.setStationId(stationId); supStationPowerInfo.setStationId(stationId);
supStationPowerInfo.setDataTime(dateTimeNow); supStationPowerInfo.setDataTime(dateTimeNow);
supStationPowerInfo.setStationClassification(Constants.one); supStationPowerInfo.setStationClassification(Constants.one);
supStationPowerInfo.setStationRealTimePower(stationPower);
// 查询运营商基本信息 // 查询运营商基本信息
PileMerchantInfoVO pileMerchantInfoVO = pileMerchantInfoService.queryMerchantInfoByStationId(stationId); PileMerchantInfoVO pileMerchantInfoVO = pileMerchantInfoService.queryMerchantInfoByStationId(stationId);
String organizationCode = pileMerchantInfoVO.getOrganizationCode(); String organizationCode = pileMerchantInfoVO.getOrganizationCode();
if (StringUtils.isNotBlank(organizationCode) && organizationCode.length() == 18) { if (StringUtils.isNotBlank(organizationCode) && organizationCode.length() == 18) {
String equipmentOwnerId = StringUtils.substring(organizationCode, organizationCode.length() - 10, organizationCode.length() - 1); supStationPowerInfo.setEquipmentOwnerID(Constants.OPERATORID_GUI_ZHOU);
supStationPowerInfo.setEquipmentOwnerID(equipmentOwnerId);
} else {
supStationPowerInfo.setEquipmentOwnerID(Constants.OPERATORID_JIANG_SU);
} }
// 根据站点id查询桩信息 // 根据站点id查询桩信息
@@ -885,6 +871,7 @@ public class GuiZhouPlatformServiceImpl implements ThirdPartyPlatformService {
logger.error("推送充换电站实时功率 error, 查询桩列表信息为空"); logger.error("推送充换电站实时功率 error, 查询桩列表信息为空");
throw new BusinessException(ReturnCodeEnum.CODE_SELECT_INFO_IS_NULL); throw new BusinessException(ReturnCodeEnum.CODE_SELECT_INFO_IS_NULL);
} }
// 将桩id筛选出来用于批量查询枪口数据 // 将桩id筛选出来用于批量查询枪口数据
List<Long> pileIds = pileList.stream() List<Long> pileIds = pileList.stream()
.map(PileBasicInfo::getId) .map(PileBasicInfo::getId)
@@ -896,20 +883,22 @@ public class GuiZhouPlatformServiceImpl implements ThirdPartyPlatformService {
logger.error("推送充换电站实时功率 error, 查询枪口列表信息为空"); logger.error("推送充换电站实时功率 error, 查询枪口列表信息为空");
throw new BusinessException(ReturnCodeEnum.CODE_SELECT_INFO_IS_NULL); throw new BusinessException(ReturnCodeEnum.CODE_SELECT_INFO_IS_NULL);
} }
supPileInfoList = new ArrayList<>();
List<com.jsowell.thirdparty.platform.common.SupStationPowerInfo.EquipmentPowerInfo> supPileInfoList = new ArrayList<>();
for (PileBasicInfo pileBasicInfo : pileList) { for (PileBasicInfo pileBasicInfo : pileList) {
supPileInfo = new com.jsowell.thirdparty.platform.common.SupStationPowerInfo.EquipmentPowerInfo(); com.jsowell.thirdparty.platform.common.SupStationPowerInfo.EquipmentPowerInfo supPileInfo = new com.jsowell.thirdparty.platform.common.SupStationPowerInfo.EquipmentPowerInfo();
supPileInfo.setEquipmentID(pileBasicInfo.getSn()); supPileInfo.setEquipmentID(pileBasicInfo.getSn());
supPileInfo.setEquipmentClassification(Constants.one); supPileInfo.setEquipmentClassification(Constants.one);
supPileInfo.setDataTime(dateTimeNow); supPileInfo.setDataTime(dateTimeNow);
supPileInfo.setEquipRealTimePower(BigDecimal.ZERO);
BigDecimal pileInstantPower = BigDecimal.ZERO; BigDecimal pileInstantPower = BigDecimal.ZERO;
connectorPowerInfoList = new ArrayList<>(); List<com.jsowell.thirdparty.platform.common.SupStationPowerInfo.EquipmentPowerInfo.ConnectorPowerInfo> connectorPowerInfoList = new ArrayList<>();
for (PileConnectorInfoVO pileConnectorInfoVO : connectorList) { for (PileConnectorInfoVO pileConnectorInfoVO : connectorList) {
if (!StringUtils.equals(pileBasicInfo.getSn(), pileConnectorInfoVO.getPileSn())) { if (!StringUtils.equals(pileBasicInfo.getSn(), pileConnectorInfoVO.getPileSn())) {
continue; continue;
} }
BigDecimal instantPower = pileConnectorInfoVO.getInstantPower() == null ? BigDecimal.ZERO : pileConnectorInfoVO.getInstantPower(); BigDecimal instantPower = pileConnectorInfoVO.getInstantPower() == null ? BigDecimal.ZERO : pileConnectorInfoVO.getInstantPower();
connectorPowerInfo = new com.jsowell.thirdparty.platform.common.SupStationPowerInfo.EquipmentPowerInfo.ConnectorPowerInfo(); com.jsowell.thirdparty.platform.common.SupStationPowerInfo.EquipmentPowerInfo.ConnectorPowerInfo connectorPowerInfo = new com.jsowell.thirdparty.platform.common.SupStationPowerInfo.EquipmentPowerInfo.ConnectorPowerInfo();
connectorPowerInfo.setConnectorID(pileConnectorInfoVO.getPileConnectorCode()); connectorPowerInfo.setConnectorID(pileConnectorInfoVO.getPileConnectorCode());
connectorPowerInfo.setEquipmentClassification(Constants.one); connectorPowerInfo.setEquipmentClassification(Constants.one);
connectorPowerInfo.setDataTime(dateTimeNow); connectorPowerInfo.setDataTime(dateTimeNow);
@@ -924,16 +913,17 @@ public class GuiZhouPlatformServiceImpl implements ThirdPartyPlatformService {
// 桩实时功率 // 桩实时功率
supPileInfo.setEquipRealTimePower(pileInstantPower); supPileInfo.setEquipRealTimePower(pileInstantPower);
stationPower = stationPower.add(pileInstantPower); stationPower = stationPower.add(pileInstantPower);
supPileInfoList.add(supPileInfo); supPileInfoList.add(supPileInfo);
} }
supStationPowerInfo.setEquipmentPowerInfos(supPileInfoList); supStationPowerInfo.setEquipmentPowerInfos(supPileInfoList);
supStationPowerInfo.setStationRealTimePower(stationPower); supStationPowerInfo.setStationRealTimePower(stationPower);
}
list.add(supStationPowerInfo); list.add(supStationPowerInfo);
}
// 获取推送配置密钥信息
ThirdPartySecretInfoVO guiZhouPlatformSecretInfo = getGuiZhouPlatformSecretInfo(); ThirdPartySecretInfoVO guiZhouPlatformSecretInfo = getGuiZhouPlatformSecretInfo();
String operatorId = guiZhouPlatformSecretInfo.getTheirOperatorId(); String operatorId = guiZhouPlatformSecretInfo.getOurOperatorId();
String operatorSecret = guiZhouPlatformSecretInfo.getTheirOperatorSecret(); String operatorSecret = guiZhouPlatformSecretInfo.getTheirOperatorSecret();
String signSecret = guiZhouPlatformSecretInfo.getTheirSigSecret(); String signSecret = guiZhouPlatformSecretInfo.getTheirSigSecret();
String dataSecret = guiZhouPlatformSecretInfo.getTheirDataSecret(); String dataSecret = guiZhouPlatformSecretInfo.getTheirDataSecret();
@@ -978,18 +968,24 @@ public class GuiZhouPlatformServiceImpl implements ThirdPartyPlatformService {
* @return * @return
*/ */
private ChargeOrderInfo transformChargeOrderInfo(OrderBasicInfo orderBasicInfo, OrderDetail orderDetail) { private ChargeOrderInfo transformChargeOrderInfo(OrderBasicInfo orderBasicInfo, OrderDetail orderDetail) {
DecimalFormat df2 = new DecimalFormat("#.######");
BigDecimal totalPower = new BigDecimal(df2.format(orderDetail.getTotalUsedElectricity()));
totalPower = totalPower.setScale(4, RoundingMode.HALF_UP);
ChargeOrderInfo chargeOrderInfo = ChargeOrderInfo.builder() ChargeOrderInfo chargeOrderInfo = ChargeOrderInfo.builder()
.operatorID(Constants.OPERATORID_JIANG_SU)
.stationID(orderBasicInfo.getStationId()) .stationID(orderBasicInfo.getStationId())
.equipmentID(orderBasicInfo.getPileSn()) .equipmentID(orderBasicInfo.getPileSn())
.orderNo(orderBasicInfo.getOrderCode()) .orderNo(orderBasicInfo.getOrderCode())
.connectorID(orderBasicInfo.getPileConnectorCode()) .connectorID(orderBasicInfo.getPileConnectorCode())
.equipmentClassification(1)
.licensePlate(orderBasicInfo.getPlateNumber()) .licensePlate(orderBasicInfo.getPlateNumber())
.vin(orderBasicInfo.getVinCode()) .vin(orderBasicInfo.getVinCode())
.startSOC(orderBasicInfo.getStartSoc()) .startSOC(orderBasicInfo.getStartSoc())
.endSOC(orderBasicInfo.getEndSoc()) .endSOC(orderBasicInfo.getEndSoc())
.startTime(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, orderBasicInfo.getChargeStartTime())) .startTime(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, orderBasicInfo.getChargeStartTime()))
.endTime(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, orderBasicInfo.getChargeEndTime())) .endTime(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, orderBasicInfo.getChargeEndTime()))
.totalPower(orderDetail.getTotalUsedElectricity()) .totalPower(totalPower)
.cuspElect(orderDetail.getSharpUsedElectricity()) .cuspElect(orderDetail.getSharpUsedElectricity())
.peakElect(orderDetail.getSharpUsedElectricity()) .peakElect(orderDetail.getSharpUsedElectricity())
.flatElect(orderDetail.getFlatUsedElectricity()) .flatElect(orderDetail.getFlatUsedElectricity())
@@ -997,8 +993,9 @@ public class GuiZhouPlatformServiceImpl implements ThirdPartyPlatformService {
.pushTimeStamp(DateUtils.getDateTime()) .pushTimeStamp(DateUtils.getDateTime())
.totalElecMoney(orderDetail.getTotalElectricityAmount()) .totalElecMoney(orderDetail.getTotalElectricityAmount())
.totalSeviceMoney(orderDetail.getTotalServiceAmount()) .totalSeviceMoney(orderDetail.getTotalServiceAmount())
.totalServiceMoney(orderDetail.getTotalServiceAmount())
.totalMoney(orderDetail.getTotalOrderAmount()) .totalMoney(orderDetail.getTotalOrderAmount())
.stopReason(0) .stopReason(2)
.stopDesc(orderBasicInfo.getReason()) // TODO 停止原因 .stopDesc(orderBasicInfo.getReason()) // TODO 停止原因
.sumPeriod(0) .sumPeriod(0)
.build(); .build();
@@ -1019,8 +1016,8 @@ public class GuiZhouPlatformServiceImpl implements ThirdPartyPlatformService {
detail = new SupChargeDetails(); detail = new SupChargeDetails();
if (StringUtils.equals(billingPriceVO.getTimeType(), BillingTimeTypeEnum.SHARP.getValue())) { if (StringUtils.equals(billingPriceVO.getTimeType(), BillingTimeTypeEnum.SHARP.getValue())) {
// 尖时段 // 尖时段
detail.setDetailStartTime(billingPriceVO.getStartTime()); detail.setDetailStartTime(DateUtils.getDateTime());
detail.setDetailEndTime(billingPriceVO.getEndTime()); detail.setDetailEndTime(DateUtils.getDateTime());
detail.setElecPrice(new BigDecimal(billingPriceVO.getElectricityPrice()).setScale(4, BigDecimal.ROUND_HALF_UP)); detail.setElecPrice(new BigDecimal(billingPriceVO.getElectricityPrice()).setScale(4, BigDecimal.ROUND_HALF_UP));
detail.setSevicePrice(new BigDecimal(billingPriceVO.getServicePrice()).setScale(4, BigDecimal.ROUND_HALF_UP)); detail.setSevicePrice(new BigDecimal(billingPriceVO.getServicePrice()).setScale(4, BigDecimal.ROUND_HALF_UP));
detail.setDetailPower(orderDetail.getSharpUsedElectricity()); detail.setDetailPower(orderDetail.getSharpUsedElectricity());
@@ -1028,8 +1025,8 @@ public class GuiZhouPlatformServiceImpl implements ThirdPartyPlatformService {
detail.setDetailSeviceMoney(orderDetail.getSharpServicePrice()); detail.setDetailSeviceMoney(orderDetail.getSharpServicePrice());
} else if (StringUtils.equals(billingPriceVO.getTimeType(), BillingTimeTypeEnum.PEAK.getValue())) { } else if (StringUtils.equals(billingPriceVO.getTimeType(), BillingTimeTypeEnum.PEAK.getValue())) {
// 峰时段 // 峰时段
detail.setDetailStartTime(billingPriceVO.getStartTime()); detail.setDetailStartTime(DateUtils.getDateTime());
detail.setDetailEndTime(billingPriceVO.getEndTime()); detail.setDetailEndTime(DateUtils.getDateTime());
detail.setElecPrice(new BigDecimal(billingPriceVO.getElectricityPrice()).setScale(4, BigDecimal.ROUND_HALF_UP)); detail.setElecPrice(new BigDecimal(billingPriceVO.getElectricityPrice()).setScale(4, BigDecimal.ROUND_HALF_UP));
detail.setSevicePrice(new BigDecimal(billingPriceVO.getServicePrice()).setScale(4, BigDecimal.ROUND_HALF_UP)); detail.setSevicePrice(new BigDecimal(billingPriceVO.getServicePrice()).setScale(4, BigDecimal.ROUND_HALF_UP));
detail.setDetailPower(orderDetail.getPeakUsedElectricity()); detail.setDetailPower(orderDetail.getPeakUsedElectricity());
@@ -1037,8 +1034,8 @@ public class GuiZhouPlatformServiceImpl implements ThirdPartyPlatformService {
detail.setDetailSeviceMoney(orderDetail.getPeakServicePrice()); detail.setDetailSeviceMoney(orderDetail.getPeakServicePrice());
} else if (StringUtils.equals(billingPriceVO.getTimeType(), BillingTimeTypeEnum.FLAT.getValue())) { } else if (StringUtils.equals(billingPriceVO.getTimeType(), BillingTimeTypeEnum.FLAT.getValue())) {
// 平时段 // 平时段
detail.setDetailStartTime(billingPriceVO.getStartTime()); detail.setDetailStartTime(DateUtils.getDateTime());
detail.setDetailEndTime(billingPriceVO.getEndTime()); detail.setDetailEndTime(DateUtils.getDateTime());
detail.setElecPrice(new BigDecimal(billingPriceVO.getElectricityPrice()).setScale(4, BigDecimal.ROUND_HALF_UP)); detail.setElecPrice(new BigDecimal(billingPriceVO.getElectricityPrice()).setScale(4, BigDecimal.ROUND_HALF_UP));
detail.setSevicePrice(new BigDecimal(billingPriceVO.getServicePrice()).setScale(4, BigDecimal.ROUND_HALF_UP)); detail.setSevicePrice(new BigDecimal(billingPriceVO.getServicePrice()).setScale(4, BigDecimal.ROUND_HALF_UP));
detail.setDetailPower(orderDetail.getFlatUsedElectricity()); detail.setDetailPower(orderDetail.getFlatUsedElectricity());
@@ -1046,8 +1043,8 @@ public class GuiZhouPlatformServiceImpl implements ThirdPartyPlatformService {
detail.setDetailSeviceMoney(orderDetail.getFlatServicePrice()); detail.setDetailSeviceMoney(orderDetail.getFlatServicePrice());
} else if (StringUtils.equals(billingPriceVO.getTimeType(), BillingTimeTypeEnum.VALLEY.getValue())) { } else if (StringUtils.equals(billingPriceVO.getTimeType(), BillingTimeTypeEnum.VALLEY.getValue())) {
// 谷时段 // 谷时段
detail.setDetailStartTime(billingPriceVO.getStartTime()); detail.setDetailStartTime(DateUtils.getDateTime());
detail.setDetailEndTime(billingPriceVO.getEndTime()); detail.setDetailEndTime(DateUtils.getDateTime());
detail.setElecPrice(new BigDecimal(billingPriceVO.getElectricityPrice()).setScale(4, BigDecimal.ROUND_HALF_UP)); detail.setElecPrice(new BigDecimal(billingPriceVO.getElectricityPrice()).setScale(4, BigDecimal.ROUND_HALF_UP));
detail.setSevicePrice(new BigDecimal(billingPriceVO.getServicePrice()).setScale(4, BigDecimal.ROUND_HALF_UP)); detail.setSevicePrice(new BigDecimal(billingPriceVO.getServicePrice()).setScale(4, BigDecimal.ROUND_HALF_UP));
detail.setDetailPower(orderDetail.getValleyUsedElectricity()); detail.setDetailPower(orderDetail.getValleyUsedElectricity());