Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation
This project
Loading...
Sign in
谢明辉
/
fanxing3
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 57b9e902
authored
Dec 07, 2021
by
xmh
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
<feat> 数据清除添加日志
<fix> 数据概览去掉缓存,数据概览详情添加24小时
1 parent
ed98d597
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
1 deletions
fanxing-commons/src/main/java/com/viontech/fanxing/commons/constant/LogType.java
fanxing-forward/src/main/java/com/viontech/fanxing/forward/runner/PicKeepRunner.java
fanxing-query/src/main/java/com/viontech/fanxing/query/service/impl/TrafficServiceImpl.java
fanxing-commons/src/main/java/com/viontech/fanxing/commons/constant/LogType.java
View file @
57b9e90
...
...
@@ -18,6 +18,8 @@ public enum LogType {
QUERY
(
3
),
/** 视频资源管理 */
VIDEO_RESOURCE
(
4
),
/** 系统日志 */
SYSTEM
(
5
),
;
public
int
value
;
...
...
fanxing-forward/src/main/java/com/viontech/fanxing/forward/runner/PicKeepRunner.java
View file @
57b9e90
...
...
@@ -2,8 +2,10 @@ package com.viontech.fanxing.forward.runner;
import
cn.hutool.core.util.RuntimeUtil
;
import
com.viontech.fanxing.commons.config.VionConfig
;
import
com.viontech.fanxing.commons.constant.LogType
;
import
com.viontech.fanxing.commons.feign.OpsClient
;
import
com.viontech.fanxing.commons.model.main.ImageKeepConfig
;
import
com.viontech.fanxing.commons.vo.LogVo
;
import
com.viontech.keliu.util.DateUtil
;
import
com.viontech.keliu.util.JsonMessageUtil
;
import
lombok.extern.slf4j.Slf4j
;
...
...
@@ -129,7 +131,9 @@ public class PicKeepRunner {
// 删除文件
for
(
String
dirName
:
yyyyMMddSet
)
{
dropDir
(
dirName
);
addLog
(
yyyyMMdd
);
}
}
private
void
dropDir
(
String
dirName
)
{
...
...
@@ -151,6 +155,17 @@ public class PicKeepRunner {
}
}
private
void
addLog
(
String
yyyyMMdd
)
{
String
year
=
yyyyMMdd
.
substring
(
0
,
4
);
String
month
=
yyyyMMdd
.
substring
(
4
,
6
);
String
day
=
yyyyMMdd
.
substring
(
6
,
8
);
LogVo
logVo
=
new
LogVo
();
logVo
.
setUsername
(
"系统"
);
logVo
.
setLogType
(
LogType
.
SYSTEM
.
value
);
logVo
.
setContent
(
"清除数据 执行时间: "
+
DateUtil
.
format
(
DateUtil
.
FORMAT_LONG
,
new
Date
())
+
" 数据日期: "
+
year
+
"-"
+
month
+
"-"
+
day
);
opsClient
.
addLog
(
logVo
);
}
}
fanxing-query/src/main/java/com/viontech/fanxing/query/service/impl/TrafficServiceImpl.java
View file @
57b9e90
...
...
@@ -69,7 +69,6 @@ public class TrafficServiceImpl extends BaseServiceImpl<Traffic> implements Traf
}
@Override
@LocalCache
(
value
=
"dataOverview"
,
duration
=
1
)
public
JSONObject
dataOverview
(
Date
date
,
Long
taskId
,
Integer
page
,
Integer
pageSize
)
{
// todo 还需要加有效分析时长(effectiveAnalysisTime) 和 异常次数(exceptionNum)
...
...
@@ -151,6 +150,13 @@ public class TrafficServiceImpl extends BaseServiceImpl<Traffic> implements Traf
Date
min
=
DateUtil
.
setDayMinTime
(
date
);
Date
max
=
DateUtil
.
setDayMaxTime
(
date
);
TreeMap
<
Integer
,
DataOverViewModel
>
resultMap
=
new
TreeMap
<>();
for
(
int
i
=
0
;
i
<
24
;
i
++)
{
resultMap
.
computeIfAbsent
(
i
,
x
->
{
DataOverViewModel
temp
=
new
DataOverViewModel
();
temp
.
setHour
(
x
);
return
temp
;
});
}
TrafficExample
trafficExample
=
new
TrafficExample
();
trafficExample
.
createCriteria
().
andEventTimeGreaterThanOrEqualTo
(
min
).
andEventTimeLessThanOrEqualTo
(
max
).
andTaskIdEqualTo
(
taskId
);
TrafficExample
.
ColumnContainer
columns
=
trafficExample
.
createColumns
().
hasTaskIdColumn
();
...
...
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