Browse Source

初步完成一個代碼生成的版本

攻心小虫 3 days ago
parent
commit
d5b74e00cb
29 changed files with 1636 additions and 1543 deletions
  1. 79 94
      healsphere-admin/src/main/java/com/zdqz/web/controller/system/SysDeptController.java
  2. 196 221
      healsphere-admin/src/main/java/com/zdqz/web/controller/system/SysRoleController.java
  3. 104 0
      healsphere-buss/src/main/java/com/zdqz/sample/controller/SampleExperimentController.java
  4. 90 0
      healsphere-buss/src/main/java/com/zdqz/sample/domain/SampleExperiment.java
  5. 4 19
      healsphere-buss/src/main/java/com/zdqz/sample/domain/SampleInfo.java
  6. 10 10
      healsphere-buss/src/main/java/com/zdqz/sample/domain/SamplePatient.java
  7. 61 0
      healsphere-buss/src/main/java/com/zdqz/sample/mapper/SampleExperimentMapper.java
  8. 61 0
      healsphere-buss/src/main/java/com/zdqz/sample/service/ISampleExperimentService.java
  9. 96 0
      healsphere-buss/src/main/java/com/zdqz/sample/service/impl/SampleExperimentServiceImpl.java
  10. 13 13
      healsphere-buss/src/main/java/com/zdqz/system/controller/SysAreaController.java
  11. 21 51
      healsphere-buss/src/main/java/com/zdqz/system/domain/SysArea.java
  12. 15 15
      healsphere-buss/src/main/java/com/zdqz/system/mapper/SysAreaMapper.java
  13. 16 16
      healsphere-buss/src/main/java/com/zdqz/system/service/ISysAreaService.java
  14. 16 16
      healsphere-buss/src/main/java/com/zdqz/system/service/impl/SysAreaServiceImpl.java
  15. 86 0
      healsphere-buss/src/main/resources/mapper/sample/SampleExperimentMapper.xml
  16. 1 6
      healsphere-buss/src/main/resources/mapper/sample/SampleInfoMapper.xml
  17. 6 6
      healsphere-buss/src/main/resources/mapper/sample/SamplePatientMapper.xml
  18. 11 21
      healsphere-buss/src/main/resources/mapper/system/SysAreaMapper.xml
  19. 0 5
      healsphere-common/src/main/java/com/zdqz/common/constant/Constants.java
  20. 161 225
      healsphere-common/src/main/java/com/zdqz/common/core/domain/entity/SysRole.java
  21. 98 149
      healsphere-common/src/main/java/com/zdqz/common/utils/SecurityUtils.java
  22. 0 1
      healsphere-framework/src/main/java/com/zdqz/framework/config/SecurityConfig.java
  23. 2 56
      healsphere-framework/src/main/java/com/zdqz/framework/web/service/PermissionService.java
  24. 47 64
      healsphere-framework/src/main/java/com/zdqz/framework/web/service/SysPermissionService.java
  25. 0 8
      healsphere-system/src/main/java/com/zdqz/system/mapper/SysRoleMapper.java
  26. 145 161
      healsphere-system/src/main/java/com/zdqz/system/service/ISysRoleService.java
  27. 297 373
      healsphere-system/src/main/java/com/zdqz/system/service/impl/SysRoleServiceImpl.java
  28. 0 12
      healsphere-system/src/main/resources/mapper/system/SysRoleMapper.xml
  29. 0 1
      healsphere-system/src/main/resources/mapper/system/SysUserMapper.xml

+ 79 - 94
healsphere-admin/src/main/java/com/zdqz/web/controller/system/SysDeptController.java

@@ -29,104 +29,89 @@ import com.zdqz.system.service.ISysDeptService;
  */
 @RestController
 @RequestMapping("/system/dept")
