Commit 2c3d0d0b authored by Quxl's avatar Quxl

x

parent 70c1b8ba
......@@ -146,4 +146,6 @@ public interface FilmService {
void saveCreateBase(Long id, Integer admin_id, Integer member_id, String create_ip);
void exchangeFilmNo(Integer id1, Integer id2);
}
......@@ -658,4 +658,18 @@ public class FilmServiceImpl implements FilmService {
jdbcTemplate.executeUpdate("update fc_member_film set admin_creator = ?, member_id = ?, create_ip = ?, create_time = ?, last_modify_time = ? where id = ?", admin_id, member_id, create_ip, now, now, id);
}
@Override
@Transactional
public void exchangeFilmNo(Integer id1, Integer id2) {
Fc_member_film f1 = jdbcTemplate.queryForBean("select id, film_no from fc_member_film where id = ?", Fc_member_film.class, id1);
Fc_member_film f2 = jdbcTemplate.queryForBean("select id, film_no from fc_member_film where id = ?", Fc_member_film.class, id2);
jdbcTemplate.batchUpdate("update fc_member_film set film_no = ? where id = ?", new Object[][]{ {f1.getFilm_no(), id2}, {f2.getFilm_no(), id1}});
jdbcTemplate.batchUpdate("update fc_member_film set apply_state = ? where id = ?", new Object[][] {{1, id1}, {3, id2}});
jdbcTemplate.batchUpdate("delete from fc_review_record_ext where record_id in (select id from fc_review_record where review_id in (select id from fc_review where film_id = ?))", new Object[][]{{id1}, {id2}});
jdbcTemplate.batchUpdate("delete from fc_review_record where review_id in (select id from fc_review where film_id = ?)", new Object[][]{{id1}, {id2}});
jdbcTemplate.batchUpdate("delete from fc_review_history where review_id in (select id from fc_review where film_id = ?)", new Object[][]{{id1}, {id2}});
jdbcTemplate.batchUpdate("delete from fc_review where id = ?", new Object[][]{{id1}, {id2}});
}
}
......@@ -201,4 +201,17 @@ public class AdminFirstController {
memberFilmService.updateFilmState(member_film_id, state);
return Rjx.jsonOk();
}
@ResponseBody
@PostMapping("exchangeFilmNo")
@ApiOperation("交换影片编号")
@ApiImplicitParams({
@ApiImplicitParam(paramType="query", dataType="long", required=true, name="member_film_id", value="影片ID"),
@ApiImplicitParam(paramType="query", dataType="int", required=true, name="state", value="影片状态:1未提交 2已提交"),
})
public Object exchangeFilmNo(Integer id1, Integer id2) {
memberFilmService.exchangeFilmNo(id1, id2);
return Rjx.jsonOk();
}
}
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