mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-06-20 07:16:00 +08:00
add 新增联联平台接口 获取充电桩状态信息
This commit is contained in:
@@ -64,6 +64,10 @@ public class CacheConstants {
|
|||||||
*/
|
*/
|
||||||
public static final String SELECT_PILE_STATION_INFO_BY_ID = "select_pile_station_info_by_id:";
|
public static final String SELECT_PILE_STATION_INFO_BY_ID = "select_pile_station_info_by_id:";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* uniApp通过站点id查询枪口列表信息
|
||||||
|
*/
|
||||||
|
public static final String GET_UNIAPP_CONNECTOR_LIST_BY_STATION_ID = "GET_UNIAPP_CONNECTOR_LIST_BY_STATION_ID:";
|
||||||
/**
|
/**
|
||||||
* 充电桩sn生成 key
|
* 充电桩sn生成 key
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -129,5 +129,7 @@ public interface IPileConnectorInfoService {
|
|||||||
*/
|
*/
|
||||||
List<ConnectorInfoVO> getUniAppConnectorList(Long stationId);
|
List<ConnectorInfoVO> getUniAppConnectorList(Long stationId);
|
||||||
|
|
||||||
|
List<ConnectorInfoVO> getConnectorListForLianLian(Long stationId);
|
||||||
|
|
||||||
List<ConnectorInfoVO> selectConnectorInfoList(String pileSn);
|
List<ConnectorInfoVO> selectConnectorInfoList(String pileSn);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -383,9 +383,22 @@ public class PileConnectorInfoServiceImpl implements IPileConnectorInfoService {
|
|||||||
@Override
|
@Override
|
||||||
public List<ConnectorInfoVO> getUniAppConnectorList(Long stationId) {
|
public List<ConnectorInfoVO> getUniAppConnectorList(Long stationId) {
|
||||||
// TODO 加缓存
|
// TODO 加缓存
|
||||||
|
// String redisKey = CacheConstants.GET_UNIAPP_CONNECTOR_LIST_BY_STATION_ID + stationId;
|
||||||
|
// List<ConnectorInfoVO> list = redisCache.getCacheObject(redisKey);
|
||||||
|
// if (CollectionUtils.isEmpty(list)) {
|
||||||
|
// // 查数据库
|
||||||
|
// list = pileConnectorInfoMapper.getUniAppConnectorList(stationId);
|
||||||
|
// if (CollectionUtils.isNotEmpty(list)) {
|
||||||
|
// redisCache.setCacheObject(redisKey, list, 5, TimeUnit.MINUTES);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
return pileConnectorInfoMapper.getUniAppConnectorList(stationId);
|
return pileConnectorInfoMapper.getUniAppConnectorList(stationId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<ConnectorInfoVO> getConnectorListForLianLian(Long stationId) {
|
||||||
|
return getUniAppConnectorList(stationId);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<ConnectorInfoVO> selectConnectorInfoList(String pileSn) {
|
public List<ConnectorInfoVO> selectConnectorInfoList(String pileSn) {
|
||||||
// 查询充电桩型号信息
|
// 查询充电桩型号信息
|
||||||
|
|||||||
@@ -16,6 +16,11 @@ import lombok.NoArgsConstructor;
|
|||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@Builder
|
@Builder
|
||||||
public class ConnectorInfoVO {
|
public class ConnectorInfoVO {
|
||||||
|
/**
|
||||||
|
* 站点id
|
||||||
|
*/
|
||||||
|
private String stationId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 枪口号
|
* 枪口号
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -224,6 +224,7 @@
|
|||||||
<select id="getUniAppConnectorList" resultType="com.jsowell.pile.vo.base.ConnectorInfoVO">
|
<select id="getUniAppConnectorList" resultType="com.jsowell.pile.vo.base.ConnectorInfoVO">
|
||||||
SELECT
|
SELECT
|
||||||
t1.pile_connector_code as connectorCode,
|
t1.pile_connector_code as connectorCode,
|
||||||
|
t2.station_id as stationId,
|
||||||
t1.STATUS as connectorStatus,
|
t1.STATUS as connectorStatus,
|
||||||
t1.pile_sn,
|
t1.pile_sn,
|
||||||
t2.model_id,
|
t2.model_id,
|
||||||
|
|||||||
@@ -19,13 +19,13 @@ public class ConnectorChargeStatusInfo {
|
|||||||
* 充电订单号 Y
|
* 充电订单号 Y
|
||||||
* 对接平台系统订单编号
|
* 对接平台系统订单编号
|
||||||
*/
|
*/
|
||||||
private String orderCode;
|
private String StartChargeSeq;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 充电设备接口编码 Y
|
* 充电设备接口编码 Y
|
||||||
* 平台下唯一枪口号
|
* 平台下唯一枪口号
|
||||||
*/
|
*/
|
||||||
private String pileConnectorCode;
|
private String ConnectorID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 充电设备接口状态 Y
|
* 充电设备接口状态 Y
|
||||||
@@ -35,88 +35,88 @@ public class ConnectorChargeStatusInfo {
|
|||||||
* 4:占用(预约锁定)
|
* 4:占用(预约锁定)
|
||||||
* 255:故障
|
* 255:故障
|
||||||
*/
|
*/
|
||||||
private Integer connectorStatus;
|
private Integer ConnectorStatus;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 车辆识别码 N
|
* 车辆识别码 N
|
||||||
* 车辆识别号码或车架号码,由17位英数组成
|
* 车辆识别号码或车架号码,由17位英数组成
|
||||||
*/
|
*/
|
||||||
private String vinCode;
|
private String Vin;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A相电流 Y
|
* A相电流 Y
|
||||||
* 单位:A,默认:0 含直流(输出)
|
* 单位:A,默认:0 含直流(输出)
|
||||||
*/
|
*/
|
||||||
private BigDecimal currentA;
|
private BigDecimal CurrentA;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* B相电流 N
|
* B相电流 N
|
||||||
* 单位:A,默认:0
|
* 单位:A,默认:0
|
||||||
*/
|
*/
|
||||||
private BigDecimal currentB;
|
private BigDecimal CurrentB;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* C相电流 N
|
* C相电流 N
|
||||||
* 单位:A,默认:0
|
* 单位:A,默认:0
|
||||||
*/
|
*/
|
||||||
private BigDecimal currentC;
|
private BigDecimal CurrentC;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A相电压 Y
|
* A相电压 Y
|
||||||
* 单位:V,默认:0含直流(输出)
|
* 单位:V,默认:0含直流(输出)
|
||||||
*/
|
*/
|
||||||
private BigDecimal voltageA;
|
private BigDecimal VoltageA;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* B相电压 N
|
* B相电压 N
|
||||||
* 单位:V,默认:0
|
* 单位:V,默认:0
|
||||||
*/
|
*/
|
||||||
private BigDecimal voltageB;
|
private BigDecimal VoltageB;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* C相电压 N
|
* C相电压 N
|
||||||
* 单位:V,默认:0
|
* 单位:V,默认:0
|
||||||
*/
|
*/
|
||||||
private BigDecimal voltageC;
|
private BigDecimal VoltageC;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 电池剩余电量(默认:0) Y
|
* 电池剩余电量(默认:0) Y
|
||||||
*/
|
*/
|
||||||
private BigDecimal soc;
|
private BigDecimal Soc;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 开始充电时间 Y
|
* 开始充电时间 Y
|
||||||
* 格式“yyyy-MM-dd HH:mm:ss”
|
* 格式“yyyy-MM-dd HH:mm:ss”
|
||||||
*/
|
*/
|
||||||
private String chargingStartTime;
|
private String StartTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 本次采样时间 Y
|
* 本次采样时间 Y
|
||||||
* 格式“yyyy-MM-dd HH:mm:ss”
|
* 格式“yyyy-MM-dd HH:mm:ss”
|
||||||
*/
|
*/
|
||||||
private String chargingEndTime;
|
private String EndTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 累计充电量 Y
|
* 累计充电量 Y
|
||||||
* 单位:度,小数点后2位
|
* 单位:度,小数点后2位
|
||||||
*/
|
*/
|
||||||
private BigDecimal totalUseElectricity;
|
private BigDecimal TotalPower;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 累计电费 Y
|
* 累计电费 Y
|
||||||
* 单位:元,小数点后2位
|
* 单位:元,小数点后2位
|
||||||
*/
|
*/
|
||||||
private BigDecimal totalElectricityAmount;
|
private BigDecimal ElecMoney;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 累计服务费 Y
|
* 累计服务费 Y
|
||||||
* 单位:元,小数点后2位
|
* 单位:元,小数点后2位
|
||||||
*/
|
*/
|
||||||
private BigDecimal totalServiceAmount;
|
private BigDecimal SeviceMoney;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 累计总金额 Y
|
* 累计总金额 Y
|
||||||
* 单位:元,小数点后2位
|
* 单位:元,小数点后2位
|
||||||
*/
|
*/
|
||||||
private BigDecimal totalAmount;
|
private BigDecimal TotalMoney;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ public class ConnectorStatusInfo {
|
|||||||
* 充电设备接口编码 Y
|
* 充电设备接口编码 Y
|
||||||
* 充电设备接口编码,同一对接平台内唯一
|
* 充电设备接口编码,同一对接平台内唯一
|
||||||
*/
|
*/
|
||||||
private String pileConnectorCode;
|
private String ConnectorID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 充电设备接口状态 Y
|
* 充电设备接口状态 Y
|
||||||
@@ -28,15 +28,15 @@ public class ConnectorStatusInfo {
|
|||||||
* 4:占用(预约锁定)
|
* 4:占用(预约锁定)
|
||||||
* 255:故障
|
* 255:故障
|
||||||
*/
|
*/
|
||||||
private String connectorStatus;
|
private String Status;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 车位状态(0-未知;10-空闲;50-占用) N
|
* 车位状态(0-未知;10-空闲;50-占用) N
|
||||||
*/
|
*/
|
||||||
private String parkingStatus;
|
private String ParkStatus;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 地锁状态(0-未知;10-已解锁;50-占用) N
|
* 地锁状态(0-未知;10-已解锁;50-占用) N
|
||||||
*/
|
*/
|
||||||
private String groundLockStatus;
|
private String LockStatus;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,11 +19,11 @@ public class StationStatusInfo {
|
|||||||
* 充电站ID Y
|
* 充电站ID Y
|
||||||
* 对接平台自定义的唯一编码,不足长度在前方补0
|
* 对接平台自定义的唯一编码,不足长度在前方补0
|
||||||
*/
|
*/
|
||||||
private String stationId;
|
private String StationID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 充电设备接口状态列表 Y
|
* 充电设备接口状态列表 Y
|
||||||
* 所有充电设备接口的状态
|
* 所有充电设备接口的状态
|
||||||
*/
|
*/
|
||||||
private List<ConnectorStatusInfo> connectorStatusInfos;
|
private List<?> ConnectorStatusInfos;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,5 +14,19 @@ public interface LianLianService {
|
|||||||
*/
|
*/
|
||||||
void pushMerchantInfo(Long merchantId);
|
void pushMerchantInfo(Long merchantId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 联联平台获取充电站信息
|
||||||
|
* @param dto
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
LianLianPageResponse query_stations_info(QueryStationInfoDTO dto);
|
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;
|
package com.jsowell.thirdparty.service.impl;
|
||||||
|
|
||||||
import com.github.pagehelper.PageInfo;
|
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.DateUtils;
|
||||||
import com.jsowell.common.util.PageUtils;
|
import com.jsowell.common.util.PageUtils;
|
||||||
import com.jsowell.common.util.StringUtils;
|
import com.jsowell.common.util.StringUtils;
|
||||||
|
import com.jsowell.pile.domain.OrderBasicInfo;
|
||||||
import com.jsowell.pile.domain.PileBasicInfo;
|
import com.jsowell.pile.domain.PileBasicInfo;
|
||||||
import com.jsowell.pile.domain.PileConnectorInfo;
|
import com.jsowell.pile.domain.PileConnectorInfo;
|
||||||
import com.jsowell.pile.domain.PileStationInfo;
|
import com.jsowell.pile.domain.PileStationInfo;
|
||||||
import com.jsowell.pile.service.*;
|
import com.jsowell.pile.service.*;
|
||||||
|
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.web.PileModelInfoVO;
|
import com.jsowell.pile.vo.web.PileModelInfoVO;
|
||||||
import com.jsowell.thirdparty.domain.ConnectorInfo;
|
import com.jsowell.thirdparty.domain.*;
|
||||||
import com.jsowell.thirdparty.domain.EquipmentInfo;
|
|
||||||
import com.jsowell.thirdparty.domain.OperatorInfo;
|
|
||||||
import com.jsowell.thirdparty.domain.StationInfo;
|
|
||||||
import com.jsowell.thirdparty.dto.QueryStationInfoDTO;
|
import com.jsowell.thirdparty.dto.QueryStationInfoDTO;
|
||||||
import com.jsowell.thirdparty.service.LianLianService;
|
import com.jsowell.thirdparty.service.LianLianService;
|
||||||
import com.jsowell.thirdparty.vo.LianLianPageResponse;
|
import com.jsowell.thirdparty.vo.LianLianPageResponse;
|
||||||
@@ -24,6 +25,7 @@ import org.springframework.stereotype.Service;
|
|||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
public class LianLianServiceImpl implements LianLianService {
|
public class LianLianServiceImpl implements LianLianService {
|
||||||
@@ -43,6 +45,9 @@ public class LianLianServiceImpl implements LianLianService {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private IPileConnectorInfoService pileConnectorInfoService;
|
private IPileConnectorInfoService pileConnectorInfoService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IOrderBasicInfoService orderBasicInfoService;
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void pushMerchantInfo(Long merchantId) {
|
public void pushMerchantInfo(Long merchantId) {
|
||||||
@@ -128,6 +133,59 @@ public class LianLianServiceImpl implements LianLianService {
|
|||||||
return pageResponse;
|
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
|
* @param pileStationInfo
|
||||||
|
|||||||
Reference in New Issue
Block a user