-public class SysDeptController extends BaseController
-{
-    @Autowired
-    private ISysDeptService deptService;
+public class SysDeptController extends BaseController {
+	@Autowired
+	private ISysDeptService deptService;
 
-    /**
-     * 获取部门列表
-     */
-    @PreAuthorize("@ss.hasPermi('system:dept:list')")
-    @GetMapping("/list")
-    public AjaxResult list(SysDept dept)
-    {
-        List<SysDept> depts = deptService.selectDeptList(dept);
-        return success(depts);
-    }
+	/**
+	 * 获取部门列表
+	 */
+	@PreAuthorize("@ss.hasPermi('system:dept:list')")
+	@GetMapping("/list")
+	public AjaxResult list(SysDept dept) {
+		List<SysDept> depts = deptService.selectDeptList(dept);
+		return success(depts);
+	}
 
-    /**
-     * 查询部门列表(排除节点)
-     */
-    @PreAuthorize("@ss.hasPermi('system:dept:list')")
-    @GetMapping("/list/exclude/{deptId}")
-    public AjaxResult excludeChild(@PathVariable(value = "deptId", required = false) Long deptId)
-    {
-        List<SysDept> depts = deptService.selectDeptList(new SysDept());
-        depts.removeIf(d -> d.getDeptId().intValue() == deptId || ArrayUtils.contains(StringUtils.split(d.getAncestors(), ","), deptId + ""));
-        return success(depts);
-    }
+	/**
+	 * 查询部门列表(排除节点)
+	 */
+	@PreAuthorize("@ss.hasPermi('system:dept:list')")
+	@GetMapping("/list/exclude/{deptId}")
+	public AjaxResult excludeChild(@PathVariable(value = "deptId", required = false) Long deptId) {
+		List<SysDept> depts = deptService.selectDeptList(new SysDept());
+		depts.removeIf(d -> d.getDeptId().intValue() == deptId || ArrayUtils.contains(StringUtils.split(d.getAncestors(), ","), deptId + ""));
+		return success(depts);
+	}
 
-    /**
-     * 根据部门编号获取详细信息
-     */
-    @PreAuthorize("@ss.hasPermi('system:dept:query')")
-    @GetMapping(value = "/{deptId}")
-    public AjaxResult getInfo(@PathVariable Long deptId)
-    {
-        deptService.checkDeptDataScope(deptId);
-        return success(deptService.selectDeptById(deptId));
-    }
+	/**
+	 * 根据部门编号获取详细信息
+	 */
+	@PreAuthorize("@ss.hasPermi('system:dept:query')")
+	@GetMapping(value = "/{deptId}")
+	public AjaxResult getInfo(@PathVariable Long deptId) {
+		deptService.checkDeptDataScope(deptId);
+		return success(deptService.selectDeptById(deptId));
+	}
 
-    /**
-     * 新增部门
-     */
-    @PreAuthorize("@ss.hasPermi('system:dept:add')")
-    @Log(title = "部门管理", businessType = BusinessType.INSERT)
-    @PostMapping
-    public AjaxResult add(@Validated @RequestBody SysDept dept)
-    {
-        if (!deptService.checkDeptNameUnique(dept))
-        {
-            return error("新增部门'" + dept.getDeptName() + "'失败,部门名称已存在");
-        }
-        dept.setCreateBy(getUsername());
-        return toAjax(deptService.insertDept(dept));
-    }
+	/**
+	 * 新增部门
+	 */
+	@PreAuthorize("@ss.hasPermi('system:dept:add')")
+	@Log(title = "部门管理", businessType = BusinessType.INSERT)
+	@PostMapping
+	public AjaxResult add(@Validated @RequestBody SysDept dept) {
+		if (!deptService.checkDeptNameUnique(dept)) {
+			return error("新增部门'" + dept.getDeptName() + "'失败,部门名称已存在");
+		}
+		dept.setCreateBy(getUsername());
+		return toAjax(deptService.insertDept(dept));
+	}
 
-    /**
-     * 修改部门
-     */
-    @PreAuthorize("@ss.hasPermi('system:dept:edit')")
-    @Log(title = "部门管理", businessType = BusinessType.UPDATE)
-    @PutMapping
-    public AjaxResult edit(@Validated @RequestBody SysDept dept)
-    {
-        Long deptId = dept.getDeptId();
-        deptService.checkDeptDataScope(deptId);
-        if (!deptService.checkDeptNameUnique(dept))
-        {
-            return error("修改部门'" + dept.getDeptName() + "'失败,部门名称已存在");
-        }
-        else if (dept.getParentId().equals(deptId))
-        {
-            return error("修改部门'" + dept.getDeptName() + "'失败,上级部门不能是自己");
-        }
-        else if (StringUtils.equals(UserConstants.DEPT_DISABLE, dept.getStatus()) && deptService.selectNormalChildrenDeptById(deptId) > 0)
-        {
-            return error("该部门包含未停用的子部门!");
-        }
-        dept.setUpdateBy(getUsername());
-        return toAjax(deptService.updateDept(dept));
-    }
+	/**
+	 * 修改部门
+	 */
+	@PreAuthorize("@ss.hasPermi('system:dept:edit')")
+	@Log(title = "部门管理", businessType = BusinessType.UPDATE)
+	@PutMapping
+	public AjaxResult edit(@Validated @RequestBody SysDept dept) {
+		Long deptId = dept.getDeptId();
+		deptService.checkDeptDataScope(deptId);
+		if (!deptService.checkDeptNameUnique(dept)) {
+			return error("修改部门'" + dept.getDeptName() + "'失败,部门名称已存在");
+		} else if (dept.getParentId().equals(deptId)) {
+			return error("修改部门'" + dept.getDeptName() + "'失败,上级部门不能是自己");
+		} else if (StringUtils.equals(UserConstants.DEPT_DISABLE, dept.getStatus()) && deptService.selectNormalChildrenDeptById(deptId) > 0) {
+			return error("该部门包含未停用的子部门!");
+		}
+		dept.setUpdateBy(getUsername());
+		return toAjax(deptService.updateDept(dept));
+	}
 
-    /**
-     * 删除部门
-     */
-    @PreAuthorize("@ss.hasPermi('system:dept:remove')")
-    @Log(title = "部门管理", businessType = BusinessType.DELETE)
-    @DeleteMapping("/{deptId}")
-    public AjaxResult remove(@PathVariable Long deptId)
-    {
-        if (deptService.hasChildByDeptId(deptId))
-        {
-            return warn("存在下级部门,不允许删除");
-        }
-        if (deptService.checkDeptExistUser(deptId))
-        {
-            return warn("部门存在用户,不允许删除");
-        }
-        deptService.checkDeptDataScope(deptId);
-        return toAjax(deptService.deleteDeptById(deptId));
-    }
+	/**
+	 * 删除部门
+	 */
+	@PreAuthorize("@ss.hasPermi('system:dept:remove')")
+	@Log(title = "部门管理", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{deptId}")
+	public AjaxResult remove(@PathVariable Long deptId) {
+		if (deptService.hasChildByDeptId(deptId)) {
+			return warn("存在下级部门,不允许删除");
+		}
+		if (deptService.checkDeptExistUser(deptId)) {
+			return warn("部门存在用户,不允许删除");
+		}
+		deptService.checkDeptDataScope(deptId);
+		return toAjax(deptService.deleteDeptById(deptId));
+	}
 }

+ 196 - 221
healsphere-admin/src/main/java/com/zdqz/web/controller/system/SysRoleController.java

@@ -1,7 +1,9 @@
 package com.zdqz.web.controller.system;
 
 import java.util.List;
+
 import javax.servlet.http.HttpServletResponse;
+
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.validation.annotation.Validated;
@@ -13,6 +15,7 @@ import org.springframework.web.bind.annotation.PutMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
+
 import com.zdqz.common.annotation.Log;
 import com.zdqz.common.core.controller.BaseController;
 import com.zdqz.common.core.domain.AjaxResult;
@@ -38,225 +41,197 @@ import com.zdqz.system.service.ISysUserService;
  */
 @RestController
 @RequestMapping("/system/role")
-public class SysRoleController extends BaseController
-{
-    @Autowired
-    private ISysRoleService roleService;
-
-    @Autowired
-    private TokenService tokenService;
-
-    @Autowired
-    private SysPermissionService permissionService;
-
-    @Autowired
-    private ISysUserService userService;
-
-    @Autowired
-    private ISysDeptService deptService;
-
-    @PreAuthorize("@ss.hasPermi('system:role:list')")
-    @GetMapping("/list")
-    public TableDataInfo list(SysRole role)
-    {
-        startPage();
-        List<SysRole> list = roleService.selectRoleList(role);
-        return getDataTable(list);
-    }
-
-    @Log(title = "角色管理", businessType = BusinessType.EXPORT)
-    @PreAuthorize("@ss.hasPermi('system:role:export')")
-    @PostMapping("/export")
-    public void export(HttpServletResponse response, SysRole role)
-    {
-        List<SysRole> list = roleService.selectRoleList(role);
-        ExcelUtil<SysRole> util = new ExcelUtil<SysRole>(SysRole.class);
-        util.exportExcel(response, list, "角色数据");
-    }
-
-    /**
-     * 根据角色编号获取详细信息
-     */
-    @PreAuthorize("@ss.hasPermi('system:role:query')")
-    @GetMapping(value = "/{roleId}")
-    public AjaxResult getInfo(@PathVariable Long roleId)
-    {
-        roleService.checkRoleDataScope(roleId);
-        return success(roleService.selectRoleById(roleId));
-    }
-
-    /**
-     * 新增角色
-     */
-    @PreAuthorize("@ss.hasPermi('system:role:add')")
-    @Log(title = "角色管理", businessType = BusinessType.INSERT)
-    @PostMapping
-    public AjaxResult add(@Validated @RequestBody SysRole role)
-    {
-        if (!roleService.checkRoleNameUnique(role))
-        {
-            return error("新增角色'" + role.getRoleName() + "'失败,角色名称已存在");
-        }
-        else if (!roleService.checkRoleKeyUnique(role))
-        {
-            return error("新增角色'" + role.getRoleName() + "'失败,角色权限已存在");
-        }
-        role.setCreateBy(getUsername());
-        return toAjax(roleService.insertRole(role));
-
-    }
-
-    /**
-     * 修改保存角色
-     */
-    @PreAuthorize("@ss.hasPermi('system:role:edit')")
-    @Log(title = "角色管理", businessType = BusinessType.UPDATE)
-    @PutMapping
-    public AjaxResult edit(@Validated @RequestBody SysRole role)
-    {
-        roleService.checkRoleAllowed(role);
-        roleService.checkRoleDataScope(role.getRoleId());
-        if (!roleService.checkRoleNameUnique(role))
-        {
-            return error("修改角色'" + role.getRoleName() + "'失败,角色名称已存在");
-        }
-        else if (!roleService.checkRoleKeyUnique(role))
-        {
-            return error("修改角色'" + role.getRoleName() + "'失败,角色权限已存在");
-        }
-        role.setUpdateBy(getUsername());
-        
-        if (roleService.updateRole(role) > 0)
-        {
-            // 更新缓存用户权限
-            LoginUser loginUser = getLoginUser();
-            if (StringUtils.isNotNull(loginUser.getUser()) && !loginUser.getUser().isAdmin())
-            {
-                loginUser.setUser(userService.selectUserByUserName(loginUser.getUser().getUserName()));
-                loginUser.setPermissions(permissionService.getMenuPermission(loginUser.getUser()));
-                tokenService.setLoginUser(loginUser);
-            }
-            return success();
-        }
-        return error("修改角色'" + role.getRoleName() + "'失败,请联系管理员");
-    }
-
-    /**
-     * 修改保存数据权限
-     */
-    @PreAuthorize("@ss.hasPermi('system:role:edit')")
-    @Log(title = "角色管理", businessType = BusinessType.UPDATE)
-    @PutMapping("/dataScope")
-    public AjaxResult dataScope(@RequestBody SysRole role)
-    {
-        roleService.checkRoleAllowed(role);
-        roleService.checkRoleDataScope(role.getRoleId());
-        return toAjax(roleService.authDataScope(role));
-    }
-
-    /**
-     * 状态修改
-     */
-    @PreAuthorize("@ss.hasPermi('system:role:edit')")
-    @Log(title = "角色管理", businessType = BusinessType.UPDATE)
-    @PutMapping("/changeStatus")
-    public AjaxResult changeStatus(@RequestBody SysRole role)
-    {
-        roleService.checkRoleAllowed(role);
-        roleService.checkRoleDataScope(role.getRoleId());
-        role.setUpdateBy(getUsername());
-        return toAjax(roleService.updateRoleStatus(role));
-    }
-
-    /**
-     * 删除角色
-     */
-    @PreAuthorize("@ss.hasPermi('system:role:remove')")
-    @Log(title = "角色管理", businessType = BusinessType.DELETE)
-    @DeleteMapping("/{roleIds}")
-    public AjaxResult remove(@PathVariable Long[] roleIds)
-    {
-        return toAjax(roleService.deleteRoleByIds(roleIds));
-    }
-
-    /**
-     * 获取角色选择框列表
-     */
-    @PreAuthorize("@ss.hasPermi('system:role:query')")
-    @GetMapping("/optionselect")
-    public AjaxResult optionselect()
-    {
-        return success(roleService.selectRoleAll());
-    }
-
-    /**
-     * 查询已分配用户角色列表
-     */
-    @PreAuthorize("@ss.hasPermi('system:role:list')")
-    @GetMapping("/authUser/allocatedList")
-    public TableDataInfo allocatedList(SysUser user)
-    {
-        startPage();
-        List<SysUser> list = userService.selectAllocatedList(user);
-        return getDataTable(list);
-    }
-
-    /**
-     * 查询未分配用户角色列表
-     */
-    @PreAuthorize("@ss.hasPermi('system:role:list')")
-    @GetMapping("/authUser/unallocatedList")
-    public TableDataInfo unallocatedList(SysUser user)
-    {
-        startPage();
-        List<SysUser> list = userService.selectUnallocatedList(user);
-        return getDataTable(list);
-    }
-
-    /**
-     * 取消授权用户
-     */
-    @PreAuthorize("@ss.hasPermi('system:role:edit')")
-    @Log(title = "角色管理", businessType = BusinessType.GRANT)
-    @PutMapping("/authUser/cancel")
-    public AjaxResult cancelAuthUser(@RequestBody SysUserRole userRole)
-    {
-        return toAjax(roleService.deleteAuthUser(userRole));
-    }
-
-    /**
-     * 批量取消授权用户
-     */
-    @PreAuthorize("@ss.hasPermi('system:role:edit')")
-    @Log(title = "角色管理", businessType = BusinessType.GRANT)
-    @PutMapping("/authUser/cancelAll")
-    public AjaxResult cancelAuthUserAll(Long roleId, Long[] userIds)
-    {
-        return toAjax(roleService.deleteAuthUsers(roleId, userIds));
-    }
-
-    /**
-     * 批量选择用户授权
-     */
-    @PreAuthorize("@ss.hasPermi('system:role:edit')")
-    @Log(title = "角色管理", businessType = BusinessType.GRANT)
-    @PutMapping("/authUser/selectAll")
-    public AjaxResult selectAuthUserAll(Long roleId, Long[] userIds)
-    {
-        roleService.checkRoleDataScope(roleId);
-        return toAjax(roleService.insertAuthUsers(roleId, userIds));
-    }
-
-    /**
-     * 获取对应角色部门树列表
-     */
-    @PreAuthorize("@ss.hasPermi('system:role:query')")
-    @GetMapping(value = "/deptTree/{roleId}")
-    public AjaxResult deptTree(@PathVariable("roleId") Long roleId)
-    {
-        AjaxResult ajax = AjaxResult.success();
-        ajax.put("checkedKeys", deptService.selectDeptListByRoleId(roleId));
-        ajax.put("depts", deptService.selectDeptTreeList(new SysDept()));
-        return ajax;
-    }
+public class SysRoleController extends BaseController {
+	@Autowired
+	private ISysRoleService roleService;
+
+	@Autowired
+	private TokenService tokenService;
+
+	@Autowired
+	private SysPermissionService permissionService;
+
+	@Autowired
+	private ISysUserService userService;
+
+	@Autowired
+	private ISysDeptService deptService;
+
+	@PreAuthorize("@ss.hasPermi('system:role:list')")
+	@GetMapping("/list")
+	public TableDataInfo list(SysRole role) {
+		startPage();
+		List<SysRole> list = roleService.selectRoleList(role);
+		return getDataTable(list);
+	}
+
+	@Log(title = "角色管理", businessType = BusinessType.EXPORT)
+	@PreAuthorize("@ss.hasPermi('system:role:export')")
+	@PostMapping("/export")
+	public void export(HttpServletResponse response, SysRole role) {
+		List<SysRole> list = roleService.selectRoleList(role);
+		ExcelUtil<SysRole> util = new ExcelUtil<SysRole>(SysRole.class);
+		util.exportExcel(response, list, "角色数据");
+	}
+
+	/**
+	 * 根据角色编号获取详细信息
+	 */
+	@PreAuthorize("@ss.hasPermi('system:role:query')")
+	@GetMapping(value = "/{roleId}")
+	public AjaxResult getInfo(@PathVariable Long roleId) {
+		roleService.checkRoleDataScope(roleId);
+		return success(roleService.selectRoleById(roleId));
+	}
+
+	/**
+	 * 新增角色
+	 */
+	@PreAuthorize("@ss.hasPermi('system:role:add')")
+	@Log(title = "角色管理", businessType = BusinessType.INSERT)
+	@PostMapping
+	public AjaxResult add(@Validated @RequestBody SysRole role) {
+		if (!roleService.checkRoleNameUnique(role)) {
+			return error("新增角色'" + role.getRoleName() + "'失败,角色名称已存在");
+		}
+		role.setCreateBy(getUsername());
+		return toAjax(roleService.insertRole(role));
+
+	}
+
+	/**
+	 * 修改保存角色
+	 */
+	@PreAuthorize("@ss.hasPermi('system:role:edit')")
+	@Log(title = "角色管理", businessType = BusinessType.UPDATE)
+	@PutMapping
+	public AjaxResult edit(@Validated @RequestBody SysRole role) {
+		roleService.checkRoleAllowed(role);
+		roleService.checkRoleDataScope(role.getRoleId());
+		if (!roleService.checkRoleNameUnique(role)) {
+			return error("修改角色'" + role.getRoleName() + "'失败,角色名称已存在");
+		}
+		role.setUpdateBy(getUsername());
+
+		if (roleService.updateRole(role) > 0) {
+			// 更新缓存用户权限
+			LoginUser loginUser = getLoginUser();
+			if (StringUtils.isNotNull(loginUser.getUser()) && !loginUser.getUser().isAdmin()) {
+				loginUser.setUser(userService.selectUserByUserName(loginUser.getUser().getUserName()));
+				loginUser.setPermissions(permissionService.getMenuPermission(loginUser.getUser()));
+				tokenService.setLoginUser(loginUser);
+			}
+			return success();
+		}
+		return error("修改角色'" + role.getRoleName() + "'失败,请联系管理员");
+	}
+
+	/**
+	 * 修改保存数据权限
+	 */
+	@PreAuthorize("@ss.hasPermi('system:role:edit')")
+	@Log(title = "角色管理", businessType = BusinessType.UPDATE)
+	@PutMapping("/dataScope")
+	public AjaxResult dataScope(@RequestBody SysRole role) {
+		roleService.checkRoleAllowed(role);
+		roleService.checkRoleDataScope(role.getRoleId());
+		return toAjax(roleService.authDataScope(role));
+	}
+
+	/**
+	 * 状态修改
+	 */
+	@PreAuthorize("@ss.hasPermi('system:role:edit')")
+	@Log(title = "角色管理", businessType = BusinessType.UPDATE)
+	@PutMapping("/changeStatus")
+	public AjaxResult changeStatus(@RequestBody SysRole role) {
+		roleService.checkRoleAllowed(role);
+		roleService.checkRoleDataScope(role.getRoleId());
+		role.setUpdateBy(getUsername());
+		return toAjax(roleService.updateRoleStatus(role));
+	}
+
+	/**
+	 * 删除角色
+	 */
+	@PreAuthorize("@ss.hasPermi('system:role:remove')")
+	@Log(title = "角色管理", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{roleIds}")
+	public AjaxResult remove(@PathVariable Long[] roleIds) {
+		return toAjax(roleService.deleteRoleByIds(roleIds));
+	}
+
+	/**
+	 * 获取角色选择框列表
+	 */
+	@PreAuthorize("@ss.hasPermi('system:role:query')")
+	@GetMapping("/optionselect")
+	public AjaxResult optionselect() {
+		return success(roleService.selectRoleAll());
+	}
+
+	/**
+	 * 查询已分配用户角色列表
+	 */
+	@PreAuthorize("@ss.hasPermi('system:role:list')")
+	@GetMapping("/authUser/allocatedList")
+	public TableDataInfo allocatedList(SysUser user) {
+		startPage();
+		List<SysUser> list = userService.selectAllocatedList(user);
+		return getDataTable(list);
+	}
+
+	/**
+	 * 查询未分配用户角色列表
+	 */
+	@PreAuthorize("@ss.hasPermi('system:role:list')")
+	@GetMapping("/authUser/unallocatedList")
+	public TableDataInfo unallocatedList(SysUser user) {
+		startPage();
+		List<SysUser> list = userService.selectUnallocatedList(user);
+		return getDataTable(list);
+	}
+
+	/**
+	 * 取消授权用户
+	 */
+	@PreAuthorize("@ss.hasPermi('system:role:edit')")
+	@Log(title = "角色管理", businessType = BusinessType.GRANT)
+	@PutMapping("/authUser/cancel")
+	public AjaxResult cancelAuthUser(@RequestBody SysUserRole userRole) {
+		return toAjax(roleService.deleteAuthUser(userRole));
+	}
+
+	/**
+	 * 批量取消授权用户
+	 */
+	@PreAuthorize("@ss.hasPermi('system:role:edit')")
+	@Log(title = "角色管理", businessType = BusinessType.GRANT)
+	@PutMapping("/authUser/cancelAll")
+	public AjaxResult cancelAuthUserAll(Long roleId, Long[] userIds) {
+		return toAjax(roleService.deleteAuthUsers(roleId, userIds));
+	}
+
+	/**
+	 * 批量选择用户授权
+	 */
+	@PreAuthorize("@ss.hasPermi('system:role:edit')")
+	@Log(title = "角色管理", businessType = BusinessType.GRANT)
+	@PutMapping("/authUser/selectAll")
+	public AjaxResult selectAuthUserAll(Long roleId, Long[] userIds) {
+		roleService.checkRoleDataScope(roleId);
+		return toAjax(roleService.insertAuthUsers(roleId, userIds));
+	}
+
+	/**
+	 * 获取对应角色部门树列表
+	 */
+	@PreAuthorize("@ss.hasPermi('system:role:query')")
+	@GetMapping(value = "/deptTree/{roleId}")
+	public AjaxResult deptTree(@PathVariable("roleId") Long roleId) {
+		AjaxResult ajax = AjaxResult.success();
+		ajax.put("checkedKeys", deptService.selectDeptListByRoleId(roleId));
+		ajax.put("depts", deptService.selectDeptTreeList(new SysDept()));
+		return ajax;
+	}
 }

+ 104 - 0
healsphere-buss/src/main/java/com/zdqz/sample/controller/SampleExperimentController.java

@@ -0,0 +1,104 @@
+package com.zdqz.sample.controller;
+
+import java.util.List;
+import javax.servlet.http.HttpServletResponse;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.zdqz.common.annotation.Log;
+import com.zdqz.common.core.controller.BaseController;
+import com.zdqz.common.core.domain.AjaxResult;
+import com.zdqz.common.enums.BusinessType;
+import com.zdqz.sample.domain.SampleExperiment;
+import com.zdqz.sample.service.ISampleExperimentService;
+import com.zdqz.common.utils.poi.ExcelUtil;
+import com.zdqz.common.core.page.TableDataInfo;
+
+/**
+ * 解读管理Controller
+ * 
+ * @author ruoyi
+ * @date 2025-06-04
+ */
+@RestController
+@RequestMapping("/sample/sampleExperiment")
+public class SampleExperimentController extends BaseController
+{
+    @Autowired
+    private ISampleExperimentService sampleExperimentService;
+
+    /**
+     * 查询解读管理列表
+     */
+    @PreAuthorize("@ss.hasPermi('sample:sampleExperiment:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(SampleExperiment sampleExperiment)
+    {
+        startPage();
+        List<SampleExperiment> list = sampleExperimentService.selectSampleExperimentList(sampleExperiment);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出解读管理列表
+     */
+    @PreAuthorize("@ss.hasPermi('sample:sampleExperiment:export')")
+    @Log(title = "解读管理", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, SampleExperiment sampleExperiment)
+    {
+        List<SampleExperiment> list = sampleExperimentService.selectSampleExperimentList(sampleExperiment);
+        ExcelUtil<SampleExperiment> util = new ExcelUtil<SampleExperiment>(SampleExperiment.class);
+        util.exportExcel(response, list, "解读管理数据");
+    }
+
+    /**
+     * 获取解读管理详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('sample:sampleExperiment:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return success(sampleExperimentService.selectSampleExperimentById(id));
+    }
+
+    /**
+     * 新增解读管理
+     */
+    @PreAuthorize("@ss.hasPermi('sample:sampleExperiment:add')")
+    @Log(title = "解读管理", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody SampleExperiment sampleExperiment)
+    {
+        return toAjax(sampleExperimentService.insertSampleExperiment(sampleExperiment));
+    }
+
+    /**
+     * 修改解读管理
+     */
+    @PreAuthorize("@ss.hasPermi('sample:sampleExperiment:edit')")
+    @Log(title = "解读管理", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody SampleExperiment sampleExperiment)
+    {
+        return toAjax(sampleExperimentService.updateSampleExperiment(sampleExperiment));
+    }
+
+    /**
+     * 删除解读管理
+     */
+    @PreAuthorize("@ss.hasPermi('sample:sampleExperiment:remove')")
+    @Log(title = "解读管理", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(sampleExperimentService.deleteSampleExperimentByIds(ids));
+    }
+}

+ 90 - 0
healsphere-buss/src/main/java/com/zdqz/sample/domain/SampleExperiment.java

@@ -0,0 +1,90 @@
+package com.zdqz.sample.domain;
+
+import java.util.Date;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.zdqz.common.annotation.Excel;
+import com.zdqz.common.core.domain.BaseEntity;
+
+/**
+ * 解读管理对象 sample_experiment
+ * 
+ * @author ruoyi
+ * @date 2025-06-04
+ */
+public class SampleExperiment extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 实验编号 */
+    private Long id;
+
+    /** 样品编号 */
+    @Excel(name = "样品编号")
+    private Long sampleInfoId;
+
+    /** 状态 */
+    @Excel(name = "状态")
+    private Long status;
+
+    /** 解读&作废时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "解读&作废时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date dealTime;
+
+    public void setId(Long id) 
+    {
+        this.id = id;
+    }
+
+    public Long getId() 
+    {
+        return id;
+    }
+
+    public void setSampleInfoId(Long sampleInfoId) 
+    {
+        this.sampleInfoId = sampleInfoId;
+    }
+
+    public Long getSampleInfoId() 
+    {
+        return sampleInfoId;
+    }
+
+    public void setStatus(Long status) 
+    {
+        this.status = status;
+    }
+
+    public Long getStatus() 
+    {
+        return status;
+    }
+
+    public void setDealTime(Date dealTime) 
+    {
+        this.dealTime = dealTime;
+    }
+
+    public Date getDealTime() 
+    {
+        return dealTime;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("id", getId())
+            .append("sampleInfoId", getSampleInfoId())
+            .append("status", getStatus())
+            .append("dealTime", getDealTime())
+            .append("createBy", getCreateBy())
+            .append("createTime", getCreateTime())
+            .append("updateBy", getUpdateBy())
+            .append("updateTime", getUpdateTime())
+            .append("remark", getRemark())
+            .toString();
+    }
+}

+ 4 - 19
healsphere-buss/src/main/java/com/zdqz/sample/domain/SampleInfo.java

@@ -18,10 +18,6 @@ public class SampleInfo extends BaseEntity
     /** 编号 */
     private Long id;
 
-    /** 实验编号 */
-    @Excel(name = "实验编号")
-    private String experimentId;
-
     /** 患者编号 */
     @Excel(name = "患者编号")
     private Long patientId;
@@ -34,12 +30,12 @@ public class SampleInfo extends BaseEntity
     @Excel(name = "样本类型")
     private Long sampleTypeId;
 
-    /** 送检医院 */
-    @Excel(name = "送检医院")
+    /** 送检医院编号 */
+    @Excel(name = "送检医院编号")
     private Long sampleHospitalId;
 
-    /** 送检科室 */
-    @Excel(name = "送检科室")
+    /** 送检科室编号 */
+    @Excel(name = "送检科室编号")
     private Long sampleDeptId;
 
     /** 医生名字 */
@@ -56,16 +52,6 @@ public class SampleInfo extends BaseEntity
         return id;
     }
 
-    public void setExperimentId(String experimentId) 
-    {
-        this.experimentId = experimentId;
-    }
-
-    public String getExperimentId() 
-    {
-        return experimentId;
-    }
-
     public void setPatientId(Long patientId) 
     {
         this.patientId = patientId;
@@ -130,7 +116,6 @@ public class SampleInfo extends BaseEntity
     public String toString() {
         return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
             .append("id", getId())
-            .append("experimentId", getExperimentId())
             .append("patientId", getPatientId())
             .append("patientPhone", getPatientPhone())
             .append("sampleTypeId", getSampleTypeId())

+ 10 - 10
healsphere-buss/src/main/java/com/zdqz/sample/domain/SamplePatient.java

@@ -18,16 +18,16 @@ public class SamplePatient extends BaseEntity
     /** 编号 */
     private Long id;
 
-    /** 样品编号 */
-    @Excel(name = "样品编号")
-    private Long sampleInfoId;
+    /** 病案号 */
+    @Excel(name = "病案号")
+    private String bahCode;
 
     /** 姓名 */
     @Excel(name = "姓名")
     private String name;
 
-    /** 出生年份 */
-    @Excel(name = "出生年份")
+    /** 出生年份(换算年龄) */
+    @Excel(name = "出生年份(换算年龄)")
     private Long birth;
 
     /** 性别 */
@@ -288,14 +288,14 @@ public class SamplePatient extends BaseEntity
         return id;
     }
 
-    public void setSampleInfoId(Long sampleInfoId) 
+    public void setBahCode(String bahCode) 
     {
-        this.sampleInfoId = sampleInfoId;
+        this.bahCode = bahCode;
     }
 
-    public Long getSampleInfoId() 
+    public String getBahCode() 
     {
-        return sampleInfoId;
+        return bahCode;
     }
 
     public void setName(String name) 
@@ -942,7 +942,7 @@ public class SamplePatient extends BaseEntity
     public String toString() {
         return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
             .append("id", getId())
-            .append("sampleInfoId", getSampleInfoId())
+            .append("bahCode", getBahCode())
             .append("name", getName())
             .append("birth", getBirth())
             .append("sex", getSex())

+ 61 - 0
healsphere-buss/src/main/java/com/zdqz/sample/mapper/SampleExperimentMapper.java

@@ -0,0 +1,61 @@
+package com.zdqz.sample.mapper;
+
+import java.util.List;
+import com.zdqz.sample.domain.SampleExperiment;
+
+/**
+ * 解读管理Mapper接口
+ * 
+ * @author ruoyi
+ * @date 2025-06-04
+ */
+public interface SampleExperimentMapper 
+{
+    /**
+     * 查询解读管理
+     * 
+     * @param id 解读管理主键
+     * @return 解读管理
+     */
+    public SampleExperiment selectSampleExperimentById(Long id);
+
+    /**
+     * 查询解读管理列表
+     * 
+     * @param sampleExperiment 解读管理
+     * @return 解读管理集合
+     */
+    public List<SampleExperiment> selectSampleExperimentList(SampleExperiment sampleExperiment);
+
+    /**
+     * 新增解读管理
+     * 
+     * @param sampleExperiment 解读管理
+     * @return 结果
+     */
+    public int insertSampleExperiment(SampleExperiment sampleExperiment);
+
+    /**
+     * 修改解读管理
+     * 
+     * @param sampleExperiment 解读管理
+     * @return 结果
+     */
+    public int updateSampleExperiment(SampleExperiment sampleExperiment);
+
+    /**
+     * 删除解读管理
+     * 
+     * @param id 解读管理主键
+     * @return 结果
+     */
+    public int deleteSampleExperimentById(Long id);
+
+    /**
+     * 批量删除解读管理
+     * 
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteSampleExperimentByIds(Long[] ids);
+}

+ 61 - 0
healsphere-buss/src/main/java/com/zdqz/sample/service/ISampleExperimentService.java

@@ -0,0 +1,61 @@
+package com.zdqz.sample.service;
+
+import java.util.List;
+import com.zdqz.sample.domain.SampleExperiment;
+
+/**
+ * 解读管理Service接口
+ * 
+ * @author ruoyi
+ * @date 2025-06-04
+ */
+public interface ISampleExperimentService 
+{
+    /**
+     * 查询解读管理
+     * 
+     * @param id 解读管理主键
+     * @return 解读管理
+     */
+    public SampleExperiment selectSampleExperimentById(Long id);
+
+    /**
+     * 查询解读管理列表
+     * 
+     * @param sampleExperiment 解读管理
+     * @return 解读管理集合
+     */
+    public List<SampleExperiment> selectSampleExperimentList(SampleExperiment sampleExperiment);
+
+    /**
+     * 新增解读管理
+     * 
+     * @param sampleExperiment 解读管理
+     * @return 结果
+     */
+    public int insertSampleExperiment(SampleExperiment sampleExperiment);
+
+    /**
+     * 修改解读管理
+     * 
+     * @param sampleExperiment 解读管理
+     * @return 结果
+     */
+    public int updateSampleExperiment(SampleExperiment sampleExperiment);
+
+    /**
+     * 批量删除解读管理
+     * 
+     * @param ids 需要删除的解读管理主键集合
+     * @return 结果
+     */
+    public int deleteSampleExperimentByIds(Long[] ids);
+
+    /**
+     * 删除解读管理信息
+     * 
+     * @param id 解读管理主键
+     * @return 结果
+     */
+    public int deleteSampleExperimentById(Long id);
+}

+ 96 - 0
healsphere-buss/src/main/java/com/zdqz/sample/service/impl/SampleExperimentServiceImpl.java

@@ -0,0 +1,96 @@
+package com.zdqz.sample.service.impl;
+
+import java.util.List;
+import com.zdqz.common.utils.DateUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.zdqz.sample.mapper.SampleExperimentMapper;
+import com.zdqz.sample.domain.SampleExperiment;
+import com.zdqz.sample.service.ISampleExperimentService;
+
+/**
+ * 解读管理Service业务层处理
+ * 
+ * @author ruoyi
+ * @date 2025-06-04
+ */
+@Service
+public class SampleExperimentServiceImpl implements ISampleExperimentService 
+{
+    @Autowired
+    private SampleExperimentMapper sampleExperimentMapper;
+
+    /**
+     * 查询解读管理
+     * 
+     * @param id 解读管理主键
+     * @return 解读管理
+     */
+    @Override
+    public SampleExperiment selectSampleExperimentById(Long id)
+    {
+        return sampleExperimentMapper.selectSampleExperimentById(id);
+    }
+
+    /**
+     * 查询解读管理列表
+     * 
+     * @param sampleExperiment 解读管理
+     * @return 解读管理
+     */
+    @Override
+    public List<SampleExperiment> selectSampleExperimentList(SampleExperiment sampleExperiment)
+    {
+        return sampleExperimentMapper.selectSampleExperimentList(sampleExperiment);
+    }
+
+    /**
+     * 新增解读管理
+     * 
+     * @param sampleExperiment 解读管理
+     * @return 结果
+     */
+    @Override
+    public int insertSampleExperiment(SampleExperiment sampleExperiment)
+    {
+        sampleExperiment.setCreateTime(DateUtils.getNowDate());
+        return sampleExperimentMapper.insertSampleExperiment(sampleExperiment);
+    }
+
+    /**
+     * 修改解读管理
+     * 
+     * @param sampleExperiment 解读管理
+     * @return 结果
+     */
+    @Override
+    public int updateSampleExperiment(SampleExperiment sampleExperiment)
+    {
+        sampleExperiment.setUpdateTime(DateUtils.getNowDate());
+        return sampleExperimentMapper.updateSampleExperiment(sampleExperiment);
+    }
+
+    /**
+     * 批量删除解读管理
+     * 
+     * @param ids 需要删除的解读管理主键
+     * @return 结果
+     */
+    @Override
+    public int deleteSampleExperimentByIds(Long[] ids)
+    {
+        return sampleExperimentMapper.deleteSampleExperimentByIds(ids);
+    }
+
+    /**
+     * 删除解读管理信息
+     * 
+     * @param id 解读管理主键
+     * @return 结果
+     */
+    @Override
+    public int deleteSampleExperimentById(Long id)
+    {
+        return sampleExperimentMapper.deleteSampleExperimentById(id);
+    }
+}

+ 13 - 13
healsphere-buss/src/main/java/com/zdqz/system/controller/SysAreaController.java

@@ -22,10 +22,10 @@ import com.zdqz.common.utils.poi.ExcelUtil;
 import com.zdqz.common.core.page.TableDataInfo;
 
 /**
- * 世界国家区域Controller
+ * 全球地区库Controller
  * 
  * @author 攻心小虫
- * @date 2025-06-03
+ * @date 2025-06-04
  */
 @RestController
 @RequestMapping("/system/area")
@@ -35,7 +35,7 @@ public class SysAreaController extends BaseController
     private ISysAreaService sysAreaService;
 
     /**
-     * 查询世界国家区域列表
+     * 查询全球地区库列表
      */
     @PreAuthorize("@ss.hasPermi('system:area:list')")
     @GetMapping("/list")
@@ -47,20 +47,20 @@ public class SysAreaController extends BaseController
     }
 
     /**
-     * 导出世界国家区域列表
+     * 导出全球地区库列表
      */
     @PreAuthorize("@ss.hasPermi('system:area:export')")
-    @Log(title = "世界国家区域", businessType = BusinessType.EXPORT)
+    @Log(title = "全球地区库", businessType = BusinessType.EXPORT)
     @PostMapping("/export")
     public void export(HttpServletResponse response, SysArea sysArea)
     {
         List<SysArea> list = sysAreaService.selectSysAreaList(sysArea);
         ExcelUtil<SysArea> util = new ExcelUtil<SysArea>(SysArea.class);
-        util.exportExcel(response, list, "世界国家区域数据");
+        util.exportExcel(response, list, "全球地区库数据");
     }
 
     /**
-     * 获取世界国家区域详细信息
+     * 获取全球地区库详细信息
      */
     @PreAuthorize("@ss.hasPermi('system:area:query')")
     @GetMapping(value = "/{areaId}")
@@ -70,10 +70,10 @@ public class SysAreaController extends BaseController
     }
 
     /**
-     * 新增世界国家区域
+     * 新增全球地区库
      */
     @PreAuthorize("@ss.hasPermi('system:area:add')")
-    @Log(title = "世界国家区域", businessType = BusinessType.INSERT)
+    @Log(title = "全球地区库", businessType = BusinessType.INSERT)
     @PostMapping
     public AjaxResult add(@RequestBody SysArea sysArea)
     {
@@ -81,10 +81,10 @@ public class SysAreaController extends BaseController
     }
 
     /**
-     * 修改世界国家区域
+     * 修改全球地区库
      */
     @PreAuthorize("@ss.hasPermi('system:area:edit')")
-    @Log(title = "世界国家区域", businessType = BusinessType.UPDATE)
+    @Log(title = "全球地区库", businessType = BusinessType.UPDATE)
     @PutMapping
     public AjaxResult edit(@RequestBody SysArea sysArea)
     {
@@ -92,10 +92,10 @@ public class SysAreaController extends BaseController
     }
 
     /**
-     * 删除世界国家区域
+     * 删除全球地区库
      */
     @PreAuthorize("@ss.hasPermi('system:area:remove')")
-    @Log(title = "世界国家区域", businessType = BusinessType.DELETE)
+    @Log(title = "全球地区库", businessType = BusinessType.DELETE)
 	@DeleteMapping("/{areaIds}")
     public AjaxResult remove(@PathVariable String[] areaIds)
     {

+ 21 - 51
healsphere-buss/src/main/java/com/zdqz/system/domain/SysArea.java

@@ -6,26 +6,22 @@ import com.zdqz.common.annotation.Excel;
 import com.zdqz.common.core.domain.BaseEntity;
 
 /**
- * 世界国家区域对象 sys_area
+ * 全球地区库对象 sys_area
  * 
  * @author 攻心小虫
- * @date 2025-06-03
+ * @date 2025-06-04
  */
 public class SysArea extends BaseEntity
 {
     private static final long serialVersionUID = 1L;
 
-    /** 编号 */
+    /** 主键 */
     private String areaId;
 
-    /** 父编号 */
-    @Excel(name = "父编号")
+    /** 父ID */
+    @Excel(name = "父ID")
     private String areaParentId;
 
-    /** 路径 */
-    @Excel(name = "路径")
-    private String path;
-
     /** 层级 */
     @Excel(name = "层级")
     private String areaDeep;
@@ -34,17 +30,13 @@ public class SysArea extends BaseEntity
     @Excel(name = "中文名称")
     private String areaName;
 
-    /** 英文名称 */
-    @Excel(name = "英文名称")
-    private String nameEn;
-
-    /** 中文拼音 */
-    @Excel(name = "中文拼音")
-    private String namePinyin;
+    /** 维度 */
+    @Excel(name = "维度")
+    private String lat;
 
-    /** 代码 */
-    @Excel(name = "代码")
-    private String code;
+    /** 经度 */
+    @Excel(name = "经度")
+    private String lng;
 
     public void setAreaId(String areaId) 
     {
@@ -66,16 +58,6 @@ public class SysArea extends BaseEntity
         return areaParentId;
     }
 
-    public void setPath(String path) 
-    {
-        this.path = path;
-    }
-
-    public String getPath() 
-    {
-        return path;
-    }
-
     public void setAreaDeep(String areaDeep) 
     {
         this.areaDeep = areaDeep;
@@ -96,34 +78,24 @@ public class SysArea extends BaseEntity
         return areaName;
     }
 
-    public void setNameEn(String nameEn) 
-    {
-        this.nameEn = nameEn;
-    }
-
-    public String getNameEn() 
-    {
-        return nameEn;
-    }
-
-    public void setNamePinyin(String namePinyin) 
+    public void setLat(String lat) 
     {
-        this.namePinyin = namePinyin;
+        this.lat = lat;
     }
 
-    public String getNamePinyin() 
+    public String getLat() 
     {
-        return namePinyin;
+        return lat;
     }
 
-    public void setCode(String code) 
+    public void setLng(String lng) 
     {
-        this.code = code;
+        this.lng = lng;
     }
 
-    public String getCode() 
+    public String getLng() 
     {
-        return code;
+        return lng;
     }
 
     @Override
@@ -131,12 +103,10 @@ public class SysArea extends BaseEntity
         return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
             .append("areaId", getAreaId())
             .append("areaParentId", getAreaParentId())
-            .append("path", getPath())
             .append("areaDeep", getAreaDeep())
             .append("areaName", getAreaName())
-            .append("nameEn", getNameEn())
-            .append("namePinyin", getNamePinyin())
-            .append("code", getCode())
+            .append("lat", getLat())
+            .append("lng", getLng())
             .toString();
     }
 }

+ 15 - 15
healsphere-buss/src/main/java/com/zdqz/system/mapper/SysAreaMapper.java

@@ -4,55 +4,55 @@ import java.util.List;
 import com.zdqz.system.domain.SysArea;
 
 /**
- * 世界国家区域Mapper接口
+ * 全球地区库Mapper接口
  * 
  * @author 攻心小虫
- * @date 2025-06-03
+ * @date 2025-06-04
  */
 public interface SysAreaMapper 
 {
     /**
-     * 查询世界国家区域
+     * 查询全球地区库
      * 
-     * @param areaId 世界国家区域主键
-     * @return 世界国家区域
+     * @param areaId 全球地区库主键
+     * @return 全球地区库
      */
     public SysArea selectSysAreaByAreaId(String areaId);
 
     /**
-     * 查询世界国家区域列表
+     * 查询全球地区库列表
      * 
-     * @param sysArea 世界国家区域
-     * @return 世界国家区域集合
+     * @param sysArea 全球地区库
+     * @return 全球地区库集合
      */
     public List<SysArea> selectSysAreaList(SysArea sysArea);
 
     /**
-     * 新增世界国家区域
+     * 新增全球地区库
      * 
-     * @param sysArea 世界国家区域
+     * @param sysArea 全球地区库
      * @return 结果
      */
     public int insertSysArea(SysArea sysArea);
 
     /**
-     * 修改世界国家区域
+     * 修改全球地区库
      * 
-     * @param sysArea 世界国家区域
+     * @param sysArea 全球地区库
      * @return 结果
      */
     public int updateSysArea(SysArea sysArea);
 
     /**
-     * 删除世界国家区域
+     * 删除全球地区库
      * 
-     * @param areaId 世界国家区域主键
+     * @param areaId 全球地区库主键
      * @return 结果
      */
     public int deleteSysAreaByAreaId(String areaId);
 
     /**
-     * 批量删除世界国家区域
+     * 批量删除全球地区库
      * 
      * @param areaIds 需要删除的数据主键集合
      * @return 结果

+ 16 - 16
healsphere-buss/src/main/java/com/zdqz/system/service/ISysAreaService.java

@@ -4,57 +4,57 @@ import java.util.List;
 import com.zdqz.system.domain.SysArea;
 
 /**
- * 世界国家区域Service接口
+ * 全球地区库Service接口
  * 
  * @author 攻心小虫
- * @date 2025-06-03
+ * @date 2025-06-04
  */
 public interface ISysAreaService 
 {
     /**
-     * 查询世界国家区域
+     * 查询全球地区库
      * 
-     * @param areaId 世界国家区域主键
-     * @return 世界国家区域
+     * @param areaId 全球地区库主键
+     * @return 全球地区库
      */
     public SysArea selectSysAreaByAreaId(String areaId);
 
     /**
-     * 查询世界国家区域列表
+     * 查询全球地区库列表
      * 
-     * @param sysArea 世界国家区域
-     * @return 世界国家区域集合
+     * @param sysArea 全球地区库
+     * @return 全球地区库集合
      */
     public List<SysArea> selectSysAreaList(SysArea sysArea);
 
     /**
-     * 新增世界国家区域
+     * 新增全球地区库
      * 
-     * @param sysArea 世界国家区域
+     * @param sysArea 全球地区库
      * @return 结果
      */
     public int insertSysArea(SysArea sysArea);
 
     /**
-     * 修改世界国家区域
+     * 修改全球地区库
      * 
-     * @param sysArea 世界国家区域
+     * @param sysArea 全球地区库
      * @return 结果
      */
     public int updateSysArea(SysArea sysArea);
 
     /**
-     * 批量删除世界国家区域
+     * 批量删除全球地区库
      * 
-     * @param areaIds 需要删除的世界国家区域主键集合
+     * @param areaIds 需要删除的全球地区库主键集合
      * @return 结果
      */
     public int deleteSysAreaByAreaIds(String[] areaIds);
 
     /**
-     * 删除世界国家区域信息
+     * 删除全球地区库信息
      * 
-     * @param areaId 世界国家区域主键
+     * @param areaId 全球地区库主键
      * @return 结果
      */
     public int deleteSysAreaByAreaId(String areaId);

+ 16 - 16
healsphere-buss/src/main/java/com/zdqz/system/service/impl/SysAreaServiceImpl.java

@@ -8,10 +8,10 @@ import com.zdqz.system.domain.SysArea;
 import com.zdqz.system.service.ISysAreaService;
 
 /**
- * 世界国家区域Service业务层处理
+ * 全球地区库Service业务层处理
  * 
  * @author 攻心小虫
- * @date 2025-06-03
+ * @date 2025-06-04
  */
 @Service
 public class SysAreaServiceImpl implements ISysAreaService 
@@ -20,10 +20,10 @@ public class SysAreaServiceImpl implements ISysAreaService
     private SysAreaMapper sysAreaMapper;
 
     /**
-     * 查询世界国家区域
+     * 查询全球地区库
      * 
-     * @param areaId 世界国家区域主键
-     * @return 世界国家区域
+     * @param areaId 全球地区库主键
+     * @return 全球地区库
      */
     @Override
     public SysArea selectSysAreaByAreaId(String areaId)
@@ -32,10 +32,10 @@ public class SysAreaServiceImpl implements ISysAreaService
     }
 
     /**
-     * 查询世界国家区域列表
+     * 查询全球地区库列表
      * 
-     * @param sysArea 世界国家区域
-     * @return 世界国家区域
+     * @param sysArea 全球地区库
+     * @return 全球地区库
      */
     @Override
     public List<SysArea> selectSysAreaList(SysArea sysArea)
@@ -44,9 +44,9 @@ public class SysAreaServiceImpl implements ISysAreaService
     }
 
     /**
-     * 新增世界国家区域
+     * 新增全球地区库
      * 
-     * @param sysArea 世界国家区域
+     * @param sysArea 全球地区库
      * @return 结果
      */
     @Override
@@ -56,9 +56,9 @@ public class SysAreaServiceImpl implements ISysAreaService
     }
 
     /**
-     * 修改世界国家区域
+     * 修改全球地区库
      * 
-     * @param sysArea 世界国家区域
+     * @param sysArea 全球地区库
      * @return 结果
      */
     @Override
@@ -68,9 +68,9 @@ public class SysAreaServiceImpl implements ISysAreaService
     }
 
     /**
-     * 批量删除世界国家区域
+     * 批量删除全球地区库
      * 
-     * @param areaIds 需要删除的世界国家区域主键
+     * @param areaIds 需要删除的全球地区库主键
      * @return 结果
      */
     @Override
@@ -80,9 +80,9 @@ public class SysAreaServiceImpl implements ISysAreaService
     }
 
     /**
-     * 删除世界国家区域信息
+     * 删除全球地区库信息
      * 
-     * @param areaId 世界国家区域主键
+     * @param areaId 全球地区库主键
      * @return 结果
      */
     @Override

+ 86 - 0
healsphere-buss/src/main/resources/mapper/sample/SampleExperimentMapper.xml

@@ -0,0 +1,86 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.zdqz.sample.mapper.SampleExperimentMapper">
+    
+    <resultMap type="SampleExperiment" id="SampleExperimentResult">
+        <result property="id"    column="id"    />
+        <result property="sampleInfoId"    column="sample_info_id"    />
+        <result property="status"    column="status"    />
+        <result property="dealTime"    column="deal_time"    />
+        <result property="createBy"    column="create_by"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="updateBy"    column="update_by"    />
+        <result property="updateTime"    column="update_time"    />
+        <result property="remark"    column="remark"    />
+    </resultMap>
+
+    <sql id="selectSampleExperimentVo">
+        select id, sample_info_id, status, deal_time, create_by, create_time, update_by, update_time, remark from sample_experiment
+    </sql>
+
+    <select id="selectSampleExperimentList" parameterType="SampleExperiment" resultMap="SampleExperimentResult">
+        <include refid="selectSampleExperimentVo"/>
+        <where>  
+            <if test="sampleInfoId != null "> and sample_info_id = #{sampleInfoId}</if>
+            <if test="status != null "> and status = #{status}</if>
+            <if test="dealTime != null "> and deal_time = #{dealTime}</if>
+        </where>
+    </select>
+    
+    <select id="selectSampleExperimentById" parameterType="Long" resultMap="SampleExperimentResult">
+        <include refid="selectSampleExperimentVo"/>
+        where id = #{id}
+    </select>
+
+    <insert id="insertSampleExperiment" parameterType="SampleExperiment" useGeneratedKeys="true" keyProperty="id">
+        insert into sample_experiment
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="sampleInfoId != null">sample_info_id,</if>
+            <if test="status != null">status,</if>
+            <if test="dealTime != null">deal_time,</if>
+            <if test="createBy != null">create_by,</if>
+            <if test="createTime != null">create_time,</if>
+            <if test="updateBy != null">update_by,</if>
+            <if test="updateTime != null">update_time,</if>
+            <if test="remark != null">remark,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="sampleInfoId != null">#{sampleInfoId},</if>
+            <if test="status != null">#{status},</if>
+            <if test="dealTime != null">#{dealTime},</if>
+            <if test="createBy != null">#{createBy},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="updateBy != null">#{updateBy},</if>
+            <if test="updateTime != null">#{updateTime},</if>
+            <if test="remark != null">#{remark},</if>
+         </trim>
+    </insert>
+
+    <update id="updateSampleExperiment" parameterType="SampleExperiment">
+        update sample_experiment
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="sampleInfoId != null">sample_info_id = #{sampleInfoId},</if>
+            <if test="status != null">status = #{status},</if>
+            <if test="dealTime != null">deal_time = #{dealTime},</if>
+            <if test="createBy != null">create_by = #{createBy},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="updateBy != null">update_by = #{updateBy},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+            <if test="remark != null">remark = #{remark},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteSampleExperimentById" parameterType="Long">
+        delete from sample_experiment where id = #{id}
+    </delete>
+
+    <delete id="deleteSampleExperimentByIds" parameterType="String">
+        delete from sample_experiment where id in 
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+</mapper>

+ 1 - 6
healsphere-buss/src/main/resources/mapper/sample/SampleInfoMapper.xml

@@ -6,7 +6,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     
     <resultMap type="SampleInfo" id="SampleInfoResult">
         <result property="id"    column="id"    />
-        <result property="experimentId"    column="experiment_id"    />
         <result property="patientId"    column="patient_id"    />
         <result property="patientPhone"    column="patient_phone"    />
         <result property="sampleTypeId"    column="sample_type_id"    />
@@ -21,13 +20,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </resultMap>
 
     <sql id="selectSampleInfoVo">
-        select id, experiment_id, patient_id, patient_phone, sample_type_id, sample_hospital_id, sample_dept_id, doctor_name, create_by, create_time, update_by, update_time, remark from sample_info
+        select id, patient_id, patient_phone, sample_type_id, sample_hospital_id, sample_dept_id, doctor_name, create_by, create_time, update_by, update_time, remark from sample_info
     </sql>
 
     <select id="selectSampleInfoList" parameterType="SampleInfo" resultMap="SampleInfoResult">
         <include refid="selectSampleInfoVo"/>
         <where>  
-            <if test="experimentId != null  and experimentId != ''"> and experiment_id = #{experimentId}</if>
             <if test="patientId != null "> and patient_id = #{patientId}</if>
             <if test="patientPhone != null  and patientPhone != ''"> and patient_phone = #{patientPhone}</if>
             <if test="sampleTypeId != null "> and sample_type_id = #{sampleTypeId}</if>
@@ -45,7 +43,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <insert id="insertSampleInfo" parameterType="SampleInfo" useGeneratedKeys="true" keyProperty="id">
         insert into sample_info
         <trim prefix="(" suffix=")" suffixOverrides=",">
-            <if test="experimentId != null">experiment_id,</if>
             <if test="patientId != null">patient_id,</if>
             <if test="patientPhone != null">patient_phone,</if>
             <if test="sampleTypeId != null">sample_type_id,</if>
@@ -59,7 +56,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="remark != null">remark,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
-            <if test="experimentId != null">#{experimentId},</if>
             <if test="patientId != null">#{patientId},</if>
             <if test="patientPhone != null">#{patientPhone},</if>
             <if test="sampleTypeId != null">#{sampleTypeId},</if>
@@ -77,7 +73,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <update id="updateSampleInfo" parameterType="SampleInfo">
         update sample_info
         <trim prefix="SET" suffixOverrides=",">
-            <if test="experimentId != null">experiment_id = #{experimentId},</if>
             <if test="patientId != null">patient_id = #{patientId},</if>
             <if test="patientPhone != null">patient_phone = #{patientPhone},</if>
             <if test="sampleTypeId != null">sample_type_id = #{sampleTypeId},</if>

File diff suppressed because it is too large
+ 6 - 6
healsphere-buss/src/main/resources/mapper/sample/SamplePatientMapper.xml


+ 11 - 21
healsphere-buss/src/main/resources/mapper/system/SysAreaMapper.xml

@@ -7,28 +7,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <resultMap type="SysArea" id="SysAreaResult">
         <result property="areaId"    column="area_id"    />
         <result property="areaParentId"    column="area_parent_id"    />
-        <result property="path"    column="path"    />
         <result property="areaDeep"    column="area_deep"    />
         <result property="areaName"    column="area_name"    />
-        <result property="nameEn"    column="name_en"    />
-        <result property="namePinyin"    column="name_pinyin"    />
-        <result property="code"    column="code"    />
+        <result property="lat"    column="lat"    />
+        <result property="lng"    column="lng"    />
     </resultMap>
 
     <sql id="selectSysAreaVo">
-        select area_id, area_parent_id, path, area_deep, area_name, name_en, name_pinyin, code from sys_area
+        select area_id, area_parent_id, area_deep, area_name, lat, lng from sys_area
     </sql>
 
     <select id="selectSysAreaList" parameterType="SysArea" resultMap="SysAreaResult">
         <include refid="selectSysAreaVo"/>
         <where>  
             <if test="areaParentId != null  and areaParentId != ''"> and area_parent_id = #{areaParentId}</if>
-            <if test="path != null  and path != ''"> and path = #{path}</if>
             <if test="areaDeep != null  and areaDeep != ''"> and area_deep = #{areaDeep}</if>
             <if test="areaName != null  and areaName != ''"> and area_name like concat('%', #{areaName}, '%')</if>
-            <if test="nameEn != null  and nameEn != ''"> and name_en = #{nameEn}</if>
-            <if test="namePinyin != null  and namePinyin != ''"> and name_pinyin = #{namePinyin}</if>
-            <if test="code != null  and code != ''"> and code = #{code}</if>
+            <if test="lat != null  and lat != ''"> and lat = #{lat}</if>
+            <if test="lng != null  and lng != ''"> and lng = #{lng}</if>
         </where>
     </select>
     
@@ -41,21 +37,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         insert into sys_area
         <trim prefix="(" suffix=")" suffixOverrides=",">
             <if test="areaParentId != null">area_parent_id,</if>
-            <if test="path != null">path,</if>
             <if test="areaDeep != null">area_deep,</if>
             <if test="areaName != null">area_name,</if>
-            <if test="nameEn != null">name_en,</if>
-            <if test="namePinyin != null">name_pinyin,</if>
-            <if test="code != null">code,</if>
+            <if test="lat != null">lat,</if>
+            <if test="lng != null">lng,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="areaParentId != null">#{areaParentId},</if>
-            <if test="path != null">#{path},</if>
             <if test="areaDeep != null">#{areaDeep},</if>
             <if test="areaName != null">#{areaName},</if>
-            <if test="nameEn != null">#{nameEn},</if>
-            <if test="namePinyin != null">#{namePinyin},</if>
-            <if test="code != null">#{code},</if>
+            <if test="lat != null">#{lat},</if>
+            <if test="lng != null">#{lng},</if>
          </trim>
     </insert>
 
@@ -63,12 +55,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         update sys_area
         <trim prefix="SET" suffixOverrides=",">
             <if test="areaParentId != null">area_parent_id = #{areaParentId},</if>
-            <if test="path != null">path = #{path},</if>
             <if test="areaDeep != null">area_deep = #{areaDeep},</if>
             <if test="areaName != null">area_name = #{areaName},</if>
-            <if test="nameEn != null">name_en = #{nameEn},</if>
-            <if test="namePinyin != null">name_pinyin = #{namePinyin},</if>
-            <if test="code != null">code = #{code},</if>
+            <if test="lat != null">lat = #{lat},</if>
+            <if test="lng != null">lng = #{lng},</if>
         </trim>
         where area_id = #{areaId}
     </update>

+ 0 - 5
healsphere-common/src/main/java/com/zdqz/common/constant/Constants.java

@@ -75,11 +75,6 @@ public class Constants
      */
     public static final String ALL_PERMISSION = "*:*:*";
 
-    /**
-     * 管理员角色权限标识
-     */
-    public static final String SUPER_ADMIN = "admin";
-
     /**
      * 角色权限分隔符
      */

+ 161 - 225
healsphere-common/src/main/java/com/zdqz/common/core/domain/entity/SysRole.java

@@ -1,11 +1,11 @@
 package com.zdqz.common.core.domain.entity;
 
 import java.util.Set;
+
 import javax.validation.constraints.NotBlank;
 import javax.validation.constraints.NotNull;
 import javax.validation.constraints.Size;
-import org.apache.commons.lang3.builder.ToStringBuilder;
-import org.apache.commons.lang3.builder.ToStringStyle;
+
 import com.zdqz.common.annotation.Excel;
 import com.zdqz.common.annotation.Excel.ColumnType;
 import com.zdqz.common.core.domain.BaseEntity;
@@ -15,227 +15,163 @@ import com.zdqz.common.core.domain.BaseEntity;
  * 
  * @author 攻心小虫
  */
-public class SysRole extends BaseEntity
-{
-    private static final long serialVersionUID = 1L;
-
-    /** 角色ID */
-    @Excel(name = "角色序号", cellType = ColumnType.NUMERIC)
-    private Long roleId;
-
-    /** 角色名称 */
-    @Excel(name = "角色名称")
-    private String roleName;
-
-    /** 角色权限 */
-    @Excel(name = "角色权限")
-    private String roleKey;
-
-    /** 角色排序 */
-    @Excel(name = "角色排序")
-    private Integer roleSort;
-
-    /** 数据范围(1:所有数据权限;2:自定义数据权限;3:本部门数据权限;4:本部门及以下数据权限;5:仅本人数据权限) */
-    @Excel(name = "数据范围", readConverterExp = "1=所有数据权限,2=自定义数据权限,3=本部门数据权限,4=本部门及以下数据权限,5=仅本人数据权限")
-    private String dataScope;
-
-    /** 菜单树选择项是否关联显示( 0:父子不互相关联显示 1:父子互相关联显示) */
-    private boolean menuCheckStrictly;
-
-    /** 部门树选择项是否关联显示(0:父子不互相关联显示 1:父子互相关联显示 ) */
-    private boolean deptCheckStrictly;
-
-    /** 角色状态(0正常 1停用) */
-    @Excel(name = "角色状态", readConverterExp = "0=正常,1=停用")
-    private String status;
-
-    /** 删除标志(0代表存在 2代表删除) */
-    private String delFlag;
-
-    /** 用户是否存在此角色标识 默认不存在 */
-    private boolean flag = false;
-
-    /** 菜单组 */
-    private Long[] menuIds;
-
-    /** 部门组(数据权限) */
-    private Long[] deptIds;
-
-    /** 角色菜单权限 */
-    private Set<String> permissions;
-
-    public SysRole()
-    {
-
-    }
-
-    public SysRole(Long roleId)
-    {
-        this.roleId = roleId;
-    }
-
-    public Long getRoleId()
-    {
-        return roleId;
-    }
-
-    public void setRoleId(Long roleId)
-    {
-        this.roleId = roleId;
-    }
-
-    public boolean isAdmin()
-    {
-        return isAdmin(this.roleId);
-    }
-
-    public static boolean isAdmin(Long roleId)
-    {
-        return roleId != null && 1L == roleId;
-    }
-
-    @NotBlank(message = "角色名称不能为空")
-    @Size(min = 0, max = 30, message = "角色名称长度不能超过30个字符")
-    public String getRoleName()
-    {
-        return roleName;
-    }
-
-    public void setRoleName(String roleName)
-    {
-        this.roleName = roleName;
-    }
-
-    @NotBlank(message = "权限字符不能为空")
-    @Size(min = 0, max = 100, message = "权限字符长度不能超过100个字符")
-    public String getRoleKey()
-    {
-        return roleKey;
-    }
-
-    public void setRoleKey(String roleKey)
-    {
-        this.roleKey = roleKey;
-    }
-
-    @NotNull(message = "显示顺序不能为空")
-    public Integer getRoleSort()
-    {
-        return roleSort;
-    }
-
-    public void setRoleSort(Integer roleSort)
-    {
-        this.roleSort = roleSort;
-    }
-
-    public String getDataScope()
-    {
-        return dataScope;
-    }
-
-    public void setDataScope(String dataScope)
-    {
-        this.dataScope = dataScope;
-    }
-
-    public boolean isMenuCheckStrictly()
-    {
-        return menuCheckStrictly;
-    }
-
-    public void setMenuCheckStrictly(boolean menuCheckStrictly)
-    {
-        this.menuCheckStrictly = menuCheckStrictly;
-    }
-
-    public boolean isDeptCheckStrictly()
-    {
-        return deptCheckStrictly;
-    }
-
-    public void setDeptCheckStrictly(boolean deptCheckStrictly)
-    {
-        this.deptCheckStrictly = deptCheckStrictly;
-    }
-
-    public String getStatus()
-    {
-        return status;
-    }
-
-    public void setStatus(String status)
-    {
-        this.status = status;
-    }
-
-    public String getDelFlag()
-    {
-        return delFlag;
-    }
-
-    public void setDelFlag(String delFlag)
-    {
-        this.delFlag = delFlag;
-    }
-
-    public boolean isFlag()
-    {
-        return flag;
-    }
-
-    public void setFlag(boolean flag)
-    {
-        this.flag = flag;
-    }
-
-    public Long[] getMenuIds()
-    {
-        return menuIds;
-    }
-
-    public void setMenuIds(Long[] menuIds)
-    {
-        this.menuIds = menuIds;
-    }
-
-    public Long[] getDeptIds()
-    {
-        return deptIds;
-    }
-
-    public void setDeptIds(Long[] deptIds)
-    {
-        this.deptIds = deptIds;
-    }
-
-    public Set<String> getPermissions()
-    {
-        return permissions;
-    }
-
-    public void setPermissions(Set<String> permissions)
-    {
-        this.permissions = permissions;
-    }
-
-    @Override
-    public String toString() {
-        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
-            .append("roleId", getRoleId())
-            .append("roleName", getRoleName())
-            .append("roleKey", getRoleKey())
-            .append("roleSort", getRoleSort())
-            .append("dataScope", getDataScope())
-            .append("menuCheckStrictly", isMenuCheckStrictly())
-            .append("deptCheckStrictly", isDeptCheckStrictly())
-            .append("status", getStatus())
-            .append("delFlag", getDelFlag())
-            .append("createBy", getCreateBy())
-            .append("createTime", getCreateTime())
-            .append("updateBy", getUpdateBy())
-            .append("updateTime", getUpdateTime())
-            .append("remark", getRemark())
-            .toString();
-    }
+public class SysRole extends BaseEntity {
+	private static final long serialVersionUID = 1L;
+
+	/** 角色ID */
+	@Excel(name = "角色序号", cellType = ColumnType.NUMERIC)
+	private Long roleId;
+
+	/** 角色名称 */
+	@Excel(name = "角色名称")
+	private String roleName;
+
+	/** 角色排序 */
+	@Excel(name = "角色排序")
+	private Integer roleSort;
+
+	/** 数据范围(1:所有数据权限;2:自定义数据权限;3:本部门数据权限;4:本部门及以下数据权限;5:仅本人数据权限) */
+	@Excel(name = "数据范围", readConverterExp = "1=所有数据权限,2=自定义数据权限,3=本部门数据权限,4=本部门及以下数据权限,5=仅本人数据权限")
+	private String dataScope;
+
+	/** 菜单树选择项是否关联显示( 0:父子不互相关联显示 1:父子互相关联显示) */
+	private boolean menuCheckStrictly;
+
+	/** 部门树选择项是否关联显示(0:父子不互相关联显示 1:父子互相关联显示 ) */
+	private boolean deptCheckStrictly;
+
+	/** 角色状态(0正常 1停用) */
+	@Excel(name = "角色状态", readConverterExp = "0=正常,1=停用")
+	private String status;
+
+	/** 删除标志(0代表存在 2代表删除) */
+	private String delFlag;
+
+	/** 用户是否存在此角色标识 默认不存在 */
+	private boolean flag = false;
+
+	/** 菜单组 */
+	private Long[] menuIds;
+
+	/** 部门组(数据权限) */
+	private Long[] deptIds;
+
+	/** 角色菜单权限 */
+	private Set<String> permissions;
+
+	public SysRole() {
+
+	}
+
+	public SysRole(Long roleId) {
+		this.roleId = roleId;
+	}
+
+	public Long getRoleId() {
+		return roleId;
+	}
+
+	public void setRoleId(Long roleId) {
+		this.roleId = roleId;
+	}
+
+	public boolean isAdmin() {
+		return isAdmin(this.roleId);
+	}
+
+	public static boolean isAdmin(Long roleId) {
+		return roleId != null && 1L == roleId;
+	}
+
+	@NotBlank(message = "角色名称不能为空")
+	@Size(min = 0, max = 30, message = "角色名称长度不能超过30个字符")
+	public String getRoleName() {
+		return roleName;
+	}
+
+	public void setRoleName(String roleName) {
+		this.roleName = roleName;
+	}
+
+	@NotNull(message = "显示顺序不能为空")
+	public Integer getRoleSort() {
+		return roleSort;
+	}
+
+	public void setRoleSort(Integer roleSort) {
+		this.roleSort = roleSort;
+	}
+
+	public String getDataScope() {
+		return dataScope;
+	}
+
+	public void setDataScope(String dataScope) {
+		this.dataScope = dataScope;
+	}
+
+	public boolean isMenuCheckStrictly() {
+		return menuCheckStrictly;
+	}
+
+	public void setMenuCheckStrictly(boolean menuCheckStrictly) {
+		this.menuCheckStrictly = menuCheckStrictly;
+	}
+
+	public boolean isDeptCheckStrictly() {
+		return deptCheckStrictly;
+	}
+
+	public void setDeptCheckStrictly(boolean deptCheckStrictly) {
+		this.deptCheckStrictly = deptCheckStrictly;
+	}
+
+	public String getStatus() {
+		return status;
+	}
+
+	public void setStatus(String status) {
+		this.status = status;
+	}
+
+	public String getDelFlag() {
+		return delFlag;
+	}
+
+	public void setDelFlag(String delFlag) {
+		this.delFlag = delFlag;
+	}
+
+	public boolean isFlag() {
+		return flag;
+	}
+
+	public void setFlag(boolean flag) {
+		this.flag = flag;
+	}
+
+	public Long[] getMenuIds() {
+		return menuIds;
+	}
+
+	public void setMenuIds(Long[] menuIds) {
+		this.menuIds = menuIds;
+	}
+
+	public Long[] getDeptIds() {
+		return deptIds;
+	}
+
+	public void setDeptIds(Long[] deptIds) {
+		this.deptIds = deptIds;
+	}
+
+	public Set<String> getPermissions() {
+		return permissions;
+	}
+
+	public void setPermissions(Set<String> permissions) {
+		this.permissions = permissions;
+	}
+
 }

+ 98 - 149
healsphere-common/src/main/java/com/zdqz/common/utils/SecurityUtils.java

@@ -1,15 +1,14 @@
 package com.zdqz.common.utils;
 
 import java.util.Collection;
-import java.util.List;
-import java.util.stream.Collectors;
+
 import org.springframework.security.core.Authentication;
 import org.springframework.security.core.context.SecurityContextHolder;
 import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
 import org.springframework.util.PatternMatchUtils;
+
 import com.zdqz.common.constant.Constants;
 import com.zdqz.common.constant.HttpStatus;
-import com.zdqz.common.core.domain.entity.SysRole;
 import com.zdqz.common.core.domain.model.LoginUser;
 import com.zdqz.common.exception.ServiceException;
 
@@ -18,161 +17,111 @@ import com.zdqz.common.exception.ServiceException;
  * 
  * @author 攻心小虫
  */
-public class SecurityUtils
-{
-
-    /**
-     * 用户ID
-     **/
-    public static Long getUserId()
-    {
-        try
-        {
-            return getLoginUser().getUserId();
-        }
-        catch (Exception e)
-        {
-            throw new ServiceException("获取用户ID异常", HttpStatus.UNAUTHORIZED);
-        }
-    }
-
-    /**
-     * 获取部门ID
-     **/
-    public static Long getDeptId()
-    {
-        try
-        {
-            return getLoginUser().getDeptId();
-        }
-        catch (Exception e)
-        {
-            throw new ServiceException("获取部门ID异常", HttpStatus.UNAUTHORIZED);
-        }
-    }
+public class SecurityUtils {
 
-    /**
-     * 获取用户账户
-     **/
-    public static String getUsername()
-    {
-        try
-        {
-            return getLoginUser().getUsername();
-        }
-        catch (Exception e)
-        {
-            throw new ServiceException("获取用户账户异常", HttpStatus.UNAUTHORIZED);
-        }
-    }
+	/**
+	 * 用户ID
+	 **/
+	public static Long getUserId() {
+		try {
+			return getLoginUser().getUserId();
+		} catch (Exception e) {
+			throw new ServiceException("获取用户ID异常", HttpStatus.UNAUTHORIZED);
+		}
+	}
 
-    /**
-     * 获取用户
-     **/
-    public static LoginUser getLoginUser()
-    {
-        try
-        {
-            return (LoginUser) getAuthentication().getPrincipal();
-        }
-        catch (Exception e)
-        {
-            throw new ServiceException("获取用户信息异常", HttpStatus.UNAUTHORIZED);
-        }
-    }
+	/**
+	 * 获取部门ID
+	 **/
+	public static Long getDeptId() {
+		try {
+			return getLoginUser().getDeptId();
+		} catch (Exception e) {
+			throw new ServiceException("获取部门ID异常", HttpStatus.UNAUTHORIZED);
+		}
+	}
 
-    /**
-     * 获取Authentication
-     */
-    public static Authentication getAuthentication()
-    {
-        return SecurityContextHolder.getContext().getAuthentication();
-    }
+	/**
+	 * 获取用户账户
+	 **/
+	public static String getUsername() {
+		try {
+			return getLoginUser().getUsername();
+		} catch (Exception e) {
+			throw new ServiceException("获取用户账户异常", HttpStatus.UNAUTHORIZED);
+		}
+	}
 
-    /**
-     * 生成BCryptPasswordEncoder密码
-     *
-     * @param password 密码
-     * @return 加密字符串
-     */
-    public static String encryptPassword(String password)
-    {
-        BCryptPasswordEncoder passwordEncoder = new BCryptPasswordEncoder();
-        return passwordEncoder.encode(password);
-    }
+	/**
+	 * 获取用户
+	 **/
+	public static LoginUser getLoginUser() {
+		try {
+			return (LoginUser) getAuthentication().getPrincipal();
+		} catch (Exception e) {
+			throw new ServiceException("获取用户信息异常", HttpStatus.UNAUTHORIZED);
+		}
+	}
 
-    /**
-     * 判断密码是否相同
-     *
-     * @param rawPassword 真实密码
-     * @param encodedPassword 加密后字符
-     * @return 结果
-     */
-    public static boolean matchesPassword(String rawPassword, String encodedPassword)
-    {
-        BCryptPasswordEncoder passwordEncoder = new BCryptPasswordEncoder();
-        return passwordEncoder.matches(rawPassword, encodedPassword);
-    }
+	/**
+	 * 获取Authentication
+	 */
+	public static Authentication getAuthentication() {
+		return SecurityContextHolder.getContext().getAuthentication();
+	}
 
-    /**
-     * 是否为管理员
-     * 
-     * @param userId 用户ID
-     * @return 结果
-     */
-    public static boolean isAdmin(Long userId)
-    {
-        return userId != null && 1L == userId;
-    }
+	/**
+	 * 生成BCryptPasswordEncoder密码
+	 *
+	 * @param password 密码
+	 * @return 加密字符串
+	 */
+	public static String encryptPassword(String password) {
+		BCryptPasswordEncoder passwordEncoder = new BCryptPasswordEncoder();
+		return passwordEncoder.encode(password);
+	}
 
-    /**
-     * 验证用户是否具备某权限
-     * 
-     * @param permission 权限字符串
-     * @return 用户是否具备某权限
-     */
-    public static boolean hasPermi(String permission)
-    {
-        return hasPermi(getLoginUser().getPermissions(), permission);
-    }
+	/**
+	 * 判断密码是否相同
+	 *
+	 * @param rawPassword     真实密码
+	 * @param encodedPassword 加密后字符
+	 * @return 结果
+	 */
+	public static boolean matchesPassword(String rawPassword, String encodedPassword) {
+		BCryptPasswordEncoder passwordEncoder = new BCryptPasswordEncoder();
+		return passwordEncoder.matches(rawPassword, encodedPassword);
+	}
 
-    /**
-     * 判断是否包含权限
-     * 
-     * @param authorities 权限列表
-     * @param permission 权限字符串
-     * @return 用户是否具备某权限
-     */
-    public static boolean hasPermi(Collection<String> authorities, String permission)
-    {
-        return authorities.stream().filter(StringUtils::hasText)
-                .anyMatch(x -> Constants.ALL_PERMISSION.equals(x) || PatternMatchUtils.simpleMatch(x, permission));
-    }
+	/**
+	 * 是否为管理员
+	 * 
+	 * @param userId 用户ID
+	 * @return 结果
+	 */
+	public static boolean isAdmin(Long userId) {
+		return userId != null && 1L == userId;
+	}
 
-    /**
-     * 验证用户是否拥有某个角色
-     * 
-     * @param role 角色标识
-     * @return 用户是否具备某角色
-     */
-    public static boolean hasRole(String role)
-    {
-        List<SysRole> roleList = getLoginUser().getUser().getRoles();
-        Collection<String> roles = roleList.stream().map(SysRole::getRoleKey).collect(Collectors.toSet());
-        return hasRole(roles, role);
-    }
+	/**
+	 * 验证用户是否具备某权限
+	 * 
+	 * @param permission 权限字符串
+	 * @return 用户是否具备某权限
+	 */
+	public static boolean hasPermi(String permission) {
+		return hasPermi(getLoginUser().getPermissions(), permission);
+	}
 
-    /**
-     * 判断是否包含角色
-     * 
-     * @param roles 角色列表
-     * @param role 角色
-     * @return 用户是否具备某角色权限
-     */
-    public static boolean hasRole(Collection<String> roles, String role)
-    {
-        return roles.stream().filter(StringUtils::hasText)
-                .anyMatch(x -> Constants.SUPER_ADMIN.equals(x) || PatternMatchUtils.simpleMatch(x, role));
-    }
+	/**
+	 * 判断是否包含权限
+	 * 
+	 * @param authorities 权限列表
+	 * @param permission  权限字符串
+	 * @return 用户是否具备某权限
+	 */
+	public static boolean hasPermi(Collection<String> authorities, String permission) {
+		return authorities.stream().filter(StringUtils::hasText).anyMatch(x -> Constants.ALL_PERMISSION.equals(x) || PatternMatchUtils.simpleMatch(x, permission));
+	}
 
 }

+ 0 - 1
healsphere-framework/src/main/java/com/zdqz/framework/config/SecurityConfig.java

@@ -88,7 +88,6 @@ public class SecurityConfig
      * hasAnyRole          |   如果有参数,参数表示角色,则其中任何一个角色可以访问
      * hasAuthority        |   如果有参数,参数表示权限,则其权限可以访问
      * hasIpAddress        |   如果有参数,参数表示IP地址,如果用户IP和参数匹配,则可以访问
-     * hasRole             |   如果有参数,参数表示角色,则其角色可以访问
      * permitAll           |   用户可以任意访问
      * rememberMe          |   允许通过remember-me登录的用户访问
      * authenticated       |   用户登录后可访问

+ 2 - 56
healsphere-framework/src/main/java/com/zdqz/framework/web/service/PermissionService.java

@@ -1,10 +1,11 @@
 package com.zdqz.framework.web.service;
 
 import java.util.Set;
+
 import org.springframework.stereotype.Service;
 import org.springframework.util.CollectionUtils;
+
 import com.zdqz.common.constant.Constants;
-import com.zdqz.common.core.domain.entity.SysRole;
 import com.zdqz.common.core.domain.model.LoginUser;
 import com.zdqz.common.utils.SecurityUtils;
 import com.zdqz.common.utils.StringUtils;
@@ -69,61 +70,6 @@ public class PermissionService {
 		return false;
 	}
 
-	/**
-	 * 判断用户是否拥有某个角色
-	 * 
-	 * @param role 角色字符串
-	 * @return 用户是否具备某角色
-	 */
-	public boolean hasRole(String role) {
-		if (StringUtils.isEmpty(role)) {
-			return false;
-		}
-		LoginUser loginUser = SecurityUtils.getLoginUser();
-		if (StringUtils.isNull(loginUser) || CollectionUtils.isEmpty(loginUser.getUser().getRoles())) {
-			return false;
-		}
-		for (SysRole sysRole : loginUser.getUser().getRoles()) {
-			String roleKey = sysRole.getRoleKey();
-			if (Constants.SUPER_ADMIN.equals(roleKey) || roleKey.equals(StringUtils.trim(role))) {
-				return true;
-			}
-		}
-		return false;
-	}
-
-	/**
-	 * 验证用户是否不具备某角色,与 isRole逻辑相反。
-	 *
-	 * @param role 角色名称
-	 * @return 用户是否不具备某角色
-	 */
-	public boolean lacksRole(String role) {
-		return hasRole(role) != true;
-	}
-
-	/**
-	 * 验证用户是否具有以下任意一个角色
-	 *
-	 * @param roles 以 ROLE_NAMES_DELIMETER 为分隔符的角色列表
-	 * @return 用户是否具有以下任意一个角色
-	 */
-	public boolean hasAnyRoles(String roles) {
-		if (StringUtils.isEmpty(roles)) {
-			return false;
-		}
-		LoginUser loginUser = SecurityUtils.getLoginUser();
-		if (StringUtils.isNull(loginUser) || CollectionUtils.isEmpty(loginUser.getUser().getRoles())) {
-			return false;
-		}
-		for (String role : roles.split(Constants.ROLE_DELIMETER)) {
-			if (hasRole(role)) {
-				return true;
-			}
-		}
-		return false;
-	}
-
 	/**
 	 * 判断是否包含权限
 	 * 

+ 47 - 64
healsphere-framework/src/main/java/com/zdqz/framework/web/service/SysPermissionService.java

@@ -3,15 +3,16 @@ package com.zdqz.framework.web.service;
 import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
+
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 import org.springframework.util.CollectionUtils;
+
 import com.zdqz.common.constant.UserConstants;
 import com.zdqz.common.core.domain.entity.SysRole;
 import com.zdqz.common.core.domain.entity.SysUser;
 import com.zdqz.common.utils.StringUtils;
 import com.zdqz.system.service.ISysMenuService;
-import com.zdqz.system.service.ISysRoleService;
 
 /**
  * 用户权限处理
@@ -19,70 +20,52 @@ import com.zdqz.system.service.ISysRoleService;
  * @author 攻心小虫
  */
 @Component
-public class SysPermissionService
-{
-    @Autowired
-    private ISysRoleService roleService;
+public class SysPermissionService {
 
-    @Autowired
-    private ISysMenuService menuService;
+	@Autowired
+	private ISysMenuService menuService;
 
-    /**
-     * 获取角色数据权限
-     * 
-     * @param user 用户信息
-     * @return 角色权限信息
-     */
-    public Set<String> getRolePermission(SysUser user)
-    {
-        Set<String> roles = new HashSet<String>();
-        // 管理员拥有所有权限
-        if (user.isAdmin())
-        {
-            roles.add("admin");
-        }
-        else
-        {
-            roles.addAll(roleService.selectRolePermissionByUserId(user.getUserId()));
-        }
-        return roles;
-    }
+	/**
+	 * 获取角色数据权限
+	 * 
+	 * @param user 用户信息
+	 * @return 角色权限信息
+	 */
+	public Set<String> getRolePermission(SysUser user) {
+		Set<String> roles = new HashSet<String>();
+		// 管理员拥有所有权限
+		if (user.isAdmin()) {
+			roles.add("admin");
+		}
+		return roles;
+	}
 
-    /**
-     * 获取菜单数据权限
-     * 
-     * @param user 用户信息
-     * @return 菜单权限信息
-     */
-    public Set<String> getMenuPermission(SysUser user)
-    {
-        Set<String> perms = new HashSet<String>();
-        // 管理员拥有所有权限
-        if (user.isAdmin())
-        {
-            perms.add("*:*:*");
-        }
-        else
-        {
-            List<SysRole> roles = user.getRoles();
-            if (!CollectionUtils.isEmpty(roles))
-            {
-                // 多角色设置permissions属性,以便数据权限匹配权限
-                for (SysRole role : roles)
-                {
-                    if (StringUtils.equals(role.getStatus(), UserConstants.ROLE_NORMAL) && !role.isAdmin())
-                    {
-                        Set<String> rolePerms = menuService.selectMenuPermsByRoleId(role.getRoleId());
-                        role.setPermissions(rolePerms);
-                        perms.addAll(rolePerms);
-                    }
-                }
-            }
-            else
-            {
-                perms.addAll(menuService.selectMenuPermsByUserId(user.getUserId()));
-            }
-        }
-        return perms;
-    }
+	/**
+	 * 获取菜单数据权限
+	 * 
+	 * @param user 用户信息
+	 * @return 菜单权限信息
+	 */
+	public Set<String> getMenuPermission(SysUser user) {
+		Set<String> perms = new HashSet<String>();
+		// 管理员拥有所有权限
+		if (user.isAdmin()) {
+			perms.add("*:*:*");
+		} else {
+			List<SysRole> roles = user.getRoles();
+			if (!CollectionUtils.isEmpty(roles)) {
+				// 多角色设置permissions属性,以便数据权限匹配权限
+				for (SysRole role : roles) {
+					if (StringUtils.equals(role.getStatus(), UserConstants.ROLE_NORMAL) && !role.isAdmin()) {
+						Set<String> rolePerms = menuService.selectMenuPermsByRoleId(role.getRoleId());
+						role.setPermissions(rolePerms);
+						perms.addAll(rolePerms);
+					}
+				}
+			} else {
+				perms.addAll(menuService.selectMenuPermsByUserId(user.getUserId()));
+			}
+		}
+		return perms;
+	}
 }

+ 0 - 8
healsphere-system/src/main/java/com/zdqz/system/mapper/SysRoleMapper.java

@@ -65,14 +65,6 @@ public interface SysRoleMapper
      */
     public SysRole checkRoleNameUnique(String roleName);
 
-    /**
-     * 校验角色权限是否唯一
-     * 
-     * @param roleKey 角色权限
-     * @return 角色信息
-     */
-    public SysRole checkRoleKeyUnique(String roleKey);
-
     /**
      * 修改角色信息
      * 

+ 145 - 161
healsphere-system/src/main/java/com/zdqz/system/service/ISysRoleService.java

@@ -1,7 +1,7 @@
 package com.zdqz.system.service;
 
 import java.util.List;
-import java.util.Set;
+
 import com.zdqz.common.core.domain.entity.SysRole;
 import com.zdqz.system.domain.SysUserRole;
 
@@ -10,164 +10,148 @@ import com.zdqz.system.domain.SysUserRole;
  * 
  * @author 攻心小虫
  */
-public interface ISysRoleService
-{
-    /**
-     * 根据条件分页查询角色数据
-     * 
-     * @param role 角色信息
-     * @return 角色数据集合信息
-     */
-    public List<SysRole> selectRoleList(SysRole role);
-
-    /**
-     * 根据用户ID查询角色列表
-     * 
-     * @param userId 用户ID
-     * @return 角色列表
-     */
-    public List<SysRole> selectRolesByUserId(Long userId);
-
-    /**
-     * 根据用户ID查询角色权限
-     * 
-     * @param userId 用户ID
-     * @return 权限列表
-     */
-    public Set<String> selectRolePermissionByUserId(Long userId);
-
-    /**
-     * 查询所有角色
-     * 
-     * @return 角色列表
-     */
-    public List<SysRole> selectRoleAll();
-
-    /**
-     * 根据用户ID获取角色选择框列表
-     * 
-     * @param userId 用户ID
-     * @return 选中角色ID列表
-     */
-    public List<Long> selectRoleListByUserId(Long userId);
-
-    /**
-     * 通过角色ID查询角色
-     * 
-     * @param roleId 角色ID
-     * @return 角色对象信息
-     */
-    public SysRole selectRoleById(Long roleId);
-
-    /**
-     * 校验角色名称是否唯一
-     * 
-     * @param role 角色信息
-     * @return 结果
-     */
-    public boolean checkRoleNameUnique(SysRole role);
-
-    /**
-     * 校验角色权限是否唯一
-     * 
-     * @param role 角色信息
-     * @return 结果
-     */
-    public boolean checkRoleKeyUnique(SysRole role);
-
-    /**
-     * 校验角色是否允许操作
-     * 
-     * @param role 角色信息
-     */
-    public void checkRoleAllowed(SysRole role);
-
-    /**
-     * 校验角色是否有数据权限
-     * 
-     * @param roleIds 角色id
-     */
-    public void checkRoleDataScope(Long... roleIds);
-
-    /**
-     * 通过角色ID查询角色使用数量
-     * 
-     * @param roleId 角色ID
-     * @return 结果
-     */
-    public int countUserRoleByRoleId(Long roleId);
-
-    /**
-     * 新增保存角色信息
-     * 
-     * @param role 角色信息
-     * @return 结果
-     */
-    public int insertRole(SysRole role);
-
-    /**
-     * 修改保存角色信息
-     * 
-     * @param role 角色信息
-     * @return 结果
-     */
-    public int updateRole(SysRole role);
-
-    /**
-     * 修改角色状态
-     * 
-     * @param role 角色信息
-     * @return 结果
-     */
-    public int updateRoleStatus(SysRole role);
-
-    /**
-     * 修改数据权限信息
-     * 
-     * @param role 角色信息
-     * @return 结果
-     */
-    public int authDataScope(SysRole role);
-
-    /**
-     * 通过角色ID删除角色
-     * 
-     * @param roleId 角色ID
-     * @return 结果
-     */
-    public int deleteRoleById(Long roleId);
-
-    /**
-     * 批量删除角色信息
-     * 
-     * @param roleIds 需要删除的角色ID
-     * @return 结果
-     */
-    public int deleteRoleByIds(Long[] roleIds);
-
-    /**
-     * 取消授权用户角色
-     * 
-     * @param userRole 用户和角色关联信息
-     * @return 结果
-     */
-    public int deleteAuthUser(SysUserRole userRole);
-
-    /**
-     * 批量取消授权用户角色
-     * 
-     * @param roleId 角色ID
-     * @param userIds 需要取消授权的用户数据ID
-     * @return 结果
-     */
-    public int deleteAuthUsers(Long roleId, Long[] userIds);
-
-    /**
-     * 批量选择授权用户角色
-     * 
-     * @param roleId 角色ID
-     * @param userIds 需要删除的用户数据ID
-     * @return 结果
-     */
-    public int insertAuthUsers(Long roleId, Long[] userIds);
+public interface ISysRoleService {
+	/**
+	 * 根据条件分页查询角色数据
+	 * 
+	 * @param role 角色信息
+	 * @return 角色数据集合信息
+	 */
+	public List<SysRole> selectRoleList(SysRole role);
+
+	/**
+	 * 根据用户ID查询角色列表
+	 * 
+	 * @param userId 用户ID
+	 * @return 角色列表
+	 */
+	public List<SysRole> selectRolesByUserId(Long userId);
+
+	/**
+	 * 查询所有角色
+	 * 
+	 * @return 角色列表
+	 */
+	public List<SysRole> selectRoleAll();
+
+	/**
+	 * 根据用户ID获取角色选择框列表
+	 * 
+	 * @param userId 用户ID
+	 * @return 选中角色ID列表
+	 */
+	public List<Long> selectRoleListByUserId(Long userId);
+
+	/**
+	 * 通过角色ID查询角色
+	 * 
+	 * @param roleId 角色ID
+	 * @return 角色对象信息
+	 */
+	public SysRole selectRoleById(Long roleId);
+
+	/**
+	 * 校验角色名称是否唯一
+	 * 
+	 * @param role 角色信息
+	 * @return 结果
+	 */
+	public boolean checkRoleNameUnique(SysRole role);
+
+
+	/**
+	 * 校验角色是否允许操作
+	 * 
+	 * @param role 角色信息
+	 */
+	public void checkRoleAllowed(SysRole role);
+
+	/**
+	 * 校验角色是否有数据权限
+	 * 
+	 * @param roleIds 角色id
+	 */
+	public void checkRoleDataScope(Long... roleIds);
+
+	/**
+	 * 通过角色ID查询角色使用数量
+	 * 
+	 * @param roleId 角色ID
+	 * @return 结果
+	 */
+	public int countUserRoleByRoleId(Long roleId);
+
+	/**
+	 * 新增保存角色信息
+	 * 
+	 * @param role 角色信息
+	 * @return 结果
+	 */
+	public int insertRole(SysRole role);
+
+	/**
+	 * 修改保存角色信息
+	 * 
+	 * @param role 角色信息
+	 * @return 结果
+	 */
+	public int updateRole(SysRole role);
+
+	/**
+	 * 修改角色状态
+	 * 
+	 * @param role 角色信息
+	 * @return 结果
+	 */
+	public int updateRoleStatus(SysRole role);
+
+	/**
+	 * 修改数据权限信息
+	 * 
+	 * @param role 角色信息
+	 * @return 结果
+	 */
+	public int authDataScope(SysRole role);
+
+	/**
+	 * 通过角色ID删除角色
+	 * 
+	 * @param roleId 角色ID
+	 * @return 结果
+	 */
+	public int deleteRoleById(Long roleId);
+
+	/**
+	 * 批量删除角色信息
+	 * 
+	 * @param roleIds 需要删除的角色ID
+	 * @return 结果
+	 */
+	public int deleteRoleByIds(Long[] roleIds);
+
+	/**
+	 * 取消授权用户角色
+	 * 
+	 * @param userRole 用户和角色关联信息
+	 * @return 结果
+	 */
+	public int deleteAuthUser(SysUserRole userRole);
+
+	/**
+	 * 批量取消授权用户角色
+	 * 
+	 * @param roleId  角色ID
+	 * @param userIds 需要取消授权的用户数据ID
+	 * @return 结果
+	 */
+	public int deleteAuthUsers(Long roleId, Long[] userIds);
+
+	/**
+	 * 批量选择授权用户角色
+	 * 
+	 * @param roleId  角色ID
+	 * @param userIds 需要删除的用户数据ID
+	 * @return 结果
+	 */
+	public int insertAuthUsers(Long roleId, Long[] userIds);
 }

+ 297 - 373
healsphere-system/src/main/java/com/zdqz/system/service/impl/SysRoleServiceImpl.java

@@ -1,13 +1,12 @@
 package com.zdqz.system.service.impl;
 
 import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashSet;
 import java.util.List;
-import java.util.Set;
+
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
+
 import com.zdqz.common.annotation.DataScope;
 import com.zdqz.common.constant.UserConstants;
 import com.zdqz.common.core.domain.entity.SysRole;
@@ -31,397 +30,322 @@ import com.zdqz.system.service.ISysRoleService;
  * @author 攻心小虫
  */
 @Service
-public class SysRoleServiceImpl implements ISysRoleService
-{
-    @Autowired
-    private SysRoleMapper roleMapper;
-
-    @Autowired
-    private SysRoleMenuMapper roleMenuMapper;
-
-    @Autowired
-    private SysUserRoleMapper userRoleMapper;
+public class SysRoleServiceImpl implements ISysRoleService {
+	@Autowired
+	private SysRoleMapper roleMapper;
 
-    @Autowired
-    private SysRoleDeptMapper roleDeptMapper;
+	@Autowired
+	private SysRoleMenuMapper roleMenuMapper;
 
-    /**
-     * 根据条件分页查询角色数据
-     * 
-     * @param role 角色信息
-     * @return 角色数据集合信息
-     */
-    @Override
-    @DataScope(deptAlias = "d")
-    public List<SysRole> selectRoleList(SysRole role)
-    {
-        return roleMapper.selectRoleList(role);
-    }
+	@Autowired
+	private SysUserRoleMapper userRoleMapper;
 
-    /**
-     * 根据用户ID查询角色
-     * 
-     * @param userId 用户ID
-     * @return 角色列表
-     */
-    @Override
-    public List<SysRole> selectRolesByUserId(Long userId)
-    {
-        List<SysRole> userRoles = roleMapper.selectRolePermissionByUserId(userId);
-        List<SysRole> roles = selectRoleAll();
-        for (SysRole role : roles)
-        {
-            for (SysRole userRole : userRoles)
-            {
-                if (role.getRoleId().longValue() == userRole.getRoleId().longValue())
-                {
-                    role.setFlag(true);
-                    break;
-                }
-            }
-        }
-        return roles;
-    }
+	@Autowired
+	private SysRoleDeptMapper roleDeptMapper;
 
-    /**
-     * 根据用户ID查询权限
-     * 
-     * @param userId 用户ID
-     * @return 权限列表
-     */
-    @Override
-    public Set<String> selectRolePermissionByUserId(Long userId)
-    {
-        List<SysRole> perms = roleMapper.selectRolePermissionByUserId(userId);
-        Set<String> permsSet = new HashSet<>();
-        for (SysRole perm : perms)
-        {
-            if (StringUtils.isNotNull(perm))
-            {
-                permsSet.addAll(Arrays.asList(perm.getRoleKey().trim().split(",")));
-            }
-        }
-        return permsSet;
-    }
+	/**
+	 * 根据条件分页查询角色数据
+	 * 
+	 * @param role 角色信息
+	 * @return 角色数据集合信息
+	 */
+	@Override
+	@DataScope(deptAlias = "d")
+	public List<SysRole> selectRoleList(SysRole role) {
+		return roleMapper.selectRoleList(role);
+	}
 
-    /**
-     * 查询所有角色
-     * 
-     * @return 角色列表
-     */
-    @Override
-    public List<SysRole> selectRoleAll()
-    {
-        return SpringUtils.getAopProxy(this).selectRoleList(new SysRole());
-    }
+	/**
+	 * 根据用户ID查询角色
+	 * 
+	 * @param userId 用户ID
+	 * @return 角色列表
+	 */
+	@Override
+	public List<SysRole> selectRolesByUserId(Long userId) {
+		List<SysRole> userRoles = roleMapper.selectRolePermissionByUserId(userId);
+		List<SysRole> roles = selectRoleAll();
+		for (SysRole role : roles) {
+			for (SysRole userRole : userRoles) {
+				if (role.getRoleId().longValue() == userRole.getRoleId().longValue()) {
+					role.setFlag(true);
+					break;
+				}
+			}
+		}
+		return roles;
+	}
 
-    /**
-     * 根据用户ID获取角色选择框列表
-     * 
-     * @param userId 用户ID
-     * @return 选中角色ID列表
-     */
-    @Override
-    public List<Long> selectRoleListByUserId(Long userId)
-    {
-        return roleMapper.selectRoleListByUserId(userId);
-    }
+	/**
+	 * 查询所有角色
+	 * 
+	 * @return 角色列表
+	 */
+	@Override
+	public List<SysRole> selectRoleAll() {
+		return SpringUtils.getAopProxy(this).selectRoleList(new SysRole());
+	}
 
-    /**
-     * 通过角色ID查询角色
-     * 
-     * @param roleId 角色ID
-     * @return 角色对象信息
-     */
-    @Override
-    public SysRole selectRoleById(Long roleId)
-    {
-        return roleMapper.selectRoleById(roleId);
-    }
+	/**
+	 * 根据用户ID获取角色选择框列表
+	 * 
+	 * @param userId 用户ID
+	 * @return 选中角色ID列表
+	 */
+	@Override
+	public List<Long> selectRoleListByUserId(Long userId) {
+		return roleMapper.selectRoleListByUserId(userId);
+	}
 
-    /**
-     * 校验角色名称是否唯一
-     * 
-     * @param role 角色信息
-     * @return 结果
-     */
-    @Override
-    public boolean checkRoleNameUnique(SysRole role)
-    {
-        Long roleId = StringUtils.isNull(role.getRoleId()) ? -1L : role.getRoleId();
-        SysRole info = roleMapper.checkRoleNameUnique(role.getRoleName());
-        if (StringUtils.isNotNull(info) && info.getRoleId().longValue() != roleId.longValue())
-        {
-            return UserConstants.NOT_UNIQUE;
-        }
-        return UserConstants.UNIQUE;
-    }
+	/**
+	 * 通过角色ID查询角色
+	 * 
+	 * @param roleId 角色ID
+	 * @return 角色对象信息
+	 */
+	@Override
+	public SysRole selectRoleById(Long roleId) {
+		return roleMapper.selectRoleById(roleId);
+	}
 
-    /**
-     * 校验角色权限是否唯一
-     * 
-     * @param role 角色信息
-     * @return 结果
-     */
-    @Override
-    public boolean checkRoleKeyUnique(SysRole role)
-    {
-        Long roleId = StringUtils.isNull(role.getRoleId()) ? -1L : role.getRoleId();
-        SysRole info = roleMapper.checkRoleKeyUnique(role.getRoleKey());
-        if (StringUtils.isNotNull(info) && info.getRoleId().longValue() != roleId.longValue())
-        {
-            return UserConstants.NOT_UNIQUE;
-        }
-        return UserConstants.UNIQUE;
-    }
+	/**
+	 * 校验角色名称是否唯一
+	 * 
+	 * @param role 角色信息
+	 * @return 结果
+	 */
+	@Override
+	public boolean checkRoleNameUnique(SysRole role) {
+		Long roleId = StringUtils.isNull(role.getRoleId()) ? -1L : role.getRoleId();
+		SysRole info = roleMapper.checkRoleNameUnique(role.getRoleName());
+		if (StringUtils.isNotNull(info) && info.getRoleId().longValue() != roleId.longValue()) {
+			return UserConstants.NOT_UNIQUE;
+		}
+		return UserConstants.UNIQUE;
+	}
 
-    /**
-     * 校验角色是否允许操作
-     * 
-     * @param role 角色信息
-     */
-    @Override
-    public void checkRoleAllowed(SysRole role)
-    {
-        if (StringUtils.isNotNull(role.getRoleId()) && role.isAdmin())
-        {
-            throw new ServiceException("不允许操作超级管理员角色");
-        }
-    }
+	/**
+	 * 校验角色是否允许操作
+	 * 
+	 * @param role 角色信息
+	 */
+	@Override
+	public void checkRoleAllowed(SysRole role) {
+		if (StringUtils.isNotNull(role.getRoleId()) && role.isAdmin()) {
+			throw new ServiceException("不允许操作超级管理员角色");
+		}
+	}
 
-    /**
-     * 校验角色是否有数据权限
-     * 
-     * @param roleIds 角色id
-     */
-    @Override
-    public void checkRoleDataScope(Long... roleIds)
-    {
-        if (!SysUser.isAdmin(SecurityUtils.getUserId()))
-        {
-            for (Long roleId : roleIds)
-            {
-                SysRole role = new SysRole();
-                role.setRoleId(roleId);
-                List<SysRole> roles = SpringUtils.getAopProxy(this).selectRoleList(role);
-                if (StringUtils.isEmpty(roles))
-                {
-                    throw new ServiceException("没有权限访问角色数据!");
-                }
-            }
-        }
-    }
+	/**
+	 * 校验角色是否有数据权限
+	 * 
+	 * @param roleIds 角色id
+	 */
+	@Override
+	public void checkRoleDataScope(Long... roleIds) {
+		if (!SysUser.isAdmin(SecurityUtils.getUserId())) {
+			for (Long roleId : roleIds) {
+				SysRole role = new SysRole();
+				role.setRoleId(roleId);
+				List<SysRole> roles = SpringUtils.getAopProxy(this).selectRoleList(role);
+				if (StringUtils.isEmpty(roles)) {
+					throw new ServiceException("没有权限访问角色数据!");
+				}
+			}
+		}
+	}
 
-    /**
-     * 通过角色ID查询角色使用数量
-     * 
-     * @param roleId 角色ID
-     * @return 结果
-     */
-    @Override
-    public int countUserRoleByRoleId(Long roleId)
-    {
-        return userRoleMapper.countUserRoleByRoleId(roleId);
-    }
+	/**
+	 * 通过角色ID查询角色使用数量
+	 * 
+	 * @param roleId 角色ID
+	 * @return 结果
+	 */
+	@Override
+	public int countUserRoleByRoleId(Long roleId) {
+		return userRoleMapper.countUserRoleByRoleId(roleId);
+	}
 
-    /**
-     * 新增保存角色信息
-     * 
-     * @param role 角色信息
-     * @return 结果
-     */
-    @Override
-    @Transactional
-    public int insertRole(SysRole role)
-    {
-        // 新增角色信息
-        roleMapper.insertRole(role);
-        return insertRoleMenu(role);
-    }
+	/**
+	 * 新增保存角色信息
+	 * 
+	 * @param role 角色信息
+	 * @return 结果
+	 */
+	@Override
+	@Transactional
+	public int insertRole(SysRole role) {
+		// 新增角色信息
+		roleMapper.insertRole(role);
+		return insertRoleMenu(role);
+	}
 
-    /**
-     * 修改保存角色信息
-     * 
-     * @param role 角色信息
-     * @return 结果
-     */
-    @Override
-    @Transactional
-    public int updateRole(SysRole role)
-    {
-        // 修改角色信息
-        roleMapper.updateRole(role);
-        // 删除角色与菜单关联
-        roleMenuMapper.deleteRoleMenuByRoleId(role.getRoleId());
-        return insertRoleMenu(role);
-    }
+	/**
+	 * 修改保存角色信息
+	 * 
+	 * @param role 角色信息
+	 * @return 结果
+	 */
+	@Override
+	@Transactional
+	public int updateRole(SysRole role) {
+		// 修改角色信息
+		roleMapper.updateRole(role);
+		// 删除角色与菜单关联
+		roleMenuMapper.deleteRoleMenuByRoleId(role.getRoleId());
+		return insertRoleMenu(role);
+	}
 
-    /**
-     * 修改角色状态
-     * 
-     * @param role 角色信息
-     * @return 结果
-     */
-    @Override
-    public int updateRoleStatus(SysRole role)
-    {
-        return roleMapper.updateRole(role);
-    }
+	/**
+	 * 修改角色状态
+	 * 
+	 * @param role 角色信息
+	 * @return 结果
+	 */
+	@Override
+	public int updateRoleStatus(SysRole role) {
+		return roleMapper.updateRole(role);
+	}
 
-    /**
-     * 修改数据权限信息
-     * 
-     * @param role 角色信息
-     * @return 结果
-     */
-    @Override
-    @Transactional
-    public int authDataScope(SysRole role)
-    {
-        // 修改角色信息
-        roleMapper.updateRole(role);
-        // 删除角色与部门关联
-        roleDeptMapper.deleteRoleDeptByRoleId(role.getRoleId());
-        // 新增角色和部门信息(数据权限)
-        return insertRoleDept(role);
-    }
+	/**
+	 * 修改数据权限信息
+	 * 
+	 * @param role 角色信息
+	 * @return 结果
+	 */
+	@Override
+	@Transactional
+	public int authDataScope(SysRole role) {
+		// 修改角色信息
+		roleMapper.updateRole(role);
+		// 删除角色与部门关联
+		roleDeptMapper.deleteRoleDeptByRoleId(role.getRoleId());
+		// 新增角色和部门信息(数据权限)
+		return insertRoleDept(role);
+	}
 
-    /**
-     * 新增角色菜单信息
-     * 
-     * @param role 角色对象
-     */
-    public int insertRoleMenu(SysRole role)
-    {
-        int rows = 1;
-        // 新增用户与角色管理
-        List<SysRoleMenu> list = new ArrayList<SysRoleMenu>();
-        for (Long menuId : role.getMenuIds())
-        {
-            SysRoleMenu rm = new SysRoleMenu();
-            rm.setRoleId(role.getRoleId());
-            rm.setMenuId(menuId);
-            list.add(rm);
-        }
-        if (list.size() > 0)
-        {
-            rows = roleMenuMapper.batchRoleMenu(list);
-        }
-        return rows;
-    }
+	/**
+	 * 新增角色菜单信息
+	 * 
+	 * @param role 角色对象
+	 */
+	public int insertRoleMenu(SysRole role) {
+		int rows = 1;
+		// 新增用户与角色管理
+		List<SysRoleMenu> list = new ArrayList<SysRoleMenu>();
+		for (Long menuId : role.getMenuIds()) {
+			SysRoleMenu rm = new SysRoleMenu();
+			rm.setRoleId(role.getRoleId());
+			rm.setMenuId(menuId);
+			list.add(rm);
+		}
+		if (list.size() > 0) {
+			rows = roleMenuMapper.batchRoleMenu(list);
+		}
+		return rows;
+	}
 
-    /**
-     * 新增角色部门信息(数据权限)
-     *
-     * @param role 角色对象
-     */
-    public int insertRoleDept(SysRole role)
-    {
-        int rows = 1;
-        // 新增角色与部门(数据权限)管理
-        List<SysRoleDept> list = new ArrayList<SysRoleDept>();
-        for (Long deptId : role.getDeptIds())
-        {
-            SysRoleDept rd = new SysRoleDept();
-            rd.setRoleId(role.getRoleId());
-            rd.setDeptId(deptId);
-            list.add(rd);
-        }
-        if (list.size() > 0)
-        {
-            rows = roleDeptMapper.batchRoleDept(list);
-        }
-        return rows;
-    }
+	/**
+	 * 新增角色部门信息(数据权限)
+	 *
+	 * @param role 角色对象
+	 */
+	public int insertRoleDept(SysRole role) {
+		int rows = 1;
+		// 新增角色与部门(数据权限)管理
+		List<SysRoleDept> list = new ArrayList<SysRoleDept>();
+		for (Long deptId : role.getDeptIds()) {
+			SysRoleDept rd = new SysRoleDept();
+			rd.setRoleId(role.getRoleId());
+			rd.setDeptId(deptId);
+			list.add(rd);
+		}
+		if (list.size() > 0) {
+			rows = roleDeptMapper.batchRoleDept(list);
+		}
+		return rows;
+	}
 
-    /**
-     * 通过角色ID删除角色
-     * 
-     * @param roleId 角色ID
-     * @return 结果
-     */
-    @Override
-    @Transactional
-    public int deleteRoleById(Long roleId)
-    {
-        // 删除角色与菜单关联
-        roleMenuMapper.deleteRoleMenuByRoleId(roleId);
-        // 删除角色与部门关联
-        roleDeptMapper.deleteRoleDeptByRoleId(roleId);
-        return roleMapper.deleteRoleById(roleId);
-    }
+	/**
+	 * 通过角色ID删除角色
+	 * 
+	 * @param roleId 角色ID
+	 * @return 结果
+	 */
+	@Override
+	@Transactional
+	public int deleteRoleById(Long roleId) {
+		// 删除角色与菜单关联
+		roleMenuMapper.deleteRoleMenuByRoleId(roleId);
+		// 删除角色与部门关联
+		roleDeptMapper.deleteRoleDeptByRoleId(roleId);
+		return roleMapper.deleteRoleById(roleId);
+	}
 
-    /**
-     * 批量删除角色信息
-     * 
-     * @param roleIds 需要删除的角色ID
-     * @return 结果
-     */
-    @Override
-    @Transactional
-    public int deleteRoleByIds(Long[] roleIds)
-    {
-        for (Long roleId : roleIds)
-        {
-            checkRoleAllowed(new SysRole(roleId));
-            checkRoleDataScope(roleId);
-            SysRole role = selectRoleById(roleId);
-            if (countUserRoleByRoleId(roleId) > 0)
-            {
-                throw new ServiceException(String.format("%1$s已分配,不能删除", role.getRoleName()));
-            }
-        }
-        // 删除角色与菜单关联
-        roleMenuMapper.deleteRoleMenu(roleIds);
-        // 删除角色与部门关联
-        roleDeptMapper.deleteRoleDept(roleIds);
-        return roleMapper.deleteRoleByIds(roleIds);
-    }
+	/**
+	 * 批量删除角色信息
+	 * 
+	 * @param roleIds 需要删除的角色ID
+	 * @return 结果
+	 */
+	@Override
+	@Transactional
+	public int deleteRoleByIds(Long[] roleIds) {
+		for (Long roleId : roleIds) {
+			checkRoleAllowed(new SysRole(roleId));
+			checkRoleDataScope(roleId);
+			SysRole role = selectRoleById(roleId);
+			if (countUserRoleByRoleId(roleId) > 0) {
+				throw new ServiceException(String.format("%1$s已分配,不能删除", role.getRoleName()));
+			}
+		}
+		// 删除角色与菜单关联
+		roleMenuMapper.deleteRoleMenu(roleIds);
+		// 删除角色与部门关联
+		roleDeptMapper.deleteRoleDept(roleIds);
+		return roleMapper.deleteRoleByIds(roleIds);
+	}
 
-    /**
-     * 取消授权用户角色
-     * 
-     * @param userRole 用户和角色关联信息
-     * @return 结果
-     */
-    @Override
-    public int deleteAuthUser(SysUserRole userRole)
-    {
-        return userRoleMapper.deleteUserRoleInfo(userRole);
-    }
+	/**
+	 * 取消授权用户角色
+	 * 
+	 * @param userRole 用户和角色关联信息
+	 * @return 结果
+	 */
+	@Override
+	public int deleteAuthUser(SysUserRole userRole) {
+		return userRoleMapper.deleteUserRoleInfo(userRole);
+	}
 
-    /**
-     * 批量取消授权用户角色
-     * 
-     * @param roleId 角色ID
-     * @param userIds 需要取消授权的用户数据ID
-     * @return 结果
-     */
-    @Override
-    public int deleteAuthUsers(Long roleId, Long[] userIds)
-    {
-        return userRoleMapper.deleteUserRoleInfos(roleId, userIds);
-    }
+	/**
+	 * 批量取消授权用户角色
+	 * 
+	 * @param roleId  角色ID
+	 * @param userIds 需要取消授权的用户数据ID
+	 * @return 结果
+	 */
+	@Override
+	public int deleteAuthUsers(Long roleId, Long[] userIds) {
+		return userRoleMapper.deleteUserRoleInfos(roleId, userIds);
+	}
 
-    /**
-     * 批量选择授权用户角色
-     * 
-     * @param roleId 角色ID
-     * @param userIds 需要授权的用户数据ID
-     * @return 结果
-     */
-    @Override
-    public int insertAuthUsers(Long roleId, Long[] userIds)
-    {
-        // 新增用户与角色管理
-        List<SysUserRole> list = new ArrayList<SysUserRole>();
-        for (Long userId : userIds)
-        {
-            SysUserRole ur = new SysUserRole();
-            ur.setUserId(userId);
-            ur.setRoleId(roleId);
-            list.add(ur);
-        }
-        return userRoleMapper.batchUserRole(list);
-    }
+	/**
+	 * 批量选择授权用户角色
+	 * 
+	 * @param roleId  角色ID
+	 * @param userIds 需要授权的用户数据ID
+	 * @return 结果
+	 */
+	@Override
+	public int insertAuthUsers(Long roleId, Long[] userIds) {
+		// 新增用户与角色管理
+		List<SysUserRole> list = new ArrayList<SysUserRole>();
+		for (Long userId : userIds) {
+			SysUserRole ur = new SysUserRole();
+			ur.setUserId(userId);
+			ur.setRoleId(roleId);
+			list.add(ur);
+		}
+		return userRoleMapper.batchUserRole(list);
+	}
 }

+ 0 - 12
healsphere-system/src/main/resources/mapper/system/SysRoleMapper.xml

@@ -7,7 +7,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 	<resultMap type="SysRole" id="SysRoleResult">
 		<id     property="roleId"             column="role_id"               />
 		<result property="roleName"           column="role_name"             />
-		<result property="roleKey"            column="role_key"              />
 		<result property="roleSort"           column="role_sort"             />
 		<result property="dataScope"          column="data_scope"            />
 		<result property="menuCheckStrictly"  column="menu_check_strictly"   />
@@ -42,9 +41,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 		<if test="status != null and status != ''">
 			AND r.status = #{status}
 		</if>
-		<if test="roleKey != null and roleKey != ''">
-			AND r.role_key like concat('%', #{roleKey}, '%')
-		</if>
 		<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
 			and date_format(r.create_time,'%Y%m%d') &gt;= date_format(#{params.beginTime},'%Y%m%d')
 		</if>
@@ -88,16 +84,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 		 where r.role_name=#{roleName} and r.del_flag = '0' limit 1
 	</select>
 	
-	<select id="checkRoleKeyUnique" parameterType="String" resultMap="SysRoleResult">
-		<include refid="selectRoleVo"/>
-		 where r.role_key=#{roleKey} and r.del_flag = '0' limit 1
-	</select>
-	
  	<insert id="insertRole" parameterType="SysRole" useGeneratedKeys="true" keyProperty="roleId">
  		insert into sys_role(
  			<if test="roleId != null and roleId != 0">role_id,</if>
  			<if test="roleName != null and roleName != ''">role_name,</if>
- 			<if test="roleKey != null and roleKey != ''">role_key,</if>
  			<if test="roleSort != null">role_sort,</if>
  			<if test="dataScope != null and dataScope != ''">data_scope,</if>
  			<if test="menuCheckStrictly != null">menu_check_strictly,</if>
@@ -109,7 +99,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  		)values(
  			<if test="roleId != null and roleId != 0">#{roleId},</if>
  			<if test="roleName != null and roleName != ''">#{roleName},</if>
- 			<if test="roleKey != null and roleKey != ''">#{roleKey},</if>
  			<if test="roleSort != null">#{roleSort},</if>
  			<if test="dataScope != null and dataScope != ''">#{dataScope},</if>
  			<if test="menuCheckStrictly != null">#{menuCheckStrictly},</if>
@@ -125,7 +114,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  		update sys_role
  		<set>
  			<if test="roleName != null and roleName != ''">role_name = #{roleName},</if>
- 			<if test="roleKey != null and roleKey != ''">role_key = #{roleKey},</if>
  			<if test="roleSort != null">role_sort = #{roleSort},</if>
  			<if test="dataScope != null and dataScope != ''">data_scope = #{dataScope},</if>
  			<if test="menuCheckStrictly != null">menu_check_strictly = #{menuCheckStrictly},</if>

+ 0 - 1
healsphere-system/src/main/resources/mapper/system/SysUserMapper.xml

@@ -37,7 +37,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <resultMap id="RoleResult" type="SysRole">
         <id     property="roleId"       column="role_id"        />
         <result property="roleName"     column="role_name"      />
-        <result property="roleKey"      column="role_key"       />
         <result property="roleSort"     column="role_sort"      />
         <result property="dataScope"    column="data_scope"     />
         <result property="status"       column="role_status"    />