gamma算法insertPeak,ComputePeakRange调整

gamma缓存key修改
移动gamma,beta算法内容以及相关的算法类
This commit is contained in:
qiaoqinzheng 2023-10-11 10:32:17 +08:00
parent 9e89b4aea9
commit 170081ea08
34 changed files with 296 additions and 2574 deletions

View File

@ -34,6 +34,10 @@ public class ConfigureData implements Serializable {
private Double riskLevelK;
private boolean updateCalibration;
private boolean keepCalPeakSearchPeaks;
@DateTimeFormat(pattern = "yyyy/MM/dd HH:mm:ss")
@JsonFormat(pattern = "yyyy/MM/dd HH:mm:ss", timezone = "GMT+8")
private Date refTime_act;

View File

@ -811,15 +811,6 @@ public class GammaFileUtil {
SimpleMatrix calMatrix = new SimpleMatrix(fwhmcCalFcnEval.rowNum, fwhmcCalFcnEval.colNum, true, array2);
//计算后的矩阵 / dE矩阵 得到除后的矩阵
SimpleMatrix matrixC = calMatrix.elementDiv(dEMatrix);
//声明一个集合接收除后的矩阵数据
// List<Double> values = new LinkedList<>();
//遍历相除后的矩阵 行数
// for (int i=0; i<matrixC.numRows(); i++) {
// //遍历相除后的矩阵 列数
// for (int j=0; j<matrixC.numCols(); i++){
// values.add(matrixC.get(i, j));
// }
// }
//取除后矩阵的第一个数据
double fwhmc = matrixC.get(0, 0);
//取计算后的矩阵第一个数据
@ -1278,7 +1269,7 @@ public class GammaFileUtil {
regChan.add(d);
d += 0.25;
}
List<Double> t_base = vBase.subList(peak.left, peak.right + 1);
List<Double> t_base = vBase.subList(peak.left-1, peak.right);
List<Double> regPeak = CalValuesHandler.interp1(peak, t_base, regChan);
if(bEnergy) {
@ -3703,7 +3694,15 @@ public class GammaFileUtil {
}
//重新计算各个peak的左值 右值 multiIndex
StructInsertOutput structInsertOutput = CalValuesHandler.ComputePeakRange(phd.getVPeak().size(), (int) phd.getSpec().getNum_g_channel(), vCentroid, vFwhmCh, vTail, vUpperTail);
System.out.println(structInsertOutput.vLeft.size());
if (CollectionUtils.isNotEmpty(structInsertOutput.vLeft) && CollectionUtils.isNotEmpty(structInsertOutput.vRight) && CollectionUtils.isNotEmpty(structInsertOutput.multiIndex)) {
for (int i=0; i<structInsertOutput.vLeft.size(); i++) {
PeakInfo peakInfo = phd.getVPeak().get(i);
peakInfo.left = structInsertOutput.vLeft.get(i).intValue();
peakInfo.right = structInsertOutput.vRight.get(i).intValue();
peakInfo.multiIndex = structInsertOutput.multiIndex.get(i).intValue();
}
}
}
public int FindNearPeak(List<PeakInfo> vPeak, int channel, boolean bFind) {

View File

@ -45,4 +45,6 @@ public class StructInsertOutput implements Serializable {
public List<Double> vCentroid;
public List<Double> multiIndex;
}

View File

@ -1,5 +1,6 @@
package org.jeecg.modules.native_jni;
import org.jeecg.modules.entity.vo.BgCalibratePara;
import org.jeecg.modules.native_jni.struct.*;
import java.util.List;
@ -48,6 +49,16 @@ public class EnergySpectrumHandler {
*/
public static native BgAnalyseResult bgAnalyse(String sampleFile, String gasFile, String detFile);
/**
* BetaGamma 重新分析算法
* @param sampleFile
* @param gasFile
* @param detFile
* @param BgCalPara
* @return
*/
public static native BgAnalyseResult bgReAnalyse(String sampleFile, String gasFile, String detFile, BgCalibratePara BgCalPara);
/**
* 获取健康状态谱原始数据
* @param path 能谱文件路径

View File

@ -80,13 +80,13 @@ public class GammaController {
@GetMapping("configure")
@ApiOperation(value = "analyze菜单下configure页面数据", notes = "analyze菜单下configure页面数据")
public Result configure(Integer sampleId, String fileName) {
return gammaService.configure(sampleId, fileName);
public Result configure(Integer sampleId, String fileName, HttpServletRequest request) {
return gammaService.configure(sampleId, fileName, request);
}
@PostMapping("configureSave")
public Result configureSave(@RequestBody ConfigureData configureData) {
return gammaService.configureSave(configureData);
public Result configureSave(@RequestBody ConfigureData configureData, HttpServletRequest request) {
return gammaService.configureSave(configureData, request);
}
@PostMapping("Reprocessing")
@ -103,8 +103,8 @@ public class GammaController {
@GetMapping("insertPeak")
@ApiOperation(value = "InteractiveTool页面Insert按钮页面", notes = "InteractiveTool页面Insert按钮页面")
public Result insertPeak(Integer sampleId, String fileName, Integer curChan) {
return gammaService.insertPeak(sampleId, fileName, curChan);
public Result insertPeak(Integer sampleId, String fileName, Integer curChan, HttpServletRequest request) {
return gammaService.insertPeak(sampleId, fileName, curChan, request);
}
@PostMapping("acceptResults")
@ -133,32 +133,32 @@ public class GammaController {
@PostMapping("deleteNuclide")
@ApiOperation(value = "InteractiveTool页面删除核素信息接口", notes = "InteractiveTool页面删除核素信息接口")
public Result deleteNuclide(@RequestBody NuclideInfo nuclideInfo) {
return gammaService.deleteNuclide(nuclideInfo.getCurRow(), nuclideInfo.getNuclideName(), nuclideInfo.getFileName(), nuclideInfo.getList_identify());
public Result deleteNuclide(@RequestBody NuclideInfo nuclideInfo, HttpServletRequest request) {
return gammaService.deleteNuclide(nuclideInfo.getCurRow(), nuclideInfo.getNuclideName(), nuclideInfo.getFileName(), nuclideInfo.getList_identify(), request);
}
@GetMapping("viewPeakComment")
@ApiOperation(value = "InteractiveTool页面查看峰对应备注信息接口", notes = "InteractiveTool页面查看峰对应备注信息接口")
public Result viewPeakComment(String fileName, int curRow) {
return gammaService.viewPeakComment(fileName, curRow);
public Result viewPeakComment(String fileName, int curRow, HttpServletRequest request) {
return gammaService.viewPeakComment(fileName, curRow, request);
}
@PostMapping("addPeakComment")
@ApiOperation(value = "InteractiveTool页面add峰对应备注信息接口", notes = "InteractiveTool页面add峰对应备注信息接口")
public Result addPeakComment(@RequestBody CommentsInfo commentsInfo) {
return gammaService.addPeakComment(commentsInfo.getFileName(), commentsInfo.getCurRow(), commentsInfo.getComments());
public Result addPeakComment(@RequestBody CommentsInfo commentsInfo, HttpServletRequest request) {
return gammaService.addPeakComment(commentsInfo.getFileName(), commentsInfo.getCurRow(), commentsInfo.getComments(), request);
}
@GetMapping("viewGeneralComment")
@ApiOperation(value = "InteractiveTool页面查看备注信息接口", notes = "InteractiveTool页面查看备注信息接口")
public Result viewGeneralComment(String fileName) {
return gammaService.viewGeneralComment(fileName);
public Result viewGeneralComment(String fileName, HttpServletRequest request) {
return gammaService.viewGeneralComment(fileName, request);
}
@PostMapping("addGeneralComment")
@ApiOperation(value = "InteractiveTool页面add备注信息接口", notes = "InteractiveTool页面add备注信息接口")
public Result addGeneralComment(@RequestBody CommentsInfo commentsInfo) {
return gammaService.addGeneralComment(commentsInfo.getFileName(), commentsInfo.getComments());
public Result addGeneralComment(@RequestBody CommentsInfo commentsInfo, HttpServletRequest request) {
return gammaService.addGeneralComment(commentsInfo.getFileName(), commentsInfo.getComments(), request);
}
@GetMapping("nuclideReview")
@ -220,20 +220,20 @@ public class GammaController {
@GetMapping("energyCalibration")
@ApiOperation(value = "查看Energy Calibration数据", notes = "查看Energy Calibration数据")
public Result energyCalibration(Integer sampleId, String fileName, String currentText, Double width) {
return gammaService.energyCalibration(sampleId, fileName, currentText, width);
public Result energyCalibration(Integer sampleId, String fileName, String currentText, Double width, HttpServletRequest request) {
return gammaService.energyCalibration(sampleId, fileName, currentText, width, request);
}
@PostMapping("changeDataEnergy")
@ApiOperation(value = "修改Energy Calibration数据", notes = "修改Energy Calibration数据")
public Result changeDataEnergy(@RequestBody ChangeData changeData) {
return gammaService.changeDataEnergy(changeData.getM_vCurCentroid(), changeData.getM_vCurEnergy(), changeData.getM_vCurUncert(), changeData.getM_curParam(), changeData.getSampleId(), changeData.getFileName(), changeData.getWidth());
public Result changeDataEnergy(@RequestBody ChangeData changeData, HttpServletRequest request) {
return gammaService.changeDataEnergy(changeData.getM_vCurCentroid(), changeData.getM_vCurEnergy(), changeData.getM_vCurUncert(), changeData.getM_curParam(), changeData.getSampleId(), changeData.getFileName(), changeData.getWidth(), request);
}
@PostMapping("applyDataEnergy")
@ApiOperation(value = "Apply Energy Calibration数据", notes = "Apply Energy Calibration数据")
public Result applyDataEnergy(@RequestBody ChangeData changeData) {
return gammaService.applyDataEnergy(changeData.getM_vCurCentroid(), changeData.getM_vCurEnergy(), changeData.getM_vCurUncert(), changeData.getM_curParam(), changeData.getCurCalName(), changeData.getSampleId(), changeData.getFileName());
public Result applyDataEnergy(@RequestBody ChangeData changeData, HttpServletRequest request) {
return gammaService.applyDataEnergy(changeData.getM_vCurCentroid(), changeData.getM_vCurEnergy(), changeData.getM_vCurUncert(), changeData.getM_curParam(), changeData.getCurCalName(), changeData.getSampleId(), changeData.getFileName(), request);
}
@PostMapping("saveDataEnergy")
@ -250,26 +250,26 @@ public class GammaController {
@PutMapping("setCurrentEnergy")
@ApiOperation(value = "Energy Calibration页面set to current按钮", notes = "Energy Calibration页面set to current按钮")
public Result setCurrentEnergy(String fileName, String currentName) {
return gammaService.setCurrentEnergy(fileName, currentName);
public Result setCurrentEnergy(String fileName, String currentName, HttpServletRequest request) {
return gammaService.setCurrentEnergy(fileName, currentName, request);
}
@GetMapping("resolutionCalibration")
@ApiOperation(value = "查看Resolution Calibration数据", notes = "查看Resolution Calibration数据")
public Result resolutionCalibration(Integer sampleId, String fileName, String currentText, Double width) {
return gammaService.resolutionCalibration(sampleId, fileName, currentText, width);
public Result resolutionCalibration(Integer sampleId, String fileName, String currentText, Double width, HttpServletRequest request) {
return gammaService.resolutionCalibration(sampleId, fileName, currentText, width, request);
}
@PostMapping("changeDataResolution")
@ApiOperation(value = "修改Resolution Calibration数据", notes = "修改Resolution Calibration数据")
public Result changeDataResolution(@RequestBody ChangeData changeData) {
return gammaService.changeDataResolution(changeData.getM_vCurReso(), changeData.getM_vCurEnergy(), changeData.getM_vCurUncert(), changeData.getM_curParam(), changeData.getSampleId(), changeData.getFileName(), changeData.getWidth());
public Result changeDataResolution(@RequestBody ChangeData changeData, HttpServletRequest request) {
return gammaService.changeDataResolution(changeData.getM_vCurReso(), changeData.getM_vCurEnergy(), changeData.getM_vCurUncert(), changeData.getM_curParam(), changeData.getSampleId(), changeData.getFileName(), changeData.getWidth(), request);
}
@PostMapping("applyDataResolution")
@ApiOperation(value = "Apply Resolution Calibration数据", notes = "Apply Resolution Calibration数据")
public Result applyDataResolution(@RequestBody ChangeData changeData) {
return gammaService.applyDataResolution(changeData.getM_vCurReso(), changeData.getM_vCurEnergy(), changeData.getM_vCurUncert(), changeData.getM_curParam(), changeData.getCurCalName(), changeData.getSampleId(), changeData.getFileName());
public Result applyDataResolution(@RequestBody ChangeData changeData, HttpServletRequest request) {
return gammaService.applyDataResolution(changeData.getM_vCurReso(), changeData.getM_vCurEnergy(), changeData.getM_vCurUncert(), changeData.getM_curParam(), changeData.getCurCalName(), changeData.getSampleId(), changeData.getFileName(), request);
}
@PostMapping("saveDataResolution")
@ -286,26 +286,26 @@ public class GammaController {
@PutMapping("setCurrentResolution")
@ApiOperation(value = "Resolution Calibration页面set to current按钮", notes = "Resolution Calibration页面set to current按钮")
public Result setCurrentResolution(String fileName, String currentName) {
return gammaService.setCurrentResolution(fileName, currentName);
public Result setCurrentResolution(String fileName, String currentName, HttpServletRequest request) {
return gammaService.setCurrentResolution(fileName, currentName, request);
}
@GetMapping("EfficiencyCalibration")
@ApiOperation(value = "查看Efficiency Calibration数据", notes = "查看Efficiency Calibration数据")
public Result EfficiencyCalibration(Integer sampleId, String fileName, String currentText, Double width) {
return gammaService.EfficiencyCalibration(sampleId, fileName, currentText, width);
public Result EfficiencyCalibration(Integer sampleId, String fileName, String currentText, Double width, HttpServletRequest request) {
return gammaService.EfficiencyCalibration(sampleId, fileName, currentText, width, request);
}
@PostMapping("changeDataEfficiency")
@ApiOperation(value = "修改Efficiency Calibration数据", notes = "修改Efficiency Calibration数据")
public Result changeDataEfficiency(@RequestBody ChangeData changeData) {
return gammaService.changeDataEfficiency(changeData.getM_vCurEffi(), changeData.getM_vCurEnergy(), changeData.getM_vCurUncert(), changeData.getM_curParam(), changeData.getFuncId(), changeData.getSampleId(), changeData.getFileName(), changeData.getWidth());
public Result changeDataEfficiency(@RequestBody ChangeData changeData, HttpServletRequest request) {
return gammaService.changeDataEfficiency(changeData.getM_vCurEffi(), changeData.getM_vCurEnergy(), changeData.getM_vCurUncert(), changeData.getM_curParam(), changeData.getFuncId(), changeData.getSampleId(), changeData.getFileName(), changeData.getWidth(), request);
}
@PostMapping("applyDataEfficiency")
@ApiOperation(value = "Apply Efficiency Calibration数据", notes = "Apply Efficiency Calibration数据")
public Result applyDataEfficiency(@RequestBody ChangeData changeData) {
return gammaService.applyDataEfficiency(changeData.getM_vCurEffi(), changeData.getM_vCurEnergy(), changeData.getM_vCurUncert(), changeData.getM_curParam(), changeData.getCurCalName(), changeData.getSampleId(), changeData.getFileName());
public Result applyDataEfficiency(@RequestBody ChangeData changeData, HttpServletRequest request) {
return gammaService.applyDataEfficiency(changeData.getM_vCurEffi(), changeData.getM_vCurEnergy(), changeData.getM_vCurUncert(), changeData.getM_curParam(), changeData.getCurCalName(), changeData.getSampleId(), changeData.getFileName(), request);
}
@PostMapping("saveDataEfficiency")
@ -322,8 +322,8 @@ public class GammaController {
@PutMapping("setCurrentEfficiency")
@ApiOperation(value = "Efficiency Calibration页面set to current按钮", notes = "Efficiency Calibration页面set to current按钮")
public Result setCurrentEfficiency(String fileName, String currentName) {
return gammaService.setCurrentEfficiency(fileName, currentName);
public Result setCurrentEfficiency(String fileName, String currentName, HttpServletRequest request) {
return gammaService.setCurrentEfficiency(fileName, currentName, request);
}
@GetMapping("NuclideLibrary")
@ -346,26 +346,25 @@ public class GammaController {
@GetMapping("viewComment")
@ApiOperation(value = "查看Comment页面数据", notes = "查看Comment页面数据")
public Result viewComment(Integer sampleId, String fileName) {
return gammaService.viewComment(sampleId, fileName);
public Result viewComment(Integer sampleId, String fileName, HttpServletRequest request) {
return gammaService.viewComment(sampleId, fileName, request);
}
@PutMapping("addComment")
@ApiOperation(value = "修改Comment数据", notes = "修改Comment数据")
public Result addComment(String fileName, String comment) {
return gammaService.addComment(fileName, comment);
public Result addComment(String fileName, String comment, HttpServletRequest request) {
return gammaService.addComment(fileName, comment, request);
}
@GetMapping("peakInformation")
@ApiOperation(value = "查看Peak Information页面数据", notes = "查看Peak Information页面数据")
public Result<?> peakInformation(Integer sampleId, String fileName){
return gammaService.peakInformation(sampleId, fileName);
public Result<?> peakInformation(Integer sampleId, String fileName, HttpServletRequest request){
return gammaService.peakInformation(sampleId, fileName, request);
}
@GetMapping("exportPeakInformation")
public void exportPeakInformation(Integer sampleId, String fileName,
HttpServletResponse response){
gammaService.exportPeakInformation(sampleId, fileName, response);
public void exportPeakInformation(Integer sampleId, String fileName, HttpServletRequest request, HttpServletResponse response){
gammaService.exportPeakInformation(sampleId, fileName, request, response);
}
@GetMapping("viewARR")
@ -381,59 +380,58 @@ public class GammaController {
@GetMapping("viewRRR")
@ApiOperation(value = "查看RRR页面数据", notes = "查看RRR页面数据")
public Result viewRRR(Integer sampleId, String fileName) {
return gammaService.viewRRR(sampleId, fileName);
public Result viewRRR(Integer sampleId, String fileName, HttpServletRequest request) {
return gammaService.viewRRR(sampleId, fileName, request);
}
@GetMapping("exportRRR")
public void exportRRR(Integer sampleId, String fileName, HttpServletResponse response) {
gammaService.exportRRR(sampleId, fileName, response);
public void exportRRR(Integer sampleId, String fileName, HttpServletRequest request, HttpServletResponse response) {
gammaService.exportRRR(sampleId, fileName, request, response);
}
@GetMapping("radionuclideActivity")
@ApiOperation(value = "查看Radionuclide Activity页面数据", notes = "查看Radionuclide Activity页面数据")
public Result radionuclideActivity(Integer sampleId, String fileName) {
return gammaService.radionuclideActivity(sampleId, fileName);
public Result radionuclideActivity(Integer sampleId, String fileName, HttpServletRequest request) {
return gammaService.radionuclideActivity(sampleId, fileName, request);
}
@GetMapping("exportRadionuclideActivity")
public void exportRadionuclideActivity(Integer sampleId, String fileName,
HttpServletResponse response){
gammaService.exportRadionuclideActivity(sampleId, fileName, response);
public void exportRadionuclideActivity(Integer sampleId, String fileName, HttpServletRequest request, HttpServletResponse response){
gammaService.exportRadionuclideActivity(sampleId, fileName, request, response);
}
@GetMapping("Spectrum")
@ApiOperation(value = "查看Spectrum页面数据", notes = "查看Spectrum页面数据")
public Result Spectrum(Integer sampleId, String fileName) {
return gammaService.Spectrum(sampleId, fileName);
public Result Spectrum(Integer sampleId, String fileName, HttpServletRequest request) {
return gammaService.Spectrum(sampleId, fileName, request);
}
@GetMapping("sampleInformation")
@ApiOperation(value = "查看Sample Information页面数据", notes = "查看Sample Information页面数据")
public Result<?> sampleInformation(Integer sampleId, String fileName){
return gammaService.sampleInformation(sampleId, fileName);
public Result<?> sampleInformation(Integer sampleId, String fileName, HttpServletRequest request){
return gammaService.sampleInformation(sampleId, fileName, request);
}
@GetMapping("exportSampleInformation")
public void exportSampleInformation(Integer sampleId, String fileName, HttpServletResponse response){
gammaService.exportSampleInformation(sampleId, fileName, response);
public void exportSampleInformation(Integer sampleId, String fileName, HttpServletRequest request, HttpServletResponse response){
gammaService.exportSampleInformation(sampleId, fileName, request, response);
}
@GetMapping("viewQCResult")
@ApiOperation(value = "查看QC Result页面数据", notes = "查看QC Result页面数据")
public Result<?> viewQCResult(Integer sampleId, String fileName){
return gammaService.viewQCResult(sampleId, fileName);
public Result<?> viewQCResult(Integer sampleId, String fileName, HttpServletRequest request){
return gammaService.viewQCResult(sampleId, fileName, request);
}
@GetMapping("exportQCResult")
public void exportQCResult(Integer sampleId, String fileName,HttpServletResponse response){
gammaService.exportQCResult(sampleId,fileName,response);
public void exportQCResult(Integer sampleId, String fileName, HttpServletRequest request, HttpServletResponse response){
gammaService.exportQCResult(sampleId,fileName, request, response);
}
@GetMapping("viewRLR")
@ApiOperation(value = "查看RLR页面数据", notes = "查看RLR页面数据")
public Result viewRLR(Integer sampleId, String fileName) {
return gammaService.viewRLR(sampleId, fileName);
public Result viewRLR(Integer sampleId, String fileName, HttpServletRequest request) {
return gammaService.viewRLR(sampleId, fileName, request);
}
@PostMapping ("exportRLR")
@ -450,14 +448,14 @@ public class GammaController {
@GetMapping("viewGammaViewerLog")
@ApiOperation(value = "查看Gamma Viewer Log页面数据", notes = "查看Gamma Viewer Log页面数据")
public Result viewGammaviewerLog(Integer sampleId, String fileName) {
return gammaService.viewGammaviewerLog(sampleId, fileName);
public Result viewGammaviewerLog(Integer sampleId, String fileName, HttpServletRequest request) {
return gammaService.viewGammaviewerLog(sampleId, fileName, request);
}
@GetMapping("clickPeakInformation")
@ApiOperation(value = "gamma主页面点击peakInformation返回信息接口", notes = "gamma主页面点击peakInformation返回信息接口")
public Result clickPeakInformation(String fileName, int index) {
return gammaService.clickPeakInformation(fileName, index);
public Result clickPeakInformation(String fileName, int index, HttpServletRequest request) {
return gammaService.clickPeakInformation(fileName, index, request);
}
@GetMapping("viewColorConfig")
@ -478,4 +476,9 @@ public class GammaController {
return gammaService.saveToDB(fileName, request);
}
@GetMapping("saveTxt")
public Result saveTxt(String fileName, HttpServletRequest request) {
return null;
}
}

View File

@ -1,71 +0,0 @@
package org.jeecg.modules.entity.vo;
import java.io.Serializable;
import java.util.LinkedList;
import java.util.List;
public class PeakInfo implements Serializable {
public int index; //峰序号
public int multiIndex; //重峰序号
public int left; //峰的左边界
public int right; //峰的右边界
public double peakCentroid; //峰拟合后加权峰中心道
public double energy;
public double fwhmc; //半高宽
public double fwhm; //以keV为单位的半高宽
public double area; //净面积
public double areaErr; //
public double efficiency;
public double lc;
public double ld;
public double meanBackCount;
public double backgroundArea;
public double significance;
public double sensitivity;
public double stepRatio;
public double tail;
public double tailAlpha;
public double upperTail;
public double upperTailAlpha;
public double BWWidthChan;
public String recoilBetaChan;
public String recoilDeltaChan;
public String comments;
public List<String> nuclides;
public PeakInfo(){
nuclides = new LinkedList<>();
comments = "";
recoilBetaChan = "1";
recoilDeltaChan = "1";
}
}

View File

@ -1,60 +0,0 @@
package org.jeecg.modules.entity.vo;
import java.io.Serializable;
import java.util.List;
public class StructInsertInput implements Serializable {
//-----------------input:------------------
public List<Double> peakCentroid;
public List<Double> fwhmc;
public List<Double> tail;
public List<Double> tailAlpha;
public List<Double> upperTail;
public List<Double> upperTailAlpha;
public List<Double> area;
public List<Double> stepRatio;
public List<Double> usedEnerPara;
public List<Double> usedResoPara;
public List<Double> usedEffiPara;
public long num_g_channel;
public long begin_channel;
public List<Double> XCtrl;
public List<Double> YCtrl;
public List<Double> YSlope;
public int rg_low;
public int rg_high;
public List<Double> para_tail;
public List<Double> para_tailAlpha;
public List<Double> para_tailRight;
public List<Double> para_tailRightAlpha;
public List<Double> para_stepRatio;
public int curChan;
public List<Double> vCount;
}

View File

@ -1,48 +0,0 @@
package org.jeecg.modules.entity.vo;
import java.io.Serializable;
import java.util.List;
public class StructInsertOutput implements Serializable {
//-----------------output:------------------
public List<Double> peakCentroid;
public List<Double> energy;
public List<Double> area;
public List<Double> sensitivity;
public List<Double> fwhm;
public List<Double> fwhmc;
public List<Double> stepRatio;
public List<Double> tail;
public List<Double> tailAlpha;
public List<Double> upperTail;
public List<Double> upperTailAlpha;
public List<Double> efficiency;
public List<Double> BWWidthChan;
public List<Double> recoilBetaChan;
public List<Double> recoilDeltaChan;
public List<Double> vIdx;
public List<Double> vLeft;
public List<Double> vRight;
public List<Double> vCentroid;
}

View File

@ -1,30 +0,0 @@
package org.jeecg.modules.native_jni;
import org.jeecg.modules.entity.vo.PeakInfo;
import org.jeecg.modules.entity.vo.StructInsertInput;
import org.jeecg.modules.entity.vo.StructInsertOutput;
import org.jeecg.modules.native_jni.struct.CalValuesOut;
import java.util.List;
public class CalValuesHandler {
public static native CalValuesOut calFcnEval(List<Double> x, List<Double> para);
public static native CalValuesOut energyToChannel(List<Double> energy, List<Double> para);
public static native CalValuesOut calDerivEval(List<Double> channel, List<Double> para);
public static native double calDerivaOut(double Chan, List<Double> p);
public static native List<Double> interp1(PeakInfo peak, List<Double> t_base, List<Double> regChan);
public static native StructInsertOutput insertPeaks(StructInsertInput structInsertInput);
public static native List<Double> calFitPara(String type, int funcId, List<Double> x, List<Double> y, List<Double> err);
public static native StructInsertOutput ComputePeakRange(int peakSize, int m_nCount, List<Double> vCentroid, List<Double> vFwhmCh, List<Double> vTail, List<Double> vUpperTail);
public static native String analyseSpectrum(String phd, String mapLines, String phdFilePath, AnalysisProcess process);
}

View File

@ -1,65 +0,0 @@
package org.jeecg.modules.native_jni;
import org.jeecg.modules.entity.vo.BgCalibratePara;
import org.jeecg.modules.native_jni.struct.BgAnalyseResult;
import org.jeecg.modules.native_jni.struct.BgBoundary;
import org.jeecg.modules.native_jni.struct.CalcBgBoundaryParam;
import org.jeecg.modules.native_jni.struct.EnergySpectrumStruct;
import java.util.List;
/**
* 能谱处理本地类
*/
public class EnergySpectrumHandler {
/**
* 获取能谱原始数据
* @param path 能谱文件路径
* @return 能谱原始数据
*/
public static native EnergySpectrumStruct getSourceData(String path);
/**
* 根据不同的拟合方法计算边界值 默认2次拟合 可以继承书写新的拟合
* @param calcBgBoundaryParam
* @return
*/
public static native BgBoundary CalcBgBoundary(CalcBgBoundaryParam calcBgBoundaryParam);
/**
* 获取 Energy
* @param centroid_channel
* @param g_energy
* @return
*/
public static native List<Double> GetFileFittingPara(List<Double> g_energy, List<Double> centroid_channel);
/**
* 根据channel 获取 Energy
* @param centroid_channel
* @param fittingPara
* @return
*/
public static native List<Double> GetFileFittingData(List<Double> centroid_channel, List<Double> fittingPara);
/**
* BetaGamma 分析算法
* @param sampleFile 样品谱文件
* @param gasFile 气体谱文件
* @param detFile 探测器本地谱文件
* @return
*/
public static native BgAnalyseResult bgAnalyse(String sampleFile, String gasFile, String detFile);
/**
* BetaGamma 重新分析算法
* @param sampleFile
* @param gasFile
* @param detFile
* @param BgCalPara
* @return
*/
public static native BgAnalyseResult bgReAnalyse(String sampleFile, String gasFile, String detFile, BgCalibratePara BgCalPara);
}

View File

@ -1,89 +0,0 @@
package org.jeecg.modules.native_jni.struct;
import java.util.List;
public class AllGenerate {
//BgGasGenerate BgGas;
private List<Integer> g_ROI_B_Boundary_start;
private List<Integer> g_ROI_B_Boundary_stop;
private List<Integer> g_ROI_G_Boundary_start;
private List<Integer> g_ROI_G_Boundary_stop;
private List<Double> g_roi_cts; //气体本底谱感兴趣区计数
private List<Double> g_deduct_d_cts; //气体本底谱扣除探测器本底谱数据
private int g_b_fitting_type;
private int g_g_fitting_type;
private List<Double> g_b_fitting_e_c;
private List<Double> g_g_fitting_e_c;
private List<Double> g_b_fitting_c_e;
private List<Double> g_g_fitting_c_e;
//BgSampleGenerate BgSample;
// private BgBoundary s_boungdary;
private List<Integer> s_ROI_B_Boundary_start;
private List<Integer> s_ROI_B_Boundary_stop;
private List<Integer> s_ROI_G_Boundary_start;
private List<Integer> s_ROI_G_Boundary_stop;
private List<Double> s_roi_cts; //样品普感兴趣区计数
private List<Double> s_deduct_d_cts; //样品谱扣除探测器本底谱数据
private int s_b_fitting_type;
private int s_g_fitting_type;
private List<Double> s_b_fitting_e_c;
private List<Double> s_g_fitting_e_c;
private List<Double> s_b_fitting_c_e;
private List<Double> s_g_fitting_c_e;
private String s_collection_time; //采集时间
//BgOtherGenerate BgOther;
private List<Double> ROI_net_coutns; //感兴趣区净计数
private List<Double> ROI_net_err;
private List<Double> ROI_con_uncer; //感兴趣区浓度和不确定度 [n..0]浓度 [n..1]不确定度
private List<Double> ROI_con_counts_factor; //感兴趣区浓度计数系数 [n..0]系数
//enum XeType{both,_131m,_133m,none};
private int XeType;
private double LC_Xe135; //LC XE135
private double LC_Xe131m; //LC XE131m
private double LC_Xe133m; //LC XE133m
private double LC_Xe133; //LC XE133
private List<Double> LC;
private List<Double> LC_CTS;
private double MDC_Xe135; //MDC XE135
private double MDC_Xe131m; //MDC XE131m
private double MDC_Xe133m; //MDC XE133m
private double MDC_Xe133; //MDC XE133
private List<Double> MDC;
private List<Double> MDC_CTS;
private double Xe135_con; //135不浓度
private double Xe135_uncer; //135不确定度
private double Xe131m_con;
private double Xe131m_uncer;
private double Xe133m_con;
private double Xe133m_uncer;
private double Xe133_con;
private double Xe133_uncer;
private List<Integer> ROI_B_Boundary_start;
private List<Integer> ROI_B_Boundary_stop;
private List<Integer> ROI_G_Boundary_start;
private List<Integer> ROI_G_Boundary_stop;
private List<Double> d_roi_cts; //探测器本底谱感兴趣区计数
// 拟合后值
private int b_fitting_type;
private int g_fitting_type;
private List<Double> b_fitting_e_c;
private List<Double> g_fitting_e_c;
private List<Double> b_fitting_c_e;
private List<Double> g_fitting_c_e;
//BgDetbgrGenerate BgDetbgr;
private List<Integer> d_ROI_B_Boundary_start;
private List<Integer> d_ROI_B_Boundary_stop;
private List<Integer> d_ROI_G_Boundary_start;
private List<Integer> d_ROI_G_Boundary_stop;
private List<Double> d_d_roi_cts; //探测器本底谱感兴趣区计数
private int d_b_fitting_type;
private int d_g_fitting_type;
private List<Double> d_b_fitting_e_c;
private List<Double> d_g_fitting_e_c;
private List<Double> d_b_fitting_c_e;
private List<Double> d_g_fitting_c_e;
}

View File

@ -1,191 +0,0 @@
package org.jeecg.modules.native_jni.struct;
import java.util.List;
public class BgAnalyseResult {
/************************** GARDS_XE_RESULTS START**************************/
/************************** XE_131m **************************/
public double Xe131m_con;
public double Xe131m_uncer;
public double MDC_Xe131m;
public double LC_Xe131m;
public int XE_131m_NID_FLAG;
/************************** XE_133 **************************/
public double Xe133_con;
public double Xe133_uncer;
public double MDC_Xe133;
public double LC_Xe133;
public int XE_133_NID_FLAG;
/************************** XE_133m **************************/
public double Xe133m_con;
public double Xe133m_uncer;
public double MDC_Xe133m;
public double LC_Xe133m;
public int XE_133m_NID_FLAG;
/************************** XE_135 **************************/
public double Xe135_con;
public double Xe135_uncer;
public double MDC_Xe135;
public double LC_Xe135;
public int XE_135_NID_FLAG;
/************************** GARDS_XE_RESULTS end **************************/
/************************** GARDS_ROI_RESULTS START**************************/
public List<Integer> ROI;
public List<Double> LC;
public List<Double> s_roi_cts;
public List<Double> g_roi_cts;
public List<Double> d_roi_cts;
public List<Double> s_deduct_d_cts;
public List<Double> g_deduct_d_cts;
public List<Double> ROI_net_coutns;
public List<Double> ROI_net_coutns_err;
public List<Double> ROI_con_uncer;
public List<Double> ROI_con_uncer_err;
public List<Double> MDC;
public List<Integer> dNidFlag;
public List<Double> LC_CTS;
/************************** GARDS_ROI_RESULTS end **************************/
/************************** GARDS_CALIBRATION START**************************/
public List<Double> s_b_fitting_e_c;
public int s_b_fitting_type;
public String s_b_fitting_type_def;
public List<Double> s_g_fitting_e_c;
public int s_g_fitting_type;
public String s_g_fitting_type_def;
public List<Double> s_b_fitting_c_e;
public List<Double> s_g_fitting_c_e;
public List<Double> g_b_fitting_e_c;
public int g_b_fitting_type;
public String g_b_fitting_type_def;
public List<Double> g_g_fitting_e_c;
public int g_g_fitting_type;
public String g_g_fitting_type_def;
public List<Double> g_b_fitting_c_e;
public List<Double> g_g_fitting_c_e;
public List<Double> d_b_fitting_e_c;
public int d_b_fitting_type;
public String d_b_fitting_type_def;
public List<Double> d_g_fitting_e_c;
public int d_g_fitting_type;
public String d_g_fitting_type_def;
public List<Double> d_b_fitting_c_e;
public List<Double> d_g_fitting_c_e;
/************************** GARDS_CALIBRATION end **************************/
/************************** GARDS_ROI_CHANNELS START**************************/
public List<Integer> S_ROI;
public List<Integer> S_ROI_B_Boundary_start;
public List<Integer> S_ROI_B_Boundary_stop;
public List<Integer> S_ROI_G_Boundary_start;
public List<Integer> S_ROI_G_Boundary_stop;
public List<Integer> G_ROI;
public List<Integer> G_ROI_B_Boundary_start;
public List<Integer> G_ROI_B_Boundary_stop;
public List<Integer> G_ROI_G_Boundary_start;
public List<Integer> G_ROI_G_Boundary_stop;
public List<Integer> D_ROI;
public List<Integer> D_ROI_B_Boundary_start;
public List<Integer> D_ROI_B_Boundary_stop;
public List<Integer> D_ROI_G_Boundary_start;
public List<Integer> D_ROI_G_Boundary_stop;
/************************** GARDS_ROI_CHANNELS end **************************/
/**
* 分析结果标记true成功false失败
*/
public boolean analyse_flag;
/**
* 失败原因
*/
public String error_log;
@Override
public String toString() {
return "BgAnalyseResult{" +
"Xe131m_con=" + Xe131m_con +
", Xe131m_uncer=" + Xe131m_uncer +
", MDC_Xe131m=" + MDC_Xe131m +
", LC_Xe131m=" + LC_Xe131m +
", XE_131m_NID_FLAG=" + XE_131m_NID_FLAG +
", Xe133_con=" + Xe133_con +
", Xe133_uncer=" + Xe133_uncer +
", MDC_Xe133=" + MDC_Xe133 +
", LC_Xe133=" + LC_Xe133 +
", XE_133_NID_FLAG=" + XE_133_NID_FLAG +
", Xe133m_con=" + Xe133m_con +
", Xe133m_uncer=" + Xe133m_uncer +
", MDC_Xe133m=" + MDC_Xe133m +
", LC_Xe133m=" + LC_Xe133m +
", XE_133m_NID_FLAG=" + XE_133m_NID_FLAG +
", Xe135_con=" + Xe135_con +
", Xe135_uncer=" + Xe135_uncer +
", MDC_Xe135=" + MDC_Xe135 +
", LC_Xe135=" + LC_Xe135 +
", XE_135_NID_FLAG=" + XE_135_NID_FLAG +
", ROI=" + ROI +
", LC=" + LC +
", s_roi_cts=" + s_roi_cts +
", g_roi_cts=" + g_roi_cts +
", d_roi_cts=" + d_roi_cts +
", s_deduct_d_cts=" + s_deduct_d_cts +
", g_deduct_d_cts=" + g_deduct_d_cts +
", ROI_net_coutns=" + ROI_net_coutns +
", ROI_net_coutns_err=" + ROI_net_coutns_err +
", ROI_con_uncer=" + ROI_con_uncer +
", ROI_con_uncer_err=" + ROI_con_uncer_err +
", MDC=" + MDC +
", dNidFlag=" + dNidFlag +
", LC_CTS=" + LC_CTS +
", s_b_fitting_e_c=" + s_b_fitting_e_c +
", s_b_fitting_type=" + s_b_fitting_type +
", s_b_fitting_type_def='" + s_b_fitting_type_def + '\'' +
", s_g_fitting_e_c=" + s_g_fitting_e_c +
", s_g_fitting_type=" + s_g_fitting_type +
", s_g_fitting_type_def='" + s_g_fitting_type_def + '\'' +
", s_b_fitting_c_e=" + s_b_fitting_c_e +
", s_g_fitting_c_e=" + s_g_fitting_c_e +
", g_b_fitting_e_c=" + g_b_fitting_e_c +
", g_b_fitting_type=" + g_b_fitting_type +
", g_b_fitting_type_def='" + g_b_fitting_type_def + '\'' +
", g_g_fitting_e_c=" + g_g_fitting_e_c +
", g_g_fitting_type=" + g_g_fitting_type +
", g_g_fitting_type_def='" + g_g_fitting_type_def + '\'' +
", g_b_fitting_c_e=" + g_b_fitting_c_e +
", g_g_fitting_c_e=" + g_g_fitting_c_e +
", d_b_fitting_e_c=" + d_b_fitting_e_c +
", d_b_fitting_type=" + d_b_fitting_type +
", d_b_fitting_type_def='" + d_b_fitting_type_def + '\'' +
", d_g_fitting_e_c=" + d_g_fitting_e_c +
", d_g_fitting_type=" + d_g_fitting_type +
", d_g_fitting_type_def='" + d_g_fitting_type_def + '\'' +
", d_b_fitting_c_e=" + d_b_fitting_c_e +
", d_g_fitting_c_e=" + d_g_fitting_c_e +
", S_ROI=" + S_ROI +
", S_ROI_B_Boundary_start=" + S_ROI_B_Boundary_start +
", S_ROI_B_Boundary_stop=" + S_ROI_B_Boundary_stop +
", S_ROI_G_Boundary_start=" + S_ROI_G_Boundary_start +
", S_ROI_G_Boundary_stop=" + S_ROI_G_Boundary_stop +
", G_ROI=" + G_ROI +
", G_ROI_B_Boundary_start=" + G_ROI_B_Boundary_start +
", G_ROI_B_Boundary_stop=" + G_ROI_B_Boundary_stop +
", G_ROI_G_Boundary_start=" + G_ROI_G_Boundary_start +
", G_ROI_G_Boundary_stop=" + G_ROI_G_Boundary_stop +
", D_ROI=" + D_ROI +
", D_ROI_B_Boundary_start=" + D_ROI_B_Boundary_start +
", D_ROI_B_Boundary_stop=" + D_ROI_B_Boundary_stop +
", D_ROI_G_Boundary_start=" + D_ROI_G_Boundary_start +
", D_ROI_G_Boundary_stop=" + D_ROI_G_Boundary_stop +
", analyse_flag=" + analyse_flag +
", error_log='" + error_log + '\'' +
'}';
}
}

View File

@ -1,21 +0,0 @@
package org.jeecg.modules.native_jni.struct;
import java.util.List;
/**
* 边界值
*/
public class BgBoundary {
/**
*/
public List<Integer> ROI_B_Boundary_start;
/**
*/
public List<Integer> ROI_B_Boundary_stop;
/**
*/
public List<Integer> ROI_G_Boundary_start;
/**
*/
public List<Integer> ROI_G_Boundary_stop;
}

View File

@ -1,13 +0,0 @@
package org.jeecg.modules.native_jni.struct;
import java.util.List;
public class CalValuesOut {
public int rowNum;
public int colNum;
public List<Double> counts;
}

View File

@ -1,75 +0,0 @@
package org.jeecg.modules.native_jni.struct;
import java.util.List;
public class CalcBgBoundaryParam {
/************************* BgROILimit ******************/
/**
* 2-D ROI β-range start, x 1 (keV)
*/
public List<Double> ROI_B_start_x1;
/**
* 2-D ROI β-range stop, x 2 (keV)
*/
public List<Double> ROI_B_stop_x2;
/**
* 2-D ROI γ-range start, y 1 (keV)
*/
public List<Double> ROI_G_start_y1;
/**
* 2-D ROI γ-range stop, y 2 (keV)
*/
public List<Double> ROI_G_stop_y2;
/************************* BgEnergyChannel ******************/
/**
* b_Energy:electron_energy kev 能量
*/
public List<Double> b_energy;
/**
* b_Energy channel
*/
public List<Double> b_channel;
/**
* g_Energy:g_energy kev 能量
*/
public List<Double> g_energy;
/**
* g_Energy:centroid_channel
*/
public List<Double> g_channel;
/************************* BgCalibratePara ******************/
/**
* b 能刻度系数
*/
public List<Double> b_e_cal;
/**
* g 能刻度系数
*/
public List<Double> g_e_cal;
/**
* b 自计算刻度系数配置
*/
int b_e_cal_flag = 2;
/**
* g 自计算刻度系数配置
*/
int g_e_cal_flag = 2;
/**
* 界面交互新刻度应用
*/
boolean bApplyNewCalicSample = false;
boolean bApplyNewCalicDetBg = false;
boolean bApplyNewCalicGasBg = false;
boolean bApplyNewCalicQc = false;
}

View File

@ -1,552 +0,0 @@
package org.jeecg.modules.native_jni.struct;
import java.util.List;
/**
* 能谱结构体字段信息
*/
public class EnergySpectrumStruct {
/************************* Infomations ******************/
/**
* 消息类型
*/
public String msg_type;
/**
* 消息id
*/
public String msg_id;
/**
* 数据类型
*/
public String data_type;
/************************* Header Black ******************/
/**
* designator
*/
public String designator;
/**
* site code
*/
public String site_code;
/**
* detector code
*/
public String detector_code;
/**
* system type: P for particulate; B for gas with 3-D β - γ coincidence detection; and
*/
public String system_type;
/**
* sample geometry
*/
public String sample_geometry;
/**
* spectrum qualifier: preliminary ( PREL )or full ( FULL)
*/
public String spectrum_quantity;
/**
* sample reference identification
*/
public String sample_ref_id;
/**
* measurement identification
*/
public String measurement_id;
/**
* detector background measurement identification
*/
public String detector_bk_measurement_id;
/**
* gas background measurement identification (memory effect)
*/
public String gas_bk_measurement_id;
/**
* transmit date (yyyy / mm / dd)
*/
public String transmit_date;
/**
* transmit time (hh : mm : ss . s)
*/
public String transmit_time;
/************************* Sample ******************/
public double dimension_1;
public double dimension_2;
/************************* Comment ******************/
public String comment;
/************************* Acquisition Block ******************/
/**
* acquisition start date (yyyy / mm / dd)
*/
public String acquisition_start_date;
/**
* acquisition start time (hh : mm : ss . s)
*/
public String acquisition_start_time;
/**
* acquisition real time (s)
*/
public double acquisition_real_time;
/**
* acquisition live time (s)
*/
public double acquisition_live_time;
/************************* Collection Block ******************/
/**
* collection start date (yyyy / mm / dd)
*/
public String collection_start_date;
/**
* collection start time (hh : mm : ss . s)
*/
public String collection_start_time;
/**
* collection stop date (yyyy / mm / dd)
*/
public String collection_stop_date;
/**
* collection stop time (hh : mm : ss . s)
*/
public String collection_stop_time;
/**
* total air volume sampled (standard cubic meters [scm])
*/
public double air_volume;
/************************* Processing Block ******************/
/**
* sample volume of Xe (cm 3 )
*/
public double sample_volume_of_Xe;
/**
* uncertainty (cm 3 )
*/
public double uncertainty_1;
/**
* Xe collection yield (Xe gas in sample/total Xe gas sampled)
*/
public double Xe_collection_yield;
/**
* uncertainty (Xe gas in sample/total Xe gas sampled)
*/
public double uncertainty_2;
/**
* archive bottle identification
*/
public String archive_bottle_id;
/************************* Calibration Block ******************/
/**
* date of last calibration (yyyy / mm / dd)
*/
public String date_calibration;
/**
* time of last calibration (hh : mm : ss)
*/
public String time_calibration;
/************************* g_Energy Block ******************/
/**
* γ -energy (keV)
*/
public List<Double> g_energy;
/**
* centroid channel
*/
public List<Double> g_centroid_channel;
/**
* uncertainty (channels)
*/
public List<Double> g_uncertainty;
public int g_record_count;
/************************* b_Energy Block ******************/
/**
* electron energy (keV)
*/
public List<Double> b_electron_energy;
/**
* decay mode descriptor: B for β-particle, C for conversion electron (CE)
*/
public List<String> b_decay_mode;
/**
* maximum channel of β-particle distribution or centroid channel of CE (channels)
*/
public List<Double> b_channel;
/**
* uncertainty (channels)
*/
public List<Double> b_uncertainty;
public int b_record_count;
/************************* g_Resolution Block ******************/
/**
* γ -energy (keV)
*/
public List<Double> g_r_energy;
/**
* FWHM (keV)
*/
public List<Double> g_r_FWHM;
/**
* uncertainty (keV)
*/
public List<Double> g_r_uncertainty;
public int g_r_record_count;
/************************* b_Resolution Block ******************/
/**
* electron energy (keV)
*/
public List<Double> b_r_electron_energy;
/**
* FWHM (keV)
*/
public List<Double> b_r_FWHM;
/**
* uncertainty (keV)
*/
public List<Double> b_r_uncertainty;
public int b_r_record_count;
/************************* g_Efficiency Block ******************/
/**
* γ -energy (keV)
*/
public List<Double> g_e_energy;
/**
* efficiency (counts in peak/photon emitted)
*/
public List<Double> g_e_efficiency;
/**
* uncertainty (counts in peak/photon emitted)
*/
public List<Double> g_e_uncertainty;
public int g_e_record_count;
/************************* ROI_Limits Block ******************/
/**
* ROI number
*/
public List<String> ROI_number;
/**
* 2-D ROI β-range start, x 1 (keV)
*/
public List<Double> POI_B_x1;
/**
* 2-D ROI β-range stop, x 2 (keV)
*/
public List<Double> POI_B_x2;
/**
* 2-D ROI γ-range start, y 1 (keV)
*/
public List<Double> POI_G_y1;
/**
* 2-D ROI γ-range stop, y 2 (keV)
*/
public List<Double> POI_G_y2;
public int roi_record_count;
/************************* b-gEfficiency Block ******************/
/**
* nuclide name
*/
public List<String> bg_nuclide_name;
/**
* ROI number
*/
public List<Double> bg_ROI_number;
/**
* β-γ coincidence efficiency (counts in ROI/β-γ pair emitted)
*/
public List<Double> bg_efficiency;
/**
* uncertainty (counts in ROI/β-γ pair emitted)
*/
public List<Double> bg_uncertainty;
public int bg_record_count;
/************************* Ratios Block ******************/
/**
* ratio identifier
*/
public List<String> ratio_id;
/**
* ROI number for the higher γ -energy ROI
*/
public List<String> ROI_num_highter_G_energy_ROI;
/**
* ROI number for the lower γ -energy ROI
*/
public List<String> ROI_num_lower_G_energy_ROI;
/**
* Q_DECLARE_METATYPE(RMSSOHData::HeaderBlock)count ratio(counts in higher γ -energy ROI/counts in lower γ -energy ROI)
*/
public List<Double> count_ratio;
/**
* count ratio uncertainty (percent)
*/
public List<Double> count_ratio_uncertainty;
public int ratio_record_count;
/************************* g_Spectrum Block ******************/
/**
* number of γ channels
*/
public long num_g_channel;
/**
* γ-energy span (keV)
*/
public long g_energy_span;
/**
* begin of channels
*/
public long g_begin_channel;
/**
* count at channel
*/
public List<Long> g_counts;
/************************* b_Spectrum Block ******************/
/**
* number of β -channels
*/
public long num_b_channel;
/**
* β -energy span (keV)
*/
public long b_energy_span;
/**
* begin of channels
*/
public long b_begin_channel;
/**
* counts at channels
*/
public List<Long> b_counts;
/************************* Histogram Block ******************/
/**
* β-channels
*/
public long b_channels;
/**
* γ-channels
*/
public long g_channels;
/**
* β-energy span
*/
public long b_h_energy_span;
/**
* γ-energy span
*/
public long g_h_energy_span;
/**
* counts at channels
*/
public List<Long> h_counts;
/************************* Certificate_Block ******************/
/**
* total source activity (Bq)
*/
public double total_source_activity;
/**
* assay date (yyyy / mm / dd)
*/
public String assay_date;
/**
* assay time (hh : mm : ss)
*/
public String assay_time;
/**
* units of activity: B, b for Bq or [blank]; if nothing, then B is assigned
*/
public String units_activity;
/**
* nuclide name
*/
public List<String> nuclide_name;
/**
* half-life in seconds, hours, days, or years
*/
public List<String> half_life_time;
/**
* time unit(Y, D, H, S)
*/
public List<String> time_unit;
/**
* activity of nuclide at time of assay
*/
public List<Double> activity_nuclide_time_assay;
/**
* uncertainty (%)
*/
public List<Double> uncertainty;
/**
* γ-energy (keV)
*/
public List<Double> cer_g_energy;
/**
* γ-intensity (percent)
*/
public List<Double> g_intensity;
/**
* electron decay mode descriptor: B for β particle or C for conversion electron (CE), 0 for none (that is, γ-only source)
*/
public List<String> electron_decay_mode;
/**
* maximum β-particle energy or CE energy (keV)
*/
public List<Double> maximum_energy;
/**
* intensity of β-particle (percent)
*/
public List<Double> intensity_b_particle;
public int record_count;
/************************* Totaleff Block ******************/
/**
* γ-energy (keV)
*/
public List<Double> t_g_energy;
/**
* total efficiency (counts/photon emitted)
*/
public List<Double> total_efficiency;
/**
* uncertainty (counts/photon emitted)
*/
public List<Double> t_uncertainty;
public int t_record_count;
public EnergySpectrumStruct() {
super();
}
@Override
public String toString() {
return "EnergySpectrumStruct{" +
"msg_type='" + msg_type + '\'' +
", msg_id='" + msg_id + '\'' +
", data_type='" + data_type + '\'' +
", designator='" + designator + '\'' +
", site_code='" + site_code + '\'' +
", detector_code='" + detector_code + '\'' +
", system_type='" + system_type + '\'' +
", sample_geometry='" + sample_geometry + '\'' +
", spectrum_quantity='" + spectrum_quantity + '\'' +
", sample_ref_id='" + sample_ref_id + '\'' +
", measurement_id='" + measurement_id + '\'' +
", detector_bk_measurement_id='" + detector_bk_measurement_id + '\'' +
", gas_bk_measurement_id='" + gas_bk_measurement_id + '\'' +
", transmit_date='" + transmit_date + '\'' +
", transmit_time='" + transmit_time + '\'' +
", comment='" + comment + '\'' +
", acquisition_start_date='" + acquisition_start_date + '\'' +
", acquisition_start_time='" + acquisition_start_time + '\'' +
", acquisition_real_time=" + acquisition_real_time +
", acquisition_live_time=" + acquisition_live_time +
", collection_start_date='" + collection_start_date + '\'' +
", collection_start_time='" + collection_start_time + '\'' +
", collection_stop_date='" + collection_stop_date + '\'' +
", collection_stop_time='" + collection_stop_time + '\'' +
", air_volume=" + air_volume +
", sample_volume_of_Xe=" + sample_volume_of_Xe +
", uncertainty_1=" + uncertainty_1 +
", Xe_collection_yield=" + Xe_collection_yield +
", uncertainty_2=" + uncertainty_2 +
", archive_bottle_id='" + archive_bottle_id + '\'' +
", date_calibration='" + date_calibration + '\'' +
", time_calibration='" + time_calibration + '\'' +
", g_energy=" + g_energy +
", g_centroid_channel=" + g_centroid_channel +
", g_uncertainty=" + g_uncertainty +
", g_record_count=" + g_record_count +
", b_electron_energy=" + b_electron_energy +
", b_decay_mode=" + b_decay_mode +
", b_channel=" + b_channel +
", b_uncertainty=" + b_uncertainty +
", b_record_count=" + b_record_count +
", g_r_energy=" + g_r_energy +
", g_r_FWHM=" + g_r_FWHM +
", g_r_uncertainty=" + g_r_uncertainty +
", g_r_record_count=" + g_r_record_count +
", b_r_electron_energy=" + b_r_electron_energy +
", b_r_FWHM=" + b_r_FWHM +
", b_r_uncertainty=" + b_r_uncertainty +
", b_r_record_count=" + b_r_record_count +
", g_e_energy=" + g_e_energy +
", g_e_efficiency=" + g_e_efficiency +
", g_e_uncertainty=" + g_e_uncertainty +
", g_e_record_count=" + g_e_record_count +
", ROI_number=" + ROI_number +
", POI_B_x1=" + POI_B_x1 +
", POI_B_x2=" + POI_B_x2 +
", POI_G_y1=" + POI_G_y1 +
", POI_G_y2=" + POI_G_y2 +
", roi_record_count=" + roi_record_count +
", bg_nuclide_name=" + bg_nuclide_name +
", bg_ROI_number=" + bg_ROI_number +
", bg_efficiency=" + bg_efficiency +
", bg_uncertainty=" + bg_uncertainty +
", bg_record_count=" + bg_record_count +
", ratio_id=" + ratio_id +
", ROI_num_highter_G_energy_ROI=" + ROI_num_highter_G_energy_ROI +
", ROI_num_lower_G_energy_ROI=" + ROI_num_lower_G_energy_ROI +
", count_ratio=" + count_ratio +
", count_ratio_uncertainty=" + count_ratio_uncertainty +
", ratio_record_count=" + ratio_record_count +
", num_g_channel=" + num_g_channel +
", g_energy_span=" + g_energy_span +
", g_begin_channel=" + g_begin_channel +
", g_counts=" + g_counts +
", num_b_channel=" + num_b_channel +
", b_energy_span=" + b_energy_span +
", b_begin_channel=" + b_begin_channel +
", b_counts=" + b_counts +
", b_channels=" + b_channels +
", g_channels=" + g_channels +
", b_h_energy_span=" + b_h_energy_span +
", g_h_energy_span=" + g_h_energy_span +
", h_counts=" + h_counts +
", total_source_activity=" + total_source_activity +
", assay_date='" + assay_date + '\'' +
", assay_time='" + assay_time + '\'' +
", units_activity='" + units_activity + '\'' +
", nuclide_name=" + nuclide_name +
", half_life_time=" + half_life_time +
", time_unit=" + time_unit +
", activity_nuclide_time_assay=" + activity_nuclide_time_assay +
", uncertainty=" + uncertainty +
", cer_g_energy=" + cer_g_energy +
", g_intensity=" + g_intensity +
", electron_decay_mode=" + electron_decay_mode +
", maximum_energy=" + maximum_energy +
", intensity_b_particle=" + intensity_b_particle +
", record_count=" + record_count +
'}';
}
public static void main(String[] args) {
EnergySpectrumStruct s = new EnergySpectrumStruct();
System.out.println(s);
System.out.println(s.gas_bk_measurement_id);
}
}

View File

@ -24,15 +24,15 @@ public interface IGammaService{
Result Strip(String fileName, String stripFileName, Double ratioRate, HttpServletRequest request);
Result configure(Integer sampleId, String fileName);
Result configure(Integer sampleId, String fileName, HttpServletRequest request);
Result configureSave(ConfigureData configureData);
Result configureSave(ConfigureData configureData, HttpServletRequest request);
Result Reprocessing(String fileName, HttpServletRequest request);
Result InteractiveTool(Integer sampleId, String fileName, HttpServletRequest request);
Result insertPeak(Integer sampleId, String fileName, Integer curChan);
Result insertPeak(Integer sampleId, String fileName, Integer curChan, HttpServletRequest request);
Result acceptResults(String fileName, boolean accept, List<PeakInfo> oldPeak, HttpServletRequest request);
@ -42,15 +42,15 @@ public interface IGammaService{
Result addNuclide(Integer curRow, String nuclideName, String fileName, List<String> list_identify, HttpServletRequest request);
Result deleteNuclide(Integer curRow, String nuclideName, String fileName, List<String> list_identify);
Result deleteNuclide(Integer curRow, String nuclideName, String fileName, List<String> list_identify, HttpServletRequest request);
Result viewPeakComment(String fileName, int curRow);
Result viewPeakComment(String fileName, int curRow, HttpServletRequest request);
Result addPeakComment(String fileName, int curRow, String comments);
Result addPeakComment(String fileName, int curRow, String comments, HttpServletRequest request);
Result viewGeneralComment(String fileName);
Result viewGeneralComment(String fileName, HttpServletRequest request);
Result addGeneralComment(String fileName, String comments);
Result addGeneralComment(String fileName, String comments, HttpServletRequest request);
Result nuclideReview(Integer sampleId, String fileName, Double channel, HttpServletRequest request);
@ -72,41 +72,41 @@ public interface IGammaService{
List<InputData> KorSumInput(CoeffData coeffData);
Result energyCalibration(Integer sampleId, String fileName, String currentText, Double width);
Result energyCalibration(Integer sampleId, String fileName, String currentText, Double width, HttpServletRequest request);
Result changeDataEnergy(List<Double> m_vCurCentroid, List<Double> m_vCurEnergy, List<Double> m_vCurUncert, ParameterInfo m_curParam, Integer sampleId, String fileName, Double width);
Result changeDataEnergy(List<Double> m_vCurCentroid, List<Double> m_vCurEnergy, List<Double> m_vCurUncert, ParameterInfo m_curParam, Integer sampleId, String fileName, Double width, HttpServletRequest request);
Result applyDataEnergy(List<Double> m_vCurCentroid, List<Double> m_vCurEnergy, List<Double> m_vCurUncert, ParameterInfo m_curParam, String curCalName, Integer sampleId, String fileName);
Result applyDataEnergy(List<Double> m_vCurCentroid, List<Double> m_vCurEnergy, List<Double> m_vCurUncert, ParameterInfo m_curParam, String curCalName, Integer sampleId, String fileName, HttpServletRequest request);
void saveDataEnergy(List<Double> m_vCurCentroid, List<Double> m_vCurEnergy, List<Double> m_vCurUncert, HttpServletResponse response);
Result callDataEnergy(MultipartFile file, String sampleFileName, Double width, String currentText);
Result setCurrentEnergy(String fileName, String currentName);
Result setCurrentEnergy(String fileName, String currentName, HttpServletRequest request);
Result resolutionCalibration(Integer sampleId, String fileName, String currentText, Double width);
Result resolutionCalibration(Integer sampleId, String fileName, String currentText, Double width, HttpServletRequest request);
Result changeDataResolution(List<Double> m_vCurReso, List<Double> m_vCurEnergy, List<Double> m_vCurUncert, ParameterInfo m_curParam, Integer sampleId, String fileName, Double width);
Result changeDataResolution(List<Double> m_vCurReso, List<Double> m_vCurEnergy, List<Double> m_vCurUncert, ParameterInfo m_curParam, Integer sampleId, String fileName, Double width, HttpServletRequest request);
Result applyDataResolution(List<Double> m_vCurReso, List<Double> m_vCurEnergy, List<Double> m_vCurUncert, ParameterInfo m_curParam, String curCalName, Integer sampleId, String fileName);
Result applyDataResolution(List<Double> m_vCurReso, List<Double> m_vCurEnergy, List<Double> m_vCurUncert, ParameterInfo m_curParam, String curCalName, Integer sampleId, String fileName, HttpServletRequest request);
void saveDataResolution(List<Double> m_vCurReso, List<Double> m_vCurEnergy, List<Double> m_vCurUncert, HttpServletResponse response);
Result callDataResolution(MultipartFile file, String sampleFileName, Double width, String currentText);
Result setCurrentResolution(String fileName, String currentName);
Result setCurrentResolution(String fileName, String currentName, HttpServletRequest request);
Result EfficiencyCalibration(Integer sampleId, String fileName, String currentText, Double width);
Result EfficiencyCalibration(Integer sampleId, String fileName, String currentText, Double width, HttpServletRequest request);
Result changeDataEfficiency(List<Double> m_vCurEffi, List<Double> m_vCurEnergy, List<Double> m_vCurUncert, ParameterInfo m_curParam, Integer funcId, Integer sampleId, String fileName, Double width);
Result changeDataEfficiency(List<Double> m_vCurEffi, List<Double> m_vCurEnergy, List<Double> m_vCurUncert, ParameterInfo m_curParam, Integer funcId, Integer sampleId, String fileName, Double width, HttpServletRequest request);
Result applyDataEfficiency(List<Double> m_vCurEffi, List<Double> m_vCurEnergy, List<Double> m_vCurUncert, ParameterInfo m_curParam, String curCalName, Integer sampleId, String fileName);
Result applyDataEfficiency(List<Double> m_vCurEffi, List<Double> m_vCurEnergy, List<Double> m_vCurUncert, ParameterInfo m_curParam, String curCalName, Integer sampleId, String fileName, HttpServletRequest request);
void saveDataEfficiency(List<Double> m_vCurEffi, List<Double> m_vCurEnergy, List<Double> m_vCurUncert, Integer funId, HttpServletResponse response);
Result callDataEfficiency(MultipartFile file, String sampleFileName, Double width, String currentText);
Result setCurrentEfficiency(String fileName, String currentName);
Result setCurrentEfficiency(String fileName, String currentName, HttpServletRequest request);
Result NuclideLibrary(Integer sampleId, String fileName, String editEnergy, double err, String libraryName, String nuclideName, HttpServletRequest request);
@ -114,46 +114,45 @@ public interface IGammaService{
Result saveUserLibrary(List<String> userLibraryName, String fileName, HttpServletRequest request);
Result viewComment(Integer sampleId, String fileName);
Result viewComment(Integer sampleId, String fileName, HttpServletRequest request);
Result addComment(String fileName, String comment);
Result addComment(String fileName, String comment, HttpServletRequest request);
Result<?> peakInformation(Integer sampleId, String fileName);
Result<?> peakInformation(Integer sampleId, String fileName, HttpServletRequest request);
void exportPeakInformation(Integer sampleId, String fileName, HttpServletResponse response);
void exportPeakInformation(Integer sampleId, String fileName, HttpServletRequest request, HttpServletResponse response);
void viewARR(Integer sampleId, HttpServletResponse response);
void exportARR(Integer sampleId, HttpServletResponse response);
Result viewRRR(Integer sampleId, String fileName);
Result viewRRR(Integer sampleId, String fileName, HttpServletRequest request);
void exportRRR(Integer sampleId, String fileName, HttpServletResponse response);
void exportRRR(Integer sampleId, String fileName, HttpServletRequest request, HttpServletResponse response);
Result<?> radionuclideActivity(Integer sampleId, String fileName);
Result<?> radionuclideActivity(Integer sampleId, String fileName, HttpServletRequest request);
void exportRadionuclideActivity(Integer sampleId, String fileName, HttpServletResponse response);
void exportRadionuclideActivity(Integer sampleId, String fileName, HttpServletRequest request, HttpServletResponse response);
Result Spectrum(Integer sampleId, String fileName);
Result Spectrum(Integer sampleId, String fileName, HttpServletRequest request);
Result<?> sampleInformation(Integer sampleId, String fileName);
Result<?> sampleInformation(Integer sampleId, String fileName, HttpServletRequest request);
void exportSampleInformation(Integer sampleId, String fileName,
HttpServletResponse response);
void exportSampleInformation(Integer sampleId, String fileName, HttpServletRequest request, HttpServletResponse response);
Result<?> viewQCResult(Integer sampleId, String fileName);
Result<?> viewQCResult(Integer sampleId, String fileName, HttpServletRequest request);
void exportQCResult(Integer sampleId, String fileName,HttpServletResponse response);
void exportQCResult(Integer sampleId, String fileName, HttpServletRequest request, HttpServletResponse response);
Result viewRLR(Integer sampleId, String fileName);
Result viewRLR(Integer sampleId, String fileName, HttpServletRequest request);
void exportRLR(GammaRLR gammaRLR, HttpServletResponse response);
void viewAutomaticAnalysisLog(Integer sampleId, HttpServletResponse response);
Result viewGammaviewerLog(Integer sampleId, String fileName);
Result viewGammaviewerLog(Integer sampleId, String fileName, HttpServletRequest request);
Result clickPeakInformation(String fileName, int index);
Result clickPeakInformation(String fileName, int index, HttpServletRequest request);
Result viewColorConfig(HttpServletRequest request);
@ -161,4 +160,6 @@ public interface IGammaService{
Result saveToDB(String fileName, HttpServletRequest request);
Result saveTxt(String fileName, HttpServletRequest request);
}

View File

@ -53,7 +53,6 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.*;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.net.URLEncoder;
import java.sql.Connection;
import java.sql.ResultSet;
@ -442,10 +441,12 @@ public class GammaServiceImpl implements IGammaService {
map.put("live_time", String.format("%.2f", phd.getAcq().getAcquisition_live_time()));
double deadTime = (phd.getAcq().getAcquisition_real_time() - phd.getAcq().getAcquisition_live_time()) / phd.getAcq().getAcquisition_real_time();
map.put("dead_time", String.format("%.2f", deadTime*100));
map.put("checkBox_updateCal", phd.getSetting().isBUpdateCal());
map.put("bAnalyed", phd.isBAnalyed());
// 更新页面折线图信息
gammaFileUtil.UpdateChart(phd, map, colorMap);
//将当前加载的phd信息加入到缓存中 文件名称作为缓存信息的key
phdCache.put(fileName, phd);
phdCache.put(fileName+"-"+userName, phd);
localCache.setPHDCache(phdCache);
result.setSuccess(true);
result.setResult(map);
@ -775,8 +776,10 @@ public class GammaServiceImpl implements IGammaService {
map.put("live_time", String.format("%.2f", phd.getAcq().getAcquisition_live_time()));
double deadTime = (phd.getAcq().getAcquisition_real_time() - phd.getAcq().getAcquisition_live_time()) / phd.getAcq().getAcquisition_real_time();
map.put("dead_time", String.format("%.2f", deadTime*100));
map.put("checkBox_updateCal", phd.getSetting().isBUpdateCal());
map.put("bAnalyed", phd.isBAnalyed());
gammaFileUtil.UpdateChart(phd, map, colorMap);
phdCache.put(fileName, phd);
phdCache.put(fileName+"-"+userName, phd);
localCache.setPHDCache(phdCache);
result.setSuccess(true);
result.setResult(map);
@ -791,7 +794,7 @@ public class GammaServiceImpl implements IGammaService {
Map<String, String> colorMap = sysUserColorService.initColor(userName);
//获取缓存的phd数据
Cache<String, PHDFile> phdCache = localCache.getPHDCache();
PHDFile phd = phdCache.getIfPresent(fileName);
PHDFile phd = phdCache.getIfPresent(fileName+"-"+userName);
long m_nCount = phd.getSpec().getNum_g_channel();
List<Double> vEnergy = phd.getVEnergy();
//获取Compare数据
@ -812,7 +815,7 @@ public class GammaServiceImpl implements IGammaService {
Map<String, String> colorMap = sysUserColorService.initColor(userName);
//获取缓存的phd数据
Cache<String, PHDFile> phdCache = localCache.getPHDCache();
PHDFile phd = phdCache.getIfPresent(fileName);
PHDFile phd = phdCache.getIfPresent(fileName+"-"+userName);
long m_nCount = phd.getSpec().getNum_g_channel();
List<Double> vEnergy = phd.getVEnergy();
long m_nSChan = phd.getSpec().getBegin_channel();
@ -839,10 +842,11 @@ public class GammaServiceImpl implements IGammaService {
}
@Override
public Result configure(Integer sampleId, String fileName) {
public Result configure(Integer sampleId, String fileName, HttpServletRequest request) {
Result result = new Result();
String userName = JwtUtil.getUserNameByToken(request);
Cache<String, PHDFile> phdCache = localCache.getPHDCache();
PHDFile phd = phdCache.getIfPresent(fileName);
PHDFile phd = phdCache.getIfPresent(fileName+"-"+userName);
if (Objects.isNull(phd)){
result.error500("请先选择解析文件!");
return result;
@ -876,11 +880,12 @@ public class GammaServiceImpl implements IGammaService {
}
@Override
public Result configureSave(ConfigureData configureData) {
public Result configureSave(ConfigureData configureData, HttpServletRequest request) {
Result result = new Result();
String userName = JwtUtil.getUserNameByToken(request);
String fileName = configureData.getFileName();
Cache<String, PHDFile> phdCache = localCache.getPHDCache();
PHDFile phd = phdCache.getIfPresent(fileName);
PHDFile phd = phdCache.getIfPresent(fileName+"-"+userName);
if (Objects.isNull(phd)){
result.error500("请先选择解析文件!");
return result;
@ -895,6 +900,8 @@ public class GammaServiceImpl implements IGammaService {
phdSetting.setK_alpha(configureData.getK_alpha());
phdSetting.setK_beta(configureData.getK_beta());
phdSetting.setRiskLevelK(configureData.getRiskLevelK());
phdSetting.setBUpdateCal(configureData.isUpdateCalibration());
phdSetting.setKeepCalPeakSearchPeaks(configureData.isKeepCalPeakSearchPeaks());
phdSetting.setRefTime_act(configureData.getRefTime_act());
phdSetting.setRefTime_conc(configureData.getRefTime_conc());
result.success("保存成功");
@ -906,7 +913,7 @@ public class GammaServiceImpl implements IGammaService {
Result result = new Result();
String userName = JwtUtil.getUserNameByToken(request);
Cache<String, PHDFile> phdCache = localCache.getPHDCache();
PHDFile phd = phdCache.getIfPresent(fileName);
PHDFile phd = phdCache.getIfPresent(fileName+"-"+userName);
if (Objects.isNull(phd)){
result.error500("请先选择解析文件!");
return result;
@ -995,7 +1002,7 @@ public class GammaServiceImpl implements IGammaService {
String userName = JwtUtil.getUserNameByToken(request);
Map<String, Object> map = new HashMap<>();
Cache<String, PHDFile> phdCache = localCache.getPHDCache();
PHDFile phd = phdCache.getIfPresent(fileName);
PHDFile phd = phdCache.getIfPresent(fileName+"-"+userName);
if (Objects.isNull(phd)){
result.error500("请先选择解析文件!");
return result;
@ -1042,12 +1049,13 @@ public class GammaServiceImpl implements IGammaService {
}
@Override
public Result insertPeak(Integer sampleId, String fileName, Integer curChan) {
public Result insertPeak(Integer sampleId, String fileName, Integer curChan, HttpServletRequest request) {
Result result = new Result();
String userName = JwtUtil.getUserNameByToken(request);
Map<String, Object> map = new HashMap<>();
//System.loadLibrary("GammaAnaly");
Cache<String, PHDFile> phdCache = localCache.getPHDCache();
PHDFile phd = phdCache.getIfPresent(fileName);
PHDFile phd = phdCache.getIfPresent(fileName+"-"+userName);
if (Objects.isNull(phd)){
result.error500("请先选择解析文件!");
return result;
@ -1121,6 +1129,13 @@ public class GammaServiceImpl implements IGammaService {
insertInput.rg_high = phd.getBaseCtrls().getRg_high();
insertInput.curChan = curChan;
insertInput.vCount = m_vCount;
ObjectMapper mapper = new ObjectMapper();
try {
String value = mapper.writeValueAsString(insertInput);
System.out.println(value);
} catch (JsonProcessingException e) {
throw new RuntimeException(e);
}
StructInsertOutput structInsertOutput = CalValuesHandler.insertPeaks(insertInput);
List<Integer> indexs = new LinkedList<>();
if (structInsertOutput.vIdx.size()>0){
@ -1189,18 +1204,13 @@ public class GammaServiceImpl implements IGammaService {
nuclide+=peakNuclide+";";
}
tablePeaks.setNuclide(StringUtils.isBlank(nuclide)?nuclide:nuclide.substring(0,nuclide.length()-1));
BigDecimal energy = new BigDecimal(peak.energy);
energy = energy.setScale(3, RoundingMode.HALF_UP);
tablePeaks.setEnergy(String.valueOf(energy));
BigDecimal area = new BigDecimal(peak.area);
area = area.setScale(4, RoundingMode.HALF_UP);
tablePeaks.setNetArea(String.valueOf(area));
BigDecimal fwhm = new BigDecimal(peak.fwhm);
fwhm = fwhm.setScale(5, RoundingMode.HALF_UP);
tablePeaks.setFwhm(String.valueOf(fwhm));
tablePeaks.setStep(String.valueOf(peak.area * peak.stepRatio));
tablePeaks.setEnergy(NumberFormatUtil.numberCal(String.valueOf(peak.energy)));
tablePeaks.setNetArea(NumberFormatUtil.numberCal(String.valueOf(peak.area)));
tablePeaks.setFwhm(NumberFormatUtil.numberCal(String.valueOf(peak.fwhm)));
tablePeaks.setStep(NumberFormatUtil.numberCal(String.valueOf(peak.area * peak.stepRatio)));
double deriva = CalValuesHandler.calDerivaOut(peak.peakCentroid, phd.getUsedEnerPara().getP());
tablePeaks.setBwGamma(String.valueOf(peak.BWWidthChan * deriva));
tablePeaks.setBwGamma(NumberFormatUtil.numberCal(String.valueOf(peak.BWWidthChan * deriva)));
tablePeaks.setNetAreaB(false);
tablePeaks.setCentroid(true);
tablePeaks.setFwhmB(true);
@ -1214,7 +1224,7 @@ public class GammaServiceImpl implements IGammaService {
Result result = new Result();
String userName = JwtUtil.getUserNameByToken(request);
Cache<String, PHDFile> phdCache = localCache.getPHDCache();
PHDFile phd = phdCache.getIfPresent(fileName);
PHDFile phd = phdCache.getIfPresent(fileName+"-"+userName);
if (Objects.isNull(phd)){
result.error500("请先选择解析文件!");
return result;
@ -1239,7 +1249,7 @@ public class GammaServiceImpl implements IGammaService {
//根据boolean 决定是否保留本次数据 如果保留则不需要操作vPeak 并重新拟合线
if (accept){
//算法有问题 --- 需要等等处理
// gammaFileUtil.PeaksChanged(phd);
gammaFileUtil.PeaksChanged(phd);
List<PeakInfo> vPeak = gammaFileUtil.InitPeakTable(phd.getVPeak());
map.put("table", vPeak);
@ -1269,7 +1279,7 @@ public class GammaServiceImpl implements IGammaService {
Result result = new Result();
String userName = JwtUtil.getUserNameByToken(request);
Cache<String, PHDFile> phdCache = localCache.getPHDCache();
PHDFile phd = phdCache.getIfPresent(fileName);
PHDFile phd = phdCache.getIfPresent(fileName+"-"+userName);
if (Objects.isNull(phd)){
result.error500("请先选择解析文件!");
return result;
@ -1307,7 +1317,7 @@ public class GammaServiceImpl implements IGammaService {
Map<String, Object> map = new HashMap<>();
String userName = JwtUtil.getUserNameByToken(request);
Cache<String, PHDFile> phdCache = localCache.getPHDCache();
PHDFile phd = phdCache.getIfPresent(fileName);
PHDFile phd = phdCache.getIfPresent(fileName+"-"+userName);
if (Objects.isNull(phd)){
result.error500("请先选择解析文件!");
return result;
@ -1344,7 +1354,7 @@ public class GammaServiceImpl implements IGammaService {
Map<String, Object> map = new HashMap<>();
String userName = JwtUtil.getUserNameByToken(request);
Cache<String, PHDFile> phdCache = localCache.getPHDCache();
PHDFile phd = phdCache.getIfPresent(fileName);
PHDFile phd = phdCache.getIfPresent(fileName+"-"+userName);
if (Objects.isNull(phd)){
result.error500("请先选择解析文件!");
return result;
@ -1395,11 +1405,12 @@ public class GammaServiceImpl implements IGammaService {
}
@Override
public Result deleteNuclide(Integer curRow, String nuclideName, String fileName, List<String> list_identify) {
public Result deleteNuclide(Integer curRow, String nuclideName, String fileName, List<String> list_identify, HttpServletRequest request) {
Result result = new Result();
String userName = JwtUtil.getUserNameByToken(request);
Map<String, Object> map = new HashMap<>();
Cache<String, PHDFile> phdCache = localCache.getPHDCache();
PHDFile phd = phdCache.getIfPresent(fileName);
PHDFile phd = phdCache.getIfPresent(fileName+"-"+userName);
if (Objects.isNull(phd)){
result.error500("请先选择解析文件!");
return result;
@ -1427,10 +1438,11 @@ public class GammaServiceImpl implements IGammaService {
}
@Override
public Result viewPeakComment(String fileName, int curRow) {
public Result viewPeakComment(String fileName, int curRow, HttpServletRequest request) {
Result result = new Result();
String userName = JwtUtil.getUserNameByToken(request);
Cache<String, PHDFile> phdCache = localCache.getPHDCache();
PHDFile phd = phdCache.getIfPresent(fileName);
PHDFile phd = phdCache.getIfPresent(fileName+"-"+userName);
if (Objects.isNull(phd)) {
result.error500("请先选择解析文件!");
return result;
@ -1445,11 +1457,12 @@ public class GammaServiceImpl implements IGammaService {
}
@Override
public Result addPeakComment(String fileName, int curRow, String comments) {
public Result addPeakComment(String fileName, int curRow, String comments, HttpServletRequest request) {
Result result = new Result();
String userName = JwtUtil.getUserNameByToken(request);
Map<String, Object> map = new HashMap<>();
Cache<String, PHDFile> phdCache = localCache.getPHDCache();
PHDFile phd = phdCache.getIfPresent(fileName);
PHDFile phd = phdCache.getIfPresent(fileName+"-"+userName);
if (Objects.isNull(phd)) {
result.error500("请先选择解析文件!");
return result;
@ -1467,10 +1480,11 @@ public class GammaServiceImpl implements IGammaService {
}
@Override
public Result viewGeneralComment(String fileName) {
public Result viewGeneralComment(String fileName, HttpServletRequest request) {
Result result = new Result();
String userName = JwtUtil.getUserNameByToken(request);
Cache<String, PHDFile> phdCache = localCache.getPHDCache();
PHDFile phd = phdCache.getIfPresent(fileName);
PHDFile phd = phdCache.getIfPresent(fileName+"-"+userName);
if (Objects.isNull(phd)) {
result.error500("请先选择解析文件!");
return result;
@ -1481,10 +1495,11 @@ public class GammaServiceImpl implements IGammaService {
}
@Override
public Result addGeneralComment(String fileName, String comments) {
public Result addGeneralComment(String fileName, String comments, HttpServletRequest request) {
Result result = new Result();
String userName = JwtUtil.getUserNameByToken(request);
Cache<String, PHDFile> phdCache = localCache.getPHDCache();
PHDFile phd = phdCache.getIfPresent(fileName);
PHDFile phd = phdCache.getIfPresent(fileName+"-"+userName);
if (Objects.isNull(phd)) {
result.error500("请先选择解析文件!");
return result;
@ -1504,7 +1519,7 @@ public class GammaServiceImpl implements IGammaService {
Map<String, Object> map = new HashMap<>();
String userName = JwtUtil.getUserNameByToken(request);
Cache<String, PHDFile> phdCache = localCache.getPHDCache();
PHDFile phd = phdCache.getIfPresent(fileName);
PHDFile phd = phdCache.getIfPresent(fileName+"-"+userName);
if (Objects.isNull(phd)){
result.error500("请先选择解析文件!");
return result;
@ -1597,7 +1612,7 @@ public class GammaServiceImpl implements IGammaService {
String userName = JwtUtil.getUserNameByToken(request);
Map<String, Object> map = new HashMap<>();
Cache<String, PHDFile> phdCache = localCache.getPHDCache();
PHDFile phd = phdCache.getIfPresent(fileName);
PHDFile phd = phdCache.getIfPresent(fileName+"-"+userName);
if (Objects.isNull(phd)){
result.error500("请先选择解析文件!");
return result;
@ -1615,7 +1630,7 @@ public class GammaServiceImpl implements IGammaService {
Map<String, Object> map = new HashMap<>();
String userName = JwtUtil.getUserNameByToken(request);
Cache<String, PHDFile> phdCache = localCache.getPHDCache();
PHDFile phd = phdCache.getIfPresent(fileName);
PHDFile phd = phdCache.getIfPresent(fileName+"-"+userName);
if (Objects.isNull(phd)){
result.error500("请先选择解析文件!");
return result;
@ -1908,12 +1923,13 @@ public class GammaServiceImpl implements IGammaService {
}
@Override
public Result energyCalibration(Integer sampleId, String fileName, String currentText, Double width) {
public Result energyCalibration(Integer sampleId, String fileName, String currentText, Double width, HttpServletRequest request) {
Result result = new Result();
String userName = JwtUtil.getUserNameByToken(request);
Map<String, Object> map = new HashMap<>();
//System.loadLibrary("GammaAnaly");
Cache<String, PHDFile> phdCache = localCache.getPHDCache();
PHDFile phd = phdCache.getIfPresent(fileName);
PHDFile phd = phdCache.getIfPresent(fileName+"-"+userName);
if (Objects.isNull(phd)){
result.error500("请先选择解析文件!");
return result;
@ -1924,6 +1940,7 @@ public class GammaServiceImpl implements IGammaService {
List<String> dataSourceList = phd.getMapEnerKD().keySet().stream().collect(Collectors.toList());
map.put("list_dataSource", dataSourceList);
if (StringUtils.isNotBlank(currentText)) {
map.put("currentText", currentText);
List<Double> m_vCurCentroid = phd.getMapEnerKD().get(currentText).getCentroid_channel();
List<Double> m_vCurEnergy = phd.getMapEnerKD().get(currentText).getG_energy();
List<Double> m_vCurUncert = phd.getMapEnerKD().get(currentText).getUncertainty();
@ -1961,11 +1978,12 @@ public class GammaServiceImpl implements IGammaService {
}
@Override
public Result changeDataEnergy(List<Double> m_vCurCentroid, List<Double> m_vCurEnergy, List<Double> m_vCurUncert, ParameterInfo m_curParam, Integer sampleId, String fileName, Double width) {
public Result changeDataEnergy(List<Double> m_vCurCentroid, List<Double> m_vCurEnergy, List<Double> m_vCurUncert, ParameterInfo m_curParam, Integer sampleId, String fileName, Double width, HttpServletRequest request) {
Result result = new Result();
String userName = JwtUtil.getUserNameByToken(request);
Map<String, Object> map = new HashMap<>();
Cache<String, PHDFile> phdCache = localCache.getPHDCache();
PHDFile phd = phdCache.getIfPresent(fileName);
PHDFile phd = phdCache.getIfPresent(fileName+"-"+userName);
if (Objects.isNull(phd)){
result.error500("请先选择解析文件!");
return result;
@ -2023,10 +2041,11 @@ public class GammaServiceImpl implements IGammaService {
}
@Override
public Result applyDataEnergy(List<Double> m_vCurCentroid, List<Double> m_vCurEnergy, List<Double> m_vCurUncert, ParameterInfo m_curParam, String curCalName, Integer sampleId, String fileName) {
public Result applyDataEnergy(List<Double> m_vCurCentroid, List<Double> m_vCurEnergy, List<Double> m_vCurUncert, ParameterInfo m_curParam, String curCalName, Integer sampleId, String fileName, HttpServletRequest request) {
Result result = new Result();
String userName = JwtUtil.getUserNameByToken(request);
Cache<String, PHDFile> phdCache = localCache.getPHDCache();
PHDFile phd = phdCache.getIfPresent(fileName);
PHDFile phd = phdCache.getIfPresent(fileName+"-"+userName);
if (Objects.isNull(phd)){
result.error500("请先选择解析文件!");
return result;
@ -2166,10 +2185,11 @@ public class GammaServiceImpl implements IGammaService {
}
@Override
public Result setCurrentEnergy(String fileName, String currentName) {
public Result setCurrentEnergy(String fileName, String currentName, HttpServletRequest request) {
Result result = new Result();
String userName = JwtUtil.getUserNameByToken(request);
Cache<String, PHDFile> phdCache = localCache.getPHDCache();
PHDFile phd = phdCache.getIfPresent(fileName);
PHDFile phd = phdCache.getIfPresent(fileName+"-"+userName);
if (Objects.isNull(phd)){
result.error500("请先选择解析文件!");
return result;
@ -2184,12 +2204,13 @@ public class GammaServiceImpl implements IGammaService {
}
@Override
public Result resolutionCalibration(Integer sampleId, String fileName, String currentText, Double width) {
public Result resolutionCalibration(Integer sampleId, String fileName, String currentText, Double width, HttpServletRequest request) {
Result result = new Result();
String userName = JwtUtil.getUserNameByToken(request);
Map<String, Object> map = new HashMap<>();
//System.loadLibrary("GammaAnaly");
Cache<String, PHDFile> phdCache = localCache.getPHDCache();
PHDFile phd = phdCache.getIfPresent(fileName);
PHDFile phd = phdCache.getIfPresent(fileName+"-"+userName);
if (Objects.isNull(phd)){
result.error500("请先选择解析文件!");
return result;
@ -2200,6 +2221,7 @@ public class GammaServiceImpl implements IGammaService {
List<String> dataSourceList = phd.getMapResoKD().keySet().stream().collect(Collectors.toList());
map.put("list_dataSource", dataSourceList);
if (StringUtils.isNotBlank(currentText)) {
map.put("currentText", currentText);
List<Double> m_vCurReso = phd.getMapResoKD().get(currentText).getFWHM();
List<Double> m_vCurEnergy = phd.getMapResoKD().get(currentText).getG_energy();
List<Double> m_vCurUncert = phd.getMapResoKD().get(currentText).getUncertainty();
@ -2237,12 +2259,13 @@ public class GammaServiceImpl implements IGammaService {
}
@Override
public Result changeDataResolution(List<Double> m_vCurReso, List<Double> m_vCurEnergy, List<Double> m_vCurUncert, ParameterInfo m_curParam, Integer sampleId, String fileName, Double width) {
public Result changeDataResolution(List<Double> m_vCurReso, List<Double> m_vCurEnergy, List<Double> m_vCurUncert, ParameterInfo m_curParam, Integer sampleId, String fileName, Double width, HttpServletRequest request) {
Result result = new Result();
String userName = JwtUtil.getUserNameByToken(request);
Map<String, Object> map = new HashMap<>();
//System.loadLibrary("GammaAnaly");
Cache<String, PHDFile> phdCache = localCache.getPHDCache();
PHDFile phd = phdCache.getIfPresent(fileName);
PHDFile phd = phdCache.getIfPresent(fileName+"-"+userName);
if (Objects.isNull(phd)){
result.error500("请先选择解析文件!");
return result;
@ -2289,10 +2312,11 @@ public class GammaServiceImpl implements IGammaService {
}
@Override
public Result applyDataResolution(List<Double> m_vCurReso, List<Double> m_vCurEnergy, List<Double> m_vCurUncert, ParameterInfo m_curParam, String curCalName, Integer sampleId, String fileName) {
public Result applyDataResolution(List<Double> m_vCurReso, List<Double> m_vCurEnergy, List<Double> m_vCurUncert, ParameterInfo m_curParam, String curCalName, Integer sampleId, String fileName, HttpServletRequest request) {
Result result = new Result();
String userName = JwtUtil.getUserNameByToken(request);
Cache<String, PHDFile> phdCache = localCache.getPHDCache();
PHDFile phd = phdCache.getIfPresent(fileName);
PHDFile phd = phdCache.getIfPresent(fileName+"-"+userName);
if (Objects.isNull(phd)){
result.error500("请先选择解析文件!");
return result;
@ -2432,10 +2456,11 @@ public class GammaServiceImpl implements IGammaService {
}
@Override
public Result setCurrentResolution(String fileName, String currentName) {
public Result setCurrentResolution(String fileName, String currentName, HttpServletRequest request) {
Result result = new Result();
String userName = JwtUtil.getUserNameByToken(request);
Cache<String, PHDFile> phdCache = localCache.getPHDCache();
PHDFile phd = phdCache.getIfPresent(fileName);
PHDFile phd = phdCache.getIfPresent(fileName+"-"+userName);
if (Objects.isNull(phd)){
result.error500("请先选择解析文件!");
return result;
@ -2450,8 +2475,9 @@ public class GammaServiceImpl implements IGammaService {
}
@Override
public Result EfficiencyCalibration(Integer sampleId, String fileName, String currentText, Double width) {
public Result EfficiencyCalibration(Integer sampleId, String fileName, String currentText, Double width, HttpServletRequest request) {
Result result = new Result();
String userName = JwtUtil.getUserNameByToken(request);
Map<String, Object> map = new HashMap<>();
List<String> m_vFuncName = new LinkedList<>();
m_vFuncName.add("Interpolation"); // 1
@ -2464,7 +2490,7 @@ public class GammaServiceImpl implements IGammaService {
map.put("function", m_vFuncName);
//System.loadLibrary("GammaAnaly");
Cache<String, PHDFile> phdCache = localCache.getPHDCache();
PHDFile phd = phdCache.getIfPresent(fileName);
PHDFile phd = phdCache.getIfPresent(fileName+"-"+userName);
if (Objects.isNull(phd)){
result.error500("请先选择解析文件!");
return result;
@ -2475,6 +2501,7 @@ public class GammaServiceImpl implements IGammaService {
List<String> dataSourceList = phd.getMapEffiKD().keySet().stream().collect(Collectors.toList());
map.put("list_dataSource", dataSourceList);
if (StringUtils.isNotBlank(currentText)) {
map.put("currentText", currentText);
List<Double> m_vCurEffi = phd.getMapEffiKD().get(currentText).getEfficiency();
List<Double> m_vCurEnergy = phd.getMapEffiKD().get(currentText).getG_energy();
List<Double> m_vCurUncert = phd.getMapEffiKD().get(currentText).getUncertainty();
@ -2512,12 +2539,13 @@ public class GammaServiceImpl implements IGammaService {
}
@Override
public Result changeDataEfficiency(List<Double> m_vCurEffi, List<Double> m_vCurEnergy, List<Double> m_vCurUncert, ParameterInfo m_curParam, Integer funcId, Integer sampleId, String fileName, Double width) {
public Result changeDataEfficiency(List<Double> m_vCurEffi, List<Double> m_vCurEnergy, List<Double> m_vCurUncert, ParameterInfo m_curParam, Integer funcId, Integer sampleId, String fileName, Double width, HttpServletRequest request) {
Result result = new Result();
String userName = JwtUtil.getUserNameByToken(request);
Map<String, Object> map = new HashMap<>();
//System.loadLibrary("GammaAnaly");
Cache<String, PHDFile> phdCache = localCache.getPHDCache();
PHDFile phd = phdCache.getIfPresent(fileName);
PHDFile phd = phdCache.getIfPresent(fileName+"-"+userName);
if (Objects.isNull(phd)){
result.error500("请先选择解析文件!");
return result;
@ -2564,10 +2592,11 @@ public class GammaServiceImpl implements IGammaService {
}
@Override
public Result applyDataEfficiency(List<Double> m_vCurEffi, List<Double> m_vCurEnergy, List<Double> m_vCurUncert, ParameterInfo m_curParam, String curCalName, Integer sampleId, String fileName) {
public Result applyDataEfficiency(List<Double> m_vCurEffi, List<Double> m_vCurEnergy, List<Double> m_vCurUncert, ParameterInfo m_curParam, String curCalName, Integer sampleId, String fileName, HttpServletRequest request) {
Result result = new Result();
String userName = JwtUtil.getUserNameByToken(request);
Cache<String, PHDFile> phdCache = localCache.getPHDCache();
PHDFile phd = phdCache.getIfPresent(fileName);
PHDFile phd = phdCache.getIfPresent(fileName+"-"+userName);
if (Objects.isNull(phd)){
result.error500("请先选择解析文件!");
return result;
@ -2720,10 +2749,11 @@ public class GammaServiceImpl implements IGammaService {
}
@Override
public Result setCurrentEfficiency(String fileName, String currentName) {
public Result setCurrentEfficiency(String fileName, String currentName, HttpServletRequest request) {
Result result = new Result();
String userName = JwtUtil.getUserNameByToken(request);
Cache<String, PHDFile> phdCache = localCache.getPHDCache();
PHDFile phd = phdCache.getIfPresent(fileName);
PHDFile phd = phdCache.getIfPresent(fileName+"-"+userName);
if (Objects.isNull(phd)){
result.error500("请先选择解析文件!");
return result;
@ -2743,7 +2773,7 @@ public class GammaServiceImpl implements IGammaService {
Map<String, Object> map = new HashMap<>();
String userName = JwtUtil.getUserNameByToken(request);
Cache<String, PHDFile> phdCache = localCache.getPHDCache();
PHDFile phd = phdCache.getIfPresent(fileName);
PHDFile phd = phdCache.getIfPresent(fileName+"-"+userName);
if (Objects.isNull(phd)){
result.error500("请先选择解析文件!");
return result;
@ -2897,7 +2927,7 @@ public class GammaServiceImpl implements IGammaService {
Map<String, List<String>> map = new HashMap<>();
String userName = JwtUtil.getUserNameByToken(request);
Cache<String, PHDFile> phdCache = localCache.getPHDCache();
PHDFile phd = phdCache.getIfPresent(fileName);
PHDFile phd = phdCache.getIfPresent(fileName+"-"+userName);
if (Objects.isNull(phd)){
result.error500("请先选择解析文件!");
return result;
@ -2919,7 +2949,7 @@ public class GammaServiceImpl implements IGammaService {
Result result = new Result();
String userName = JwtUtil.getUserNameByToken(request);
Cache<String, PHDFile> phdCache = localCache.getPHDCache();
PHDFile phd = phdCache.getIfPresent(fileName);
PHDFile phd = phdCache.getIfPresent(fileName+"-"+userName);
if (Objects.isNull(phd)){
result.error500("请先选择解析文件!");
return result;
@ -2939,11 +2969,12 @@ public class GammaServiceImpl implements IGammaService {
}
@Override
public Result viewComment(Integer sampleId, String fileName) {
public Result viewComment(Integer sampleId, String fileName, HttpServletRequest request) {
Result result = new Result();
String comments = "";
String userName = JwtUtil.getUserNameByToken(request);
Cache<String, PHDFile> phdCache = localCache.getPHDCache();
PHDFile phd = phdCache.getIfPresent(fileName);
PHDFile phd = phdCache.getIfPresent(fileName+"-"+userName);
if (Objects.isNull(phd)){
result.error500("请先选择解析文件!");
return result;
@ -2967,10 +2998,11 @@ public class GammaServiceImpl implements IGammaService {
}
@Override
public Result addComment(String fileName, String comment) {
public Result addComment(String fileName, String comment, HttpServletRequest request) {
Result result = new Result();
String userName = JwtUtil.getUserNameByToken(request);
Cache<String, PHDFile> phdCache = localCache.getPHDCache();
PHDFile phd = phdCache.getIfPresent(fileName);
PHDFile phd = phdCache.getIfPresent(fileName+"-"+userName);
if (Objects.isNull(phd)){
result.error500("请先选择解析文件!");
return result;
@ -2982,10 +3014,11 @@ public class GammaServiceImpl implements IGammaService {
return result;
}
public Result<List<TablePeak>> peakInformation(Integer sampleId, String fileName){
public Result<List<TablePeak>> peakInformation(Integer sampleId, String fileName, HttpServletRequest request){
Result<List<TablePeak>> result = new Result();
String userName = JwtUtil.getUserNameByToken(request);
Cache<String, PHDFile> phdCache = localCache.getPHDCache();
PHDFile phd = phdCache.getIfPresent(fileName);
PHDFile phd = phdCache.getIfPresent(fileName+"-"+userName);
if (Objects.isNull(phd)){
result.error500("请先选择解析文件!");
return result;
@ -3013,8 +3046,8 @@ public class GammaServiceImpl implements IGammaService {
}
@Override
public void exportPeakInformation(Integer sampleId, String fileName, HttpServletResponse response) {
Result<List<TablePeak>> result = peakInformation(sampleId, fileName);
public void exportPeakInformation(Integer sampleId, String fileName, HttpServletRequest request, HttpServletResponse response) {
Result<List<TablePeak>> result = peakInformation(sampleId, fileName, request);
List<TablePeak> peaks = result.getResult();
if (CollUtil.isEmpty(peaks)) return;
String export = "PeakInformation-Gamma.xls";
@ -3141,10 +3174,11 @@ public class GammaServiceImpl implements IGammaService {
}
@Override
public Result viewRRR(Integer sampleId, String fileName) {
public Result viewRRR(Integer sampleId, String fileName, HttpServletRequest request) {
Result result = new Result();
String userName = JwtUtil.getUserNameByToken(request);
Cache<String, PHDFile> phdCache = localCache.getPHDCache();
PHDFile phd = phdCache.getIfPresent(fileName);
PHDFile phd = phdCache.getIfPresent(fileName+"-"+userName);
if (Objects.isNull(phd)){
result.error500("请先选择解析文件!");
return result;
@ -3156,9 +3190,10 @@ public class GammaServiceImpl implements IGammaService {
}
@Override
public void exportRRR(Integer sampleId, String fileName, HttpServletResponse response) {
public void exportRRR(Integer sampleId, String fileName, HttpServletRequest request, HttpServletResponse response) {
String userName = JwtUtil.getUserNameByToken(request);
Cache<String, PHDFile> phdCache = localCache.getPHDCache();
PHDFile phd = phdCache.getIfPresent(fileName);
PHDFile phd = phdCache.getIfPresent(fileName+"-"+userName);
if (Objects.isNull(phd)) {
return;
}
@ -3185,10 +3220,11 @@ public class GammaServiceImpl implements IGammaService {
}
@Override
public Result<Map<String, Object>> radionuclideActivity(Integer sampleId, String fileName) {
public Result<Map<String, Object>> radionuclideActivity(Integer sampleId, String fileName, HttpServletRequest request) {
Result<Map<String, Object>> result = new Result();
String userName = JwtUtil.getUserNameByToken(request);
Cache<String, PHDFile> phdCache = localCache.getPHDCache();
PHDFile phd = phdCache.getIfPresent(fileName);
PHDFile phd = phdCache.getIfPresent(fileName+"-"+userName);
if (Objects.isNull(phd)){
result.error500("请先选择解析文件!");
return result;
@ -3200,8 +3236,8 @@ public class GammaServiceImpl implements IGammaService {
}
@Override
public void exportRadionuclideActivity(Integer sampleId, String fileName, HttpServletResponse response) {
Result<Map<String, Object>> result = radionuclideActivity(sampleId, fileName);
public void exportRadionuclideActivity(Integer sampleId, String fileName, HttpServletRequest request, HttpServletResponse response) {
Result<Map<String, Object>> result = radionuclideActivity(sampleId, fileName, request);
Map<String, Object> dataMap = result.getResult();
if (MapUtil.isEmpty(dataMap)) return;
Date actRef = (Date) dataMap.get("dateTime_act_ref");
@ -3220,10 +3256,11 @@ public class GammaServiceImpl implements IGammaService {
}
@Override
public Result Spectrum(Integer sampleId, String fileName) {
public Result Spectrum(Integer sampleId, String fileName, HttpServletRequest request) {
Result result = new Result();
String userName = JwtUtil.getUserNameByToken(request);
Cache<String, PHDFile> phdCache = localCache.getPHDCache();
PHDFile phd = phdCache.getIfPresent(fileName);
PHDFile phd = phdCache.getIfPresent(fileName+"-"+userName);
if (Objects.isNull(phd)){
result.error500("请先选择解析文件!");
return result;
@ -3235,10 +3272,11 @@ public class GammaServiceImpl implements IGammaService {
}
@Override
public Result<Map<String, String>> sampleInformation(Integer sampleId, String fileName) {
public Result<Map<String, String>> sampleInformation(Integer sampleId, String fileName, HttpServletRequest request) {
Result<Map<String, String>> result = new Result();
String userName = JwtUtil.getUserNameByToken(request);
Cache<String, PHDFile> phdCache = localCache.getPHDCache();
PHDFile phd = phdCache.getIfPresent(fileName);
PHDFile phd = phdCache.getIfPresent(fileName+"-"+userName);
if (Objects.isNull(phd)){
result.error500("请先选择解析文件!");
return result;
@ -3281,9 +3319,8 @@ public class GammaServiceImpl implements IGammaService {
}
@Override
public void exportSampleInformation(Integer sampleId, String fileName,
HttpServletResponse response) {
Result<Map<String, String>> result = sampleInformation(sampleId, fileName);
public void exportSampleInformation(Integer sampleId, String fileName, HttpServletRequest request, HttpServletResponse response) {
Result<Map<String, String>> result = sampleInformation(sampleId, fileName, request);
Map<String, String> sampleInfo = result.getResult();
if (MapUtil.isEmpty(sampleInfo)) return;
Map<String, Object> dataMap = sampleInfo.entrySet().stream()
@ -3293,10 +3330,11 @@ public class GammaServiceImpl implements IGammaService {
}
@Override
public Result<List<TableQCResult>> viewQCResult(Integer sampleId, String fileName) {
public Result<List<TableQCResult>> viewQCResult(Integer sampleId, String fileName, HttpServletRequest request) {
Result<List<TableQCResult>> result = new Result();
String userName = JwtUtil.getUserNameByToken(request);
Cache<String, PHDFile> phdCache = localCache.getPHDCache();
PHDFile phd = phdCache.getIfPresent(fileName);
PHDFile phd = phdCache.getIfPresent(fileName+"-"+userName);
if (Objects.isNull(phd)){
result.error500("请先选择解析文件!");
return result;
@ -3366,8 +3404,8 @@ public class GammaServiceImpl implements IGammaService {
}
@Override
public void exportQCResult(Integer sampleId, String fileName, HttpServletResponse response) {
Result<List<TableQCResult>> result = viewQCResult(sampleId, fileName);
public void exportQCResult(Integer sampleId, String fileName, HttpServletRequest request, HttpServletResponse response) {
Result<List<TableQCResult>> result = viewQCResult(sampleId, fileName, request);
List<TableQCResult> qcResults = result.getResult();
if (CollUtil.isEmpty(qcResults))return;
String export = "QCResult-Gamma.xls";
@ -3375,10 +3413,11 @@ public class GammaServiceImpl implements IGammaService {
}
@Override
public Result viewRLR(Integer sampleId, String fileName) {
public Result viewRLR(Integer sampleId, String fileName, HttpServletRequest request) {
Result result = new Result();
String userName = JwtUtil.getUserNameByToken(request);
Cache<String, PHDFile> phdCache = localCache.getPHDCache();
PHDFile phd = phdCache.getIfPresent(fileName);
PHDFile phd = phdCache.getIfPresent(fileName+"-"+userName);
if (Objects.isNull(phd)){
result.error500("请先选择解析文件!");
return result;
@ -3675,10 +3714,11 @@ public class GammaServiceImpl implements IGammaService {
}
@Override
public Result viewGammaviewerLog(Integer sampleId, String fileName) {
public Result viewGammaviewerLog(Integer sampleId, String fileName, HttpServletRequest request) {
Result result = new Result();
String userName = JwtUtil.getUserNameByToken(request);
Cache<String, PHDFile> phdCache = localCache.getPHDCache();
PHDFile phd = phdCache.getIfPresent(fileName);
PHDFile phd = phdCache.getIfPresent(fileName+"-"+userName);
if (Objects.isNull(phd)){
result.error500("请先选择解析文件!");
return result;
@ -3690,10 +3730,11 @@ public class GammaServiceImpl implements IGammaService {
}
@Override
public Result clickPeakInformation(String fileName, int index) {
public Result clickPeakInformation(String fileName, int index, HttpServletRequest request) {
Result result = new Result();
String userName = JwtUtil.getUserNameByToken(request);
Cache<String, PHDFile> phdCache = localCache.getPHDCache();
PHDFile phd = phdCache.getIfPresent(fileName);
PHDFile phd = phdCache.getIfPresent(fileName+"-"+userName);
if (Objects.isNull(phd)){
result.error500("请先选择解析文件!");
return result;
@ -3740,7 +3781,7 @@ public class GammaServiceImpl implements IGammaService {
String userName = JwtUtil.getUserNameByToken(request);
boolean bRet = true;
Cache<String, PHDFile> phdCache = localCache.getPHDCache();
PHDFile phd = phdCache.getIfPresent(fileName);
PHDFile phd = phdCache.getIfPresent(fileName+"-"+userName);
if (Objects.isNull(phd)) {
result.error500("请先解析文件!");
return result;
@ -3879,5 +3920,15 @@ public class GammaServiceImpl implements IGammaService {
}
}
@Override
public Result saveTxt(String fileName, HttpServletRequest request) {
Result result = new Result();
String userName = JwtUtil.getUserNameByToken(request);
Cache<String, PHDFile> phdCache = localCache.getPHDCache();
PHDFile phd = phdCache.getIfPresent(fileName+"-"+userName);
return result;
}
}

View File

@ -1,93 +0,0 @@
<#include "/common/utils.ftl">
<#assign modal_width = 800>
<#if tableVo.fieldRowNum==2>
<#assign modal_width = 896>
<#elseif tableVo.fieldRowNum==3>
<#assign modal_width = 1024>
<#elseif tableVo.fieldRowNum==4>
<#assign modal_width = 1280>
</#if>
<template>
<a-drawer
:title="title"
:width="width"
placement="right"
:closable="false"
@close="close"
destroyOnClose
:visible="visible">
<${Format.humpToShortbar(entityName)}-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></${Format.humpToShortbar(entityName)}-form>
<div class="drawer-footer">
<a-button @click="handleCancel" style="margin-bottom: 0;">关闭</a-button>
<a-button v-if="!disableSubmit" @click="handleOk" type="primary" style="margin-bottom: 0;">提交</a-button>
</div>
</a-drawer>
</template>
<script>
import ${entityName}Form from './${entityName}Form'
export default {
name: '${entityName}Modal',
components: {
${entityName}Form
},
data () {
return {
title:"操作",
width:${modal_width},
visible: false,
disableSubmit: false
}
},
methods: {
add () {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.add();
})
},
edit (record) {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.edit(record);
});
},
close () {
this.$emit('close');
this.visible = false;
},
submitCallback(){
this.$emit('ok');
this.visible = false;
},
handleOk () {
this.$refs.realForm.submitForm();
},
handleCancel () {
this.close()
}
}
}
</script>
<style lang="less" scoped>
/** Button按钮间距 */
.ant-btn {
margin-left: 30px;
margin-bottom: 30px;
float: right;
}
.drawer-footer{
position: absolute;
bottom: -8px;
width: 100%;
border-top: 1px solid #e8e8e8;
padding: 10px 16px;
text-align: right;
left: 0;
background: #fff;
border-radius: 0 0 2px 2px;
}
</style>

View File

@ -1,105 +0,0 @@
package ${bussiPackage}.${entityPackage}.service.impl;
import ${bussiPackage}.${entityPackage}.entity.${entityName};
<#list subTables as sub>
import ${bussiPackage}.${entityPackage}.entity.${sub.entityName};
</#list>
<#list subTables as sub>
import ${bussiPackage}.${entityPackage}.mapper.${sub.entityName}Mapper;
</#list>
import ${bussiPackage}.${entityPackage}.mapper.${entityName}Mapper;
import ${bussiPackage}.${entityPackage}.service.I${entityName}Service;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import java.io.Serializable;
import java.util.List;
import java.util.Collection;
/**
* @Description: ${tableVo.ftlDescription}
* @Author: jeecg-boot
* @Date: ${.now?string["yyyy-MM-dd"]}
* @Version: V1.0
*/
@Service
public class ${entityName}ServiceImpl extends ServiceImpl<${entityName}Mapper, ${entityName}> implements I${entityName}Service {
@Autowired
private ${entityName}Mapper ${entityName?uncap_first}Mapper;
<#list subTables as sub>
@Autowired
private ${sub.entityName}Mapper ${sub.entityName?uncap_first}Mapper;
</#list>
@Override
@Transactional(rollbackFor = Exception.class)
public void saveMain(${entityName} ${entityName?uncap_first}, <#list subTables as sub>List<${sub.entityName}> ${sub.entityName?uncap_first}List<#if sub_has_next>,</#if></#list>) {
${entityName?uncap_first}Mapper.insert(${entityName?uncap_first});
<#list subTables as sub>
if(${sub.entityName?uncap_first}List!=null && ${sub.entityName?uncap_first}List.size()>0) {
for(${sub.entityName} entity:${sub.entityName?uncap_first}List) {
<#list sub.foreignKeys as key>
//外键设置
<#if key?lower_case?index_of("${primaryKeyField}")!=-1>
entity.set${key?cap_first}(${entityName?uncap_first}.get${primaryKeyField?cap_first}());
<#else>
entity.set${key?cap_first}(${entityName?uncap_first}.get${key}());
</#if>
</#list>
${sub.entityName?uncap_first}Mapper.insert(entity);
}
}
</#list>
}
@Override
@Transactional(rollbackFor = Exception.class)
public void updateMain(${entityName} ${entityName?uncap_first},<#list subTables as sub>List<${sub.entityName}> ${sub.entityName?uncap_first}List<#if sub_has_next>,</#if></#list>) {
${entityName?uncap_first}Mapper.updateById(${entityName?uncap_first});
//1.先删除子表数据
<#list subTables as sub>
${sub.entityName?uncap_first}Mapper.deleteByMainId(${entityName?uncap_first}.getId());
</#list>
//2.子表数据重新插入
<#list subTables as sub>
if(${sub.entityName?uncap_first}List!=null && ${sub.entityName?uncap_first}List.size()>0) {
for(${sub.entityName} entity:${sub.entityName?uncap_first}List) {
<#list sub.foreignKeys as key>
//外键设置
<#if key?lower_case?index_of("${primaryKeyField}")!=-1>
entity.set${key?cap_first}(${entityName?uncap_first}.get${primaryKeyField?cap_first}());
<#else>
entity.set${key?cap_first}(${entityName?uncap_first}.get${key}());
</#if>
</#list>
${sub.entityName?uncap_first}Mapper.insert(entity);
}
}
</#list>
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delMain(String id) {
<#list subTables as sub>
${sub.entityName?uncap_first}Mapper.deleteByMainId(id);
</#list>
${entityName?uncap_first}Mapper.deleteById(id);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delBatchMain(Collection<? extends Serializable> idList) {
for(Serializable id:idList) {
<#list subTables as sub>
${sub.entityName?uncap_first}Mapper.deleteByMainId(id.toString());
</#list>
${entityName?uncap_first}Mapper.deleteById(id);
}
}
}

View File

@ -1,280 +0,0 @@
package ${bussiPackage}.${entityPackage}.controller;
import java.io.UnsupportedEncodingException;
import java.io.IOException;
import java.net.URLDecoder;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
import org.jeecg.common.system.vo.LoginUser;
import org.apache.shiro.SecurityUtils;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.util.oConvertUtils;
<#list subTables as sub>
import ${bussiPackage}.${entityPackage}.entity.${sub.entityName};
</#list>
import ${bussiPackage}.${entityPackage}.entity.${entityName};
import ${bussiPackage}.${entityPackage}.vo.${entityName}Page;
import ${bussiPackage}.${entityPackage}.service.I${entityName}Service;
<#list subTables as sub>
import ${bussiPackage}.${entityPackage}.service.I${sub.entityName}Service;
</#list>
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j;
import com.alibaba.fastjson.JSON;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.apache.shiro.authz.annotation.RequiresPermissions;
/**
* @Description: ${tableVo.ftlDescription}
* @Author: jeecg-boot
* @Date: ${.now?string["yyyy-MM-dd"]}
* @Version: V1.0
*/
@Api(tags="${tableVo.ftlDescription}")
@RestController
@RequestMapping("/${entityPackage}/${entityName?uncap_first}")
@Slf4j
public class ${entityName}Controller {
@Autowired
private I${entityName}Service ${entityName?uncap_first}Service;
<#list subTables as sub>
@Autowired
private I${sub.entityName}Service ${sub.entityName?uncap_first}Service;
</#list>
/**
* 分页列表查询
*
* @param ${entityName?uncap_first}
* @param pageNo
* @param pageSize
* @param req
* @return
*/
//@AutoLog(value = "${tableVo.ftlDescription}-分页列表查询")
@ApiOperation(value="${tableVo.ftlDescription}-分页列表查询", notes="${tableVo.ftlDescription}-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<${entityName}>> queryPageList(${entityName} ${entityName?uncap_first},
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<${entityName}> queryWrapper = QueryGenerator.initQueryWrapper(${entityName?uncap_first}, req.getParameterMap());
Page<${entityName}> page = new Page<${entityName}>(pageNo, pageSize);
IPage<${entityName}> pageList = ${entityName?uncap_first}Service.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 添加
*
* @param ${entityName?uncap_first}Page
* @return
*/
@AutoLog(value = "${tableVo.ftlDescription}-添加")
@ApiOperation(value="${tableVo.ftlDescription}-添加", notes="${tableVo.ftlDescription}-添加")
@RequiresPermissions("${entityPackage}:${tableName}:add")
@PostMapping(value = "/add")
public Result<String> add(@RequestBody ${entityName}Page ${entityName?uncap_first}Page) {
${entityName} ${entityName?uncap_first} = new ${entityName}();
BeanUtils.copyProperties(${entityName?uncap_first}Page, ${entityName?uncap_first});
${entityName?uncap_first}Service.saveMain(${entityName?uncap_first}, <#list subTables as sub>${entityName?uncap_first}Page.get${sub.entityName}List()<#if sub_has_next>,</#if></#list>);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param ${entityName?uncap_first}Page
* @return
*/
@AutoLog(value = "${tableVo.ftlDescription}-编辑")
@ApiOperation(value="${tableVo.ftlDescription}-编辑", notes="${tableVo.ftlDescription}-编辑")
@RequiresPermissions("${entityPackage}:${tableName}:edit")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
public Result<String> edit(@RequestBody ${entityName}Page ${entityName?uncap_first}Page) {
${entityName} ${entityName?uncap_first} = new ${entityName}();
BeanUtils.copyProperties(${entityName?uncap_first}Page, ${entityName?uncap_first});
${entityName} ${entityName?uncap_first}Entity = ${entityName?uncap_first}Service.getById(${entityName?uncap_first}.getId());
if(${entityName?uncap_first}Entity==null) {
return Result.error("未找到对应数据");
}
${entityName?uncap_first}Service.updateMain(${entityName?uncap_first}, <#list subTables as sub>${entityName?uncap_first}Page.get${sub.entityName}List()<#if sub_has_next>,</#if></#list>);
return Result.OK("编辑成功!");
}
/**
* 通过id删除
*
* @param id
* @return
*/
@AutoLog(value = "${tableVo.ftlDescription}-通过id删除")
@ApiOperation(value="${tableVo.ftlDescription}-通过id删除", notes="${tableVo.ftlDescription}-通过id删除")
@RequiresPermissions("${entityPackage}:${tableName}:delete")
@DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
${entityName?uncap_first}Service.delMain(id);
return Result.OK("删除成功!");
}
/**
* 批量删除
*
* @param ids
* @return
*/
@AutoLog(value = "${tableVo.ftlDescription}-批量删除")
@ApiOperation(value="${tableVo.ftlDescription}-批量删除", notes="${tableVo.ftlDescription}-批量删除")
@RequiresPermissions("${entityPackage}:${tableName}:deleteBatch")
@DeleteMapping(value = "/deleteBatch")
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
this.${entityName?uncap_first}Service.delBatchMain(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
/**
* 通过id查询
*
* @param id
* @return
*/
//@AutoLog(value = "${tableVo.ftlDescription}-通过id查询")
@ApiOperation(value="${tableVo.ftlDescription}-通过id查询", notes="${tableVo.ftlDescription}-通过id查询")
@GetMapping(value = "/queryById")
public Result<${entityName}> queryById(@RequestParam(name="id",required=true) String id) {
${entityName} ${entityName?uncap_first} = ${entityName?uncap_first}Service.getById(id);
if(${entityName?uncap_first}==null) {
return Result.error("未找到对应数据");
}
return Result.OK(${entityName?uncap_first});
}
<#list subTables as sub>
/**
* 通过id查询
*
* @param id
* @return
*/
//@AutoLog(value = "${sub.ftlDescription}-通过主表ID查询")
@ApiOperation(value="${sub.ftlDescription}-通过主表ID查询", notes="${sub.ftlDescription}-通过主表ID查询")
@GetMapping(value = "/query${sub.entityName}ByMainId")
public Result<IPage<${sub.entityName}>> query${sub.entityName}ListByMainId(@RequestParam(name="id",required=true) String id) {
List<${sub.entityName}> ${sub.entityName?uncap_first}List = ${sub.entityName?uncap_first}Service.selectByMainId(id);
<#-- 包裹分页对象,用于翻译注解 -->
IPage <${sub.entityName}> page = new Page<>();
page.setRecords(${sub.entityName?uncap_first}List);
page.setTotal(${sub.entityName?uncap_first}List.size());
return Result.OK(page);
}
</#list>
/**
* 导出excel
*
* @param request
* @param ${entityName?uncap_first}
*/
@RequiresPermissions("${entityPackage}:${tableName}:exportXls")
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, ${entityName} ${entityName?uncap_first}) {
// Step.1 组装查询条件查询数据
QueryWrapper<${entityName}> queryWrapper = QueryGenerator.initQueryWrapper(${entityName?uncap_first}, request.getParameterMap());
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
//配置选中数据查询条件
String selections = request.getParameter("selections");
if(oConvertUtils.isNotEmpty(selections)) {
List<String> selectionList = Arrays.asList(selections.split(","));
queryWrapper.in("id",selectionList);
}
//Step.2 获取导出数据
List<${entityName}> ${entityName?uncap_first}List = ${entityName?uncap_first}Service.list(queryWrapper);
// Step.3 组装pageList
List<${entityName}Page> pageList = new ArrayList<${entityName}Page>();
for (${entityName} main : ${entityName?uncap_first}List) {
${entityName}Page vo = new ${entityName}Page();
BeanUtils.copyProperties(main, vo);
<#list subTables as sub>
List<${sub.entityName}> ${sub.entityName?uncap_first}List = ${sub.entityName?uncap_first}Service.selectByMainId(main.getId());
vo.set${sub.entityName}List(${sub.entityName?uncap_first}List);
</#list>
pageList.add(vo);
}
// Step.4 AutoPoi 导出Excel
ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
mv.addObject(NormalExcelConstants.FILE_NAME, "${tableVo.ftlDescription}列表");
mv.addObject(NormalExcelConstants.CLASS, ${entityName}Page.class);
mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("${tableVo.ftlDescription}数据", "导出人:"+sysUser.getRealname(), "${tableVo.ftlDescription}"));
mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
return mv;
}
/**
* 通过excel导入数据
*
* @param request
* @param response
* @return
*/
@RequiresPermissions("${entityPackage}:${tableName}:importExcel")
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
// 获取上传文件对象
MultipartFile file = entity.getValue();
ImportParams params = new ImportParams();
params.setTitleRows(2);
params.setHeadRows(1);
params.setNeedSave(true);
try {
List<${entityName}Page> list = ExcelImportUtil.importExcel(file.getInputStream(), ${entityName}Page.class, params);
for (${entityName}Page page : list) {
${entityName} po = new ${entityName}();
BeanUtils.copyProperties(page, po);
${entityName?uncap_first}Service.saveMain(po, <#list subTables as sub>page.get${sub.entityName}List()<#if sub_has_next>,</#if></#list>);
}
return Result.OK("文件导入成功!数据行数:" + list.size());
} catch (Exception e) {
log.error(e.getMessage(),e);
return Result.error("文件导入失败:"+e.getMessage());
} finally {
try {
file.getInputStream().close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
return Result.OK("文件导入失败!");
}
}

View File

@ -1,105 +0,0 @@
package ${bussiPackage}.${entityPackage}.service.impl;
import ${bussiPackage}.${entityPackage}.entity.${entityName};
<#list subTables as sub>
import ${bussiPackage}.${entityPackage}.entity.${sub.entityName};
</#list>
<#list subTables as sub>
import ${bussiPackage}.${entityPackage}.mapper.${sub.entityName}Mapper;
</#list>
import ${bussiPackage}.${entityPackage}.mapper.${entityName}Mapper;
import ${bussiPackage}.${entityPackage}.service.I${entityName}Service;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import java.io.Serializable;
import java.util.List;
import java.util.Collection;
/**
* @Description: ${tableVo.ftlDescription}
* @Author: jeecg-boot
* @Date: ${.now?string["yyyy-MM-dd"]}
* @Version: V1.0
*/
@Service
public class ${entityName}ServiceImpl extends ServiceImpl<${entityName}Mapper, ${entityName}> implements I${entityName}Service {
@Autowired
private ${entityName}Mapper ${entityName?uncap_first}Mapper;
<#list subTables as sub>
@Autowired
private ${sub.entityName}Mapper ${sub.entityName?uncap_first}Mapper;
</#list>
@Override
@Transactional(rollbackFor = Exception.class)
public void saveMain(${entityName} ${entityName?uncap_first}, <#list subTables as sub>List<${sub.entityName}> ${sub.entityName?uncap_first}List<#if sub_has_next>,</#if></#list>) {
${entityName?uncap_first}Mapper.insert(${entityName?uncap_first});
<#list subTables as sub>
if(${sub.entityName?uncap_first}List!=null && ${sub.entityName?uncap_first}List.size()>0) {
for(${sub.entityName} entity:${sub.entityName?uncap_first}List) {
<#list sub.foreignKeys as key>
//外键设置
<#if key?lower_case?index_of("${primaryKeyField}")!=-1>
entity.set${key?cap_first}(${entityName?uncap_first}.get${primaryKeyField?cap_first}());
<#else>
entity.set${key?cap_first}(${entityName?uncap_first}.get${key}());
</#if>
</#list>
${sub.entityName?uncap_first}Mapper.insert(entity);
}
}
</#list>
}
@Override
@Transactional(rollbackFor = Exception.class)
public void updateMain(${entityName} ${entityName?uncap_first},<#list subTables as sub>List<${sub.entityName}> ${sub.entityName?uncap_first}List<#if sub_has_next>,</#if></#list>) {
${entityName?uncap_first}Mapper.updateById(${entityName?uncap_first});
//1.先删除子表数据
<#list subTables as sub>
${sub.entityName?uncap_first}Mapper.deleteByMainId(${entityName?uncap_first}.getId());
</#list>
//2.子表数据重新插入
<#list subTables as sub>
if(${sub.entityName?uncap_first}List!=null && ${sub.entityName?uncap_first}List.size()>0) {
for(${sub.entityName} entity:${sub.entityName?uncap_first}List) {
<#list sub.foreignKeys as key>
//外键设置
<#if key?lower_case?index_of("${primaryKeyField}")!=-1>
entity.set${key?cap_first}(${entityName?uncap_first}.get${primaryKeyField?cap_first}());
<#else>
entity.set${key?cap_first}(${entityName?uncap_first}.get${key}());
</#if>
</#list>
${sub.entityName?uncap_first}Mapper.insert(entity);
}
}
</#list>
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delMain(String id) {
<#list subTables as sub>
${sub.entityName?uncap_first}Mapper.deleteByMainId(id);
</#list>
${entityName?uncap_first}Mapper.deleteById(id);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delBatchMain(Collection<? extends Serializable> idList) {
for(Serializable id:idList) {
<#list subTables as sub>
${sub.entityName?uncap_first}Mapper.deleteByMainId(id.toString());
</#list>
${entityName?uncap_first}Mapper.deleteById(id);
}
}
}

View File

@ -1,192 +0,0 @@
<#include "/common/utils.ftl">
<template>
<BasicModal v-bind="$attrs" @register="registerModal" destroyOnClose :title="title" :width="${getModalWidth(tableVo.fieldRowNum?default(1))}" @ok="handleSubmit">
<BasicForm @register="registerForm" ref="formRef"/>
<!-- 子表单区域 -->
<a-tabs v-model:activeKey="activeKey" animated @change="handleChangeTabs">
<#list subTables as sub><#rt/>
<#assign refKey = sub.entityName?uncap_first/>
<#if sub.foreignRelationType =='1'>
<a-tab-pane tab="${sub.ftlDescription}" key="${refKey}" :forceRender="true">
<${sub.entityName}Form ref="${sub.entityName?uncap_first}Form" :disabled="formDisabled"></${sub.entityName}Form>
</a-tab-pane>
<#else>
<a-tab-pane tab="${sub.ftlDescription}" key="${refKey}" :forceRender="true">
<JVxeTable
keep-source
resizable
ref="${refKey}"
:loading="${sub.entityName?uncap_first}Table.loading"
:columns="${sub.entityName?uncap_first}Table.columns"
:dataSource="${sub.entityName?uncap_first}Table.dataSource"
:height="340"
:disabled="formDisabled"
:rowNumber="true"
:rowSelection="true"
:toolbar="true"
/>
</a-tab-pane>
</#if>
</#list>
</a-tabs>
</BasicModal>
</template>
<script lang="ts" setup>
import {ref, computed, unref,reactive} from 'vue';
import {BasicModal, useModalInner} from '/@/components/Modal';
import {BasicForm, useForm} from '/@/components/Form/index';
import { JVxeTable } from '/@/components/jeecg/JVxeTable'
import { useJvxeMethod } from '/@/hooks/system/useJvxeMethods.ts'
<#list subTables as sub>
<#if sub.foreignRelationType =='1'>
import ${sub.entityName}Form from './${sub.entityName}Form.vue'
</#if>
</#list>
import {formSchema<#list subTables as sub><#if sub.foreignRelationType =='0'>,${sub.entityName?uncap_first}JVxeColumns</#if></#list>} from '../${entityName}.data';
import {saveOrUpdate<#list subTables as sub>,query${sub.entityName}</#list>} from '../${entityName}.api';
import { VALIDATE_FAILED } from '/@/utils/common/vxeUtils'
// Emits声明
const emit = defineEmits(['register','success']);
const isUpdate = ref(true);
const formDisabled = ref(false);
const refKeys = ref([<#list subTables as sub>'${sub.entityName?uncap_first}', </#list>]);
<#assign hasOne2Many = false>
<#assign hasOne2One = false>
const activeKey = ref('${subTables[0].entityName?uncap_first}');
<#list subTables as sub>
<#if sub.foreignRelationType =='0'>
<#assign hasOne2Many = true>
const ${sub.entityName?uncap_first} = ref();
</#if>
<#if sub.foreignRelationType =='1'>
<#assign hasOne2One = true>
const ${sub.entityName?uncap_first}Form = ref();
</#if>
</#list>
const tableRefs = {<#list subTables as sub><#if sub.foreignRelationType =='0'>${sub.entityName?uncap_first}, <#assign hasOne2Many = true></#if></#list>};
<#list subTables as sub>
<#if sub.foreignRelationType =='0'>
const ${sub.entityName?uncap_first}Table = reactive({
loading: false,
dataSource: [],
columns:${sub.entityName?uncap_first}JVxeColumns
})
</#if>
</#list>
//表单配置
const [registerForm, {setProps,resetFields, setFieldsValue, validate}] = useForm({
//labelWidth: 150,
schemas: formSchema,
showActionButtonGroup: false,
baseColProps: {span: ${getFormSpan(tableVo.fieldRowNum?default(1))}}
});
//表单赋值
const [registerModal, {setModalProps, closeModal}] = useModalInner(async (data) => {
//重置表单
await reset();
setModalProps({confirmLoading: false,showCancelBtn:data?.showFooter,showOkBtn:data?.showFooter});
isUpdate.value = !!data?.isUpdate;
formDisabled.value = !data?.showFooter;
if (unref(isUpdate)) {
//表单赋值
await setFieldsValue({
...data.record,
});
<#list subTables as sub><#rt/>
<#if sub.foreignRelationType =='1'>
${sub.entityName?uncap_first}Form.value.initFormData(query${sub.entityName},data?.record?.id)
</#if>
</#list>
<#list subTables as sub><#rt/>
<#if sub.foreignRelationType =='0'>
requestSubTableData(query${sub.entityName}, {id:data?.record?.id}, ${sub.entityName?uncap_first}Table)
</#if>
</#list>
}
// 隐藏底部时禁用整个表单
setProps({ disabled: !data?.showFooter })
});
//方法配置
const [handleChangeTabs,handleSubmit,requestSubTableData,formRef] = useJvxeMethod(requestAddOrEdit,classifyIntoFormData,tableRefs,activeKey,refKeys<#if hasOne2One==true>,validateSubForm</#if>);
//设置标题
const title = computed(() => (!unref(isUpdate) ? '新增' : '编辑'));
async function reset(){
await resetFields();
activeKey.value = '${subTables[0].entityName?uncap_first}';
<#list subTables as sub>
<#if sub.foreignRelationType =='0'>
${sub.entityName?uncap_first}Table.dataSource = [];
</#if>
<#if sub.foreignRelationType =='1'>
${sub.entityName?uncap_first}Form.value.resetFields();
</#if>
</#list>
}
function classifyIntoFormData(allValues) {
let main = Object.assign({}, allValues.formValue)
return {
...main, // 展开
<#assign subManyIndex = 0>
<#list subTables as sub><#rt/>
<#if sub.foreignRelationType =='0'>
${sub.entityName?uncap_first}List: allValues.tablesValue[${subManyIndex}].tableData,
<#assign subManyIndex = subManyIndex+1>
<#else>
${sub.entityName?uncap_first}List: ${sub.entityName?uncap_first}Form.value.getFormData(),
</#if>
</#list>
}
}
<#if hasOne2One==true>
//校验所有一对一子表表单
function validateSubForm(allValues){
return new Promise((resolve,reject)=>{
Promise.all([
<#list subTables as sub><#rt/>
<#if sub.foreignRelationType =='1'>
${sub.entityName?uncap_first}Form.value.validateForm(${sub_index}),
</#if>
</#list>
]).then(() => {
resolve(allValues)
}).catch(e => {
if (e.error === VALIDATE_FAILED) {
// 如果有未通过表单验证的子表就自动跳转到它所在的tab
activeKey.value = e.index == null ? unref(activeKey) : refKeys.value[e.index]
} else {
console.error(e)
}
})
})
}
</#if>
//表单提交事件
async function requestAddOrEdit(values) {
try {
setModalProps({confirmLoading: true});
//提交表单
await saveOrUpdate(values, isUpdate.value);
//关闭弹窗
closeModal();
//刷新列表
emit('success');
} finally {
setModalProps({confirmLoading: false});
}
}
</script>
<style lang="less" scoped>
/** 时间和数字输入框样式 */
:deep(.ant-input-number){
width: 100%
}
:deep(.ant-calendar-picker){
width: 100%
}
</style>

View File

@ -1,25 +0,0 @@
package org.jeecg.modules.test.seata.account.controller;
import org.jeecg.modules.test.seata.account.service.SeataAccountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.math.BigDecimal;
/**
* @author zyf
*/
@RestController
@RequestMapping("/test/seata/account")
public class SeataAccountController {
@Autowired
private SeataAccountService accountService;
@PostMapping("/reduceBalance")
public void reduceBalance(Long userId, BigDecimal amount) {
accountService.reduceBalance(userId, amount);
}
}

View File

@ -1,17 +0,0 @@
package org.jeecg.modules.test.seata.account.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.jeecg.modules.test.seata.account.entity.SeataAccount;
/**
* @Description: TODO
* @author: zyf
* @date: 2022/01/24
* @version: V1.0
*/
@Mapper
public interface SeataAccountMapper extends BaseMapper<SeataAccount> {
}

View File

@ -1,18 +0,0 @@
package org.jeecg.modules.test.seata.account.service;
import java.math.BigDecimal;
/**
* @Description: 账户接口
* @author: zyf
* @date: 2022/01/24
* @version: V1.0
*/
public interface SeataAccountService {
/**
* 扣减金额
* @param userId 用户 ID
* @param amount 扣减金额
*/
void reduceBalance(Long userId, BigDecimal amount);
}

View File

@ -1,53 +0,0 @@
package org.jeecg.modules.test.seata.account.service.impl;
import com.baomidou.dynamic.datasource.annotation.DS;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.modules.test.seata.account.entity.SeataAccount;
import org.jeecg.modules.test.seata.account.mapper.SeataAccountMapper;
import org.jeecg.modules.test.seata.account.service.SeataAccountService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.Assert;
import javax.annotation.Resource;
import java.math.BigDecimal;
/**
* @Description: TODO
* @author: zyf
* @date: 2022/01/24
* @version: V1.0
*/
@Slf4j
@Service
public class SeataAccountServiceImpl implements SeataAccountService {
@Resource
private SeataAccountMapper accountMapper;
/**
* 事务传播特性设置为 REQUIRES_NEW 开启新的事务
*/
@DS("account")
@Override
@Transactional(propagation = Propagation.REQUIRES_NEW,rollbackFor = Exception.class)
public void reduceBalance(Long userId, BigDecimal amount) {
log.info("=============ACCOUNT START=================");
SeataAccount account = accountMapper.selectById(userId);
Assert.notNull(account, "用户不存在");
BigDecimal balance = account.getBalance();
log.info("下单用户{}余额为 {},商品总价为{}", userId, balance, amount);
if (balance.compareTo(amount)==-1) {
log.warn("用户 {} 余额不足,当前余额:{}", userId, balance);
throw new RuntimeException("余额不足");
}
log.info("开始扣减用户 {} 余额", userId);
BigDecimal currentBalance = account.getBalance().subtract(amount);
account.setBalance(currentBalance);
accountMapper.updateById(account);
log.info("扣减用户 {} 余额成功,扣减后用户账户余额为{}", userId, currentBalance);
log.info("=============ACCOUNT END=================");
}
}

View File

@ -1,60 +0,0 @@
package org.jeecg.modules.test.seata.order.controller;
/**
* @Description: TODO
* @author: zyf
* @date: 2022/01/24
* @version: V1.0
*/
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.jeecg.modules.test.seata.order.dto.PlaceOrderRequest;
import org.jeecg.modules.test.seata.order.service.SeataOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/test/seata/order")
@Api(tags = "seata测试")
public class SeataOrderController {
@Autowired
private SeataOrderService orderService;
/**
* 自由下单
*/
@PostMapping("/placeOrder")
@ApiOperation(value = "自由下单", notes = "自由下单")
public String placeOrder(@Validated @RequestBody PlaceOrderRequest request) {
orderService.placeOrder(request);
return "下单成功";
}
/**
* 测试商品库存不足-异常回滚
*/
@PostMapping("/test1")
@ApiOperation(value = "测试商品库存不足", notes = "测试商品库存不足")
public String test1() {
//商品单价10元库存20个,用户余额50元模拟一次性购买22个 期望异常回滚
orderService.placeOrder(new PlaceOrderRequest(1L, 1L, 22));
return "下单成功";
}
/**
* 测试用户账户余额不足-异常回滚
*/
@PostMapping("/test2")
@ApiOperation(value = "测试用户账户余额不足", notes = "测试用户账户余额不足")
public String test2() {
//商品单价10元库存20个用户余额50元模拟一次性购买6个 期望异常回滚
orderService.placeOrder(new PlaceOrderRequest(1L, 1L, 6));
return "下单成功";
}
}

View File

@ -1,68 +0,0 @@
package org.jeecg.modules.test.seata.order.service.impl;
import com.baomidou.dynamic.datasource.annotation.DS;
import io.seata.spring.annotation.GlobalTransactional;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.modules.test.seata.order.dto.PlaceOrderRequest;
import org.jeecg.modules.test.seata.order.entity.SeataOrder;
import org.jeecg.modules.test.seata.order.enums.OrderStatus;
import org.jeecg.modules.test.seata.order.feign.AccountClient;
import org.jeecg.modules.test.seata.order.feign.ProductClient;
import org.jeecg.modules.test.seata.order.mapper.SeataOrderMapper;
import org.jeecg.modules.test.seata.order.service.SeataOrderService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.math.BigDecimal;
/**
* @Description: 订单服务类
* @author: zyf
* @date: 2022/01/24
* @version: V1.0
*/
@Slf4j
@Service
public class SeataOrderServiceImpl implements SeataOrderService {
@Resource
private SeataOrderMapper orderMapper;
@Resource
private AccountClient accountClient;
@Resource
private ProductClient productClient;
@DS("order")
@Override
@Transactional(rollbackFor = Exception.class)
@GlobalTransactional
public void placeOrder(PlaceOrderRequest request) {
log.info("=============ORDER START=================");
Long userId = request.getUserId();
Long productId = request.getProductId();
Integer count = request.getCount();
log.info("收到下单请求,用户:{}, 商品:{},数量:{}", userId, productId, count);
SeataOrder order = SeataOrder.builder()
.userId(userId)
.productId(productId)
.status(OrderStatus.INIT)
.count(count)
.build();
orderMapper.insert(order);
log.info("订单一阶段生成,等待扣库存付款中");
// 扣减库存并计算总价
BigDecimal amount = productClient.reduceStock(productId, count);
// 扣减余额
accountClient.reduceBalance(userId, amount);
order.setStatus(OrderStatus.SUCCESS);
order.setTotalPrice(amount);
orderMapper.updateById(order);
log.info("订单已成功下单");
log.info("=============ORDER END=================");
}
}

View File

@ -1,25 +0,0 @@
package org.jeecg.modules.test.seata.product.controller;
import org.jeecg.modules.test.seata.product.service.SeataProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.math.BigDecimal;
/**
* @author zyf
*/
@RestController
@RequestMapping("/test/seata/product")
public class SeataProductController {
@Autowired
private SeataProductService seataProductService;
@PostMapping("/reduceStock")
public BigDecimal reduceStock(Long productId, Integer count) {
return seataProductService.reduceStock(productId, count);
}
}

View File

@ -1,16 +0,0 @@
package org.jeecg.modules.test.seata.product.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.jeecg.modules.test.seata.product.entity.SeataProduct;
/**
* @Description: TODO
* @author: zyf
* @date: 2022/01/24
* @version: V1.0
*/
@Mapper
public interface SeataProductMapper extends BaseMapper<SeataProduct> {
}

View File

@ -1,20 +0,0 @@
package org.jeecg.modules.test.seata.product.service;
import java.math.BigDecimal;
/**
* @Description: 产品接口
* @author: zyf
* @date: 2022/01/24
* @version: V1.0
*/
public interface SeataProductService {
/**
* 扣减库存
*
* @param productId 商品 ID
* @param count 扣减数量
* @return 商品总价
*/
BigDecimal reduceStock(Long productId, Integer count);
}

View File

@ -1,57 +0,0 @@
package org.jeecg.modules.test.seata.product.service.impl;
import com.baomidou.dynamic.datasource.annotation.DS;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.modules.test.seata.product.entity.SeataProduct;
import org.jeecg.modules.test.seata.product.mapper.SeataProductMapper;
import org.jeecg.modules.test.seata.product.service.SeataProductService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.Assert;
import javax.annotation.Resource;
import java.math.BigDecimal;
/**
* @Description: 产品服务类
* @author: zyf
* @date: 2022/01/24
* @version: V1.0
*/
@Slf4j
@Service
public class SeataProductServiceImpl implements SeataProductService {
@Resource
private SeataProductMapper productMapper;
/**
* 事务传播特性设置为 REQUIRES_NEW 开启新的事务
*/
@DS("product")
@Transactional(propagation = Propagation.REQUIRES_NEW,rollbackFor = Exception.class)
@Override
public BigDecimal reduceStock(Long productId, Integer count) {
log.info("=============PRODUCT START=================");
// 检查库存
SeataProduct product = productMapper.selectById(productId);
Assert.notNull(product, "商品不存在");
Integer stock = product.getStock();
log.info("商品编号为 {} 的库存为{},订单商品数量为{}", productId, stock, count);
if (stock < count) {
log.warn("商品编号为{} 库存不足,当前库存:{}", productId, stock);
throw new RuntimeException("库存不足");
}
log.info("开始扣减商品编号为 {} 库存,单价商品价格为{}", productId, product.getPrice());
// 扣减库存
int currentStock = stock - count;
product.setStock(currentStock);
productMapper.updateById(product);
BigDecimal totalPrice = product.getPrice().multiply(new BigDecimal(count));
log.info("扣减商品编号为 {} 库存成功,扣减后库存为{}, {} 件商品总价为 {} ", productId, currentStock, count, totalPrice);
log.info("=============PRODUCT END=================");
return totalPrice;
}
}