| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139 |
- package com.zhongzheng.controller.system;
- import java.util.List;
- import java.util.Arrays;
- import com.zhongzheng.modules.system.bo.*;
- import com.zhongzheng.modules.system.service.ISysTenantService;
- import com.zhongzheng.modules.system.vo.SysTenantBankAccountVo;
- import com.zhongzheng.modules.system.vo.SysTenantVo;
- import lombok.RequiredArgsConstructor;
- import org.springframework.security.access.prepost.PreAuthorize;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.validation.annotation.Validated;
- 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 hjl
- * @date 2021-08-03
- */
- @Api(value = "系统商户控制器", tags = {"系统商户管理"})
- @RequiredArgsConstructor(onConstructor_ = @Autowired)
- @RestController
- @RequestMapping("/system/tenant")
- public class SysTenantController extends BaseController {
- private final ISysTenantService iSysTenantService;
- /**
- * 查询系统商户列表
- */
- @ApiOperation("查询系统商户列表")
- @PreAuthorize("@ss.hasPermi('system:tenant:list')")
- @GetMapping("/list")
- public TableDataInfo<SysTenantVo> list(SysTenantQueryBo bo) {
- startPage();
- List<SysTenantVo> list = iSysTenantService.queryList(bo);
- return getDataTable(list);
- }
- /**
- * 导出系统商户列表
- */
- /* @ApiOperation("导出系统商户列表")
- @PreAuthorize("@ss.hasPermi('system:tenant:export')")
- @Log(title = "系统商户", businessType = BusinessType.EXPORT)
- @GetMapping("/export")
- public AjaxResult<SysTenantVo> export(SysTenantQueryBo bo) {
- List<SysTenantVo> list = iSysTenantService.queryList(bo);
- ExcelUtil<SysTenantVo> util = new ExcelUtil<SysTenantVo>(SysTenantVo.class);
- return util.exportExcel(list, "系统商户");
- }*/
- /**
- * 获取系统商户详细信息
- */
- @ApiOperation("获取系统商户详细信息")
- @PreAuthorize("@ss.hasPermi('system:tenant:query')")
- @GetMapping("/{tenantId}")
- public AjaxResult<SysTenantVo> getInfo(@PathVariable("tenantId" ) Long tenantId) {
- return AjaxResult.success(iSysTenantService.queryById(tenantId));
- }
- /**
- * 获取系统商户银行账号信息
- */
- @ApiOperation("获取系统商户银行账号信息")
- @GetMapping("/bank/{tenantId}")
- public AjaxResult<List<SysTenantBankAccountVo>> getBankAccountList(@PathVariable("tenantId" ) String tenantId) {
- return AjaxResult.success(iSysTenantService.getBankAccountList(tenantId));
- }
- /**
- * 新增系统商户
- */
- @ApiOperation("新增系统商户")
- @PreAuthorize("@ss.hasPermi('system:tenant:add')")
- @Log(title = "系统商户", businessType = BusinessType.INSERT)
- @PostMapping()
- public AjaxResult<Void> add(@Validated @RequestBody SysTenantAddBo bo) {
- return toAjax(iSysTenantService.insertByAddBo(bo) ? 1 : 0);
- }
- /**
- * 总平台新增系统商户
- */
- @ApiOperation("总平台新增系统商户")
- @PostMapping("/add")
- public AjaxResult<Void> addTopTenant(@Validated @RequestBody SysTopTenantAddBo bo) {
- return toAjax(iSysTenantService.addTopTenant(bo) ? 1 : 0);
- }
- /**
- * 修改系统商户
- */
- @ApiOperation("修改系统商户")
- @PreAuthorize("@ss.hasPermi('system:tenant:edit')")
- @Log(title = "系统商户", businessType = BusinessType.UPDATE)
- @PostMapping("/edit")
- public AjaxResult<Void> edit(@RequestBody SysTenantEditBo bo) {
- return toAjax(iSysTenantService.updateByEditBo(bo) ? 1 : 0);
- }
- /**
- * 总平台修改系统商户
- */
- @ApiOperation("总平台修改系统商户")
- @PostMapping("/edit/top")
- public AjaxResult<Void> editTopTenant(@RequestBody SysTopTenantEditBo bo) {
- return toAjax(iSysTenantService.editTopTenant(bo) ? 1 : 0);
- }
- /**
- * 删除系统商户
- */
- /* @ApiOperation("删除系统商户")
- @PreAuthorize("@ss.hasPermi('system:tenant:remove')")
- @Log(title = "系统商户" , businessType = BusinessType.DELETE)
- @DeleteMapping("/{tenantIds}")
- public AjaxResult<Void> remove(@PathVariable Long[] tenantIds) {
- return toAjax(iSysTenantService.deleteWithValidByIds(Arrays.asList(tenantIds), true) ? 1 : 0);
- }*/
- }
|