法规清单-角色切换完善。

This commit is contained in:
qq787203167
2022-07-12 09:56:13 +08:00
parent 264cd7480e
commit d3de930960
2 changed files with 15 additions and 4 deletions
@@ -1,10 +1,13 @@
package com.jero.modules.project.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.jero.common.system.vo.LoginUser;
import com.jero.modules.project.entity.ProjectLibraryRoleRelEO;
import com.jero.modules.project.mapper.ProjectLibraryRoleRelEOMapper;
import com.jero.modules.project.service.IProjectLibraryRoleRelEOService;
import me.zhyd.oauth.utils.StringUtils;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.shiro.SecurityUtils;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Date;
@@ -43,9 +46,16 @@ public class ProjectLibraryRoleRelEOServiceImpl extends ServiceImpl<ProjectLibra
*/
@Override
public void editById(ProjectLibraryRoleRelEO projectLibraryRoleRelEO) {
Date now = new Date();
projectLibraryRoleRelEO.setUpdateTime(now);
saveOrUpdate(projectLibraryRoleRelEO);
//用户在法规清单角色切换中,切换角色,只有这个项目的studio 有id,其他用户第一次默认是没有的。如果不是studio 只能给他新增一条数据 ,后续回显使用。
if(StringUtils.isNotEmpty(projectLibraryRoleRelEO.getId())){
Date now = new Date();
projectLibraryRoleRelEO.setUpdateTime(now);
this.baseMapper.updateById(projectLibraryRoleRelEO);
}else {
LoginUser currentUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
projectLibraryRoleRelEO.setUserId(currentUser.getId());
this.baseMapper.insert(projectLibraryRoleRelEO);
}
}
/**
@@ -1219,7 +1219,8 @@
if (valid) {
let query = {
roleCode: this.formInlineRoleSwitching.roleSwitchingCode,
id: this.AndUserId
id: this.AndUserId,
projectLibraryId: this.$route.query.id
}
this.confirmLoadingRoleSwitching = true
postAction(this.url.AndUserIdEdit, query).then((res) => {