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
386c3e5b
Commit
386c3e5b
authored
Apr 24, 2019
by
Quxl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
x
parent
224a34f1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
38 additions
and
0 deletions
+38
-0
CinemaService.java
src/main/java/com/egolm/film/api/service/CinemaService.java
+2
-0
CinemaServiceImpl.java
...va/com/egolm/film/api/service/impl/CinemaServiceImpl.java
+9
-0
CinemaController.java
...n/java/com/egolm/film/api/web/admin/CinemaController.java
+27
-0
No files found.
src/main/java/com/egolm/film/api/service/CinemaService.java
View file @
386c3e5b
...
...
@@ -13,4 +13,6 @@ public interface CinemaService {
void
setTmpData
(
Integer
showtimeId
);
List
<
Map
<
String
,
Object
>>
queryShowtimeList
();
}
src/main/java/com/egolm/film/api/service/impl/CinemaServiceImpl.java
View file @
386c3e5b
package
com
.
egolm
.
film
.
api
.
service
.
impl
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
com.egolm.common.DateUtil
;
import
com.egolm.common.StringUtil
;
import
com.egolm.common.jdbc.JdbcTemplate
;
import
com.egolm.common.jdbc.Page
;
...
...
@@ -60,4 +62,11 @@ public class CinemaServiceImpl implements CinemaService {
jdbcTemplate
.
executeUpdate
(
"update fc_cinema set tmp_count_show = ?, tmp_count_film = ? where id = ?"
,
tmp_count_show
,
tmp_count_film
,
cinema_id
);
}
@Override
public
List
<
Map
<
String
,
Object
>>
queryShowtimeList
()
{
Date
dodayStart
=
DateUtil
.
start
(
new
Date
());
String
sql
=
"select * from fc_cinema_showtime where show_date >= ?"
;
return
jdbcTemplate
.
queryForList
(
sql
,
dodayStart
);
}
}
src/main/java/com/egolm/film/api/web/admin/CinemaController.java
View file @
386c3e5b
package
com
.
egolm
.
film
.
api
.
web
.
admin
;
import
java.util.ArrayList
;
import
java.util.Comparator
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.TreeMap
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.format.annotation.DateTimeFormat
;
...
...
@@ -12,6 +14,8 @@ import org.springframework.web.bind.annotation.RequestMapping;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
org.springframework.web.bind.annotation.RestController
;
import
com.egolm.common.DateUtil
;
import
com.egolm.common.Util
;
import
com.egolm.common.bean.Rjx
;
import
com.egolm.common.jdbc.Page
;
import
com.egolm.film.api.service.CinemaService
;
...
...
@@ -104,4 +108,27 @@ public class CinemaController {
return
Rjx
.
jsonOk
();
}
@ResponseBody
@PostMapping
(
"updateShowtime"
)
@ApiOperation
(
"编辑场次"
)
public
Object
getShowtimeList
()
{
List
<
Map
<
String
,
Object
>>
list
=
service
.
queryShowtimeList
();
for
(
Map
<
String
,
Object
>
map
:
list
)
{
Date
date
=
(
Date
)
map
.
get
(
"show_date"
);
map
.
put
(
"show_date"
,
DateUtil
.
format
(
date
,
"yyyy-MM-dd"
));
}
Map
<
String
,
List
<
Map
<
String
,
Object
>>>
datas
=
Util
.
listToML
(
list
,
"show_date"
);
for
(
String
key
:
datas
.
keySet
())
{
List
<
Map
<
String
,
Object
>>
dataList
=
datas
.
get
(
key
);
dataList
.
sort
(
new
Comparator
<
Map
<
String
,
Object
>>()
{
@Override
public
int
compare
(
Map
<
String
,
Object
>
o1
,
Map
<
String
,
Object
>
o2
)
{
String
show_time1
=
(
String
)
o1
.
get
(
"show_time"
);
String
show_time2
=
(
String
)
o2
.
get
(
"show_time"
);
return
show_time1
.
compareTo
(
show_time2
);
}
});
}
return
Rjx
.
jsonOk
().
setData
(
new
TreeMap
<
String
,
List
<
Map
<
String
,
Object
>>>(
datas
));
}
}
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