人工交互页面查询台站,探测器信息接口增加根据系统类型查询信息
This commit is contained in:
parent
9adeda8597
commit
62d448c294
|
@ -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")
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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<String, List<String>> map = new HashMap<>();
|
||||
//查询谱对应的台站类型
|
||||
if (StringUtils.isBlank(sampleType)){
|
||||
result.error500("谱类型不能为空");
|
||||
return result;
|
||||
}
|
||||
List<String> 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<String> stationTypes = sysDictService.findStationType(menuTypes);
|
||||
if (CollectionUtils.isEmpty(stationTypes)) {
|
||||
result.error500("请先补充数据字典中当前系统类型对应的台站类型信息");
|
||||
return result;
|
||||
}
|
||||
//获取台站编码
|
||||
List<String> stationCodes = new LinkedList<>();
|
||||
List<String> detectorCodes = new LinkedList<>();
|
||||
//根据台站id查询台站名称
|
||||
Map<String, String> stationMap = (Map<String, String>)redisUtil.get("stationMap");
|
||||
//查询台站信息接口
|
||||
HashMap<String, Object> stationMap = (HashMap<String, Object>)redisUtil.get("stationInfoMap");
|
||||
//从redis中获取探测器信息
|
||||
Map<Integer, String> detectorInfoMap = (Map<Integer, String>)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<String, String> entry:stationMap.entrySet()) {
|
||||
if (userStations.contains(entry.getKey())) {
|
||||
stationCodes.add(entry.getValue());
|
||||
for (Map.Entry<String, Object> 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<Integer, String> 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<String, String> entry: stationMap.entrySet()) {
|
||||
stationCodes.add(entry.getValue());
|
||||
for (Map.Entry<String, Object> 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<Integer, String> 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());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user