mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-24 04:55:08 +08:00
update 高德
This commit is contained in:
@@ -379,6 +379,14 @@ public class PileBillingTemplateServiceImpl implements IPileBillingTemplateServi
|
||||
return pileBillingDetails;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BillingTemplateVO> selectBillingTemplateByStationIdList(List<String> stationIdList) {
|
||||
if (CollectionUtils.isEmpty(stationIdList)) {
|
||||
return Lists.newArrayList();
|
||||
}
|
||||
return pileBillingTemplateMapper.selectBillingTemplateByStationIdList(stationIdList);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BillingTemplateVO> queryPublicBillingTemplateList() {
|
||||
return pileBillingTemplateMapper.queryPublicBillingTemplateList();
|
||||
@@ -455,6 +463,45 @@ public class PileBillingTemplateServiceImpl implements IPileBillingTemplateServi
|
||||
return max.orElse(null);
|
||||
}
|
||||
|
||||
/**
|
||||
* 转换参数
|
||||
* @param billingDetailList
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<BillingPriceVO> conversionParameters(List<BillingDetailVO> billingDetailList) {
|
||||
List<BillingPriceVO> resultList = Lists.newArrayList();
|
||||
if (org.springframework.util.CollectionUtils.isEmpty(billingDetailList)) {
|
||||
return resultList;
|
||||
}
|
||||
for (BillingDetailVO billingDetailVO : billingDetailList) {
|
||||
List<String> applyTimeList = billingDetailVO.getApplyTime();
|
||||
BigDecimal electricityPrice = billingDetailVO.getElectricityPrice();
|
||||
BigDecimal servicePrice = billingDetailVO.getServicePrice();
|
||||
for (String applyTime : applyTimeList) {
|
||||
String[] split = applyTime.split("-");
|
||||
// 开始时间
|
||||
String startTime = split[0];
|
||||
// 结束时间
|
||||
String endTime = split[1];
|
||||
// 是否当前时间
|
||||
boolean in = DateUtils.isIn(LocalTime.now(), LocalTime.parse(startTime), LocalTime.parse(endTime));
|
||||
resultList.add(
|
||||
BillingPriceVO.builder()
|
||||
.timeType(billingDetailVO.getTimeType())
|
||||
.startTime(startTime)
|
||||
.endTime(endTime)
|
||||
.electricityPrice(electricityPrice.toString())
|
||||
.servicePrice(servicePrice.toString())
|
||||
.totalPrice(electricityPrice.add(servicePrice).toString())
|
||||
.isCurrentTime(in ? Constants.ONE : Constants.ZERO)
|
||||
.build()
|
||||
);
|
||||
}
|
||||
}
|
||||
return resultList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BillingPriceVO> queryBillingPrice(String stationId) {
|
||||
// 查询站点当前计费模板 有缓存
|
||||
|
||||
Reference in New Issue
Block a user