mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-20 02:55:04 +08:00
update 预约充电
This commit is contained in:
@@ -9,7 +9,7 @@ public enum PileConnectorDataBaseStatusEnum {
|
|||||||
FREE("1", "空闲"),
|
FREE("1", "空闲"),
|
||||||
OCCUPIED_NOT_CHARGED("2", "占用(未充电)"),
|
OCCUPIED_NOT_CHARGED("2", "占用(未充电)"),
|
||||||
OCCUPIED_CHARGING("3", "占用(充电中)"),
|
OCCUPIED_CHARGING("3", "占用(充电中)"),
|
||||||
OCCUPIED_APPOINTMENT_LOCK("4", "占用(预约锁定)"),
|
OCCUPIED_RESERVED_LOCK("4", "占用(预约锁定)"),
|
||||||
FAULT("255", "故障")
|
FAULT("255", "故障")
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|||||||
@@ -151,14 +151,19 @@ public class OrderBasicInfo {
|
|||||||
private Date chargeEndTime;
|
private Date chargeEndTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 启动类型(now-立即启动;appointment-预约启动)
|
* 启动类型(now-立即启动;reserved-预约启动)
|
||||||
*/
|
*/
|
||||||
private String startType;
|
private String startType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 预约时间
|
* 预约开始时间
|
||||||
*/
|
*/
|
||||||
private Date appointmentTime;
|
private Date reservedStartTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 预约结束时间
|
||||||
|
*/
|
||||||
|
private Date reservedEndTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 开始SOC
|
* 开始SOC
|
||||||
|
|||||||
@@ -39,12 +39,12 @@ public class ReservedChargingCommand {
|
|||||||
/**
|
/**
|
||||||
* 开始时间
|
* 开始时间
|
||||||
*/
|
*/
|
||||||
private Date appointmentStartTime;
|
private Date reservedStartTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 结束时间
|
* 结束时间
|
||||||
*/
|
*/
|
||||||
private Date appointmentEndTime;
|
private Date reservedEndTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 启动金额
|
* 启动金额
|
||||||
|
|||||||
@@ -60,9 +60,14 @@ public class GenerateOrderDTO extends BasicPileDTO{
|
|||||||
private String startType;
|
private String startType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 预约时间
|
* 预约开始时间
|
||||||
*/
|
*/
|
||||||
private String appointmentTime;
|
private String reservedStartTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 预约结束时间
|
||||||
|
*/
|
||||||
|
private String reservedEndTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 使用刷卡创建订单时有值
|
* 使用刷卡创建订单时有值
|
||||||
|
|||||||
@@ -258,7 +258,7 @@ public interface OrderBasicInfoMapper {
|
|||||||
*/
|
*/
|
||||||
List<PersonPileConnectorSumInfoVO> getAccumulativeInfo(QueryPersonPileDTO dto);
|
List<PersonPileConnectorSumInfoVO> getAccumulativeInfo(QueryPersonPileDTO dto);
|
||||||
|
|
||||||
List<OrderBasicInfo> getAppointmentOrder(LocalDateTime dateTime);
|
List<OrderBasicInfo> getReservedOrder(LocalDateTime dateTime);
|
||||||
|
|
||||||
List<OrderVO> getListByOrderCodes(@Param("orderCodes") List<String> orderCodes);
|
List<OrderVO> getListByOrderCodes(@Param("orderCodes") List<String> orderCodes);
|
||||||
|
|
||||||
|
|||||||
@@ -298,7 +298,7 @@ public interface OrderBasicInfoService{
|
|||||||
*/
|
*/
|
||||||
void updateOrderStatusAsAbnormal(String pileSn);
|
void updateOrderStatusAsAbnormal(String pileSn);
|
||||||
|
|
||||||
List<OrderBasicInfo> getAppointmentOrder(LocalDateTime dateTime);
|
List<OrderBasicInfo> getReservedOrder(LocalDateTime dateTime);
|
||||||
|
|
||||||
Map<String, Object> generateOrderByCard(GenerateOrderDTO dto) throws Exception;
|
Map<String, Object> generateOrderByCard(GenerateOrderDTO dto) throws Exception;
|
||||||
|
|
||||||
|
|||||||
@@ -544,8 +544,8 @@ public class OrderBasicInfoServiceImpl implements OrderBasicInfoService {
|
|||||||
Date payTime = orderBasicInfo.getPayTime();
|
Date payTime = orderBasicInfo.getPayTime();
|
||||||
time = payTime == null ? 0L : payTime.getTime();
|
time = payTime == null ? 0L : payTime.getTime();
|
||||||
} else {
|
} else {
|
||||||
Date appointmentTime = orderBasicInfo.getAppointmentTime();
|
Date reservedStartTime = orderBasicInfo.getReservedStartTime();
|
||||||
time = appointmentTime == null ? 0L : appointmentTime.getTime();
|
time = reservedStartTime == null ? 0L : reservedStartTime.getTime();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (currentTimeMillis - time < 1000 * 60 * 15) {
|
if (currentTimeMillis - time < 1000 * 60 * 15) {
|
||||||
@@ -2380,8 +2380,8 @@ public class OrderBasicInfoServiceImpl implements OrderBasicInfoService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<OrderBasicInfo> getAppointmentOrder(LocalDateTime dateTime) {
|
public List<OrderBasicInfo> getReservedOrder(LocalDateTime dateTime) {
|
||||||
return orderBasicInfoMapper.getAppointmentOrder(dateTime);
|
return orderBasicInfoMapper.getReservedOrder(dateTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -3549,7 +3549,8 @@ public class OrderBasicInfoServiceImpl implements OrderBasicInfoService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (StringUtils.equals(dto.getStartType(), StartTypeEnum.RESERVED.getValue())) {
|
if (StringUtils.equals(dto.getStartType(), StartTypeEnum.RESERVED.getValue())) {
|
||||||
orderBasicInfo.setAppointmentTime(DateUtils.parseDate(dto.getAppointmentTime(), DateUtils.YYYY_MM_DD_HH_MM_SS));
|
orderBasicInfo.setReservedStartTime(DateUtils.parseDate(dto.getReservedStartTime(), DateUtils.YYYY_MM_DD_HH_MM_SS));
|
||||||
|
orderBasicInfo.setReservedEndTime(DateUtils.parseDate(dto.getReservedEndTime(), DateUtils.YYYY_MM_DD_HH_MM_SS));
|
||||||
}
|
}
|
||||||
|
|
||||||
// 订单详情
|
// 订单详情
|
||||||
|
|||||||
@@ -493,12 +493,12 @@ public class YKCPushCommandServiceImpl implements YKCPushCommandService {
|
|||||||
byte[] operateByteArr = BytesUtil.str2Bcd(operation);
|
byte[] operateByteArr = BytesUtil.str2Bcd(operation);
|
||||||
|
|
||||||
// 开始时间
|
// 开始时间
|
||||||
Date appointmentStartTime = command.getAppointmentStartTime();
|
Date reservedStartTime = command.getReservedStartTime();
|
||||||
byte[] appointmentStartTimeByteArr = Cp56Time2aUtil.date2Hbyte(DateUtils.parseDate(appointmentStartTime));
|
byte[] reservedStartTimeByteArr = Cp56Time2aUtil.date2Hbyte(DateUtils.parseDate(reservedStartTime));
|
||||||
|
|
||||||
// 结束时间
|
// 结束时间
|
||||||
Date appointmentEndTime = command.getAppointmentEndTime();
|
Date reservedEndTime = command.getReservedEndTime();
|
||||||
byte[] appointmentEndTimeByteArr = Cp56Time2aUtil.date2Hbyte(DateUtils.parseDate(appointmentEndTime));
|
byte[] reservedEndTimeByteArr = Cp56Time2aUtil.date2Hbyte(DateUtils.parseDate(reservedEndTime));
|
||||||
|
|
||||||
// 启动金额
|
// 启动金额
|
||||||
BigDecimal amount = command.getAmount();
|
BigDecimal amount = command.getAmount();
|
||||||
@@ -506,7 +506,7 @@ public class YKCPushCommandServiceImpl implements YKCPushCommandService {
|
|||||||
|
|
||||||
// 拼装msg信息
|
// 拼装msg信息
|
||||||
byte[] msg = Bytes.concat(transactionCodeArr, pileSnByteArr, connectorCodeByteArr, operateByteArr,
|
byte[] msg = Bytes.concat(transactionCodeArr, pileSnByteArr, connectorCodeByteArr, operateByteArr,
|
||||||
appointmentStartTimeByteArr, appointmentEndTimeByteArr, amountByteArr);
|
reservedStartTimeByteArr, reservedEndTimeByteArr, amountByteArr);
|
||||||
this.push(msg, pileSn, YKCFrameTypeCode.RESERVE_CHARGING_CODE);
|
this.push(msg, pileSn, YKCFrameTypeCode.RESERVE_CHARGING_CODE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -772,177 +772,6 @@ public abstract class AbstractProgramLogic implements InitializingBean {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 保存订单信息到数据库
|
|
||||||
* 2024年3月11日14点04分修改,使用OrderBasicInfoService中的公共方法
|
|
||||||
* @param dto
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
// protected OrderBasicInfo saveOrder2Database(GenerateOrderDTO dto) throws ParseException {
|
|
||||||
// String orderCode = generateNewOrderCode();
|
|
||||||
// String transactionCode = IdUtils.generateTransactionCode(dto.getPileSn(), dto.getConnectorCode());
|
|
||||||
//
|
|
||||||
// if (StringUtils.isBlank(dto.getStartType())) {
|
|
||||||
// dto.setStartType(StartTypeEnum.NOW.getValue());
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// String stationId = dto.getPileConnector().getStationId();
|
|
||||||
// // 查询站点信息
|
|
||||||
// PileStationInfo pileStationInfo = pileStationInfoService.selectPileStationInfoById(Long.valueOf(stationId));
|
|
||||||
// String merchantId = pileStationInfo != null ? String.valueOf(pileStationInfo.getMerchantId()) : "";
|
|
||||||
// String plateNumber = dto.getPlateNumber() != null ? dto.getPlateNumber() : "";
|
|
||||||
// // 订单基本信息
|
|
||||||
// OrderBasicInfo orderBasicInfo = OrderBasicInfo.builder()
|
|
||||||
// .orderCode(orderCode)
|
|
||||||
// .transactionCode(transactionCode)
|
|
||||||
// .orderStatus(OrderStatusEnum.NOT_START.getValue())
|
|
||||||
// .memberId(dto.getMemberId())
|
|
||||||
// .stationId(stationId)
|
|
||||||
// .merchantId(merchantId)
|
|
||||||
// .pileSn(dto.getPileSn())
|
|
||||||
// .connectorCode(dto.getConnectorCode())
|
|
||||||
// .pileConnectorCode(dto.getPileSn() + dto.getConnectorCode())
|
|
||||||
// .startMode(dto.getStartMode())
|
|
||||||
// .payStatus(Constants.ZERO)
|
|
||||||
// .payAmount(dto.getChargeAmount())
|
|
||||||
// .payMode(dto.getPayMode())
|
|
||||||
// .plateNumber(plateNumber)
|
|
||||||
// .orderAmount(BigDecimal.ZERO)
|
|
||||||
// .virtualAmount(BigDecimal.ZERO)
|
|
||||||
// .settleAmount(BigDecimal.ZERO)
|
|
||||||
// .startType(dto.getStartType())
|
|
||||||
// .build();
|
|
||||||
// if (StringUtils.equals(dto.getStartMode(), StartModeEnum.AUTH_CARD.getValue())) {
|
|
||||||
// // 鉴权卡启动
|
|
||||||
// orderBasicInfo.setLogicCard(dto.getPileAuthCardInfo().getLogicCard());
|
|
||||||
// }
|
|
||||||
// if (StringUtils.equals(dto.getStartMode(), StartModeEnum.VIN_CODE.getValue())) {
|
|
||||||
// // vin启动
|
|
||||||
// MemberPlateNumberRelation memberPlateNumberRelation = dto.getMemberPlateNumberRelation();
|
|
||||||
// if (memberPlateNumberRelation != null) {
|
|
||||||
// if (StringUtils.isNotBlank(memberPlateNumberRelation.getVinCode())) {
|
|
||||||
// orderBasicInfo.setVinCode(memberPlateNumberRelation.getVinCode());
|
|
||||||
// }
|
|
||||||
// if (StringUtils.isNotBlank(memberPlateNumberRelation.getLicensePlateNumber())) {
|
|
||||||
// orderBasicInfo.setPlateNumber(memberPlateNumberRelation.getLicensePlateNumber());
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// if (StringUtils.equals(dto.getStartType(), StartTypeEnum.APPOINTMENT.getValue())) {
|
|
||||||
// orderBasicInfo.setAppointmentTime(DateUtils.parseDate(dto.getAppointmentTime(), DateUtils.YYYY_MM_DD_HH_MM_SS));
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// // 订单详情
|
|
||||||
// BillingTemplateVO billingTemplate = dto.getBillingTemplate();
|
|
||||||
// logger.info("订单使用的计费模板-orderCode:{}, billingTemplate:{}", orderCode, JSON.toJSONString(billingTemplate));
|
|
||||||
// BigDecimal sharpElectricityPrice = billingTemplate.getSharpElectricityPrice() != null ? billingTemplate.getSharpElectricityPrice() : BigDecimal.ZERO;
|
|
||||||
// BigDecimal sharpServicePrice = billingTemplate.getSharpServicePrice() != null ? billingTemplate.getSharpServicePrice() : BigDecimal.ZERO;
|
|
||||||
// BigDecimal peakElectricityPrice = billingTemplate.getPeakElectricityPrice() != null ? billingTemplate.getPeakElectricityPrice() : BigDecimal.ZERO;
|
|
||||||
// BigDecimal peakServicePrice = billingTemplate.getPeakServicePrice() != null ? billingTemplate.getPeakServicePrice() : BigDecimal.ZERO;
|
|
||||||
// BigDecimal flatElectricityPrice = billingTemplate.getFlatElectricityPrice() != null ? billingTemplate.getFlatElectricityPrice() : BigDecimal.ZERO;
|
|
||||||
// BigDecimal flatServicePrice = billingTemplate.getFlatServicePrice() != null ? billingTemplate.getFlatServicePrice() : BigDecimal.ZERO;
|
|
||||||
// BigDecimal valleyElectricityPrice = billingTemplate.getValleyElectricityPrice() != null ? billingTemplate.getValleyElectricityPrice() : BigDecimal.ZERO;
|
|
||||||
// BigDecimal valleyServicePrice = billingTemplate.getValleyServicePrice() != null ? billingTemplate.getValleyServicePrice() : BigDecimal.ZERO;
|
|
||||||
//
|
|
||||||
// OrderDetail orderDetail = OrderDetail.builder()
|
|
||||||
// .orderCode(orderCode)
|
|
||||||
// .sharpPrice(sharpElectricityPrice.add(sharpServicePrice))
|
|
||||||
// .sharpElectricityPrice(sharpElectricityPrice)
|
|
||||||
// .sharpServicePrice(sharpServicePrice)
|
|
||||||
// .peakPrice(peakElectricityPrice.add(peakServicePrice))
|
|
||||||
// .peakElectricityPrice(peakElectricityPrice)
|
|
||||||
// .peakServicePrice(peakServicePrice)
|
|
||||||
// .flatPrice(flatElectricityPrice.add(flatServicePrice))
|
|
||||||
// .flatElectricityPrice(flatElectricityPrice)
|
|
||||||
// .flatServicePrice(flatServicePrice)
|
|
||||||
// .valleyPrice(valleyElectricityPrice.add(valleyServicePrice))
|
|
||||||
// .valleyElectricityPrice(valleyElectricityPrice)
|
|
||||||
// .valleyServicePrice(valleyServicePrice)
|
|
||||||
// .build();
|
|
||||||
//
|
|
||||||
// OrderTransactionDTO createOrderTransactionDTO = OrderTransactionDTO.builder()
|
|
||||||
// .orderBasicInfo(orderBasicInfo)
|
|
||||||
// .orderDetail(orderDetail)
|
|
||||||
// .build();
|
|
||||||
// transactionService.doCreateOrder(createOrderTransactionDTO);
|
|
||||||
// return orderBasicInfo;
|
|
||||||
// }
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 计算订单折扣
|
|
||||||
* @param orderBasicInfo 订单主表
|
|
||||||
* @param orderDetail 订单详情
|
|
||||||
*/
|
|
||||||
// protected void calculateOrderDiscounts(OrderBasicInfo orderBasicInfo, OrderDetail orderDetail) {
|
|
||||||
// String memberId = orderBasicInfo.getMemberId(); // 会员id
|
|
||||||
// String merchantId = orderBasicInfo.getMerchantId(); // 运营商id
|
|
||||||
// String stationId = orderBasicInfo.getStationId(); // 站点id
|
|
||||||
//
|
|
||||||
// // 电费折扣金额
|
|
||||||
// BigDecimal discountElectricityAmount = BigDecimal.ZERO;
|
|
||||||
// // 服务费折扣金额
|
|
||||||
// BigDecimal discountServiceAmount = BigDecimal.ZERO;
|
|
||||||
// // 优惠后服务费金额 初始值为优惠前金额
|
|
||||||
// BigDecimal afterServiceAmountDiscount = orderDetail.getTotalServiceAmount();
|
|
||||||
// // 优惠后电费金额 初始值为优惠前金额
|
|
||||||
// BigDecimal afterElectricityAmountDiscount = orderDetail.getTotalElectricityAmount();
|
|
||||||
//
|
|
||||||
// // 查询会员在此站点会员折扣
|
|
||||||
// MemberDiscountVO memberDiscountVO = memberGroupService.queryMemberDiscount(merchantId, stationId, memberId);
|
|
||||||
// if (memberDiscountVO != null) {
|
|
||||||
// BigDecimal discount = memberDiscountVO.getDiscount(); // 折扣率
|
|
||||||
// String groupType = memberDiscountVO.getGroupType(); // 类型(1-服务费折扣,2-电费折扣 ,3-电费和服务费一起折扣)
|
|
||||||
// BigDecimal totalElectricityAmount = orderDetail.getTotalElectricityAmount(); // 电费
|
|
||||||
// BigDecimal totalServiceAmount = orderDetail.getTotalServiceAmount(); // 服务费
|
|
||||||
//
|
|
||||||
// // 未进行打折前
|
|
||||||
// afterServiceAmountDiscount = totalServiceAmount;
|
|
||||||
// afterElectricityAmountDiscount = totalElectricityAmount;
|
|
||||||
// if (Constants.ONE.equals(groupType)) {
|
|
||||||
// // 服务费折扣
|
|
||||||
// afterServiceAmountDiscount = totalServiceAmount.multiply(discount).setScale(4, RoundingMode.DOWN);
|
|
||||||
// discountServiceAmount = totalServiceAmount.subtract(afterServiceAmountDiscount);
|
|
||||||
// } else if (Constants.TWO.equals(groupType)) {
|
|
||||||
// // 电费折扣
|
|
||||||
// afterElectricityAmountDiscount = totalElectricityAmount.multiply(discount).setScale(4, RoundingMode.DOWN);
|
|
||||||
// discountElectricityAmount = totalElectricityAmount.subtract(afterElectricityAmountDiscount);
|
|
||||||
// } else {
|
|
||||||
// // BigDecimal afterServiceAmountDiscount = totalServiceAmount.multiply(discount).setScale(2, RoundingMode.DOWN);
|
|
||||||
// // discountServiceAmount = totalServiceAmount.subtract(afterServiceAmountDiscount);
|
|
||||||
// // BigDecimal afterElectricityAmountDiscount = totalElectricityAmount.multiply(discount).setScale(2, RoundingMode.DOWN);
|
|
||||||
// // discountElectricityAmount = totalElectricityAmount.subtract(afterElectricityAmountDiscount);
|
|
||||||
//
|
|
||||||
// // 电费和服务费一起折扣
|
|
||||||
// afterServiceAmountDiscount = totalServiceAmount.multiply(discount).setScale(4, RoundingMode.DOWN);
|
|
||||||
// afterElectricityAmountDiscount = totalElectricityAmount.multiply(discount).setScale(4, RoundingMode.DOWN);
|
|
||||||
//
|
|
||||||
// discountServiceAmount = totalServiceAmount.subtract(afterServiceAmountDiscount);
|
|
||||||
// discountElectricityAmount = totalElectricityAmount.subtract(afterElectricityAmountDiscount);
|
|
||||||
// }
|
|
||||||
// orderBasicInfo.setGroupCode(memberDiscountVO.getGroupCode());
|
|
||||||
// }
|
|
||||||
// // 订单折扣金额
|
|
||||||
// BigDecimal discountAmount = discountServiceAmount.add(discountElectricityAmount);
|
|
||||||
// orderBasicInfo.setDiscountAmount(discountAmount);
|
|
||||||
//
|
|
||||||
// // 更新结算金额 结算金额 = 消费金额 - 虚拟金额 - 优惠金额
|
|
||||||
// BigDecimal newSettleAmount = orderBasicInfo.getSettleAmount().subtract(discountAmount);
|
|
||||||
// orderBasicInfo.setSettleAmount(newSettleAmount);
|
|
||||||
//
|
|
||||||
// // 总消费金额 = 折扣后电费 + 折扣后服务费
|
|
||||||
// BigDecimal totalConsumeAmount = afterServiceAmountDiscount.add(afterElectricityAmountDiscount);
|
|
||||||
//
|
|
||||||
// // 更新退款金额
|
|
||||||
// BigDecimal refundAmount = orderBasicInfo.getPayAmount().subtract(totalConsumeAmount).setScale(2, RoundingMode.DOWN);
|
|
||||||
// orderBasicInfo.setRefundAmount(refundAmount);
|
|
||||||
//
|
|
||||||
// orderDetail.setDiscountElectricityAmount(discountElectricityAmount);
|
|
||||||
// orderDetail.setDiscountServiceAmount(discountServiceAmount);
|
|
||||||
// logger.info("计算订单折扣, orderCode:{}, memberId:{}, discountAmount:{}, discountElectricityAmount:{}, discountServiceAmount:{}, totalConsumeAmount:{}",
|
|
||||||
// orderBasicInfo.getOrderCode(), memberId, discountAmount, discountElectricityAmount, discountServiceAmount, totalConsumeAmount);
|
|
||||||
// }
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 计算订单折扣V2
|
* 计算订单折扣V2
|
||||||
* 使用优惠计费模板计算优惠金额
|
* 使用优惠计费模板计算优惠金额
|
||||||
|
|||||||
@@ -78,119 +78,6 @@ public class NotDelayMerchantProgramLogic extends AbstractProgramLogic {
|
|||||||
return orderBasicInfoService.saveOrder2Database(dto);
|
return orderBasicInfoService.saveOrder2Database(dto);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 生成订单编号
|
|
||||||
*
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
// private String generateNewOrderCode() {
|
|
||||||
// while (true) {
|
|
||||||
// String orderCode = "C" + IdUtils.getOrderCode();
|
|
||||||
// // 通过orderCode查询是否已经存在
|
|
||||||
// OrderBasicInfo orderBasicInfo = orderBasicInfoService.getOrderInfoByOrderCode(orderCode);
|
|
||||||
// if (orderBasicInfo == null) {
|
|
||||||
// return orderCode;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 保存订单信息到数据库
|
|
||||||
*
|
|
||||||
* @param dto
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
// protected OrderBasicInfo saveOrder2Database(GenerateOrderDTO dto) throws ParseException {
|
|
||||||
// String orderCode = generateNewOrderCode();
|
|
||||||
// String transactionCode = IdUtils.generateTransactionCode(dto.getPileSn(), dto.getConnectorCode());
|
|
||||||
//
|
|
||||||
// if (StringUtils.isBlank(dto.getStartType())) {
|
|
||||||
// dto.setStartType(StartTypeEnum.NOW.getValue());
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// String stationId = dto.getPileConnector().getStationId();
|
|
||||||
// // 查询站点信息
|
|
||||||
// PileStationInfo pileStationInfo = pileStationInfoService.selectPileStationInfoById(Long.valueOf(stationId));
|
|
||||||
// String merchantId = pileStationInfo != null ? String.valueOf(pileStationInfo.getMerchantId()) : "";
|
|
||||||
// String plateNumber = dto.getPlateNumber() != null ? dto.getPlateNumber() : "";
|
|
||||||
// // 订单基本信息
|
|
||||||
// OrderBasicInfo orderBasicInfo = OrderBasicInfo.builder()
|
|
||||||
// .orderCode(orderCode)
|
|
||||||
// .transactionCode(transactionCode)
|
|
||||||
// .orderStatus(OrderStatusEnum.NOT_START.getValue())
|
|
||||||
// .memberId(dto.getMemberId())
|
|
||||||
// .stationId(stationId)
|
|
||||||
// .merchantId(merchantId)
|
|
||||||
// .pileSn(dto.getPileSn())
|
|
||||||
// .connectorCode(dto.getConnectorCode())
|
|
||||||
// .pileConnectorCode(dto.getPileSn() + dto.getConnectorCode())
|
|
||||||
// .startMode(dto.getStartMode())
|
|
||||||
// .payStatus(Constants.ZERO)
|
|
||||||
// .payAmount(dto.getChargeAmount())
|
|
||||||
// .payMode(dto.getPayMode())
|
|
||||||
// .plateNumber(plateNumber)
|
|
||||||
// .orderAmount(BigDecimal.ZERO)
|
|
||||||
// .virtualAmount(BigDecimal.ZERO)
|
|
||||||
// .settleAmount(BigDecimal.ZERO)
|
|
||||||
// .startType(dto.getStartType())
|
|
||||||
// .build();
|
|
||||||
// if (StringUtils.equals(dto.getStartMode(), StartModeEnum.AUTH_CARD.getValue())) {
|
|
||||||
// // 鉴权卡启动
|
|
||||||
// orderBasicInfo.setLogicCard(dto.getPileAuthCardInfo().getLogicCard());
|
|
||||||
// }
|
|
||||||
// if (StringUtils.equals(dto.getStartMode(), StartModeEnum.VIN_CODE.getValue())) {
|
|
||||||
// // vin启动
|
|
||||||
// MemberPlateNumberRelation memberPlateNumberRelation = dto.getMemberPlateNumberRelation();
|
|
||||||
// if (memberPlateNumberRelation != null) {
|
|
||||||
// if (StringUtils.isNotBlank(memberPlateNumberRelation.getVinCode())) {
|
|
||||||
// orderBasicInfo.setVinCode(memberPlateNumberRelation.getVinCode());
|
|
||||||
// }
|
|
||||||
// if (StringUtils.isNotBlank(memberPlateNumberRelation.getLicensePlateNumber())) {
|
|
||||||
// orderBasicInfo.setPlateNumber(memberPlateNumberRelation.getLicensePlateNumber());
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// if (StringUtils.equals(dto.getStartType(), StartTypeEnum.APPOINTMENT.getValue())) {
|
|
||||||
// orderBasicInfo.setAppointmentTime(DateUtils.parseDate(dto.getAppointmentTime(), DateUtils.YYYY_MM_DD_HH_MM_SS));
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// // 订单详情
|
|
||||||
// BillingTemplateVO billingTemplate = dto.getBillingTemplate();
|
|
||||||
// logger.info("订单使用的计费模板-orderCode:{}, billingTemplate:{}", orderCode, JSON.toJSONString(billingTemplate));
|
|
||||||
// BigDecimal sharpElectricityPrice = billingTemplate.getSharpElectricityPrice() != null ? billingTemplate.getSharpElectricityPrice() : BigDecimal.ZERO;
|
|
||||||
// BigDecimal sharpServicePrice = billingTemplate.getSharpServicePrice() != null ? billingTemplate.getSharpServicePrice() : BigDecimal.ZERO;
|
|
||||||
// BigDecimal peakElectricityPrice = billingTemplate.getPeakElectricityPrice() != null ? billingTemplate.getPeakElectricityPrice() : BigDecimal.ZERO;
|
|
||||||
// BigDecimal peakServicePrice = billingTemplate.getPeakServicePrice() != null ? billingTemplate.getPeakServicePrice() : BigDecimal.ZERO;
|
|
||||||
// BigDecimal flatElectricityPrice = billingTemplate.getFlatElectricityPrice() != null ? billingTemplate.getFlatElectricityPrice() : BigDecimal.ZERO;
|
|
||||||
// BigDecimal flatServicePrice = billingTemplate.getFlatServicePrice() != null ? billingTemplate.getFlatServicePrice() : BigDecimal.ZERO;
|
|
||||||
// BigDecimal valleyElectricityPrice = billingTemplate.getValleyElectricityPrice() != null ? billingTemplate.getValleyElectricityPrice() : BigDecimal.ZERO;
|
|
||||||
// BigDecimal valleyServicePrice = billingTemplate.getValleyServicePrice() != null ? billingTemplate.getValleyServicePrice() : BigDecimal.ZERO;
|
|
||||||
//
|
|
||||||
// OrderDetail orderDetail = OrderDetail.builder()
|
|
||||||
// .orderCode(orderCode)
|
|
||||||
// .sharpPrice(sharpElectricityPrice.add(sharpServicePrice))
|
|
||||||
// .sharpElectricityPrice(sharpElectricityPrice)
|
|
||||||
// .sharpServicePrice(sharpServicePrice)
|
|
||||||
// .peakPrice(peakElectricityPrice.add(peakServicePrice))
|
|
||||||
// .peakElectricityPrice(peakElectricityPrice)
|
|
||||||
// .peakServicePrice(peakServicePrice)
|
|
||||||
// .flatPrice(flatElectricityPrice.add(flatServicePrice))
|
|
||||||
// .flatElectricityPrice(flatElectricityPrice)
|
|
||||||
// .flatServicePrice(flatServicePrice)
|
|
||||||
// .valleyPrice(valleyElectricityPrice.add(valleyServicePrice))
|
|
||||||
// .valleyElectricityPrice(valleyElectricityPrice)
|
|
||||||
// .valleyServicePrice(valleyServicePrice)
|
|
||||||
// .build();
|
|
||||||
//
|
|
||||||
// OrderTransactionDTO createOrderTransactionDTO = OrderTransactionDTO.builder()
|
|
||||||
// .orderBasicInfo(orderBasicInfo)
|
|
||||||
// .orderDetail(orderDetail)
|
|
||||||
// .build();
|
|
||||||
// transactionService.doCreateOrder(createOrderTransactionDTO);
|
|
||||||
// return orderBasicInfo;
|
|
||||||
// }
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Map<String, Object> payOrder(PayOrderDTO dto) {
|
public Map<String, Object> payOrder(PayOrderDTO dto) {
|
||||||
logger.info("【{}】-支付订单start, param:{}", this.getClass().getSimpleName(), JSON.toJSONString(dto));
|
logger.info("【{}】-支付订单start, param:{}", this.getClass().getSimpleName(), JSON.toJSONString(dto));
|
||||||
|
|||||||
@@ -32,7 +32,8 @@
|
|||||||
<result column="charge_start_time" jdbcType="TIMESTAMP" property="chargeStartTime" />
|
<result column="charge_start_time" jdbcType="TIMESTAMP" property="chargeStartTime" />
|
||||||
<result column="charge_end_time" jdbcType="TIMESTAMP" property="chargeEndTime" />
|
<result column="charge_end_time" jdbcType="TIMESTAMP" property="chargeEndTime" />
|
||||||
<result column="start_type" jdbcType="VARCHAR" property="startType" />
|
<result column="start_type" jdbcType="VARCHAR" property="startType" />
|
||||||
<result column="appointment_time" jdbcType="TIMESTAMP" property="appointmentTime" />
|
<result column="reserved_start_time" jdbcType="TIMESTAMP" property="reservedStartTime" />
|
||||||
|
<result column="reserved_end_time" jdbcType="TIMESTAMP" property="reservedEndTime" />
|
||||||
<result column="start_soc" jdbcType="VARCHAR" property="startSoc" />
|
<result column="start_soc" jdbcType="VARCHAR" property="startSoc" />
|
||||||
<result column="end_soc" jdbcType="VARCHAR" property="endSoc" />
|
<result column="end_soc" jdbcType="VARCHAR" property="endSoc" />
|
||||||
<result column="reason" jdbcType="VARCHAR" property="reason" />
|
<result column="reason" jdbcType="VARCHAR" property="reason" />
|
||||||
@@ -51,7 +52,7 @@
|
|||||||
pile_sn, connector_code, pile_connector_code, logic_card, vin_code, start_mode, third_party_type,
|
pile_sn, connector_code, pile_connector_code, logic_card, vin_code, start_mode, third_party_type,
|
||||||
pay_mode, pay_status, pay_amount, pay_time, plate_number, order_amount, virtual_amount,
|
pay_mode, pay_status, pay_amount, pay_time, plate_number, order_amount, virtual_amount,
|
||||||
group_code, discount_amount, settle_amount, remedial_amount, charge_start_time, charge_end_time,
|
group_code, discount_amount, settle_amount, remedial_amount, charge_start_time, charge_end_time,
|
||||||
start_type, appointment_time, start_soc, end_soc, reason, settlement_time, refund_amount,
|
start_type, reserved_start_time, reserved_end_time, start_soc, end_soc, reason, settlement_time, refund_amount,
|
||||||
refund_status, create_by, create_time, update_by, update_time, del_flag
|
refund_status, create_by, create_time, update_by, update_time, del_flag
|
||||||
</sql>
|
</sql>
|
||||||
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
||||||
@@ -76,8 +77,9 @@
|
|||||||
pay_amount, pay_time, plate_number,
|
pay_amount, pay_time, plate_number,
|
||||||
order_amount, virtual_amount, group_code,
|
order_amount, virtual_amount, group_code,
|
||||||
discount_amount, settle_amount, remedial_amount,
|
discount_amount, settle_amount, remedial_amount,
|
||||||
charge_start_time, charge_end_time, start_type,
|
charge_start_time, charge_end_time, start_type,
|
||||||
appointment_time, start_soc, end_soc,
|
reserved_start_time, reserved_end_time,
|
||||||
|
start_soc, end_soc,
|
||||||
reason, settlement_time, refund_amount,
|
reason, settlement_time, refund_amount,
|
||||||
refund_status, create_by, create_time,
|
refund_status, create_by, create_time,
|
||||||
update_by, update_time, del_flag
|
update_by, update_time, del_flag
|
||||||
@@ -90,8 +92,9 @@
|
|||||||
#{payAmount,jdbcType=DECIMAL}, #{payTime,jdbcType=TIMESTAMP}, #{plateNumber,jdbcType=VARCHAR},
|
#{payAmount,jdbcType=DECIMAL}, #{payTime,jdbcType=TIMESTAMP}, #{plateNumber,jdbcType=VARCHAR},
|
||||||
#{orderAmount,jdbcType=DECIMAL}, #{virtualAmount,jdbcType=DECIMAL}, #{groupCode,jdbcType=VARCHAR},
|
#{orderAmount,jdbcType=DECIMAL}, #{virtualAmount,jdbcType=DECIMAL}, #{groupCode,jdbcType=VARCHAR},
|
||||||
#{discountAmount,jdbcType=DECIMAL}, #{settleAmount,jdbcType=DECIMAL}, #{remedialAmount,jdbcType=DECIMAL},
|
#{discountAmount,jdbcType=DECIMAL}, #{settleAmount,jdbcType=DECIMAL}, #{remedialAmount,jdbcType=DECIMAL},
|
||||||
#{chargeStartTime,jdbcType=TIMESTAMP}, #{chargeEndTime,jdbcType=TIMESTAMP}, #{startType,jdbcType=VARCHAR},
|
#{chargeStartTime,jdbcType=TIMESTAMP}, #{chargeEndTime,jdbcType=TIMESTAMP}, #{startType,jdbcType=VARCHAR},
|
||||||
#{appointmentTime,jdbcType=TIMESTAMP}, #{startSoc,jdbcType=VARCHAR}, #{endSoc,jdbcType=VARCHAR},
|
#{reservedStartTime,jdbcType=TIMESTAMP},#{reservedEndTime,jdbcType=TIMESTAMP},
|
||||||
|
#{startSoc,jdbcType=VARCHAR}, #{endSoc,jdbcType=VARCHAR},
|
||||||
#{reason,jdbcType=VARCHAR}, #{settlementTime,jdbcType=TIMESTAMP}, #{refundAmount,jdbcType=DECIMAL},
|
#{reason,jdbcType=VARCHAR}, #{settlementTime,jdbcType=TIMESTAMP}, #{refundAmount,jdbcType=DECIMAL},
|
||||||
#{refundStatus,jdbcType=VARCHAR}, #{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
|
#{refundStatus,jdbcType=VARCHAR}, #{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
|
||||||
#{updateBy,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, #{delFlag,jdbcType=CHAR}
|
#{updateBy,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, #{delFlag,jdbcType=CHAR}
|
||||||
@@ -182,8 +185,11 @@
|
|||||||
<if test="startType != null">
|
<if test="startType != null">
|
||||||
start_type,
|
start_type,
|
||||||
</if>
|
</if>
|
||||||
<if test="appointmentTime != null">
|
<if test="reservedStartTime != null">
|
||||||
appointment_time,
|
reserved_start_time,
|
||||||
|
</if>
|
||||||
|
<if test="reservedEndTime != null">
|
||||||
|
reserved_end_time,
|
||||||
</if>
|
</if>
|
||||||
<if test="startSoc != null">
|
<if test="startSoc != null">
|
||||||
start_soc,
|
start_soc,
|
||||||
@@ -301,8 +307,11 @@
|
|||||||
<if test="startType != null">
|
<if test="startType != null">
|
||||||
#{startType,jdbcType=VARCHAR},
|
#{startType,jdbcType=VARCHAR},
|
||||||
</if>
|
</if>
|
||||||
<if test="appointmentTime != null">
|
<if test="reservedStartTime != null">
|
||||||
#{appointmentTime,jdbcType=TIMESTAMP},
|
#{reservedStartTime},
|
||||||
|
</if>
|
||||||
|
<if test="reservedEndTime != null">
|
||||||
|
#{reservedEndTime},
|
||||||
</if>
|
</if>
|
||||||
<if test="startSoc != null">
|
<if test="startSoc != null">
|
||||||
#{startSoc,jdbcType=VARCHAR},
|
#{startSoc,jdbcType=VARCHAR},
|
||||||
@@ -424,8 +433,11 @@
|
|||||||
<if test="startType != null">
|
<if test="startType != null">
|
||||||
start_type = #{startType,jdbcType=VARCHAR},
|
start_type = #{startType,jdbcType=VARCHAR},
|
||||||
</if>
|
</if>
|
||||||
<if test="appointmentTime != null">
|
<if test="reservedStartTime != null">
|
||||||
appointment_time = #{appointmentTime,jdbcType=TIMESTAMP},
|
reserved_start_time = #{reservedStartTime,jdbcType=TIMESTAMP},
|
||||||
|
</if>
|
||||||
|
<if test="reservedEndTime != null">
|
||||||
|
reserved_end_time = #{reservedEndTime,jdbcType=TIMESTAMP},
|
||||||
</if>
|
</if>
|
||||||
<if test="startSoc != null">
|
<if test="startSoc != null">
|
||||||
start_soc = #{startSoc,jdbcType=VARCHAR},
|
start_soc = #{startSoc,jdbcType=VARCHAR},
|
||||||
@@ -493,7 +505,8 @@
|
|||||||
charge_start_time = #{chargeStartTime,jdbcType=TIMESTAMP},
|
charge_start_time = #{chargeStartTime,jdbcType=TIMESTAMP},
|
||||||
charge_end_time = #{chargeEndTime,jdbcType=TIMESTAMP},
|
charge_end_time = #{chargeEndTime,jdbcType=TIMESTAMP},
|
||||||
start_type = #{startType,jdbcType=VARCHAR},
|
start_type = #{startType,jdbcType=VARCHAR},
|
||||||
appointment_time = #{appointmentTime,jdbcType=TIMESTAMP},
|
reserved_start_time = #{reservedStartTime,jdbcType=TIMESTAMP},
|
||||||
|
reserved_end_time = #{reservedEndTime,jdbcType=TIMESTAMP},
|
||||||
start_soc = #{startSoc,jdbcType=VARCHAR},
|
start_soc = #{startSoc,jdbcType=VARCHAR},
|
||||||
end_soc = #{endSoc,jdbcType=VARCHAR},
|
end_soc = #{endSoc,jdbcType=VARCHAR},
|
||||||
reason = #{reason,jdbcType=VARCHAR},
|
reason = #{reason,jdbcType=VARCHAR},
|
||||||
@@ -646,9 +659,14 @@
|
|||||||
when id = #{item.id,jdbcType=INTEGER} then #{item.startType,jdbcType=VARCHAR}
|
when id = #{item.id,jdbcType=INTEGER} then #{item.startType,jdbcType=VARCHAR}
|
||||||
</foreach>
|
</foreach>
|
||||||
</trim>
|
</trim>
|
||||||
<trim prefix="appointment_time = case" suffix="end,">
|
<trim prefix="reserved_start_time = case" suffix="end,">
|
||||||
<foreach collection="list" index="index" item="item">
|
<foreach collection="list" index="index" item="item">
|
||||||
when id = #{item.id,jdbcType=INTEGER} then #{item.appointmentTime,jdbcType=TIMESTAMP}
|
when id = #{item.id,jdbcType=INTEGER} then #{item.reservedStartTime,jdbcType=TIMESTAMP}
|
||||||
|
</foreach>
|
||||||
|
</trim>
|
||||||
|
<trim prefix="reserved_end_time = case" suffix="end,">
|
||||||
|
<foreach collection="list" index="index" item="item">
|
||||||
|
when id = #{item.id,jdbcType=INTEGER} then #{item.reservedEndTime,jdbcType=TIMESTAMP}
|
||||||
</foreach>
|
</foreach>
|
||||||
</trim>
|
</trim>
|
||||||
<trim prefix="start_soc = case" suffix="end,">
|
<trim prefix="start_soc = case" suffix="end,">
|
||||||
@@ -905,10 +923,17 @@
|
|||||||
</if>
|
</if>
|
||||||
</foreach>
|
</foreach>
|
||||||
</trim>
|
</trim>
|
||||||
<trim prefix="appointment_time = case" suffix="end,">
|
<trim prefix="reserved_start_time = case" suffix="end,">
|
||||||
<foreach collection="list" index="index" item="item">
|
<foreach collection="list" index="index" item="item">
|
||||||
<if test="item.appointmentTime != null">
|
<if test="item.reservedStartTime != null">
|
||||||
when id = #{item.id,jdbcType=INTEGER} then #{item.appointmentTime,jdbcType=TIMESTAMP}
|
when id = #{item.id,jdbcType=INTEGER} then #{item.reservedStartTime,jdbcType=TIMESTAMP}
|
||||||
|
</if>
|
||||||
|
</foreach>
|
||||||
|
</trim>
|
||||||
|
<trim prefix="reserved_end_time = case" suffix="end,">
|
||||||
|
<foreach collection="list" index="index" item="item">
|
||||||
|
<if test="item.reservedEndTime != null">
|
||||||
|
when id = #{item.id,jdbcType=INTEGER} then #{item.reservedEndTime,jdbcType=TIMESTAMP}
|
||||||
</if>
|
</if>
|
||||||
</foreach>
|
</foreach>
|
||||||
</trim>
|
</trim>
|
||||||
@@ -1002,7 +1027,7 @@
|
|||||||
pile_sn, connector_code, pile_connector_code, logic_card, vin_code, start_mode,
|
pile_sn, connector_code, pile_connector_code, logic_card, vin_code, start_mode,
|
||||||
third_party_type, pay_mode, pay_status, pay_amount, pay_time, plate_number, order_amount,
|
third_party_type, pay_mode, pay_status, pay_amount, pay_time, plate_number, order_amount,
|
||||||
virtual_amount, group_code, discount_amount, settle_amount, remedial_amount, charge_start_time,
|
virtual_amount, group_code, discount_amount, settle_amount, remedial_amount, charge_start_time,
|
||||||
charge_end_time, start_type, appointment_time, start_soc, end_soc, reason, settlement_time,
|
charge_end_time, start_type, reserved_start_time, reserved_end_time, start_soc, end_soc, reason, settlement_time,
|
||||||
refund_amount, refund_status, create_by, create_time, update_by, update_time, del_flag
|
refund_amount, refund_status, create_by, create_time, update_by, update_time, del_flag
|
||||||
)
|
)
|
||||||
values
|
values
|
||||||
@@ -1016,7 +1041,8 @@
|
|||||||
#{item.orderAmount,jdbcType=DECIMAL}, #{item.virtualAmount,jdbcType=DECIMAL}, #{item.groupCode,jdbcType=VARCHAR},
|
#{item.orderAmount,jdbcType=DECIMAL}, #{item.virtualAmount,jdbcType=DECIMAL}, #{item.groupCode,jdbcType=VARCHAR},
|
||||||
#{item.discountAmount,jdbcType=DECIMAL}, #{item.settleAmount,jdbcType=DECIMAL},
|
#{item.discountAmount,jdbcType=DECIMAL}, #{item.settleAmount,jdbcType=DECIMAL},
|
||||||
#{item.remedialAmount,jdbcType=DECIMAL}, #{item.chargeStartTime,jdbcType=TIMESTAMP},
|
#{item.remedialAmount,jdbcType=DECIMAL}, #{item.chargeStartTime,jdbcType=TIMESTAMP},
|
||||||
#{item.chargeEndTime,jdbcType=TIMESTAMP}, #{item.startType,jdbcType=VARCHAR}, #{item.appointmentTime,jdbcType=TIMESTAMP},
|
#{item.chargeEndTime,jdbcType=TIMESTAMP}, #{item.startType,jdbcType=VARCHAR}, #{item.reservedStartTime,jdbcType=TIMESTAMP},
|
||||||
|
#{item.reservedEndTime,jdbcType=TIMESTAMP},
|
||||||
#{item.startSoc,jdbcType=VARCHAR}, #{item.endSoc,jdbcType=VARCHAR}, #{item.reason,jdbcType=VARCHAR},
|
#{item.startSoc,jdbcType=VARCHAR}, #{item.endSoc,jdbcType=VARCHAR}, #{item.reason,jdbcType=VARCHAR},
|
||||||
#{item.settlementTime,jdbcType=TIMESTAMP}, #{item.refundAmount,jdbcType=DECIMAL},
|
#{item.settlementTime,jdbcType=TIMESTAMP}, #{item.refundAmount,jdbcType=DECIMAL},
|
||||||
#{item.refundStatus,jdbcType=VARCHAR}, #{item.createBy,jdbcType=VARCHAR}, #{item.createTime,jdbcType=TIMESTAMP},
|
#{item.refundStatus,jdbcType=VARCHAR}, #{item.createBy,jdbcType=VARCHAR}, #{item.createTime,jdbcType=TIMESTAMP},
|
||||||
@@ -1058,7 +1084,8 @@
|
|||||||
charge_start_time,
|
charge_start_time,
|
||||||
charge_end_time,
|
charge_end_time,
|
||||||
start_type,
|
start_type,
|
||||||
appointment_time,
|
reserved_start_time,
|
||||||
|
reserved_end_time,
|
||||||
start_soc,
|
start_soc,
|
||||||
end_soc,
|
end_soc,
|
||||||
reason,
|
reason,
|
||||||
@@ -1103,7 +1130,8 @@
|
|||||||
#{chargeStartTime,jdbcType=TIMESTAMP},
|
#{chargeStartTime,jdbcType=TIMESTAMP},
|
||||||
#{chargeEndTime,jdbcType=TIMESTAMP},
|
#{chargeEndTime,jdbcType=TIMESTAMP},
|
||||||
#{startType,jdbcType=VARCHAR},
|
#{startType,jdbcType=VARCHAR},
|
||||||
#{appointmentTime,jdbcType=TIMESTAMP},
|
#{reservedStartTime,jdbcType=TIMESTAMP},
|
||||||
|
#{reservedEndTime,jdbcType=TIMESTAMP},
|
||||||
#{startSoc,jdbcType=VARCHAR},
|
#{startSoc,jdbcType=VARCHAR},
|
||||||
#{endSoc,jdbcType=VARCHAR},
|
#{endSoc,jdbcType=VARCHAR},
|
||||||
#{reason,jdbcType=VARCHAR},
|
#{reason,jdbcType=VARCHAR},
|
||||||
@@ -1148,7 +1176,8 @@
|
|||||||
charge_start_time = #{chargeStartTime,jdbcType=TIMESTAMP},
|
charge_start_time = #{chargeStartTime,jdbcType=TIMESTAMP},
|
||||||
charge_end_time = #{chargeEndTime,jdbcType=TIMESTAMP},
|
charge_end_time = #{chargeEndTime,jdbcType=TIMESTAMP},
|
||||||
start_type = #{startType,jdbcType=VARCHAR},
|
start_type = #{startType,jdbcType=VARCHAR},
|
||||||
appointment_time = #{appointmentTime,jdbcType=TIMESTAMP},
|
reserved_start_time = #{reservedStartTime,jdbcType=TIMESTAMP},
|
||||||
|
reserved_end_time = #{reservedEndTime,jdbcType=TIMESTAMP},
|
||||||
start_soc = #{startSoc,jdbcType=VARCHAR},
|
start_soc = #{startSoc,jdbcType=VARCHAR},
|
||||||
end_soc = #{endSoc,jdbcType=VARCHAR},
|
end_soc = #{endSoc,jdbcType=VARCHAR},
|
||||||
reason = #{reason,jdbcType=VARCHAR},
|
reason = #{reason,jdbcType=VARCHAR},
|
||||||
@@ -1250,8 +1279,11 @@
|
|||||||
<if test="startType != null">
|
<if test="startType != null">
|
||||||
start_type,
|
start_type,
|
||||||
</if>
|
</if>
|
||||||
<if test="appointmentTime != null">
|
<if test="reservedStartTime != null">
|
||||||
appointment_time,
|
reserved_start_time,
|
||||||
|
</if>
|
||||||
|
<if test="reservedEndTime != null">
|
||||||
|
reserved_end_time,
|
||||||
</if>
|
</if>
|
||||||
<if test="startSoc != null">
|
<if test="startSoc != null">
|
||||||
start_soc,
|
start_soc,
|
||||||
@@ -1373,8 +1405,11 @@
|
|||||||
<if test="startType != null">
|
<if test="startType != null">
|
||||||
#{startType,jdbcType=VARCHAR},
|
#{startType,jdbcType=VARCHAR},
|
||||||
</if>
|
</if>
|
||||||
<if test="appointmentTime != null">
|
<if test="reservedStartTime != null">
|
||||||
#{appointmentTime,jdbcType=TIMESTAMP},
|
#{reservedStartTime,jdbcType=TIMESTAMP},
|
||||||
|
</if>
|
||||||
|
<if test="reservedEndTime != null">
|
||||||
|
#{reservedEndTime,jdbcType=TIMESTAMP},
|
||||||
</if>
|
</if>
|
||||||
<if test="startSoc != null">
|
<if test="startSoc != null">
|
||||||
#{startSoc,jdbcType=VARCHAR},
|
#{startSoc,jdbcType=VARCHAR},
|
||||||
@@ -1496,8 +1531,11 @@
|
|||||||
<if test="startType != null">
|
<if test="startType != null">
|
||||||
start_type = #{startType,jdbcType=VARCHAR},
|
start_type = #{startType,jdbcType=VARCHAR},
|
||||||
</if>
|
</if>
|
||||||
<if test="appointmentTime != null">
|
<if test="reservedStartTime != null">
|
||||||
appointment_time = #{appointmentTime,jdbcType=TIMESTAMP},
|
reserved_start_time = #{reservedStartTime,jdbcType=TIMESTAMP},
|
||||||
|
</if>
|
||||||
|
<if test="reservedEndTime != null">
|
||||||
|
reserved_end_time = #{reservedEndTime,jdbcType=TIMESTAMP},
|
||||||
</if>
|
</if>
|
||||||
<if test="startSoc != null">
|
<if test="startSoc != null">
|
||||||
start_soc = #{startSoc,jdbcType=VARCHAR},
|
start_soc = #{startSoc,jdbcType=VARCHAR},
|
||||||
@@ -1856,9 +1894,9 @@
|
|||||||
<if test="startMode != null">
|
<if test="startMode != null">
|
||||||
start_mode,
|
start_mode,
|
||||||
</if>
|
</if>
|
||||||
<if test="thirdPartyType != null">
|
<if test="thirdPartyType != null">
|
||||||
third_party_type,
|
third_party_type,
|
||||||
</if>
|
</if>
|
||||||
<if test="payMode != null">
|
<if test="payMode != null">
|
||||||
pay_mode,
|
pay_mode,
|
||||||
</if>
|
</if>
|
||||||
@@ -1892,8 +1930,11 @@
|
|||||||
<if test="startType != null">
|
<if test="startType != null">
|
||||||
start_type,
|
start_type,
|
||||||
</if>
|
</if>
|
||||||
<if test="appointmentTime != null">
|
<if test="reservedStartTime != null">
|
||||||
appointment_time,
|
reserved_start_time,
|
||||||
|
</if>
|
||||||
|
<if test="reservedEndTime != null">
|
||||||
|
reserved_end_time,
|
||||||
</if>
|
</if>
|
||||||
<if test="startSoc != null">
|
<if test="startSoc != null">
|
||||||
start_soc,
|
start_soc,
|
||||||
@@ -1963,9 +2004,9 @@
|
|||||||
<if test="startMode != null">
|
<if test="startMode != null">
|
||||||
#{startMode},
|
#{startMode},
|
||||||
</if>
|
</if>
|
||||||
<if test="thirdPartyType != null">
|
<if test="thirdPartyType != null">
|
||||||
#{thirdPartyType},
|
#{thirdPartyType},
|
||||||
</if>
|
</if>
|
||||||
<if test="payMode != null">
|
<if test="payMode != null">
|
||||||
#{payMode},
|
#{payMode},
|
||||||
</if>
|
</if>
|
||||||
@@ -1999,8 +2040,11 @@
|
|||||||
<if test="startType != null">
|
<if test="startType != null">
|
||||||
#{startType},
|
#{startType},
|
||||||
</if>
|
</if>
|
||||||
<if test="appointmentTime != null">
|
<if test="reservedStartTime != null">
|
||||||
#{appointmentTime},
|
#{reservedStartTime},
|
||||||
|
</if>
|
||||||
|
<if test="reservedEndTime != null">
|
||||||
|
#{reservedEndTime},
|
||||||
</if>
|
</if>
|
||||||
<if test="startSoc != null">
|
<if test="startSoc != null">
|
||||||
#{startSoc},
|
#{startSoc},
|
||||||
@@ -2113,9 +2157,6 @@
|
|||||||
<if test="startType != null">
|
<if test="startType != null">
|
||||||
start_type = #{startType},
|
start_type = #{startType},
|
||||||
</if>
|
</if>
|
||||||
<if test="appointmentTime != null">
|
|
||||||
appointment_time = #{appointmentTime},
|
|
||||||
</if>
|
|
||||||
<if test="startSoc != null">
|
<if test="startSoc != null">
|
||||||
start_soc = #{startSoc},
|
start_soc = #{startSoc},
|
||||||
</if>
|
</if>
|
||||||
@@ -2511,17 +2552,6 @@
|
|||||||
AND t1.del_flag = '0'
|
AND t1.del_flag = '0'
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getAppointmentOrder" resultMap="BaseResultMap">
|
|
||||||
select
|
|
||||||
<include refid="Base_Column_List" />
|
|
||||||
from order_basic_info
|
|
||||||
where del_flag = '0'
|
|
||||||
and pay_status = '1'
|
|
||||||
and start_type = 'appointment'
|
|
||||||
and order_status = '0'
|
|
||||||
and appointment_time <![CDATA[ <= ]]> #{dateTime,jdbcType=TIMESTAMP}
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<select id="getListByOrderCodes" resultType="com.jsowell.pile.vo.uniapp.OrderVO">
|
<select id="getListByOrderCodes" resultType="com.jsowell.pile.vo.uniapp.OrderVO">
|
||||||
SELECT t1.order_code as orderCode,
|
SELECT t1.order_code as orderCode,
|
||||||
t1.order_status as orderStatus,
|
t1.order_status as orderStatus,
|
||||||
@@ -2842,4 +2872,15 @@
|
|||||||
AND
|
AND
|
||||||
t1.order_code = #{orderCode,jdbcType=VARCHAR}
|
t1.order_code = #{orderCode,jdbcType=VARCHAR}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="getReservedOrder" resultMap="BaseResultMap">
|
||||||
|
select
|
||||||
|
<include refid="Base_Column_List" />
|
||||||
|
from order_basic_info
|
||||||
|
where del_flag = '0'
|
||||||
|
and pay_status = '1'
|
||||||
|
and start_type = 'reserved'
|
||||||
|
and order_status = '0'
|
||||||
|
and order_basic_info.reserved_start_time <![CDATA[ <= ]]> #{dateTime,jdbcType=TIMESTAMP}
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
@@ -81,7 +81,7 @@ public class JsowellTask {
|
|||||||
public void appointmentOrderStart() {
|
public void appointmentOrderStart() {
|
||||||
// 查询出 已支付 设置预约充电 未启动 的订单
|
// 查询出 已支付 设置预约充电 未启动 的订单
|
||||||
LocalDateTime now = LocalDateTime.now();
|
LocalDateTime now = LocalDateTime.now();
|
||||||
List<OrderBasicInfo> list = orderBasicInfoService.getAppointmentOrder(now);
|
List<OrderBasicInfo> list = orderBasicInfoService.getReservedOrder(now);
|
||||||
if (CollectionUtils.isEmpty(list)) {
|
if (CollectionUtils.isEmpty(list)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -598,7 +598,7 @@ public class LianLianServiceImpl implements LianLianService {
|
|||||||
PileConnectorInfoVO connectorInfo = pileConnectorInfoService.getPileConnectorInfoByConnectorCode(pileConnectorCode);
|
PileConnectorInfoVO connectorInfo = pileConnectorInfoService.getPileConnectorInfoByConnectorCode(pileConnectorCode);
|
||||||
if (StringUtils.equals(PileConnectorDataBaseStatusEnum.OCCUPIED_NOT_CHARGED.getValue(), String.valueOf(connectorInfo.getStatus()))
|
if (StringUtils.equals(PileConnectorDataBaseStatusEnum.OCCUPIED_NOT_CHARGED.getValue(), String.valueOf(connectorInfo.getStatus()))
|
||||||
|| StringUtils.equals(PileConnectorDataBaseStatusEnum.OCCUPIED_CHARGING.getValue(), String.valueOf(connectorInfo.getStatus()))
|
|| StringUtils.equals(PileConnectorDataBaseStatusEnum.OCCUPIED_CHARGING.getValue(), String.valueOf(connectorInfo.getStatus()))
|
||||||
|| StringUtils.equals(PileConnectorDataBaseStatusEnum.OCCUPIED_APPOINTMENT_LOCK.getValue(), String.valueOf(connectorInfo.getStatus()))
|
|| StringUtils.equals(PileConnectorDataBaseStatusEnum.OCCUPIED_RESERVED_LOCK.getValue(), String.valueOf(connectorInfo.getStatus()))
|
||||||
) {
|
) {
|
||||||
vo.setSuccStat(0);
|
vo.setSuccStat(0);
|
||||||
vo.setFailReason(0);
|
vo.setFailReason(0);
|
||||||
|
|||||||
@@ -615,7 +615,7 @@ public class HaiNanPlatformServiceImpl implements ThirdPartyPlatformService {
|
|||||||
PileConnectorInfoVO connectorInfo = pileConnectorInfoService.getPileConnectorInfoByConnectorCode(pileConnectorCode);
|
PileConnectorInfoVO connectorInfo = pileConnectorInfoService.getPileConnectorInfoByConnectorCode(pileConnectorCode);
|
||||||
if (StringUtils.equals(PileConnectorDataBaseStatusEnum.OCCUPIED_NOT_CHARGED.getValue(), String.valueOf(connectorInfo.getStatus()))
|
if (StringUtils.equals(PileConnectorDataBaseStatusEnum.OCCUPIED_NOT_CHARGED.getValue(), String.valueOf(connectorInfo.getStatus()))
|
||||||
|| StringUtils.equals(PileConnectorDataBaseStatusEnum.OCCUPIED_CHARGING.getValue(), String.valueOf(connectorInfo.getStatus()))
|
|| StringUtils.equals(PileConnectorDataBaseStatusEnum.OCCUPIED_CHARGING.getValue(), String.valueOf(connectorInfo.getStatus()))
|
||||||
|| StringUtils.equals(PileConnectorDataBaseStatusEnum.OCCUPIED_APPOINTMENT_LOCK.getValue(), String.valueOf(connectorInfo.getStatus()))
|
|| StringUtils.equals(PileConnectorDataBaseStatusEnum.OCCUPIED_RESERVED_LOCK.getValue(), String.valueOf(connectorInfo.getStatus()))
|
||||||
) {
|
) {
|
||||||
vo.setSuccStat(0);
|
vo.setSuccStat(0);
|
||||||
vo.setFailReason(0);
|
vo.setFailReason(0);
|
||||||
|
|||||||
@@ -1176,7 +1176,7 @@ public class LianLianPlatformServiceImpl implements ThirdPartyPlatformService {
|
|||||||
PileConnectorInfoVO connectorInfo = pileConnectorInfoService.getPileConnectorInfoByConnectorCode(pileConnectorCode);
|
PileConnectorInfoVO connectorInfo = pileConnectorInfoService.getPileConnectorInfoByConnectorCode(pileConnectorCode);
|
||||||
if (StringUtils.equals(PileConnectorDataBaseStatusEnum.OCCUPIED_NOT_CHARGED.getValue(), String.valueOf(connectorInfo.getStatus()))
|
if (StringUtils.equals(PileConnectorDataBaseStatusEnum.OCCUPIED_NOT_CHARGED.getValue(), String.valueOf(connectorInfo.getStatus()))
|
||||||
|| StringUtils.equals(PileConnectorDataBaseStatusEnum.OCCUPIED_CHARGING.getValue(), String.valueOf(connectorInfo.getStatus()))
|
|| StringUtils.equals(PileConnectorDataBaseStatusEnum.OCCUPIED_CHARGING.getValue(), String.valueOf(connectorInfo.getStatus()))
|
||||||
|| StringUtils.equals(PileConnectorDataBaseStatusEnum.OCCUPIED_APPOINTMENT_LOCK.getValue(), String.valueOf(connectorInfo.getStatus()))
|
|| StringUtils.equals(PileConnectorDataBaseStatusEnum.OCCUPIED_RESERVED_LOCK.getValue(), String.valueOf(connectorInfo.getStatus()))
|
||||||
) {
|
) {
|
||||||
succStat = 0;
|
succStat = 0;
|
||||||
failReason = 0;
|
failReason = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user