mirror of
http://192.168.1.205:9980/cf_devdept2/cf_imes_server.git
synced 2026-08-13 05:12:07 +08:00
系统接口权限整理,修改
This commit is contained in:
+2
-6
@@ -34,7 +34,6 @@ public class DeptController {
|
||||
|
||||
@PostMapping("create")
|
||||
@Operation(summary = "创建部门")
|
||||
// @PreAuthorize("@ss.hasPermission('system:dept:create')")
|
||||
@PreAuthorize("@ss.hasAnyPermissions('system:dept:create','base:dept:create')")
|
||||
public CommonResult<Long> createDept(@Valid @RequestBody DeptSaveReqVO createReqVO) {
|
||||
Long deptId = deptService.createDept(createReqVO);
|
||||
@@ -43,7 +42,6 @@ public class DeptController {
|
||||
|
||||
@PutMapping("update")
|
||||
@Operation(summary = "更新部门")
|
||||
// @PreAuthorize("@ss.hasPermission('system:dept:update')")
|
||||
@PreAuthorize("@ss.hasAnyPermissions('system:dept:update','base:dept:update')")
|
||||
public CommonResult<Boolean> updateDept(@Valid @RequestBody DeptSaveReqVO updateReqVO) {
|
||||
deptService.updateDept(updateReqVO);
|
||||
@@ -53,7 +51,6 @@ public class DeptController {
|
||||
@DeleteMapping("delete")
|
||||
@Operation(summary = "删除部门")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
// @PreAuthorize("@ss.hasPermission('system:dept:delete')")
|
||||
@PreAuthorize("@ss.hasAnyPermissions('system:dept:delete','base:dept:delete')")
|
||||
public CommonResult<Boolean> deleteDept(@RequestParam("id") Long id) {
|
||||
deptService.deleteDept(id);
|
||||
@@ -62,7 +59,7 @@ public class DeptController {
|
||||
|
||||
@GetMapping("/list")
|
||||
@Operation(summary = "获取部门列表")
|
||||
//@PreAuthorize("@ss.hasPermission('system:dept:query')")
|
||||
@PreAuthorize("@ss.hasAnyPermissions('system:dept:query','base:dept:query','base:user:query','base:user:update','base:permission:assign-user-role')")
|
||||
public CommonResult<List<DeptRespVO>> getDeptList(@Valid DeptListReqVO reqVO) {
|
||||
List<DeptDO> list = deptService.getDeptList(reqVO);
|
||||
return success(BeanUtils.toBean(list, DeptRespVO.class));
|
||||
@@ -83,8 +80,7 @@ public class DeptController {
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得部门信息")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
// @PreAuthorize("@ss.hasPermission('system:dept:query')")
|
||||
@PreAuthorize("@ss.hasAnyPermissions('system:dept:query','base:dept:query')")
|
||||
// @PreAuthorize("@ss.hasAnyPermissions('system:dept:query','base:dept:query')")
|
||||
public CommonResult<DeptRespVO> getDept(@RequestParam("id") Long id) {
|
||||
DeptDO dept = deptService.getDept(id);
|
||||
return success(BeanUtils.toBean(dept, DeptRespVO.class));
|
||||
|
||||
+1
-1
@@ -68,7 +68,7 @@ public class PostController {
|
||||
@GetMapping(value = "/get")
|
||||
@Operation(summary = "获得岗位信息")
|
||||
@Parameter(name = "id", description = "岗位编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('system:post:query')")
|
||||
// @PreAuthorize("@ss.hasPermission('system:post:query')")
|
||||
public CommonResult<PostRespVO> getPost(@RequestParam("id") Long id) {
|
||||
PostDO post = postService.getPost(id);
|
||||
return success(BeanUtils.toBean(post, PostRespVO.class));
|
||||
|
||||
+1
-1
@@ -83,7 +83,7 @@ public class DictDataController {
|
||||
@GetMapping(value = "/get")
|
||||
@Operation(summary = "/查询字典数据详细")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('dict:query')")
|
||||
// @PreAuthorize("@ss.hasPermission('dict:query')")
|
||||
public CommonResult<DictDataRespVO> getDictData(@RequestParam("id") Long id) {
|
||||
DictDataDO dictData = dictDataService.getDictData(id);
|
||||
return success(BeanUtils.toBean(dictData, DictDataRespVO.class));
|
||||
|
||||
+1
-1
@@ -73,7 +73,7 @@ public class DictTypeController {
|
||||
@Operation(summary = "/查询字典类型详细")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@GetMapping(value = "/get")
|
||||
@PreAuthorize("@ss.hasPermission('dict:query')")
|
||||
// @PreAuthorize("@ss.hasPermission('dict:query')")
|
||||
public CommonResult<DictTypeRespVO> getDictType(@RequestParam("id") Long id) {
|
||||
DictTypeDO dictType = dictTypeService.getDictType(id);
|
||||
return success(BeanUtils.toBean(dictType, DictTypeRespVO.class));
|
||||
|
||||
+2
-2
@@ -42,7 +42,7 @@ public class LabelController {
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建标签")
|
||||
@PreAuthorize("@ss.hasPermission('sysTagDesignManager:create')")
|
||||
@PreAuthorize("@ss.hasAnyPermissions('sysTagDesignManager:create','sysTagDesignManager:copy')")
|
||||
@OperateLog(enable = false)
|
||||
public CommonResult<Long> createLabel(@Valid @RequestBody LabelSaveReqVO createReqVO) {
|
||||
return success(labelService.createLabel(createReqVO));
|
||||
@@ -50,7 +50,7 @@ public class LabelController {
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新标签")
|
||||
@PreAuthorize("@ss.hasPermission('sysTagDesignManager:update')")
|
||||
@PreAuthorize("@ss.hasAnyPermissions('sysTagDesignManager:update','sysTagDesignManager:save')")
|
||||
@OperateLog(enable = false)
|
||||
public CommonResult<Boolean> updateLabel(@Valid @RequestBody LabelSaveReqVO updateReqVO) {
|
||||
labelService.updateLabel(updateReqVO);
|
||||
|
||||
+16
-13
@@ -1,21 +1,24 @@
|
||||
package com.cf.imes.module.system.controller.admin.labeltemplate;
|
||||
|
||||
import com.cf.imes.module.system.validation.label.LabelTemplateTypeValid;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import java.util.*;
|
||||
|
||||
import com.cf.imes.framework.common.pojo.CommonResult;
|
||||
import static com.cf.imes.framework.common.pojo.CommonResult.success;
|
||||
import com.cf.imes.framework.operatelog.core.annotations.OperateLog;
|
||||
import com.cf.imes.module.system.controller.admin.labeltemplate.vo.*;
|
||||
import com.cf.imes.module.system.controller.admin.labeltemplate.vo.LabelTemplateRespVO;
|
||||
import com.cf.imes.module.system.controller.admin.labeltemplate.vo.LabelTemplateSaveReqVO;
|
||||
import com.cf.imes.module.system.service.labeltemplate.LabelTemplateService;
|
||||
import com.cf.imes.module.system.validation.label.LabelTemplateTypeValid;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import static com.cf.imes.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@Tag(name = "标签模板管理")
|
||||
@RestController
|
||||
@@ -28,7 +31,7 @@ public class LabelTemplateController {
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建标签模板")
|
||||
@PreAuthorize("@ss.hasPermission('system:label-template:create')")
|
||||
@PreAuthorize("@ss.hasAnyPermissions('system:label-template:create','system:label-template:copy')")
|
||||
@OperateLog(enable = false)
|
||||
public CommonResult<Long> createLabelTemplate(@Valid @RequestBody LabelTemplateSaveReqVO createReqVO) {
|
||||
return success(labelTemplateService.createLabelTemplate(createReqVO));
|
||||
@@ -36,7 +39,7 @@ public class LabelTemplateController {
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新标签模板")
|
||||
@PreAuthorize("@ss.hasPermission('system:label-template:update')")
|
||||
@PreAuthorize("@ss.hasAnyPermissions('system:label-template:update','system:label-template:save')")
|
||||
@OperateLog(enable = false)
|
||||
public CommonResult<Boolean> updateLabelTemplate(@Valid @RequestBody LabelTemplateSaveReqVO updateReqVO) {
|
||||
labelTemplateService.updateLabelTemplate(updateReqVO);
|
||||
|
||||
+3
-3
@@ -34,7 +34,7 @@ public class MachineAuthController {
|
||||
@PutMapping("insert-organ-auth")
|
||||
@OperateLog(type = CREATE)
|
||||
@Operation(summary = "组织机台授权信息新增")
|
||||
@PreAuthorize("@ss.hasPermission('machine-auth::update')")
|
||||
@PreAuthorize("@ss.hasPermission('machine-auth::create')")
|
||||
public CommonResult<Boolean> authInsert(@RequestBody MachineOrgAuthReq vo) {
|
||||
return success(machineService.authInsert(vo));
|
||||
}
|
||||
@@ -57,7 +57,7 @@ public class MachineAuthController {
|
||||
|
||||
@GetMapping("organ-by-organId")
|
||||
@Operation(summary = "根据组织ID查询已经授权的机台ID")
|
||||
@PreAuthorize("@ss.hasPermission('machine-auth::query')")
|
||||
// @PreAuthorize("@ss.hasPermission('machine-auth::query')")
|
||||
@Parameter(name = "organId", description = "组织id", required = true, example = "1")
|
||||
public CommonResult<List<Integer>> organTemplateByOrganId(@RequestParam Long organId ) {
|
||||
return success(machineService.organMachineByOrganId(organId));
|
||||
@@ -65,7 +65,7 @@ public class MachineAuthController {
|
||||
|
||||
@GetMapping("select-machine-auth")
|
||||
@Operation(summary = "查询机台授权列表")
|
||||
@PreAuthorize("@ss.hasPermission('machine-auth::query')")
|
||||
// @PreAuthorize("@ss.hasPermission('machine-auth::query')")
|
||||
public CommonResult<Map<Integer, List<MachineBrandModelRespVO>>> getTemplateAuth(MachinePageReqVO pageParam) {
|
||||
|
||||
return success(machineService.getTemplateAuth(pageParam));
|
||||
|
||||
+5
-5
@@ -39,7 +39,7 @@ public class MachineController {
|
||||
|
||||
@PutMapping("/create-cutting")
|
||||
@Operation(summary = "创建机台")
|
||||
// @PreAuthorize("@ss.hasAnyPermissions('system:machine:create','system:machine:duplet')")
|
||||
@PreAuthorize("@ss.hasAnyPermissions('system:machine:create','system:machine:duplet')")
|
||||
@OperateLog(logArgs = false,type = CREATE )
|
||||
public CommonResult<Long> createCutting(@Validated(CreateGroup.class) @RequestBody CuttingSaveReqVO createReqVO) throws JsonProcessingException {
|
||||
return success(machineService.createCutting(createReqVO));
|
||||
@@ -47,7 +47,7 @@ public class MachineController {
|
||||
|
||||
@PostMapping("/update-cutting")
|
||||
@Operation(summary = "更新机台")
|
||||
// @PreAuthorize("@ss.hasAnyPermissions('system:machine:update','system:machine:submit')")
|
||||
@PreAuthorize("@ss.hasAnyPermissions('system:machine:update','system:machine:submit')")
|
||||
@OperateLog(logArgs = false,type = UPDATE)
|
||||
public CommonResult<Boolean> update(@Validated(UpdateGroup.class) @RequestBody CuttingSaveReqVO updateReqVO) {
|
||||
machineService.updateCutting(updateReqVO);
|
||||
@@ -57,7 +57,7 @@ public class MachineController {
|
||||
@DeleteMapping("/delete-cutting")
|
||||
@Operation(summary = "删除机台")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
//@PreAuthorize("@ss.hasPermission('machine::delete')")
|
||||
@PreAuthorize("@ss.hasPermission('system:machine:delete')")
|
||||
public CommonResult<Boolean> delete(@RequestParam("id") Long id) {
|
||||
machineService.deleteCutting(id);
|
||||
return success(true);
|
||||
@@ -66,7 +66,7 @@ public class MachineController {
|
||||
@DeleteMapping("/batch-delete-cutting")
|
||||
@Operation(summary = "批量删除机台")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
//@PreAuthorize("@ss.hasPermission('machine::delete')")
|
||||
@PreAuthorize("@ss.hasPermission('system:machine:delete')")
|
||||
public CommonResult<Boolean> batchDeleteCutting(@RequestParam("ids") List<Long> ids) {
|
||||
machineService.batchDeleteCutting(ids);
|
||||
return success(true);
|
||||
@@ -94,7 +94,7 @@ public class MachineController {
|
||||
|
||||
@GetMapping("getMachineTree")
|
||||
@Operation(summary = "获得机台树")
|
||||
//@PreAuthorize("@ss.hasPermission('machine::query')")
|
||||
@PreAuthorize("@ss.hasPermission('system:machine:query')")
|
||||
public CommonResult<Map<Integer, List<MachineVO>>> getMachineTree(@RequestParam(required = false) Long type) {
|
||||
return success(machineService.getMachineTree(type));
|
||||
}
|
||||
|
||||
+1
-1
@@ -67,7 +67,7 @@ public class MachineTemplateController {
|
||||
|
||||
@GetMapping("get-template-machine")
|
||||
@Operation(summary = "获取机台模板配置")
|
||||
@PreAuthorize("@ss.hasPermission('machine-template::query')")
|
||||
// @PreAuthorize("@ss.hasPermission('machine-template::query')")
|
||||
public CommonResult<CuttingTemplateRespVO> getCuttingTemplateById(@RequestParam("id") String id) {
|
||||
return success(machineTemplateService.getCuttingTemplateById(id));
|
||||
}
|
||||
|
||||
+1
-1
@@ -62,7 +62,7 @@ public class NotifyTemplateController {
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得站内信模版")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('system:notify-template:query')")
|
||||
// @PreAuthorize("@ss.hasPermission('system:notify-template:query')")
|
||||
public CommonResult<NotifyTemplateRespVO> getNotifyTemplate(@RequestParam("id") Long id) {
|
||||
NotifyTemplateDO template = notifyTemplateService.getNotifyTemplate(id);
|
||||
return success(BeanUtils.toBean(template, NotifyTemplateRespVO.class));
|
||||
|
||||
+3
-3
@@ -94,7 +94,7 @@ public class OrganController {
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得组织")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('organizationLIst:query')")
|
||||
// @PreAuthorize("@ss.hasPermission('organizationLIst:query')")
|
||||
public CommonResult<OrganRespVO> getOrgan(@RequestParam("id") Long id) {
|
||||
OrganizationDO organ = organService.getOrgan(id);
|
||||
if (ObjectUtil.isNull(organ)) {
|
||||
@@ -112,7 +112,7 @@ public class OrganController {
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得组织分页")
|
||||
@PreAuthorize("@ss.hasPermission('organizationLIst:query')")
|
||||
@PreAuthorize("@ss.hasAnyPermissions('organizationLIst:query','machine-auth::create')")
|
||||
public CommonResult<PageResult<OrganRespVO>> getOrganPage(@Valid OrganPageReqVO pageVO) {
|
||||
PageResult<OrganizationDO> pageResult = organService.getOrganPage(pageVO);
|
||||
if(CollUtil.isEmpty(pageResult.getList())) {
|
||||
@@ -172,7 +172,7 @@ public class OrganController {
|
||||
@GetMapping({"/list-all-simple", "/simple-list"})
|
||||
@Operation(summary = "获取组织精简信息列表", description = "主要用于前端的下拉选项")
|
||||
@Parameter(name = "name", description = "组织名称", required = false, example = "xxx")
|
||||
@PreAuthorize("@ss.hasPermission('organizationLIst:query')")
|
||||
// @PreAuthorize("@ss.hasPermission('organizationLIst:query')")
|
||||
public CommonResult<List<OrganSimpleRespVO>> getSimpleOrganList(@RequestParam(required = false, value = "name") String name) {
|
||||
return success(organService.getSimpleOrganList(name));
|
||||
}
|
||||
|
||||
+1
-1
@@ -60,7 +60,7 @@ public class TenantPackageController {
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得组织套餐")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('system:tenant-package:query')")
|
||||
// @PreAuthorize("@ss.hasPermission('system:tenant-package:query')")
|
||||
public CommonResult<TenantPackageRespVO> getTenantPackage(@RequestParam("id") Long id) {
|
||||
TenantPackageDO tenantPackage = tenantPackageService.getTenantPackage(id);
|
||||
return success(BeanUtils.toBean(tenantPackage, TenantPackageRespVO.class));
|
||||
|
||||
+1
-1
@@ -79,7 +79,7 @@ public class MenuController {
|
||||
|
||||
@GetMapping("/list")
|
||||
@Operation(summary = "获取菜单列表", description = "用于【菜单管理】界面")
|
||||
//@PreAuthorize("@ss.hasPermission('system:menu:query')")
|
||||
@PreAuthorize("@ss.hasAnyPermissions('system:menu:query','base:permission:assign-role-menu','system:permission:assign-role-menu')")
|
||||
public CommonResult<List<MenuRespVO>> getMenuList(MenuListReqVO reqVO) {
|
||||
List <MenuDO> list;
|
||||
LoginUser loginUser = getLoginUser();
|
||||
|
||||
+4
-10
@@ -48,8 +48,7 @@ public class PermissionController {
|
||||
@Operation(summary = "获得角色拥有的菜单编号")
|
||||
@Parameter(name = "roleId", description = "角色编号", required = true)
|
||||
@GetMapping("/list-role-menus")
|
||||
// @PreAuthorize("@ss.hasPermission('system:permission:assign-role-menu')")
|
||||
@PreAuthorize("@ss.hasAnyPermissions('system:permission:assign-role-menu','base:permission:assign-role-menu')")
|
||||
// @PreAuthorize("@ss.hasAnyPermissions('system:permission:assign-role-menu','base:permission:assign-role-menu','system:permission:assign-user-role')")
|
||||
public CommonResult<Set<Long>> getRoleMenuList(@RequestParam("roleId") Long roleId) {
|
||||
return success(permissionService.getRoleMenuListByRoleId(roleId));
|
||||
}
|
||||
@@ -85,7 +84,6 @@ public class PermissionController {
|
||||
|
||||
@PostMapping("/assign-role-data-scope")
|
||||
@Operation(summary = "赋予角色数据权限")
|
||||
// @PreAuthorize("@ss.hasPermission('system:permission:assign-role-data-scope')")
|
||||
@PreAuthorize("@ss.hasAnyPermissions('system:permission:assign-role-data-scope','base:permission:assign-role-data-scope')")
|
||||
public CommonResult<Boolean> assignRoleDataScope(@Valid @RequestBody PermissionAssignRoleDataScopeReqVO reqVO) {
|
||||
permissionService.assignRoleDataScope(reqVO.getRoleId(), reqVO.getDataScope(), reqVO.getDataScopeDeptIds());
|
||||
@@ -95,16 +93,14 @@ public class PermissionController {
|
||||
@Operation(summary = "获得管理员拥有的角色编号列表")
|
||||
@Parameter(name = "userId", description = "用户编号", required = true)
|
||||
@GetMapping("/list-user-roles")
|
||||
// @PreAuthorize("@ss.hasPermission('system:permission:assign-user-role')")
|
||||
@PreAuthorize("@ss.hasAnyPermissions('system:permission:assign-user-role','base:permission:assign-user-role')")
|
||||
// @PreAuthorize("@ss.hasAnyPermissions('system:permission:assign-user-role','base:permission:assign-user-role')")
|
||||
public CommonResult<Set<Long>> listAdminRoles(@RequestParam("userId") Long userId) {
|
||||
return success(permissionService.getUserRoleIdListByUserId(userId));
|
||||
}
|
||||
|
||||
@Operation(summary = "赋予用户角色")
|
||||
@PostMapping("/assign-user-role")
|
||||
// @PreAuthorize("@ss.hasPermission('system:permission:assign-user-role')")
|
||||
@PreAuthorize("@ss.hasAnyPermissions('system:permission:assign-user-role','base:permission:assign-user-role')")
|
||||
@PreAuthorize("@ss.hasAnyPermissions('system:user:assign-role','base:user:assign-role')")
|
||||
public CommonResult<Boolean> assignUserRole(@Validated @RequestBody PermissionAssignUserRoleReqVO reqVO) {
|
||||
Long organId = reqVO.getOrganId() == null ? OrganContextHolder.getOrganId() : reqVO.getOrganId();
|
||||
permissionService.assignUserRole(reqVO.getUserId(), reqVO.getRoleIds(), organId);
|
||||
@@ -113,7 +109,6 @@ public class PermissionController {
|
||||
|
||||
@Operation(summary = "赋予多用户角色")
|
||||
@PostMapping("/bath-assign-user-role")
|
||||
// @PreAuthorize("@ss.hasPermission('system:permission:assign-user-role')")
|
||||
@PreAuthorize("@ss.hasAnyPermissions('system:permission:assign-user-role','base:permission:assign-user-role')")
|
||||
public CommonResult<Boolean> bathAssignUserRole(@Validated @RequestBody PermissionAssignRoleUserReqVO reqVO) {
|
||||
permissionService.batchAssignRoleUsers(reqVO);
|
||||
@@ -124,8 +119,7 @@ public class PermissionController {
|
||||
@Operation(summary = "获得拥有角色的用户列表")
|
||||
@Parameter(name = "roleId", description = "角色id", required = true)
|
||||
@GetMapping("/list-role-users")
|
||||
// @PreAuthorize("@ss.hasPermission('system:permission:assign-user-role')")
|
||||
@PreAuthorize("@ss.hasAnyPermissions('system:permission:assign-user-role','base:permission:assign-user-role')")
|
||||
// @PreAuthorize("@ss.hasAnyPermissions('system:permission:assign-user-role','base:permission:assign-user-role')")
|
||||
public CommonResult<Set<Long>> listRoleUsers(@RequestParam("roleId") Long roleId, @RequestParam(value = "organId", required = false) Long organId) {
|
||||
return success(permissionService.getListRoleUsers(roleId, organId));
|
||||
}
|
||||
|
||||
+1
-8
@@ -51,7 +51,6 @@ public class RoleController {
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建角色")
|
||||
// @PreAuthorize("@ss.hasPermission('system:role:create')")
|
||||
@PreAuthorize("@ss.hasAnyPermissions('system:role:create','base:role:create')")
|
||||
public CommonResult<Long> createRole(@Valid @RequestBody RoleSaveReqVO createReqVO) {
|
||||
if(Objects.isNull(createReqVO.getOrganId())) {
|
||||
@@ -63,7 +62,6 @@ public class RoleController {
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "修改角色")
|
||||
// @PreAuthorize("@ss.hasPermission('system:role:update')")
|
||||
@PreAuthorize("@ss.hasAnyPermissions('system:role:update','base:role:update')")
|
||||
public CommonResult<Boolean> updateRole(@Valid @RequestBody RoleSaveReqVO updateReqVO) {
|
||||
if (Objects.equals(updateReqVO.getId(), InternalRoleConstants.ORGAN_ADMIN_ROLE_ID) || Objects.equals(updateReqVO.getId(), InternalRoleConstants.ORGAN_STAFF_ROLE_ID)) {
|
||||
@@ -79,7 +77,6 @@ public class RoleController {
|
||||
|
||||
@PutMapping("/update-status")
|
||||
@Operation(summary = "修改角色状态")
|
||||
// @PreAuthorize("@ss.hasPermission('system:role:update')")
|
||||
@PreAuthorize("@ss.hasAnyPermissions('system:role:update','base:role:update')")
|
||||
public CommonResult<Boolean> updateRoleStatus(@Valid @RequestBody RoleUpdateStatusReqVO reqVO) {
|
||||
roleService.updateRoleStatus(reqVO.getId(), reqVO.getStatus());
|
||||
@@ -89,7 +86,6 @@ public class RoleController {
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除角色")
|
||||
@Parameter(name = "id", description = "角色编号", required = true, example = "1024")
|
||||
// @PreAuthorize("@ss.hasPermission('system:role:delete')")
|
||||
@PreAuthorize("@ss.hasAnyPermissions('system:role:delete','base:role:delete')")
|
||||
public CommonResult<Boolean> deleteRole(@RequestParam("id") Long id) {
|
||||
roleService.deleteRole(id);
|
||||
@@ -98,8 +94,7 @@ public class RoleController {
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得角色信息")
|
||||
// @PreAuthorize("@ss.hasPermission('system:role:query')")
|
||||
@PreAuthorize("@ss.hasAnyPermissions('system:role:query','base:role:query')")
|
||||
// @PreAuthorize("@ss.hasAnyPermissions('system:role:query','base:role:query','system:permission:assign-user-role')")
|
||||
public CommonResult<RoleRespVO> getRole(@RequestParam("id") Long id) {
|
||||
RoleDO role = roleService.getRole(id);
|
||||
if (ObjectUtil.isNull(role)) {
|
||||
@@ -110,7 +105,6 @@ public class RoleController {
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得角色分页")
|
||||
// @PreAuthorize("@ss.hasPermission('system:role:query')")
|
||||
@PreAuthorize("@ss.hasAnyPermissions('system:role:query','base:role:query')")
|
||||
public CommonResult<PageResult<RoleRespVO>> getRolePage(@Valid RolePageReqVO pageReqVO) {
|
||||
PageResult<RoleDO> pageResult = roleService.getRolePage(pageReqVO);
|
||||
@@ -129,7 +123,6 @@ public class RoleController {
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出角色 Excel")
|
||||
@OperateLog(type = EXPORT)
|
||||
// @PreAuthorize("@ss.hasPermission('system:role:export')")
|
||||
@PreAuthorize("@ss.hasAnyPermissions('system:role:export','base:role:export')")
|
||||
public void export(HttpServletResponse response, @Validated RolePageReqVO exportReqVO) throws IOException {
|
||||
exportReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
|
||||
+2
-1
@@ -47,7 +47,7 @@ public class SettingController {
|
||||
@PostMapping("/update")
|
||||
@Operation(summary = "更新打包系统配置")
|
||||
@OperateLog(module="管理后台 - 系统打包配置",name = "更新打包/预打包系统配置",type = UPDATE)
|
||||
// @PreAuthorize("@ss.hasAnyPermissions('manage:pack:pack-config','manage:pack:pre-pack-config')")
|
||||
@PreAuthorize("@ss.hasAnyPermissions('manage:pack:pack-config','manage:pack:pre-pack-config')")
|
||||
public CommonResult<Long> updateSetting( @RequestBody PackageConfigReqVO reqVO ) {
|
||||
|
||||
return success(settingService.updateSetting(reqVO));
|
||||
@@ -59,6 +59,7 @@ public class SettingController {
|
||||
@GetMapping("/select")
|
||||
@Operation(summary = "查看当前用户的打包配置信息")
|
||||
@Parameter(name = "type", description = "配置类型", required = true)
|
||||
@PreAuthorize("@ss.hasAnyPermissions('manage:pack:query')")
|
||||
public CommonResult<PackageConfigDO> selectSetting(@RequestParam("type") Integer type ) {
|
||||
|
||||
return success(settingService.selectSetting(type));
|
||||
|
||||
+1
-1
@@ -65,7 +65,7 @@ public class SmsTemplateController {
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得短信模板")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('system:sms-template:query')")
|
||||
// @PreAuthorize("@ss.hasPermission('system:sms-template:query')")
|
||||
public CommonResult<SmsTemplateRespVO> getSmsTemplate(@RequestParam("id") Long id) {
|
||||
SmsTemplateDO template = smsTemplateService.getSmsTemplate(id);
|
||||
return success(BeanUtils.toBean(template, SmsTemplateRespVO.class));
|
||||
|
||||
+3
-3
@@ -35,7 +35,7 @@ public class SystemConfigController {
|
||||
|
||||
@GetMapping()
|
||||
@Operation(summary = "获得系统配置的分页列表")
|
||||
@PreAuthorize("@ss.hasAnyPermissions('system:base-setting:query','unplannedOrders:query','placeorder:query')")
|
||||
@PreAuthorize("@ss.hasAnyPermissions('system:base-setting:query','unplannedOrders:query','placeorder:query','manage:un-order-olan:create')")
|
||||
public CommonResult<List<ConfigRespVO>> getSystemConfigPage(@Valid ConfigPageReqVO pageReqVO) {
|
||||
List<SystemConfigDO> pageResult = systemConfigService.getSystemConfigList(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, ConfigRespVO.class));
|
||||
@@ -70,7 +70,7 @@ public class SystemConfigController {
|
||||
|
||||
@PostMapping()
|
||||
@Operation(summary = "新增/修改系统配置")
|
||||
// @PreAuthorize("@ss.hasAnyPermissions('system:base-setting:setting','system:base-setting:save','system:base-setting:copy')")
|
||||
@PreAuthorize("@ss.hasAnyPermissions('system:base-setting:setting','system:base-setting:save','system:base-setting:copy')")
|
||||
public CommonResult<Boolean> modifySystemConfig(@Valid @RequestBody ConfigSaveReqVO reqVO) {
|
||||
systemConfigService.modifySystemConfig(reqVO);
|
||||
return success(true);
|
||||
@@ -78,7 +78,7 @@ public class SystemConfigController {
|
||||
|
||||
@DeleteMapping("")
|
||||
@Operation(summary = "删除系统配置")
|
||||
@PreAuthorize("@ss.hasPermission('system:base-setting:setting')")
|
||||
@PreAuthorize("@ss.hasPermission('system:base-setting:delete')")
|
||||
public CommonResult<Boolean> deleteSystemConfig(@Valid @RequestBody ConfigDeleteReqVO reqVO) {
|
||||
systemConfigService.deleteSystemConfig(reqVO);
|
||||
return success(true);
|
||||
|
||||
+2
-10
@@ -70,7 +70,6 @@ public class UserController {
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "新增用户")
|
||||
// @PreAuthorize("@ss.hasPermission('system:user:create')")
|
||||
@PreAuthorize("@ss.hasAnyPermissions('system:user:create','base:user:create')")
|
||||
public CommonResult<Long> createUser(@Valid @RequestBody UserSaveReqVO reqVO) {
|
||||
Long id = userService.createUser(reqVO);
|
||||
@@ -79,7 +78,6 @@ public class UserController {
|
||||
|
||||
@PutMapping("update")
|
||||
@Operation(summary = "修改用户")
|
||||
// @PreAuthorize("@ss.hasPermission('system:user:update')")
|
||||
@PreAuthorize("@ss.hasAnyPermissions('system:user:update','base:user:update')")
|
||||
public CommonResult<Boolean> updateUser(@Valid @RequestBody UserSaveReqVO reqVO) {
|
||||
userService.updateUser(reqVO);
|
||||
@@ -89,7 +87,6 @@ public class UserController {
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除用户")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
// @PreAuthorize("@ss.hasPermission('system:user:delete')")
|
||||
@PreAuthorize("@ss.hasAnyPermissions('system:user:delete','base:user:delete')")
|
||||
public CommonResult<Boolean> deleteUser(@RequestParam("id") Long id) {
|
||||
userService.deleteUser(id);
|
||||
@@ -98,7 +95,6 @@ public class UserController {
|
||||
|
||||
@PutMapping("/update-password")
|
||||
@Operation(summary = "重置用户密码")
|
||||
// @PreAuthorize("@ss.hasPermission('system:user:update-password')")
|
||||
@PreAuthorize("@ss.hasAnyPermissions('system:user:update-password','base:user:update-password')")
|
||||
public CommonResult<Boolean> updateUserPassword(@Valid @RequestBody UserUpdatePasswordReqVO reqVO) {
|
||||
userService.updateUserPassword(reqVO.getId(), reqVO.getPassword());
|
||||
@@ -116,7 +112,6 @@ public class UserController {
|
||||
|
||||
@PutMapping("/update-status")
|
||||
@Operation(summary = "修改用户状态")
|
||||
// @PreAuthorize("@ss.hasPermission('system:user:update')")
|
||||
@PreAuthorize("@ss.hasAnyPermissions('system:user:update','base:user:update')")
|
||||
public CommonResult<Boolean> updateUserStatus(@Valid @RequestBody UserUpdateStatusReqVO reqVO) {
|
||||
userService.updateUserStatus(reqVO.getId(), reqVO.getStatus());
|
||||
@@ -125,7 +120,7 @@ public class UserController {
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得用户分页列表")
|
||||
@PreAuthorize("@ss.hasAnyPermissions('system:user:list','base:user:query')")
|
||||
@PreAuthorize("@ss.hasAnyPermissions('system:user:query','base:user:query','system:permission:assign-user-role','base:permission:assign-user-role')")
|
||||
public CommonResult<PageResult<UserRespVO>> getUserPage(@Valid UserPageReqVO pageReqVO) {
|
||||
// 获得用户分页列表
|
||||
PageResult<AdminUserDO> pageResult = userService.getUserPage(pageReqVO);
|
||||
@@ -153,8 +148,7 @@ public class UserController {
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得用户详情")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
// @PreAuthorize("@ss.hasPermission('system:user:query')")
|
||||
@PreAuthorize("@ss.hasAnyPermissions('system:user:query','base:user:query')")
|
||||
// @PreAuthorize("@ss.hasAnyPermissions('system:user:query','base:user:query')")
|
||||
public CommonResult<UserRespVO> getUser(@RequestParam("id") Long id) {
|
||||
AdminUserDO user = userService.getUser(id);
|
||||
if (ObjectUtil.isNull(user)) {
|
||||
@@ -167,7 +161,6 @@ public class UserController {
|
||||
|
||||
@GetMapping("/export")
|
||||
@Operation(summary = "导出用户")
|
||||
// @PreAuthorize("@ss.hasPermission('system:user:export')")
|
||||
@PreAuthorize("@ss.hasAnyPermissions('system:user:export','base:user:export')")
|
||||
@OperateLog(type = EXPORT)
|
||||
public void exportUserList(@Validated UserPageReqVO exportReqVO,
|
||||
@@ -220,7 +213,6 @@ public class UserController {
|
||||
@Parameter(name = "file", description = "Excel 文件", required = true),
|
||||
@Parameter(name = "updateSupport", description = "是否支持更新,默认为 false", example = "true")
|
||||
})
|
||||
// @PreAuthorize("@ss.hasPermission('system:user:import')")
|
||||
@PreAuthorize("@ss.hasAnyPermissions('system:user:import','base:user:import')")
|
||||
public CommonResult<UserImportRespVO> importExcel(@RequestParam("file") MultipartFile file,
|
||||
@RequestParam(value = "updateSupport", required = false, defaultValue = "false") Boolean updateSupport,
|
||||
|
||||
Reference in New Issue
Block a user