|
@@ -3,6 +3,7 @@ package com.jkcredit.invoice.hub.task;
|
|
|
import com.jkcredit.invoice.hub.model.po.carFreeCarrierBillStart.CarFreeCarrierBillStartPo;
|
|
|
import com.jkcredit.invoice.hub.service.apiCarFree.ApiCarFreeChargeService;
|
|
|
import com.jkcredit.invoice.hub.service.carFreeCarrierBillStart.CarFreeCarrierBillStartService;
|
|
|
+import com.xxl.job.core.biz.model.ReturnT;
|
|
|
import com.xxl.job.core.handler.annotation.XxlJob;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -17,7 +18,7 @@ import java.util.List;
|
|
|
* @create: 2020/1/18 15:49
|
|
|
* @version: V1.0
|
|
|
**/
|
|
|
-//@Component
|
|
|
+@Component
|
|
|
@Slf4j
|
|
|
public class WayBillTask {
|
|
|
@Autowired
|
|
@@ -28,7 +29,7 @@ public class WayBillTask {
|
|
|
// 实时运单
|
|
|
// @Scheduled(cron = "0 1 23 * * ?", zone = "Asia/Shanghai")
|
|
|
@XxlJob("realTimeWayBillHandler")
|
|
|
- public void realTimeWayBill() {
|
|
|
+ public ReturnT<String> realTimeWayBill(String param) {
|
|
|
log.info("实时运单定时处理开始");
|
|
|
// 查询实时订单,且状态为已结束和开票中
|
|
|
// 调用运单查询发票接口
|
|
@@ -40,13 +41,14 @@ public class WayBillTask {
|
|
|
for (CarFreeCarrierBillStartPo po : startPoList) {
|
|
|
chargeService.charge(po);
|
|
|
}
|
|
|
+ return ReturnT.SUCCESS;
|
|
|
}
|
|
|
|
|
|
// 历史运单
|
|
|
// @Scheduled(cron = "0 1 * * * ?", zone = "Asia/Shanghai")
|
|
|
// @Scheduled(cron = "0 11 17 * * ?", zone = "Asia/Shanghai")
|
|
|
@XxlJob("historyWayBillHandler")
|
|
|
- public void historyWayBill() {
|
|
|
+ public ReturnT<String> historyWayBill(String param) {
|
|
|
log.info("历史运单定时处理开始");
|
|
|
// 查询历史订单,且状态为已结束和开票中
|
|
|
// 调用运单查询发票接口
|
|
@@ -58,13 +60,14 @@ public class WayBillTask {
|
|
|
for (CarFreeCarrierBillStartPo po : startPoList) {
|
|
|
chargeService.charge(po);
|
|
|
}
|
|
|
+ return ReturnT.SUCCESS;
|
|
|
}
|
|
|
|
|
|
// // 查询状态为空的运单(状态为空为老平台遗留数据,通过此项目接口上传的运单状态不为空),is_history为空则不能区分是历史运单还是实时运单
|
|
|
// @Scheduled(cron = "0 0 0/2 * * ?", zone = "Asia/Shanghai")
|
|
|
// @Scheduled(cron = "0 1/3 * * * ?", zone = "Asia/Shanghai")
|
|
|
@XxlJob("billsWithoutIsHistoryFlagHandler")
|
|
|
- public void billsWithoutIsHistoryFlag() {
|
|
|
+ public ReturnT<String> billsWithoutIsHistoryFlag(String param) {
|
|
|
// 查询实时/历史订单,且状态为已结束和开票中
|
|
|
// 调用运单查询发票接口
|
|
|
// 解析结果
|
|
@@ -75,5 +78,6 @@ public class WayBillTask {
|
|
|
for (CarFreeCarrierBillStartPo po : startPoList) {
|
|
|
chargeService.charge(po);
|
|
|
}
|
|
|
+ return ReturnT.SUCCESS;
|
|
|
}
|
|
|
}
|