mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-24 21:15:06 +08:00
update 电单车协议
This commit is contained in:
@@ -20,6 +20,7 @@ import com.jsowell.common.enums.DelFlagEnum;
|
||||
import com.jsowell.common.enums.MemberWalletEnum;
|
||||
import com.jsowell.common.enums.adapay.AdapayStatusEnum;
|
||||
import com.jsowell.common.enums.adapay.MerchantDelayModeEnum;
|
||||
import com.jsowell.common.enums.ebike.EBikeStopReasonEnum;
|
||||
import com.jsowell.common.enums.ykc.*;
|
||||
import com.jsowell.common.exception.BusinessException;
|
||||
import com.jsowell.common.util.AdapayUtil;
|
||||
@@ -473,7 +474,35 @@ public class DelayMerchantProgramLogic extends AbstractProgramLogic {
|
||||
|
||||
@Override
|
||||
public void settleOrderForEBike(EBikeMessageCmd03 message, OrderBasicInfo orderBasicInfo) {
|
||||
// 判断订单状态
|
||||
if (StringUtils.equals(orderBasicInfo.getOrderStatus(), OrderStatusEnum.ORDER_COMPLETE.getValue())) {
|
||||
logger.info("结算订单:{}, 是订单完成状态", orderBasicInfo.getOrderCode());
|
||||
return;
|
||||
}
|
||||
|
||||
// 订单状态
|
||||
orderBasicInfo.setOrderStatus(OrderStatusEnum.ORDER_COMPLETE.getValue());
|
||||
// 停止原因
|
||||
orderBasicInfo.setReason(EBikeStopReasonEnum.getDescriptionByCode(message.getStopReason()));
|
||||
|
||||
// 更新订单详情
|
||||
OrderDetail orderDetail = orderBasicInfoService.getOrderDetailByOrderCode(orderBasicInfo.getOrderCode());
|
||||
if (orderDetail != null) {
|
||||
orderDetail.setTotalUsedElectricity(message.getConsumedEnergy());
|
||||
orderDetail.setFlatUsedElectricity(message.getConsumedEnergy());
|
||||
}
|
||||
|
||||
// 更新数据库
|
||||
OrderTransactionDTO dto = new OrderTransactionDTO();
|
||||
dto.setOrderBasicInfo(orderBasicInfo);
|
||||
dto.setOrderDetail(orderDetail);
|
||||
transactionService.doUpdateOrder(dto);
|
||||
|
||||
// 充电时间大于30秒不退费
|
||||
int chargingTime = message.getChargingTime();
|
||||
if (chargingTime < 30) {
|
||||
// 退款
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user