车辆以及人员进出信息修复
parent
f9e4d06002
commit
4d91d260be
|
@ -24,7 +24,7 @@ public class SaveMachineInfoScheduled {
|
||||||
private GateCarMachineInfoService gateCarMachineInfoService;
|
private GateCarMachineInfoService gateCarMachineInfoService;
|
||||||
|
|
||||||
@Scheduled(cron ="0 0 0/1 * * ?")
|
@Scheduled(cron ="0 0 0/1 * * ?")
|
||||||
// @Scheduled(cron ="0/30 * * * * ?")
|
//@Scheduled(cron ="0/30 * * * * ?")
|
||||||
public void scheduled() {
|
public void scheduled() {
|
||||||
//存储人员进出记录信息
|
//存储人员进出记录信息
|
||||||
savePersonMachineInfo();
|
savePersonMachineInfo();
|
||||||
|
@ -39,8 +39,8 @@ public class SaveMachineInfoScheduled {
|
||||||
String fendDate = dft.format(new Date())+"+08:00";
|
String fendDate = dft.format(new Date())+"+08:00";
|
||||||
String fstartDate = "";
|
String fstartDate = "";
|
||||||
Calendar now = Calendar.getInstance();
|
Calendar now = Calendar.getInstance();
|
||||||
// now.add(Calendar.HOUR, -1);
|
now.add(Calendar.HOUR, -1);
|
||||||
now.add(Calendar.SECOND, -30);
|
// now.add(Calendar.SECOND, -30);
|
||||||
Date before = now.getTime();
|
Date before = now.getTime();
|
||||||
fstartDate = dft.format(before)+"+08:00";
|
fstartDate = dft.format(before)+"+08:00";
|
||||||
int pageNo = 1; //第几页
|
int pageNo = 1; //第几页
|
||||||
|
@ -49,6 +49,7 @@ public class SaveMachineInfoScheduled {
|
||||||
JSONObject data = (JSONObject)carDoorComeAndOutInfo.get("data");
|
JSONObject data = (JSONObject)carDoorComeAndOutInfo.get("data");
|
||||||
List<PageData> firstInfoList = getCarInfoList(data);
|
List<PageData> firstInfoList = getCarInfoList(data);
|
||||||
if (firstInfoList.size() > 0) {
|
if (firstInfoList.size() > 0) {
|
||||||
|
System.out.println(DateUtil.date2Str(new Date())+"存入第一页车辆进出数据"+firstInfoList.size()+"条");
|
||||||
gateCarMachineInfoService.BatchinsertInfo(firstInfoList);
|
gateCarMachineInfoService.BatchinsertInfo(firstInfoList);
|
||||||
}
|
}
|
||||||
int total = Integer.parseInt(data.getString("total"));
|
int total = Integer.parseInt(data.getString("total"));
|
||||||
|
@ -68,6 +69,7 @@ public class SaveMachineInfoScheduled {
|
||||||
JSONObject nextData = (JSONObject)nextDoorComeAndOutInfo.get("data");
|
JSONObject nextData = (JSONObject)nextDoorComeAndOutInfo.get("data");
|
||||||
List<PageData> nextInfoList = getCarInfoList(nextData);
|
List<PageData> nextInfoList = getCarInfoList(nextData);
|
||||||
if (nextInfoList.size() > 0) {
|
if (nextInfoList.size() > 0) {
|
||||||
|
System.out.println(DateUtil.date2Str(new Date())+"存入第"+i+"页车辆进出数据"+nextInfoList.size()+"条");
|
||||||
gateCarMachineInfoService.BatchinsertInfo(nextInfoList);
|
gateCarMachineInfoService.BatchinsertInfo(nextInfoList);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -84,8 +86,8 @@ public class SaveMachineInfoScheduled {
|
||||||
String fendDate = dft.format(new Date())+"+08:00";
|
String fendDate = dft.format(new Date())+"+08:00";
|
||||||
String fstartDate = "";
|
String fstartDate = "";
|
||||||
Calendar now = Calendar.getInstance();
|
Calendar now = Calendar.getInstance();
|
||||||
// now.add(Calendar.HOUR, -1);
|
now.add(Calendar.HOUR, -1);
|
||||||
now.add(Calendar.SECOND, -30);
|
// now.add(Calendar.SECOND, -30);
|
||||||
Date before = now.getTime();
|
Date before = now.getTime();
|
||||||
fstartDate = dft.format(before)+"+08:00";
|
fstartDate = dft.format(before)+"+08:00";
|
||||||
int pageNo = 1; //第几页
|
int pageNo = 1; //第几页
|
||||||
|
@ -94,6 +96,7 @@ public class SaveMachineInfoScheduled {
|
||||||
JSONObject data = (JSONObject)doorComeAndOutInfo.get("data");
|
JSONObject data = (JSONObject)doorComeAndOutInfo.get("data");
|
||||||
List<PageData> infoList = getInfoList(data);
|
List<PageData> infoList = getInfoList(data);
|
||||||
if (infoList.size()>0) {
|
if (infoList.size()>0) {
|
||||||
|
System.out.println(DateUtil.date2Str(new Date())+"存入第一页人员进出数据"+infoList.size()+"条");
|
||||||
gateMachineInfoService.BatchinsertInfo(infoList);
|
gateMachineInfoService.BatchinsertInfo(infoList);
|
||||||
}
|
}
|
||||||
//判断是否有下一页,如果有继续请求并且插入
|
//判断是否有下一页,如果有继续请求并且插入
|
||||||
|
@ -105,6 +108,7 @@ public class SaveMachineInfoScheduled {
|
||||||
JSONObject nextData = (JSONObject)nextDoorComeAndOutInfo.get("data");
|
JSONObject nextData = (JSONObject)nextDoorComeAndOutInfo.get("data");
|
||||||
List<PageData> nextInfoList = getInfoList(nextData);
|
List<PageData> nextInfoList = getInfoList(nextData);
|
||||||
if (nextInfoList.size()>0) {
|
if (nextInfoList.size()>0) {
|
||||||
|
System.out.println(DateUtil.date2Str(new Date())+"存入第"+i+"页人员进出数据"+nextInfoList.size()+"条");
|
||||||
gateMachineInfoService.BatchinsertInfo(nextInfoList);
|
gateMachineInfoService.BatchinsertInfo(nextInfoList);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue