|
|
@@ -0,0 +1,46 @@
|
|
|
+package com.uas.eis.task;
|
|
|
+
|
|
|
+import com.uas.eis.serviceImpl.ADSyncService;
|
|
|
+import com.uas.eis.serviceImpl.NetEasyService;
|
|
|
+import com.uas.eis.serviceImpl.SyncResService;
|
|
|
+import com.uas.eis.serviceImpl.YongHService;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.scheduling.annotation.Scheduled;
|
|
|
+import org.springframework.stereotype.Component;
|
|
|
+
|
|
|
+import java.util.Map;
|
|
|
+
|
|
|
+@Component
|
|
|
+public class SyncAccountTask {
|
|
|
+ @Autowired
|
|
|
+ private NetEasyService netEasyService;
|
|
|
+ @Autowired
|
|
|
+ private ADSyncService adSyncService;
|
|
|
+ @Autowired
|
|
|
+ private YongHService yongHService;
|
|
|
+ @Autowired
|
|
|
+ private SyncResService syncResService;
|
|
|
+
|
|
|
+ @Scheduled(cron = "0 0 12,20 * * ?")
|
|
|
+ public void syncNetEasy(){
|
|
|
+ netEasyService.syncNetEasyOrg();
|
|
|
+ netEasyService.syncEmployee();
|
|
|
+ }
|
|
|
+
|
|
|
+ @Scheduled(cron = "0 0 12,20 * * ?")
|
|
|
+ public void syncAD(){
|
|
|
+ adSyncService.syncOrg();
|
|
|
+ adSyncService.syncUser();
|
|
|
+ }
|
|
|
+
|
|
|
+ @Scheduled(cron = "0 0 12,20 * * ?")
|
|
|
+ public void syncYongH() throws Exception {
|
|
|
+ String key="yonghong";
|
|
|
+ String err="";
|
|
|
+ String message="";
|
|
|
+ Map<String,Object> resMap=yongHService.syncEmployee();
|
|
|
+ err = resMap.get("err")==null?"":resMap.get("err").toString();
|
|
|
+ message=resMap.get("message")==null?"":resMap.get("message").toString();
|
|
|
+ syncResService.updateSyncResult(key,message,err);
|
|
|
+ }
|
|
|
+}
|