update 甘肃省平台Service

This commit is contained in:
Lemon
2024-12-11 15:29:03 +08:00
parent c833d8c182
commit e0f040ec8b
7 changed files with 112 additions and 147 deletions

View File

@@ -24,14 +24,6 @@ public class SupStationInfo extends StationInfo {
@JSONField(name = "StationUniqueNumber")
private String stationUniqueNumber;
/**
* 设备接口分类
* 1车辆充电设备接口
* 2换电站内的电池箱充电设备接口
*/
@JSONField(name = "EquipmentClassification")
private String equipmentClassification;
/**
* 充换电站所在县以下行政区划代码
* 填写内容为12位行政区划代码1-6位为县及以上行政区划代码7-12位为县以下区划代码
@@ -47,17 +39,7 @@ public class SupStationInfo extends StationInfo {
* 3充换电一体站
*/
@JSONField(name = "StationClassification")
private int stationClassification;
/**
* 通用类型
* 1通用可为 3 种或 3 种以上的车型进行换电)
* 2非通用
* 注:站点分类为 2 或 3 时,此字段必填,为 1 时非必填。
*/
@JSONField(name = "GeneralApplicationType")
private Integer generalApplicationType;
private Integer stationClassification;
/**
* 7*24小时营业
@@ -65,7 +47,7 @@ public class SupStationInfo extends StationInfo {
* 1
*/
@JSONField(name = "RoundTheClock")
private String roundTheClock;
private Integer roundTheClock;
/**
* 停车费类型

View File

@@ -193,8 +193,8 @@ public class GanSuPlatformServiceImpl implements ThirdPartyPlatformService {
// 查询计费模板
List<BillingPriceVO> priceList = pileBillingTemplateService.queryBillingPrice(stationId);
for (BillingPriceVO billingPriceVO : priceList) {
electricityFee.put(billingPriceVO.getStartTime() + ":00" + "-" + billingPriceVO.getEndTime() + ":00", billingPriceVO.getElectricityPrice());
serviceFee.put(billingPriceVO.getStartTime() + ":00" + "-" + billingPriceVO.getEndTime() + ":00", billingPriceVO.getServicePrice());
electricityFee.put(billingPriceVO.getStartTime() + ":00-" + billingPriceVO.getEndTime() + ":00", billingPriceVO.getElectricityPrice());
serviceFee.put(billingPriceVO.getStartTime() + ":00-" + billingPriceVO.getEndTime() + ":00", billingPriceVO.getServicePrice());
}
stationInfo.setElectricityFee(electricityFee.toJSONString());
stationInfo.setServiceFee(serviceFee.toJSONString());

View File

@@ -35,6 +35,7 @@ import com.jsowell.pile.vo.base.ThirdPartyStationRelationVO;
import com.jsowell.pile.vo.uniapp.customer.BillingPriceVO;
import com.jsowell.pile.vo.web.PileConnectorInfoVO;
import com.jsowell.pile.vo.web.PileMerchantInfoVO;
import com.jsowell.pile.vo.web.PileStationVO;
import com.jsowell.thirdparty.lianlian.domain.ConnectorStatusInfo;
import com.jsowell.thirdparty.lianlian.domain.StationStatusInfo;
import com.jsowell.thirdparty.lianlian.vo.AccessTokenVO;
@@ -218,7 +219,6 @@ public class GuiZhouPlatformServiceImpl implements ThirdPartyPlatformService {
SupStationInfo stationInfo = new SupStationInfo();
String stationId = String.valueOf(pileStationInfo.getId());
stationInfo.setStationID(stationId);
// MerchantInfoVO merchantInfo = pileMerchantInfoService.getMerchantInfo(String.valueOf(pileStationInfo.getMerchantId()));
stationInfo.setOperatorID(Constants.OPERATORID_JIANG_SU); // 组织机构代码
stationInfo.setEquipmentOwnerID(String.valueOf(pileStationInfo.getMerchantId()));
stationInfo.setStationName(pileStationInfo.getStationName());
@@ -244,7 +244,7 @@ public class GuiZhouPlatformServiceImpl implements ThirdPartyPlatformService {
stationInfo.setSupportOrder(Integer.valueOf(pileStationInfo.getSupportOrder()));
stationInfo.setStationStatus(Integer.valueOf(pileStationInfo.getStationStatus()));
stationInfo.setParkNums(Integer.valueOf(pileStationInfo.getParkNums()));
stationInfo.setRoundTheClock(Constants.ONE);
stationInfo.setRoundTheClock(Constants.one);
stationInfo.setParkType("255");
stationInfo.setElectricityType(1);
stationInfo.setCapacity(pileStationInfo.getCapacity().setScale(2, RoundingMode.HALF_UP));
@@ -307,46 +307,32 @@ public class GuiZhouPlatformServiceImpl implements ThirdPartyPlatformService {
// 组装所需要的数据格式
SupStationInfo info = SupStationInfo.builder()
.stationID(stationId)
.equipmentClassification(Constants.ONE)
.generalApplicationType(2)
.operatorID(operatorId)
// .equipmentOwnerID()
.stationName(pileStationInfo.getStationName())
.periodFee(1) // 峰谷分时 0-否1-是
.parkType("255") // 255-参考场地实际收费标准
.roundTheClock(Constants.ONE)
.electricityType(1) // 用电类型 1-商业用电
.videoMonitor(0) // 视频监控配套情况 0-无1-有
.isAloneApply(Integer.valueOf(pileStationInfo.getAloneApply()))
.isPublicParkingLot(Integer.valueOf(pileStationInfo.getPublicParking()))
.countryCode(pileStationInfo.getCountryCode())
// .areaCode()
// .areaCodeCountryside()
.address(pileStationInfo.getAddress())
.serviceTel(pileStationInfo.getStationTel())
.stationClassification(1)
.stationType(Integer.valueOf(pileStationInfo.getStationType()))
.stationStatus(Integer.valueOf(pileStationInfo.getStationStatus()))
.parkNums(Integer.valueOf(pileStationInfo.getParkNums()))
.stationClassification(Constants.one)
.stationType(Integer.parseInt(pileStationInfo.getStationType()))
.stationStatus(Integer.parseInt(pileStationInfo.getStationStatus()))
.parkNums(Integer.parseInt(pileStationInfo.getParkNums()))
.stationLng(new BigDecimal(pileStationInfo.getStationLng()))
.stationLat(new BigDecimal(pileStationInfo.getStationLat()))
.construction(Integer.valueOf(pileStationInfo.getConstruction()))
.openAllDay(Integer.valueOf(pileStationInfo.getOpenAllDay()))
.minElectricityPrice(new BigDecimal(Constants.ZERO))
.electricityFee(Constants.ZERO)
.serviceFee(Constants.ZERO)
.parkFree(Integer.valueOf(pileStationInfo.getParkFree()))
.supportOrder(Integer.valueOf(pileStationInfo.getSupportOrder()))
.parkFeeType(0)
.ratedPower(BigDecimal.ONE)//站点额定总功率
.officialRunTime(DateUtils.dateTime(pileStationInfo.getCreateTime()))//正式投运时间
.businessExpandType(1)//报装类型
.construction(Integer.parseInt(pileStationInfo.getConstruction()))
.roundTheClock(Constants.one)
.parkType("255") // 255-参考场地实际收费标准
.electricityType(Constants.one) // 用电类型 1-商业用电
.businessExpandType(Constants.one)//报装类型
// .capacity()
.ratedPower(new BigDecimal("0.0"))
.periodFee(Constants.one) // 峰谷分时 0-否1-是
.officialRunTime(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD, pileStationInfo.getCreateTime()))//正式投运时间
.videoMonitor(Constants.zero) // 视频监控配套情况 0-无1-有
.toiletFlag(Integer.valueOf(pileStationInfo.getToiletFlag()))
.storeFlag(Integer.valueOf(pileStationInfo.getStoreFlag()))
.restaurantFlag(Integer.valueOf(pileStationInfo.getRestaurantFlag()))
.loungeFlag(Integer.valueOf(pileStationInfo.getLoungeFlag()))
.canopyFlag(Integer.valueOf(pileStationInfo.getCanopyFlag()))
.printerFlag(Integer.valueOf(pileStationInfo.getPrinterFlag()))
.barrierFlag(Integer.valueOf(pileStationInfo.getBarrierFlag()))
.parkingLockFlag(Integer.valueOf(pileStationInfo.getParkingLockFlag()))
.build();
String areaCode = pileStationInfo.getAreaCode(); // 330000,330200,330213
// 根据逗号分组
@@ -357,16 +343,6 @@ public class GuiZhouPlatformServiceImpl implements ThirdPartyPlatformService {
info.setEquipmentOwnerID(Constants.OPERATORID_GUI_ZHOU);
info.setPayment(StationPaymentEnum.getPaymentByCode(pileStationInfo.getPayment()));
if (StringUtils.isNotBlank(pileStationInfo.getParkingNumber())) {
info.setIsPublicParkingLot(1);
info.setParkingLotNumber(pileStationInfo.getParkingNumber());
}
// 户号
if (StringUtils.isNotBlank(pileStationInfo.getAccountNumber())) {
info.setAccountNumber(pileStationInfo.getAccountNumber());
}
// 容量
if (StringUtils.isNotBlank(String.valueOf(pileStationInfo.getCapacity()))) {
info.setCapacity(pileStationInfo.getCapacity().setScale(2, RoundingMode.HALF_UP));
@@ -384,7 +360,7 @@ public class GuiZhouPlatformServiceImpl implements ThirdPartyPlatformService {
info.setAreaCodeCountryside(areaCodeCountryside);
}
// 调用联联平台接口
// 调用平台接口
String url = urlAddress + "supervise_notification_station_info";
JSONObject data = new JSONObject();
@@ -481,9 +457,6 @@ public class GuiZhouPlatformServiceImpl implements ThirdPartyPlatformService {
.equipmentID(connectorInfo.getPileSn())
.connectorID(pileConnectorCode)
.status(Integer.parseInt(status))
.statusDesc(PileConnectorDataBaseStatusEnum.getStatusDescription(status))
.parkStatus(Constants.zero)
.lockStatus(Constants.zero)
.updateTime(DateUtils.getDateTime())
.equipmentClassification(Constants.ONE)
.build();
@@ -524,12 +497,17 @@ public class GuiZhouPlatformServiceImpl implements ThirdPartyPlatformService {
String dataSecret = guiZhouPlatformSecretInfo.getTheirDataSecret();
String dataSecretIv = guiZhouPlatformSecretInfo.getTheirDataSecretIv();
String urlAddress = guiZhouPlatformSecretInfo.getTheirUrlPrefix();
// 查询站点信息
PileStationVO stationInfo = pileStationInfoService.getStationInfo(orderInfo.getStationId());
String organizationCode = stationInfo.getOrganizationCode();
// 查询枪口实时状态
List<RealTimeMonitorData> chargingRealTimeData = orderBasicInfoService.getChargingRealTimeData(orderInfo.getTransactionCode());
RealTimeMonitorData realTimeMonitorData;
if (CollectionUtils.isEmpty(chargingRealTimeData)) {
realTimeMonitorData = RealTimeMonitorData.builder()
.chargingDegree("0")
.chargingDegree(Constants.ZERO)
.connectorStatus("3")
.build();
chargingRealTimeData.add(realTimeMonitorData);
} else {
@@ -554,41 +532,32 @@ public class GuiZhouPlatformServiceImpl implements ThirdPartyPlatformService {
// 充电完成
orderStatus = "4";
}
BigDecimal current = info.getCurrent() == null ? BigDecimal.ZERO : info.getCurrent();
BigDecimal voltage = info.getVoltage() == null ? BigDecimal.ZERO : info.getVoltage();
String soc = info.getSOC() == null ? Constants.ZERO : info.getSOC();
BigDecimal current = realTimeMonitorData.getOutputCurrent() == null ? BigDecimal.ZERO : info.getCurrent();
BigDecimal voltage = realTimeMonitorData.getOutputVoltage() == null ? BigDecimal.ZERO : info.getVoltage();
String soc = realTimeMonitorData.getSOC() == null ? Constants.ZERO : info.getSOC();
String dateTime = DateUtils.getDateTime();
SupEquipChargeStatusInfo supEquipChargeStatusInfo = SupEquipChargeStatusInfo.builder()
.operatorID(Constants.OPERATORID_JIANG_SU)
.equipmentOwnerID(Constants.OPERATORID_GUI_ZHOU)
.equipmentOwnerID(ThirdPartyPlatformUtils.extractEquipmentOwnerID(organizationCode))
.stationID(orderInfo.getStationId())
.equipmentID(orderInfo.getPileSn())
.startChargeSeqStat(Integer.parseInt(orderStatus))
.connectorID(orderInfo.getPileConnectorCode())
.orderNo(orderInfo.getOrderCode())
.orderStatus(2)
.equipmentClassification(1)
.orderStatus(Integer.parseInt(orderStatus))
.equipmentClassification(Constants.one)
.pushTimeStamp(dateTime)
.connectorStatus(3) // 3-充电中
.currentA(current.setScale(1, BigDecimal.ROUND_HALF_UP))
.voltageA(voltage.setScale(1, BigDecimal.ROUND_HALF_UP))
.connectorStatus(Integer.parseInt(realTimeMonitorData.getConnectorStatus())) // 3-充电中
.currentA(current.setScale(1, RoundingMode.HALF_UP))
.voltageA(voltage.setScale(1, RoundingMode.HALF_UP))
.soc(new BigDecimal(soc))
// .currentA(BigDecimal.ONE)
// .voltageA(BigDecimal.ONE)
// .soc(BigDecimal.ZERO)
.startTime(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, orderInfo.getChargeStartTime()))
.endTime(dateTime)
.totalPower(new BigDecimal(realTimeMonitorData.getChargingDegree()))
.eventTime(dateTime)
.chargeVoltage(voltage.setScale(1, BigDecimal.ROUND_HALF_UP))
.chargeCurrent(current.setScale(1, BigDecimal.ROUND_HALF_UP))
.build();
supEquipChargeStatusInfo.setEquipmentOwnerID(Constants.OPERATORID_GUI_ZHOU);
if (StringUtils.isNotBlank(info.getSOC())) {
supEquipChargeStatusInfo.setSoc(new BigDecimal(info.getSOC()));
}
supEquipChargeStatusInfo.setEquipmentOwnerID(Constants.OPERATORID_GUI_ZHOU); // TODO 临时测试使用贵州测试数据
String url = urlAddress + "supervise_notification_equip_charge_status";
// 调用平台接口
@@ -630,17 +599,14 @@ public class GuiZhouPlatformServiceImpl implements ThirdPartyPlatformService {
// 拼装成平台所需格式对象
ChargeOrderInfo orderInfo = transformChargeOrderInfo(orderBasicInfo, orderDetail);
orderInfo.setOperatorID(operatorId);
orderInfo.setEquipmentOwnerID(Constants.OPERATORID_GUI_ZHOU);
orderInfo.setTotalServiceMoney(orderInfo.getTotalSeviceMoney());
orderInfo.setTotalElecMoney(orderDetail.getTotalElectricityAmount());
orderInfo.setEquipmentOwnerID(Constants.OPERATORID_GUI_ZHOU); // TODO
List<BillingPriceVO> billingList = pileBillingTemplateService.queryBillingPrice(orderBasicInfo.getStationId());
// 先将list按照 尖、峰、平、谷 时段排序
// List<BillingPriceVO> collect = billingList.stream().sorted(Comparator.comparing(BillingPriceVO::getTimeType)).collect(Collectors.toList());
// 再循环该list拼装对应的充电价格、费率
List<SupChargeDetails> chargeDetails = transformSupChargeDetails(orderDetail, billingList);
orderInfo.setChargeDetails(chargeDetails);
// List<SupChargeDetails> chargeDetails = transformSupChargeDetails(orderDetail, billingList);
// orderInfo.setChargeDetails(chargeDetails);
// 获取令牌
String token = getToken(urlAddress, operatorId, operatorSecret, dataSecretIv, signSecret, dataSecret);
@@ -664,28 +630,28 @@ public class GuiZhouPlatformServiceImpl implements ThirdPartyPlatformService {
// 根据订单号查询出信息
OrderBasicInfo orderBasicInfo = orderBasicInfoService.getOrderInfoByOrderCode(orderCode);
OrderDetail orderDetail = orderBasicInfoService.getOrderDetailByOrderCode(orderCode);
String operatorId = Constants.OPERATORID_JIANG_SU;
String operatorSecret = getGuiZhouPlatformSecretInfo().getTheirOperatorSecret();
String signSecret = getGuiZhouPlatformSecretInfo().getTheirSigSecret();
String dataSecret = getGuiZhouPlatformSecretInfo().getTheirDataSecret();
String dataSecretIv = getGuiZhouPlatformSecretInfo().getTheirDataSecretIv();
String urlAddress = getGuiZhouPlatformSecretInfo().getTheirUrlPrefix();
ThirdPartySecretInfoVO guiZhouPlatformSecretInfo = getGuiZhouPlatformSecretInfo();
String operatorSecret = guiZhouPlatformSecretInfo.getTheirOperatorSecret();
String signSecret = guiZhouPlatformSecretInfo.getTheirSigSecret();
String dataSecret = guiZhouPlatformSecretInfo.getTheirDataSecret();
String dataSecretIv = guiZhouPlatformSecretInfo.getTheirDataSecretIv();
String urlAddress = guiZhouPlatformSecretInfo.getTheirUrlPrefix();
String url = urlAddress + "supervise_notification_charge_order_info_history";
ChargeOrderInfo orderInfo = transformChargeOrderInfo(orderBasicInfo, orderDetail);
orderInfo.setOperatorID(operatorId);
orderInfo.setEquipmentOwnerID(Constants.OPERATORID_GUI_ZHOU);
orderInfo.setEquipmentOwnerID(Constants.OPERATORID_GUI_ZHOU); // todo
List<BillingPriceVO> billingList = pileBillingTemplateService.queryBillingPrice(orderBasicInfo.getStationId());
// 先将list按照 尖、峰、平、谷 时段排序
// List<BillingPriceVO> collect = billingList.stream().sorted(Comparator.comparing(BillingPriceVO::getTimeType)).collect(Collectors.toList());
// 再循环该list拼装对应的充电价格、费率
List<SupChargeDetails> chargeDetails = transformSupChargeDetails(orderDetail, billingList);
orderInfo.setChargeDetails(chargeDetails);
// List<SupChargeDetails> chargeDetails = transformSupChargeDetails(orderDetail, billingList);
// orderInfo.setChargeDetails(chargeDetails);
// 获取令牌
String token = getToken(urlAddress, operatorId, operatorSecret, dataSecretIv, signSecret, dataSecret);
@@ -707,10 +673,15 @@ public class GuiZhouPlatformServiceImpl implements ThirdPartyPlatformService {
@Override
public String notificationOperationStatsInfo(String stationId) {
SupStationStatsInfo.EquipmentStatsInfo equipmentStatsInfo = new SupStationStatsInfo.EquipmentStatsInfo();
List<SupStationStatsInfo.EquipmentStatsInfo> equipmentStatsInfoList = new ArrayList<>();
List<SupStationStatsInfo
.EquipmentStatsInfo> equipmentStatsInfoList = new ArrayList<>();
SupStationStatsInfo.EquipmentStatsInfo.ConnectorStatsInfo connectorStatsInfo = null;
List<SupStationStatsInfo.EquipmentStatsInfo.ConnectorStatsInfo> connectorStatsInfoList = new ArrayList<>();
SupStationStatsInfo
.EquipmentStatsInfo
.ConnectorStatsInfo connectorStatsInfo = null;
List<SupStationStatsInfo
.EquipmentStatsInfo
.ConnectorStatsInfo> connectorStatsInfoList = new ArrayList<>();
// 根据站点id查询订单记录 (新建Service方法)
List<SupStationStatsVO> orderVOS = orderBasicInfoService.queryOrderListByStationId(stationId);
@@ -720,7 +691,7 @@ public class GuiZhouPlatformServiceImpl implements ThirdPartyPlatformService {
for (SupStationStatsVO orderVO : orderVOS) {
// 充电站累计用电量
BigDecimal totalPower = (orderVO.getTotalPower() != null) ? orderVO.getTotalPower() : BigDecimal.ZERO;
Integer chargingTime = (orderVO.getChargingTime() != null) ? orderVO.getChargingTime() : Constants.zero;
int chargingTime = (orderVO.getChargingTime() != null) ? orderVO.getChargingTime() : Constants.zero;
stationTotalElectricity = stationTotalElectricity.add(totalPower);
// 充电站累计充电时长(分钟)
@@ -797,13 +768,16 @@ public class GuiZhouPlatformServiceImpl implements ThirdPartyPlatformService {
}
}
PileStationVO stationInfo = pileStationInfoService.getStationInfo(stationId);
String organizationCode = stationInfo.getOrganizationCode();
// 创建对象
String startTime = DateUtils.getYesterdayStr() + " 00:00:00";
String endTime = DateUtils.getYesterdayStr() + " 23:59:59";
String startTime = DateUtils.getYesterdayStr();
String endTime = DateUtils.getYesterdayStr();
SupStationStatsInfo supStationStatsInfo = SupStationStatsInfo.builder()
.stationId(stationId)
.operatorId(Constants.OPERATORID_JIANG_SU)
// .equipmentOwnerId(orderVOS.get(0).getOrganizationCode())
.equipmentOwnerId(ThirdPartyPlatformUtils.extractEquipmentOwnerID(organizationCode))
.stationClassification(1)
.startTime(startTime)
.endTime(endTime)
@@ -813,7 +787,6 @@ public class GuiZhouPlatformServiceImpl implements ThirdPartyPlatformService {
.stationTotalChargeTime(stationChargeTime)
.stationTotalWarningNum(0)
.equipmentStatsInfos(equipmentStatsInfoList)
.equipmentOwnerId(Constants.OPERATORID_GUI_ZHOU)
.build();
JSONObject json = new JSONObject();
json.put("StationStatsInfos", supStationStatsInfo);
@@ -821,7 +794,8 @@ public class GuiZhouPlatformServiceImpl implements ThirdPartyPlatformService {
// 发送推送请求
ThirdPartySecretInfoVO guiZhouPlatformSecretInfo = getGuiZhouPlatformSecretInfo();
String operatorId = guiZhouPlatformSecretInfo.getOurOperatorId();
String operatorId = Constants.OPERATORID_JIANG_SU;
String operatorSecret = guiZhouPlatformSecretInfo.getTheirOperatorSecret();
String signSecret = guiZhouPlatformSecretInfo.getTheirSigSecret();
String dataSecret = guiZhouPlatformSecretInfo.getTheirDataSecret();
@@ -845,14 +819,14 @@ public class GuiZhouPlatformServiceImpl implements ThirdPartyPlatformService {
* @return
*/
public String notificationPowerInfo(List<String> stationIds) {
List<com.jsowell.thirdparty.platform.common.SupStationPowerInfo> list = new ArrayList<>();
List<SupStationPowerInfo> list = new ArrayList<>();
String dateTimeNow = DateUtils.dateTimeNow(DateUtils.YYYY_MM_DD_HH_MM_SS);
for (String stationId : stationIds) {
BigDecimal stationPower = BigDecimal.ZERO;
com.jsowell.thirdparty.platform.common.SupStationPowerInfo supStationPowerInfo = new com.jsowell.thirdparty.platform.common.SupStationPowerInfo();
SupStationPowerInfo supStationPowerInfo = new SupStationPowerInfo();
supStationPowerInfo.setOperatorID(Constants.OPERATORID_JIANG_SU);
supStationPowerInfo.setOperatorId(Constants.OPERATORID_JIANG_SU);
supStationPowerInfo.setStationId(stationId);
supStationPowerInfo.setDataTime(dateTimeNow);
supStationPowerInfo.setStationClassification(Constants.one);
@@ -862,7 +836,7 @@ public class GuiZhouPlatformServiceImpl implements ThirdPartyPlatformService {
PileMerchantInfoVO pileMerchantInfoVO = pileMerchantInfoService.queryMerchantInfoByStationId(stationId);
String organizationCode = pileMerchantInfoVO.getOrganizationCode();
if (StringUtils.isNotBlank(organizationCode) && organizationCode.length() == 18) {
supStationPowerInfo.setEquipmentOwnerID(Constants.OPERATORID_GUI_ZHOU);
supStationPowerInfo.setEquipmentOwnerID(ThirdPartyPlatformUtils.extractEquipmentOwnerID(organizationCode));
}
// 根据站点id查询桩信息
@@ -884,21 +858,25 @@ public class GuiZhouPlatformServiceImpl implements ThirdPartyPlatformService {
throw new BusinessException(ReturnCodeEnum.CODE_SELECT_INFO_IS_NULL);
}
List<com.jsowell.thirdparty.platform.common.SupStationPowerInfo.EquipmentPowerInfo> supPileInfoList = new ArrayList<>();
List<SupStationPowerInfo.EquipmentPowerInfo> supPileInfoList = new ArrayList<>();
for (PileBasicInfo pileBasicInfo : pileList) {
com.jsowell.thirdparty.platform.common.SupStationPowerInfo.EquipmentPowerInfo supPileInfo = new com.jsowell.thirdparty.platform.common.SupStationPowerInfo.EquipmentPowerInfo();
SupStationPowerInfo.EquipmentPowerInfo supPileInfo = new SupStationPowerInfo.EquipmentPowerInfo();
supPileInfo.setEquipmentID(pileBasicInfo.getSn());
supPileInfo.setEquipmentClassification(Constants.one);
supPileInfo.setDataTime(dateTimeNow);
supPileInfo.setEquipRealTimePower(BigDecimal.ZERO);
BigDecimal pileInstantPower = BigDecimal.ZERO;
List<com.jsowell.thirdparty.platform.common.SupStationPowerInfo.EquipmentPowerInfo.ConnectorPowerInfo> connectorPowerInfoList = new ArrayList<>();
List<SupStationPowerInfo
.EquipmentPowerInfo
.ConnectorPowerInfo> connectorPowerInfoList = new ArrayList<>();
for (PileConnectorInfoVO pileConnectorInfoVO : connectorList) {
if (!StringUtils.equals(pileBasicInfo.getSn(), pileConnectorInfoVO.getPileSn())) {
continue;
}
BigDecimal instantPower = pileConnectorInfoVO.getInstantPower() == null ? BigDecimal.ZERO : pileConnectorInfoVO.getInstantPower();
com.jsowell.thirdparty.platform.common.SupStationPowerInfo.EquipmentPowerInfo.ConnectorPowerInfo connectorPowerInfo = new com.jsowell.thirdparty.platform.common.SupStationPowerInfo.EquipmentPowerInfo.ConnectorPowerInfo();
SupStationPowerInfo.
EquipmentPowerInfo.
ConnectorPowerInfo connectorPowerInfo = new SupStationPowerInfo.EquipmentPowerInfo.ConnectorPowerInfo();
connectorPowerInfo.setConnectorID(pileConnectorInfoVO.getPileConnectorCode());
connectorPowerInfo.setEquipmentClassification(Constants.one);
connectorPowerInfo.setDataTime(dateTimeNow);
@@ -923,7 +901,7 @@ public class GuiZhouPlatformServiceImpl implements ThirdPartyPlatformService {
// 获取推送配置密钥信息
ThirdPartySecretInfoVO guiZhouPlatformSecretInfo = getGuiZhouPlatformSecretInfo();
String operatorId = guiZhouPlatformSecretInfo.getOurOperatorId();
String operatorId = Constants.OPERATORID_JIANG_SU;
String operatorSecret = guiZhouPlatformSecretInfo.getTheirOperatorSecret();
String signSecret = guiZhouPlatformSecretInfo.getTheirSigSecret();
String dataSecret = guiZhouPlatformSecretInfo.getTheirDataSecret();
@@ -950,9 +928,8 @@ public class GuiZhouPlatformServiceImpl implements ThirdPartyPlatformService {
* @return
*/
private ThirdPartySecretInfoVO getGuiZhouPlatformSecretInfo() {
String thirdPartyType = ThirdPlatformTypeEnum.GUI_ZHOU_PLATFORM.getTypeCode();
// 通过第三方平台类型查询相关配置信息
ThirdPartySecretInfoVO thirdPartySecretInfoVO = thirdpartySecretInfoService.queryByThirdPlatformType(thirdPartyType);
ThirdPartySecretInfoVO thirdPartySecretInfoVO = thirdpartySecretInfoService.queryByThirdPlatformType(thirdPlatformType);
if (thirdPartySecretInfoVO == null) {
throw new BusinessException(ReturnCodeEnum.CODE_SELECT_INFO_IS_NULL);
}
@@ -968,24 +945,24 @@ public class GuiZhouPlatformServiceImpl implements ThirdPartyPlatformService {
* @return
*/
private ChargeOrderInfo transformChargeOrderInfo(OrderBasicInfo orderBasicInfo, OrderDetail orderDetail) {
DecimalFormat df2 = new DecimalFormat("#.######");
BigDecimal totalPower = new BigDecimal(df2.format(orderDetail.getTotalUsedElectricity()));
totalPower = totalPower.setScale(4, RoundingMode.HALF_UP);
PileStationVO stationInfo = pileStationInfoService.getStationInfo(orderBasicInfo.getStationId());
String organizationCode = stationInfo.getOrganizationCode();
ChargeOrderInfo chargeOrderInfo = ChargeOrderInfo.builder()
.operatorID(Constants.OPERATORID_JIANG_SU)
.stationID(orderBasicInfo.getStationId())
.equipmentOwnerID(ThirdPartyPlatformUtils.extractEquipmentOwnerID(organizationCode))
.equipmentID(orderBasicInfo.getPileSn())
.orderNo(orderBasicInfo.getOrderCode())
.connectorID(orderBasicInfo.getPileConnectorCode())
.equipmentClassification(1)
.licensePlate(orderBasicInfo.getPlateNumber())
.vin(orderBasicInfo.getVinCode())
.startSOC(orderBasicInfo.getStartSoc())
.endSOC(orderBasicInfo.getEndSoc())
// .licensePlate(orderBasicInfo.getPlateNumber())
// .vin(orderBasicInfo.getVinCode())
// .startSOC(orderBasicInfo.getStartSoc())
// .endSOC(orderBasicInfo.getEndSoc())
.startTime(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, orderBasicInfo.getChargeStartTime()))
.endTime(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, orderBasicInfo.getChargeEndTime()))
.totalPower(totalPower)
.totalPower(orderDetail.getTotalUsedElectricity())
.cuspElect(orderDetail.getSharpUsedElectricity())
.peakElect(orderDetail.getSharpUsedElectricity())
.flatElect(orderDetail.getFlatUsedElectricity())
@@ -999,6 +976,19 @@ public class GuiZhouPlatformServiceImpl implements ThirdPartyPlatformService {
.stopDesc(orderBasicInfo.getReason()) // TODO 停止原因
.sumPeriod(0)
.build();
if (orderBasicInfo.getPlateNumber() != null) {
chargeOrderInfo.setLicensePlate(orderBasicInfo.getPlateNumber());
}
if (orderBasicInfo.getVinCode() != null) {
chargeOrderInfo.setVin(orderBasicInfo.getVinCode());
}
if (orderBasicInfo.getStartSoc() != null) {
chargeOrderInfo.setStartSOC(orderBasicInfo.getStartSoc());
}
if (orderBasicInfo.getEndSoc() != null) {
chargeOrderInfo.setEndSOC(orderBasicInfo.getEndSoc());
}
return chargeOrderInfo;
}

View File

@@ -266,7 +266,7 @@ public class NeiMengGuPlatformServiceImpl implements ThirdPartyPlatformService {
stationInfo.setPictures(pictures);
stationInfo.setMatchCars(pileStationInfo.getMatchCars());
stationInfo.setBusineHours(getBusineHours());
stationInfo.setRoundTheClock(Constants.ONE);
stationInfo.setRoundTheClock(Constants.one);
Map<String, String> feeMap = getFeeMap(stationId);
stationInfo.setElectricityFee(feeMap.get("electricityFee")); // 电费 xx元/度
stationInfo.setServiceFee(feeMap.get("serviceFee")); // 服务费 xx元/度