配置文件中新增台站类型名称,台站类型判断最小id,台站类型判断最大id
新增实体类接收台站类型配置文件数组信息 新增查询台站,核设施类型接口 查询台站,核设施信息接口增加根据台站类型过滤数据
This commit is contained in:
parent
e8d369c46c
commit
12d586c7c3
|
@ -1,17 +1,36 @@
|
||||||
package org.jeecg.common;
|
package org.jeecg.common;
|
||||||
|
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.jeecg.modules.entity.StationType;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
@Component
|
||||||
public class StationTypeUtil {
|
public class StationTypeUtil {
|
||||||
|
|
||||||
public static String getStationType(Integer stationId){
|
@Autowired
|
||||||
String stationType = "";
|
private StationType stationType;
|
||||||
if (stationId<=200){
|
|
||||||
stationType = "IMS STATION(P)";
|
public List<String> findAllStationType(){
|
||||||
}else if(stationId>200 && stationId<=300){
|
List<StationType> stationTypeList = stationType.getTypes();
|
||||||
stationType = "IMS STATION(G)";
|
List<String> stationTypes = stationTypeList.stream().map(StationType::getName).collect(Collectors.toList());
|
||||||
}else if(stationId>300){
|
return stationTypes;
|
||||||
stationType = "NRL";
|
}
|
||||||
|
|
||||||
|
public String getStationType(Integer stationId){
|
||||||
|
String type = "";
|
||||||
|
List<StationType> stationTypeList = stationType.getTypes();
|
||||||
|
for (StationType stationType:stationTypeList) {
|
||||||
|
if (StringUtils.isNotBlank(stationType.getMinId()) && StringUtils.isNotBlank(stationType.getMaxId())){
|
||||||
|
if (stationId>Integer.valueOf(stationType.getMinId()) && stationId<=Integer.valueOf(stationType.getMaxId())){
|
||||||
|
type = stationType.getName();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return stationType;
|
return type;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,10 +24,17 @@ public class StationOperationController {
|
||||||
@Autowired
|
@Autowired
|
||||||
private IStationOperationService stationOperationService;
|
private IStationOperationService stationOperationService;
|
||||||
|
|
||||||
|
@GetMapping("findStationType")
|
||||||
|
@ApiOperation(value = "查询台站,核设施类型", notes = "查询台站,核设施类型")
|
||||||
|
public List<String> findStationType(){
|
||||||
|
List<String> result = stationOperationService.findStationType();
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
@GetMapping("findList")
|
@GetMapping("findList")
|
||||||
@ApiOperation(value = "查询所有台站,核设施信息", notes = "查询所有台站,核设施信息")
|
@ApiOperation(value = "查询所有台站,核设施信息", notes = "查询所有台站,核设施信息")
|
||||||
public List<StationOperation> findList(String status){
|
public List<StationOperation> findList(String status, String stationType){
|
||||||
List<StationOperation> result = stationOperationService.findList(status);
|
List<StationOperation> result = stationOperationService.findList(status, stationType);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,24 @@
|
||||||
|
package org.jeecg.modules.entity;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Component
|
||||||
|
@ConfigurationProperties(prefix = "station")
|
||||||
|
public class StationType implements Serializable {
|
||||||
|
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
private String minId;
|
||||||
|
|
||||||
|
private String maxId;
|
||||||
|
|
||||||
|
private List<StationType> types = new ArrayList<>();
|
||||||
|
|
||||||
|
}
|
|
@ -86,4 +86,10 @@ public class SysUserFocusStation implements Serializable {
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private String status;
|
private String status;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 台站编码
|
||||||
|
*/
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String stationCode;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,12 +11,18 @@ import java.util.List;
|
||||||
|
|
||||||
public interface IStationOperationService extends IService<StationOperation> {
|
public interface IStationOperationService extends IService<StationOperation> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询台站,核设施类型
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<String> findStationType();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询台站,核设施信息
|
* 查询台站,核设施信息
|
||||||
* @param status
|
* @param status
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<StationOperation> findList(String status);
|
List<StationOperation> findList(String status, String stationType);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查看台站,核设施详情信息
|
* 查看台站,核设施详情信息
|
||||||
|
|
|
@ -47,11 +47,20 @@ public class StationOperationServiceImpl extends ServiceImpl<StationOperationMap
|
||||||
private StationMetDataMapper stationMetDataMapper;
|
private StationMetDataMapper stationMetDataMapper;
|
||||||
@Autowired
|
@Autowired
|
||||||
private SysUserFocusStationMapper sysUserFocusStationMapper;
|
private SysUserFocusStationMapper sysUserFocusStationMapper;
|
||||||
|
@Autowired
|
||||||
|
private StationTypeUtil stationTypeUtil;
|
||||||
|
|
||||||
private final SpatialContext spatialContext = SpatialContext.GEO;
|
private final SpatialContext spatialContext = SpatialContext.GEO;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<StationOperation> findList(String status) {
|
public List<String> findStationType() {
|
||||||
|
List<String> allStationType = stationTypeUtil.findAllStationType();
|
||||||
|
allStationType.add("Nuclear Facility");
|
||||||
|
return allStationType;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<StationOperation> findList(String status, String stationType) {
|
||||||
//声明结果集合
|
//声明结果集合
|
||||||
List<StationOperation> result = new LinkedList<>();
|
List<StationOperation> result = new LinkedList<>();
|
||||||
//查询全部台站信息
|
//查询全部台站信息
|
||||||
|
@ -65,8 +74,7 @@ public class StationOperationServiceImpl extends ServiceImpl<StationOperationMap
|
||||||
StationOperation stationOperation = new StationOperation();
|
StationOperation stationOperation = new StationOperation();
|
||||||
stationOperation.setStationId(gardsStation.getStationId());
|
stationOperation.setStationId(gardsStation.getStationId());
|
||||||
stationOperation.setStationName(gardsStation.getStationCode());
|
stationOperation.setStationName(gardsStation.getStationCode());
|
||||||
String stationType = StationTypeUtil.getStationType(gardsStation.getStationId());
|
stationOperation.setStationType(stationTypeUtil.getStationType(gardsStation.getStationId()));
|
||||||
stationOperation.setStationType(stationType);
|
|
||||||
stationOperation.setAltitude(Objects.isNull(gardsStation.getElevation())?"--":gardsStation.getElevation()+"m");
|
stationOperation.setAltitude(Objects.isNull(gardsStation.getElevation())?"--":gardsStation.getElevation()+"m");
|
||||||
stationOperation.setLon(String.valueOf(gardsStation.getLon()));
|
stationOperation.setLon(String.valueOf(gardsStation.getLon()));
|
||||||
stationOperation.setLat(String.valueOf(gardsStation.getLat()));
|
stationOperation.setLat(String.valueOf(gardsStation.getLat()));
|
||||||
|
@ -89,9 +97,13 @@ public class StationOperationServiceImpl extends ServiceImpl<StationOperationMap
|
||||||
result.add(stationOperation);
|
result.add(stationOperation);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//如果类型不为空
|
//如果状态不为空
|
||||||
if (StringUtils.isNotBlank(status)){
|
if (StringUtils.isNotBlank(status)){
|
||||||
result = result.stream().filter(item-> StringUtils.isNotBlank(item.getStatus())&&item.getStatus().equalsIgnoreCase(status)).collect(Collectors.toList());
|
result = result.stream().filter(item-> StringUtils.isNotBlank(item.getStatus()) && item.getStatus().equalsIgnoreCase(status)).collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
//如果类型不为空
|
||||||
|
if (StringUtils.isNotBlank(stationType)){
|
||||||
|
result = result.stream().filter(item-> StringUtils.isNotBlank(item.getStationType()) && item.getStationType().equalsIgnoreCase(stationType)).collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,6 +41,8 @@ public class SysUserFocusStationServiceImpl extends ServiceImpl<SysUserFocusStat
|
||||||
private ICacheTimeService cacheTimeService;
|
private ICacheTimeService cacheTimeService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private StationReceivingConfigMapper stationReceivingConfigMapper;
|
private StationReceivingConfigMapper stationReceivingConfigMapper;
|
||||||
|
@Autowired
|
||||||
|
private StationTypeUtil stationTypeUtil;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<SysUserFocusStation> findList() {
|
public List<SysUserFocusStation> findList() {
|
||||||
|
@ -52,8 +54,9 @@ public class SysUserFocusStationServiceImpl extends ServiceImpl<SysUserFocusStat
|
||||||
if (CollectionUtils.isNotEmpty(stationInfoMap)){
|
if (CollectionUtils.isNotEmpty(stationInfoMap)){
|
||||||
if (Objects.nonNull(stationInfoMap.get(item.getStationId()))){
|
if (Objects.nonNull(stationInfoMap.get(item.getStationId()))){
|
||||||
GardsStations stations = (GardsStations) stationInfoMap.get(item.getStationId());
|
GardsStations stations = (GardsStations) stationInfoMap.get(item.getStationId());
|
||||||
String stationType = StationTypeUtil.getStationType(stations.getStationId());
|
String stationType = stationTypeUtil.getStationType(stations.getStationId());
|
||||||
item.setStationType(stationType);
|
item.setStationType(stationType);
|
||||||
|
item.setStationCode(stations.getStationCode());
|
||||||
item.setLon(stations.getLon());
|
item.setLon(stations.getLon());
|
||||||
item.setLat(stations.getLat());
|
item.setLat(stations.getLat());
|
||||||
item.setStatus(stations.getStatus());
|
item.setStatus(stations.getStatus());
|
||||||
|
@ -118,7 +121,7 @@ public class SysUserFocusStationServiceImpl extends ServiceImpl<SysUserFocusStat
|
||||||
sysUserFocusStation.setId(String.valueOf(id));
|
sysUserFocusStation.setId(String.valueOf(id));
|
||||||
sysUserFocusStation.setUserId(sysUser.getId());
|
sysUserFocusStation.setUserId(sysUser.getId());
|
||||||
sysUserFocusStation.setStationId(String.valueOf(stationId));
|
sysUserFocusStation.setStationId(String.valueOf(stationId));
|
||||||
String stationType = StationTypeUtil.getStationType(stationId);
|
String stationType = stationTypeUtil.getStationType(stationId);
|
||||||
sysUserFocusStation.setStationType(stationType);
|
sysUserFocusStation.setStationType(stationType);
|
||||||
sysUserFocusStation.setCreateTime(LocalDateTime.now());
|
sysUserFocusStation.setCreateTime(LocalDateTime.now());
|
||||||
sysUserFocusStation.setCreateBy(username);
|
sysUserFocusStation.setCreateBy(username);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user