| | |
| | | @GetMapping("/get") |
| | | @Operation(summary = "获得联系人") |
| | | @Parameter(name = "id", description = "编号", required = true, example = "1024") |
| | | @PreAuthorize("@ss.hasPermission('crm:contact:query')") |
| | | public CommonResult<CrmContactRespVO> getContact(@RequestParam("id") Long id) { |
| | | CrmContactDO contact = contactService.getContact(id); |
| | | return success(buildContactDetail(contact)); |
| | |
| | | |
| | | @GetMapping("/simple-all-list") |
| | | @Operation(summary = "获得联系人的精简列表") |
| | | @PreAuthorize("@ss.hasPermission('crm:contact:query')") |
| | | public CommonResult<List<CrmContactRespVO>> getSimpleContactList() { |
| | | List<CrmContactDO> list = contactService.getContactList(getLoginUserId()); |
| | | return success(convertList(list, contact -> // 只返回 id、name 字段 |
| | |
| | | @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 字段 |
| | |
| | | |
| | | @GetMapping("/page") |
| | | @Operation(summary = "获得联系人分页") |
| | | @PreAuthorize("@ss.hasPermission('crm:contact:query')") |
| | | public CommonResult<PageResult<CrmContactRespVO>> getContactPage(@Valid CrmContactPageReqVO pageVO) { |
| | | PageResult<CrmContactDO> pageResult = contactService.getContactPage(pageVO, getLoginUserId()); |
| | | return success(new PageResult<>(buildContactDetailList(pageResult.getList()), pageResult.getTotal())); |
| | |
| | | @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)); |
| | | } |