Commit b304a3f7 authored by Quxl's avatar Quxl

x

parent 86ac5271
......@@ -92,12 +92,14 @@ public interface ReviewService {
void saveReviewRecordIfNotExists(Integer review_id, Integer review_round, Integer[] user_id);
void deleteReviewRecord(Integer review_id, Integer review_round, Integer[] user_id);
void deleteDoubtfulById(Integer id);
Map<String, Object> queryReviewRecordMapById(Integer record_id);
Fc_review queryReview(int film_id);
public List<Map<String, Object>> queryUserGroupListByReviewRecord(int enroll_type_id, Integer review_round);
List<Map<String, Object>> queryUserGroupListByReviewRecord(int enroll_type_id, Integer review_round);
}
\ No newline at end of file
......@@ -674,6 +674,16 @@ public class ReviewServiceImpl implements ReviewService {
jdbcTemplate.executeUpdate("update fc_review set allot_state = 1, opt_state = 0 where id = ? and review_round = ?", review_id, review_round);
}
@Override
public void deleteReviewRecord(Integer review_id, Integer review_round, Integer[] user_id) {
String sql = "delete from fc_review_record where review_id = ? and review_round = ? and user_id = ? and review_state is null";
Object[][] objs = new Object[user_id.length][];
for(int i = 0; i < objs.length; i++) {
objs[i] = new Object[]{review_id, review_round, user_id[i]};
}
jdbcTemplate.batchUpdate(sql, objs);
}
@Override
public void deleteDoubtfulById(Integer id) {
jdbcTemplate.executeUpdate("delete from fc_review_doubtful where id = ?", id);
......
......@@ -133,12 +133,17 @@ public class AdminReviewController {
@PostMapping("allot")
@ApiOperation("分配审片评委")
@ApiImplicitParams({
@ApiImplicitParam(paramType="query", dataType="boolean", required=true, name="is_cancel", value="是否取消分配", defaultValue="false"),
@ApiImplicitParam(paramType="query", dataType="int", required=true, name="review_id", value="审片主表ID"),
@ApiImplicitParam(paramType="query", dataType="int", required=true, name="review_round", value="分配评委的审片环节"),
@ApiImplicitParam(paramType="query", dataType="int", required=true, name="user_id", value="审片评委ID", allowMultiple=true),
})
public Object allot(Integer review_id, Integer review_round, Integer[] user_id) {
public Object allot(Boolean is_cancel, Integer review_id, Integer review_round, Integer[] user_id) {
if(!is_cancel) {
reviewService.saveReviewRecordIfNotExists(review_id, review_round, user_id);
} else {
reviewService.deleteReviewRecord(review_id, review_round, user_id);
}
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