tevin hace 2 meses
padre
commit
82c73e61aa

+ 11 - 7
src/main/java/com/shanghaichengdi/schedule/PollutionWarningSchedule.java

@@ -1,8 +1,11 @@
 package com.shanghaichengdi.schedule;
 
+import com.shanghaichengdi.service.IBoatPollutionWarningService;
 import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Component;
 
+import javax.annotation.Resource;
+
 /**
  * @ClassName PollutionWarningSchedule
  * @Author Tevin
@@ -12,16 +15,17 @@ import org.springframework.stereotype.Component;
 @Component
 public class PollutionWarningSchedule {
 
+    @Resource
+    private IBoatPollutionWarningService boatPollutionWarningService;
 
-    @Scheduled(fixedRate = 10*60*1000)
-    public void ShortBarge(){
-
+    @Scheduled(fixedRate = 10 * 60 * 1000)
+    public void ShortBarge() {
         System.out.println(System.currentTimeMillis());
-
+        boatPollutionWarningService.handleShortBarge();
     }
 
-    @Scheduled(fixedRate = 10*60*1000)
-    public void OrdinaryShip(){
-
+    @Scheduled(fixedRate = 10 * 60 * 1000)
+    public void OrdinaryShip() {
+        boatPollutionWarningService.handleOrdinaryShip();
     }
 }