gaoluyang
17 小时以前 4ef87a2398db569291f8aa665e4d18050e94a090
yudao-module-crm/src/main/java/cn/iocoder/yudao/module/crm/controller/admin/contact/CrmContactController.java
@@ -114,6 +114,17 @@
                        .setCustomerId(contact.getCustomerId())));
    }
    @GetMapping("/list-by-customer")
    @Operation(summary = "获得联系人列表,基于指定客户")
    @Parameter(name = "customerId", description = "客户编号", required = true)
    @PreAuthorize("@ss.hasPermission('crm:contact:query')")
    public CommonResult<List<CrmContactRespVO>> getContactListByCustomer(@RequestParam("customerId") Long customerId) {
        List<CrmContactDO> list = contactService.getContactListByCustomerId(customerId);
        return success(convertList(list, contact -> // 只返回 id、name 字段
                new CrmContactRespVO().setId(contact.getId()).setName(contact.getName())
                        .setCustomerId(contact.getCustomerId())));
    }
    @GetMapping("/page")
    @Operation(summary = "获得联系人分页")
    @PreAuthorize("@ss.hasPermission('crm:contact:query')")
@@ -144,7 +155,7 @@
    @ApiAccessLog(operateType = EXPORT)
    public void exportContactExcel(@Valid CrmContactPageReqVO exportReqVO,
                                   HttpServletResponse response) throws IOException {
        exportReqVO.setPageNo(PAGE_SIZE_NONE);
        exportReqVO.setPageSize(PAGE_SIZE_NONE); // 不分页,导出全部符合条件的联系人
        List<CrmContactDO> list = contactService.getContactPage(exportReqVO, getLoginUserId()).getList();
        ExcelUtils.write(response, "联系人.xls", "数据", CrmContactRespVO.class, buildContactDetailList(list));
    }