Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
cms
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
iuav
cms
Commits
015ef99c
提交
015ef99c
authored
4月 10, 2024
作者:
刘明祎-运维用途
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修改bug
上级
a3036d4d
流水线
#8728
已通过 于阶段
in 2 分 32 秒
变更
5
流水线
1
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
22 行增加
和
8 行删除
+22
-8
UserServiceDao.java
...r/src/main/java/com/mmc/iuav/user/dao/UserServiceDao.java
+1
-1
ManagerLogSchedule.java
...n/java/com/mmc/iuav/user/schedule/ManagerLogSchedule.java
+10
-3
UserReportService.java
...ava/com/mmc/iuav/user/service/data/UserReportService.java
+1
-1
UserReportServiceImpl.java
...mc/iuav/user/service/data/impl/UserReportServiceImpl.java
+9
-3
UserServiceDao.xml
...service-user/src/main/resources/mapper/UserServiceDao.xml
+1
-0
没有找到文件。
csm-service/cms-service-user/src/main/java/com/mmc/iuav/user/dao/UserServiceDao.java
浏览文件 @
015ef99c
...
@@ -190,7 +190,7 @@ public interface UserServiceDao {
...
@@ -190,7 +190,7 @@ public interface UserServiceDao {
int
getYesterdayAddUserCount
();
int
getYesterdayAddUserCount
();
void
insertActiveUserCount
(
ActiveUserCountDO
activeUserCountDO
);
int
insertActiveUserCount
(
ActiveUserCountDO
activeUserCountDO
);
ActiveUserCountDO
getActiveUserCountByDayNum
();
ActiveUserCountDO
getActiveUserCountByDayNum
();
...
...
csm-service/cms-service-user/src/main/java/com/mmc/iuav/user/schedule/ManagerLogSchedule.java
浏览文件 @
015ef99c
...
@@ -26,14 +26,20 @@ public class ManagerLogSchedule {
...
@@ -26,14 +26,20 @@ public class ManagerLogSchedule {
@Scheduled
(
cron
=
"0 0 8 * * ?"
)
@Scheduled
(
cron
=
"0 0 8 * * ?"
)
public
void
calculateActiveUserCount
()
{
public
void
calculateActiveUserCount
()
{
log
.
info
(
"统计日活量"
);
log
.
info
(
"统计日活量"
);
Integer
userActiveCount
=
userReportService
.
getUserActiveCount
();
Calendar
calendar
=
Calendar
.
getInstance
();
Calendar
calendar
=
Calendar
.
getInstance
();
calendar
.
add
(
Calendar
.
DAY_OF_MONTH
,
-
1
);
calendar
.
add
(
Calendar
.
DAY_OF_MONTH
,
-
1
);
//记录到数据库
//记录到数据库
ActiveUserCountVO
yxfActiveUserCountVO
=
new
ActiveUserCountVO
();
ActiveUserCountVO
yxfActiveUserCountVO
=
new
ActiveUserCountVO
();
yxfActiveUserCountVO
.
setActiveDate
(
calendar
.
getTime
());
yxfActiveUserCountVO
.
setActiveDate
(
calendar
.
getTime
());
yxfActiveUserCountVO
.
setActiveUserCount
(
userActiveCount
);
int
temp
=
0
,
i
=
0
;
userReportService
.
insertActiveUserCount
(
yxfActiveUserCountVO
);
while
(
temp
==
0
&&
i
<=
5
)
{
Integer
userActiveCount
=
userReportService
.
getUserActiveCount
();
if
(
userActiveCount
!=
null
)
{
yxfActiveUserCountVO
.
setActiveUserCount
(
userActiveCount
);
temp
=
userReportService
.
insertActiveUserCount
(
yxfActiveUserCountVO
);
}
i
++;
}
}
}
}
}
\ No newline at end of file
csm-service/cms-service-user/src/main/java/com/mmc/iuav/user/service/data/UserReportService.java
浏览文件 @
015ef99c
...
@@ -16,7 +16,7 @@ public interface UserReportService {
...
@@ -16,7 +16,7 @@ public interface UserReportService {
Integer
getUserActiveCount
();
Integer
getUserActiveCount
();
void
insertActiveUserCount
(
ActiveUserCountVO
param
);
int
insertActiveUserCount
(
ActiveUserCountVO
param
);
ProductReportDTO
getJoinStoreNumber
();
ProductReportDTO
getJoinStoreNumber
();
...
...
csm-service/cms-service-user/src/main/java/com/mmc/iuav/user/service/data/impl/UserReportServiceImpl.java
浏览文件 @
015ef99c
...
@@ -61,7 +61,13 @@ public class UserReportServiceImpl implements UserReportService {
...
@@ -61,7 +61,13 @@ public class UserReportServiceImpl implements UserReportService {
ResultBody
resultBody
=
wxService
.
getUserPortrait
();
ResultBody
resultBody
=
wxService
.
getUserPortrait
();
if
(
resultBody
!=
null
&&
resultBody
.
getCode
().
equals
(
"200"
))
{
if
(
resultBody
!=
null
&&
resultBody
.
getCode
().
equals
(
"200"
))
{
JSONObject
result
=
JSONObject
.
parseObject
(
resultBody
.
getResult
().
toString
());
JSONObject
result
=
JSONObject
.
parseObject
(
resultBody
.
getResult
().
toString
());
JSONArray
jsonArray
=
JSONArray
.
parseArray
(
result
.
get
(
"list"
).
toString
());
JSONArray
jsonArray
;
//当去微信拿不到日活量时会报空指针就返回null代表没拿到数据,要重新请求
try
{
jsonArray
=
JSONArray
.
parseArray
(
result
.
get
(
"list"
).
toString
());
}
catch
(
NullPointerException
e
)
{
return
null
;
}
JSONObject
object
=
(
JSONObject
)
jsonArray
.
get
(
0
);
JSONObject
object
=
(
JSONObject
)
jsonArray
.
get
(
0
);
return
(
Integer
)
object
.
get
(
"visit_uv"
);
return
(
Integer
)
object
.
get
(
"visit_uv"
);
}
}
...
@@ -69,9 +75,9 @@ public class UserReportServiceImpl implements UserReportService {
...
@@ -69,9 +75,9 @@ public class UserReportServiceImpl implements UserReportService {
}
}
@Override
@Override
public
void
insertActiveUserCount
(
ActiveUserCountVO
param
)
{
public
int
insertActiveUserCount
(
ActiveUserCountVO
param
)
{
ActiveUserCountDO
activeUserCountDO
=
new
ActiveUserCountDO
(
param
);
ActiveUserCountDO
activeUserCountDO
=
new
ActiveUserCountDO
(
param
);
userServiceDao
.
insertActiveUserCount
(
activeUserCountDO
);
return
userServiceDao
.
insertActiveUserCount
(
activeUserCountDO
);
}
}
@Override
@Override
...
...
csm-service/cms-service-user/src/main/resources/mapper/UserServiceDao.xml
浏览文件 @
015ef99c
...
@@ -95,6 +95,7 @@
...
@@ -95,6 +95,7 @@
values (#{activeUserCount}, #{activeDate}, NOW())
values (#{activeUserCount}, #{activeDate}, NOW())
</insert>
</insert>
<update
id=
"update"
parameterType=
"com.mmc.iuav.user.entity.UserAccountDO"
>
<update
id=
"update"
parameterType=
"com.mmc.iuav.user.entity.UserAccountDO"
>
update user_account
update user_account
<set>
<set>
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论