From 5822ff6d513df1ad4c55beeeba449b7e39c7de32 Mon Sep 17 00:00:00 2001 From: 18650502300 <18650502300@163.com> Date: Thu, 13 Jun 2024 17:47:25 +0800 Subject: [PATCH] =?UTF-8?q?1.=20=E8=81=94=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/ruoyi/system/domain/EtOrder.java | 4 ++++ .../system/service/impl/AsDeviceServiceImpl.java | 12 ++++++++++-- .../system/service/impl/EtOrderServiceImpl.java | 2 ++ .../main/resources/mapper/system/EtOrderMapper.xml | 12 +++++++++--- 4 files changed, 25 insertions(+), 5 deletions(-) diff --git a/electripper-system/src/main/java/com/ruoyi/system/domain/EtOrder.java b/electripper-system/src/main/java/com/ruoyi/system/domain/EtOrder.java index c46689c..371faf7 100644 --- a/electripper-system/src/main/java/com/ruoyi/system/domain/EtOrder.java +++ b/electripper-system/src/main/java/com/ruoyi/system/domain/EtOrder.java @@ -98,6 +98,10 @@ public class EtOrder extends BaseEntity @Excel(name = "订单总金额(元)") private BigDecimal totalFee; + /** 实际支付金额(元) */ + @Excel(name = "实际支付金额(元)") + private BigDecimal payFee; + /** 实际结算金额(元) */ @TableField(exist = false) private BigDecimal settlementFee; diff --git a/electripper-system/src/main/java/com/ruoyi/system/service/impl/AsDeviceServiceImpl.java b/electripper-system/src/main/java/com/ruoyi/system/service/impl/AsDeviceServiceImpl.java index 28f78fe..06bd39f 100644 --- a/electripper-system/src/main/java/com/ruoyi/system/service/impl/AsDeviceServiceImpl.java +++ b/electripper-system/src/main/java/com/ruoyi/system/service/impl/AsDeviceServiceImpl.java @@ -128,7 +128,7 @@ public class AsDeviceServiceImpl extends ServiceImpl i } /** - * 根据sn号查询车辆实时信息 + * 根据sn号查询车辆实时信息 真实金额 实际 * * @param sn 设备sn * @return 设备 @@ -140,12 +140,20 @@ public class AsDeviceServiceImpl extends ServiceImpl i if (ObjectUtil.isNull(asDevice)) { throw new ServiceException("设备不存在:"+ sn); } + // 查询车辆上下线 + if(!isOnline(sn)){ + asDevice.setOnlineStatus(ServiceConstants.VEHICLE_STATUS_OFFLINE); + log.info("设备不在线:"+ sn); + }else{ + asDevice.setOnlineStatus(ServiceConstants.VEHICLE_STATUS_ONLINE); + } + int i = asDeviceMapper.updateAsDevice(asDevice); Long areaId = asDevice.getAreaId(); EtOperatingArea etOperatingArea; if (ObjectUtil.isNotNull(areaId)) { etOperatingArea = etOperatingAreaService.selectEtOperatingAreaByAreaId(areaId); }else{ - throw new ServiceException("区域信息不存在"); + throw new ServiceException("【selectAsDeviceBySn】区域信息不存在"); } if(ObjectUtil.isNotNull(etOperatingArea)){ asDevice.setAreaName(etOperatingArea.getAreaName()); diff --git a/electripper-system/src/main/java/com/ruoyi/system/service/impl/EtOrderServiceImpl.java b/electripper-system/src/main/java/com/ruoyi/system/service/impl/EtOrderServiceImpl.java index 8df2764..c6956f5 100644 --- a/electripper-system/src/main/java/com/ruoyi/system/service/impl/EtOrderServiceImpl.java +++ b/electripper-system/src/main/java/com/ruoyi/system/service/impl/EtOrderServiceImpl.java @@ -715,6 +715,8 @@ public class EtOrderServiceImpl implements IEtOrderService } log.info("总金额:【{}】,退款金额:【{}】", etOrder1.getTotalFee(), refundAmount); Refund refund = wxPayService.refund(etOrder1, etOrder.getReason(), refundAmount); + //todo 更新订单的payFee = totalFee - refundAmount + /** 2.记录退款表 创建退款对象*/ EtRefund refund1= createRefund(etOrder, refundAmount, appointmentFee, dispatchFee, manageFee, ridingFee, refund,ServiceConstants.REFUND_TYPE_SYSTEM); int i = etRefundService.insertEtRefund(refund1); diff --git a/electripper-system/src/main/resources/mapper/system/EtOrderMapper.xml b/electripper-system/src/main/resources/mapper/system/EtOrderMapper.xml index 0f5fe85..a584bfb 100644 --- a/electripper-system/src/main/resources/mapper/system/EtOrderMapper.xml +++ b/electripper-system/src/main/resources/mapper/system/EtOrderMapper.xml @@ -18,6 +18,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + @@ -40,7 +41,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" select order_id, area_id, order_no, out_trade_no, user_id, rule_id, - device_mac, sn, pay_time, paid, pay_type, type, total_fee, dispatch_fee, + device_mac, sn, pay_time, paid, pay_type, type, total_fee, pay_fee, dispatch_fee, manage_fee, riding_fee, appointment_fee, mark, duration, distance, status, create_time, appointment_start_time, appointment_end_time,appointment_timeout, unlock_time,return_time, rule_end_time, return_type, AsText(trip_route) trip_route,trip_route_str from et_order @@ -63,6 +64,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" o.pay_type, o.type, COALESCE(o.total_fee, 0) AS total_fee, + COALESCE(o.pay_fee, 0) AS pay_fee, COALESCE(o.dispatch_fee, 0) AS dispatch_fee, COALESCE(o.manage_fee, 0) AS manage_fee, COALESCE(o.riding_fee, 0) AS riding_fee, @@ -250,7 +252,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"