Commit 233f2abe authored by Quxl's avatar Quxl

x

parent 6c1e2d00
......@@ -134,8 +134,6 @@ public interface FilmService {
void updateEnroll(Long member_film_id);
void saveReviewRecordIfNotExists(Integer review_id, Integer review_round, Integer[] user_id);
void saveUploadId(Long member_film_id, String upload_id);
void saveUploadState(Long member_film_id, Integer upload_state);
......
......@@ -83,5 +83,7 @@ public interface ReviewService {
void toNextRound(Integer review_id);
void tryNextRound(Integer review_id);
void saveReviewRecordIfNotExists(Integer review_id, Integer review_round, Integer[] user_id);
}
\ No newline at end of file
......@@ -580,22 +580,6 @@ public class FilmServiceImpl implements FilmService {
}
}
@Override
@Transactional
public void saveReviewRecordIfNotExists(Integer review_id, Integer review_round, Integer[] user_id) {
String sql = ""
+ "insert into fc_review_record"
+ "(review_id, user_id, review_round, view_state, create_time) select ?, ?, ?, 0, now() from dual "
+ "where "
+ "not exists (select * from fc_review_record where review_id = ? and user_id = ? and review_round = ?)";
Object[][] objs = new Object[user_id.length][];
for(int i = 0; i < objs.length; i++) {
objs[i] = new Object[]{review_id, user_id[i], review_round, review_id, user_id[i], review_round};
}
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);
}
@Override
public void saveUploadId(Long member_film_id, String upload_id) {
jdbcTemplate.executeUpdate("update fc_member_film set upload_id = ?, upload_time = ? where id = ?", upload_id, new Date(), member_film_id);
......
......@@ -295,4 +295,20 @@ public class ReviewServiceImpl implements ReviewService {
}
}
}
@Override
@Transactional
public void saveReviewRecordIfNotExists(Integer review_id, Integer review_round, Integer[] user_id) {
String sql = ""
+ "insert into fc_review_record"
+ "(review_id, user_id, review_round, view_state, create_time) select ?, ?, ?, 0, now() from dual "
+ "where "
+ "not exists (select * from fc_review_record where review_id = ? and user_id = ? and review_round = ?)";
Object[][] objs = new Object[user_id.length][];
for(int i = 0; i < objs.length; i++) {
objs[i] = new Object[]{review_id, user_id[i], review_round, review_id, user_id[i], review_round};
}
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);
}
}
......@@ -13,7 +13,6 @@ import com.egolm.common.bean.Rjx;
import com.egolm.common.jdbc.Page;
import com.egolm.film.api.service.AdminTokenService;
import com.egolm.film.api.service.AdminUserService;
import com.egolm.film.api.service.FilmService;
import com.egolm.film.api.service.ReviewService;
import com.egolm.film.bean.Fc_admin;
......@@ -27,9 +26,6 @@ import io.swagger.annotations.ApiOperation;
@RequestMapping("admin/review")
public class AdminReviewController {
@Autowired
FilmService filmService;
@Autowired
ReviewService reviewService;
......@@ -85,7 +81,7 @@ public class AdminReviewController {
@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) {
filmService.saveReviewRecordIfNotExists(review_id, review_round, user_id);
reviewService.saveReviewRecordIfNotExists(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