Commit 50016f92 authored by 张永's avatar 张永

1

parent 8e685394
......@@ -35,6 +35,7 @@ import com.egolm.film.bean.model.Fc_member_film_base_model;
import com.egolm.film.config.WebMvcConfig;
import com.egolm.film.config.XException;
import com.egolm.film.config.XRException;
import com.egolm.film.util.FilmContrants;
import com.egolm.film.util.SqlWhere;
......@@ -635,15 +636,25 @@ public class FilmServiceImpl implements FilmService {
@Override
public void updateFilmUploadState(String[] film_id,String[] number) {
if(film_id.length == number.length) {
List<Object[]> objs = new ArrayList<Object[]>();
List<Object[]> uploadObjs = new ArrayList<Object[]>();
List<Object[]> filmObjs = new ArrayList<Object[]>();
for(int i = 0; i < film_id.length; i++) {
objs.add(new Object[]{
uploadObjs.add(new Object[]{
FilmContrants.UPLOAD_STATUS_INIT,
film_id[i],
number[i]});
filmObjs.add(new Object[]{
FilmContrants.UPLOAD_STATUS_INIT,
film_id[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);
String updateSql = "update fc_film_upload set upload_state = ? ,upload__error_message= '',upload_progress='0%' where film_id = ? and number = ? ";
jdbcTemplate.batchUpdate(updateSql, uploadObjs);
String filmSql = "update fc_member_film set upload_state = ? where film_no = ? ";
jdbcTemplate.batchUpdate(filmSql, filmObjs);
}
}
}
......@@ -209,6 +209,22 @@ public class AdminFirstController {
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
@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