master
张腾 2024-08-09 22:09:55 +08:00
parent f24d0c73d6
commit e0c54bbea6
1 changed files with 9 additions and 9 deletions

View File

@ -8,10 +8,12 @@ import com.muyu.cloud.pay.domain.resp.CustomerListResp;
import com.muyu.cloud.pay.mapper.OrderPayCustomerMapper; import com.muyu.cloud.pay.mapper.OrderPayCustomerMapper;
import com.muyu.cloud.pay.service.OrderPayCustomerService; import com.muyu.cloud.pay.service.OrderPayCustomerService;
import com.muyu.common.core.utils.StringUtils; import com.muyu.common.core.utils.StringUtils;
import com.muyu.common.nacos.service.NacosServerService;
import lombok.extern.log4j.Log4j2; import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;
@ -32,9 +34,8 @@ public class OrderPayCustomerServiceImpl
implements OrderPayCustomerService { implements OrderPayCustomerService {
@Autowired @Resource
private OrderPayCustomerService orderPayCustomerService; private NacosServerService nacosServerService;
@Override @Override
public List<CustomerListResp> selectList(CustomerListReq req) { public List<CustomerListResp> selectList(CustomerListReq req) {
@ -63,14 +64,13 @@ public class OrderPayCustomerServiceImpl
*/ */
@Override @Override
public List<String> getCustomerAllList() { public List<String> getCustomerAllList() {
List<String> nacosServerAllList = orderPayCustomerService.getCustomerAllList(); List<String> nacosServerAllList = nacosServerService.nacosServerAllList();
LambdaQueryWrapper<OrderPayCustomer> queryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<OrderPayCustomer> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.select(OrderPayCustomer::getAppCode); queryWrapper.select(OrderPayCustomer::getAppCode);
List<OrderPayCustomer> orderPayCustomerList = this.list(queryWrapper); List<OrderPayCustomer> list = this.list(queryWrapper);
Set<String> collect = orderPayCustomerList.stream().map(OrderPayCustomer::getAppCode).collect(Collectors.toSet()); Set<String> customerSet = list.stream().map(OrderPayCustomer::getAppCode).collect(Collectors.toSet());
return nacosServerAllList.stream() return nacosServerAllList.stream()
.filter(nacosServer -> !collect.contains(nacosServer)) .filter(nacosServer -> !customerSet.contains(nacosServer))
.collect(Collectors.toList()); .toList();
} }
} }