| | |
| | | package com.moral.api.service.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; |
| | | import com.moral.api.entity.Device; |
| | |
| | | import com.moral.pojo.AQI; |
| | | import com.moral.util.AQIUtils; |
| | | import com.moral.util.RegionCodeUtils; |
| | | import com.moral.util.TokenUtils; |
| | | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.redis.core.RedisTemplate; |
| | |
| | | .in("city_code", cityCodes); |
| | | return govMonitorPointMapper.selectMaps(govMonitorPointQueryWrapper); |
| | | } |
| | | |
| | | /** |
| | | * 获取国控站信息 |
| | | * |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<GovMonitorPoint> selectPoint() { |
| | | Map<String, Object> userInfo = (Map<String, Object>) TokenUtils.getUserInfo(); |
| | | Map<String, Object> orgInfo = (Map<String, Object>) userInfo.get("organization"); |
| | | Integer orId =(Integer) orgInfo.get("id"); |
| | | Integer code = null; |
| | | LambdaQueryWrapper<GovMonitorPoint> wrapper = new LambdaQueryWrapper<>(); |
| | | wrapper.select(GovMonitorPoint::getGuid,GovMonitorPoint::getLatitude,GovMonitorPoint::getLongitude,GovMonitorPoint::getName); |
| | | if (orId!=24){ |
| | | code = (Integer) orgInfo.get("locationLevelCode"); |
| | | wrapper.eq(GovMonitorPoint::getAreaCode,code); |
| | | } |
| | | wrapper.eq(GovMonitorPoint::getIsDelete,Constants.NOT_DELETE); |
| | | |
| | | List<GovMonitorPoint> govMonitorPoints = govMonitorPointMapper.selectList(wrapper); |
| | | return govMonitorPoints; |
| | | } |
| | | } |