| | |
| | | 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; |
| | |
| | | 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(); |