Commit 499f5f26ffff98092a23d77187cb23a237ec4999

Authored by 张志伟
1 parent 1ca0a771

:sparkles: 新增查询数量接口

fw-valhalla-sdk/src/main/java/cn/fw/valhalla/sdk/param/CustomerQueryReq.java
... ... @@ -4,7 +4,6 @@ import cn.fw.valhalla.sdk.enums.CustomerFollowTypeEnum;
4 4 import lombok.EqualsAndHashCode;
5 5 import lombok.ToString;
6 6  
7   -import javax.validation.constraints.NotNull;
8 7 import java.io.Serializable;
9 8 import java.util.Arrays;
10 9 import java.util.List;
... ... @@ -51,7 +50,6 @@ public class CustomerQueryReq implements Serializable {
51 50 @Deprecated
52 51 private Integer customerType;
53 52  
54   - @NotNull(message = "集团id不能为空")
55 53 private Long groupId;
56 54  
57 55 /**
... ...
fw-valhalla-server/src/main/java/cn/fw/valhalla/controller/erp/ERPCommonController.java
1 1 package cn.fw.valhalla.controller.erp;
2 2  
3 3 import cn.fw.common.web.annotation.ControllerMethod;
  4 +import cn.fw.common.web.auth.LoginAuthBean;
  5 +import cn.fw.common.web.auth.annotation.CurrentUser;
4 6 import cn.fw.data.base.domain.common.Message;
5 7 import cn.fw.security.auth.client.annotation.Authorization;
6   -import cn.fw.security.auth.client.annotation.IgnoreAuth;
7 8 import cn.fw.security.auth.client.annotation.IgnoreUserToken;
8 9 import cn.fw.security.auth.client.enums.AuthType;
9   -import cn.fw.valhalla.domain.dto.CustomerDetailDto;
10 10 import cn.fw.valhalla.sdk.param.CustomerQueryReq;
11 11 import cn.fw.valhalla.service.bus.cust.CustomerBizService;
12 12 import lombok.RequiredArgsConstructor;
13 13 import lombok.extern.slf4j.Slf4j;
14 14 import org.springframework.validation.annotation.Validated;
15 15 import org.springframework.web.bind.annotation.GetMapping;
16   -import org.springframework.web.bind.annotation.RequestBody;
17 16 import org.springframework.web.bind.annotation.RequestMapping;
18 17 import org.springframework.web.bind.annotation.RestController;
19 18  
20 19 import javax.validation.Valid;
21   -import java.util.List;
22 20  
23 21 import static cn.fw.common.web.util.ResultBuilder.success;
24 22  
... ... @@ -39,9 +37,10 @@ public class ERPCommonController {
39 37  
40 38  
41 39 @GetMapping("/condition/count")
42   - @IgnoreAuth
  40 + @IgnoreUserToken
43 41 @ControllerMethod("查询满足条件的档案数量")
44   - public Message<Number> conditionCustomerCount(@Valid CustomerQueryReq customerQueryReq) {
  42 + public Message<Number> conditionCustomerCount(@CurrentUser LoginAuthBean currentUser, @Valid CustomerQueryReq customerQueryReq) {
  43 + customerQueryReq.setGroupId(currentUser.getGroupId());
45 44 return success(customerBizService.queryCustomCount(customerQueryReq));
46 45 }
47 46 }
... ...
fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/cust/CustomerBizService.java
... ... @@ -811,6 +811,7 @@ public class CustomerBizService extends AbstractCustomerService {
811 811 }
812 812  
813 813 private CustomCustomerQuery fillParams(final CustomerQueryReq queryReq) {
  814 + BV.notNull(queryReq.getGroupId(), () -> "集团id不能为空");
814 815 CustomCustomerQuery query = new CustomCustomerQuery();
815 816 BeanUtils.copyProperties(queryReq, query);
816 817  
... ...