From bd08e2a93803f743393c201f960b559ea5f2d2c7 Mon Sep 17 00:00:00 2001 From: Guoqs <123@jsowell.com> Date: Tue, 21 May 2024 18:11:01 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E9=A2=84=E7=BA=A6=E5=85=85=E7=94=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ykc/PileConnectorDataBaseStatusEnum.java | 2 +- .../jsowell/pile/domain/OrderBasicInfo.java | 11 +- .../ykcCommond/ReservedChargingCommand.java | 4 +- .../jsowell/pile/dto/GenerateOrderDTO.java | 9 +- .../pile/mapper/OrderBasicInfoMapper.java | 2 +- .../pile/service/OrderBasicInfoService.java | 2 +- .../impl/OrderBasicInfoServiceImpl.java | 11 +- .../impl/YKCPushCommandServiceImpl.java | 10 +- .../programlogic/AbstractProgramLogic.java | 171 ------------------ .../NotDelayMerchantProgramLogic.java | 113 ------------ .../mapper/pile/OrderBasicInfoMapper.xml | 147 +++++++++------ .../com/jsowell/quartz/task/JsowellTask.java | 2 +- .../service/impl/LianLianServiceImpl.java | 2 +- .../impl/HaiNanPlatformServiceImpl.java | 2 +- .../impl/LianLianPlatformServiceImpl.java | 2 +- 15 files changed, 129 insertions(+), 361 deletions(-) diff --git a/jsowell-common/src/main/java/com/jsowell/common/enums/ykc/PileConnectorDataBaseStatusEnum.java b/jsowell-common/src/main/java/com/jsowell/common/enums/ykc/PileConnectorDataBaseStatusEnum.java index cdfedca82..7594575a2 100644 --- a/jsowell-common/src/main/java/com/jsowell/common/enums/ykc/PileConnectorDataBaseStatusEnum.java +++ b/jsowell-common/src/main/java/com/jsowell/common/enums/ykc/PileConnectorDataBaseStatusEnum.java @@ -9,7 +9,7 @@ public enum PileConnectorDataBaseStatusEnum { FREE("1", "空闲"), OCCUPIED_NOT_CHARGED("2", "占用(未充电)"), OCCUPIED_CHARGING("3", "占用(充电中)"), - OCCUPIED_APPOINTMENT_LOCK("4", "占用(预约锁定)"), + OCCUPIED_RESERVED_LOCK("4", "占用(预约锁定)"), FAULT("255", "故障") ; diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/domain/OrderBasicInfo.java b/jsowell-pile/src/main/java/com/jsowell/pile/domain/OrderBasicInfo.java index e42664efa..bf940bcaf 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/domain/OrderBasicInfo.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/domain/OrderBasicInfo.java @@ -151,14 +151,19 @@ public class OrderBasicInfo { private Date chargeEndTime; /** - * 启动类型(now-立即启动;appointment-预约启动) + * 启动类型(now-立即启动;reserved-预约启动) */ private String startType; /** - * 预约时间 + * 预约开始时间 */ - private Date appointmentTime; + private Date reservedStartTime; + + /** + * 预约结束时间 + */ + private Date reservedEndTime; /** * 开始SOC diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/domain/ykcCommond/ReservedChargingCommand.java b/jsowell-pile/src/main/java/com/jsowell/pile/domain/ykcCommond/ReservedChargingCommand.java index bca5a7994..fac1d5b8f 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/domain/ykcCommond/ReservedChargingCommand.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/domain/ykcCommond/ReservedChargingCommand.java @@ -39,12 +39,12 @@ public class ReservedChargingCommand { /** * 开始时间 */ - private Date appointmentStartTime; + private Date reservedStartTime; /** * 结束时间 */ - private Date appointmentEndTime; + private Date reservedEndTime; /** * 启动金额 diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/dto/GenerateOrderDTO.java b/jsowell-pile/src/main/java/com/jsowell/pile/dto/GenerateOrderDTO.java index b2075cef7..22153c317 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/dto/GenerateOrderDTO.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/dto/GenerateOrderDTO.java @@ -60,9 +60,14 @@ public class GenerateOrderDTO extends BasicPileDTO{ private String startType; /** - * 预约时间 + * 预约开始时间 */ - private String appointmentTime; + private String reservedStartTime; + + /** + * 预约结束时间 + */ + private String reservedEndTime; /** * 使用刷卡创建订单时有值 diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/mapper/OrderBasicInfoMapper.java b/jsowell-pile/src/main/java/com/jsowell/pile/mapper/OrderBasicInfoMapper.java index 91c62b1e2..8e5e32e91 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/mapper/OrderBasicInfoMapper.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/mapper/OrderBasicInfoMapper.java @@ -258,7 +258,7 @@ public interface OrderBasicInfoMapper { */ List getAccumulativeInfo(QueryPersonPileDTO dto); - List getAppointmentOrder(LocalDateTime dateTime); + List getReservedOrder(LocalDateTime dateTime); List getListByOrderCodes(@Param("orderCodes") List orderCodes); diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/service/OrderBasicInfoService.java b/jsowell-pile/src/main/java/com/jsowell/pile/service/OrderBasicInfoService.java index 79cbcae5f..cee2a5bdb 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/service/OrderBasicInfoService.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/service/OrderBasicInfoService.java @@ -298,7 +298,7 @@ public interface OrderBasicInfoService{ */ void updateOrderStatusAsAbnormal(String pileSn); - List getAppointmentOrder(LocalDateTime dateTime); + List getReservedOrder(LocalDateTime dateTime); Map generateOrderByCard(GenerateOrderDTO dto) throws Exception; diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/OrderBasicInfoServiceImpl.java b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/OrderBasicInfoServiceImpl.java index 0716c1a84..e93b35ff5 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/OrderBasicInfoServiceImpl.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/OrderBasicInfoServiceImpl.java @@ -544,8 +544,8 @@ public class OrderBasicInfoServiceImpl implements OrderBasicInfoService { Date payTime = orderBasicInfo.getPayTime(); time = payTime == null ? 0L : payTime.getTime(); } else { - Date appointmentTime = orderBasicInfo.getAppointmentTime(); - time = appointmentTime == null ? 0L : appointmentTime.getTime(); + Date reservedStartTime = orderBasicInfo.getReservedStartTime(); + time = reservedStartTime == null ? 0L : reservedStartTime.getTime(); } if (currentTimeMillis - time < 1000 * 60 * 15) { @@ -2380,8 +2380,8 @@ public class OrderBasicInfoServiceImpl implements OrderBasicInfoService { } @Override - public List getAppointmentOrder(LocalDateTime dateTime) { - return orderBasicInfoMapper.getAppointmentOrder(dateTime); + public List getReservedOrder(LocalDateTime dateTime) { + return orderBasicInfoMapper.getReservedOrder(dateTime); } /** @@ -3549,7 +3549,8 @@ public class OrderBasicInfoServiceImpl implements OrderBasicInfoService { } 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)); } // 订单详情 diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/YKCPushCommandServiceImpl.java b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/YKCPushCommandServiceImpl.java index bfbb27dda..93f91d074 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/YKCPushCommandServiceImpl.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/YKCPushCommandServiceImpl.java @@ -493,12 +493,12 @@ public class YKCPushCommandServiceImpl implements YKCPushCommandService { byte[] operateByteArr = BytesUtil.str2Bcd(operation); // 开始时间 - Date appointmentStartTime = command.getAppointmentStartTime(); - byte[] appointmentStartTimeByteArr = Cp56Time2aUtil.date2Hbyte(DateUtils.parseDate(appointmentStartTime)); + Date reservedStartTime = command.getReservedStartTime(); + byte[] reservedStartTimeByteArr = Cp56Time2aUtil.date2Hbyte(DateUtils.parseDate(reservedStartTime)); // 结束时间 - Date appointmentEndTime = command.getAppointmentEndTime(); - byte[] appointmentEndTimeByteArr = Cp56Time2aUtil.date2Hbyte(DateUtils.parseDate(appointmentEndTime)); + Date reservedEndTime = command.getReservedEndTime(); + byte[] reservedEndTimeByteArr = Cp56Time2aUtil.date2Hbyte(DateUtils.parseDate(reservedEndTime)); // 启动金额 BigDecimal amount = command.getAmount(); @@ -506,7 +506,7 @@ public class YKCPushCommandServiceImpl implements YKCPushCommandService { // 拼装msg信息 byte[] msg = Bytes.concat(transactionCodeArr, pileSnByteArr, connectorCodeByteArr, operateByteArr, - appointmentStartTimeByteArr, appointmentEndTimeByteArr, amountByteArr); + reservedStartTimeByteArr, reservedEndTimeByteArr, amountByteArr); this.push(msg, pileSn, YKCFrameTypeCode.RESERVE_CHARGING_CODE); } } diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/service/programlogic/AbstractProgramLogic.java b/jsowell-pile/src/main/java/com/jsowell/pile/service/programlogic/AbstractProgramLogic.java index d868f539c..5b2932205 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/service/programlogic/AbstractProgramLogic.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/service/programlogic/AbstractProgramLogic.java @@ -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 * 使用优惠计费模板计算优惠金额 diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/service/programlogic/NotDelayMerchantProgramLogic.java b/jsowell-pile/src/main/java/com/jsowell/pile/service/programlogic/NotDelayMerchantProgramLogic.java index e1c41299b..e1855617b 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/service/programlogic/NotDelayMerchantProgramLogic.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/service/programlogic/NotDelayMerchantProgramLogic.java @@ -78,119 +78,6 @@ public class NotDelayMerchantProgramLogic extends AbstractProgramLogic { 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 public Map payOrder(PayOrderDTO dto) { logger.info("【{}】-支付订单start, param:{}", this.getClass().getSimpleName(), JSON.toJSONString(dto)); diff --git a/jsowell-pile/src/main/resources/mapper/pile/OrderBasicInfoMapper.xml b/jsowell-pile/src/main/resources/mapper/pile/OrderBasicInfoMapper.xml index 7d428a8fb..f40233f8c 100644 --- a/jsowell-pile/src/main/resources/mapper/pile/OrderBasicInfoMapper.xml +++ b/jsowell-pile/src/main/resources/mapper/pile/OrderBasicInfoMapper.xml @@ -32,7 +32,8 @@ - + + @@ -51,7 +52,7 @@ 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, 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 - - + + \ No newline at end of file diff --git a/jsowell-quartz/src/main/java/com/jsowell/quartz/task/JsowellTask.java b/jsowell-quartz/src/main/java/com/jsowell/quartz/task/JsowellTask.java index 6510569e7..b31a5eb13 100644 --- a/jsowell-quartz/src/main/java/com/jsowell/quartz/task/JsowellTask.java +++ b/jsowell-quartz/src/main/java/com/jsowell/quartz/task/JsowellTask.java @@ -81,7 +81,7 @@ public class JsowellTask { public void appointmentOrderStart() { // 查询出 已支付 设置预约充电 未启动 的订单 LocalDateTime now = LocalDateTime.now(); - List list = orderBasicInfoService.getAppointmentOrder(now); + List list = orderBasicInfoService.getReservedOrder(now); if (CollectionUtils.isEmpty(list)) { return; } diff --git a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/lianlian/service/impl/LianLianServiceImpl.java b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/lianlian/service/impl/LianLianServiceImpl.java index d3ee4c79d..11ed45939 100644 --- a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/lianlian/service/impl/LianLianServiceImpl.java +++ b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/lianlian/service/impl/LianLianServiceImpl.java @@ -598,7 +598,7 @@ public class LianLianServiceImpl implements LianLianService { PileConnectorInfoVO connectorInfo = pileConnectorInfoService.getPileConnectorInfoByConnectorCode(pileConnectorCode); 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_APPOINTMENT_LOCK.getValue(), String.valueOf(connectorInfo.getStatus())) + || StringUtils.equals(PileConnectorDataBaseStatusEnum.OCCUPIED_RESERVED_LOCK.getValue(), String.valueOf(connectorInfo.getStatus())) ) { vo.setSuccStat(0); vo.setFailReason(0); diff --git a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/service/impl/HaiNanPlatformServiceImpl.java b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/service/impl/HaiNanPlatformServiceImpl.java index 7b82d36a9..d1d95f895 100644 --- a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/service/impl/HaiNanPlatformServiceImpl.java +++ b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/service/impl/HaiNanPlatformServiceImpl.java @@ -615,7 +615,7 @@ public class HaiNanPlatformServiceImpl implements ThirdPartyPlatformService { PileConnectorInfoVO connectorInfo = pileConnectorInfoService.getPileConnectorInfoByConnectorCode(pileConnectorCode); 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_APPOINTMENT_LOCK.getValue(), String.valueOf(connectorInfo.getStatus())) + || StringUtils.equals(PileConnectorDataBaseStatusEnum.OCCUPIED_RESERVED_LOCK.getValue(), String.valueOf(connectorInfo.getStatus())) ) { vo.setSuccStat(0); vo.setFailReason(0); diff --git a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/service/impl/LianLianPlatformServiceImpl.java b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/service/impl/LianLianPlatformServiceImpl.java index f1df0fb4b..61cf0f913 100644 --- a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/service/impl/LianLianPlatformServiceImpl.java +++ b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/service/impl/LianLianPlatformServiceImpl.java @@ -1176,7 +1176,7 @@ public class LianLianPlatformServiceImpl implements ThirdPartyPlatformService { PileConnectorInfoVO connectorInfo = pileConnectorInfoService.getPileConnectorInfoByConnectorCode(pileConnectorCode); 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_APPOINTMENT_LOCK.getValue(), String.valueOf(connectorInfo.getStatus())) + || StringUtils.equals(PileConnectorDataBaseStatusEnum.OCCUPIED_RESERVED_LOCK.getValue(), String.valueOf(connectorInfo.getStatus())) ) { succStat = 0; failReason = 0;