配置文件修改

pull/2/head
perry 2023-05-26 15:01:46 +08:00
parent 540caf9cc1
commit 74a33ecb85
5 changed files with 22 additions and 2 deletions

View File

@ -9,7 +9,10 @@ import com.alibaba.ttl.TransmittableThreadLocal;
* @author
*/
public class TenantContextHolder {
/**
* -
*/
public static final Long ID_SYSTEM = 1L;
/**
*
*/

View File

@ -3,6 +3,7 @@ package cn.iocoder.yudao.module.shop.controller.admin.recharge;
import cn.iocoder.yudao.framework.security.core.annotations.PreAuthenticated;
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
import cn.iocoder.yudao.framework.tenant.core.aop.TenantIgnore;
import cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder;
import cn.iocoder.yudao.module.shop.controller.admin.recharge.method.Excel;
import cn.iocoder.yudao.module.shop.convert.recharge.RechargeOrderInfoConvert;
import cn.iocoder.yudao.module.shop.dal.dataobject.recharge.RechargeOrderInfoDO;
@ -102,6 +103,9 @@ public class RechargeOrderController {
@PreAuthorize("@ss.hasPermission('shop:recharge-order:query')")
@TenantIgnore
public CommonResult<PageResult<RechargeOrderRespVO>> getRechargeOrderPage(@Valid RechargeOrderPageReqVO pageVO) {
if(!TenantContextHolder.ID_SYSTEM.equals(TenantContextHolder.getRequiredTenantId())){
pageVO.setTenantId(TenantContextHolder.getRequiredTenantId());
}
pageVO.setTenantId(SecurityFrameworkUtils.getLoginUser().getTenantId());
PageResult<RechargeOrderRespVO> pageResult = rechargeOrderService.getRechargeOrderPage(pageVO);
return success(pageResult);

View File

@ -5,6 +5,7 @@ import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
import cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder;
import cn.iocoder.yudao.module.system.controller.admin.tenant.vo.tenant.*;
import cn.iocoder.yudao.module.system.convert.tenant.TenantConvert;
import cn.iocoder.yudao.module.system.dal.dataobject.tenant.TenantDO;
@ -96,7 +97,16 @@ public class TenantController {
PageResult<TenantDO> pageResult = tenantService.getTenantPage(pageVO);
return success(TenantConvert.INSTANCE.convertPage(pageResult));
}
@GetMapping("/list")
@Operation(summary = "获取所有商户")
public CommonResult<List<TenantRespVO>> list(@Valid TenantExportReqVO pageVO) {
List<TenantDO> pageResult = null;
if(!TenantContextHolder.ID_SYSTEM.equals(TenantContextHolder.getRequiredTenantId())){
pageVO.setTenantId(TenantContextHolder.getRequiredTenantId());
}
pageResult = tenantService.getTenantList(pageVO);
return success(TenantConvert.INSTANCE.convertList(pageResult));
}
@GetMapping("/export-excel")
@Operation(summary = "导出租户 Excel")
@PreAuthorize("@ss.hasPermission('system:tenant:export')")

View File

@ -14,6 +14,8 @@ public class TenantExportReqVO {
@Schema(description = "租户名", example = "芋道")
private String name;
@Schema(description = "tenantId", example = "芋道")
private Long tenantId;
@Schema(description = "联系人", example = "芋艿")
private String contactName;

View File

@ -36,6 +36,7 @@ public interface TenantMapper extends BaseMapperX<TenantDO> {
.likeIfPresent(TenantDO::getContactName, reqVO.getContactName())
.likeIfPresent(TenantDO::getContactMobile, reqVO.getContactMobile())
.eqIfPresent(TenantDO::getStatus, reqVO.getStatus())
.eqIfPresent(TenantDO::getId, reqVO.getTenantId())
.betweenIfPresent(TenantDO::getCreateTime, reqVO.getCreateTime())
.orderByDesc(TenantDO::getId));
}