Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
e05400dd05
@ -1,95 +0,0 @@
|
|||||||
package com.xdap.self_development.controller;
|
|
||||||
|
|
||||||
import com.definesys.mpaas.common.http.Response;
|
|
||||||
import com.definesys.mpaas.query.db.PageQueryResult;
|
|
||||||
import com.xdap.self_development.controller.form.InsertRoleForm;
|
|
||||||
import com.xdap.self_development.controller.form.UpdateRoleForm;
|
|
||||||
import com.xdap.self_development.controller.form.UserRoleAndPermissionPageForm;
|
|
||||||
import com.xdap.self_development.exception.CommonException;
|
|
||||||
import com.xdap.self_development.pojo.Permission;
|
|
||||||
import com.xdap.self_development.pojo.view.UserRoleAndPermissionView;
|
|
||||||
import com.xdap.self_development.service.PermissionService;
|
|
||||||
import org.springframework.validation.BindingResult;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
import javax.validation.Valid;
|
|
||||||
import javax.validation.constraints.NotBlank;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/custom/permission")
|
|
||||||
public class PermissionController {
|
|
||||||
@Resource
|
|
||||||
private PermissionService permissionService;
|
|
||||||
|
|
||||||
// 查询所有权限
|
|
||||||
@GetMapping("/getAllPermission")
|
|
||||||
public Response getAllPermission() {
|
|
||||||
List<Permission> list = permissionService.getAllPermission();
|
|
||||||
return Response.ok().data(list);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 查看全部角色的用户和权限
|
|
||||||
@GetMapping("/getUserRoleAndPermission")
|
|
||||||
public Response getUserRoleAndPermission(
|
|
||||||
@Valid UserRoleAndPermissionPageForm form,
|
|
||||||
BindingResult bindingResult
|
|
||||||
) {
|
|
||||||
if (bindingResult.hasErrors()) {
|
|
||||||
bindingResult.getFieldErrors().forEach(error -> {
|
|
||||||
throw new CommonException(error.getDefaultMessage());
|
|
||||||
});
|
|
||||||
}
|
|
||||||
PageQueryResult<UserRoleAndPermissionView> list = permissionService.getUserRoleAndPermission(form);
|
|
||||||
return Response.ok().data(list);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 新增角色
|
|
||||||
@PostMapping("/insertRole")
|
|
||||||
public Response insertRole(
|
|
||||||
@Valid @RequestBody InsertRoleForm form,
|
|
||||||
BindingResult bindingResult
|
|
||||||
) {
|
|
||||||
if (bindingResult.hasErrors()) {
|
|
||||||
bindingResult.getFieldErrors().forEach(error -> {
|
|
||||||
throw new CommonException(error.getDefaultMessage());
|
|
||||||
});
|
|
||||||
}
|
|
||||||
permissionService.insertRole(form);
|
|
||||||
return Response.ok().setMessage("新增角色成功");
|
|
||||||
}
|
|
||||||
|
|
||||||
// 修改角色
|
|
||||||
@PostMapping("updateRole")
|
|
||||||
public Response updateRole(
|
|
||||||
@Valid @RequestBody UpdateRoleForm form,
|
|
||||||
BindingResult bindingResult
|
|
||||||
) {
|
|
||||||
if (bindingResult.hasErrors()) {
|
|
||||||
bindingResult.getFieldErrors().forEach(error -> {
|
|
||||||
throw new CommonException(error.getDefaultMessage());
|
|
||||||
});
|
|
||||||
}
|
|
||||||
permissionService.updateRole(form);
|
|
||||||
return Response.ok().setMessage("修改角色成功");
|
|
||||||
}
|
|
||||||
|
|
||||||
// 删除角色
|
|
||||||
@GetMapping("/deleteRole")
|
|
||||||
public Response deleteRole(
|
|
||||||
@NotBlank String roleId
|
|
||||||
) {
|
|
||||||
permissionService.deleteRole(roleId);
|
|
||||||
return Response.ok().setMessage("删除角色成功");
|
|
||||||
}
|
|
||||||
|
|
||||||
// 根据用户查询权限
|
|
||||||
@GetMapping("/selectPermByUserId")
|
|
||||||
public Response selectPermByUserId(
|
|
||||||
@NotBlank String userId
|
|
||||||
) {
|
|
||||||
List<Permission> permissions = permissionService.selectPermissionByUser(userId);
|
|
||||||
return Response.ok().data(permissions);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -72,7 +72,7 @@ public class ParamApprovalRecordPojo implements Serializable {
|
|||||||
/**
|
/**
|
||||||
* 创建时间
|
* 创建时间
|
||||||
*/
|
*/
|
||||||
private Date createdDate;
|
private Date creationDate;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 最后更新人
|
* 最后更新人
|
||||||
@ -82,7 +82,7 @@ public class ParamApprovalRecordPojo implements Serializable {
|
|||||||
/**
|
/**
|
||||||
* 最后更新时间
|
* 最后更新时间
|
||||||
*/
|
*/
|
||||||
private Date lastUpdatedDate;
|
private Date lastUpdateDate;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,19 +0,0 @@
|
|||||||
package com.xdap.self_development.pojo;
|
|
||||||
|
|
||||||
import com.definesys.mpaas.query.annotation.RowID;
|
|
||||||
import com.definesys.mpaas.query.annotation.RowIDType;
|
|
||||||
import com.definesys.mpaas.query.annotation.Table;
|
|
||||||
import com.definesys.mpaas.query.model.MpaasBasePojo;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.EqualsAndHashCode;
|
|
||||||
|
|
||||||
@EqualsAndHashCode(callSuper = true)
|
|
||||||
@Data
|
|
||||||
@Table("yfsjglpt_model_permissions")
|
|
||||||
public class Permission extends MpaasBasePojo {
|
|
||||||
@RowID(value = "permissions_s", type = RowIDType.UUID)
|
|
||||||
private String id;
|
|
||||||
private String permissionName;
|
|
||||||
private String permPath;
|
|
||||||
private String perDescription;
|
|
||||||
}
|
|
||||||
@ -1,18 +0,0 @@
|
|||||||
package com.xdap.self_development.pojo;
|
|
||||||
|
|
||||||
import com.definesys.mpaas.query.annotation.RowID;
|
|
||||||
import com.definesys.mpaas.query.annotation.RowIDType;
|
|
||||||
import com.definesys.mpaas.query.annotation.Table;
|
|
||||||
import com.definesys.mpaas.query.model.MpaasBasePojo;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.EqualsAndHashCode;
|
|
||||||
|
|
||||||
@EqualsAndHashCode(callSuper = true)
|
|
||||||
@Data
|
|
||||||
@Table("yfsjglpt_model_roles")
|
|
||||||
public class Role extends MpaasBasePojo {
|
|
||||||
@RowID(value = "roles_s", type = RowIDType.UUID)
|
|
||||||
private String id;
|
|
||||||
private String roleName;
|
|
||||||
private String roleDescription;
|
|
||||||
}
|
|
||||||
@ -1,18 +0,0 @@
|
|||||||
package com.xdap.self_development.pojo;
|
|
||||||
|
|
||||||
import com.definesys.mpaas.query.annotation.RowID;
|
|
||||||
import com.definesys.mpaas.query.annotation.RowIDType;
|
|
||||||
import com.definesys.mpaas.query.annotation.Table;
|
|
||||||
import com.definesys.mpaas.query.model.MpaasBasePojo;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.EqualsAndHashCode;
|
|
||||||
|
|
||||||
@EqualsAndHashCode(callSuper = true)
|
|
||||||
@Data
|
|
||||||
@Table("yfsjglpt_model_role_permissions")
|
|
||||||
public class RoleAndPermissions extends MpaasBasePojo {
|
|
||||||
@RowID(value = "role_permissions_s", type = RowIDType.UUID)
|
|
||||||
private String id;
|
|
||||||
private String roleId;
|
|
||||||
private String permissionId;
|
|
||||||
}
|
|
||||||
@ -1,18 +0,0 @@
|
|||||||
package com.xdap.self_development.pojo;
|
|
||||||
|
|
||||||
import com.definesys.mpaas.query.annotation.RowID;
|
|
||||||
import com.definesys.mpaas.query.annotation.RowIDType;
|
|
||||||
import com.definesys.mpaas.query.annotation.Table;
|
|
||||||
import com.definesys.mpaas.query.model.MpaasBasePojo;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.EqualsAndHashCode;
|
|
||||||
|
|
||||||
@EqualsAndHashCode(callSuper = true)
|
|
||||||
@Data
|
|
||||||
@Table("yfsjglpt_model_user_roles")
|
|
||||||
public class UserAndRoles extends MpaasBasePojo {
|
|
||||||
@RowID(value = "user_roles_s", type = RowIDType.UUID)
|
|
||||||
private String id;
|
|
||||||
private String roleId;
|
|
||||||
private String userId;
|
|
||||||
}
|
|
||||||
@ -1,26 +0,0 @@
|
|||||||
package com.xdap.self_development.service;
|
|
||||||
|
|
||||||
import com.definesys.mpaas.query.db.PageQueryResult;
|
|
||||||
import com.xdap.self_development.controller.form.InsertRoleForm;
|
|
||||||
import com.xdap.self_development.controller.form.UpdateRoleForm;
|
|
||||||
import com.xdap.self_development.controller.form.UserRoleAndPermissionPageForm;
|
|
||||||
import com.xdap.self_development.pojo.Permission;
|
|
||||||
import com.xdap.self_development.pojo.view.UserRoleAndPermissionView;
|
|
||||||
|
|
||||||
import javax.validation.Valid;
|
|
||||||
import javax.validation.constraints.NotBlank;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public interface PermissionService {
|
|
||||||
PageQueryResult<UserRoleAndPermissionView> getUserRoleAndPermission(@Valid UserRoleAndPermissionPageForm form);
|
|
||||||
|
|
||||||
void insertRole(@Valid InsertRoleForm form);
|
|
||||||
|
|
||||||
List<Permission> getAllPermission();
|
|
||||||
|
|
||||||
void updateRole(@Valid UpdateRoleForm form);
|
|
||||||
|
|
||||||
void deleteRole(@NotBlank String roleId);
|
|
||||||
|
|
||||||
List<Permission> selectPermissionByUser(String userId);
|
|
||||||
}
|
|
||||||
@ -215,7 +215,7 @@ public class ActivitiProcessServiceImpl implements ActivitiProcessService {
|
|||||||
record.setNodeName("提交");
|
record.setNodeName("提交");
|
||||||
record.setNodeOrder(0);
|
record.setNodeOrder(0);
|
||||||
record.setOperateTime(new Date());
|
record.setOperateTime(new Date());
|
||||||
record.setCreatedDate(new Date());
|
record.setCreationDate(new Date());
|
||||||
record.setApprovalComment("提交流程");
|
record.setApprovalComment("提交流程");
|
||||||
sw.buildFromDatasource("xdap_app_223770822127386625").doInsert(record);
|
sw.buildFromDatasource("xdap_app_223770822127386625").doInsert(record);
|
||||||
|
|
||||||
@ -270,7 +270,7 @@ public class ActivitiProcessServiceImpl implements ActivitiProcessService {
|
|||||||
record.setNodeName(reviewListPojo.getNodeName());
|
record.setNodeName(reviewListPojo.getNodeName());
|
||||||
record.setNodeOrder(nodeOrder);
|
record.setNodeOrder(nodeOrder);
|
||||||
record.setOperateTime(new Date());
|
record.setOperateTime(new Date());
|
||||||
record.setCreatedDate(new Date());
|
record.setCreationDate(new Date());
|
||||||
record.setApprovalComment(comment);
|
record.setApprovalComment(comment);
|
||||||
sw.buildFromDatasource("xdap_app_223770822127386625").doInsert(record);
|
sw.buildFromDatasource("xdap_app_223770822127386625").doInsert(record);
|
||||||
|
|
||||||
@ -290,7 +290,7 @@ public class ActivitiProcessServiceImpl implements ActivitiProcessService {
|
|||||||
//审批流改为已拒绝
|
//审批流改为已拒绝
|
||||||
sw.buildFromDatasource("xdap_app_223770822127386625")
|
sw.buildFromDatasource("xdap_app_223770822127386625")
|
||||||
.update("status_code", ParamValueVersionEnum.REFUSE.getCode())
|
.update("status_code", ParamValueVersionEnum.REFUSE.getCode())
|
||||||
.update("status_desc", ParamValueVersionEnum.REFUSE.getDesc())
|
.update("status_description", ParamValueVersionEnum.REFUSE.getDesc())
|
||||||
.update("approver_persons", "")
|
.update("approver_persons", "")
|
||||||
.update("last_update_date", new Date())
|
.update("last_update_date", new Date())
|
||||||
.eq("id", approvalId).doUpdate(EngineReviewListPojo.class);
|
.eq("id", approvalId).doUpdate(EngineReviewListPojo.class);
|
||||||
@ -398,7 +398,7 @@ public class ActivitiProcessServiceImpl implements ActivitiProcessService {
|
|||||||
//审批流改为已通过
|
//审批流改为已通过
|
||||||
sw.buildFromDatasource("xdap_app_223770822127386625")
|
sw.buildFromDatasource("xdap_app_223770822127386625")
|
||||||
.update("status_code", ParamValueVersionEnum.PASSED.getCode())
|
.update("status_code", ParamValueVersionEnum.PASSED.getCode())
|
||||||
.update("status_desc", ParamValueVersionEnum.PASSED.getDesc())
|
.update("status_description", ParamValueVersionEnum.PASSED.getDesc())
|
||||||
.update("approver_persons", "")
|
.update("approver_persons", "")
|
||||||
.update("last_update_date", new Date())
|
.update("last_update_date", new Date())
|
||||||
.eq("id", approvalId).doUpdate(EngineReviewListPojo.class);
|
.eq("id", approvalId).doUpdate(EngineReviewListPojo.class);
|
||||||
|
|||||||
@ -1,173 +0,0 @@
|
|||||||
package com.xdap.self_development.service.impl;
|
|
||||||
|
|
||||||
import com.definesys.mpaas.query.db.PageQueryResult;
|
|
||||||
import com.xdap.self_development.config.BusinessDatabase;
|
|
||||||
import com.xdap.self_development.controller.form.InsertRoleForm;
|
|
||||||
import com.xdap.self_development.controller.form.UpdateRoleForm;
|
|
||||||
import com.xdap.self_development.controller.form.UserRoleAndPermissionPageForm;
|
|
||||||
import com.xdap.self_development.exception.CommonException;
|
|
||||||
import com.xdap.self_development.pojo.Permission;
|
|
||||||
import com.xdap.self_development.pojo.Role;
|
|
||||||
import com.xdap.self_development.pojo.RoleAndPermissions;
|
|
||||||
import com.xdap.self_development.pojo.UserAndRoles;
|
|
||||||
import com.xdap.self_development.pojo.view.UserRoleAndPermissionView;
|
|
||||||
import com.xdap.self_development.service.PermissionService;
|
|
||||||
import org.apache.commons.lang3.ObjectUtils;
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.stream.Collectors;
|
|
||||||
|
|
||||||
@Service
|
|
||||||
public class PermissionServiceImpl implements PermissionService {
|
|
||||||
@Resource
|
|
||||||
private BusinessDatabase bd;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public PageQueryResult<UserRoleAndPermissionView> getUserRoleAndPermission(UserRoleAndPermissionPageForm form) {
|
|
||||||
|
|
||||||
return bd.getBusinessDatabase()
|
|
||||||
.viewQueryMode(true)
|
|
||||||
.view("getAllRoleUserAndPerm")
|
|
||||||
.doPageQuery(form.getPageNumber(), form.getPageSize(), UserRoleAndPermissionView.class);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
@Transactional(rollbackFor = CommonException.class)
|
|
||||||
public void insertRole(InsertRoleForm form) {
|
|
||||||
// 查询角色是否重复
|
|
||||||
List<Role> roles = bd.getBusinessDatabase()
|
|
||||||
.eq("role_name", form.getRoleName())
|
|
||||||
.doQuery(Role.class);
|
|
||||||
if (!roles.isEmpty()) {
|
|
||||||
throw new CommonException("该角色已创建");
|
|
||||||
}
|
|
||||||
|
|
||||||
// 新增角色
|
|
||||||
Role role = new Role();
|
|
||||||
role.setRoleName(form.getRoleName());
|
|
||||||
role.setRoleDescription("无");
|
|
||||||
bd.getBusinessDatabase().doInsert(role);
|
|
||||||
|
|
||||||
// 新增角色和用户、角色和权限的关联
|
|
||||||
List<UserAndRoles> userAndRoles = new ArrayList<>();
|
|
||||||
for (String userId : form.getUsers()) {
|
|
||||||
UserAndRoles userAndRole = new UserAndRoles();
|
|
||||||
userAndRole.setUserId(userId);
|
|
||||||
userAndRole.setRoleId(role.getId());
|
|
||||||
userAndRoles.add(userAndRole);
|
|
||||||
}
|
|
||||||
List<RoleAndPermissions> roleAndPermissions = new ArrayList<>();
|
|
||||||
for (String permissionId : form.getPermissions()) {
|
|
||||||
RoleAndPermissions roleAndPermission = new RoleAndPermissions();
|
|
||||||
roleAndPermission.setRoleId(role.getId());
|
|
||||||
roleAndPermission.setPermissionId(permissionId);
|
|
||||||
roleAndPermissions.add(roleAndPermission);
|
|
||||||
}
|
|
||||||
bd.getBusinessDatabase().doBatchInsert(userAndRoles);
|
|
||||||
bd.getBusinessDatabase().doBatchInsert(roleAndPermissions);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<Permission> getAllPermission() {
|
|
||||||
return bd.getBusinessDatabase().doQuery(Permission.class);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
@Transactional(rollbackFor = CommonException.class)
|
|
||||||
public void updateRole(UpdateRoleForm form) {
|
|
||||||
Role role = bd.getBusinessDatabase()
|
|
||||||
.eq("id", form.getRoleId())
|
|
||||||
.doQueryFirst(Role.class);
|
|
||||||
|
|
||||||
// 先更新角色名
|
|
||||||
if (form.getRoleName() != null && !form.getRoleName().isEmpty()) {
|
|
||||||
bd.getBusinessDatabase()
|
|
||||||
.rowid("id", role.getRowId())
|
|
||||||
.update("role_name", form.getRoleName())
|
|
||||||
.doUpdate(Role.class);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 先清空所有关联关系
|
|
||||||
List<String> userAndRoleIds = bd.getBusinessDatabase()
|
|
||||||
.eq("role_id", role.getId())
|
|
||||||
.doQuery(UserAndRoles.class).stream().map(UserAndRoles::getId).collect(Collectors.toList());
|
|
||||||
List<String> roleAndPermissionIds = bd.getBusinessDatabase()
|
|
||||||
.eq("role_id", role.getId())
|
|
||||||
.doQuery(RoleAndPermissions.class).stream().map(RoleAndPermissions::getId).collect(Collectors.toList());
|
|
||||||
bd.getBusinessDatabase().in("id", userAndRoleIds).doDelete(UserAndRoles.class);
|
|
||||||
bd.getBusinessDatabase().in("id", roleAndPermissionIds).doDelete(RoleAndPermissions.class);
|
|
||||||
|
|
||||||
// 添加新的关联关系
|
|
||||||
List<UserAndRoles> userAndRoles = new ArrayList<>();
|
|
||||||
List<RoleAndPermissions> roleAndPermissions = new ArrayList<>();
|
|
||||||
if (!form.getUsers().isEmpty()) {
|
|
||||||
for (String userId : form.getUsers()) {
|
|
||||||
UserAndRoles userAndRole = new UserAndRoles();
|
|
||||||
userAndRole.setUserId(userId);
|
|
||||||
userAndRole.setRoleId(role.getId());
|
|
||||||
userAndRoles.add(userAndRole);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!form.getPermissions().isEmpty()) {
|
|
||||||
for (String permissionId : form.getPermissions()) {
|
|
||||||
RoleAndPermissions roleAndPermission = new RoleAndPermissions();
|
|
||||||
roleAndPermission.setRoleId(role.getId());
|
|
||||||
roleAndPermission.setPermissionId(permissionId);
|
|
||||||
roleAndPermissions.add(roleAndPermission);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
bd.getBusinessDatabase().doBatchInsert(userAndRoles);
|
|
||||||
bd.getBusinessDatabase().doBatchInsert(roleAndPermissions);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
@Transactional(rollbackFor = CommonException.class)
|
|
||||||
public void deleteRole(String roleId) {
|
|
||||||
// 先清空所有关联关系
|
|
||||||
List<String> userAndRoleIds = bd.getBusinessDatabase()
|
|
||||||
.eq("role_id", roleId)
|
|
||||||
.doQuery(UserAndRoles.class).stream().map(UserAndRoles::getId).collect(Collectors.toList());
|
|
||||||
List<String> roleAndPermissionIds = bd.getBusinessDatabase()
|
|
||||||
.eq("role_id", roleId)
|
|
||||||
.doQuery(RoleAndPermissions.class).stream().map(RoleAndPermissions::getId).collect(Collectors.toList());
|
|
||||||
bd.getBusinessDatabase().in("id", userAndRoleIds).doDelete(UserAndRoles.class);
|
|
||||||
bd.getBusinessDatabase().in("id", roleAndPermissionIds).doDelete(RoleAndPermissions.class);
|
|
||||||
|
|
||||||
// 删除角色
|
|
||||||
bd.getBusinessDatabase().eq("id", roleId).doDelete(Role.class);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<Permission> selectPermissionByUser(String userId) {
|
|
||||||
if (StringUtils.isEmpty(userId)) {
|
|
||||||
throw new RuntimeException("请传入用户");
|
|
||||||
}
|
|
||||||
//查询用户所拥有的角色
|
|
||||||
List<UserAndRoles> userAndRoleIds = bd.getBusinessDatabase()
|
|
||||||
.eq("user_id", userId)
|
|
||||||
.doQuery(UserAndRoles.class);
|
|
||||||
if (ObjectUtils.isNotEmpty(userAndRoleIds)) {
|
|
||||||
List<String> roleIds = userAndRoleIds.stream().map(x -> x.getRoleId()).collect(Collectors.toList());
|
|
||||||
//查询角色权限
|
|
||||||
List<RoleAndPermissions> roleAndPermissions = bd.getBusinessDatabase()
|
|
||||||
.in("role_id", roleIds)
|
|
||||||
.doQuery(RoleAndPermissions.class);
|
|
||||||
if (ObjectUtils.isEmpty(roleAndPermissions)) {
|
|
||||||
throw new RuntimeException("该角色没有分配权限");
|
|
||||||
}
|
|
||||||
List<String> permissionIds = roleAndPermissions.stream().map(x -> x.getPermissionId()).collect(Collectors.toList());
|
|
||||||
//组装返回
|
|
||||||
return bd.getBusinessDatabase()
|
|
||||||
.in("id", permissionIds)
|
|
||||||
.doQuery(Permission.class);
|
|
||||||
}
|
|
||||||
return Collections.emptyList();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -7,3 +7,72 @@ CREATE TABLE `analysis_common_parameters` (
|
|||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='查询分析常用参数表';
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='查询分析常用参数表';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
--删除1版权限
|
||||||
|
drop table yfsjglpt_model_role_permissions
|
||||||
|
drop table yfsjglpt_model_roles
|
||||||
|
drop table yfsjglpt_model_user_roles
|
||||||
|
drop table yfsjglpt_model_permissions
|
||||||
|
|
||||||
|
--角色表
|
||||||
|
DROP TABLE IF EXISTS yfsjglpt_model_roles;
|
||||||
|
CREATE TABLE yfsjglpt_model_roles(
|
||||||
|
`id` VARCHAR(64) NOT NULL COMMENT 'ID',
|
||||||
|
`role_name` VARCHAR(128) NOT NULL COMMENT '角色名称',
|
||||||
|
`role_code` VARCHAR(128) COMMENT '角色代号',
|
||||||
|
`role_description` VARCHAR(128) COMMENT '角色描述',
|
||||||
|
`is_enabled` INT(128) DEFAULT 1 COMMENT '是否启用',
|
||||||
|
`created_by` VARCHAR(64) COMMENT '创建人',
|
||||||
|
`creation_date` DATETIME COMMENT '创建时间',
|
||||||
|
`last_updated_by` VARCHAR(64) COMMENT '最后更新人',
|
||||||
|
`last_update_date` DATETIME COMMENT '最后更新时间',
|
||||||
|
PRIMARY KEY (`id`)
|
||||||
|
) COMMENT '角色表';
|
||||||
|
|
||||||
|
---菜单权限
|
||||||
|
|
||||||
|
DROP TABLE IF EXISTS yfsjglpt_model_menu_permission;
|
||||||
|
CREATE TABLE yfsjglpt_model_menu_permission(
|
||||||
|
`id` VARCHAR(64) NOT NULL COMMENT 'ID',
|
||||||
|
`parent_id` VARCHAR(64) COMMENT '上级ID',
|
||||||
|
`menu_name` VARCHAR(64) COMMENT '菜单名称',
|
||||||
|
`menu_code` VARCHAR(64) COMMENT '菜单代码',
|
||||||
|
`menu_desc` VARCHAR(128) COMMENT '菜单描述',
|
||||||
|
`is_enable` INT DEFAULT 1 COMMENT '是否可用',
|
||||||
|
`created_by` VARCHAR(64) COMMENT '创建人',
|
||||||
|
`creation_date` DATETIME COMMENT '创建时间',
|
||||||
|
`last_updated_by` VARCHAR(64) COMMENT '最后更新人',
|
||||||
|
`last_update_date` DATETIME COMMENT '最后更新时间',
|
||||||
|
PRIMARY KEY (`id`)
|
||||||
|
) COMMENT '菜单权限';
|
||||||
|
|
||||||
|
|
||||||
|
--菜单参数关联表
|
||||||
|
DROP TABLE IF EXISTS yfsjglpt_model_menu_parameter;
|
||||||
|
CREATE TABLE yfsjglpt_model_menu_parameter(
|
||||||
|
`id` VARCHAR(64) NOT NULL COMMENT 'ID',
|
||||||
|
`menu_id` VARCHAR(128) COMMENT '菜单ID',
|
||||||
|
`subsystem` VARCHAR(64) COMMENT '子系统',
|
||||||
|
`parameter_id` VARCHAR(64) COMMENT '参数ID',
|
||||||
|
`parameter_per` INT COMMENT '参数权限;1:查看;2:编辑',
|
||||||
|
`created_by` VARCHAR(64) COMMENT '创建人',
|
||||||
|
`creation_date` DATETIME COMMENT '创建时间',
|
||||||
|
`last_updated_by` VARCHAR(64) COMMENT '最后更新人',
|
||||||
|
`last_update_date` DATETIME COMMENT '最后更新时间',
|
||||||
|
PRIMARY KEY (`id`)
|
||||||
|
) COMMENT '菜单参数关联表';
|
||||||
|
|
||||||
|
--部门或用户关联角色表
|
||||||
|
DROP TABLE IF EXISTS yfsjglpt_model_dep_user_role;
|
||||||
|
CREATE TABLE yfsjglpt_model_dep_user_role(
|
||||||
|
`id` VARCHAR(64) NOT NULL COMMENT 'ID',
|
||||||
|
`user_or_dep` VARCHAR(64) COMMENT '用户或部门ID',
|
||||||
|
`role_id` VARCHAR(64) COMMENT '角色ID',
|
||||||
|
`is_dep` INT COMMENT '是否是部门;0:个人;1:部门',
|
||||||
|
`created_by` VARCHAR(64) COMMENT '创建人',
|
||||||
|
`creation_date` DATETIME COMMENT '创建时间',
|
||||||
|
`last_updated_by` VARCHAR(64) COMMENT '最后更新人',
|
||||||
|
`last_update_date` DATETIME COMMENT '最后更新时间',
|
||||||
|
PRIMARY KEY (`id`)
|
||||||
|
) COMMENT '部门或用户关联角色表';
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user