| | |
| | | package com.doumee.api.business; |
| | | |
| | | import com.doumee.api.BaseController; |
| | | import com.doumee.config.annotation.EncryptionReq; |
| | | import com.doumee.config.annotation.EncryptionResp; |
| | | import com.doumee.core.annotation.excel.ExcelExporter; |
| | | import com.doumee.core.annotation.pr.PreventRepeat; |
| | | import com.doumee.core.model.ApiResponse; |
| | |
| | | @PreventRepeat |
| | | @ApiOperation("新建") |
| | | @PostMapping("/create") |
| | | @EncryptionResp |
| | | @EncryptionReq |
| | | @RequiresPermissions("business:company:create") |
| | | public ApiResponse create(@RequestBody Company company) { |
| | | return ApiResponse.success(companyService.create(company)); |
| | |
| | | @PreventRepeat |
| | | @ApiOperation("同步部门信息") |
| | | @PostMapping("/syncAll") |
| | | @EncryptionResp |
| | | @EncryptionReq |
| | | @RequiresPermissions("business:company:create") |
| | | public ApiResponse syncAll(@RequestBody Company company) { |
| | | return ApiResponse.success(companyService.syncAll(company)); |
| | |
| | | |
| | | @ApiOperation("组织树查询") |
| | | @PostMapping("/tree") |
| | | @EncryptionResp |
| | | @EncryptionReq |
| | | @RequiresPermissions("business:company:query") |
| | | public ApiResponse<List<Company>> tree (@RequestBody Company company){ |
| | | return ApiResponse.success(companyService.companyTree()); |
| | |
| | | |
| | | @ApiOperation("根据ID删除") |
| | | @GetMapping("/delete/{id}") |
| | | @EncryptionResp |
| | | @EncryptionReq |
| | | @RequiresPermissions("business:company:delete") |
| | | public ApiResponse deleteById(@PathVariable Integer id) { |
| | | companyService.deleteById(id); |
| | |
| | | @ApiOperation("批量删除") |
| | | @GetMapping("/delete/batch") |
| | | @RequiresPermissions("business:company:delete") |
| | | @EncryptionResp |
| | | @EncryptionReq |
| | | public ApiResponse deleteByIdInBatch(@RequestParam String ids) { |
| | | companyService.deleteByIdInBatch(this.getIdList(ids)); |
| | | return ApiResponse.success(null); |
| | |
| | | |
| | | @ApiOperation("分页查询") |
| | | @PostMapping("/page") |
| | | @EncryptionResp |
| | | @EncryptionReq |
| | | @RequiresPermissions("business:company:query") |
| | | public ApiResponse<PageData<Company>> findPage (@RequestBody PageWrap<Company> pageWrap) { |
| | | return ApiResponse.success(companyService.findPage(pageWrap)); |
| | |
| | | |
| | | @ApiOperation("导出Excel") |
| | | @PostMapping("/exportExcel") |
| | | @EncryptionReq |
| | | @RequiresPermissions("business:company:exportExcel") |
| | | public void exportExcel (@RequestBody PageWrap<Company> pageWrap, HttpServletResponse response) { |
| | | ExcelExporter.build(Company.class).export(companyService.findPage(pageWrap).getRecords(), "组织信息表", response); |
| | |
| | | |
| | | @ApiOperation("根据ID查询") |
| | | @GetMapping("/{id}") |
| | | @EncryptionResp |
| | | @EncryptionReq |
| | | @RequiresPermissions("business:company:query") |
| | | public ApiResponse findById(@PathVariable Integer id) { |
| | | return ApiResponse.success(companyService.findById(id)); |