新增判断桩号是否为电单车的工具类方法

This commit is contained in:
Lemon
2025-12-15 09:35:30 +08:00
parent ec5161dca6
commit 5b959eca97
3 changed files with 56 additions and 1875 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -506,4 +506,19 @@ public class YKCUtils {
return minValue;
}
/**
* 判断是否为汽车桩号
* @return
*/
public static Boolean checkEVPileSn(String pileSn) {
if (StringUtils.isBlank(pileSn)) {
return false;
}
// 起始为 88并且位数为 14 位,判断为汽车桩
if (StringUtils.startsWith(pileSn, "88") && StringUtils.length(pileSn) == 14) {
return true;
}
return false;
}
}

View File

@@ -454,16 +454,18 @@ public class PileBillingTemplateServiceImpl implements PileBillingTemplateServic
@Override
public CurrentTimePriceDetails getCurrentTimePriceDetailsByPileType(String stationId , String pileSn) {
// 使用工具类判断是否为电单车桩
boolean isEBike = YouDianUtils.isEBikePileSn(pileSn);
// boolean isEBike = YouDianUtils.isEBikePileSn(pileSn);
// 判断桩号是否为汽车桩号
Boolean result = YKCUtils.checkEVPileSn(pileSn);
if (!isEBike) {
log.info("走电单车方法");
// 电单车:调用电单车计费模板查询方法
return getCurrentTimePriceDetailsForEBike(stationId);
} else {
if (result) {
log.info("走电动汽车逻辑");
// 电动汽车:调用电动汽车计费模板查询方法
return getCurrentTimePriceDetails(stationId);
} else {
log.info("走电单车方法");
// 电单车:调用电单车计费模板查询方法
return getCurrentTimePriceDetailsForEBike(stationId);
}
}