Browse Source

项目及项目组相关进行权限优化

master
qqkj 5 years ago
parent
commit
febb7fbeec
  1. 10
      xm-core/src/main/java/com/xm/core/ctrl/XmProjectController.java
  2. 12
      xm-core/src/main/java/com/xm/core/service/XmProjectGroupService.java

10
xm-core/src/main/java/com/xm/core/ctrl/XmProjectController.java

@ -134,7 +134,7 @@ public class XmProjectController {
Tips tips=new Tips("成功删除一条数据"); Tips tips=new Tips("成功删除一条数据");
try{ try{
User user= LoginUtils.getCurrentUserInfo(); User user= LoginUtils.getCurrentUserInfo();
XmProject xmProjectDb=this.xmProjectService.selectOneObject(xmProject);
XmProject xmProjectDb=this.xmProjectService.getProjectFromCache(xmProject.getId());
if(xmProjectDb==null){ if(xmProjectDb==null){
tips.setFailureMsg("项目不存在"); tips.setFailureMsg("项目不存在");
} }
@ -173,7 +173,7 @@ public class XmProjectController {
m.put("tips", tips); m.put("tips", tips);
return m; return m;
} }
XmProject xmProjectDb=this.xmProjectService.selectOneObject(xmProject);
XmProject xmProjectDb=this.xmProjectService.getProjectFromCache(xmProject.getId());
if(xmProjectDb==null){ if(xmProjectDb==null){
tips.setFailureMsg("项目不存在"); tips.setFailureMsg("项目不存在");
m.put("tips", tips); m.put("tips", tips);
@ -218,7 +218,7 @@ public class XmProjectController {
m.put("tips", tips); m.put("tips", tips);
return m; return m;
} }
XmProject xmProjectDb=this.xmProjectService.selectOneObject(xmProject);
XmProject xmProjectDb=this.xmProjectService.getProjectFromCache(xmProject.getId());
if(xmProjectDb==null){ if(xmProjectDb==null){
tips.setFailureMsg("项目不存在"); tips.setFailureMsg("项目不存在");
m.put("tips", tips); m.put("tips", tips);
@ -263,7 +263,7 @@ public class XmProjectController {
m.put("tips", tips); m.put("tips", tips);
return m; return m;
} }
XmProject xmProjectDb=this.xmProjectService.selectOneObject(xmProject);
XmProject xmProjectDb=this.xmProjectService.getProjectFromCache(xmProject.getId());
if(xmProjectDb==null){ if(xmProjectDb==null){
tips.setFailureMsg("项目不存在"); tips.setFailureMsg("项目不存在");
m.put("tips", tips); m.put("tips", tips);
@ -308,7 +308,7 @@ public class XmProjectController {
m.put("tips", tips); m.put("tips", tips);
return m; return m;
} }
XmProject xmProjectDb=this.xmProjectService.selectOneObject(xmProject);
XmProject xmProjectDb=this.xmProjectService.getProjectFromCache(xmProject.getId());
if(xmProjectDb==null){ if(xmProjectDb==null){
tips.setFailureMsg("项目不存在"); tips.setFailureMsg("项目不存在");
m.put("tips", tips); m.put("tips", tips);

12
xm-core/src/main/java/com/xm/core/service/XmProjectGroupService.java

@ -181,7 +181,7 @@ public class XmProjectGroupService extends BaseService {
if(!isProjectCreate) { if(!isProjectCreate) {
if(!isPm) { if(!isPm) {
throw new BizException("你既不是项目创建人,也不是项目经理,不允许删除项目小组,项目创建人为【"+project.getCreateUsername()+"】");
throw new BizException("无权操作!只有项目创建人、项目经理可以删除小组");
} }
} }
delGroups.forEach(g->{ delGroups.forEach(g->{
@ -219,7 +219,7 @@ public class XmProjectGroupService extends BaseService {
if(xmProjectGroupVoAdd.size()>0) { if(xmProjectGroupVoAdd.size()>0) {
if(!isProjectCreate) { if(!isProjectCreate) {
if(!isPm) { if(!isPm) {
throw new BizException("你不是项目创建人,也不是项目经理,不允许新增该项目的小组,项目创建人为【"+project.getCreateUsername()+"】");
throw new BizException("您无权操作!只有项目创建人、项目经理可创建小组");
} }
} }
@ -275,7 +275,7 @@ public class XmProjectGroupService extends BaseService {
if(!isProjectCreate) { if(!isProjectCreate) {
if(!isPm) { if(!isPm) {
throw new BizException("你不是项目创建人,也不是项目经理,不允许清空【"+gvo.getGroupName()+"】整个小组所有成员");
throw new BizException("无权操作!只有项目创建人、项目经理可以清空小组成员");
} }
} }
@ -366,7 +366,7 @@ public class XmProjectGroupService extends BaseService {
} }
} }
if(!isHead) { if(!isHead) {
throw new BizException("你既不是项目创建人,也不是项目经理,也不是组长,不允许增加小组成员");
throw new BizException("无权操作!只有项目创建人、项目经理、小组长可增加小组成员");
} }
} }
@ -409,7 +409,7 @@ public class XmProjectGroupService extends BaseService {
} }
} }
if(!isHead) { if(!isHead) {
throw new BizException("你既不是项目创建人,也不是项目经理,也不是组长,不允许删除小组成员");
throw new BizException("无权操作!只有小组长、项目经理、项目创建人可以删除小组成员");
} }
} }
@ -431,7 +431,7 @@ public class XmProjectGroupService extends BaseService {
if(allUsersEdit.size()>0) { if(allUsersEdit.size()>0) {
if(!isProjectCreate) { if(!isProjectCreate) {
if(!isPm) { if(!isPm) {
throw new BizException("你不是项目创建人,也不是项目经理,不能调整组长");
throw new BizException("无权操作!只有项目经理、项目创建人可以调整各小组组长");
} }
} }
List<XmProjectGroupUser> allUsersEdit2=new ArrayList<>(); List<XmProjectGroupUser> allUsersEdit2=new ArrayList<>();

Loading…
Cancel
Save