Parcourir la source

系统编码管理2

yaoyi il y a 1 mois
Parent
commit
e5bef780ab

+ 7 - 3
hr-api/hr-api-system/src/main/java/com/hr/system/api/model/LoginUser.java

@@ -64,9 +64,11 @@ public class LoginUser implements Serializable
 //    private List<Long> depidlist;
 //
 //    private List<String> datascopelist;
-
+/***
     private String depCode;
     private Long depId;
+
+
     private String orgCode;
 
     public String getOrgCode() {
@@ -93,6 +95,7 @@ public class LoginUser implements Serializable
         this.depId = depId;
     }
 
+
     private List<SysDeptDto> userDeptList;
 
     public List<SysDeptDto> getUserDeptList() {
@@ -112,9 +115,10 @@ public class LoginUser implements Serializable
     public void setAuthInfo(JSONObject authInfo) {
         this.authInfo = authInfo;
     }
+ ***/
 
     private JSONObject sysMenuUrls;
-
+    /***
     private List<String> sysPostsList;
 
     public List<String> getSysPostsList() {
@@ -124,7 +128,7 @@ public class LoginUser implements Serializable
     public void setSysPostsList(List<String> sysPostsList) {
         this.sysPostsList = sysPostsList;
     }
-
+    ***/
     public JSONObject getSysMenuUrls() {
         return sysMenuUrls;
     }

+ 1 - 10
hr-auth/src/main/java/com/hr/auth/RuoYiAuthApplication.java

@@ -17,15 +17,6 @@ public class RuoYiAuthApplication
     public static void main(String[] args)
     {
         SpringApplication.run(RuoYiAuthApplication.class, args);
-        System.out.println("(♥◠‿◠)ノ゙  认证授权中心启动成功   ლ(´ڡ`ლ)゙  \n" +
-                " .-------.       ____     __        \n" +
-                " |  _ _   \\      \\   \\   /  /    \n" +
-                " | ( ' )  |       \\  _. /  '       \n" +
-                " |(_ o _) /        _( )_ .'         \n" +
-                " | (_,_).' __  ___(_ o _)'          \n" +
-                " |  |\\ \\  |  ||   |(_,_)'         \n" +
-                " |  | \\ `'   /|   `-'  /           \n" +
-                " |  |  \\    /  \\      /           \n" +
-                " ''-'   `'-'    `-..-'              ");
+        System.out.println("(♥◠‿◠)ノ゙  认证授权中心启动成功   ლ(´ڡ`ლ)゙  \n" );
     }
 }

+ 1 - 0
hr-modules/hr-system/src/main/java/com/hr/system/HrSystemApplication.java

@@ -24,6 +24,7 @@ public class HrSystemApplication
     {
         SpringApplication.run(HrSystemApplication.class, args);
 
+
         System.out.println("(♥◠‿◠)ノ゙  系统模块启动成功   ლ(´ڡ`ლ)゙  \n" );
     }
 }

+ 4 - 4
hr-modules/hr-system/src/main/java/com/hr/system/controller/SysSystemController.java

@@ -7,10 +7,10 @@ import com.hr.common.core.web.domain.AjaxResult;
 import com.hr.system.api.domain.SysDept;
 import com.hr.system.domain.SysBusinessSystem;
 import com.hr.system.service.ISysSystemService;
-import com.ruoyi.common.log.annotation.Log;
-import com.ruoyi.common.log.enums.BusinessType;
-import com.ruoyi.common.security.annotation.RequiresPermissions;
-import com.ruoyi.common.security.utils.SecurityUtils;
+import com.hr.common.log.annotation.Log;
+import com.hr.common.log.enums.BusinessType;
+import com.hr.common.security.annotation.RequiresPermissions;
+import com.hr.common.security.utils.SecurityUtils;
 import org.apache.commons.lang3.ArrayUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.validation.annotation.Validated;

+ 3 - 117
hr-modules/hr-system/src/main/java/com/hr/system/controller/SysUserController.java

@@ -159,7 +159,7 @@ public class SysUserController extends BaseController
          * 设置当前用户的菜单路径集合
          */
         sysUserVo.setSysMenuUrls(menump);
