mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-21 03:25:12 +08:00
将 根据站点id查询快、慢充设备数量 方法进行封装、优化
This commit is contained in:
@@ -10,6 +10,7 @@ import com.jsowell.pile.domain.PileStationInfo;
|
||||
import com.jsowell.pile.dto.amap.ChargeDeviceDynamicsDTO;
|
||||
import com.jsowell.pile.dto.amap.GetStationInfoDTO;
|
||||
import com.jsowell.pile.service.*;
|
||||
import com.jsowell.pile.service.impl.PileStationInfoServiceImpl;
|
||||
import com.jsowell.pile.vo.base.ConnectorInfoVO;
|
||||
import com.jsowell.pile.vo.uniapp.BillingPriceVO;
|
||||
import com.jsowell.pile.vo.uniapp.PileConnectorDetailVO;
|
||||
@@ -103,7 +104,7 @@ public class AMapServiceImpl implements AMapService {
|
||||
List<AMapPriceChargingInfo> priceList = getPriceInfoByStationId(String.valueOf(stationInfo.getId()));
|
||||
aMapInfo.setAMapPriceChargingInfo(priceList);
|
||||
|
||||
Map<String, Integer> pileNumMap = getPileNum(stationInfo.getId());
|
||||
Map<String, Integer> pileNumMap = pileConnectorInfoService.getPileTypeNum(stationInfo.getId());
|
||||
aMapInfo.setFastEquipmentNum(pileNumMap.get("fastTotal"));
|
||||
aMapInfo.setSlowEquipmentNum(pileNumMap.get("slowTotal"));
|
||||
|
||||
@@ -130,7 +131,7 @@ public class AMapServiceImpl implements AMapService {
|
||||
throw new BusinessException("", "");
|
||||
}
|
||||
String stationId = pileConnectorDetailVO.getStationId();
|
||||
Map<String, Integer> pileNumMap = getPileNum(Long.parseLong(stationId));
|
||||
Map<String, Integer> pileNumMap = pileConnectorInfoService.getPileTypeNum(Long.parseLong(stationId));
|
||||
|
||||
AMapConnectorStatusInfo info = new AMapConnectorStatusInfo();
|
||||
info.setConnectorID(pileConnectorCode);
|
||||
@@ -155,43 +156,6 @@ public class AMapServiceImpl implements AMapService {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 根据站点id查询快、慢充设备数量
|
||||
* @param stationId
|
||||
* @return
|
||||
*/
|
||||
private Map<String, Integer> getPileNum(Long stationId) {
|
||||
int fastTotal = 0;
|
||||
int fastFree = 0;
|
||||
int slowTotal = 0;
|
||||
int slowFree = 0;
|
||||
List<ConnectorInfoVO> connectorList = pileConnectorInfoService.getUniAppConnectorList(stationId);
|
||||
for (ConnectorInfoVO connectorVO : connectorList) {
|
||||
if (StringUtils.equals(connectorVO.getChargingType(), Constants.ONE)) {
|
||||
// 快充
|
||||
fastTotal += 1;
|
||||
if (StringUtils.equals(connectorVO.getConnectorStatus(), Constants.ONE)) {
|
||||
fastFree += 1;
|
||||
}
|
||||
} else {
|
||||
// 慢充
|
||||
slowTotal += 1;
|
||||
if (StringUtils.equals(connectorVO.getConnectorStatus(), Constants.ONE)) {
|
||||
slowFree += 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
Map<String, Integer> map = new LinkedHashMap<>();
|
||||
map.put("fastTotal", fastTotal);
|
||||
map.put("fastFree", fastFree);
|
||||
map.put("slowTotal", slowTotal);
|
||||
map.put("slowFree", slowFree);
|
||||
|
||||
return map;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据站点id查询计费模板
|
||||
* @param StationId
|
||||
|
||||
Reference in New Issue
Block a user