控制器增加Permissions注解
This commit is contained in:
parent
17d2374675
commit
d66658f73d
|
|
@ -6,6 +6,7 @@ import com.bonus.common.core.domain.ResultBean;
|
|||
import com.bonus.common.core.utils.poi.ExcelUtil;
|
||||
import com.bonus.common.core.web.controller.BaseController;
|
||||
import com.bonus.common.core.web.page.TableDataInfo;
|
||||
import com.bonus.common.security.annotation.RequiresPermissions;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
|
@ -33,6 +34,7 @@ public class BmAgreementController extends BaseController {
|
|||
* 分页查询
|
||||
*/
|
||||
@GetMapping("/getAgreementList")
|
||||
@RequiresPermissions("base:agreement:query")
|
||||
public TableDataInfo list(BmAgreement bmAgreement) {
|
||||
startPage();
|
||||
List<BmAgreement> list = this.bmAgreementService.selectAll(bmAgreement);
|
||||
|
|
@ -47,6 +49,7 @@ public class BmAgreementController extends BaseController {
|
|||
* @return 单条数据
|
||||
*/
|
||||
@GetMapping("{id}")
|
||||
@RequiresPermissions("base:agreement:query")
|
||||
public ResultBean<BmAgreement> queryById(@PathVariable("id") Integer id) {
|
||||
return ResultBean.success(this.bmAgreementService.selectByPrimaryKey(id));
|
||||
}
|
||||
|
|
@ -58,6 +61,7 @@ public class BmAgreementController extends BaseController {
|
|||
* @return 新增结果
|
||||
*/
|
||||
@PostMapping(value = "/add")
|
||||
@RequiresPermissions("base:agreement:add")
|
||||
public ResultBean<Boolean> add(@RequestBody BmAgreement bmAgreement) {
|
||||
int result = this.bmAgreementService.insertSelective(bmAgreement);
|
||||
return result > 0 ? ResultBean.success(true) : ResultBean.error("新增失败");
|
||||
|
|
@ -70,6 +74,7 @@ public class BmAgreementController extends BaseController {
|
|||
* @return 编辑结果
|
||||
*/
|
||||
@PutMapping(value = "/update")
|
||||
@RequiresPermissions("base:agreement:edit")
|
||||
public ResultBean<Boolean> edit(@RequestBody BmAgreement bmAgreement) {
|
||||
this.bmAgreementService.updateByPrimaryKeySelective(bmAgreement);
|
||||
return ResultBean.success(true);
|
||||
|
|
@ -82,6 +87,7 @@ public class BmAgreementController extends BaseController {
|
|||
* @return 删除是否成功
|
||||
*/
|
||||
@DeleteMapping(value = "/{id}")
|
||||
@RequiresPermissions("base:agreement:remove")
|
||||
public ResultBean<String> deleteById(@PathVariable("id") Integer id) {
|
||||
return ResultBean.toIsSuccess(this.bmAgreementService.deleteByPrimaryKey(id), "删除成功");
|
||||
}
|
||||
|
|
@ -91,6 +97,7 @@ public class BmAgreementController extends BaseController {
|
|||
*/
|
||||
@ApiOperation(value = "导出协议列表")
|
||||
@PostMapping("/export")
|
||||
@RequiresPermissions("base:agreement:export")
|
||||
public void export(HttpServletResponse response, BmAgreement bmAgreement)
|
||||
{
|
||||
List<BmAgreement> list = this.bmAgreementService.selectAll(bmAgreement);
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ public class BmCustomerTypeController extends BaseController {
|
|||
@Autowired
|
||||
private BmCustomerTypeService bmCustomerTypeService;
|
||||
|
||||
// @RequiresPermissions("base:customerType:query")
|
||||
@RequiresPermissions("base:customerType:query")
|
||||
@GetMapping("/getUnitTypeList")
|
||||
@SysLog(title = "往来单位类型", businessType = OperaType.QUERY, logType = 1, module = "往来单位类型->分页查询", details = "往来单位类型列表")
|
||||
public TableDataInfo list(BmCustomerType bmCustomerType) {
|
||||
|
|
@ -97,6 +97,7 @@ public class BmCustomerTypeController extends BaseController {
|
|||
*/
|
||||
@ApiOperation(value = "导出单位类型列表")
|
||||
@PostMapping("/export")
|
||||
@RequiresPermissions("base:customerType:export")
|
||||
public void export(HttpServletResponse response, BmCustomerType bmCustomerType)
|
||||
{
|
||||
List<BmCustomerType> list = bmCustomerTypeService.selectAll(bmCustomerType);
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import com.bonus.common.core.domain.ResultBean;
|
|||
import com.bonus.common.core.utils.poi.ExcelUtil;
|
||||
import com.bonus.common.core.web.controller.BaseController;
|
||||
import com.bonus.common.core.web.page.TableDataInfo;
|
||||
import com.bonus.common.security.annotation.RequiresPermissions;
|
||||
import com.bonus.common.security.utils.SecurityUtils;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
|
|
@ -38,6 +39,7 @@ public class BmSupplierController extends BaseController {
|
|||
* @return 查询结果
|
||||
*/
|
||||
@ApiOperation(value = "分页查询供应商列表")
|
||||
@RequiresPermissions("base:supplier:query")
|
||||
@GetMapping("/getMaSupplierList")
|
||||
public TableDataInfo queryByPage(BmSupplier bmSupplier) {
|
||||
startPage();
|
||||
|
|
@ -52,6 +54,7 @@ public class BmSupplierController extends BaseController {
|
|||
* @return 单条数据详情
|
||||
*/
|
||||
@ApiOperation(value = "查询供应商单条数据详情")
|
||||
@RequiresPermissions("base:supplier:query")
|
||||
@GetMapping("/{id}")
|
||||
public ResultBean<BmSupplier> queryById(@PathVariable("id") Integer id) {
|
||||
return ResultBean.success(bmSupplierService.queryById(id));
|
||||
|
|
@ -64,6 +67,7 @@ public class BmSupplierController extends BaseController {
|
|||
* @return 新增结果
|
||||
*/
|
||||
@ApiOperation(value = "新增供应商管理数据")
|
||||
@RequiresPermissions("base:supplier:add")
|
||||
@PostMapping("/add")
|
||||
public ResultBean add(@RequestBody BmSupplier bmSupplier) {
|
||||
Long companyId = SecurityUtils.getLoginUser().getSysUser().getCompanyId();
|
||||
|
|
@ -78,6 +82,7 @@ public class BmSupplierController extends BaseController {
|
|||
* @return 编辑结果
|
||||
*/
|
||||
@ApiOperation(value = "编辑供应商管理数据")
|
||||
@RequiresPermissions("base:supplier:edit")
|
||||
@PutMapping("/update")
|
||||
public ResultBean edit(@RequestBody BmSupplier bmSupplier) {
|
||||
return bmSupplierService.update(bmSupplier);
|
||||
|
|
@ -90,6 +95,7 @@ public class BmSupplierController extends BaseController {
|
|||
* @return 删除是否成功
|
||||
*/
|
||||
@ApiOperation(value = "删除供应商管理数据")
|
||||
@RequiresPermissions("base:supplier:remove")
|
||||
@PostMapping(value = "/{ids}")
|
||||
public ResultBean<Boolean> deleteById(@PathVariable("ids") Long[] ids) {
|
||||
int result = bmSupplierService.deleteById(ids);
|
||||
|
|
@ -100,6 +106,7 @@ public class BmSupplierController extends BaseController {
|
|||
* 导出供应商管理列表
|
||||
*/
|
||||
@ApiOperation(value = "导出查询机具供应商列表")
|
||||
@RequiresPermissions("base:supplier:export")
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, BmSupplier bmSupplier)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue