mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-05-02 17:10:03 +08:00
update 调试联联接口
This commit is contained in:
@@ -29,4 +29,7 @@ public interface LianLianService {
|
||||
* @return
|
||||
*/
|
||||
LianLianPageResponse query_station_status(List<String> StationIDs);
|
||||
|
||||
|
||||
LianLianPageResponse query_station_stats(QueryStationInfoDTO dto);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.jsowell.thirdparty.service.impl;
|
||||
|
||||
import cn.hutool.core.util.PageUtil;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.jsowell.common.core.domain.ykc.RealTimeMonitorData;
|
||||
import com.jsowell.common.enums.ykc.PileConnectorDataBaseStatusEnum;
|
||||
@@ -26,6 +27,7 @@ import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Service
|
||||
public class LianLianServiceImpl implements LianLianService {
|
||||
@@ -72,8 +74,8 @@ public class LianLianServiceImpl implements LianLianService {
|
||||
@Override
|
||||
public LianLianPageResponse query_stations_info(QueryStationInfoDTO dto) {
|
||||
List<StationInfo> resultList = new ArrayList<>();
|
||||
int pageNo = dto.getPageNo() == 0 ? 1 : dto.getPageNo();
|
||||
int pageSize = dto.getPageSize() == 0 ? 10 : dto.getPageSize();
|
||||
int pageNo = dto.getPageNo() == null ? 1 : dto.getPageNo();
|
||||
int pageSize = dto.getPageSize() == null ? 10 : dto.getPageSize();
|
||||
|
||||
PageUtils.startPage(pageNo, pageSize);
|
||||
List<PileStationInfo> stationInfos = pileStationInfoService.getStationInfoForLianLian();
|
||||
@@ -107,10 +109,6 @@ public class LianLianServiceImpl implements LianLianService {
|
||||
stationInfo.setParkFree(Integer.valueOf(pileStationInfo.getParkFree()));
|
||||
stationInfo.setPayment(pileStationInfo.getPayment());
|
||||
stationInfo.setSupportOrder(Integer.valueOf(pileStationInfo.getSupportOrder()));
|
||||
|
||||
List<EquipmentInfo> pileList = getPileList(pileStationInfo);
|
||||
stationInfo.setEquipmentInfos(pileList); // 充电设备信息列表
|
||||
|
||||
// stationInfo.setParkFeeType(pileStationInfo); // 停车收费类型
|
||||
stationInfo.setToiletFlag(Integer.valueOf(pileStationInfo.getToiletFlag()));
|
||||
stationInfo.setStoreFlag(Integer.valueOf(pileStationInfo.getStoreFlag()));
|
||||
@@ -121,6 +119,11 @@ public class LianLianServiceImpl implements LianLianService {
|
||||
stationInfo.setBarrierFlag(Integer.valueOf(pileStationInfo.getBarrierFlag()));
|
||||
stationInfo.setParkingLockFlag(Integer.valueOf(pileStationInfo.getParkingLockFlag()));
|
||||
|
||||
List<EquipmentInfo> pileList = getPileList(pileStationInfo);
|
||||
if (CollectionUtils.isNotEmpty(pileList)) {
|
||||
stationInfo.setEquipmentInfos(pileList); // 充电设备信息列表
|
||||
}
|
||||
|
||||
resultList.add(stationInfo);
|
||||
}
|
||||
|
||||
@@ -180,9 +183,29 @@ public class LianLianServiceImpl implements LianLianService {
|
||||
|
||||
StationStatusInfos.add(stationStatusInfo);
|
||||
}
|
||||
// TODO 将 StationStatusInfos 分页
|
||||
|
||||
}
|
||||
// TODO 将 StationStatusInfos 分页
|
||||
int pageNum = 1;
|
||||
int pageSize = 10;
|
||||
List<StationStatusInfo> collect = StationStatusInfos.stream()
|
||||
.skip((pageNum - 1) * pageSize)
|
||||
.limit(pageSize)
|
||||
.collect(Collectors.toList());
|
||||
|
||||
int total = StationStatusInfos.size();
|
||||
int pages = PageUtil.totalPage(total, pageSize);
|
||||
|
||||
LianLianPageResponse response = LianLianPageResponse.builder()
|
||||
.PageCount(pages)
|
||||
.PageNo(pageNum)
|
||||
.list(collect)
|
||||
.ItemSize(total)
|
||||
.build();
|
||||
return response;
|
||||
}
|
||||
|
||||
@Override
|
||||
public LianLianPageResponse query_station_stats(QueryStationInfoDTO dto) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -212,9 +235,10 @@ public class LianLianServiceImpl implements LianLianService {
|
||||
equipmentInfo.setEquipmentStatus(50);
|
||||
equipmentInfo.setEquipmentPower(new BigDecimal(modelInfo.getRatedPower()));
|
||||
equipmentInfo.setNewNationalStandard(1);
|
||||
equipmentInfo.setVinFlag(1);
|
||||
|
||||
List<ConnectorInfo> connectorList = getConnectorList(pileBasicInfo);
|
||||
equipmentInfo.setConnectorInfos(connectorList);
|
||||
equipmentInfo.setVinFlag(1);
|
||||
|
||||
resultList.add(equipmentInfo);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user