|
|
@@ -7,6 +7,7 @@ import java.util.stream.Stream;
|
|
|
import com.dgtly.common.core.domain.Ztree;
|
|
|
import com.dgtly.common.utils.DateUtils;
|
|
|
import com.dgtly.common.utils.StringUtils;
|
|
|
+import com.dgtly.common.utils.UserIdentityUtil;
|
|
|
import com.dgtly.system.domain.*;
|
|
|
import com.dgtly.system.mapper.SysUserAuthorRelMapper;
|
|
|
import com.dgtly.system.mapper.SysUserExtMapper;
|
|
|
@@ -15,6 +16,7 @@ import org.springframework.stereotype.Service;
|
|
|
import com.dgtly.system.mapper.SysUserOrderAuthorMapper;
|
|
|
import com.dgtly.system.service.ISysUserOrderAuthorService;
|
|
|
import com.dgtly.common.core.text.Convert;
|
|
|
+import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
import static java.util.stream.Collectors.toList;
|
|
|
|
|
|
@@ -111,8 +113,35 @@ public class SysUserOrderAuthorServiceImpl implements ISysUserOrderAuthorService
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
+ @Transactional
|
|
|
public int insertRel(SysUserAuthorRel role)
|
|
|
{
|
|
|
+ /*1、查询所有一级节点*/
|
|
|
+ String identity = "";
|
|
|
+ SysUserExt sysUserExt = new SysUserExt();
|
|
|
+ sysUserExt.setUserId(role.getUserId());
|
|
|
+ for (Long authorId : role.getAuthorIds()){
|
|
|
+ SysUserOrderAuthor sysUserOrderAuthor = sysUserOrderAuthorMapper.selectSysUserOrderAuthorById(authorId);
|
|
|
+ if (sysUserOrderAuthor.getParentId()==1L){
|
|
|
+ if(UserIdentityUtil.UI_DIY_NAME.equals(sysUserOrderAuthor.getAuthorName())){
|
|
|
+ identity+=UserIdentityUtil.UI_DIY+",";
|
|
|
+ }else if(UserIdentityUtil.UI_CW_NAME.equals(sysUserOrderAuthor.getAuthorName())){
|
|
|
+ identity+=UserIdentityUtil.UI_CW+",";
|
|
|
+ }else if(UserIdentityUtil.UI_YSL_NAME.equals(sysUserOrderAuthor.getAuthorName())){
|
|
|
+ identity+=UserIdentityUtil.UI_YSL+",";
|
|
|
+ }else if(UserIdentityUtil.UI_FC_NAME.equals(sysUserOrderAuthor.getAuthorName())){
|
|
|
+ identity+=UserIdentityUtil.UI_FC+",";
|
|
|
+ }else if(UserIdentityUtil.UI_XLS_NAME.equals(sysUserOrderAuthor.getAuthorName())){
|
|
|
+ identity+=UserIdentityUtil.UI_XLS+",";
|
|
|
+ }else if(UserIdentityUtil.UI_SAF_NAME.equals(sysUserOrderAuthor.getAuthorName())){
|
|
|
+ identity+=UserIdentityUtil.UI_SAF+",";
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (!"".equals(identity)) {
|
|
|
+ sysUserExt.setIdentity(identity.substring(0, identity.length() - 1));
|
|
|
+ }
|
|
|
+ /*判断节点对应身份进行人员身份修改*/
|
|
|
userAuthorRelMapper.deleteSysUserAuthorRelById(role.getUserId());
|
|
|
int rows = 1;
|
|
|
// 新增角色与部门(数据权限)管理
|
|
|
@@ -127,6 +156,9 @@ public class SysUserOrderAuthorServiceImpl implements ISysUserOrderAuthorService
|
|
|
if (list.size() > 0)
|
|
|
{
|
|
|
rows = userAuthorRelMapper.batchRel(list);
|
|
|
+ if (!"".equals(identity)) {
|
|
|
+ rows = userExtMapper.updateSysUserExt(sysUserExt);
|
|
|
+ }
|
|
|
}
|
|
|
return rows;
|
|
|
}
|