云
9 小时以前 d17024670efca145ff97bc26913bfd9b0fef2cd0
yudao-module-crm/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/customer/CrmCustomerController.java
@@ -114,6 +114,15 @@
        return success(buildCustomerDetail(customer));
    }
    @GetMapping("/business-get")
    @Operation(summary = "获得业务模块关联客户详情")
    @PreAuthorize("isAuthenticated()")
    public CommonResult<CrmCustomerRespVO> getBusinessCustomer(@RequestParam("id") Long id) {
        CrmCustomerDO customer = customerService.getCustomerList(java.util.Collections.singleton(id))
                .stream().findFirst().orElse(null);
        return success(buildCustomerDetail(customer));
    }
    public CrmCustomerRespVO buildCustomerDetail(CrmCustomerDO customer) {
        if (customer == null) {
            return null;
@@ -134,6 +143,18 @@
        return success(new PageResult<>(buildCustomerDetailList(pageResult.getList()), pageResult.getTotal()));
    }
    @GetMapping("/business-page")
    @Operation(summary = "获得业务模块客户分页")
    @PreAuthorize("isAuthenticated()")
    public CommonResult<PageResult<CrmCustomerRespVO>> getBusinessCustomerPage(
            @Valid CrmCustomerPageReqVO pageVO) {
        PageResult<CrmCustomerDO> pageResult = customerService.getBusinessCustomerPage(pageVO);
        if (CollUtil.isEmpty(pageResult.getList())) {
            return success(PageResult.empty(pageResult.getTotal()));
        }
        return success(new PageResult<>(buildCustomerDetailList(pageResult.getList()), pageResult.getTotal()));
    }
    public List<CrmCustomerRespVO> buildCustomerDetailList(List<CrmCustomerDO> list) {
        if (CollUtil.isEmpty(list)) {
            return java.util.Collections.emptyList();