Commit 654dc5e5 by 朱海

[chg]修复male_stage,female_stage为null的问题

1 parent f555fc5b
...@@ -201,8 +201,18 @@ public class PersonRecordServiceImpl implements PersonRecordService { ...@@ -201,8 +201,18 @@ public class PersonRecordServiceImpl implements PersonRecordService {
for (DPersonRecord dPersonRecord : recordList) { for (DPersonRecord dPersonRecord : recordList) {
//没有匹配到出 //没有匹配到出
if (dPersonRecord.getLeaveTime() == null) { if (dPersonRecord.getLeaveTime() == null) {
//判断在店内的时间
List<DPersonTrackDetail> personTrackDetailList = dPersonRecord.getPersonTrackDetailList();
if (CollectionUtils.isEmpty(personTrackDetailList)) {
continue; continue;
} }
//计算区域的总停留时间,小于10分钟的排除掉
long totalTime = personTrackDetailList.stream().mapToLong(DPersonTrackDetail::getVisitDuration).sum();
if (totalTime < excludePersonTime * 60 * 1000) {
continue;
}
}
//排除掉短时间在店内的记录 //排除掉短时间在店内的记录
if (dPersonRecord.getVisitDuration() < excludePersonTime * 60 * 1000) { if (dPersonRecord.getVisitDuration() < excludePersonTime * 60 * 1000) {
continue; continue;
...@@ -524,14 +534,14 @@ public class PersonRecordServiceImpl implements PersonRecordService { ...@@ -524,14 +534,14 @@ public class PersonRecordServiceImpl implements PersonRecordService {
updateSta.setFemaleCount(femaleCount); updateSta.setFemaleCount(femaleCount);
String[] maleStageArry = maleStage.split(","); String[] maleStageArry = maleStage.split(",");
Long[] maleStages = strArry2LongArry(maleStageArry); long[] maleStages = strArry2LongArry(maleStageArry);
maleStageMap.forEach((k,v) -> { maleStageMap.forEach((k,v) -> {
maleStages[k] = v; maleStages[k] = v;
}); });
String[] femaleStageArry = femaleStage.split(","); String[] femaleStageArry = femaleStage.split(",");
Long[] femaleStages = strArry2LongArry(femaleStageArry); long[] femaleStages = strArry2LongArry(femaleStageArry);
femaleStageMap.forEach((k,v) -> { femaleStageMap.forEach((k,v) -> {
femaleStages[k] = v; femaleStages[k] = v;
}); });
...@@ -604,13 +614,13 @@ public class PersonRecordServiceImpl implements PersonRecordService { ...@@ -604,13 +614,13 @@ public class PersonRecordServiceImpl implements PersonRecordService {
updateSta.setMaleCount(maleCount); updateSta.setMaleCount(maleCount);
updateSta.setFemaleCount(femaleCount); updateSta.setFemaleCount(femaleCount);
updateSta.setCounttime(DateUtil.parse(k, "yyyy-MM-dd HH:00:00")); updateSta.setCounttime(DateUtil.parse(k, "yyyy-MM-dd HH:00:00"));
Long[] maleStages = new Long[100]; long[] maleStages = new long[100];
maleStageMap.forEach((k1,v1) -> { maleStageMap.forEach((k1,v1) -> {
maleStages[k1] = v1; maleStages[k1] = v1;
}); });
Long[] femaleStages = new Long[100]; long[] femaleStages = new long[100];
femaleStageMap.forEach((k1,v1) -> { femaleStageMap.forEach((k1,v1) -> {
femaleStages[k1] = v1; femaleStages[k1] = v1;
}); });
...@@ -693,13 +703,13 @@ public class PersonRecordServiceImpl implements PersonRecordService { ...@@ -693,13 +703,13 @@ public class PersonRecordServiceImpl implements PersonRecordService {
public String arraysToString(Long[] arrays) { public String arraysToString(long[] arrays) {
return Arrays.toString(arrays).substring(1, Arrays.toString(arrays).length() - 1); return Arrays.toString(arrays).substring(1, Arrays.toString(arrays).length() - 1);
} }
public Long[] strArry2LongArry(String[] arrays) { public long[] strArry2LongArry(String[] arrays) {
Long[] intArrays = new Long[arrays.length]; long[] intArrays = new long[arrays.length];
for (int i = 0; i < arrays.length; i++) { for (int i = 0; i < arrays.length; i++) {
intArrays[i] = Long.parseLong(arrays[i].trim()); intArrays[i] = Long.parseLong(arrays[i].trim());
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!