This commit is contained in:
YAS\29473
2025-04-24 08:25:45 +08:00
parent 63b0833360
commit 876fac433a
3 changed files with 23 additions and 143 deletions

View File

@@ -445,9 +445,6 @@ public interface ThirdPartyPlatformService extends InitializingBean {
throw new UnsupportedOperationException("This method is not yet implemented");
}
default String checkChargeOrders(String orderCode) {
throw new UnsupportedOperationException("This method is not yet implemented");
}
// -------------------------------------- 以下是公用方法 --------------------------------------- //
/**

View File

@@ -156,7 +156,6 @@ public class weiWangKuaiDianPlatformServiceImpl implements ThirdPartyPlatformSer
}
// TODO 扩展接口,字段扩展
/**
* 查询站点信息
* @param dto 查询站点信息dto
@@ -527,7 +526,6 @@ public class weiWangKuaiDianPlatformServiceImpl implements ThirdPartyPlatformSer
}
//TODO 扩展字段
/**
* 请求启动充电 query_start_charge
* @param dto 请求启动充电DTO
@@ -867,83 +865,6 @@ public class weiWangKuaiDianPlatformServiceImpl implements ThirdPartyPlatformSer
}
/**
* 推送订单对账结果信息
*
* @param orderCode
* @return
*/
@Override
public String checkChargeOrders(String orderCode) {
List<ChargeOrder> list = new ArrayList<>();
// 根据订单号查询订单信息
OrderBasicInfo orderInfo = orderBasicInfoService.getOrderInfoByOrderCode(orderCode);
OrderDetail orderDetail = orderBasicInfoService.getOrderDetailByOrderCode(orderCode);
if (orderInfo == null || orderDetail == null) {
return null;
}
// 通过站点id查询相关配置信息
// 通过三方平台类型查询相关配置信息
ThirdPartyStationRelation relation = new ThirdPartyStationRelation();
relation.setThirdPartyType(orderInfo.getThirdPartyType());
ThirdPartyStationRelationVO relationInfo = thirdPartyStationRelationService.selectRelationInfo(relation);
// ThirdPartySettingInfo settingInfo = thirdPartySettingInfoService.getInfoByStationId(Long.parseLong(orderInfo.getStationId()));
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 + BusinessInformationExchangeEnum.CHECK_CHARGE_ORDERS.getValue();
JSONObject json = new JSONObject();
json.put("CheckOrderSeq", orderCode);
json.put("StartTime", DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, orderInfo.getChargeStartTime()));
json.put("EndTime", DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, orderInfo.getChargeEndTime()));
json.put("TotalDisputeOrder", 1);
json.put("TotalDisputePower", orderDetail.getTotalUsedElectricity());
json.put("TotalDisputeMoney", orderDetail.getTotalOrderAmount());
ChargeOrder chargeOrder = ChargeOrder.builder()
.startChargeSeq(orderCode)
.totalPower(orderDetail.getTotalUsedElectricity())
.totalMoney(orderDetail.getTotalOrderAmount())
.build();
list.add(chargeOrder);
json.put("DisputeOrders", list);
// 获取令牌
String token = getToken(urlAddress, operatorId, operatorSecret, dataSecretIv, signSecret, dataSecret);
if (StringUtils.isBlank(token)) {
return null;
}
String jsonString = JSON.toJSONString(json);
log.info("请求参数:{}", jsonString);
// 发送请求
String result = HttpRequestUtil.sendPost(token, jsonString, url, dataSecret, dataSecretIv, operatorId, signSecret);
return result;
}
//<---------------------------扩展接口-------------------------->
//TODO 站点变更通知 notification_station_change
//TODO 二维码查询枪号 query_terminal_code
//TODO 推送充电车牌号 notification_charge_carnum
//TODO 超时占位费推送 notification_overtime_order_info
//TODO 账单拉取 query_charge_order_info
/**
* 获取微网快电配置密钥信息
*
@@ -970,36 +891,16 @@ public class weiWangKuaiDianPlatformServiceImpl implements ThirdPartyPlatformSer
List<EquipmentInfo> resultList = new ArrayList<>();
// 通过站点id查询桩基本信息
List<PileBasicInfo> list = pileBasicInfoService.getPileListByStationId(String.valueOf(pileStationInfo.getId()));
// MerchantInfoVO merchantInfo = pileMerchantInfoService.getMerchantInfo(String.valueOf(pileStationInfo.getMerchantId()));
// 封装成联联平台对象
// 封装成中电联平台对象
for (PileBasicInfo pileBasicInfo : list) {
EquipmentInfo equipmentInfo = new EquipmentInfo();
String pileSn = pileBasicInfo.getSn();
equipmentInfo.setEquipmentID(pileSn);
equipmentInfo.setManufacturerID(Constants.OPERATORID_LIANLIAN);
equipmentInfo.setConstructionTime(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD, pileBasicInfo.getCreateTime()));
PileModelInfoVO modelInfo = pileModelInfoService.getPileModelInfoByPileSn(pileSn);
equipmentInfo.setEquipmentType(Integer.valueOf(modelInfo.getSpeedType()));
// Map<String, String> pileStatus = pileConnectorInfoService.getPileStatus(Lists.newArrayList(pileBasicInfo.getSn()));
Map<String, String> pileStatusMap = pileConnectorInfoService.getPileStatus(Lists.newArrayList(pileSn));
String pileStatus = pileStatusMap.get(pileSn);
if (StringUtils.equals(PileStatusEnum.ON_LINE.getValue(), pileStatus)) {
// 1-在线
pileStatus = LianLianPileStatusEnum.NORMAL.getCode();
} else if (StringUtils.equals(PileStatusEnum.OFF_LINE.getValue(), pileStatus)) {
// 2-离线
pileStatus = LianLianPileStatusEnum.CLOSE_OFFLINE.getCode();
} else if (StringUtils.equals(PileStatusEnum.FAULT.getValue(), pileStatus)) {
// 3-故障
pileStatus = LianLianPileStatusEnum.UNDER_MAINTENANCE.getCode();
}
equipmentInfo.setEquipmentStatus(Integer.valueOf(pileStatus));
equipmentInfo.setEquipmentPower(new BigDecimal(modelInfo.getRatedPower()).setScale(1, BigDecimal.ROUND_HALF_UP));
equipmentInfo.setNewNationalStandard(1);
equipmentInfo.setVinFlag(1);
equipmentInfo.setEquipmentType(Integer.parseInt(modelInfo.getSpeedType()));
equipmentInfo.setPower(new BigDecimal(modelInfo.getRatedPower()).setScale(1, BigDecimal.ROUND_HALF_UP));
List<ConnectorInfo> connectorList = getConnectorList(pileBasicInfo);
equipmentInfo.setConnectorInfos(connectorList);
@@ -1035,16 +936,16 @@ public class weiWangKuaiDianPlatformServiceImpl implements ThirdPartyPlatformSer
}
connectorInfo.setVoltageUpperLimits(Integer.valueOf(modelInfo.getRatedVoltage()));
connectorInfo.setVoltageLowerLimits(Integer.valueOf(modelInfo.getRatedVoltage()));
connectorInfo.setCurrent(Integer.valueOf(modelInfo.getRatedCurrent()));
if (!StringUtils.equals(modelInfo.getConnectorNum(), "1")) {
// 如果不是单枪,则枪口功率需要除以枪口数量
String ratedPowerStr = modelInfo.getRatedPower();
BigDecimal ratedPower = new BigDecimal(ratedPowerStr);
connectorInfo.setPower(ratedPower.divide(new BigDecimal(modelInfo.getConnectorNum()), 1, BigDecimal.ROUND_HALF_UP));
}else {
connectorInfo.setPower(new BigDecimal(modelInfo.getRatedPower()).setScale(1, BigDecimal.ROUND_HALF_UP));
}
connectorInfo.setNationalStandard(2);
// if (!StringUtils.equals(modelInfo.getConnectorNum(), "1")) {
// // 如果不是单枪,则枪口功率需要除以枪口数量
// String ratedPowerStr = modelInfo.getRatedPower();
// BigDecimal ratedPower = new BigDecimal(ratedPowerStr);
// connectorInfo.setPower(ratedPower.divide(new BigDecimal(modelInfo.getConnectorNum()), 1, BigDecimal.ROUND_HALF_UP));
// }else {
// }
connectorInfo.setPower(new BigDecimal(modelInfo.getRatedPower()).setScale(1, BigDecimal.ROUND_HALF_UP));
resultList.add(connectorInfo);
}