|
|
@@ -1,12 +1,15 @@
|
|
|
package com.ydtech.modules.order.timer;
|
|
|
|
|
|
import com.ydtech.modules.order.service.InsOrderPayDateRecordService;
|
|
|
+import com.ydtech.utils.DateUtil;
|
|
|
+import com.ydtech.utils.DateUtil_N;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.scheduling.annotation.Scheduled;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
import java.text.SimpleDateFormat;
|
|
|
+import java.util.Date;
|
|
|
|
|
|
|
|
|
/**
|
|
|
@@ -33,9 +36,11 @@ public class UpdateOrderTimer {
|
|
|
@Scheduled(cron = "0 0 13 * * ?")
|
|
|
private void updateOrderDateNoon() {
|
|
|
log.info("定时更新订单的签单时间和缴费日期,启动时间:{}", new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"));
|
|
|
-
|
|
|
+ //凌晨1点到中午1点
|
|
|
+ String benginDate = DateUtil.getDateFormat(new Date(), "yyyy-MM-dd")+" 01:00:00";
|
|
|
+ String endDate = DateUtil.getDateFormat(new Date(), "yyyy-MM-dd HH:mm:ss");
|
|
|
try {
|
|
|
- insOrderPayDateRecordService.batchOrderDate();
|
|
|
+ insOrderPayDateRecordService.batchOrderDate(benginDate,endDate);
|
|
|
log.info("定时更新订单的签单时间和缴费日期成功");
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
@@ -47,9 +52,11 @@ public class UpdateOrderTimer {
|
|
|
@Scheduled(cron = "0 0 1 * * ?")
|
|
|
private void updateOrderDateBeforeDawn() {
|
|
|
log.info("定时更新订单的签单时间和缴费日期,启动时间:{}", new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"));
|
|
|
-
|
|
|
+ //中午1点到凌晨1点
|
|
|
+ String benginDate = DateUtil.getDateFormat(DateUtil_N.getPreviousDate(new Date()), "yyyy-MM-dd")+" 13:00:01";
|
|
|
+ String endDate = DateUtil.getDateFormat(new Date(), "yyyy-MM-dd HH:mm:ss");
|
|
|
try {
|
|
|
- insOrderPayDateRecordService.batchOrderDate();
|
|
|
+ insOrderPayDateRecordService.batchOrderDate(benginDate,endDate);
|
|
|
log.info("定时更新订单的签单时间和缴费日期成功");
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|