|
|
|
@ -18,8 +18,10 @@ import org.springframework.scheduling.annotation.Scheduled;
|
|
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
import java.text.SimpleDateFormat;
|
|
|
|
|
import java.util.Date;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.TimeZone;
|
|
|
|
|
import java.util.concurrent.CountDownLatch;
|
|
|
|
|
import java.util.concurrent.ExecutorService;
|
|
|
|
|
import java.util.concurrent.Executors;
|
|
|
|
@ -38,7 +40,8 @@ public class TStrhEntityInfoKsTask {
|
|
|
|
|
@Resource
|
|
|
|
|
private TransitUserRecordService transitUserRecordService;
|
|
|
|
|
|
|
|
|
|
String maxTime = "2023-10-01 00:00:00";
|
|
|
|
|
String maxTime = "2023-12-09 00:00:00";
|
|
|
|
|
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
|
|
|
|
|
|
|
@Scheduled(initialDelay = 100, fixedDelay = 3000)
|
|
|
|
|
public void setTransitUserRecordService() {
|
|
|
|
@ -47,19 +50,20 @@ public class TStrhEntityInfoKsTask {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
dateFormat.setTimeZone(TimeZone.getTimeZone("Asia/Shanghai"));
|
|
|
|
|
LambdaQueryWrapper<TStrhEntityInfoKs> queryWrapper = Wrappers.lambdaQuery();
|
|
|
|
|
queryWrapper.gt(TStrhEntityInfoKs::getCapturetime, maxTime);
|
|
|
|
|
int countTStrh = tStrhEntityInfoKsService.count(queryWrapper);
|
|
|
|
|
if (countTStrh > 0) {
|
|
|
|
|
int count = countTStrh / 200;
|
|
|
|
|
int count = countTStrh / 1000;
|
|
|
|
|
for (int i = 0; i <= count; i++) {
|
|
|
|
|
try {
|
|
|
|
|
Page<TStrhEntityInfoKs> page = new Page<>(i + 1, 200);
|
|
|
|
|
Page<TStrhEntityInfoKs> page = new Page<>(i + 1, 1000);
|
|
|
|
|
List<TStrhEntityInfoKs> resultList = tStrhEntityInfoKsService.page(page, queryWrapper).getRecords();
|
|
|
|
|
for (TStrhEntityInfoKs entityInfoKs : resultList) {
|
|
|
|
|
TransitUserRecord transitUserRecord = new TransitUserRecord();
|
|
|
|
|
transitUserRecord.setDeviceCode(entityInfoKs.getCameraidx());
|
|
|
|
|
transitUserRecord.setPassTime(Long.parseLong(entityInfoKs.getCapturetime()));
|
|
|
|
|
transitUserRecord.setPassTime(dateFormat.parse(entityInfoKs.getCapturetime()).getTime() / 1000);
|
|
|
|
|
transitUserRecord.setPartitionField(dateFormat.parse(entityInfoKs.getCapturetime()));
|
|
|
|
|
transitUserRecord.setBodyGlobalPic(entityInfoKs.getImage());
|
|
|
|
|
transitUserRecord.setPersonPic(entityInfoKs.getSmalimage());
|
|
|
|
|
transitUserRecord.setSourceId(entityInfoKs.getEntityid());
|
|
|
|
@ -82,9 +86,6 @@ public class TStrhEntityInfoKsTask {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
logger.info("TSInfos:" + StringKit.getTrace(e));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|