|
@@ -0,0 +1,112 @@
|
|
|
+package com.zhongzheng.controller.system;
|
|
|
+
|
|
|
+import java.util.List;
|
|
|
+import java.util.Arrays;
|
|
|
+
|
|
|
+import com.zhongzheng.modules.system.bo.SysRoleBusinessAddBo;
|
|
|
+import com.zhongzheng.modules.system.bo.SysRoleBusinessEditBo;
|
|
|
+import com.zhongzheng.modules.system.bo.SysRoleBusinessQueryBo;
|
|
|
+import com.zhongzheng.modules.system.service.ISysRoleBusinessService;
|
|
|
+import com.zhongzheng.modules.system.vo.SysRoleBusinessVo;
|
|
|
+import lombok.RequiredArgsConstructor;
|
|
|
+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.zhongzheng.common.annotation.Log;
|
|
|
+import com.zhongzheng.common.core.controller.BaseController;
|
|
|
+import com.zhongzheng.common.core.domain.AjaxResult;
|
|
|
+import com.zhongzheng.common.enums.BusinessType;
|
|
|
+import com.zhongzheng.common.utils.poi.ExcelUtil;
|
|
|
+import com.zhongzheng.common.core.page.TableDataInfo;
|
|
|
+import io.swagger.annotations.Api;
|
|
|
+import io.swagger.annotations.ApiOperation;
|
|
|
+
|
|
|
+/**
|
|
|
+ * 角色和业务层次关联Controller
|
|
|
+ *
|
|
|
+ * @author ruoyi
|
|
|
+ * @date 2022-01-18
|
|
|
+ */
|
|
|
+@Api(value = "角色和业务层次关联控制器", tags = {"角色和业务层次关联管理"})
|
|
|
+@RequiredArgsConstructor(onConstructor_ = @Autowired)
|
|
|
+@RestController
|
|
|
+@RequestMapping("/system/role/business")
|
|
|
+public class SysRoleBusinessController extends BaseController {
|
|
|
+
|
|
|
+ private final ISysRoleBusinessService iSysRoleBusinessService;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查询角色和业务层次关联列表
|
|
|
+ */
|
|
|
+ @ApiOperation("查询角色和业务层次关联列表")
|
|
|
+ @PreAuthorize("@ss.hasPermi('system:business:list')")
|
|
|
+ @GetMapping("/list")
|
|
|
+ public TableDataInfo<SysRoleBusinessVo> list(SysRoleBusinessQueryBo bo) {
|
|
|
+ startPage();
|
|
|
+ List<SysRoleBusinessVo> list = iSysRoleBusinessService.queryList(bo);
|
|
|
+ return getDataTable(list);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 导出角色和业务层次关联列表
|
|
|
+ */
|
|
|
+ /* @ApiOperation("导出角色和业务层次关联列表")
|
|
|
+ @PreAuthorize("@ss.hasPermi('system:business:export')")
|
|
|
+ @Log(title = "角色和业务层次关联", businessType = BusinessType.EXPORT)
|
|
|
+ @GetMapping("/export")
|
|
|
+ public AjaxResult<SysRoleBusinessVo> export(SysRoleBusinessQueryBo bo) {
|
|
|
+ List<SysRoleBusinessVo> list = iSysRoleBusinessService.queryList(bo);
|
|
|
+ ExcelUtil<SysRoleBusinessVo> util = new ExcelUtil<SysRoleBusinessVo>(SysRoleBusinessVo.class);
|
|
|
+ return util.exportExcel(list, "角色和业务层次关联");
|
|
|
+ }*/
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取角色和业务层次关联详细信息
|
|
|
+ */
|
|
|
+ @ApiOperation("获取角色和业务层次关联详细信息")
|
|
|
+ @PreAuthorize("@ss.hasPermi('system:business:query')")
|
|
|
+ @GetMapping("/{id}")
|
|
|
+ public AjaxResult<SysRoleBusinessVo> getInfo(@PathVariable("id" ) Long id) {
|
|
|
+ return AjaxResult.success(iSysRoleBusinessService.queryById(id));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 新增角色和业务层次关联
|
|
|
+ */
|
|
|
+ @ApiOperation("新增角色和业务层次关联")
|
|
|
+ @PreAuthorize("@ss.hasPermi('system:business:add')")
|
|
|
+ @Log(title = "角色和业务层次关联", businessType = BusinessType.INSERT)
|
|
|
+ @PostMapping()
|
|
|
+ public AjaxResult<Void> add(@RequestBody SysRoleBusinessAddBo bo) {
|
|
|
+ return toAjax(iSysRoleBusinessService.insertByAddBo(bo) ? 1 : 0);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 修改角色和业务层次关联
|
|
|
+ */
|
|
|
+ @ApiOperation("修改角色和业务层次关联")
|
|
|
+ @PreAuthorize("@ss.hasPermi('system:business:edit')")
|
|
|
+ @Log(title = "角色和业务层次关联", businessType = BusinessType.UPDATE)
|
|
|
+ @PostMapping("/edit")
|
|
|
+ public AjaxResult<Void> edit(@RequestBody SysRoleBusinessEditBo bo) {
|
|
|
+ return toAjax(iSysRoleBusinessService.updateByEditBo(bo) ? 1 : 0);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 删除角色和业务层次关联
|
|
|
+ */
|
|
|
+ @ApiOperation("删除角色和业务层次关联")
|
|
|
+ @PreAuthorize("@ss.hasPermi('system:business:remove')")
|
|
|
+ @Log(title = "角色和业务层次关联" , businessType = BusinessType.DELETE)
|
|
|
+ @DeleteMapping("/{ids}")
|
|
|
+ public AjaxResult<Void> remove(@PathVariable Long[] ids) {
|
|
|
+ return toAjax(iSysRoleBusinessService.deleteWithValidByIds(Arrays.asList(ids), true) ? 1 : 0);
|
|
|
+ }
|
|
|
+}
|