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 list(SysTenantQueryBo bo) { startPage(); List list = iSysTenantService.queryList(bo); return getDataTable(list); } /** * 导出系统商户列表 */ /* @ApiOperation("导出系统商户列表") @PreAuthorize("@ss.hasPermi('system:tenant:export')") @Log(title = "系统商户", businessType = BusinessType.EXPORT) @GetMapping("/export") public AjaxResult export(SysTenantQueryBo bo) { List list = iSysTenantService.queryList(bo); ExcelUtil util = new ExcelUtil(SysTenantVo.class); return util.exportExcel(list, "系统商户"); }*/ /** * 获取系统商户详细信息 */ @ApiOperation("获取系统商户详细信息") @PreAuthorize("@ss.hasPermi('system:tenant:query')") @GetMapping("/{tenantId}") public AjaxResult getInfo(@PathVariable("tenantId" ) Long tenantId) { return AjaxResult.success(iSysTenantService.queryById(tenantId)); } /** * 获取系统商户银行账号信息 */ @ApiOperation("获取系统商户银行账号信息") @GetMapping("/bank/{tenantId}") public AjaxResult> 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 add(@Validated @RequestBody SysTenantAddBo bo) { return toAjax(iSysTenantService.insertByAddBo(bo) ? 1 : 0); } /** * 总平台新增系统商户 */ @ApiOperation("总平台新增系统商户") @PostMapping("/add") public AjaxResult 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 edit(@RequestBody SysTenantEditBo bo) { return toAjax(iSysTenantService.updateByEditBo(bo) ? 1 : 0); } /** * 总平台修改系统商户 */ @ApiOperation("总平台修改系统商户") @PostMapping("/edit/top") public AjaxResult 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 remove(@PathVariable Long[] tenantIds) { return toAjax(iSysTenantService.deleteWithValidByIds(Arrays.asList(tenantIds), true) ? 1 : 0); }*/ }