Commit 3181f3a6 by zhuhaitao

[chg]临时给屈臣氏用,移除汽车排除的接待记录相关逻辑;

1 parent 44b39962
...@@ -199,49 +199,49 @@ public class PersonRecordServiceImpl implements PersonRecordService { ...@@ -199,49 +199,49 @@ public class PersonRecordServiceImpl implements PersonRecordService {
List<DPersonRecord> personRecordList = new ArrayList<>(); List<DPersonRecord> personRecordList = new ArrayList<>();
for (DPersonRecord dPersonRecord : recordList) { for (DPersonRecord dPersonRecord : recordList) {
//没有匹配到出 //没有匹配到出
if (dPersonRecord.getLeaveTime() == null) { // if (dPersonRecord.getLeaveTime() == null) {
//判断在店内的时间 // //判断在店内的时间
List<DPersonTrackDetail> personTrackDetailList = dPersonRecord.getPersonTrackDetailList(); // List<DPersonTrackDetail> personTrackDetailList = dPersonRecord.getPersonTrackDetailList();
if (CollectionUtils.isEmpty(personTrackDetailList)) { // if (CollectionUtils.isEmpty(personTrackDetailList)) {
continue; // continue;
} // }
//计算区域的总停留时间,小于10分钟的排除掉 // //计算区域的总停留时间,小于10分钟的排除掉
long totalTime = personTrackDetailList.stream().mapToLong(DPersonTrackDetail::getVisitDuration).sum(); // long totalTime = personTrackDetailList.stream().mapToLong(DPersonTrackDetail::getVisitDuration).sum();
if (needFilter && totalTime < excludePersonTime * 60 * 1000) { // if (needFilter && totalTime < excludePersonTime * 60 * 1000) {
continue; // continue;
} // }
//
} // }
//排除掉短时间在店内的记录 // //排除掉短时间在店内的记录
if (needFilter && dPersonRecord.getVisitDuration() < excludePersonTime * 60 * 1000) { // if (needFilter && dPersonRecord.getVisitDuration() < excludePersonTime * 60 * 1000) {
continue; // continue;
} // }
if (strictMode) { // if (strictMode) {
log.info("门店:{}严格模式过滤", mallId); // log.info("门店:{}严格模式过滤", mallId);
// 严格模式,没接待,或没看车,就过滤 // // 严格模式,没接待,或没看车,就过滤
if (filterAttention == 1) { // if (filterAttention == 1) {
// if (dPersonRecord.getReceptionCount() == 0) { //// if (dPersonRecord.getReceptionCount() == 0) {
//// continue;
//// }
// List<DPersonTrackDetail> personTrackDetailList = dPersonRecord.getPersonTrackDetailList();
// if (CollectionUtils.isEmpty(personTrackDetailList)) {
// continue; // continue;
// } // }
List<DPersonTrackDetail> personTrackDetailList = dPersonRecord.getPersonTrackDetailList(); // List<DPersonTrackDetail> attentionList = personTrackDetailList.stream().filter(v -> v.getVisitDuration() != null && v.getVisitDuration() > strictModeAttentionSecond * 1000L)
if (CollectionUtils.isEmpty(personTrackDetailList)) { // .sorted(Comparator.comparing(DPersonTrackDetail::getArriveTime)).toList();
continue; // if (attentionList.isEmpty()) {
} // continue;
List<DPersonTrackDetail> attentionList = personTrackDetailList.stream().filter(v -> v.getVisitDuration() != null && v.getVisitDuration() > strictModeAttentionSecond * 1000L) // }
.sorted(Comparator.comparing(DPersonTrackDetail::getArriveTime)).toList(); // dPersonRecord.setAttentionCount(attentionList.size());
if (attentionList.isEmpty()) { // dPersonRecord.setAttentionTime(attentionList.get(0).getArriveTime());
continue; // }
} // } else {
dPersonRecord.setAttentionCount(attentionList.size()); // //没有被接待,并且没有看车的排除掉
dPersonRecord.setAttentionTime(attentionList.get(0).getArriveTime()); // if (dPersonRecord.getReceptionCount() == 0 && filterAttention == 1 && dPersonRecord.getAttentionCount() == 0) {
} // continue;
} else { // }
//没有被接待,并且没有看车的排除掉 // }
if (dPersonRecord.getReceptionCount() == 0 && filterAttention == 1 && dPersonRecord.getAttentionCount() == 0) {
continue;
}
}
personRecordList.add(dPersonRecord); personRecordList.add(dPersonRecord);
dPersonRecordDao.createDPersonRecordBatch(Collections.singletonList(dPersonRecord)); dPersonRecordDao.createDPersonRecordBatch(Collections.singletonList(dPersonRecord));
if (!CollectionUtils.isEmpty(dPersonRecord.getPersonTrackDetailList())) { if (!CollectionUtils.isEmpty(dPersonRecord.getPersonTrackDetailList())) {
...@@ -584,10 +584,11 @@ public class PersonRecordServiceImpl implements PersonRecordService { ...@@ -584,10 +584,11 @@ public class PersonRecordServiceImpl implements PersonRecordService {
CustomerGroupResult customerGroupResult = new CustomerGroupResult(); CustomerGroupResult customerGroupResult = new CustomerGroupResult();
List<DPersonRecord> visitorsGroupRecordList = personRecordMap.values().stream().toList(); List<DPersonRecord> visitorsGroupRecordList = personRecordMap.values().stream().toList();
Set<String> nonEffectVisitorsUnids = nonEffectVisitorsUnids(visitorsGroupRecordList, effectVisitorsConfig); // Set<String> nonEffectVisitorsUnids = nonEffectVisitorsUnids(visitorsGroupRecordList, effectVisitorsConfig);
List<DPersonRecord> effectVisitorsRecord = nonEffectVisitorsUnids.isEmpty() ? visitorsGroupRecordList // List<DPersonRecord> effectVisitorsRecord = nonEffectVisitorsUnids.isEmpty() ? visitorsGroupRecordList
: visitorsGroupRecordList.stream().filter(r -> !nonEffectVisitorsUnids.contains(r.getPersonUnid())).toList(); // : visitorsGroupRecordList.stream().filter(r -> !nonEffectVisitorsUnids.contains(r.getPersonUnid())).toList();
Map<String, List<DPersonRecord>> groupMap = effectVisitorsRecord.stream().collect(Collectors.groupingBy(DPersonRecord::getGroupUnid)); // Map<String, List<DPersonRecord>> groupMap = effectVisitorsRecord.stream().collect(Collectors.groupingBy(DPersonRecord::getGroupUnid));
Map<String, List<DPersonRecord>> groupMap = visitorsGroupRecordList.stream().collect(Collectors.groupingBy(DPersonRecord::getGroupUnid));
groupMap.forEach((k, v) -> { groupMap.forEach((k, v) -> {
calGroup(1, customerGroupResult, v); calGroup(1, customerGroupResult, v);
}); });
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!