mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-27 06:25:13 +08:00
update 南瑞平台相关接口
This commit is contained in:
@@ -2,11 +2,15 @@ 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.PushStationInfoDTO;
|
||||
import com.jsowell.pile.dto.QueryOrderDTO;
|
||||
import com.jsowell.pile.dto.QueryStationInfoDTO;
|
||||
import com.jsowell.pile.dto.nanrui.NRQueryOrderDTO;
|
||||
import com.jsowell.pile.dto.nanrui.PushAlarmInfoDTO;
|
||||
import com.jsowell.thirdparty.lianlian.dto.CommonParamsDTO;
|
||||
import com.jsowell.thirdparty.nanrui.domain.NRStationStatusInfo;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.text.ParseException;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -19,13 +23,35 @@ import java.util.Map;
|
||||
*/
|
||||
public interface NRService {
|
||||
|
||||
/**
|
||||
* 从南瑞平台获取令牌
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
public String getToken(String urlAddress, String operatorId, String operatorSecret,
|
||||
String dataSecretIv, String signSecret, String dataSecret);
|
||||
|
||||
/**
|
||||
* 生成令牌
|
||||
* @param dto
|
||||
* @return
|
||||
* @throws UnsupportedEncodingException
|
||||
*/
|
||||
Map<String, String> generateToken(CommonParamsDTO dto) throws UnsupportedEncodingException;
|
||||
|
||||
/**
|
||||
* 校验签名
|
||||
* @param dto
|
||||
*/
|
||||
Map<String, String> checkoutSign(CommonParamsDTO dto);
|
||||
|
||||
/**
|
||||
* 推送充电站信息
|
||||
* @param stationId
|
||||
* @param dto
|
||||
* @return
|
||||
* @throws ParseException
|
||||
*/
|
||||
public String notification_stationInfo(String stationId) throws ParseException;
|
||||
public String pushStationInfo(PushStationInfoDTO dto) throws ParseException;
|
||||
|
||||
|
||||
/**
|
||||
@@ -38,11 +64,10 @@ public interface NRService {
|
||||
/**
|
||||
* 推送告警信息
|
||||
* 当充电接口发生异常告警或故障时,运营商企业平台应立即主动推送信息到省、市两级监管平台
|
||||
* @param pileConnectorCode
|
||||
* @param connectorStatus
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
String notification_alarmInfo(String pileConnectorCode, String connectorStatus);
|
||||
String pushAlarmInfo(PushAlarmInfoDTO dto);
|
||||
|
||||
|
||||
/**
|
||||
@@ -50,7 +75,7 @@ public interface NRService {
|
||||
* 当充电枪由 闲置 转为 充电 等状态发生变化时,运营商平台应立即推送当前状态到省、市两级监管平台。
|
||||
* 充电过程中运营商平台应 每分钟 上报充电包含电流、电压在内的监测数据。
|
||||
*/
|
||||
String notification_stationStatus(RealTimeMonitorData realTimeMonitorData);
|
||||
String pushPileStatus(RealTimeMonitorData realTimeMonitorData);
|
||||
|
||||
|
||||
/**
|
||||
@@ -69,7 +94,7 @@ public interface NRService {
|
||||
* @param orderCode
|
||||
* @return
|
||||
*/
|
||||
String notification_orderInfo(String orderCode);
|
||||
String pushOrderInfo(String orderCode);
|
||||
|
||||
/**
|
||||
* 查询充电电量信息
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
package com.jsowell.thirdparty.nanrui.service.impl;
|
||||
|
||||
import cn.hutool.http.HttpUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.jsowell.common.constant.CacheConstants;
|
||||
@@ -12,23 +16,37 @@ 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.PushStationInfoDTO;
|
||||
import com.jsowell.pile.dto.QueryConnectorListDTO;
|
||||
import com.jsowell.pile.dto.QueryStationInfoDTO;
|
||||
import com.jsowell.pile.dto.nanrui.NRQueryOrderDTO;
|
||||
import com.jsowell.pile.dto.nanrui.PushAlarmInfoDTO;
|
||||
import com.jsowell.pile.service.*;
|
||||
import com.jsowell.pile.vo.base.ThirdPartyStationRelationVO;
|
||||
import com.jsowell.pile.vo.nanrui.NROrderInfoVO;
|
||||
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.dto.CommonParamsDTO;
|
||||
import com.jsowell.thirdparty.lianlian.service.LianLianService;
|
||||
import com.jsowell.thirdparty.lianlian.util.Cryptos;
|
||||
import com.jsowell.thirdparty.lianlian.util.Encodes;
|
||||
import com.jsowell.thirdparty.lianlian.util.GBSignUtils;
|
||||
import com.jsowell.thirdparty.lianlian.util.HttpRequestUtil;
|
||||
import com.jsowell.thirdparty.lianlian.vo.LianLianResultVO;
|
||||
import com.jsowell.thirdparty.nanrui.domain.*;
|
||||
import com.jsowell.thirdparty.nanrui.service.NRService;
|
||||
import com.jsowell.thirdparty.nanrui.util.QEncodeUtil;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigDecimal;
|
||||
import java.text.ParseException;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
@@ -58,20 +76,73 @@ public class NRServiceImpl implements NRService {
|
||||
@Autowired
|
||||
private IOrderBasicInfoService orderBasicInfoService;
|
||||
|
||||
@Autowired
|
||||
private IThirdPartyStationRelationService thirdPartyStationRelationService;
|
||||
|
||||
@Autowired
|
||||
private LianLianService lianLianService;
|
||||
|
||||
@Autowired
|
||||
private RedisCache redisCache;
|
||||
|
||||
|
||||
/**
|
||||
* 充电站信息变化推送
|
||||
* @param stationId
|
||||
* 从南瑞平台获取令牌
|
||||
* @param urlAddress
|
||||
* @param operatorId
|
||||
* @param operatorSecret
|
||||
* @param dataSecretIv
|
||||
* @param signSecret
|
||||
* @param dataSecret
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public String notification_stationInfo(String stationId) throws ParseException {
|
||||
PileStationVO stationInfoVO = pileStationInfoService.getStationInfo(stationId);
|
||||
public String getToken(String urlAddress, String operatorId, String operatorSecret,
|
||||
String dataSecretIv, String signSecret, String dataSecret) {
|
||||
return lianLianService.getToken(urlAddress, operatorId, operatorSecret,
|
||||
dataSecretIv, signSecret, dataSecret);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, String> generateToken(CommonParamsDTO dto) throws UnsupportedEncodingException {
|
||||
return lianLianService.generateToken(dto);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, String> checkoutSign(CommonParamsDTO dto) {
|
||||
return lianLianService.checkoutSign(dto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 推送充电站信息
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public String pushStationInfo(PushStationInfoDTO dto) throws ParseException {
|
||||
PileStationVO stationInfoVO = pileStationInfoService.getStationInfo(String.valueOf(dto.getStationId()));
|
||||
if (stationInfoVO == null) {
|
||||
return null;
|
||||
}
|
||||
// 通过站点id查询相关配置信息
|
||||
ThirdPartyStationRelation relation = new ThirdPartyStationRelation();
|
||||
relation.setStationId(dto.getStationId());
|
||||
ThirdPartyStationRelationVO relationInfo = thirdPartyStationRelationService.selectRelationInfo(relation);
|
||||
// ThirdPartySettingInfo settingInfo = thirdPartySettingInfoService.getInfoByStationId(dto.getStationId());
|
||||
if (relationInfo == null) {
|
||||
// 新增
|
||||
relation.setThirdPartyType(dto.getThirdPartyType());
|
||||
thirdPartyStationRelationService.insertThirdPartyStationRelation(relation);
|
||||
|
||||
relationInfo = thirdPartyStationRelationService.selectRelationInfo(relation);
|
||||
}
|
||||
String operatorId = relationInfo.getOperatorId();
|
||||
String operatorSecret = relationInfo.getOperatorSecret();
|
||||
String signSecret = relationInfo.getSignSecret();
|
||||
String dataSecret = relationInfo.getDataSecret();
|
||||
String dataSecretIv = relationInfo.getDataSecretIv();
|
||||
String urlAddress = relationInfo.getUrlAddress();
|
||||
|
||||
// 拼装南瑞平台所需参数
|
||||
NRStationInfo nrStationInfo = NRStationInfo.builder()
|
||||
.stationId("NR" + stationInfoVO.getId())
|
||||
@@ -103,25 +174,39 @@ public class NRServiceImpl implements NRService {
|
||||
nrStationInfo.setStationType(Integer.parseInt(stationType));
|
||||
nrStationInfo.setConstruction(255);
|
||||
|
||||
List<NREquipmentInfo> nrEquipmentInfos = getEquipmentInfo(stationId);
|
||||
List<NREquipmentInfo> nrEquipmentInfos = getEquipmentInfo(String.valueOf(dto.getStationId()));
|
||||
nrStationInfo.setEquipmentInfos(nrEquipmentInfos);
|
||||
|
||||
// TODO 推送到平台
|
||||
// 推送到平台
|
||||
String url = urlAddress + "notification_stationInfo";
|
||||
|
||||
return null;
|
||||
String jsonStr = JSONObject.toJSONString(nrStationInfo);
|
||||
JSONObject data = new JSONObject();
|
||||
data.put("StationInfo", jsonStr);
|
||||
|
||||
String jsonString = JSONObject.toJSONString(data);
|
||||
System.out.println("jsonString : " + jsonString);
|
||||
|
||||
// 获取令牌
|
||||
String token = getToken(urlAddress, operatorId, operatorSecret, dataSecretIv, signSecret, dataSecret);
|
||||
String result = HttpRequestUtil.nrSendPost(token, jsonString, url, dataSecret
|
||||
, dataSecretIv, operatorId, signSecret);
|
||||
|
||||
// System.out.println(result);
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取充电站信息
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
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();
|
||||
|
||||
// 查询密钥等配置
|
||||
// ThirdPartyPlatformConfig configInfo = thirdPartyPlatformConfigService.getInfoByOperatorId(dto.getOperatorId());
|
||||
// if (configInfo == null) {
|
||||
// return null;
|
||||
// }
|
||||
PageUtils.startPage(pageNo, pageSize);
|
||||
List<PileStationInfo> stationInfos = pileStationInfoService.getStationInfosByThirdParty();
|
||||
if (CollectionUtils.isEmpty(stationInfos)) {
|
||||
@@ -194,24 +279,38 @@ public class NRServiceImpl implements NRService {
|
||||
|
||||
/**
|
||||
* 推送告警信息
|
||||
* @param pileConnectorCode
|
||||
* @param connectorStatus
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public String notification_alarmInfo(String pileConnectorCode, String connectorStatus) {
|
||||
public String pushAlarmInfo(PushAlarmInfoDTO dto) {
|
||||
List<NRAlarmInfo> nrAlarmInfos = new ArrayList<>();
|
||||
|
||||
// 通过站点id查询相关配置信息
|
||||
ThirdPartyStationRelation relation = new ThirdPartyStationRelation();
|
||||
relation.setStationId(dto.getStationId());
|
||||
ThirdPartyStationRelationVO relationInfo = thirdPartyStationRelationService.selectRelationInfo(relation);
|
||||
if (relationInfo == null) {
|
||||
return null;
|
||||
}
|
||||
String operatorId = relationInfo.getOperatorId();
|
||||
String operatorSecret = relationInfo.getOperatorSecret();
|
||||
String signSecret = relationInfo.getSignSecret();
|
||||
String dataSecret = relationInfo.getDataSecret();
|
||||
String dataSecretIv = relationInfo.getDataSecretIv();
|
||||
String urlAddress = relationInfo.getUrlAddress();
|
||||
|
||||
// 从缓存中获取故障原因
|
||||
String redisKey = CacheConstants.PILE_HARDWARE_FAULT + pileConnectorCode;
|
||||
String redisKey = CacheConstants.PILE_HARDWARE_FAULT + dto.getPileConnectorCode();
|
||||
String faultReason = redisCache.getCacheObject(redisKey);
|
||||
int status = 0;
|
||||
if (StringUtils.equals(connectorStatus, "01")) {
|
||||
if (StringUtils.equals(dto.getConnectorStatus(), "01")) {
|
||||
// 故障
|
||||
status = 1;
|
||||
}
|
||||
// 封装对象
|
||||
NRAlarmInfo alarmInfo = NRAlarmInfo.builder()
|
||||
.connectorId(pileConnectorCode)
|
||||
.connectorId(dto.getPileConnectorCode())
|
||||
.alertTime(DateUtils.dateTimeNow(DateUtils.YYYY_MM_DD_HH_MM_SS))
|
||||
.alertCode(120) // 120-预留
|
||||
.describe(faultReason)
|
||||
@@ -219,13 +318,24 @@ public class NRServiceImpl implements NRService {
|
||||
|
||||
.build();
|
||||
nrAlarmInfos.add(alarmInfo);
|
||||
Map<String, Object> map = new LinkedHashMap<>();
|
||||
map.put("AlarmInfos", nrAlarmInfos);
|
||||
|
||||
// TODO 发送请求
|
||||
// 发送请求
|
||||
String url = urlAddress + "notification_alarmInfo";
|
||||
|
||||
String jsonStr = JSONObject.toJSONString(nrAlarmInfos);
|
||||
JSONObject data = new JSONObject();
|
||||
data.put("AlarmInfos", jsonStr);
|
||||
|
||||
return null;
|
||||
String jsonString = JSONObject.toJSONString(data);
|
||||
System.out.println("jsonString : " + jsonString);
|
||||
|
||||
// 获取令牌
|
||||
String token = getToken(urlAddress, operatorId, operatorSecret,
|
||||
dataSecretIv, signSecret, dataSecret);
|
||||
String result = HttpRequestUtil.nrSendPost(token, jsonString, url, dataSecret
|
||||
, dataSecretIv, operatorId, signSecret);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -234,10 +344,35 @@ public class NRServiceImpl implements NRService {
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public String notification_stationStatus(RealTimeMonitorData realTimeMonitorData) {
|
||||
public String pushPileStatus(RealTimeMonitorData realTimeMonitorData) {
|
||||
String pileConnectorCode = realTimeMonitorData.getPileSn() + realTimeMonitorData.getConnectorCode();
|
||||
String connectorStatus = realTimeMonitorData.getConnectorStatus();
|
||||
String transactionCode = realTimeMonitorData.getTransactionCode();
|
||||
|
||||
// 查出该桩所属哪个站点
|
||||
String pileSn = StringUtils.substring(pileConnectorCode, 0, 14);
|
||||
PileStationVO stationVO = pileStationInfoService.getStationInfoByPileSn(pileSn);
|
||||
// 通过站点id查询相关配置信息
|
||||
ThirdPartyStationRelation relation = new ThirdPartyStationRelation();
|
||||
relation.setStationId(Long.parseLong(stationVO.getId()));
|
||||
ThirdPartyStationRelationVO relationInfo = thirdPartyStationRelationService.selectRelationInfo(relation);
|
||||
if (relationInfo == null) {
|
||||
return null;
|
||||
}
|
||||
String operatorId = relationInfo.getOperatorId();
|
||||
String operatorSecret = relationInfo.getOperatorSecret();
|
||||
String signSecret = relationInfo.getSignSecret();
|
||||
String dataSecret = relationInfo.getDataSecret();
|
||||
String dataSecretIv = relationInfo.getDataSecretIv();
|
||||
String urlAddress = relationInfo.getUrlAddress();
|
||||
|
||||
String url = urlAddress + "notification_stationStatus";
|
||||
|
||||
// 获取令牌
|
||||
String token = getToken(urlAddress, operatorId, operatorSecret, dataSecretIv, signSecret, dataSecret);
|
||||
if (StringUtils.isBlank(token)) {
|
||||
return null;
|
||||
}
|
||||
// 根据交易流水号查询订单信息
|
||||
OrderBasicInfo orderBasicInfo = orderBasicInfoService.getOrderInfoByTransactionCode(transactionCode);
|
||||
// 封装对象
|
||||
@@ -256,14 +391,22 @@ public class NRServiceImpl implements NRService {
|
||||
nrConnectorStatusInfo.setSoc(new BigDecimal(realTimeMonitorData.getSOC()).setScale(1, BigDecimal.ROUND_HALF_UP));
|
||||
}
|
||||
|
||||
Map<String, Object> map = new LinkedHashMap<>();
|
||||
map.put("ConnectorStatusInfo", nrConnectorStatusInfo);
|
||||
// 发送请求
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("ConnectorStatusInfo", nrConnectorStatusInfo);
|
||||
String jsonString = JSONObject.toJSONString(json);
|
||||
|
||||
// TODO 发送请求
|
||||
|
||||
return null;
|
||||
String result = HttpRequestUtil.nrSendPost(token, jsonString, url, dataSecret, dataSecretIv, operatorId, signSecret);
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询设备接口状态
|
||||
* 此接口用于批量查询设备实时状态
|
||||
* 由充电运营商方实现此接口,省、市两级监管平台调用。
|
||||
* @param stationIds
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Map<String, Object> query_station_status(List<String> stationIds) {
|
||||
List<NRStationStatusInfo> resultList = new ArrayList<>();
|
||||
@@ -329,31 +472,97 @@ public class NRServiceImpl implements NRService {
|
||||
return map;
|
||||
}
|
||||
|
||||
/**
|
||||
* 充电电量信息推送
|
||||
* 当运营商平台完成一次充电时,将充电电量信息推送至省、市两级监管平台
|
||||
* @param orderCode
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public String notification_orderInfo(String orderCode) {
|
||||
public String pushOrderInfo(String orderCode) {
|
||||
// 根据订单号查询订单信息
|
||||
NROrderInfo nrOrderInfo = orderBasicInfoService.getNROrderInfoByOrderCode(orderCode);
|
||||
// TODO 发送请求
|
||||
Map<String, Object> map = new LinkedHashMap<>();
|
||||
map.put("OrderInfo", nrOrderInfo);
|
||||
NROrderInfoVO nrOrderInfoVO = orderBasicInfoService.getNROrderInfoByOrderCode(orderCode);
|
||||
NROrderInfo nrOrderInfo = formatNROrderInfo((nrOrderInfoVO));
|
||||
|
||||
return null;
|
||||
// 通过站点id查询相关配置信息
|
||||
ThirdPartyStationRelation relation = new ThirdPartyStationRelation();
|
||||
relation.setStationId(Long.parseLong(nrOrderInfoVO.getStationId()));
|
||||
ThirdPartyStationRelationVO relationInfo = thirdPartyStationRelationService.selectRelationInfo(relation);
|
||||
if (relationInfo == null) {
|
||||
return null;
|
||||
}
|
||||
String operatorId = relationInfo.getOperatorId();
|
||||
String operatorSecret = relationInfo.getOperatorSecret();
|
||||
String signSecret = relationInfo.getSignSecret();
|
||||
String dataSecret = relationInfo.getDataSecret();
|
||||
String dataSecretIv = relationInfo.getDataSecretIv();
|
||||
String urlAddress = relationInfo.getUrlAddress();
|
||||
|
||||
String url = urlAddress + "notification_orderInfo";
|
||||
|
||||
// 获取令牌
|
||||
String token = getToken(urlAddress, operatorId, operatorSecret, dataSecretIv, signSecret, dataSecret);
|
||||
if (StringUtils.isBlank(token)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// 发送请求
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("OrderInfo", nrOrderInfo);
|
||||
|
||||
String jsonString = JSONObject.toJSONString(jsonObject);
|
||||
|
||||
String result = HttpRequestUtil.nrSendPost(token, jsonString, url, dataSecret, dataSecretIv, operatorId, signSecret);
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<NROrderInfo> query_order_info(NRQueryOrderDTO dto) {
|
||||
List<NROrderInfo> nrOrderInfos = orderBasicInfoService.getNROrderInfos(dto);
|
||||
List<NROrderInfo> resultList = new ArrayList<>();
|
||||
List<NROrderInfoVO> nrOrderInfos = orderBasicInfoService.getNROrderInfos(dto);
|
||||
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));
|
||||
}
|
||||
for (NROrderInfoVO nrOrderInfoVO : nrOrderInfos) {
|
||||
NROrderInfo nrOrderInfo = formatNROrderInfo(nrOrderInfoVO);
|
||||
resultList.add(nrOrderInfo);
|
||||
}
|
||||
return nrOrderInfos;
|
||||
return resultList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 格式化南瑞平台订单对象
|
||||
* @param nrOrderInfoVO
|
||||
* @return
|
||||
*/
|
||||
private NROrderInfo formatNROrderInfo(NROrderInfoVO nrOrderInfoVO) {
|
||||
// 将组织机构代码截取后九位
|
||||
String organizationCode = nrOrderInfoVO.getOperatorId();
|
||||
if (StringUtils.isBlank(organizationCode)) {
|
||||
return null;
|
||||
}
|
||||
String operatorId = StringUtils.substring(organizationCode, organizationCode.length() - 9);
|
||||
|
||||
NROrderInfo nrOrderInfo = NROrderInfo.builder()
|
||||
.operatorId(operatorId)
|
||||
.connectorId(nrOrderInfoVO.getConnectorId())
|
||||
.startChargeSeq(nrOrderInfoVO.getStartChargeSeq())
|
||||
.userChargeType(1)
|
||||
.elect(nrOrderInfoVO.getElect())
|
||||
.cuspElect(nrOrderInfoVO.getCuspElect())
|
||||
.peakElect(nrOrderInfoVO.getPeakElect())
|
||||
.flatElect(nrOrderInfoVO.getFlatElect())
|
||||
.valleyElect(nrOrderInfoVO.getValleyElect())
|
||||
.startTime(nrOrderInfoVO.getStartTime())
|
||||
.endTime(nrOrderInfoVO.getEndTime())
|
||||
|
||||
.build();
|
||||
// TODO 获取电表总起、止值
|
||||
// pileMsgRecordService.getPileFeedList()
|
||||
|
||||
nrOrderInfo.setMeterValueStart(BigDecimal.ZERO);
|
||||
nrOrderInfo.setMeterValueEnd(BigDecimal.ZERO);
|
||||
return nrOrderInfo;
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
Reference in New Issue
Block a user