Commit 409f25ad authored by lisong's avatar lisong

添加气瓶数据同步定时任务

parent a7850ad4
...@@ -11,9 +11,11 @@ import com.yeejoin.amos.boot.module.cylinder.flc.api.entity.CylinderInfo; ...@@ -11,9 +11,11 @@ import com.yeejoin.amos.boot.module.cylinder.flc.api.entity.CylinderInfo;
import com.yeejoin.amos.boot.module.cylinder.flc.api.mapper.CylCylinderFillingCheckMapper; import com.yeejoin.amos.boot.module.cylinder.flc.api.mapper.CylCylinderFillingCheckMapper;
import com.yeejoin.amos.boot.module.cylinder.flc.api.mapper.CylinderFillingCheckMapper; import com.yeejoin.amos.boot.module.cylinder.flc.api.mapper.CylinderFillingCheckMapper;
import com.yeejoin.amos.boot.module.cylinder.flc.api.mapper.CylinderInfoMapper; import com.yeejoin.amos.boot.module.cylinder.flc.api.mapper.CylinderInfoMapper;
import net.javacrumbs.shedlock.spring.annotation.SchedulerLock;
import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.ObjectUtils;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.StopWatch; import org.springframework.util.StopWatch;
...@@ -38,6 +40,8 @@ public class CylSyncServiceImpl { ...@@ -38,6 +40,8 @@ public class CylSyncServiceImpl {
@Autowired @Autowired
private CylCylinderFillingCheckMapper cylCylinderFillingCheckMapper; private CylCylinderFillingCheckMapper cylCylinderFillingCheckMapper;
@Scheduled(cron = "0 0 1 * * ?")
@SchedulerLock(name = "syncFillingCheckInfo", lockAtMostFor = "PT10H", lockAtLeastFor = "PT60M")
public void syncFillingCheckInfo() { public void syncFillingCheckInfo() {
// Integer totalSize = sourceFillingCheckServiceImpl.getFillCheckListTotal(); // Integer totalSize = sourceFillingCheckServiceImpl.getFillCheckListTotal();
// Integer times; // Integer times;
...@@ -125,6 +129,8 @@ public class CylSyncServiceImpl { ...@@ -125,6 +129,8 @@ public class CylSyncServiceImpl {
} }
} }
@Scheduled(cron = "0 0 1 * * ?")
@SchedulerLock(name = "fillingSync", lockAtMostFor = "PT10H", lockAtLeastFor = "PT60M")
public Object fillingSync() { public Object fillingSync() {
try { try {
StopWatch stopWatch = new StopWatch(); StopWatch stopWatch = new StopWatch();
...@@ -227,7 +233,8 @@ public class CylSyncServiceImpl { ...@@ -227,7 +233,8 @@ public class CylSyncServiceImpl {
} }
@Scheduled(cron = "0 0 1 * * ?")
@SchedulerLock(name = "fillingRecordSync", lockAtMostFor = "PT10H", lockAtLeastFor = "PT60M")
public String fillingRecordSync() { public String fillingRecordSync() {
// StopWatch stopWatch = new StopWatch(); // StopWatch stopWatch = new StopWatch();
// stopWatch.start(); // stopWatch.start();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment