Compare commits

..

2 Commits

Author SHA1 Message Date
xiaoguangbin
30d88aa5e3 fix:修改台站管理 自建台站类型没有数据问题 2024-11-07 09:28:34 +08:00
xiaoguangbin
00f56418d5 fix:修改dos谱业务逻辑 块名称从DoseRare改为DoseRate 2024-11-06 16:32:37 +08:00
4 changed files with 12 additions and 10 deletions

View File

@ -69,9 +69,9 @@ public class DOSSpectrum extends AbstractSpectrumHandler{
}
protected void checkAirSamplerFlowBlock(){
if(super.mailContent.indexOf("#DoseRare") == -1){
if(super.mailContent.indexOf("#DoseRate") == -1){
ErrorLogManager.getInstance().write(new SpectrumErrorEvent(new Date(), ErrorType.AIR_SAMPLER_FLOW_ERROR,super.spectrumFile.getName(),super.getMsgId()));
throw new AirSamplerFlowException("this is no DoseRare data");
throw new AirSamplerFlowException("this is no DoseRate data");
}
}
@ -128,7 +128,7 @@ public class DOSSpectrum extends AbstractSpectrumHandler{
throw new PHD_ReadException("THE PHDFile has some blocks can't be read:"+super.spectrumFile.getAbsolutePath());
}
if(sourceData.dr_record_count <= 0 || sourceData.dr_start_date.size() < 0 || sourceData.dr_start_time.size() < 0){
throw new AirSamplerFlowException("DoseRare data error");
throw new AirSamplerFlowException("DoseRate data error");
}
this.sourceData = sourceData;
}

View File

@ -6,6 +6,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
@Component
@ -26,11 +27,7 @@ public class StationTypeUtil {
for (StationType stationType:stationTypeList) {
if (StringUtils.isNotBlank(stationType.getMinId()) && StringUtils.isNotBlank(stationType.getMaxId())){
if (stationId>Integer.valueOf(stationType.getMinId()) && stationId<=Integer.valueOf(stationType.getMaxId())){
if (category == 3) {
type = "Car";
} else if (category == 4) {
type = "Ship";
} else {
if (Objects.equals(category, stationType.getCategory())) {
type = stationType.getName();
}
}

View File

@ -19,6 +19,8 @@ public class StationType implements Serializable {
private String maxId;
private Integer category;
private List<StationType> types = new ArrayList<>();
}

View File

@ -60,6 +60,9 @@ public class StationOperationServiceImpl extends ServiceImpl<StationOperationMap
@Autowired
private StationTypeUtil stationTypeUtil;
@Autowired
private StationType stationType;
private final SpatialContext spatialContext = SpatialContext.GEO;
@Override
@ -133,8 +136,8 @@ public class StationOperationServiceImpl extends ServiceImpl<StationOperationMap
@Override
public Result findInfo(String stationId, String type) {
Result result = new Result();
if (type.equals("IMS STATION(P)") || type.equals("IMS STATION(G)") || type.equals("NRL")
|| type.equals("Car")|| type.equals("Ship")){
List<String> stationTypes = stationType.getTypes().stream().map(StationType::getName).collect(Collectors.toList());
if (stationTypes.contains(type)){
HashMap<String, GardsStations> stationInfoMap = (HashMap<String, GardsStations>) redisUtil.get("stationInfoMap");
GardsStations stations = stationInfoMap.get(stationId);
if (Objects.nonNull(stations)){