【修改】后端角色权限的代码直接删除
This commit is contained in:
-44
@@ -13,7 +13,6 @@ import com.jero.common.system.base.controller.JeroController;
|
|||||||
import com.jero.common.system.query.QueryGenerator;
|
import com.jero.common.system.query.QueryGenerator;
|
||||||
import com.jero.common.util.oConvertUtils;
|
import com.jero.common.util.oConvertUtils;
|
||||||
import com.jero.modules.system.entity.SysDepartPermission;
|
import com.jero.modules.system.entity.SysDepartPermission;
|
||||||
//import com.jero.modules.system.entity.SysDepartRolePermission;
|
|
||||||
import com.jero.modules.system.entity.SysPermission;
|
import com.jero.modules.system.entity.SysPermission;
|
||||||
import com.jero.modules.system.entity.SysPermissionDataRule;
|
import com.jero.modules.system.entity.SysPermissionDataRule;
|
||||||
import com.jero.modules.system.model.TreeModel;
|
import com.jero.modules.system.model.TreeModel;
|
||||||
@@ -22,7 +21,6 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
//import com.jero.modules.system.service.ISysDepartRolePermissionService;
|
|
||||||
import com.jero.modules.system.service.ISysPermissionDataRuleService;
|
import com.jero.modules.system.service.ISysPermissionDataRuleService;
|
||||||
import com.jero.modules.system.service.ISysPermissionService;
|
import com.jero.modules.system.service.ISysPermissionService;
|
||||||
|
|
||||||
@@ -52,9 +50,6 @@ public class SysDepartPermissionController extends JeroController<SysDepartPermi
|
|||||||
@Autowired
|
@Autowired
|
||||||
private ISysPermissionService sysPermissionService;
|
private ISysPermissionService sysPermissionService;
|
||||||
|
|
||||||
// @Autowired
|
|
||||||
// private ISysDepartRolePermissionService sysDepartRolePermissionService;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 分页列表查询
|
* 分页列表查询
|
||||||
*
|
*
|
||||||
@@ -192,45 +187,6 @@ public class SysDepartPermissionController extends JeroController<SysDepartPermi
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// /**
|
|
||||||
// * 查询角色授权
|
|
||||||
// *
|
|
||||||
// * @return
|
|
||||||
// */
|
|
||||||
// @RequestMapping(value = "/queryDeptRolePermission", method = RequestMethod.GET)
|
|
||||||
// public Result<List<String>> queryDeptRolePermission(@RequestParam(name = "roleId", required = true) String roleId) {
|
|
||||||
// Result<List<String>> result = new Result<>();
|
|
||||||
// try {
|
|
||||||
// List<SysDepartRolePermission> list = sysDepartRolePermissionService.list(new QueryWrapper<SysDepartRolePermission>().lambda().eq(SysDepartRolePermission::getRoleId, roleId));
|
|
||||||
// result.setResult(list.stream().map(SysDepartRolePermission -> String.valueOf(SysDepartRolePermission.getPermissionId())).collect(Collectors.toList()));
|
|
||||||
// result.setSuccess(true);
|
|
||||||
// } catch (Exception e) {
|
|
||||||
// log.error(e.getMessage(), e);
|
|
||||||
// }
|
|
||||||
// return result;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// /**
|
|
||||||
// * 保存角色授权
|
|
||||||
// *
|
|
||||||
// * @return
|
|
||||||
// */
|
|
||||||
// @RequestMapping(value = "/saveDeptRolePermission", method = RequestMethod.POST)
|
|
||||||
// public Result<Object> saveDeptRolePermission(@RequestBody JSONObject json) {
|
|
||||||
// long start = System.currentTimeMillis();
|
|
||||||
// try {
|
|
||||||
// String roleId = json.getString("roleId");
|
|
||||||
// String permissionIds = json.getString("permissionIds");
|
|
||||||
// String lastPermissionIds = json.getString("lastpermissionIds");
|
|
||||||
// this.sysDepartRolePermissionService.saveDeptRolePermission(roleId, permissionIds, lastPermissionIds);
|
|
||||||
// log.info("======部门角色授权成功=====耗时:" + (System.currentTimeMillis() - start) + "毫秒");
|
|
||||||
// return Result.OK("保存成功!");
|
|
||||||
// } catch (Exception e) {
|
|
||||||
// log.error(e.getMessage(), e);
|
|
||||||
// return Result.error500("授权失败!");
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户角色授权功能,查询菜单权限树
|
* 用户角色授权功能,查询菜单权限树
|
||||||
* @param request
|
* @param request
|
||||||
|
|||||||
-294
@@ -1,294 +0,0 @@
|
|||||||
//package com.jero.modules.system.controller;
|
|
||||||
//
|
|
||||||
//import java.util.*;
|
|
||||||
//import java.util.stream.Collectors;
|
|
||||||
//import javax.servlet.http.HttpServletRequest;
|
|
||||||
//import javax.servlet.http.HttpServletResponse;
|
|
||||||
//
|
|
||||||
//import com.alibaba.fastjson.JSONObject;
|
|
||||||
//import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
||||||
//import com.jero.common.system.base.controller.JeroController;
|
|
||||||
//import org.apache.shiro.SecurityUtils;
|
|
||||||
//import com.jero.common.api.vo.Result;
|
|
||||||
//import com.jero.common.system.query.QueryGenerator;
|
|
||||||
//import com.jero.common.aspect.annotation.AutoLog;
|
|
||||||
//import com.jero.common.system.vo.LoginUser;
|
|
||||||
//import com.jero.common.util.oConvertUtils;
|
|
||||||
//import com.jero.modules.system.entity.*;
|
|
||||||
//import com.jero.modules.system.service.*;
|
|
||||||
//import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
||||||
//import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
||||||
//import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
||||||
//import lombok.extern.slf4j.Slf4j;
|
|
||||||
//
|
|
||||||
//import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
//import org.springframework.web.bind.annotation.*;
|
|
||||||
//import org.springframework.web.servlet.ModelAndView;
|
|
||||||
//import io.swagger.annotations.Api;
|
|
||||||
//import io.swagger.annotations.ApiOperation;
|
|
||||||
//
|
|
||||||
// /**
|
|
||||||
// * @Description: 部门角色
|
|
||||||
// * @Author: jero-boot
|
|
||||||
// * @Date: 2020-02-12
|
|
||||||
// * @Version: V1.0
|
|
||||||
// */
|
|
||||||
//@Slf4j
|
|
||||||
//@Api(tags="部门角色")
|
|
||||||
//@RestController
|
|
||||||
//@RequestMapping("/sys/sysDepartRole")
|
|
||||||
//public class SysDepartRoleController extends JeroController<SysDepartRole, ISysDepartRoleService> {
|
|
||||||
// @Autowired
|
|
||||||
// private ISysDepartRoleService sysDepartRoleService;
|
|
||||||
//
|
|
||||||
// @Autowired
|
|
||||||
// private ISysDepartRoleUserService departRoleUserService;
|
|
||||||
//
|
|
||||||
// @Autowired
|
|
||||||
// private ISysDepartPermissionService sysDepartPermissionService;
|
|
||||||
//
|
|
||||||
// @Autowired
|
|
||||||
// private ISysDepartRolePermissionService sysDepartRolePermissionService;
|
|
||||||
//
|
|
||||||
// @Autowired
|
|
||||||
// private ISysDepartService sysDepartService;
|
|
||||||
//
|
|
||||||
// /**
|
|
||||||
// * 分页列表查询
|
|
||||||
// *
|
|
||||||
// * @param sysDepartRole
|
|
||||||
// * @param pageNo
|
|
||||||
// * @param pageSize
|
|
||||||
// * @param req
|
|
||||||
// * @return
|
|
||||||
// */
|
|
||||||
// @ApiOperation(value="部门角色-分页列表查询", notes="部门角色-分页列表查询")
|
|
||||||
// @GetMapping(value = "/page")
|
|
||||||
// public Result<?> queryPageList(SysDepartRole sysDepartRole,
|
|
||||||
// @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
|
||||||
// @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
|
||||||
// @RequestParam(name="deptId",required=false) String deptId,
|
|
||||||
// HttpServletRequest req) {
|
|
||||||
// QueryWrapper<SysDepartRole> queryWrapper = QueryGenerator.initQueryWrapper(sysDepartRole, req.getParameterMap());
|
|
||||||
// Page<SysDepartRole> page = new Page<SysDepartRole>(pageNo, pageSize);
|
|
||||||
// LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
|
||||||
// List<String> deptIds = null;
|
|
||||||
//// if(oConvertUtils.isEmpty(deptId)){
|
|
||||||
//// if(oConvertUtils.isNotEmpty(user.getUserIdentity()) && user.getUserIdentity().equals(CommonConstant.USER_IDENTITY_2) ){
|
|
||||||
//// deptIds = sysDepartService.getMySubDepIdsByDepId(user.getDepartIds());
|
|
||||||
//// }else{
|
|
||||||
//// return Result.OK(null);
|
|
||||||
//// }
|
|
||||||
//// }else{
|
|
||||||
//// deptIds = sysDepartService.getSubDepIdsByDepId(deptId);
|
|
||||||
//// }
|
|
||||||
//// queryWrapper.in("depart_id",deptIds);
|
|
||||||
//
|
|
||||||
// //我的部门,选中部门只能看当前部门下的角色
|
|
||||||
// queryWrapper.eq("depart_id",deptId);
|
|
||||||
// IPage<SysDepartRole> pageList = sysDepartRoleService.page(page, queryWrapper);
|
|
||||||
// return Result.OK(pageList);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// /**
|
|
||||||
// * 添加
|
|
||||||
// *
|
|
||||||
// * @param sysDepartRole
|
|
||||||
// * @return
|
|
||||||
// */
|
|
||||||
// //@RequiresRoles({"admin"})
|
|
||||||
// @ApiOperation(value="部门角色-添加", notes="部门角色-添加")
|
|
||||||
// @PostMapping(value = "/add")
|
|
||||||
// public Result<?> add(@RequestBody SysDepartRole sysDepartRole) {
|
|
||||||
// sysDepartRoleService.save(sysDepartRole);
|
|
||||||
// return Result.OK("添加成功!");
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// /**
|
|
||||||
// * 编辑
|
|
||||||
// *
|
|
||||||
// * @param sysDepartRole
|
|
||||||
// * @return
|
|
||||||
// */
|
|
||||||
// //@RequiresRoles({"admin"})
|
|
||||||
// @ApiOperation(value="部门角色-编辑", notes="部门角色-编辑")
|
|
||||||
// @PutMapping(value = "/edit")
|
|
||||||
// public Result<?> edit(@RequestBody SysDepartRole sysDepartRole) {
|
|
||||||
// sysDepartRoleService.updateById(sysDepartRole);
|
|
||||||
// return Result.OK("编辑成功!");
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// /**
|
|
||||||
// * 通过id删除
|
|
||||||
// *
|
|
||||||
// * @param id
|
|
||||||
// * @return
|
|
||||||
// */
|
|
||||||
// //@RequiresRoles({"admin"})
|
|
||||||
// @AutoLog(value = "部门角色-通过id删除")
|
|
||||||
// @ApiOperation(value="部门角色-通过id删除", notes="部门角色-通过id删除")
|
|
||||||
// @DeleteMapping(value = "/delete")
|
|
||||||
// public Result<?> delete(@RequestParam(name="id",required=true) String id) {
|
|
||||||
// sysDepartRoleService.removeById(id);
|
|
||||||
// return Result.OK("删除成功!");
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// /**
|
|
||||||
// * 批量删除
|
|
||||||
// *
|
|
||||||
// * @param ids
|
|
||||||
// * @return
|
|
||||||
// */
|
|
||||||
// //@RequiresRoles({"admin"})
|
|
||||||
// @AutoLog(value = "部门角色-批量删除")
|
|
||||||
// @ApiOperation(value="部门角色-批量删除", notes="部门角色-批量删除")
|
|
||||||
// @DeleteMapping(value = "/deleteBatch")
|
|
||||||
// public Result<?> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
|
||||||
// this.sysDepartRoleService.removeByIds(Arrays.asList(ids.split(",")));
|
|
||||||
// return Result.OK("批量删除成功!");
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// /**
|
|
||||||
// * 通过id查询
|
|
||||||
// *
|
|
||||||
// * @param id
|
|
||||||
// * @return
|
|
||||||
// */
|
|
||||||
// @ApiOperation(value="部门角色-通过id查询", notes="部门角色-通过id查询")
|
|
||||||
// @GetMapping(value = "/queryById")
|
|
||||||
// public Result<?> queryById(@RequestParam(name="id",required=true) String id) {
|
|
||||||
// SysDepartRole sysDepartRole = sysDepartRoleService.getById(id);
|
|
||||||
// return Result.OK(sysDepartRole);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// /**
|
|
||||||
// * 获取部门下角色
|
|
||||||
// * @param departId
|
|
||||||
// * @return
|
|
||||||
// */
|
|
||||||
// @RequestMapping(value = "/getDeptRoleList", method = RequestMethod.GET)
|
|
||||||
// public Result<List<SysDepartRole>> getDeptRoleList(@RequestParam(value = "departId") String departId,@RequestParam(value = "userId") String userId){
|
|
||||||
// Result<List<SysDepartRole>> result = new Result<>();
|
|
||||||
// //查询选中部门的角色
|
|
||||||
// List<SysDepartRole> deptRoleList = sysDepartRoleService.list(new LambdaQueryWrapper<SysDepartRole>().eq(SysDepartRole::getDepartId,departId));
|
|
||||||
// result.setSuccess(true);
|
|
||||||
// result.setResult(deptRoleList);
|
|
||||||
// return result;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// /**
|
|
||||||
// * 设置
|
|
||||||
// * @param json
|
|
||||||
// * @return
|
|
||||||
// */
|
|
||||||
// //@RequiresRoles({"admin"})
|
|
||||||
// @RequestMapping(value = "/deptRoleUserAdd", method = RequestMethod.POST)
|
|
||||||
// public Result<?> deptRoleAdd(@RequestBody JSONObject json) {
|
|
||||||
// String newRoleId = json.getString("newRoleId");
|
|
||||||
// String oldRoleId = json.getString("oldRoleId");
|
|
||||||
// String userId = json.getString("userId");
|
|
||||||
// departRoleUserService.deptRoleUserAdd(userId,newRoleId,oldRoleId);
|
|
||||||
// return Result.OK("添加成功!");
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// /**
|
|
||||||
// * 根据用户id获取已设置部门角色
|
|
||||||
// * @param userId
|
|
||||||
// * @return
|
|
||||||
// */
|
|
||||||
// @RequestMapping(value = "/getDeptRoleByUserId", method = RequestMethod.GET)
|
|
||||||
// public Result<List<SysDepartRoleUser>> getDeptRoleByUserId(@RequestParam(value = "userId") String userId,@RequestParam(value = "departId") String departId){
|
|
||||||
// Result<List<SysDepartRoleUser>> result = new Result<>();
|
|
||||||
// //查询部门下角色
|
|
||||||
// List<SysDepartRole> roleList = sysDepartRoleService.list(new QueryWrapper<SysDepartRole>().eq("depart_id",departId));
|
|
||||||
// List<String> roleIds = roleList.stream().map(SysDepartRole::getId).collect(Collectors.toList());
|
|
||||||
// //根据角色id,用户id查询已授权角色
|
|
||||||
// List<SysDepartRoleUser> roleUserList = null;
|
|
||||||
// if(roleIds!=null && roleIds.size()>0){
|
|
||||||
// roleUserList = departRoleUserService.list(new QueryWrapper<SysDepartRoleUser>().eq("user_id",userId).in("drole_id",roleIds));
|
|
||||||
// }
|
|
||||||
// result.setSuccess(true);
|
|
||||||
// result.setResult(roleUserList);
|
|
||||||
// return result;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// /**
|
|
||||||
// * 查询数据规则数据
|
|
||||||
// */
|
|
||||||
// @GetMapping(value = "/datarule/{permissionId}/{departId}/{roleId}")
|
|
||||||
// public Result<?> loadDatarule(@PathVariable("permissionId") String permissionId,@PathVariable("departId") String departId,@PathVariable("roleId") String roleId) {
|
|
||||||
// //查询已授权的部门规则
|
|
||||||
// List<SysPermissionDataRule> list = sysDepartPermissionService.getPermRuleListByDeptIdAndPermId(departId,permissionId);
|
|
||||||
// if(list==null || list.size()==0) {
|
|
||||||
// return Result.error("未找到权限配置信息");
|
|
||||||
// }else {
|
|
||||||
// Map<String,Object> map = new HashMap<>();
|
|
||||||
// map.put("datarule", list);
|
|
||||||
// LambdaQueryWrapper<SysDepartRolePermission> query = new LambdaQueryWrapper<SysDepartRolePermission>()
|
|
||||||
// .eq(SysDepartRolePermission::getPermissionId, permissionId)
|
|
||||||
// .eq(SysDepartRolePermission::getRoleId,roleId);
|
|
||||||
// SysDepartRolePermission sysRolePermission = sysDepartRolePermissionService.getOne(query);
|
|
||||||
// if(sysRolePermission==null) {
|
|
||||||
// //return Result.error("未找到角色菜单配置信息");
|
|
||||||
// }else {
|
|
||||||
// String drChecked = sysRolePermission.getDataRuleIds();
|
|
||||||
// if(oConvertUtils.isNotEmpty(drChecked)) {
|
|
||||||
// map.put("drChecked", drChecked.endsWith(",")?drChecked.substring(0, drChecked.length()-1):drChecked);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// return Result.OK(map);
|
|
||||||
// //TODO 以后按钮权限的查询也走这个请求 无非在map中多加两个key
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// /**
|
|
||||||
// * 保存数据规则至角色菜单关联表
|
|
||||||
// */
|
|
||||||
// @PostMapping(value = "/datarule")
|
|
||||||
// public Result<?> saveDatarule(@RequestBody JSONObject jsonObject) {
|
|
||||||
// try {
|
|
||||||
// String permissionId = jsonObject.getString("permissionId");
|
|
||||||
// String roleId = jsonObject.getString("roleId");
|
|
||||||
// String dataRuleIds = jsonObject.getString("dataRuleIds");
|
|
||||||
// log.info("保存数据规则>>"+"菜单ID:"+permissionId+"角色ID:"+ roleId+"数据权限ID:"+dataRuleIds);
|
|
||||||
// LambdaQueryWrapper<SysDepartRolePermission> query = new LambdaQueryWrapper<SysDepartRolePermission>()
|
|
||||||
// .eq(SysDepartRolePermission::getPermissionId, permissionId)
|
|
||||||
// .eq(SysDepartRolePermission::getRoleId,roleId);
|
|
||||||
// SysDepartRolePermission sysRolePermission = sysDepartRolePermissionService.getOne(query);
|
|
||||||
// if(sysRolePermission==null) {
|
|
||||||
// return Result.error("请先保存角色菜单权限!");
|
|
||||||
// }else {
|
|
||||||
// sysRolePermission.setDataRuleIds(dataRuleIds);
|
|
||||||
// this.sysDepartRolePermissionService.updateById(sysRolePermission);
|
|
||||||
// }
|
|
||||||
// } catch (Exception e) {
|
|
||||||
// log.error("SysRoleController.saveDatarule()发生异常:" + e.getMessage(),e);
|
|
||||||
// return Result.error("保存失败");
|
|
||||||
// }
|
|
||||||
// return Result.OK("保存成功!");
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// /**
|
|
||||||
// * 导出excel
|
|
||||||
// *
|
|
||||||
// * @param request
|
|
||||||
// * @param sysDepartRole
|
|
||||||
// */
|
|
||||||
// @RequestMapping(value = "/exportXls")
|
|
||||||
// public ModelAndView exportXls(HttpServletRequest request, SysDepartRole sysDepartRole) {
|
|
||||||
// return super.exportXls(request, sysDepartRole, SysDepartRole.class, "部门角色");
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// /**
|
|
||||||
// * 通过excel导入数据
|
|
||||||
// *
|
|
||||||
// * @param request
|
|
||||||
// * @param response
|
|
||||||
// * @return
|
|
||||||
// */
|
|
||||||
// @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
|
||||||
// public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
|
||||||
// return super.importExcel(request, response, SysDepartRole.class);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
//}
|
|
||||||
+1
-33
@@ -4,7 +4,6 @@ package com.jero.modules.system.controller;
|
|||||||
import cn.hutool.core.util.RandomUtil;
|
import cn.hutool.core.util.RandomUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.alibaba.fastjson.JSONArray;
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
@@ -31,8 +30,6 @@ import com.jero.modules.system.model.SysUserSysDepartModel;
|
|||||||
import com.jero.modules.system.service.*;
|
import com.jero.modules.system.service.*;
|
||||||
import com.jero.modules.system.vo.SysDepartUsersVO;
|
import com.jero.modules.system.vo.SysDepartUsersVO;
|
||||||
import com.jero.modules.system.vo.SysUserRoleVO;
|
import com.jero.modules.system.vo.SysUserRoleVO;
|
||||||
import org.apache.shiro.subject.Subject;
|
|
||||||
import org.checkerframework.framework.qual.RequiresQualifier;
|
|
||||||
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
||||||
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
||||||
import org.jeecgframework.poi.excel.entity.ExportParams;
|
import org.jeecgframework.poi.excel.entity.ExportParams;
|
||||||
@@ -79,15 +76,6 @@ public class SysUserController {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private ISysUserDepartService sysUserDepartService;
|
private ISysUserDepartService sysUserDepartService;
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private ISysUserRoleService userRoleService;
|
|
||||||
|
|
||||||
// @Autowired
|
|
||||||
// private ISysDepartRoleUserService departRoleUserService;
|
|
||||||
|
|
||||||
// @Autowired
|
|
||||||
// private ISysDepartRoleService departRoleService;
|
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private RedisUtil redisUtil;
|
private RedisUtil redisUtil;
|
||||||
|
|
||||||
@@ -146,13 +134,11 @@ public class SysUserController {
|
|||||||
try {
|
try {
|
||||||
if (StrUtil.isNotEmpty(user.getEmail())){
|
if (StrUtil.isNotEmpty(user.getEmail())){
|
||||||
String email = CommonUtils.decryptBtRsaPriKey(user.getEmail(), rsaPrivateKey);
|
String email = CommonUtils.decryptBtRsaPriKey(user.getEmail(), rsaPrivateKey);
|
||||||
// email = PasswordUtil.encrypt(email);
|
|
||||||
user.setEmail(email);
|
user.setEmail(email);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (StrUtil.isNotEmpty(user.getPhone())){
|
if (StrUtil.isNotEmpty(user.getPhone())){
|
||||||
String phone = CommonUtils.decryptBtRsaPriKey(user.getPhone(), rsaPrivateKey);
|
String phone = CommonUtils.decryptBtRsaPriKey(user.getPhone(), rsaPrivateKey);
|
||||||
// phone = PasswordUtil.encrypt(phone);
|
|
||||||
user.setPhone(phone);
|
user.setPhone(phone);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -207,12 +193,9 @@ public class SysUserController {
|
|||||||
throw new JeroBootException("解密失败!", e);
|
throw new JeroBootException("解密失败!", e);
|
||||||
}
|
}
|
||||||
// 3:把数据加密在放回来
|
// 3:把数据加密在放回来
|
||||||
// email = PasswordUtil.encrypt(email);
|
|
||||||
// phone = PasswordUtil.encrypt(phone);
|
|
||||||
user.setEmail(email);
|
user.setEmail(email);
|
||||||
user.setPhone(phone);
|
user.setPhone(phone);
|
||||||
user.setUpdateTime(new Date());
|
user.setUpdateTime(new Date());
|
||||||
//String passwordEncode = PasswordUtil.encrypt(user.getUsername(), user.getPassword(), sysUser.getSalt());
|
|
||||||
user.setPassword(sysUser.getPassword());
|
user.setPassword(sysUser.getPassword());
|
||||||
// 修改用户走一个service 保证事务
|
// 修改用户走一个service 保证事务
|
||||||
sysUserService.editUser(user, roles, departs);
|
sysUserService.editUser(user, roles, departs);
|
||||||
@@ -780,18 +763,7 @@ public class SysUserController {
|
|||||||
QueryWrapper<SysUserDepart> queryWrapper = new QueryWrapper<SysUserDepart>();
|
QueryWrapper<SysUserDepart> queryWrapper = new QueryWrapper<SysUserDepart>();
|
||||||
queryWrapper.eq("dep_id", depId).eq("user_id",userId);
|
queryWrapper.eq("dep_id", depId).eq("user_id",userId);
|
||||||
sysUserDepartService.remove(queryWrapper);
|
sysUserDepartService.remove(queryWrapper);
|
||||||
// if(b){
|
return Result.OK("删除成功!");
|
||||||
// List<SysDepartRole> sysDepartRoleList = departRoleService.list(new QueryWrapper<SysDepartRole>().eq("depart_id",depId));
|
|
||||||
// List<String> roleIds = sysDepartRoleList.stream().map(SysDepartRole::getId).collect(Collectors.toList());
|
|
||||||
// if(roleIds != null && roleIds.size()>0){
|
|
||||||
// QueryWrapper<SysDepartRoleUser> query = new QueryWrapper<>();
|
|
||||||
// query.eq("user_id",userId).in("drole_id",roleIds);
|
|
||||||
// departRoleUserService.remove(query);
|
|
||||||
// }
|
|
||||||
return Result.OK("删除成功!");
|
|
||||||
// }else{
|
|
||||||
// return Result.error500("当前选中部门与用户无关联关系!");
|
|
||||||
// }
|
|
||||||
}catch(Exception e) {
|
}catch(Exception e) {
|
||||||
log.error(e.getMessage(), e);
|
log.error(e.getMessage(), e);
|
||||||
return Result.error500("删除失败!");
|
return Result.error500("删除失败!");
|
||||||
@@ -809,9 +781,6 @@ public class SysUserController {
|
|||||||
QueryWrapper<SysUserDepart> queryWrapper = new QueryWrapper<SysUserDepart>();
|
QueryWrapper<SysUserDepart> queryWrapper = new QueryWrapper<SysUserDepart>();
|
||||||
queryWrapper.eq("dep_id", depId).in("user_id",Arrays.asList(userIds.split(",")));
|
queryWrapper.eq("dep_id", depId).in("user_id",Arrays.asList(userIds.split(",")));
|
||||||
sysUserDepartService.remove(queryWrapper);
|
sysUserDepartService.remove(queryWrapper);
|
||||||
// if(b){
|
|
||||||
// departRoleUserService.removeDeptRoleUser(Arrays.asList(userIds.split(",")),depId);
|
|
||||||
// }
|
|
||||||
return Result.OK("删除成功!");
|
return Result.OK("删除成功!");
|
||||||
}catch(Exception e) {
|
}catch(Exception e) {
|
||||||
log.error(e.getMessage(), e);
|
log.error(e.getMessage(), e);
|
||||||
@@ -1043,7 +1012,6 @@ public class SysUserController {
|
|||||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||||
@RequestParam(name = "syncFlow", required = false) String syncFlow) {
|
@RequestParam(name = "syncFlow", required = false) String syncFlow) {
|
||||||
try {
|
try {
|
||||||
//TODO 从查询效率上将不要用mp的封装的page分页查询 建议自己写分页语句
|
|
||||||
LambdaQueryWrapper<SysUser> query = new LambdaQueryWrapper<SysUser>();
|
LambdaQueryWrapper<SysUser> query = new LambdaQueryWrapper<SysUser>();
|
||||||
if(oConvertUtils.isNotEmpty(syncFlow)){
|
if(oConvertUtils.isNotEmpty(syncFlow)){
|
||||||
query.eq(SysUser::getActivitiSync, CommonConstant.ACT_SYNC_1);
|
query.eq(SysUser::getActivitiSync, CommonConstant.ACT_SYNC_1);
|
||||||
|
|||||||
-75
@@ -1,75 +0,0 @@
|
|||||||
//package com.jero.modules.system.entity;
|
|
||||||
//
|
|
||||||
//import java.io.Serializable;
|
|
||||||
//import java.util.Date;
|
|
||||||
//import com.baomidou.mybatisplus.annotation.IdType;
|
|
||||||
//import com.baomidou.mybatisplus.annotation.TableId;
|
|
||||||
//import com.baomidou.mybatisplus.annotation.TableName;
|
|
||||||
//import com.baomidou.mybatisplus.annotation.TableField;
|
|
||||||
//import io.swagger.annotations.ApiModel;
|
|
||||||
//import io.swagger.annotations.ApiModelProperty;
|
|
||||||
//import lombok.Data;
|
|
||||||
//import lombok.EqualsAndHashCode;
|
|
||||||
//import lombok.experimental.Accessors;
|
|
||||||
//import com.fasterxml.jackson.annotation.JsonFormat;
|
|
||||||
//import com.jero.common.aspect.annotation.Dict;
|
|
||||||
//import org.springframework.format.annotation.DateTimeFormat;
|
|
||||||
//import org.jeecgframework.poi.excel.annotation.Excel;
|
|
||||||
//
|
|
||||||
///**
|
|
||||||
// * @Description: 部门角色
|
|
||||||
// * @Author: jero-boot
|
|
||||||
// * @Date: 2020-02-12
|
|
||||||
// * @Version: V1.0
|
|
||||||
// */
|
|
||||||
//@Data
|
|
||||||
//@TableName("sys_depart_role")
|
|
||||||
//@EqualsAndHashCode(callSuper = false)
|
|
||||||
//@Accessors(chain = true)
|
|
||||||
//@ApiModel(value="sys_depart_role对象", description="部门角色")
|
|
||||||
//public class SysDepartRole {
|
|
||||||
//
|
|
||||||
// /**id*/
|
|
||||||
// @TableId(type = IdType.ASSIGN_ID)
|
|
||||||
// @ApiModelProperty(value = "id")
|
|
||||||
// private java.lang.String id;
|
|
||||||
// /**部门id*/
|
|
||||||
// @Excel(name = "部门id", width = 15)
|
|
||||||
// @ApiModelProperty(value = "部门id")
|
|
||||||
// @Dict(dictTable ="sys_depart",dicText = "depart_name",dicCode = "id")
|
|
||||||
// private java.lang.String departId;
|
|
||||||
// /**部门角色名称*/
|
|
||||||
// @Excel(name = "部门角色名称", width = 15)
|
|
||||||
// @ApiModelProperty(value = "部门角色名称")
|
|
||||||
// private java.lang.String roleName;
|
|
||||||
// /**部门角色编码*/
|
|
||||||
// @Excel(name = "部门角色编码", width = 15)
|
|
||||||
// @ApiModelProperty(value = "部门角色编码")
|
|
||||||
// private java.lang.String roleCode;
|
|
||||||
// /**描述*/
|
|
||||||
// @Excel(name = "描述", width = 15)
|
|
||||||
// @ApiModelProperty(value = "描述")
|
|
||||||
// private java.lang.String description;
|
|
||||||
// /**创建人*/
|
|
||||||
// @Excel(name = "创建人", width = 15)
|
|
||||||
// @ApiModelProperty(value = "创建人")
|
|
||||||
// private java.lang.String createBy;
|
|
||||||
// /**创建时间*/
|
|
||||||
// @Excel(name = "创建时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
|
|
||||||
// @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
|
||||||
// @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
|
||||||
// @ApiModelProperty(value = "创建时间")
|
|
||||||
// private java.util.Date createTime;
|
|
||||||
// /**更新人*/
|
|
||||||
// @Excel(name = "更新人", width = 15)
|
|
||||||
// @ApiModelProperty(value = "更新人")
|
|
||||||
// private java.lang.String updateBy;
|
|
||||||
// /**更新时间*/
|
|
||||||
// @Excel(name = "更新时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
|
|
||||||
// @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
|
||||||
// @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
|
||||||
// @ApiModelProperty(value = "更新时间")
|
|
||||||
// private java.util.Date updateTime;
|
|
||||||
//
|
|
||||||
//
|
|
||||||
//}
|
|
||||||
-67
@@ -1,67 +0,0 @@
|
|||||||
//package com.jero.modules.system.entity;
|
|
||||||
//
|
|
||||||
//import java.io.Serializable;
|
|
||||||
//import java.util.Date;
|
|
||||||
//import com.baomidou.mybatisplus.annotation.IdType;
|
|
||||||
//import com.baomidou.mybatisplus.annotation.TableId;
|
|
||||||
//import com.baomidou.mybatisplus.annotation.TableName;
|
|
||||||
//import com.baomidou.mybatisplus.annotation.TableField;
|
|
||||||
//import io.swagger.annotations.ApiModel;
|
|
||||||
//import io.swagger.annotations.ApiModelProperty;
|
|
||||||
//import lombok.Data;
|
|
||||||
//import lombok.EqualsAndHashCode;
|
|
||||||
//import lombok.experimental.Accessors;
|
|
||||||
//import com.fasterxml.jackson.annotation.JsonFormat;
|
|
||||||
//import org.springframework.format.annotation.DateTimeFormat;
|
|
||||||
//import org.jeecgframework.poi.excel.annotation.Excel;
|
|
||||||
//
|
|
||||||
///**
|
|
||||||
// * @Description: 部门角色权限
|
|
||||||
// * @Author: jero-boot
|
|
||||||
// * @Date: 2020-02-12
|
|
||||||
// * @Version: V1.0
|
|
||||||
// */
|
|
||||||
//@Data
|
|
||||||
//@TableName("sys_depart_role_permission")
|
|
||||||
//@EqualsAndHashCode(callSuper = false)
|
|
||||||
//@Accessors(chain = true)
|
|
||||||
//@ApiModel(value="sys_depart_role_permission对象", description="部门角色权限")
|
|
||||||
//public class SysDepartRolePermission {
|
|
||||||
//
|
|
||||||
// /**id*/
|
|
||||||
// @TableId(type = IdType.ASSIGN_ID)
|
|
||||||
// @ApiModelProperty(value = "id")
|
|
||||||
// private java.lang.String id;
|
|
||||||
// /**部门id*/
|
|
||||||
// @Excel(name = "部门id", width = 15)
|
|
||||||
// @ApiModelProperty(value = "部门id")
|
|
||||||
// private java.lang.String departId;
|
|
||||||
// /**角色id*/
|
|
||||||
// @Excel(name = "角色id", width = 15)
|
|
||||||
// @ApiModelProperty(value = "角色id")
|
|
||||||
// private java.lang.String roleId;
|
|
||||||
// /**权限id*/
|
|
||||||
// @Excel(name = "权限id", width = 15)
|
|
||||||
// @ApiModelProperty(value = "权限id")
|
|
||||||
// private java.lang.String permissionId;
|
|
||||||
// /**dataRuleIds*/
|
|
||||||
// @Excel(name = "dataRuleIds", width = 15)
|
|
||||||
// @ApiModelProperty(value = "dataRuleIds")
|
|
||||||
// private java.lang.String dataRuleIds;
|
|
||||||
// /** 操作时间 */
|
|
||||||
// @Excel(name = "操作时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
|
|
||||||
// @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
|
||||||
// @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
|
||||||
// @ApiModelProperty(value = "操作时间")
|
|
||||||
// private java.util.Date operateDate;
|
|
||||||
// /** 操作ip */
|
|
||||||
// private java.lang.String operateIp;
|
|
||||||
//
|
|
||||||
// public SysDepartRolePermission() {
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// public SysDepartRolePermission(String roleId, String permissionId) {
|
|
||||||
// this.roleId = roleId;
|
|
||||||
// this.permissionId = permissionId;
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
-52
@@ -1,52 +0,0 @@
|
|||||||
//package com.jero.modules.system.entity;
|
|
||||||
//
|
|
||||||
//import java.io.Serializable;
|
|
||||||
//import java.util.Date;
|
|
||||||
//import com.baomidou.mybatisplus.annotation.IdType;
|
|
||||||
//import com.baomidou.mybatisplus.annotation.TableId;
|
|
||||||
//import com.baomidou.mybatisplus.annotation.TableName;
|
|
||||||
//import com.baomidou.mybatisplus.annotation.TableField;
|
|
||||||
//import io.swagger.annotations.ApiModel;
|
|
||||||
//import io.swagger.annotations.ApiModelProperty;
|
|
||||||
//import lombok.Data;
|
|
||||||
//import lombok.EqualsAndHashCode;
|
|
||||||
//import lombok.experimental.Accessors;
|
|
||||||
//import com.fasterxml.jackson.annotation.JsonFormat;
|
|
||||||
//import org.springframework.format.annotation.DateTimeFormat;
|
|
||||||
//import org.jeecgframework.poi.excel.annotation.Excel;
|
|
||||||
//
|
|
||||||
///**
|
|
||||||
// * @Description: 部门角色人员信息
|
|
||||||
// * @Author: jero-boot
|
|
||||||
// * @Date: 2020-02-13
|
|
||||||
// * @Version: V1.0
|
|
||||||
// */
|
|
||||||
//@Data
|
|
||||||
//@TableName("sys_depart_role_user")
|
|
||||||
//@EqualsAndHashCode(callSuper = false)
|
|
||||||
//@Accessors(chain = true)
|
|
||||||
//@ApiModel(value="sys_depart_role_user对象", description="部门角色人员信息")
|
|
||||||
//public class SysDepartRoleUser {
|
|
||||||
//
|
|
||||||
// /**主键id*/
|
|
||||||
// @TableId(type = IdType.ASSIGN_ID)
|
|
||||||
// @ApiModelProperty(value = "主键id")
|
|
||||||
// private java.lang.String id;
|
|
||||||
// /**用户id*/
|
|
||||||
// @Excel(name = "用户id", width = 15)
|
|
||||||
// @ApiModelProperty(value = "用户id")
|
|
||||||
// private java.lang.String userId;
|
|
||||||
// /**角色id*/
|
|
||||||
// @Excel(name = "角色id", width = 15)
|
|
||||||
// @ApiModelProperty(value = "角色id")
|
|
||||||
// private java.lang.String droleId;
|
|
||||||
//
|
|
||||||
// public SysDepartRoleUser() {
|
|
||||||
//
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// public SysDepartRoleUser(String userId, String droleId) {
|
|
||||||
// this.userId = userId;
|
|
||||||
// this.droleId = droleId;
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
-23
@@ -1,23 +0,0 @@
|
|||||||
//package com.jero.modules.system.mapper;
|
|
||||||
//
|
|
||||||
//import java.util.List;
|
|
||||||
//
|
|
||||||
//import org.apache.ibatis.annotations.Param;
|
|
||||||
//import com.jero.modules.system.entity.SysDepartRole;
|
|
||||||
//import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|
||||||
//
|
|
||||||
///**
|
|
||||||
// * @Description: 部门角色
|
|
||||||
// * @Author: jero-boot
|
|
||||||
// * @Date: 2020-02-12
|
|
||||||
// * @Version: V1.0
|
|
||||||
// */
|
|
||||||
//public interface SysDepartRoleMapper extends BaseMapper<SysDepartRole> {
|
|
||||||
// /**
|
|
||||||
// * 根据用户id,部门id查询可授权所有部门角色
|
|
||||||
// * @param orgCode
|
|
||||||
// * @param userId
|
|
||||||
// * @return
|
|
||||||
// */
|
|
||||||
// public List<SysDepartRole> queryDeptRoleByDeptAndUser(@Param("orgCode") String orgCode, @Param("userId") String userId);
|
|
||||||
//}
|
|
||||||
-17
@@ -1,17 +0,0 @@
|
|||||||
//package com.jero.modules.system.mapper;
|
|
||||||
//
|
|
||||||
//import java.util.List;
|
|
||||||
//
|
|
||||||
//import org.apache.ibatis.annotations.Param;
|
|
||||||
//import com.jero.modules.system.entity.SysDepartRolePermission;
|
|
||||||
//import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|
||||||
//
|
|
||||||
///**
|
|
||||||
// * @Description: 部门角色权限
|
|
||||||
// * @Author: jero-boot
|
|
||||||
// * @Date: 2020-02-12
|
|
||||||
// * @Version: V1.0
|
|
||||||
// */
|
|
||||||
//public interface SysDepartRolePermissionMapper extends BaseMapper<SysDepartRolePermission> {
|
|
||||||
//
|
|
||||||
//}
|
|
||||||
-17
@@ -1,17 +0,0 @@
|
|||||||
//package com.jero.modules.system.mapper;
|
|
||||||
//
|
|
||||||
//import java.util.List;
|
|
||||||
//
|
|
||||||
//import org.apache.ibatis.annotations.Param;
|
|
||||||
//import com.jero.modules.system.entity.SysDepartRoleUser;
|
|
||||||
//import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|
||||||
//
|
|
||||||
///**
|
|
||||||
// * @Description: 部门角色人员信息
|
|
||||||
// * @Author: jero-boot
|
|
||||||
// * @Date: 2020-02-13
|
|
||||||
// * @Version: V1.0
|
|
||||||
// */
|
|
||||||
//public interface SysDepartRoleUserMapper extends BaseMapper<SysDepartRoleUser> {
|
|
||||||
//
|
|
||||||
//}
|
|
||||||
-20
@@ -1,20 +0,0 @@
|
|||||||
//package com.jero.modules.system.service;
|
|
||||||
//
|
|
||||||
//import com.jero.modules.system.entity.SysDepartRolePermission;
|
|
||||||
//import com.baomidou.mybatisplus.extension.service.IService;
|
|
||||||
//
|
|
||||||
///**
|
|
||||||
// * @Description: 部门角色权限
|
|
||||||
// * @Author: jero-boot
|
|
||||||
// * @Date: 2020-02-12
|
|
||||||
// * @Version: V1.0
|
|
||||||
// */
|
|
||||||
//public interface ISysDepartRolePermissionService extends IService<SysDepartRolePermission> {
|
|
||||||
// /**
|
|
||||||
// * 保存授权 将上次的权限和这次作比较 差异处理提高效率
|
|
||||||
// * @param roleId
|
|
||||||
// * @param permissionIds
|
|
||||||
// * @param lastPermissionIds
|
|
||||||
// */
|
|
||||||
// public void saveDeptRolePermission(String roleId,String permissionIds,String lastPermissionIds);
|
|
||||||
//}
|
|
||||||
-24
@@ -1,24 +0,0 @@
|
|||||||
//package com.jero.modules.system.service;
|
|
||||||
//
|
|
||||||
//import com.jero.modules.system.entity.SysDepartRole;
|
|
||||||
//import com.baomidou.mybatisplus.extension.service.IService;
|
|
||||||
//
|
|
||||||
//import java.util.List;
|
|
||||||
//
|
|
||||||
///**
|
|
||||||
// * @Description: 部门角色
|
|
||||||
// * @Author: jero-boot
|
|
||||||
// * @Date: 2020-02-12
|
|
||||||
// * @Version: V1.0
|
|
||||||
// */
|
|
||||||
//public interface ISysDepartRoleService extends IService<SysDepartRole> {
|
|
||||||
//
|
|
||||||
// /**
|
|
||||||
// * 根据用户id,部门id查询可授权所有部门角色
|
|
||||||
// * @param orgCode
|
|
||||||
// * @param userId
|
|
||||||
// * @return
|
|
||||||
// */
|
|
||||||
// List<SysDepartRole> queryDeptRoleByDeptAndUser(String orgCode, String userId);
|
|
||||||
//
|
|
||||||
//}
|
|
||||||
-24
@@ -1,24 +0,0 @@
|
|||||||
//package com.jero.modules.system.service;
|
|
||||||
//
|
|
||||||
//import com.jero.modules.system.entity.SysDepartRoleUser;
|
|
||||||
//import com.baomidou.mybatisplus.extension.service.IService;
|
|
||||||
//
|
|
||||||
//import java.util.List;
|
|
||||||
//
|
|
||||||
///**
|
|
||||||
// * @Description: 部门角色人员信息
|
|
||||||
// * @Author: jero-boot
|
|
||||||
// * @Date: 2020-02-13
|
|
||||||
// * @Version: V1.0
|
|
||||||
// */
|
|
||||||
//public interface ISysDepartRoleUserService extends IService<SysDepartRoleUser> {
|
|
||||||
//
|
|
||||||
// void deptRoleUserAdd(String userId,String newRoleId,String oldRoleId);
|
|
||||||
//
|
|
||||||
// /**
|
|
||||||
// * 取消用户与部门关联,删除关联关系
|
|
||||||
// * @param userIds
|
|
||||||
// * @param depId
|
|
||||||
// */
|
|
||||||
// void removeDeptRoleUser(List<String> userIds,String depId);
|
|
||||||
//}
|
|
||||||
+1
-16
@@ -4,12 +4,8 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.jero.common.util.oConvertUtils;
|
import com.jero.common.util.oConvertUtils;
|
||||||
import com.jero.modules.system.entity.SysDepartPermission;
|
import com.jero.modules.system.entity.SysDepartPermission;
|
||||||
//import com.jero.modules.system.entity.SysDepartRole;
|
|
||||||
//import com.jero.modules.system.entity.SysDepartRolePermission;
|
|
||||||
import com.jero.modules.system.entity.SysPermissionDataRule;
|
import com.jero.modules.system.entity.SysPermissionDataRule;
|
||||||
import com.jero.modules.system.mapper.SysDepartPermissionMapper;
|
import com.jero.modules.system.mapper.SysDepartPermissionMapper;
|
||||||
//import com.jero.modules.system.mapper.SysDepartRoleMapper;
|
|
||||||
//import com.jero.modules.system.mapper.SysDepartRolePermissionMapper;
|
|
||||||
import com.jero.modules.system.mapper.SysPermissionDataRuleMapper;
|
import com.jero.modules.system.mapper.SysPermissionDataRuleMapper;
|
||||||
import com.jero.modules.system.service.ISysDepartPermissionService;
|
import com.jero.modules.system.service.ISysDepartPermissionService;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
@@ -29,15 +25,10 @@ import java.util.stream.Collectors;
|
|||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
public class SysDepartPermissionServiceImpl extends ServiceImpl<SysDepartPermissionMapper, SysDepartPermission> implements ISysDepartPermissionService {
|
public class SysDepartPermissionServiceImpl extends ServiceImpl<SysDepartPermissionMapper, SysDepartPermission> implements ISysDepartPermissionService {
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private SysPermissionDataRuleMapper ruleMapper;
|
private SysPermissionDataRuleMapper ruleMapper;
|
||||||
|
|
||||||
// @Resource
|
|
||||||
// private SysDepartRoleMapper sysDepartRoleMapper;
|
|
||||||
|
|
||||||
// @Resource
|
|
||||||
// private SysDepartRolePermissionMapper departRolePermissionMapper;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void saveDepartPermission(String departId, String permissionIds, String lastPermissionIds) {
|
public void saveDepartPermission(String departId, String permissionIds, String lastPermissionIds) {
|
||||||
@@ -56,12 +47,6 @@ public class SysDepartPermissionServiceImpl extends ServiceImpl<SysDepartPermiss
|
|||||||
if(delete!=null && delete.size()>0) {
|
if(delete!=null && delete.size()>0) {
|
||||||
for (String permissionId : delete) {
|
for (String permissionId : delete) {
|
||||||
this.remove(new QueryWrapper<SysDepartPermission>().lambda().eq(SysDepartPermission::getDepartId, departId).eq(SysDepartPermission::getPermissionId, permissionId));
|
this.remove(new QueryWrapper<SysDepartPermission>().lambda().eq(SysDepartPermission::getDepartId, departId).eq(SysDepartPermission::getPermissionId, permissionId));
|
||||||
//删除部门权限时,删除部门角色中已授权的权限
|
|
||||||
// List<SysDepartRole> sysDepartRoleList = sysDepartRoleMapper.selectList(new LambdaQueryWrapper<SysDepartRole>().eq(SysDepartRole::getDepartId,departId));
|
|
||||||
// List<String> roleIds = sysDepartRoleList.stream().map(SysDepartRole::getId).collect(Collectors.toList());
|
|
||||||
// if(roleIds != null && roleIds.size()>0){
|
|
||||||
// departRolePermissionMapper.delete(new LambdaQueryWrapper<SysDepartRolePermission>().eq(SysDepartRolePermission::getPermissionId,permissionId));
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
-87
@@ -1,87 +0,0 @@
|
|||||||
//package com.jero.modules.system.service.impl;
|
|
||||||
//
|
|
||||||
//import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
||||||
//import com.jero.common.util.IPUtils;
|
|
||||||
//import com.jero.common.util.SpringContextUtils;
|
|
||||||
//import com.jero.common.util.oConvertUtils;
|
|
||||||
//import com.jero.modules.system.entity.SysDepartRolePermission;
|
|
||||||
//import com.jero.modules.system.mapper.SysDepartRolePermissionMapper;
|
|
||||||
//import com.jero.modules.system.service.ISysDepartRolePermissionService;
|
|
||||||
//import org.springframework.stereotype.Service;
|
|
||||||
//
|
|
||||||
//import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
||||||
//
|
|
||||||
//import javax.servlet.http.HttpServletRequest;
|
|
||||||
//import java.util.*;
|
|
||||||
//
|
|
||||||
///**
|
|
||||||
// * @Description: 部门角色权限
|
|
||||||
// * @Author: jero-boot
|
|
||||||
// * @Date: 2020-02-12
|
|
||||||
// * @Version: V1.0
|
|
||||||
// */
|
|
||||||
//@Service
|
|
||||||
//public class SysDepartRolePermissionServiceImpl extends ServiceImpl<SysDepartRolePermissionMapper, SysDepartRolePermission> implements ISysDepartRolePermissionService {
|
|
||||||
//
|
|
||||||
// @Override
|
|
||||||
// public void saveDeptRolePermission(String roleId, String permissionIds, String lastPermissionIds) {
|
|
||||||
// String ip = "";
|
|
||||||
// try {
|
|
||||||
// //获取request
|
|
||||||
// HttpServletRequest request = SpringContextUtils.getHttpServletRequest();
|
|
||||||
// //获取IP地址
|
|
||||||
// ip = IPUtils.getIpAddr(request);
|
|
||||||
// } catch (Exception e) {
|
|
||||||
// ip = "127.0.0.1";
|
|
||||||
// }
|
|
||||||
// List<String> add = getDiff(lastPermissionIds,permissionIds);
|
|
||||||
// if(add!=null && add.size()>0) {
|
|
||||||
// List<SysDepartRolePermission> list = new ArrayList<SysDepartRolePermission>();
|
|
||||||
// for (String p : add) {
|
|
||||||
// if(oConvertUtils.isNotEmpty(p)) {
|
|
||||||
// SysDepartRolePermission rolepms = new SysDepartRolePermission(roleId, p);
|
|
||||||
// rolepms.setOperateDate(new Date());
|
|
||||||
// rolepms.setOperateIp(ip);
|
|
||||||
// list.add(rolepms);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// this.saveBatch(list);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// List<String> delete = getDiff(permissionIds,lastPermissionIds);
|
|
||||||
// if(delete!=null && delete.size()>0) {
|
|
||||||
// for (String permissionId : delete) {
|
|
||||||
// this.remove(new QueryWrapper<SysDepartRolePermission>().lambda().eq(SysDepartRolePermission::getRoleId, roleId).eq(SysDepartRolePermission::getPermissionId, permissionId));
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// /**
|
|
||||||
// * 从diff中找出main中没有的元素
|
|
||||||
// * @param main
|
|
||||||
// * @param diff
|
|
||||||
// * @return
|
|
||||||
// */
|
|
||||||
// private List<String> getDiff(String main, String diff){
|
|
||||||
// if(oConvertUtils.isEmpty(diff)) {
|
|
||||||
// return null;
|
|
||||||
// }
|
|
||||||
// if(oConvertUtils.isEmpty(main)) {
|
|
||||||
// return Arrays.asList(diff.split(","));
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// String[] mainArr = main.split(",");
|
|
||||||
// String[] diffArr = diff.split(",");
|
|
||||||
// Map<String, Integer> map = new HashMap<>();
|
|
||||||
// for (String string : mainArr) {
|
|
||||||
// map.put(string, 1);
|
|
||||||
// }
|
|
||||||
// List<String> res = new ArrayList<String>();
|
|
||||||
// for (String key : diffArr) {
|
|
||||||
// if(oConvertUtils.isNotEmpty(key) && !map.containsKey(key)) {
|
|
||||||
// res.add(key);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// return res;
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
-25
@@ -1,25 +0,0 @@
|
|||||||
//package com.jero.modules.system.service.impl;
|
|
||||||
//
|
|
||||||
//import com.jero.modules.system.entity.SysDepartRole;
|
|
||||||
//import com.jero.modules.system.mapper.SysDepartRoleMapper;
|
|
||||||
//import com.jero.modules.system.service.ISysDepartRoleService;
|
|
||||||
//import org.springframework.stereotype.Service;
|
|
||||||
//
|
|
||||||
//import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
||||||
//
|
|
||||||
//import java.util.List;
|
|
||||||
//
|
|
||||||
///**
|
|
||||||
// * @Description: 部门角色
|
|
||||||
// * @Author: jero-boot
|
|
||||||
// * @Date: 2020-02-12
|
|
||||||
// * @Version: V1.0
|
|
||||||
// */
|
|
||||||
//@Service
|
|
||||||
//public class SysDepartRoleServiceImpl extends ServiceImpl<SysDepartRoleMapper, SysDepartRole> implements ISysDepartRoleService {
|
|
||||||
//
|
|
||||||
// @Override
|
|
||||||
// public List<SysDepartRole> queryDeptRoleByDeptAndUser(String orgCode, String userId) {
|
|
||||||
// return this.baseMapper.queryDeptRoleByDeptAndUser(orgCode,userId);
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
-93
@@ -1,93 +0,0 @@
|
|||||||
//package com.jero.modules.system.service.impl;
|
|
||||||
//
|
|
||||||
//import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
||||||
//import com.jero.common.util.oConvertUtils;
|
|
||||||
//import com.jero.modules.system.entity.SysDepartRole;
|
|
||||||
//import com.jero.modules.system.entity.SysDepartRoleUser;
|
|
||||||
//import com.jero.modules.system.mapper.SysDepartRoleMapper;
|
|
||||||
//import com.jero.modules.system.mapper.SysDepartRoleUserMapper;
|
|
||||||
//import com.jero.modules.system.service.ISysDepartRoleUserService;
|
|
||||||
//import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
//import org.springframework.stereotype.Service;
|
|
||||||
//
|
|
||||||
//import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
||||||
//import org.springframework.transaction.annotation.Transactional;
|
|
||||||
//
|
|
||||||
//import java.util.*;
|
|
||||||
//import java.util.stream.Collectors;
|
|
||||||
//
|
|
||||||
///**
|
|
||||||
// * @Description: 部门角色人员信息
|
|
||||||
// * @Author: jero-boot
|
|
||||||
// * @Date: 2020-02-13
|
|
||||||
// * @Version: V1.0
|
|
||||||
// */
|
|
||||||
//@Service
|
|
||||||
//public class SysDepartRoleUserServiceImpl extends ServiceImpl<SysDepartRoleUserMapper, SysDepartRoleUser> implements ISysDepartRoleUserService {
|
|
||||||
// @Autowired
|
|
||||||
// private SysDepartRoleMapper sysDepartRoleMapper;
|
|
||||||
//
|
|
||||||
// @Override
|
|
||||||
// public void deptRoleUserAdd(String userId, String newRoleId, String oldRoleId) {
|
|
||||||
// List<String> add = getDiff(oldRoleId,newRoleId);
|
|
||||||
// if(add!=null && add.size()>0) {
|
|
||||||
// List<SysDepartRoleUser> list = new ArrayList<>();
|
|
||||||
// for (String roleId : add) {
|
|
||||||
// if(oConvertUtils.isNotEmpty(roleId)) {
|
|
||||||
// SysDepartRoleUser rolepms = new SysDepartRoleUser(userId, roleId);
|
|
||||||
// list.add(rolepms);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// this.saveBatch(list);
|
|
||||||
// }
|
|
||||||
// List<String> remove = getDiff(newRoleId,oldRoleId);
|
|
||||||
// if(remove!=null && remove.size()>0) {
|
|
||||||
// for (String roleId : remove) {
|
|
||||||
// this.remove(new QueryWrapper<SysDepartRoleUser>().lambda().eq(SysDepartRoleUser::getUserId, userId).eq(SysDepartRoleUser::getDroleId, roleId));
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @Override
|
|
||||||
// @Transactional(rollbackFor = Exception.class)
|
|
||||||
// public void removeDeptRoleUser(List<String> userIds, String depId) {
|
|
||||||
// for(String userId : userIds){
|
|
||||||
// List<SysDepartRole> sysDepartRoleList = sysDepartRoleMapper.selectList(new QueryWrapper<SysDepartRole>().eq("depart_id",depId));
|
|
||||||
// List<String> roleIds = sysDepartRoleList.stream().map(SysDepartRole::getId).collect(Collectors.toList());
|
|
||||||
// if(roleIds != null && roleIds.size()>0){
|
|
||||||
// QueryWrapper<SysDepartRoleUser> query = new QueryWrapper<>();
|
|
||||||
// query.eq("user_id",userId).in("drole_id",roleIds);
|
|
||||||
// this.remove(query);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// /**
|
|
||||||
// * 从diff中找出main中没有的元素
|
|
||||||
// * @param main
|
|
||||||
// * @param diff
|
|
||||||
// * @return
|
|
||||||
// */
|
|
||||||
// private List<String> getDiff(String main, String diff){
|
|
||||||
// if(oConvertUtils.isEmpty(diff)) {
|
|
||||||
// return null;
|
|
||||||
// }
|
|
||||||
// if(oConvertUtils.isEmpty(main)) {
|
|
||||||
// return Arrays.asList(diff.split(","));
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// String[] mainArr = main.split(",");
|
|
||||||
// String[] diffArr = diff.split(",");
|
|
||||||
// Map<String, Integer> map = new HashMap<>();
|
|
||||||
// for (String string : mainArr) {
|
|
||||||
// map.put(string, 1);
|
|
||||||
// }
|
|
||||||
// List<String> res = new ArrayList<String>();
|
|
||||||
// for (String key : diffArr) {
|
|
||||||
// if(oConvertUtils.isNotEmpty(key) && !map.containsKey(key)) {
|
|
||||||
// res.add(key);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// return res;
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
-53
@@ -41,16 +41,8 @@ public class SysDepartServiceImpl extends ServiceImpl<SysDepartMapper, SysDepart
|
|||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private SysUserDepartMapper userDepartMapper;
|
private SysUserDepartMapper userDepartMapper;
|
||||||
// @Autowired
|
|
||||||
// private SysDepartRoleMapper sysDepartRoleMapper;
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private SysDepartPermissionMapper departPermissionMapper;
|
private SysDepartPermissionMapper departPermissionMapper;
|
||||||
// @Autowired
|
|
||||||
// private SysDepartRolePermissionMapper departRolePermissionMapper;
|
|
||||||
// @Autowired
|
|
||||||
// private SysDepartRoleUserMapper departRoleUserMapper;
|
|
||||||
@Autowired
|
|
||||||
private SysUserMapper sysUserMapper;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<SysDepartTreeModel> queryMyDeptTreeList(String departIds) {
|
public List<SysDepartTreeModel> queryMyDeptTreeList(String departIds) {
|
||||||
@@ -199,19 +191,6 @@ public class SysDepartServiceImpl extends ServiceImpl<SysDepartMapper, SysDepart
|
|||||||
//update-end--Author:Steve Date:20190201 for:组织机构添加数据代码调整
|
//update-end--Author:Steve Date:20190201 for:组织机构添加数据代码调整
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* removeDepartDataById 对应 delete方法 根据ID删除相关部门数据
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
* @Override
|
|
||||||
*
|
|
||||||
* @Transactional public boolean removeDepartDataById(String id) {
|
|
||||||
* System.out.println("要删除的ID 为=============================>>>>>"+id); boolean
|
|
||||||
* flag = this.removeById(id); return flag; }
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* updateDepartDataById 对应 edit 根据部门主键来更新对应的部门数据
|
* updateDepartDataById 对应 edit 根据部门主键来更新对应的部门数据
|
||||||
*/
|
*/
|
||||||
@@ -238,26 +217,10 @@ public class SysDepartServiceImpl extends ServiceImpl<SysDepartMapper, SysDepart
|
|||||||
this.checkChildrenExists(id, idList);
|
this.checkChildrenExists(id, idList);
|
||||||
}
|
}
|
||||||
this.removeByIds(idList);
|
this.removeByIds(idList);
|
||||||
//根据部门id获取部门角色id
|
|
||||||
List<String> roleIdList = new ArrayList<>();
|
|
||||||
// LambdaQueryWrapper<SysDepartRole> query = new LambdaQueryWrapper<>();
|
|
||||||
// query.select(SysDepartRole::getId).in(SysDepartRole::getDepartId, idList);
|
|
||||||
// List<SysDepartRole> depRoleList = sysDepartRoleMapper.selectList(query);
|
|
||||||
// for(SysDepartRole deptRole : depRoleList){
|
|
||||||
// roleIdList.add(deptRole.getId());
|
|
||||||
// }
|
|
||||||
//根据部门id删除用户与部门关系
|
//根据部门id删除用户与部门关系
|
||||||
userDepartMapper.delete(new LambdaQueryWrapper<SysUserDepart>().in(SysUserDepart::getDepId,idList));
|
userDepartMapper.delete(new LambdaQueryWrapper<SysUserDepart>().in(SysUserDepart::getDepId,idList));
|
||||||
//根据部门id删除部门授权
|
//根据部门id删除部门授权
|
||||||
departPermissionMapper.delete(new LambdaQueryWrapper<SysDepartPermission>().in(SysDepartPermission::getDepartId,idList));
|
departPermissionMapper.delete(new LambdaQueryWrapper<SysDepartPermission>().in(SysDepartPermission::getDepartId,idList));
|
||||||
//根据部门id删除部门角色
|
|
||||||
// sysDepartRoleMapper.delete(new LambdaQueryWrapper<SysDepartRole>().in(SysDepartRole::getDepartId,idList));
|
|
||||||
// if(roleIdList != null && roleIdList.size()>0){
|
|
||||||
//根据角色id删除部门角色授权
|
|
||||||
// departRolePermissionMapper.delete(new LambdaQueryWrapper<SysDepartRolePermission>().in(SysDepartRolePermission::getRoleId,roleIdList));
|
|
||||||
//根据角色id删除部门角色用户信息
|
|
||||||
// departRoleUserMapper.delete(new LambdaQueryWrapper<SysDepartRoleUser>().in(SysDepartRoleUser::getDroleId,roleIdList));
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -328,26 +291,10 @@ public class SysDepartServiceImpl extends ServiceImpl<SysDepartMapper, SysDepart
|
|||||||
//清空部门树内存
|
//清空部门树内存
|
||||||
//FindsDepartsChildrenUtil.clearDepartIdModel();
|
//FindsDepartsChildrenUtil.clearDepartIdModel();
|
||||||
boolean ok = this.removeByIds(idList);
|
boolean ok = this.removeByIds(idList);
|
||||||
//根据部门id获取部门角色id
|
|
||||||
// List<String> roleIdList = new ArrayList<>();
|
|
||||||
// LambdaQueryWrapper<SysDepartRole> query = new LambdaQueryWrapper<>();
|
|
||||||
// query.select(SysDepartRole::getId).in(SysDepartRole::getDepartId, idList);
|
|
||||||
// List<SysDepartRole> depRoleList = sysDepartRoleMapper.selectList(query);
|
|
||||||
// for(SysDepartRole deptRole : depRoleList){
|
|
||||||
// roleIdList.add(deptRole.getId());
|
|
||||||
// }
|
|
||||||
//根据部门id删除用户与部门关系
|
//根据部门id删除用户与部门关系
|
||||||
userDepartMapper.delete(new LambdaQueryWrapper<SysUserDepart>().in(SysUserDepart::getDepId,idList));
|
userDepartMapper.delete(new LambdaQueryWrapper<SysUserDepart>().in(SysUserDepart::getDepId,idList));
|
||||||
//根据部门id删除部门授权
|
//根据部门id删除部门授权
|
||||||
departPermissionMapper.delete(new LambdaQueryWrapper<SysDepartPermission>().in(SysDepartPermission::getDepartId,idList));
|
departPermissionMapper.delete(new LambdaQueryWrapper<SysDepartPermission>().in(SysDepartPermission::getDepartId,idList));
|
||||||
//根据部门id删除部门角色
|
|
||||||
// sysDepartRoleMapper.delete(new LambdaQueryWrapper<SysDepartRole>().in(SysDepartRole::getDepartId,idList));
|
|
||||||
// if(roleIdList != null && roleIdList.size()>0){
|
|
||||||
// 根据角色id删除部门角色授权
|
|
||||||
// departRolePermissionMapper.delete(new LambdaQueryWrapper<SysDepartRolePermission>().in(SysDepartRolePermission::getRoleId,roleIdList));
|
|
||||||
// 根据角色id删除部门角色用户信息
|
|
||||||
// departRoleUserMapper.delete(new LambdaQueryWrapper<SysDepartRoleUser>().in(SysDepartRoleUser::getDroleId,roleIdList));
|
|
||||||
// }
|
|
||||||
return ok;
|
return ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-9
@@ -14,7 +14,6 @@ import com.jero.common.util.oConvertUtils;
|
|||||||
import com.jero.modules.system.entity.SysPermission;
|
import com.jero.modules.system.entity.SysPermission;
|
||||||
import com.jero.modules.system.entity.SysPermissionDataRule;
|
import com.jero.modules.system.entity.SysPermissionDataRule;
|
||||||
import com.jero.modules.system.mapper.SysDepartPermissionMapper;
|
import com.jero.modules.system.mapper.SysDepartPermissionMapper;
|
||||||
//import com.jero.modules.system.mapper.SysDepartRolePermissionMapper;
|
|
||||||
import com.jero.modules.system.mapper.SysPermissionMapper;
|
import com.jero.modules.system.mapper.SysPermissionMapper;
|
||||||
import com.jero.modules.system.mapper.SysRolePermissionMapper;
|
import com.jero.modules.system.mapper.SysRolePermissionMapper;
|
||||||
import com.jero.modules.system.model.TreeModel;
|
import com.jero.modules.system.model.TreeModel;
|
||||||
@@ -52,9 +51,6 @@ public class SysPermissionServiceImpl extends ServiceImpl<SysPermissionMapper, S
|
|||||||
@Resource
|
@Resource
|
||||||
private SysDepartPermissionMapper sysDepartPermissionMapper;
|
private SysDepartPermissionMapper sysDepartPermissionMapper;
|
||||||
|
|
||||||
// @Resource
|
|
||||||
// private SysDepartRolePermissionMapper sysDepartRolePermissionMapper;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<TreeModel> queryListByParentId(String parentId) {
|
public List<TreeModel> queryListByParentId(String parentId) {
|
||||||
return sysPermissionMapper.queryListByParentId(parentId);
|
return sysPermissionMapper.queryListByParentId(parentId);
|
||||||
@@ -91,8 +87,6 @@ public class SysPermissionServiceImpl extends ServiceImpl<SysPermissionMapper, S
|
|||||||
sysRolePermissionMapper.deleteByMap(map);
|
sysRolePermissionMapper.deleteByMap(map);
|
||||||
//删除部门权限表
|
//删除部门权限表
|
||||||
sysDepartPermissionMapper.deleteByMap(map);
|
sysDepartPermissionMapper.deleteByMap(map);
|
||||||
//删除部门角色授权
|
|
||||||
// sysDepartRolePermissionMapper.deleteByMap(map);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -122,8 +116,7 @@ public class SysPermissionServiceImpl extends ServiceImpl<SysPermissionMapper, S
|
|||||||
sysRolePermissionMapper.deleteByMap(map);
|
sysRolePermissionMapper.deleteByMap(map);
|
||||||
//删除部门权限表
|
//删除部门权限表
|
||||||
sysDepartPermissionMapper.deleteByMap(map);
|
sysDepartPermissionMapper.deleteByMap(map);
|
||||||
//删除部门角色授权
|
|
||||||
// sysDepartRolePermissionMapper.deleteByMap(map);
|
|
||||||
num = this.count(new LambdaQueryWrapper<SysPermission>().eq(SysPermission::getParentId, id));
|
num = this.count(new LambdaQueryWrapper<SysPermission>().eq(SysPermission::getParentId, id));
|
||||||
// 如果有, 则递归
|
// 如果有, 则递归
|
||||||
if (num > 0) {
|
if (num > 0) {
|
||||||
@@ -138,7 +131,6 @@ public class SysPermissionServiceImpl extends ServiceImpl<SysPermissionMapper, S
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@CacheEvict(value = CacheConstant.SYS_DATA_PERMISSIONS_CACHE,allEntries=true)
|
@CacheEvict(value = CacheConstant.SYS_DATA_PERMISSIONS_CACHE,allEntries=true)
|
||||||
//@CacheEvict(value = CacheConstant.SYS_DATA_PERMISSIONS_CACHE,allEntries=true,condition="#sysPermission.menuType==2")
|
|
||||||
public void deletePermissionLogical(String id) throws JeroBootException {
|
public void deletePermissionLogical(String id) throws JeroBootException {
|
||||||
SysPermission sysPermission = this.getById(id);
|
SysPermission sysPermission = this.getById(id);
|
||||||
if(sysPermission==null) {
|
if(sysPermission==null) {
|
||||||
|
|||||||
+1
-44
@@ -56,10 +56,6 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
|||||||
private SysDepartMapper sysDepartMapper;
|
private SysDepartMapper sysDepartMapper;
|
||||||
@Autowired
|
@Autowired
|
||||||
private SysRoleMapper sysRoleMapper;
|
private SysRoleMapper sysRoleMapper;
|
||||||
// @Autowired
|
|
||||||
// private SysDepartRoleUserMapper departRoleUserMapper;
|
|
||||||
// @Autowired
|
|
||||||
// private SysDepartRoleMapper sysDepartRoleMapper;
|
|
||||||
@Resource
|
@Resource
|
||||||
private BaseCommonService baseCommonService;
|
private BaseCommonService baseCommonService;
|
||||||
|
|
||||||
@@ -177,10 +173,6 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
|||||||
Set<String> permissionSet = new HashSet<>();
|
Set<String> permissionSet = new HashSet<>();
|
||||||
List<SysPermission> permissionList = sysPermissionMapper.queryByUser(username);
|
List<SysPermission> permissionList = sysPermissionMapper.queryByUser(username);
|
||||||
for (SysPermission po : permissionList) {
|
for (SysPermission po : permissionList) {
|
||||||
// // TODO URL规则有问题?
|
|
||||||
// if (oConvertUtils.isNotEmpty(po.getUrl())) {
|
|
||||||
// permissionSet.add(po.getUrl());
|
|
||||||
// }
|
|
||||||
if (oConvertUtils.isNotEmpty(po.getPerms())) {
|
if (oConvertUtils.isNotEmpty(po.getPerms())) {
|
||||||
permissionSet.add(po.getPerms());
|
permissionSet.add(po.getPerms());
|
||||||
}
|
}
|
||||||
@@ -193,10 +185,6 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
|||||||
public SysUserCacheInfo getCacheUser(String username) {
|
public SysUserCacheInfo getCacheUser(String username) {
|
||||||
SysUserCacheInfo info = new SysUserCacheInfo();
|
SysUserCacheInfo info = new SysUserCacheInfo();
|
||||||
info.setOneDepart(true);
|
info.setOneDepart(true);
|
||||||
// SysUser user = userMapper.getUserByName(username);
|
|
||||||
// info.setSysUserCode(user.getUsername());
|
|
||||||
// info.setSysUserName(user.getRealname());
|
|
||||||
|
|
||||||
|
|
||||||
LoginUser user = sysBaseAPI.getUserByName(username);
|
LoginUser user = sysBaseAPI.getUserByName(username);
|
||||||
if(user!=null) {
|
if(user!=null) {
|
||||||
@@ -320,22 +308,6 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
|||||||
if(oConvertUtils.isNotEmpty(departs)){
|
if(oConvertUtils.isNotEmpty(departs)){
|
||||||
arr = departs.split(",");
|
arr = departs.split(",");
|
||||||
}
|
}
|
||||||
//查询已关联部门
|
|
||||||
/* List<SysUserDepart> userDepartList = sysUserDepartMapper.selectList(new QueryWrapper<SysUserDepart>().lambda().eq(SysUserDepart::getUserId, user.getId()));
|
|
||||||
if(userDepartList != null && userDepartList.size()>0){
|
|
||||||
for(SysUserDepart depart : userDepartList ){
|
|
||||||
//修改已关联部门删除部门用户角色关系
|
|
||||||
if(!Arrays.asList(arr).contains(depart.getDepId())){
|
|
||||||
List<SysDepartRole> sysDepartRoleList = sysDepartRoleMapper.selectList(
|
|
||||||
new QueryWrapper<SysDepartRole>().lambda().eq(SysDepartRole::getDepartId,depart.getDepId()));
|
|
||||||
List<String> roleIds = sysDepartRoleList.stream().map(SysDepartRole::getId).collect(Collectors.toList());
|
|
||||||
if(roleIds != null && roleIds.size()>0){
|
|
||||||
departRoleUserMapper.delete(new QueryWrapper<SysDepartRoleUser>().lambda().eq(SysDepartRoleUser::getUserId, user.getId())
|
|
||||||
.in(SysDepartRoleUser::getDroleId,roleIds));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}*/
|
|
||||||
//先删后加
|
//先删后加
|
||||||
sysUserDepartMapper.delete(new QueryWrapper<SysUserDepart>().lambda().eq(SysUserDepart::getUserId, user.getId()));
|
sysUserDepartMapper.delete(new QueryWrapper<SysUserDepart>().lambda().eq(SysUserDepart::getUserId, user.getId()));
|
||||||
if(oConvertUtils.isNotEmpty(departs)) {
|
if(oConvertUtils.isNotEmpty(departs)) {
|
||||||
@@ -484,22 +456,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
|||||||
if(oConvertUtils.isNotEmpty(departs)){
|
if(oConvertUtils.isNotEmpty(departs)){
|
||||||
arr = departs.split(",");
|
arr = departs.split(",");
|
||||||
}
|
}
|
||||||
//查询已关联部门
|
|
||||||
/*List<SysUserDepart> userDepartList = sysUserDepartMapper.selectList(new QueryWrapper<SysUserDepart>().lambda().eq(SysUserDepart::getUserId, user.getId()));
|
|
||||||
if(userDepartList != null && userDepartList.size()>0){
|
|
||||||
for(SysUserDepart depart : userDepartList ){
|
|
||||||
//修改已关联部门删除部门用户角色关系
|
|
||||||
if(!Arrays.asList(arr).contains(depart.getDepId())){
|
|
||||||
List<SysDepartRole> sysDepartRoleList = sysDepartRoleMapper.selectList(
|
|
||||||
new QueryWrapper<SysDepartRole>().lambda().eq(SysDepartRole::getDepartId,depart.getDepId()));
|
|
||||||
List<String> roleIds = sysDepartRoleList.stream().map(SysDepartRole::getId).collect(Collectors.toList());
|
|
||||||
if(roleIds != null && roleIds.size()>0){
|
|
||||||
departRoleUserMapper.delete(new QueryWrapper<SysDepartRoleUser>().lambda().eq(SysDepartRoleUser::getUserId, user.getId())
|
|
||||||
.in(SysDepartRoleUser::getDroleId,roleIds));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}*/
|
|
||||||
//先删后加
|
//先删后加
|
||||||
sysUserDepartMapper.delete(new QueryWrapper<SysUserDepart>().lambda().eq(SysUserDepart::getUserId, user.getId()));
|
sysUserDepartMapper.delete(new QueryWrapper<SysUserDepart>().lambda().eq(SysUserDepart::getUserId, user.getId()));
|
||||||
if(oConvertUtils.isNotEmpty(departs)) {
|
if(oConvertUtils.isNotEmpty(departs)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user