|
@@ -1,6 +1,7 @@
|
|
package com.szwl.controller;
|
|
package com.szwl.controller;
|
|
|
|
|
|
import com.szwl.service.TDepartmentService;
|
|
import com.szwl.service.TDepartmentService;
|
|
|
|
+import com.szwl.service.TOrderTaskService;
|
|
import com.szwl.service.TShandeMchService;
|
|
import com.szwl.service.TShandeMchService;
|
|
import com.szwl.service.es.EsTCoinOrderService;
|
|
import com.szwl.service.es.EsTCoinOrderService;
|
|
import com.szwl.service.es.EsTOrderService;
|
|
import com.szwl.service.es.EsTOrderService;
|
|
@@ -10,6 +11,8 @@ import org.springframework.scheduling.annotation.EnableScheduling;
|
|
import org.springframework.scheduling.annotation.Scheduled;
|
|
import org.springframework.scheduling.annotation.Scheduled;
|
|
import org.springframework.stereotype.Component;
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
|
|
+import java.net.InetAddress;
|
|
|
|
+import java.net.UnknownHostException;
|
|
import java.text.ParseException;
|
|
import java.text.ParseException;
|
|
import java.util.Calendar;
|
|
import java.util.Calendar;
|
|
|
|
|
|
@@ -22,21 +25,76 @@ public class ScheduledService {
|
|
@Autowired
|
|
@Autowired
|
|
private TShandeMchService tShandeMchService;
|
|
private TShandeMchService tShandeMchService;
|
|
@Autowired
|
|
@Autowired
|
|
|
|
+ private TOrderTaskService orderTaskService;
|
|
|
|
+ @Autowired
|
|
EsTCoinOrderService esTCoinOrderService;
|
|
EsTCoinOrderService esTCoinOrderService;
|
|
@Autowired
|
|
@Autowired
|
|
EsTOrderService esTOrderService;
|
|
EsTOrderService esTOrderService;
|
|
|
|
+
|
|
|
|
+ //8点到22点,每隔30秒去重发订单
|
|
|
|
+ @Scheduled(cron = "0/30 * 8-22 * * ?")
|
|
|
|
+ public void checkOrder() throws ParseException {
|
|
|
|
+// orderTaskService.checkOrder();
|
|
|
|
+ int i = 0;
|
|
|
|
+ try {
|
|
|
|
+ String hostAddress = InetAddress.getLocalHost().getHostAddress();
|
|
|
|
+ if(hostAddress.equals("10.0.0.153")){
|
|
|
|
+ orderTaskService.checkOrder();
|
|
|
|
+ i++;
|
|
|
|
+ }
|
|
|
|
+// if(hostAddress.equals("10.0.0.152")){
|
|
|
|
+// i++;
|
|
|
|
+// }
|
|
|
|
+
|
|
|
|
+ } catch (UnknownHostException e) {
|
|
|
|
+ e.printStackTrace();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ //每天凌晨删除订单定时发送表
|
|
|
|
+ @Scheduled(cron = "30 05 1 * * ?")
|
|
|
|
+ public void removeOrder(){
|
|
|
|
+ int i = 0;
|
|
|
|
+ try {
|
|
|
|
+ String hostAddress = InetAddress.getLocalHost().getHostAddress();
|
|
|
|
+ if(hostAddress.equals("10.0.0.153")){
|
|
|
|
+ orderTaskService.removeOrder();
|
|
|
|
+ i++;
|
|
|
|
+ }
|
|
|
|
+// if(hostAddress.equals("10.0.0.152")){
|
|
|
|
+// i++;
|
|
|
|
+// }
|
|
|
|
+
|
|
|
|
+ } catch (UnknownHostException e) {
|
|
|
|
+ e.printStackTrace();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+// 在每小时的29分执行一次 es同步数据
|
|
|
|
+ @Scheduled(cron = "0 29 * * * ?")
|
|
|
|
+ public void tongbuEs() throws ParseException {
|
|
|
|
+ int i = 0;
|
|
|
|
+ try {
|
|
|
|
+ String hostAddress = InetAddress.getLocalHost().getHostAddress();
|
|
|
|
+ if(hostAddress.equals("10.0.0.153")){
|
|
|
|
+ esTOrderService.tongbuByHour();
|
|
|
|
+ esTCoinOrderService.tongbuByHour();
|
|
|
|
+ i++;
|
|
|
|
+ }
|
|
|
|
+// if(hostAddress.equals("10.0.0.152")){
|
|
|
|
+// i++;
|
|
|
|
+// }
|
|
|
|
+
|
|
|
|
+ } catch (UnknownHostException e) {
|
|
|
|
+ e.printStackTrace();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
// //每天凌晨统计/核对杉德支付的金额表
|
|
// //每天凌晨统计/核对杉德支付的金额表
|
|
// @Scheduled(cron = "30 05 0 * * ?")
|
|
// @Scheduled(cron = "30 05 0 * * ?")
|
|
// public void shandejiesuan(){
|
|
// public void shandejiesuan(){
|
|
// tShandeMchService.jiesuan();
|
|
// tShandeMchService.jiesuan();
|
|
// }
|
|
// }
|
|
//
|
|
//
|
|
-// //在每小时的20分执行一次 es同步数据
|
|
|
|
-// @Scheduled(cron = "0 20 * * * ?")
|
|
|
|
-// public void tongbuEs() throws ParseException {
|
|
|
|
-// esTOrderService.tongbuByHour();
|
|
|
|
-// esTCoinOrderService.tongbuByHour();
|
|
|
|
-// }
|
|
|
|
-
|
|
|
|
|
|
|
|
}
|
|
}
|