Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
smart_gov_platform
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
赵啸非
smart_gov_platform
Commits
2f8e976a
Commit
2f8e976a
authored
Jun 09, 2025
by
廖旭伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增设备每日点击总量
parent
a1b4a901
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
40 additions
and
0 deletions
+40
-0
portal-manager/src/main/java/com/mortals/xhx/common/key/RedisKey.java
...er/src/main/java/com/mortals/xhx/common/key/RedisKey.java
+2
-0
portal-manager/src/main/java/com/mortals/xhx/module/page/service/impl/PageEventServiceImpl.java
...ls/xhx/module/page/service/impl/PageEventServiceImpl.java
+22
-0
portal-manager/src/main/java/com/mortals/xhx/module/page/web/PageCensusController.java
...com/mortals/xhx/module/page/web/PageCensusController.java
+10
-0
portal-manager/src/main/resources/sqlmap/module/page/PageEventMapperExt.xml
.../main/resources/sqlmap/module/page/PageEventMapperExt.xml
+6
-0
No files found.
portal-manager/src/main/java/com/mortals/xhx/common/key/RedisKey.java
View file @
2f8e976a
...
...
@@ -35,4 +35,6 @@ public class RedisKey {
public
static
final
String
KEY_DEVICE_EVENT_CLICK_CACHE
=
"device:event:click"
;
public
static
final
String
KEY_DEVICE_EVENT_CLICK_CACHE_DAY
=
"device:event:click:day"
;
}
portal-manager/src/main/java/com/mortals/xhx/module/page/service/impl/PageEventServiceImpl.java
View file @
2f8e976a
...
...
@@ -4,6 +4,7 @@ import com.mortals.framework.exception.AppException;
import
com.mortals.framework.model.Context
;
import
com.mortals.framework.service.ICacheService
;
import
com.mortals.framework.service.impl.AbstractCRUDServiceImpl
;
import
com.mortals.framework.util.DateUtils
;
import
com.mortals.framework.util.StringUtils
;
import
com.mortals.xhx.common.code.YesNoEnum
;
import
com.mortals.xhx.common.key.RedisKey
;
...
...
@@ -88,6 +89,18 @@ public class PageEventServiceImpl extends AbstractCRUDServiceImpl<PageEventDao,
pageEventCensusVo
.
setTotal
(
pageEventCensusVo
.
getTotal
()+
1
);
cacheService
.
hset
(
RedisKey
.
KEY_DEVICE_EVENT_CLICK_CACHE
,
key
,
pageEventCensusVo
);
}
PageEventCensusVo
pageEventCensusVoDay
=
cacheService
.
hget
(
RedisKey
.
KEY_DEVICE_EVENT_CLICK_CACHE_DAY
,
key
,
PageEventCensusVo
.
class
);
if
(
ObjectUtils
.
isEmpty
(
pageEventCensusVoDay
)){
pageEventCensusVoDay
=
new
PageEventCensusVo
();
pageEventCensusVoDay
.
setProductId
(
entity
.
getProductId
());
pageEventCensusVoDay
.
setEventCode
(
"Click"
);
pageEventCensusVoDay
.
setEventName
(
"点击"
);
pageEventCensusVoDay
.
setTotal
(
1
);
cacheService
.
hset
(
RedisKey
.
KEY_DEVICE_EVENT_CLICK_CACHE_DAY
,
key
,
pageEventCensusVoDay
);
}
else
{
pageEventCensusVoDay
.
setTotal
(
pageEventCensusVoDay
.
getTotal
()+
1
);
cacheService
.
hset
(
RedisKey
.
KEY_DEVICE_EVENT_CLICK_CACHE_DAY
,
key
,
pageEventCensusVoDay
);
}
}
}
}
...
...
@@ -311,10 +324,19 @@ public class PageEventServiceImpl extends AbstractCRUDServiceImpl<PageEventDao,
if
(
CollectionUtils
.
isNotEmpty
(
list
))
{
cacheService
.
hset
(
RedisKey
.
KEY_DEVICE_EVENT_CLICK_CACHE
,
entry
.
getKey
(),
list
.
get
(
0
));
}
query
.
setDateTimeStart
(
DateUtils
.
getCurrDateTime
(
"yyyy-MM-dd"
));
query
.
setDateTimeEnd
(
DateUtils
.
getCurrDateTime
(
"yyyy-MM-dd"
));
List
<
PageEventCensusVo
>
listDay
=
dao
.
getPageClickEventCensus
(
query
);
if
(
CollectionUtils
.
isNotEmpty
(
listDay
))
{
cacheService
.
hset
(
RedisKey
.
KEY_DEVICE_EVENT_CLICK_CACHE_DAY
,
entry
.
getKey
(),
list
.
get
(
0
));
}
}
}
}
return
null
;
}
public
static
void
main
(
String
[]
args
)
{
System
.
out
.
println
(
DateUtils
.
getCurrDateTime
(
"yyyy-MM-dd"
));
}
}
\ No newline at end of file
portal-manager/src/main/java/com/mortals/xhx/module/page/web/PageCensusController.java
View file @
2f8e976a
...
...
@@ -359,6 +359,16 @@ public class PageCensusController extends BaseJsonBodyController {
}
model
.
put
(
"data"
,
pageEventCensusVo
);
PageEventCensusVo
pageEventCensusVoDay
=
cacheService
.
hget
(
RedisKey
.
KEY_DEVICE_EVENT_CLICK_CACHE_DAY
,
key
,
PageEventCensusVo
.
class
);
if
(
null
==
pageEventCensusVoDay
){
pageEventCensusVoDay
=
new
PageEventCensusVo
();
pageEventCensusVoDay
.
setProductId
(
query
.
getProductId
());
pageEventCensusVoDay
.
setEventCode
(
"Click"
);
pageEventCensusVoDay
.
setEventName
(
"点击"
);
pageEventCensusVoDay
.
setTotal
(
0
);
}
model
.
put
(
"dataDay"
,
pageEventCensusVoDay
);
model
.
put
(
"message_info"
,
busiDesc
+
"成功"
);
}
...
...
portal-manager/src/main/resources/sqlmap/module/page/PageEventMapperExt.xml
View file @
2f8e976a
...
...
@@ -187,6 +187,12 @@
#{item}
</foreach>
</if>
<if
test=
"dateTimeStart!=null and dateTimeStart!=''"
>
AND t.createTime
<![CDATA[ >= ]]>
STR_TO_DATE(left(concat(#{dateTimeStart},' 00:00:00'),19),'%Y-%m-%d %k:%i:%s')
</if>
<if
test=
"dateTimeEnd!=null and dateTimeEnd!=''"
>
AND t.createTime
<![CDATA[ <= ]]>
STR_TO_DATE(left(concat(#{dateTimeEnd},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s')
</if>
GROUP BY
t.eventCode,
t.eventName
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment