Commit 08223f55 by 朱海

[add]增加最大数量限制

1 parent 2d5b3747
...@@ -72,7 +72,8 @@ public class KeliuController { ...@@ -72,7 +72,8 @@ public class KeliuController {
@RequestParam(required = false, value = "channelSerialNum") String channelSerialNum, @RequestParam(required = false, value = "channelSerialNum") String channelSerialNum,
@RequestParam(required = false, value = "startTime") Date startTime, @RequestParam(required = false, value = "startTime") Date startTime,
@RequestParam(required = false, value = "endTime") Date endTime, @RequestParam(required = false, value = "endTime") Date endTime,
@RequestParam(required = false, value = "recordCount", defaultValue = "1") Integer recordCount @RequestParam(required = false, value = "recordCount", defaultValue = "1") Integer recordCount,
@RequestParam(required = false, value = "maxRecordCount") Integer maxRecordCount
) { ) {
List<Future<JsonMessageUtil.JsonMessage>> responses = new LinkedList<>(); List<Future<JsonMessageUtil.JsonMessage>> responses = new LinkedList<>();
if (SEND_DATA) { if (SEND_DATA) {
...@@ -87,10 +88,13 @@ public class KeliuController { ...@@ -87,10 +88,13 @@ public class KeliuController {
List<FaceRecognition> faceRecognitionList = new ArrayList<>(); List<FaceRecognition> faceRecognitionList = new ArrayList<>();
faceRecognitionMap.forEach((k, v) -> { faceRecognitionMap.forEach((k, v) -> {
if (v.size() >= recordCount) { if (v.size() >= recordCount) {
if (maxRecordCount != null && v.size() > maxRecordCount) {
return;
}
faceRecognitionList.addAll(v); faceRecognitionList.addAll(v);
} }
}); });
log.info("上传数据量:" + faceRecognitionList.size()); log.info("上传数据量{}", faceRecognitionList.size());
for (FaceRecognition faceRecognition : faceRecognitionList) { for (FaceRecognition faceRecognition : faceRecognitionList) {
Future<JsonMessageUtil.JsonMessage> submit = threadPoolExecutor.submit(() -> { Future<JsonMessageUtil.JsonMessage> submit = threadPoolExecutor.submit(() -> {
try { try {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!