Commit 95c693c5 authored by 张永's avatar 张永
parents 4d17788e 26e6a63a
......@@ -93,9 +93,9 @@ public interface FilmService {
List<Map<String, Object>> queryListAll(String keyword);
List<Map<String, Object>> queryChuShenList(String keyword, Integer state, Integer apply_state, Integer upload_state, Integer film_type, Integer enroll_type, String film_country, Page page);
List<Map<String, Object>> queryChuShenList(String keyword, Integer state, Integer apply_state, Integer upload_state, Integer film_type, Integer enroll_type, String film_country, Integer film_type_short, Page page);
void pass(Long member_film_id);
Integer pass(Long member_film_id);
void reject(Long member_film_id, String apply_state_intro);
......
......@@ -26,4 +26,6 @@ public interface ReviewService {
void saveReviewRecord(Fc_review_record ru, List<Fc_review_record_ext> exts);
List<Fc_review_record_ext> queryReviewRecordExtList(Integer record_id);
}
\ No newline at end of file
......@@ -367,19 +367,21 @@ public class FilmServiceImpl implements FilmService {
}
@Override
public List<Map<String, Object>> queryChuShenList(String keyword, Integer state, Integer apply_state, Integer upload_state, Integer film_type, Integer enroll_type, String film_country, Page page) {
SqlWhere where = new SqlWhere().lk(new String[]{"mf.en_name", "mf.cn_name"}, keyword).eq("mf.state", state).eq("mf.apply_state", apply_state).eq("mf.upload_state", upload_state).lk("mf.enroll_type_name", enroll_type).eq("mf.film_type_name", film_type).eq("mf.film_country", film_country);
public List<Map<String, Object>> queryChuShenList(String keyword, Integer state, Integer apply_state, Integer upload_state, Integer film_type, Integer enroll_type, String film_country, Integer film_type_short, Page page) {
SqlWhere where = new SqlWhere().lk(new String[]{"mf.en_name", "mf.cn_name"}, keyword).eq("mf.state", state).eq("mf.apply_state", apply_state).eq("mf.upload_state", upload_state).lk("mf.enroll_type_name", enroll_type).eq("mf.film_type_name", film_type).eq("mf.film_type_name_short", film_type_short).eq("mf.film_country", film_country);
String sql = "select mf.*, ifnull(rv.review_state, 0) review_state, (select GROUP_CONCAT(mfd.playactor_name) from fc_member_film_playactor mfd where mfd.film_id = mf.id and mfd.playactor_type = 'director') director_name from fc_member_film mf left join fc_review rv on rv.film_id = mf.id" + StringUtil.join(" and ", " where ", "", "", where.getStringList());
Object[] objs = where.getObjectList();
page.setLimitKey("mf.film_no");
return jdbcTemplate.limit(sql, page, objs);
}
@Override
public synchronized void pass(Long member_film_id) {
public synchronized Integer pass(Long member_film_id) {
this.updateEnroll(member_film_id);
Integer film_no = jdbcTemplate.queryForInt("select ifnull(max(film_no), 0) + 1 from fc_member_film");
String sql = "update fc_member_film set film_no = ?, apply_state = ?, upload_state = ?, pass_time = ? where id = ?";
jdbcTemplate.executeUpdate(sql, film_no, 2, 0, System.currentTimeMillis()/1000L, member_film_id);
return film_no;
}
@Override
......
......@@ -27,7 +27,8 @@ public class ReviewServiceImpl implements ReviewService {
@Override
public List<Map<String, Object>> queryReviewList(boolean is_review, Integer user_id, Date push_date, Integer film_type_id, Integer enroll_type_id, String keyword, Page page) {
SqlWhere where = new SqlWhere().eq("r.enroll_type_id", enroll_type_id).lk(new String[]{"en_name", "cn_name"}, keyword);
List<Integer> ids = jdbcTemplate.queryForObjects("select ugf.fun_id from fc_user_group_fun ugf, fc_user u where ugf.group_id = u.group_id", Integer.class, user_id);
SqlWhere where = new SqlWhere().in("r.review_round", ids.toArray()).eq("r.enroll_type_id", enroll_type_id).lk(new String[]{"en_name", "cn_name"}, keyword);
if(is_review) {
where.ge("r.review_state", 2);
} else {
......@@ -56,7 +57,8 @@ public class ReviewServiceImpl implements ReviewService {
+ "where "
+ " mf.id = r.film_id "
+ "and r.id = rr.review_id "
+ "and r.review_round = rr.review_round"
+ "and r.review_round = rr.review_round "
+ "and r.review_round in ()"
+ "and rr.user_id = " + user_id
+ StringUtil.join(" and ", " and ", "", "", where.getStringList());
return jdbcTemplate.limit(sql, page, where.getObjectList());
......@@ -86,7 +88,8 @@ public class ReviewServiceImpl implements ReviewService {
@Override
public Fc_review_record queryReviewRecord(Integer user_id, Integer review_id) {
return jdbcTemplate.queryForBean("select * from fc_review_record where user_id = ? and review_id = ?", Fc_review_record.class, user_id, review_id);
String sql = "select rr.* from fc_review_record rr, fc_review r where rr.user_id = ? and rr.review_id = ? and rr.review_id = r.id and rr.review_round = r.review_round";
return jdbcTemplate.queryForBean(sql, Fc_review_record.class, user_id, review_id);
}
@Override
......@@ -97,4 +100,9 @@ public class ReviewServiceImpl implements ReviewService {
jdbcTemplate.batchSave(exts);
}
@Override
public List<Fc_review_record_ext> queryReviewRecordExtList(Integer record_id) {
return jdbcTemplate.queryForBeans("select * from fc_review_record_ext where record_id = ?", Fc_review_record_ext.class, record_id);
}
}
......@@ -65,16 +65,17 @@ public class AdminFirstController {
@ApiImplicitParam(paramType="query", dataType="int", required=false, name="state", value="影片状态[state=1 未提交, state=2 已提交]"),
@ApiImplicitParam(paramType="query", dataType="int", required=false, name="apply_state", value="初审状态[apply_state=1 未初审, apply_state=2 初审通过, apply_state=3 初审未通过]"),
@ApiImplicitParam(paramType="query", dataType="int", required=false, name="film_type", value="影片类型"),
@ApiImplicitParam(paramType="query", dataType="int", required=false, name="film_type_short"),
@ApiImplicitParam(paramType="query", dataType="int", required=false, name="enroll_type", value="影片性质"),
@ApiImplicitParam(paramType="query", dataType="string", required=false, name="film_country",value="影片国家地区"),
@ApiImplicitParam(paramType="query", dataType="long", required=true, name="index", value="分页编号"),
@ApiImplicitParam(paramType="query", dataType="long", required=true, name="limit", value="分页大小"),
})
public Object list(String keyword, Integer state, Integer apply_state, Integer film_type, Integer enroll_type, String film_country, Long index, Long limit) {
public Object list(String keyword, Integer state, Integer apply_state, Integer film_type, Integer enroll_type, String film_country, Integer film_type_short, Long index, Long limit) {
index = index == null ? 1 : index;
limit = limit == null ? 20 : limit;
Page page = new Page(index, limit);
List<Map<String, Object>> list = memberFilmService.queryChuShenList(keyword, state, apply_state, null, film_type, enroll_type, film_country, page);
List<Map<String, Object>> list = memberFilmService.queryChuShenList(keyword, state, apply_state, null, film_type, enroll_type, film_country, film_type_short, page);
return Rjx.jsonOk().setData(list).setPage(page);
}
......@@ -84,17 +85,18 @@ public class AdminFirstController {
@ApiImplicitParams({
@ApiImplicitParam(paramType="query", dataType="string", required=false, name="keyword", value="关键字"),
@ApiImplicitParam(paramType="query", dataType="int", required=false, name="film_type", value="影片类型"),
@ApiImplicitParam(paramType="query", dataType="int", required=false, name="film_type_short"),
@ApiImplicitParam(paramType="query", dataType="int", required=false, name="enroll_type", value="影片性质"),
@ApiImplicitParam(paramType="query", dataType="string", required=false, name="film_country",value="影片国家地区"),
@ApiImplicitParam(paramType="query", dataType="int", required=false, name="upload_state",value="影片文件上传状态(0,1)"),
@ApiImplicitParam(paramType="query", dataType="long", required=true, name="index", value="分页编号"),
@ApiImplicitParam(paramType="query", dataType="long", required=true, name="limit", value="分页大小"),
})
public Object pass_list(String keyword, Integer film_type, Integer enroll_type, Integer upload_state, String film_country, Long index, Long limit) {
public Object pass_list(String keyword, Integer film_type, Integer enroll_type, Integer upload_state, String film_country, Integer film_type_short, Long index, Long limit) {
index = index == null ? 1 : index;
limit = limit == null ? 20 : limit;
Page page = new Page(index, limit);
List<Map<String, Object>> list = memberFilmService.queryChuShenList(keyword, 2, 2, upload_state,film_type, enroll_type, film_country, page);
List<Map<String, Object>> list = memberFilmService.queryChuShenList(keyword, 2, 2, upload_state,film_type, enroll_type, film_country, film_type_short, page);
return Rjx.jsonOk().setData(list).setPage(page);
}
......@@ -143,7 +145,7 @@ public class AdminFirstController {
String film_no = StringUtil.formatLength(memberFilm.getFilm_no(), "0000");
content = MessageFormat.format(content, member.getUsername(), film_no, filmName == null ? "" : filmName);
emailService.send(subject, content, member.getEmail());
return Rjx.jsonOk().set("email", member.getEmail());
return Rjx.jsonOk().set("email", member.getEmail()).set("film_no", memberFilm.getFilm_no());
}
@ResponseBody
......
......@@ -53,14 +53,13 @@ public class UserReviewController {
@ApiImplicitParam(paramType = "query", dataType = "string", required = false, name = "keyword", value="模糊匹配关键词"),
@ApiImplicitParam(paramType = "query", dataType = "long", required = false, name = "index", value="分页页码"),
@ApiImplicitParam(paramType = "query", dataType = "long", required = false, name = "limit", value="分页大小"),
@ApiImplicitParam(paramType = "query", dataType = "string", required = false, name = "limitKey", value="分页排序", allowMultiple=true),
})
public Object getReviewList(boolean is_review, Date push_date, Integer film_type_id, Integer enroll_type_id, String keyword, Long index, Long limit, String[] limitKey) {
public Object getReviewList(boolean is_review, Date push_date, Integer film_type_id, Integer enroll_type_id, String keyword, Long index, Long limit) {
index = index == null ? 1 : index;
limit = limit == null ? 20 : limit;
Page page = new Page(index, limit);
LoginToken loginToken = tokenService.getToken();
Integer user_id = (Integer)loginToken.getId();
Page page = new Page(index, limit, limitKey);
List<Map<String, Object>> list = service.queryReviewList(is_review, user_id, push_date, film_type_id, enroll_type_id, keyword, page);
return Rjx.jsonOk().setData(list).setPage(page);
}
......@@ -147,4 +146,19 @@ public class UserReviewController {
return Rjx.jsonOk();
}
@ResponseBody
@Transactional
@PostMapping("getReviewRecord")
@ApiOperation("查询审片详情")
@ApiImplicitParams({
@ApiImplicitParam(paramType = "query", dataType = "int", required = false, name = "review_id", value="审片ID"),
})
public Object saveReviewRecord(Integer review_id) {
LoginToken token = tokenService.getToken();
Integer user_id = (Integer)token.getId();
Fc_review_record record = service.queryReviewRecord(user_id, review_id);
List<Fc_review_record_ext> extList = service.queryReviewRecordExtList(record.getId());
return Rjx.jsonOk().setData(record).set("exts", extList);
}
}
......@@ -28,6 +28,10 @@ public class ExceptionHandler implements HandlerExceptionResolver {
if(rjx.getCode() == 200) {
displayInLog = false;
}
if(rjx.getCode() == 300) {
displayInLog = false;
logger.debug(ex.getMessage());
}
} else {
mav.addAllObjects(Rjx.jsonErr().setMessage("未处理异常[" + ex.getClass().getName() + ":" + ex.getMessage() + "]"));
}
......
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