mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-21 11:35:12 +08:00
update 调试联联接口
This commit is contained in:
@@ -1,19 +0,0 @@
|
||||
package com.jsowell.thirdparty.controller;
|
||||
|
||||
import com.jsowell.common.annotation.Anonymous;
|
||||
import com.jsowell.common.core.controller.BaseController;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* 对接联联平台controller
|
||||
*
|
||||
* @author JS-ZZA
|
||||
* @date 2023/4/10 14:58
|
||||
*/
|
||||
@Anonymous
|
||||
@RestController
|
||||
@RequestMapping("/LianLian")
|
||||
public class LianLianController extends BaseController {
|
||||
|
||||
}
|
||||
@@ -1,6 +1,11 @@
|
||||
package com.jsowell.thirdparty.dto;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 查询站点信息dto
|
||||
@@ -9,6 +14,9 @@ import lombok.Data;
|
||||
* @date 2023/4/8 10:02
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
public class QueryStationInfoDTO {
|
||||
/**
|
||||
* 上次查询时间
|
||||
@@ -28,4 +36,22 @@ public class QueryStationInfoDTO {
|
||||
* 不填写默认为 10
|
||||
*/
|
||||
private Integer PageSize;
|
||||
|
||||
|
||||
/**
|
||||
* 充电站 ID
|
||||
*/
|
||||
private String StationID;
|
||||
|
||||
/**
|
||||
* 统计开始时间
|
||||
* 格式“yyyy-MM-dd”
|
||||
*/
|
||||
private String StartTime;
|
||||
|
||||
/**
|
||||
* 统计结束时间
|
||||
* 格式“yyyy-MM-dd”
|
||||
*/
|
||||
private String EndTime;
|
||||
}
|
||||
|
||||
@@ -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