-        sysUserVo.setSysPostsList(userpstlststr);
+//        sysUserVo.setSysPostsList(userpstlststr);
 
 
         /*****
@@ -192,129 +192,15 @@ public class SysUserController extends BaseController
 //            if(_d.getDepType().equals("base")){
 //                userorgdept=_d;
 //            }
-            sysUserVo.setUserDeptList(deptlist);
+//            sysUserVo.setUserDeptList(deptlist);
         }
 
-        //用户只能关联一个基础组织机构id
-        if(userorgdept!=null) {
-            sysUserVo.setDepCode(userorgdept.getAncestors());
-            sysUserVo.setDepId(userorgdept.getDeptId());
-//            sysUserVo.setOrgCode(userorgdept.getOrgCode());
-        }
+
 
         Map<String, List<SysDeptDto>> groupedByDepTypemap = deptlist.stream()
                 .collect(Collectors.groupingBy(SysDeptDto::getDepType));
 
 
-        JSONObject depinfo=new JSONObject();
-        //filename --> = like in
-        //userid 本人
-        //dept_id 组织id List Long
-        //dept_code 组织编码  List String
-        //auth_cs_dept_id 业务组织id List Long
-        //auth_cs_dept_code 业务组织编码  List String
-//        depinfo.put("userid",sysUser.getUserId());
-        depinfo.put("=",new JSONObject());
-        depinfo.put("in",new JSONObject());
-        depinfo.put("like",new JSONObject());
-
-        for(SysRole _r:roleList){
-
-            //开始循环不同业务类型下面的数据
-            for(String _k:groupedByDepTypemap.keySet()) {
-                //1全部数据 2自定义 3本部门权限 4本部门以及以下 5本人
-                //如果是2,自定义,需要将当前角色关联的部门Ids加入进来
-                if (_r.getDataScope().equals("2") && _k.equals(_r.getRoleDeptType())) {
-                    String _filename="dep_id";
-                    if(!_k.equals("base")){
-                        _filename="auth_"+_k+"_depid";
-                    }
-
-                    JSONObject depinfo1=depinfo.getJSONObject("in");
-                    if(!depinfo1.containsKey(_filename)){
-                        depinfo1.put(_filename,new ArrayList<Long>());
-                    }
-                    List<Long> _depidlist=depinfo1.getObject( _filename, List.class);
-//                    deptService.selectDeptListByRoleId(roleId)
-                    _depidlist.addAll( deptService.selectDeptListByRoleId(_r.getRoleId(),_k));
-                    depinfo1.put(_filename,_depidlist);
-                }
-                //3本部门权限
-                if (_r.getDataScope().equals("3") && _k.equals(_r.getRoleDeptType())) {
-
-                    String _filename="dep_id";
-                    if(!_k.equals("base")){
-                        _filename="auth_"+_k+"_depid";
-                    }
-
-                    JSONObject depinfo1=depinfo.getJSONObject("in");
-                    if(!depinfo1.containsKey(_filename)){
-                        depinfo1.put(_filename,new ArrayList<Long>());
-                    }
-                    List<Long> _depidlist=depinfo1.getObject( _filename, List.class);
-                    //根据用户id和业务组织类型查询组织id
-                    _depidlist.addAll( deptService.selectDeptListByuserId(sysUser.getUserId(),_k));
-                    depinfo1.put(_filename,_depidlist);
-
-                }
-//                4本部门以及以下
-                if(_r.getDataScope().equals("4") && _k.equals(_r.getRoleDeptType())){
-
-                    String _filename="dep_code";
-                    if(!_k.equals("base")){
-                        _filename="auth_"+_k+"_depcode";
-                    }
-
-                    JSONObject depinfo1=depinfo.getJSONObject("like");
-                    if(!depinfo1.containsKey(_filename)){
-                        depinfo1.put(_filename,new ArrayList<Long>());
-                    }
-                    List<String> _depidlist=depinfo1.getObject( _filename, List.class);
-                    //根据用户id和业务组织类型查询组织id
-                    _depidlist.addAll( deptService.selectDeptListByuserIdChild(sysUser.getUserId(),_k));
-                    depinfo1.put(_filename,_depidlist);
-                }
-                //5本人
-                if ( _r.getDataScope().equals("5") && _k.equals(_r.getRoleDeptType())) {
-                    String _filename="creater_id";
-                    JSONObject depinfo1=depinfo.getJSONObject("=");
-                    depinfo1.put( _filename, sysUser.getUserId());
-
-                }
-            }
-
-        }
-        sysUserVo.setAuthInfo(depinfo);
-
-
-        /***
-        sysUserVo.setDepidlist(depidlist);
-
-        sysUserVo.setDatascopelist(new ArrayList<>());
-
-
-        for(SysRole _r:roleList){
-            //排除超级管理员
-            // ##################和自定义数据权限,合并在一起了,权限,只排除超级管理员
-            if(_r.getDataScope()!=null &&
-                    !(_r.getDataScope().equals("1")
-//                            || _r.getDataScope().equals("2")
-                    )) {
-//                sysUserVo.getDatascopelist().add(_r.getDataScope() + ":" + sysUser.getDept().getAncestors());
-                //设置权限2#base:deptid@201,202,203;deptcode@0,100,201#
-
-                for(SysDept _d:userdeps){
-
-                }
-            }
-        }
-***/
-
-
-//        sysUserVo.setDepId(dep.getDeptId());
-//        sysUserVo.setDepCode(dep.getAncestors());
-
-
         sysUserVo.setSysUser(sysUser);
         sysUserVo.setRoles(roles);
         sysUserVo.setPermissions(permissions);