From 8ce672de303b9724bb54ecc5a17e0c225317fc41 Mon Sep 17 00:00:00 2001 From: jianjun Date: Fri, 17 Sep 2021 15:04:47 +0800 Subject: [PATCH] =?UTF-8?q?=E8=8E=B7=E5=8F=96=E8=87=AA=E5=B7=B1=E5=AE=A2?= =?UTF-8?q?=E6=88=B7=E5=8F=8A=E5=B9=B3=E5=8F=B0=E6=A8=A1=E7=89=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cloud/api/web/controller/ProjectTemplateController.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tduck-api/src/main/java/com/tduck/cloud/api/web/controller/ProjectTemplateController.java b/tduck-api/src/main/java/com/tduck/cloud/api/web/controller/ProjectTemplateController.java index 5e9b369..8c8a18e 100644 --- a/tduck-api/src/main/java/com/tduck/cloud/api/web/controller/ProjectTemplateController.java +++ b/tduck-api/src/main/java/com/tduck/cloud/api/web/controller/ProjectTemplateController.java @@ -5,6 +5,7 @@ import cn.hutool.core.util.IdUtil; import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.StrUtil; import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.tduck.cloud.common.constant.CommonConstants; import com.tduck.cloud.common.util.LoginUserUtil; import com.tduck.cloud.common.util.Result; import com.tduck.cloud.common.validator.ValidatorUtils; @@ -74,7 +75,7 @@ public class ProjectTemplateController { } /** - * 分页查询项目模板 + * 分页查询项目模板 查询自己客户id和default的模版 * * @return */ @@ -82,7 +83,7 @@ public class ProjectTemplateController { public Result queryProjectTemplates(QueryProjectTemplateRequest.Page request) { return Result.success(projectTemplateService.page(request.toMybatisPage(), Wrappers.lambdaQuery() - .eq(ProjectTemplateEntity::getCustomerId, LoginUserUtil.get().getCustomerId()) + .and(wq->wq.eq(ProjectTemplateEntity::getCustomerId, CommonConstants.DEFAULT_EPMET_CUSTOMER_ID).or().eq(ProjectTemplateEntity::getCustomerId, LoginUserUtil.get().getCustomerId())) .eq(ObjectUtil.isNotNull(request.getType()), ProjectTemplateEntity::getCategoryId, request.getType()) .like(StrUtil.isNotBlank(request.getName()), ProjectTemplateEntity::getName, request.getName()) .orderByDesc(ProjectTemplateEntity::getUpdatedTime)));