Merge remote-tracking branch 'origin/SelfStation' into SelfStation
This commit is contained in:
commit
cb74fb5a9e
|
@ -1,9 +1,11 @@
|
|||
package org.jeecg.common.util;
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.StringPool;
|
||||
import org.jeecg.common.properties.SpectrumPathProperties;
|
||||
import org.jeecg.modules.base.enums.DataType;
|
||||
import org.jeecg.modules.base.enums.SystemType;
|
||||
import org.jeecg.modules.entity.vo.PHDFile;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
@ -18,21 +20,22 @@ import java.util.Map;
|
|||
@Component
|
||||
public class NameStandUtil {
|
||||
|
||||
@Autowired
|
||||
private SpectrumPathProperties pathProperties;
|
||||
|
||||
public String GetSysTemSubdir(String systemType) {
|
||||
StringBuffer path = new StringBuffer();
|
||||
String path = null;
|
||||
Map<String, String> pathMap = pathProperties.getFilePathMap();
|
||||
if(systemType.contains(SystemType.BETA.getType())) {
|
||||
path.append("Spectrum");
|
||||
path.append(StringPool.SLASH+"Xenon");
|
||||
path.append(StringPool.SLASH+"Sauna");
|
||||
path = pathMap.getOrDefault(SystemType.BETA.getType(), "Spectrum/Xenon/Sauna");
|
||||
} else if(systemType.contains(SystemType.GAMMA.getType())) {
|
||||
path.append("Spectrum");
|
||||
path.append(StringPool.SLASH+"Xenon");
|
||||
path.append(StringPool.SLASH+"Spalax");
|
||||
path = pathMap.getOrDefault(SystemType.GAMMA.getType(), "Spectrum/Xenon/Spalax");
|
||||
} else if(systemType.contains(SystemType.PARTICULATE.getType())) {
|
||||
path.append("Spectrum");
|
||||
path.append(StringPool.SLASH+"Particulates");
|
||||
path = pathMap.getOrDefault(SystemType.PARTICULATE.getType(), "Spectrum/Particulates");
|
||||
} else if(systemType.contains(SystemType.WATER.getType())) {
|
||||
path = pathMap.getOrDefault(SystemType.WATER.getType(), "Spectrum/Water");
|
||||
}
|
||||
return path.toString();
|
||||
return path;
|
||||
}
|
||||
|
||||
public String GetDateTypeSubdir(String dataType){
|
||||
|
|
|
@ -97,4 +97,10 @@ public class GardsSampleAux implements Serializable {
|
|||
*/
|
||||
@TableField(value = "XE_COLLECTION_YIED_UNCER")
|
||||
private Double xeCollectionYiedUncer;
|
||||
|
||||
@TableField("LON")
|
||||
private Double lon;
|
||||
|
||||
@TableField("LAT")
|
||||
private Double lat;
|
||||
}
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
package org.jeecg.modules.service.impl;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.jeecg.common.constant.StringConstant;
|
||||
|
@ -8,6 +10,7 @@ import org.jeecg.modules.base.entity.configuration.GardsDetectors;
|
|||
import org.jeecg.modules.base.entity.configuration.GardsStations;
|
||||
import org.jeecg.modules.base.entity.original.GardsSampleAux;
|
||||
import org.jeecg.modules.base.entity.original.GardsSampleData;
|
||||
import org.jeecg.modules.base.enums.DataType;
|
||||
import org.jeecg.modules.file.FileOperation;
|
||||
import org.jeecg.modules.mapper.GardsSampleAuxMapper;
|
||||
import org.jeecg.modules.mapper.GardsSampleDataMapper;
|
||||
|
@ -122,6 +125,14 @@ public class SpectrumBaseBlockServiceImpl implements ISpectrumBaseBlockService {
|
|||
gardsSampleAux.setXeCollectionYied(struct.Xe_collection_yield);
|
||||
gardsSampleAux.setXeCollectionYiedUncer(struct.uncertainty_2);
|
||||
|
||||
// 如果是样品谱类型 自建台站谱需要存储GPS坐标信息 其它样品谱GPS坐标为0
|
||||
String dataType = struct.data_type;
|
||||
if (StrUtil.contains(dataType, DataType.SAMPLEPHD.getType())
|
||||
|| StrUtil.contains(dataType, DataType.SPHDF.getType())
|
||||
|| StrUtil.contains(dataType, DataType.SPHDP.getType())){
|
||||
gardsSampleAux.setLon(struct.lon);
|
||||
gardsSampleAux.setLat(struct.lat);
|
||||
}
|
||||
this.sampleAuxMapper.insert(gardsSampleAux);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -110,7 +110,9 @@ public class SamplephdSpectrum extends AbstractS_D_Q_G_SpectrumHandler {
|
|||
Sample_B_Analysis bAnalysis = new Sample_B_Analysis(this);
|
||||
bAnalysis.analysis();
|
||||
}
|
||||
if (this.sourceData.system_type.equals(SystemType.PARTICULATE.getType()) || this.sourceData.system_type.equals(SystemType.GAMMA.getType())) {
|
||||
if (this.sourceData.system_type.equals(SystemType.PARTICULATE.getType())
|
||||
|| this.sourceData.system_type.equals(SystemType.GAMMA.getType())
|
||||
|| this.sourceData.system_type.equals(SystemType.WATER.getType())) {
|
||||
Sample_G_Analysis sample_g_analysis = new Sample_G_Analysis(this, super.sourceData, super.spectrumServiceQuotes, super.sampleData);
|
||||
sample_g_analysis.analysis();
|
||||
}
|
||||
|
|
|
@ -309,4 +309,10 @@ public class SelfStationController {
|
|||
public Result configureSave(@RequestBody ConfigureData configureData, HttpServletRequest request) {
|
||||
return selfStationService.configureSave(configureData, request);
|
||||
}
|
||||
|
||||
@GetMapping("viewSpectrum")
|
||||
@ApiOperation(value = "查看Spectrum数据", notes = "查看Spectrum数据")
|
||||
public Result viewSpectrum(String fileName, HttpServletRequest request) {
|
||||
return selfStationService.viewSpectrum(fileName, request);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -106,4 +106,6 @@ public interface ISelfStationService {
|
|||
Result configure(String fileName, HttpServletRequest request);
|
||||
|
||||
Result configureSave(ConfigureData configureData, HttpServletRequest request);
|
||||
|
||||
Result viewSpectrum(String fileName, HttpServletRequest request);
|
||||
}
|
||||
|
|
|
@ -2,6 +2,7 @@ package org.jeecg.modules.service.impl;
|
|||
|
||||
import cn.hutool.core.collection.ListUtil;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.io.FileUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
|
@ -3252,6 +3253,36 @@ public class SelfStationServiceImpl implements ISelfStationService {
|
|||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result viewSpectrum(String fileName, HttpServletRequest request) {
|
||||
Result result = new Result();
|
||||
//获取用户名
|
||||
String userName = JwtUtil.getUserNameByToken(request);
|
||||
//读取本地缓存
|
||||
Cache<String, SelfStationData> selfCache = selfStationCache.getSelfCache();
|
||||
SelfStationData selfStationData = selfCache.getIfPresent(fileName + StringPool.DASH + userName);
|
||||
if (Objects.isNull(selfStationData)) {
|
||||
result.error500("Please select the parse file first!");
|
||||
return result;
|
||||
}
|
||||
Map<String, List<String>> map = new HashMap<>();
|
||||
if(FileUtil.exist(selfStationData.getSampleTmpPath())) {
|
||||
List<String> lines = FileUtil.readUtf8Lines(selfStationData.getSampleTmpPath());
|
||||
map.put("sample", lines);
|
||||
}
|
||||
if(FileUtil.exist(selfStationData.getDetTmpPath())) {
|
||||
List<String> lines = FileUtil.readUtf8Lines(selfStationData.getDetTmpPath());
|
||||
map.put("detBg", lines);
|
||||
}
|
||||
if (FileUtil.exist(selfStationData.getQcTmpPath())) {
|
||||
List<String> lines = FileUtil.readUtf8Lines(selfStationData.getQcTmpPath());
|
||||
map.put("qc", lines);
|
||||
}
|
||||
result.setSuccess(true);
|
||||
result.setResult(map);
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 执行gamma分析
|
||||
* @param phd gamma 数据
|
||||
|
|
Loading…
Reference in New Issue
Block a user