feat:bugs
This commit is contained in:
parent
94ed1907d8
commit
6c2f0a5415
|
@ -1,14 +1,15 @@
|
|||
package org.jeecg.common.util;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.collection.ListUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import org.jeecgframework.poi.excel.entity.TemplateExportParams;
|
||||
import org.springframework.core.io.ClassPathResource;
|
||||
import org.springframework.core.io.DefaultResourceLoader;
|
||||
import org.springframework.core.io.Resource;
|
||||
import org.springframework.core.io.ResourceLoader;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
@ -71,6 +72,17 @@ public class ClassUtil {
|
|||
}
|
||||
}
|
||||
|
||||
public static InputStream classPathStream(String classPath){
|
||||
try {
|
||||
ClassPathResource resource = new ClassPathResource(classPath);
|
||||
return resource.getInputStream();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static <T1,T2> void copyProperties(T1 source, T2 target){
|
||||
Class<?> sourceClass = source.getClass();
|
||||
Class<?> targetClass = target.getClass();
|
||||
|
|
|
@ -12,15 +12,15 @@ import org.springframework.core.io.Resource;
|
|||
import org.springframework.core.io.ResourceLoader;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
import java.io.PrintWriter;
|
||||
import java.io.*;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import static org.jeecg.common.util.ClassUtil.classPathStream;
|
||||
|
||||
public class ExportUtil {
|
||||
|
||||
private static final String UTF_8 = StandardCharsets.UTF_8.name();
|
||||
|
@ -101,7 +101,9 @@ public class ExportUtil {
|
|||
public static TemplateExportParams excelTemplate(String template){
|
||||
String pathPrefix = "excelTemplate/";
|
||||
String path = pathPrefix + template;
|
||||
String templatePath = ClassUtil.classPath(path);
|
||||
InputStream inputStream = classPathStream(path);
|
||||
|
||||
String templatePath = "";
|
||||
return new TemplateExportParams(templatePath);
|
||||
}
|
||||
|
||||
|
|
|
@ -12,4 +12,14 @@ public class ConcDto implements Serializable {
|
|||
private String conc;
|
||||
|
||||
private Date analysisBegin;
|
||||
|
||||
public ConcDto() {
|
||||
|
||||
}
|
||||
|
||||
public ConcDto(String nuclideName, String conc, Date analysisBegin) {
|
||||
this.nuclideName = nuclideName;
|
||||
this.conc = conc;
|
||||
this.analysisBegin = analysisBegin;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
package org.jeecg.modules.base.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
public class ConcDtoXe implements Serializable {
|
||||
|
||||
private String nuclideName;
|
||||
|
||||
private Double conc;
|
||||
|
||||
private Date analysisBegin;
|
||||
}
|
|
@ -3,6 +3,7 @@ package org.jeecg.modules.mapper;
|
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.jeecg.modules.base.dto.ConcDto;
|
||||
import org.jeecg.modules.base.dto.ConcDtoXe;
|
||||
import org.jeecg.modules.base.entity.rnauto.GardsNuclIded;
|
||||
|
||||
import java.util.List;
|
||||
|
|
|
@ -3,6 +3,7 @@ package org.jeecg.modules.mapper;
|
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.jeecg.modules.base.dto.ConcDto;
|
||||
import org.jeecg.modules.base.dto.ConcDtoXe;
|
||||
import org.jeecg.modules.base.entity.rnauto.GardsXeResults;
|
||||
|
||||
import java.util.List;
|
||||
|
@ -12,7 +13,7 @@ import java.util.Set;
|
|||
@Mapper
|
||||
public interface GardsXeResultsAutoMapper extends BaseMapper<GardsXeResults> {
|
||||
|
||||
List<ConcDto> getConc(Map<String,Object> params);
|
||||
List<ConcDtoXe> getConc(Map<String,Object> params);
|
||||
|
||||
List<String> nuclideNames(Set<String> nuclideNames);
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@ package org.jeecg.modules.mapper;
|
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.jeecg.modules.base.dto.ConcDto;
|
||||
import org.jeecg.modules.base.dto.ConcDtoXe;
|
||||
import org.jeecg.modules.base.entity.rnman.GardsXeResults;
|
||||
|
||||
import java.util.List;
|
||||
|
@ -12,7 +13,7 @@ import java.util.Set;
|
|||
@Mapper
|
||||
public interface GardsXeResultsManMapper extends BaseMapper<GardsXeResults> {
|
||||
|
||||
List<ConcDto> getConc(Map<String,Object> params);
|
||||
List<ConcDtoXe> getConc(Map<String,Object> params);
|
||||
|
||||
List<String> nuclideNames(Set<String> nuclideNames);
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.jeecg.modules.mapper.GardsXeResultsAutoMapper">
|
||||
|
||||
<select id="getConc" resultType="org.jeecg.modules.base.dto.ConcDto">
|
||||
<select id="getConc" resultType="org.jeecg.modules.base.dto.ConcDtoXe">
|
||||
SELECT
|
||||
xe.NUCLIDE_NAME,
|
||||
xe.CONC,
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.jeecg.modules.mapper.GardsXeResultsManMapper">
|
||||
<select id="getConc" resultType="org.jeecg.modules.base.dto.ConcDto">
|
||||
<select id="getConc" resultType="org.jeecg.modules.base.dto.ConcDtoXe">
|
||||
SELECT
|
||||
xe.NUCLIDE_NAME,
|
||||
xe.CONC,
|
||||
|
|
|
@ -2,6 +2,7 @@ package org.jeecg.modules.service;
|
|||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.jeecg.modules.base.dto.ConcDto;
|
||||
import org.jeecg.modules.base.dto.ConcDtoXe;
|
||||
import org.jeecg.modules.base.entity.rnauto.GardsNuclIded;
|
||||
|
||||
import java.util.List;
|
||||
|
|
|
@ -2,6 +2,7 @@ package org.jeecg.modules.service;
|
|||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.jeecg.modules.base.dto.ConcDto;
|
||||
import org.jeecg.modules.base.dto.ConcDtoXe;
|
||||
import org.jeecg.modules.base.entity.rnauto.GardsXeResults;
|
||||
|
||||
import java.util.List;
|
||||
|
@ -10,7 +11,7 @@ import java.util.Set;
|
|||
|
||||
public interface IGardsXeResultsAutoService extends IService<GardsXeResults> {
|
||||
|
||||
List<ConcDto> getConc(Map<String,Object> params);
|
||||
List<ConcDtoXe> getConc(Map<String,Object> params);
|
||||
|
||||
List<String> nuclideNames(Set<String> nuclideNames);
|
||||
}
|
||||
|
|
|
@ -2,6 +2,7 @@ package org.jeecg.modules.service;
|
|||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.jeecg.modules.base.dto.ConcDto;
|
||||
import org.jeecg.modules.base.dto.ConcDtoXe;
|
||||
import org.jeecg.modules.base.entity.rnman.GardsXeResults;
|
||||
|
||||
import java.util.List;
|
||||
|
@ -10,7 +11,7 @@ import java.util.Set;
|
|||
|
||||
public interface IGardsXeResultsManService extends IService<GardsXeResults> {
|
||||
|
||||
List<ConcDto> getConc(Map<String,Object> params);
|
||||
List<ConcDtoXe> getConc(Map<String,Object> params);
|
||||
|
||||
List<String> nuclideNames(Set<String> nuclideNames);
|
||||
}
|
||||
|
|
|
@ -7,6 +7,7 @@ import org.jeecg.common.constant.CommonConstant;
|
|||
import org.jeecg.common.constant.DateConstant;
|
||||
import org.jeecg.common.constant.SymbolConstant;
|
||||
import org.jeecg.modules.base.dto.ConcDto;
|
||||
import org.jeecg.modules.base.dto.ConcDtoXe;
|
||||
import org.jeecg.modules.base.entity.postgre.AlarmAnalysisNuclideAvg;
|
||||
import org.jeecg.modules.base.entity.postgre.AlarmAnalysisNuclideParam;
|
||||
import org.jeecg.modules.base.entity.postgre.AlarmAnalysisRule;
|
||||
|
@ -69,11 +70,12 @@ public class CalculateConcServiceImpl implements CalculateConcService {
|
|||
params.put("endDate",endDate + DateConstant.TIME_END);
|
||||
/* Auto自动处理 */
|
||||
// beta-gamma
|
||||
List<ConcDto> xeConcAuto = xeResultsAutoService.getConc(params);
|
||||
List<ConcDtoXe> xeConcAuto = xeResultsAutoService.getConc(params);
|
||||
// gamma
|
||||
List<ConcDto> nuclConcAuto = nuclIdedAutoService.getConc(params);
|
||||
|
||||
Map<String,String> autoResult = new HashMap<>();
|
||||
autoResult.putAll(calculate(xeConcAuto,index));
|
||||
autoResult.putAll(calculate(concDto(xeConcAuto), index));
|
||||
autoResult.putAll(calculate(nuclConcAuto, index));
|
||||
List<AlarmAnalysisNuclideAvg> autoAvgs = autoResult.entrySet().stream()
|
||||
.map(entry -> new AlarmAnalysisNuclideAvg(entry.getKey(), entry.getValue()))
|
||||
|
@ -81,11 +83,11 @@ public class CalculateConcServiceImpl implements CalculateConcService {
|
|||
autoAvgs.forEach(item -> item.setDataSourceType(CommonConstant.ARMDARR));
|
||||
/* Man人工交互 */
|
||||
// beta-gamma
|
||||
List<ConcDto> xeConcMan = xeResultsManService.getConc(params);
|
||||
List<ConcDtoXe> xeConcMan = xeResultsManService.getConc(params);
|
||||
// gamma
|
||||
List<ConcDto> nuclConcMan = nuclIdedManService.getConc(params);
|
||||
Map<String,String> manResult = new HashMap<>();
|
||||
manResult.putAll(calculate(xeConcMan,index));
|
||||
manResult.putAll(calculate(concDto(xeConcMan), index));
|
||||
manResult.putAll(calculate(nuclConcMan, index));
|
||||
List<AlarmAnalysisNuclideAvg> manAvgs = manResult.entrySet().stream()
|
||||
.map(entry -> new AlarmAnalysisNuclideAvg(entry.getKey(), entry.getValue()))
|
||||
|
@ -123,4 +125,14 @@ public class CalculateConcServiceImpl implements CalculateConcService {
|
|||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private List<ConcDto> concDto(List<ConcDtoXe> concDtoXes){
|
||||
List<ConcDto> concDtos = new ArrayList<>();
|
||||
if (CollUtil.isEmpty(concDtoXes)) return concDtos;
|
||||
|
||||
concDtos = concDtoXes.stream()
|
||||
.map(xe -> new ConcDto(xe.getNuclideName(), String.valueOf(xe.getConc()), xe.getAnalysisBegin()))
|
||||
.collect(Collectors.toList());
|
||||
return concDtos;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,6 +4,7 @@ import com.baomidou.dynamic.datasource.annotation.DS;
|
|||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import org.jeecg.common.constant.DateConstant;
|
||||
import org.jeecg.modules.base.dto.ConcDto;
|
||||
import org.jeecg.modules.base.dto.ConcDtoXe;
|
||||
import org.jeecg.modules.base.entity.rnauto.GardsNuclIded;
|
||||
import org.jeecg.modules.base.entity.rnauto.GardsXeResults;
|
||||
import org.jeecg.modules.mapper.GardsNuclIdedAutoMapper;
|
||||
|
|
|
@ -4,6 +4,7 @@ import com.baomidou.dynamic.datasource.annotation.DS;
|
|||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import org.jeecg.common.constant.DateConstant;
|
||||
import org.jeecg.modules.base.dto.ConcDto;
|
||||
import org.jeecg.modules.base.dto.ConcDtoXe;
|
||||
import org.jeecg.modules.base.entity.rnauto.GardsXeResults;
|
||||
import org.jeecg.modules.mapper.GardsXeResultsAutoMapper;
|
||||
import org.jeecg.modules.service.IGardsXeResultsAutoService;
|
||||
|
@ -23,7 +24,7 @@ public class GardsXeResultsAutoServiceImpl extends ServiceImpl<GardsXeResultsAut
|
|||
|
||||
|
||||
@Override
|
||||
public List<ConcDto> getConc(Map<String, Object> params) {
|
||||
public List<ConcDtoXe> getConc(Map<String, Object> params) {
|
||||
return baseMapper.getConc(params);
|
||||
}
|
||||
|
||||
|
|
|
@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.jeecg.common.constant.DateConstant;
|
||||
import org.jeecg.modules.base.dto.ConcDto;
|
||||
import org.jeecg.modules.base.dto.ConcDtoXe;
|
||||
import org.jeecg.modules.base.entity.rnman.GardsXeResults;
|
||||
import org.jeecg.modules.mapper.GardsXeResultsManMapper;
|
||||
import org.jeecg.modules.service.IGardsXeResultsManService;
|
||||
|
@ -23,7 +24,7 @@ public class GardsXeResultsManServiceImpl extends ServiceImpl<GardsXeResultsManM
|
|||
|
||||
|
||||
@Override
|
||||
public List<ConcDto> getConc(Map<String, Object> params) {
|
||||
public List<ConcDtoXe> getConc(Map<String, Object> params) {
|
||||
return baseMapper.getConc(params);
|
||||
}
|
||||
|
||||
|
|
|
@ -230,4 +230,10 @@ public class SpectrumAnalysesController {
|
|||
@RequestBody BgDataAnlyseResultIn anlyseResultIn){
|
||||
spectrumAnalysisService.saveToTxt(anlyseResultIn, response);
|
||||
}
|
||||
|
||||
@GetMapping("viewAutomaticAnalysisLog")
|
||||
@ApiOperation(value = "查看Automatic Analysis Log页面数据", notes = "查看Automatic Analysis Log页面数据")
|
||||
public void viewAutomaticAnalysisLog(Integer sampleId, HttpServletResponse response) {
|
||||
spectrumAnalysisService.viewAutomaticAnalysisLog(sampleId, response);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -81,4 +81,6 @@ public interface ISpectrumAnalysisService {
|
|||
void saveToExcel(BgDataAnlyseResultIn anlyseResultIn, HttpServletResponse response);
|
||||
|
||||
void saveToTxt(BgDataAnlyseResultIn anlyseResultIn, HttpServletResponse response);
|
||||
|
||||
void viewAutomaticAnalysisLog(Integer sampleId, HttpServletResponse response);
|
||||
}
|
||||
|
|
|
@ -15,6 +15,7 @@ import com.baomidou.mybatisplus.core.toolkit.StringPool;
|
|||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import com.google.common.cache.Cache;
|
||||
import org.apache.commons.net.ftp.FTPClient;
|
||||
|
@ -1186,8 +1187,10 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi
|
|||
}
|
||||
PeakInfo peak = new PeakInfo();
|
||||
peak.index = a + 1;
|
||||
peak.left = structInsertOutput.vLeft.get(j).intValue();;
|
||||
peak.right = structInsertOutput.vRight.get(j).intValue();;
|
||||
peak.left = structInsertOutput.vLeft.get(j).intValue();
|
||||
;
|
||||
peak.right = structInsertOutput.vRight.get(j).intValue();
|
||||
;
|
||||
peak.peakCentroid = structInsertOutput.peakCentroid.get(j);
|
||||
peak.energy = structInsertOutput.energy.get(j);
|
||||
peak.area = structInsertOutput.area.get(j);
|
||||
|
@ -2060,10 +2063,14 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi
|
|||
annlyse.put("date", date);
|
||||
annlyse.put("time", time);
|
||||
|
||||
PrintWriter writer = null;
|
||||
try {
|
||||
String pathPrefix = "excelTemplate/";
|
||||
String path = pathPrefix + ZEROTIME_G.getName();
|
||||
String template = ClassUtil.classPath(path);
|
||||
List<String> lines = FileUtil.readUtf8Lines(template);
|
||||
/*String template = ClassUtil.classPath(path);
|
||||
List<String> lines = FileUtil.readUtf8Lines(template);*/
|
||||
InputStream inputStream = ClassUtil.classPathStream(path);
|
||||
List<String> lines = IOUtils.readLines(inputStream, "UTF-8");
|
||||
// 正则表达式,匹配${}中的内容
|
||||
String regex = "\\$\\{([^}]+)}";
|
||||
List<String> newLines = new ArrayList<>();
|
||||
|
@ -2084,8 +2091,7 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi
|
|||
}
|
||||
newLines.add(line);
|
||||
}
|
||||
PrintWriter writer = null;
|
||||
try {
|
||||
|
||||
String export = "ZeroTime-G.txt";
|
||||
writer = ExportUtil.streamWriter(response, export);
|
||||
for (String newLine : newLines) {
|
||||
|
@ -3812,17 +3818,11 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi
|
|||
}
|
||||
} else if (str.contains("(")) {
|
||||
standard += str.replace("(", "") + " < " + iter.getKey();
|
||||
}
|
||||
else if(str.contains(")"))
|
||||
{
|
||||
} else if (str.contains(")")) {
|
||||
standard += " < " + str.replace(")", "");
|
||||
}
|
||||
else if(str.contains("["))
|
||||
{
|
||||
} else if (str.contains("[")) {
|
||||
standard += str.replace("[", "") + " <= " + iter.getKey();
|
||||
}
|
||||
else if(str.contains("]"))
|
||||
{
|
||||
} else if (str.contains("]")) {
|
||||
standard += " <= " + str.replace("]", "");
|
||||
}
|
||||
}
|
||||
|
@ -4020,10 +4020,14 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi
|
|||
@Override
|
||||
public void exportRLR(GammaRLR gammaRLR, HttpServletResponse response) {
|
||||
if (ObjectUtil.isNull(gammaRLR)) return;
|
||||
PrintWriter writer = null;
|
||||
try {
|
||||
String pathPrefix = "excelTemplate/";
|
||||
String path = pathPrefix + RLR_G.getName();
|
||||
String template = ClassUtil.classPath(path);
|
||||
List<String> lines = FileUtil.readUtf8Lines(template);
|
||||
/*String template = ClassUtil.classPath(path);
|
||||
List<String> lines = FileUtil.readUtf8Lines(template);*/
|
||||
InputStream inputStream = ClassUtil.classPathStream(path);
|
||||
List<String> lines = IOUtils.readLines(inputStream, "UTF-8");
|
||||
// 正则表达式,匹配${}中的内容
|
||||
String regex = "\\$\\{([^}]+)}";
|
||||
List<String> newLines = new ArrayList<>();
|
||||
|
@ -4078,8 +4082,7 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi
|
|||
if (!CollUtil.contains(skip, newLine))
|
||||
newLines.add(newLine);
|
||||
}
|
||||
PrintWriter writer = null;
|
||||
try {
|
||||
|
||||
String export = "Gamma.RLR";
|
||||
writer = ExportUtil.streamWriter(response, export);
|
||||
for (String newLine : newLines) {
|
||||
|
@ -4559,14 +4562,16 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi
|
|||
data.put("nuclides", nuclideStr);
|
||||
/* Nuclide's Activity and Concentration */
|
||||
// 时间部分
|
||||
String actTime = ""; String concTime = "";
|
||||
String actTime = "";
|
||||
String concTime = "";
|
||||
Date refTimeAct = phd.getUsedSetting().getRefTime_act();
|
||||
Date refTimeConc = phd.getUsedSetting().getRefTime_conc();
|
||||
if (ObjectUtil.isNotNull(refTimeAct))
|
||||
actTime = DateUtil.format(refTimeAct, DateConstant.DATE_BIAS_TIME);
|
||||
if (ObjectUtil.isNotNull(refTimeConc))
|
||||
concTime = DateUtil.format(refTimeConc, DateConstant.DATE_BIAS_TIME);
|
||||
data.put("actTime", actTime); data.put("concTime", concTime);
|
||||
data.put("actTime", actTime);
|
||||
data.put("concTime", concTime);
|
||||
// 数据部分
|
||||
Map<String, NuclideActMda> mapNucActMda = phd.getMapNucActMda();
|
||||
List<NuclideActMdaDto> nuclideActs = new ArrayList<>();
|
||||
|
@ -4612,9 +4617,11 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi
|
|||
if (calculateIdx >= 0 && calculateIdx < vEnergy.size()) {
|
||||
String yield = NumberFormatUtil.numberFormat(String.valueOf(vYield.get(calculateIdx) * 100));
|
||||
String energy = NumberFormatUtil.numberFormat(String.valueOf(vEnergy.get(calculateIdx)));
|
||||
nuclideActMdaDto.setYield(yield); nuclideActMdaDto.setEnergy(energy);
|
||||
nuclideActMdaDto.setYield(yield);
|
||||
nuclideActMdaDto.setEnergy(energy);
|
||||
} else {
|
||||
nuclideActMdaDto.setYield("NULL"); nuclideActMdaDto.setEnergy("NULL");
|
||||
nuclideActMdaDto.setYield("NULL");
|
||||
nuclideActMdaDto.setEnergy("NULL");
|
||||
}
|
||||
nuclideActs.add(nuclideActMdaDto);
|
||||
}
|
||||
|
|
|
@ -13,7 +13,9 @@ import com.baomidou.mybatisplus.core.toolkit.StringPool;
|
|||
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.google.common.cache.Cache;
|
||||
import org.apache.commons.io.Charsets;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.apache.commons.net.ftp.FTP;
|
||||
import org.apache.commons.net.ftp.FTPClient;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
|
@ -205,7 +207,9 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
|||
// 声明分页page
|
||||
Page<GardsSampleDataSpectrum> page = new Page<>(queryRequest.getPageNo(), queryRequest.getPageSize());
|
||||
Page<GardsSampleDataSpectrum> sampleDataPage = spectrumAnalysisMapper.getDBSpectrumList(page, gardsSampleData, dbName, stationTypes, CollectStopB, AcqStartB, startTime, endTime, userStations, AllUsers);
|
||||
sampleDataPage.getRecords().stream().forEach(item->{item.setDbName(tempDBName);});
|
||||
sampleDataPage.getRecords().stream().forEach(item -> {
|
||||
item.setDbName(tempDBName);
|
||||
});
|
||||
result.setSuccess(true);
|
||||
result.setResult(sampleDataPage);
|
||||
return result;
|
||||
|
@ -4339,11 +4343,14 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
|||
analyze.put("gasRoi", roiChannels(roiChannelsDtosG));
|
||||
analyze.putAll(roiResults(roiResultsDtos));
|
||||
analyze.put("resultSummary", xeResults(xeResultsDtos));
|
||||
PrintWriter writer = null;
|
||||
try {
|
||||
// 使数据适配导出模板
|
||||
String pathPrefix = "excelTemplate/";
|
||||
String path = pathPrefix + SAVETOTXT.getName();
|
||||
String template = ClassUtil.classPath(path);
|
||||
List<String> lines = FileUtil.readUtf8Lines(template);
|
||||
InputStream inputStream = ClassUtil.classPathStream(path);
|
||||
List<String> lines = IOUtils.readLines(inputStream, "UTF-8");
|
||||
|
||||
// 正则表达式,匹配${}中的内容
|
||||
String regex = "\\$\\{([^}]+)}";
|
||||
List<String> newLines = new ArrayList<>();
|
||||
|
@ -4371,8 +4378,7 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
|||
if (!CollUtil.contains(skip, line))
|
||||
newLines.add(line);
|
||||
}
|
||||
PrintWriter writer = null;
|
||||
try {
|
||||
|
||||
String export = "SaveToTxt.txt";
|
||||
writer = ExportUtil.streamWriter(response, export);
|
||||
for (String newLine : newLines) {
|
||||
|
@ -4386,6 +4392,26 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void viewAutomaticAnalysisLog(Integer sampleId, HttpServletResponse response) {
|
||||
try {
|
||||
String path = "C:\\Users\\a\\Desktop\\demo.log";
|
||||
InputStream inputStream = new FileInputStream(new File(path));
|
||||
OutputStream outputStream = ExportUtil.stream(response, "demo.log");
|
||||
|
||||
// 缓冲区大小
|
||||
byte[] buffer = new byte[4096];
|
||||
int bytesRead;
|
||||
|
||||
// 将文件输出流写入到输出流中
|
||||
while ((bytesRead = inputStream.read(buffer)) != -1) {
|
||||
outputStream.write(buffer, 0, bytesRead);
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
private List<String> calibrations(GardsCalibrationSpectrum gammaCalibrationCE, GardsCalibrationSpectrum gammaCalibrationEC, GardsCalibrationSpectrum betaCalibrationCE, GardsCalibrationSpectrum betaCalibrationEC) {
|
||||
int min = 79;
|
||||
String space = StrUtil.SPACE;
|
||||
|
|
Loading…
Reference in New Issue
Block a user