mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-21 03:25:12 +08:00
update 对接第三方平台
This commit is contained in:
@@ -1,13 +1,14 @@
|
||||
package com.jsowell.pile.service;
|
||||
|
||||
import com.jsowell.pile.thirdparty.ConnectorInfo;
|
||||
import com.jsowell.pile.thirdparty.EquipmentInfo;
|
||||
import com.jsowell.common.core.domain.ykc.RealTimeMonitorData;
|
||||
import com.jsowell.pile.domain.PileBasicInfo;
|
||||
import com.jsowell.pile.domain.PileStationInfo;
|
||||
import com.jsowell.pile.dto.IndexQueryDTO;
|
||||
import com.jsowell.pile.dto.QueryPileDTO;
|
||||
import com.jsowell.pile.dto.ReplaceMerchantStationDTO;
|
||||
import com.jsowell.pile.thirdparty.ConnectorInfo;
|
||||
import com.jsowell.pile.thirdparty.EquipmentInfo;
|
||||
import com.jsowell.pile.thirdparty.ZDLConnectorInfo;
|
||||
import com.jsowell.pile.thirdparty.ZDLEquipmentInfo;
|
||||
import com.jsowell.pile.vo.base.PileInfoVO;
|
||||
import com.jsowell.pile.vo.uniapp.GroundLockInfoVO;
|
||||
import com.jsowell.pile.vo.uniapp.PersonalPileInfoVO;
|
||||
@@ -194,7 +195,18 @@ public interface PileBasicInfoService {
|
||||
*/
|
||||
PileBasicInfo getMaxNumPileInfo();
|
||||
|
||||
List<EquipmentInfo> getPileList(PileStationInfo pileStationInfo);
|
||||
/**
|
||||
* 获取充电桩列表
|
||||
* 提供给联联平台
|
||||
* @param pileStationInfo
|
||||
* @return
|
||||
*/
|
||||
// List<EquipmentInfo> getPileList(PileStationInfo pileStationInfo);
|
||||
// List<ConnectorInfo> getConnectorList(PileBasicInfo pileBasicInfo);
|
||||
|
||||
List<ConnectorInfo> getConnectorList(PileBasicInfo pileBasicInfo);
|
||||
List<EquipmentInfo> getPileListForLianLian(String stationId);
|
||||
List<ConnectorInfo> getConnectorListForLianLian(String pileSn);
|
||||
|
||||
List<ZDLEquipmentInfo> getPileListForZDL(String stationId);
|
||||
List<ZDLConnectorInfo> getConnectorListForZDL(String pileSn);
|
||||
}
|
||||
|
||||
@@ -303,7 +303,7 @@ public class OrderBasicInfoServiceImpl implements OrderBasicInfoService {
|
||||
}
|
||||
String thirdPartyType = orderListVO.getThirdPartyType();
|
||||
if(StringUtils.isNotBlank(thirdPartyType)) {
|
||||
String label = ThirdPlatformTypeEnum.getLabelByCode(thirdPartyType);
|
||||
String label = ThirdPlatformTypeEnum.getTypeLabelByTypeCode(thirdPartyType);
|
||||
orderListVO.setThirdPartyType(label + "启动");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,6 +27,8 @@ import com.jsowell.pile.mapper.PileBasicInfoMapper;
|
||||
import com.jsowell.pile.mapper.PileMerchantInfoMapper;
|
||||
import com.jsowell.pile.mapper.PileSimInfoMapper;
|
||||
import com.jsowell.pile.service.*;
|
||||
import com.jsowell.pile.thirdparty.ZDLConnectorInfo;
|
||||
import com.jsowell.pile.thirdparty.ZDLEquipmentInfo;
|
||||
import com.jsowell.pile.util.UserUtils;
|
||||
import com.jsowell.pile.vo.base.MerchantInfoVO;
|
||||
import com.jsowell.pile.vo.base.PileInfoVO;
|
||||
@@ -935,7 +937,7 @@ public class PileBasicInfoServiceImpl implements PileBasicInfoService {
|
||||
* @param pileStationInfo
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
/*@Override
|
||||
public List<EquipmentInfo> getPileList(PileStationInfo pileStationInfo) {
|
||||
List<EquipmentInfo> resultList = new ArrayList<>();
|
||||
// 通过站点id查询桩基本信息
|
||||
@@ -977,6 +979,49 @@ public class PileBasicInfoServiceImpl implements PileBasicInfoService {
|
||||
resultList.add(equipmentInfo);
|
||||
}
|
||||
return resultList;
|
||||
}*/
|
||||
|
||||
@Override
|
||||
public List<EquipmentInfo> getPileListForLianLian(String stationId) {
|
||||
List<EquipmentInfo> resultList = new ArrayList<>();
|
||||
// 通过站点id查询桩基本信息
|
||||
List<PileBasicInfo> list = this.getPileListByStationId(stationId);
|
||||
// 封装成联联平台对象
|
||||
for (PileBasicInfo pileBasicInfo : list) {
|
||||
EquipmentInfo equipmentInfo = new EquipmentInfo();
|
||||
String pileSn = pileBasicInfo.getSn();
|
||||
|
||||
equipmentInfo.setEquipmentID(pileSn);
|
||||
equipmentInfo.setManufacturerID(Constants.OPERATORID_LIANLIAN);
|
||||
equipmentInfo.setConstructionTime(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD, pileBasicInfo.getCreateTime()));
|
||||
|
||||
PileModelInfoVO modelInfo = pileModelInfoService.getPileModelInfoByPileSn(pileSn);
|
||||
equipmentInfo.setEquipmentType(Integer.valueOf(modelInfo.getSpeedType()));
|
||||
|
||||
// Map<String, String> pileStatus = pileConnectorInfoService.getPileStatus(Lists.newArrayList(pileBasicInfo.getSn()));
|
||||
Map<String, String> pileStatusMap = pileConnectorInfoService.getPileStatus(Lists.newArrayList(pileSn));
|
||||
String pileStatus = pileStatusMap.get(pileSn);
|
||||
if (StringUtils.equals(PileStatusEnum.ON_LINE.getValue(), pileStatus)) {
|
||||
// 1-在线
|
||||
pileStatus = LianLianPileStatusEnum.NORMAL.getCode();
|
||||
} else if (StringUtils.equals(PileStatusEnum.OFF_LINE.getValue(), pileStatus)) {
|
||||
// 2-离线
|
||||
pileStatus = LianLianPileStatusEnum.CLOSE_OFFLINE.getCode();
|
||||
} else if (StringUtils.equals(PileStatusEnum.FAULT.getValue(), pileStatus)) {
|
||||
// 3-故障
|
||||
pileStatus = LianLianPileStatusEnum.UNDER_MAINTENANCE.getCode();
|
||||
}
|
||||
equipmentInfo.setEquipmentStatus(Integer.valueOf(pileStatus));
|
||||
equipmentInfo.setEquipmentPower(new BigDecimal(modelInfo.getRatedPower()).setScale(1, BigDecimal.ROUND_HALF_UP));
|
||||
equipmentInfo.setNewNationalStandard(1);
|
||||
equipmentInfo.setVinFlag(1);
|
||||
|
||||
List<ConnectorInfo> connectorList = getConnectorListForLianLian(pileSn);
|
||||
equipmentInfo.setConnectorInfos(connectorList);
|
||||
|
||||
resultList.add(equipmentInfo);
|
||||
}
|
||||
return resultList;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -985,7 +1030,7 @@ public class PileBasicInfoServiceImpl implements PileBasicInfoService {
|
||||
* @param pileBasicInfo
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
/*@Override
|
||||
public List<ConnectorInfo> getConnectorList(PileBasicInfo pileBasicInfo) {
|
||||
List<ConnectorInfo> resultList = new ArrayList<>();
|
||||
|
||||
@@ -1019,6 +1064,84 @@ public class PileBasicInfoServiceImpl implements PileBasicInfoService {
|
||||
resultList.add(connectorInfo);
|
||||
}
|
||||
|
||||
return resultList;
|
||||
}*/
|
||||
|
||||
@Override
|
||||
public List<ConnectorInfo> getConnectorListForLianLian(String pileSn) {
|
||||
List<ConnectorInfo> resultList = new ArrayList<>();
|
||||
|
||||
List<PileConnectorInfo> list = pileConnectorInfoService.selectPileConnectorInfoList(pileSn);
|
||||
PileModelInfoVO modelInfo = pileModelInfoService.getPileModelInfoByPileSn(pileSn);
|
||||
for (PileConnectorInfo pileConnectorInfo : list) {
|
||||
ConnectorInfo connectorInfo = new ConnectorInfo();
|
||||
connectorInfo.setConnectorID(pileConnectorInfo.getPileConnectorCode());
|
||||
int connectorType = StringUtils.equals("1", modelInfo.getSpeedType()) ? 4 : 3;
|
||||
connectorInfo.setConnectorType(connectorType);
|
||||
// 车位号
|
||||
if (StringUtils.isNotBlank(pileConnectorInfo.getParkNo())) {
|
||||
connectorInfo.setParkNo(pileConnectorInfo.getParkNo());
|
||||
}
|
||||
connectorInfo.setVoltageUpperLimits(Integer.valueOf(modelInfo.getRatedVoltage()));
|
||||
connectorInfo.setVoltageLowerLimits(Integer.valueOf(modelInfo.getRatedVoltage()));
|
||||
connectorInfo.setCurrent(Integer.valueOf(modelInfo.getRatedCurrent()));
|
||||
if (!StringUtils.equals(modelInfo.getConnectorNum(), "1")) {
|
||||
// 如果不是单枪,则枪口功率需要除以枪口数量
|
||||
String ratedPowerStr = modelInfo.getRatedPower();
|
||||
BigDecimal ratedPower = new BigDecimal(ratedPowerStr);
|
||||
connectorInfo.setPower(ratedPower.divide(new BigDecimal(modelInfo.getConnectorNum()), 1, BigDecimal.ROUND_HALF_UP));
|
||||
}else {
|
||||
connectorInfo.setPower(new BigDecimal(modelInfo.getRatedPower()).setScale(1, BigDecimal.ROUND_HALF_UP));
|
||||
}
|
||||
resultList.add(connectorInfo);
|
||||
}
|
||||
return resultList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ZDLEquipmentInfo> getPileListForZDL(String stationId) {
|
||||
List<ZDLEquipmentInfo> resultList = new ArrayList<>();
|
||||
// 通过站点id查询桩基本信息
|
||||
List<PileBasicInfo> list = this.getPileListByStationId(stationId);
|
||||
// 封装成中电联平台对象
|
||||
for (PileBasicInfo pileBasicInfo : list) {
|
||||
ZDLEquipmentInfo equipmentInfo = new ZDLEquipmentInfo();
|
||||
String pileSn = pileBasicInfo.getSn();
|
||||
equipmentInfo.setEquipmentId(pileSn);
|
||||
PileModelInfoVO modelInfo = pileModelInfoService.getPileModelInfoByPileSn(pileSn);
|
||||
equipmentInfo.setEquipmentType(Integer.parseInt(modelInfo.getSpeedType()));
|
||||
equipmentInfo.setPower(new BigDecimal(modelInfo.getRatedPower()).setScale(1, BigDecimal.ROUND_HALF_UP));
|
||||
|
||||
List<ZDLConnectorInfo> connectorList = getConnectorListForZDL(pileSn);
|
||||
equipmentInfo.setConnectorInfos(connectorList);
|
||||
|
||||
resultList.add(equipmentInfo);
|
||||
}
|
||||
return resultList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ZDLConnectorInfo> getConnectorListForZDL(String pileSn) {
|
||||
List<ZDLConnectorInfo> resultList = new ArrayList<>();
|
||||
|
||||
List<PileConnectorInfo> list = pileConnectorInfoService.selectPileConnectorInfoList(pileSn);
|
||||
PileModelInfoVO modelInfo = pileModelInfoService.getPileModelInfoByPileSn(pileSn);
|
||||
for (PileConnectorInfo pileConnectorInfo : list) {
|
||||
ZDLConnectorInfo connectorInfo = new ZDLConnectorInfo();
|
||||
connectorInfo.setConnectorId(pileConnectorInfo.getPileConnectorCode());
|
||||
int connectorType = StringUtils.equals("1", modelInfo.getSpeedType()) ? 4 : 3;
|
||||
connectorInfo.setConnectorType(connectorType);
|
||||
// 车位号
|
||||
if (StringUtils.isNotBlank(pileConnectorInfo.getParkNo())) {
|
||||
connectorInfo.setParkNo(pileConnectorInfo.getParkNo());
|
||||
}
|
||||
connectorInfo.setVoltageUpperLimits(Integer.valueOf(modelInfo.getRatedVoltage()));
|
||||
connectorInfo.setVoltageLowerLimits(Integer.valueOf(modelInfo.getRatedVoltage()));
|
||||
connectorInfo.setCurrent(Integer.valueOf(modelInfo.getRatedCurrent()));
|
||||
connectorInfo.setNationalStandard(2);
|
||||
connectorInfo.setPower(new BigDecimal(modelInfo.getRatedPower()).setScale(1, BigDecimal.ROUND_HALF_UP));
|
||||
resultList.add(connectorInfo);
|
||||
}
|
||||
return resultList;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ public class ThirdPartyStationRelationServiceImpl implements ThirdPartyStationRe
|
||||
ThirdPartyStationRelation relation = new ThirdPartyStationRelation();
|
||||
relation.setStationId(Long.parseLong(stationId));
|
||||
relation.setThirdPartyType(thirdPartyType);
|
||||
if (StringUtils.equals(thirdPartyType, ThirdPlatformTypeEnum.HUA_WEI.getCode())) {
|
||||
if (StringUtils.equals(thirdPartyType, ThirdPlatformTypeEnum.HUA_WEI.getTypeCode())) {
|
||||
relation.setStartMode(Constants.ONE);
|
||||
}
|
||||
ThirdPartyStationRelationVO vo = this.selectRelationInfo(relation);
|
||||
|
||||
@@ -4,7 +4,6 @@ import java.util.List;
|
||||
|
||||
import com.jsowell.common.enums.thirdparty.ThirdPlatformTypeEnum;
|
||||
import com.jsowell.common.util.DateUtils;
|
||||
import com.jsowell.pile.dto.QueryPileDTO;
|
||||
import com.jsowell.pile.dto.ThirdPartySnRelationDTO;
|
||||
import com.jsowell.pile.vo.web.ThirdPartySnRelationVO;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -103,7 +102,7 @@ public class ThirdpartySnRelationServiceImpl implements IThirdpartySnRelationSer
|
||||
for (ThirdPartySnRelationVO thirdPartySnRelationVO : list) {
|
||||
// 将第三方平台类型中文名称查询出来
|
||||
String thirdPartyType = thirdPartySnRelationVO.getThirdPartyType();
|
||||
String label = ThirdPlatformTypeEnum.getLabelByCode(thirdPartyType);
|
||||
String label = ThirdPlatformTypeEnum.getTypeLabelByTypeCode(thirdPartyType);
|
||||
thirdPartySnRelationVO.setThirdPartyName(label);
|
||||
}
|
||||
return list;
|
||||
|
||||
40
jsowell-pile/src/main/java/com/jsowell/pile/thirdparty/ZDLConnectorInfo.java
vendored
Normal file
40
jsowell-pile/src/main/java/com/jsowell/pile/thirdparty/ZDLConnectorInfo.java
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
package com.jsowell.pile.thirdparty;
|
||||
|
||||
import com.alibaba.fastjson2.annotation.JSONField;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* TODO
|
||||
*
|
||||
* @author Lemon
|
||||
* @Date 2023/9/7 14:03
|
||||
*/
|
||||
@Data
|
||||
public class ZDLConnectorInfo {
|
||||
@JSONField(name = "ConnectorID")
|
||||
private String connectorId;
|
||||
|
||||
@JSONField(name = "ConnectorType")
|
||||
private Integer connectorType;
|
||||
|
||||
@JSONField(name = "VoltageUpperLimits")
|
||||
private Integer voltageUpperLimits;
|
||||
|
||||
@JSONField(name = "VoltageLowerLimits")
|
||||
private Integer voltageLowerLimits;
|
||||
|
||||
@JSONField(name = "Current")
|
||||
private Integer current;
|
||||
|
||||
@JSONField(name = "ParkNo")
|
||||
private String parkNo;
|
||||
|
||||
@JSONField(name = "Power")
|
||||
private BigDecimal power;
|
||||
|
||||
@JSONField(name = "NationalStandard")
|
||||
private Integer nationalStandard;
|
||||
|
||||
}
|
||||
28
jsowell-pile/src/main/java/com/jsowell/pile/thirdparty/ZDLEquipmentInfo.java
vendored
Normal file
28
jsowell-pile/src/main/java/com/jsowell/pile/thirdparty/ZDLEquipmentInfo.java
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
package com.jsowell.pile.thirdparty;
|
||||
|
||||
import com.alibaba.fastjson2.annotation.JSONField;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 设备基本信息
|
||||
*
|
||||
* @author Lemon
|
||||
* @Date 2023/9/5 15:16
|
||||
*/
|
||||
@Data
|
||||
public class ZDLEquipmentInfo {
|
||||
@JSONField(name = "EquipmentID")
|
||||
private String equipmentId;
|
||||
|
||||
@JSONField(name = "EquipmentType")
|
||||
private Integer equipmentType;
|
||||
|
||||
@JSONField(name = "Power")
|
||||
private BigDecimal power;
|
||||
|
||||
@JSONField(name = "ConnectorInfos")
|
||||
private List<ZDLConnectorInfo> connectorInfos;
|
||||
}
|
||||
73
jsowell-pile/src/main/java/com/jsowell/pile/thirdparty/ZDLStationInfo.java
vendored
Normal file
73
jsowell-pile/src/main/java/com/jsowell/pile/thirdparty/ZDLStationInfo.java
vendored
Normal file
@@ -0,0 +1,73 @@
|
||||
package com.jsowell.pile.thirdparty;
|
||||
|
||||
import com.alibaba.fastjson2.annotation.JSONField;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 站点基本信息
|
||||
*
|
||||
* @author Lemon
|
||||
* @Date 2023/9/5 14:10
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Builder
|
||||
public class ZDLStationInfo {
|
||||
@JSONField(name = "StationID")
|
||||
private String stationId;
|
||||
|
||||
@JSONField(name = "OperatorID")
|
||||
private String operatorId;
|
||||
|
||||
@JSONField(name = "EquipmentOwnerID")
|
||||
private String equipmentOwnerId;
|
||||
|
||||
@JSONField(name = "StationName")
|
||||
private String stationName;
|
||||
|
||||
@JSONField(name = "CountryCode")
|
||||
private String countryCode;
|
||||
|
||||
@JSONField(name = "AreaCode")
|
||||
private String areaCode;
|
||||
|
||||
@JSONField(name = "Address")
|
||||
private String address;
|
||||
|
||||
@JSONField(name = "ServiceTel")
|
||||
private String serviceTel;
|
||||
|
||||
@JSONField(name = "StationType")
|
||||
private Integer stationType;
|
||||
|
||||
@JSONField(name = "StationStatus")
|
||||
private Integer stationStatus;
|
||||
|
||||
@JSONField(name = "ParkNums")
|
||||
private Integer parkNums;
|
||||
|
||||
@JSONField(name = "StationLng")
|
||||
private BigDecimal stationLng;
|
||||
|
||||
@JSONField(name = "StationLat")
|
||||
private BigDecimal stationLat;
|
||||
|
||||
@JSONField(name = "Construction")
|
||||
private Integer construction;
|
||||
|
||||
@JSONField(name = "ParkFee")
|
||||
private String parkFee;
|
||||
|
||||
@JSONField(name = "Pictures")
|
||||
private List<String> pictures;
|
||||
|
||||
@JSONField(name = "EquipmentInfos")
|
||||
private List<ZDLEquipmentInfo> equipmentInfos;
|
||||
}
|
||||
Reference in New Issue
Block a user