|
@@ -43,8 +43,8 @@ public class SyncService {
|
|
|
@Autowired
|
|
|
private SyncMeterDataJob syncMeterDataJob;
|
|
|
|
|
|
- //@Scheduled(cron = "0 0 * * * ?")
|
|
|
- public void countPlanDevice(){
|
|
|
+ //@Scheduled(cron = "10 0 0 * * ?")
|
|
|
+ /*public void countPlanDevice(){
|
|
|
|
|
|
WaterMeterBaseEntity waterMeterBaseEntity=new WaterMeterBaseEntity();
|
|
|
|
|
@@ -64,13 +64,15 @@ public class SyncService {
|
|
|
|
|
|
|
|
|
|
|
|
- }
|
|
|
+ }*/
|
|
|
+ @Scheduled(cron = "10 0 0 * * ?")
|
|
|
public void uploadRelationId(){
|
|
|
WaterMeterBaseEntity waterMeterBaseEntity=new WaterMeterBaseEntity();
|
|
|
|
|
|
- log.info("获取泗水水表列表");
|
|
|
+
|
|
|
List<Map<String, Object>> meterInfor = receiveDao.getMeterInfor(waterMeterBaseEntity);
|
|
|
Sets.SetView<String> meterNoIntersection = needSyncMeterNo(meterInfor);
|
|
|
+ log.info("获取泗水水表列表,数量={}",meterInfor.size());
|
|
|
meterInfor.forEach(meter->{
|
|
|
String meterNo = (String) meter.get("meterNo");
|
|
|
if(meterNoIntersection.contains(meterNo)){
|
|
@@ -185,19 +187,20 @@ public class SyncService {
|
|
|
Sets.SetView<String> difference = Sets.difference(allDeviceNos, hasDeviceNos);
|
|
|
return difference;
|
|
|
}
|
|
|
- //@Scheduled(cron = "* 0/30 * * * ?")
|
|
|
+ @Scheduled(cron = "* 0/30 * * * ?")
|
|
|
public void uploadData(){
|
|
|
Map<String,Object>args2=new HashMap<>();
|
|
|
+ log.info("获取泗水上传计划");
|
|
|
List<Map<String, Object>> uploadPlan = receiveDao.getUploadPlan(args2);
|
|
|
uploadPlan.forEach(map->{
|
|
|
String planId=(String) map.get("PlanId");
|
|
|
- log.info("获取泗水上传计划");
|
|
|
- //syncMeterDataJob.sendTask(map);
|
|
|
- if(!quartzManager.checkExists(planId)){
|
|
|
|
|
|
- quartzManager.addJob(planId, SyncMeterDataJob.class,setCron((Date) map.get("UploadTime")),map);
|
|
|
+ // syncMeterDataJob.sendTask(map);
|
|
|
+ if(!quartzManager.checkExists(planId)){
|
|
|
+ Date date=(Date) map.get("UploadTime");
|
|
|
+ quartzManager.addJob(planId, SyncMeterDataJob.class,setCron(date),map);
|
|
|
//quartzManager.addJob(planId, SyncMeterDataJob.class,"15 41 15 * * ?", map);
|
|
|
- log.info("设置泗水上传计划定时任务");
|
|
|
+ log.info("设置泗水上传计划定时任务={}",date.toString());
|
|
|
}
|
|
|
|
|
|
});
|