mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-20 19:15:35 +08:00
add 新增联联平台接口 获取充电桩状态信息
This commit is contained in:
@@ -19,13 +19,13 @@ public class ConnectorChargeStatusInfo {
|
||||
* 充电订单号 Y
|
||||
* 对接平台系统订单编号
|
||||
*/
|
||||
private String orderCode;
|
||||
private String StartChargeSeq;
|
||||
|
||||
/**
|
||||
* 充电设备接口编码 Y
|
||||
* 平台下唯一枪口号
|
||||
*/
|
||||
private String pileConnectorCode;
|
||||
private String ConnectorID;
|
||||
|
||||
/**
|
||||
* 充电设备接口状态 Y
|
||||
@@ -35,88 +35,88 @@ public class ConnectorChargeStatusInfo {
|
||||
* 4:占用(预约锁定)
|
||||
* 255:故障
|
||||
*/
|
||||
private Integer connectorStatus;
|
||||
private Integer ConnectorStatus;
|
||||
|
||||
/**
|
||||
* 车辆识别码 N
|
||||
* 车辆识别号码或车架号码,由17位英数组成
|
||||
*/
|
||||
private String vinCode;
|
||||
private String Vin;
|
||||
|
||||
/**
|
||||
* A相电流 Y
|
||||
* 单位:A,默认:0 含直流(输出)
|
||||
*/
|
||||
private BigDecimal currentA;
|
||||
private BigDecimal CurrentA;
|
||||
|
||||
/**
|
||||
* B相电流 N
|
||||
* 单位:A,默认:0
|
||||
*/
|
||||
private BigDecimal currentB;
|
||||
private BigDecimal CurrentB;
|
||||
|
||||
/**
|
||||
* C相电流 N
|
||||
* 单位:A,默认:0
|
||||
*/
|
||||
private BigDecimal currentC;
|
||||
private BigDecimal CurrentC;
|
||||
|
||||
/**
|
||||
* A相电压 Y
|
||||
* 单位:V,默认:0含直流(输出)
|
||||
*/
|
||||
private BigDecimal voltageA;
|
||||
private BigDecimal VoltageA;
|
||||
|
||||
/**
|
||||
* B相电压 N
|
||||
* 单位:V,默认:0
|
||||
*/
|
||||
private BigDecimal voltageB;
|
||||
private BigDecimal VoltageB;
|
||||
|
||||
/**
|
||||
* C相电压 N
|
||||
* 单位:V,默认:0
|
||||
*/
|
||||
private BigDecimal voltageC;
|
||||
private BigDecimal VoltageC;
|
||||
|
||||
/**
|
||||
* 电池剩余电量(默认:0) Y
|
||||
*/
|
||||
private BigDecimal soc;
|
||||
private BigDecimal Soc;
|
||||
|
||||
/**
|
||||
* 开始充电时间 Y
|
||||
* 格式“yyyy-MM-dd HH:mm:ss”
|
||||
*/
|
||||
private String chargingStartTime;
|
||||
private String StartTime;
|
||||
|
||||
/**
|
||||
* 本次采样时间 Y
|
||||
* 格式“yyyy-MM-dd HH:mm:ss”
|
||||
*/
|
||||
private String chargingEndTime;
|
||||
private String EndTime;
|
||||
|
||||
/**
|
||||
* 累计充电量 Y
|
||||
* 单位:度,小数点后2位
|
||||
*/
|
||||
private BigDecimal totalUseElectricity;
|
||||
private BigDecimal TotalPower;
|
||||
|
||||
/**
|
||||
* 累计电费 Y
|
||||
* 单位:元,小数点后2位
|
||||
*/
|
||||
private BigDecimal totalElectricityAmount;
|
||||
private BigDecimal ElecMoney;
|
||||
|
||||
/**
|
||||
* 累计服务费 Y
|
||||
* 单位:元,小数点后2位
|
||||
*/
|
||||
private BigDecimal totalServiceAmount;
|
||||
private BigDecimal SeviceMoney;
|
||||
|
||||
/**
|
||||
* 累计总金额 Y
|
||||
* 单位:元,小数点后2位
|
||||
*/
|
||||
private BigDecimal totalAmount;
|
||||
private BigDecimal TotalMoney;
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ public class ConnectorStatusInfo {
|
||||
* 充电设备接口编码 Y
|
||||
* 充电设备接口编码,同一对接平台内唯一
|
||||
*/
|
||||
private String pileConnectorCode;
|
||||
private String ConnectorID;
|
||||
|
||||
/**
|
||||
* 充电设备接口状态 Y
|
||||
@@ -28,15 +28,15 @@ public class ConnectorStatusInfo {
|
||||
* 4:占用(预约锁定)
|
||||
* 255:故障
|
||||
*/
|
||||
private String connectorStatus;
|
||||
private String Status;
|
||||
|
||||
/**
|
||||
* 车位状态(0-未知;10-空闲;50-占用) N
|
||||
*/
|
||||
private String parkingStatus;
|
||||
private String ParkStatus;
|
||||
|
||||
/**
|
||||
* 地锁状态(0-未知;10-已解锁;50-占用) N
|
||||
*/
|
||||
private String groundLockStatus;
|
||||
private String LockStatus;
|
||||
}
|
||||
|
||||
@@ -19,11 +19,11 @@ public class StationStatusInfo {
|
||||
* 充电站ID Y
|
||||
* 对接平台自定义的唯一编码,不足长度在前方补0
|
||||
*/
|
||||
private String stationId;
|
||||
private String StationID;
|
||||
|
||||
/**
|
||||
* 充电设备接口状态列表 Y
|
||||
* 所有充电设备接口的状态
|
||||
*/
|
||||
private List<ConnectorStatusInfo> connectorStatusInfos;
|
||||
private List<?> ConnectorStatusInfos;
|
||||
}
|
||||
|
||||
@@ -14,5 +14,19 @@ public interface LianLianService {
|
||||
*/
|
||||
void pushMerchantInfo(Long merchantId);
|
||||
|
||||
/**
|
||||
* 联联平台获取充电站信息
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
LianLianPageResponse query_stations_info(QueryStationInfoDTO dto);
|
||||
|
||||
/**
|
||||
* 设备接口状态查询
|
||||
* 此接口用于批量查询设备实时状态
|
||||
*
|
||||
* @param StationIDs
|
||||
* @return
|
||||
*/
|
||||
LianLianPageResponse query_station_status(List<String> StationIDs);
|
||||
}
|
||||
|
||||
@@ -1,19 +1,20 @@
|
||||
package com.jsowell.thirdparty.service.impl;
|
||||
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.jsowell.common.core.domain.ykc.RealTimeMonitorData;
|
||||
import com.jsowell.common.enums.ykc.PileConnectorDataBaseStatusEnum;
|
||||
import com.jsowell.common.util.DateUtils;
|
||||
import com.jsowell.common.util.PageUtils;
|
||||
import com.jsowell.common.util.StringUtils;
|
||||
import com.jsowell.pile.domain.OrderBasicInfo;
|
||||
import com.jsowell.pile.domain.PileBasicInfo;
|
||||
import com.jsowell.pile.domain.PileConnectorInfo;
|
||||
import com.jsowell.pile.domain.PileStationInfo;
|
||||
import com.jsowell.pile.service.*;
|
||||
import com.jsowell.pile.vo.base.ConnectorInfoVO;
|
||||
import com.jsowell.pile.vo.base.MerchantInfoVO;
|
||||
import com.jsowell.pile.vo.web.PileModelInfoVO;
|
||||
import com.jsowell.thirdparty.domain.ConnectorInfo;
|
||||
import com.jsowell.thirdparty.domain.EquipmentInfo;
|
||||
import com.jsowell.thirdparty.domain.OperatorInfo;
|
||||
import com.jsowell.thirdparty.domain.StationInfo;
|
||||
import com.jsowell.thirdparty.domain.*;
|
||||
import com.jsowell.thirdparty.dto.QueryStationInfoDTO;
|
||||
import com.jsowell.thirdparty.service.LianLianService;
|
||||
import com.jsowell.thirdparty.vo.LianLianPageResponse;
|
||||
@@ -24,6 +25,7 @@ import org.springframework.stereotype.Service;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
@Service
|
||||
public class LianLianServiceImpl implements LianLianService {
|
||||
@@ -43,6 +45,9 @@ public class LianLianServiceImpl implements LianLianService {
|
||||
@Autowired
|
||||
private IPileConnectorInfoService pileConnectorInfoService;
|
||||
|
||||
@Autowired
|
||||
private IOrderBasicInfoService orderBasicInfoService;
|
||||
|
||||
|
||||
@Override
|
||||
public void pushMerchantInfo(Long merchantId) {
|
||||
@@ -128,6 +133,59 @@ public class LianLianServiceImpl implements LianLianService {
|
||||
return pageResponse;
|
||||
}
|
||||
|
||||
@Override
|
||||
public LianLianPageResponse query_station_status(List<String> StationIDs) {
|
||||
List<StationStatusInfo> StationStatusInfos = new ArrayList<>();
|
||||
List<Object> ConnectorStatusInfos = new ArrayList<>();
|
||||
|
||||
for (String stationId : StationIDs) {
|
||||
// 根据站点id查询
|
||||
List<ConnectorInfoVO> list = pileConnectorInfoService.getConnectorListForLianLian(Long.parseLong(stationId));
|
||||
for (ConnectorInfoVO connectorInfoVO : list) {
|
||||
|
||||
String connectorStatus = connectorInfoVO.getConnectorStatus();
|
||||
if (StringUtils.equals(connectorStatus, PileConnectorDataBaseStatusEnum.OCCUPIED_CHARGING.getValue())) {
|
||||
// 充电中
|
||||
ConnectorChargeStatusInfo info = new ConnectorChargeStatusInfo();
|
||||
OrderBasicInfo orderBasicInfo = orderBasicInfoService.queryChargingByPileConnectorCode(connectorInfoVO.getPileConnectorCode());
|
||||
List<RealTimeMonitorData> chargingRealTimeData = orderBasicInfoService.getChargingRealTimeData(orderBasicInfo.getOrderCode());
|
||||
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.getTime()); // 本次采样时间
|
||||
info.setTotalPower(new BigDecimal(realTimeMonitorData.getChargingDegree())); // 累计充电量
|
||||
// info.setElecMoney(); // 累计电费
|
||||
// info.setSeviceMoney(); // 累计服务费
|
||||
info.setTotalMoney(new BigDecimal(realTimeMonitorData.getChargingAmount()));
|
||||
|
||||
ConnectorStatusInfos.add(info);
|
||||
|
||||
} else {
|
||||
// 其他
|
||||
ConnectorStatusInfo info = new ConnectorStatusInfo();
|
||||
info.setConnectorID(connectorInfoVO.getPileConnectorCode());
|
||||
info.setStatus(connectorInfoVO.getConnectorStatus());
|
||||
|
||||
ConnectorStatusInfos.add(info);
|
||||
}
|
||||
StationStatusInfo stationStatusInfo = new StationStatusInfo();
|
||||
stationStatusInfo.setStationID(connectorInfoVO.getStationId());
|
||||
stationStatusInfo.setConnectorStatusInfos(ConnectorStatusInfos);
|
||||
|
||||
StationStatusInfos.add(stationStatusInfo);
|
||||
}
|
||||
// TODO 将 StationStatusInfos 分页
|
||||
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取桩列表信息
|
||||
* @param pileStationInfo
|
||||
|
||||
Reference in New Issue
Block a user