Commit 62095cd9 by 朱海

[chg]同步数据增加人员类型过滤

1 parent 225ee1a2
......@@ -58,6 +58,7 @@ 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,value = "deviceSerialNum") String deviceSerialNum
) {
List<Future<JsonMessageUtil.JsonMessage>> responses = new LinkedList<>();
......@@ -68,7 +69,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);
List<FaceRecognition> faceRecognitions = keliuRepository.getFaceRecognitionsByDateAndMallId(date, mallId, direction, deviceSerialNum,personType);
log.info("上传数据量:" + faceRecognitions.size());
for (FaceRecognition faceRecognition : faceRecognitions) {
Future<JsonMessageUtil.JsonMessage> submit = threadPoolExecutor.submit(() -> {
......
......@@ -26,7 +26,7 @@ public class KeliuRepository {
private JdbcTemplate jdbcTemplate;
public List<FaceRecognition> getFaceRecognitionsByDateAndMallId(Date date, Long mallId, String direction, String deviceSerialNum) {
public List<FaceRecognition> getFaceRecognitionsByDateAndMallId(Date date, Long mallId, String direction, String deviceSerialNum,String personType) {
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)) {
......@@ -41,6 +41,19 @@ public class KeliuRepository {
sql = sql + ")";
}
//顾客店员过滤
if (StringUtils.isNotBlank(personType)) {
String[] personTypes = personType.split(",");
sql = sql + " and person_type in(";
for (int i = 0; i < personTypes.length; i++) {
sql = sql + Integer.valueOf(personTypes[i]);
if (i < personTypes.length - 1) {
sql = sql + ",";
}
}
sql = sql + ")";
}
if (StringUtils.isNotBlank(deviceSerialNum)) {
String[] devices = deviceSerialNum.split(",");
StringBuilder sb = new StringBuilder();
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!