mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-19 18:45:03 +08:00
Merge branch 'dev-zza' into dev
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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())) {
|
||||
// 将结束时间的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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user