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