Commit e0512952 authored by 曲欣红's avatar 曲欣红
parents c601a456 2c1a25f5
...@@ -30,4 +30,6 @@ public interface AdminUserService { ...@@ -30,4 +30,6 @@ public interface AdminUserService {
void deleteUserById(Integer uid); void deleteUserById(Integer uid);
void deleteGroupById(Integer group_id);
} }
...@@ -28,7 +28,7 @@ public class AdminUserServiceImpl implements AdminUserService { ...@@ -28,7 +28,7 @@ public class AdminUserServiceImpl implements AdminUserService {
@Override @Override
public List<Map<String, Object>> queryGroupList(String keyword, Page page) { public List<Map<String, Object>> queryGroupList(String keyword, Page page) {
SqlWhere argEdit = new SqlWhere().lk(new String[]{"ug.group_id", "ug.group_name"}, keyword); SqlWhere argEdit = new SqlWhere().lk(new String[]{"ug.group_id", "ug.group_name"}, keyword);
String sql = "select ug.group_id, ug.group_name, count(u.uid) count, group_concat(ugf.fun_id) funs from fc_user_group ug, fc_user_group_fun ugf, fc_user u where ugf.group_id = ug.group_id and u.group_id = ug.group_id" + StringUtil.join(" and ", " and ", " ", " ", argEdit.getStringList()) + "group by ug.group_id, group_name"; String sql = "SELECT ug.group_id, ug.group_name, (select count(u.uid) from fc_user u where u.group_id = ug.group_id) count, (select group_concat(ugf.fun_id) from fc_user_group_fun ugf where ugf.group_id = ug.group_id group by ugf.group_id) funs FROM fc_user_group ug" + StringUtil.join(" and ", " where ", " ", " ", argEdit.getStringList()) ;
return jdbcTemplate.limit(sql, page, argEdit.getObjectList()); return jdbcTemplate.limit(sql, page, argEdit.getObjectList());
} }
...@@ -88,4 +88,9 @@ public class AdminUserServiceImpl implements AdminUserService { ...@@ -88,4 +88,9 @@ public class AdminUserServiceImpl implements AdminUserService {
jdbcTemplate.executeUpdate("delete from fc_user where uid = ?", uid); jdbcTemplate.executeUpdate("delete from fc_user where uid = ?", uid);
} }
@Override
public void deleteGroupById(Integer group_id) {
jdbcTemplate.executeUpdate("delete from fc_user_group where group_id = ?", group_id);
}
} }
...@@ -457,21 +457,12 @@ public class FilmServiceImpl implements FilmService { ...@@ -457,21 +457,12 @@ public class FilmServiceImpl implements FilmService {
@Override @Override
@Transactional @Transactional
public void toNextRound(Long member_film_id, Integer enroll_type_id) { public void toNextRound(Long member_film_id, Integer enroll_type_id) {
Fc_member_film_enroll enroll = this.jdbcTemplate.queryForBean("select * from fc_member_film_enroll where film_id = ? and enroll_type_id = ?", Fc_member_film_enroll.class, member_film_id, enroll_type_id); Integer count = jdbcTemplate.executeUpdate("update fc_review set review_round = review_round + 1 where film_id = ? and enroll_type_id = ?", member_film_id, enroll_type_id);
Integer round = enroll.getReview_round();
Integer nextRound = null;
if(round == null || round == 0) {
nextRound = 1;
} else {
nextRound = round + 1;
}
jdbcTemplate.executeUpdate("update fc_member_film_enroll set review_round = ? where film_id = ? and enroll_type_id = ?", nextRound, member_film_id, enroll_type_id);
Integer count = jdbcTemplate.queryForInt("select count(id) from fc_review where film_id = ? and review_round = ? and enroll_type_id = ?", member_film_id, nextRound, enroll_type_id);
if(count == 0) { if(count == 0) {
Fc_review review = new Fc_review(); Fc_review review = new Fc_review();
review.setEnroll_type_id(enroll_type_id); review.setEnroll_type_id(enroll_type_id);
review.setFilm_id(member_film_id.intValue()); review.setFilm_id(member_film_id.intValue());
review.setReview_round(nextRound); review.setReview_round(1);
review.setReview_state(0); review.setReview_state(0);
review.setCreate_time(new Date()); review.setCreate_time(new Date());
jdbcTemplate.save(review); jdbcTemplate.save(review);
......
...@@ -59,9 +59,6 @@ public class AdminUserController { ...@@ -59,9 +59,6 @@ public class AdminUserController {
@ApiOperation("查询分组及分组权限") @ApiOperation("查询分组及分组权限")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(paramType="query", dataType="int", required=false, name="group_id", value="分组ID"), @ApiImplicitParam(paramType="query", dataType="int", required=false, name="group_id", value="分组ID"),
@ApiImplicitParam(paramType="query", dataType="string", required=true, name="group_name", value="分组名称"),
@ApiImplicitParam(paramType="query", dataType="string", required=true, name="job_desc", value="工作介绍"),
@ApiImplicitParam(paramType="query", dataType="int", required=true, name="fun_id", value="权限[功能]ID [1-6]选权限,7快进后退权限"),
}) })
public Rjx groupDetail(Integer group_id) { public Rjx groupDetail(Integer group_id) {
Fc_user_group group = service.queryGroupById(group_id); Fc_user_group group = service.queryGroupById(group_id);
...@@ -160,10 +157,22 @@ public class AdminUserController { ...@@ -160,10 +157,22 @@ public class AdminUserController {
@PostMapping("user_delete") @PostMapping("user_delete")
@ApiOperation("删除评委") @ApiOperation("删除评委")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(paramType="query", dataType="int", required=false, name="uid", value="评委ID"), @ApiImplicitParam(paramType="query", dataType="int", required=true, name="uid", value="评委ID"),
}) })
public Rjx deleteUser(Integer uid) { public Rjx deleteUser(Integer uid) {
service.deleteUserById(uid); service.deleteUserById(uid);
return Rjx.jsonOk(); return Rjx.jsonOk();
} }
@ResponseBody
@Transactional
@PostMapping("group_delete")
@ApiOperation("删除评委组")
@ApiImplicitParams({
@ApiImplicitParam(paramType="query", dataType="int", required=true, name="group_id", value="评委组ID"),
})
public Rjx deleteGroup(Integer group_id) {
service.deleteGroupById(group_id);
return Rjx.jsonOk();
}
} }
...@@ -18,8 +18,6 @@ public class Fc_member_film_enroll implements java.io.Serializable { ...@@ -18,8 +18,6 @@ public class Fc_member_film_enroll implements java.io.Serializable {
@Id @Id
private Integer enroll_type_id; private Integer enroll_type_id;
private Integer review_round;
/** /**
* 无参数构造方法 * 无参数构造方法
...@@ -32,12 +30,10 @@ public class Fc_member_film_enroll implements java.io.Serializable { ...@@ -32,12 +30,10 @@ public class Fc_member_film_enroll implements java.io.Serializable {
* 全参数构造方法 * 全参数构造方法
* @param film_id * @param film_id
* @param enroll_type_id * @param enroll_type_id
* @param review_round
*/ */
public Fc_member_film_enroll(Integer film_id, Integer enroll_type_id, Integer review_round) { public Fc_member_film_enroll(Integer film_id, Integer enroll_type_id) {
this.film_id = film_id; this.film_id = film_id;
this.enroll_type_id = enroll_type_id; this.enroll_type_id = enroll_type_id;
this.review_round = review_round;
} }
public void setFilm_id(Integer film_id) { public void setFilm_id(Integer film_id) {
...@@ -56,13 +52,5 @@ public class Fc_member_film_enroll implements java.io.Serializable { ...@@ -56,13 +52,5 @@ public class Fc_member_film_enroll implements java.io.Serializable {
return enroll_type_id; return enroll_type_id;
} }
public void setReview_round(Integer review_round) {
this.review_round = review_round;
}
public Integer getReview_round() {
return review_round;
}
} }
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