mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-07-03 05:28:03 +08:00
update
This commit is contained in:
@@ -175,6 +175,14 @@ public interface PileBillingTemplateService {
|
|||||||
*/
|
*/
|
||||||
CurrentTimePriceDetails getCurrentTimePriceDetails(String stationId);
|
CurrentTimePriceDetails getCurrentTimePriceDetails(String stationId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用于微信发送微信提醒,查询计费详情
|
||||||
|
* @param stationId
|
||||||
|
* @param pileSn
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
CurrentTimePriceDetails getCurrentTimePriceDetailsByPileType(String stationId , String pileSn);
|
||||||
|
|
||||||
List<PileBillingDetail> queryBillingDetailById(Long id);
|
List<PileBillingDetail> queryBillingDetailById(Long id);
|
||||||
|
|
||||||
int deletePreferentialBillingTemplate(String stationId);
|
int deletePreferentialBillingTemplate(String stationId);
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import com.alibaba.fastjson2.JSON;
|
|||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
import com.google.common.collect.Maps;
|
import com.google.common.collect.Maps;
|
||||||
import com.google.common.primitives.Bytes;
|
import com.google.common.primitives.Bytes;
|
||||||
|
import com.jsowell.common.YouDianUtils;
|
||||||
import com.jsowell.common.constant.CacheConstants;
|
import com.jsowell.common.constant.CacheConstants;
|
||||||
import com.jsowell.common.constant.Constants;
|
import com.jsowell.common.constant.Constants;
|
||||||
import com.jsowell.common.core.domain.vo.AuthorizedDeptVO;
|
import com.jsowell.common.core.domain.vo.AuthorizedDeptVO;
|
||||||
@@ -364,7 +365,7 @@ public class PileBillingTemplateServiceImpl implements PileBillingTemplateServic
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过站点id查询当前时间的收费详情
|
* 通过站点id查询当前时间的收费详情 (用于查询电动汽车的收费详情)
|
||||||
*
|
*
|
||||||
* @param stationId 站点id
|
* @param stationId 站点id
|
||||||
*/
|
*/
|
||||||
@@ -425,6 +426,96 @@ public class PileBillingTemplateServiceImpl implements PileBillingTemplateServic
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过站点id查询当前时间的收费详情 (用于查询电动单车的收费详情)
|
||||||
|
*
|
||||||
|
* @param stationId 站点id
|
||||||
|
*/
|
||||||
|
// @Override
|
||||||
|
public CurrentTimePriceDetails getCurrentTimePriceDetailsForEBike(String stationId) {
|
||||||
|
CurrentTimePriceDetails result = null;
|
||||||
|
// 查询当前时段电费
|
||||||
|
LocalTime localTime = LocalTime.now();
|
||||||
|
String now = LocalTime.of(localTime.getHour(), localTime.getMinute(), localTime.getSecond()).toString();
|
||||||
|
// 通过站点id查询计费模板
|
||||||
|
BillingTemplateVO billingTemplateVO = queryUsedBillingTemplateForEBike(stationId);
|
||||||
|
|
||||||
|
if (Objects.nonNull(billingTemplateVO)) {
|
||||||
|
result = new CurrentTimePriceDetails();
|
||||||
|
result.setTemplateCode(billingTemplateVO.getTemplateCode());
|
||||||
|
result.setStationId(stationId);
|
||||||
|
result.setDateTime(localTime.toString());
|
||||||
|
result.setFreeTime(billingTemplateVO.getFreeTime());
|
||||||
|
result.setOccupyFee(billingTemplateVO.getOccupyFee());
|
||||||
|
List<BillingDetailVO> billingDetailList = billingTemplateVO.getBillingDetailList();
|
||||||
|
for (BillingDetailVO detailVO : billingDetailList) {
|
||||||
|
List<String> applyTimeList = detailVO.getApplyTime();
|
||||||
|
for (String applyTime : applyTimeList) {
|
||||||
|
boolean b = DateUtils.checkTime(now + "-" + now, applyTime);
|
||||||
|
if (b) {
|
||||||
|
// 将桩的费率存入stationVO
|
||||||
|
BigDecimal electricityPrice = detailVO.getElectricityPrice();
|
||||||
|
BigDecimal servicePrice = detailVO.getServicePrice();
|
||||||
|
result.setElectricityPrice(electricityPrice.toString());
|
||||||
|
result.setServicePrice(servicePrice.toString());
|
||||||
|
result.setTotalPrice(electricityPrice.add(servicePrice).toString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询站点的集团会员计费模板
|
||||||
|
BillingTemplateVO preferentialBillingTemplate = this.queryPreferentialBillingTemplate(stationId);
|
||||||
|
if (Objects.nonNull(preferentialBillingTemplate) && Objects.nonNull(result) ) {
|
||||||
|
List<BillingDetailVO> billingDetailList = preferentialBillingTemplate.getBillingDetailList();
|
||||||
|
for (BillingDetailVO detailVO : billingDetailList) {
|
||||||
|
List<String> applyTimeList = detailVO.getApplyTime();
|
||||||
|
for (String applyTime : applyTimeList) {
|
||||||
|
boolean b = DateUtils.checkTime(now + "-" + now, applyTime);
|
||||||
|
if (b) {
|
||||||
|
// 将桩的费率存入stationVO
|
||||||
|
BigDecimal electricityPrice = detailVO.getElectricityPrice();
|
||||||
|
BigDecimal servicePrice = detailVO.getServicePrice();
|
||||||
|
result.setDisplayFlag(preferentialBillingTemplate.getDisplayFlag());
|
||||||
|
result.setVipElectricityPrice(electricityPrice.toString());
|
||||||
|
result.setVipServicePrice(servicePrice.toString());
|
||||||
|
result.setVipTotalPrice(electricityPrice.add(servicePrice).toString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return result;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用于微信发送微信提醒,查询计费详情
|
||||||
|
* @param stationId
|
||||||
|
* @param pileSn
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public CurrentTimePriceDetails getCurrentTimePriceDetailsByPileType(String stationId , String pileSn) {
|
||||||
|
// 使用工具类判断是否为电单车桩
|
||||||
|
boolean isEBike = YouDianUtils.isEBikePileSn(pileSn);
|
||||||
|
|
||||||
|
if (isEBike) {
|
||||||
|
// 电单车:调用电单车计费模板查询方法
|
||||||
|
return getCurrentTimePriceDetailsForEBike(stationId);
|
||||||
|
} else {
|
||||||
|
// 电动汽车:调用电动汽车计费模板查询方法
|
||||||
|
return getCurrentTimePriceDetails(stationId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过计费模板id查询计费模板详情
|
* 通过计费模板id查询计费模板详情
|
||||||
* 缓存1天,修改清缓存
|
* 缓存1天,修改清缓存
|
||||||
@@ -630,6 +721,7 @@ public class PileBillingTemplateServiceImpl implements PileBillingTemplateServic
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public BillingTemplateVO queryUsedBillingTemplateForEV(String stationId) {
|
public BillingTemplateVO queryUsedBillingTemplateForEV(String stationId) {
|
||||||
|
|
||||||
List<BillingTemplateVO> list = queryStationBillingTemplateListForUniApp(stationId);
|
List<BillingTemplateVO> list = queryStationBillingTemplateListForUniApp(stationId);
|
||||||
Optional<BillingTemplateVO> max = list.stream()
|
Optional<BillingTemplateVO> max = list.stream()
|
||||||
.filter(x -> StringUtils.equals(x.getDeviceType(), Constants.ONE)) // 过滤出汽车桩的计费模板(1-电动汽车;2-电动自行车)
|
.filter(x -> StringUtils.equals(x.getDeviceType(), Constants.ONE)) // 过滤出汽车桩的计费模板(1-电动汽车;2-电动自行车)
|
||||||
|
|||||||
@@ -241,7 +241,8 @@ public class WxAppletRemoteService {
|
|||||||
// 订单编号
|
// 订单编号
|
||||||
startChargingMessage.setOrderCode(sendMessageVO.getOrderCode());
|
startChargingMessage.setOrderCode(sendMessageVO.getOrderCode());
|
||||||
// 收费标准
|
// 收费标准
|
||||||
CurrentTimePriceDetails currentTimePriceDetails = pileBillingTemplateService.getCurrentTimePriceDetails(sendMessageVO.getStationId());
|
CurrentTimePriceDetails currentTimePriceDetails = pileBillingTemplateService.getCurrentTimePriceDetailsByPileType(sendMessageVO.getStationId(),sendMessageVO.getPileSn());
|
||||||
|
|
||||||
startChargingMessage.setTotalPrice(currentTimePriceDetails.getTotalPrice() + " 元/度");
|
startChargingMessage.setTotalPrice(currentTimePriceDetails.getTotalPrice() + " 元/度");
|
||||||
// 枪口编号
|
// 枪口编号
|
||||||
startChargingMessage.setPileConnectorCode(sendMessageVO.getPileSn() + "桩" + sendMessageVO.getConnectorCode() + "枪口");
|
startChargingMessage.setPileConnectorCode(sendMessageVO.getPileSn() + "桩" + sendMessageVO.getConnectorCode() + "枪口");
|
||||||
|
|||||||
Reference in New Issue
Block a user