Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
eshiled-new
/
ne-shield-trialdrive-admin
This project
Loading...
Sign in
Toggle navigation
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 b4e5679d
authored
Aug 26, 2021
by
杨林龙
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
优化试驾报表查询和数据导出
1 parent
eb892e4c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
145 deletions
src/main/java/cn/com/glsx/admin/modules/service/TrialDriveReportService.java
src/main/java/cn/com/glsx/admin/modules/service/TrialDriveReportService.java
View file @
b4e5679
...
@@ -179,151 +179,6 @@ public class TrialDriveReportService {
...
@@ -179,151 +179,6 @@ public class TrialDriveReportService {
return
testDrivePageList
;
return
testDrivePageList
;
}
}
public
List
<
TrialDriveReportExport
>
exportEffectiveTestDriveReport
(
TrialDriveReportSearch
search
,
List
<
TrialDriveReportExport
>
testDrivePageList
)
{
// 没有年月查询消息时 默认显示当前年月
if
(
StringUtils
.
isNullOrEmpty
(
search
.
getMonth
())
&&
StringUtils
.
isNullOrEmpty
(
search
.
getYear
()))
{
search
.
setYear
(
DateUtil
.
getYearOfNow
());
search
.
setMonth
(
DateUtil
.
getMonthOfNow
());
}
for
(
TrialDriveReportExport
drivePageExcel
:
testDrivePageList
)
{
search
.
setSn
(
drivePageExcel
.
getSn
());
List
<
TrialDriveReportExport
>
testDriveDataOneList
=
statisticsDriveMapper
.
getTestDriveData
(
search
);
//将每一个查询的对象进行填充
makeDriveData
(
testDriveDataOneList
,
drivePageExcel
);
}
//获取查询的年月参数
String
yearAndMonth
=
null
;
if
(
StringUtils
.
isNotEmpty
(
search
.
getYear
())
&&
StringUtils
.
isNotBlank
(
search
.
getYear
())
&&
StringUtils
.
isNotEmpty
(
search
.
getMonth
())
&&
StringUtils
.
isNotBlank
(
search
.
getMonth
()))
{
yearAndMonth
=
search
.
getYear
().
concat
(
"-"
).
concat
(
search
.
getMonth
());
}
else
{
if
(
StringUtils
.
isNotEmpty
(
search
.
getYear
())
&&
StringUtils
.
isNotBlank
(
search
.
getYear
()))
{
yearAndMonth
=
search
.
getYear
().
concat
(
"-01"
);
}
if
(
StringUtils
.
isNotEmpty
(
search
.
getMonth
())
&&
StringUtils
.
isNotBlank
(
search
.
getMonth
()))
{
yearAndMonth
=
DateUtil
.
getYearOfNow
().
concat
(
"-"
).
concat
(
search
.
getMonth
());
}
}
// 将没有数据的部分用 O 替代
for
(
TrialDriveReportExport
drivePageExcel
:
testDrivePageList
)
{
// 获取当天的最大天数
int
maxDayNum
=
31
;
if
(
StringUtils
.
isNotEmpty
(
search
.
getYear
())
&&
StringUtils
.
isNotBlank
(
search
.
getYear
())
&&
StringUtils
.
isNotEmpty
(
search
.
getMonth
())
&&
StringUtils
.
isNotBlank
(
search
.
getMonth
()))
{
maxDayNum
=
DateUtil
.
getDaysByYearMonth
(
Integer
.
parseInt
(
search
.
getYear
()),
Integer
.
parseInt
(
search
.
getMonth
()));
}
else
if
(
StringUtils
.
isNotEmpty
(
search
.
getMonth
())
&&
StringUtils
.
isNotBlank
(
search
.
getMonth
()))
{
maxDayNum
=
DateUtil
.
getDaysByYearMonth
(
Integer
.
parseInt
(
DateUtil
.
getYearOfNow
()),
Integer
.
parseInt
(
search
.
getMonth
()));
}
if
(
maxDayNum
>=
1
)
{
drivePageExcel
.
setDayNum1
(
replaceDayCount
(
drivePageExcel
.
getDayNum1
()));
}
if
(
maxDayNum
>=
2
)
{
drivePageExcel
.
setDayNum2
(
replaceDayCount
(
drivePageExcel
.
getDayNum2
()));
}
if
(
maxDayNum
>=
3
)
{
drivePageExcel
.
setDayNum3
(
replaceDayCount
(
drivePageExcel
.
getDayNum3
()));
}
if
(
maxDayNum
>=
4
)
{
drivePageExcel
.
setDayNum4
(
replaceDayCount
(
drivePageExcel
.
getDayNum4
()));
}
if
(
maxDayNum
>=
5
)
{
drivePageExcel
.
setDayNum5
(
replaceDayCount
(
drivePageExcel
.
getDayNum5
()));
}
if
(
maxDayNum
>=
6
)
{
drivePageExcel
.
setDayNum6
(
replaceDayCount
(
drivePageExcel
.
getDayNum6
()));
}
if
(
maxDayNum
>=
7
)
{
drivePageExcel
.
setDayNum7
(
replaceDayCount
(
drivePageExcel
.
getDayNum7
()));
}
if
(
maxDayNum
>=
8
)
{
drivePageExcel
.
setDayNum8
(
replaceDayCount
(
drivePageExcel
.
getDayNum8
()));
}
if
(
maxDayNum
>=
9
)
{
drivePageExcel
.
setDayNum9
(
replaceDayCount
(
drivePageExcel
.
getDayNum9
()));
}
if
(
maxDayNum
>=
10
)
{
drivePageExcel
.
setDayNum10
(
replaceDayCount
(
drivePageExcel
.
getDayNum10
()));
}
if
(
maxDayNum
>=
11
)
{
drivePageExcel
.
setDayNum11
(
replaceDayCount
(
drivePageExcel
.
getDayNum11
()));
}
if
(
maxDayNum
>=
12
)
{
drivePageExcel
.
setDayNum12
(
replaceDayCount
(
drivePageExcel
.
getDayNum12
()));
}
if
(
maxDayNum
>=
13
)
{
drivePageExcel
.
setDayNum13
(
replaceDayCount
(
drivePageExcel
.
getDayNum13
()));
}
if
(
maxDayNum
>=
14
)
{
drivePageExcel
.
setDayNum14
(
replaceDayCount
(
drivePageExcel
.
getDayNum14
()));
}
if
(
maxDayNum
>=
15
)
{
drivePageExcel
.
setDayNum15
(
replaceDayCount
(
drivePageExcel
.
getDayNum15
()));
}
if
(
maxDayNum
>=
16
)
{
drivePageExcel
.
setDayNum16
(
replaceDayCount
(
drivePageExcel
.
getDayNum16
()));
}
if
(
maxDayNum
>=
17
)
{
drivePageExcel
.
setDayNum17
(
replaceDayCount
(
drivePageExcel
.
getDayNum17
()));
}
if
(
maxDayNum
>=
18
)
{
drivePageExcel
.
setDayNum18
(
replaceDayCount
(
drivePageExcel
.
getDayNum18
()));
}
if
(
maxDayNum
>=
19
)
{
drivePageExcel
.
setDayNum19
(
replaceDayCount
(
drivePageExcel
.
getDayNum19
()));
}
if
(
maxDayNum
>=
20
)
{
drivePageExcel
.
setDayNum20
(
replaceDayCount
(
drivePageExcel
.
getDayNum20
()));
}
if
(
maxDayNum
>=
21
)
{
drivePageExcel
.
setDayNum21
(
replaceDayCount
(
drivePageExcel
.
getDayNum21
()));
}
if
(
maxDayNum
>=
22
)
{
drivePageExcel
.
setDayNum22
(
replaceDayCount
(
drivePageExcel
.
getDayNum22
()));
}
if
(
maxDayNum
>=
23
)
{
drivePageExcel
.
setDayNum23
(
replaceDayCount
(
drivePageExcel
.
getDayNum23
()));
}
if
(
maxDayNum
>=
24
)
{
drivePageExcel
.
setDayNum24
(
replaceDayCount
(
drivePageExcel
.
getDayNum24
()));
}
if
(
maxDayNum
>=
25
)
{
drivePageExcel
.
setDayNum25
(
replaceDayCount
(
drivePageExcel
.
getDayNum25
()));
}
if
(
maxDayNum
>=
26
)
{
drivePageExcel
.
setDayNum26
(
replaceDayCount
(
drivePageExcel
.
getDayNum26
()));
}
if
(
maxDayNum
>=
27
)
{
drivePageExcel
.
setDayNum27
(
replaceDayCount
(
drivePageExcel
.
getDayNum27
()));
}
if
(
maxDayNum
>=
28
)
{
drivePageExcel
.
setDayNum28
(
replaceDayCount
(
drivePageExcel
.
getDayNum28
()));
}
if
(
maxDayNum
>=
29
)
{
drivePageExcel
.
setDayNum29
(
replaceDayCount
(
drivePageExcel
.
getDayNum29
()));
}
if
(
maxDayNum
>=
30
)
{
drivePageExcel
.
setDayNum30
(
replaceDayCount
(
drivePageExcel
.
getDayNum30
()));
}
if
(
maxDayNum
>=
31
)
{
drivePageExcel
.
setDayNum31
(
replaceDayCount
(
drivePageExcel
.
getDayNum31
()));
}
// 填充行程时间
drivePageExcel
.
setStatDate
(
replaceStatDate
(
drivePageExcel
.
getStatDate
(),
yearAndMonth
));
// 设置总计算数
drivePageExcel
.
setSummation
(
replaceDayCount
(
drivePageExcel
.
getSummation
()));
}
if
(
CollectionUtils
.
isEmpty
(
testDrivePageList
))
{
return
null
;
}
// 将数据集合按照店代码排序
testDrivePageList
.
sort
((
o1
,
o2
)
->
o1
.
getShopCode
().
compareToIgnoreCase
(
o2
.
getShopCode
()));
return
testDrivePageList
;
}
public
List
<
String
>
getYearWithData
()
{
public
List
<
String
>
getYearWithData
()
{
// 获取有数据的年份
// 获取有数据的年份
return
trialDriveReportMapper
.
getYearWithData
();
return
trialDriveReportMapper
.
getYearWithData
();
...
...
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