Commit 360421f8 authored by Quxl's avatar Quxl

x

parent bbd113f8
......@@ -19,6 +19,7 @@ import com.egolm.film.bean.Fc_review;
import com.egolm.film.bean.Fc_review_doubtful;
import com.egolm.film.bean.Fc_review_record;
import com.egolm.film.bean.Fc_review_record_ext;
import com.egolm.film.config.XRException;
import com.egolm.film.util.SqlWhere;
@Service
......@@ -208,17 +209,22 @@ public class ReviewServiceImpl implements ReviewService {
@Override
@Transactional
public void toFirstRound(Long member_film_id, Integer enroll_type_id) {
Date now = new Date();
Fc_review review = new Fc_review();
review.setEnroll_type_id(enroll_type_id);
review.setFilm_id(member_film_id.intValue());
review.setReview_round(1);
review.setPush_time(now);
review.setAllot_state(0);
review.setState(0);
review.setReview_state(null);
review.setCreate_time(now);
jdbcTemplate.save(review);
Integer count = jdbcTemplate.queryForInt("select count(id) from fc_review where film_id = ?", member_film_id);
if(count == 0) {
Date now = new Date();
Fc_review review = new Fc_review();
review.setEnroll_type_id(enroll_type_id);
review.setFilm_id(member_film_id.intValue());
review.setReview_round(1);
review.setPush_time(now);
review.setAllot_state(0);
review.setState(0);
review.setReview_state(null);
review.setCreate_time(now);
jdbcTemplate.save(review);
} else {
throw new XRException("该影已存在审片流程");
}
}
@Override
......
package com.egolm.film.api.web.admin;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
......@@ -9,6 +11,8 @@ import org.springframework.web.bind.annotation.ResponseBody;
import com.egolm.common.bean.Rjx;
import com.egolm.common.jdbc.JdbcTemplate;
import com.egolm.film.api.service.ReviewService;
import com.egolm.film.bean.Fc_member_film;
import com.egolm.film.config.XRException;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
......@@ -31,4 +35,35 @@ public class WebUtilController {
service.tryNextRound(review_id);
return Rjx.jsonOk();
}
@ResponseBody
@PostMapping("initAllReview")
@ApiOperation("初始化所有审片流程")
public Object initAllReview() {
jdbcTemplate.executeUpdate("delete from fc_review");
jdbcTemplate.executeUpdate("delete from fc_review_record");
jdbcTemplate.executeUpdate("delete from fc_review_record_ext");
List<Fc_member_film> films = jdbcTemplate.queryForBeans("select * from fc_member_film where apply_state = 2", Fc_member_film.class);
Integer enroll_1_2 = null;
for(Fc_member_film film : films) {
String enroll_type_name = film.getEnroll_type_name();
String[] enrolls = enroll_type_name.split(",");
for(String enroll_str : enrolls) {
Integer enroll_type_id = Integer.valueOf(enroll_str);
if(enroll_type_id == 1 || enroll_type_id == 2) {
if(enroll_1_2 == null) {
enroll_1_2 = enroll_type_id;
} else {
throw new XRException("不能同时申请亚新和金爵流程");
}
}
}
if(enroll_1_2 != null) {
service.toFirstRound(film.getId(), enroll_1_2);
} else {
service.toFirstRound(film.getId(), 4);
}
}
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