车辆以及人员进出信息修复

0927cmt
zhaoyu 2024-03-22 09:52:04 +08:00
parent f9e4d06002
commit 4d91d260be
1 changed files with 9 additions and 5 deletions

View File

@ -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<PageData> 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<PageData> 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<PageData> 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<PageData> nextInfoList = getInfoList(nextData);
if (nextInfoList.size()>0) {
System.out.println(DateUtil.date2Str(new Date())+"存入第"+i+"页人员进出数据"+nextInfoList.size()+"条");
gateMachineInfoService.BatchinsertInfo(nextInfoList);
}
}