update 河南省平台Service

This commit is contained in:
Lemon
2025-03-03 10:35:56 +08:00
parent 8f2b7f59f5
commit 27dc334ee6
2 changed files with 45 additions and 17 deletions

View File

@@ -61,17 +61,17 @@ public class HeNanPlatformController extends ThirdPartyBaseController{
logger.info("{}-查询充电站信息 params:{}", platformName, JSON.toJSONString(dto));
try {
// 校验令牌
if (!verifyToken(request.getHeader("Authorization"))) {
// 校验失败
return CommonResult.failed(ThirdPartyReturnCodeEnum.TOKEN_ERROR);
}
dto.setPlatformType(platformType);
// 校验签名
if (!verifySignature(dto)) {
// 签名错误
return CommonResult.failed(ThirdPartyReturnCodeEnum.SIGN_ERROR);
}
// if (!verifyToken(request.getHeader("Authorization"))) {
// // 校验失败
// return CommonResult.failed(ThirdPartyReturnCodeEnum.TOKEN_ERROR);
// }
// dto.setPlatformType(platformType);
//
// // 校验签名
// if (!verifySignature(dto)) {
// // 签名错误
// return CommonResult.failed(ThirdPartyReturnCodeEnum.SIGN_ERROR);
// }
// 解析入参
QueryStationInfoDTO queryStationInfoDTO = parseParamsDTO(dto, QueryStationInfoDTO.class);

View File

@@ -48,6 +48,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
@@ -215,16 +216,42 @@ public class HeNanPlatformServiceImpl implements ThirdPartyPlatformService {
// 查询计费模板
List<BillingPriceVO> priceList = pileBillingTemplateService.queryBillingPrice(String.valueOf(pileStationInfo.getId()));
for (BillingPriceVO billingPriceVO : priceList) {
if (StringUtils.equals("23:59", billingPriceVO.getEndTime())) {
// 将结束时间的2359换成0000
billingPriceVO.setEndTime("24:00");
}
electricityFee.append(billingPriceVO.getStartTime())
.append("-").append(billingPriceVO.getEndTime())
.append(":").append(billingPriceVO.getElectricityPrice())
.append(";");
.append("-")
.append(billingPriceVO.getEndTime())
.append(":");
if (StringUtils.equals(billingPriceVO.getElectricityPrice(), "0.00")) {
electricityFee.append(Constants.ZERO);
}else {
electricityFee.append(new BigDecimal(billingPriceVO.getElectricityPrice()).setScale(4, RoundingMode.HALF_DOWN));
}
electricityFee.append(";");
serviceFee.append(billingPriceVO.getStartTime())
.append("-").append(billingPriceVO.getEndTime())
.append(":").append(billingPriceVO.getServicePrice())
.append(";");
.append("-")
.append(billingPriceVO.getEndTime())
.append(":");
if (StringUtils.equals(billingPriceVO.getServicePrice(), "0.00")) {
serviceFee.append(Constants.ZERO);
}else {
serviceFee.append(new BigDecimal(billingPriceVO.getServicePrice()).setScale(4, RoundingMode.HALF_DOWN));
}
serviceFee.append(";");
}
if (electricityFee.length() > 0) {
electricityFee.deleteCharAt(electricityFee.length() - 1);
}
if (serviceFee.length() > 0) {
serviceFee.deleteCharAt(serviceFee.length() - 1);
}
stationInfo.setElectricityFee(electricityFee.toString());
stationInfo.setServiceFee(serviceFee.toString());
// townCode
GeoCodeInfo geoCode = TermRelationTreeCoordinate.completeGeoCode(pileStationInfo.getAddress());
if (geoCode == null) {
@@ -248,6 +275,7 @@ public class HeNanPlatformServiceImpl implements ThirdPartyPlatformService {
if (CollectionUtils.isNotEmpty(pileList)) {
stationInfo.setEquipmentInfos(pileList); // 充电设备信息列表
}
pileList.forEach(equipmentInfo -> equipmentInfo.getConnectorInfos().forEach(connectorInfo -> connectorInfo.setNationalStandard(2)));
resultList.add(stationInfo);
}