Commit 351cd534 by 朱海

[chg]接待统计时间范围扩大

1 parent 1f22fa60
package com.viontech.keliu.dao;
import cn.hutool.core.date.DateUtil;
import com.viontech.keliu.entity.DPersonReception;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
......@@ -24,6 +25,8 @@ public class DPersonReceptionDao {
public List<DPersonReception> getPersonReceptionList(Long mallId, Date countDate, String personUnid, Date startTime, Date endTime) {
startTime = DateUtil.offsetMinute(startTime, -5);
endTime = DateUtil.offsetMinute(endTime, 5);
String sql = "select * from d_person_reception where mall_id = ? and count_date = ? and person_unid = ? and start_time >= ? and end_time <= ? order by start_time;";
return jdbcTemplate.query(sql, new BeanPropertyRowMapper<>(DPersonReception.class), mallId, countDate, personUnid, startTime, endTime);
}
......
......@@ -222,6 +222,15 @@ public class PersonRecordServiceImpl implements PersonRecordService {
if (personInOutDetail.getPersonType() != 0) {
continue;
}
//处理接待数据
List<DPersonReception> personReceptionList = dPersonReceptionDao.getPersonReceptionList(dPersonRecord.getMallId(), dPersonRecord.getCountDate(), dPersonRecord.getPersonUnid(), dPersonRecord.getArriveTime(), dPersonRecord.getLeaveTime());
if (CollectionUtils.isNotEmpty(personReceptionList)) {
dPersonRecord.setReceptionCount(personReceptionList.size());
dPersonRecord.setReceptionTime(personReceptionList.get(0).getStartTime());
dPersonRecord.setReceptionDuration(personReceptionList.stream().mapToLong(DPersonReception::getDuration).sum());
}
//进出匹配的人在店内的抓拍记录
List<Person> insidePersonList = personInOutDetail.getInsidePersonList();
if (CollectionUtils.isEmpty(insidePersonList)) {
......@@ -258,13 +267,7 @@ public class PersonRecordServiceImpl implements PersonRecordService {
dPersonRecord.setAttentionCount(attentionList.size());
dPersonRecord.setAttentionTime(attentionList.get(0).getArriveTime());
}
//处理接待数据
List<DPersonReception> personReceptionList = dPersonReceptionDao.getPersonReceptionList(dPersonRecord.getMallId(), dPersonRecord.getCountDate(), dPersonRecord.getPersonUnid(), dPersonRecord.getArriveTime(), dPersonRecord.getLeaveTime());
if (CollectionUtils.isNotEmpty(personReceptionList)) {
dPersonRecord.setReceptionCount(personReceptionList.size());
dPersonRecord.setReceptionTime(personReceptionList.get(0).getStartTime());
dPersonRecord.setReceptionDuration(personReceptionList.stream().mapToLong(DPersonReception::getDuration).sum());
}
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!