新增超时+自动完成订单提现操作

This commit is contained in:
kuang.yifei@iwhalecloud.com 2022-07-19 11:04:23 +08:00
parent 42129f215f
commit 3518269ae3
3 changed files with 67 additions and 3 deletions

View File

@ -0,0 +1,11 @@
package com.ghy.quartz.service;
public interface OrderService {
// 更新超时环境订单
void overTimeOrder(String orderStatus);
// 自动完成和分账
void finishOrder();
}

View File

@ -0,0 +1,35 @@
package com.ghy.quartz.service.impl;
import com.ghy.order.service.OrderMasterService;
import com.ghy.payment.service.FinancialMasterService;
import com.ghy.quartz.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class OrderServiceImpl implements OrderService {
@Autowired
private OrderMasterService orderMasterService;
@Autowired
private FinancialMasterService financialMasterService;
@Override
public void overTimeOrder(String orderStatus) {
// 查询符合超时的单
// 更新对应单的状态
// 生成对应的扣款明细
}
@Override
public void finishOrder() {
// 查询符合自动确认的订单
// 更新符合自动确认订单的状态
// 调用分账动作
}
}

View File

@ -1,22 +1,40 @@
package com.ghy.quartz.task;
import com.ghy.common.utils.ExceptionUtil;
import com.ghy.quartz.service.OrderService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@Slf4j
@Component("orderTask")
public class OrderTask {
@Autowired
private OrderService orderService;
/**
* 超时状态刷新
* */
public void overTimeOrder(){
public void overTimeOrder(String orderStatus){
try {
orderService.overTimeOrder(orderStatus);
}catch (Exception e){
log.error("over time order task error is {}", ExceptionUtil.getExceptionMessage(e));
e.printStackTrace();
}
}
/**
* 自动确认完成订单
* */
public void finishOrder(){
try {
orderService.finishOrder();
}catch (Exception e){
log.error("auto finish order task error is {}", ExceptionUtil.getExceptionMessage(e));
e.printStackTrace();
}
}
}