From 368df7be5f9efe9c237e7cb731d396e7e2ca55d2 Mon Sep 17 00:00:00 2001 From: 18650502300 <18650502300@163.com> Date: Mon, 2 Sep 2024 10:55:31 +0800 Subject: [PATCH] =?UTF-8?q?1.=20=E6=8A=BC=E9=87=91=E6=8A=B5=E6=89=A3?= =?UTF-8?q?=E4=B8=8D=E6=88=90=E5=8A=9F=E8=AE=A2=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../web/controller/app/AppController.java | 14 ++++++++++++++ .../ruoyi/system/mapper/EtOrderMapper.java | 5 +++++ .../java/com/ruoyi/system/task/EtTask.java | 19 +++++++++++++++++++ .../resources/mapper/system/EtOrderMapper.xml | 5 +++++ 4 files changed, 43 insertions(+) diff --git a/electripper-admin/src/main/java/com/ruoyi/web/controller/app/AppController.java b/electripper-admin/src/main/java/com/ruoyi/web/controller/app/AppController.java index 6c8459d..991c215 100644 --- a/electripper-admin/src/main/java/com/ruoyi/web/controller/app/AppController.java +++ b/electripper-admin/src/main/java/com/ruoyi/web/controller/app/AppController.java @@ -27,6 +27,7 @@ import com.ruoyi.framework.web.service.SysLoginService; import com.ruoyi.system.domain.*; import com.ruoyi.system.mapper.AsDeviceMapper; import com.ruoyi.system.mapper.AsUserMapper; +import com.ruoyi.system.mapper.EtOrderMapper; import com.ruoyi.system.service.*; import com.wechat.pay.java.service.payments.model.Transaction; import com.wechat.pay.java.service.refund.model.Refund; @@ -94,6 +95,9 @@ public class AppController extends BaseController @Autowired private IEtCouponService etCouponService; + @Resource + private EtOrderMapper etOrderMapper; + @Value("${aliyun.accessKeyId}") private String accessKeyId; @@ -724,4 +728,14 @@ public class AppController extends BaseController return success(errorDevices); } + /** + * 押金抵扣不成功订单 + */ + @GetMapping("/getDeductionErrorOrder") + public AjaxResult getDeductionErrorOrder() + { + List orders = etOrderMapper.deductionErrorOrderList(); + return success(orders); + } + } diff --git a/electripper-system/src/main/java/com/ruoyi/system/mapper/EtOrderMapper.java b/electripper-system/src/main/java/com/ruoyi/system/mapper/EtOrderMapper.java index d31de3a..b3bc295 100644 --- a/electripper-system/src/main/java/com/ruoyi/system/mapper/EtOrderMapper.java +++ b/electripper-system/src/main/java/com/ruoyi/system/mapper/EtOrderMapper.java @@ -325,4 +325,9 @@ public interface EtOrderMapper * 查询所有正在骑行中的订单 */ List getCurrentOrderList(); + + /** + * 押金抵扣不成功的修复 + */ + List deductionErrorOrderList(); } 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 0be7797..01602a5 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 @@ -483,6 +483,25 @@ public class EtTask { } } + /** + * 押金抵扣不成功的修复 + * 1. 找出所有押金抵扣不成功的订单 + * 2. 将状态改成已结束 + * + */ + public void deductionErrorOrder(){ + log.info("-------------------【定时任务】押金抵扣不成功的修复---开始----------------"); + List orders = etOrderMapper.deductionErrorOrderList(); + for (EtOrder order:orders) { + EtOrder order1 = new EtOrder(); + order1.setOrderId(order.getOrderId()); + order1.setStatus(ServiceConstants.ORDER_STATUS_ORDER_END); + order1.setMark("押金抵扣修复,订单已结束"); + etOrderMapper.updateEtOrder(order1); + } + log.info("-------------------【定时任务】押金抵扣不成功的修复---结束----------------"); + } + /** 更新订单为已支付*/ private void updateOrderPaid(EtOrder order) { order.setPaid(ServiceConstants.ORDER_PAY_STATUS_PAID); diff --git a/electripper-system/src/main/resources/mapper/system/EtOrderMapper.xml b/electripper-system/src/main/resources/mapper/system/EtOrderMapper.xml index 9437663..56a3e33 100644 --- a/electripper-system/src/main/resources/mapper/system/EtOrderMapper.xml +++ b/electripper-system/src/main/resources/mapper/system/EtOrderMapper.xml @@ -972,5 +972,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" where status = 2 + +