From 499f5f26ffff98092a23d77187cb23a237ec4999 Mon Sep 17 00:00:00 2001 From: Kurisu Date: Mon, 14 Feb 2022 11:39:29 +0800 Subject: [PATCH] :sparkles: 新增查询数量接口 --- fw-valhalla-sdk/src/main/java/cn/fw/valhalla/sdk/param/CustomerQueryReq.java | 2 -- fw-valhalla-server/src/main/java/cn/fw/valhalla/controller/erp/ERPCommonController.java | 11 +++++------ fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/cust/CustomerBizService.java | 1 + 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/fw-valhalla-sdk/src/main/java/cn/fw/valhalla/sdk/param/CustomerQueryReq.java b/fw-valhalla-sdk/src/main/java/cn/fw/valhalla/sdk/param/CustomerQueryReq.java index 28b8a1b..269e40b 100644 --- a/fw-valhalla-sdk/src/main/java/cn/fw/valhalla/sdk/param/CustomerQueryReq.java +++ b/fw-valhalla-sdk/src/main/java/cn/fw/valhalla/sdk/param/CustomerQueryReq.java @@ -4,7 +4,6 @@ import cn.fw.valhalla.sdk.enums.CustomerFollowTypeEnum; import lombok.EqualsAndHashCode; import lombok.ToString; -import javax.validation.constraints.NotNull; import java.io.Serializable; import java.util.Arrays; import java.util.List; @@ -51,7 +50,6 @@ public class CustomerQueryReq implements Serializable { @Deprecated private Integer customerType; - @NotNull(message = "集团id不能为空") private Long groupId; /** diff --git a/fw-valhalla-server/src/main/java/cn/fw/valhalla/controller/erp/ERPCommonController.java b/fw-valhalla-server/src/main/java/cn/fw/valhalla/controller/erp/ERPCommonController.java index 26c7b9d..95bba01 100644 --- a/fw-valhalla-server/src/main/java/cn/fw/valhalla/controller/erp/ERPCommonController.java +++ b/fw-valhalla-server/src/main/java/cn/fw/valhalla/controller/erp/ERPCommonController.java @@ -1,24 +1,22 @@ package cn.fw.valhalla.controller.erp; import cn.fw.common.web.annotation.ControllerMethod; +import cn.fw.common.web.auth.LoginAuthBean; +import cn.fw.common.web.auth.annotation.CurrentUser; import cn.fw.data.base.domain.common.Message; import cn.fw.security.auth.client.annotation.Authorization; -import cn.fw.security.auth.client.annotation.IgnoreAuth; import cn.fw.security.auth.client.annotation.IgnoreUserToken; import cn.fw.security.auth.client.enums.AuthType; -import cn.fw.valhalla.domain.dto.CustomerDetailDto; import cn.fw.valhalla.sdk.param.CustomerQueryReq; import cn.fw.valhalla.service.bus.cust.CustomerBizService; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import javax.validation.Valid; -import java.util.List; import static cn.fw.common.web.util.ResultBuilder.success; @@ -39,9 +37,10 @@ public class ERPCommonController { @GetMapping("/condition/count") - @IgnoreAuth + @IgnoreUserToken @ControllerMethod("查询满足条件的档案数量") - public Message conditionCustomerCount(@Valid CustomerQueryReq customerQueryReq) { + public Message conditionCustomerCount(@CurrentUser LoginAuthBean currentUser, @Valid CustomerQueryReq customerQueryReq) { + customerQueryReq.setGroupId(currentUser.getGroupId()); return success(customerBizService.queryCustomCount(customerQueryReq)); } } diff --git a/fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/cust/CustomerBizService.java b/fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/cust/CustomerBizService.java index f0cd4bc..728db3c 100644 --- a/fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/cust/CustomerBizService.java +++ b/fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/cust/CustomerBizService.java @@ -811,6 +811,7 @@ public class CustomerBizService extends AbstractCustomerService { } private CustomCustomerQuery fillParams(final CustomerQueryReq queryReq) { + BV.notNull(queryReq.getGroupId(), () -> "集团id不能为空"); CustomCustomerQuery query = new CustomCustomerQuery(); BeanUtils.copyProperties(queryReq, query); -- libgit2 0.22.2