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