修改查询台站监测数据接口
This commit is contained in:
parent
1efaa6fe36
commit
4c59719321
|
@ -54,8 +54,8 @@ public class StationOperationController {
|
||||||
|
|
||||||
@GetMapping("getDataReceivingStatus")
|
@GetMapping("getDataReceivingStatus")
|
||||||
@ApiOperation(value = "查询台站监测数据信息", notes = "查询台站监测数据信息")
|
@ApiOperation(value = "查询台站监测数据信息", notes = "查询台站监测数据信息")
|
||||||
public void getDataReceivingStatus(List<String> stationIds){
|
public void getDataReceivingStatus(String userId){
|
||||||
stationOperationService.getDataReceivingStatus(stationIds);
|
stationOperationService.getDataReceivingStatus(userId);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,9 +41,9 @@ public interface IStationOperationService extends IService<StationOperation> {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询台站监测数据
|
* 查询台站监测数据
|
||||||
* @param stationIds
|
* @param userId
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
Result getDataReceivingStatus(List<String> stationIds);
|
Result getDataReceivingStatus(String userId);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package org.jeecg.modules.service.impl;
|
package org.jeecg.modules.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
@ -15,14 +16,11 @@ import org.jeecg.modules.base.entity.GardsMetData;
|
||||||
import org.jeecg.modules.base.entity.GardsSampleData;
|
import org.jeecg.modules.base.entity.GardsSampleData;
|
||||||
import org.jeecg.modules.base.entity.GardsSohData;
|
import org.jeecg.modules.base.entity.GardsSohData;
|
||||||
import org.jeecg.modules.entity.*;
|
import org.jeecg.modules.entity.*;
|
||||||
import org.jeecg.modules.mapper.StationMetDataMapper;
|
import org.jeecg.modules.mapper.*;
|
||||||
import org.jeecg.modules.mapper.StationSampleDataMapper;
|
|
||||||
import org.jeecg.modules.mapper.StationSohDataMapper;
|
|
||||||
import org.jeecg.modules.service.ICacheTimeService;
|
import org.jeecg.modules.service.ICacheTimeService;
|
||||||
import org.jeecg.modules.system.entity.GardsDetectors;
|
import org.jeecg.modules.system.entity.GardsDetectors;
|
||||||
import org.jeecg.modules.system.entity.GardsNuclearfacility;
|
import org.jeecg.modules.system.entity.GardsNuclearfacility;
|
||||||
import org.jeecg.modules.system.entity.GardsStations;
|
import org.jeecg.modules.system.entity.GardsStations;
|
||||||
import org.jeecg.modules.mapper.StationOperationMapper;
|
|
||||||
import org.jeecg.modules.service.IStationOperationService;
|
import org.jeecg.modules.service.IStationOperationService;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
@ -47,6 +45,8 @@ public class StationOperationServiceImpl extends ServiceImpl<StationOperationMap
|
||||||
private StationSohDataMapper stationSohDataMapper;
|
private StationSohDataMapper stationSohDataMapper;
|
||||||
@Autowired
|
@Autowired
|
||||||
private StationMetDataMapper stationMetDataMapper;
|
private StationMetDataMapper stationMetDataMapper;
|
||||||
|
@Autowired
|
||||||
|
private SysUserFocusStationMapper sysUserFocusStationMapper;
|
||||||
|
|
||||||
private final SpatialContext spatialContext = SpatialContext.GEO;
|
private final SpatialContext spatialContext = SpatialContext.GEO;
|
||||||
|
|
||||||
|
@ -315,7 +315,7 @@ public class StationOperationServiceImpl extends ServiceImpl<StationOperationMap
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Result getDataReceivingStatus(List<String> stationIds) {
|
public Result getDataReceivingStatus(String userId) {
|
||||||
Result result = new Result();
|
Result result = new Result();
|
||||||
//获取四项缓存数据的对应内容
|
//获取四项缓存数据的对应内容
|
||||||
List<Map<String, String>> cacheList = cacheTimeService.findCacheTime();
|
List<Map<String, String>> cacheList = cacheTimeService.findCacheTime();
|
||||||
|
@ -331,6 +331,11 @@ public class StationOperationServiceImpl extends ServiceImpl<StationOperationMap
|
||||||
result.error500("缓存时间不能为空");
|
result.error500("缓存时间不能为空");
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
//根据用户id查询出当前用户关注的台站信息
|
||||||
|
LambdaQueryWrapper<SysUserFocusStation> userFocusStationQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
userFocusStationQueryWrapper.eq(SysUserFocusStation::getUserId, userId);
|
||||||
|
List<SysUserFocusStation> userFocusStations = sysUserFocusStationMapper.selectList(userFocusStationQueryWrapper);
|
||||||
|
List<String> stationIds = userFocusStations.stream().map(SysUserFocusStation::getStationId).collect(Collectors.toList());
|
||||||
//从redis中获取台站信息
|
//从redis中获取台站信息
|
||||||
Map<Integer, String> stationInfoMap = (Map<Integer, String>)redisUtil.get("stationMap");
|
Map<Integer, String> stationInfoMap = (Map<Integer, String>)redisUtil.get("stationMap");
|
||||||
//从redis中获取探测器信息
|
//从redis中获取探测器信息
|
||||||
|
|
Loading…
Reference in New Issue
Block a user