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
b1d20437
Commit
b1d20437
authored
Apr 24, 2019
by
Quxl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
x
parent
7b154f6a
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
116 additions
and
14 deletions
+116
-14
CinemaService.java
src/main/java/com/egolm/film/api/service/CinemaService.java
+6
-0
CinemaServiceImpl.java
...va/com/egolm/film/api/service/impl/CinemaServiceImpl.java
+19
-0
CinemaController.java
...n/java/com/egolm/film/api/web/admin/CinemaController.java
+44
-4
Fc_cinema.java
src/main/java/com/egolm/film/bean/Fc_cinema.java
+27
-5
Fc_cinema_showtime.java
src/main/java/com/egolm/film/bean/Fc_cinema_showtime.java
+5
-5
WebApiInterceptor.java
.../com/egolm/film/config/interceptor/WebApiInterceptor.java
+15
-0
No files found.
src/main/java/com/egolm/film/api/service/CinemaService.java
View file @
b1d20437
...
...
@@ -3,8 +3,14 @@ package com.egolm.film.api.service;
import
java.util.List
;
import
java.util.Map
;
import
com.egolm.common.jdbc.Page
;
public
interface
CinemaService
{
List
<
Map
<
String
,
Object
>>
getCinemaListForSelected
(
String
keyword
);
List
<
Map
<
String
,
Object
>>
getCinemaList
(
String
keyword
,
Page
page
);
void
setTmpData
(
Integer
showtimeId
);
}
src/main/java/com/egolm/film/api/service/impl/CinemaServiceImpl.java
View file @
b1d20437
...
...
@@ -8,6 +8,7 @@ import org.springframework.stereotype.Service;
import
com.egolm.common.StringUtil
;
import
com.egolm.common.jdbc.JdbcTemplate
;
import
com.egolm.common.jdbc.Page
;
import
com.egolm.film.api.service.CinemaService
;
import
com.egolm.film.util.SqlWhere
;
...
...
@@ -41,4 +42,22 @@ public class CinemaServiceImpl implements CinemaService {
return
jdbcTemplate
.
queryForList
(
sql
,
where
.
getObjectArray
());
}
@Override
public
List
<
Map
<
String
,
Object
>>
getCinemaList
(
String
keyword
,
Page
page
)
{
SqlWhere
where
=
new
SqlWhere
().
lk
(
new
String
[]
{
"cinema_no"
,
"cinema_name"
,
"cinema_en_name"
},
keyword
);
String
sql
=
"select * from fc_cinema "
+
StringUtil
.
join
(
" and "
,
" where "
,
" "
,
" "
,
where
.
getStringList
());
return
jdbcTemplate
.
limit
(
sql
,
page
,
where
.
getObjectArray
());
}
@Override
public
void
setTmpData
(
Integer
showtimeId
)
{
String
sql
=
"select cinema_id from fc_cinema_showtime where id = ?"
;
Integer
cinema_id
=
jdbcTemplate
.
queryForInt
(
sql
,
showtimeId
);
String
sql_tmp_count_show
=
"select count(*) from fc_cinema_showtime where cinema_id = ? and showtime_no is not null and showtime_no != ''"
;
Integer
tmp_count_show
=
jdbcTemplate
.
queryForInt
(
sql_tmp_count_show
,
cinema_id
);
String
sql_tmp_count_film
=
"select count(film_id) from fc_cinema_showtime where cinema_id = ? and film_id is not null group by film_id"
;
Integer
tmp_count_film
=
jdbcTemplate
.
queryForInt
(
sql_tmp_count_film
,
cinema_id
);
jdbcTemplate
.
executeUpdate
(
"update fc_cinema set tmp_count_show = ?, tmp_count_film = ? where id = ?"
,
tmp_count_show
,
tmp_count_film
,
cinema_id
);
}
}
src/main/java/com/egolm/film/api/web/admin/CinemaController.java
View file @
b1d20437
...
...
@@ -10,10 +10,16 @@ import org.springframework.web.bind.annotation.ResponseBody;
import
org.springframework.web.bind.annotation.RestController
;
import
com.egolm.common.bean.Rjx
;
import
com.egolm.common.jdbc.Page
;
import
com.egolm.film.api.service.CinemaService
;
import
com.egolm.film.bean.Fc_cinema
;
import
com.egolm.film.api.service.CommonService
;
import
com.egolm.film.bean.Fc_cinema_showtime
;
import
com.egolm.film.bean.model.Fc_cinema_model
;
import
com.egolm.film.bean.model.Fc_cinema_showtime_model
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
@Api
...
...
@@ -24,19 +30,53 @@ public class CinemaController {
@Autowired
CinemaService
service
;
@Autowired
CommonService
common
;
@ResponseBody
@PostMapping
(
"save"
)
@PostMapping
(
"save
OrUpdate
"
)
@ApiOperation
(
"保存影院影厅"
)
public
Object
save
(
Fc_cinema
cinema
)
{
public
Object
saveOrUpdate
(
Fc_cinema_model
cinemaModel
)
{
common
.
save
(
cinemaModel
);
return
Rjx
.
jsonOk
();
}
@ResponseBody
@PostMapping
(
"getCinemaListForSelected"
)
@ApiOperation
(
"查询影院列表"
)
@ApiOperation
(
"查询影院列表
(不包含影厅信息,且GroupBy去重),新增影院影厅信息的时候,影院信息可以通过下拉菜单选择,数据库中已存在的影院信息将显示再此列表中
"
)
public
Object
getCinemaListForSelected
(
String
keyword
)
{
List
<
Map
<
String
,
Object
>>
list
=
service
.
getCinemaListForSelected
(
keyword
);
return
Rjx
.
jsonOk
().
setData
(
list
);
}
@ResponseBody
@PostMapping
(
"getCinemaList"
)
@ApiOperation
(
"查询影院列表"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"index"
,
value
=
"分页页码"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"limit"
,
value
=
"每页显示条数"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"limitKey"
,
value
=
"分页排序字段"
),
})
public
Object
getCinemaList
(
String
keyword
,
Page
page
)
{
List
<
Map
<
String
,
Object
>>
list
=
service
.
getCinemaList
(
keyword
,
page
);
return
Rjx
.
jsonOk
().
setData
(
list
).
setPage
(
page
);
}
@ResponseBody
@PostMapping
(
"saveShowtime"
)
@ApiOperation
(
"保存拍片时间"
)
public
Object
saveShowtime
(
Fc_cinema_showtime
[]
showtime
)
{
common
.
save
(
showtime
);
return
Rjx
.
jsonOk
();
}
@ResponseBody
@PostMapping
(
"updateShowtime"
)
@ApiOperation
(
"编辑场次"
)
public
Object
updateShowtime
(
Fc_cinema_showtime_model
showtimeModel
)
{
common
.
update
(
showtimeModel
);
service
.
setTmpData
(
showtimeModel
.
getId
());
return
Rjx
.
jsonOk
();
}
}
src/main/java/com/egolm/film/bean/Fc_cinema.java
View file @
b1d20437
...
...
@@ -18,7 +18,7 @@ public class Fc_cinema implements java.io.Serializable {
private
Integer
id
;
@Column
(
columnDefinition
=
"varchar(100) COMMENT '影院编号'"
)
private
String
no
;
private
String
cinema_
no
;
@Column
(
columnDefinition
=
"varchar(255) COMMENT '影院名称'"
)
private
String
cinema_name
;
...
...
@@ -50,6 +50,12 @@ public class Fc_cinema implements java.io.Serializable {
@Column
(
columnDefinition
=
"datetime COMMENT '创建时间'"
)
private
Date
create_time
;
@Column
(
columnDefinition
=
"int(11) COMMENT '冗余,已排片影片数量'"
)
private
Integer
tmp_count_film
;
@Column
(
columnDefinition
=
"int(11) COMMENT '冗余,已设置厂数'"
)
private
Integer
tmp_count_show
;
public
void
setId
(
Integer
id
)
{
this
.
id
=
id
;
...
...
@@ -59,12 +65,12 @@ public class Fc_cinema implements java.io.Serializable {
return
id
;
}
public
void
set
No
(
String
no
)
{
this
.
no
=
no
;
public
void
set
Cinema_no
(
String
cinema_
no
)
{
this
.
cinema_no
=
cinema_
no
;
}
public
String
get
N
o
()
{
return
no
;
public
String
get
Cinema_n
o
()
{
return
cinema_
no
;
}
public
void
setCinema_name
(
String
cinema_name
)
{
...
...
@@ -147,5 +153,21 @@ public class Fc_cinema implements java.io.Serializable {
return
create_time
;
}
public
void
setTmp_count_film
(
Integer
tmp_count_film
)
{
this
.
tmp_count_film
=
tmp_count_film
;
}
public
Integer
getTmp_count_film
()
{
return
tmp_count_film
;
}
public
void
setTmp_count_show
(
Integer
tmp_count_show
)
{
this
.
tmp_count_show
=
tmp_count_show
;
}
public
Integer
getTmp_count_show
()
{
return
tmp_count_show
;
}
}
src/main/java/com/egolm/film/bean/Fc_cinema_showtime.java
View file @
b1d20437
...
...
@@ -17,7 +17,7 @@ public class Fc_cinema_showtime implements java.io.Serializable {
private
Integer
id
;
@Column
(
columnDefinition
=
"int(11) unsigned COMMENT '场次编号'"
)
private
Integer
no
;
private
Integer
showtime_
no
;
@Column
(
columnDefinition
=
"int(11) unsigned COMMENT '影院放映厅ID'"
)
private
Integer
cinema_id
;
...
...
@@ -52,12 +52,12 @@ public class Fc_cinema_showtime implements java.io.Serializable {
return
id
;
}
public
void
set
No
(
Integer
no
)
{
this
.
no
=
no
;
public
void
set
Showtime_no
(
Integer
showtime_
no
)
{
this
.
showtime_no
=
showtime_
no
;
}
public
Integer
get
N
o
()
{
return
no
;
public
Integer
get
Showtime_n
o
()
{
return
showtime_
no
;
}
public
void
setCinema_id
(
Integer
cinema_id
)
{
...
...
src/main/java/com/egolm/film/config/interceptor/WebApiInterceptor.java
View file @
b1d20437
...
...
@@ -70,4 +70,19 @@ public class WebApiInterceptor extends HandlerInterceptorAdapter {
System
.
out
.
println
(
"10.10.0.111:20002/film/webapi/getFilmList?timestamp="
+
timestamp
+
"&sign="
+
sign
);
}
public
String
sign
(
Map
<
String
,
String
>
params
)
{
StringBuffer
sb
=
new
StringBuffer
();
Map
<
String
,
String
>
sortMap
=
new
TreeMap
<
String
,
String
>(
params
);
sortMap
.
remove
(
"sign"
);
for
(
String
key
:
sortMap
.
keySet
())
{
String
val
=
sortMap
.
get
(
key
);
if
(
val
!=
null
)
{
sb
.
append
(
val
);
}
}
String
sign_data
=
sb
.
toString
()
+
md5key
;
return
StringUtil
.
toMD5HexString
(
sign_data
);
}
}
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