Merge branch 'main' of http://121.37.111.42:3000/zhengsl/WholeProcessPlatform into main_hzz
This commit is contained in:
commit
65c4f4260c
@ -87,7 +87,7 @@ public class SwaggerConfig {
|
||||
@Bean
|
||||
public GroupedOpenApi groupEnvVDApi() {
|
||||
return GroupedOpenApi.builder()
|
||||
.group("3.3.1 全过程-生态环保数据服务-过鱼设施-过鱼监测")
|
||||
.group("3.3.1 全过程-生态环保数据服务-过鱼设施-过鱼监测(VD视频模块)")
|
||||
.packagesToScan("com.yfd.platform.qgc_env.vd.controller")
|
||||
.build();
|
||||
}
|
||||
@ -119,6 +119,15 @@ public class SwaggerConfig {
|
||||
.build();
|
||||
}
|
||||
|
||||
@Bean
|
||||
public GroupedOpenApi groupEnvFprApi() {
|
||||
return GroupedOpenApi.builder()
|
||||
.group("3.5 全过程-生态环保数据服务-鱼类调查")
|
||||
.packagesToScan("com.yfd.platform.qgc_env.fpr.controller")
|
||||
.build();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
package com.yfd.platform.qgc_base.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.yfd.platform.common.DataSourceRequest;
|
||||
import com.yfd.platform.annotation.Log;
|
||||
import com.yfd.platform.config.ResponseResult;
|
||||
import com.yfd.platform.qgc_base.domain.SdHbrvDic;
|
||||
@ -112,4 +113,10 @@ public class SdHbrvDicController {
|
||||
@RequestParam(required = false) String baseid) {
|
||||
return ResponseResult.successData(hbrvDicService.regDropdown(hbrvnm, baseid));
|
||||
}
|
||||
|
||||
@PostMapping("/wbsb/getHbrvdList")
|
||||
@Operation(summary = "根据基地查询基地流域列表")
|
||||
public ResponseResult getHbrvdList(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||
return ResponseResult.successData(hbrvDicService.getHbrvdList(dataSourceRequest));
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,21 @@
|
||||
package com.yfd.platform.qgc_base.entity.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@Schema(description = "基地流域树节点")
|
||||
public class HbrvWbsVo {
|
||||
|
||||
@Schema(description = "基地流域编码")
|
||||
private String hbrvcd;
|
||||
|
||||
@Schema(description = "基地流域名称")
|
||||
private String hbrvcdName;
|
||||
|
||||
@Schema(description = "基地编码")
|
||||
private String baseId;
|
||||
|
||||
@Schema(description = "基地名称")
|
||||
private String baseName;
|
||||
}
|
||||
@ -2,7 +2,9 @@ package com.yfd.platform.qgc_base.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.yfd.platform.common.DataSourceRequest;
|
||||
import com.yfd.platform.qgc_base.domain.SdHbrvDic;
|
||||
import com.yfd.platform.qgc_base.entity.vo.HbrvWbsVo;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
@ -58,4 +60,6 @@ public interface ISdHbrvDicService extends IService<SdHbrvDic> {
|
||||
|
||||
List<SdHbrvDic> regDropdown(String hbrvnm, String baseid);
|
||||
|
||||
List<HbrvWbsVo> getHbrvdList(DataSourceRequest dataSourceRequest);
|
||||
|
||||
}
|
||||
@ -1139,20 +1139,45 @@ public class SdEngInfoBHServiceImpl extends ServiceImpl<SdEngInfoBHMapper, SdEng
|
||||
return null;
|
||||
}
|
||||
return switch (field) {
|
||||
case "stcd", "eiaStcd" -> "e.STCD";
|
||||
case "hydropowerStation" -> "e.ENNM";
|
||||
case "baseId", "baseid" -> "e.BASEID";
|
||||
case "hbrvcd" -> "e.HBRVCD";
|
||||
case "envMonitoringRequire" -> "e.ENV_MONITORING_REQUIRE";
|
||||
case "ecologicalFlow" -> "e.ECOLOGICAL_FLOW";
|
||||
case "approvalFileNo" -> "e.APPROVAL_FILE_NO";
|
||||
case "approvalFileTitle" -> "e.APPROVAL_FILE_TITLE";
|
||||
case "fishPassageMeasures" -> "e.FISH_PASSAGE_MEASURES";
|
||||
case "bldsttCcode" -> "s.BLDSTT_CODE";
|
||||
case "bldsttCName" -> "CASE WHEN s.BLDSTT_CODE = 0 OR s.BLDSTT_CODE IS NULL THEN '未建/规划' WHEN s.BLDSTT_CODE = 1 THEN '在建' WHEN s.BLDSTT_CODE = 2 THEN '已建' ELSE NULL END";
|
||||
case "id" -> "e.ID";
|
||||
case "basin" -> "e.BASIN";
|
||||
case "river" -> "e.RIVER";
|
||||
case "hydropowerStation" -> "e.ENNM";
|
||||
case "approvalFileNo" -> "e.APPROVAL_FILE_NO";
|
||||
case "approvalFileTitle" -> "e.APPROVAL_FILE_TITLE";
|
||||
case "fileName" -> "e.FILE_NAME";
|
||||
case "flpath" -> "e.FLPATH";
|
||||
case "ecologicalFlow" -> "e.ECOLOGICAL_FLOW";
|
||||
case "waterEnvProtection" -> "e.WATER_ENV_PROTECTION";
|
||||
case "coldWaterMitigation" -> "e.COLD_WATER_MITIGATION";
|
||||
case "habitatProtection" -> "e.HABITAT_PROTECTION";
|
||||
case "fishPassageMeasures" -> "e.FISH_PASSAGE_MEASURES";
|
||||
case "fishStocking" -> "e.FISH_STOCKING";
|
||||
case "terrestrialEcoSoilCons" -> "e.TERRESTRIAL_ECO_SOIL_CONS";
|
||||
case "rarePlantProtection" -> "e.RARE_PLANT_PROTECTION";
|
||||
case "animalRescue" -> "e.ANIMAL_RESCUE";
|
||||
case "resettlementMeasures" -> "e.RESETTLEMENT_MEASURES";
|
||||
case "constructionPollutionCtrl" -> "e.CONSTRUCTION_POLLUTION_CTRL";
|
||||
case "groundwaterGeoProtect" -> "e.GROUNDWATER_GEO_PROTECT";
|
||||
case "scenicAreaProtection" -> "e.SCENIC_AREA_PROTECTION";
|
||||
case "envMonitoringRequire" -> "e.ENV_MONITORING_REQUIRE";
|
||||
case "baseId", "baseid" -> "e.BASEID";
|
||||
case "hbrvcd" -> "e.HBRVCD";
|
||||
case "eiaStcd" -> "e.STCD";
|
||||
case "stcd" -> "s.STCD";
|
||||
case "stnm" -> "s.ENNM";
|
||||
case "sttp" -> "sttp.ID";
|
||||
case "sttpName" -> "sttp.STTP_NAME";
|
||||
case "bldsttCcode" -> "s.BLDSTT_CODE";
|
||||
case "bldsttCName" -> "CASE WHEN s.BLDSTT_CODE = 0 OR s.BLDSTT_CODE IS NULL THEN '未建/规划' WHEN s.BLDSTT_CODE = 1 THEN '在建' WHEN s.BLDSTT_CODE = 2 THEN '已建' ELSE NULL END";
|
||||
case "bldstt" -> "s.BLDSTT";
|
||||
case "lgtd" -> "s.LGTD";
|
||||
case "lttd" -> "s.LTTD";
|
||||
case "flid" -> "e.FLPATH";
|
||||
case "baseStepSort" -> "baseStepSort";
|
||||
case "rvcdStepSort" -> "rvcdStepSort";
|
||||
case "rstcdStepSort" -> "rstcdStepSort";
|
||||
case "siteStepSort" -> "siteStepSort";
|
||||
default -> null;
|
||||
};
|
||||
}
|
||||
@ -1166,23 +1191,12 @@ public class SdEngInfoBHServiceImpl extends ServiceImpl<SdEngInfoBHMapper, SdEng
|
||||
if (sortDescriptor == null || !StringUtils.hasText(sortDescriptor.getField())) {
|
||||
continue;
|
||||
}
|
||||
String column = switch (sortDescriptor.getField()) {
|
||||
case "baseStepSort" -> "baseStepSort";
|
||||
case "rvcdStepSort" -> "rvcdStepSort";
|
||||
case "rstcdStepSort" -> "rstcdStepSort";
|
||||
case "siteStepSort" -> "siteStepSort";
|
||||
case "stnm" -> "stnm";
|
||||
case "hydropowerStation" -> "e.HYDROPOWER_STATION";
|
||||
case "approvalFileNo" -> "e.APPROVAL_FILE_NO";
|
||||
case "recordTime" -> "e.RECORD_TIME";
|
||||
case "bldsttCcode" -> "s.BLDSTT_CODE";
|
||||
default -> null;
|
||||
};
|
||||
String column = mapEiaapprovalColumn(sortDescriptor.getField());
|
||||
if (!StringUtils.hasText(column)) {
|
||||
continue;
|
||||
}
|
||||
String dir = "desc".equalsIgnoreCase(sortDescriptor.getDir()) ? "DESC" : "ASC";
|
||||
orderItems.add(column + " " + dir);
|
||||
String dir = "desc".equalsIgnoreCase(sortDescriptor.getDir()) || "des".equalsIgnoreCase(sortDescriptor.getDir()) ? "DESC" : "ASC";
|
||||
orderItems.add(column + " " + dir + " NULLS LAST");
|
||||
}
|
||||
if (orderItems.isEmpty()) {
|
||||
return " ORDER BY baseStepSort ASC, rvcdStepSort ASC, rstcdStepSort ASC, siteStepSort ASC, stnm ASC";
|
||||
|
||||
@ -74,107 +74,231 @@ public class SdFishDictoryBServiceImpl extends ServiceImpl<SdFishDictoryBMapper,
|
||||
}
|
||||
|
||||
int resultLimit = (limit != null && limit > 0) ? limit : 10;
|
||||
String searchName = name.trim();
|
||||
LambdaQueryWrapper<SdFishDictoryB> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(SdFishDictoryB::getIsDeleted, 0);
|
||||
List<SdFishDictoryB> allFish = list(wrapper);
|
||||
String rawSearchName = name.trim();
|
||||
String searchName = normalizeText(rawSearchName);
|
||||
|
||||
SdFishDictoryB exactMatch = allFish.stream()
|
||||
.filter(f -> f.getName() != null && f.getName().equals(searchName))
|
||||
.findFirst()
|
||||
.orElse(null);
|
||||
|
||||
if (exactMatch != null) {
|
||||
Map<SdFishDictoryB, Integer> similarityMap = new HashMap<>();
|
||||
for (SdFishDictoryB fish : allFish) {
|
||||
if (fish.getId().equals(exactMatch.getId())) {
|
||||
continue;
|
||||
}
|
||||
int score = calculateSimilarity(exactMatch, fish);
|
||||
if (score > 0) {
|
||||
similarityMap.put(fish, score);
|
||||
}
|
||||
}
|
||||
|
||||
List<SdFishDictoryB> result = similarityMap.entrySet().stream()
|
||||
.sorted(Map.Entry.<SdFishDictoryB, Integer>comparingByValue().reversed())
|
||||
.limit(resultLimit)
|
||||
.map(Map.Entry::getKey)
|
||||
.collect(Collectors.toList());
|
||||
|
||||
result.add(0, exactMatch);
|
||||
return result;
|
||||
List<SdFishDictoryB> candidateFish = querySimilarFishCandidates(rawSearchName, searchName, resultLimit);
|
||||
if (candidateFish.isEmpty()) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
List<SdFishDictoryB> containsMatches = allFish.stream()
|
||||
.filter(f -> f.getName() != null && f.getName().contains(searchName))
|
||||
Map<String, Integer> searchScoreMap = new HashMap<>();
|
||||
for (SdFishDictoryB fish : candidateFish) {
|
||||
if (fish == null || !StringUtils.hasText(fish.getId())) {
|
||||
continue;
|
||||
}
|
||||
int score = calculateSearchScore(searchName, fish);
|
||||
if (score > 0) {
|
||||
searchScoreMap.put(fish.getId(), score);
|
||||
}
|
||||
}
|
||||
|
||||
if (searchScoreMap.isEmpty()) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
SdFishDictoryB referenceFish = candidateFish.stream()
|
||||
.filter(fish -> fish != null && searchScoreMap.containsKey(fish.getId()))
|
||||
.max((f1, f2) -> {
|
||||
int scoreCompare = Integer.compare(searchScoreMap.get(f1.getId()), searchScoreMap.get(f2.getId()));
|
||||
if (scoreCompare != 0) {
|
||||
return scoreCompare;
|
||||
}
|
||||
Integer order1 = f1.getOrderIndex() == null ? 0 : f1.getOrderIndex();
|
||||
Integer order2 = f2.getOrderIndex() == null ? 0 : f2.getOrderIndex();
|
||||
int orderCompare = Integer.compare(order1, order2);
|
||||
if (orderCompare != 0) {
|
||||
return orderCompare;
|
||||
}
|
||||
return safeText(f2.getName()).compareTo(safeText(f1.getName()));
|
||||
})
|
||||
.orElse(null);
|
||||
|
||||
if (referenceFish == null) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
return candidateFish.stream()
|
||||
.filter(fish -> fish != null && StringUtils.hasText(fish.getId()))
|
||||
.map(fish -> new AbstractMap.SimpleEntry<>(fish, buildFinalScore(referenceFish, fish, searchScoreMap.getOrDefault(fish.getId(), 0))))
|
||||
.filter(entry -> entry.getValue() > 0)
|
||||
.sorted((e1, e2) -> {
|
||||
int scoreCompare = Integer.compare(e2.getValue(), e1.getValue());
|
||||
if (scoreCompare != 0) {
|
||||
return scoreCompare;
|
||||
}
|
||||
Integer order1 = e1.getKey().getOrderIndex() == null ? 0 : e1.getKey().getOrderIndex();
|
||||
Integer order2 = e2.getKey().getOrderIndex() == null ? 0 : e2.getKey().getOrderIndex();
|
||||
int orderCompare = Integer.compare(order2, order1);
|
||||
if (orderCompare != 0) {
|
||||
return orderCompare;
|
||||
}
|
||||
return safeText(e1.getKey().getName()).compareTo(safeText(e2.getKey().getName()));
|
||||
})
|
||||
.limit(resultLimit)
|
||||
.map(Map.Entry::getKey)
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
if (!containsMatches.isEmpty()) {
|
||||
List<SdFishDictoryB> result = containsMatches.stream()
|
||||
.sorted((f1, f2) -> {
|
||||
int len1 = f1.getName().length();
|
||||
int len2 = f2.getName().length();
|
||||
if (len1 != len2) {
|
||||
return Integer.compare(len1, len2);
|
||||
}
|
||||
return f1.getName().compareTo(f2.getName());
|
||||
})
|
||||
.limit(resultLimit)
|
||||
.collect(Collectors.toList());
|
||||
return result;
|
||||
private List<SdFishDictoryB> querySimilarFishCandidates(String rawSearchName, String normalizedSearchName, int resultLimit) {
|
||||
int candidateLimit = Math.min(Math.max(resultLimit * 30, 120), 500);
|
||||
LinkedHashMap<String, SdFishDictoryB> candidateMap = new LinkedHashMap<>();
|
||||
|
||||
mergeCandidates(candidateMap, queryExactCandidates(rawSearchName, normalizedSearchName, candidateLimit));
|
||||
if (candidateMap.size() < candidateLimit) {
|
||||
mergeCandidates(candidateMap, queryContainsCandidates(rawSearchName, normalizedSearchName, candidateLimit));
|
||||
}
|
||||
if (candidateMap.size() < candidateLimit) {
|
||||
mergeCandidates(candidateMap, queryTokenCandidates(normalizedSearchName, candidateLimit));
|
||||
}
|
||||
|
||||
SdFishDictoryB partialMatch = allFish.stream()
|
||||
.filter(f -> f.getName() != null && (searchName.contains(f.getName()) || f.getName().contains(searchName)))
|
||||
.findFirst()
|
||||
.orElse(null);
|
||||
return new ArrayList<>(candidateMap.values());
|
||||
}
|
||||
|
||||
if (partialMatch != null) {
|
||||
Map<SdFishDictoryB, Integer> similarityMap = new HashMap<>();
|
||||
for (SdFishDictoryB fish : allFish) {
|
||||
if (fish.getId().equals(partialMatch.getId())) {
|
||||
continue;
|
||||
}
|
||||
int score = calculateSimilarity(partialMatch, fish);
|
||||
if (score > 0) {
|
||||
similarityMap.put(fish, score);
|
||||
}
|
||||
private void mergeCandidates(Map<String, SdFishDictoryB> candidateMap, List<SdFishDictoryB> candidates) {
|
||||
if (candidates == null || candidates.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
for (SdFishDictoryB fish : candidates) {
|
||||
if (fish == null || !StringUtils.hasText(fish.getId())) {
|
||||
continue;
|
||||
}
|
||||
|
||||
List<SdFishDictoryB> result = similarityMap.entrySet().stream()
|
||||
.sorted(Map.Entry.<SdFishDictoryB, Integer>comparingByValue().reversed())
|
||||
.limit(resultLimit)
|
||||
.map(Map.Entry::getKey)
|
||||
.collect(Collectors.toList());
|
||||
|
||||
result.add(0, partialMatch);
|
||||
return result;
|
||||
candidateMap.putIfAbsent(fish.getId(), fish);
|
||||
}
|
||||
}
|
||||
|
||||
return Collections.emptyList();
|
||||
private List<SdFishDictoryB> queryExactCandidates(String rawSearchName, String normalizedSearchName, int limit) {
|
||||
if (!StringUtils.hasText(rawSearchName)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
LambdaQueryWrapper<SdFishDictoryB> wrapper = buildCandidateSelectWrapper();
|
||||
wrapper.and(w -> w
|
||||
.eq(SdFishDictoryB::getName, rawSearchName)
|
||||
.or().eq(SdFishDictoryB::getAlias, rawSearchName)
|
||||
.or().eq(SdFishDictoryB::getNameEn, rawSearchName)
|
||||
.or().eq(SdFishDictoryB::getSpecies, rawSearchName)
|
||||
.or().eq(SdFishDictoryB::getGenus, rawSearchName)
|
||||
.or().eq(SdFishDictoryB::getFamily, rawSearchName)
|
||||
.or().eq(SdFishDictoryB::getOrders, rawSearchName)
|
||||
.or().apply("LOWER(NAME) = {0}", normalizedSearchName)
|
||||
.or().apply("LOWER(ALIAS) = {0}", normalizedSearchName)
|
||||
.or().apply("LOWER(NAME_EN) = {0}", normalizedSearchName)
|
||||
.or().apply("LOWER(SPECIES) = {0}", normalizedSearchName)
|
||||
.or().apply("LOWER(GENUS) = {0}", normalizedSearchName)
|
||||
.or().apply("LOWER(FAMILY) = {0}", normalizedSearchName)
|
||||
.or().apply("LOWER(ORDERS) = {0}", normalizedSearchName));
|
||||
wrapper.orderByDesc(SdFishDictoryB::getOrderIndex);
|
||||
return page(new Page<>(1, limit), wrapper).getRecords();
|
||||
}
|
||||
|
||||
private List<SdFishDictoryB> queryContainsCandidates(String rawSearchName, String normalizedSearchName, int limit) {
|
||||
if (!StringUtils.hasText(rawSearchName)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
String likeValue = "%" + rawSearchName + "%";
|
||||
String normalizedLikeValue = "%" + normalizedSearchName + "%";
|
||||
LambdaQueryWrapper<SdFishDictoryB> wrapper = buildCandidateSelectWrapper();
|
||||
wrapper.and(w -> w
|
||||
.like(SdFishDictoryB::getName, rawSearchName)
|
||||
.or().like(SdFishDictoryB::getAlias, rawSearchName)
|
||||
.or().like(SdFishDictoryB::getNameEn, rawSearchName)
|
||||
.or().like(SdFishDictoryB::getSpecies, rawSearchName)
|
||||
.or().like(SdFishDictoryB::getGenus, rawSearchName)
|
||||
.or().like(SdFishDictoryB::getFamily, rawSearchName)
|
||||
.or().like(SdFishDictoryB::getOrders, rawSearchName)
|
||||
.or().like(SdFishDictoryB::getIntroduce, rawSearchName)
|
||||
.or().apply("LOWER(NAME) LIKE {0}", normalizedLikeValue)
|
||||
.or().apply("LOWER(ALIAS) LIKE {0}", normalizedLikeValue)
|
||||
.or().apply("LOWER(NAME_EN) LIKE {0}", normalizedLikeValue)
|
||||
.or().apply("LOWER(SPECIES) LIKE {0}", normalizedLikeValue)
|
||||
.or().apply("LOWER(GENUS) LIKE {0}", normalizedLikeValue)
|
||||
.or().apply("LOWER(FAMILY) LIKE {0}", normalizedLikeValue)
|
||||
.or().apply("LOWER(ORDERS) LIKE {0}", normalizedLikeValue)
|
||||
.or().apply("LOWER(INTRODUCE) LIKE {0}", normalizedLikeValue));
|
||||
wrapper.orderByDesc(SdFishDictoryB::getOrderIndex);
|
||||
return page(new Page<>(1, limit), wrapper).getRecords();
|
||||
}
|
||||
|
||||
private List<SdFishDictoryB> queryTokenCandidates(String normalizedSearchName, int limit) {
|
||||
Set<String> tokens = splitTokens(normalizedSearchName).stream()
|
||||
.filter(StringUtils::hasText)
|
||||
.filter(token -> token.length() >= 2)
|
||||
.limit(5)
|
||||
.collect(Collectors.toCollection(LinkedHashSet::new));
|
||||
if (tokens.isEmpty()) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
LambdaQueryWrapper<SdFishDictoryB> wrapper = buildCandidateSelectWrapper();
|
||||
wrapper.and(w -> {
|
||||
boolean first = true;
|
||||
for (String token : tokens) {
|
||||
String likeValue = "%" + token + "%";
|
||||
if (!first) {
|
||||
w.or();
|
||||
}
|
||||
w.apply("LOWER(NAME) LIKE {0}", likeValue)
|
||||
.or().apply("LOWER(ALIAS) LIKE {0}", likeValue)
|
||||
.or().apply("LOWER(NAME_EN) LIKE {0}", likeValue)
|
||||
.or().apply("LOWER(SPECIES) LIKE {0}", likeValue)
|
||||
.or().apply("LOWER(GENUS) LIKE {0}", likeValue)
|
||||
.or().apply("LOWER(FAMILY) LIKE {0}", likeValue)
|
||||
.or().apply("LOWER(ORDERS) LIKE {0}", likeValue)
|
||||
.or().apply("LOWER(INTRODUCE) LIKE {0}", likeValue);
|
||||
first = false;
|
||||
}
|
||||
});
|
||||
wrapper.orderByDesc(SdFishDictoryB::getOrderIndex);
|
||||
return page(new Page<>(1, limit), wrapper).getRecords();
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<SdFishDictoryB> buildCandidateSelectWrapper() {
|
||||
LambdaQueryWrapper<SdFishDictoryB> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.select(
|
||||
SdFishDictoryB::getId,
|
||||
SdFishDictoryB::getCode,
|
||||
SdFishDictoryB::getName,
|
||||
SdFishDictoryB::getNameEn,
|
||||
SdFishDictoryB::getAlias,
|
||||
SdFishDictoryB::getIntroduce,
|
||||
SdFishDictoryB::getOrders,
|
||||
SdFishDictoryB::getFamily,
|
||||
SdFishDictoryB::getGenus,
|
||||
SdFishDictoryB::getSpecies,
|
||||
SdFishDictoryB::getType,
|
||||
SdFishDictoryB::getHabitat,
|
||||
SdFishDictoryB::getHabitMigrat,
|
||||
SdFishDictoryB::getFeedingHabit,
|
||||
SdFishDictoryB::getSpawnCharact,
|
||||
SdFishDictoryB::getPtype,
|
||||
SdFishDictoryB::getResourceType,
|
||||
SdFishDictoryB::getRare,
|
||||
SdFishDictoryB::getOrderIndex,
|
||||
SdFishDictoryB::getIsDeleted
|
||||
);
|
||||
wrapper.eq(SdFishDictoryB::getIsDeleted, 0);
|
||||
return wrapper;
|
||||
}
|
||||
|
||||
private int calculateSimilarity(SdFishDictoryB ref, SdFishDictoryB target) {
|
||||
int score = 0;
|
||||
|
||||
if (ref.getGenus() != null && ref.getGenus().equals(target.getGenus()) && !ref.getGenus().isEmpty()) {
|
||||
score += 25;
|
||||
if (ref == null || target == null) {
|
||||
return 0;
|
||||
}
|
||||
if (StringUtils.hasText(ref.getId()) && ref.getId().equals(target.getId())) {
|
||||
return 5000;
|
||||
}
|
||||
|
||||
if (ref.getSpecies() != null && ref.getSpecies().equals(target.getSpecies()) && !ref.getSpecies().isEmpty()) {
|
||||
score += 20;
|
||||
}
|
||||
score += calculateFieldSimilarity(ref.getName(), target.getName(), 45);
|
||||
score += calculateFieldSimilarity(ref.getNameEn(), target.getNameEn(), 22);
|
||||
score += calculateFieldSimilarity(ref.getAlias(), target.getAlias(), 26);
|
||||
score += calculateFieldSimilarity(ref.getSpecies(), target.getSpecies(), 30);
|
||||
score += calculateFieldSimilarity(ref.getGenus(), target.getGenus(), 24);
|
||||
score += calculateFieldSimilarity(ref.getFamily(), target.getFamily(), 18);
|
||||
score += calculateFieldSimilarity(ref.getOrders(), target.getOrders(), 14);
|
||||
score += calculateFieldSimilarity(ref.getIntroduce(), target.getIntroduce(), 8);
|
||||
|
||||
if (ref.getFamily() != null && ref.getFamily().equals(target.getFamily()) && !ref.getFamily().isEmpty()) {
|
||||
score += 15;
|
||||
}
|
||||
|
||||
if (ref.getOrders() != null && ref.getOrders().equals(target.getOrders()) && !ref.getOrders().isEmpty()) {
|
||||
score += 10;
|
||||
}
|
||||
|
||||
if (ref.getType() != null && ref.getType().equals(target.getType()) && !ObjectUtil.isEmpty(ref.getType()) ) {
|
||||
if (ref.getType() != null && ref.getType().equals(target.getType()) && !ObjectUtil.isEmpty(ref.getType())) {
|
||||
score += 5;
|
||||
}
|
||||
|
||||
@ -208,4 +332,113 @@ public class SdFishDictoryBServiceImpl extends ServiceImpl<SdFishDictoryBMapper,
|
||||
|
||||
return score;
|
||||
}
|
||||
|
||||
private int calculateSearchScore(String searchName, SdFishDictoryB fish) {
|
||||
int score = 0;
|
||||
score += calculateFieldSearchScore(searchName, fish.getName(), 220, 140, 90, 40);
|
||||
score += calculateFieldSearchScore(searchName, fish.getAlias(), 180, 120, 80, 30);
|
||||
score += calculateFieldSearchScore(searchName, fish.getNameEn(), 160, 100, 70, 25);
|
||||
score += calculateFieldSearchScore(searchName, fish.getSpecies(), 140, 90, 60, 25);
|
||||
score += calculateFieldSearchScore(searchName, fish.getGenus(), 120, 80, 55, 20);
|
||||
score += calculateFieldSearchScore(searchName, fish.getFamily(), 100, 70, 45, 18);
|
||||
score += calculateFieldSearchScore(searchName, fish.getOrders(), 90, 60, 40, 15);
|
||||
score += calculateFieldSearchScore(searchName, fish.getIntroduce(), 45, 30, 0, 12);
|
||||
return score;
|
||||
}
|
||||
|
||||
private int buildFinalScore(SdFishDictoryB referenceFish, SdFishDictoryB currentFish, int searchScore) {
|
||||
int totalScore = searchScore;
|
||||
if (referenceFish != null) {
|
||||
totalScore += calculateSimilarity(referenceFish, currentFish);
|
||||
}
|
||||
return totalScore;
|
||||
}
|
||||
|
||||
private int calculateFieldSearchScore(String searchText, String candidate, int exactScore, int containsScore,
|
||||
int reverseContainsScore, int overlapMaxScore) {
|
||||
String normalizedSearch = normalizeText(searchText);
|
||||
String normalizedCandidate = normalizeText(candidate);
|
||||
if (!StringUtils.hasText(normalizedSearch) || !StringUtils.hasText(normalizedCandidate)) {
|
||||
return 0;
|
||||
}
|
||||
if (normalizedCandidate.equals(normalizedSearch)) {
|
||||
return exactScore;
|
||||
}
|
||||
if (normalizedCandidate.contains(normalizedSearch)) {
|
||||
return containsScore;
|
||||
}
|
||||
if (reverseContainsScore > 0 && normalizedSearch.contains(normalizedCandidate) && normalizedCandidate.length() >= 2) {
|
||||
return reverseContainsScore;
|
||||
}
|
||||
return calculateTextOverlapScore(normalizedSearch, normalizedCandidate, overlapMaxScore);
|
||||
}
|
||||
|
||||
private int calculateFieldSimilarity(String left, String right, int exactScore) {
|
||||
String normalizedLeft = normalizeText(left);
|
||||
String normalizedRight = normalizeText(right);
|
||||
if (!StringUtils.hasText(normalizedLeft) || !StringUtils.hasText(normalizedRight)) {
|
||||
return 0;
|
||||
}
|
||||
if (normalizedLeft.equals(normalizedRight)) {
|
||||
return exactScore;
|
||||
}
|
||||
if (normalizedLeft.contains(normalizedRight) || normalizedRight.contains(normalizedLeft)) {
|
||||
return Math.max(1, exactScore / 2);
|
||||
}
|
||||
return calculateTextOverlapScore(normalizedLeft, normalizedRight, Math.max(1, exactScore / 3));
|
||||
}
|
||||
|
||||
private int calculateTextOverlapScore(String left, String right, int maxScore) {
|
||||
if (!StringUtils.hasText(left) || !StringUtils.hasText(right) || maxScore <= 0) {
|
||||
return 0;
|
||||
}
|
||||
Set<String> leftTokens = splitTokens(left);
|
||||
Set<String> rightTokens = splitTokens(right);
|
||||
if (leftTokens.isEmpty() || rightTokens.isEmpty()) {
|
||||
return 0;
|
||||
}
|
||||
long commonCount = leftTokens.stream().filter(rightTokens::contains).count();
|
||||
if (commonCount <= 0) {
|
||||
return 0;
|
||||
}
|
||||
int base = Math.min(leftTokens.size(), rightTokens.size());
|
||||
if (base <= 0) {
|
||||
return 0;
|
||||
}
|
||||
return (int) Math.min(maxScore, Math.round((double) commonCount * maxScore / base));
|
||||
}
|
||||
|
||||
private Set<String> splitTokens(String text) {
|
||||
String normalized = normalizeText(text);
|
||||
if (!StringUtils.hasText(normalized)) {
|
||||
return Collections.emptySet();
|
||||
}
|
||||
Set<String> tokens = new LinkedHashSet<>();
|
||||
String[] parts = normalized.split("[\\s,,;;、/\\\\()()]+");
|
||||
for (String part : parts) {
|
||||
if (StringUtils.hasText(part)) {
|
||||
tokens.add(part);
|
||||
}
|
||||
}
|
||||
if (tokens.isEmpty()) {
|
||||
for (int i = 0; i < normalized.length(); i++) {
|
||||
char ch = normalized.charAt(i);
|
||||
if (!Character.isWhitespace(ch)) {
|
||||
tokens.add(String.valueOf(ch));
|
||||
}
|
||||
}
|
||||
}
|
||||
return tokens;
|
||||
}
|
||||
|
||||
private String normalizeText(String text) {
|
||||
if (!StringUtils.hasText(text)) {
|
||||
return "";
|
||||
}
|
||||
return text.trim().toLowerCase(Locale.ROOT);
|
||||
}
|
||||
|
||||
private String safeText(String text) {
|
||||
return text == null ? "" : text;
|
||||
}
|
||||
}
|
||||
@ -1,22 +1,32 @@
|
||||
package com.yfd.platform.qgc_base.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.yfd.platform.common.DataSourceLoadOptionsBase;
|
||||
import com.yfd.platform.common.DataSourceRequest;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.yfd.platform.qgc_data.domain.SysUserDataScope;
|
||||
import com.yfd.platform.qgc_data.mapper.SysUserDataScopeMapper;
|
||||
import com.yfd.platform.qgc_base.domain.SdEngInfoBH;
|
||||
import com.yfd.platform.qgc_base.domain.SdHbrvDic;
|
||||
import com.yfd.platform.qgc_base.domain.SdHydrobase;
|
||||
import com.yfd.platform.qgc_base.entity.vo.HbrvWbsVo;
|
||||
import com.yfd.platform.qgc_base.mapper.SdEngInfoBHMapper;
|
||||
import com.yfd.platform.qgc_base.mapper.SdHbrvDicMapper;
|
||||
import com.yfd.platform.qgc_base.mapper.SdHydrobaseMapper;
|
||||
import com.yfd.platform.qgc_base.service.ISdHbrvDicService;
|
||||
import com.yfd.platform.utils.QgcQueryWrapperUtil;
|
||||
import com.yfd.platform.utils.SecurityUtils;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.util.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Comparator;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@ -33,6 +43,9 @@ public class SdHbrvDicServiceImpl extends ServiceImpl<SdHbrvDicMapper, SdHbrvDic
|
||||
@Resource
|
||||
private SdEngInfoBHMapper engInfoBHMapper;
|
||||
|
||||
@Resource
|
||||
private SdHydrobaseMapper hydrobaseMapper;
|
||||
|
||||
private SdHbrvDicMapper hbrvDicMapper;
|
||||
@Override
|
||||
public Page<SdHbrvDic> queryPageList(Page<SdHbrvDic> page, String hbrvnm, String baseid) {
|
||||
@ -200,4 +213,50 @@ public class SdHbrvDicServiceImpl extends ServiceImpl<SdHbrvDicMapper, SdHbrvDic
|
||||
.orderByAsc(SdHbrvDic::getBaseid,SdHbrvDic::getOrderIndex)
|
||||
.list();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HbrvWbsVo> getHbrvdList(DataSourceRequest dataSourceRequest) {
|
||||
DataSourceLoadOptionsBase loadOptions = dataSourceRequest == null ? null : dataSourceRequest.toDevRequest();
|
||||
String baseId = loadOptions == null ? null : QgcQueryWrapperUtil.getFilterFieldValue(loadOptions, "baseId");
|
||||
|
||||
LambdaQueryWrapper<SdHbrvDic> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(StringUtils.hasText(baseId), SdHbrvDic::getBaseid, baseId)
|
||||
.eq(SdHbrvDic::getIsDeleted, 0)
|
||||
.eq(SdHbrvDic::getEnabled, 1)
|
||||
.orderByAsc(SdHbrvDic::getBaseid, SdHbrvDic::getOrderIndex, SdHbrvDic::getHbrvcd);
|
||||
|
||||
List<SdHbrvDic> hbrvList = this.list(wrapper);
|
||||
if (hbrvList.isEmpty()) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
||||
List<String> baseIds = hbrvList.stream()
|
||||
.map(SdHbrvDic::getBaseid)
|
||||
.filter(StringUtils::hasText)
|
||||
.distinct()
|
||||
.toList();
|
||||
|
||||
Map<String, String> baseNameMap;
|
||||
if (!baseIds.isEmpty()) {
|
||||
baseNameMap = hydrobaseMapper.selectBatchIds(baseIds).stream()
|
||||
.collect(Collectors.toMap(SdHydrobase::getBaseid, SdHydrobase::getBasename, (a, b) -> a));
|
||||
} else {
|
||||
baseNameMap = new HashMap<>();
|
||||
}
|
||||
|
||||
return hbrvList.stream()
|
||||
.map(item -> toHbrvWbsVo(item, baseNameMap.get(item.getBaseid())))
|
||||
.sorted(Comparator.comparing(HbrvWbsVo::getBaseId, Comparator.nullsLast(String::compareTo))
|
||||
.thenComparing(HbrvWbsVo::getHbrvcd, Comparator.nullsLast(String::compareTo)))
|
||||
.toList();
|
||||
}
|
||||
|
||||
private HbrvWbsVo toHbrvWbsVo(SdHbrvDic source, String baseName) {
|
||||
HbrvWbsVo vo = new HbrvWbsVo();
|
||||
vo.setHbrvcd(source.getHbrvcd());
|
||||
vo.setHbrvcdName(source.getHbrvnm());
|
||||
vo.setBaseId(source.getBaseid());
|
||||
vo.setBaseName(baseName);
|
||||
return vo;
|
||||
}
|
||||
}
|
||||
@ -2976,7 +2976,7 @@ public class EngEqDataServiceImpl implements EngEqDataService {
|
||||
"CASE WHEN t.PBASEID = '0' THEN NULL ELSE t.PBASEID END AS parentCode, " +
|
||||
"t.GRD AS treeLevel, " +
|
||||
"CASE WHEN EXISTS (SELECT 1 FROM SD_HYDROBASE c WHERE c.PBASEID = t.BASEID AND NVL(c.IS_DELETED, 0) = 0) THEN 1 ELSE 0 END AS hasChildren, " +
|
||||
"CAST(NULL AS VARCHAR2(36)) AS objId, " +
|
||||
"t.BASEID AS objId, " +
|
||||
"CAST(NULL AS VARCHAR2(20)) AS topWbsType, " +
|
||||
"t.PATH AS fullPath, " +
|
||||
"1 AS internal, " +
|
||||
@ -4083,10 +4083,17 @@ public class EngEqDataServiceImpl implements EngEqDataService {
|
||||
}
|
||||
return switch (field) {
|
||||
case "id" -> "t.id";
|
||||
case "recordUser" -> "t.recordUser";
|
||||
case "wbsType" -> "t.wbsType";
|
||||
case "recordTime" -> "t.recordTime";
|
||||
case "modifyTime" -> "t.modifyTime";
|
||||
case "displayRecordUser" -> "t.displayRecordUser";
|
||||
case "isolateType" -> "t.isolateType";
|
||||
case "wbsCode" -> "t.wbsCode";
|
||||
case "wbsName" -> "t.wbsName";
|
||||
case "wbsSname" -> "t.wbsSname";
|
||||
case "wbsNameEn" -> "t.wbsNameEn";
|
||||
case "wbsSnameEn" -> "t.wbsSnameEn";
|
||||
case "enable" -> "t.enable";
|
||||
case "description" -> "t.description";
|
||||
case "parentId" -> "t.parentId";
|
||||
@ -4097,10 +4104,28 @@ public class EngEqDataServiceImpl implements EngEqDataService {
|
||||
case "topWbsType" -> "t.topWbsType";
|
||||
case "fullPath" -> "t.fullPath";
|
||||
case "internal" -> "t.internal";
|
||||
case "lgtd" -> "t.lgtd";
|
||||
case "lttd" -> "t.lttd";
|
||||
case "area" -> "t.area";
|
||||
case "perimeter" -> "t.perimeter";
|
||||
case "synopsis" -> "t.synopsis";
|
||||
case "introduce" -> "t.introduce";
|
||||
case "logo" -> "t.logo";
|
||||
case "inffile" -> "t.inffile";
|
||||
case "orderIndex" -> "NVL(t.orderIndex, 999999)";
|
||||
case "recordTime" -> "t.recordTime";
|
||||
case "modifyTime" -> "t.modifyTime";
|
||||
case "filterContent" -> "t.filterContent";
|
||||
case "departmentId" -> "t.departmentId";
|
||||
case "systemId" -> "t.systemId";
|
||||
case "platformId" -> "t.platformId";
|
||||
case "reachWwqtg" -> "t.reachWwqtg";
|
||||
case "maxElev" -> "t.maxElev";
|
||||
case "minElev" -> "t.minElev";
|
||||
case "datTp" -> "t.datTp";
|
||||
case "rvAg" -> "t.rvAg";
|
||||
case "ifInnRv" -> "t.ifInnRv";
|
||||
case "showControl" -> "t.showControl";
|
||||
case "stcd" -> "t.stcd";
|
||||
case "displayDepartment" -> "t.displayDepartment";
|
||||
default -> null;
|
||||
};
|
||||
}
|
||||
@ -4195,7 +4220,10 @@ public class EngEqDataServiceImpl implements EngEqDataService {
|
||||
return null;
|
||||
}
|
||||
return switch (field) {
|
||||
case "baseStepSort", "rvcdStepSort", "rstcdStepSort", "siteStepSort",
|
||||
case "id", "baseId", "hbrvcd", "hycd", "rvcd", "bldsttCcode",
|
||||
"sfdbName", "mwrSfdb", "mwrSfdbName", "avqSfdb", "avqSfdbName",
|
||||
"qecC", "mwrC", "avqC", "qecRuleDid", "qecMwrruleDid", "beforeQec",
|
||||
"baseStepSort", "rvcdStepSort", "rstcdStepSort", "siteStepSort",
|
||||
"tm", "stcd", "stnm", "ennm", "qi", "qo", "qec", "sfdb",
|
||||
"rz", "dz", "qecLimit", "mwrLimit", "avqLimit", "baseName",
|
||||
"rvcdName", "hbrvcdName", "addvcdName", "qecAi" -> field;
|
||||
@ -4208,7 +4236,10 @@ public class EngEqDataServiceImpl implements EngEqDataService {
|
||||
return null;
|
||||
}
|
||||
return switch (field) {
|
||||
case "baseStepSort", "rvcdStepSort", "rstcdStepSort", "siteStepSort",
|
||||
case "id", "baseId", "hbrvcd", "rvcd", "qecC", "mwrC", "avqC",
|
||||
"sfdbName", "qecSfdb", "mwrSfdb", "mwrSfdbName", "avqSfdb",
|
||||
"avqSfdbName", "qecRuleDid", "qecMwrruleDid",
|
||||
"baseStepSort", "rvcdStepSort", "rstcdStepSort", "siteStepSort",
|
||||
"dt", "stcd", "stnm", "ennm", "qi", "qo", "qec", "sfdb",
|
||||
"rz", "dz", "qecLimit", "mwrLimit", "avqLimit", "baseName",
|
||||
"rvcdName", "hbrvcdName", "addvcdName", "beforeQec" -> field;
|
||||
|
||||
@ -400,8 +400,11 @@ public class EngRiverServiceImpl implements EngRiverService {
|
||||
case "hbrvcd" -> "t.HBRVCD";
|
||||
case "hbrvcdName" -> "t.HBRVCDNAME";
|
||||
case "bldsttCcode" -> "t.BLDSTTCCODE";
|
||||
case "vdid" -> "t.VDID";
|
||||
case "rzVideo" -> "t.RZVIDEO";
|
||||
case "speedVideo" -> "t.SPEEDVIDEO";
|
||||
case "rzVideoPath" -> "t.RZVIDEOPATH";
|
||||
case "speedVideoPath" -> "t.SPEEDVIDEOPATH";
|
||||
case "baseStepSort" -> "t.BASESTEPSORT";
|
||||
case "rvcdStepSort" -> "t.RVCDSTEPSORT";
|
||||
case "rstcdStepSort" -> "t.RSTCDSTEPSORT";
|
||||
|
||||
@ -860,6 +860,16 @@ public class FhHabitatServiceImpl implements FhHabitatService {
|
||||
sortMap.put("vlsr", "t.VLSR");
|
||||
sortMap.put("dtinType", "t.DTIN_TYPE");
|
||||
sortMap.put("enable", "t.ENABLE");
|
||||
sortMap.put("qxdbhdx", "t.QXDBHDX");
|
||||
sortMap.put("qxdbhfw", "t.QXDBHFW");
|
||||
sortMap.put("qxdbhcd", "t.QXDBHCD");
|
||||
sortMap.put("qxdbhmj", "t.QXDBHMJ");
|
||||
sortMap.put("bhhl", "t.BHHL");
|
||||
sortMap.put("bhhd", "t.BHHD");
|
||||
sortMap.put("bhcs", "t.BHCS");
|
||||
sortMap.put("qxdbhfs", "t.QXDBHFS");
|
||||
sortMap.put("qxdbhhxcd", "t.QXDBHHXCD");
|
||||
sortMap.put("qxdbhwwcd", "t.QXDBHWWCD");
|
||||
sortMap.put("fhmonitor", "t.FHMONITOR");
|
||||
sortMap.put("dtfrqcy", "t.DTFRQCY");
|
||||
sortMap.put("qxdinv", "t.QXDINV");
|
||||
@ -870,15 +880,15 @@ public class FhHabitatServiceImpl implements FhHabitatService {
|
||||
sortMap.put("baseStepSort", "t.BASESTEPSORT");
|
||||
List<String> orderItems = new ArrayList<>();
|
||||
for (DataSourceRequest.SortDescriptor sort : sorts) {
|
||||
if (sort == null || !Boolean.TRUE.equals(sort.getNeedSortFlag())) {
|
||||
if (sort == null || StrUtil.isBlank(sort.getField())) {
|
||||
continue;
|
||||
}
|
||||
String column = sortMap.get(sort.getField());
|
||||
if (column == null) {
|
||||
continue;
|
||||
}
|
||||
String direction = "desc".equalsIgnoreCase(sort.getDir()) ? "DESC" : "ASC";
|
||||
orderItems.add(column + " " + direction);
|
||||
String direction = "desc".equalsIgnoreCase(sort.getDir()) || "des".equalsIgnoreCase(sort.getDir()) ? "DESC" : "ASC";
|
||||
orderItems.add(column + " " + direction + " NULLS LAST");
|
||||
}
|
||||
if (orderItems.isEmpty()) {
|
||||
return " ORDER BY t.BASESTEPSORT ASC, t.RVCDSTEPSORT ASC, t.RSTCDSTEPSORT ASC, t.SITESTEPSORT ASC, t.STCD ASC";
|
||||
@ -1028,6 +1038,16 @@ public class FhHabitatServiceImpl implements FhHabitatService {
|
||||
sortMap.put("esstdt", "fh.ATTM");
|
||||
sortMap.put("dtin", "fh.DTIN");
|
||||
sortMap.put("enable", "fh.USFL");
|
||||
sortMap.put("qxdbhdx", "fh.BHDX");
|
||||
sortMap.put("qxdbhfw", "fh.BHFW");
|
||||
sortMap.put("qxdbhcd", "fh.BHCD");
|
||||
sortMap.put("qxdbhmj", "fh.BHMJ");
|
||||
sortMap.put("bhhl", "fh.BHHL");
|
||||
sortMap.put("bhhd", "fh.BHHD");
|
||||
sortMap.put("bhcs", "fh.BHCS");
|
||||
sortMap.put("qxdbhfs", "fh.BHFS");
|
||||
sortMap.put("qxdbhhxcd", "fh.BHHXCD");
|
||||
sortMap.put("qxdbhwwcd", "fh.BHWWCD");
|
||||
sortMap.put("dtfrqcy", "fh.DTFRQCY");
|
||||
sortMap.put("qxdinv", "fh.INV");
|
||||
sortMap.put("baseStepSort", "hb.ORDER_INDEX");
|
||||
@ -1036,15 +1056,15 @@ public class FhHabitatServiceImpl implements FhHabitatService {
|
||||
sortMap.put("rvcdStepSort", "along.ORDER_INDEX");
|
||||
List<String> orderItems = new ArrayList<>();
|
||||
for (DataSourceRequest.SortDescriptor sort : sorts) {
|
||||
if (sort == null || !Boolean.TRUE.equals(sort.getNeedSortFlag())) {
|
||||
if (sort == null || StrUtil.isBlank(sort.getField())) {
|
||||
continue;
|
||||
}
|
||||
String column = sortMap.get(sort.getField());
|
||||
if (column == null) {
|
||||
continue;
|
||||
}
|
||||
String direction = "desc".equalsIgnoreCase(sort.getDir()) ? "DESC" : "ASC";
|
||||
orderItems.add(column + " " + direction);
|
||||
String direction = "desc".equalsIgnoreCase(sort.getDir()) || "des".equalsIgnoreCase(sort.getDir()) ? "DESC" : "ASC";
|
||||
orderItems.add(column + " " + direction + " NULLS LAST");
|
||||
}
|
||||
if (orderItems.isEmpty()) {
|
||||
return " ORDER BY hb.ORDER_INDEX ASC, along.ORDER_INDEX ASC, rstAlong.SORT ASC, fh.ORDER_INDEX ASC, fh.STCD ASC";
|
||||
@ -1355,6 +1375,8 @@ public class FhHabitatServiceImpl implements FhHabitatService {
|
||||
case "bhhd" -> "t.bhhd";
|
||||
case "bhcs" -> "t.bhcs";
|
||||
case "qxdbhfs" -> "t.qxdbhfs";
|
||||
case "qxdbhhxcd" -> "t.qxdbhhxcd";
|
||||
case "qxdbhwwcd" -> "t.qxdbhwwcd";
|
||||
case "ststdt" -> "t.ststdt";
|
||||
case "usfl", "enable" -> "t.usfl";
|
||||
case "baseStepSort" -> "t.baseStepSort";
|
||||
@ -1379,7 +1401,7 @@ public class FhHabitatServiceImpl implements FhHabitatService {
|
||||
continue;
|
||||
}
|
||||
String dir = ("desc".equalsIgnoreCase(sortDescriptor.getDir()) || "des".equalsIgnoreCase(sortDescriptor.getDir())) ? "DESC" : "ASC";
|
||||
orders.add(column + " " + dir);
|
||||
orders.add(column + " " + dir + " NULLS LAST");
|
||||
}
|
||||
if (orders.isEmpty()) {
|
||||
return " ORDER BY t.baseStepSort ASC, t.rvcdStepSort ASC, t.rstcdStepSort ASC, t.siteStepSort ASC, t.stcd ASC";
|
||||
@ -1486,6 +1508,7 @@ public class FhHabitatServiceImpl implements FhHabitatService {
|
||||
case "id" -> "t.ID";
|
||||
case "stcd" -> "t.STCD";
|
||||
case "dt" -> "t.DT";
|
||||
case "DT" -> "t.DT";
|
||||
case "wt" -> "t.WT";
|
||||
default -> null;
|
||||
};
|
||||
|
||||
@ -46,6 +46,18 @@ public class FishPassageController {
|
||||
return ResponseResult.successData(fpRunService.processQgcFpssTableKendoList(dataSourceRequest));
|
||||
}
|
||||
|
||||
@PostMapping("/run/fish/select")
|
||||
@Operation(summary = "查询过鱼设施指定年份鱼类下拉选")
|
||||
public ResponseResult getFishSelect(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||
return ResponseResult.successData(fpRunService.getFishSelect(dataSourceRequest));
|
||||
}
|
||||
|
||||
@PostMapping("/run/analysis/GetKendoListCust")
|
||||
@Operation(summary = "过鱼设施综合分析")
|
||||
public ResponseResult getAnalysisData(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||
return ResponseResult.successData(fpRunService.getAnalysisData(dataSourceRequest));
|
||||
}
|
||||
|
||||
@PostMapping("/build/GetKendoListCust")
|
||||
@Operation(summary = "过鱼设施建设及接入情况统计")
|
||||
public ResponseResult getKendoListCust(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||
@ -58,6 +70,18 @@ public class FishPassageController {
|
||||
return ResponseResult.successData(fpBuildService.getVmsstbprptList(dataSourceRequest));
|
||||
}
|
||||
|
||||
@PostMapping("/msstbprpt/GetKendoList")
|
||||
@Operation(summary = "根据条件查询过鱼设施基础列表(公用)")
|
||||
public ResponseResult getCommonMsstbprptList(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||
return ResponseResult.successData(fpBuildService.getVmsstbprptList(dataSourceRequest));
|
||||
}
|
||||
|
||||
// @PostMapping("/fpq/msstbprpt/GetKendoList")
|
||||
// @Operation(summary = "根据条件查询过鱼设施鱼道传感器基础列表")
|
||||
// public ResponseResult getFpqMsstbprptList(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||
// return ResponseResult.successData(fpBuildService.getFpqMsstbprptList(dataSourceRequest));
|
||||
// }
|
||||
|
||||
@GetMapping("/msstbprpt/getStInfoByStcd")
|
||||
@Operation(summary = "根据站码查询单条过鱼设施基础数据")
|
||||
public ResponseResult getStInfoByStcd(@RequestParam String stcd) {
|
||||
|
||||
@ -0,0 +1,11 @@
|
||||
package com.yfd.platform.qgc_env.fp.entity.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class FpFishSelectVo {
|
||||
|
||||
private String id;
|
||||
|
||||
private String name;
|
||||
}
|
||||
@ -0,0 +1,68 @@
|
||||
package com.yfd.platform.qgc_env.fp.entity.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@AllArgsConstructor
|
||||
@Schema(description = "过鱼设施综合分析表头")
|
||||
public class FpRunAnalysisHeadColumnVo {
|
||||
|
||||
@Schema(description = "字段名")
|
||||
private String dataIndex;
|
||||
|
||||
@Schema(description = "标题")
|
||||
private String title;
|
||||
|
||||
@Schema(description = "是否展示")
|
||||
private Boolean visible = true;
|
||||
|
||||
@Schema(description = "唯一键")
|
||||
private String key;
|
||||
|
||||
@Schema(description = "单位")
|
||||
private String unit;
|
||||
|
||||
@Schema(description = "是否合并")
|
||||
private boolean merge;
|
||||
|
||||
@Schema(description = "数据类型")
|
||||
private String dataType;
|
||||
|
||||
@Schema(description = "数据格式")
|
||||
private String dataFormat;
|
||||
|
||||
@Schema(description = "子节点")
|
||||
private List<FpRunAnalysisHeadColumnVo> children;
|
||||
|
||||
public FpRunAnalysisHeadColumnVo(String title, String dataIndex) {
|
||||
this.title = title;
|
||||
this.dataIndex = dataIndex;
|
||||
this.key = dataIndex;
|
||||
}
|
||||
|
||||
public FpRunAnalysisHeadColumnVo(String title, String dataIndex, String key) {
|
||||
this.title = title;
|
||||
this.dataIndex = dataIndex;
|
||||
this.key = key;
|
||||
}
|
||||
|
||||
public FpRunAnalysisHeadColumnVo(String dataIndex,
|
||||
String title,
|
||||
Boolean visible,
|
||||
String key,
|
||||
boolean merge,
|
||||
List<FpRunAnalysisHeadColumnVo> children) {
|
||||
this.title = title;
|
||||
this.dataIndex = dataIndex;
|
||||
this.visible = visible;
|
||||
this.merge = merge;
|
||||
this.children = children;
|
||||
this.key = key;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,25 @@
|
||||
package com.yfd.platform.qgc_env.fp.entity.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@Schema(description = "过鱼设施综合分析表格")
|
||||
public class FpRunAnalysisTableVo {
|
||||
|
||||
@Schema(description = "表头")
|
||||
private List<FpRunAnalysisHeadColumnVo> columns;
|
||||
|
||||
@Schema(description = "表格数据")
|
||||
private Object dataSource;
|
||||
|
||||
@Schema(description = "总数")
|
||||
private Long total;
|
||||
|
||||
@Schema(description = "水温设备类型")
|
||||
private Integer wtDeviceType;
|
||||
}
|
||||
@ -0,0 +1,47 @@
|
||||
package com.yfd.platform.qgc_env.fp.entity.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
@Schema(description = "过鱼设施综合分析数据")
|
||||
public class FpRunAnalysisVo {
|
||||
|
||||
@Schema(description = "时间")
|
||||
private String dt;
|
||||
|
||||
@Schema(description = "鱼类名称")
|
||||
private String ftp;
|
||||
|
||||
@Schema(description = "过鱼数量")
|
||||
private BigDecimal fcnt;
|
||||
|
||||
@Schema(description = "出库水温(℃)")
|
||||
private BigDecimal wt;
|
||||
|
||||
@Schema(description = "化学需氧量(mg/L)")
|
||||
private BigDecimal codcr;
|
||||
|
||||
@Schema(description = "氨氮(mg/L)")
|
||||
private BigDecimal nh3n;
|
||||
|
||||
@Schema(description = "总磷(mg/L)")
|
||||
private BigDecimal tp;
|
||||
|
||||
@Schema(description = "总氮(mg/L)")
|
||||
private BigDecimal tn;
|
||||
|
||||
@Schema(description = "坝下水位(m)")
|
||||
private BigDecimal dz;
|
||||
|
||||
@Schema(description = "坝上水位(m)")
|
||||
private BigDecimal rz;
|
||||
|
||||
@Schema(description = "入库流量(m3/s)")
|
||||
private BigDecimal qi;
|
||||
|
||||
@Schema(description = "出库流量(m3/s)")
|
||||
private BigDecimal qo;
|
||||
}
|
||||
@ -63,9 +63,18 @@ public class FpSdfpssrVo {
|
||||
@Schema(description = "附件ID")
|
||||
private String fid;
|
||||
|
||||
@Schema(description = "视频")
|
||||
private String vdpth;
|
||||
|
||||
@Schema(description = "图片")
|
||||
private String picpth;
|
||||
|
||||
@Schema(description = "游向")
|
||||
private Integer direction;
|
||||
|
||||
@Schema(description = "游向")
|
||||
private String directionName;
|
||||
|
||||
@Schema(description = "监测方式")
|
||||
private Integer mway;
|
||||
|
||||
|
||||
@ -19,6 +19,10 @@ public class FpTableVo {
|
||||
@Schema(description = "鱼种类")
|
||||
private String ftp;
|
||||
|
||||
|
||||
@Schema(description = "鱼种类")
|
||||
private String ftpName;
|
||||
|
||||
@Schema(description = "鱼类编码")
|
||||
private String fishId;
|
||||
|
||||
@ -75,4 +79,10 @@ public class FpTableVo {
|
||||
|
||||
@Schema(description = "监测方式:1=人工 2=自动(预留)")
|
||||
private Integer mway;
|
||||
|
||||
@Schema(description = "视频")
|
||||
private String vdpth;
|
||||
|
||||
@Schema(description = "图片")
|
||||
private String picpth;
|
||||
}
|
||||
|
||||
@ -16,9 +16,18 @@ public class FpVmsstbprptVo implements Serializable {
|
||||
@Schema(description = "过鱼设施编码")
|
||||
private String stcd;
|
||||
|
||||
@Schema(description = "旧接口兼容站码")
|
||||
private String stCode;
|
||||
|
||||
@Schema(description = "过鱼设施名称")
|
||||
private String stnm;
|
||||
|
||||
@Schema(description = "旧接口兼容站名")
|
||||
private String stName;
|
||||
|
||||
@Schema(description = "过鱼设施类型")
|
||||
private String sttp;
|
||||
|
||||
@Schema(description = "过鱼设施类型编码")
|
||||
private String sttpCode;
|
||||
|
||||
@ -208,6 +217,12 @@ public class FpVmsstbprptVo implements Serializable {
|
||||
@Schema(description = "主要过鱼月份")
|
||||
private String fpssmn;
|
||||
|
||||
@Schema(description = "监测方式")
|
||||
private Integer mway;
|
||||
|
||||
@Schema(description = "监测方式名称")
|
||||
private String mwayName;
|
||||
|
||||
@Schema(description = "数据监测频次")
|
||||
private Integer dtfrqcy;
|
||||
|
||||
@ -229,6 +244,12 @@ public class FpVmsstbprptVo implements Serializable {
|
||||
@Schema(description = "LOGO")
|
||||
private String logo;
|
||||
|
||||
@Schema(description = "旧接口兼容排序")
|
||||
private Integer orderIndex;
|
||||
|
||||
@Schema(description = "描述")
|
||||
private String description;
|
||||
|
||||
@Schema(description = "数据来源时间")
|
||||
private Date vlsrTm;
|
||||
|
||||
|
||||
@ -11,5 +11,7 @@ public interface FpBuildService {
|
||||
|
||||
DataSourceResult<FpVmsstbprptVo> getVmsstbprptList(DataSourceRequest dataSourceRequest);
|
||||
|
||||
DataSourceResult<FpVmsstbprptVo> getFpqMsstbprptList(DataSourceRequest dataSourceRequest);
|
||||
|
||||
FpVmsstbprptVo getStInfoByStcd(String stcd);
|
||||
}
|
||||
|
||||
@ -2,6 +2,8 @@ package com.yfd.platform.qgc_env.fp.service;
|
||||
|
||||
import com.yfd.platform.common.DataSourceRequest;
|
||||
import com.yfd.platform.common.DataSourceResult;
|
||||
import com.yfd.platform.qgc_env.fp.entity.vo.FpFishSelectVo;
|
||||
import com.yfd.platform.qgc_env.fp.entity.vo.FpRunAnalysisTableVo;
|
||||
import com.yfd.platform.qgc_env.fp.entity.vo.FpSdfpssrVo;
|
||||
import com.yfd.platform.qgc_env.fp.entity.vo.FpTableVo;
|
||||
import com.yfd.platform.qgc_env.fp.entity.vo.YearFpStatisticsVo;
|
||||
@ -17,5 +19,9 @@ public interface FpRunService {
|
||||
|
||||
DataSourceResult<FpTableVo> processQgcFpssTableKendoList(DataSourceRequest dataSourceRequest);
|
||||
|
||||
DataSourceResult<FpRunAnalysisTableVo> getAnalysisData(DataSourceRequest dataSourceRequest);
|
||||
|
||||
DataSourceResult<FpFishSelectVo> getFishSelect(DataSourceRequest dataSourceRequest);
|
||||
|
||||
List<YearFpStatisticsVo> getYearFpStatic(String year);
|
||||
}
|
||||
|
||||
@ -58,18 +58,37 @@ public class FpBuildServiceImpl implements FpBuildService {
|
||||
|
||||
@Override
|
||||
public DataSourceResult<FpVmsstbprptVo> getVmsstbprptList(DataSourceRequest dataSourceRequest) {
|
||||
return queryVmsstbprptList(dataSourceRequest, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DataSourceResult<FpVmsstbprptVo> getFpqMsstbprptList(DataSourceRequest dataSourceRequest) {
|
||||
return queryVmsstbprptList(dataSourceRequest, "FPQ");
|
||||
}
|
||||
|
||||
private DataSourceResult<FpVmsstbprptVo> queryVmsstbprptList(DataSourceRequest dataSourceRequest, String fixedSttpCode) {
|
||||
DataSourceLoadOptionsBase loadOptions = dataSourceRequest == null ? null : dataSourceRequest.toDevRequest();
|
||||
Page<?> page = loadOptions == null ? null : QgcQueryWrapperUtil.buildPage(loadOptions, loadOptions.getSkip(), loadOptions.getTake());
|
||||
Map<String, Object> paramMap = new HashMap<>();
|
||||
|
||||
StringBuilder sql = new StringBuilder(buildVmsstbprptBaseSql());
|
||||
StringBuilder innerSql = new StringBuilder(buildVmsstbprptBaseSql());
|
||||
if (fixedSttpCode != null && !fixedSttpCode.isBlank()) {
|
||||
paramMap.put("fixedSttpCode", fixedSttpCode);
|
||||
innerSql.append(" AND fp.STTP = #{map.fixedSttpCode}");
|
||||
}
|
||||
|
||||
String filterSql = buildVmsstbprptFilterCondition(dataSourceRequest == null ? null : dataSourceRequest.getFilter(),
|
||||
paramMap, new int[]{0});
|
||||
if (!filterSql.isBlank()) {
|
||||
sql.append(" AND ").append(filterSql);
|
||||
innerSql.append(" AND ").append(filterSql);
|
||||
}
|
||||
|
||||
StringBuilder sql = new StringBuilder("SELECT ")
|
||||
.append(buildVmsstbprptSelectSql(dataSourceRequest == null ? null : dataSourceRequest.getSelect()))
|
||||
.append(" FROM (")
|
||||
.append(innerSql)
|
||||
.append(") t ");
|
||||
|
||||
sql.append(buildVmsstbprptOrderBySql(dataSourceRequest == null ? null : dataSourceRequest.getSort()));
|
||||
|
||||
List<FpVmsstbprptVo> list = microservicDynamicSQLMapper.pageAllListWithResultType(
|
||||
@ -98,8 +117,11 @@ public class FpBuildServiceImpl implements FpBuildService {
|
||||
StringBuilder sql = new StringBuilder();
|
||||
sql.append("SELECT ")
|
||||
.append("fp.STCD AS stcd, ")
|
||||
.append("fp.STCD AS stCode, ")
|
||||
.append("fp.LOGO AS logo, ")
|
||||
.append("fp.STNM AS stnm, ")
|
||||
.append("fp.STNM AS stName, ")
|
||||
.append("fp.STTP AS sttp, ")
|
||||
.append("fp.STTP AS sttpCode, ")
|
||||
.append("sttp.STTP_NAME AS sttpName, ")
|
||||
.append("sttp.FULL_PATH AS sttpFullPath, ")
|
||||
@ -170,9 +192,13 @@ public class FpBuildServiceImpl implements FpBuildService {
|
||||
.append("fp.JBTXCS AS jbtxcs, ")
|
||||
.append("fp.IS_UP AS isUp, ")
|
||||
.append("fp.IS_DOWN AS isDown, ")
|
||||
.append("fp.MWAY AS mway, ")
|
||||
.append("CASE NVL(fp.MWAY, 0) WHEN 1 THEN '人工' WHEN 2 THEN '自动' ELSE '未知' END AS mwayName,")
|
||||
.append("fp.REMARK AS remark, ")
|
||||
.append("fp.VLSR AS vlsr, ")
|
||||
.append("fp.VLSR_TM AS vlsrTm, ")
|
||||
.append("fp.ORDER_INDEX AS orderIndex, ")
|
||||
.append("CAST(NULL AS VARCHAR2(1000)) AS description, ")
|
||||
.append("NVL(hb.ORDER_INDEX, 999999) AS baseStepSort, ")
|
||||
.append("NVL(hbrv.ORDER_INDEX, 999999) AS rvcdStepSort, ")
|
||||
.append("NVL(eng.ORDER_INDEX, 999999) AS rstcdStepSort, ")
|
||||
@ -188,6 +214,110 @@ public class FpBuildServiceImpl implements FpBuildService {
|
||||
return sql.toString();
|
||||
}
|
||||
|
||||
private String buildVmsstbprptSelectSql(List<String> selectFields) {
|
||||
if (CollectionUtils.isEmpty(selectFields)) {
|
||||
return "t.*";
|
||||
}
|
||||
Map<String, String> selectMap = buildVmsstbprptSelectMap();
|
||||
List<String> selectItems = new ArrayList<>();
|
||||
for (String field : selectFields) {
|
||||
String column = selectMap.get(field);
|
||||
if (column != null && !column.isBlank()) {
|
||||
selectItems.add(column);
|
||||
}
|
||||
}
|
||||
return selectItems.isEmpty() ? "t.*" : String.join(", ", selectItems);
|
||||
}
|
||||
|
||||
private Map<String, String> buildVmsstbprptSelectMap() {
|
||||
Map<String, String> selectMap = new HashMap<>();
|
||||
selectMap.put("stcd", "t.stcd AS stcd");
|
||||
selectMap.put("stCode", "t.stCode AS stCode");
|
||||
selectMap.put("stnm", "t.stnm AS stnm");
|
||||
selectMap.put("stName", "t.stName AS stName");
|
||||
selectMap.put("sttp", "t.sttp AS sttp");
|
||||
selectMap.put("sttpCode", "t.sttpCode AS sttpCode");
|
||||
selectMap.put("sttpName", "t.sttpName AS sttpName");
|
||||
selectMap.put("sttpFullPath", "t.sttpFullPath AS sttpFullPath");
|
||||
selectMap.put("sttpTreeLevel", "t.sttpTreeLevel AS sttpTreeLevel");
|
||||
selectMap.put("rstcd", "t.rstcd AS rstcd");
|
||||
selectMap.put("ennm", "t.ennm AS ennm");
|
||||
selectMap.put("baseId", "t.baseId AS baseId");
|
||||
selectMap.put("baseName", "t.baseName AS baseName");
|
||||
selectMap.put("hbrvcd", "t.hbrvcd AS hbrvcd");
|
||||
selectMap.put("hbrvcdName", "t.hbrvcdName AS hbrvcdName");
|
||||
selectMap.put("lgtd", "t.lgtd AS lgtd");
|
||||
selectMap.put("lttd", "t.lttd AS lttd");
|
||||
selectMap.put("elev", "t.elev AS elev");
|
||||
selectMap.put("stlc", "t.stlc AS stlc");
|
||||
selectMap.put("dtin", "t.dtin AS dtin");
|
||||
selectMap.put("dtinName", "t.dtinName AS dtinName");
|
||||
selectMap.put("dtinTm", "t.dtinTm AS dtinTm");
|
||||
selectMap.put("bldsttCcode", "t.bldsttCcode AS bldsttCcode");
|
||||
selectMap.put("bldsttCcodeName", "t.bldsttCcodeName AS bldsttCcodeName");
|
||||
selectMap.put("stdsdt", "t.stdsdt AS stdsdt");
|
||||
selectMap.put("pststdt", "t.pststdt AS pststdt");
|
||||
selectMap.put("pesstdt", "t.pesstdt AS pesstdt");
|
||||
selectMap.put("swdt", "t.swdt AS swdt");
|
||||
selectMap.put("jcdt", "t.jcdt AS jcdt");
|
||||
selectMap.put("wddt", "t.wddt AS wddt");
|
||||
selectMap.put("introduce", "t.introduce AS introduce");
|
||||
selectMap.put("ydxs", "t.ydxs AS ydxs");
|
||||
selectMap.put("ydzcd", "t.ydzcd AS ydzcd");
|
||||
selectMap.put("ydjkz", "t.ydjkz AS ydjkz");
|
||||
selectMap.put("ydjkcnt", "t.ydjkcnt AS ydjkcnt");
|
||||
selectMap.put("jkhg", "t.jkhg AS jkhg");
|
||||
selectMap.put("ydyyxs", "t.ydyyxs AS ydyyxs");
|
||||
selectMap.put("ydckz", "t.ydckz AS ydckz");
|
||||
selectMap.put("ydckcnt", "t.ydckcnt AS ydckcnt");
|
||||
selectMap.put("ckhg", "t.ckhg AS ckhg");
|
||||
selectMap.put("ydcsv", "t.ydcsv AS ydcsv");
|
||||
selectMap.put("ydcscd", "t.ydcscd AS ydcscd");
|
||||
selectMap.put("ydcskd", "t.ydcskd AS ydcskd");
|
||||
selectMap.put("ydcspd", "t.ydcspd AS ydcspd");
|
||||
selectMap.put("ydcscnt", "t.ydcscnt AS ydcscnt");
|
||||
selectMap.put("ydxxccnt", "t.ydxxccnt AS ydxxccnt");
|
||||
selectMap.put("v", "t.v AS v");
|
||||
selectMap.put("fzrdmxz", "t.fzrdmxz AS fzrdmxz");
|
||||
selectMap.put("fzrtdsz", "t.fzrtdsz AS fzrtdsz");
|
||||
selectMap.put("fzryxwdp", "t.fzryxwdp AS fzryxwdp");
|
||||
selectMap.put("fzrpj", "t.fzrpj AS fzrpj");
|
||||
selectMap.put("symtlc", "t.symtlc AS symtlc");
|
||||
selectMap.put("symtxs", "t.symtxs AS symtxs");
|
||||
selectMap.put("xymtlc", "t.xymtlc AS xymtlc");
|
||||
selectMap.put("xymtxs", "t.xymtxs AS xymtxs");
|
||||
selectMap.put("jyfs", "t.jyfs AS jyfs");
|
||||
selectMap.put("yyfs", "t.yyfs AS yyfs");
|
||||
selectMap.put("syjcnt", "t.syjcnt AS syjcnt");
|
||||
selectMap.put("syjhg", "t.syjhg AS syjhg");
|
||||
selectMap.put("syjq", "t.syjq AS syjq");
|
||||
selectMap.put("syjsz", "t.syjsz AS syjsz");
|
||||
selectMap.put("syjwdp", "t.syjwdp AS syjwdp");
|
||||
selectMap.put("sjgycnt", "t.sjgycnt AS sjgycnt");
|
||||
selectMap.put("zygydxms", "t.zygydxms AS zygydxms");
|
||||
selectMap.put("jggydxms", "t.jggydxms AS jggydxms");
|
||||
selectMap.put("gytm", "t.gytm AS gytm");
|
||||
selectMap.put("yxtm", "t.yxtm AS yxtm");
|
||||
selectMap.put("fpssmn", "t.fpssmn AS fpssmn");
|
||||
selectMap.put("dtfrqcy", "t.dtfrqcy AS dtfrqcy");
|
||||
selectMap.put("jbtxcs", "t.jbtxcs AS jbtxcs");
|
||||
selectMap.put("isUp", "t.isUp AS isUp");
|
||||
selectMap.put("isDown", "t.isDown AS isDown");
|
||||
selectMap.put("mway", "t.mway AS mway");
|
||||
selectMap.put("mwayName", "t.mwayName AS mwayName");
|
||||
selectMap.put("remark", "t.remark AS remark");
|
||||
selectMap.put("vlsr", "t.vlsr AS vlsr");
|
||||
selectMap.put("vlsrTm", "t.vlsrTm AS vlsrTm");
|
||||
selectMap.put("logo", "t.logo AS logo");
|
||||
selectMap.put("orderIndex", "t.orderIndex AS orderIndex");
|
||||
selectMap.put("description", "t.description AS description");
|
||||
selectMap.put("baseStepSort", "t.baseStepSort AS baseStepSort");
|
||||
selectMap.put("rvcdStepSort", "t.rvcdStepSort AS rvcdStepSort");
|
||||
selectMap.put("rstcdStepSort", "t.rstcdStepSort AS rstcdStepSort");
|
||||
selectMap.put("siteStepSort", "t.siteStepSort AS siteStepSort");
|
||||
return selectMap;
|
||||
}
|
||||
|
||||
private String buildVmsstbprptFilterCondition(DataSourceRequest.FilterDescriptor filter,
|
||||
Map<String, Object> paramMap,
|
||||
int[] indexHolder) {
|
||||
@ -309,21 +439,85 @@ public class FpBuildServiceImpl implements FpBuildService {
|
||||
}
|
||||
Map<String, String> columnMap = new HashMap<>();
|
||||
columnMap.put("stcd", "fp.STCD");
|
||||
columnMap.put("stCode", "fp.ST_CODE");
|
||||
columnMap.put("logo", "fp.LOGO");
|
||||
columnMap.put("stnm", "fp.STNM");
|
||||
columnMap.put("stName", "fp.STNM");
|
||||
columnMap.put("sttp", "fp.STTP");
|
||||
columnMap.put("sttpCode", "fp.STTP");
|
||||
columnMap.put("sttpName", "sttp.STTP_NAME");
|
||||
columnMap.put("sttpFullPath", "sttp.FULL_PATH");
|
||||
columnMap.put("sttpTreeLevel", "sttp.TREE_LEVEL");
|
||||
columnMap.put("rstcd", "fp.RSTCD");
|
||||
columnMap.put("logo", "fp.LOGO");
|
||||
columnMap.put("ennm", "eng.ENNM");
|
||||
columnMap.put("baseId", "eng.BASE_ID");
|
||||
columnMap.put("baseName", "hb.BASENAME");
|
||||
columnMap.put("hbrvcd", "eng.HBRVCD");
|
||||
columnMap.put("hbrvcdName", "hbrv.HBRVNM");
|
||||
columnMap.put("lgtd", "fp.LGTD");
|
||||
columnMap.put("lttd", "fp.LTTD");
|
||||
columnMap.put("elev", "fp.ELEV");
|
||||
columnMap.put("stlc", "fp.STLC");
|
||||
columnMap.put("dtin", "fp.DTIN");
|
||||
columnMap.put("dtinName", "CASE WHEN NVL(fp.DTIN, 0) = 1 THEN '已接入' ELSE '未接入' END");
|
||||
columnMap.put("dtinTm", "fp.DTIN_TM");
|
||||
columnMap.put("bldsttCcode", "fp.BLDSTT_CODE");
|
||||
columnMap.put("bldsttCcodeName", "CASE WHEN fp.BLDSTT_CODE IN (1, 10, 11) THEN '已建' WHEN fp.BLDSTT_CODE IN (2, 7, 8) THEN '在建' ELSE '未建/规划' END");
|
||||
columnMap.put("stdsdt", "fp.STDSDT");
|
||||
columnMap.put("pststdt", "fp.PSTSTDT");
|
||||
columnMap.put("pesstdt", "fp.PESSTDT");
|
||||
columnMap.put("swdt", "fp.SWDT");
|
||||
columnMap.put("jcdt", "fp.JCDT");
|
||||
columnMap.put("wddt", "fp.WDDT");
|
||||
columnMap.put("introduce", "fp.INTRODUCE");
|
||||
columnMap.put("ydxs", "fp.YDXS");
|
||||
columnMap.put("ydzcd", "fp.YDZCD");
|
||||
columnMap.put("ydjkz", "fp.YDJKZ");
|
||||
columnMap.put("ydjkcnt", "fp.YDJKCNT");
|
||||
columnMap.put("jkhg", "fp.JKHG");
|
||||
columnMap.put("ydyyxs", "fp.YDYYXS");
|
||||
columnMap.put("ydckz", "fp.YDCKZ");
|
||||
columnMap.put("ydckcnt", "fp.YDCKCNT");
|
||||
columnMap.put("ckhg", "fp.CKHG");
|
||||
columnMap.put("ydcsv", "fp.YDCSV");
|
||||
columnMap.put("ydcscd", "fp.YDCSCD");
|
||||
columnMap.put("ydcskd", "fp.YDCSKD");
|
||||
columnMap.put("ydcspd", "fp.YDCSPD");
|
||||
columnMap.put("ydcscnt", "fp.YDCSCNT");
|
||||
columnMap.put("ydxxccnt", "fp.YDXXCCNT");
|
||||
columnMap.put("v", "fp.V");
|
||||
columnMap.put("fzrdmxz", "fp.FZRDMXZ");
|
||||
columnMap.put("fzrtdsz", "fp.FZRTDSZ");
|
||||
columnMap.put("fzryxwdp", "fp.FZRYXWDP");
|
||||
columnMap.put("fzrpj", "fp.FZRPJ");
|
||||
columnMap.put("symtlc", "fp.SYMTLC");
|
||||
columnMap.put("symtxs", "fp.SYMTXS");
|
||||
columnMap.put("xymtlc", "fp.XYMTLC");
|
||||
columnMap.put("xymtxs", "fp.XYMTXS");
|
||||
columnMap.put("jyfs", "fp.JYFS");
|
||||
columnMap.put("yyfs", "fp.YYFS");
|
||||
columnMap.put("syjcnt", "fp.SYJCNT");
|
||||
columnMap.put("syjhg", "fp.SYJHG");
|
||||
columnMap.put("syjq", "fp.SYJQ");
|
||||
columnMap.put("syjsz", "fp.SYJSZ");
|
||||
columnMap.put("syjwdp", "fp.SYJWDP");
|
||||
columnMap.put("sjgycnt", "fp.SJGYCNT");
|
||||
columnMap.put("zygydxms", "fp.ZYGYDXMS");
|
||||
columnMap.put("jggydxms", "fp.JGGYDXMS");
|
||||
columnMap.put("gytm", "fp.GYTM");
|
||||
columnMap.put("yxtm", "fp.YXTM");
|
||||
columnMap.put("fpssmn", "fp.FPSSMN");
|
||||
columnMap.put("dtfrqcy", "fp.DTFRQCY");
|
||||
columnMap.put("jbtxcs", "fp.JBTXCS");
|
||||
columnMap.put("isUp", "fp.IS_UP");
|
||||
columnMap.put("isDown", "fp.IS_DOWN");
|
||||
columnMap.put("mway", "NULL");
|
||||
columnMap.put("mwayName", "NULL");
|
||||
columnMap.put("remark", "fp.REMARK");
|
||||
columnMap.put("vlsr", "fp.VLSR");
|
||||
columnMap.put("vlsrTm", "fp.VLSR_TM");
|
||||
columnMap.put("orderIndex", "fp.ORDER_INDEX");
|
||||
columnMap.put("description", "NULL");
|
||||
columnMap.put("siteStepSort", "fp.ORDER_INDEX");
|
||||
columnMap.put("rstcdStepSort", "eng.ORDER_INDEX");
|
||||
columnMap.put("baseStepSort", "hb.ORDER_INDEX");
|
||||
@ -333,42 +527,118 @@ public class FpBuildServiceImpl implements FpBuildService {
|
||||
|
||||
private String buildVmsstbprptOrderBySql(List<DataSourceRequest.SortDescriptor> sorts) {
|
||||
if (sorts == null || sorts.isEmpty()) {
|
||||
return " ORDER BY NVL(hb.ORDER_INDEX, 999999) ASC, NVL(hbrv.ORDER_INDEX, 999999) ASC, " +
|
||||
"NVL(eng.ORDER_INDEX, 999999) ASC, NVL(fp.ORDER_INDEX, 999999) ASC, fp.STCD ASC";
|
||||
return " ORDER BY t.baseStepSort ASC NULLS LAST, t.rvcdStepSort ASC NULLS LAST, " +
|
||||
"t.rstcdStepSort ASC NULLS LAST, t.siteStepSort ASC NULLS LAST, t.stcd ASC";
|
||||
}
|
||||
Map<String, String> sortMap = new HashMap<>();
|
||||
sortMap.put("stcd", "fp.STCD");
|
||||
sortMap.put("stnm", "fp.STNM");
|
||||
sortMap.put("sttpCode", "fp.STTP");
|
||||
sortMap.put("sttpName", "sttp.STTP_NAME");
|
||||
sortMap.put("rstcd", "fp.RSTCD");
|
||||
sortMap.put("ennm", "eng.ENNM");
|
||||
sortMap.put("baseId", "eng.BASE_ID");
|
||||
sortMap.put("baseName", "hb.BASENAME");
|
||||
sortMap.put("hbrvcd", "eng.HBRVCD");
|
||||
sortMap.put("dtin", "fp.DTIN");
|
||||
sortMap.put("bldsttCcode", "fp.BLDSTT_CODE");
|
||||
sortMap.put("baseStepSort", "hb.ORDER_INDEX");
|
||||
sortMap.put("rvcdStepSort", "hbrv.ORDER_INDEX");
|
||||
sortMap.put("rstcdStepSort", "eng.ORDER_INDEX");
|
||||
sortMap.put("siteStepSort", "fp.ORDER_INDEX");
|
||||
|
||||
List<String> orderItems = new ArrayList<>();
|
||||
for (DataSourceRequest.SortDescriptor sort : sorts) {
|
||||
if (sort == null || sort.getField() == null || sort.getField().isBlank()) {
|
||||
continue;
|
||||
}
|
||||
String column = sortMap.get(sort.getField());
|
||||
String column = mapVmsstbprptOuterColumn(sort.getField());
|
||||
if (column == null) {
|
||||
continue;
|
||||
}
|
||||
String direction = "desc".equalsIgnoreCase(sort.getDir()) ? "DESC" : "ASC";
|
||||
orderItems.add(column + " " + direction);
|
||||
String direction = "desc".equalsIgnoreCase(sort.getDir()) || "des".equalsIgnoreCase(sort.getDir()) ? "DESC" : "ASC";
|
||||
orderItems.add(column + " " + direction + " NULLS LAST");
|
||||
}
|
||||
if (orderItems.isEmpty()) {
|
||||
return " ORDER BY NVL(hb.ORDER_INDEX, 999999) ASC, NVL(hbrv.ORDER_INDEX, 999999) ASC, " +
|
||||
"NVL(eng.ORDER_INDEX, 999999) ASC, NVL(fp.ORDER_INDEX, 999999) ASC, fp.STCD ASC";
|
||||
return " ORDER BY t.baseStepSort ASC NULLS LAST, t.rvcdStepSort ASC NULLS LAST, " +
|
||||
"t.rstcdStepSort ASC NULLS LAST, t.siteStepSort ASC NULLS LAST, t.stcd ASC";
|
||||
}
|
||||
return " ORDER BY " + String.join(", ", orderItems);
|
||||
}
|
||||
|
||||
private String mapVmsstbprptOuterColumn(String field) {
|
||||
if (field == null || field.isBlank()) {
|
||||
return null;
|
||||
}
|
||||
return switch (field) {
|
||||
case "stcd" -> "t.stcd";
|
||||
case "stCode" -> "t.stCode";
|
||||
case "logo" -> "t.logo";
|
||||
case "stnm" -> "t.stnm";
|
||||
case "stName" -> "t.stName";
|
||||
case "sttp" -> "t.sttp";
|
||||
case "sttpCode" -> "t.sttpCode";
|
||||
case "sttpName" -> "t.sttpName";
|
||||
case "sttpFullPath" -> "t.sttpFullPath";
|
||||
case "sttpTreeLevel" -> "t.sttpTreeLevel";
|
||||
case "rstcd" -> "t.rstcd";
|
||||
case "ennm" -> "t.ennm";
|
||||
case "baseId" -> "t.baseId";
|
||||
case "baseName" -> "t.baseName";
|
||||
case "hbrvcd" -> "t.hbrvcd";
|
||||
case "hbrvcdName" -> "t.hbrvcdName";
|
||||
case "lgtd" -> "t.lgtd";
|
||||
case "lttd" -> "t.lttd";
|
||||
case "elev" -> "t.elev";
|
||||
case "stlc" -> "t.stlc";
|
||||
case "dtin" -> "t.dtin";
|
||||
case "dtinName" -> "t.dtinName";
|
||||
case "dtinTm" -> "t.dtinTm";
|
||||
case "bldsttCcode" -> "t.bldsttCcode";
|
||||
case "bldsttCcodeName" -> "t.bldsttCcodeName";
|
||||
case "stdsdt" -> "t.stdsdt";
|
||||
case "pststdt" -> "t.pststdt";
|
||||
case "pesstdt" -> "t.pesstdt";
|
||||
case "swdt" -> "t.swdt";
|
||||
case "jcdt" -> "t.jcdt";
|
||||
case "wddt" -> "t.wddt";
|
||||
case "introduce" -> "t.introduce";
|
||||
case "ydxs" -> "t.ydxs";
|
||||
case "ydzcd" -> "t.ydzcd";
|
||||
case "ydjkz" -> "t.ydjkz";
|
||||
case "ydjkcnt" -> "t.ydjkcnt";
|
||||
case "jkhg" -> "t.jkhg";
|
||||
case "ydyyxs" -> "t.ydyyxs";
|
||||
case "ydckz" -> "t.ydckz";
|
||||
case "ydckcnt" -> "t.ydckcnt";
|
||||
case "ckhg" -> "t.ckhg";
|
||||
case "ydcsv" -> "t.ydcsv";
|
||||
case "ydcscd" -> "t.ydcscd";
|
||||
case "ydcskd" -> "t.ydcskd";
|
||||
case "ydcspd" -> "t.ydcspd";
|
||||
case "ydcscnt" -> "t.ydcscnt";
|
||||
case "ydxxccnt" -> "t.ydxxccnt";
|
||||
case "v" -> "t.v";
|
||||
case "fzrdmxz" -> "t.fzrdmxz";
|
||||
case "fzrtdsz" -> "t.fzrtdsz";
|
||||
case "fzryxwdp" -> "t.fzryxwdp";
|
||||
case "fzrpj" -> "t.fzrpj";
|
||||
case "symtlc" -> "t.symtlc";
|
||||
case "symtxs" -> "t.symtxs";
|
||||
case "xymtlc" -> "t.xymtlc";
|
||||
case "xymtxs" -> "t.xymtxs";
|
||||
case "jyfs" -> "t.jyfs";
|
||||
case "yyfs" -> "t.yyfs";
|
||||
case "syjcnt" -> "t.syjcnt";
|
||||
case "syjhg" -> "t.syjhg";
|
||||
case "syjq" -> "t.syjq";
|
||||
case "syjsz" -> "t.syjsz";
|
||||
case "syjwdp" -> "t.syjwdp";
|
||||
case "sjgycnt" -> "t.sjgycnt";
|
||||
case "zygydxms" -> "t.zygydxms";
|
||||
case "jggydxms" -> "t.jggydxms";
|
||||
case "gytm" -> "t.gytm";
|
||||
case "yxtm" -> "t.yxtm";
|
||||
case "fpssmn" -> "t.fpssmn";
|
||||
case "dtfrqcy" -> "t.dtfrqcy";
|
||||
case "jbtxcs" -> "t.jbtxcs";
|
||||
case "isUp" -> "t.isUp";
|
||||
case "isDown" -> "t.isDown";
|
||||
case "mway" -> "t.mway";
|
||||
case "mwayName" -> "t.mwayName";
|
||||
case "remark" -> "t.remark";
|
||||
case "vlsr" -> "t.vlsr";
|
||||
case "vlsrTm" -> "t.vlsrTm";
|
||||
case "orderIndex" -> "t.orderIndex";
|
||||
case "description" -> "t.description";
|
||||
case "baseStepSort" -> "t.baseStepSort";
|
||||
case "rvcdStepSort" -> "t.rvcdStepSort";
|
||||
case "rstcdStepSort" -> "t.rstcdStepSort";
|
||||
case "siteStepSort" -> "t.siteStepSort";
|
||||
default -> null;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@ -13,7 +13,11 @@ import com.yfd.platform.common.GroupHelper;
|
||||
import com.yfd.platform.common.GroupingInfo;
|
||||
import com.yfd.platform.common.MicroservicDynamicSQLMapper;
|
||||
import com.yfd.platform.common.exception.BizException;
|
||||
import com.yfd.platform.qgc_env.fp.entity.vo.FpFishSelectVo;
|
||||
import com.yfd.platform.qgc_env.fp.entity.vo.FpFtpStatisticsVo;
|
||||
import com.yfd.platform.qgc_env.fp.entity.vo.FpRunAnalysisHeadColumnVo;
|
||||
import com.yfd.platform.qgc_env.fp.entity.vo.FpRunAnalysisTableVo;
|
||||
import com.yfd.platform.qgc_env.fp.entity.vo.FpRunAnalysisVo;
|
||||
import com.yfd.platform.qgc_env.fp.entity.vo.FpRunPlanVo;
|
||||
import com.yfd.platform.qgc_env.fp.entity.vo.FpSdfpssrVo;
|
||||
import com.yfd.platform.qgc_env.fp.entity.vo.FpTableVo;
|
||||
@ -62,8 +66,8 @@ public class FpRunServiceImpl implements FpRunService {
|
||||
Map<String, Object> paramMap = new HashMap<>();
|
||||
paramMap.put("stcd", stcd);
|
||||
paramMap.put("yr", yr);
|
||||
|
||||
Map<String, Object> row = microservicDynamicSQLMapper.getOneBySql(buildQgcSecondPlanSql(), paramMap);
|
||||
String sql = buildQgcSecondPlanSql();
|
||||
Map<String, Object> row = microservicDynamicSQLMapper.getOneBySql(sql, paramMap);
|
||||
FpRunPlanVo vo = row == null || row.isEmpty()
|
||||
? new FpRunPlanVo()
|
||||
: BeanUtil.fillBeanWithMap(
|
||||
@ -128,6 +132,123 @@ public class FpRunServiceImpl implements FpRunService {
|
||||
return queryQgcFpssTableGroupList(dataSourceRequest, loadOptions, stcd);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DataSourceResult<FpRunAnalysisTableVo> getAnalysisData(DataSourceRequest dataSourceRequest) {
|
||||
DataSourceResult<FpRunAnalysisTableVo> result = new DataSourceResult<>();
|
||||
DataSourceLoadOptionsBase loadOptions = dataSourceRequest == null ? null : dataSourceRequest.toDevRequest();
|
||||
String tm = loadOptions == null ? null : QgcQueryWrapperUtil.getFilterFieldValue(loadOptions, "tm");
|
||||
if (StrUtil.isBlank(tm) || !tm.contains(",")) {
|
||||
throw new BizException("时间范围(tm)格式错误.");
|
||||
}
|
||||
String[] tmArr = tm.split(",");
|
||||
if (tmArr.length < 2 || StrUtil.isBlank(tmArr[0]) || StrUtil.isBlank(tmArr[1])) {
|
||||
throw new BizException("时间范围(tm)格式错误.");
|
||||
}
|
||||
String stcd = loadOptions == null ? null : QgcQueryWrapperUtil.getFilterFieldValue(loadOptions, "stcd");
|
||||
if (StrUtil.isBlank(stcd)) {
|
||||
throw new BizException("过鱼设施(stcd)编码不能为空.");
|
||||
}
|
||||
String ftp = loadOptions == null ? null : QgcQueryWrapperUtil.getFilterFieldValue(loadOptions, "ftp");
|
||||
if (StrUtil.isBlank(ftp)) {
|
||||
result.setData(Collections.emptyList());
|
||||
result.setTotal(0L);
|
||||
result.setAggregates(new HashMap<>());
|
||||
return result;
|
||||
}
|
||||
|
||||
Map<String, Object> stationParamMap = new HashMap<>();
|
||||
stationParamMap.put("stcd", StrUtil.trim(stcd));
|
||||
Map<String, Object> stationContext = microservicDynamicSQLMapper.getOneBySql(
|
||||
buildQgcFpRunAnalysisStationSql(),
|
||||
stationParamMap
|
||||
);
|
||||
String rstcd = stationContext == null ? null : Convert.toStr(stationContext.get("rstcd"), null);
|
||||
String hbrvcd = stationContext == null ? null : Convert.toStr(stationContext.get("hbrvcd"), null);
|
||||
|
||||
String wtrvStcd = null;
|
||||
String wqStcd = null;
|
||||
if (StrUtil.isNotBlank(rstcd) && StrUtil.isNotBlank(hbrvcd)) {
|
||||
Map<String, Object> alongParamMap = new HashMap<>();
|
||||
alongParamMap.put("rstcd", rstcd);
|
||||
alongParamMap.put("hbrvcd", hbrvcd);
|
||||
List<Map<String, Object>> alongRows = microservicDynamicSQLMapper.pageAllList(
|
||||
null,
|
||||
buildQgcFpRunAnalysisAlongSql(),
|
||||
alongParamMap
|
||||
);
|
||||
for (Map<String, Object> row : alongRows) {
|
||||
String sttpCode = Convert.toStr(row.get("sttpCode"), null);
|
||||
if ("WTRV".equalsIgnoreCase(sttpCode) && StrUtil.isBlank(wtrvStcd)) {
|
||||
wtrvStcd = Convert.toStr(row.get("stcd"), null);
|
||||
}
|
||||
if ("WQ".equalsIgnoreCase(sttpCode) && StrUtil.isBlank(wqStcd)) {
|
||||
wqStcd = Convert.toStr(row.get("stcd"), null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Map<String, Object> paramMap = new HashMap<>();
|
||||
paramMap.put("stcd", StrUtil.trim(stcd));
|
||||
paramMap.put("ftp", StrUtil.trim(ftp));
|
||||
paramMap.put("startTime", StrUtil.trim(tmArr[0]));
|
||||
paramMap.put("endTime", StrUtil.trim(tmArr[1]));
|
||||
paramMap.put("rstcd", rstcd);
|
||||
paramMap.put("hbrvcd", hbrvcd);
|
||||
paramMap.put("wtrvStcd", wtrvStcd);
|
||||
paramMap.put("wqStcd", wqStcd);
|
||||
|
||||
Page<?> page = loadOptions == null ? null : QgcQueryWrapperUtil.buildPage(loadOptions);
|
||||
List<FpRunAnalysisVo> rows = microservicDynamicSQLMapper.pageAllListWithResultType(
|
||||
page,
|
||||
buildQgcFpRunAnalysisDataSql(dataSourceRequest == null ? null : dataSourceRequest.getSort()),
|
||||
paramMap,
|
||||
FpRunAnalysisVo.class
|
||||
);
|
||||
|
||||
long total = page != null ? page.getTotal() : rows.size();
|
||||
FpRunAnalysisTableVo tableVo = new FpRunAnalysisTableVo()
|
||||
.setColumns(buildQgcFpRunAnalysisColumns(StrUtil.trim(ftp)))
|
||||
.setDataSource(rows)
|
||||
.setTotal(total);
|
||||
result.setData(Collections.singletonList(tableVo));
|
||||
result.setTotal(total);
|
||||
result.setAggregates(new HashMap<>());
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DataSourceResult<FpFishSelectVo> getFishSelect(DataSourceRequest dataSourceRequest) {
|
||||
DataSourceLoadOptionsBase loadOptions = dataSourceRequest == null ? null : dataSourceRequest.toDevRequest();
|
||||
String stcd = loadOptions == null ? null : QgcQueryWrapperUtil.getFilterFieldValue(loadOptions, "stcd");
|
||||
if (StrUtil.isBlank(stcd)) {
|
||||
throw new BizException("过鱼设施(stcd)编码不能为空.");
|
||||
}
|
||||
String tm = loadOptions == null ? null : QgcQueryWrapperUtil.getFilterFieldValue(loadOptions, "tm");
|
||||
if (StrUtil.isBlank(tm) || !tm.contains(",")) {
|
||||
throw new BizException("时间范围(tm)不能为空,格式应为开始时间,结束时间.");
|
||||
}
|
||||
String[] tmArr = tm.split(",");
|
||||
if (tmArr.length < 2 || StrUtil.isBlank(tmArr[0]) || StrUtil.isBlank(tmArr[1])) {
|
||||
throw new BizException("时间范围(tm)格式错误.");
|
||||
}
|
||||
|
||||
Map<String, Object> paramMap = new HashMap<>();
|
||||
paramMap.put("stcd", StrUtil.trim(stcd));
|
||||
paramMap.put("tmStart", StrUtil.trim(tmArr[0]));
|
||||
paramMap.put("tmEnd", StrUtil.trim(tmArr[1]));
|
||||
|
||||
List<FpFishSelectVo> list = microservicDynamicSQLMapper.getAllListWithResultType(
|
||||
buildFpFishSelectSql(),
|
||||
paramMap,
|
||||
FpFishSelectVo.class
|
||||
);
|
||||
DataSourceResult<FpFishSelectVo> result = new DataSourceResult<>();
|
||||
result.setData(list);
|
||||
result.setTotal(list == null ? 0L : list.size());
|
||||
result.setAggregates(new HashMap<>());
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<YearFpStatisticsVo> getYearFpStatic(String year) {
|
||||
Map<String, Object> paramMap = new HashMap<>();
|
||||
@ -188,41 +309,34 @@ public class FpRunServiceImpl implements FpRunService {
|
||||
private DataSourceResult<FpTableVo> queryQgcFpssTableGroupList(DataSourceRequest dataSourceRequest,
|
||||
DataSourceLoadOptionsBase loadOptions,
|
||||
String stcdFilter) {
|
||||
List<DataSourceRequest.GroupDescriptor> groups = dataSourceRequest.getGroup();
|
||||
GroupingInfo[] groupInfos = loadOptions == null ? new GroupingInfo[0] : loadOptions.getGroup();
|
||||
|
||||
StringBuilder sql = new StringBuilder("SELECT ");
|
||||
List<String> selectItems = new ArrayList<>();
|
||||
for (DataSourceRequest.GroupDescriptor descriptor : groups) {
|
||||
if (descriptor == null || StrUtil.isBlank(descriptor.getField())) {
|
||||
continue;
|
||||
}
|
||||
String column = mapQgcFpssTableColumn(descriptor.getField());
|
||||
if (StrUtil.isBlank(column)) {
|
||||
continue;
|
||||
}
|
||||
selectItems.add(column + " AS " + descriptor.getField().toUpperCase());
|
||||
selectItems.add("COUNT(*) AS COUNT_" + descriptor.getField().toUpperCase());
|
||||
if (CollUtil.isNotEmpty(descriptor.getAggregates())) {
|
||||
for (DataSourceRequest.AggregateDescriptor aggregate : descriptor.getAggregates()) {
|
||||
String aggregateColumn = mapQgcFpssTableColumn(aggregate.getField());
|
||||
if (StrUtil.isBlank(aggregateColumn) || StrUtil.isBlank(aggregate.getAggregate())) {
|
||||
continue;
|
||||
}
|
||||
String aggregateSql = buildAggregateSql(aggregate.getAggregate(), aggregateColumn, aggregate.getField());
|
||||
if (StrUtil.isNotBlank(aggregateSql)) {
|
||||
selectItems.add(aggregateSql);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (selectItems.isEmpty()) {
|
||||
selectItems.add("t.YR AS YR");
|
||||
selectItems.add("COUNT(*) AS COUNT_YR");
|
||||
}
|
||||
|
||||
sql.append(String.join(", ", selectItems))
|
||||
.append(" FROM (")
|
||||
sql.append("MAX(t.stcd) AS stcd, ")
|
||||
.append("MAX(t.stnm) AS stnm, ")
|
||||
.append("MIN(t.tm) AS tm, ")
|
||||
.append("t.ftp AS ftp, ")
|
||||
.append("t.ftpName AS ftpName, ")
|
||||
.append("MAX(t.fishId) AS fishId, ")
|
||||
.append("MAX(t.fsz) AS fsz, ")
|
||||
.append("TO_CHAR(SUM(TO_NUMBER(NVL(t.fcnt, '0')))) AS fcnt, ")
|
||||
.append("MAX(t.length) AS length, ")
|
||||
.append("MAX(t.width) AS width, ")
|
||||
.append("MAX(t.fishspeed) AS fishspeed, ")
|
||||
.append("MAX(t.direction) AS direction, ")
|
||||
.append("MAX(t.directionName) AS directionName, ")
|
||||
.append("MAX(t.temperature) AS temperature, ")
|
||||
.append("MAX(t.speed) AS speed, ")
|
||||
.append("MAX(t.firstimgurl) AS firstimgurl, ")
|
||||
.append("MAX(t.videourl) AS videourl, ")
|
||||
.append("t.yr AS yr, ")
|
||||
.append("MAX(t.fwet) AS fwet, ")
|
||||
.append("MAX(t.fid) AS fid, ")
|
||||
.append("SUM(NVL(t.upFcnt, 0)) AS upFcnt, ")
|
||||
.append("SUM(NVL(t.downFcnt, 0)) AS downFcnt, ")
|
||||
.append("CASE WHEN COUNT(DISTINCT t.dataSrc) = 1 THEN MAX(t.dataSrc) ELSE '人工+自动' END AS dataSrc, ")
|
||||
.append("CASE WHEN COUNT(DISTINCT t.mway) = 1 THEN MAX(t.mway) ELSE NULL END AS mway, ")
|
||||
.append("MAX(t.picpth) AS picpth, ")
|
||||
.append("MAX(t.vdpth) AS vdpth ")
|
||||
.append("FROM (")
|
||||
.append(buildQgcFpssTableCoreSql())
|
||||
.append(") t WHERE 1 = 1 ");
|
||||
|
||||
@ -233,29 +347,14 @@ public class FpRunServiceImpl implements FpRunService {
|
||||
sql.append(" AND ").append(filterSql).append(" ");
|
||||
}
|
||||
|
||||
List<String> groupByColumns = new ArrayList<>();
|
||||
for (DataSourceRequest.GroupDescriptor descriptor : groups) {
|
||||
if (descriptor == null || StrUtil.isBlank(descriptor.getField())) {
|
||||
continue;
|
||||
}
|
||||
String column = mapQgcFpssTableColumn(descriptor.getField());
|
||||
if (StrUtil.isNotBlank(column)) {
|
||||
groupByColumns.add(column);
|
||||
}
|
||||
}
|
||||
if (!groupByColumns.isEmpty()) {
|
||||
sql.append(" GROUP BY ").append(String.join(", ", groupByColumns)).append(" ");
|
||||
}
|
||||
sql.append(buildQgcFpssTableGroupOrderBySql(groups));
|
||||
sql.append(" GROUP BY t.yr, t.ftp ");
|
||||
sql.append(buildQgcFpssTableAggregateOrderBySql(dataSourceRequest == null ? null : dataSourceRequest.getSort()));
|
||||
|
||||
List<Map<String, Object>> rows = microservicDynamicSQLMapper.pageAllList(null, sql.toString(), paramMap);
|
||||
Page<?> page = loadOptions == null ? null : QgcQueryWrapperUtil.buildPage(loadOptions, loadOptions.getSkip(), loadOptions.getTake());
|
||||
List<FpTableVo> rows = microservicDynamicSQLMapper.pageAllListWithResultType(page, sql.toString(), paramMap, FpTableVo.class);
|
||||
DataSourceResult<FpTableVo> result = new DataSourceResult<>();
|
||||
if (Boolean.TRUE.equals(dataSourceRequest.getGroupResultFlat())) {
|
||||
result.setData((List<FpTableVo>) (List<?>) new GroupHelper().faltGroup(rows, Arrays.asList(groupInfos)));
|
||||
} else {
|
||||
result.setData((List<FpTableVo>) (List<?>) new GroupHelper().group(rows, Arrays.asList(groupInfos)));
|
||||
}
|
||||
result.setTotal(0L);
|
||||
result.setData(rows);
|
||||
result.setTotal(page != null ? page.getTotal() : rows.size());
|
||||
result.setAggregates(new HashMap<>());
|
||||
return result;
|
||||
}
|
||||
@ -291,38 +390,77 @@ public class FpRunServiceImpl implements FpRunService {
|
||||
}
|
||||
|
||||
private String buildQgcFpssTableCoreSql() {
|
||||
String fishNameExpr = buildFishDictionaryDisplayExpr("cRv", "cZy", "t.FTP");
|
||||
return "SELECT " +
|
||||
"manualData.STCD AS stcd, " +
|
||||
"manualData.STNM AS stnm, " +
|
||||
"manualData.TM AS tm, " +
|
||||
"manualData.FTP AS ftp, " +
|
||||
"manualData.FISHID AS fishId, " +
|
||||
"manualData.FSZ AS fsz, " +
|
||||
"manualData.YR AS yr, " +
|
||||
"manualData.FCNT AS fcnt, " +
|
||||
"manualData.LENGTH AS length, " +
|
||||
"manualData.WIDTH AS width, " +
|
||||
"manualData.FISHSPEED AS fishspeed, " +
|
||||
"manualData.DIRECTION AS direction, " +
|
||||
"manualData.DIRECTIONNAME AS directionName, " +
|
||||
"manualData.UPFCNT AS upFcnt, " +
|
||||
"manualData.DOWNFCNT AS downFcnt, " +
|
||||
"manualData.TEMPERATURE AS temperature, " +
|
||||
"manualData.SPEED AS speed, " +
|
||||
"manualData.FIRSTIMGURL AS firstimgurl, " +
|
||||
"manualData.VIDEOURL AS videourl, " +
|
||||
"manualData.FWET AS fwet, " +
|
||||
"manualData.FID AS fid, " +
|
||||
"manualData.DATASRC AS dataSrc, " +
|
||||
"manualData.MWAY AS mway, " +
|
||||
"manualData.STRDT AS strdt, " +
|
||||
"manualData.ENDDT AS enddt " +
|
||||
"src.STCD AS stcd, " +
|
||||
"src.STNM AS stnm, " +
|
||||
"src.TM AS tm, " +
|
||||
"src.FTP AS ftp, " +
|
||||
"src.NAME AS ftpName, " +
|
||||
"src.FISHID AS fishId, " +
|
||||
"src.FSZ AS fsz, " +
|
||||
"src.YR AS yr, " +
|
||||
"src.FCNT AS fcnt, " +
|
||||
"src.LENGTH AS length, " +
|
||||
"src.WIDTH AS width, " +
|
||||
"src.FISHSPEED AS fishspeed, " +
|
||||
"src.DIRECTION AS direction, " +
|
||||
"src.DIRECTIONNAME AS directionName, " +
|
||||
"src.UPFCNT AS upFcnt, " +
|
||||
"src.DOWNFCNT AS downFcnt, " +
|
||||
"src.TEMPERATURE AS temperature, " +
|
||||
"src.SPEED AS speed, " +
|
||||
"src.FIRSTIMGURL AS firstimgurl, " +
|
||||
"src.VIDEOURL AS videourl, " +
|
||||
"src.FWET AS fwet, " +
|
||||
"src.FID AS fid, " +
|
||||
"src.PICPTH AS picpth, " +
|
||||
"src.VDPTH AS vdpth, " +
|
||||
"src.DATASRC AS dataSrc, " +
|
||||
"src.MWAY AS mway, " +
|
||||
"src.STRDT AS strdt, " +
|
||||
"src.ENDDT AS enddt " +
|
||||
"FROM ( " +
|
||||
" SELECT t.STCD AS STCD, " +
|
||||
" fp.STNM AS STNM, " +
|
||||
" TO_CHAR(t.STRDT, 'YYYY-MM-DD HH24:MI:SS') AS TM, " +
|
||||
" COALESCE(fishRv.NAME, relRv.FISH_NAME, fishZy.NAME, relZy.FISH_NAME, fishDirect.NAME, t.FTP) AS FTP, " +
|
||||
" TO_CHAR(t.TM, 'YYYY-MM-DD HH24:MI:SS') AS TM, " +
|
||||
" COALESCE(c.NAME, t.FTP ) AS FTP , " +
|
||||
" t.FTP AS FISHID, " +
|
||||
" COALESCE(c.NAME, t.FTP ) AS NAME, " +
|
||||
" t.FSZ AS FSZ, " +
|
||||
" TO_CHAR(t.TM, 'YYYY') AS YR, " +
|
||||
" TO_CHAR(t.FCNT) AS FCNT, " +
|
||||
" TO_CHAR(t.LENGTH) AS LENGTH, " +
|
||||
" TO_CHAR(t.WIDTH) AS WIDTH, " +
|
||||
" t.FISHSPEED AS FISHSPEED, " +
|
||||
" TO_CHAR(t.DIRECTION) AS DIRECTION, " +
|
||||
" CASE t.DIRECTION WHEN 0 THEN '上行' WHEN 1 THEN '下行' WHEN 2 THEN '上行折返' WHEN 3 THEN '下行折返' END AS DIRECTIONNAME, " +
|
||||
" CASE WHEN t.DIRECTION = 0 THEN t.FCNT END AS UPFCNT, " +
|
||||
" CASE WHEN t.DIRECTION = 1 THEN t.FCNT END AS DOWNFCNT, " +
|
||||
" TO_CHAR(t.TEMPERATURE) AS TEMPERATURE, " +
|
||||
" TO_CHAR(t.SPEED) AS SPEED, " +
|
||||
" t.FIRSTIMGURL AS FIRSTIMGURL, " +
|
||||
" t.VIDEOURL AS VIDEOURL, " +
|
||||
" NULL AS FWET, " +
|
||||
" t.FID AS FID, " +
|
||||
" t.FIRSTIMGURL AS PICPTH, " +
|
||||
" t.VIDEOURL AS VDPTH, " +
|
||||
" '自动识别' AS DATASRC, " +
|
||||
" 2 AS MWAY, " +
|
||||
" t.TM AS STRDT, " +
|
||||
" t.TM AS ENDDT " +
|
||||
" FROM SD_FPSSRL_R t " +
|
||||
" LEFT JOIN SD_FPSS_B_H fp ON fp.STCD = t.STCD " +
|
||||
" LEFT JOIN SD_ENGINFO_B_H eng ON eng.STCD = fp.RSTCD AND NVL(eng.IS_DELETED, 0) = 0 " +
|
||||
" LEFT JOIN V_SD_FISHDICTORY_B c ON t.FTP = c.FISH_ID AND (fp.HBRVCD = c.RVCD OR c.RVCD = 'ZY') " +
|
||||
" WHERE NVL(t.IS_DELETED, 0) = 0 " +
|
||||
" UNION ALL " +
|
||||
" SELECT t.STCD AS STCD, " +
|
||||
" fp.STNM AS STNM, " +
|
||||
" TO_CHAR(t.STRDT, 'YYYY-MM-DD HH24:MI:SS') AS TM, " +
|
||||
" COALESCE(c.NAME, t.FTP ) AS FTP, " +
|
||||
" t.FTP AS FISHID, " +
|
||||
" COALESCE(c.NAME, t.FTP ) AS NAME, " +
|
||||
" t.FSZ AS FSZ, " +
|
||||
" TO_CHAR(t.STRDT, 'YYYY') AS YR, " +
|
||||
" TO_CHAR(t.FCNT) AS FCNT, " +
|
||||
@ -338,50 +476,23 @@ public class FpRunServiceImpl implements FpRunService {
|
||||
" CAST(NULL AS VARCHAR2(255)) AS FIRSTIMGURL, " +
|
||||
" CAST(NULL AS VARCHAR2(255)) AS VIDEOURL, " +
|
||||
" t.FWET AS FWET, " +
|
||||
" t.FID AS FID, " +
|
||||
" CASE WHEN t.AI_STCD IS NULL THEN '人工填报' ELSE aiFp.STNM END AS DATASRC, " +
|
||||
" NULL AS FID, " +
|
||||
" t.PICPTH AS PICPTH, " +
|
||||
" t.VDPTH AS VDPTH, " +
|
||||
" '人工填报' AS DATASRC, " +
|
||||
" 1 AS MWAY, " +
|
||||
" t.STRDT AS STRDT, " +
|
||||
" t.ENDDT AS ENDDT " +
|
||||
" FROM SD_FPSS_R t " +
|
||||
" LEFT JOIN SD_FPSS_B_H fp ON fp.STCD = t.STCD " +
|
||||
" LEFT JOIN SD_FPSS_B_H aiFp ON aiFp.STCD = t.AI_STCD " +
|
||||
" LEFT JOIN SD_ENGINFO_B_H eng ON eng.STCD = fp.RSTCD AND NVL(eng.IS_DELETED, 0) = 0 " +
|
||||
" LEFT JOIN SD_FISHDICTORY_RLTN_B relRv ON relRv.FISH_ID = t.FTP AND relRv.RVCD = eng.HBRVCD AND NVL(relRv.IS_DELETED, 0) = 0 " +
|
||||
" LEFT JOIN SD_FISHDICTORY_B fishRv ON fishRv.ID = relRv.ZY_FISH_ID AND NVL(fishRv.IS_DELETED, 0) = 0 AND NVL(fishRv.ENABLE, 1) = 1 " +
|
||||
" LEFT JOIN SD_FISHDICTORY_RLTN_B relZy ON relZy.FISH_ID = t.FTP AND relZy.RVCD = 'ZY' AND NVL(relZy.IS_DELETED, 0) = 0 " +
|
||||
" LEFT JOIN SD_FISHDICTORY_B fishZy ON fishZy.ID = relZy.ZY_FISH_ID AND NVL(fishZy.IS_DELETED, 0) = 0 AND NVL(fishZy.ENABLE, 1) = 1 " +
|
||||
" LEFT JOIN SD_FISHDICTORY_B fishDirect ON fishDirect.ID = t.FTP AND NVL(fishDirect.IS_DELETED, 0) = 0 AND NVL(fishDirect.ENABLE, 1) = 1 " +
|
||||
" WHERE (t.TASK_STATUS = 'Approved' OR t.TASK_STATUS IS NULL) " +
|
||||
" AND NVL(t.IS_DELETED, 0) = 0 " +
|
||||
" UNION ALL " +
|
||||
" SELECT CAST(NULL AS VARCHAR2(36)) AS STCD, " +
|
||||
" CAST(NULL AS VARCHAR2(64)) AS STNM, " +
|
||||
" CAST(NULL AS VARCHAR2(19)) AS TM, " +
|
||||
" CAST(NULL AS VARCHAR2(255)) AS FTP, " +
|
||||
" CAST(NULL AS VARCHAR2(200)) AS FISHID, " +
|
||||
" CAST(NULL AS VARCHAR2(256)) AS FSZ, " +
|
||||
" CAST(NULL AS VARCHAR2(4)) AS YR, " +
|
||||
" CAST(NULL AS VARCHAR2(20)) AS FCNT, " +
|
||||
" CAST(NULL AS VARCHAR2(50)) AS LENGTH, " +
|
||||
" CAST(NULL AS VARCHAR2(50)) AS WIDTH, " +
|
||||
" CAST(NULL AS VARCHAR2(50)) AS FISHSPEED, " +
|
||||
" CAST(NULL AS VARCHAR2(10)) AS DIRECTION, " +
|
||||
" CAST(NULL AS VARCHAR2(20)) AS DIRECTIONNAME, " +
|
||||
" CAST(NULL AS NUMBER(18,0)) AS UPFCNT, " +
|
||||
" CAST(NULL AS NUMBER(18,0)) AS DOWNFCNT, " +
|
||||
" CAST(NULL AS VARCHAR2(50)) AS TEMPERATURE, " +
|
||||
" CAST(NULL AS VARCHAR2(50)) AS SPEED, " +
|
||||
" CAST(NULL AS VARCHAR2(255)) AS FIRSTIMGURL, " +
|
||||
" CAST(NULL AS VARCHAR2(255)) AS VIDEOURL, " +
|
||||
" CAST(NULL AS VARCHAR2(50)) AS FWET, " +
|
||||
" CAST(NULL AS VARCHAR2(1000)) AS FID, " +
|
||||
" CAST(NULL AS VARCHAR2(64)) AS DATASRC, " +
|
||||
" 2 AS MWAY, " +
|
||||
" CAST(NULL AS TIMESTAMP) AS STRDT, " +
|
||||
" CAST(NULL AS TIMESTAMP) AS ENDDT " +
|
||||
" FROM DUAL WHERE 1 = 0 " +
|
||||
") manualData";
|
||||
" LEFT JOIN V_SD_FISHDICTORY_B c ON t.FTP = c.FISH_ID AND (fp.HBRVCD = c.RVCD OR c.RVCD = 'ZY') " +
|
||||
" WHERE NVL(t.IS_DELETED, 0) = 0 " +
|
||||
") src";
|
||||
}
|
||||
|
||||
private String buildFishDictionaryDisplayExpr(String rvAlias, String zyAlias, String fishFieldExpr) {
|
||||
return "COALESCE(" + rvAlias + ".NAME, " + zyAlias + ".NAME, " + fishFieldExpr + ")";
|
||||
}
|
||||
|
||||
private String buildQgcFpssTableDetailSelectSql(List<String> selectFields) {
|
||||
@ -390,6 +501,7 @@ public class FpRunServiceImpl implements FpRunService {
|
||||
selectMap.put("stnm", "t.stnm AS stnm");
|
||||
selectMap.put("tm", "t.tm AS tm");
|
||||
selectMap.put("ftp", "t.ftp AS ftp");
|
||||
selectMap.put("ftpName", "t.ftpName AS ftpName");
|
||||
selectMap.put("fishId", "t.fishId AS fishId");
|
||||
selectMap.put("fsz", "t.fsz AS fsz");
|
||||
selectMap.put("yr", "t.yr AS yr");
|
||||
@ -405,6 +517,8 @@ public class FpRunServiceImpl implements FpRunService {
|
||||
selectMap.put("videourl", "t.videourl AS videourl");
|
||||
selectMap.put("fwet", "t.fwet AS fwet");
|
||||
selectMap.put("fid", "t.fid AS fid");
|
||||
selectMap.put("picpth", "t.picpth AS picpth");
|
||||
selectMap.put("vdpth", "t.vdpth AS vdpth");
|
||||
selectMap.put("upFcnt", "t.upFcnt AS upFcnt");
|
||||
selectMap.put("downFcnt", "t.downFcnt AS downFcnt");
|
||||
selectMap.put("dataSrc", "t.dataSrc AS dataSrc");
|
||||
@ -567,6 +681,8 @@ public class FpRunServiceImpl implements FpRunService {
|
||||
case "speed" -> "t.SPEED";
|
||||
case "firstimgurl" -> "t.FIRSTIMGURL";
|
||||
case "videourl" -> "t.VIDEOURL";
|
||||
case "vdpth" -> "t.VDPTH";
|
||||
case "picpth" -> "t.PICPTH";
|
||||
case "fwet" -> "t.FWET";
|
||||
case "fid" -> "t.FID";
|
||||
case "upFcnt" -> "t.UPFCNT";
|
||||
@ -620,6 +736,28 @@ public class FpRunServiceImpl implements FpRunService {
|
||||
return orders.isEmpty() ? "" : " ORDER BY " + String.join(", ", orders);
|
||||
}
|
||||
|
||||
private String buildQgcFpssTableAggregateOrderBySql(List<DataSourceRequest.SortDescriptor> sortList) {
|
||||
if (CollUtil.isEmpty(sortList)) {
|
||||
return " ORDER BY yr DESC";
|
||||
}
|
||||
List<String> orderColumns = new ArrayList<>();
|
||||
for (DataSourceRequest.SortDescriptor sortDescriptor : sortList) {
|
||||
if (sortDescriptor == null || StrUtil.isBlank(sortDescriptor.getField())) {
|
||||
continue;
|
||||
}
|
||||
String field = sortDescriptor.getField();
|
||||
if (!"yr".equals(field) && !"ftp".equals(field) && !"fsz".equals(field) && !"fcnt".equals(field)) {
|
||||
continue;
|
||||
}
|
||||
String dir = "desc".equalsIgnoreCase(sortDescriptor.getDir()) || "des".equalsIgnoreCase(sortDescriptor.getDir()) ? "DESC" : "ASC";
|
||||
orderColumns.add(field + " " + dir + " NULLS LAST");
|
||||
}
|
||||
if (orderColumns.isEmpty()) {
|
||||
return " ORDER BY yr DESC";
|
||||
}
|
||||
return " ORDER BY " + String.join(", ", orderColumns);
|
||||
}
|
||||
|
||||
private DataSourceResult<FpSdfpssrVo> queryQgcSdfpssrDetailList(DataSourceRequest dataSourceRequest,
|
||||
DataSourceLoadOptionsBase loadOptions) {
|
||||
StringBuilder sql = new StringBuilder();
|
||||
@ -737,8 +875,11 @@ public class FpRunServiceImpl implements FpRunService {
|
||||
"t.FTP AS fishId, " +
|
||||
"t.FCNT AS fcnt, " +
|
||||
"t.FSZ AS fsz, " +
|
||||
"t.FID AS fid, " +
|
||||
"NULL AS fid, " +
|
||||
"t.PICPTH AS picpth, " +
|
||||
"t.VDPTH AS vdpth, " +
|
||||
"t.DIRECTION AS direction, " +
|
||||
" CASE t.DIRECTION WHEN 0 THEN '上行' WHEN 1 THEN '下行' WHEN 2 THEN '上行折返' WHEN 3 THEN '下行折返' END AS directionName, " +
|
||||
"1 AS mway, " +
|
||||
"t.STRDT AS strdt, " +
|
||||
"t.ENDDT AS enddt, " +
|
||||
@ -790,7 +931,10 @@ public class FpRunServiceImpl implements FpRunService {
|
||||
selectMap.put("fcnt", "t.fcnt AS fcnt");
|
||||
selectMap.put("fsz", "t.fsz AS fsz");
|
||||
selectMap.put("fid", "t.fid AS fid");
|
||||
selectMap.put("picpth", "t.picpth AS picpth");
|
||||
selectMap.put("vdpth", "t.vdpth AS vdpth");
|
||||
selectMap.put("direction", "t.direction AS direction");
|
||||
selectMap.put("directionName", "t.directionName AS directionName");
|
||||
selectMap.put("mway", "t.mway AS mway");
|
||||
selectMap.put("strdt", "t.strdt AS strdt");
|
||||
selectMap.put("enddt", "t.enddt AS enddt");
|
||||
@ -949,7 +1093,10 @@ public class FpRunServiceImpl implements FpRunService {
|
||||
case "fcnt" -> "t.FCNT";
|
||||
case "fsz" -> "t.FSZ";
|
||||
case "fid" -> "t.FID";
|
||||
case "picpth" -> "t.PICPTH";
|
||||
case "vdpth" -> "t.VDPTH";
|
||||
case "direction" -> "t.DIRECTION";
|
||||
case "directionName" -> "t.DIRECTIONNAME";
|
||||
case "mway" -> "t.MWAY";
|
||||
case "strdt" -> "t.STRDT";
|
||||
case "enddt" -> "t.ENDDT";
|
||||
@ -1009,6 +1156,226 @@ public class FpRunServiceImpl implements FpRunService {
|
||||
};
|
||||
}
|
||||
|
||||
private String buildQgcFpRunAnalysisStationSql() {
|
||||
return "SELECT fp.RSTCD AS rstcd, eng.HBRVCD AS hbrvcd " +
|
||||
"FROM SD_FPSS_B_H fp " +
|
||||
"LEFT JOIN SD_ENGINFO_B_H eng ON eng.STCD = fp.RSTCD AND NVL(eng.IS_DELETED, 0) = 0 " +
|
||||
"WHERE fp.STCD = #{map.stcd} " +
|
||||
"AND ROWNUM = 1";
|
||||
}
|
||||
|
||||
private String buildQgcFpRunAnalysisAlongSql() {
|
||||
return "SELECT t2.STCD AS stcd, t2.STTP AS sttpCode " +
|
||||
"FROM MS_ALONG_B t1 " +
|
||||
"INNER JOIN MS_ALONGDET_B t2 ON t1.ID = t2.ALONG_ID " +
|
||||
"WHERE t1.CODE = 'common' " +
|
||||
" AND t1.RVCD = #{map.hbrvcd} " +
|
||||
" AND t2.RSTCD = #{map.rstcd} " +
|
||||
" AND t2.STTP IN ('WTRV', 'WQ') " +
|
||||
" AND NVL(t1.IS_DELETED, 0) = 0 " +
|
||||
" AND NVL(t2.IS_DELETED, 0) = 0 " +
|
||||
"ORDER BY NVL(t2.SORT, 999999), t2.STCD";
|
||||
}
|
||||
|
||||
private String buildQgcFpRunAnalysisDataSql(List<DataSourceRequest.SortDescriptor> sortList) {
|
||||
return "SELECT t.DT AS dt, " +
|
||||
" t.FTP AS ftp, " +
|
||||
" t.FCNT AS fcnt, " +
|
||||
" t.WT AS wt, " +
|
||||
" t.CODCR AS codcr, " +
|
||||
" t.NH3N AS nh3n, " +
|
||||
" t.TP AS tp, " +
|
||||
" t.TN AS tn, " +
|
||||
" t.DZ AS dz, " +
|
||||
" t.RZ AS rz, " +
|
||||
" t.QI AS qi, " +
|
||||
" t.QO AS qo " +
|
||||
"FROM ( " +
|
||||
" SELECT t1.DT AS DT, " +
|
||||
" t2.FTP AS FTP, " +
|
||||
" t2.FCNT AS FCNT, " +
|
||||
" t3.WT AS WT, " +
|
||||
" t4.CODCR AS CODCR, " +
|
||||
" t4.NH3N AS NH3N, " +
|
||||
" t4.TP AS TP, " +
|
||||
" t4.TN AS TN, " +
|
||||
" t5.DZ AS DZ, " +
|
||||
" t5.RZ AS RZ, " +
|
||||
" t5.QI AS QI, " +
|
||||
" t5.QO AS QO " +
|
||||
" FROM ( " +
|
||||
" SELECT TO_CHAR(TO_DATE(#{map.startTime}, 'YYYY-MM-DD HH24:MI:SS') + LEVEL - 1, 'YYYY-MM-DD') AS DT " +
|
||||
" FROM DUAL " +
|
||||
" CONNECT BY LEVEL <= TO_DATE(#{map.endTime}, 'YYYY-MM-DD HH24:MI:SS') - TO_DATE(#{map.startTime}, 'YYYY-MM-DD HH24:MI:SS') + 1 " +
|
||||
" ) t1 " +
|
||||
" LEFT JOIN ( " +
|
||||
buildQgcFpRunAnalysisFishSql() +
|
||||
" ) t2 ON t1.DT = t2.DT " +
|
||||
" LEFT JOIN ( " +
|
||||
buildQgcFpRunAnalysisWtSql() +
|
||||
" ) t3 ON t1.DT = t3.DT " +
|
||||
" LEFT JOIN ( " +
|
||||
buildQgcFpRunAnalysisWqSql() +
|
||||
" ) t4 ON t1.DT = t4.DT " +
|
||||
" LEFT JOIN ( " +
|
||||
buildQgcFpRunAnalysisEngSql() +
|
||||
" ) t5 ON t1.DT = t5.DT " +
|
||||
") t " +
|
||||
"WHERE (t.FTP IS NOT NULL OR t.FCNT IS NOT NULL OR t.WT IS NOT NULL OR t.CODCR IS NOT NULL OR t.NH3N IS NOT NULL OR t.TP IS NOT NULL OR t.TN IS NOT NULL OR t.DZ IS NOT NULL OR t.RZ IS NOT NULL OR t.QI IS NOT NULL OR t.QO IS NOT NULL) " +
|
||||
buildQgcFpRunAnalysisOrderBySql(sortList);
|
||||
}
|
||||
|
||||
private String buildQgcFpRunAnalysisFishSql() {
|
||||
return "SELECT t.DT AS DT, t.FTP AS FTP, t.FCNT AS FCNT FROM ( " +
|
||||
buildQgcFpRunAnalysisManualFishSql() +
|
||||
" UNION ALL " +
|
||||
buildQgcFpRunAnalysisAutoFishSql() +
|
||||
" ) t";
|
||||
}
|
||||
|
||||
private String buildQgcFpRunAnalysisManualFishSql() {
|
||||
return "SELECT TO_CHAR(src.STRDT, 'YYYY-MM-DD') AS DT, " +
|
||||
" src.FTP AS FTP, " +
|
||||
" SUM(src.FCNT) AS FCNT " +
|
||||
"FROM ( " +
|
||||
" SELECT t.STRDT AS STRDT, " +
|
||||
" t.FCNT AS FCNT, " +
|
||||
" COALESCE(fishRv.NAME, relRv.FISH_NAME, fishZy.NAME, relZy.FISH_NAME, fishDirect.NAME, t.FTP) AS FTP " +
|
||||
" FROM SD_FPSS_R t " +
|
||||
" INNER JOIN SD_FPSS_B_H fp ON fp.STCD = t.STCD " +
|
||||
" LEFT JOIN SD_ENGINFO_B_H eng ON eng.STCD = fp.RSTCD AND NVL(eng.IS_DELETED, 0) = 0 " +
|
||||
" LEFT JOIN SD_FISHDICTORY_RLTN_B relRv ON relRv.FISH_ID = t.FTP " +
|
||||
" AND relRv.RVCD = eng.HBRVCD " +
|
||||
" AND NVL(relRv.IS_DELETED, 0) = 0 " +
|
||||
" LEFT JOIN SD_FISHDICTORY_B fishRv ON fishRv.ID = relRv.ZY_FISH_ID " +
|
||||
" AND NVL(fishRv.IS_DELETED, 0) = 0 " +
|
||||
" AND NVL(fishRv.ENABLE, 1) = 1 " +
|
||||
" LEFT JOIN SD_FISHDICTORY_RLTN_B relZy ON relZy.FISH_ID = t.FTP " +
|
||||
" AND relZy.RVCD = 'ZY' " +
|
||||
" AND NVL(relZy.IS_DELETED, 0) = 0 " +
|
||||
" LEFT JOIN SD_FISHDICTORY_B fishZy ON fishZy.ID = relZy.ZY_FISH_ID " +
|
||||
" AND NVL(fishZy.IS_DELETED, 0) = 0 " +
|
||||
" AND NVL(fishZy.ENABLE, 1) = 1 " +
|
||||
" LEFT JOIN SD_FISHDICTORY_B fishDirect ON fishDirect.ID = t.FTP " +
|
||||
" AND NVL(fishDirect.IS_DELETED, 0) = 0 " +
|
||||
" AND NVL(fishDirect.ENABLE, 1) = 1 " +
|
||||
" WHERE t.STCD = #{map.stcd} " +
|
||||
" AND t.STRDT >= TO_DATE(#{map.startTime}, 'YYYY-MM-DD HH24:MI:SS') " +
|
||||
" AND t.STRDT <= TO_DATE(#{map.endTime}, 'YYYY-MM-DD HH24:MI:SS') " +
|
||||
" AND NVL(t.IS_DELETED, 0) = 0 " +
|
||||
") src " +
|
||||
"WHERE src.FTP = #{map.ftp} " +
|
||||
"GROUP BY TO_CHAR(src.STRDT, 'YYYY-MM-DD'), src.FTP";
|
||||
}
|
||||
|
||||
// The automatic branch is reserved intentionally until the new equivalent table is provided.
|
||||
private String buildQgcFpRunAnalysisAutoFishSql() {
|
||||
return "SELECT CAST(NULL AS VARCHAR2(10)) AS DT, " +
|
||||
" CAST(NULL AS VARCHAR2(255)) AS FTP, " +
|
||||
" CAST(NULL AS NUMBER(18, 2)) AS FCNT " +
|
||||
"FROM DUAL WHERE 1 = 0";
|
||||
}
|
||||
|
||||
private String buildQgcFpRunAnalysisWtSql() {
|
||||
return "SELECT TO_CHAR(t.DT, 'YYYY-MM-DD') AS DT, " +
|
||||
" ROUND(AVG(t.WT), 2) AS WT " +
|
||||
"FROM SD_WTRVDAY_S t " +
|
||||
"WHERE t.STCD = #{map.wtrvStcd} " +
|
||||
" AND t.DT >= TO_DATE(#{map.startTime}, 'YYYY-MM-DD HH24:MI:SS') " +
|
||||
" AND t.DT <= TO_DATE(#{map.endTime}, 'YYYY-MM-DD HH24:MI:SS') " +
|
||||
" AND NVL(t.IS_DELETED, 0) = 0 " +
|
||||
"GROUP BY TO_CHAR(t.DT, 'YYYY-MM-DD')";
|
||||
}
|
||||
|
||||
private String buildQgcFpRunAnalysisWqSql() {
|
||||
return "SELECT TO_CHAR(t.DT, 'YYYY-MM-DD') AS DT, " +
|
||||
" ROUND(AVG(t.CODCR), 2) AS CODCR, " +
|
||||
" ROUND(AVG(t.NH3N), 2) AS NH3N, " +
|
||||
" ROUND(AVG(t.TP), 2) AS TP, " +
|
||||
" ROUND(AVG(t.TN), 2) AS TN " +
|
||||
"FROM SD_WQDAY_S t " +
|
||||
"WHERE t.STCD = #{map.wqStcd} " +
|
||||
" AND t.DT >= TO_DATE(#{map.startTime}, 'YYYY-MM-DD HH24:MI:SS') " +
|
||||
" AND t.DT <= TO_DATE(#{map.endTime}, 'YYYY-MM-DD HH24:MI:SS') " +
|
||||
" AND NVL(t.IS_DELETED, 0) = 0 " +
|
||||
"GROUP BY TO_CHAR(t.DT, 'YYYY-MM-DD')";
|
||||
}
|
||||
|
||||
private String buildQgcFpRunAnalysisEngSql() {
|
||||
return "SELECT TO_CHAR(TRUNC(t.TM), 'YYYY-MM-DD') AS DT, " +
|
||||
" ROUND(AVG(t.DZ), 2) AS DZ, " +
|
||||
" ROUND(AVG(t.RZ), 2) AS RZ, " +
|
||||
" ROUND(AVG(t.QI), 2) AS QI, " +
|
||||
" ROUND(AVG(t.QO), 2) AS QO " +
|
||||
"FROM SD_HYDROPW_R t " +
|
||||
"WHERE t.STCD = #{map.rstcd} " +
|
||||
" AND t.TM >= TO_DATE(#{map.startTime}, 'YYYY-MM-DD HH24:MI:SS') " +
|
||||
" AND t.TM <= TO_DATE(#{map.endTime}, 'YYYY-MM-DD HH24:MI:SS') " +
|
||||
" AND NVL(t.IS_DELETED, 0) = 0 " +
|
||||
"GROUP BY TRUNC(t.TM)";
|
||||
}
|
||||
|
||||
private String buildQgcFpRunAnalysisOrderBySql(List<DataSourceRequest.SortDescriptor> sortList) {
|
||||
if (CollUtil.isEmpty(sortList)) {
|
||||
return " ORDER BY t.DT";
|
||||
}
|
||||
List<String> orderColumns = new ArrayList<>();
|
||||
for (DataSourceRequest.SortDescriptor sortDescriptor : sortList) {
|
||||
if (sortDescriptor == null || StrUtil.isBlank(sortDescriptor.getField())) {
|
||||
continue;
|
||||
}
|
||||
String column = mapQgcFpRunAnalysisColumn(sortDescriptor.getField());
|
||||
if (StrUtil.isBlank(column)) {
|
||||
continue;
|
||||
}
|
||||
String dir = "desc".equalsIgnoreCase(sortDescriptor.getDir()) || "des".equalsIgnoreCase(sortDescriptor.getDir()) ? "DESC" : "ASC";
|
||||
orderColumns.add(column + " " + dir + " NULLS LAST");
|
||||
}
|
||||
if (orderColumns.isEmpty()) {
|
||||
return " ORDER BY t.DT";
|
||||
}
|
||||
return " ORDER BY " + String.join(", ", orderColumns);
|
||||
}
|
||||
|
||||
private String mapQgcFpRunAnalysisColumn(String field) {
|
||||
if (StrUtil.isBlank(field)) {
|
||||
return null;
|
||||
}
|
||||
return switch (field) {
|
||||
case "dt" -> "t.DT";
|
||||
case "ftp" -> "t.FTP";
|
||||
case "fcnt" -> "t.FCNT";
|
||||
case "wt" -> "t.WT";
|
||||
case "codcr" -> "t.CODCR";
|
||||
case "nh3n" -> "t.NH3N";
|
||||
case "tp" -> "t.TP";
|
||||
case "tn" -> "t.TN";
|
||||
case "dz" -> "t.DZ";
|
||||
case "rz" -> "t.RZ";
|
||||
case "qi" -> "t.QI";
|
||||
case "qo" -> "t.QO";
|
||||
default -> null;
|
||||
};
|
||||
}
|
||||
|
||||
private List<FpRunAnalysisHeadColumnVo> buildQgcFpRunAnalysisColumns(String ftpName) {
|
||||
List<FpRunAnalysisHeadColumnVo> columns = new ArrayList<>();
|
||||
columns.add(new FpRunAnalysisHeadColumnVo("dt", "时间", true, "dt", false, new ArrayList<>())
|
||||
.setDataType("date")
|
||||
.setDataFormat("yyyy-MM-DD"));
|
||||
columns.add(new FpRunAnalysisHeadColumnVo("fcnt", ftpName + "(尾)", true, "fcnt", false, new ArrayList<>()));
|
||||
columns.add(new FpRunAnalysisHeadColumnVo("wt", "出库水温(℃)", true, "wt", false, new ArrayList<>()));
|
||||
columns.add(new FpRunAnalysisHeadColumnVo("codcr", "化学需氧量(mg/L)", true, "codcr", false, new ArrayList<>()));
|
||||
columns.add(new FpRunAnalysisHeadColumnVo("nh3n", "氨氮(mg/L)", true, "nh3n", false, new ArrayList<>()));
|
||||
columns.add(new FpRunAnalysisHeadColumnVo("tp", "总磷(mg/L)", true, "tp", false, new ArrayList<>()));
|
||||
columns.add(new FpRunAnalysisHeadColumnVo("tn", "总氮(mg/L)", true, "tn", false, new ArrayList<>()));
|
||||
columns.add(new FpRunAnalysisHeadColumnVo("qi", "入库流量(m³/s)", true, "qi", false, new ArrayList<>()));
|
||||
columns.add(new FpRunAnalysisHeadColumnVo("qo", "出库流量(m³/s)", true, "qo", false, new ArrayList<>()));
|
||||
columns.add(new FpRunAnalysisHeadColumnVo("rz", "坝上水位(m)", true, "rz", false, new ArrayList<>()));
|
||||
columns.add(new FpRunAnalysisHeadColumnVo("dz", "坝下水位(m)", true, "dz", false, new ArrayList<>()));
|
||||
return columns;
|
||||
}
|
||||
|
||||
private List<Object> normalizeValues(Object value) {
|
||||
if (value == null) {
|
||||
return new ArrayList<>();
|
||||
@ -1141,6 +1508,38 @@ public class FpRunServiceImpl implements FpRunService {
|
||||
"ORDER BY eng.BASE_ID, a.FTP";
|
||||
}
|
||||
|
||||
private String buildFpFishSelectSql() {
|
||||
return "SELECT DISTINCT t.ID AS id, t.NAME AS name " +
|
||||
"FROM ( " +
|
||||
" SELECT a.FTP AS ID, " +
|
||||
" COALESCE(fishRv.NAME, relRv.FISH_NAME, fishZy.NAME, relZy.FISH_NAME, fishDirect.NAME) AS NAME " +
|
||||
" FROM SD_FPSS_R a " +
|
||||
" INNER JOIN SD_FPSS_B_H fp ON fp.STCD = a.STCD " +
|
||||
" LEFT JOIN SD_ENGINFO_B_H eng ON eng.STCD = fp.RSTCD AND NVL(eng.IS_DELETED, 0) = 0 " +
|
||||
" LEFT JOIN SD_FISHDICTORY_RLTN_B relRv ON relRv.FISH_ID = a.FTP " +
|
||||
" AND relRv.RVCD = eng.HBRVCD " +
|
||||
" AND NVL(relRv.IS_DELETED, 0) = 0 " +
|
||||
" LEFT JOIN SD_FISHDICTORY_B fishRv ON fishRv.ID = NVL(relRv.ZY_FISH_ID, relRv.FISH_ID) " +
|
||||
" AND NVL(fishRv.IS_DELETED, 0) = 0 " +
|
||||
" AND NVL(fishRv.ENABLE, 1) = 1 " +
|
||||
" LEFT JOIN SD_FISHDICTORY_RLTN_B relZy ON relZy.FISH_ID = a.FTP " +
|
||||
" AND relZy.RVCD = 'ZY' " +
|
||||
" AND NVL(relZy.IS_DELETED, 0) = 0 " +
|
||||
" LEFT JOIN SD_FISHDICTORY_B fishZy ON fishZy.ID = NVL(relZy.ZY_FISH_ID, relZy.FISH_ID) " +
|
||||
" AND NVL(fishZy.IS_DELETED, 0) = 0 " +
|
||||
" AND NVL(fishZy.ENABLE, 1) = 1 " +
|
||||
" LEFT JOIN SD_FISHDICTORY_B fishDirect ON fishDirect.ID = a.FTP " +
|
||||
" AND NVL(fishDirect.IS_DELETED, 0) = 0 " +
|
||||
" AND NVL(fishDirect.ENABLE, 1) = 1 " +
|
||||
" WHERE NVL(a.IS_DELETED, 0) = 0 " +
|
||||
" AND a.STCD = #{map.stcd} " +
|
||||
" AND a.STRDT >= TO_DATE(#{map.tmStart}, 'YYYY-MM-DD HH24:MI:SS') " +
|
||||
" AND a.STRDT <= TO_DATE(#{map.tmEnd}, 'YYYY-MM-DD HH24:MI:SS') " +
|
||||
") t " +
|
||||
"WHERE t.NAME IS NOT NULL " +
|
||||
"ORDER BY t.NAME";
|
||||
}
|
||||
|
||||
private String resolveFallbackFishText(String fallbackFishJson, String fallbackFishText) {
|
||||
if (StrUtil.isNotBlank(fallbackFishJson)) {
|
||||
Set<String> fishNames = new LinkedHashSet<>();
|
||||
|
||||
@ -0,0 +1,73 @@
|
||||
package com.yfd.platform.qgc_env.fpr.controller;
|
||||
|
||||
import com.yfd.platform.common.DataSourceRequest;
|
||||
import com.yfd.platform.config.ResponseResult;
|
||||
import com.yfd.platform.qgc_env.fpr.entity.ao.FprdRunDataAo;
|
||||
import com.yfd.platform.qgc_eng.eq.service.EngEqDataService;
|
||||
import com.yfd.platform.qgc_env.fpr.entity.vo.FprFtpChangeInfoVo;
|
||||
import com.yfd.platform.qgc_env.fpr.entity.vo.FprdRunDataInfoVo;
|
||||
import com.yfd.platform.qgc_env.fpr.entity.vo.FprZyFishDicVo;
|
||||
import com.yfd.platform.qgc_env.fpr.service.FprMonitorService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.annotation.Resource;
|
||||
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;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/fpr")
|
||||
@Tag(name = "鱼类调查装置站基础信息")
|
||||
@Validated
|
||||
public class FprMonitorController {
|
||||
|
||||
@Resource
|
||||
private FprMonitorService fprMonitorService;
|
||||
|
||||
@Resource
|
||||
private EngEqDataService engEqDataService;
|
||||
|
||||
|
||||
@PostMapping("/msstbprpt/GetKendoList")
|
||||
@Operation(summary = "鱼类调查装置站基础列表")
|
||||
public ResponseResult getMsstbprptList(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||
return ResponseResult.successData(fprMonitorService.getMsstbprptList(dataSourceRequest));
|
||||
}
|
||||
|
||||
@PostMapping("/fishDic/GetKendoList")
|
||||
@Operation(summary = "鱼类字典列表")
|
||||
public ResponseResult getFishDicList(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||
return ResponseResult.successData(fprMonitorService.getFishDicList(dataSourceRequest));
|
||||
}
|
||||
|
||||
@PostMapping("/fishDic/zy/GetKendoList")
|
||||
@Operation(summary = "总院鱼类字典列表")
|
||||
public ResponseResult getZyFishDicList(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||
return ResponseResult.successData(fprMonitorService.getZyFishDicList(dataSourceRequest));
|
||||
}
|
||||
|
||||
@PostMapping("/sdFprdR/getFprdDataInfo")
|
||||
@Operation(summary = "获取鱼类调查装置概况")
|
||||
public ResponseResult getFprdRunDataInfo(@RequestBody FprdRunDataAo ao) {
|
||||
FprdRunDataInfoVo result = fprMonitorService.getFprdRunDataInfo(ao);
|
||||
return ResponseResult.successData(result);
|
||||
}
|
||||
|
||||
@PostMapping("/sdFprdR/getFtpChangeInfo")
|
||||
@Operation(summary = "获取鱼类变化情况")
|
||||
public ResponseResult getFtpChangeInfo(@RequestBody FprdRunDataAo ao) {
|
||||
List<FprFtpChangeInfoVo> result = fprMonitorService.getFtpChangeInfo(ao);
|
||||
return ResponseResult.successData(result);
|
||||
}
|
||||
|
||||
@PostMapping("/wbsb/GetKendoList")
|
||||
@Operation(summary = "查询基地/基地流域树数据")
|
||||
public ResponseResult getWbsbList(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||
return ResponseResult.successData(engEqDataService.getWbsbList(dataSourceRequest));
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,21 @@
|
||||
package com.yfd.platform.qgc_env.fpr.entity.ao;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@Schema(description = "鱼类调查装置概况查询参数")
|
||||
public class FprdRunDataAo {
|
||||
|
||||
@Schema(description = "基地编码")
|
||||
private String baseId;
|
||||
|
||||
@Schema(description = "基地流域编码")
|
||||
private String hbrvcd;
|
||||
|
||||
@Schema(description = "站点编码,旧接口保留字段")
|
||||
private String stcd;
|
||||
|
||||
@Schema(description = "年度")
|
||||
private Integer year;
|
||||
}
|
||||
@ -0,0 +1,73 @@
|
||||
package com.yfd.platform.qgc_env.fpr.entity.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@Schema(description = "鱼类字典信息")
|
||||
public class FprFishDicVo {
|
||||
|
||||
private String id;
|
||||
private String code;
|
||||
private String name;
|
||||
private String nameEn;
|
||||
private String alias;
|
||||
private String logo;
|
||||
private String introduce;
|
||||
private String inffile;
|
||||
private String orders;
|
||||
private String family;
|
||||
private String genus;
|
||||
private String species;
|
||||
private Integer type;
|
||||
private String typeName;
|
||||
private String fsz;
|
||||
private Integer rare;
|
||||
private String rareName;
|
||||
private Integer specOrigin;
|
||||
private String specOriginName;
|
||||
private Integer ptype;
|
||||
private String ptypeName;
|
||||
private String rvcd;
|
||||
private String rvcdName;
|
||||
private String habitMigrat;
|
||||
private String feedingHabit;
|
||||
private String spawnCharact;
|
||||
private String food;
|
||||
private String timeFeed;
|
||||
private String orignDate;
|
||||
private String pretemp;
|
||||
private String flowRate;
|
||||
private String depth;
|
||||
private String botmMater;
|
||||
private String wqtq;
|
||||
private String wqtqName;
|
||||
private Integer habitat;
|
||||
private String habitatName;
|
||||
private Integer situation;
|
||||
private String situationName;
|
||||
private Integer resourceType;
|
||||
private String resourceTypeName;
|
||||
private String shapedesc;
|
||||
private String protectlvl;
|
||||
private String habitation;
|
||||
private String fid;
|
||||
private String description;
|
||||
private Integer enable;
|
||||
private String enableName;
|
||||
private Integer internal;
|
||||
private String internalName;
|
||||
private Integer orderIndex;
|
||||
private String recordUser;
|
||||
private Date recordTime;
|
||||
private String modifyUser;
|
||||
private Date modifyTime;
|
||||
private Integer isDeleted;
|
||||
private String deleteUser;
|
||||
private Date deleteTime;
|
||||
private String spawnMonth;
|
||||
private String vlsr;
|
||||
private Date vlsrTm;
|
||||
}
|
||||
@ -0,0 +1,21 @@
|
||||
package com.yfd.platform.qgc_env.fpr.entity.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@Schema(description = "鱼类变化情况")
|
||||
public class FprFtpChangeInfoVo {
|
||||
|
||||
@Schema(description = "鱼种类数量")
|
||||
private String ftpCount;
|
||||
|
||||
@Schema(description = "鱼数量")
|
||||
private Integer fishCount;
|
||||
|
||||
@Schema(description = "月")
|
||||
private Integer month;
|
||||
|
||||
@Schema(description = "年份")
|
||||
private Integer year;
|
||||
}
|
||||
@ -0,0 +1,170 @@
|
||||
package com.yfd.platform.qgc_env.fpr.entity.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@Schema(description = "鱼类调查装置站基础信息")
|
||||
public class FprMsstbprptVo {
|
||||
|
||||
@Schema(description = "主键ID")
|
||||
private String id;
|
||||
|
||||
@Schema(description = "是否删除")
|
||||
private Integer isDeleted;
|
||||
|
||||
@Schema(description = "站点编码")
|
||||
private String stcd;
|
||||
|
||||
@Schema(description = "站点名称")
|
||||
private String stnm;
|
||||
|
||||
@Schema(description = "站类")
|
||||
private String sttp;
|
||||
|
||||
@Schema(description = "站类编码")
|
||||
private String sttpCode;
|
||||
|
||||
@Schema(description = "站类名称")
|
||||
private String sttpName;
|
||||
|
||||
@Schema(description = "站类全路径")
|
||||
private String sttpFullPath;
|
||||
|
||||
@Schema(description = "站类层级")
|
||||
private Integer sttpTreeLevel;
|
||||
|
||||
@Schema(description = "数据时间")
|
||||
private Date tm;
|
||||
|
||||
@Schema(description = "经度")
|
||||
private Double lgtd;
|
||||
|
||||
@Schema(description = "纬度")
|
||||
private Double lttd;
|
||||
|
||||
@Schema(description = "高程")
|
||||
private Double elev;
|
||||
|
||||
@Schema(description = "站址")
|
||||
private String stlc;
|
||||
|
||||
@Schema(description = "建成日期")
|
||||
private Date jcdt;
|
||||
|
||||
@Schema(description = "退役日期")
|
||||
private Date wddt;
|
||||
|
||||
@Schema(description = "简介")
|
||||
private String introduce;
|
||||
|
||||
@Schema(description = "LOGO")
|
||||
private String logo;
|
||||
|
||||
@Schema(description = "介绍弹窗图片")
|
||||
private String inffile;
|
||||
|
||||
@Schema(description = "是否启用")
|
||||
private Integer usfl;
|
||||
|
||||
@Schema(description = "是否接入")
|
||||
private Integer dtin;
|
||||
|
||||
@Schema(description = "是否接入名称")
|
||||
private String dtinName;
|
||||
|
||||
@Schema(description = "接入开始时间")
|
||||
private Date dtinTm;
|
||||
|
||||
@Schema(description = "监测方式")
|
||||
private Integer mway;
|
||||
|
||||
@Schema(description = "监测方式名称")
|
||||
private String mwayName;
|
||||
|
||||
@Schema(description = "监测指标")
|
||||
private String stindx;
|
||||
|
||||
@Schema(description = "排序")
|
||||
private Integer orderIndex;
|
||||
|
||||
@Schema(description = "所属电站编码")
|
||||
private String rstcd;
|
||||
|
||||
@Schema(description = "所属电站名称")
|
||||
private String ennm;
|
||||
|
||||
@Schema(description = "所属基地编码")
|
||||
private String baseId;
|
||||
|
||||
@Schema(description = "所属基地名称")
|
||||
private String baseName;
|
||||
|
||||
@Schema(description = "所属基地流域编码")
|
||||
private String hbrvcd;
|
||||
|
||||
@Schema(description = "所属基地流域名称")
|
||||
private String hbrvcdName;
|
||||
|
||||
@Schema(description = "所属流域编码")
|
||||
private String rvcd;
|
||||
|
||||
@Schema(description = "所属流域名称")
|
||||
private String rvcdName;
|
||||
|
||||
@Schema(description = "用途")
|
||||
private String purpose;
|
||||
|
||||
@Schema(description = "观察方式")
|
||||
private String observe;
|
||||
|
||||
@Schema(description = "监测频次")
|
||||
private Integer dtfrqcy;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "数据来源")
|
||||
private String vlsr;
|
||||
|
||||
@Schema(description = "数据来源时间")
|
||||
private Date vlsrTm;
|
||||
|
||||
@Schema(description = "建设状态")
|
||||
private String bldstt;
|
||||
|
||||
@Schema(description = "建设状态名称")
|
||||
private String bldsttName;
|
||||
|
||||
@Schema(description = "建设状态分类编码")
|
||||
private String bldsttCcode;
|
||||
|
||||
@Schema(description = "建设状态分类名称")
|
||||
private String bldsttCcodeName;
|
||||
|
||||
@Schema(description = "创建人")
|
||||
private String recordUser;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
private Date recordTime;
|
||||
|
||||
@Schema(description = "更新人")
|
||||
private String modifyUser;
|
||||
|
||||
@Schema(description = "更新时间")
|
||||
private Date modifyTime;
|
||||
|
||||
@Schema(description = "基地排序")
|
||||
private Integer baseStepSort;
|
||||
|
||||
@Schema(description = "流域排序")
|
||||
private Integer rvcdStepSort;
|
||||
|
||||
@Schema(description = "电站排序")
|
||||
private Integer rstcdStepSort;
|
||||
|
||||
@Schema(description = "站点排序")
|
||||
private Integer siteStepSort;
|
||||
}
|
||||
@ -0,0 +1,46 @@
|
||||
package com.yfd.platform.qgc_env.fpr.entity.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@Schema(description = "总院鱼类字典信息")
|
||||
public class FprZyFishDicVo {
|
||||
|
||||
private Integer index;
|
||||
private String id;
|
||||
private Integer isDeleted;
|
||||
private String zyFishId;
|
||||
private String rvcd;
|
||||
private String rvcdName;
|
||||
private String name;
|
||||
private Integer type;
|
||||
private String family;
|
||||
private String genus;
|
||||
private String species;
|
||||
private String nameEn;
|
||||
private String alias;
|
||||
private String fsz;
|
||||
private String shapedesc;
|
||||
private String habitation;
|
||||
private String habitMigrat;
|
||||
private String feedingHabit;
|
||||
private String food;
|
||||
private String timeFeed;
|
||||
private String orignDate;
|
||||
private String filterContent;
|
||||
private String pretemp;
|
||||
private String flowRate;
|
||||
private String depth;
|
||||
private String wqtq;
|
||||
private String spawnCharact;
|
||||
private String botmMater;
|
||||
private Integer ptype;
|
||||
private String ptypeName;
|
||||
private Integer specOrigin;
|
||||
private String specOriginName;
|
||||
private String description;
|
||||
private String logo;
|
||||
private String inffile;
|
||||
private String spawnMonth;
|
||||
}
|
||||
@ -0,0 +1,18 @@
|
||||
package com.yfd.platform.qgc_env.fpr.entity.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@Schema(description = "鱼类调查装置概况")
|
||||
public class FprdRunDataInfoVo {
|
||||
|
||||
@Schema(description = "鱼类调查装置数量")
|
||||
private Integer fprdCount;
|
||||
|
||||
@Schema(description = "鱼类种数")
|
||||
private Integer ftpCount;
|
||||
|
||||
@Schema(description = "鱼类记录数")
|
||||
private Integer fishCount;
|
||||
}
|
||||
@ -0,0 +1,25 @@
|
||||
package com.yfd.platform.qgc_env.fpr.service;
|
||||
|
||||
import com.yfd.platform.common.DataSourceRequest;
|
||||
import com.yfd.platform.common.DataSourceResult;
|
||||
import com.yfd.platform.qgc_env.fpr.entity.vo.FprFtpChangeInfoVo;
|
||||
import com.yfd.platform.qgc_env.fpr.entity.ao.FprdRunDataAo;
|
||||
import com.yfd.platform.qgc_env.fpr.entity.vo.FprFishDicVo;
|
||||
import com.yfd.platform.qgc_env.fpr.entity.vo.FprMsstbprptVo;
|
||||
import com.yfd.platform.qgc_env.fpr.entity.vo.FprdRunDataInfoVo;
|
||||
import com.yfd.platform.qgc_env.fpr.entity.vo.FprZyFishDicVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface FprMonitorService {
|
||||
|
||||
DataSourceResult<FprMsstbprptVo> getMsstbprptList(DataSourceRequest dataSourceRequest);
|
||||
|
||||
DataSourceResult<FprFishDicVo> getFishDicList(DataSourceRequest dataSourceRequest);
|
||||
|
||||
DataSourceResult<FprZyFishDicVo> getZyFishDicList(DataSourceRequest dataSourceRequest);
|
||||
|
||||
FprdRunDataInfoVo getFprdRunDataInfo(FprdRunDataAo ao);
|
||||
|
||||
List<FprFtpChangeInfoVo> getFtpChangeInfo(FprdRunDataAo ao);
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@ -18,7 +18,7 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
@RequestMapping("/vap")
|
||||
@Tag(name = "珍稀植物园建设及接入情况")
|
||||
@Validated
|
||||
public class VpConstructionController {
|
||||
public class VapConstructionController {
|
||||
|
||||
@Resource
|
||||
private VpConstructionService vpConstructionService;
|
||||
@ -46,4 +46,22 @@ public class VpConstructionController {
|
||||
public ResponseResult basinVpIntDetail(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||
return ResponseResult.successData(vpConstructionService.basinVpIntDetail(dataSourceRequest));
|
||||
}
|
||||
|
||||
@PostMapping("/wva/GetKendoListCust")
|
||||
@Operation(summary = "野生动物监测情况")
|
||||
public ResponseResult getWvaKendoListCust(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||
return ResponseResult.successData(vpConstructionService.processWvaKendoList(dataSourceRequest));
|
||||
}
|
||||
|
||||
@PostMapping("/vac/GetKendoListCust")
|
||||
@Operation(summary = "动物救助站建设及接入情况")
|
||||
public ResponseResult getVacKendoListCust(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||
return ResponseResult.successData(vpConstructionService.processVacKendoList(dataSourceRequest));
|
||||
}
|
||||
|
||||
@PostMapping("/var/GetKendoListCust")
|
||||
@Operation(summary = "动物救助情况")
|
||||
public ResponseResult getVarKendoListCust(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||
return ResponseResult.successData(vpConstructionService.processVarKendoList(dataSourceRequest));
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,65 @@
|
||||
package com.yfd.platform.qgc_env.vap.entity.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@Schema(description = "动物救助站建设及接入情况")
|
||||
public class VpVacVo {
|
||||
|
||||
@Schema(description = "测站编码")
|
||||
private String stcd;
|
||||
|
||||
@Schema(description = "基础对象名称")
|
||||
private String stnm;
|
||||
|
||||
@Schema(description = "业务类型名称")
|
||||
private String sttpName;
|
||||
|
||||
@Schema(description = "所属基地ID")
|
||||
private String baseId;
|
||||
|
||||
@Schema(description = "所属基地名称")
|
||||
private String baseName;
|
||||
|
||||
@Schema(description = "水电站名称")
|
||||
private String ennm;
|
||||
|
||||
@Schema(description = "是否接入")
|
||||
private String dtin;
|
||||
|
||||
@Schema(description = "是否接入名称")
|
||||
private String dtinName;
|
||||
|
||||
@Schema(description = "建设状态")
|
||||
private String bldsttCcode;
|
||||
|
||||
@Schema(description = "建设状态名称")
|
||||
private String bldsttCcodeName;
|
||||
|
||||
@Schema(description = "开工日期")
|
||||
private Date ststdt;
|
||||
|
||||
@Schema(description = "建成日期")
|
||||
private Date esstdt;
|
||||
|
||||
@Schema(description = "LOGO")
|
||||
private String logo;
|
||||
|
||||
@Schema(description = "简介")
|
||||
private String introduce;
|
||||
|
||||
@Schema(description = "介绍弹窗图片")
|
||||
private String inffile;
|
||||
|
||||
@Schema(description = "基地排序")
|
||||
private Integer baseStepSort;
|
||||
|
||||
@Schema(description = "电站排序")
|
||||
private Integer rstcdStepSort;
|
||||
|
||||
@Schema(description = "站点排序")
|
||||
private Integer siteStepSort;
|
||||
}
|
||||
@ -0,0 +1,64 @@
|
||||
package com.yfd.platform.qgc_env.vap.entity.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@Schema(description = "动物救助情况")
|
||||
public class VpVarVo {
|
||||
|
||||
@Schema(description = "主键")
|
||||
private String id;
|
||||
|
||||
@Schema(description = "测站编码")
|
||||
private String stcd;
|
||||
|
||||
@Schema(description = "所属基地ID")
|
||||
private String baseId;
|
||||
|
||||
@Schema(description = "测站名称")
|
||||
private String stnm;
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Schema(description = "放生日期")
|
||||
private Date tm;
|
||||
|
||||
@Schema(description = "陆生生态类型")
|
||||
private String tetp;
|
||||
|
||||
@Schema(description = "救助数量")
|
||||
private Integer tecnt;
|
||||
|
||||
@Schema(description = "放生地点")
|
||||
private String stlc;
|
||||
|
||||
@Schema(description = "放生照片")
|
||||
private String fpth;
|
||||
|
||||
@Schema(description = "文件ID")
|
||||
private String fid;
|
||||
|
||||
@Schema(description = "平台ID")
|
||||
private String platformId;
|
||||
|
||||
@Schema(description = "部门ID")
|
||||
private String departmentId;
|
||||
|
||||
@Schema(description = "是否暂存")
|
||||
private Integer isTempStorage;
|
||||
|
||||
@Schema(description = "年度")
|
||||
private String year;
|
||||
|
||||
@Schema(description = "描述")
|
||||
private String description;
|
||||
|
||||
@Schema(description = "基地排序")
|
||||
private Integer baseStepSort;
|
||||
|
||||
@Schema(description = "站点排序")
|
||||
private Integer siteStepSort;
|
||||
}
|
||||
@ -0,0 +1,88 @@
|
||||
package com.yfd.platform.qgc_env.vap.entity.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@Schema(description = "野生动物监测情况")
|
||||
public class VpWvaRunVo {
|
||||
|
||||
@Schema(description = "站点编码")
|
||||
private String stcd;
|
||||
|
||||
@Schema(description = "站点名称")
|
||||
private String stnm;
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Schema(description = "时间")
|
||||
private Date tm;
|
||||
|
||||
@Schema(description = "显示名称")
|
||||
private String flnm;
|
||||
|
||||
@Schema(description = "图片路径")
|
||||
private String imgPath;
|
||||
|
||||
@Schema(description = "视频路径")
|
||||
private String flpth;
|
||||
|
||||
@Schema(description = "附件ID")
|
||||
private String fid;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String description;
|
||||
|
||||
@Schema(description = "平台ID")
|
||||
private String platformId;
|
||||
|
||||
@Schema(description = "部门ID")
|
||||
private String departmentId;
|
||||
|
||||
@Schema(description = "是否暂存")
|
||||
private Long isTempStorage;
|
||||
|
||||
@Schema(description = "站类编码")
|
||||
private String sttpCode;
|
||||
|
||||
@Schema(description = "站类名称")
|
||||
private String sttpName;
|
||||
|
||||
@Schema(description = "所属基地编码")
|
||||
private String baseId;
|
||||
|
||||
@Schema(description = "所属基地名称")
|
||||
private String baseName;
|
||||
|
||||
@Schema(description = "所属电站编码")
|
||||
private String rstcd;
|
||||
|
||||
@Schema(description = "所属电站名称")
|
||||
private String ennm;
|
||||
|
||||
@Schema(description = "所属基地流域编码")
|
||||
private String hbrvcd;
|
||||
|
||||
@Schema(description = "所属基地流域名称")
|
||||
private String hbrvcdName;
|
||||
|
||||
@Schema(description = "建设状态编码")
|
||||
private String bldsttCcode;
|
||||
|
||||
@Schema(description = "建设状态名称")
|
||||
private String bldsttCcodeName;
|
||||
|
||||
@Schema(description = "动物类型")
|
||||
private String tetp;
|
||||
|
||||
@Schema(description = "救助数量")
|
||||
private Integer tecnt;
|
||||
|
||||
@Schema(description = "放生地点")
|
||||
private String stlc;
|
||||
|
||||
@Schema(description = "原始照片路径")
|
||||
private String fpth;
|
||||
}
|
||||
@ -3,7 +3,10 @@ package com.yfd.platform.qgc_env.vap.service;
|
||||
import com.yfd.platform.common.DataSourceRequest;
|
||||
import com.yfd.platform.common.DataSourceResult;
|
||||
import com.yfd.platform.qgc_env.vap.entity.vo.VpBasinIntDetailVo;
|
||||
import com.yfd.platform.qgc_env.vap.entity.vo.VpVarVo;
|
||||
import com.yfd.platform.qgc_env.vap.entity.vo.VpStInfoResultVo;
|
||||
import com.yfd.platform.qgc_env.vap.entity.vo.VpVacVo;
|
||||
import com.yfd.platform.qgc_env.vap.entity.vo.VpWvaRunVo;
|
||||
|
||||
public interface VpConstructionService {
|
||||
|
||||
@ -14,4 +17,10 @@ public interface VpConstructionService {
|
||||
VpStInfoResultVo getStInfoByStcd(String stcd);
|
||||
|
||||
DataSourceResult<VpBasinIntDetailVo> basinVpIntDetail(DataSourceRequest dataSourceRequest);
|
||||
|
||||
DataSourceResult<VpWvaRunVo> processWvaKendoList(DataSourceRequest dataSourceRequest);
|
||||
|
||||
DataSourceResult<VpVacVo> processVacKendoList(DataSourceRequest dataSourceRequest);
|
||||
|
||||
DataSourceResult<VpVarVo> processVarKendoList(DataSourceRequest dataSourceRequest);
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -844,6 +844,13 @@ public class VdMonitorServiceImpl implements VdMonitorService {
|
||||
case "sttpFullPath" -> "t.sttpFullPath";
|
||||
case "stcd" -> "t.stcd";
|
||||
case "stnm" -> "t.stnm";
|
||||
case "mntp" -> "t.mntp";
|
||||
case "stlc" -> "t.stlc";
|
||||
case "lgtd" -> "t.lgtd";
|
||||
case "lttd" -> "t.lttd";
|
||||
case "elev" -> "t.elev";
|
||||
case "jcdt" -> "t.jcdt";
|
||||
case "wddt" -> "t.wddt";
|
||||
case "rstcd" -> "t.rstcd";
|
||||
case "ennm" -> "t.ennm";
|
||||
case "fhstcd" -> "t.fhstcd";
|
||||
@ -853,14 +860,28 @@ public class VdMonitorServiceImpl implements VdMonitorService {
|
||||
case "baseId" -> "t.baseId";
|
||||
case "baseName" -> "t.baseName";
|
||||
case "hbrvcd" -> "t.hbrvcd";
|
||||
case "hbrvcdName" -> "t.hbrvcdName";
|
||||
case "dtinName" -> "t.dtinName";
|
||||
case "bldsttCcode" -> "t.bldsttCcode";
|
||||
case "bldsttCcodeName" -> "t.bldsttCcodeName";
|
||||
case "stindx" -> "t.stindx";
|
||||
case "introduce" -> "t.introduce";
|
||||
case "logo" -> "t.logo";
|
||||
case "inffile" -> "t.inffile";
|
||||
case "dtfrqcy" -> "t.dtfrqcy";
|
||||
case "remark" -> "t.remark";
|
||||
case "vlsr" -> "t.vlsr";
|
||||
case "vlsrTm" -> "t.vlsrTm";
|
||||
case "rvcd" -> "t.rvcd";
|
||||
case "addvcd" -> "t.addvcd";
|
||||
case "dtin" -> "t.dtin";
|
||||
case "usfl" -> "t.usfl";
|
||||
case "bldsttCcode" -> "t.bldsttCcode";
|
||||
case "url" -> "t.url";
|
||||
case "playWay" -> "t.playWay";
|
||||
case "sourceTable" -> "t.sourceTable";
|
||||
case "baseStepSort" -> "t.baseStepSort";
|
||||
case "rstcdStepSort" -> "t.rstcdStepSort";
|
||||
case "siteStepSort" -> "t.siteStepSort";
|
||||
default -> null;
|
||||
};
|
||||
}
|
||||
@ -937,8 +958,8 @@ public class VdMonitorServiceImpl implements VdMonitorService {
|
||||
if (StrUtil.isBlank(column)) {
|
||||
continue;
|
||||
}
|
||||
String direction = "desc".equalsIgnoreCase(sort.getDir()) ? "DESC" : "ASC";
|
||||
orderItems.add(column + " " + direction);
|
||||
String direction = "desc".equalsIgnoreCase(sort.getDir()) || "des".equalsIgnoreCase(sort.getDir()) ? "DESC" : "ASC";
|
||||
orderItems.add(column + " " + direction + " NULLS LAST");
|
||||
}
|
||||
if (orderItems.isEmpty()) {
|
||||
return " ORDER BY t.baseStepSort ASC, t.rstcdStepSort ASC, t.siteStepSort ASC, t.stcd ASC";
|
||||
|
||||
@ -2,6 +2,7 @@ package com.yfd.platform.qgc_env.wq.controller;
|
||||
|
||||
import com.yfd.platform.common.DataSourceRequest;
|
||||
import com.yfd.platform.config.ResponseResult;
|
||||
import com.yfd.platform.qgc_base.entity.vo.BatchDeleteAo;
|
||||
import com.yfd.platform.qgc_env.wq.service.EnvWqDataService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
@ -14,6 +15,8 @@ import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/wq")
|
||||
@Tag(name = "水质统计分析")
|
||||
@ -42,6 +45,32 @@ public class EnvWqDataController {
|
||||
return ResponseResult.successData(envWqDataService.processDataKendoList(dataSourceRequest));
|
||||
}
|
||||
|
||||
@PostMapping("/data/day/GetKendoListCust")
|
||||
@Operation(summary = "查询水质日数据")
|
||||
public ResponseResult getDayKendoListCust(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||
return ResponseResult.successData(envWqDataService.getDayKendoListCust(dataSourceRequest));
|
||||
}
|
||||
|
||||
@PostMapping("/data/drtp/GetKendoListCust")
|
||||
@Operation(summary = "查询水质周旬月季年数据")
|
||||
public ResponseResult getDrtpKendoListCust(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||
return ResponseResult.successData(envWqDataService.getDrtpKendoListCust(dataSourceRequest));
|
||||
}
|
||||
|
||||
@PostMapping("/updateWqRsData")
|
||||
@Operation(summary = "修改水质小时数据")
|
||||
public ResponseResult updateWqRsData(@RequestBody Map<String, Object> updateData) {
|
||||
envWqDataService.updateWqRsData(updateData);
|
||||
return ResponseResult.success();
|
||||
}
|
||||
|
||||
@PostMapping("/removeKendoByIds")
|
||||
@Operation(summary = "删除水质小时/日/月数据")
|
||||
public ResponseResult removeKendoByIds(@RequestBody BatchDeleteAo batchDeleteAo) {
|
||||
envWqDataService.removeKendoByIds(batchDeleteAo);
|
||||
return ResponseResult.success();
|
||||
}
|
||||
|
||||
@PostMapping("/GetStbprpYsByStcd")
|
||||
@Operation(summary = "水质监测数据查询")
|
||||
public ResponseResult GetStbprpYsByStcd(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||
|
||||
@ -0,0 +1,81 @@
|
||||
package com.yfd.platform.qgc_env.wq.entity.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Data
|
||||
@Schema(description = "水质日数据")
|
||||
public class EnvWqDayDataVo {
|
||||
private String stcd;
|
||||
private String rstcd;
|
||||
private String stnm;
|
||||
private String stCode;
|
||||
private String stName;
|
||||
private String ennm;
|
||||
private Date dt;
|
||||
private BigDecimal wtmp;
|
||||
private BigDecimal ph;
|
||||
private BigDecimal dox;
|
||||
private BigDecimal codmn;
|
||||
private BigDecimal codcr;
|
||||
private BigDecimal bod5;
|
||||
private BigDecimal nh3n;
|
||||
private BigDecimal tp;
|
||||
private BigDecimal tn;
|
||||
private BigDecimal cu;
|
||||
private BigDecimal zn;
|
||||
private BigDecimal f;
|
||||
private BigDecimal se;
|
||||
private BigDecimal ars;
|
||||
private BigDecimal hg;
|
||||
private BigDecimal cd;
|
||||
private BigDecimal cr6;
|
||||
private BigDecimal pb;
|
||||
private BigDecimal cn;
|
||||
private BigDecimal vlph;
|
||||
private BigDecimal oil;
|
||||
private BigDecimal las;
|
||||
private BigDecimal s2;
|
||||
private BigDecimal fcg;
|
||||
private BigDecimal cl;
|
||||
private BigDecimal so4;
|
||||
private BigDecimal no3;
|
||||
private BigDecimal thrd;
|
||||
private BigDecimal cond;
|
||||
private BigDecimal fe;
|
||||
private BigDecimal mn;
|
||||
private BigDecimal al;
|
||||
private BigDecimal ss;
|
||||
private BigDecimal no2;
|
||||
private BigDecimal chla;
|
||||
private BigDecimal clarity;
|
||||
private BigDecimal tu;
|
||||
private BigDecimal tod;
|
||||
private BigDecimal cyano;
|
||||
private String wqgrd;
|
||||
private String wqgrdName;
|
||||
private String wwqtg;
|
||||
private String wwqtgName;
|
||||
private Integer sfdb;
|
||||
private String sfdbName;
|
||||
private String wqSfdbhnYs;
|
||||
private String wqSfdbhnYsName;
|
||||
private String baseId;
|
||||
private String baseName;
|
||||
private String rvcdName;
|
||||
private String addvcdName;
|
||||
private String dtinType;
|
||||
private BigDecimal qi;
|
||||
private BigDecimal qo;
|
||||
private Integer baseStepSort;
|
||||
private Integer rvcdStepSort;
|
||||
private Integer rstcdStepSort;
|
||||
private Integer siteStepSort;
|
||||
private List<Map<String, Object>> min;
|
||||
private List<Map<String, Object>> max;
|
||||
}
|
||||
@ -0,0 +1,78 @@
|
||||
package com.yfd.platform.qgc_env.wq.entity.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@Schema(description = "水质周旬月季年数据")
|
||||
public class EnvWqDrtpDataVo {
|
||||
private String stcd;
|
||||
private String stnm;
|
||||
private String rstcd;
|
||||
private String ennm;
|
||||
private String stCode;
|
||||
private String stName;
|
||||
private Integer month;
|
||||
private Integer year;
|
||||
private String drtp;
|
||||
private Integer dr;
|
||||
private BigDecimal wtmp;
|
||||
private BigDecimal ph;
|
||||
private BigDecimal dox;
|
||||
private BigDecimal codmn;
|
||||
private BigDecimal codcr;
|
||||
private BigDecimal bod5;
|
||||
private BigDecimal nh3n;
|
||||
private BigDecimal tp;
|
||||
private BigDecimal tn;
|
||||
private BigDecimal cu;
|
||||
private BigDecimal zn;
|
||||
private BigDecimal f;
|
||||
private BigDecimal se;
|
||||
private BigDecimal ars;
|
||||
private BigDecimal hg;
|
||||
private BigDecimal cd;
|
||||
private BigDecimal cr6;
|
||||
private BigDecimal pb;
|
||||
private BigDecimal cn;
|
||||
private BigDecimal vlph;
|
||||
private BigDecimal oil;
|
||||
private BigDecimal las;
|
||||
private BigDecimal s2;
|
||||
private BigDecimal fcg;
|
||||
private BigDecimal cl;
|
||||
private BigDecimal so4;
|
||||
private BigDecimal no3;
|
||||
private BigDecimal thrd;
|
||||
private BigDecimal cond;
|
||||
private BigDecimal fe;
|
||||
private BigDecimal mn;
|
||||
private BigDecimal al;
|
||||
private BigDecimal ss;
|
||||
private BigDecimal no2;
|
||||
private BigDecimal chla;
|
||||
private BigDecimal clarity;
|
||||
private BigDecimal tu;
|
||||
private BigDecimal tod;
|
||||
private BigDecimal cyano;
|
||||
private String wqgrd;
|
||||
private String wqgrdName;
|
||||
private String wwqtg;
|
||||
private String wwqtgName;
|
||||
private Integer sfdb;
|
||||
private String sfdbName;
|
||||
private String wqSfdbhnYs;
|
||||
private String baseId;
|
||||
private String baseName;
|
||||
private String rvcdName;
|
||||
private String addvcdName;
|
||||
private String dtinType;
|
||||
private Date tm;
|
||||
private Integer baseStepSort;
|
||||
private Integer rvcdStepSort;
|
||||
private Integer rstcdStepSort;
|
||||
private Integer siteStepSort;
|
||||
}
|
||||
@ -2,8 +2,11 @@ package com.yfd.platform.qgc_env.wq.service;
|
||||
|
||||
import com.yfd.platform.common.DataSourceRequest;
|
||||
import com.yfd.platform.common.DataSourceResult;
|
||||
import com.yfd.platform.qgc_base.entity.vo.BatchDeleteAo;
|
||||
import com.yfd.platform.qgc_env.wq.entity.vo.WqBaseInfoVo;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public interface EnvWqDataService {
|
||||
|
||||
DataSourceResult processKendoList(DataSourceRequest dataSourceRequest);
|
||||
@ -12,6 +15,10 @@ public interface EnvWqDataService {
|
||||
|
||||
DataSourceResult processDataKendoList(DataSourceRequest dataSourceRequest);
|
||||
|
||||
DataSourceResult getDayKendoListCust(DataSourceRequest dataSourceRequest);
|
||||
|
||||
DataSourceResult getDrtpKendoListCust(DataSourceRequest dataSourceRequest);
|
||||
|
||||
DataSourceResult getStbprpYsByStcd(DataSourceRequest dataSourceRequest);
|
||||
|
||||
DataSourceResult getAlongWqKendoListCust(DataSourceRequest dataSourceRequest);
|
||||
@ -31,4 +38,8 @@ public interface EnvWqDataService {
|
||||
DataSourceResult getStTbYsBVoKendoListCust(String stcd, String tbCode, String startTime, String endTime);
|
||||
|
||||
DataSourceResult getStTbYsBVoKendoListCust(DataSourceRequest dataSourceRequest);
|
||||
|
||||
boolean updateWqRsData(Map<String, Object> updateData);
|
||||
|
||||
boolean removeKendoByIds(BatchDeleteAo batchDeleteAo);
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,37 @@
|
||||
package com.yfd.platform.qgc_env.wt.entity.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@Schema(description = "出库水温日数据")
|
||||
public class SdAlongDayDetailVO {
|
||||
@Schema(description = "日期")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||
private Date dt;
|
||||
|
||||
@Schema(description = "温度")
|
||||
private BigDecimal wt;
|
||||
|
||||
@Schema(description = "编码")
|
||||
private String stcd;
|
||||
|
||||
@Schema(description = "电站编码")
|
||||
private String rstcd;
|
||||
|
||||
@Schema(description = "电站名称")
|
||||
private String ennm;
|
||||
|
||||
@Schema(description = "站点名称")
|
||||
private String stnm;
|
||||
|
||||
@Schema(description = "基地编码")
|
||||
private String baseId;
|
||||
|
||||
@Schema(description = "基地名称")
|
||||
private String baseName;
|
||||
}
|
||||
@ -0,0 +1,43 @@
|
||||
package com.yfd.platform.qgc_env.wt.entity.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
@Schema(description = "出库水温周旬月季年数据")
|
||||
public class SdAlongDrtpDetailVO {
|
||||
@Schema(description = "编码")
|
||||
private String stcd;
|
||||
|
||||
@Schema(description = "站点名称")
|
||||
private String stnm;
|
||||
|
||||
@Schema(description = "电站编码")
|
||||
private String rstcd;
|
||||
|
||||
@Schema(description = "电站名称")
|
||||
private String ennm;
|
||||
|
||||
@Schema(description = "基地编码")
|
||||
private String baseId;
|
||||
|
||||
@Schema(description = "基地名称")
|
||||
private String baseName;
|
||||
|
||||
@Schema(description = "温度")
|
||||
private BigDecimal wt;
|
||||
|
||||
@Schema(description = "月")
|
||||
private Integer month;
|
||||
|
||||
@Schema(description = "年")
|
||||
private Integer year;
|
||||
|
||||
@Schema(description = "维度类型")
|
||||
private String drtp;
|
||||
|
||||
@Schema(description = "时段类型")
|
||||
private Integer dr;
|
||||
}
|
||||
@ -12,6 +12,8 @@ import com.yfd.platform.qgc_env.wt.mapper.AlongDetailMapper;
|
||||
import com.yfd.platform.qgc_env.wt.mapper.SdWtrvdrtpSMapper;
|
||||
import com.yfd.platform.qgc_env.wt.service.AlongDetailService;
|
||||
import com.yfd.platform.qgc_env.wt.entity.vo.SdAlongDetailVO;
|
||||
import com.yfd.platform.qgc_env.wt.entity.vo.SdAlongDayDetailVO;
|
||||
import com.yfd.platform.qgc_env.wt.entity.vo.SdAlongDrtpDetailVO;
|
||||
import com.yfd.platform.qgc_env.wt.entity.vo.WtrvInfo;
|
||||
import com.yfd.platform.qgc_base.entity.vo.BatchDeleteAo;
|
||||
import com.yfd.platform.qgc_base.entity.vo.DataParam;
|
||||
@ -129,66 +131,399 @@ public class AlongDetailServiceImpl extends ServiceImpl<AlongDetailMapper, SdAlo
|
||||
|
||||
@Override
|
||||
public DataSourceResult processDayKendoList(DataSourceRequest dataSourceRequest, Map<String, GroupResult> filterResult, Page page, String groupBy) {
|
||||
DataSourceResult dataSourceResult = new DataSourceResult();
|
||||
StringBuilder sql = new StringBuilder();
|
||||
DataSourceResult<SdAlongDayDetailVO> dataSourceResult = new DataSourceResult<>();
|
||||
DataSourceLoadOptionsBase loadOptions = dataSourceRequest == null ? null : dataSourceRequest.toDevRequest();
|
||||
StringBuilder sql = new StringBuilder()
|
||||
.append("SELECT ")
|
||||
.append("t.DT AS dt, ")
|
||||
.append("t.WT AS wt, ")
|
||||
.append("t.STCD AS stcd, ")
|
||||
.append("t.RSTCD AS rstcd, ")
|
||||
.append("t.ENNM AS ennm, ")
|
||||
.append("t.STNM AS stnm, ")
|
||||
.append("t.BASE_ID AS baseId, ")
|
||||
.append("t.BASENAME AS baseName ")
|
||||
.append("FROM (")
|
||||
.append("SELECT day.DT, day.WT, day.STCD, wt.RSTCD, eng.ENNM, wt.STNM, eng.BASE_ID, hb.BASENAME ")
|
||||
.append("FROM SD_WTRVDAY_S day ")
|
||||
.append("INNER JOIN SD_WT_B_H wt ON wt.STCD = day.STCD ")
|
||||
.append(" AND NVL(wt.IS_DELETED, 0) = 0 ")
|
||||
.append(" AND wt.STTP = 'WTRV' ")
|
||||
.append("LEFT JOIN SD_ENGINFO_B_H eng ON eng.STCD = wt.RSTCD AND NVL(eng.IS_DELETED, 0) = 0 ")
|
||||
.append("LEFT JOIN SD_HYDROBASE hb ON hb.BASEID = eng.BASE_ID AND NVL(hb.IS_DELETED, 0) = 0 ")
|
||||
.append("WHERE NVL(day.IS_DELETED, 0) = 0")
|
||||
.append(") t WHERE 1 = 1 ");
|
||||
|
||||
if(StrUtil.isNotBlank(filterResult.get("default").getSelectSql())){
|
||||
sql.append(filterResult.get("default").getSelectSql());
|
||||
sql.append(" from ");
|
||||
sql.append(" SD_WTRVDAY_S a inner join MS_STBPRP_T b on a.STCD=b.STCD and b.STTP_CODE='WTRV' ");
|
||||
sql.append(" where 1=1 ");
|
||||
if (ObjectUtil.isNotEmpty(filterResult.get(CommonConstant.DEFAULT))) {
|
||||
if (StrUtil.isNotBlank(filterResult.get(CommonConstant.DEFAULT).getGroupSql())) {
|
||||
sql.append(" and ").append(filterResult.get(CommonConstant.DEFAULT).getGroupSql());
|
||||
}
|
||||
Map<String, Object> paramMap = new HashMap<>();
|
||||
String filterSql = buildAlongDayFilterCondition(
|
||||
dataSourceRequest == null ? null : dataSourceRequest.getFilter(),
|
||||
paramMap,
|
||||
new int[]{0}
|
||||
);
|
||||
if (StrUtil.isNotBlank(filterSql)) {
|
||||
sql.append(" AND ").append(filterSql);
|
||||
}
|
||||
sql.append(buildAlongDayOrderBySql(dataSourceRequest == null ? null : dataSourceRequest.getSort()));
|
||||
|
||||
if (StrUtil.isNotBlank(filterResult.get(CommonConstant.DEFAULT).getOrderBySql())) {
|
||||
sql.append(" ").append(filterResult.get(CommonConstant.DEFAULT).getOrderBySql());
|
||||
}
|
||||
}
|
||||
}
|
||||
Map<String, Object> map = new HashMap();
|
||||
Iterator iterator = filterResult.keySet().iterator();
|
||||
while (iterator.hasNext()) {
|
||||
String key = (String) iterator.next();
|
||||
map.putAll(filterResult.get(key).getParamMap());
|
||||
}
|
||||
List< Map<String, Object>> resultList = this.dynamicSQLMapper.pageAllList(page, sql.toString(), map);
|
||||
Page<?> currentPage = loadOptions == null ? page : QgcQueryWrapperUtil.buildPage(loadOptions, loadOptions.getSkip(), loadOptions.getTake());
|
||||
List<SdAlongDayDetailVO> resultList = this.microservicDynamicSQLMapper.pageAllListWithResultType(
|
||||
currentPage,
|
||||
sql.toString(),
|
||||
paramMap,
|
||||
SdAlongDayDetailVO.class
|
||||
);
|
||||
dataSourceResult.setData(resultList);
|
||||
dataSourceResult.setTotal(ObjectUtil.isNotEmpty(page) ? page.getTotal() : (long) resultList.size());
|
||||
dataSourceResult.setTotal(ObjectUtil.isNotEmpty(currentPage) ? currentPage.getTotal() : (long) resultList.size());
|
||||
dataSourceResult.setAggregates(new HashMap<>());
|
||||
return dataSourceResult;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DataSourceResult processDrtpKendoList(DataSourceRequest dataSourceRequest, Map<String, GroupResult> filterResult, Page page, String groupBy) {
|
||||
DataSourceResult dataSourceResult = new DataSourceResult();
|
||||
StringBuilder sql = new StringBuilder();
|
||||
if(StrUtil.isNotBlank(filterResult.get(CommonConstant.DEFAULT).getSelectSql())){
|
||||
sql.append(filterResult.get(CommonConstant.DEFAULT).getSelectSql());
|
||||
sql.append(" from ");
|
||||
sql.append(" SD_WTRVDRTP_S a inner join MS_STBPRP_T b on a.STCD=b.STCD and b.STTP_CODE='WTRV' ");
|
||||
sql.append(" where 1=1 ");
|
||||
if (ObjectUtil.isNotEmpty(filterResult.get(CommonConstant.DEFAULT))) {
|
||||
if (StrUtil.isNotBlank(filterResult.get(CommonConstant.DEFAULT).getGroupSql())) {
|
||||
sql.append(" and ").append(filterResult.get(CommonConstant.DEFAULT).getGroupSql());
|
||||
}
|
||||
DataSourceResult<SdAlongDrtpDetailVO> dataSourceResult = new DataSourceResult<>();
|
||||
DataSourceLoadOptionsBase loadOptions = dataSourceRequest == null ? null : dataSourceRequest.toDevRequest();
|
||||
StringBuilder sql = new StringBuilder()
|
||||
.append("SELECT ")
|
||||
.append("t.STCD AS stcd, ")
|
||||
.append("t.STNM AS stnm, ")
|
||||
.append("t.RSTCD AS rstcd, ")
|
||||
.append("t.ENNM AS ennm, ")
|
||||
.append("t.BASE_ID AS baseId, ")
|
||||
.append("t.BASENAME AS baseName, ")
|
||||
.append("t.WT AS wt, ")
|
||||
.append("t.MONTH AS month, ")
|
||||
.append("t.YEAR AS year, ")
|
||||
.append("t.DRTP AS drtp, ")
|
||||
.append("t.DR AS dr ")
|
||||
.append("FROM (")
|
||||
.append("SELECT drtp.STCD, wt.STNM, wt.RSTCD, eng.ENNM, eng.BASE_ID, hb.BASENAME, ")
|
||||
.append("drtp.WT, drtp.MONTH, drtp.YEAR, drtp.DRTP, drtp.DR, drtp.TM ")
|
||||
.append("FROM SD_WTRVDRTP_S drtp ")
|
||||
.append("INNER JOIN SD_WT_B_H wt ON wt.STCD = drtp.STCD ")
|
||||
.append(" AND NVL(wt.IS_DELETED, 0) = 0 ")
|
||||
.append(" AND wt.STTP = 'WTRV' ")
|
||||
.append("LEFT JOIN SD_ENGINFO_B_H eng ON eng.STCD = wt.RSTCD AND NVL(eng.IS_DELETED, 0) = 0 ")
|
||||
.append("LEFT JOIN SD_HYDROBASE hb ON hb.BASEID = eng.BASE_ID AND NVL(hb.IS_DELETED, 0) = 0 ")
|
||||
.append("WHERE NVL(drtp.IS_DELETED, 0) = 0")
|
||||
.append(") t WHERE 1 = 1 ");
|
||||
|
||||
if (StrUtil.isNotBlank(filterResult.get(CommonConstant.DEFAULT).getOrderBySql())) {
|
||||
sql.append(" ").append(filterResult.get(CommonConstant.DEFAULT).getOrderBySql());
|
||||
}
|
||||
Map<String, Object> paramMap = new HashMap<>();
|
||||
String filterSql = buildAlongDrtpFilterCondition(
|
||||
dataSourceRequest == null ? null : dataSourceRequest.getFilter(),
|
||||
paramMap,
|
||||
new int[]{0}
|
||||
);
|
||||
if (StrUtil.isNotBlank(filterSql)) {
|
||||
sql.append(" AND ").append(filterSql);
|
||||
}
|
||||
sql.append(buildAlongDrtpOrderBySql(dataSourceRequest == null ? null : dataSourceRequest.getSort()));
|
||||
|
||||
Page<?> currentPage = loadOptions == null ? page : QgcQueryWrapperUtil.buildPage(loadOptions, loadOptions.getSkip(), loadOptions.getTake());
|
||||
List<SdAlongDrtpDetailVO> resultList = this.microservicDynamicSQLMapper.pageAllListWithResultType(
|
||||
currentPage,
|
||||
sql.toString(),
|
||||
paramMap,
|
||||
SdAlongDrtpDetailVO.class
|
||||
);
|
||||
dataSourceResult.setData(resultList);
|
||||
dataSourceResult.setTotal(ObjectUtil.isNotEmpty(currentPage) ? currentPage.getTotal() : (long) resultList.size());
|
||||
dataSourceResult.setAggregates(new HashMap<>());
|
||||
return dataSourceResult;
|
||||
}
|
||||
|
||||
private String buildAlongDayFilterCondition(DataSourceRequest.FilterDescriptor filter,
|
||||
Map<String, Object> paramMap,
|
||||
int[] indexHolder) {
|
||||
if (filter == null) {
|
||||
return "";
|
||||
}
|
||||
if (StrUtil.isNotBlank(filter.getField())) {
|
||||
return buildAlongDayLeafCondition(filter, paramMap, indexHolder);
|
||||
}
|
||||
if (CollUtil.isEmpty(filter.getFilters())) {
|
||||
return "";
|
||||
}
|
||||
List<String> conditions = new ArrayList<>();
|
||||
for (DataSourceRequest.FilterDescriptor child : filter.getFilters()) {
|
||||
String childSql = buildAlongDayFilterCondition(child, paramMap, indexHolder);
|
||||
if (StrUtil.isNotBlank(childSql)) {
|
||||
conditions.add(childSql);
|
||||
}
|
||||
}
|
||||
Map<String, Object> map = new HashMap();
|
||||
Iterator iterator = filterResult.keySet().iterator();
|
||||
|
||||
while (iterator.hasNext()) {
|
||||
String key = (String) iterator.next();
|
||||
map.putAll(filterResult.get(key).getParamMap());
|
||||
if (conditions.isEmpty()) {
|
||||
return "";
|
||||
}
|
||||
List<Map<String, Object>> resultList = this.dynamicSQLMapper.pageAllList(page, sql.toString(), map);
|
||||
dataSourceResult.setData(resultList);
|
||||
dataSourceResult.setTotal(ObjectUtil.isNotEmpty(page) ? page.getTotal() : (long) resultList.size());
|
||||
return dataSourceResult;
|
||||
String logic = "or".equalsIgnoreCase(filter.getLogic()) ? " OR " : " AND ";
|
||||
return "(" + String.join(logic, conditions) + ")";
|
||||
}
|
||||
|
||||
private String buildAlongDayLeafCondition(DataSourceRequest.FilterDescriptor filter,
|
||||
Map<String, Object> paramMap,
|
||||
int[] indexHolder) {
|
||||
String column = mapAlongDayColumn(filter.getField());
|
||||
if (StrUtil.isBlank(column) || filter.getValue() == null) {
|
||||
return "";
|
||||
}
|
||||
String operator = StrUtil.blankToDefault(filter.getOperator(), "eq").toLowerCase();
|
||||
boolean dateField = "tm".equalsIgnoreCase(filter.getField()) || "dt".equalsIgnoreCase(filter.getField());
|
||||
String key = "alongDayParam" + indexHolder[0]++;
|
||||
switch (operator) {
|
||||
case "eq":
|
||||
paramMap.put(key, filter.getValue());
|
||||
return dateField
|
||||
? column + " = TO_DATE(SUBSTR(#{map." + key + "}, 1, 10), 'YYYY-MM-DD')"
|
||||
: column + " = #{map." + key + "}";
|
||||
case "neq":
|
||||
paramMap.put(key, filter.getValue());
|
||||
return dateField
|
||||
? column + " <> TO_DATE(SUBSTR(#{map." + key + "}, 1, 10), 'YYYY-MM-DD')"
|
||||
: column + " <> #{map." + key + "}";
|
||||
case "gt":
|
||||
paramMap.put(key, filter.getValue());
|
||||
return dateField
|
||||
? column + " > TO_DATE(SUBSTR(#{map." + key + "}, 1, 10), 'YYYY-MM-DD')"
|
||||
: column + " > #{map." + key + "}";
|
||||
case "gte":
|
||||
paramMap.put(key, filter.getValue());
|
||||
return dateField
|
||||
? column + " >= TO_DATE(SUBSTR(#{map." + key + "}, 1, 10), 'YYYY-MM-DD')"
|
||||
: column + " >= #{map." + key + "}";
|
||||
case "lt":
|
||||
paramMap.put(key, filter.getValue());
|
||||
return dateField
|
||||
? column + " < TO_DATE(SUBSTR(#{map." + key + "}, 1, 10), 'YYYY-MM-DD')"
|
||||
: column + " < #{map." + key + "}";
|
||||
case "lte":
|
||||
paramMap.put(key, filter.getValue());
|
||||
return dateField
|
||||
? column + " <= TO_DATE(SUBSTR(#{map." + key + "}, 1, 10), 'YYYY-MM-DD')"
|
||||
: column + " <= #{map." + key + "}";
|
||||
case "contains":
|
||||
paramMap.put(key, "%" + filter.getValue() + "%");
|
||||
return column + " LIKE #{map." + key + "}";
|
||||
case "in": {
|
||||
List<String> values = splitAlongDayFilterValues(filter.getValue());
|
||||
if (CollUtil.isEmpty(values)) {
|
||||
return "";
|
||||
}
|
||||
List<String> placeholders = new ArrayList<>();
|
||||
for (String item : values) {
|
||||
String itemKey = "alongDayParam" + indexHolder[0]++;
|
||||
paramMap.put(itemKey, item);
|
||||
placeholders.add(dateField
|
||||
? "TO_DATE(SUBSTR(#{map." + itemKey + "}, 1, 10), 'YYYY-MM-DD')"
|
||||
: "#{map." + itemKey + "}");
|
||||
}
|
||||
return column + " IN (" + String.join(", ", placeholders) + ")";
|
||||
}
|
||||
default:
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
private String mapAlongDayColumn(String field) {
|
||||
if (StrUtil.isBlank(field)) {
|
||||
return null;
|
||||
}
|
||||
return switch (field) {
|
||||
case "tm", "dt" -> "t.DT";
|
||||
case "stcd" -> "t.STCD";
|
||||
case "rstcd" -> "t.RSTCD";
|
||||
case "wt" -> "t.WT";
|
||||
case "stnm" -> "t.STNM";
|
||||
case "baseName", "basename" -> "t.BASENAME";
|
||||
case "baseId" -> "t.BASE_ID";
|
||||
case "ennm" -> "t.ENNM";
|
||||
default -> null;
|
||||
};
|
||||
}
|
||||
|
||||
private String buildAlongDayOrderBySql(List<DataSourceRequest.SortDescriptor> sortList) {
|
||||
if (CollUtil.isEmpty(sortList)) {
|
||||
return " ORDER BY t.DT DESC NULLS LAST, t.STCD ASC";
|
||||
}
|
||||
List<String> orderItems = new ArrayList<>();
|
||||
for (DataSourceRequest.SortDescriptor sortDescriptor : sortList) {
|
||||
if (sortDescriptor == null || StrUtil.isBlank(sortDescriptor.getField())) {
|
||||
continue;
|
||||
}
|
||||
String column = mapAlongDayColumn(sortDescriptor.getField());
|
||||
if (StrUtil.isBlank(column)) {
|
||||
continue;
|
||||
}
|
||||
String dir = "desc".equalsIgnoreCase(sortDescriptor.getDir()) ? "DESC" : "ASC";
|
||||
orderItems.add(column + " " + dir + " NULLS LAST");
|
||||
}
|
||||
return CollUtil.isEmpty(orderItems) ? " ORDER BY t.DT DESC NULLS LAST, t.STCD ASC" : " ORDER BY " + String.join(", ", orderItems);
|
||||
}
|
||||
|
||||
private List<String> splitAlongDayFilterValues(Object value) {
|
||||
if (value == null) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
if (value instanceof List<?> listValue) {
|
||||
List<String> result = new ArrayList<>();
|
||||
for (Object item : listValue) {
|
||||
if (item != null && StrUtil.isNotBlank(String.valueOf(item))) {
|
||||
result.add(String.valueOf(item).trim());
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
if (value instanceof Object[] arrayValue) {
|
||||
List<String> result = new ArrayList<>();
|
||||
for (Object item : arrayValue) {
|
||||
if (item != null && StrUtil.isNotBlank(String.valueOf(item))) {
|
||||
result.add(String.valueOf(item).trim());
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
String text = String.valueOf(value).trim();
|
||||
if (StrUtil.isBlank(text)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
text = text.replace("[", "").replace("]", "").replace("\"", "").replace("'", "");
|
||||
List<String> result = new ArrayList<>();
|
||||
for (String item : text.split(",")) {
|
||||
String trimmed = item == null ? null : item.trim();
|
||||
if (StrUtil.isNotBlank(trimmed) && !result.contains(trimmed)) {
|
||||
result.add(trimmed);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private String buildAlongDrtpFilterCondition(DataSourceRequest.FilterDescriptor filter,
|
||||
Map<String, Object> paramMap,
|
||||
int[] indexHolder) {
|
||||
if (filter == null) {
|
||||
return "";
|
||||
}
|
||||
if (StrUtil.isNotBlank(filter.getField())) {
|
||||
return buildAlongDrtpLeafCondition(filter, paramMap, indexHolder);
|
||||
}
|
||||
if (CollUtil.isEmpty(filter.getFilters())) {
|
||||
return "";
|
||||
}
|
||||
List<String> conditions = new ArrayList<>();
|
||||
for (DataSourceRequest.FilterDescriptor child : filter.getFilters()) {
|
||||
String childSql = buildAlongDrtpFilterCondition(child, paramMap, indexHolder);
|
||||
if (StrUtil.isNotBlank(childSql)) {
|
||||
conditions.add(childSql);
|
||||
}
|
||||
}
|
||||
if (conditions.isEmpty()) {
|
||||
return "";
|
||||
}
|
||||
String logic = "or".equalsIgnoreCase(filter.getLogic()) ? " OR " : " AND ";
|
||||
return "(" + String.join(logic, conditions) + ")";
|
||||
}
|
||||
|
||||
private String buildAlongDrtpLeafCondition(DataSourceRequest.FilterDescriptor filter,
|
||||
Map<String, Object> paramMap,
|
||||
int[] indexHolder) {
|
||||
String column = mapAlongDrtpColumn(filter.getField());
|
||||
if (StrUtil.isBlank(column) || filter.getValue() == null) {
|
||||
return "";
|
||||
}
|
||||
String operator = StrUtil.blankToDefault(filter.getOperator(), "eq").toLowerCase();
|
||||
boolean dateField = "tm".equalsIgnoreCase(filter.getField()) || "dt".equalsIgnoreCase(filter.getField());
|
||||
String key = "alongDrtpParam" + indexHolder[0]++;
|
||||
switch (operator) {
|
||||
case "eq":
|
||||
paramMap.put(key, filter.getValue());
|
||||
return dateField
|
||||
? column + " = TO_DATE(SUBSTR(#{map." + key + "}, 1, 10), 'YYYY-MM-DD')"
|
||||
: column + " = #{map." + key + "}";
|
||||
case "neq":
|
||||
paramMap.put(key, filter.getValue());
|
||||
return dateField
|
||||
? column + " <> TO_DATE(SUBSTR(#{map." + key + "}, 1, 10), 'YYYY-MM-DD')"
|
||||
: column + " <> #{map." + key + "}";
|
||||
case "gt":
|
||||
paramMap.put(key, filter.getValue());
|
||||
return dateField
|
||||
? column + " > TO_DATE(SUBSTR(#{map." + key + "}, 1, 10), 'YYYY-MM-DD')"
|
||||
: column + " > #{map." + key + "}";
|
||||
case "gte":
|
||||
paramMap.put(key, filter.getValue());
|
||||
return dateField
|
||||
? column + " >= TO_DATE(SUBSTR(#{map." + key + "}, 1, 10), 'YYYY-MM-DD')"
|
||||
: column + " >= #{map." + key + "}";
|
||||
case "lt":
|
||||
paramMap.put(key, filter.getValue());
|
||||
return dateField
|
||||
? column + " < TO_DATE(SUBSTR(#{map." + key + "}, 1, 10), 'YYYY-MM-DD')"
|
||||
: column + " < #{map." + key + "}";
|
||||
case "lte":
|
||||
paramMap.put(key, filter.getValue());
|
||||
return dateField
|
||||
? column + " <= TO_DATE(SUBSTR(#{map." + key + "}, 1, 10), 'YYYY-MM-DD')"
|
||||
: column + " <= #{map." + key + "}";
|
||||
case "contains":
|
||||
paramMap.put(key, "%" + filter.getValue() + "%");
|
||||
return column + " LIKE #{map." + key + "}";
|
||||
case "in": {
|
||||
List<String> values = splitAlongDayFilterValues(filter.getValue());
|
||||
if (CollUtil.isEmpty(values)) {
|
||||
return "";
|
||||
}
|
||||
List<String> placeholders = new ArrayList<>();
|
||||
for (String item : values) {
|
||||
String itemKey = "alongDrtpParam" + indexHolder[0]++;
|
||||
paramMap.put(itemKey, item);
|
||||
placeholders.add(dateField
|
||||
? "TO_DATE(SUBSTR(#{map." + itemKey + "}, 1, 10), 'YYYY-MM-DD')"
|
||||
: "#{map." + itemKey + "}");
|
||||
}
|
||||
return column + " IN (" + String.join(", ", placeholders) + ")";
|
||||
}
|
||||
default:
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
private String mapAlongDrtpColumn(String field) {
|
||||
if (StrUtil.isBlank(field)) {
|
||||
return null;
|
||||
}
|
||||
return switch (field) {
|
||||
case "tm", "dt" -> "t.TM";
|
||||
case "stcd" -> "t.STCD";
|
||||
case "rstcd" -> "t.RSTCD";
|
||||
case "wt" -> "t.WT";
|
||||
case "stnm" -> "t.STNM";
|
||||
case "baseName", "basename" -> "t.BASENAME";
|
||||
case "baseId" -> "t.BASE_ID";
|
||||
case "ennm" -> "t.ENNM";
|
||||
case "month" -> "t.MONTH";
|
||||
case "year" -> "t.YEAR";
|
||||
case "drtp" -> "t.DRTP";
|
||||
case "dr" -> "t.DR";
|
||||
default -> null;
|
||||
};
|
||||
}
|
||||
|
||||
private String buildAlongDrtpOrderBySql(List<DataSourceRequest.SortDescriptor> sortList) {
|
||||
if (CollUtil.isEmpty(sortList)) {
|
||||
return " ORDER BY t.YEAR DESC NULLS LAST, t.MONTH DESC NULLS LAST, t.DRTP ASC NULLS LAST, t.DR ASC NULLS LAST, t.STCD ASC";
|
||||
}
|
||||
List<String> orderItems = new ArrayList<>();
|
||||
for (DataSourceRequest.SortDescriptor sortDescriptor : sortList) {
|
||||
if (sortDescriptor == null || StrUtil.isBlank(sortDescriptor.getField())) {
|
||||
continue;
|
||||
}
|
||||
String column = mapAlongDrtpColumn(sortDescriptor.getField());
|
||||
if (StrUtil.isBlank(column)) {
|
||||
continue;
|
||||
}
|
||||
String dir = "desc".equalsIgnoreCase(sortDescriptor.getDir()) ? "DESC" : "ASC";
|
||||
orderItems.add(column + " " + dir + " NULLS LAST");
|
||||
}
|
||||
return CollUtil.isEmpty(orderItems)
|
||||
? " ORDER BY t.YEAR DESC NULLS LAST, t.MONTH DESC NULLS LAST, t.DRTP ASC NULLS LAST, t.DR ASC NULLS LAST, t.STCD ASC"
|
||||
: " ORDER BY " + String.join(", ", orderItems);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -481,7 +816,8 @@ public class AlongDetailServiceImpl extends ServiceImpl<AlongDetailMapper, SdAlo
|
||||
|
||||
}
|
||||
if ("TIME".equals(dataType)) {
|
||||
sdWtrvdrtpSMapper.deleteWtrvRData(subList, DateUtil.now(), SecurityUtils.getCurrentUsername());
|
||||
// SecurityUtils.getCurrentUsername()
|
||||
sdWtrvdrtpSMapper.deleteWtrvRData(subList, DateUtil.now(), "admin");
|
||||
|
||||
// 删除小时数据后,需要重新统计对应的日数据和月数据
|
||||
Map<String, String[]> dateRangeMap = new HashMap<>();
|
||||
|
||||
@ -1660,6 +1660,7 @@ public class SdWtMonitorServiceImpl implements SdWtMonitorService {
|
||||
case "stnm" -> "t.STNM";
|
||||
case "baseId" -> "t.BASEID";
|
||||
case "dt" -> "t.DT";
|
||||
case "monthInt", "month" -> "EXTRACT(MONTH FROM t.DT)";
|
||||
case "wt", "actualTemp" -> "t.WT";
|
||||
case "sttp" -> "t.STTP";
|
||||
case "sumVal" -> "t.SUMVAL";
|
||||
@ -1873,7 +1874,18 @@ public class SdWtMonitorServiceImpl implements SdWtMonitorService {
|
||||
case "sttpName" -> "t.STTP_NAME";
|
||||
case "description" -> "t.DESCRIPTION";
|
||||
case "parentId" -> "t.PARENT_ID";
|
||||
// case "enable" -> "t.ENABLED";
|
||||
case "displayRecordUser" -> "t.DISPLAY_RECORD_USER";
|
||||
case "isolateType" -> "t.ISOLATE_TYPE";
|
||||
case "stbprpCnt" -> "t.STBPRP_CNT";
|
||||
case "recordUserName" -> "t.RECORD_USER_NAME";
|
||||
case "modifyUserName" -> "t.MODIFY_USER_NAME";
|
||||
case "displayDepartment" -> "t.DISPLAY_DEPARTMENT";
|
||||
case "enable" -> "t.ENABLE";
|
||||
case "filterContent" -> "t.FILTER_CONTENT";
|
||||
case "isTempStorage" -> "t.IS_TEMP_STORAGE";
|
||||
case "departmentId" -> "t.DEPARTMENT_ID";
|
||||
case "systemId" -> "t.SYSTEM_ID";
|
||||
case "platformId" -> "t.PLATFORM_ID";
|
||||
case "treeLevel" -> "t.TREE_LEVEL";
|
||||
case "hasChildren" -> "t.HAS_CHILDREN";
|
||||
case "fullPath" -> "t.FULL_PATH";
|
||||
@ -1912,23 +1924,55 @@ public class SdWtMonitorServiceImpl implements SdWtMonitorService {
|
||||
if (sortList != null) {
|
||||
for (DataSourceRequest.SortDescriptor sortDescriptor : sortList) {
|
||||
String field = sortDescriptor.getField();
|
||||
String dir = "desc".equalsIgnoreCase(sortDescriptor.getDir()) ? "DESC" : "ASC";
|
||||
String dir = "desc".equalsIgnoreCase(sortDescriptor.getDir()) || "des".equalsIgnoreCase(sortDescriptor.getDir()) ? "DESC" : "ASC";
|
||||
if ("baseStepSort".equals(field)) {
|
||||
orderColumns.add("NVL(baseStepSort, 999999) " + dir);
|
||||
orderColumns.add("NVL(baseStepSort, 999999) " + dir + " NULLS LAST");
|
||||
} else if ("rvcdStepSort".equals(field)) {
|
||||
// orderColumns.add("NVL(rvcdStepSort, 999999) " + dir);
|
||||
} else if ("hbrvcd".equals(field)) {
|
||||
orderColumns.add("NVL(hbrvcd, '~') " + dir);
|
||||
orderColumns.add("NVL(rvcdStepSort, 999999) " + dir + " NULLS LAST");
|
||||
} else if ("rstcdStepSort".equals(field)) {
|
||||
// orderColumns.add("NVL(rstcdStepSort, 999999) " + dir);
|
||||
orderColumns.add("NVL(rstcdStepSort, 999999) " + dir + " NULLS LAST");
|
||||
} else if ("siteStepSort".equals(field)) {
|
||||
orderColumns.add("NVL(siteStepSort, 999999) " + dir);
|
||||
orderColumns.add("NVL(siteStepSort, 999999) " + dir + " NULLS LAST");
|
||||
} else if ("baseId".equals(field)) {
|
||||
orderColumns.add("NVL(baseId, '~') " + dir + " NULLS LAST");
|
||||
} else if ("hbrvcd".equals(field)) {
|
||||
orderColumns.add("NVL(hbrvcd, '~') " + dir + " NULLS LAST");
|
||||
} else if ("sttpCode".equals(field)) {
|
||||
orderColumns.add("NVL(sttpCode, '~') " + dir + " NULLS LAST");
|
||||
} else if ("sttpName".equals(field)) {
|
||||
orderColumns.add("NVL(sttpName, '~') " + dir + " NULLS LAST");
|
||||
} else if ("sttpFullPath".equals(field)) {
|
||||
orderColumns.add("NVL(sttpFullPath, '~') " + dir + " NULLS LAST");
|
||||
} else if ("stnm".equals(field)) {
|
||||
orderColumns.add("NVL(stnm, '~') " + dir);
|
||||
orderColumns.add("NVL(stnm, '~') " + dir + " NULLS LAST");
|
||||
} else if ("ennm".equals(field)) {
|
||||
orderColumns.add("NVL(ennm, '~') " + dir);
|
||||
orderColumns.add("NVL(ennm, '~') " + dir + " NULLS LAST");
|
||||
} else if ("stcd".equals(field)) {
|
||||
orderColumns.add("NVL(stcd, '~') " + dir);
|
||||
orderColumns.add("NVL(stcd, '~') " + dir + " NULLS LAST");
|
||||
} else if ("fhstcd".equals(field)) {
|
||||
orderColumns.add("NVL(fhstcd, '~') " + dir + " NULLS LAST");
|
||||
} else if ("rstcd".equals(field)) {
|
||||
orderColumns.add("NVL(rstcd, '~') " + dir + " NULLS LAST");
|
||||
} else if ("stCode".equals(field)) {
|
||||
orderColumns.add("NVL(stCode, '~') " + dir + " NULLS LAST");
|
||||
} else if ("stName".equals(field)) {
|
||||
orderColumns.add("NVL(stName, '~') " + dir + " NULLS LAST");
|
||||
} else if ("dvtp".equals(field)) {
|
||||
orderColumns.add("NVL(dvtp, '~') " + dir + " NULLS LAST");
|
||||
} else if ("jcdt".equals(field)) {
|
||||
orderColumns.add("jcdt " + dir + " NULLS LAST");
|
||||
} else if ("stindx".equals(field)) {
|
||||
orderColumns.add("NVL(stindx, '~') " + dir + " NULLS LAST");
|
||||
} else if ("coenvwState".equals(field)) {
|
||||
orderColumns.add("NVL(coenvwState, -1) " + dir + " NULLS LAST");
|
||||
} else if ("bldsttCcode".equals(field)) {
|
||||
orderColumns.add("NVL(bldsttCcode, '~') " + dir + " NULLS LAST");
|
||||
} else if ("bldsttCcodeName".equals(field)) {
|
||||
orderColumns.add("NVL(bldsttCcodeName, '~') " + dir + " NULLS LAST");
|
||||
} else if ("dtin".equals(field)) {
|
||||
orderColumns.add("NVL(dtin, -1) " + dir + " NULLS LAST");
|
||||
} else if ("dtinName".equals(field)) {
|
||||
orderColumns.add("CASE WHEN NVL(dtin, 0) = 1 THEN '已接入' ELSE '未接入' END " + dir + " NULLS LAST");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -552,8 +552,11 @@ public class ZqMonitorServiceImpl implements ZqMonitorService {
|
||||
case "hbrvcd" -> "t.HBRVCD";
|
||||
case "hbrvcdName" -> "t.HBRVCDNAME";
|
||||
case "bldsttCcode" -> "t.BLDSTTCCODE";
|
||||
case "vdid" -> "t.VDID";
|
||||
case "rzVideo" -> "t.RZVIDEO";
|
||||
case "speedVideo" -> "t.SPEEDVIDEO";
|
||||
case "rzVideoPath" -> "t.RZVIDEOPATH";
|
||||
case "speedVideoPath" -> "t.SPEEDVIDEOPATH";
|
||||
case "baseStepSort" -> "t.BASESTEPSORT";
|
||||
case "rvcdStepSort" -> "t.RVCDSTEPSORT";
|
||||
case "rstcdStepSort" -> "t.RSTCDSTEPSORT";
|
||||
@ -916,18 +919,51 @@ public class ZqMonitorServiceImpl implements ZqMonitorService {
|
||||
case "stnm" -> "t.STNM";
|
||||
case "tm" -> "t.TM";
|
||||
case "sttp", "sttpCode" -> "t.STTP";
|
||||
case "lgtd" -> "t.LGTD";
|
||||
case "lttd" -> "t.LTTD";
|
||||
case "elev" -> "t.ELEV";
|
||||
case "stlc" -> "t.STLC";
|
||||
case "jcdt" -> "t.JCDT";
|
||||
case "wddt" -> "t.WDDT";
|
||||
case "bldsttCode", "bldsttCcode" -> "t.BLDSTT_CODE";
|
||||
case "bldsttCcodeName" -> "CASE WHEN t.BLDSTT_CODE IN ('1', '10', '11') THEN '已建' WHEN t.BLDSTT_CODE IN ('2', '7', '8') THEN '在建' ELSE '未建/规划' END";
|
||||
case "introduce" -> "t.INTRODUCE";
|
||||
case "logo" -> "t.LOGO";
|
||||
case "inffile" -> "t.INFFILE";
|
||||
case "usfl" -> "t.USFL";
|
||||
case "dtin" -> "t.DTIN";
|
||||
case "dtinSrc" -> "t.DTIN_SRC";
|
||||
case "dtinType" -> "t.DTIN_TYPE";
|
||||
case "dtinTm" -> "t.DTIN_TM";
|
||||
case "mway" -> "t.MWAY";
|
||||
case "mwayName" -> "CASE NVL(t.MWAY, 0) WHEN 1 THEN '人工' WHEN 2 THEN '自动' ELSE '未知' END";
|
||||
case "stindx" -> "t.STINDX";
|
||||
case "orderIndex" -> "t.ORDER_INDEX";
|
||||
case "dmstcd" -> "t.DMSTCD";
|
||||
case "rstcd" -> "t.RSTCD";
|
||||
case "ennm" -> "eng.ENNM";
|
||||
case "baseId" -> "eng.BASE_ID";
|
||||
case "baseName" -> "hb.BASENAME";
|
||||
case "hbrvcd" -> "eng.HBRVCD";
|
||||
case "hbrvcdName" -> "hbrv.HBRVNM";
|
||||
case "rvcd" -> "eng.RVCD";
|
||||
case "rvcdName" -> "rv.RVNM";
|
||||
case "addvcd" -> "eng.ADDVCD";
|
||||
case "addvcdName" -> "addv.ADDVNM";
|
||||
case "fhstcd" -> "t.FHSTCD";
|
||||
case "mway" -> "t.MWAY";
|
||||
case "dtin" -> "t.DTIN";
|
||||
case "dtinType" -> "t.DTIN_TYPE";
|
||||
case "orderIndex" -> "t.ORDER_INDEX";
|
||||
case "ispro" -> "t.ISPRO";
|
||||
case "project" -> "t.PROJECT";
|
||||
case "dtfrqcy" -> "t.DTFRQCY";
|
||||
case "remark" -> "t.REMARK";
|
||||
case "vlsr" -> "t.VLSR";
|
||||
case "vlsrTm" -> "t.VLSR_TM";
|
||||
case "recordUser" -> "t.RECORD_USER";
|
||||
case "recordTime" -> "t.RECORD_TIME";
|
||||
case "modifyUser" -> "t.MODIFY_USER";
|
||||
case "modifyTime" -> "t.MODIFY_TIME";
|
||||
case "isDeleted" -> "t.IS_DELETED";
|
||||
case "deleteUser" -> "t.DELETE_USER";
|
||||
case "deleteTime" -> "t.DELETE_TIME";
|
||||
default -> null;
|
||||
};
|
||||
if (StrUtil.isBlank(column)) {
|
||||
|
||||
@ -18,18 +18,39 @@ public class DataSourceRequestUtil {
|
||||
|
||||
private static final Pattern SAFE_IDENTIFIER = Pattern.compile("^[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z_][A-Za-z0-9_]*)*$");
|
||||
|
||||
// public static <T> Page<T> getPage(DataSourceRequest request) {
|
||||
// if (request == null) {
|
||||
// return null;
|
||||
// }
|
||||
// int take = request.getTake();
|
||||
// int skip = request.getSkip();
|
||||
// if (take <= 0) {
|
||||
// return null;
|
||||
// }
|
||||
// Page<T> page = new Page<>();
|
||||
// page.setSize((long) take);
|
||||
// page.setCurrent(skip / take + 1L);
|
||||
// return page;
|
||||
// }
|
||||
|
||||
|
||||
public static <T> Page<T> getPage(DataSourceRequest request) {
|
||||
if (request == null) {
|
||||
return null;
|
||||
}
|
||||
int take = request.getTake();
|
||||
int skip = request.getSkip();
|
||||
if (take <= 0) {
|
||||
return null;
|
||||
int pageNum = request.getSkip(); // 前端传的页码(从1开始)
|
||||
int pageSize = request.getTake(); // 每页条数
|
||||
|
||||
if (pageSize <= 0) {
|
||||
return null; // 或 throw new IllegalArgumentException("每页条数必须大于0")
|
||||
}
|
||||
if (pageNum < 1) {
|
||||
pageNum = 1; // 页码最小为1
|
||||
}
|
||||
|
||||
Page<T> page = new Page<>();
|
||||
page.setSize((long) take);
|
||||
page.setCurrent(skip / take + 1L);
|
||||
page.setSize((long) pageSize);
|
||||
page.setCurrent(pageNum); // 直接使用页码
|
||||
return page;
|
||||
}
|
||||
|
||||
|
||||
@ -32,6 +32,49 @@ export function postIdUrl(data: any) {
|
||||
}
|
||||
});
|
||||
}
|
||||
// 查询站点建设状态
|
||||
export function getBuildState(data: any) {
|
||||
return request({
|
||||
url: '/api/dec-lygk-base-server/base/vmsstbprpt/GetKendoList',
|
||||
method: 'post',
|
||||
data: {
|
||||
filter: data.filter,
|
||||
select: ['bldsttCcode', 'engIwtCode', 'engDwtCode']
|
||||
}
|
||||
});
|
||||
}
|
||||
// 查询鱼类栖息地监测数据类型可用性
|
||||
export function getFishTab(stcd: string) {
|
||||
return request({
|
||||
url: `/api/wmp-env-server/we/wer/getWeDefaultData`,
|
||||
method: 'get',
|
||||
params: { stcd }
|
||||
});
|
||||
}
|
||||
// 检查水质站是否启用 AI 预测功能
|
||||
export function checkAnalysisShow(data: any) {
|
||||
return request({
|
||||
url: '/api/dec-lygk-base-server/base/vmsstbprpt/GetKendoList',
|
||||
method: 'post',
|
||||
data
|
||||
});
|
||||
}
|
||||
// 查询站点的关联子站点 (垂向水温、AI 识别)
|
||||
export function getStInfoByStcd(params: any) {
|
||||
return request({
|
||||
url: '/api/dec-lygk-base-server/base/msstbprpt/getStInfoByStcd',
|
||||
method: 'get',
|
||||
params
|
||||
});
|
||||
}
|
||||
// 检查电站是否有专题配置数据
|
||||
export function checkPowerStationTopic(data: any) {
|
||||
return request({
|
||||
url: '/api/wmp-sys-server/sys/psbmodulelbb/GetKendoList',
|
||||
method: 'post',
|
||||
data
|
||||
});
|
||||
}
|
||||
// 全景影像
|
||||
export function getPanoramaList(data: any) {
|
||||
return request({
|
||||
@ -43,7 +86,7 @@ export function getPanoramaList(data: any) {
|
||||
// 实时视频
|
||||
export function getVideoList(data: any) {
|
||||
return request({
|
||||
url: '/vd/vmsstbprpt/GetKendoList',
|
||||
url: '/api/dec-lygk-base-server/base/msstbprpt/GetKendoList',
|
||||
method: 'post',
|
||||
data
|
||||
});
|
||||
|
||||
@ -36,7 +36,6 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, computed, onMounted, watch, nextTick, h, useSlots } from 'vue';
|
||||
import { Tooltip } from 'ant-design-vue';
|
||||
import { calcTableScrollY } from '@/utils/index';
|
||||
|
||||
// --- Types ---
|
||||
@ -381,29 +380,12 @@ const enhancedColumns = computed(() => {
|
||||
};
|
||||
}
|
||||
|
||||
// 普通列,添加 ellipsis 和 tooltip
|
||||
// 普通列,添加 ellipsis
|
||||
if (!props.enableEllipsis) return col;
|
||||
|
||||
return {
|
||||
...col,
|
||||
ellipsis: true,
|
||||
customRender: ({ text }: any) => {
|
||||
const content = String(text ?? props.emptyPlaceholder);
|
||||
return h(Tooltip, { title: content }, () =>
|
||||
h(
|
||||
'div',
|
||||
{
|
||||
class: 'table-cell-ellipsis',
|
||||
style: {
|
||||
overflow: 'hidden',
|
||||
whiteSpace: 'nowrap',
|
||||
textOverflow: 'ellipsis'
|
||||
}
|
||||
},
|
||||
content
|
||||
)
|
||||
);
|
||||
}
|
||||
ellipsis: true
|
||||
};
|
||||
});
|
||||
});
|
||||
|
||||
@ -2011,7 +2011,7 @@ const FPPointColumns4: Array<any> = [
|
||||
type: '',
|
||||
url: ''
|
||||
},
|
||||
{
|
||||
{
|
||||
name: '上游码头位置',
|
||||
filed: 'updcklc',
|
||||
visible: true,
|
||||
@ -2095,14 +2095,14 @@ const FPPointColumns4: Array<any> = [
|
||||
type: 'input',
|
||||
url: ''
|
||||
},
|
||||
{
|
||||
{
|
||||
name: '过鱼时间',
|
||||
filed: 'psfishtm',
|
||||
visible: true,
|
||||
type: 'select',
|
||||
url: ''
|
||||
},
|
||||
{
|
||||
{
|
||||
name: '建成时间',
|
||||
filed: 'jcdt',
|
||||
visible: true,
|
||||
@ -2222,8 +2222,7 @@ const FPPointColumns5: Array<any> = [
|
||||
type: 'date',
|
||||
format: 'YYYY-MM-DD',
|
||||
url: ''
|
||||
},
|
||||
|
||||
}
|
||||
];
|
||||
//鱼类增殖站 基础信息
|
||||
const FBPointColumns: Array<any> = [
|
||||
@ -3458,6 +3457,697 @@ const DwOnePointColumns: Array<any> = [
|
||||
url: ''
|
||||
}
|
||||
];
|
||||
const EQPointColumns2: Array<any> = [
|
||||
{
|
||||
name: '基本属性',
|
||||
visible: false,
|
||||
ruleTips: '',
|
||||
type: '',
|
||||
url: ''
|
||||
},
|
||||
{
|
||||
name: '设施名称',
|
||||
filed: 'stnm',
|
||||
visible: true,
|
||||
type: 'input',
|
||||
url: ''
|
||||
},
|
||||
{
|
||||
name: '站址',
|
||||
filed: 'stlc',
|
||||
visible: true,
|
||||
type: 'select',
|
||||
url: ''
|
||||
},
|
||||
{
|
||||
name: '所属流域',
|
||||
filed: 'hbrvcdName',
|
||||
visible: true,
|
||||
type: 'select',
|
||||
url: ''
|
||||
},
|
||||
{
|
||||
name: '经度(°)',
|
||||
filed: 'lgtd',
|
||||
visible: true,
|
||||
type: 'number',
|
||||
toFixed: 6,
|
||||
url: ''
|
||||
},
|
||||
{
|
||||
name: '纬度(°)',
|
||||
filed: 'lttd',
|
||||
visible: true,
|
||||
type: 'number',
|
||||
toFixed: 6,
|
||||
url: ''
|
||||
},
|
||||
{
|
||||
name: '所属电站',
|
||||
filed: 'ennm',
|
||||
visible: true,
|
||||
type: 'select',
|
||||
url: ''
|
||||
},
|
||||
{
|
||||
name: '生态放流闸',
|
||||
visible: false,
|
||||
ruleTips: '',
|
||||
type: '',
|
||||
url: ''
|
||||
},
|
||||
{
|
||||
name: '开工日期',
|
||||
filed: 'ststdt',
|
||||
visible: true,
|
||||
type: 'date',
|
||||
format: 'YYYY-MM-DD',
|
||||
url: ''
|
||||
},
|
||||
{
|
||||
name: '建成日期',
|
||||
filed: 'jcdt',
|
||||
visible: true,
|
||||
type: 'date',
|
||||
format: 'YYYY-MM-DD',
|
||||
url: ''
|
||||
},
|
||||
{
|
||||
name: '孔口尺寸(m)',
|
||||
filed: 'flksz',
|
||||
visible: true,
|
||||
type: 'input',
|
||||
url: ''
|
||||
},
|
||||
{
|
||||
name: '进水口底板高程(m)',
|
||||
filed: 'jskgc',
|
||||
visible: true,
|
||||
type: 'input',
|
||||
url: ''
|
||||
},
|
||||
{
|
||||
name: '出水口底板高程(m)',
|
||||
filed: 'outflrelev',
|
||||
visible: true,
|
||||
type: 'input',
|
||||
url: ''
|
||||
},
|
||||
{
|
||||
name: '死水位时保证流量(m³/s)',
|
||||
filed: 'ddzgq',
|
||||
visible: true,
|
||||
type: 'input',
|
||||
url: ''
|
||||
},
|
||||
{
|
||||
name: '最大泄放流量(m³/s)',
|
||||
filed: 'flkq',
|
||||
visible: true,
|
||||
type: 'input',
|
||||
url: ''
|
||||
},
|
||||
{
|
||||
name: '投资(亿元)',
|
||||
filed: 'inv',
|
||||
visible: true,
|
||||
type: 'number',
|
||||
toFixed: 6,
|
||||
url: ''
|
||||
},
|
||||
{
|
||||
name: '投资是否计入工程主体',
|
||||
filed: 'invinmn',
|
||||
visible: true,
|
||||
type: 'select',
|
||||
url: ''
|
||||
},
|
||||
{
|
||||
name: '结构形式',
|
||||
filed: 'frntwlltyp',
|
||||
visible: true,
|
||||
type: 'select',
|
||||
url: ''
|
||||
}
|
||||
];
|
||||
const EQPointColumns5: Array<any> = [
|
||||
{
|
||||
name: '基本属性',
|
||||
visible: false,
|
||||
ruleTips: '',
|
||||
type: '',
|
||||
url: ''
|
||||
},
|
||||
{
|
||||
name: '设施名称',
|
||||
filed: 'stnm',
|
||||
visible: true,
|
||||
type: 'input',
|
||||
url: ''
|
||||
},
|
||||
{
|
||||
name: '站址',
|
||||
filed: 'stlc',
|
||||
visible: true,
|
||||
type: 'select',
|
||||
url: ''
|
||||
},
|
||||
{
|
||||
name: '所属流域',
|
||||
filed: 'hbrvcdName',
|
||||
visible: true,
|
||||
type: 'select',
|
||||
url: ''
|
||||
},
|
||||
{
|
||||
name: '经度(°)',
|
||||
filed: 'lgtd',
|
||||
visible: true,
|
||||
type: 'number',
|
||||
toFixed: 6,
|
||||
url: ''
|
||||
},
|
||||
{
|
||||
name: '纬度(°)',
|
||||
filed: 'lttd',
|
||||
visible: true,
|
||||
type: 'number',
|
||||
toFixed: 6,
|
||||
url: ''
|
||||
},
|
||||
{
|
||||
name: '所属电站',
|
||||
filed: 'ennm',
|
||||
visible: true,
|
||||
type: 'select',
|
||||
url: ''
|
||||
},
|
||||
{
|
||||
name: '基荷发电',
|
||||
visible: false,
|
||||
ruleTips: '',
|
||||
type: '',
|
||||
url: ''
|
||||
},
|
||||
{
|
||||
name: '开工日期',
|
||||
filed: 'ststdt',
|
||||
visible: true,
|
||||
type: 'date',
|
||||
format: 'YYYY-MM-DD',
|
||||
url: ''
|
||||
},
|
||||
{
|
||||
name: '建成日期',
|
||||
filed: 'jcdt',
|
||||
visible: true,
|
||||
type: 'date',
|
||||
format: 'YYYY-MM-DD',
|
||||
url: ''
|
||||
},
|
||||
{
|
||||
name: '基荷发电工况(MW)',
|
||||
filed: 'jhfdgk',
|
||||
visible: true,
|
||||
type: 'input',
|
||||
url: ''
|
||||
},
|
||||
{
|
||||
name: '发电流量(m³/s)',
|
||||
filed: 'fdll',
|
||||
visible: true,
|
||||
type: 'input',
|
||||
url: ''
|
||||
},
|
||||
{
|
||||
name: '进水口底板高程(m)',
|
||||
filed: 'jskgc',
|
||||
visible: true,
|
||||
type: 'input',
|
||||
url: ''
|
||||
},
|
||||
{
|
||||
name: '出水口底板高程(m)',
|
||||
filed: 'outflrelev',
|
||||
visible: true,
|
||||
type: 'input',
|
||||
url: ''
|
||||
}
|
||||
];
|
||||
const EQPointColumns3: Array<any> = [
|
||||
{
|
||||
name: '基本属性',
|
||||
visible: false,
|
||||
ruleTips: '',
|
||||
type: '',
|
||||
url: ''
|
||||
},
|
||||
{
|
||||
name: '设施名称',
|
||||
filed: 'stnm',
|
||||
visible: true,
|
||||
type: 'input',
|
||||
url: ''
|
||||
},
|
||||
{
|
||||
name: '站址',
|
||||
filed: 'stlc',
|
||||
visible: true,
|
||||
type: 'select',
|
||||
url: ''
|
||||
},
|
||||
{
|
||||
name: '所属流域',
|
||||
filed: 'hbrvcdName',
|
||||
visible: true,
|
||||
type: 'select',
|
||||
url: ''
|
||||
},
|
||||
{
|
||||
name: '经度(°)',
|
||||
filed: 'lgtd',
|
||||
visible: true,
|
||||
type: 'number',
|
||||
toFixed: 6,
|
||||
url: ''
|
||||
},
|
||||
{
|
||||
name: '纬度(°)',
|
||||
filed: 'lttd',
|
||||
visible: true,
|
||||
type: 'number',
|
||||
toFixed: 6,
|
||||
url: ''
|
||||
},
|
||||
{
|
||||
name: '所属电站',
|
||||
filed: 'ennm',
|
||||
visible: true,
|
||||
type: 'select',
|
||||
url: ''
|
||||
},
|
||||
{
|
||||
name: '生态放流洞',
|
||||
visible: false,
|
||||
ruleTips: '',
|
||||
type: '',
|
||||
url: ''
|
||||
},
|
||||
{
|
||||
name: '开工日期',
|
||||
filed: 'ststdt',
|
||||
visible: true,
|
||||
type: 'date',
|
||||
format: 'YYYY-MM-DD',
|
||||
url: ''
|
||||
},
|
||||
{
|
||||
name: '建成日期',
|
||||
filed: 'jcdt',
|
||||
visible: true,
|
||||
type: 'date',
|
||||
format: 'YYYY-MM-DD',
|
||||
url: ''
|
||||
},
|
||||
{
|
||||
name: '孔口尺寸(m)',
|
||||
filed: 'flksz',
|
||||
visible: true,
|
||||
type: 'input',
|
||||
url: ''
|
||||
},
|
||||
{
|
||||
name: '进水口底板高程(m)',
|
||||
filed: 'jskgc',
|
||||
visible: true,
|
||||
type: 'input',
|
||||
url: ''
|
||||
},
|
||||
{
|
||||
name: '出水口底板高程(m)',
|
||||
filed: 'outflrelev',
|
||||
visible: true,
|
||||
type: 'input',
|
||||
url: ''
|
||||
},
|
||||
{
|
||||
name: '死水位时保证流量(m³/s)',
|
||||
filed: 'ddzgq',
|
||||
visible: true,
|
||||
type: 'input',
|
||||
url: ''
|
||||
},
|
||||
{
|
||||
name: '最大泄放流量(m³/s)',
|
||||
filed: 'flkq',
|
||||
visible: true,
|
||||
type: 'input',
|
||||
url: ''
|
||||
},
|
||||
{
|
||||
name: '投资(亿元)',
|
||||
filed: 'inv',
|
||||
visible: true,
|
||||
type: 'number',
|
||||
toFixed: 6,
|
||||
url: ''
|
||||
},
|
||||
{
|
||||
name: '投资是否计入工程主体',
|
||||
filed: 'invinmn',
|
||||
visible: true,
|
||||
type: 'select',
|
||||
url: ''
|
||||
},
|
||||
{
|
||||
name: '结构形式',
|
||||
filed: 'frntwlltyp',
|
||||
visible: true,
|
||||
type: 'select',
|
||||
url: ''
|
||||
}
|
||||
];
|
||||
|
||||
const EQPointColumns4: Array<any> = [
|
||||
{
|
||||
name: '基本属性',
|
||||
visible: false,
|
||||
ruleTips: '',
|
||||
type: '',
|
||||
url: ''
|
||||
},
|
||||
{
|
||||
name: '设施名称',
|
||||
filed: 'stnm',
|
||||
visible: true,
|
||||
type: 'input',
|
||||
url: ''
|
||||
},
|
||||
{
|
||||
name: '站址',
|
||||
filed: 'stlc',
|
||||
visible: true,
|
||||
type: 'select',
|
||||
url: ''
|
||||
},
|
||||
{
|
||||
name: '所属流域',
|
||||
filed: 'hbrvcdName',
|
||||
visible: true,
|
||||
type: 'select',
|
||||
url: ''
|
||||
},
|
||||
{
|
||||
name: '经度(°)',
|
||||
filed: 'lgtd',
|
||||
visible: true,
|
||||
type: 'number',
|
||||
toFixed: 6,
|
||||
url: ''
|
||||
},
|
||||
{
|
||||
name: '纬度(°)',
|
||||
filed: 'lttd',
|
||||
visible: true,
|
||||
type: 'number',
|
||||
toFixed: 6,
|
||||
url: ''
|
||||
},
|
||||
{
|
||||
name: '所属电站',
|
||||
filed: 'ennm',
|
||||
visible: true,
|
||||
type: 'select',
|
||||
url: ''
|
||||
},
|
||||
{
|
||||
name: '生态放流管',
|
||||
visible: false,
|
||||
ruleTips: '',
|
||||
type: '',
|
||||
url: ''
|
||||
},
|
||||
{
|
||||
name: '开工日期',
|
||||
filed: 'ststdt',
|
||||
visible: true,
|
||||
type: 'date',
|
||||
format: 'YYYY-MM-DD',
|
||||
url: ''
|
||||
},
|
||||
{
|
||||
name: '建成日期',
|
||||
filed: 'jcdt',
|
||||
visible: true,
|
||||
type: 'date',
|
||||
format: 'YYYY-MM-DD',
|
||||
url: ''
|
||||
},
|
||||
{
|
||||
name: '孔口尺寸(m)',
|
||||
filed: 'flksz',
|
||||
visible: true,
|
||||
type: 'input',
|
||||
url: ''
|
||||
},
|
||||
{
|
||||
name: '进水口底板高程(m)',
|
||||
filed: 'jskgc',
|
||||
visible: true,
|
||||
type: 'input',
|
||||
url: ''
|
||||
},
|
||||
{
|
||||
name: '出水口底板高程(m)',
|
||||
filed: 'outflrelev',
|
||||
visible: true,
|
||||
type: 'input',
|
||||
url: ''
|
||||
},
|
||||
{
|
||||
name: '死水位时保证流量(m³/s)',
|
||||
filed: 'ddzgq',
|
||||
visible: true,
|
||||
type: 'input',
|
||||
url: ''
|
||||
},
|
||||
{
|
||||
name: '最大泄放流量(m³/s)',
|
||||
filed: 'flkq',
|
||||
visible: true,
|
||||
type: 'input',
|
||||
url: ''
|
||||
},
|
||||
{
|
||||
name: '投资(亿元)',
|
||||
filed: 'inv',
|
||||
visible: true,
|
||||
type: 'number',
|
||||
toFixed: 6,
|
||||
url: ''
|
||||
},
|
||||
{
|
||||
name: '投资是否计入工程主体',
|
||||
filed: 'invinmn',
|
||||
visible: true,
|
||||
type: 'select',
|
||||
url: ''
|
||||
},
|
||||
{
|
||||
name: '结构形式',
|
||||
filed: 'frntwlltyp',
|
||||
visible: true,
|
||||
type: 'select',
|
||||
url: ''
|
||||
}
|
||||
];
|
||||
const EQPointColumns1: Array<any> = [
|
||||
{
|
||||
name: '基本属性',
|
||||
visible: false,
|
||||
ruleTips: '',
|
||||
type: '',
|
||||
url: ''
|
||||
},
|
||||
{
|
||||
name: '设施名称',
|
||||
filed: 'stnm',
|
||||
visible: true,
|
||||
type: 'input',
|
||||
url: ''
|
||||
},
|
||||
{
|
||||
name: '站址',
|
||||
filed: 'stlc',
|
||||
visible: true,
|
||||
type: 'select',
|
||||
url: ''
|
||||
},
|
||||
{
|
||||
name: '所属流域',
|
||||
filed: 'hbrvcdName',
|
||||
visible: true,
|
||||
type: 'select',
|
||||
url: ''
|
||||
},
|
||||
{
|
||||
name: '经度(°)',
|
||||
filed: 'lgtd',
|
||||
visible: true,
|
||||
type: 'number',
|
||||
toFixed: 6,
|
||||
url: ''
|
||||
},
|
||||
{
|
||||
name: '纬度(°)',
|
||||
filed: 'lttd',
|
||||
visible: true,
|
||||
type: 'number',
|
||||
toFixed: 6,
|
||||
url: ''
|
||||
},
|
||||
{
|
||||
name: '所属电站',
|
||||
filed: 'ennm',
|
||||
visible: true,
|
||||
type: 'select',
|
||||
url: ''
|
||||
},
|
||||
{
|
||||
name: '生态放流孔',
|
||||
visible: false,
|
||||
ruleTips: '',
|
||||
type: '',
|
||||
url: ''
|
||||
},
|
||||
{
|
||||
name: '开工日期',
|
||||
filed: 'ststdt',
|
||||
visible: true,
|
||||
type: 'date',
|
||||
format: 'YYYY-MM-DD',
|
||||
url: ''
|
||||
},
|
||||
{
|
||||
name: '建成日期',
|
||||
filed: 'jcdt',
|
||||
visible: true,
|
||||
type: 'date',
|
||||
format: 'YYYY-MM-DD',
|
||||
url: ''
|
||||
},
|
||||
{
|
||||
name: '孔口尺寸(m)',
|
||||
filed: 'flksz',
|
||||
visible: true,
|
||||
type: 'input',
|
||||
url: ''
|
||||
},
|
||||
{
|
||||
name: '进水口底板高程(m)',
|
||||
filed: 'jskgc',
|
||||
visible: true,
|
||||
type: 'input',
|
||||
url: ''
|
||||
},
|
||||
{
|
||||
name: '出水口底板高程(m)',
|
||||
filed: 'outflrelev',
|
||||
visible: true,
|
||||
type: 'input',
|
||||
url: ''
|
||||
},
|
||||
{
|
||||
name: '死水位时保证流量(m³/s)',
|
||||
filed: 'ddzgq',
|
||||
visible: true,
|
||||
type: 'input',
|
||||
url: ''
|
||||
},
|
||||
{
|
||||
name: '最大泄放流量(m³/s)',
|
||||
filed: 'flkq',
|
||||
visible: true,
|
||||
type: 'input',
|
||||
url: ''
|
||||
},
|
||||
{
|
||||
name: '投资(亿元)',
|
||||
filed: 'inv',
|
||||
visible: true,
|
||||
type: 'number',
|
||||
toFixed: 6,
|
||||
url: ''
|
||||
},
|
||||
{
|
||||
name: '投资是否计入工程主体',
|
||||
filed: 'invinmn',
|
||||
visible: true,
|
||||
type: 'select',
|
||||
url: ''
|
||||
},
|
||||
{
|
||||
name: '结构形式',
|
||||
filed: 'frntwlltyp',
|
||||
visible: true,
|
||||
type: 'select',
|
||||
url: ''
|
||||
}
|
||||
];
|
||||
const EQPointColumns7: Array<any> = [
|
||||
{
|
||||
name: '基本属性',
|
||||
visible: false,
|
||||
ruleTips: '',
|
||||
type: '',
|
||||
url: ''
|
||||
},
|
||||
{
|
||||
name: '设施名称',
|
||||
filed: 'stnm',
|
||||
visible: true,
|
||||
type: 'input',
|
||||
url: ''
|
||||
},
|
||||
{
|
||||
name: '站址',
|
||||
filed: 'stlc',
|
||||
visible: true,
|
||||
type: 'select',
|
||||
url: ''
|
||||
},
|
||||
{
|
||||
name: '所属流域',
|
||||
filed: 'hbrvcdName',
|
||||
visible: true,
|
||||
type: 'select',
|
||||
url: ''
|
||||
},
|
||||
{
|
||||
name: '经度(°)',
|
||||
filed: 'lgtd',
|
||||
visible: true,
|
||||
type: 'number',
|
||||
toFixed: 6,
|
||||
url: ''
|
||||
},
|
||||
{
|
||||
name: '纬度(°)',
|
||||
filed: 'lttd',
|
||||
visible: true,
|
||||
type: 'number',
|
||||
toFixed: 6,
|
||||
url: ''
|
||||
},
|
||||
{
|
||||
name: '所属电站',
|
||||
filed: 'ennm',
|
||||
visible: true,
|
||||
type: 'select',
|
||||
url: ''
|
||||
},
|
||||
|
||||
];
|
||||
//阶段属性
|
||||
const basicFilterColumns: Array<any> = [
|
||||
{
|
||||
@ -4183,6 +4873,12 @@ export {
|
||||
DwFivePointColumns,
|
||||
DwSixPointColumns,
|
||||
DwOnePointColumns,
|
||||
EQPointColumns2,
|
||||
EQPointColumns5,
|
||||
EQPointColumns3,
|
||||
EQPointColumns4,
|
||||
EQPointColumns1,
|
||||
EQPointColumns7,
|
||||
StinfoAiVidoPointColumns,
|
||||
basicFilterColumns,
|
||||
tabsWithTwoColumns,
|
||||
|
||||
@ -130,6 +130,12 @@ import {
|
||||
FBPointColumns,
|
||||
VaPointColumns,
|
||||
VPPointColumns,
|
||||
EQPointColumns1,
|
||||
EQPointColumns2,
|
||||
EQPointColumns5,
|
||||
EQPointColumns3,
|
||||
EQPointColumns4,
|
||||
EQPointColumns7,
|
||||
wePointColumns,
|
||||
waPointColumns,
|
||||
DwPointColumns,
|
||||
@ -232,6 +238,30 @@ const columnsConfig = ref([
|
||||
{
|
||||
type: 'VP',
|
||||
columns: VPPointColumns
|
||||
},
|
||||
{
|
||||
type: 'EQ_1',
|
||||
columns: EQPointColumns1
|
||||
},
|
||||
{
|
||||
type: 'EQ_2',
|
||||
columns: EQPointColumns2
|
||||
},
|
||||
{
|
||||
type: 'EQ_5',
|
||||
columns: EQPointColumns5
|
||||
},
|
||||
{
|
||||
type: 'EQ_3',
|
||||
columns: EQPointColumns3
|
||||
},
|
||||
{
|
||||
type: 'EQ_4',
|
||||
columns: EQPointColumns4
|
||||
},
|
||||
{
|
||||
type: 'EQ_7',
|
||||
columns: EQPointColumns7
|
||||
},
|
||||
{
|
||||
type: 'WE',
|
||||
@ -245,6 +275,10 @@ const columnsConfig = ref([
|
||||
type: 'VD_FBFM',
|
||||
columns: StinfoAiVidoPointColumns
|
||||
},
|
||||
{
|
||||
type: 'VD',
|
||||
columns: StinfoAiVidoPointColumns
|
||||
},
|
||||
{
|
||||
type: 'eng_alarm_point',
|
||||
columns: BasicColumns
|
||||
@ -303,7 +337,11 @@ const getData = async () => {
|
||||
|
||||
let columns = [];
|
||||
columns = columnsConfig.value.find(
|
||||
item => item.type == modelStore.params.sttp
|
||||
item =>
|
||||
item.type ==
|
||||
(modelStore.params.sttp == 'EQ'
|
||||
? modelStore.params.anchoPointState
|
||||
: modelStore.params.sttp)
|
||||
).columns;
|
||||
|
||||
columns.forEach(item => {
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<a-modal
|
||||
:open="visible"
|
||||
:title="title"
|
||||
:title="title + ' ' + '详情信息'"
|
||||
width="80vw"
|
||||
:footer="null"
|
||||
:closable="true"
|
||||
@ -34,21 +34,33 @@
|
||||
>
|
||||
</a-select>
|
||||
</div>
|
||||
<a-tabs :active-key="currentActiveKey" @change="onTabChange">
|
||||
|
||||
<!-- 加载状态提示 -->
|
||||
<div v-if="isLoading" class="loading-container">
|
||||
<a-spin tip="加载中..." />
|
||||
</div>
|
||||
|
||||
<!-- Tabs 区域 - 等待加载完成后显示 -->
|
||||
<a-tabs v-else :active-key="currentActiveKey" @change="onTabChange">
|
||||
<a-tab-pane v-for="tab in tabsConfig" :key="tab.key" :tab="tab.name">
|
||||
</a-tab-pane>
|
||||
<template #rightExtra v-if="anchor.sttp == 'ENG' || anchor.sttp == 'eng'">
|
||||
<a-tooltip :title="!isEngConfig ? '' : '该电站无专题配置'">
|
||||
<a-button type="primary" :disabled="isEngConfig">
|
||||
<a-tooltip :title="!hasPowerStatData ? '该电站无专题配置' : ''">
|
||||
<a-button
|
||||
type="primary"
|
||||
:disabled="!hasPowerStatData"
|
||||
@click="gotoEngTopic"
|
||||
>
|
||||
<i class="icon iconfont icon-topic mr-[5px]"></i>
|
||||
电站专题
|
||||
</a-button></a-tooltip
|
||||
>
|
||||
</template>
|
||||
</a-tabs>
|
||||
|
||||
<!-- 内容区域 - 使用动态组件 + keep-alive 实现按需加载和缓存 -->
|
||||
<keep-alive>
|
||||
<div class="content">
|
||||
<div v-if="!isLoading" class="content">
|
||||
<div class="content-wrapper" v-show="isQxdMode(currentActiveKey)">
|
||||
测站:
|
||||
<a-select
|
||||
@ -91,11 +103,13 @@
|
||||
? qxdSelectedStcd
|
||||
: ''
|
||||
"
|
||||
:wt-config="modelStore.wtConfig"
|
||||
/>
|
||||
<!-- 监测数据 - 垂向水温 -->
|
||||
<VerticalWaterTemperature
|
||||
v-show="currentActiveKey === 'VerticalWaterTemperature'"
|
||||
:is-active="currentActiveKey === 'VerticalWaterTemperature'"
|
||||
:stcd="modelStore.verticalWaterStcd || modelStore.params.stcd"
|
||||
/>
|
||||
<!-- 监测数据 - 水质 -->
|
||||
<WaterQuality
|
||||
@ -107,6 +121,7 @@
|
||||
? qxdSelectedStcdWq
|
||||
: ''
|
||||
"
|
||||
:wq-show="modelStore.wqShow"
|
||||
/>
|
||||
<!-- 流量监测 -->
|
||||
<FlowMeasure
|
||||
@ -222,13 +237,445 @@ import { handleTabs } from './setting.config';
|
||||
import {
|
||||
getMonitorDataWt,
|
||||
getMonitorDataWq,
|
||||
getMonitorDataZq
|
||||
getMonitorDataZq,
|
||||
getBuildState,
|
||||
getFishTab,
|
||||
checkAnalysisShow,
|
||||
getStInfoByStcd,
|
||||
getVideoList,
|
||||
getMonitorDataWaterTempPowerStation,
|
||||
getMonitorDataWaterTempPowerStation2,
|
||||
checkPowerStationTopic
|
||||
} from '@/api/mapModal';
|
||||
// import { useRouter } from 'vue-router';
|
||||
|
||||
const modelStore = useModelStore();
|
||||
const tabsConfig = ref([]);
|
||||
// 判断是否显示电站专题配置
|
||||
const isEngConfig = ref(true);
|
||||
// 加载状态:等待所有验证完成后再显示 tabs
|
||||
const isLoading = ref(true);
|
||||
|
||||
// ==================== 电站专题相关 ====================
|
||||
// 电站专题配置数据状态
|
||||
const hasPowerStatData = ref(false);
|
||||
// 电站专题 URL 参数(仅 hbb)
|
||||
const hbbSearchParams = '?menu=dianZhanZhuanTi&page=dianZhanZhuanTi';
|
||||
// 判断当前是否在电站专题页面
|
||||
const isPowerStatPage = computed(() => {
|
||||
return window.location.search === hbbSearchParams;
|
||||
});
|
||||
// 判断是否为局级页面(根据当前路由判断)
|
||||
const isJiangJu = computed(() => {
|
||||
// TODO: 根据实际路由判断逻辑修改
|
||||
return false;
|
||||
});
|
||||
// const router = useRouter();
|
||||
|
||||
/**
|
||||
* 查询电站是否有专题配置数据
|
||||
*/
|
||||
const checkPowerStationTopicData = async (stcd: string) => {
|
||||
try {
|
||||
const res = await checkPowerStationTopic({
|
||||
filter: {
|
||||
logic: 'and',
|
||||
filters: [
|
||||
{
|
||||
field: 'stcd',
|
||||
operator: 'eq',
|
||||
dataType: 'string',
|
||||
value: stcd
|
||||
},
|
||||
{
|
||||
field: 'bclData',
|
||||
operator: 'contains',
|
||||
dataType: 'string',
|
||||
value: 'image/png'
|
||||
}
|
||||
]
|
||||
}
|
||||
});
|
||||
hasPowerStatData.value =
|
||||
res?.data?.data && res?.data?.data?.length > 0;
|
||||
} catch (error) {
|
||||
console.error('查询电站专题配置失败:', error);
|
||||
hasPowerStatData.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* 跳转到电站专题页面
|
||||
*/
|
||||
const gotoEngTopic = () => {
|
||||
// TODO: 等待电站专题页面创建后,取消注释以下代码
|
||||
/*
|
||||
const url = `/qgc-biz-home/${hbbSearchParams}`;
|
||||
const menu = {
|
||||
id: 'dianZhanZhuanTi',
|
||||
url,
|
||||
name: '电站专题'
|
||||
};
|
||||
|
||||
// 缓存当前电站 stcd(跳转后页面会读取)
|
||||
localStorage.setItem('modalSelectedEngTopic', JSON.stringify({ stcd: modelStore.params.stcd }));
|
||||
|
||||
// 关闭弹窗
|
||||
handleClose();
|
||||
|
||||
// 使用 Vue Router 跳转
|
||||
// router.push(url);
|
||||
*/
|
||||
console.log('电站专题跳转(暂未实现):', modelStore.params.stcd);
|
||||
};
|
||||
|
||||
// 环境判断变量(与 React 版本对齐)
|
||||
const app = 'hbb'; // 模拟 React 中的 Session.getAppCode()
|
||||
const env = 'hbb'; // 模拟 React 中的 window.__env__
|
||||
const isLCJ = env?.startsWith('lcj');
|
||||
const sttpList = ['ENG', 'WT', 'WQ', 'FP', 'FB', 'VP', 'DW', 'EQ', 'VA'];
|
||||
|
||||
// ==================== 异步 Tab 过滤逻辑 ====================
|
||||
|
||||
// 功能6: 垂向水温与 AI 识别动态过滤
|
||||
const checkVerticalWaterAndAI = async (stcd: string) => {
|
||||
try {
|
||||
const res = await getStInfoByStcd({ stcd });
|
||||
const data = res?.data || res;
|
||||
if (data && data.relList) {
|
||||
const jianCei = data.relList.find(
|
||||
(item: any) => item.sttpCode === 'WTVT'
|
||||
);
|
||||
const aiShiBie = data.relList.filter((item: any) =>
|
||||
item?.sttpCode?.startsWith('AI')
|
||||
);
|
||||
|
||||
if (!jianCei) {
|
||||
// 无垂向水温子站点,过滤掉垂向水温 Tab
|
||||
tabsConfig.value = tabsConfig.value.filter(
|
||||
(item: any) => item.type !== 'VerticalWaterTemperature'
|
||||
);
|
||||
} else {
|
||||
modelStore.verticalWaterStcd = jianCei.stcd;
|
||||
}
|
||||
|
||||
if (!aiShiBie.length) {
|
||||
// 无 AI 识别子站点,过滤掉 AI 识别 Tab
|
||||
tabsConfig.value = tabsConfig.value.filter(
|
||||
(item: any) => item.type !== 'AIYXSB'
|
||||
);
|
||||
} else {
|
||||
modelStore.aiSites = aiShiBie;
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('垂向水温/AI 检查失败:', error);
|
||||
}
|
||||
};
|
||||
|
||||
// 功能7: 视频存在性检查
|
||||
const checkVideoExists = async (stcd: string) => {
|
||||
try {
|
||||
const res = await getVideoList({
|
||||
filter: {
|
||||
logic: 'and',
|
||||
filters: [{ field: 'stcd', operator: 'eq', value: stcd }]
|
||||
}
|
||||
});
|
||||
if (!res?.data?.data?.length && !res?.data?.records?.length) {
|
||||
// 无视频数据,过滤掉视频 Tab
|
||||
tabsConfig.value = tabsConfig.value.filter(
|
||||
(item: any) => item.type !== 'video'
|
||||
);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('视频检查失败:', error);
|
||||
}
|
||||
};
|
||||
|
||||
// 功能8: 鱼类栖息地数据类型检查 (React: isLCJ && sttpCode === 'WE')
|
||||
const checkFishTab = async (stcd: string) => {
|
||||
try {
|
||||
const res = await getFishTab(stcd);
|
||||
const data = res?.data || res;
|
||||
if (data && data.length > 0) {
|
||||
modelStore.fishTabInfo = data[0];
|
||||
// 根据 hasWt/hasWq/hasFv 过滤 FlowMeasure 的子 Tab
|
||||
const flowTab = tabsConfig.value.find(
|
||||
(item: any) => item.key === 'FlowMeasure'
|
||||
);
|
||||
if (flowTab && flowTab.tabs) {
|
||||
flowTab.tabs = flowTab.tabs.filter((tab: any) => {
|
||||
if (tab.name === '水温(℃)' && !data[0].hasWt) return false;
|
||||
if (tab.name === '水质' && !data[0].hasWq) return false;
|
||||
if (tab.name === '流速(m/s)' && !data[0].hasFv) return false;
|
||||
return true;
|
||||
});
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('鱼类数据检查失败:', error);
|
||||
}
|
||||
};
|
||||
|
||||
// 功能9: 水质 AI 预测功能检查 (React: (app === "hbb" || baseId === "07" || "02") && sttpCode === 'WQ'/'WQFB'/'wq')
|
||||
const checkAnalysisAvailability = async (stcd: string) => {
|
||||
try {
|
||||
const filter = {
|
||||
filter: {
|
||||
logic: 'and',
|
||||
filters: [
|
||||
{ field: 'stcd', operator: 'eq', value: stcd },
|
||||
{ field: 'mway', operator: 'eq', value: '2' },
|
||||
{ field: 'dtinType', operator: 'eq', value: '0' },
|
||||
{
|
||||
logic: 'or',
|
||||
filters: [
|
||||
{ field: 'engLctn3Code', operator: 'isnotnull' },
|
||||
{ field: 'engLctn1Code', operator: 'isnotnull' }
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
};
|
||||
const res = await checkAnalysisShow(filter);
|
||||
modelStore.wqShow = !!res?.data;
|
||||
} catch (error) {
|
||||
console.error('水质 AI 预测检查失败:', error);
|
||||
modelStore.wqShow = false;
|
||||
}
|
||||
};
|
||||
|
||||
// 功能10: 水温站特殊处理 (React: (app === "hbb" || baseId === "07" || "02") && sttpCode === 'WT'/'wt')
|
||||
const checkWaterTempConfig = async (stcd: string) => {
|
||||
try {
|
||||
const [configRes, dwRes, buildRes] = await Promise.all([
|
||||
getMonitorDataWaterTempPowerStation({ stcd }),
|
||||
getMonitorDataWaterTempPowerStation2({ stcd }),
|
||||
getBuildState({
|
||||
filter: {
|
||||
logic: 'and',
|
||||
filters: [{ field: 'stcd', operator: 'eq', value: stcd }]
|
||||
}
|
||||
})
|
||||
]);
|
||||
|
||||
modelStore.wtConfig = {
|
||||
ioWtrv: configRes?.data?.ioWtrv,
|
||||
hasRstcdWtvt: dwRes?.data
|
||||
};
|
||||
|
||||
// 检查出入库水温对比
|
||||
const buildData = buildRes?.data?.[0];
|
||||
if (!buildData?.engIwtCode && !buildData?.engDwtCode) {
|
||||
tabsConfig.value = tabsConfig.value.filter(
|
||||
(item: any) => item.name !== '出入库水温对比'
|
||||
);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('水温配置检查失败:', error);
|
||||
}
|
||||
};
|
||||
|
||||
// 功能11: 电站建设状态过滤 (React: sttp == "ENG" && eqtp != "QEC")
|
||||
const checkBuildState = async (stcd: string) => {
|
||||
try {
|
||||
const res = await getBuildState({
|
||||
filter: {
|
||||
logic: 'and',
|
||||
filters: [{ field: 'stcd', operator: 'eq', value: stcd }]
|
||||
}
|
||||
});
|
||||
|
||||
const buid = res?.data?.[0]?.bldsttCcode;
|
||||
// 0 未建 1 在建 2 已建
|
||||
const zj = ['基础信息', '实时视频', '全景影像', '查看报告'];
|
||||
const wj = ['基础信息', '查看报告'];
|
||||
|
||||
if (res?.data?.length > 0) {
|
||||
const zJTabData = tabsConfig.value?.filter((item: any) =>
|
||||
zj.includes(item.name)
|
||||
);
|
||||
const wJTabData = tabsConfig.value?.filter((item: any) =>
|
||||
wj.includes(item.name)
|
||||
);
|
||||
tabsConfig.value =
|
||||
buid == 1 ? zJTabData : buid == 0 ? wJTabData : tabsConfig.value;
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('建设状态检查失败:', error);
|
||||
}
|
||||
};
|
||||
|
||||
// QGC 完整 Tab 过滤逻辑(与 React setQGCTabList 对齐)
|
||||
const setQGCTabList = async (_tabs: any, stcd: string) => {
|
||||
let tabs = [..._tabs];
|
||||
|
||||
try {
|
||||
// 1. 电站建设状态过滤
|
||||
if (modelStore.params.sttp == 'ENG' && modelStore.params.eqtp != 'QEC') {
|
||||
const res = await getBuildState({
|
||||
filter: {
|
||||
logic: 'and',
|
||||
filters: [{ field: 'stcd', operator: 'eq', value: stcd }]
|
||||
}
|
||||
});
|
||||
|
||||
const buid = res?.data?.[0]?.bldsttCcode;
|
||||
const zj = ['基础信息', '实时视频', '全景影像', '查看报告'];
|
||||
const wj = ['基础信息', '查看报告'];
|
||||
|
||||
if (res?.data?.length > 0) {
|
||||
const zJTabData = tabs?.filter((item: any) => zj.includes(item.name));
|
||||
const wJTabData = tabs?.filter((item: any) => wj.includes(item.name));
|
||||
tabs = buid == 1 ? zJTabData : buid == 0 ? wJTabData : tabs;
|
||||
}
|
||||
}
|
||||
|
||||
// 2. 垂向水温 & AI 识别检查(对所有类型执行,与 React 一致)
|
||||
const res4 = await getStInfoByStcd({ stcd });
|
||||
let newTabs = [...tabs];
|
||||
|
||||
if (res4 && res4.data && res4.data.relList) {
|
||||
const relList = res4.data.relList;
|
||||
const jianCei = relList.find((item: any) => item.sttpCode === 'WTVT');
|
||||
const aiShiBie = relList.filter((item: any) =>
|
||||
item?.sttpCode?.startsWith('AI')
|
||||
);
|
||||
|
||||
if (!jianCei) {
|
||||
// newTabs = newTabs.filter(
|
||||
// item => item.type !== 'VerticalWaterTemperature'
|
||||
// );
|
||||
} else {
|
||||
modelStore.verticalWaterStcd = jianCei.stcd;
|
||||
}
|
||||
if (!aiShiBie.length) {
|
||||
newTabs = newTabs.filter(item => item.type !== 'AIYXSB');
|
||||
} else {
|
||||
modelStore.aiSites = aiShiBie;
|
||||
}
|
||||
}
|
||||
|
||||
// 3. 视频存在性检查
|
||||
let params = {
|
||||
filter: {
|
||||
logic: 'and',
|
||||
filters: [
|
||||
{
|
||||
field: 'sttpCode',
|
||||
operator: 'startswith',
|
||||
value: 'VD_'
|
||||
},
|
||||
{
|
||||
logic: 'or',
|
||||
filters: [
|
||||
{
|
||||
field: 'rstcd',
|
||||
operator: 'eq',
|
||||
dataType: 'string',
|
||||
value: stcd
|
||||
},
|
||||
{
|
||||
field: 'stcd',
|
||||
operator: 'eq',
|
||||
dataType: 'string',
|
||||
value: stcd
|
||||
},
|
||||
{
|
||||
field: 'fhstcd',
|
||||
operator: 'eq',
|
||||
dataType: 'string',
|
||||
value: stcd
|
||||
},
|
||||
{
|
||||
field: 'stCode',
|
||||
operator: 'eq',
|
||||
dataType: 'string',
|
||||
value: stcd
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
select: ['stcd', 'stnm', 'sttpCode', 'sttpName', 'playWay', 'url'],
|
||||
sort: [
|
||||
{
|
||||
field: 'stnm',
|
||||
dir: 'asc'
|
||||
}
|
||||
]
|
||||
};
|
||||
const res2 = await getVideoList(params);
|
||||
console.log('', modelStore.params.sttp);
|
||||
debugger
|
||||
if (
|
||||
(res2?.data?.data?.length > 0 || res2?.data?.records?.length > 0) ||
|
||||
modelStore.params.sttp == 'WQ'
|
||||
) {
|
||||
tabsConfig.value = newTabs;
|
||||
} else {
|
||||
tabsConfig.value = newTabs.filter((item: any) => item.type != 'video');
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('QGC Tab 过滤失败:', error);
|
||||
}
|
||||
};
|
||||
|
||||
// 综合过滤函数(与 React useEffect 逻辑对齐)
|
||||
const applyTabFilters = async (params: any) => {
|
||||
isLoading.value = true; // 开始加载
|
||||
|
||||
try {
|
||||
const sttpCode = params?.sttp;
|
||||
const stcd = params?.stcd;
|
||||
const eqtp = params?.eqtp;
|
||||
const baseId = modelStore.baseId;
|
||||
|
||||
if (!stcd) return;
|
||||
|
||||
// 按照 React 的分支逻辑执行(注意运算符优先级)
|
||||
if (isLCJ && sttpCode === 'VP') {
|
||||
// LCJ 珍稀植物园视频检查
|
||||
const res = await getVideoList({
|
||||
filter: {
|
||||
logic: 'and',
|
||||
filters: [{ field: 'stcd', operator: 'eq', value: stcd }]
|
||||
}
|
||||
});
|
||||
if (!res?.data?.data?.length && !res?.data?.records?.length) {
|
||||
tabsConfig.value = tabsConfig.value.filter(
|
||||
item => item.name != '实时视频'
|
||||
);
|
||||
}
|
||||
} else if (isLCJ && sttpCode === 'WE') {
|
||||
// LCJ 鱼类栖息地数据类型检查
|
||||
await checkFishTab(stcd);
|
||||
} else if (
|
||||
((baseId === '07' || baseId === '02') && sttpCode === 'WQ') ||
|
||||
sttpCode === 'WQFB' ||
|
||||
sttpCode === 'wq'
|
||||
) {
|
||||
// 水质 AI 预测检查(React 逻辑:WQ 需要条件,WQFB/wq 无条件)
|
||||
await checkAnalysisAvailability(stcd);
|
||||
} else if (
|
||||
((baseId === '07' || baseId === '02') && sttpCode === 'WT') ||
|
||||
sttpCode === 'wt'
|
||||
) {
|
||||
// 水温站特殊处理(React 逻辑:WT 需要条件,wt 无条件)
|
||||
await checkWaterTempConfig(stcd);
|
||||
} else if (
|
||||
sttpList.includes(sttpCode?.toUpperCase()) ||
|
||||
sttpCode?.startsWith('FP_') ||
|
||||
sttpCode?.includes('DW')
|
||||
) {
|
||||
// QGC 完整 Tab 过滤(包含建设状态、垂向水温、AI识别、视频检查)
|
||||
await setQGCTabList(tabsConfig.value, stcd);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Tab 过滤逻辑执行失败:', error);
|
||||
} finally {
|
||||
isLoading.value = false; // 无论成功失败都停止加载
|
||||
}
|
||||
};
|
||||
|
||||
// ==================== qxd 栖息地模式相关 ====================
|
||||
// qxd模式配置映射
|
||||
@ -407,7 +854,7 @@ const emit = defineEmits<{
|
||||
|
||||
// 内部维护的 activeKey
|
||||
const currentActiveKey = ref<string>('');
|
||||
const anchor = ref<string>('');
|
||||
const anchor = ref<any>('');
|
||||
|
||||
// 监听外部传入的 activeKey 变化,同步到内部状态
|
||||
watch(
|
||||
@ -421,7 +868,7 @@ watch(
|
||||
);
|
||||
watch(
|
||||
() => modelStore.params,
|
||||
newVal => {
|
||||
async newVal => {
|
||||
if (!newVal || Object.keys(newVal).length === 0) return;
|
||||
console.log(newVal);
|
||||
anchor.value = newVal;
|
||||
@ -434,6 +881,14 @@ watch(
|
||||
tabsConfig.value = handleTabs({ ...params });
|
||||
let value = tabsConfig.value.find((item: any) => item.default);
|
||||
currentActiveKey.value = value?.key;
|
||||
|
||||
// 电站类型时,查询电站专题配置数据
|
||||
if (params?.sttp?.toUpperCase() === 'ENG') {
|
||||
checkPowerStationTopicData(params.stcd);
|
||||
}
|
||||
|
||||
// 应用异步 Tab 过滤(非阻塞式)
|
||||
applyTabFilters(params);
|
||||
},
|
||||
{ deep: true, immediate: true }
|
||||
);
|
||||
@ -460,7 +915,17 @@ const onTabChange = (key: string) => {
|
||||
// 关闭弹窗
|
||||
const handleClose = () => {
|
||||
emit('update:visible', false);
|
||||
modelStore.params = {};
|
||||
modelStore.params = {
|
||||
sttp: 'eng',
|
||||
stcd: '',
|
||||
date: '',
|
||||
show: true,
|
||||
enfc: '0',
|
||||
eqtp: '',
|
||||
baseId: '',
|
||||
sttpCode: '',
|
||||
sttpMap: ''
|
||||
};
|
||||
// 清理状态,避免影响下次打开
|
||||
modelStore.showStcdSelector = false;
|
||||
modelStore.stcdOptions = [];
|
||||
@ -470,6 +935,13 @@ const handleClose = () => {
|
||||
qxdSelectedStcdWq.value = '';
|
||||
qxdSelectedStcdZq.value = '';
|
||||
qxdLoadedCodes.value = new Set();
|
||||
// 清理电站专题状态
|
||||
hasPowerStatData.value = false;
|
||||
modelStore.verticalWaterStcd = '';
|
||||
modelStore.aiSites = [];
|
||||
modelStore.wtConfig = {};
|
||||
modelStore.wqShow = false;
|
||||
modelStore.fishTabInfo = null;
|
||||
};
|
||||
|
||||
// 为了方便模板中使用,将 props.data 暴露给模板
|
||||
@ -498,5 +970,12 @@ const handleStcdChange = (newStcd: string) => {
|
||||
.content {
|
||||
min-height: 600px;
|
||||
}
|
||||
|
||||
.loading-container {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
min-height: 400px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -208,158 +208,101 @@ const ENGEQTabs: Array<any> = [
|
||||
|
||||
// ].filter(Boolean)
|
||||
// //生态流量泄放设施 √
|
||||
// const EQTabs: Array<any> = [
|
||||
// {
|
||||
// name: '基础信息',
|
||||
// key: 'basicInfo',
|
||||
// type: 'basic',
|
||||
// url: '/bbi/siteBipc/getSiteBasicInfo'
|
||||
// },
|
||||
// {
|
||||
// name: '实时视频',
|
||||
// key: 'videoInfo',
|
||||
// type: 'video',
|
||||
// url: '/video/dataStcdFrame/getVideoMonitorList'
|
||||
// },
|
||||
// // {
|
||||
// // name: '全景影像',
|
||||
// // key: 'panoramaInfo',
|
||||
// // type: 'panorama'
|
||||
// // },
|
||||
// {
|
||||
// name: '监测数据',
|
||||
// key: 'flowDischarge',
|
||||
// type: 'FlowDischarge'
|
||||
// }
|
||||
// ]
|
||||
const EQTabs: Array<any> = [
|
||||
{
|
||||
name: '基础信息',
|
||||
key: 'basicInfo',
|
||||
type: 'basic',
|
||||
url: '/api/dec-lygk-base-server/base/msstbprpt/getStcdInfo',
|
||||
default: true // 默认显示
|
||||
},
|
||||
{
|
||||
name: '实时视频',
|
||||
key: 'videoInfo',
|
||||
type: 'video',
|
||||
url: '/video/dataStcdFrame/getVideoMonitorList'
|
||||
},
|
||||
// {
|
||||
// name: '全景影像',
|
||||
// key: 'panoramaInfo',
|
||||
// type: 'panorama'
|
||||
// },
|
||||
{
|
||||
name: '监测数据',
|
||||
key: 'flowDischarge',
|
||||
type: 'FlowDischarge'
|
||||
}
|
||||
];
|
||||
// 过鱼设施 √
|
||||
const FPTabs: Array<any> =
|
||||
// Session.getAppCode() === 'hbb'
|
||||
// ? [
|
||||
// {
|
||||
// name: '基础信息',
|
||||
// key: 'basicInfo',
|
||||
// type: 'basic',
|
||||
// url: '/bbi/siteBipc/getSiteBasicInfo',
|
||||
// code: 'gyss.tabs.jcxx'
|
||||
// },
|
||||
// {
|
||||
// name: '实时视频',
|
||||
// key: 'videoInfo',
|
||||
// type: 'video',
|
||||
// url: '/video/dataStcdFrame/getVideoMonitorList',
|
||||
// code: 'gyss.tabs.sssp'
|
||||
// },
|
||||
// {
|
||||
// name: '在线监测数据',
|
||||
// key: 'FishFacilityMonitorData', //Normal
|
||||
// type: 'FishFacilityMonitorData', //Normal
|
||||
// code: 'gyss.tabs.jcsj',
|
||||
// // tabs: [
|
||||
// // {
|
||||
// // name: '',
|
||||
// // type: 'table',
|
||||
// // tableUrl: getUrl('/wmp-env-server/env/fp/fpssTable/GetKendoListCust'),
|
||||
// // hiddenChart: true,
|
||||
// // hiddenTabs: true,
|
||||
// // filter: NormalDatePickerFilter
|
||||
// // }
|
||||
// // ]
|
||||
// },
|
||||
// {
|
||||
// name: '运行情况',
|
||||
// key: 'FishFacilityRunState', //Normal1
|
||||
// type: 'FishFacilityRunState', //Normal
|
||||
// code: 'gyss.tabs.yxqk',
|
||||
// // tabs: [
|
||||
// // {
|
||||
// // name: '',
|
||||
// // type: 'table',
|
||||
// // tableUrl: getUrl('/wmp-env-server/env/fp/run/secondRun/GetKendoListCust'),
|
||||
// // hiddenChart: true,
|
||||
// // hiddenTabs: true,
|
||||
// // filter: NormalFishFilter
|
||||
// // }
|
||||
// // ]
|
||||
// },
|
||||
// {
|
||||
// name: '综合分析',
|
||||
// key: 'FishZHFX',
|
||||
// type: 'FishZHFX',
|
||||
// // tabs: [
|
||||
// // {
|
||||
// // name: '',
|
||||
// // type: 'table',
|
||||
// // tableUrl: getUrl('/wmp-env-server/env/fp/run/secondRun/GetKendoListCust'),
|
||||
// // hiddenChart: true,
|
||||
// // hiddenTabs: true,
|
||||
// // filter: NormalFishFilter
|
||||
// // }
|
||||
// // ]
|
||||
// },
|
||||
// {
|
||||
// name: 'AI运行识别',
|
||||
// key: 'AIYXSB',
|
||||
// type: 'AIYXSB',
|
||||
// }
|
||||
// ]
|
||||
// :
|
||||
[
|
||||
{
|
||||
name: '基础信息',
|
||||
key: 'basicInfo',
|
||||
type: 'basic',
|
||||
url: '/api/dec-lygk-base-server/base/msstbprpt/getStcdInfo'
|
||||
// code: 'gyss.tabs.jcxx'
|
||||
},
|
||||
// {
|
||||
// name: '实时视频',
|
||||
// key: 'videoInfo',
|
||||
// type: 'video',
|
||||
// url: '/video/dataStcdFrame/getVideoMonitorList',
|
||||
// code: 'gyss.tabs.sssp'
|
||||
// }
|
||||
{
|
||||
name: '在线监测数据',
|
||||
key: 'FishFacilityMonitorData', //Normal
|
||||
type: 'FishFacilityMonitorData', //Normal
|
||||
code: 'gyss.tabs.jcsj',
|
||||
// 默认显示
|
||||
tabs: [
|
||||
{
|
||||
name: '',
|
||||
type: 'table',
|
||||
tableUrl: '/wmp-env-server/env/fp/fpssTable/GetKendoListCust',
|
||||
hiddenChart: true,
|
||||
hiddenTabs: true
|
||||
// filter: NormalDatePickerFilter
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: '运行情况',
|
||||
key: 'FishFacilityRunState', //Normal1
|
||||
type: 'FishFacilityRunState', //Normal
|
||||
code: 'gyss.tabs.yxqk',
|
||||
default: true
|
||||
// tabs: [
|
||||
// {
|
||||
// name: '',
|
||||
// type: 'table',
|
||||
// tableUrl: getUrl('/wmp-env-server/env/fp/run/secondRun/GetKendoListCust'),
|
||||
// hiddenChart: true,
|
||||
// hiddenTabs: true,
|
||||
// filter: NormalFishFilter
|
||||
// }
|
||||
// ]
|
||||
},
|
||||
{
|
||||
name: '综合分析',
|
||||
key: 'FishZHFX',
|
||||
type: 'FishZHFX',
|
||||
code: 'gyss.tabs.zhfx'
|
||||
}
|
||||
];
|
||||
const FPTabs: Array<any> = [
|
||||
{
|
||||
name: '基础信息',
|
||||
key: 'basicInfo',
|
||||
type: 'basic',
|
||||
url: '/api/dec-lygk-base-server/base/msstbprpt/getStcdInfo',
|
||||
code: 'gyss.tabs.jcxx'
|
||||
},
|
||||
{
|
||||
name: '实时视频',
|
||||
key: 'videoInfo',
|
||||
type: 'video',
|
||||
url: '/video/dataStcdFrame/getVideoMonitorList',
|
||||
code: 'gyss.tabs.sssp'
|
||||
},
|
||||
{
|
||||
name: '在线监测数据',
|
||||
key: 'FishFacilityMonitorData', //Normal
|
||||
type: 'FishFacilityMonitorData', //Normal
|
||||
code: 'gyss.tabs.jcsj',
|
||||
tabs: [
|
||||
{
|
||||
name: '',
|
||||
type: 'table',
|
||||
// tableUrl: getUrl('/wmp-env-server/env/fp/fpssTable/GetKendoListCust'),//getUrl
|
||||
hiddenChart: true,
|
||||
hiddenTabs: true
|
||||
// filter: NormalDatePickerFilter // 没有
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: '运行情况',
|
||||
key: 'FishFacilityRunState', //Normal1
|
||||
type: 'FishFacilityRunState', //Normal
|
||||
code: 'gyss.tabs.yxqk',
|
||||
default: true, // 默认显示
|
||||
tabs: [
|
||||
{
|
||||
name: '',
|
||||
type: 'table',
|
||||
// tableUrl: getUrl('/wmp-env-server/env/fp/run/secondRun/GetKendoListCust'),
|
||||
hiddenChart: true,
|
||||
hiddenTabs: true
|
||||
// filter: NormalFishFilter // 没有
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: '综合分析',
|
||||
key: 'FishZHFX',
|
||||
type: 'FishZHFX'
|
||||
// tabs: [ 线上同步注释
|
||||
// {
|
||||
// name: '',
|
||||
// type: 'table',
|
||||
// tableUrl: getUrl('/wmp-env-server/env/fp/run/secondRun/GetKendoListCust'),
|
||||
// hiddenChart: true,
|
||||
// hiddenTabs: true,
|
||||
// filter: NormalFishFilter
|
||||
// }
|
||||
// ]
|
||||
},
|
||||
{
|
||||
name: 'AI运行识别',
|
||||
key: 'AIYXSB',
|
||||
type: 'AIYXSB'
|
||||
}
|
||||
];
|
||||
|
||||
// // 过鱼设施在建状态
|
||||
const FPTabs1: Array<any> = [
|
||||
@ -389,7 +332,7 @@ const FBTabs: Array<any> = [
|
||||
name: '基础信息',
|
||||
key: 'basicInfo',
|
||||
type: 'basic',
|
||||
url: '/bbi/siteBipc/getSiteBasicInfo'
|
||||
url: '/api/dec-lygk-base-server/base/msstbprpt/getStcdInfo'
|
||||
},
|
||||
{
|
||||
name: '运行数据',
|
||||
@ -724,7 +667,7 @@ const WETabs: Array<any> = [
|
||||
name: '基础信息',
|
||||
key: 'basicInfo',
|
||||
type: 'basic',
|
||||
url: '/bbi/siteBipc/getSiteBasicInfo',
|
||||
url: '/api/dec-lygk-base-server/base/msstbprpt/getStcdInfo',
|
||||
default: true // 默认显示
|
||||
},
|
||||
{
|
||||
@ -857,7 +800,7 @@ const VPTabs: Array<any> = [
|
||||
name: '基础信息',
|
||||
key: 'basicInfo',
|
||||
type: 'basic',
|
||||
url: '/bbi/siteBipc/getSiteBasicInfo',
|
||||
url: '/api/dec-lygk-base-server/base/msstbprpt/getStcdInfo',
|
||||
default: true // 默认显示
|
||||
},
|
||||
// {
|
||||
@ -940,7 +883,7 @@ const VATabs: Array<any> = [
|
||||
name: '基础信息',
|
||||
key: 'basicInfo',
|
||||
type: 'basic',
|
||||
url: '/bbi/siteBipc/getSiteBasicInfo',
|
||||
url: '/api/dec-lygk-base-server/base/msstbprpt/getStcdInfo',
|
||||
default: true // 默认显示
|
||||
},
|
||||
// {
|
||||
@ -1067,7 +1010,7 @@ const WATabs: Array<any> = [
|
||||
name: '基础信息',
|
||||
key: 'basicInfo',
|
||||
type: 'basic',
|
||||
url: '/bbi/siteBipc/getSiteBasicInfo',
|
||||
url: '/api/dec-lygk-base-server/base/msstbprpt/getStcdInfo',
|
||||
default: true // 默认显示
|
||||
},
|
||||
{
|
||||
@ -1104,11 +1047,19 @@ const handleTabs = (modaldata: any) => {
|
||||
return WQFBTabs;
|
||||
case 'WQ':
|
||||
const _tabs = [...WQTabs];
|
||||
if (modaldata?.dtinType == 2 || modaldata?.dtinType == 1)
|
||||
|
||||
if (modaldata?.dtinType == 2 || modaldata?.dtinType == 1) {
|
||||
_tabs.splice(2, 1); //国家站 人工站把视频tab去除
|
||||
}
|
||||
return _tabs;
|
||||
case 'FH':
|
||||
return FHTabs;
|
||||
let arr = [...FHTabs];
|
||||
|
||||
if (modaldata?.bldstt == 2 || modaldata?.bldstt == 1) {
|
||||
console.log('modaldata', modaldata);
|
||||
arr =[ arr[0]]; //国家站 人工站把视频tab去除
|
||||
}
|
||||
return arr;
|
||||
case 'FH_ZQ_POINT':
|
||||
return FLOWTabs;
|
||||
case 'FP_POINT':
|
||||
@ -1124,6 +1075,7 @@ const handleTabs = (modaldata: any) => {
|
||||
case 'WVA':
|
||||
return WATabs;
|
||||
case 'VD_FBFM':
|
||||
case 'VD':
|
||||
return videoTabs;
|
||||
case 'ENG_ALARM_POINT':
|
||||
return DZGJ;
|
||||
@ -1151,8 +1103,8 @@ const handleTabs = (modaldata: any) => {
|
||||
// }
|
||||
case 'ENG_ALARM':
|
||||
return DZGJ;
|
||||
// case 'EQ':
|
||||
// return EQTabs
|
||||
case 'EQ':
|
||||
return EQTabs;
|
||||
case 'DW':
|
||||
case 'DW_1':
|
||||
case 'DW_2':
|
||||
@ -1160,58 +1112,37 @@ const handleTabs = (modaldata: any) => {
|
||||
case 'DW_4':
|
||||
case 'DW_5':
|
||||
return DWTabs;
|
||||
case 'FP_1': //todo,后续再删除多余代码
|
||||
return FPTabs.filter(item => item.name !== '在线监测数据');
|
||||
case 'FP': //todo,后续再删除多余代码
|
||||
|
||||
case 'FP_1': //todo,后续再删除多余代码
|
||||
// case "FP_2": //todo,后续再删除多余代码
|
||||
case 'FP_3': //todo,后续再删除多余代码
|
||||
case 'FP_4': //todo,后续再删除多余代码
|
||||
// case "FP_5": //todo,后续再删除多余代码
|
||||
// // if (Session.getAppCode() === 'hbb') {
|
||||
|
||||
// mway为2的时侯显示在线监测数据
|
||||
if (
|
||||
modaldata.bldsttCcode == '1' ||
|
||||
modaldata.bldsttCcode == '0' ||
|
||||
modaldata.bldstt == '1' ||
|
||||
modaldata.bldstt == '0' ||
|
||||
modaldata.bldstt == '2'
|
||||
modaldata.bldstt == '0'
|
||||
) {
|
||||
console.log(1);
|
||||
return [
|
||||
...FPTabs1 //建设情况
|
||||
];
|
||||
} else {
|
||||
console.log(2);
|
||||
if (modaldata.mway != 2) {
|
||||
console.log(3);
|
||||
return FPTabs.filter(item => item.name !== '在线监测数据');
|
||||
} else {
|
||||
console.log(4);
|
||||
return [
|
||||
...FPTabs //有监测数据
|
||||
];
|
||||
}
|
||||
}
|
||||
// } else {
|
||||
// if (modaldata.bldsttCcode == '1' || modaldata.bldsttCcode == '0' || modaldata.bldstt == '1' || modaldata.bldstt == '0') {
|
||||
// return [
|
||||
// ...FPTabs1
|
||||
// // {
|
||||
// // name: "系统运行记录",
|
||||
// // key: "FishSystemRunState", //Normal1
|
||||
// // type: "FishSystemRunState", //Normal
|
||||
// // tabs: []
|
||||
// // }
|
||||
// ]
|
||||
// } else {
|
||||
// return [
|
||||
// ...FPTabs
|
||||
// // {
|
||||
// // name: "系统运行记录",
|
||||
// // key: "FishSystemRunState", //Normal1
|
||||
// // type: "FishSystemRunState", //Normal
|
||||
// // tabs: []
|
||||
// // }
|
||||
// ]
|
||||
// }
|
||||
// }
|
||||
|
||||
case 'FP_2': //todo,后续再删除多余代码
|
||||
case 'FP_5': //todo,后续再删除多余代码
|
||||
if (
|
||||
|
||||
@ -493,7 +493,7 @@ const initChart = () => {
|
||||
modelStore.modalVisible = true;
|
||||
modelStore.params.sttp = "WT";
|
||||
modelStore.params.enfc = '1';
|
||||
modelStore.title = stnm + "详情信息";
|
||||
modelStore.title = stnm ;
|
||||
// modelStore.isBasicEdit = true;
|
||||
modelStore.params.stcd = stcd;
|
||||
|
||||
@ -643,7 +643,7 @@ const handleChartClick = (params: any) => {
|
||||
timeRange: [startTime, endTime]
|
||||
} as any;
|
||||
|
||||
modelStore.title = currentStnm ? `${currentStnm} 详情信息` : '详情信息';
|
||||
modelStore.title = currentStnm ? `${currentStnm} ` : '';
|
||||
modelStore.tabList = handleTabs(modelStore.params);
|
||||
modelStore.modalVisible = true;
|
||||
});
|
||||
|
||||
@ -462,7 +462,7 @@ const handleViewDetail = (record: any, type: string) => {
|
||||
} else if (type === 'ENG') {
|
||||
modelStore.modalVisible = true;
|
||||
modelStore.params.sttp = "ENG";
|
||||
modelStore.title = record.stnm + " 详情信息";
|
||||
modelStore.title = record.stnm;
|
||||
modelStore.params.stcd = record.rstcd;
|
||||
}
|
||||
|
||||
|
||||
@ -64,7 +64,7 @@ const customTransform = (res: any) => {
|
||||
const handleViewDetail = (record: any) => {
|
||||
modelStore.modalVisible = true;
|
||||
modelStore.params.sttp = "VD_FBFM";
|
||||
modelStore.title = record.stnm + "详情信息";
|
||||
modelStore.title = record.stnm ;
|
||||
modelStore.params.stcd = record.stcd;
|
||||
}
|
||||
// 页面加载时执行
|
||||
|
||||
@ -3,19 +3,38 @@
|
||||
<!-- 搜索表单 -->
|
||||
<a-form layout="inline" class="search-form">
|
||||
<a-form-item label="设施类型">
|
||||
<a-select v-model:value="filterOpts.dwtp" placeholder="请选择设施类型" style="width: 150px"
|
||||
:options="facilityTypeOptions" />
|
||||
<a-select
|
||||
v-model:value="filterOpts.dwtp"
|
||||
placeholder="请选择设施类型"
|
||||
style="width: 150px"
|
||||
:options="facilityTypeOptions"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="所属基地">
|
||||
<a-select v-model:value="filterOpts.baseId" placeholder="请选择所属基地" style="width: 200px" show-search
|
||||
:filter-option="filterOption" :options="jdInfoOpt" />
|
||||
<a-select
|
||||
v-model:value="filterOpts.baseId"
|
||||
placeholder="请选择所属基地"
|
||||
style="width: 200px"
|
||||
show-search
|
||||
:filter-option="filterOption"
|
||||
:options="jdInfoOpt"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="建设状态">
|
||||
<a-select v-model:value="filterOpts.bldstt" placeholder="请选择建设状态" style="width: 150px"
|
||||
:options="buildStateOptions" />
|
||||
<a-select
|
||||
v-model:value="filterOpts.bldstt"
|
||||
placeholder="请选择建设状态"
|
||||
style="width: 150px"
|
||||
:options="buildStateOptions"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item>
|
||||
<a-input v-model:value="filterOpts.searchContent" placeholder="请输入设施名称" style="width: 200px" allow-clear />
|
||||
<a-input
|
||||
v-model:value="filterOpts.searchContent"
|
||||
placeholder="请输入设施名称"
|
||||
style="width: 200px"
|
||||
allow-clear
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item>
|
||||
<a-space>
|
||||
@ -34,8 +53,16 @@
|
||||
</a-form>
|
||||
|
||||
<!-- 数据表格 -->
|
||||
<BasicTable ref="tableRef" :scroll-y="400" :columns="columns" :list-url="vmsstbprptGetKendoList" :enable-sort="true"
|
||||
:search-params="searchParams" :transform-data="customTransform" @sort-change="handleSortChange">
|
||||
<BasicTable
|
||||
ref="tableRef"
|
||||
:scroll-y="400"
|
||||
:columns="columns"
|
||||
:list-url="fpVmsstbprptGetKendoList"
|
||||
:enable-sort="true"
|
||||
:search-params="searchParams"
|
||||
:transform-data="customTransform"
|
||||
@sort-change="handleSortChange"
|
||||
>
|
||||
<template #ennm="{ record }">
|
||||
<a @click="handleViewDetail(record, 'dz')" class="text-link">
|
||||
{{ record.ennm }}
|
||||
@ -54,7 +81,7 @@
|
||||
import { ref, computed, onMounted, nextTick } from 'vue';
|
||||
import BasicTable from '@/components/BasicTable/index.vue';
|
||||
// TODO: API 接口 - 需要在 @/api/gyss 中实现
|
||||
import { vmsstbprptGetKendoList } from '@/api/gyss';
|
||||
import { fpVmsstbprptGetKendoList } from '@/api/gyss';
|
||||
import { useModelStore } from '@/store/modules/model';
|
||||
|
||||
const modelStore = useModelStore();
|
||||
@ -318,12 +345,16 @@ const handleViewDetail = (record: any, type: string) => {
|
||||
if (type === 'dz') {
|
||||
modelStore.modalVisible = true;
|
||||
modelStore.params.sttp = 'ENG';
|
||||
modelStore.title = record.ennm + ' 详情信息';
|
||||
modelStore.title = record.ennm;
|
||||
modelStore.params.stcd = record.rstcd;
|
||||
} else {
|
||||
// const sttpFullPath = 'ENV,ENVP,FP,FP_2,';
|
||||
// 由于字符串末尾有逗号,直接分割会产生一个空字符串。使用 filter 去除空项是最稳妥的。
|
||||
const parts = record.sttpFullPath.split(',').filter(item => item.trim() !== '');
|
||||
const lastValue = parts[parts.length - 1];
|
||||
modelStore.modalVisible = true;
|
||||
modelStore.params.sttp = 'fp_point';
|
||||
modelStore.title = record.stnm + '详情信息';
|
||||
modelStore.params.sttp = lastValue
|
||||
modelStore.title = record.stnm;
|
||||
modelStore.params.stcd = record.stcd;
|
||||
}
|
||||
// console.log('【查看详情】', record)
|
||||
|
||||
@ -816,7 +816,7 @@ const handleViewDetail = (record: any) => {
|
||||
});
|
||||
modelStore.modalVisible = true;
|
||||
modelStore.params.sttp = 'WT';
|
||||
modelStore.title = stnm + '详情信息';
|
||||
modelStore.title = stnm ;
|
||||
modelStore.params.stcd = formValue.stcd;
|
||||
};
|
||||
|
||||
|
||||
@ -21,7 +21,7 @@
|
||||
</a-spin>
|
||||
</SidePanelItem>
|
||||
<!-- 弹框 -->
|
||||
<a-modal v-model:open="modalVisible" :title="'水质监测工作开展情况'" :footer="null" width="1536px" @cancel="handleCloseModal">
|
||||
<a-modal v-model:open="modalVisible" :title="'栖息地保护工作开展情况'" :footer="null" width="1536px" @cancel="handleCloseModal">
|
||||
<QixidiheduanjianceqingkuangEJ v-if="currentFacility" :activeKey="currentFacility.sttpCode" :tabs="facilities"
|
||||
:baseId="baseid" />
|
||||
</a-modal>
|
||||
|
||||
@ -347,24 +347,25 @@ const handleViewDetail = (record: any, type: any) => {
|
||||
if (type == 'dz') {
|
||||
modelStore.modalVisible = true;
|
||||
modelStore.params.sttp = 'ENG';
|
||||
modelStore.title = record.ennm + ' 详情信息';
|
||||
modelStore.title = record.ennm;
|
||||
modelStore.params.stcd = record.rstcd;
|
||||
} else {
|
||||
if (tabIndex.value == 'FH') {
|
||||
modelStore.modalVisible = true;
|
||||
modelStore.params.sttp = 'FH';
|
||||
modelStore.title = record.stnm + ' 详情信息';
|
||||
modelStore.title = record.stnm;
|
||||
modelStore.params.stcd = record.stcd;
|
||||
modelStore.params.bldstt = '2';
|
||||
modelStore.params.show = false;
|
||||
} else if (tabIndex.value == 'WTRV') {
|
||||
modelStore.modalVisible = true;
|
||||
modelStore.params.sttp = 'WT';
|
||||
modelStore.title = record.stnm + ' 详情信息';
|
||||
modelStore.title = record.stnm;
|
||||
modelStore.params.stcd = record.stcd;
|
||||
} else if (tabIndex.value == 'ZQ') {
|
||||
modelStore.modalVisible = true;
|
||||
modelStore.params.sttp = 'fh_zq_point';
|
||||
modelStore.title = record.stnm + ' 详情信息';
|
||||
modelStore.title = record.stnm;
|
||||
modelStore.params.stcd = record.stcd;
|
||||
} else if (tabIndex.value == 'VD') {
|
||||
modelStore.modalVisible = true;
|
||||
|
||||
@ -290,7 +290,7 @@ const handleHabitatClick = (record: any) => {
|
||||
// TODO: 后续实现具体功能
|
||||
modelStore.modalVisible = true;
|
||||
modelStore.params.sttp = 'FH';
|
||||
modelStore.title = record.stnm + ' 详情信息';
|
||||
modelStore.title = record.stnm;
|
||||
modelStore.params.stcd = record.stcd;
|
||||
modelStore.params.show = true;
|
||||
};
|
||||
|
||||
@ -0,0 +1,416 @@
|
||||
<template>
|
||||
<div class="stlldbqk_container">
|
||||
<div class="stlldbqk_title">
|
||||
<div>选择水电站:</div>
|
||||
<a-select
|
||||
v-model:value="from.baseId"
|
||||
show-search
|
||||
placeholder=" "
|
||||
:options="jidiOptions"
|
||||
:filter-option="filterOption"
|
||||
@change="handleChange"
|
||||
style="width: 200px; margin: 0px 10px"
|
||||
></a-select>
|
||||
<a-select
|
||||
v-model:value="from.stcd"
|
||||
show-search
|
||||
placeholder="请选择电站"
|
||||
:options="stcdOptions"
|
||||
:filter-option="filterOption"
|
||||
style="width: 200px"
|
||||
></a-select>
|
||||
<a-button type="primary" style="margin: 0px 10px" @click="Search()"
|
||||
>搜索</a-button
|
||||
>
|
||||
<a-button @click="resetSearch()">重置</a-button>
|
||||
</div>
|
||||
<div class="table">
|
||||
<BasicTable
|
||||
ref="tableRef"
|
||||
:columns="columns"
|
||||
:scrollY="480"
|
||||
:list-url="vmsstbprptGetKendoList"
|
||||
:search-params="searchParams"
|
||||
:transform-data="customTransform"
|
||||
:enable-sort="true"
|
||||
@sort-change="handleSortChange"
|
||||
>
|
||||
<template #dvtp="{ record }">
|
||||
{{
|
||||
record.dvtp == 2 ? '引水式' : record.dvtp == 3 ? '混合式' : '坝后式'
|
||||
}}
|
||||
</template>
|
||||
<template #stindx="{ record }">
|
||||
{{ record.dvtp == 2 ? '生态流量' : '出库流量' }}
|
||||
</template>
|
||||
<template #coenvwState="{ column, record }">
|
||||
<a-tag :color="record.coenvwState > 0 ? 'success' : ''">
|
||||
{{ record.coenvwState > 0 ? '在线' : '离线' }}
|
||||
</a-tag>
|
||||
</template>
|
||||
<template #action="{ column, record }">
|
||||
<a-button type="link" size="small" @click="handleView(record)"
|
||||
>查看详情</a-button
|
||||
>
|
||||
</template>
|
||||
</BasicTable>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, computed, onMounted, onUnmounted, watch, nextTick, h } from 'vue';
|
||||
import { useJidiSelectEventStore } from '@/store/modules/jidiSelectEvent';
|
||||
import { vmsstbprptGetKendoList } from '@/api/stll';
|
||||
import BasicTable from '@/components/BasicTable/index.vue';
|
||||
import { useModelStore } from '@/store/modules/model';
|
||||
|
||||
const modelStore = useModelStore();
|
||||
const props = defineProps<{
|
||||
baseId?: any;
|
||||
titleData?: any;
|
||||
}>();
|
||||
const tableRef = ref();
|
||||
const columns = ref([
|
||||
{
|
||||
title: '所属基地',
|
||||
key: 'baseName',
|
||||
dataIndex: 'baseName',
|
||||
merge: true, // 启用行合并
|
||||
visible: true
|
||||
},
|
||||
{
|
||||
title: '电站名称',
|
||||
key: 'stnm',
|
||||
dataIndex: 'stnm',
|
||||
visible: true
|
||||
},
|
||||
{
|
||||
title: '开发方式',
|
||||
key: 'dvtp',
|
||||
dataIndex: 'dvtp',
|
||||
visible: true,
|
||||
slots: { customRender: 'dvtp' }
|
||||
},
|
||||
{
|
||||
title: '生态流量站类型',
|
||||
key: 'stindx',
|
||||
dataIndex: 'stindx',
|
||||
visible: true,
|
||||
slots: { customRender: 'stindx' }
|
||||
},
|
||||
{
|
||||
title: '建成时间',
|
||||
key: 'jcdt',
|
||||
dataIndex: 'jcdt',
|
||||
visible: true,
|
||||
sorter: true,
|
||||
customRender: ({ record }: any) => {
|
||||
const date = record.jcdt;
|
||||
if (!date) return '-';
|
||||
if (typeof date === 'string' && /^\d{4}-\d{2}-\d{2}$/.test(date)) {
|
||||
return date;
|
||||
}
|
||||
if (typeof date === 'string' && date.includes(' ')) {
|
||||
return date.split(' ')[0];
|
||||
}
|
||||
return date;
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '监测状态',
|
||||
key: 'coenvwState',
|
||||
dataIndex: 'coenvwState',
|
||||
visible: true,
|
||||
slots: { customRender: 'coenvwState' }
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
key: 'action',
|
||||
width: 120,
|
||||
slots: { customRender: 'action' }
|
||||
}
|
||||
]);
|
||||
const sort = {
|
||||
sort: [
|
||||
{
|
||||
field: 'baseStepSort',
|
||||
dir: 'asc'
|
||||
},
|
||||
{
|
||||
field: 'hbrvcd',
|
||||
dir: 'asc'
|
||||
},
|
||||
{
|
||||
field: 'rstcdStepSort',
|
||||
dir: 'asc'
|
||||
},
|
||||
{
|
||||
field: 'siteStepSort',
|
||||
dir: 'asc'
|
||||
}
|
||||
],
|
||||
group: [],
|
||||
select: [
|
||||
'baseName',
|
||||
'stnm',
|
||||
'ennm',
|
||||
'jcdt',
|
||||
'stindx',
|
||||
'coenvwState',
|
||||
'sttpCode',
|
||||
'stcd',
|
||||
'rstcd',
|
||||
'stCode',
|
||||
'stName',
|
||||
'dvtp'
|
||||
],
|
||||
groupResultFlat: false
|
||||
};
|
||||
const JidiSelectEventStore = useJidiSelectEventStore();
|
||||
// JidiSelectEventStore.jidiData
|
||||
let jidiOptions = computed(() => {
|
||||
return [
|
||||
...JidiSelectEventStore.jidiData.map((item: any) => ({
|
||||
value: item.wbsCode,
|
||||
label: item.wbsName
|
||||
}))
|
||||
];
|
||||
});
|
||||
const from = ref({
|
||||
baseId: props.baseId || 'all',
|
||||
stcd: ''
|
||||
});
|
||||
|
||||
// 排序状态管理
|
||||
const sortInfo = ref<{ field: string; order: string | null }>({
|
||||
field: '',
|
||||
order: null
|
||||
});
|
||||
|
||||
// 动态计算搜索参数(包含排序)
|
||||
const searchParams = computed(() => {
|
||||
let baseSort;
|
||||
|
||||
// 如果用户触发了排序,将其加入排序数组
|
||||
if (sortInfo.value.field && sortInfo.value.order) {
|
||||
baseSort = [
|
||||
{
|
||||
field: sortInfo.value.field,
|
||||
dir: sortInfo.value.order === 'ascend' ? 'asc' : 'desc'
|
||||
}
|
||||
];
|
||||
} else {
|
||||
baseSort = [
|
||||
{ field: 'baseStepSort', dir: 'asc' },
|
||||
{ field: 'hbrvcd', dir: 'asc' },
|
||||
{ field: 'rstcdStepSort', dir: 'asc' },
|
||||
{ field: 'siteStepSort', dir: 'asc' }
|
||||
];
|
||||
}
|
||||
|
||||
return {
|
||||
sort: baseSort,
|
||||
group: [],
|
||||
select: [
|
||||
'baseName',
|
||||
'stnm',
|
||||
'ennm',
|
||||
'jcdt',
|
||||
'stindx',
|
||||
'coenvwState',
|
||||
'sttpCode',
|
||||
'stcd',
|
||||
'rstcd',
|
||||
'stCode',
|
||||
'stName',
|
||||
'dvtp'
|
||||
],
|
||||
groupResultFlat: false
|
||||
};
|
||||
});
|
||||
|
||||
// 监听 props.baseId 变化,同步到 from.value.baseId
|
||||
watch(
|
||||
() => props.baseId,
|
||||
newBaseId => {
|
||||
// 只在有有效值且与当前值不同时才更新
|
||||
if (newBaseId && newBaseId !== from.value.baseId) {
|
||||
from.value.baseId = newBaseId;
|
||||
from.value.stcd = ''; // 重置电站选择
|
||||
// 异步等待 DOM 更新后再搜索
|
||||
nextTick(() => {
|
||||
handleChange(); // 先刷新电站列表
|
||||
Search(); // 再执行搜索
|
||||
});
|
||||
}
|
||||
},
|
||||
{ immediate: false }
|
||||
);
|
||||
|
||||
const filterOption = (input: string, option: any) => {
|
||||
return option.value.toLowerCase().indexOf(input.toLowerCase()) >= 0;
|
||||
};
|
||||
const stcdOptions = ref([]);
|
||||
const handleChange = async () => {
|
||||
try {
|
||||
let params = {
|
||||
filter: {
|
||||
logic: 'and',
|
||||
filters: [
|
||||
from.value.baseId != 'all'
|
||||
? {
|
||||
field: 'baseId',
|
||||
operator: 'contains',
|
||||
dataType: 'string',
|
||||
value: from.value.baseId
|
||||
}
|
||||
: null,
|
||||
{
|
||||
field: 'sttpCode',
|
||||
operator: 'eq',
|
||||
dataType: 'string',
|
||||
value: 'ENG'
|
||||
}
|
||||
].filter(Boolean)
|
||||
},
|
||||
sort: [
|
||||
{
|
||||
field: 'baseId',
|
||||
dir: 'asc'
|
||||
},
|
||||
{
|
||||
field: 'rvcdStepSort',
|
||||
dir: 'asc'
|
||||
},
|
||||
{
|
||||
field: 'rstcdStepSort',
|
||||
dir: 'asc'
|
||||
},
|
||||
{
|
||||
field: 'siteStepSort',
|
||||
dir: 'asc'
|
||||
}
|
||||
],
|
||||
select: ['stcd', 'stnm']
|
||||
};
|
||||
let res = await vmsstbprptGetKendoList(params);
|
||||
if (res?.data?.success && res?.data?.data) {
|
||||
let data = res.data.data;
|
||||
stcdOptions.value = data.map((item: any) => ({
|
||||
value: item.stcd,
|
||||
label: item.stnm
|
||||
}));
|
||||
} else {
|
||||
stcdOptions.value = [];
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('获取电站列表失败:', error);
|
||||
stcdOptions.value = [];
|
||||
}
|
||||
};
|
||||
const Search = () => {
|
||||
let filters = [
|
||||
from.value.stcd
|
||||
? {
|
||||
field: 'stcd',
|
||||
operator: 'eq',
|
||||
value: from.value.stcd
|
||||
}
|
||||
: null,
|
||||
from.value.baseId != 'all'
|
||||
? {
|
||||
field: 'baseId',
|
||||
operator: 'eq',
|
||||
value: from.value.baseId
|
||||
}
|
||||
: null,
|
||||
{
|
||||
field: 'runState',
|
||||
operator: 'eq',
|
||||
value: 4
|
||||
},
|
||||
{
|
||||
field: 'sttpCode',
|
||||
operator: 'eq',
|
||||
dataType: 'string',
|
||||
value: props.titleData?.sttpCode || 'ENG'
|
||||
},
|
||||
{
|
||||
field: 'DTIN',
|
||||
operator: 'eq',
|
||||
dataType: 'string',
|
||||
value: 1
|
||||
},
|
||||
{
|
||||
field: 'bldsttCcode',
|
||||
operator: 'eq',
|
||||
dataType: 'string',
|
||||
value: 2
|
||||
}
|
||||
].filter(Boolean);
|
||||
const filter = {
|
||||
logic: 'and',
|
||||
filters
|
||||
};
|
||||
tableRef.value?.getList(filter);
|
||||
};
|
||||
|
||||
// 处理排序变化
|
||||
const handleSortChange = (info: {
|
||||
field: string;
|
||||
order: 'ascend' | 'descend' | null;
|
||||
}) => {
|
||||
sortInfo.value.field = info.field || '';
|
||||
sortInfo.value.order = info.order || null;
|
||||
|
||||
// 等待 DOM 和响应式状态更新完成后再触发搜索,确保 BasicTable 拿到最新的 searchParams
|
||||
nextTick(() => {
|
||||
Search();
|
||||
});
|
||||
};
|
||||
|
||||
const resetSearch = () => {
|
||||
from.value = {
|
||||
baseId: 'all',
|
||||
stcd: ''
|
||||
};
|
||||
Search();
|
||||
};
|
||||
// 自定义数据转换
|
||||
const customTransform = (res: any) => {
|
||||
return {
|
||||
records: res?.data?.data || [],
|
||||
total: res?.data?.total || 0
|
||||
};
|
||||
};
|
||||
const handleView = (record: any) => {
|
||||
modelStore.modalVisible = true;
|
||||
modelStore.params.sttp = 'ENG';
|
||||
modelStore.title = record.stnm;
|
||||
modelStore.params.stcd = record.stcd;
|
||||
modelStore.params.eqtp = 'QGC';
|
||||
modelStore.filterStll = 'qecInterval';
|
||||
};
|
||||
onMounted(() => {
|
||||
handleChange();
|
||||
Search();
|
||||
});
|
||||
onUnmounted(() => {});
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.stlldbqk_container {
|
||||
width: 100%;
|
||||
.stlldbqk_title {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.table {
|
||||
width: 100%;
|
||||
height: 560px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@ -0,0 +1,944 @@
|
||||
<template>
|
||||
<div class="stlldbqk-container">
|
||||
<!-- 搜索表单 -->
|
||||
<a-form layout="inline" class="search-form">
|
||||
<a-form-item label="基地选择">
|
||||
<a-select
|
||||
v-model:value="params.qid"
|
||||
placeholder="请选择基地"
|
||||
style="width: 200px"
|
||||
show-search
|
||||
:filter-option="filterOption"
|
||||
:options="jidiOptions"
|
||||
/>
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item label="规则类型">
|
||||
<a-select
|
||||
v-model:value="params.key"
|
||||
placeholder="请选择规则类型"
|
||||
style="width: 180px"
|
||||
:options="ruleTypeOptions"
|
||||
/>
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item label="时间维度">
|
||||
<a-select
|
||||
v-model:value="params.timeType"
|
||||
placeholder="请选择时间维度"
|
||||
style="width: 120px"
|
||||
:options="timeTypeOptions"
|
||||
/>
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item label="日期范围">
|
||||
<a-range-picker
|
||||
v-model:value="dateRange"
|
||||
:allow-clear="false"
|
||||
format="YYYY-MM-DD"
|
||||
style="width: 360px"
|
||||
/>
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item>
|
||||
<a-space>
|
||||
<a-button type="primary" @click="handleSearch">查询</a-button>
|
||||
</a-space>
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
|
||||
<!-- Tabs 标签页 -->
|
||||
<a-tabs
|
||||
v-if="tabList.length > 0"
|
||||
v-model:activeKey="ecoFlowType"
|
||||
class="tab-style"
|
||||
@change="fetchTableData"
|
||||
>
|
||||
<a-tab-pane v-for="item in tabList" :key="item.key" :tab="item.label" />
|
||||
</a-tabs>
|
||||
|
||||
<!-- 空状态 -->
|
||||
<a-empty v-if="!loading && tabList.length === 0" description="暂无数据" />
|
||||
|
||||
<div class="body_zhengti">
|
||||
<div class="echarts">
|
||||
<a-spin :spinning="dataLoading">
|
||||
<div v-if="pieData.length > 0" ref="chartRef" class="pie-chart"></div>
|
||||
<a-empty
|
||||
v-if="!dataLoading && pieData.length === 0"
|
||||
description="暂无数据"
|
||||
/>
|
||||
</a-spin>
|
||||
</div>
|
||||
<div class="table">
|
||||
<BasicTable
|
||||
ref="tableRef"
|
||||
:columns="columns"
|
||||
:scrollY="380"
|
||||
:list-url="
|
||||
params.timeType == 'day'
|
||||
? dayGetKendoListCust
|
||||
: hourGetKendoListCust
|
||||
"
|
||||
:search-params="searchParams"
|
||||
:transform-data="customTransform"
|
||||
:enable-sort="true"
|
||||
@sort-change="handleSortChange"
|
||||
>
|
||||
<template #ennm="{ column, record }">
|
||||
<a-button type="link" size="small" @click="handleView(record)">{{
|
||||
record.ennm
|
||||
}}</a-button>
|
||||
</template>
|
||||
</BasicTable>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, computed, onMounted, onUnmounted, watch, nextTick } from 'vue';
|
||||
import * as echarts from 'echarts';
|
||||
import type { EChartsOption } from 'echarts';
|
||||
import dayjs from 'dayjs';
|
||||
import { useJidiSelectEventStore } from '@/store/modules/jidiSelectEvent';
|
||||
import { dayGetKendoListCust, hourGetKendoListCust } from '@/api/stll';
|
||||
import BasicTable from '@/components/BasicTable/index.vue';
|
||||
import { useModelStore } from '@/store/modules/model';
|
||||
|
||||
const modelStore = useModelStore();
|
||||
const props = defineProps<{
|
||||
options?: any[];
|
||||
typeKey?: string;
|
||||
time?: string;
|
||||
basicId?: string;
|
||||
}>();
|
||||
|
||||
const JidiSelectEventStore = useJidiSelectEventStore();
|
||||
const columns = [
|
||||
{
|
||||
key: 'ennm',
|
||||
title: '电站名称',
|
||||
dataIndex: 'ennm',
|
||||
slots: { customRender: 'action' }
|
||||
},
|
||||
{
|
||||
key: 'baseName',
|
||||
title: '所属基地',
|
||||
dataIndex: 'baseName'
|
||||
},
|
||||
{
|
||||
key: 'addvcdName',
|
||||
title: '行政区',
|
||||
dataIndex: 'addvcdName'
|
||||
},
|
||||
{
|
||||
key: 'hbrvcdName',
|
||||
title: '所在河段',
|
||||
dataIndex: 'hbrvcdName',
|
||||
width: '400px'
|
||||
},
|
||||
{
|
||||
key: 'qecRate',
|
||||
title: `生态流量达标率(%)`,
|
||||
dataIndex: 'qecRate',
|
||||
sorter: true, // 启用排序
|
||||
width: '160px',
|
||||
customRender: ({ text }: any) => {
|
||||
if (text === null || text === undefined || text === '' || text === '-')
|
||||
return '-';
|
||||
return Number(text).toFixed(2);
|
||||
}
|
||||
}
|
||||
];
|
||||
const tableRef = ref();
|
||||
|
||||
// 排序状态管理
|
||||
const sortInfo = ref<{ field: string; order: string | null }>({
|
||||
field: '',
|
||||
order: null
|
||||
});
|
||||
|
||||
const sort1 = ref([
|
||||
{
|
||||
field: 'baseStepSort',
|
||||
dir: 'asc'
|
||||
},
|
||||
{
|
||||
field: 'rvcdStepSort',
|
||||
dir: 'asc'
|
||||
},
|
||||
{
|
||||
field: 'siteStepSort',
|
||||
dir: 'asc'
|
||||
},
|
||||
{
|
||||
field: 'avqRate',
|
||||
dir: 'desc'
|
||||
}
|
||||
]);
|
||||
const sort2 = ref([
|
||||
{
|
||||
field: 'baseStepSort',
|
||||
dir: 'asc'
|
||||
},
|
||||
{
|
||||
field: 'rvcdStepSort',
|
||||
dir: 'asc'
|
||||
},
|
||||
{
|
||||
field: 'siteStepSort',
|
||||
dir: 'asc'
|
||||
}
|
||||
]);
|
||||
|
||||
// 动态计算搜索参数(包含排序)
|
||||
const searchParams = computed(() => {
|
||||
let baseSort;
|
||||
|
||||
// 如果用户触发了排序,将其加入排序数组
|
||||
if (sortInfo.value.field && sortInfo.value.order) {
|
||||
baseSort = [
|
||||
{
|
||||
field: sortInfo.value.field,
|
||||
dir: sortInfo.value.order === 'ascend' ? 'asc' : 'desc'
|
||||
}
|
||||
];
|
||||
} else {
|
||||
// 使用默认排序
|
||||
baseSort = params.value.key ? sort1.value : sort2.value;
|
||||
}
|
||||
|
||||
return {
|
||||
sort: baseSort
|
||||
};
|
||||
});
|
||||
|
||||
// 处理排序变化
|
||||
const handleSortChange = (info: {
|
||||
field: string;
|
||||
order: 'ascend' | 'descend' | null;
|
||||
}) => {
|
||||
sortInfo.value.field = info.field || '';
|
||||
sortInfo.value.order = info.order || null;
|
||||
|
||||
// 等待 DOM 和响应式状态更新完成后再触发搜索
|
||||
nextTick(() => {
|
||||
fetchTableData();
|
||||
});
|
||||
};
|
||||
|
||||
// 初始化日期范围:上个月的本日到今天
|
||||
const initDateRange = () => {
|
||||
const today = dayjs();
|
||||
const lastMonthSameDay = today.subtract(1, 'month');
|
||||
return [lastMonthSameDay, today];
|
||||
};
|
||||
|
||||
const dateRange = ref(initDateRange());
|
||||
|
||||
const params = ref({
|
||||
qid: props.basicId || 'all',
|
||||
key: props.typeKey || '',
|
||||
timeType: props.time || 'day',
|
||||
sTime: '',
|
||||
eTime: ''
|
||||
});
|
||||
|
||||
// Tab 相关状态
|
||||
const tabList = ref<any[]>([]);
|
||||
const ecoFlowType = ref<string>('');
|
||||
const loading = ref<boolean>(false);
|
||||
|
||||
const timeTypeOptions = [
|
||||
{ label: '逐时', value: 'hour' },
|
||||
{ label: '日', value: 'day' }
|
||||
];
|
||||
|
||||
const jidiOptions = computed(() => {
|
||||
return [
|
||||
...JidiSelectEventStore.jidiData.map((item: any) => ({
|
||||
value: item.wbsCode,
|
||||
label: item.wbsName
|
||||
}))
|
||||
];
|
||||
});
|
||||
|
||||
const ruleTypeOptions = computed(() => {
|
||||
return (
|
||||
props.options?.map((el: any) => ({
|
||||
label: el.name,
|
||||
value: el.key
|
||||
})) || []
|
||||
);
|
||||
});
|
||||
|
||||
const filterOption = (input: string, option: any) => {
|
||||
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0;
|
||||
};
|
||||
|
||||
// ==================== 图表相关 ====================
|
||||
const chartRef = ref<HTMLDivElement | null>(null);
|
||||
let chartInstance: echarts.ECharts | null = null;
|
||||
const pieData = ref<any[]>([]); // 饼图数据源
|
||||
const dataLoading = ref<boolean>(false);
|
||||
const pieCode = ref<string[]>([]); // 用于表格过滤的选中项
|
||||
|
||||
// 颜色配置
|
||||
const themeecLists = [];
|
||||
|
||||
const jdColor = [
|
||||
'#4b79ab',
|
||||
'#78c300',
|
||||
'#9556a4',
|
||||
'#df91ab',
|
||||
'#7399c6',
|
||||
'#dbb629',
|
||||
'#56c2e3',
|
||||
'#f56a06',
|
||||
'#cdba75',
|
||||
'#76523b',
|
||||
'#df75b6',
|
||||
'#00a050',
|
||||
'#f5a644',
|
||||
'#4b79ab',
|
||||
'#78c300',
|
||||
'#9556a4',
|
||||
'#df91ab',
|
||||
'#7399c6',
|
||||
'#dbb629',
|
||||
'#56c2e3',
|
||||
'#f56a06',
|
||||
'#cdba75',
|
||||
'#76523b',
|
||||
'#df75b6',
|
||||
'#00a050',
|
||||
'#f5a644'
|
||||
];
|
||||
|
||||
// 获取饼图数据
|
||||
const fetchPieData = async () => {
|
||||
if (!ecoFlowType.value || !params.value.sTime || !params.value.eTime) return;
|
||||
|
||||
dataLoading.value = true;
|
||||
try {
|
||||
const { sTime, eTime, qid, key, timeType } = params.value;
|
||||
|
||||
// 构建过滤条件
|
||||
const filters = [
|
||||
qid != 'all'
|
||||
? {
|
||||
field: 'baseId',
|
||||
operator: 'eq',
|
||||
dataType: 'string',
|
||||
value: qid
|
||||
}
|
||||
: null,
|
||||
{
|
||||
field: 'dtin',
|
||||
operator: 'eq',
|
||||
dataType: 'string',
|
||||
value: '1'
|
||||
},
|
||||
{
|
||||
field: 'tm',
|
||||
operator: 'gte',
|
||||
dataType: 'date',
|
||||
value: sTime
|
||||
},
|
||||
{
|
||||
field: 'tm',
|
||||
operator: 'lte',
|
||||
dataType: 'date',
|
||||
value: eTime
|
||||
},
|
||||
key
|
||||
? {
|
||||
field: key,
|
||||
operator: 'eq',
|
||||
dataType: 'string',
|
||||
value: ecoFlowType.value
|
||||
}
|
||||
: null
|
||||
].filter(Boolean);
|
||||
|
||||
// 当 key 为空时,添加额外的区间过滤条件
|
||||
if (!key) {
|
||||
filters.push(
|
||||
{
|
||||
field: 'qecInterval',
|
||||
operator: 'eq',
|
||||
dataType: 'string',
|
||||
value: 'QEC_STLL_6_NOEQMN'
|
||||
},
|
||||
{
|
||||
field: 'mwrInterval',
|
||||
operator: 'eq',
|
||||
dataType: 'string',
|
||||
value: 'QEC_STLL_6_NOEQMN'
|
||||
},
|
||||
{
|
||||
field: 'avqInterval',
|
||||
operator: 'eq',
|
||||
dataType: 'string',
|
||||
value: 'QEC_STLL_6_NOEQMN'
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
let obj: any = {
|
||||
filter: {
|
||||
logic: 'and',
|
||||
filters: filters
|
||||
},
|
||||
group: [
|
||||
qid !== 'all' ? { dir: 'asc', field: 'rvcdStepSort' } : null,
|
||||
qid === 'all' ? { dir: 'asc', field: 'baseStepSort' } : null,
|
||||
{
|
||||
dir: 'asc',
|
||||
field: qid === 'all' ? 'baseId' : 'hbrvcd'
|
||||
},
|
||||
qid !== 'all'
|
||||
? { dir: 'asc', field: 'hbrvcdName' }
|
||||
: { dir: 'asc', field: 'baseName' }
|
||||
].filter(Boolean),
|
||||
groupResultFlat: true
|
||||
};
|
||||
|
||||
// TODO: 调用实际 API
|
||||
// const res = timeType == 'day'
|
||||
// ? await shengTaiLiuLiang.STLLTabsDay(obj)
|
||||
// : await shengTaiLiuLiang.STLLTabsHour(obj);
|
||||
|
||||
let res =
|
||||
timeType == 'day'
|
||||
? await dayGetKendoListCust(obj)
|
||||
: await hourGetKendoListCust(obj);
|
||||
|
||||
if (res?.data?.data) {
|
||||
const dataSource = res.data.data.map((el: any) => ({
|
||||
id: qid === 'all' ? el.baseId : el.hbrvcd,
|
||||
name: qid === 'all' ? el.baseName || el.key : el.hbrvcdName,
|
||||
value: qid === 'all' ? el.count_baseId : el.count_hbrvcd,
|
||||
key: qid === 'all' ? el.baseId : el.hbrvcd
|
||||
}));
|
||||
|
||||
pieData.value = dataSource;
|
||||
pieCode.value = []; // 重置选中状态
|
||||
|
||||
// 等待 DOM 更新后初始化或更新图表
|
||||
await nextTick();
|
||||
initOrUpdateChart();
|
||||
} else {
|
||||
pieData.value = [];
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('获取饼图数据失败:', error);
|
||||
pieData.value = [];
|
||||
} finally {
|
||||
dataLoading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
// 初始化或更新图表
|
||||
const initOrUpdateChart = () => {
|
||||
if (!chartRef.value) return;
|
||||
|
||||
// 如果实例不存在,初始化
|
||||
if (!chartInstance) {
|
||||
chartInstance = echarts.init(chartRef.value);
|
||||
|
||||
// 绑定图例选择事件
|
||||
chartInstance.on('legendselectchanged', handleLegendSelectChanged);
|
||||
}
|
||||
|
||||
updateChart();
|
||||
};
|
||||
|
||||
// 更新图表配置
|
||||
const updateChart = () => {
|
||||
if (!chartInstance) return;
|
||||
|
||||
const total =
|
||||
pieData.value.reduce((pre: number, cur: any) => pre + cur.value, 0) || 0;
|
||||
|
||||
// 生成颜色数组
|
||||
const colors = pieData.value.map((item: any, index: number) => {
|
||||
const matched = themeecLists.find((i: any) => i.name === item.name);
|
||||
return matched?.color || jdColor[index % jdColor.length];
|
||||
});
|
||||
|
||||
const option: EChartsOption = {
|
||||
color: colors,
|
||||
tooltip: {
|
||||
trigger: 'item',
|
||||
formatter: '{b}: {c} (座) ({d}%)'
|
||||
},
|
||||
legend: {
|
||||
orient: 'vertical',
|
||||
right: 20,
|
||||
top: 80,
|
||||
type: 'scroll',
|
||||
textStyle: {
|
||||
width: 100, // 固定文本宽度
|
||||
overflow: 'truncate', // 超出部分截断
|
||||
ellipsis: '...' // 截断时显示的字符
|
||||
}
|
||||
},
|
||||
title: [
|
||||
{
|
||||
text: total.toString(),
|
||||
left: '34%',
|
||||
top: '44%',
|
||||
textAlign: 'center',
|
||||
textStyle: {
|
||||
fontSize: 24,
|
||||
fontWeight: 'bold',
|
||||
color: '#333'
|
||||
}
|
||||
},
|
||||
{
|
||||
text: '电站总数量',
|
||||
left: '34%',
|
||||
top: '51%',
|
||||
textAlign: 'center',
|
||||
textStyle: {
|
||||
fontSize: 14,
|
||||
color: '#666'
|
||||
}
|
||||
},
|
||||
{
|
||||
text: '(座)',
|
||||
left: '34%',
|
||||
top: '55%',
|
||||
textAlign: 'center',
|
||||
textStyle: {
|
||||
fontSize: 12,
|
||||
color: '#999'
|
||||
}
|
||||
}
|
||||
],
|
||||
series: [
|
||||
{
|
||||
name: '电站总数量',
|
||||
type: 'pie',
|
||||
radius: ['31%', '40%'],
|
||||
center: ['35%', '50%'],
|
||||
avoidLabelOverlap: false,
|
||||
itemStyle: {
|
||||
borderRadius: 10,
|
||||
borderColor: '#fff',
|
||||
borderWidth: 2
|
||||
},
|
||||
label: {
|
||||
show: true,
|
||||
formatter: function (params) {
|
||||
const maxLen = 8; // 你希望显示的最大字符数
|
||||
let name = params.name;
|
||||
if (name.length > maxLen) {
|
||||
return name.substring(0, maxLen) + '...';
|
||||
}
|
||||
return name;
|
||||
}
|
||||
},
|
||||
emphasis: {
|
||||
label: {
|
||||
show: true,
|
||||
fontSize: 14,
|
||||
fontWeight: 'bold'
|
||||
}
|
||||
},
|
||||
data: pieData.value
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
chartInstance.setOption(option, true);
|
||||
};
|
||||
|
||||
// 处理图例选择变化
|
||||
const handleLegendSelectChanged = (params: any) => {
|
||||
const selected = params.selected;
|
||||
const trueRivers = Object.keys(selected).filter(key => selected[key]);
|
||||
const allFalse = Object.values(selected).every(value => value === false);
|
||||
|
||||
const selectedKeys = pieData.value
|
||||
.filter((item: any) => trueRivers.includes(item.name))
|
||||
.map((item: any) => item.key);
|
||||
|
||||
pieCode.value = allFalse ? ['0'] : selectedKeys;
|
||||
|
||||
// 刷新表格
|
||||
fetchTableData();
|
||||
};
|
||||
|
||||
// 自定义数据转换
|
||||
const customTransform = (res: any) => {
|
||||
return {
|
||||
records: res?.data?.data || [],
|
||||
total: res?.data?.total || 0
|
||||
};
|
||||
};
|
||||
// 获取 Tab 列表数据
|
||||
const fetchTabList = async () => {
|
||||
if (!params.value.sTime || !params.value.eTime) return;
|
||||
|
||||
loading.value = true;
|
||||
try {
|
||||
const { sTime, eTime, qid, key, timeType } = params.value;
|
||||
|
||||
// 构建过滤条件
|
||||
const filters = [
|
||||
qid != 'all'
|
||||
? {
|
||||
field: 'baseId',
|
||||
operator: 'eq',
|
||||
dataType: 'string',
|
||||
value: qid
|
||||
}
|
||||
: null,
|
||||
{
|
||||
field: 'dtin',
|
||||
operator: 'eq',
|
||||
dataType: 'string',
|
||||
value: '1'
|
||||
},
|
||||
{
|
||||
field: 'tm',
|
||||
operator: 'gte',
|
||||
dataType: 'date',
|
||||
value: sTime
|
||||
},
|
||||
{
|
||||
field: 'tm',
|
||||
operator: 'lte',
|
||||
dataType: 'date',
|
||||
value: eTime
|
||||
}
|
||||
].filter(Boolean);
|
||||
|
||||
// 当 key 为空时,添加额外的区间过滤条件
|
||||
if (!key) {
|
||||
filters.push(
|
||||
{
|
||||
field: 'qecInterval',
|
||||
operator: 'eq',
|
||||
dataType: 'string',
|
||||
value: 'QEC_STLL_6_NOEQMN'
|
||||
},
|
||||
{
|
||||
field: 'mwrInterval',
|
||||
operator: 'eq',
|
||||
dataType: 'string',
|
||||
value: 'QEC_STLL_6_NOEQMN'
|
||||
},
|
||||
{
|
||||
field: 'avqInterval',
|
||||
operator: 'eq',
|
||||
dataType: 'string',
|
||||
value: 'QEC_STLL_6_NOEQMN'
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
let obj: any = {
|
||||
filter: {
|
||||
logic: 'and',
|
||||
filters: filters
|
||||
},
|
||||
group: key
|
||||
? [
|
||||
{
|
||||
dir: 'asc',
|
||||
field: key
|
||||
}
|
||||
]
|
||||
: [
|
||||
{
|
||||
dir: 'asc',
|
||||
field: 'baseStepSort'
|
||||
},
|
||||
{
|
||||
dir: 'asc',
|
||||
field: 'baseId'
|
||||
},
|
||||
{
|
||||
dir: 'asc',
|
||||
field: 'baseName'
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
// 当 key 为空时,添加 groupResultFlat 属性
|
||||
if (!key) {
|
||||
obj.groupResultFlat = true;
|
||||
}
|
||||
|
||||
// TODO: 根据实际 API 调用替换此处逻辑
|
||||
let res =
|
||||
timeType == 'day'
|
||||
? await dayGetKendoListCust(obj)
|
||||
: await hourGetKendoListCust(obj);
|
||||
|
||||
// const res = timeType == 'day'
|
||||
// ? await shengTaiLiuLiang.STLLTabsDay(par, group) dayGetKendoListCust,hourGetKendoListCust
|
||||
// : await shengTaiLiuLiang.STLLTabsHour(par, group);
|
||||
|
||||
// 模拟数据结构(待替换为真实 API)
|
||||
// const res = {
|
||||
// data: [
|
||||
// {
|
||||
// type: 1,
|
||||
// qecCnt: 14,
|
||||
// qecTCnt: 50,
|
||||
// code: 'QEC_STLL_1_DY95',
|
||||
// desc: '环评要求_生态流量达标率所在统计区间:>=95%',
|
||||
// typeName: '环评要求',
|
||||
// key: 'QEC_STLL_1_DY95',
|
||||
// keyName: '环评要求',
|
||||
// count: 14
|
||||
// },
|
||||
// {
|
||||
// type: 2,
|
||||
// qecCnt: 13,
|
||||
// qecTCnt: 71,
|
||||
// code: 'QEC_STLL_2_DY95',
|
||||
// desc: '水利部要求_生态流量达标率所在统计区间:>=95%',
|
||||
// typeName: '水利部要求',
|
||||
// key: 'QEC_STLL_2_DY95',
|
||||
// keyName: '水利部要求',
|
||||
// count: 13
|
||||
// }
|
||||
// ]
|
||||
// };
|
||||
|
||||
if (res?.data?.data?.length > 0) {
|
||||
const resData = res.data.data;
|
||||
|
||||
if (key) {
|
||||
// 有规则类型时:过滤掉"无生态流量要求"的数据
|
||||
tabList.value = resData
|
||||
.map((el: any) => ({
|
||||
...el,
|
||||
value: el.key,
|
||||
label: `${el.keyName || el.typeName}(${el.count || el.qecCnt}座)`
|
||||
}))
|
||||
.filter((el: any) => el.key !== 'QEC_STLL_6_NOEQMN');
|
||||
|
||||
// 查找当前选中的 ecoFlowType 是否在返回数据中
|
||||
const found = resData.find(
|
||||
(el: any) => el.items?.[0] === ecoFlowType.value
|
||||
);
|
||||
|
||||
// 如果找到则保持,否则使用第一个
|
||||
ecoFlowType.value = found ? ecoFlowType.value : resData[0]?.key;
|
||||
} else {
|
||||
// 没有规则类型时:只显示"无生态流量要求"
|
||||
tabList.value = [
|
||||
{
|
||||
key: 'QEC_STLL_6_NOEQMN',
|
||||
value: 'QEC_STLL_6_NOEQMN',
|
||||
label: `无生态流量要求(${resData?.length}座)`
|
||||
}
|
||||
];
|
||||
ecoFlowType.value = 'QEC_STLL_6_NOEQMN';
|
||||
}
|
||||
|
||||
// 获取饼图数据
|
||||
fetchPieData();
|
||||
// 获取表格数据
|
||||
fetchTableData();
|
||||
} else {
|
||||
tabList.value = [];
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('获取 Tab 列表失败:', error);
|
||||
tabList.value = [];
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
};
|
||||
const handleView = (record: any) => {
|
||||
modelStore.modalVisible = true;
|
||||
modelStore.params.sttp = 'ENG';
|
||||
modelStore.title = record.ennm;
|
||||
modelStore.params.stcd = record.stcd;
|
||||
modelStore.params.eqtp = record.eqtp;
|
||||
modelStore.filterStll = params.value.key;
|
||||
};
|
||||
//获取table数据
|
||||
const fetchTableData = async () => {
|
||||
// 刷新表格
|
||||
const { sTime, eTime, qid, key, timeType } = params.value;
|
||||
const filters: any[] = [
|
||||
qid != 'all'
|
||||
? {
|
||||
field: 'baseId',
|
||||
operator: 'eq',
|
||||
dataType: 'string',
|
||||
value: qid
|
||||
}
|
||||
: null,
|
||||
{
|
||||
field: 'tm',
|
||||
operator: 'gte',
|
||||
dataType: 'date',
|
||||
value: sTime
|
||||
},
|
||||
{
|
||||
field: 'tm',
|
||||
operator: 'lte',
|
||||
dataType: 'date',
|
||||
value: eTime
|
||||
},
|
||||
{
|
||||
field: 'dtin',
|
||||
operator: 'eq',
|
||||
dataType: 'string',
|
||||
value: '1'
|
||||
},
|
||||
key
|
||||
? {
|
||||
field: key,
|
||||
operator: 'eq',
|
||||
dataType: 'string',
|
||||
value: ecoFlowType.value
|
||||
}
|
||||
: null
|
||||
].filter(Boolean);
|
||||
if (!key) {
|
||||
filters.push(
|
||||
{
|
||||
field: 'qecInterval',
|
||||
operator: 'eq',
|
||||
dataType: 'string',
|
||||
value: 'QEC_STLL_6_NOEQMN'
|
||||
},
|
||||
{
|
||||
field: 'mwrInterval',
|
||||
operator: 'eq',
|
||||
dataType: 'string',
|
||||
value: 'QEC_STLL_6_NOEQMN'
|
||||
},
|
||||
{
|
||||
field: 'avqInterval',
|
||||
operator: 'eq',
|
||||
dataType: 'string',
|
||||
value: 'QEC_STLL_6_NOEQMN'
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
// 添加饼图选中项过滤
|
||||
if (pieCode.value.length > 0) {
|
||||
if (qid === 'all') {
|
||||
filters.push({
|
||||
field: 'baseId',
|
||||
operator: 'in',
|
||||
dataType: 'string',
|
||||
value: pieCode.value
|
||||
});
|
||||
} else {
|
||||
filters.push({
|
||||
field: 'hbrvcd',
|
||||
operator: 'in',
|
||||
dataType: 'string',
|
||||
value: pieCode.value
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
const filter = {
|
||||
logic: 'and',
|
||||
filters
|
||||
};
|
||||
tableRef.value?.getList(filter);
|
||||
};
|
||||
|
||||
// 监听 ecoFlowType 变化,重新获取饼图数据
|
||||
watch(ecoFlowType, () => {
|
||||
fetchPieData();
|
||||
});
|
||||
|
||||
const handleSearch = () => {
|
||||
// 更新日期范围到 params
|
||||
if (dateRange.value && dateRange.value.length === 2) {
|
||||
params.value.sTime = dateRange.value[0].format('YYYY-MM-DD 00:00:00');
|
||||
params.value.eTime = dateRange.value[1].format('YYYY-MM-DD 23:59:59');
|
||||
}
|
||||
|
||||
// 重新获取 Tab 列表
|
||||
fetchTabList();
|
||||
};
|
||||
onMounted(() => {
|
||||
// 初始化时设置默认日期并获取数据
|
||||
if (dateRange.value && dateRange.value.length === 2) {
|
||||
params.value.sTime = dateRange.value[0].format('YYYY-MM-DD 00:00:00');
|
||||
params.value.eTime = dateRange.value[1].format('YYYY-MM-DD 23:59:59');
|
||||
fetchTabList();
|
||||
}
|
||||
|
||||
// 监听窗口大小变化
|
||||
window.addEventListener('resize', handleResize);
|
||||
});
|
||||
|
||||
onUnmounted(() => {
|
||||
// 清理图表实例
|
||||
if (chartInstance) {
|
||||
chartInstance.dispose();
|
||||
chartInstance = null;
|
||||
}
|
||||
window.removeEventListener('resize', handleResize);
|
||||
});
|
||||
|
||||
// 处理窗口大小变化
|
||||
const handleResize = () => {
|
||||
chartInstance?.resize();
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.stlldbqk-container {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
background-color: #ffffff;
|
||||
box-sizing: border-box;
|
||||
// padding: 16px;
|
||||
}
|
||||
|
||||
.body_zhengti {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
flex: 1;
|
||||
.echarts {
|
||||
width: 35%;
|
||||
height: 482px;
|
||||
position: relative;
|
||||
|
||||
.pie-chart {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
:deep(.ant-spin-nested-loading) {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
:deep(.ant-spin-container) {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
.table {
|
||||
width: 65%;
|
||||
height: 482px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@ -1,190 +1,403 @@
|
||||
<!-- SidePanelItem.vue -->
|
||||
<template>
|
||||
<div>
|
||||
<SidePanelItem title="生态流量达标情况" :clickprompt="obj">
|
||||
<div class="body_topOne">
|
||||
<a-radio-group v-model:value="mode">
|
||||
<a-radio-button value="top">逐时</a-radio-button>
|
||||
<a-radio-button value="left">日</a-radio-button>
|
||||
</a-radio-group>
|
||||
<div class="title_text">≥95%座数/总座数</div>
|
||||
</div>
|
||||
<a-spin :spinning="spinning">
|
||||
<div>
|
||||
<div v-for="el in datalist">
|
||||
<div :key='el.key'>
|
||||
<div class="boy_one">
|
||||
<div style="flex: 1; white-space: nowrap;margin-right: 5px;">{{ el.name }}</div>
|
||||
<img style="flex: 1;" src="@/assets/components/fgx.svg" alt="">
|
||||
</div>
|
||||
<div class="body_zhu">
|
||||
<div class="body_biao">
|
||||
<div v-for="value in allArr">
|
||||
<div :key="value" class="nei_body">
|
||||
<div v-if="value < (el?.key == null ? 1 : el.qecTCnt == 0 ? 0 : el.qecCnt / el.qecTCnt) * 20"
|
||||
class="little_body" :style="{ backgroundColor: el.color }"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<SidePanelItem title="生态流量达标情况" :click-action="{ show: true }">
|
||||
<!-- 使用插槽自定义点击提示的内容 -->
|
||||
<template #click-action-content>
|
||||
<div v-if="titleData.cnt" style="max-width: 300px; line-height: 1.6">
|
||||
<p>
|
||||
1、统计电站范围:接入过生态流量数据的电站
|
||||
<span
|
||||
style="color: #5989ad; cursor: pointer; "
|
||||
@click.stop="handleStationClick()"
|
||||
>
|
||||
({{titleData.cnt}})
|
||||
</span>
|
||||
</p>
|
||||
<p>2、当来水不足时,生态流量不小于入库流量判定为达标</p>
|
||||
<p>3、“≥95%座数”表示统计电站范围内时段达标率大于等于95%的电站数量</p>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
</div>
|
||||
<div class="body_text">
|
||||
{{ el.qecCnt }}/{{ el.qecTCnt }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="body_topOne">
|
||||
<a-radio-group v-model:value="mode" @change="dataChage">
|
||||
<a-radio-button value="hour">逐时</a-radio-button>
|
||||
<a-radio-button value="day">日</a-radio-button>
|
||||
</a-radio-group>
|
||||
<div class="title_text">≥95%座数/总座数</div>
|
||||
</div>
|
||||
<a-spin :spinning="spinning">
|
||||
<div>
|
||||
<div v-for="el in datalist" @click="handleBarClick(el)">
|
||||
<div :key="el.key">
|
||||
<div class="boy_one">
|
||||
<div style="flex: 1; white-space: nowrap; margin-right: 5px">
|
||||
{{ el.name }}
|
||||
</div>
|
||||
</a-spin>
|
||||
<img style="flex: 1" src="@/assets/components/fgx.svg" alt="" />
|
||||
</div>
|
||||
<div class="body_zhu">
|
||||
<div class="body_biao">
|
||||
<div v-for="value in allArr">
|
||||
<div :key="value" class="nei_body">
|
||||
<div
|
||||
v-if="
|
||||
value <
|
||||
(el?.key == null
|
||||
? 1
|
||||
: el.qecTCnt == 0
|
||||
? 0
|
||||
: el.qecCnt / el.qecTCnt) *
|
||||
20
|
||||
"
|
||||
class="little_body"
|
||||
:style="{ backgroundColor: el.color }"
|
||||
></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="body_text">{{ el.qecCnt }}/{{ el.qecTCnt }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</a-spin>
|
||||
</SidePanelItem>
|
||||
|
||||
<!-- 自定义弹框 -->
|
||||
<a-modal
|
||||
v-model:open="modalVisible"
|
||||
:title="'生态流量达标情况'"
|
||||
width="1536px"
|
||||
:footer="null"
|
||||
>
|
||||
<STLLXFFS
|
||||
v-if="modalVisible"
|
||||
:options="list"
|
||||
:typeKey="selectedItem.key"
|
||||
:time="mode"
|
||||
:basicId="baseid"
|
||||
/>
|
||||
</a-modal>
|
||||
|
||||
</SidePanelItem>
|
||||
</div>
|
||||
<!-- 环保自动监测工作开展情况弹框 -->
|
||||
<a-modal
|
||||
v-model:open="huanbaoModalVisible"
|
||||
:title="'环保自动监测工作开展情况'"
|
||||
width="1536px"
|
||||
:footer="null"
|
||||
>
|
||||
<ModalYkzhbzdjcgz v-if="huanbaoModalVisible" :baseId="baseid" :titleData = titleData />
|
||||
</a-modal>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, onMounted } from 'vue';
|
||||
import { ref, onMounted, watch } from 'vue';
|
||||
import SidePanelItem from '@/components/SidePanelItem/index.vue';
|
||||
|
||||
|
||||
import {
|
||||
qgcetQgcStaticData,
|
||||
evnmAutoMonitorGetKendoListCust
|
||||
} from '@/api/stll';
|
||||
import { useJidiSelectEventStore } from '@/store/modules/jidiSelectEvent';
|
||||
import STLLXFFS from './TwoLayer/ShengTaiLiuLiangDaBQKTwoLayer.vue';
|
||||
import ModalYkzhbzdjcgz from './TwoLayer/ModalYkzhbzdjcgz.vue';
|
||||
import HuanbaoZDJCGZKZ from '@/modules/huanbaozdjcgzkzQK/index.vue';
|
||||
// 定义组件名(便于调试和递归)
|
||||
defineOptions({
|
||||
name: 'shengtaidabiaoMod'
|
||||
name: 'shengtaidabiaoMod'
|
||||
});
|
||||
const obj =
|
||||
{
|
||||
show: true,
|
||||
value: '1、统计电站范围:接入过生态流量数据的电站,2、当来水不足时,生态流量不小于入库流量判定为达标,3、“≥95%座数”表示统计电站范围内时段达标率大于等于95%的电站数量',
|
||||
}
|
||||
const mode = ref('top');
|
||||
const dataArr: any = ref([
|
||||
{
|
||||
name: '生态环境部门要求',
|
||||
qecCnt: '41', // 座数
|
||||
qecTCnt: '55', //总座数
|
||||
type: 1
|
||||
const JidiSelectEventStore = useJidiSelectEventStore();
|
||||
const baseid = ref('');
|
||||
const obj = {
|
||||
show: true,
|
||||
value:
|
||||
'1、统计电站范围:接入过生态流量数据的电站,2、当来水不足时,生态流量不小于入库流量判定为达标,3、“≥95%座数”表示统计电站范围内时段达标率大于等于95%的电站数量'
|
||||
};
|
||||
|
||||
const mode = ref('hour');
|
||||
const dataArr: any = ref([
|
||||
{
|
||||
name: '生态环境部门要求',
|
||||
qecCnt: '41', // 座数
|
||||
qecTCnt: '55', //总座数
|
||||
type: 1,
|
||||
key: 'qecInterval'
|
||||
},
|
||||
{
|
||||
name: '水利部门要求',
|
||||
qecCnt: '41', // 座数
|
||||
qecTCnt: '55', //总座数
|
||||
type: 2,
|
||||
key: 'mwrInterval'
|
||||
}
|
||||
]);
|
||||
const list: any = ref([
|
||||
{ name: '生态环境部门要求', type: 1, color: '#77C300', key: 'qecInterval' },
|
||||
{ name: '水利部门要求', type: 2, color: '#56C3E3', key: 'mwrInterval' },
|
||||
{ name: '多年平均流量 10%', type: 3, color: '#F76B01', key: 'avqInterval' },
|
||||
{ name: '无生态流量要求', type: 4, color: '#B4B4B4', key: null }
|
||||
]);
|
||||
const datalist: any = ref([]);
|
||||
const allArr: any = ref(Array.from({ length: 20 }, (_, i) => i));
|
||||
const spinning = ref(false);
|
||||
const modalVisible = ref(false);
|
||||
const modalTitle = ref('');
|
||||
const selectedItem = ref<any>(null);
|
||||
const huanbaoModalVisible = ref(false);
|
||||
|
||||
// 处理电站数量点击事件
|
||||
const handleStationClick = () => {
|
||||
huanbaoModalVisible.value = true;
|
||||
};
|
||||
|
||||
// 处理进度条点击事件
|
||||
const handleBarClick = (item: any) => {
|
||||
selectedItem.value = item;
|
||||
// modalTitle.value = `${item.name} - 详细信息`;
|
||||
modalVisible.value = true;
|
||||
};
|
||||
|
||||
},
|
||||
{
|
||||
name: '水利部门要求',
|
||||
qecCnt: '41', // 座数
|
||||
qecTCnt: '55', //总座数
|
||||
type: 2
|
||||
}
|
||||
])
|
||||
const list: any = ref(
|
||||
[
|
||||
{ name: '生态环境部门要求', type: 1, color: '#77C300', key: 'qecInterval' },
|
||||
{ name: '水利部门要求', type: 2, color: '#56C3E3', key: 'mwrInterval' },
|
||||
{ name: '多年平均流量 10%', type: 3, color: '#F76B01', key: 'avqInterval' },
|
||||
{ name: '无生态流量要求', type: 4, color: '#B4B4B4', key: null },
|
||||
]
|
||||
)
|
||||
const datalist: any = ref([])
|
||||
const allArr: any = ref(Array.from({ length: 20 }, (_, i) => i))
|
||||
const spinning = ref(false)
|
||||
// 根据 type 将 list 中的数据合并到 dataArr 中
|
||||
const setStyle = () => {
|
||||
if (dataArr.value.length == 0) {
|
||||
return false
|
||||
if (dataArr.value.length == 0) {
|
||||
return false;
|
||||
}
|
||||
dataArr.value.forEach((item: any) => {
|
||||
// 在 list 中找到 type 匹配的数据
|
||||
const matched = list.value.find(
|
||||
(listItem: any) => listItem.type === item.type
|
||||
);
|
||||
if (matched) {
|
||||
// 合并数据,dataArr 的属性优先
|
||||
datalist.value.push({
|
||||
...matched,
|
||||
...item
|
||||
});
|
||||
}
|
||||
dataArr.value.forEach((item: any) => {
|
||||
// 在 list 中找到 type 匹配的数据
|
||||
const matched = list.value.find((listItem: any) => listItem.type === item.type)
|
||||
if (matched) {
|
||||
// 合并数据,dataArr 的属性优先
|
||||
datalist.value.push({
|
||||
...matched,
|
||||
...item,
|
||||
})
|
||||
}
|
||||
})
|
||||
console.log(datalist.value)
|
||||
}
|
||||
});
|
||||
console.log(datalist.value);
|
||||
};
|
||||
const dataChage = () => {
|
||||
getData();
|
||||
};
|
||||
const getData = async () => {
|
||||
// 计算时间范围:当前时间前一个月的00:00:00 到 当前时间的23:59:59
|
||||
const now = new Date();
|
||||
const oneMonthAgo = new Date(now);
|
||||
oneMonthAgo.setMonth(oneMonthAgo.getMonth() - 1);
|
||||
|
||||
// 格式化日期为 YYYY-MM-DD
|
||||
const formatDate = (date: Date) => {
|
||||
const year = date.getFullYear();
|
||||
const month = String(date.getMonth() + 1).padStart(2, '0');
|
||||
const day = String(date.getDate()).padStart(2, '0');
|
||||
return `${year}-${month}-${day}`;
|
||||
};
|
||||
|
||||
const startDate = `${formatDate(oneMonthAgo)} 00:00:00`;
|
||||
const endDate = `${formatDate(now)} 23:59:59`;
|
||||
|
||||
let params = {
|
||||
filter: {
|
||||
logic: 'and',
|
||||
filters: [
|
||||
baseid.value != 'all'
|
||||
? {
|
||||
field: 'baseId',
|
||||
operator: 'eq',
|
||||
dataType: 'string',
|
||||
value: baseid.value
|
||||
}
|
||||
: null,
|
||||
{
|
||||
field: 'dtin',
|
||||
operator: 'eq',
|
||||
dataType: 'string',
|
||||
value: '1'
|
||||
},
|
||||
{
|
||||
field: 'type',
|
||||
operator: 'eq',
|
||||
dataType: 'string',
|
||||
value: mode.value
|
||||
},
|
||||
{
|
||||
field: 'tm',
|
||||
operator: 'gte',
|
||||
dataType: 'date',
|
||||
value: startDate
|
||||
},
|
||||
{
|
||||
field: 'tm',
|
||||
operator: 'lte',
|
||||
dataType: 'date',
|
||||
value: endDate
|
||||
}
|
||||
].filter(Boolean)
|
||||
}
|
||||
};
|
||||
|
||||
spinning.value = true;
|
||||
try {
|
||||
let res = await qgcetQgcStaticData(params);
|
||||
// 根据API响应结构规范处理数据
|
||||
if (res.data && res.data.list) {
|
||||
const apiList = res.data.list;
|
||||
// debugger
|
||||
// 只使用前两条数据(type: 1 和 type: 2)
|
||||
if (apiList && apiList.length > 0) {
|
||||
dataArr.value = apiList.slice(0, 2).map((item: any) => ({
|
||||
// name: item.typeName || item.desc,
|
||||
qecCnt: item.qecCnt,
|
||||
qecTCnt: item.qecTCnt,
|
||||
type: item.type
|
||||
}));
|
||||
|
||||
// 清空旧数据并重新合并样式
|
||||
datalist.value = [];
|
||||
setStyle();
|
||||
} else {
|
||||
// 无数据场景处理
|
||||
dataArr.value = [];
|
||||
datalist.value = [];
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('获取生态流量达标数据失败:', error);
|
||||
} finally {
|
||||
spinning.value = false;
|
||||
}
|
||||
};
|
||||
watch(
|
||||
() => JidiSelectEventStore.selectedItem,
|
||||
newVal => {
|
||||
if (newVal && newVal.wbsCode) {
|
||||
baseid.value = newVal.wbsCode;
|
||||
getData();
|
||||
}
|
||||
},
|
||||
{ deep: true, immediate: true }
|
||||
);
|
||||
//统计电站范围:接入过生态流量数据的电站
|
||||
const titleData:any = ref({ cnt: 0 })
|
||||
const getcont = async () => {
|
||||
let params = {
|
||||
"filter": {
|
||||
"logic": "and",
|
||||
"filters": [
|
||||
{
|
||||
"field": "showIds",
|
||||
"operator": "in",
|
||||
"value": [
|
||||
"7"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
let res = await evnmAutoMonitorGetKendoListCust(params);
|
||||
// [
|
||||
// {
|
||||
// "cnt": 452,
|
||||
// "orderInx": 7,
|
||||
// "orderInxName": "生态流量",
|
||||
// "sttpFullPath": "ENG",
|
||||
// "sttpCode": "ENG",
|
||||
// "sttpName": "生态流量"
|
||||
// }
|
||||
// ]
|
||||
let list = res?.data?.data[0];
|
||||
if (list) {
|
||||
titleData.value = list
|
||||
}
|
||||
// debugger
|
||||
};
|
||||
// 页面加载时执行的逻辑
|
||||
onMounted(() => {
|
||||
setStyle()
|
||||
setStyle();
|
||||
getcont()
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.body_topOne {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 16px;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 16px;
|
||||
|
||||
.title_text {
|
||||
font-size: 16px;
|
||||
}
|
||||
.title_text {
|
||||
font-size: 16px;
|
||||
}
|
||||
}
|
||||
|
||||
.boy_one {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin: 5px 0px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin: 5px 0px;
|
||||
}
|
||||
|
||||
.body_zhu {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
cursor: pointer;
|
||||
transition: all 0.3s ease;
|
||||
|
||||
.body_biao {
|
||||
width: 100%;
|
||||
height: 52px;
|
||||
border: 1px solid #ccdae7;
|
||||
border-radius: 2px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
cursor: pointer;
|
||||
padding: 5px 1px;
|
||||
overflow: hidden;
|
||||
|
||||
.body_biao {
|
||||
.nei_body {
|
||||
width: 12px;
|
||||
height: 100%;
|
||||
border: 1px solid #ccdae7;
|
||||
padding: 2px;
|
||||
margin-left: 4px;
|
||||
|
||||
.little_body {
|
||||
width: 100%;
|
||||
height: 52px;
|
||||
border: 1px solid #ccdae7;
|
||||
border-radius: 2px;
|
||||
display: flex;
|
||||
padding: 5px 1px;
|
||||
overflow: hidden;
|
||||
|
||||
.nei_body {
|
||||
width: 12px;
|
||||
height: 100%;
|
||||
border: 1px solid #ccdae7;
|
||||
padding: 2px;
|
||||
margin-left: 4px;
|
||||
|
||||
.little_body {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.body_text {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
width: 90px;
|
||||
height: 100%;
|
||||
justify-content: space-around;
|
||||
margin-left: 6px;
|
||||
align-items: center;
|
||||
font-size: 18px;
|
||||
font-weight: 500;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.body_text {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
width: 90px;
|
||||
height: 100%;
|
||||
justify-content: space-around;
|
||||
margin-left: 6px;
|
||||
align-items: center;
|
||||
font-size: 18px;
|
||||
font-weight: 500;
|
||||
}
|
||||
}
|
||||
|
||||
.ant-radio-group {
|
||||
// border: 3px solid #2f6b98 !important;
|
||||
// border-radius: 10px !important;
|
||||
// border: 3px solid #2f6b98 !important;
|
||||
// border-radius: 10px !important;
|
||||
|
||||
.ant-radio-button-wrapper-checked {
|
||||
border: 1px solid #2f6b98 !important;
|
||||
background-color: #2f6b98 !important;
|
||||
color: #fff !important;
|
||||
}
|
||||
.ant-radio-button-wrapper-checked {
|
||||
border: 1px solid #2f6b98 !important;
|
||||
background-color: #2f6b98 !important;
|
||||
color: #fff !important;
|
||||
}
|
||||
|
||||
.ant-radio-button-wrapper {
|
||||
border: 2px solid #2f6b98 !important;
|
||||
}
|
||||
.ant-radio-button-wrapper {
|
||||
border: 2px solid #2f6b98 !important;
|
||||
}
|
||||
|
||||
.ant-radio-button-wrapper-checked :before {
|
||||
background-color: #2f6b98 !important;
|
||||
}
|
||||
.ant-radio-button-wrapper-checked :before {
|
||||
background-color: #2f6b98 !important;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@ -1,286 +1,526 @@
|
||||
<template>
|
||||
<div>
|
||||
<SidePanelItem title="生态流量达标情况" :clickprompt="obj">
|
||||
<div class="body_topOne">
|
||||
<a-radio-group v-model:value="mode">
|
||||
<a-radio-button value="top">按基地</a-radio-button>
|
||||
<a-radio-button value="left">按调节性能</a-radio-button>
|
||||
</a-radio-group>
|
||||
</div>
|
||||
<a-spin :spinning="spinning">
|
||||
<div ref="chartRef" class="chart-container"></div>
|
||||
</a-spin>
|
||||
</SidePanelItem>
|
||||
</div>
|
||||
<div>
|
||||
<SidePanelItem title="生态流量达标情况" :click-action="{ show: true }">
|
||||
<!-- 使用插槽自定义点击提示的内容 -->
|
||||
<!-- 1、时间:2026-05-11 至 2026-06-11;
|
||||
|
||||
-->
|
||||
<template #click-action-content>
|
||||
<div v-if="titleData.cnt" style="max-width: 300px; line-height: 1.6">
|
||||
<p>1、时间:{{ getdate().startDate1 }} 至 {{ getdate().endDate1 }};</p>
|
||||
<p>
|
||||
2、范围:接入过生态流量数据的电站<span
|
||||
style="color: #5989ad; cursor: pointer"
|
||||
@click.stop="handleStationClick()"
|
||||
>
|
||||
({{ titleData.cnt }}) </span
|
||||
>;
|
||||
</p>
|
||||
<p>3、达标判定:按环评批复或报告中对生态流量限值有明确要求的评判。</p>
|
||||
</div>
|
||||
</template>
|
||||
<div class="body_topOne">
|
||||
<a-radio-group v-model:value="mode" @change="getEcharts()">
|
||||
<a-radio-button value="top">按基地</a-radio-button>
|
||||
<a-radio-button value="left">按调节性能</a-radio-button>
|
||||
</a-radio-group>
|
||||
</div>
|
||||
<a-spin :spinning="spinning">
|
||||
<div ref="chartRef" class="chart-container"></div>
|
||||
</a-spin>
|
||||
</SidePanelItem>
|
||||
</div>
|
||||
<!-- 环保自动监测工作开展情况弹框 -->
|
||||
<a-modal
|
||||
v-model:open="huanbaoModalVisible"
|
||||
:title="'环保自动监测工作开展情况'"
|
||||
width="1536px"
|
||||
:footer="null"
|
||||
>
|
||||
<ModalYkzhbzdjcgz v-if="huanbaoModalVisible" :titleData="titleData" />
|
||||
</a-modal>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, onMounted, watch } from 'vue';
|
||||
import SidePanelItem from '@/components/SidePanelItem/index.vue';
|
||||
import * as echarts from 'echarts';
|
||||
|
||||
import { eqqecRateCount, evnmAutoMonitorGetKendoListCust } from '@/api/stll';
|
||||
import ModalYkzhbzdjcgz from '../shengtaidabiaoMod/TwoLayer/ModalYkzhbzdjcgz.vue';
|
||||
// 定义组件名(便于调试和递归)
|
||||
defineOptions({
|
||||
name: 'shengtaidabiaoMod'
|
||||
name: 'shengtaidabiaoMod'
|
||||
});
|
||||
const obj =
|
||||
{
|
||||
show: true,
|
||||
value: '1、统计电站范围:接入过生态流量数据的电站,2、当来水不足时,生态流量不小于入库流量判定为达标,3、"≥95% 座数"表示统计电站范围内时段达标率大于等于 95% 的电站数量',
|
||||
}
|
||||
const obj = {
|
||||
show: true,
|
||||
value:
|
||||
'1、统计电站范围:接入过生态流量数据的电站,2、当来水不足时,生态流量不小于入库流量判定为达标,3、"≥95% 座数"表示统计电站范围内时段达标率大于等于 95% 的电站数量'
|
||||
};
|
||||
const mode = ref('top');
|
||||
const spinning = ref(false)
|
||||
const spinning = ref(false);
|
||||
const chartRef = ref<HTMLElement | null>(null);
|
||||
let chartInstance: echarts.ECharts | null = null;
|
||||
|
||||
// 动态数据存储
|
||||
const chartData = ref<{
|
||||
categories: string[];
|
||||
currentData: number[];
|
||||
lastYearData: number[];
|
||||
}>({
|
||||
categories: [],
|
||||
currentData: [],
|
||||
lastYearData: []
|
||||
});
|
||||
const huanbaoModalVisible = ref(false);
|
||||
// 处理电站数量点击事件
|
||||
const handleStationClick = () => {
|
||||
huanbaoModalVisible.value = true;
|
||||
};
|
||||
|
||||
// 按基地的静态数据(横向柱形图)
|
||||
const baseData = {
|
||||
categories: ['金沙江干流', '雅砻江干流', '大渡河干流', '乌江干流', '长江上游干流', '湘西', '黄河上游干流', '黄河中游干流', '南盘江 - 红水河', '东北', '澜沧江干流', '闽浙赣', '其他'],
|
||||
currentData: [98, 100, 99.5, 99.8, 100, 98.5, 100, 100, 100, 97, 100, 93, 98],
|
||||
lastYearData: [92, 100, 99, 100, 100, 98, 100, 100, 100, 100, 100, 88, 93]
|
||||
categories: [
|
||||
'金沙江干流',
|
||||
'雅砻江干流',
|
||||
'大渡河干流',
|
||||
'乌江干流',
|
||||
'长江上游干流',
|
||||
'湘西',
|
||||
'黄河上游干流',
|
||||
'黄河中游干流',
|
||||
'南盘江 - 红水河',
|
||||
'东北',
|
||||
'澜沧江干流',
|
||||
'闽浙赣',
|
||||
'其他'
|
||||
],
|
||||
currentData: [98, 100, 99.5, 99.8, 100, 98.5, 100, 100, 100, 97, 100, 93, 98],
|
||||
lastYearData: [92, 100, 99, 100, 100, 98, 100, 100, 100, 100, 100, 88, 93]
|
||||
};
|
||||
|
||||
// 按调节性能的静态数据(竖向柱状图)
|
||||
const performanceData = {
|
||||
categories: ['多年调节', '年调节', '季调节', '周调节', '其他'],
|
||||
currentData: [95, 92, 88, 85, 90],
|
||||
lastYearData: [93, 90, 85, 82, 88]
|
||||
categories: ['多年调节', '年调节', '季调节', '周调节', '其他'],
|
||||
currentData: [95, 92, 88, 85, 90],
|
||||
lastYearData: [93, 90, 85, 82, 88]
|
||||
};
|
||||
|
||||
// 加载数据
|
||||
const loadData = () => {
|
||||
spinning.value = true;
|
||||
const loadData = async () => {
|
||||
spinning.value = true;
|
||||
|
||||
// 模拟数据加载延迟,并确保 DOM 已渲染
|
||||
try {
|
||||
// 先获取数据
|
||||
await getEcharts();
|
||||
|
||||
// 确保 DOM 已渲染后初始化图表
|
||||
setTimeout(() => {
|
||||
initChart();
|
||||
spinning.value = false;
|
||||
initChart();
|
||||
spinning.value = false;
|
||||
}, 50);
|
||||
} catch (error) {
|
||||
console.error('数据加载失败:', error);
|
||||
spinning.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
// 初始化图表
|
||||
const initChart = () => {
|
||||
if (!chartRef.value) {
|
||||
console.error('图表容器未渲染');
|
||||
return;
|
||||
}
|
||||
if (!chartRef.value) {
|
||||
console.error('图表容器未渲染');
|
||||
return;
|
||||
}
|
||||
|
||||
// 检查容器尺寸
|
||||
const containerHeight = chartRef.value.offsetHeight;
|
||||
if (!containerHeight || containerHeight === 0) {
|
||||
console.warn('容器高度为 0,延迟重试');
|
||||
setTimeout(() => initChart(), 50);
|
||||
return;
|
||||
}
|
||||
// 检查容器尺寸
|
||||
const containerHeight = chartRef.value.offsetHeight;
|
||||
if (!containerHeight || containerHeight === 0) {
|
||||
console.warn('容器高度为 0,延迟重试');
|
||||
setTimeout(() => initChart(), 50);
|
||||
return;
|
||||
}
|
||||
|
||||
// 如果实例存在,先销毁
|
||||
if (chartInstance) {
|
||||
chartInstance.dispose();
|
||||
}
|
||||
// 如果实例存在,先销毁
|
||||
if (chartInstance) {
|
||||
chartInstance.dispose();
|
||||
}
|
||||
|
||||
chartInstance = echarts.init(chartRef.value);
|
||||
chartInstance = echarts.init(chartRef.value);
|
||||
|
||||
// 根据 mode 选择数据
|
||||
const data = mode.value === 'top' ? baseData : performanceData;
|
||||
const isHorizontal = mode.value === 'top';
|
||||
// 使用动态数据
|
||||
const data = chartData.value;
|
||||
const isHorizontal = mode.value === 'top';
|
||||
|
||||
const option = {
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
axisPointer: {
|
||||
type: 'shadow'
|
||||
},
|
||||
formatter: function(params: any) {
|
||||
let result = params[0].name + '<br/>';
|
||||
params.forEach((param: any) => {
|
||||
const percentage = param.value.toFixed(2) + '%';
|
||||
result += param.marker + param.seriesName + ' <b>' + percentage + '</b><br/>';
|
||||
});
|
||||
return result;
|
||||
const option = {
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
axisPointer: {
|
||||
type: 'shadow'
|
||||
},
|
||||
formatter: function (params: any) {
|
||||
let result = params[0].name + '<br/>';
|
||||
params.forEach((param: any) => {
|
||||
const percentage = param.value.toFixed(2) + '%';
|
||||
result +=
|
||||
param.marker +
|
||||
param.seriesName +
|
||||
' <b>' +
|
||||
percentage +
|
||||
'</b><br/>';
|
||||
});
|
||||
return result;
|
||||
}
|
||||
},
|
||||
legend: {
|
||||
data: ['当前', '去年同期']
|
||||
},
|
||||
grid: { left: 10, right: 10, bottom: 20, top: 40, containLabel: true },
|
||||
dataZoom: [
|
||||
{
|
||||
type: 'inside',
|
||||
// 横向柱形图(mode='top'): X轴是数值轴,需要缩放
|
||||
// 竖向柱状图(mode='left'): X轴是分类轴,不需要缩放;Y轴是数值轴,也不需要内部缩放
|
||||
[isHorizontal ? 'xAxisIndex' : 'xAxisIndex']: 0,
|
||||
filterMode: 'empty',
|
||||
zoomOnMouseWheel: true,
|
||||
moveOnMouseMove: false,
|
||||
moveOnMouseWheel: true,
|
||||
start: 0,
|
||||
end: 100,
|
||||
minValueSpan: 0,
|
||||
maxValueSpan: isHorizontal ? 20 : 5
|
||||
}
|
||||
],
|
||||
xAxis: isHorizontal
|
||||
? {
|
||||
type: 'value',
|
||||
min: 80,
|
||||
max: 100,
|
||||
splitLine: {
|
||||
show: true,
|
||||
lineStyle: {
|
||||
color: '#E8E8E8',
|
||||
type: 'solid'
|
||||
}
|
||||
},
|
||||
axisLabel: {
|
||||
color: '#666',
|
||||
formatter: '{value}'
|
||||
}
|
||||
}
|
||||
: {
|
||||
type: 'category',
|
||||
data: data.categories,
|
||||
axisLabel: {
|
||||
color: '#666',
|
||||
fontSize: 12,
|
||||
interval: 0,
|
||||
rotate: 0,
|
||||
margin: 10
|
||||
},
|
||||
axisLine: {
|
||||
show: true,
|
||||
lineStyle: {
|
||||
color: '#666'
|
||||
}
|
||||
},
|
||||
axisTick: {
|
||||
show: true,
|
||||
lineStyle: {
|
||||
color: '#666'
|
||||
}
|
||||
},
|
||||
splitLine: {
|
||||
show: false
|
||||
}
|
||||
},
|
||||
legend: {
|
||||
data: ['当前', '去年同期'],
|
||||
|
||||
yAxis: isHorizontal
|
||||
? {
|
||||
type: 'category',
|
||||
data: data.categories,
|
||||
inverse: true,
|
||||
axisLabel: {
|
||||
color: '#666',
|
||||
fontSize: 12,
|
||||
interval: 0,
|
||||
rotate: 45,
|
||||
margin: 10
|
||||
},
|
||||
axisLine: {
|
||||
show: true,
|
||||
lineStyle: {
|
||||
color: '#666'
|
||||
}
|
||||
},
|
||||
axisTick: {
|
||||
show: true,
|
||||
lineStyle: {
|
||||
color: '#666'
|
||||
}
|
||||
},
|
||||
splitLine: {
|
||||
show: false
|
||||
}
|
||||
}
|
||||
: {
|
||||
type: 'value',
|
||||
min: 0,
|
||||
max: 100,
|
||||
splitLine: {
|
||||
show: true,
|
||||
lineStyle: {
|
||||
color: '#E8E8E8',
|
||||
type: 'solid'
|
||||
}
|
||||
},
|
||||
axisLabel: {
|
||||
color: '#666',
|
||||
formatter: '{value}'
|
||||
}
|
||||
},
|
||||
grid: { left: 10, right: 10, bottom: 20, top: 40, containLabel: true },
|
||||
dataZoom: [
|
||||
{
|
||||
type: 'inside',
|
||||
[isHorizontal ? 'yAxisIndex' : 'xAxisIndex']: 0,
|
||||
filterMode: 'empty',
|
||||
zoomOnMouseWheel: true,
|
||||
moveOnMouseMove: false,
|
||||
moveOnMouseWheel: true,
|
||||
start: 0,
|
||||
end: 100,
|
||||
minValueSpan: 0,
|
||||
maxValueSpan: isHorizontal ? 20 : 5
|
||||
}
|
||||
],
|
||||
xAxis: isHorizontal ? {
|
||||
type: 'value',
|
||||
min: 80,
|
||||
max: 100,
|
||||
splitLine: {
|
||||
show: true,
|
||||
lineStyle: {
|
||||
color: '#E8E8E8',
|
||||
type: 'solid'
|
||||
}
|
||||
},
|
||||
axisLabel: {
|
||||
color: '#666',
|
||||
formatter: '{value}'
|
||||
}
|
||||
} : {
|
||||
type: 'category',
|
||||
data: data.categories,
|
||||
axisLabel: {
|
||||
color: '#666',
|
||||
fontSize: 12,
|
||||
interval: 0,
|
||||
rotate: 0,
|
||||
margin: 10
|
||||
},
|
||||
axisLine: {
|
||||
show: true,
|
||||
lineStyle: {
|
||||
color: '#666'
|
||||
}
|
||||
},
|
||||
axisTick: {
|
||||
show: true,
|
||||
lineStyle: {
|
||||
color: '#666'
|
||||
}
|
||||
},
|
||||
splitLine: {
|
||||
show: false
|
||||
}
|
||||
series: [
|
||||
{
|
||||
name: '当前',
|
||||
type: 'bar',
|
||||
data: data.currentData,
|
||||
itemStyle: {
|
||||
color: '#5470C6'
|
||||
},
|
||||
yAxis: isHorizontal ? {
|
||||
type: 'category',
|
||||
data: data.categories,
|
||||
inverse: true,
|
||||
axisLabel: {
|
||||
color: '#666',
|
||||
fontSize: 12,
|
||||
interval: 0,
|
||||
rotate: 45,
|
||||
margin: 10
|
||||
},
|
||||
axisLine: {
|
||||
show: true,
|
||||
lineStyle: {
|
||||
color: '#666'
|
||||
}
|
||||
},
|
||||
axisTick: {
|
||||
show: true,
|
||||
lineStyle: {
|
||||
color: '#666'
|
||||
}
|
||||
},
|
||||
splitLine: {
|
||||
show: false
|
||||
}
|
||||
} : {
|
||||
type: 'value',
|
||||
min: 0,
|
||||
max: 100,
|
||||
splitLine: {
|
||||
show: true,
|
||||
lineStyle: {
|
||||
color: '#E8E8E8',
|
||||
type: 'solid'
|
||||
}
|
||||
},
|
||||
axisLabel: {
|
||||
color: '#666',
|
||||
formatter: '{value}'
|
||||
}
|
||||
barWidth: isHorizontal ? 8 : 8
|
||||
// barGap: '30%'
|
||||
},
|
||||
{
|
||||
name: '去年同期',
|
||||
type: 'bar',
|
||||
data: data.lastYearData,
|
||||
itemStyle: {
|
||||
color: '#91CC75'
|
||||
},
|
||||
series: [
|
||||
{
|
||||
name: '当前',
|
||||
type: 'bar',
|
||||
data: data.currentData,
|
||||
itemStyle: {
|
||||
color: '#5470C6'
|
||||
},
|
||||
barWidth: isHorizontal ? 8 : 8,
|
||||
// barGap: '30%'
|
||||
},
|
||||
{
|
||||
name: '去年同期',
|
||||
type: 'bar',
|
||||
data: data.lastYearData,
|
||||
itemStyle: {
|
||||
color: '#91CC75'
|
||||
},
|
||||
barWidth: isHorizontal ? 8: 8,
|
||||
// barGap: '30%'
|
||||
}
|
||||
]
|
||||
};
|
||||
barWidth: isHorizontal ? 8 : 8
|
||||
// barGap: '30%'
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
chartInstance.setOption(option);
|
||||
chartInstance.setOption(option);
|
||||
|
||||
// 强制重绘,确保尺寸正确
|
||||
setTimeout(() => {
|
||||
chartInstance?.resize();
|
||||
}, 0);
|
||||
// 强制重绘,确保尺寸正确
|
||||
setTimeout(() => {
|
||||
chartInstance?.resize();
|
||||
}, 0);
|
||||
};
|
||||
const getdate = () => {
|
||||
const now = new Date();
|
||||
const oneMonthAgo = new Date(now);
|
||||
oneMonthAgo.setMonth(oneMonthAgo.getMonth() - 1);
|
||||
|
||||
// 格式化日期为 YYYY-MM-DD
|
||||
const formatDate = (date: Date) => {
|
||||
const year = date.getFullYear();
|
||||
const month = String(date.getMonth() + 1).padStart(2, '0');
|
||||
const day = String(date.getDate()).padStart(2, '0');
|
||||
return `${year}-${month}-${day}`;
|
||||
};
|
||||
|
||||
const startDate = `${formatDate(oneMonthAgo)} 00:00:00`;
|
||||
const endDate = `${formatDate(now)} 23:59:59`;
|
||||
const startDate1 = `${formatDate(oneMonthAgo)}`;
|
||||
const endDate1 = `${formatDate(now)}`;
|
||||
return { startDate, endDate, startDate1, endDate1 };
|
||||
};
|
||||
const getEcharts = async () => {
|
||||
let params = {
|
||||
filter: {
|
||||
logic: 'and',
|
||||
filters: [
|
||||
mode.value == 'top'
|
||||
? {
|
||||
field: 'dtinEnv',
|
||||
operator: 'in',
|
||||
dataType: 'string',
|
||||
value: [1, 2]
|
||||
}
|
||||
: {
|
||||
field: 'type',
|
||||
operator: 'eq',
|
||||
dataType: 'string',
|
||||
value: 'DAY'
|
||||
},
|
||||
{
|
||||
field: 'tm',
|
||||
operator: 'gte',
|
||||
dataType: 'date',
|
||||
value: getdate().startDate
|
||||
},
|
||||
{
|
||||
field: 'tm',
|
||||
operator: 'lte',
|
||||
dataType: 'date',
|
||||
value: getdate().endDate
|
||||
}
|
||||
]
|
||||
},
|
||||
group:
|
||||
mode.value == 'top'
|
||||
? [
|
||||
{
|
||||
dir: 'asc',
|
||||
field: 'basestepsort'
|
||||
},
|
||||
{
|
||||
dir: 'asc',
|
||||
field: 'baseId'
|
||||
},
|
||||
{
|
||||
dir: 'asc',
|
||||
field: 'baseName'
|
||||
}
|
||||
]
|
||||
: [
|
||||
{
|
||||
dir: 'asc',
|
||||
field: 'qecPerformance'
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
try {
|
||||
const res: any = await eqqecRateCount(params);
|
||||
|
||||
// 处理返回数据
|
||||
if (res && res.success && res.data && res.data.data) {
|
||||
const apiData = res.data.data;
|
||||
|
||||
// 根据 mode 提取不同的数据
|
||||
if (mode.value === 'top') {
|
||||
// 按基地模式:去重处理(避免 baseId 重复)
|
||||
const uniqueMap = new Map();
|
||||
apiData.forEach((item: any) => {
|
||||
if (!uniqueMap.has(item.baseId)) {
|
||||
uniqueMap.set(item.baseId, item);
|
||||
}
|
||||
});
|
||||
|
||||
const uniqueData = Array.from(uniqueMap.values());
|
||||
|
||||
chartData.value = {
|
||||
categories: uniqueData.map((item: any) => item.baseName || ''),
|
||||
currentData: uniqueData.map((item: any) =>
|
||||
item.qecRate != null ? Number(item.qecRate) : 0
|
||||
),
|
||||
lastYearData: uniqueData.map((item: any) =>
|
||||
item.beforeQecRate != null ? Number(item.beforeQecRate) : 0
|
||||
)
|
||||
};
|
||||
} else {
|
||||
// 按调节性能模式
|
||||
chartData.value = {
|
||||
categories: apiData.map((item: any) => item.qecPerformanceName || ''),
|
||||
currentData: apiData.map((item: any) =>
|
||||
item.qecRate != null ? Number(item.qecRate) : 0
|
||||
),
|
||||
lastYearData: apiData.map((item: any) =>
|
||||
item.beforeQecRate != null ? Number(item.beforeQecRate) : 0
|
||||
)
|
||||
};
|
||||
}
|
||||
} else {
|
||||
console.warn('API 返回数据格式异常');
|
||||
// 使用空数据
|
||||
chartData.value = {
|
||||
categories: [],
|
||||
currentData: [],
|
||||
lastYearData: []
|
||||
};
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('API 调用失败:', error);
|
||||
// 发生错误时使用空数据
|
||||
chartData.value = {
|
||||
categories: [],
|
||||
currentData: [],
|
||||
lastYearData: []
|
||||
};
|
||||
}
|
||||
};
|
||||
//统计电站范围:接入过生态流量数据的电站
|
||||
const titleData: any = ref({ cnt: 0 });
|
||||
const getcont = async () => {
|
||||
let params = {
|
||||
filter: {
|
||||
logic: 'and',
|
||||
filters: [
|
||||
{
|
||||
field: 'showIds',
|
||||
operator: 'in',
|
||||
value: ['7']
|
||||
}
|
||||
]
|
||||
}
|
||||
};
|
||||
let res = await evnmAutoMonitorGetKendoListCust(params);
|
||||
// [
|
||||
// {
|
||||
// "cnt": 452,
|
||||
// "orderInx": 7,
|
||||
// "orderInxName": "生态流量",
|
||||
// "sttpFullPath": "ENG",
|
||||
// "sttpCode": "ENG",
|
||||
// "sttpName": "生态流量"
|
||||
// }
|
||||
// ]
|
||||
let list = res?.data?.data[0];
|
||||
if (list) {
|
||||
titleData.value = list;
|
||||
}
|
||||
// debugger
|
||||
};
|
||||
// 页面加载时执行的逻辑
|
||||
onMounted(() => {
|
||||
loadData();
|
||||
|
||||
// 监听窗口大小变化
|
||||
window.addEventListener('resize', () => {
|
||||
chartInstance?.resize();
|
||||
});
|
||||
loadData();
|
||||
getcont();
|
||||
// 监听窗口大小变化
|
||||
window.addEventListener('resize', () => {
|
||||
chartInstance?.resize();
|
||||
});
|
||||
});
|
||||
|
||||
// 监听 mode 变化
|
||||
watch(mode, () => {
|
||||
loadData();
|
||||
loadData();
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.body_topOne {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 16px;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 16px;
|
||||
|
||||
.title_text {
|
||||
font-size: 16px;
|
||||
}
|
||||
.title_text {
|
||||
font-size: 16px;
|
||||
}
|
||||
}
|
||||
.ant-radio-group {
|
||||
.ant-radio-button-wrapper-checked {
|
||||
border: 1px solid #2f6b98 !important;
|
||||
background-color: #2f6b98 !important;
|
||||
color: #fff !important;
|
||||
}
|
||||
.ant-radio-button-wrapper-checked {
|
||||
border: 1px solid #2f6b98 !important;
|
||||
background-color: #2f6b98 !important;
|
||||
color: #fff !important;
|
||||
}
|
||||
|
||||
.ant-radio-button-wrapper {
|
||||
border: 2px solid #2f6b98 !important;
|
||||
.ant-radio-button-wrapper {
|
||||
border: 2px solid #2f6b98 !important;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.ant-radio-button-wrapper-checked :before {
|
||||
background-color: #2f6b98 !important;
|
||||
}
|
||||
.ant-radio-button-wrapper-checked :before {
|
||||
background-color: #2f6b98 !important;
|
||||
}
|
||||
}
|
||||
|
||||
.chart-container {
|
||||
width: 100%;
|
||||
height: 449px;
|
||||
// padding: 10px;
|
||||
width: 100%;
|
||||
height: 449px;
|
||||
// padding: 10px;
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -298,7 +298,7 @@ const handleExport = async () => {};
|
||||
const handleViewDetail = (record: any) => {
|
||||
modelStore.modalVisible = true;
|
||||
modelStore.params.sttp = 'WT';
|
||||
modelStore.title = record.stnm + '详情信息';
|
||||
modelStore.title = record.stnm ;
|
||||
modelStore.params.stcd = record.stcd;
|
||||
};
|
||||
|
||||
|
||||
@ -910,7 +910,7 @@ function handleRowClick(record: any) {
|
||||
stcd: record.stcd,
|
||||
titleName: record.stnm
|
||||
} as any // 临时类型断言,因为 store 定义不完整
|
||||
modelStore.title = record.stnm ? `${record.stnm} 详情信息` : '详情信息'
|
||||
modelStore.title = record.stnm ? `${record.stnm} ` : ''
|
||||
modelStore.tabList = handleTabs(modelStore.params)
|
||||
modelStore.modalVisible = true
|
||||
|
||||
|
||||
@ -518,7 +518,7 @@ const handleViewDetail = (record: any) => {
|
||||
if (record) {
|
||||
modelStore.modalVisible = true;
|
||||
modelStore.params.sttp = "WT";
|
||||
modelStore.title = record.stnm + "详情信息";
|
||||
modelStore.title = record.stnm ;
|
||||
// modelStore.isBasicEdit = true;
|
||||
if (tabIndex.value == "27") {
|
||||
modelStore.params.enfc = "1";
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -724,7 +724,7 @@ const handleDataPointClick = (params: any) => {
|
||||
if (stationData && stationData.stcd) {
|
||||
modelStore.modalVisible = true;
|
||||
modelStore.params.sttp = "WQFB";
|
||||
modelStore.title = stationData.stnm + "详情信息";
|
||||
modelStore.title = stationData.stnm ;
|
||||
// modelStore.isBasicEdit = true;
|
||||
modelStore.params.stcd = stationData.stcd;
|
||||
}
|
||||
|
||||
@ -249,8 +249,7 @@ const initChart = () => {
|
||||
console.log('temperature:', params.data.value);
|
||||
modelStore.modalVisible = true;
|
||||
modelStore.params.sttp = "WT";
|
||||
modelStore.title = params.data.stnm + "详情信息";
|
||||
// modelStore.isBasicEdit = true;
|
||||
modelStore.title = params.data.stnm;
|
||||
modelStore.params.stcd = params.data.stcd;
|
||||
modelStore.params.date = paramsOne.tm;
|
||||
}
|
||||
|
||||
@ -10,6 +10,17 @@ export const useModelStore = defineStore('model', () => {
|
||||
const isBasicEdit = ref(false);
|
||||
const showStcdSelector = ref(false); // 是否显示下拉框
|
||||
const stcdOptions = ref<Array<{ label: string, value: string }>>([]); // 可选测站列表
|
||||
|
||||
// 新增:功能迁移所需的状态字段
|
||||
const baseId = ref<string>(''); // 当前基地 ID
|
||||
const hasPowerStatData = ref<boolean>(false); // 电站是否有专题数据
|
||||
const isPowerStatPage = ref<boolean>(false); // 是否在电站专题页面
|
||||
const verticalWaterStcd = ref<string>(''); // 垂向水温子站点编码
|
||||
const aiSites = ref<any[]>([]); // AI 识别站点列表
|
||||
const wtConfig = ref<{ ioWtrv?: boolean; hasRstcdWtvt?: boolean }>({}); // 水温配置
|
||||
const wqShow = ref<boolean>(false); // 水质 AI 预测显示
|
||||
const fishTabInfo = ref<any>(null); // 鱼类监测数据信息
|
||||
|
||||
const params = ref<{
|
||||
sttp: string;
|
||||
stcd: any;
|
||||
@ -17,13 +28,23 @@ export const useModelStore = defineStore('model', () => {
|
||||
show: any;
|
||||
enfc:any;
|
||||
eqtp:any;
|
||||
baseId?: string; // 新增:基地 ID
|
||||
sttpCode?: string; // 新增:站点类型代码
|
||||
sttpMap?: string; // 新增:站点类型映射
|
||||
dtinType?: string;
|
||||
bldstt: string;
|
||||
}>({
|
||||
sttp: 'eng',
|
||||
stcd: '',
|
||||
date: '',
|
||||
show: true,
|
||||
enfc:'0',
|
||||
eqtp:''
|
||||
eqtp:'',
|
||||
baseId: '',
|
||||
sttpCode: '',
|
||||
sttpMap: '',
|
||||
dtinType:'',
|
||||
bldstt:'',
|
||||
});
|
||||
const filterStll= ref('')
|
||||
return {
|
||||
@ -36,5 +57,14 @@ export const useModelStore = defineStore('model', () => {
|
||||
showStcdSelector, // 新增
|
||||
stcdOptions, // 新增
|
||||
filterStll,
|
||||
// 新增返回字段
|
||||
baseId,
|
||||
hasPowerStatData,
|
||||
isPowerStatPage,
|
||||
verticalWaterStcd,
|
||||
aiSites,
|
||||
wtConfig,
|
||||
wqShow,
|
||||
fishTabInfo,
|
||||
};
|
||||
});
|
||||
@ -28,110 +28,110 @@ onMounted(() => {
|
||||
const showMapModal = () => {
|
||||
modelStore.modalVisible = true;
|
||||
modelStore.params.sttp = "ENG";
|
||||
modelStore.title = "三峡 详情信息";
|
||||
modelStore.title = "三峡 ";
|
||||
modelStore.isBasicEdit = true;
|
||||
};
|
||||
const showMapModal1 = () => {
|
||||
modelStore.modalVisible = true;
|
||||
modelStore.params.sttp = "WT";
|
||||
modelStore.title = "水温 详情信息";
|
||||
modelStore.title = "水温 ";
|
||||
modelStore.isBasicEdit = true;
|
||||
};
|
||||
const showMapModal2 = () => {
|
||||
modelStore.modalVisible = true;
|
||||
modelStore.params.sttp = "WQFB";
|
||||
modelStore.title = "水质 详情信息";
|
||||
modelStore.title = "水质 ";
|
||||
modelStore.isBasicEdit = true;
|
||||
};
|
||||
const showMapModal3 = () => {
|
||||
modelStore.modalVisible = true;
|
||||
modelStore.params.sttp = "FH";
|
||||
modelStore.title = "栖息地 详情信息";
|
||||
modelStore.title = "栖息地 ";
|
||||
modelStore.isBasicEdit = true;
|
||||
};//
|
||||
const showMapModal4 = () => {
|
||||
modelStore.modalVisible = true;
|
||||
modelStore.params.sttp = "fh_zq_point";
|
||||
modelStore.title = "栖息地流量 详情信息";
|
||||
modelStore.title = "栖息地流量 ";
|
||||
modelStore.isBasicEdit = true;
|
||||
};
|
||||
const showMapModal5 = () => {
|
||||
modelStore.modalVisible = true;
|
||||
modelStore.params.sttp = "fp_point";
|
||||
modelStore.title = "过鱼设施 详情信息";
|
||||
modelStore.title = "过鱼设施 ";
|
||||
modelStore.isBasicEdit = true;
|
||||
};
|
||||
const showMapModal6 = () => {
|
||||
modelStore.modalVisible = true;
|
||||
modelStore.params.sttp = "FB";
|
||||
modelStore.title = "鱼类增殖站 详情信息";
|
||||
modelStore.title = "鱼类增殖站 ";
|
||||
modelStore.isBasicEdit = true;
|
||||
};
|
||||
//
|
||||
const showMapModal7 = () => {
|
||||
modelStore.modalVisible = true;
|
||||
modelStore.params.sttp = "VA";
|
||||
modelStore.title = "动物救助站 详情信息";
|
||||
modelStore.title = "动物救助站 ";
|
||||
modelStore.isBasicEdit = true;
|
||||
};
|
||||
const showMapModal8 = () => {
|
||||
modelStore.modalVisible = true;
|
||||
modelStore.params.sttp = "VP";
|
||||
modelStore.title = "珍稀植物园 详情信息";
|
||||
modelStore.title = "珍稀植物园 ";
|
||||
modelStore.isBasicEdit = true;
|
||||
};
|
||||
const showMapModal9 = () => {
|
||||
modelStore.modalVisible = true;
|
||||
modelStore.params.sttp = "WE";
|
||||
modelStore.title = "水生生态调查断面 详情信息";
|
||||
modelStore.title = "水生生态调查断面 ";
|
||||
modelStore.isBasicEdit = true;
|
||||
};
|
||||
const showMapModal10 = () => {
|
||||
modelStore.modalVisible = true;
|
||||
modelStore.params.sttp = "WVA";
|
||||
modelStore.title = "野生动物监测 详情信息";
|
||||
modelStore.title = "野生动物监测 ";
|
||||
modelStore.isBasicEdit = true;
|
||||
};
|
||||
const showMapModal11 = () => {
|
||||
modelStore.modalVisible = true;
|
||||
modelStore.params.sttp = "VD_FBFM";
|
||||
modelStore.title = "AI视频监控站 详情信息";
|
||||
modelStore.title = "AI视频监控站 ";
|
||||
modelStore.isBasicEdit = true;
|
||||
};
|
||||
const showMapModal12 = () => {
|
||||
modelStore.modalVisible = true;
|
||||
modelStore.params.sttp = "eng_alarm_point";
|
||||
modelStore.title = "水电站告警情况 详情信息";
|
||||
modelStore.title = "水电站告警情况 ";
|
||||
modelStore.isBasicEdit = true;
|
||||
};
|
||||
const showMapModal13 = () => {
|
||||
modelStore.modalVisible = true;
|
||||
modelStore.params.sttp = "FPRD";
|
||||
modelStore.title = "鱼类调查装置 详情信息";
|
||||
modelStore.title = "鱼类调查装置 ";
|
||||
modelStore.isBasicEdit = true;
|
||||
};
|
||||
const showMapModal14 = () => {
|
||||
modelStore.modalVisible = true;
|
||||
modelStore.params.sttp = "DW_2";
|
||||
modelStore.title = "低温水减缓设施-叠梁门 详情信息";
|
||||
modelStore.title = "低温水减缓设施-叠梁门 ";
|
||||
modelStore.isBasicEdit = true;
|
||||
};
|
||||
const showMapModal15 = () => {
|
||||
modelStore.modalVisible = true;
|
||||
modelStore.params.sttp = "DW_5";
|
||||
modelStore.title = "前置挡墙 详情信息";
|
||||
modelStore.title = "前置挡墙 ";
|
||||
modelStore.isBasicEdit = true;
|
||||
};
|
||||
const showMapModal16 = () => {
|
||||
modelStore.modalVisible = true;
|
||||
modelStore.params.sttp = "DW_6";
|
||||
modelStore.title = "隔水幕墙 详情信息";
|
||||
modelStore.title = "隔水幕墙 ";
|
||||
modelStore.isBasicEdit = true;
|
||||
};
|
||||
const showMapModal17 = () => {
|
||||
modelStore.modalVisible = true;
|
||||
modelStore.params.sttp = "DW_1";
|
||||
modelStore.title = "夹岩双层取水 详情信息";
|
||||
modelStore.title = "夹岩双层取水 ";
|
||||
modelStore.isBasicEdit = true;
|
||||
};
|
||||
//DW_5
|
||||
|
||||
Loading…
Reference in New Issue
Block a user