Commit d673e20f authored by Quxl's avatar Quxl

x

parent 0f7b23ed
...@@ -7,7 +7,8 @@ import com.egolm.common.jdbc.Page; ...@@ -7,7 +7,8 @@ import com.egolm.common.jdbc.Page;
import com.egolm.film.bean.Fc_user; import com.egolm.film.bean.Fc_user;
import com.egolm.film.bean.Fc_user_group; import com.egolm.film.bean.Fc_user_group;
import com.egolm.film.bean.Fc_user_group_enroll; import com.egolm.film.bean.Fc_user_group_enroll;
import com.egolm.film.bean.Fc_user_group_fun; import com.egolm.film.bean.Fc_user_group_funs;
import com.egolm.film.bean.Fc_user_group_round;
public interface AdminUserService { public interface AdminUserService {
...@@ -23,13 +24,17 @@ public interface AdminUserService { ...@@ -23,13 +24,17 @@ public interface AdminUserService {
void changePassword(Integer uid, String password); void changePassword(Integer uid, String password);
void saveGroupFun(Integer group_id, Integer[] fun_id); void saveGroupFuns(Integer group_id, Integer[] funs);
void saveGroupRound(Integer group_id, Integer[] rounds);
void saveGroupEnroll(Integer group_id, Integer[] enroll_types); void saveGroupEnroll(Integer group_id, Integer[] enroll_types);
Fc_user_group queryGroupById(Integer group_id); Fc_user_group queryGroupById(Integer group_id);
List<Fc_user_group_fun> queryGroupFunList(Integer group_id); List<Fc_user_group_funs> queryGroupFunList(Integer group_id);
List<Fc_user_group_round> queryGroupRoundList(Integer group_id);
List<Fc_user_group_enroll> queryGroupEnrollList(Integer group_id); List<Fc_user_group_enroll> queryGroupEnrollList(Integer group_id);
......
...@@ -16,7 +16,8 @@ import com.egolm.film.api.service.AdminUserService; ...@@ -16,7 +16,8 @@ import com.egolm.film.api.service.AdminUserService;
import com.egolm.film.bean.Fc_user; import com.egolm.film.bean.Fc_user;
import com.egolm.film.bean.Fc_user_group; import com.egolm.film.bean.Fc_user_group;
import com.egolm.film.bean.Fc_user_group_enroll; import com.egolm.film.bean.Fc_user_group_enroll;
import com.egolm.film.bean.Fc_user_group_fun; import com.egolm.film.bean.Fc_user_group_funs;
import com.egolm.film.bean.Fc_user_group_round;
import com.egolm.film.util.Common; import com.egolm.film.util.Common;
import com.egolm.film.util.SqlWhere; import com.egolm.film.util.SqlWhere;
...@@ -65,11 +66,11 @@ public class AdminUserServiceImpl implements AdminUserService { ...@@ -65,11 +66,11 @@ public class AdminUserServiceImpl implements AdminUserService {
@Override @Override
@Transactional @Transactional
public void saveGroupFun(Integer group_id, Integer[] fun_id) { public void saveGroupFuns(Integer group_id, Integer[] fun_id) {
jdbcTemplate.executeUpdate("delete from fc_user_group_fun where group_id = ?", group_id); jdbcTemplate.executeUpdate("delete from fc_user_group_funs where group_id = ?", group_id);
List<Fc_user_group_fun> list = new ArrayList<Fc_user_group_fun>(); List<Fc_user_group_funs> list = new ArrayList<Fc_user_group_funs>();
for(Integer i : fun_id) { for(Integer i : fun_id) {
Fc_user_group_fun gf = new Fc_user_group_fun(); Fc_user_group_funs gf = new Fc_user_group_funs();
gf.setGroup_id(group_id); gf.setGroup_id(group_id);
gf.setFun_id(i); gf.setFun_id(i);
list.add(gf); list.add(gf);
...@@ -77,6 +78,20 @@ public class AdminUserServiceImpl implements AdminUserService { ...@@ -77,6 +78,20 @@ public class AdminUserServiceImpl implements AdminUserService {
jdbcTemplate.batchSave(list); jdbcTemplate.batchSave(list);
} }
@Override
public void saveGroupRound(Integer group_id, Integer[] rounds) {
if(rounds != null && rounds.length > 0) {
List<Fc_user_group_round> objs = new ArrayList<Fc_user_group_round>();
for(Integer round : rounds) {
Fc_user_group_round type = new Fc_user_group_round();
type.setGroup_id(group_id);
type.setReview_round(round);
objs.add(type);
}
jdbcTemplate.batchSave(objs);
}
}
@Override @Override
public void saveGroupEnroll(Integer group_id, Integer[] enroll_types) { public void saveGroupEnroll(Integer group_id, Integer[] enroll_types) {
if(enroll_types != null && enroll_types.length > 0) { if(enroll_types != null && enroll_types.length > 0) {
...@@ -97,8 +112,13 @@ public class AdminUserServiceImpl implements AdminUserService { ...@@ -97,8 +112,13 @@ public class AdminUserServiceImpl implements AdminUserService {
} }
@Override @Override
public List<Fc_user_group_fun> queryGroupFunList(Integer group_id) { public List<Fc_user_group_funs> queryGroupFunList(Integer group_id) {
return jdbcTemplate.queryForBeans("select * from fc_user_group_fun where group_id = ?", Fc_user_group_fun.class, group_id); return jdbcTemplate.queryForBeans("select * from fc_user_group_fun where group_id = ?", Fc_user_group_funs.class, group_id);
}
@Override
public List<Fc_user_group_round> queryGroupRoundList(Integer group_id) {
return jdbcTemplate.queryForBeans("select * from fc_user_group_round where group_id = ?", Fc_user_group_round.class, group_id);
} }
@Override @Override
...@@ -118,13 +138,13 @@ public class AdminUserServiceImpl implements AdminUserService { ...@@ -118,13 +138,13 @@ public class AdminUserServiceImpl implements AdminUserService {
@Override @Override
public List<Map<String, Object>> getReviewUserList(Integer review_id) { public List<Map<String, Object>> getReviewUserList(Integer review_id) {
String sql = "select u.* from fc_user u, fc_user_group_fun fn, fc_member_film_enroll mfe, fc_review r where u.group_id = fn.group_id and fn.fun_id = mfe.enroll_type_id and mfe.film_id = r.film_id and r.id = ?"; String sql = "select u.*, ug.group_name from fc_user u left join fc_user_group ug on ug.group_id = u.group_id, fc_user_group_round ugr, fc_user_group_enroll uge, fc_review r where u.group_id = ugr.group_id and u.group_id = uge.group_id and ugr.review_round = r.review_round and uge.enroll_type_id = r.enroll_type_id and r.id = ?";
return jdbcTemplate.queryForList(sql, review_id); return jdbcTemplate.queryForList(sql, review_id);
} }
@Override @Override
public List<Map<String, Object>> getReviewGroupList(Integer review_id) { public List<Map<String, Object>> getReviewGroupList(Integer review_id) {
String sql = "select g.* from fc_user_group g, fc_user_group_fun fn, fc_member_film_enroll mfe, fc_review r where g.group_id = fn.group_id and fn.fun_id = mfe.enroll_type_id and mfe.film_id = r.film_id and r.id = ?"; String sql = "select g.* from fc_user_group ug, fc_user_gorup_round ugr, fc_user_group_enroll uge, fc_review r where ug.group_id = ugr.group_id and ug.group_id = uge.group_id and ugr.review_round = r.review_round and uge.enroll_type_id = r.enroll_type_id and r.id = ?";
return jdbcTemplate.queryForList(sql, review_id); return jdbcTemplate.queryForList(sql, review_id);
} }
......
...@@ -20,7 +20,8 @@ import com.egolm.film.api.service.AdminUserService; ...@@ -20,7 +20,8 @@ import com.egolm.film.api.service.AdminUserService;
import com.egolm.film.bean.Fc_user; import com.egolm.film.bean.Fc_user;
import com.egolm.film.bean.Fc_user_group; import com.egolm.film.bean.Fc_user_group;
import com.egolm.film.bean.Fc_user_group_enroll; import com.egolm.film.bean.Fc_user_group_enroll;
import com.egolm.film.bean.Fc_user_group_fun; import com.egolm.film.bean.Fc_user_group_funs;
import com.egolm.film.bean.Fc_user_group_round;
import com.egolm.film.config.WebMvcConfig; import com.egolm.film.config.WebMvcConfig;
import com.egolm.film.util.Common; import com.egolm.film.util.Common;
...@@ -64,9 +65,13 @@ public class AdminUserController { ...@@ -64,9 +65,13 @@ public class AdminUserController {
}) })
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);
List<Fc_user_group_fun> funList = service.queryGroupFunList(group_id); List<Fc_user_group_funs> funList = service.queryGroupFunList(group_id);
List<Fc_user_group_round> roundList = service.queryGroupRoundList(group_id);
List<Fc_user_group_enroll> enrollList = service.queryGroupEnrollList(group_id); List<Fc_user_group_enroll> enrollList = service.queryGroupEnrollList(group_id);
return Rjx.jsonOk().setData(group).set("funList", funList).set("enrollList", enrollList); return Rjx.jsonOk().setData(group)
.set("funList", funList)
.set("enrollList", enrollList)
.set("roundList", roundList);
} }
@ResponseBody @ResponseBody
...@@ -78,10 +83,11 @@ public class AdminUserController { ...@@ -78,10 +83,11 @@ public class AdminUserController {
@ApiImplicitParam(paramType="query", dataType="string", required=true, name="group_name", value="分组名称"), @ApiImplicitParam(paramType="query", dataType="string", required=true, name="group_name", value="分组名称"),
@ApiImplicitParam(paramType="query", dataType="int", required=true, name="state", value="状态"), @ApiImplicitParam(paramType="query", dataType="int", required=true, name="state", value="状态"),
@ApiImplicitParam(paramType="query", dataType="string", required=true, name="job_desc", 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快进后退权限", allowMultiple=true), @ApiImplicitParam(paramType="query", dataType="int", required=true, name="funs", value="其他权限 1快进快退"),
@ApiImplicitParam(paramType="query", dataType="int", required=true, name="rounds", value="权限[功能]ID [1-6]选权限", allowMultiple=true),
@ApiImplicitParam(paramType="query", dataType="int", required=true, name="enroll_types", value="评委审片权限 1金爵流程 2亚新流程 4参展流程", allowMultiple=true), @ApiImplicitParam(paramType="query", dataType="int", required=true, name="enroll_types", value="评委审片权限 1金爵流程 2亚新流程 4参展流程", allowMultiple=true),
}) })
public Rjx saveGroup(Integer group_id, String group_name, Integer state, String job_desc, Integer[] fun_id, Integer[] enroll_types) { public Rjx saveGroup(Integer group_id, String group_name, Integer state, String job_desc, Integer[] funs, Integer[] rounds, Integer[] enroll_types) {
Fc_user_group group = new Fc_user_group(); Fc_user_group group = new Fc_user_group();
group.setGroup_id(group_id); group.setGroup_id(group_id);
group.setGroup_name(group_name); group.setGroup_name(group_name);
...@@ -93,8 +99,9 @@ public class AdminUserController { ...@@ -93,8 +99,9 @@ public class AdminUserController {
group.setCreate_time(new Date()); group.setCreate_time(new Date());
} }
service.mergeGroup(group); service.mergeGroup(group);
service.saveGroupFun(group.getGroup_id(), fun_id); service.saveGroupFuns(group.getGroup_id(), funs);
service.saveGroupEnroll(group.getGroup_id(), enroll_types); service.saveGroupEnroll(group.getGroup_id(), enroll_types);
service.saveGroupRound(group.getGroup_id(), rounds);
return Rjx.jsonOk().setData(group); return Rjx.jsonOk().setData(group);
} }
......
...@@ -6,8 +6,8 @@ import javax.persistence.Column; ...@@ -6,8 +6,8 @@ import javax.persistence.Column;
import javax.persistence.Id; import javax.persistence.Id;
@Entity(name="fc_user_group_fun") @Entity(name="fc_user_group_funs")
public class Fc_user_group_fun implements java.io.Serializable { public class Fc_user_group_funs implements java.io.Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
......
package com.egolm.film.bean;
import javax.persistence.Entity;
import javax.persistence.Column;
import javax.persistence.Id;
@Entity(name="fc_user_group_round")
public class Fc_user_group_round implements java.io.Serializable {
private static final long serialVersionUID = 1L;
@Id
@Column(columnDefinition="int(11)'")
private Integer group_id;
@Id
@Column(columnDefinition="int(11)'")
private Integer review_round;
public void setGroup_id(Integer group_id) {
this.group_id = group_id;
}
public Integer getGroup_id() {
return group_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