Commit b304a3f7 authored by Quxl's avatar Quxl

x

parent 86ac5271
...@@ -91,6 +91,8 @@ public interface ReviewService { ...@@ -91,6 +91,8 @@ public interface ReviewService {
void tryNextRound(Integer review_id); void tryNextRound(Integer review_id);
void saveReviewRecordIfNotExists(Integer review_id, Integer review_round, Integer[] user_id); 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); void deleteDoubtfulById(Integer id);
...@@ -98,6 +100,6 @@ public interface ReviewService { ...@@ -98,6 +100,6 @@ public interface ReviewService {
Fc_review queryReview(int film_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
...@@ -673,6 +673,16 @@ public class ReviewServiceImpl implements ReviewService { ...@@ -673,6 +673,16 @@ public class ReviewServiceImpl implements ReviewService {
jdbcTemplate.batchUpdate(sql, objs); jdbcTemplate.batchUpdate(sql, objs);
jdbcTemplate.executeUpdate("update fc_review set allot_state = 1, opt_state = 0 where id = ? and review_round = ?", review_id, review_round); 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 @Override
public void deleteDoubtfulById(Integer id) { public void deleteDoubtfulById(Integer id) {
......
...@@ -133,12 +133,17 @@ public class AdminReviewController { ...@@ -133,12 +133,17 @@ public class AdminReviewController {
@PostMapping("allot") @PostMapping("allot")
@ApiOperation("分配审片评委") @ApiOperation("分配审片评委")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(paramType="query", dataType="int", required=true, name="review_id", value="审片主表ID"), @ApiImplicitParam(paramType="query", dataType="boolean", required=true, name="is_cancel", value="是否取消分配", defaultValue="false"),
@ApiImplicitParam(paramType="query", dataType="int", required=true, name="review_round", value="分配评委的审片环节"), @ApiImplicitParam(paramType="query", dataType="int", required=true, name="review_id", value="审片主表ID"),
@ApiImplicitParam(paramType="query", dataType="int", required=true, name="user_id", value="审片评委ID", allowMultiple=true), @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) {
reviewService.saveReviewRecordIfNotExists(review_id, review_round, 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(); 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