2021与蓝度共同重构项目,服务端
chenjiantian
2022-01-07 5c2e09dff916aa5957a4824bba7710c42df38123
ximon-admin/src/main/java/com/sandu/ximon/admin/service/PoleService.java
@@ -5,6 +5,7 @@
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;
@@ -39,6 +40,7 @@
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
/**
@@ -108,9 +110,10 @@
     *
     * @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));
@@ -287,8 +290,9 @@
        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());
    }
    /**