Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
eshiled-new
/
ne-shield-standard-interfaces
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
1
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit c9223141
authored
Aug 26, 2021
by
杨林龙
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
添加日志
1 parent
5529ff60
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
1 deletions
src/main/java/cn/com/glsx/stdinterface/modules/controller/StatisticsDriveController.java
src/main/java/cn/com/glsx/stdinterface/modules/service/StatisticsDriveService.java
src/main/java/cn/com/glsx/stdinterface/modules/controller/StatisticsDriveController.java
View file @
c922314
...
@@ -3,6 +3,7 @@ package cn.com.glsx.stdinterface.modules.controller;
...
@@ -3,6 +3,7 @@ package cn.com.glsx.stdinterface.modules.controller;
import
cn.com.glsx.stdinterface.dto.StatisticsDriveDto
;
import
cn.com.glsx.stdinterface.dto.StatisticsDriveDto
;
import
cn.com.glsx.stdinterface.modules.service.StatisticsDriveService
;
import
cn.com.glsx.stdinterface.modules.service.StatisticsDriveService
;
import
cn.hutool.core.collection.CollectionUtil
;
import
cn.hutool.core.collection.CollectionUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.glsx.plat.core.web.R
;
import
com.glsx.plat.core.web.R
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
...
@@ -29,7 +30,15 @@ public class StatisticsDriveController {
...
@@ -29,7 +30,15 @@ public class StatisticsDriveController {
public
R
statisticsDriveDataEveryDay
()
{
public
R
statisticsDriveDataEveryDay
()
{
log
.
info
(
"开始查询试驾统计数据"
);
log
.
info
(
"开始查询试驾统计数据"
);
List
<
StatisticsDriveDto
>
statisticsDriveList
=
statisticsDriveService
.
statisticsDriveDataEveryDay
();
List
<
StatisticsDriveDto
>
statisticsDriveList
=
statisticsDriveService
.
statisticsDriveDataEveryDay
();
if
(
CollectionUtil
.
isEmpty
(
statisticsDriveList
))
{
log
.
info
(
"数据集合的大小为0==="
);
log
.
info
(
"数据集合的实体==="
+
JSON
.
toJSONString
(
statisticsDriveList
));
return
R
.
ok
();
}
log
.
info
(
"数据集合的大小为==="
+
statisticsDriveList
.
size
());
log
.
info
(
"数据集合的大小为==="
+
statisticsDriveList
.
size
());
log
.
info
(
"数据集合的实体==="
+
JSON
.
toJSONString
(
statisticsDriveList
));
return
R
.
ok
().
data
(
statisticsDriveList
);
return
R
.
ok
().
data
(
statisticsDriveList
);
}
}
...
@@ -39,8 +48,10 @@ public class StatisticsDriveController {
...
@@ -39,8 +48,10 @@ public class StatisticsDriveController {
log
.
info
(
"开始保存试驾统计数据,数据集合的大小为==="
+
statisticsDriveDtoList
.
size
());
log
.
info
(
"开始保存试驾统计数据,数据集合的大小为==="
+
statisticsDriveDtoList
.
size
());
if
(
CollectionUtil
.
isNotEmpty
(
statisticsDriveDtoList
))
{
if
(
CollectionUtil
.
isNotEmpty
(
statisticsDriveDtoList
))
{
statisticsDriveService
.
insertStatisticsDriveList
(
statisticsDriveDtoList
);
statisticsDriveService
.
insertStatisticsDriveList
(
statisticsDriveDtoList
);
log
.
info
(
"保存数据成功"
);
log
.
info
(
"保存数据成功==="
);
return
R
.
ok
();
}
}
log
.
info
(
"数据集合为空 没有数据可以保存==="
);
return
R
.
ok
();
return
R
.
ok
();
}
}
}
}
src/main/java/cn/com/glsx/stdinterface/modules/service/StatisticsDriveService.java
View file @
c922314
...
@@ -30,6 +30,7 @@ public class StatisticsDriveService {
...
@@ -30,6 +30,7 @@ public class StatisticsDriveService {
Calendar
cal
=
Calendar
.
getInstance
();
Calendar
cal
=
Calendar
.
getInstance
();
cal
.
add
(
Calendar
.
DATE
,
-
1
);
cal
.
add
(
Calendar
.
DATE
,
-
1
);
String
yesterDayFormat
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
).
format
(
cal
.
getTime
());
String
yesterDayFormat
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
).
format
(
cal
.
getTime
());
log
.
info
(
"数据统计的天数==="
+
yesterDayFormat
);
return
statisticsDriveMapper
.
statisticsDriveDataEveryDay
(
yesterDayFormat
);
return
statisticsDriveMapper
.
statisticsDriveDataEveryDay
(
yesterDayFormat
);
}
}
...
...
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