diff --git a/electripper-system/src/main/java/com/ruoyi/system/domain/EtReconciliation.java b/electripper-system/src/main/java/com/ruoyi/system/domain/EtReconciliation.java index 302b806..5d1896a 100644 --- a/electripper-system/src/main/java/com/ruoyi/system/domain/EtReconciliation.java +++ b/electripper-system/src/main/java/com/ruoyi/system/domain/EtReconciliation.java @@ -44,6 +44,18 @@ public class EtReconciliation extends BaseEntity @Excel(name = "押金退款") private BigDecimal depositRefund; + /** 押金盈余 */ + @Excel(name = "押金盈余") + private BigDecimal depositSurplus; + + /** 订单退款 */ + @Excel(name = "订单退款") + private BigDecimal orderRefund; + + /** 订单盈余 */ + @Excel(name = "订单盈余") + private BigDecimal orderSurplus; + /** 押金抵扣金额 */ @Excel(name = "押金抵扣金额") private BigDecimal deductionAmount; 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 858d993..1c430d2 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 @@ -1787,6 +1787,9 @@ public class AsDeviceServiceImpl extends ServiceImpl i throw new ServiceException("该订单状态非骑行中"); } EtOperatingArea area = etOperatingAreaService.selectEtOperatingAreaByAreaId(order.getAreaId()); + if(ServiceConstants.RETURN_VERIFY_YES.equals(area.getReturnVerify()) && StrUtil.isBlank(order.getVideoUrl())){ + throw new ServiceException("请先拍摄还车视频!"); + } if(ServiceConstants.RETURN_TYPE_NORMAL.equals(returnType)){ //判断是否在禁停区内,如果在禁停区内,不能还车。 noParkingArea if(isNoParkingArea(order.getSn(), order.getAreaId())){ diff --git a/electripper-system/src/main/java/com/ruoyi/system/task/EtTask.java b/electripper-system/src/main/java/com/ruoyi/system/task/EtTask.java index 31d1032..82db9eb 100644 --- a/electripper-system/src/main/java/com/ruoyi/system/task/EtTask.java +++ b/electripper-system/src/main/java/com/ruoyi/system/task/EtTask.java @@ -905,6 +905,9 @@ public class EtTask { etReconciliation.setPlatformServiceFee(selfReconciliationVO.getPlatformServiceFee()); etReconciliation.setDepositPaid(selfReconciliationVO.getDepositPaid()); etReconciliation.setOrderPaid(selfReconciliationVO.getOrderPaid()); + etReconciliation.setOrderRefund(selfReconciliationVO.getOrderRefund()); + etReconciliation.setOrderSurplus(selfReconciliationVO.getOrderPaid().subtract(selfReconciliationVO.getOrderRefund()).add(selfReconciliationVO.getDeductionAmount())); + etReconciliation.setDepositSurplus(selfReconciliationVO.getDepositChange()); etReconciliation.setDepositRefund(selfReconciliationVO.getDepositRefund()); etReconciliation.setDeductionAmount(selfReconciliationVO.getDeductionAmount()); etReconciliation.setUserReceipts(selfReconciliationVO.getUserReceipts()); diff --git a/electripper-system/src/main/resources/mapper/system/EtOrderMapper.xml b/electripper-system/src/main/resources/mapper/system/EtOrderMapper.xml index dd46649..c7be79c 100644 --- a/electripper-system/src/main/resources/mapper/system/EtOrderMapper.xml +++ b/electripper-system/src/main/resources/mapper/system/EtOrderMapper.xml @@ -1177,7 +1177,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" SELECT - COALESCE(SUM(pay_fee), 0) AS deposit_deduction_fee + SUM( total_amount ) AS total_sum FROM - et_order - WHERE 1=1 - and area_id != 14 - and area_id = #{areaId} - and pay_channel = #{channelId} - - AND date_format(pay_time,'%y%m%d') >= date_format(#{startDateStr},'%y%m%d') - - - AND date_format(pay_time,'%y%m%d') <= date_format(#{endDateStr},'%y%m%d') - - AND STATUS = 4 - AND type = 1 - AND deposit_deduction = '1' - AND paid = 1 - AND total_fee != 0 + ( + SELECT + ( + o.pay_fee - COALESCE ( ref.total_refund, 0 )) AS total_amount + FROM + et_order o + LEFT JOIN ( SELECT order_no, SUM( amount ) AS total_refund FROM et_refund GROUP BY order_no ) ref ON o.order_no = ref.order_no + WHERE 1=1 + and o.area_id != 14 + and o.area_id = #{areaId} + + AND date_format(o.pay_time,'%y%m%d') >= date_format(#{startDateStr},'%y%m%d') + + + AND date_format(o.pay_time,'%y%m%d') <= date_format(#{endDateStr},'%y%m%d') + + AND o.STATUS = 4 + AND o.type = 1 + AND o.deposit_deduction = '1' + AND o.paid = 1 + AND o.total_fee != 0 + AND ( + o.pay_fee - COALESCE ( ref.total_refund, 0 )) > 0 + AND o.mark LIKE '%大于%' UNION ALL + SELECT + SUM( o.pay_fee - ref.amount ) AS total_amount + FROM + et_order o + LEFT JOIN et_refund ref ON o.order_no = ref.order_no + WHERE 1=1 + and o.area_id != 14 + and o.area_id = #{areaId} + AND o.pay_channel = #{channelId} + + AND date_format(ref.create_time,'%y%m%d') >= date_format(#{startDateStr},'%y%m%d') + + + AND date_format(ref.create_time,'%y%m%d') <= date_format(#{endDateStr},'%y%m%d') + + AND o.STATUS = 4 + AND o.type = 2 + AND o.deposit_deduction = '1' + AND o.paid = 1 + AND o.total_fee != 0 + GROUP BY + o.order_no + ) AS combined_amounts diff --git a/electripper-system/src/main/resources/mapper/system/EtReconciliationMapper.xml b/electripper-system/src/main/resources/mapper/system/EtReconciliationMapper.xml index c19d32f..fe41cb9 100644 --- a/electripper-system/src/main/resources/mapper/system/EtReconciliationMapper.xml +++ b/electripper-system/src/main/resources/mapper/system/EtReconciliationMapper.xml @@ -18,10 +18,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + + - select reconciliation_id, order_paid, total_amount, deposit_paid, pay_channel, create_time, day, deposit_refund, deduction_amount, handling_charge, user_receipts, settlement_amount, platform_service_fee from et_reconciliation + select reconciliation_id, order_paid, total_amount, deposit_paid, pay_channel, create_time, day, deposit_refund, deduction_amount, + handling_charge, user_receipts, settlement_amount, platform_service_fee, order_refund, order_surplus, deposit_surplus from et_reconciliation