mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-21 11:35:12 +08:00
南瑞平台 controller类 并测试
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package com.jsowell.thirdparty.nanrui.domain;
|
||||
|
||||
import com.alibaba.fastjson2.annotation.JSONField;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
@@ -20,27 +21,27 @@ public class NRAlarmInfo {
|
||||
/**
|
||||
* 枪口编号
|
||||
*/
|
||||
@JSONField(name = "ConnectorID")
|
||||
@JsonProperty(value = "ConnectorID")
|
||||
private String connectorId;
|
||||
|
||||
/**
|
||||
* 告警时间
|
||||
* 格 式 为 yyyy-MM-dd HH:mm:ss
|
||||
*/
|
||||
@JSONField(name = "Alert_time")
|
||||
@JsonProperty(value = "Alert_time")
|
||||
private String alertTime;
|
||||
|
||||
/**
|
||||
* 告警代码
|
||||
*/
|
||||
@JSONField(name = "Alert_code")
|
||||
@JsonProperty(value = "Alert_code")
|
||||
private Integer alertCode;
|
||||
|
||||
/**
|
||||
* 描述
|
||||
* 文字描述,最大长度 256 字符
|
||||
*/
|
||||
@JSONField(name = "Describe")
|
||||
@JsonProperty(value = "Describe")
|
||||
private String describe;
|
||||
|
||||
/**
|
||||
@@ -48,6 +49,6 @@ public class NRAlarmInfo {
|
||||
* 告警发生:0;告警恢复:1
|
||||
* 默认为 0
|
||||
*/
|
||||
@JSONField(name = "Status")
|
||||
@JsonProperty(value = "Status")
|
||||
private Integer status;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.jsowell.thirdparty.nanrui.domain;
|
||||
|
||||
import com.alibaba.fastjson2.annotation.JSONField;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
@@ -22,13 +23,13 @@ public class NRConnectorInfo {
|
||||
/**
|
||||
* 充电设备接口编码
|
||||
*/
|
||||
@JSONField(name = "ConnectorID")
|
||||
@JsonProperty(value = "ConnectorID")
|
||||
private String connectorId;
|
||||
|
||||
/**
|
||||
* 充电设备接口名称
|
||||
*/
|
||||
@JSONField(name = "ConnectorName")
|
||||
@JsonProperty(value = "ConnectorName")
|
||||
private String connectorName;
|
||||
|
||||
/**
|
||||
@@ -39,35 +40,35 @@ public class NRConnectorInfo {
|
||||
* 4:直流接口枪头(带枪线,模式 4)
|
||||
* 5:无线充电座;
|
||||
*/
|
||||
@JSONField(name = "ConnectorType")
|
||||
@JsonProperty(value = "ConnectorType")
|
||||
private Integer connectorType;
|
||||
|
||||
/**
|
||||
* 额定电压上限
|
||||
* 单位:V
|
||||
*/
|
||||
@JSONField(name = "VoltageUpperLimits")
|
||||
@JsonProperty(value = "VoltageUpperLimits")
|
||||
private Integer voltageUpperLimits;
|
||||
|
||||
/**
|
||||
* 额定电压下限
|
||||
* 单位:V
|
||||
*/
|
||||
@JSONField(name = "VoltageLowerLimits")
|
||||
@JsonProperty(value = "VoltageLowerLimits")
|
||||
private Integer voltageLowerLimits;
|
||||
|
||||
/**
|
||||
* 额定电流
|
||||
* 单位:A
|
||||
*/
|
||||
@JSONField(name = "Current")
|
||||
@JsonProperty(value = "Current")
|
||||
private Integer current;
|
||||
|
||||
/**
|
||||
* 额定功率
|
||||
* 单位:kW
|
||||
*/
|
||||
@JSONField(name = "Power")
|
||||
@JsonProperty(value = "Power")
|
||||
private BigDecimal power;
|
||||
|
||||
/**
|
||||
@@ -75,6 +76,6 @@ public class NRConnectorInfo {
|
||||
* 1:2011
|
||||
* 2:2015
|
||||
*/
|
||||
@JSONField(name = "NationalStandard")
|
||||
@JsonProperty(value = "NationalStandard")
|
||||
private Integer nationalStandard;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.jsowell.thirdparty.nanrui.domain;
|
||||
|
||||
import com.alibaba.fastjson2.annotation.JSONField;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
@@ -23,25 +24,25 @@ public class NRConnectorStatusInfo {
|
||||
/**
|
||||
* 充电设备接口编码
|
||||
*/
|
||||
@JSONField(name = "ConnectorID")
|
||||
@JsonProperty(value = "ConnectorID")
|
||||
private String connectorID;
|
||||
|
||||
/**
|
||||
* 充电设备接口状态
|
||||
*/
|
||||
@JSONField(name = "Status")
|
||||
@JsonProperty(value = "Status")
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* A 相电流
|
||||
*/
|
||||
@JSONField(name = "CurrentA")
|
||||
@JsonProperty(value = "CurrentA")
|
||||
private Integer currentA;
|
||||
|
||||
/**
|
||||
* A 相电压
|
||||
*/
|
||||
@JSONField(name = "VoltageA")
|
||||
@JsonProperty(value = "VoltageA")
|
||||
private Integer voltageA;
|
||||
|
||||
/**
|
||||
@@ -51,14 +52,14 @@ public class NRConnectorStatusInfo {
|
||||
* 默认:0
|
||||
* 交流充电桩采集不到SOC 值的填 0
|
||||
*/
|
||||
@JSONField(name = "SOC")
|
||||
@JsonProperty(value = "SOC")
|
||||
private BigDecimal soc;
|
||||
|
||||
/**
|
||||
* 开始充电时间
|
||||
* 格 式 为 yyyy-MM-dd HH:mm:ss
|
||||
*/
|
||||
@JSONField(name = "Begin_time")
|
||||
@JsonProperty(value = "Begin_time")
|
||||
private String beginTime;
|
||||
|
||||
/**
|
||||
@@ -67,13 +68,13 @@ public class NRConnectorStatusInfo {
|
||||
*
|
||||
* 单位:kWh
|
||||
*/
|
||||
@JSONField(name = "Current_kwh")
|
||||
@JsonProperty(value = "Current_kwh")
|
||||
private BigDecimal currentKwh;
|
||||
|
||||
/**
|
||||
* 时间戳
|
||||
* 数据生成时间(秒级时间戳)
|
||||
*/
|
||||
@JSONField(name = "Time_stamp")
|
||||
@JsonProperty(value = "Time_stamp")
|
||||
private Integer timeStamp;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.jsowell.thirdparty.nanrui.domain;
|
||||
|
||||
import com.alibaba.fastjson2.annotation.JSONField;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
@@ -24,20 +25,20 @@ public class NREquipmentInfo {
|
||||
* 设备编码
|
||||
* 设备唯一编码,对同一运营商,保证唯一
|
||||
*/
|
||||
@JSONField(name = "EquipmentID")
|
||||
@JsonProperty(value = "EquipmentID")
|
||||
private String equipmentID;
|
||||
|
||||
/**
|
||||
* 设备名称
|
||||
*/
|
||||
@JSONField(name = "EquipmentName")
|
||||
@JsonProperty(value = "EquipmentName")
|
||||
private String equipmentName;
|
||||
|
||||
/**
|
||||
* 充电桩投运日期
|
||||
* yyyy-MM-dd 格式
|
||||
*/
|
||||
@JSONField(name = "OpenForBusinessDate")
|
||||
@JsonProperty(value = "OpenForBusinessDate")
|
||||
private String openForBusinessDate;
|
||||
|
||||
/**
|
||||
@@ -46,7 +47,7 @@ public class NREquipmentInfo {
|
||||
* 2:交流设备
|
||||
* 3:交直流一体设备
|
||||
*/
|
||||
@JSONField(name = "EquipmentType")
|
||||
@JsonProperty(value = "EquipmentType")
|
||||
private Integer equipmentType;
|
||||
|
||||
/**
|
||||
@@ -57,19 +58,19 @@ public class NREquipmentInfo {
|
||||
* 6:维护中
|
||||
* 50:正常使用
|
||||
*/
|
||||
@JSONField(name = "EquipmentStatus")
|
||||
@JsonProperty(value = "EquipmentStatus")
|
||||
private Integer equipmentStatus;
|
||||
|
||||
/**
|
||||
* 额定功率
|
||||
* 单位:kW
|
||||
*/
|
||||
@JSONField(name = "Power")
|
||||
@JsonProperty(value = "Power")
|
||||
private BigDecimal power;
|
||||
|
||||
/**
|
||||
* 充电设备接口列表
|
||||
*/
|
||||
@JSONField(name = "ConnectorInfos")
|
||||
@JsonProperty(value = "ConnectorInfos")
|
||||
private List<NRConnectorInfo> connectorInfos;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.jsowell.thirdparty.nanrui.domain;
|
||||
|
||||
import com.alibaba.fastjson2.annotation.JSONField;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
@@ -24,52 +25,52 @@ public class NRStationInfo {
|
||||
* 充电站id
|
||||
* 运营商自定义的唯一编码
|
||||
*/
|
||||
@JSONField(name = "StationID")
|
||||
@JsonProperty(value = "StationID")
|
||||
private String stationId;
|
||||
|
||||
/**
|
||||
* 运营商id
|
||||
* 统一社会信用代码
|
||||
*/
|
||||
@JSONField(name = "OperatorID")
|
||||
@JsonProperty(value = "OperatorID")
|
||||
private String operatorID;
|
||||
|
||||
/**
|
||||
* 设备所属方ID
|
||||
* 设备所属方组织机构代码
|
||||
*/
|
||||
@JSONField(name = "EquipmentOwnerID")
|
||||
@JsonProperty(value = "EquipmentOwnerID")
|
||||
private String equipmentOwnerID;
|
||||
|
||||
/**
|
||||
* 充电站名称
|
||||
*/
|
||||
@JSONField(name = "StationName")
|
||||
@JsonProperty(value = "StationName")
|
||||
private String stationName;
|
||||
|
||||
/**
|
||||
* 充电站国家代码
|
||||
* 比如 CN
|
||||
*/
|
||||
@JSONField(name = "CountryCode")
|
||||
@JsonProperty(value = "CountryCode")
|
||||
private String countryCode;
|
||||
|
||||
/**
|
||||
* 充电站省市辖区编码
|
||||
*/
|
||||
@JSONField(name = "AreaCode")
|
||||
@JsonProperty(value = "AreaCode")
|
||||
private String areaCode;
|
||||
|
||||
/**
|
||||
* 详细地址
|
||||
*/
|
||||
@JSONField(name = "Address")
|
||||
@JsonProperty(value = "Address")
|
||||
private String address;
|
||||
|
||||
/**
|
||||
* 服务电话
|
||||
*/
|
||||
@JSONField(name = "ServiceTel")
|
||||
@JsonProperty(value = "ServiceTel")
|
||||
private String serviceTel;
|
||||
|
||||
/**
|
||||
@@ -79,7 +80,7 @@ public class NRStationInfo {
|
||||
* 3:居民充电区
|
||||
* 255:其他
|
||||
*/
|
||||
@JSONField(name = "StationType")
|
||||
@JsonProperty(value = "StationType")
|
||||
private Integer stationType;
|
||||
|
||||
/**
|
||||
@@ -90,7 +91,7 @@ public class NRStationInfo {
|
||||
* 6:维护中
|
||||
* 50:正常使用
|
||||
*/
|
||||
@JSONField(name = "StationStatus")
|
||||
@JsonProperty(value = "StationStatus")
|
||||
private Integer stationStatus;
|
||||
|
||||
/**
|
||||
@@ -99,19 +100,19 @@ public class NRStationInfo {
|
||||
* 默认:0 未知
|
||||
*
|
||||
*/
|
||||
@JSONField(name = "ParkNums")
|
||||
@JsonProperty(value = "ParkNums")
|
||||
private Integer parkNums;
|
||||
|
||||
/**
|
||||
* 经度
|
||||
*/
|
||||
@JSONField(name = "StationLng")
|
||||
@JsonProperty(value = "StationLng")
|
||||
private BigDecimal stationLng;
|
||||
|
||||
/**
|
||||
* 纬度
|
||||
*/
|
||||
@JSONField(name = "StationLat")
|
||||
@JsonProperty(value = "StationLat")
|
||||
private BigDecimal stationLat;
|
||||
|
||||
/**
|
||||
@@ -133,21 +134,21 @@ public class NRStationInfo {
|
||||
* 301:居民(小)区
|
||||
* 255:其他
|
||||
*/
|
||||
@JSONField(name = "Construction")
|
||||
@JsonProperty(value = "Construction")
|
||||
private Integer construction;
|
||||
|
||||
/**
|
||||
* 站点照片
|
||||
* 充电设备照片、充电车位照片、停车场入口照片
|
||||
*/
|
||||
@JSONField(name = "Pictures")
|
||||
@JsonProperty(value = "Pictures")
|
||||
private List<String> pictures;
|
||||
|
||||
/**
|
||||
* 站点投运日期
|
||||
* yyyy-MM-dd 格式
|
||||
*/
|
||||
@JSONField(name = "OpenForBusinessDate")
|
||||
@JsonProperty(value = "OpenForBusinessDate")
|
||||
private String openForBusinessDate;
|
||||
|
||||
/**
|
||||
@@ -155,24 +156,24 @@ public class NRStationInfo {
|
||||
* 0:否
|
||||
* 1:是
|
||||
*/
|
||||
@JSONField(name = "OpenAllDay")
|
||||
@JsonProperty(value = "OpenAllDay")
|
||||
private Integer openAllDay;
|
||||
|
||||
/**
|
||||
* 营业时间
|
||||
*/
|
||||
@JSONField(name = "BusineHours")
|
||||
@JsonProperty(value = "BusineHours")
|
||||
private String busineHours;
|
||||
|
||||
/**
|
||||
* 最低单价
|
||||
*/
|
||||
@JSONField(name = "MinElectricityPrice")
|
||||
@JsonProperty(value = "MinElectricityPrice")
|
||||
private BigDecimal minElectricityPrice;
|
||||
|
||||
/**
|
||||
* 充电设备信息
|
||||
*/
|
||||
@JSONField(name = "EquipmentInfos")
|
||||
@JsonProperty(value = "EquipmentInfos")
|
||||
private List<NREquipmentInfo> equipmentInfos;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.jsowell.thirdparty.nanrui.domain;
|
||||
|
||||
import com.alibaba.fastjson2.annotation.JSONField;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
@@ -20,9 +21,9 @@ import java.util.List;
|
||||
@Builder
|
||||
public class NRStationStatusInfo {
|
||||
|
||||
@JSONField(name = "StationID")
|
||||
@JsonProperty(value = "StationID")
|
||||
private String stationId;
|
||||
|
||||
@JSONField(name = "ConnectorStatusInfos")
|
||||
@JsonProperty(value = "ConnectorStatusInfos")
|
||||
private List<NRConnectorStatusInfo> connectorStatusInfos;
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ public interface NRService {
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
Map<String, String> query_stations_info(QueryStationInfoDTO dto);
|
||||
Map<String, Object> query_stations_info(QueryStationInfoDTO dto);
|
||||
|
||||
/**
|
||||
* 推送告警信息
|
||||
|
||||
@@ -24,6 +24,7 @@ import com.jsowell.thirdparty.nanrui.domain.*;
|
||||
import com.jsowell.thirdparty.nanrui.service.NRService;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.text.ParseException;
|
||||
@@ -36,6 +37,7 @@ import java.util.stream.Collectors;
|
||||
* @author Lemon
|
||||
* @Date 2023/9/26 9:20
|
||||
*/
|
||||
@Service
|
||||
public class NRServiceImpl implements NRService {
|
||||
|
||||
@Autowired
|
||||
@@ -84,7 +86,7 @@ public class NRServiceImpl implements NRService {
|
||||
.parkNums(0)
|
||||
.stationLng(new BigDecimal(stationInfoVO.getStationLng()).setScale(6, BigDecimal.ROUND_HALF_UP))
|
||||
.stationLat(new BigDecimal(stationInfoVO.getStationLat()).setScale(6, BigDecimal.ROUND_HALF_UP))
|
||||
.openForBusinessDate(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD, DateUtils.parseDate(stationInfoVO.getCreateTime())))
|
||||
.openForBusinessDate(stationInfoVO.getCreateTime())
|
||||
.openAllDay(Integer.parseInt(stationInfoVO.getOpenAllDay()))
|
||||
.busineHours(stationInfoVO.getBusinessHours())
|
||||
.minElectricityPrice(stationInfoVO.getElectricityPrice().add(stationInfoVO.getServicePrice()))
|
||||
@@ -110,7 +112,7 @@ public class NRServiceImpl implements NRService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, String> query_stations_info(QueryStationInfoDTO dto) {
|
||||
public Map<String, Object> query_stations_info(QueryStationInfoDTO dto) {
|
||||
List<NRStationInfo> resultList = new ArrayList<>();
|
||||
int pageNo = dto.getPageNo() == null ? 1 : dto.getPageNo();
|
||||
int pageSize = dto.getPageSize() == null ? 10 : dto.getPageSize();
|
||||
@@ -142,7 +144,7 @@ public class NRServiceImpl implements NRService {
|
||||
.parkNums(0)
|
||||
.stationLng(new BigDecimal(pileStationInfo.getStationLng()).setScale(6, BigDecimal.ROUND_HALF_UP))
|
||||
.stationLat(new BigDecimal(pileStationInfo.getStationLat()).setScale(6, BigDecimal.ROUND_HALF_UP))
|
||||
.openForBusinessDate(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD, DateUtils.parseDate(pileStationInfo.getCreateTime())))
|
||||
.openForBusinessDate(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD, pileStationInfo.getCreateTime()))
|
||||
.openAllDay(Integer.parseInt(pileStationInfo.getOpenAllDay()))
|
||||
.busineHours(pileStationInfo.getBusinessHours())
|
||||
.build();
|
||||
@@ -186,9 +188,7 @@ public class NRServiceImpl implements NRService {
|
||||
map.put("ItemSize", resultList.size());
|
||||
map.put("StationInfos", resultList);
|
||||
|
||||
// TODO 发送数据
|
||||
|
||||
return null;
|
||||
return map;
|
||||
}
|
||||
|
||||
|
||||
@@ -346,6 +346,13 @@ public class NRServiceImpl implements NRService {
|
||||
if (CollectionUtils.isEmpty(nrOrderInfos)) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
// 将组织机构代码只取后9位数
|
||||
for (NROrderInfo nrOrderInfo : nrOrderInfos) {
|
||||
String operatorId = nrOrderInfo.getOperatorId();
|
||||
if (StringUtils.isNotBlank(operatorId)) {
|
||||
nrOrderInfo.setOperatorId(StringUtils.substring(operatorId, operatorId.length() - 9));
|
||||
}
|
||||
}
|
||||
return nrOrderInfos;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user