v1.0.30
This commit is contained in:
+12
-3
@@ -71,10 +71,19 @@ public class GaoCustomerPackageController {
|
||||
if (result.getList().isEmpty()) {
|
||||
return result;
|
||||
}
|
||||
fillTransient(result.getList());
|
||||
Map<String, GaoCustomer> customerMap = customerService.mapByIdList(result.getList().stream().map(GaoCustomerPackage::getCustomerId).toList());
|
||||
List<String> customerIdList = result.getList().stream()
|
||||
.map(GaoCustomerPackage::getCustomerId)
|
||||
.filter(value -> value != null && !value.isBlank())
|
||||
.distinct()
|
||||
.toList();
|
||||
Map<String, GaoCustomer> customerMap = customerService.mapByIdList(customerIdList);
|
||||
Map<String, List<Attachment>> attachmentMap = attachmentService.mapByBizIdList(Attachment.BizType.GAO_CUSTOMER, customerIdList, GaoCustomer.AttachType.PHOTO.name());
|
||||
for (GaoCustomerPackage packageEntity : result.getList()) {
|
||||
packageEntity.setCustomer(customerMap.get(packageEntity.getCustomerId()));
|
||||
GaoCustomer customer = customerMap.get(packageEntity.getCustomerId());
|
||||
if (customer != null) {
|
||||
customer.setAttachmentList(attachmentMap.get(customer.getId()));
|
||||
}
|
||||
packageEntity.setCustomer(customer);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user