Commit d4c69c3c authored by 张永's avatar 张永

增加上传监控接口

parent 0520e2c8
...@@ -151,4 +151,8 @@ public interface FilmService { ...@@ -151,4 +151,8 @@ public interface FilmService {
void exchangeFilmNo(Integer id1, Integer id2); void exchangeFilmNo(Integer id1, Integer id2);
void initKeywords(Long member_film_id); 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 { ...@@ -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); 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);
}
}
} }
...@@ -204,6 +204,41 @@ public class AdminFirstController { ...@@ -204,6 +204,41 @@ public class AdminFirstController {
return Rjx.jsonOk(); 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("batch_update_state")
@ApiOperation("批量修改上传列表状态")
@ApiImplicitParams({
@ApiImplicitParam(paramType="query", dataType="int", allowMultiple=true, required=true, name="film_id", value="影片ID"),
@ApiImplicitParam(paramType="query", dataType="int", allowMultiple=true, required=true, name="number", value="第几集"),
})
public Object batch_update_state(HttpServletRequest req) {
String[] film_id = req.getParameterValues("film_id");
String[] number = req.getParameterValues("number");
filmService.updateFilmUploadState(film_id, number);
return Rjx.jsonOk();
}
@ResponseBody @ResponseBody
@PostMapping("exchangeFilmNo") @PostMapping("exchangeFilmNo")
@ApiOperation("交换影片编号, id1影片会被更新初审待审核状态,id2影片会被更新为初审否决状态") @ApiOperation("交换影片编号, id1影片会被更新初审待审核状态,id2影片会被更新为初审否决状态")
......
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