update 江苏省平台接口

This commit is contained in:
Lemon
2023-10-19 11:21:02 +08:00
parent 45da1f1ed1
commit bd0a9d6dac
9 changed files with 244 additions and 20 deletions

View File

@@ -40,6 +40,7 @@ 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.apache.commons.lang3.RandomStringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@@ -150,8 +151,8 @@ public class NRServiceImpl implements NRService {
// 拼装南瑞平台所需参数
NRStationInfo nrStationInfo = NRStationInfo.builder()
.stationId("NR" + stationInfoVO.getId())
.operatorID(Constants.OPERATORID_LIANLIAN)
.equipmentOwnerID(Constants.OPERATORID_LIANLIAN)
.operatorID("014406554")
.equipmentOwnerID("014406554")
.stationName(stationInfoVO.getStationName())
.countryCode(stationInfoVO.getCountryCode())
.areaCode(stationInfoVO.getAreaCode())
@@ -165,6 +166,24 @@ public class NRServiceImpl implements NRService {
.openAllDay(Integer.parseInt(stationInfoVO.getOpenAllDay()))
.busineHours(stationInfoVO.getBusinessHours())
.minElectricityPrice(stationInfoVO.getElectricityPrice().add(stationInfoVO.getServicePrice()))
.loungeFlag(0)
.isAloneApply(0)
.printerFlag(0)
.parkFree(0)
.isPublicParkingLot(0)
.payment(1)
.restaurantFlag(0)
.barrierFlag(0)
.serviceFee(stationInfoVO.getServicePrice())
.parkingLockFlag(0)
.electricityFee(stationInfoVO.getElectricityPrice())
.storeFlag(0)
.canopyFlag(0)
.toiletFlag(0)
.supportOrder(0)
.parkFeeType(1)
.build();
// 站点图片
if (CollectionUtils.isNotEmpty(stationInfoVO.getPictureList())) {
@@ -624,10 +643,13 @@ public class NRServiceImpl implements NRService {
}
public static void main(String[] args) {
String chargingTime = "30";
Date beginTime = DateUtils.addMinute(new Date(), -Integer.parseInt(chargingTime));
String s = DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, beginTime);
String s = RandomStringUtils.randomAlphanumeric(16).toUpperCase(Locale.ROOT);
System.out.println(s);
// String chargingTime = "30";
// Date beginTime = DateUtils.addMinute(new Date(), -Integer.parseInt(chargingTime));
// String s = DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, beginTime);
// System.out.println(s);
}
/**
@@ -655,7 +677,9 @@ public class NRServiceImpl implements NRService {
}
// 获取桩型号信息
PileModelInfoVO modelInfo = pileModelInfoService.getPileModelInfoByPileSn(pileSn);
if (modelInfo == null) {
continue;
}
NREquipmentInfo equipmentInfo = NREquipmentInfo.builder()
.equipmentID(pileSn)
.equipmentName(pileSn)
@@ -663,6 +687,12 @@ public class NRServiceImpl implements NRService {
.equipmentType(Integer.parseInt(modelInfo.getSpeedType()))
.equipmentStatus(Integer.parseInt(pileStatus))
.power(new BigDecimal(modelInfo.getRatedPower()).setScale(1, BigDecimal.ROUND_HALF_UP))
.vinFlag(1)
.equipmentPower(new BigDecimal(modelInfo.getRatedPower()).setScale(1, BigDecimal.ROUND_HALF_UP))
.newNationalStandard(1)
.constructionTime(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD, pileBasicInfo.getProductionDate()))
.manufacturerID("014406554")
.build();
// 获取枪口信息
List<NRConnectorInfo> connectorInfos = getConnectorInfo(pileSn);