feat:selfStationController 增加 resetButton 接口

This commit is contained in:
xiaoguangbin 2024-07-25 14:34:44 +08:00
parent 566657c339
commit 50c70d7026
3 changed files with 38 additions and 0 deletions

View File

@ -298,6 +298,12 @@ public class SelfStationController {
return selfStationService.getGammaGated(chartHeight, channelWidth, gammaChannel, sampleId, qcFileName, sampleFileName, request);
}
@PostMapping("resetButton")
@ApiOperation(value = "重置计算数据", notes = "重置计算数据")
public void resetButton(String sampleFileName, String tabName, HttpServletRequest request) {
selfStationService.resetButton(sampleFileName, tabName, request);
}
@GetMapping("NuclideLibrary")
@ApiOperation(value = "查看Nuclide Library页面数据", notes = "查看Nuclide Library页面数据")
public Result NuclideLibrary(Integer sampleId, String fileName, String editEnergy, double err, String libraryName, String nuclideName, HttpServletRequest request) {

View File

@ -97,6 +97,8 @@ public interface ISelfStationService {
Result getGammaGated(Integer chartHeight, Integer channelWidth, Integer gammaChannel, Integer sampleId, String qcFileName, String sampleFileName, HttpServletRequest request);
void resetButton(String sampleFileName, String tabName, HttpServletRequest request);
Result NuclideLibrary(Integer sampleId, String fileName, String editEnergy, double err, String libraryName, String nuclideName, HttpServletRequest request);
Result configUserLibrary(Integer sampleId, String fileName, HttpServletRequest request);

View File

@ -3029,6 +3029,36 @@ public class SelfStationServiceImpl implements ISelfStationService {
return result;
}
@Override
public void resetButton(String sampleFileName, String tabName, HttpServletRequest request) {
//获取用户名
String userName = JwtUtil.getUserNameByToken(request);
//获取自建台站缓存信息
Cache<String, SelfStationData> selfCache = selfStationCache.getSelfCache();
SelfStationData betaDataFile = selfCache.getIfPresent(sampleFileName + StringPool.DASH + userName);
//获取缓存信息
// Cache<String, BetaDataFile> cache = betaCache.getBetaCache();
// BetaDataFile betaDataFile = cache.getIfPresent(sampleFileName + "-" + userName);
if (Objects.nonNull(betaDataFile)) {
//判断需要重置的tab页
if (tabName.equalsIgnoreCase("gamma")) {
betaDataFile.setGammaListNow(Collections.EMPTY_LIST);
betaDataFile.setGammaFittingParaNow(Collections.EMPTY_LIST);
betaDataFile.setGammaFittingParaToUiNow(Collections.EMPTY_LIST);
betaDataFile.setGammaNewEnergyListNow(Collections.EMPTY_LIST);
betaDataFile.setBetaListNow(Collections.EMPTY_LIST);
betaDataFile.setBetaFittingParaNow(Collections.EMPTY_LIST);
betaDataFile.setBetaFittingParaToUiNow(Collections.EMPTY_LIST);
betaDataFile.setBetaNewEnergyListNow(Collections.EMPTY_LIST);
} else if (tabName.equalsIgnoreCase("beta")) {
betaDataFile.setBetaListNow(Collections.EMPTY_LIST);
betaDataFile.setBetaFittingParaNow(Collections.EMPTY_LIST);
betaDataFile.setBetaFittingParaToUiNow(Collections.EMPTY_LIST);
betaDataFile.setBetaNewEnergyListNow(Collections.EMPTY_LIST);
}
}
}
private List<SeriseData> getGateGamma(int channelWidth, int chartHeight, int gammaChannel, SelfStationData betaDataFile){
List<SeriseData> serise_data = new LinkedList<>();
//选择矩形框高度