Merge branch 'master' of https://gitee.com/op-souls/ghy-all
This commit is contained in:
commit
7226dab94d
|
|
@ -35,6 +35,16 @@
|
||||||
<artifactId>ghy-common</artifactId>
|
<artifactId>ghy-common</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.ghy</groupId>
|
||||||
|
<artifactId>ghy-order</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.ghy</groupId>
|
||||||
|
<artifactId>ghy-payment</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
|
|
@ -0,0 +1,11 @@
|
||||||
|
package com.ghy.quartz.service;
|
||||||
|
|
||||||
|
public interface OrderService {
|
||||||
|
|
||||||
|
// 更新超时环境订单
|
||||||
|
void overTimeOrder(String orderStatus);
|
||||||
|
|
||||||
|
// 自动完成和分账
|
||||||
|
void finishOrder();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -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() {
|
||||||
|
// 查询符合自动确认的订单
|
||||||
|
|
||||||
|
// 更新符合自动确认订单的状态
|
||||||
|
|
||||||
|
// 调用分账动作
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +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(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();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue