Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
member-api
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
曲欣亮
member-api
Commits
a812dd9b
Commit
a812dd9b
authored
Feb 26, 2019
by
张永
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
b8d9143f
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
74 additions
and
41 deletions
+74
-41
OtherUploadService.java
...n/java/com/egolm/film/api/service/OtherUploadService.java
+7
-5
OtherUploadServiceImpl.java
...m/egolm/film/api/service/impl/OtherUploadServiceImpl.java
+27
-18
FilmUploadController.java
...va/com/egolm/film/api/web/admin/FilmUploadController.java
+22
-13
Fc_film_upload.java
src/main/java/com/egolm/film/bean/Fc_film_upload.java
+16
-5
FilmContrants.java
src/main/java/com/egolm/film/util/FilmContrants.java
+2
-0
No files found.
src/main/java/com/egolm/film/api/service/OtherUploadService.java
View file @
a812dd9b
...
@@ -7,22 +7,24 @@ import com.egolm.common.jdbc.Page;
...
@@ -7,22 +7,24 @@ import com.egolm.common.jdbc.Page;
import
com.egolm.film.bean.Fc_film_upload
;
import
com.egolm.film.bean.Fc_film_upload
;
public
interface
OtherUploadService
{
public
interface
OtherUploadService
{
public
void
batchSave
(
List
<
Fc_film_upload
>
fc_film_upload
);
public
void
batchSave
(
List
<
Fc_film_upload
>
fc_film_upload
);
public
void
save
(
Fc_film_upload
fc_film_upload
);
public
void
save
(
Fc_film_upload
fc_film_upload
);
public
int
checkExists
(
Integer
film_
id
,
Integer
number
);
public
int
checkExists
(
Integer
film_
no
,
Integer
number
);
public
List
<
Map
<
String
,
Object
>>
getWaitUploadList
(
Page
page
);
public
List
<
Map
<
String
,
Object
>>
getWaitUploadList
(
Page
page
);
public
void
updateBegin
(
Integer
film_id
,
Integer
number
,
String
videoId
,
String
taskName
);
public
void
updateBegin
(
Integer
film_id
,
Integer
film_no
,
Integer
number
,
String
videoId
,
String
taskName
);
public
void
updateProgress
(
String
videoId
,
String
progress
);
public
void
updateProgress
(
String
videoId
,
String
progress
);
public
void
updateSuccess
(
String
videoId
);
public
void
updateSuccess
(
String
videoId
,
String
film_no
);
public
void
updateFail
(
String
videoId
,
String
errorMessage
);
public
void
updateFail
(
String
videoId
,
String
errorMessage
);
public
void
updateFail
(
Integer
film_id
,
Integer
number
,
String
errorMessage
);
public
void
updateFail
(
Integer
film_no
,
Integer
number
,
String
errorMessage
);
public
int
getIdByNo
(
Integer
film_no
);
}
}
src/main/java/com/egolm/film/api/service/impl/OtherUploadServiceImpl.java
View file @
a812dd9b
...
@@ -23,27 +23,37 @@ public class OtherUploadServiceImpl implements OtherUploadService {
...
@@ -23,27 +23,37 @@ public class OtherUploadServiceImpl implements OtherUploadService {
jdbcTemplate
.
saveOrUpdate
(
fc_film_upload
);
jdbcTemplate
.
saveOrUpdate
(
fc_film_upload
);
}
}
public
int
getIdByNo
(
Integer
film_no
)
{
try
{
String
sql
=
"select id from fc_member_film where film_no = ?"
;
return
jdbcTemplate
.
queryForInt
(
sql
,
film_no
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
return
0
;
}
public
void
batchSave
(
List
<
Fc_film_upload
>
fc_film_upload
)
{
public
void
batchSave
(
List
<
Fc_film_upload
>
fc_film_upload
)
{
jdbcTemplate
.
batchSave
(
fc_film_upload
);
jdbcTemplate
.
batchSave
(
fc_film_upload
);
}
}
public
int
checkExists
(
Integer
film_
id
,
Integer
number
)
{
public
int
checkExists
(
Integer
film_
no
,
Integer
number
)
{
String
sql
=
"SELECT count(1) from fc_film_upload where film_
id
= ? and number = ?"
;
String
sql
=
"SELECT count(1) from fc_film_upload where film_
no
= ? and number = ?"
;
return
jdbcTemplate
.
queryForInt
(
sql
,
film_
id
,
number
);
return
jdbcTemplate
.
queryForInt
(
sql
,
film_
no
,
number
);
}
}
//开始上传
//开始上传
public
void
updateBegin
(
Integer
film_id
,
Integer
number
,
String
videoId
,
String
taskName
)
{
public
void
updateBegin
(
Integer
film_id
,
Integer
film_no
,
Integer
number
,
String
videoId
,
String
taskName
)
{
if
(
StringUtil
.
isNotEmpty
(
taskName
))
{
if
(
StringUtil
.
isNotEmpty
(
taskName
))
{
String
sql
=
"update fc_film_upload set id = ? ,upload_state = ? ,upload_progress = '0%' ,taskName=? where film_
id
= ? and number = ? "
;
String
sql
=
"update fc_film_upload set id = ? ,upload_state = ? ,upload_progress = '0%' ,taskName=? where film_
no
= ? and number = ? "
;
jdbcTemplate
.
executeUpdate
(
sql
,
videoId
,
FilmContrants
.
UPLOAD_STATUS_ING
,
taskName
,
film_
id
,
number
);
jdbcTemplate
.
executeUpdate
(
sql
,
videoId
,
FilmContrants
.
UPLOAD_STATUS_ING
,
taskName
,
film_
no
,
number
);
}
else
{
}
else
{
String
sql
=
"update fc_film_upload set id = ? ,upload_state = ? ,upload_progress = '0%' where film_
id
= ? and number = ? "
;
String
sql
=
"update fc_film_upload set id = ? ,upload_state = ? ,upload_progress = '0%' where film_
no
= ? and number = ? "
;
jdbcTemplate
.
executeUpdate
(
sql
,
videoId
,
FilmContrants
.
UPLOAD_STATUS_ING
,
film_
id
,
number
);
jdbcTemplate
.
executeUpdate
(
sql
,
videoId
,
FilmContrants
.
UPLOAD_STATUS_ING
,
film_
no
,
number
);
}
}
String
filmSql
=
"update fc_member_film set upload_id =?, upload_state = ? where film_no = ? "
;
String
filmSql
=
"update fc_member_film set upload_id =?, upload_state = ? where film_no = ? "
;
jdbcTemplate
.
executeUpdate
(
filmSql
,
videoId
,
FilmContrants
.
UPLOAD_STATUS_ING
,
film_
id
);
jdbcTemplate
.
executeUpdate
(
filmSql
,
videoId
,
FilmContrants
.
UPLOAD_STATUS_ING
,
film_
no
);
}
}
//修改进度
//修改进度
...
@@ -52,7 +62,7 @@ public class OtherUploadServiceImpl implements OtherUploadService {
...
@@ -52,7 +62,7 @@ public class OtherUploadServiceImpl implements OtherUploadService {
jdbcTemplate
.
executeUpdate
(
sql
,
progress
,
videoId
);
jdbcTemplate
.
executeUpdate
(
sql
,
progress
,
videoId
);
}
}
//上传成功
//上传成功
public
void
updateSuccess
(
String
videoId
)
{
public
void
updateSuccess
(
String
videoId
,
String
film_no
)
{
String
sql
=
"update fc_film_upload set upload_time = now() ,file_local_path = '' ,upload_state = ? where id = ? "
;
String
sql
=
"update fc_film_upload set upload_time = now() ,file_local_path = '' ,upload_state = ? where id = ? "
;
jdbcTemplate
.
executeUpdate
(
sql
,
FilmContrants
.
UPLOAD_STATUS_COMPLETED
,
videoId
);
jdbcTemplate
.
executeUpdate
(
sql
,
FilmContrants
.
UPLOAD_STATUS_COMPLETED
,
videoId
);
...
@@ -68,10 +78,9 @@ public class OtherUploadServiceImpl implements OtherUploadService {
...
@@ -68,10 +78,9 @@ public class OtherUploadServiceImpl implements OtherUploadService {
jdbcTemplate
.
executeUpdate
(
filmSql
,
FilmContrants
.
UPLOAD_STATUS_FILE
,
videoId
);
jdbcTemplate
.
executeUpdate
(
filmSql
,
FilmContrants
.
UPLOAD_STATUS_FILE
,
videoId
);
}
}
public
void
updateFail
(
Integer
film_id
,
Integer
number
,
String
errorMessage
)
{
public
void
updateFail
(
Integer
film_no
,
Integer
number
,
String
errorMessage
)
{
String
sql
=
"update fc_film_upload set upload__error_message =? ,upload_state = ? where film_id = ? and number = ? "
;
String
sql
=
"update fc_film_upload set upload__error_message =? ,upload_state = ? where film_no = ? and number = ? "
;
jdbcTemplate
.
executeUpdate
(
sql
,
errorMessage
,
FilmContrants
.
UPLOAD_STATUS_FILE
,
film_id
,
number
);
jdbcTemplate
.
executeUpdate
(
sql
,
errorMessage
,
FilmContrants
.
UPLOAD_STATUS_FILE
,
film_no
,
number
);
}
}
/**
/**
...
...
src/main/java/com/egolm/film/api/web/admin/FilmUploadController.java
View file @
a812dd9b
...
@@ -44,16 +44,23 @@ public class FilmUploadController {
...
@@ -44,16 +44,23 @@ public class FilmUploadController {
@PostMapping
(
"save"
)
@PostMapping
(
"save"
)
@ApiOperation
(
"保存上传数据"
)
@ApiOperation
(
"保存上传数据"
)
@ApiImplicitParams
({
@ApiImplicitParams
({
@ApiImplicitParam
(
paramType
=
"query"
,
dataType
=
"int"
,
required
=
true
,
name
=
"film_
id"
,
value
=
"申报影片ID
"
),
@ApiImplicitParam
(
paramType
=
"query"
,
dataType
=
"int"
,
required
=
true
,
name
=
"film_
no"
,
value
=
"申报影片NO
"
),
@ApiImplicitParam
(
paramType
=
"query"
,
dataType
=
"int"
,
required
=
true
,
name
=
"number"
,
value
=
"影片分类扩展分类"
),
@ApiImplicitParam
(
paramType
=
"query"
,
dataType
=
"int"
,
required
=
true
,
name
=
"number"
,
value
=
"影片分类扩展分类"
),
@ApiImplicitParam
(
paramType
=
"query"
,
dataType
=
"String"
,
required
=
true
,
name
=
"unit_name"
,
value
=
"剧集名"
),
@ApiImplicitParam
(
paramType
=
"query"
,
dataType
=
"String"
,
required
=
true
,
name
=
"unit_name"
,
value
=
"剧集名"
),
@ApiImplicitParam
(
paramType
=
"query"
,
dataType
=
"String"
,
required
=
true
,
name
=
"file_name"
,
value
=
"文件名"
),
@ApiImplicitParam
(
paramType
=
"query"
,
dataType
=
"String"
,
required
=
true
,
name
=
"file_name"
,
value
=
"文件名"
),
@ApiImplicitParam
(
paramType
=
"query"
,
dataType
=
"String"
,
required
=
true
,
name
=
"file_local_path"
,
value
=
"后台服务上传路径"
),
@ApiImplicitParam
(
paramType
=
"query"
,
dataType
=
"String"
,
required
=
true
,
name
=
"file_local_path"
,
value
=
"后台服务上传路径"
),
})
})
public
Object
save
(
Integer
film_
id
,
Integer
number
,
String
unit_name
,
String
file_name
,
String
file_local_path
)
{
public
Object
save
(
Integer
film_
no
,
Integer
number
,
String
unit_name
,
String
file_name
,
String
file_local_path
)
{
try
{
try
{
Fc_film_upload
fc_film_upload
=
new
Fc_film_upload
();
Fc_film_upload
fc_film_upload
=
new
Fc_film_upload
();
fc_film_upload
.
setFilm_id
(
film_id
);
int
film_id
=
otherUploadService
.
getIdByNo
(
film_no
);
if
(
film_id
!=
0
)
{
fc_film_upload
.
setUpload_state
(
FilmContrants
.
UPLOAD_STATUS_INIT
);
}
else
{
fc_film_upload
.
setUpload_state
(
FilmContrants
.
UPLOAD_STATUS_ERROR
);
fc_film_upload
.
setUpload__error_message
(
"该视频没有对应的申报记录"
);
}
fc_film_upload
.
setFilm_no
(
film_no
);
fc_film_upload
.
setNumber
(
number
);
fc_film_upload
.
setNumber
(
number
);
fc_film_upload
.
setUnit_name
(
unit_name
);
fc_film_upload
.
setUnit_name
(
unit_name
);
fc_film_upload
.
setFile_name
(
file_name
);
fc_film_upload
.
setFile_name
(
file_name
);
...
@@ -108,13 +115,14 @@ public class FilmUploadController {
...
@@ -108,13 +115,14 @@ public class FilmUploadController {
@PostMapping
(
"updateBegin"
)
@PostMapping
(
"updateBegin"
)
@ApiOperation
(
"修改为开始上传"
)
@ApiOperation
(
"修改为开始上传"
)
@ApiImplicitParams
({
@ApiImplicitParams
({
@ApiImplicitParam
(
paramType
=
"query"
,
dataType
=
"long"
,
required
=
true
,
name
=
"film_id"
,
value
=
"分页编号"
),
@ApiImplicitParam
(
paramType
=
"query"
,
dataType
=
"long"
,
required
=
true
,
name
=
"film_id"
,
value
=
"影片ID"
),
@ApiImplicitParam
(
paramType
=
"query"
,
dataType
=
"long"
,
required
=
true
,
name
=
"film_no"
,
value
=
"影片NO"
),
@ApiImplicitParam
(
paramType
=
"query"
,
dataType
=
"long"
,
required
=
true
,
name
=
"number"
,
value
=
"分页大小"
),
@ApiImplicitParam
(
paramType
=
"query"
,
dataType
=
"long"
,
required
=
true
,
name
=
"number"
,
value
=
"分页大小"
),
@ApiImplicitParam
(
paramType
=
"query"
,
dataType
=
"String"
,
required
=
false
,
name
=
"videoId"
,
value
=
"阿里视频ID"
),
@ApiImplicitParam
(
paramType
=
"query"
,
dataType
=
"String"
,
required
=
false
,
name
=
"videoId"
,
value
=
"阿里视频ID"
),
@ApiImplicitParam
(
paramType
=
"query"
,
dataType
=
"String"
,
required
=
false
,
name
=
"taskName"
,
value
=
"任务名称"
),
@ApiImplicitParam
(
paramType
=
"query"
,
dataType
=
"String"
,
required
=
false
,
name
=
"taskName"
,
value
=
"任务名称"
),
})
})
public
Object
updateBegin
(
Integer
film_id
,
Integer
number
,
String
videoId
,
String
taskName
){
public
Object
updateBegin
(
Integer
film_id
,
Integer
film_no
,
Integer
number
,
String
videoId
,
String
taskName
){
otherUploadService
.
updateBegin
(
film_id
,
number
,
videoId
,
taskName
);
otherUploadService
.
updateBegin
(
film_id
,
film_no
,
number
,
videoId
,
taskName
);
return
Rjx
.
jsonOk
();
return
Rjx
.
jsonOk
();
}
}
...
@@ -139,9 +147,10 @@ public class FilmUploadController {
...
@@ -139,9 +147,10 @@ public class FilmUploadController {
@ApiOperation
(
"更新上传完成"
)
@ApiOperation
(
"更新上传完成"
)
@ApiImplicitParams
({
@ApiImplicitParams
({
@ApiImplicitParam
(
paramType
=
"query"
,
dataType
=
"String"
,
required
=
false
,
name
=
"videoId"
,
value
=
"阿里视频ID"
),
@ApiImplicitParam
(
paramType
=
"query"
,
dataType
=
"String"
,
required
=
false
,
name
=
"videoId"
,
value
=
"阿里视频ID"
),
@ApiImplicitParam
(
paramType
=
"query"
,
dataType
=
"String"
,
required
=
false
,
name
=
"film_no"
,
value
=
"影片no"
),
})
})
public
Object
updateSuccess
(
String
videoId
){
public
Object
updateSuccess
(
String
videoId
,
String
film_no
){
otherUploadService
.
updateSuccess
(
videoId
);
otherUploadService
.
updateSuccess
(
videoId
,
film_no
);
return
Rjx
.
jsonOk
();
return
Rjx
.
jsonOk
();
}
}
...
@@ -160,15 +169,15 @@ public class FilmUploadController {
...
@@ -160,15 +169,15 @@ public class FilmUploadController {
@ResponseBody
@ResponseBody
@Transactional
@Transactional
@PostMapping
(
"updateFailByFilm
Id
"
)
@PostMapping
(
"updateFailByFilm
No
"
)
@ApiOperation
(
"更新为上传失败"
)
@ApiOperation
(
"更新为上传失败"
)
@ApiImplicitParams
({
@ApiImplicitParams
({
@ApiImplicitParam
(
paramType
=
"query"
,
dataType
=
"int"
,
required
=
true
,
name
=
"film_
id"
,
value
=
"影片ID
"
),
@ApiImplicitParam
(
paramType
=
"query"
,
dataType
=
"int"
,
required
=
true
,
name
=
"film_
no"
,
value
=
"影片NO
"
),
@ApiImplicitParam
(
paramType
=
"query"
,
dataType
=
"int"
,
required
=
false
,
name
=
"number"
,
value
=
"集数"
),
@ApiImplicitParam
(
paramType
=
"query"
,
dataType
=
"int"
,
required
=
false
,
name
=
"number"
,
value
=
"集数"
),
@ApiImplicitParam
(
paramType
=
"query"
,
dataType
=
"String"
,
required
=
false
,
name
=
"errorMessage"
,
value
=
"失败原因"
),
@ApiImplicitParam
(
paramType
=
"query"
,
dataType
=
"String"
,
required
=
false
,
name
=
"errorMessage"
,
value
=
"失败原因"
),
})
})
public
Object
updateFailByFilm
Id
(
Integer
film_id
,
Integer
number
,
String
errorMessage
){
public
Object
updateFailByFilm
No
(
Integer
film_no
,
Integer
number
,
String
errorMessage
){
otherUploadService
.
updateFail
(
film_
id
,
number
,
errorMessage
);
otherUploadService
.
updateFail
(
film_
no
,
number
,
errorMessage
);
return
Rjx
.
jsonOk
();
return
Rjx
.
jsonOk
();
}
}
}
}
src/main/java/com/egolm/film/bean/Fc_film_upload.java
View file @
a812dd9b
...
@@ -11,16 +11,19 @@ public class Fc_film_upload implements java.io.Serializable {
...
@@ -11,16 +11,19 @@ public class Fc_film_upload implements java.io.Serializable {
private
static
final
long
serialVersionUID
=
1L
;
private
static
final
long
serialVersionUID
=
1L
;
@Column
(
columnDefinition
=
"varchar(255)"
)
@Column
(
columnDefinition
=
"varchar(255)
COMMENT '阿里云视频ID'
"
)
private
String
id
;
private
String
id
;
@Column
(
columnDefinition
=
"int(11) COMMENT '影片ID'"
)
@Column
(
columnDefinition
=
"int(11) COMMENT '影片ID'"
)
private
Integer
film_id
;
private
Integer
film_id
;
@Column
(
columnDefinition
=
"int(11) COMMENT '影片NO'"
)
private
Integer
film_no
;
@Column
(
columnDefinition
=
"int(11) COMMENT '集数'"
)
@Column
(
columnDefinition
=
"int(11) COMMENT '集数'"
)
private
Integer
number
;
private
Integer
number
;
@Column
(
columnDefinition
=
"int(11) COMMENT '上传状态'"
)
@Column
(
columnDefinition
=
"int(11) COMMENT '上传状态
0未上传, 1上传中, 2已上传
'"
)
private
Integer
upload_state
;
private
Integer
upload_state
;
@Column
(
columnDefinition
=
"varchar(255) COMMENT '剧集名'"
)
@Column
(
columnDefinition
=
"varchar(255) COMMENT '剧集名'"
)
...
@@ -35,7 +38,7 @@ public class Fc_film_upload implements java.io.Serializable {
...
@@ -35,7 +38,7 @@ public class Fc_film_upload implements java.io.Serializable {
@Column
(
columnDefinition
=
"datetime COMMENT '完成上传时间'"
)
@Column
(
columnDefinition
=
"datetime COMMENT '完成上传时间'"
)
private
Date
upload_time
;
private
Date
upload_time
;
@Column
(
columnDefinition
=
"varchar(3
2
) COMMENT '上传进度'"
)
@Column
(
columnDefinition
=
"varchar(3
6
) COMMENT '上传进度'"
)
private
String
upload_progress
;
private
String
upload_progress
;
@Column
(
columnDefinition
=
"varchar(255) COMMENT '后台服务上传路径'"
)
@Column
(
columnDefinition
=
"varchar(255) COMMENT '后台服务上传路径'"
)
...
@@ -44,7 +47,7 @@ public class Fc_film_upload implements java.io.Serializable {
...
@@ -44,7 +47,7 @@ public class Fc_film_upload implements java.io.Serializable {
@Column
(
columnDefinition
=
"varchar(255) COMMENT '后台服务上传失败原因'"
)
@Column
(
columnDefinition
=
"varchar(255) COMMENT '后台服务上传失败原因'"
)
private
String
upload__error_message
;
private
String
upload__error_message
;
@Column
(
columnDefinition
=
"varchar(
64) COMMENT '后台服务上传
任务名称'"
)
@Column
(
columnDefinition
=
"varchar(
255) COMMENT '分配的
任务名称'"
)
private
String
taskName
;
private
String
taskName
;
...
@@ -64,6 +67,14 @@ public class Fc_film_upload implements java.io.Serializable {
...
@@ -64,6 +67,14 @@ public class Fc_film_upload implements java.io.Serializable {
return
film_id
;
return
film_id
;
}
}
public
void
setFilm_no
(
Integer
film_no
)
{
this
.
film_no
=
film_no
;
}
public
Integer
getFilm_no
()
{
return
film_no
;
}
public
void
setNumber
(
Integer
number
)
{
public
void
setNumber
(
Integer
number
)
{
this
.
number
=
number
;
this
.
number
=
number
;
}
}
...
...
src/main/java/com/egolm/film/util/FilmContrants.java
View file @
a812dd9b
...
@@ -5,4 +5,6 @@ public class FilmContrants {
...
@@ -5,4 +5,6 @@ public class FilmContrants {
public
static
int
UPLOAD_STATUS_ING
=
1
;
//上传中
public
static
int
UPLOAD_STATUS_ING
=
1
;
//上传中
public
static
int
UPLOAD_STATUS_COMPLETED
=
2
;
//上传完成
public
static
int
UPLOAD_STATUS_COMPLETED
=
2
;
//上传完成
public
static
int
UPLOAD_STATUS_FILE
=
3
;
//上传失败
public
static
int
UPLOAD_STATUS_FILE
=
3
;
//上传失败
public
static
int
UPLOAD_STATUS_ERROR
=
4
;
//数据异常
}
}
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