|
|
@@ -11,16 +11,18 @@ import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.context.ApplicationListener;
|
|
|
import org.springframework.context.event.EventListener;
|
|
|
+import org.springframework.scheduling.annotation.Async;
|
|
|
+import org.springframework.scheduling.annotation.EnableAsync;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
import org.springframework.transaction.event.TransactionPhase;
|
|
|
import org.springframework.transaction.event.TransactionalEventListener;
|
|
|
import springfox.documentation.spring.web.json.Json;
|
|
|
|
|
|
+import java.util.concurrent.CompletableFuture;
|
|
|
+
|
|
|
@Component
|
|
|
@Slf4j
|
|
|
public class WorkTimeChangeEventListener implements ApplicationListener<WorkTimeChangeEvent> {
|
|
|
-
|
|
|
-
|
|
|
@Autowired
|
|
|
RemoteResumptionTaskService remoteResumptionTaskService;
|
|
|
@Autowired
|
|
|
@@ -34,10 +36,15 @@ public class WorkTimeChangeEventListener implements ApplicationListener<WorkTime
|
|
|
@EventListener(WorkTimeChangeEvent.class)
|
|
|
@TransactionalEventListener(phase = TransactionPhase.AFTER_COMMIT, fallbackExecution = false)
|
|
|
public void onApplicationEvent(WorkTimeChangeEvent event) {
|
|
|
+ CompletableFuture.supplyAsync(() ->
|
|
|
+ {
|
|
|
+ remoteResumptionTaskService.rebuild(JSON.toJSONString(event), SecurityConstants.INNER);
|
|
|
+ eduTrainingService.rebuild(JSON.toJSONString(event), SecurityConstants.INNER);
|
|
|
+ remoteRetrievalTaskService.rebuild(JSON.toJSONString(event), SecurityConstants.INNER);
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ );
|
|
|
|
|
|
- remoteResumptionTaskService.rebuild(JSON.toJSONString(event), SecurityConstants.INNER);
|
|
|
- eduTrainingService.rebuild(JSON.toJSONString(event), SecurityConstants.INNER);
|
|
|
- remoteRetrievalTaskService.rebuild(JSON.toJSONString(event), SecurityConstants.INNER);
|
|
|
// remoteSafetyCheckService.rebuild(JSON.toJSONString(event), SecurityConstants.INNER);
|
|
|
}
|
|
|
}
|