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 + +