| | |
| | | import com.aliyuncs.iot.model.v20180120.BatchGetDeviceStateResponse; |
| | | import com.aliyuncs.iot.model.v20180120.QueryDeviceDetailResponse; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.github.pagehelper.PageHelper; |
| | | import com.sandu.common.execption.BusinessException; |
| | | import com.sandu.common.redis.RedisService; |
| | | import com.sandu.common.service.impl.BaseServiceImpl; |
| | |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | |
| | | * |
| | | * @return |
| | | */ |
| | | public List<Pole> queryStatesAndList() { |
| | | public List<Pole> queryStatesAndList(Integer pageNo,Integer pageSize) { |
| | | // List<LampPost> list = list(Wrappers.lambdaQuery(LampPost.class).eq(LampPost::getClientId, SecurityUtils.getUserId())); |
| | | //List<Pole> list = list(Wrappers.lambdaQuery(Pole.class)); |
| | | PageHelper.startPage(pageNo,pageSize); |
| | | List<Pole> list = new ArrayList<>(); |
| | | if (SecurityUtils.getClientId() == null) { |
| | | list = list(Wrappers.lambdaQuery(Pole.class)); |
| | |
| | | if(CollectionUtil.isEmpty(poleIdList)){ |
| | | return null; |
| | | } |
| | | return list(Wrappers.lambdaQuery(Pole.class).in(Pole::getId, poleIdList).select(Pole::getDeviceCode)) |
| | | .stream().map(Pole::getDeviceCode).filter(StrUtil::isNotEmpty).collect(Collectors.toList()); |
| | | List<Pole> list = list(Wrappers.lambdaQuery(Pole.class).in(Pole::getId, poleIdList).select(Pole::getDeviceCode)); |
| | | return list |
| | | .stream().filter(Objects::nonNull).map(Pole::getDeviceCode).filter(StrUtil::isNotEmpty).collect(Collectors.toList()); |
| | | } |
| | | |
| | | /** |