mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-20 19:15:35 +08:00
update 联联平台 查询充电站信息接口
This commit is contained in:
19
jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/controller/LianLianController.java
vendored
Normal file
19
jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/controller/LianLianController.java
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
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 {
|
||||
|
||||
}
|
||||
@@ -19,12 +19,12 @@ public class ConnectorInfo {
|
||||
* 充电设备接口编码 Y
|
||||
* 充电设备接口编码,同一对接平台内唯一
|
||||
*/
|
||||
private String PileConnectorCode;
|
||||
private String ConnectorID;
|
||||
|
||||
/**
|
||||
* 充电设备接口名称 N
|
||||
*/
|
||||
private String connectorName;
|
||||
private String ConnectorName;
|
||||
|
||||
/**
|
||||
* 充电设备接口类型 Y
|
||||
@@ -33,32 +33,32 @@ public class ConnectorInfo {
|
||||
* 3:交流接口插头(带枪线,模式3,连接方式C)
|
||||
* 4:直流接口枪头(带枪线,模式4)
|
||||
*/
|
||||
private Integer connectorType;
|
||||
private Integer ConnectorType;
|
||||
|
||||
/**
|
||||
* 额定电压上限(单位:V) Y
|
||||
*/
|
||||
private Integer ratedVoltageMax;
|
||||
private Integer VoltageUpperLimits;
|
||||
|
||||
/**
|
||||
* 额定电压下限(单位:V) Y
|
||||
*/
|
||||
private Integer ratedVoltageMin;
|
||||
private Integer VoltageLowerLimits;
|
||||
|
||||
/**
|
||||
* 额定电流(单位:A) Y
|
||||
*/
|
||||
private Integer ratedCurrent;
|
||||
private Integer Current;
|
||||
|
||||
/**
|
||||
* 额定功率(单位:kW) Y
|
||||
*/
|
||||
private BigDecimal ratedPower;
|
||||
private BigDecimal Power;
|
||||
|
||||
/**
|
||||
* 车位号 N
|
||||
* 停车场车位编号
|
||||
*/
|
||||
private String parkingCode;
|
||||
private String ParkNo;
|
||||
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.jsowell.thirdparty.service;
|
||||
|
||||
import com.jsowell.thirdparty.domain.StationInfo;
|
||||
import com.jsowell.thirdparty.dto.QueryStationInfoDTO;
|
||||
import com.jsowell.thirdparty.vo.LianLianPageResponse;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -13,5 +14,5 @@ public interface LianLianService {
|
||||
*/
|
||||
void pushMerchantInfo(Long merchantId);
|
||||
|
||||
List<StationInfo> query_stations_info(QueryStationInfoDTO dto);
|
||||
LianLianPageResponse query_stations_info(QueryStationInfoDTO dto);
|
||||
}
|
||||
|
||||
@@ -1,19 +1,22 @@
|
||||
package com.jsowell.thirdparty.service.impl;
|
||||
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.jsowell.common.util.DateUtils;
|
||||
import com.jsowell.common.util.PageUtils;
|
||||
import com.jsowell.common.util.StringUtils;
|
||||
import com.jsowell.pile.domain.PileBasicInfo;
|
||||
import com.jsowell.pile.domain.PileConnectorInfo;
|
||||
import com.jsowell.pile.domain.PileStationInfo;
|
||||
import com.jsowell.pile.service.*;
|
||||
import com.jsowell.pile.vo.base.MerchantInfoVO;
|
||||
import com.jsowell.pile.vo.web.PileModelInfoVO;
|
||||
import com.jsowell.thirdparty.domain.ConnectorInfo;
|
||||
import com.jsowell.thirdparty.domain.EquipmentInfo;
|
||||
import com.jsowell.thirdparty.domain.OperatorInfo;
|
||||
import com.jsowell.thirdparty.domain.StationInfo;
|
||||
import com.jsowell.thirdparty.dto.QueryStationInfoDTO;
|
||||
import com.jsowell.thirdparty.service.LianLianService;
|
||||
import com.jsowell.thirdparty.vo.LianLianPageResponse;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -21,7 +24,6 @@ import org.springframework.stereotype.Service;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Service
|
||||
public class LianLianServiceImpl implements LianLianService {
|
||||
@@ -63,7 +65,7 @@ public class LianLianServiceImpl implements LianLianService {
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<StationInfo> query_stations_info(QueryStationInfoDTO dto) {
|
||||
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();
|
||||
@@ -117,7 +119,13 @@ public class LianLianServiceImpl implements LianLianService {
|
||||
resultList.add(stationInfo);
|
||||
}
|
||||
|
||||
return resultList;
|
||||
LianLianPageResponse pageResponse = LianLianPageResponse.builder()
|
||||
.PageNo(pageInfo.getPageNum())
|
||||
.PageCount(pageInfo.getPages())
|
||||
.ItemSize(resultList.size())
|
||||
.list(resultList)
|
||||
.build();
|
||||
return pageResponse;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -146,11 +154,42 @@ public class LianLianServiceImpl implements LianLianService {
|
||||
equipmentInfo.setEquipmentStatus(50);
|
||||
equipmentInfo.setEquipmentPower(new BigDecimal(modelInfo.getRatedPower()));
|
||||
equipmentInfo.setNewNationalStandard(1);
|
||||
// equipmentInfo.setConnectorInfos();
|
||||
List<ConnectorInfo> connectorList = getConnectorList(pileBasicInfo);
|
||||
equipmentInfo.setConnectorInfos(connectorList);
|
||||
equipmentInfo.setVinFlag(1);
|
||||
|
||||
resultList.add(equipmentInfo);
|
||||
}
|
||||
return resultList;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取枪口列表
|
||||
* @param pileBasicInfo
|
||||
* @return
|
||||
*/
|
||||
private List<ConnectorInfo> getConnectorList(PileBasicInfo pileBasicInfo){
|
||||
List<ConnectorInfo> resultList = new ArrayList<>();
|
||||
|
||||
List<PileConnectorInfo> list = pileConnectorInfoService.selectPileConnectorInfoList(pileBasicInfo.getSn());
|
||||
for (PileConnectorInfo pileConnectorInfo : list) {
|
||||
ConnectorInfo connectorInfo = new ConnectorInfo();
|
||||
|
||||
connectorInfo.setConnectorID(pileConnectorInfo.getPileConnectorCode());
|
||||
String pileSn = pileConnectorInfo.getPileSn();
|
||||
PileModelInfoVO modelInfo = pileModelInfoService.getPileModelInfoByPileSn(pileSn);
|
||||
int connectorType = StringUtils.equals("1", modelInfo.getSpeedType()) ? 4 : 3;
|
||||
|
||||
connectorInfo.setConnectorType(connectorType);
|
||||
connectorInfo.setVoltageUpperLimits(Integer.valueOf(modelInfo.getRatedVoltage()));
|
||||
connectorInfo.setVoltageLowerLimits(Integer.valueOf(modelInfo.getRatedVoltage()));
|
||||
connectorInfo.setCurrent(Integer.valueOf(modelInfo.getRatedCurrent()));
|
||||
connectorInfo.setPower(new BigDecimal(modelInfo.getRatedPower()));
|
||||
|
||||
resultList.add(connectorInfo);
|
||||
}
|
||||
|
||||
return resultList;
|
||||
}
|
||||
}
|
||||
|
||||
43
jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/vo/LianLianPageResponse.java
vendored
Normal file
43
jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/vo/LianLianPageResponse.java
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
package com.jsowell.thirdparty.vo;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 联联平台分页反参
|
||||
*
|
||||
* @author JS-ZZA
|
||||
* @date 2023/4/10 15:24
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Builder
|
||||
public class LianLianPageResponse implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -8425633122529553009L;
|
||||
/**
|
||||
* 当前页数
|
||||
*/
|
||||
private int PageNo;
|
||||
|
||||
/**
|
||||
* 页码总数
|
||||
*/
|
||||
private int PageCount;
|
||||
|
||||
/**
|
||||
* 总记录条数
|
||||
*/
|
||||
private int ItemSize;
|
||||
|
||||
/**
|
||||
* 数据集合
|
||||
*/
|
||||
private List<?> list;
|
||||
}
|
||||
Reference in New Issue
Block a user