diff --git a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/controller/SpectrumAnalysesController.java b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/controller/SpectrumAnalysesController.java index 2545beae..a77d5e8e 100644 --- a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/controller/SpectrumAnalysesController.java +++ b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/controller/SpectrumAnalysesController.java @@ -32,8 +32,8 @@ public class SpectrumAnalysesController { @GetMapping("getDBSearchList") @ApiOperation(value = "查询查询条件数据接口", notes = "查询查询条件数据接口") - public Result getDBSearchList(HttpServletRequest request, boolean AllUsers) { - return spectrumAnalysisService.getDBSearchList(request, AllUsers); + public Result getDBSearchList(HttpServletRequest request, boolean AllUsers, String sampleType) { + return spectrumAnalysisService.getDBSearchList(request, AllUsers, sampleType); } @GetMapping("getDBSpectrumList") diff --git a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/ISpectrumAnalysisService.java b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/ISpectrumAnalysisService.java index ee0248af..a6fcbfcb 100644 --- a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/ISpectrumAnalysisService.java +++ b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/ISpectrumAnalysisService.java @@ -16,7 +16,7 @@ public interface ISpectrumAnalysisService { Result initValue(String dbName, Integer sampleId, String analyst, String sampleFileName, String gasFileName, String detFileName, String qcFileName, HttpServletRequest request); - Result getDBSearchList(HttpServletRequest request, boolean AllUsers); + Result getDBSearchList(HttpServletRequest request, boolean AllUsers, String sampleType); Result getDBSpectrumList(QueryRequest queryRequest, GardsSampleDataSpectrum gardsSampleData, String dbName, String[] menuTypes, boolean AllUsers, boolean CollectStopB, boolean AcqStartB, Date startDate, Date endDate, HttpServletRequest request); diff --git a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/SpectrumAnalysisServiceImpl.java b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/SpectrumAnalysisServiceImpl.java index dced9e2f..bcfede07 100644 --- a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/SpectrumAnalysisServiceImpl.java +++ b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/SpectrumAnalysisServiceImpl.java @@ -31,6 +31,7 @@ import org.jeecg.modules.base.abstracts.AbstractLogOrReport; import org.jeecg.modules.base.bizVo.BetaRLR; import org.jeecg.modules.base.dto.*; import org.jeecg.modules.base.entity.configuration.GardsDetectors; +import org.jeecg.modules.base.entity.configuration.GardsStations; import org.jeecg.modules.base.entity.original.GardsSampleData; import org.jeecg.modules.base.entity.rnman.*; import org.jeecg.modules.base.enums.*; @@ -126,14 +127,34 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements } @Override - public Result getDBSearchList(HttpServletRequest request, boolean AllUsers) { + public Result getDBSearchList(HttpServletRequest request, boolean AllUsers, String sampleType) { Result result = new Result(); + //接收返回结果 Map> map = new HashMap<>(); + //查询谱对应的台站类型 + if (StringUtils.isBlank(sampleType)){ + result.error500("谱类型不能为空"); + return result; + } + List menuTypes = new LinkedList<>(); + if (sampleType.equalsIgnoreCase("All")) { + menuTypes.add(SystemType.BETA.getType()); + menuTypes.add(SystemType.GAMMA.getType()); + } else if (sampleType.equalsIgnoreCase("Beta")) { + menuTypes.add(SystemType.BETA.getType()); + } else if (sampleType.equalsIgnoreCase("Gamma")) { + menuTypes.add(SystemType.GAMMA.getType()); + } + List stationTypes = sysDictService.findStationType(menuTypes); + if (CollectionUtils.isEmpty(stationTypes)) { + result.error500("请先补充数据字典中当前系统类型对应的台站类型信息"); + return result; + } //获取台站编码 List stationCodes = new LinkedList<>(); List detectorCodes = new LinkedList<>(); - //根据台站id查询台站名称 - Map stationMap = (Map)redisUtil.get("stationMap"); + //查询台站信息接口 + HashMap stationMap = (HashMap)redisUtil.get("stationInfoMap"); //从redis中获取探测器信息 Map detectorInfoMap = (Map)redisUtil.get("detectorsMap"); //获取台站信息 @@ -145,24 +166,26 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements result.error500("Description Failed to obtain the current login user information!"); return result; } + //查询用户当天排班的台站信息 userStations = userTaskUtil.findUserStation(userName); //判断当前用户在当天是否有排班任务的台站信息 if (CollectionUtils.isNotEmpty(userStations)) { if (CollectionUtils.isNotEmpty(stationMap)){ - for (Map.Entry entry:stationMap.entrySet()) { - if (userStations.contains(entry.getKey())) { - stationCodes.add(entry.getValue()); + for (Map.Entry entry:stationMap.entrySet()) { + GardsStations value = (GardsStations)entry.getValue(); + if (userStations.contains(entry.getKey()) && StringUtils.isNotBlank(value.getType()) && stationTypes.contains(value.getType())) { + stationCodes.add(value.getStationCode()); } } } if (CollectionUtils.isNotEmpty(detectorInfoMap)) { for (Map.Entry entry:detectorInfoMap.entrySet()) { - if (String.valueOf(entry.getKey()).length() <= 3) { - if (userStations.contains(String.valueOf(entry.getKey()))) { + if (String.valueOf(entry.getValue()).length() <= 5) { + if (stationCodes.contains(String.valueOf(entry.getValue()))) { detectorCodes.add(entry.getValue()); } } else { - if (userStations.contains(String.valueOf(entry.getKey()).substring(0, 3))) { + if (stationCodes.contains(String.valueOf(entry.getValue()).substring(0, 5))) { detectorCodes.add(entry.getValue()); } } @@ -171,13 +194,24 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements } } else { if (CollectionUtils.isNotEmpty(stationMap)) { - for (Map.Entry entry: stationMap.entrySet()) { - stationCodes.add(entry.getValue()); + for (Map.Entry entry: stationMap.entrySet()) { + GardsStations value = (GardsStations) entry.getValue(); + if (StringUtils.isNotBlank(value.getType()) && stationTypes.contains(value.getType())) { + stationCodes.add(value.getStationCode()); + } } } if (CollectionUtils.isNotEmpty(detectorInfoMap)) { for (Map.Entry entry: detectorInfoMap.entrySet()) { - detectorCodes.add(entry.getValue()); + if (String.valueOf(entry.getValue()).length() <= 5) { + if (stationCodes.contains(String.valueOf(entry.getValue()))) { + detectorCodes.add(entry.getValue()); + } + } else { + if (stationCodes.contains(String.valueOf(entry.getValue()).substring(0, 5))) { + detectorCodes.add(entry.getValue()); + } + } } } }