Commit 24d95cf3 by 朱海

[chg]增加过滤横穿数据

1 parent fa3dd3b2
......@@ -56,7 +56,7 @@ public class KeliuController {
@GetMapping("/sendData")
public Object sendData(@RequestParam Date date, @RequestParam Long mallId, @RequestParam Long packId, @RequestParam(required = false) Long taskId) {
public Object sendData(@RequestParam Date date, @RequestParam Long mallId, @RequestParam Long packId, @RequestParam(required = false) Long taskId, @RequestParam(required = false, defaultValue = "1") Integer needOutSide) {
List<Future<JsonMessageUtil.JsonMessage>> responses = new LinkedList<>();
if (SEND_DATA) {
return JsonMessageUtil.getErrorJsonMsg("有数据传输任务正在进行");
......@@ -65,7 +65,8 @@ public class KeliuController {
ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor(20, 20, 1, TimeUnit.MINUTES, new LinkedBlockingDeque<>(10000), new ThreadPoolExecutor.CallerRunsPolicy());
try {
AtomicLong count = new AtomicLong();
List<FaceRecognition> faceRecognitions = keliuRepository.getFaceRecognitionsByDateAndMallId(date, mallId);
List<FaceRecognition> faceRecognitions = keliuRepository.getFaceRecognitionsByDateAndMallId(date, mallId, needOutSide);
System.out.println("上传数据量:" + faceRecognitions.size());
for (FaceRecognition faceRecognition : faceRecognitions) {
Future<JsonMessageUtil.JsonMessage> submit = threadPoolExecutor.submit(() -> {
try {
......
......@@ -23,10 +23,16 @@ public class KeliuRepository {
@Resource
private JdbcTemplate jdbcTemplate;
public List<FaceRecognition> getFaceRecognitionsByDateAndMallId(Date date, Long mallId) {
public List<FaceRecognition> getFaceRecognitionsByDateAndMallId(Date date, Long mallId, Integer needOutSide) {
//不需要横穿数据
if (needOutSide == 0) {
return jdbcTemplate.query("select unid,person_unid,channel_serialnum,body_pic,countdate,counttime,direction,gate_id from d_face_recognition where countdate=? and mall_id=? and direction != 0", new BeanPropertyRowMapper<>(FaceRecognition.class), date, mallId);
} else {
return jdbcTemplate.query("select unid,person_unid,channel_serialnum,body_pic,countdate,counttime,direction,gate_id from d_face_recognition where countdate=? and mall_id=?", new BeanPropertyRowMapper<>(FaceRecognition.class), date, mallId);
}
}
public HashMap<Long, String> getMallMap() {
HashMap<Long, String> result = new HashMap<>();
jdbcTemplate.query("select id,name from b_mall", rs -> {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!