diff --git a/src/main/java/com/zcloud/util/SaveMachineInfoScheduled.java b/src/main/java/com/zcloud/util/SaveMachineInfoScheduled.java index ddebd029..2d9e5879 100644 --- a/src/main/java/com/zcloud/util/SaveMachineInfoScheduled.java +++ b/src/main/java/com/zcloud/util/SaveMachineInfoScheduled.java @@ -24,7 +24,7 @@ public class SaveMachineInfoScheduled { private GateCarMachineInfoService gateCarMachineInfoService; @Scheduled(cron ="0 0 0/1 * * ?") -// @Scheduled(cron ="0/30 * * * * ?") + //@Scheduled(cron ="0/30 * * * * ?") public void scheduled() { //存储人员进出记录信息 savePersonMachineInfo(); @@ -39,8 +39,8 @@ public class SaveMachineInfoScheduled { String fendDate = dft.format(new Date())+"+08:00"; String fstartDate = ""; Calendar now = Calendar.getInstance(); -// now.add(Calendar.HOUR, -1); - now.add(Calendar.SECOND, -30); + now.add(Calendar.HOUR, -1); +// now.add(Calendar.SECOND, -30); Date before = now.getTime(); fstartDate = dft.format(before)+"+08:00"; int pageNo = 1; //第几页 @@ -49,6 +49,7 @@ public class SaveMachineInfoScheduled { JSONObject data = (JSONObject)carDoorComeAndOutInfo.get("data"); List firstInfoList = getCarInfoList(data); if (firstInfoList.size() > 0) { + System.out.println(DateUtil.date2Str(new Date())+"存入第一页车辆进出数据"+firstInfoList.size()+"条"); gateCarMachineInfoService.BatchinsertInfo(firstInfoList); } int total = Integer.parseInt(data.getString("total")); @@ -68,6 +69,7 @@ public class SaveMachineInfoScheduled { JSONObject nextData = (JSONObject)nextDoorComeAndOutInfo.get("data"); List nextInfoList = getCarInfoList(nextData); if (nextInfoList.size() > 0) { + System.out.println(DateUtil.date2Str(new Date())+"存入第"+i+"页车辆进出数据"+nextInfoList.size()+"条"); gateCarMachineInfoService.BatchinsertInfo(nextInfoList); } } @@ -84,8 +86,8 @@ public class SaveMachineInfoScheduled { String fendDate = dft.format(new Date())+"+08:00"; String fstartDate = ""; Calendar now = Calendar.getInstance(); -// now.add(Calendar.HOUR, -1); - now.add(Calendar.SECOND, -30); + now.add(Calendar.HOUR, -1); +// now.add(Calendar.SECOND, -30); Date before = now.getTime(); fstartDate = dft.format(before)+"+08:00"; int pageNo = 1; //第几页 @@ -94,6 +96,7 @@ public class SaveMachineInfoScheduled { JSONObject data = (JSONObject)doorComeAndOutInfo.get("data"); List infoList = getInfoList(data); if (infoList.size()>0) { + System.out.println(DateUtil.date2Str(new Date())+"存入第一页人员进出数据"+infoList.size()+"条"); gateMachineInfoService.BatchinsertInfo(infoList); } //判断是否有下一页,如果有继续请求并且插入 @@ -105,6 +108,7 @@ public class SaveMachineInfoScheduled { JSONObject nextData = (JSONObject)nextDoorComeAndOutInfo.get("data"); List nextInfoList = getInfoList(nextData); if (nextInfoList.size()>0) { + System.out.println(DateUtil.date2Str(new Date())+"存入第"+i+"页人员进出数据"+nextInfoList.size()+"条"); gateMachineInfoService.BatchinsertInfo(nextInfoList); } }