gongchunyi
5 天以前 ff61feb990cbe2a7be5b790566b3aff9f16005e5
src/main/java/com/ruoyi/basic/service/impl/CustomerServiceImpl.java
@@ -86,32 +86,34 @@
        BeanUtils.copyProperties(customer, dto);
        // 查询跟进记录
        List<CustomerFollowUp> followUpList = customerFollowUpService.list(
                new LambdaQueryWrapper<CustomerFollowUp>()
                        .eq(CustomerFollowUp::getCustomerId, id)
                        .orderByDesc(CustomerFollowUp::getFollowUpTime)
        );
        if (!CollectionUtils.isEmpty(followUpList)) {
            List<CustomerFollowUpDto> followUpDtoList = followUpList.stream().map(followUp -> {
                CustomerFollowUpDto followUpDto = new CustomerFollowUpDto();
                BeanUtils.copyProperties(followUp, followUpDto);
                // 查询附件
                List<CustomerFollowUpFile> fileList = customerFollowUpFileService.list(
                        new LambdaQueryWrapper<CustomerFollowUpFile>()
                                .eq(CustomerFollowUpFile::getFollowUpId, followUp.getId())
                );
                followUpDto.setFileList(fileList);
                return followUpDto;
            }).collect(Collectors.toList());
            dto.setFollowUpList(followUpDtoList);
        }
//        List<CustomerFollowUp> followUpList = customerFollowUpService.list(
//                new LambdaQueryWrapper<CustomerFollowUp>()
//                        .eq(CustomerFollowUp::getCustomerId, id)
//                        .orderByDesc(CustomerFollowUp::getFollowUpTime)
//        );
//
//        if (!CollectionUtils.isEmpty(followUpList)) {
//            List<CustomerFollowUpDto> followUpDtoList = followUpList.stream().map(followUp -> {
//                CustomerFollowUpDto followUpDto = new CustomerFollowUpDto();
//                BeanUtils.copyProperties(followUp, followUpDto);
//
//                // 查询附件
//                List<CustomerFollowUpFile> fileList = customerFollowUpFileService.list(
//                        new LambdaQueryWrapper<CustomerFollowUpFile>()
//                                .eq(CustomerFollowUpFile::getFollowUpId, followUp.getId())
//                );
//                followUpDto.setFileList(fileList);
//
//                return followUpDto;
//            }).collect(Collectors.toList());
//
//            dto.setFollowUpList(followUpDtoList);
//        }
        //  地区名称
        CustomerRegions customerRegions = customerRegionsService.getById(customer.getRegionsId());
        dto.setRegionsName(customerRegions.getRegionsName());
        if (customerRegions != null) {
            dto.setRegionsName(customerRegions.getRegionsName());
        }
        return dto;
    }