深圳停车平台

This commit is contained in:
Guoqs
2025-02-14 17:01:48 +08:00
parent e18cd482fa
commit f7057f925f
7 changed files with 823 additions and 38 deletions

View File

@@ -93,6 +93,9 @@ public class CommonService {
@Autowired
private ZDLService zdlService;
@Autowired
private ChargeParkingDiscountService chargeParkingDiscountService;
@Autowired
private CarCouponRecordService carCouponRecordService;
@@ -687,7 +690,7 @@ public class CommonService {
*/
public void bindParkingCoupon(RealTimeMonitorData realTimeMonitorData, OrderBasicInfo orderBasicInfo) throws UnsupportedEncodingException {
// 判断该订单的站点是否有停车优惠
ChargeParkingDiscountVO chargeParkingDiscount = getChargeParkingDiscount(orderBasicInfo.getStationId());
ChargeParkingDiscountVO chargeParkingDiscount = chargeParkingDiscountService.getChargeParkingDiscount(orderBasicInfo.getStationId());
if (chargeParkingDiscount == null) {
return;
}
@@ -697,12 +700,12 @@ public class CommonService {
String conditionType = chargeParkingDiscount.getConditionType();
// 如果conditionType为1判断充电度数, 如果为2判断充电时长
boolean flag = false;
if (StringUtils.equals(conditionType, "1")) {
if (StringUtils.equals(conditionType, Constants.ONE)) {
if (Integer.parseInt(chargingDegree) >= Integer.parseInt(chargeParkingDiscount.getConditionValue())) {
// 发券
flag = true;
}
} else if (StringUtils.equals(conditionType, "2")) {
} else if (StringUtils.equals(conditionType, Constants.TWO)) {
if (Integer.parseInt(sumChargingTime) >= Integer.parseInt(chargeParkingDiscount.getConditionValue())) {
// 发券
flag = true;
@@ -742,16 +745,13 @@ public class CommonService {
// 绑定优惠券
String s = ltytService.bindCoupon(dto);
// 如果s为ok, discountFlag为true
if (StringUtils.equals(s, "ok")) {
discountFlag = true;
}
discountFlag = StringUtils.equals(s, "ok");
} else if (StringUtils.equals(ParkingPlatformEnum.SHEN_ZHEN_PLATFORM.getCode(), stationInfo.getParkingId())) {
// 深圳道闸
QcyunParkCouponDTO dto = QcyunParkCouponDTO.builder()
.plateNumber(orderBasicInfo.getPlateNumber())
.stationId(orderBasicInfo.getStationId())
.stationName(stationInfo.getStationName())
.parkId(stationInfo.getParkingId())
.build();
discountFlag = qcyunsService.issuanceOfParkingTickets(dto);
}
@@ -771,37 +771,6 @@ public class CommonService {
}
}
/**
* TODO 先做个临时方法返回ChargeParkingDiscountVO, 后面改为后面页面配置
*
* @param stationId
* @return
*/
private ChargeParkingDiscountVO getChargeParkingDiscount(String stationId) {
// 查询该站点的停车优惠信息
ChargeParkingDiscountVO discountVO = new ChargeParkingDiscountVO();
if (StringUtils.equals(stationId, "")) {
discountVO.setStationId(stationId);
discountVO.setConditionType("2");
discountVO.setConditionValue("10");
discountVO.setDiscountType("");
discountVO.setDiscountValue("");
discountVO.setStartTime("");
discountVO.setEndTime("");
} else if (StringUtils.equals(stationId, "")) {
discountVO.setStationId(stationId);
discountVO.setConditionType("");
discountVO.setConditionValue("");
discountVO.setDiscountType("");
discountVO.setDiscountValue("");
discountVO.setStartTime("");
discountVO.setEndTime("");
} else {
discountVO = null;
}
return discountVO;
}
/**
* 统一请求启动充电,目前给华为平台用
* @param dto