From 27dc334ee6b0d10e89b8f111e9cf3f4b77237c92 Mon Sep 17 00:00:00 2001 From: Lemon Date: Mon, 3 Mar 2025 10:35:56 +0800 Subject: [PATCH] =?UTF-8?q?update=20=20=E6=B2=B3=E5=8D=97=E7=9C=81?= =?UTF-8?q?=E5=B9=B3=E5=8F=B0Service?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../thirdparty/HeNanPlatformController.java | 22 +++++----- .../impl/HeNanPlatformServiceImpl.java | 40 ++++++++++++++++--- 2 files changed, 45 insertions(+), 17 deletions(-) diff --git a/jsowell-admin/src/main/java/com/jsowell/api/thirdparty/HeNanPlatformController.java b/jsowell-admin/src/main/java/com/jsowell/api/thirdparty/HeNanPlatformController.java index 65152be31..47eb66f43 100644 --- a/jsowell-admin/src/main/java/com/jsowell/api/thirdparty/HeNanPlatformController.java +++ b/jsowell-admin/src/main/java/com/jsowell/api/thirdparty/HeNanPlatformController.java @@ -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); diff --git a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/service/impl/HeNanPlatformServiceImpl.java b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/service/impl/HeNanPlatformServiceImpl.java index 6d4e1590f..f8d4ec558 100644 --- a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/service/impl/HeNanPlatformServiceImpl.java +++ b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/service/impl/HeNanPlatformServiceImpl.java @@ -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 priceList = pileBillingTemplateService.queryBillingPrice(String.valueOf(pileStationInfo.getId())); for (BillingPriceVO billingPriceVO : priceList) { + if (StringUtils.equals("23:59", billingPriceVO.getEndTime())) { + // 将结束时间的23:59换成00:00 + 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); }