Browse Source

权限控制

master
陈裕财 4 years ago
parent
commit
af0911b541
  1. 5
      xm-core/src/main/java/com/xm/core/ctrl/XmQuestionController.java
  2. 6
      xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmQuestionMapper.xml

5
xm-core/src/main/java/com/xm/core/ctrl/XmQuestionController.java

@ -109,7 +109,12 @@ public class XmQuestionController {
RequestUtils.transformArray(xmQuestion, "tagIdList");
PageUtils.startPage(xmQuestion);
User user = LoginUtils.getCurrentUserInfo();
if(LoginUtils.isBranchAdmin()){
xmQuestion.put("branchId",user.getBranchId());
}else {
xmQuestion.put("compete",user.getUserid());
}
List<Map<String,Object>> xmQuestionList = xmQuestionService.getQuestion(xmQuestion); //列出XmQuestion列表
PageUtils.responePage(m, xmQuestionList);

6
xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmQuestionMapper.xml

@ -30,8 +30,10 @@
and exists ( select 1 from xm_group_user gu where gu.userid=#{compete} and (gu.project_id=res.project_id or gu.product_id=res.product_id))
</if>
<if test="key != null and key !='' "> and res.name like #{key} </if>
<if test="work != null and work != ''"> and res.status != 'resolved' </if>
<if test="work != null and work != ''"> and res.status in ('1','2','3','4','7') </if>
<if test="branchId!=null and branchId!=''">
and exists( select 1 from xm_project p where p.id=res.project_id and p.branch_id=#{branchId})
</if>
<if test="linkIterationId != null and linkIterationId != ''"> and exists (select 1 from xm_menu m where m.iteration_id=#{linkIterationId} and m.menu_id=res.menu_id) </if>
</sql>

Loading…
Cancel
Save