Commit d74f5873 by 朱海

[add]增加按半球设备同步

1 parent fb3ce759
......@@ -67,13 +67,14 @@ public class KeliuController {
@GetMapping("/sendData")
public Object sendData(@RequestParam Date date, @RequestParam Long mallId, @RequestParam Long packId, @RequestParam(required = false) Long taskId,
@RequestParam(required = false, defaultValue = "-1,0,1") String direction,
@RequestParam(required = false, defaultValue = "0,1") String personType,
@RequestParam(required = false) String personType,
@RequestParam(required = false, value = "deviceSerialNum") String deviceSerialNum,
@RequestParam(required = false, value = "channelSerialNum") String channelSerialNum,
@RequestParam(required = false, value = "startTime") Date startTime,
@RequestParam(required = false, value = "endTime") Date endTime,
@RequestParam(required = false, value = "recordCount", defaultValue = "1") Integer recordCount,
@RequestParam(required = false, value = "maxRecordCount") Integer maxRecordCount
@RequestParam(required = false, value = "maxRecordCount") Integer maxRecordCount,
@RequestParam(required = false, value = "d2SerialNum") String d2SerialNum
) {
List<Future<JsonMessageUtil.JsonMessage>> responses = new LinkedList<>();
if (SEND_DATA) {
......@@ -83,7 +84,7 @@ 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, direction, deviceSerialNum, personType, channelSerialNum, startTime, endTime);
List<FaceRecognition> faceRecognitions = keliuRepository.getFaceRecognitionsByDateAndMallId(date, mallId, direction, deviceSerialNum, personType, channelSerialNum, startTime, endTime, d2SerialNum);
Map<String, List<FaceRecognition>> faceRecognitionMap = faceRecognitions.stream().collect(Collectors.groupingBy(FaceRecognition::getPersonUnid));
List<FaceRecognition> faceRecognitionList = new ArrayList<>();
faceRecognitionMap.forEach((k, v) -> {
......
......@@ -27,7 +27,7 @@ public class KeliuRepository {
private JdbcTemplate jdbcTemplate;
public List<FaceRecognition> getFaceRecognitionsByDateAndMallId(Date date, Long mallId, String direction, String deviceSerialNum,String personType,String channelSerialNum, Date startTime, Date endTime) {
public List<FaceRecognition> getFaceRecognitionsByDateAndMallId(Date date, Long mallId, String direction, String deviceSerialNum,String personType,String channelSerialNum, Date startTime, Date endTime, String d2SerialNum) {
String sql = "select unid,person_unid,channel_serialnum,body_pic,countdate,counttime,direction,gate_id from d_face_recognition where countdate=? and mall_id=?";
//方向过滤
if (StringUtils.isNotBlank(direction)) {
......@@ -83,15 +83,27 @@ public class KeliuRepository {
sql = sql + " and channel_serialnum in (" + sb.toString() + ")";
}
if (StringUtils.isNotBlank(d2SerialNum)) {
String[] channels = d2SerialNum.split(",");
StringBuilder sb = new StringBuilder();
for (String channel : channels) {
if (sb.length() > 0) {
sb.append(",");
}
sb.append("'");
sb.append(channel);
sb.append("'");
}
sql = sql + " and person_unid in(select distinct person_unid from d_face_recognition where device_serialnum in(" + sb.toString() + "))";
}
if (startTime != null) {
sql = sql + " and counttime >= '" + DateUtil.format("yyyy-MM-dd HH:mm:ss", startTime) + "'";
}
if (endTime != null) {
sql = sql + " and counttime <= '" + DateUtil.format("yyyy-MM-dd HH:mm:ss", endTime) + "'";
}
return jdbcTemplate.query(sql, new BeanPropertyRowMapper<>(FaceRecognition.class), date, mallId);
}
public HashMap<Long, String> getMallMap() {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!