mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-20 02:55:04 +08:00
Merge branch 'dev' of http://192.168.2.2:8099/jsowell/jsowell-charger-web into dev
This commit is contained in:
@@ -426,6 +426,8 @@ public class PileConnectorInfoServiceImpl implements IPileConnectorInfoService {
|
|||||||
if (pileModelInfoVO != null) {
|
if (pileModelInfoVO != null) {
|
||||||
infoVO.setChargingType(pileModelInfoVO.getSpeedType());
|
infoVO.setChargingType(pileModelInfoVO.getSpeedType());
|
||||||
infoVO.setRatedPower(pileModelInfoVO.getRatedPower());
|
infoVO.setRatedPower(pileModelInfoVO.getRatedPower());
|
||||||
|
infoVO.setRatedCurrent(pileModelInfoVO.getRatedCurrent());
|
||||||
|
infoVO.setRatedVoltage(pileModelInfoVO.getRatedVoltage());
|
||||||
}
|
}
|
||||||
connectorInfoList.add(infoVO);
|
connectorInfoList.add(infoVO);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -46,4 +46,14 @@ public class ConnectorInfoVO {
|
|||||||
*/
|
*/
|
||||||
private String ratedPower;
|
private String ratedPower;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 额定电流
|
||||||
|
*/
|
||||||
|
private String ratedCurrent;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 额定电压
|
||||||
|
*/
|
||||||
|
private String ratedVoltage;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,11 +3,16 @@ package com.jsowell.thirdparty.amap.service.impl;
|
|||||||
import com.jsowell.common.constant.Constants;
|
import com.jsowell.common.constant.Constants;
|
||||||
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.PileBasicInfo;
|
||||||
import com.jsowell.pile.domain.PileStationInfo;
|
import com.jsowell.pile.domain.PileStationInfo;
|
||||||
import com.jsowell.pile.dto.amap.GetStationInfoDTO;
|
import com.jsowell.pile.dto.amap.GetStationInfoDTO;
|
||||||
import com.jsowell.pile.service.IPileConnectorInfoService;
|
import com.jsowell.pile.service.*;
|
||||||
import com.jsowell.pile.service.IPileStationInfoService;
|
|
||||||
import com.jsowell.pile.vo.base.ConnectorInfoVO;
|
import com.jsowell.pile.vo.base.ConnectorInfoVO;
|
||||||
|
import com.jsowell.pile.vo.uniapp.BillingPriceVO;
|
||||||
|
import com.jsowell.pile.vo.web.PileModelInfoVO;
|
||||||
|
import com.jsowell.thirdparty.amap.domain.AMapConnectorInfo;
|
||||||
|
import com.jsowell.thirdparty.amap.domain.AMapEquipmentInfo;
|
||||||
|
import com.jsowell.thirdparty.amap.domain.AMapPriceChargingInfo;
|
||||||
import com.jsowell.thirdparty.amap.domain.AMapStationInfo;
|
import com.jsowell.thirdparty.amap.domain.AMapStationInfo;
|
||||||
import com.jsowell.thirdparty.amap.service.AMapService;
|
import com.jsowell.thirdparty.amap.service.AMapService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@@ -16,7 +21,9 @@ import org.springframework.util.CollectionUtils;
|
|||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.LinkedHashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 高德地图Service
|
* 高德地图Service
|
||||||
@@ -33,6 +40,15 @@ public class AMapServiceImpl implements AMapService {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private IPileConnectorInfoService pileConnectorInfoService;
|
private IPileConnectorInfoService pileConnectorInfoService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IPileBillingTemplateService pileBillingTemplateService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IPileBasicInfoService pileBasicInfoService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IPileModelInfoService pileModelInfoService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 高德拉取充电站静态数据
|
* 高德拉取充电站静态数据
|
||||||
* @param dto
|
* @param dto
|
||||||
@@ -41,6 +57,7 @@ public class AMapServiceImpl implements AMapService {
|
|||||||
@Override
|
@Override
|
||||||
public List<AMapStationInfo> getStationInfos(GetStationInfoDTO dto) {
|
public List<AMapStationInfo> getStationInfos(GetStationInfoDTO dto) {
|
||||||
List<AMapStationInfo> resultList = new ArrayList<>();
|
List<AMapStationInfo> resultList = new ArrayList<>();
|
||||||
|
|
||||||
if (StringUtils.equals("page", dto.getType())) {
|
if (StringUtils.equals("page", dto.getType())) {
|
||||||
int pageNo = dto.getCurrentPage() == null ? 1 : dto.getCurrentPage();
|
int pageNo = dto.getCurrentPage() == null ? 1 : dto.getCurrentPage();
|
||||||
int pageSize = dto.getPageSize() == null ? 10 : dto.getPageSize();
|
int pageSize = dto.getPageSize() == null ? 10 : dto.getPageSize();
|
||||||
@@ -80,28 +97,134 @@ public class AMapServiceImpl implements AMapService {
|
|||||||
}
|
}
|
||||||
aMapInfo.setConstruction(Integer.parseInt(construction));
|
aMapInfo.setConstruction(Integer.parseInt(construction));
|
||||||
aMapInfo.setBusineHours(stationInfo.getBusinessHours());
|
aMapInfo.setBusineHours(stationInfo.getBusinessHours());
|
||||||
// aMapInfo.setAMapPriceChargingInfo();
|
|
||||||
int fastTotal = 0;
|
|
||||||
int slowTotal = 0;
|
|
||||||
List<ConnectorInfoVO> connectorList = pileConnectorInfoService.getUniAppConnectorList(stationInfo.getId());
|
|
||||||
for (ConnectorInfoVO connectorVO : connectorList) {
|
|
||||||
if (StringUtils.equals(connectorVO.getChargingType(), Constants.ONE)) {
|
|
||||||
// 快充
|
|
||||||
fastTotal += 1;
|
|
||||||
} else {
|
|
||||||
// 慢充
|
|
||||||
slowTotal += 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
aMapInfo.setFastEquipmentNum(fastTotal);
|
|
||||||
aMapInfo.setSlowEquipmentNum(slowTotal);
|
|
||||||
// aMapInfo.setAMapEquipmentInfos();
|
|
||||||
|
|
||||||
|
List<AMapPriceChargingInfo> priceList = getPriceInfoByStationId(String.valueOf(stationInfo.getId()));
|
||||||
|
aMapInfo.setAMapPriceChargingInfo(priceList);
|
||||||
|
|
||||||
|
Map<String, Integer> pileNumMap = getPileNum(stationInfo.getId());
|
||||||
|
|
||||||
|
aMapInfo.setFastEquipmentNum(pileNumMap.get("fastTotal"));
|
||||||
|
aMapInfo.setSlowEquipmentNum(pileNumMap.get("slowTotal"));
|
||||||
|
|
||||||
|
List<AMapEquipmentInfo> aMapEquipmentInfos = getPileListByStationId(String.valueOf(stationInfo.getId()));
|
||||||
|
|
||||||
|
aMapInfo.setAMapEquipmentInfos(aMapEquipmentInfos);
|
||||||
|
|
||||||
resultList.add(aMapInfo);
|
resultList.add(aMapInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
return resultList;
|
return resultList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据站点id查询快、慢充设备数量
|
||||||
|
* @param stationId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
private Map<String, Integer> getPileNum(Long stationId) {
|
||||||
|
int fastTotal = 0;
|
||||||
|
int slowTotal = 0;
|
||||||
|
List<ConnectorInfoVO> connectorList = pileConnectorInfoService.getUniAppConnectorList(stationId);
|
||||||
|
for (ConnectorInfoVO connectorVO : connectorList) {
|
||||||
|
if (StringUtils.equals(connectorVO.getChargingType(), Constants.ONE)) {
|
||||||
|
// 快充
|
||||||
|
fastTotal += 1;
|
||||||
|
} else {
|
||||||
|
// 慢充
|
||||||
|
slowTotal += 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Map<String, Integer> map = new LinkedHashMap<>();
|
||||||
|
map.put("fastTotal", fastTotal);
|
||||||
|
map.put("slowTotal", slowTotal);
|
||||||
|
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据站点id查询计费模板
|
||||||
|
* @param StationId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
private List<AMapPriceChargingInfo> getPriceInfoByStationId(String StationId) {
|
||||||
|
List<AMapPriceChargingInfo> priceList = new ArrayList<>();
|
||||||
|
// 查询计费模板
|
||||||
|
List<BillingPriceVO> billingPriceList = pileBillingTemplateService.queryBillingPrice(StationId);
|
||||||
|
for (BillingPriceVO billingPriceVO : billingPriceList) {
|
||||||
|
AMapPriceChargingInfo info = new AMapPriceChargingInfo();
|
||||||
|
info.setFeeTime(billingPriceVO.getStartTime() + "-" + billingPriceVO.getEndTime()); // 时间段
|
||||||
|
info.setElectricityFee(new BigDecimal(billingPriceVO.getElectricityPrice()).setScale(4, BigDecimal.ROUND_HALF_UP)); // 电费
|
||||||
|
info.setServiceFee(new BigDecimal(billingPriceVO.getServicePrice()).setScale(4, BigDecimal.ROUND_HALF_UP)); // 服务费
|
||||||
|
|
||||||
|
priceList.add(info);
|
||||||
|
}
|
||||||
|
return priceList;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据站点查询站点下所有桩
|
||||||
|
* @param stationId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
private List<AMapEquipmentInfo> getPileListByStationId(String stationId) {
|
||||||
|
List<AMapEquipmentInfo> pileList = new ArrayList<>();
|
||||||
|
// 根据站点查询站点下所有桩
|
||||||
|
List<PileBasicInfo> pileBasicInfoList = pileBasicInfoService.getPileListByStationId(String.valueOf(stationId));
|
||||||
|
if (CollectionUtils.isEmpty(pileBasicInfoList)) {
|
||||||
|
return new ArrayList<>();
|
||||||
|
}
|
||||||
|
for (PileBasicInfo pileBasicInfo : pileBasicInfoList) {
|
||||||
|
AMapEquipmentInfo info = new AMapEquipmentInfo();
|
||||||
|
|
||||||
|
info.setEquipmentID(pileBasicInfo.getSn());
|
||||||
|
info.setManufacturerName("举视");
|
||||||
|
// 查询型号
|
||||||
|
PileModelInfoVO modelInfo = pileModelInfoService.getPileModelInfoByPileSn(pileBasicInfo.getSn());
|
||||||
|
|
||||||
|
info.setEquipmentType(Integer.parseInt(modelInfo.getSpeedType()));
|
||||||
|
info.setPower(new BigDecimal(modelInfo.getRatedPower()).setScale(1, BigDecimal.ROUND_HALF_UP));
|
||||||
|
|
||||||
|
List<AMapConnectorInfo> aMapConnectorInfos = getConnectorListBySN(pileBasicInfo.getSn());
|
||||||
|
|
||||||
|
info.setAMapConnectorInfos(aMapConnectorInfos);
|
||||||
|
|
||||||
|
pileList.add(info);
|
||||||
|
}
|
||||||
|
return pileList;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据桩号查询枪口列表
|
||||||
|
* @param pileSn
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
private List<AMapConnectorInfo> getConnectorListBySN(String pileSn) {
|
||||||
|
List<AMapConnectorInfo> list = new ArrayList<>();
|
||||||
|
|
||||||
|
// 根据桩号查询枪口列表
|
||||||
|
List<ConnectorInfoVO> connectorInfoList = pileConnectorInfoService.selectConnectorInfoList(pileSn);
|
||||||
|
if (CollectionUtils.isEmpty(connectorInfoList)) {
|
||||||
|
return new ArrayList<>();
|
||||||
|
}
|
||||||
|
|
||||||
|
for (ConnectorInfoVO connectorInfoVO : connectorInfoList) {
|
||||||
|
AMapConnectorInfo aMapConnectorInfo = new AMapConnectorInfo();
|
||||||
|
|
||||||
|
aMapConnectorInfo.setConnectorID(connectorInfoVO.getPileConnectorCode());
|
||||||
|
|
||||||
|
Integer connectorType = Integer.parseInt(connectorInfoVO.getChargingType()) == 1 ? 4 : 3;
|
||||||
|
aMapConnectorInfo.setConnectorType(connectorType);
|
||||||
|
aMapConnectorInfo.setVoltageLowerLimits(0);
|
||||||
|
aMapConnectorInfo.setVoltageUpperLimits(Integer.parseInt(connectorInfoVO.getRatedVoltage()));
|
||||||
|
aMapConnectorInfo.setCurrent(Integer.parseInt(connectorInfoVO.getRatedCurrent()));
|
||||||
|
aMapConnectorInfo.setPower(new BigDecimal(connectorInfoVO.getRatedPower()).setScale(1, BigDecimal.ROUND_HALF_UP));
|
||||||
|
aMapConnectorInfo.setNationalStandard(2);
|
||||||
|
aMapConnectorInfo.setBrandDesc("举视");
|
||||||
|
|
||||||
|
list.add(aMapConnectorInfo);
|
||||||
|
}
|
||||||
|
return list;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user