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.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<CustomerListResp> selectList(CustomerListReq req) {
@ -63,14 +64,13 @@ public class OrderPayCustomerServiceImpl
*/
@Override
public List<String> getCustomerAllList() {
List<String> nacosServerAllList = orderPayCustomerService.getCustomerAllList();
List<String> nacosServerAllList = nacosServerService.nacosServerAllList();
LambdaQueryWrapper<OrderPayCustomer> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.select(OrderPayCustomer::getAppCode);
List<OrderPayCustomer> orderPayCustomerList = this.list(queryWrapper);
Set<String> collect = orderPayCustomerList.stream().map(OrderPayCustomer::getAppCode).collect(Collectors.toSet());
List<OrderPayCustomer> list = this.list(queryWrapper);
Set<String> 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();
}
}