|
@@ -5,6 +5,8 @@ import com.rongwei.bscommon.sys.service.impl.ScheduledTasksServiceBySqlServerSer
|
|
import com.rongwei.rwcommon.base.R;
|
|
import com.rongwei.rwcommon.base.R;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
+import org.springframework.scheduling.annotation.Scheduled;
|
|
|
|
+import org.springframework.scheduling.annotation.Schedules;
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
@@ -26,6 +28,7 @@ public class ScheduledTasksServiceController {
|
|
* 新增和修改接口同步方法
|
|
* 新增和修改接口同步方法
|
|
*/
|
|
*/
|
|
@PostMapping("/project")
|
|
@PostMapping("/project")
|
|
|
|
+ @Scheduled(cron = "0 0 0,12 * * ? ")
|
|
public R pushDataSync() {
|
|
public R pushDataSync() {
|
|
scheduledTasksServiceBySqlServer.projectAboutSync();
|
|
scheduledTasksServiceBySqlServer.projectAboutSync();
|
|
return R.ok();
|
|
return R.ok();
|
|
@@ -35,6 +38,7 @@ public class ScheduledTasksServiceController {
|
|
* 从sql server同步人员、组织机构、关系
|
|
* 从sql server同步人员、组织机构、关系
|
|
*/
|
|
*/
|
|
@PostMapping("/userAndOrgSync")
|
|
@PostMapping("/userAndOrgSync")
|
|
|
|
+ @Scheduled(cron = "0 0 0,12 * * ? ")
|
|
public R userAndOrgSync() {
|
|
public R userAndOrgSync() {
|
|
scheduledTasksServiceBySqlServer.userAndOrgSync();
|
|
scheduledTasksServiceBySqlServer.userAndOrgSync();
|
|
return R.ok();
|
|
return R.ok();
|