Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation
This project
Loading...
Sign in
朱海
/
VVAS-PicGroup
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 897a5e82
authored
Sep 03, 2024
by
朱海
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
[add]增加接待结束时间
1 parent
23ed153f
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
5 deletions
src/main/java/com/viontech/keliu/dao/DPersonRecordDao.java
src/main/java/com/viontech/keliu/entity/DPersonRecord.java
src/main/java/com/viontech/keliu/service/impl/PersonRecordServiceImpl.java
src/main/java/com/viontech/keliu/dao/DPersonRecordDao.java
View file @
897a5e8
...
@@ -32,9 +32,9 @@ public class DPersonRecordDao {
...
@@ -32,9 +32,9 @@ public class DPersonRecordDao {
public
void
createDPersonRecordBatch
(
List
<
DPersonRecord
>
personRecordList
)
{
public
void
createDPersonRecordBatch
(
List
<
DPersonRecord
>
personRecordList
)
{
SqlParameterSource
[]
batch
=
SqlParameterSourceUtils
.
createBatch
(
personRecordList
.
toArray
());
SqlParameterSource
[]
batch
=
SqlParameterSourceUtils
.
createBatch
(
personRecordList
.
toArray
());
String
sql
=
"insert into d_person_record (mall_id,account_id,count_date,person_unid,group_unid,age,gender,person_type,arrive_time, leave_time, "
+
String
sql
=
"insert into d_person_record (mall_id,account_id,count_date,person_unid,group_unid,age,gender,person_type,arrive_time, leave_time, "
+
"visit_count, visit_duration, engage_count,engage_time,reception_count,reception_time,reception_duration,attention_count,attention_time)"
+
"visit_count, visit_duration, engage_count,engage_time,reception_count,reception_time,reception_duration,attention_count,attention_time
,reception_end_time
)"
+
" values(:mallId,:accountId,:countDate,:personUnid,:groupUnid,:age,:gender,:personType,:arriveTime,:leaveTime,:visitCount,:visitDuration,"
+
" values(:mallId,:accountId,:countDate,:personUnid,:groupUnid,:age,:gender,:personType,:arriveTime,:leaveTime,:visitCount,:visitDuration,"
+
":engageCount,:engageTime,:receptionCount,:receptionTime,:receptionDuration,:attentionCount,:attentionTime)"
;
":engageCount,:engageTime,:receptionCount,:receptionTime,:receptionDuration,:attentionCount,:attentionTime
,:receptionEndTime
)"
;
namedParameterJdbcTemplate
.
batchUpdate
(
sql
,
batch
);
namedParameterJdbcTemplate
.
batchUpdate
(
sql
,
batch
);
}
}
...
...
src/main/java/com/viontech/keliu/entity/DPersonRecord.java
View file @
897a5e8
...
@@ -70,12 +70,17 @@ public class DPersonRecord {
...
@@ -70,12 +70,17 @@ public class DPersonRecord {
private
Integer
receptionCount
=
0
;
private
Integer
receptionCount
=
0
;
/**
/**
* 接待时间
* 接待
开始
时间
*/
*/
private
Date
receptionTime
;
private
Date
receptionTime
;
/**
/**
* 接待时长
* 接待结束时间
*/
private
Date
receptionEndTime
;
/**
* 接待时长,不是用接待结束时间减去接待开始时间,用的是多次接待时长累加
*/
*/
private
Long
receptionDuration
;
private
Long
receptionDuration
;
...
...
src/main/java/com/viontech/keliu/service/impl/PersonRecordServiceImpl.java
View file @
897a5e8
...
@@ -315,12 +315,14 @@ public class PersonRecordServiceImpl implements PersonRecordService {
...
@@ -315,12 +315,14 @@ public class PersonRecordServiceImpl implements PersonRecordService {
List
<
DPersonReception
>
personReceptionList
=
dPersonReceptionDao
.
getPersonReceptionList
(
dPersonRecord
.
getMallId
(),
dPersonRecord
.
getCountDate
(),
dPersonRecord
.
getPersonUnid
(),
dPersonRecord
.
getArriveTime
(),
dPersonRecord
.
getLeaveTime
());
List
<
DPersonReception
>
personReceptionList
=
dPersonReceptionDao
.
getPersonReceptionList
(
dPersonRecord
.
getMallId
(),
dPersonRecord
.
getCountDate
(),
dPersonRecord
.
getPersonUnid
(),
dPersonRecord
.
getArriveTime
(),
dPersonRecord
.
getLeaveTime
());
if
(
CollectionUtils
.
isNotEmpty
(
personReceptionList
))
{
if
(
CollectionUtils
.
isNotEmpty
(
personReceptionList
))
{
dPersonRecord
.
setReceptionCount
(
personReceptionList
.
size
());
dPersonRecord
.
setReceptionCount
(
personReceptionList
.
size
());
Date
startTime
=
personReceptionList
.
get
(
0
).
getStartTime
();
Date
startTime
=
personReceptionList
.
stream
().
min
(
Comparator
.
comparing
(
DPersonReception:
:
getStartTime
)).
get
(
).
getStartTime
();
//接待时间早于到店时间,接待时间为进店时间+1秒
//接待时间早于到店时间,接待时间为进店时间+1秒
if
(
startTime
.
before
(
dPersonRecord
.
getArriveTime
()))
{
if
(
startTime
.
before
(
dPersonRecord
.
getArriveTime
()))
{
startTime
=
DateUtil
.
offsetSecond
(
dPersonRecord
.
getArriveTime
(),
1
);
startTime
=
DateUtil
.
offsetSecond
(
dPersonRecord
.
getArriveTime
(),
1
);
}
}
dPersonRecord
.
setReceptionTime
(
startTime
);
dPersonRecord
.
setReceptionTime
(
startTime
);
Date
endTime
=
personReceptionList
.
stream
().
max
(
Comparator
.
comparing
(
DPersonReception:
:
getEndTime
)).
get
().
getEndTime
();
dPersonRecord
.
setReceptionEndTime
(
endTime
);
dPersonRecord
.
setReceptionDuration
(
personReceptionList
.
stream
().
mapToLong
(
DPersonReception:
:
getDuration
).
sum
());
dPersonRecord
.
setReceptionDuration
(
personReceptionList
.
stream
().
mapToLong
(
DPersonReception:
:
getDuration
).
sum
());
}
}
//进出匹配的人在店内的抓拍记录
//进出匹配的人在店内的抓拍记录
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment