Commit 5adbdb9d authored by Quxl's avatar Quxl

Merge branch 'master' of

http://key@gitlab.egolm.com/hanxu/siff-film-api.git

Conflicts:
	src/main/java/com/egolm/film/api/web/admin/AdminFirstController.java
parents b9475773 d4c69c3c
......@@ -151,4 +151,8 @@ public interface FilmService {
void exchangeFilmNo(Integer id1, Integer id2);
void initKeywords(Long member_film_id);
List<Map<String, Object>> queryMonitorUploadList(String keyword,Integer upload_state, Page page);
public void updateFilmUploadState(String[] film_id,String[] number);
}
......@@ -617,5 +617,33 @@ public class FilmServiceImpl implements FilmService {
jdbcTemplate.executeUpdate("update fc_member_film set director_name = ?, keywords = ? where id = ?", directors, keywords, member_film_id);
}
@Override
public List<Map<String, Object>> queryMonitorUploadList(String keyword,Integer upload_state, Page page) {
SqlWhere w = new SqlWhere().lk(new String[]{"file_name", "film_id"}, keyword).eq("upload_state", upload_state);
String sql = "select * from fc_film_upload "+ StringUtil.join(" and ", " where ", "", "", w.getStringList());;
return jdbcTemplate.limit(sql, page, w.getObjectArray());
}
/**
* 批量修改上传状态 为 未上传
* @Title: updateFilmUploadState
* @Description: TODO(这里用一句话描述这个方法的作用)
* @param: @param film_id
* @param: @param number
* @return: void
* @throws
*/
@Override
public void updateFilmUploadState(String[] film_id,String[] number) {
if(film_id.length == number.length) {
List<Object[]> objs = new ArrayList<Object[]>();
for(int i = 0; i < film_id.length; i++) {
objs.add(new Object[]{
film_id[i],
number[i]});
}
String sql = "update fc_film_upload set upload_state = 0 ,upload__error_message= '',upload_progress='0%' where film_id = ? and number = ? ";
jdbcTemplate.batchUpdate(sql, objs);
}
}
}
......@@ -205,6 +205,23 @@ public class AdminFirstController {
return Rjx.jsonOk();
}
@ResponseBody
@PostMapping("upload_monitor")
@ApiOperation("影片上传监控列表")
@ApiImplicitParams({
@ApiImplicitParam(paramType="query", dataType="String", required=false, name="keyword", value="关键字"),
@ApiImplicitParam(paramType="query", dataType="int", required=false, name="upload_state", value="上传状态( 0未上传, 1上传中, 2已上传)"),
@ApiImplicitParam(paramType="query", dataType="long", required=true, name="index", value="分页编号"),
@ApiImplicitParam(paramType="query", dataType="long", required=true, name="limit", value="分页大小"),
})
public Object upload_monitor(String keyword,Integer upload_state,Long index, Long limit) {
index = index == null ? 1 : index;
limit = limit == null ? 20 : limit;
Page page = new Page(index, limit);
List<Map<String, Object>> list = filmService.queryMonitorUploadList(keyword,upload_state,page);
return Rjx.jsonOk().setData(list).setPage(page);
}
@ResponseBody
@PostMapping("update_state")
@ApiOperation("修改影片状态")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment