Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
S
sentinel
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
曲欣亮
sentinel
Commits
9d4ed076
Commit
9d4ed076
authored
Dec 28, 2018
by
Quxl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
x
parent
9c0246a5
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
12 deletions
+30
-12
ExportServiceImpl.java
...va/com/egolm/film/api/service/impl/ExportServiceImpl.java
+30
-12
No files found.
src/main/java/com/egolm/film/api/service/impl/ExportServiceImpl.java
View file @
9d4ed076
...
...
@@ -25,17 +25,26 @@ public class ExportServiceImpl implements ExportService {
@Autowired
JdbcTemplate
jdbcTemplate
;
private
static
final
Map
<
String
,
String
>
t
ypes
=
new
HashMap
<
String
,
String
>();
private
static
final
Map
<
String
,
String
>
playactorT
ypes
=
new
HashMap
<
String
,
String
>();
static
{
t
ypes
.
put
(
"director"
,
"导演"
);
t
ypes
.
put
(
"producer"
,
"制片人"
);
t
ypes
.
put
(
"screenwriter"
,
"编剧"
);
t
ypes
.
put
(
"photographer"
,
"摄影"
);
t
ypes
.
put
(
"actor"
,
"男演员"
);
t
ypes
.
put
(
"actress"
,
"女演员"
);
t
ypes
.
put
(
"issuser"
,
"发行方"
);
t
ypes
.
put
(
"show"
,
"参加过的电视节"
);
playactorT
ypes
.
put
(
"director"
,
"导演"
);
playactorT
ypes
.
put
(
"producer"
,
"制片人"
);
playactorT
ypes
.
put
(
"screenwriter"
,
"编剧"
);
playactorT
ypes
.
put
(
"photographer"
,
"摄影"
);
playactorT
ypes
.
put
(
"actor"
,
"男演员"
);
playactorT
ypes
.
put
(
"actress"
,
"女演员"
);
playactorT
ypes
.
put
(
"issuser"
,
"发行方"
);
playactorT
ypes
.
put
(
"show"
,
"参加过的电视节"
);
}
private
static
final
Map
<
String
,
String
>
enrollTypes
=
new
HashMap
<
String
,
String
>();
static
{
enrollTypes
.
put
(
"1"
,
"金爵奖国际影片评选"
);
enrollTypes
.
put
(
"2"
,
"亚洲新人奖国际影片评选"
);
enrollTypes
.
put
(
"3"
,
"电影频道传媒关注"
);
enrollTypes
.
put
(
"4"
,
"国际电影展映"
);
}
private
List
<
Map
<
String
,
Object
>>
queryFilmDataList
()
{
String
sql
=
"select t.* from fc_member_film t"
;
String
sql0
=
"select group_concat(fp.playactor_name) text, fp.film_id, fp.playactor_type from fc_member_film_playactor fp group by fp.film_id, fp.playactor_type"
;
...
...
@@ -50,7 +59,7 @@ public class ExportServiceImpl implements ExportService {
Map
<
String
,
Map
<
String
,
Object
>>
showMM
=
Util
.
listToMM
(
shows
,
","
,
"film_id"
);
for
(
Map
<
String
,
Object
>
map
:
list
)
{
String
id_str
=
""
+
map
.
get
(
"id"
);
for
(
String
playactor_type
:
t
ypes
.
keySet
())
{
for
(
String
playactor_type
:
playactorT
ypes
.
keySet
())
{
Map
<
String
,
Object
>
playactorMap
=
playactorMM
.
get
(
id_str
+
","
+
playactor_type
);
map
.
put
(
playactor_type
,
playactorMap
==
null
?
null
:
playactorMap
.
get
(
"text"
));
}
...
...
@@ -58,6 +67,15 @@ public class ExportServiceImpl implements ExportService {
Map
<
String
,
Object
>
showMap
=
showMM
.
get
(
id_str
);
map
.
put
(
"issuer"
,
issuerMap
==
null
?
null
:
issuerMap
.
get
(
"text"
));
map
.
put
(
"show"
,
showMap
==
null
?
null
:
showMap
.
get
(
"text"
));
String
enroll_type_name
=
(
String
)
map
.
get
(
"enroll_type_name"
);
String
[]
enrolls
=
enroll_type_name
.
split
(
","
);
List
<
String
>
enrollList
=
new
ArrayList
<
String
>();
for
(
String
s
:
enrolls
)
{
enrollList
.
add
(
enrollTypes
.
get
(
s
));
}
map
.
put
(
"enroll_type_name"
,
StringUtil
.
join
(
","
,
enrollList
));
}
return
list
;
...
...
@@ -90,9 +108,9 @@ public class ExportServiceImpl implements ExportService {
argsList
.
add
(
columnName
);
titleList
.
add
(
columnComment
);
}
for
(
String
key
:
t
ypes
.
keySet
())
{
for
(
String
key
:
playactorT
ypes
.
keySet
())
{
argsList
.
add
(
key
);
titleList
.
add
(
t
ypes
.
get
(
key
));
titleList
.
add
(
playactorT
ypes
.
get
(
key
));
}
ExcelUtil
.
excel
(
os
,
argsList
.
toArray
(
new
String
[
argsList
.
size
()]),
titleList
.
toArray
(
new
String
[
titleList
.
size
()]),
null
,
list
);
}
...
...
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