diff --git a/fw-valhalla-dao/src/main/java/cn/fw/valhalla/dao/mapper/CustomerMapper.java b/fw-valhalla-dao/src/main/java/cn/fw/valhalla/dao/mapper/CustomerMapper.java index 01b1f14..788fbbf 100644 --- a/fw-valhalla-dao/src/main/java/cn/fw/valhalla/dao/mapper/CustomerMapper.java +++ b/fw-valhalla-dao/src/main/java/cn/fw/valhalla/dao/mapper/CustomerMapper.java @@ -46,4 +46,11 @@ public interface CustomerMapper extends BaseMapper { * @return */ List queryCustomList(@Param("condition") CustomCustomerQuery query); + /** + * 查询自定义参数的档案数量 + * + * @param query + * @return + */ + Long queryCustomCount(@Param("condition") CustomCustomerQuery query); } diff --git a/fw-valhalla-dao/src/main/resources/mapper/CustomerMapper.xml b/fw-valhalla-dao/src/main/resources/mapper/CustomerMapper.xml index c53e2f7..573a129 100644 --- a/fw-valhalla-dao/src/main/resources/mapper/CustomerMapper.xml +++ b/fw-valhalla-dao/src/main/resources/mapper/CustomerMapper.xml @@ -226,4 +226,95 @@ ) + + 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 5406704..28b8a1b 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 @@ -89,6 +89,10 @@ public class CustomerQueryReq implements Serializable { this.followType = followType; } + public void setType(Integer type) { + this.followType = CustomerFollowTypeEnum.ofValue(type); + } + public Integer[] getArrivalMileage() { return arrivalMileage; } diff --git a/fw-valhalla-server/src/main/java/cn/fw/valhalla/controller/erp/CustomerController.java b/fw-valhalla-server/src/main/java/cn/fw/valhalla/controller/erp/ERPCommonController.java index 86b2835..26c7b9d 100644 --- a/fw-valhalla-server/src/main/java/cn/fw/valhalla/controller/erp/CustomerController.java +++ b/fw-valhalla-server/src/main/java/cn/fw/valhalla/controller/erp/ERPCommonController.java @@ -3,6 +3,7 @@ package cn.fw.valhalla.controller.erp; import cn.fw.common.web.annotation.ControllerMethod; 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; @@ -33,15 +34,14 @@ import static cn.fw.common.web.util.ResultBuilder.success; @Authorization(AuthType.ERP) @RequiredArgsConstructor @RequestMapping("/erp/customer") -public class CustomerController { +public class ERPCommonController { private final CustomerBizService customerBizService; @GetMapping("/condition/count") - @IgnoreUserToken + @IgnoreAuth @ControllerMethod("查询满足条件的档案数量") - public Message conditionCustomerCount(@Valid @RequestBody CustomerQueryReq customerQueryReq) { - List list = customerBizService.queryCustomList(customerQueryReq); - return success(list.size()); + public Message conditionCustomerCount(@Valid CustomerQueryReq customerQueryReq) { + 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 a0fb6bb..f0cd4bc 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 @@ -358,13 +358,22 @@ public class CustomerBizService extends AbstractCustomerService { * @return */ public List queryCustomList(final CustomerQueryReq queryReq) { - CustomCustomerQuery query = fillParams(queryReq); - return customerService.queryCustomList(query); } /** + * 根据自定义条件查询保有客档案数量 + * + * @param queryReq + * @return + */ + public Long queryCustomCount(final CustomerQueryReq queryReq) { + CustomCustomerQuery query = fillParams(queryReq); + return customerService.queryCustomListCount(query); + } + + /** * 根据手机号查询所有档案 * * @param mobile diff --git a/fw-valhalla-service/src/main/java/cn/fw/valhalla/service/data/CustomerService.java b/fw-valhalla-service/src/main/java/cn/fw/valhalla/service/data/CustomerService.java index ab885dd..30bdd62 100644 --- a/fw-valhalla-service/src/main/java/cn/fw/valhalla/service/data/CustomerService.java +++ b/fw-valhalla-service/src/main/java/cn/fw/valhalla/service/data/CustomerService.java @@ -120,4 +120,11 @@ public interface CustomerService extends IService { * @return */ List queryCustomList(CustomCustomerQuery query); + + /** + * 查询自定义参数的档案数量 + * @param query + * @return + */ + Long queryCustomListCount(CustomCustomerQuery query); } diff --git a/fw-valhalla-service/src/main/java/cn/fw/valhalla/service/data/impl/CustomerServiceImpl.java b/fw-valhalla-service/src/main/java/cn/fw/valhalla/service/data/impl/CustomerServiceImpl.java index d1987e2..0377cb7 100644 --- a/fw-valhalla-service/src/main/java/cn/fw/valhalla/service/data/impl/CustomerServiceImpl.java +++ b/fw-valhalla-service/src/main/java/cn/fw/valhalla/service/data/impl/CustomerServiceImpl.java @@ -125,4 +125,9 @@ public class CustomerServiceImpl extends ServiceImpl i public List queryCustomList(CustomCustomerQuery query) { return Optional.ofNullable(getBaseMapper().queryCustomList(query)).orElse(new ArrayList<>()); } + + @Override + public Long queryCustomListCount(CustomCustomerQuery query) { + return Optional.ofNullable(getBaseMapper().queryCustomCount(query)).orElse(0L); + } }