查询DATA BASE页面缓慢问题修改
This commit is contained in:
parent
8a45bf0241
commit
18f8173a04
|
@ -28,20 +28,15 @@ import java.util.Objects;
|
||||||
@Service("gardsSampleDataService")
|
@Service("gardsSampleDataService")
|
||||||
@DS("ori")
|
@DS("ori")
|
||||||
public class GardsSampleDataServiceImpl extends ServiceImpl<GardsSampleDataMapper, GardsSampleData> implements IGardsSampleDataService {
|
public class GardsSampleDataServiceImpl extends ServiceImpl<GardsSampleDataMapper, GardsSampleData> implements IGardsSampleDataService {
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private IGardsStationsService gardsStationsService;
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private RedisUtil redisUtil;
|
private RedisUtil redisUtil;
|
||||||
@Autowired
|
|
||||||
private IGardsDetectorsService gardsDetectorsService;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Result<IPage<GardsSampleData>> findPage(QueryRequest queryRequest, GardsSampleData gardsSampleData) {
|
public Result<IPage<GardsSampleData>> findPage(QueryRequest queryRequest, GardsSampleData gardsSampleData) {
|
||||||
//查询全部台站信息
|
//查询全部台站信息
|
||||||
HashMap<Integer, String> stationMap = (HashMap<Integer, String>) redisUtil.get("stationMap");
|
HashMap<Integer, String> stationMap = (HashMap<Integer, String>) redisUtil.get("stationMap");
|
||||||
//查询全部监测器信息
|
//查询全部监测器信息
|
||||||
List<GardsDetectors> detectors = gardsDetectorsService.findDetectors();
|
HashMap<Integer, String> detectorsMap = (HashMap<Integer, String>) redisUtil.get("detectorsMap");
|
||||||
Result<IPage<GardsSampleData>> result = new Result<>();
|
Result<IPage<GardsSampleData>> result = new Result<>();
|
||||||
Page<GardsSampleData> page = new Page<>(queryRequest.getPageNo(), queryRequest.getPageSize());
|
Page<GardsSampleData> page = new Page<>(queryRequest.getPageNo(), queryRequest.getPageSize());
|
||||||
LambdaQueryWrapper<GardsSampleData> queryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<GardsSampleData> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
@ -58,11 +53,10 @@ public class GardsSampleDataServiceImpl extends ServiceImpl<GardsSampleDataMappe
|
||||||
item.setStationName(stationValue);
|
item.setStationName(stationValue);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (CollectionUtils.isNotEmpty(detectors)){
|
if (CollectionUtils.isNotEmpty(detectorsMap)){
|
||||||
for (GardsDetectors detector:detectors) {
|
String detectorValue = detectorsMap.get(item.getDetectorId());
|
||||||
if (detector.getDetectorId().equals(item.getDetectorId())){
|
if (StringUtils.isNotBlank(detectorValue)){
|
||||||
item.setDetectorsName(detector.getDetectorCode());
|
item.setDetectorsName(detectorValue);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue
Block a user