add 根据数据中心查询虚拟机

develop
bayuzhen 2024-11-06 16:18:47 +08:00
parent 28696b3a6d
commit c3599c76d5
1 changed files with 6 additions and 3 deletions

View File

@ -70,6 +70,7 @@ import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.Assert;
import org.springframework.util.CollectionUtils;
import java.util.*;
import java.util.stream.Collectors;
@ -315,9 +316,11 @@ public class CloudServerServiceImpl implements CloudServerService {
paramMap.remove("dcId");
// 查询相应云平台
List<CloudVendor> cloudVendors = cloudVendorRepository.getByDcId(dcId);
String ids = cloudVendors.stream().map(CloudVendor::getId).map(item -> String.valueOf(item)).collect(Collectors.joining(","));
paramMap.put("vendorId", ids);
param.setSign(Sign.IN);
if (!CollectionUtils.isEmpty(cloudVendors)) {
String ids = cloudVendors.stream().map(CloudVendor::getId).map(item -> String.valueOf(item)).collect(Collectors.joining(","));
paramMap.put("vendorId", ids);
param.setSign(Sign.IN);
}
}
}
int total = 0;