关注台站实体类增加经纬度相关返回数据
This commit is contained in:
parent
1f54fa41a7
commit
61ee437052
|
@ -39,4 +39,10 @@ public class SysUserFocusStation implements Serializable {
|
||||||
@TableField(value = "create_by")
|
@TableField(value = "create_by")
|
||||||
private String createBy;
|
private String createBy;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
private Double lon;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
private Double lat;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,32 +6,44 @@ import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import org.jeecg.common.api.vo.Result;
|
import org.jeecg.common.api.vo.Result;
|
||||||
import org.jeecg.common.system.util.JwtUtil;
|
import org.jeecg.common.system.util.JwtUtil;
|
||||||
|
import org.jeecg.common.util.RedisUtil;
|
||||||
import org.jeecg.common.util.SpringContextUtils;
|
import org.jeecg.common.util.SpringContextUtils;
|
||||||
import org.jeecg.modules.entity.SysUser;
|
import org.jeecg.modules.entity.SysUser;
|
||||||
import org.jeecg.modules.entity.SysUserFocusStation;
|
import org.jeecg.modules.entity.SysUserFocusStation;
|
||||||
import org.jeecg.modules.mapper.SysUserFocusStationMapper;
|
import org.jeecg.modules.mapper.SysUserFocusStationMapper;
|
||||||
import org.jeecg.modules.mapper.SysUserMapper;
|
import org.jeecg.modules.mapper.SysUserMapper;
|
||||||
import org.jeecg.modules.service.ISysUserFocusStationService;
|
import org.jeecg.modules.service.ISysUserFocusStationService;
|
||||||
|
import org.jeecg.modules.system.entity.GardsStations;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import java.util.Collections;
|
import java.util.*;
|
||||||
import java.util.Date;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Objects;
|
|
||||||
|
|
||||||
@Service("sysUserFocusStationService")
|
@Service("sysUserFocusStationService")
|
||||||
public class SysUserFocusStationServiceImpl extends ServiceImpl<SysUserFocusStationMapper, SysUserFocusStation> implements ISysUserFocusStationService {
|
public class SysUserFocusStationServiceImpl extends ServiceImpl<SysUserFocusStationMapper, SysUserFocusStation> implements ISysUserFocusStationService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private RedisUtil redisUtil;
|
||||||
@Autowired
|
@Autowired
|
||||||
private SysUserMapper sysUserMapper;
|
private SysUserMapper sysUserMapper;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<SysUserFocusStation> findList() {
|
public List<SysUserFocusStation> findList() {
|
||||||
|
//查询全部台站信息
|
||||||
|
HashMap<String, Object> stationInfoMap = (HashMap<String, Object>) redisUtil.get("stationInfoMap");
|
||||||
List<SysUserFocusStation> sysUserFocusStations = this.baseMapper.selectList(new LambdaQueryWrapper<>());
|
List<SysUserFocusStation> sysUserFocusStations = this.baseMapper.selectList(new LambdaQueryWrapper<>());
|
||||||
if (CollectionUtils.isNotEmpty(sysUserFocusStations)){
|
if (CollectionUtils.isNotEmpty(sysUserFocusStations)){
|
||||||
|
sysUserFocusStations.stream().forEach(item->{
|
||||||
|
if (CollectionUtils.isNotEmpty(stationInfoMap)){
|
||||||
|
if (Objects.nonNull(stationInfoMap.get(item.getStationId()))){
|
||||||
|
GardsStations stations = (GardsStations) stationInfoMap.get(item.getStationId());
|
||||||
|
item.setLon(stations.getLon());
|
||||||
|
item.setLat(stations.getLat());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
return sysUserFocusStations;
|
return sysUserFocusStations;
|
||||||
}
|
}
|
||||||
return Collections.emptyList();
|
return Collections.emptyList();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user