mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-21 03:25:12 +08:00
新增 南瑞相关接口
This commit is contained in:
@@ -1,106 +0,0 @@
|
||||
package com.jsowell.thirdparty.nanrui.domain;
|
||||
|
||||
import com.alibaba.fastjson2.annotation.JSONField;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 订单信息
|
||||
*
|
||||
* @author Lemon
|
||||
* @Date 2023/9/25 14:33
|
||||
*/
|
||||
@Data
|
||||
public class NROrderInfo {
|
||||
/**
|
||||
* 运营商 ID
|
||||
* 统一社会信用代码
|
||||
*/
|
||||
@JSONField(name = "OperatorID")
|
||||
private String operatorId;
|
||||
|
||||
/**
|
||||
* 充电设备接口编码
|
||||
*/
|
||||
@JSONField(name = "ConnectorID")
|
||||
private String connectorId;
|
||||
|
||||
/**
|
||||
* 充电业务编号
|
||||
*/
|
||||
@JSONField(name = "StartChargeSeq")
|
||||
private String startChargeSeq;
|
||||
|
||||
/**
|
||||
* 用户发起充电类型
|
||||
* 1:充电运营商平台注册用户
|
||||
* 2:监管平台注册用户
|
||||
* 3:其他
|
||||
*/
|
||||
@JSONField(name = "UserChargeType")
|
||||
private String userChargeType;
|
||||
|
||||
/**
|
||||
* 本次充电电量
|
||||
* 单位 kWh,精度 0.001,
|
||||
* 如果不设置峰谷电价,平电量等于本次充电电量,其他分电量为零
|
||||
*/
|
||||
@JSONField(name = "Elect")
|
||||
private String elect;
|
||||
|
||||
/**
|
||||
* 尖阶段电量
|
||||
* 单位 kWh,精度 0.001
|
||||
*/
|
||||
@JSONField(name = "CuspElect")
|
||||
private String cuspElect;
|
||||
|
||||
/**
|
||||
* 峰阶段电量
|
||||
* 单位 kWh,精度 0.001
|
||||
*/
|
||||
@JSONField(name = "PeakElect")
|
||||
private String peakElect;
|
||||
|
||||
/**
|
||||
* 平阶段电量
|
||||
* 单位 kWh,精度 0.001
|
||||
*/
|
||||
@JSONField(name = "FlatElect")
|
||||
private String flatElect;
|
||||
|
||||
/**
|
||||
* 谷阶段电量
|
||||
* 单位 kWh,精度 0.001
|
||||
*/
|
||||
@JSONField(name = "ValleyElect")
|
||||
private String valleyElect;
|
||||
|
||||
/**
|
||||
* 本次充电开始时间
|
||||
* yyyy-MM-dd HH:mm:ss
|
||||
*/
|
||||
@JSONField(name = "StartTime")
|
||||
private String startTime;
|
||||
|
||||
/**
|
||||
* 本次充电结束时间
|
||||
* yyyy-MM-dd HH:mm:ss
|
||||
*
|
||||
*/
|
||||
@JSONField(name = "EndTime")
|
||||
private String endTime;
|
||||
|
||||
/**
|
||||
* 电表总起值
|
||||
* 单位 kWh,精度 0.001
|
||||
*/
|
||||
@JSONField(name = "MeterValueStart")
|
||||
private String meterValueStart;
|
||||
|
||||
/**
|
||||
* 电表总止值
|
||||
* 单位 kWh,精度 0.001
|
||||
*/
|
||||
@JSONField(name = "MeterValueEnd")
|
||||
private String meterValueEnd;
|
||||
}
|
||||
@@ -1,7 +1,10 @@
|
||||
package com.jsowell.thirdparty.nanrui.service;
|
||||
|
||||
import com.jsowell.common.core.domain.ykc.RealTimeMonitorData;
|
||||
import com.jsowell.pile.domain.nanrui.NROrderInfo;
|
||||
import com.jsowell.pile.dto.QueryOrderDTO;
|
||||
import com.jsowell.pile.dto.QueryStationInfoDTO;
|
||||
import com.jsowell.pile.dto.nanrui.NRQueryOrderDTO;
|
||||
import com.jsowell.thirdparty.nanrui.domain.NRStationStatusInfo;
|
||||
|
||||
import java.text.ParseException;
|
||||
@@ -52,8 +55,26 @@ public interface NRService {
|
||||
|
||||
/**
|
||||
* 查询设备接口状态
|
||||
* 此接口用于批量查询设备实时状态
|
||||
* 由充电运营商方实现此接口,省、市两级监管平台调用。
|
||||
* @param stationIds
|
||||
* @return
|
||||
*/
|
||||
String query_station_status(List<String> stationIds);
|
||||
Map<String, Object> query_station_status(List<String> stationIds);
|
||||
|
||||
|
||||
/**
|
||||
* 充电电量信息推送
|
||||
* 当运营商平台完成一次充电时,将充电电量信息推送至省、市两级监管平台
|
||||
* @param orderCode
|
||||
* @return
|
||||
*/
|
||||
String notification_orderInfo(String orderCode);
|
||||
|
||||
/**
|
||||
* 此接口用于批量查询时间区段内交易记录
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
List<NROrderInfo> query_order_info(NRQueryOrderDTO dto);
|
||||
}
|
||||
@@ -11,16 +11,15 @@ import com.jsowell.common.util.DateUtils;
|
||||
import com.jsowell.common.util.PageUtils;
|
||||
import com.jsowell.common.util.StringUtils;
|
||||
import com.jsowell.pile.domain.*;
|
||||
import com.jsowell.pile.domain.nanrui.NROrderInfo;
|
||||
import com.jsowell.pile.dto.QueryConnectorListDTO;
|
||||
import com.jsowell.pile.dto.QueryStationInfoDTO;
|
||||
import com.jsowell.pile.dto.nanrui.NRQueryOrderDTO;
|
||||
import com.jsowell.pile.service.*;
|
||||
import com.jsowell.pile.vo.base.ConnectorInfoVO;
|
||||
import com.jsowell.pile.vo.uniapp.CurrentTimePriceDetails;
|
||||
import com.jsowell.pile.vo.web.PileConnectorInfoVO;
|
||||
import com.jsowell.pile.vo.web.PileModelInfoVO;
|
||||
import com.jsowell.pile.vo.web.PileStationVO;
|
||||
import com.jsowell.thirdparty.lianlian.domain.ConnectorInfo;
|
||||
import com.jsowell.thirdparty.lianlian.domain.StationInfo;
|
||||
import com.jsowell.thirdparty.nanrui.domain.*;
|
||||
import com.jsowell.thirdparty.nanrui.service.NRService;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
@@ -266,7 +265,7 @@ public class NRServiceImpl implements NRService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String query_station_status(List<String> stationIds) {
|
||||
public Map<String, Object> query_station_status(List<String> stationIds) {
|
||||
List<NRStationStatusInfo> resultList = new ArrayList<>();
|
||||
|
||||
// 将 stationIdList 转换成 List<Long>
|
||||
@@ -279,7 +278,7 @@ public class NRServiceImpl implements NRService {
|
||||
.build();
|
||||
List<PileConnectorInfoVO> connectorInfoVOS = pileConnectorInfoService.getConnectorInfoListByParams(dto);
|
||||
if (CollectionUtils.isEmpty(connectorInfoVOS)) {
|
||||
return null;
|
||||
return new LinkedHashMap<>();
|
||||
}
|
||||
// 根据stationId分组
|
||||
Map<String, List<PileConnectorInfoVO>> collect = connectorInfoVOS.stream()
|
||||
@@ -327,11 +326,29 @@ public class NRServiceImpl implements NRService {
|
||||
Map<String, Object> map = new LinkedHashMap<>();
|
||||
map.put("StationStatusInfos", resultList);
|
||||
|
||||
return map;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String notification_orderInfo(String orderCode) {
|
||||
// 根据订单号查询订单信息
|
||||
NROrderInfo nrOrderInfo = orderBasicInfoService.getNROrderInfoByOrderCode(orderCode);
|
||||
// TODO 发送请求
|
||||
Map<String, Object> map = new LinkedHashMap<>();
|
||||
map.put("OrderInfo", nrOrderInfo);
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<NROrderInfo> query_order_info(NRQueryOrderDTO dto) {
|
||||
List<NROrderInfo> nrOrderInfos = orderBasicInfoService.getNROrderInfos(dto);
|
||||
if (CollectionUtils.isEmpty(nrOrderInfos)) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
return nrOrderInfos;
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
String chargingTime = "30";
|
||||
Date beginTime = DateUtils.addMinute(new Date(), -Integer.parseInt(chargingTime));
|
||||
|
||||
Reference in New Issue
Block a user