Merge branch 'main' into dev-lilin
# Conflicts: # backend/src/main/resources/application-prod.yml
This commit is contained in:
commit
568f76dafa
@ -61,8 +61,8 @@ public class RedisConfig {
|
|||||||
RedisCacheConfiguration defaultConfig = RedisCacheConfiguration.defaultCacheConfig()
|
RedisCacheConfiguration defaultConfig = RedisCacheConfiguration.defaultCacheConfig()
|
||||||
.prefixCacheNameWith("qgc:")
|
.prefixCacheNameWith("qgc:")
|
||||||
.serializeKeysWith(RedisSerializationContext.SerializationPair.fromSerializer(new StringRedisSerializer()))
|
.serializeKeysWith(RedisSerializationContext.SerializationPair.fromSerializer(new StringRedisSerializer()))
|
||||||
.serializeValuesWith(RedisSerializationContext.SerializationPair.fromSerializer(genericJackson2JsonRedisSerializer()))
|
.serializeValuesWith(RedisSerializationContext.SerializationPair.fromSerializer(genericJackson2JsonRedisSerializer()));
|
||||||
.entryTtl(Duration.ofMinutes(30));
|
// .entryTtl(Duration.ofMinutes(30));
|
||||||
|
|
||||||
// Map<String, RedisCacheConfiguration> cacheConfigs = new HashMap<>();
|
// Map<String, RedisCacheConfiguration> cacheConfigs = new HashMap<>();
|
||||||
// cacheConfigs.put("dictCache", defaultConfig.entryTtl(Duration.ofHours(6)));
|
// cacheConfigs.put("dictCache", defaultConfig.entryTtl(Duration.ofHours(6)));
|
||||||
|
|||||||
@ -2,6 +2,7 @@ package com.yfd.platform.qgc_base.controller;
|
|||||||
|
|
||||||
import com.yfd.platform.common.DataSourceRequest;
|
import com.yfd.platform.common.DataSourceRequest;
|
||||||
import com.yfd.platform.config.ResponseResult;
|
import com.yfd.platform.config.ResponseResult;
|
||||||
|
import com.yfd.platform.qgc_base.domain.vo.EngRsvrcscdBVo;
|
||||||
import com.yfd.platform.qgc_base.service.ISdEngInfoBHService;
|
import com.yfd.platform.qgc_base.service.ISdEngInfoBHService;
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
@ -50,4 +51,10 @@ public class SdEngMonitorController {
|
|||||||
public ResponseResult getEngPointKendoListCust(@RequestBody DataSourceRequest dataSourceRequest) {
|
public ResponseResult getEngPointKendoListCust(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||||
return ResponseResult.successData(engInfoBHService.getEngPointKendoListCust(dataSourceRequest));
|
return ResponseResult.successData(engInfoBHService.getEngPointKendoListCust(dataSourceRequest));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping("/rsvrcscdb/GetKendoList")
|
||||||
|
@Operation(summary = "条件过滤数据列表")
|
||||||
|
public ResponseResult getRsvrcscdBKendoList(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||||
|
return ResponseResult.successData(engInfoBHService.getRsvrcscdBKendoList(dataSourceRequest));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,41 @@
|
|||||||
|
package com.yfd.platform.qgc_base.domain.vo;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class EngRsvrcscdBVo {
|
||||||
|
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
private String rvcd;
|
||||||
|
|
||||||
|
private String rvcdName;
|
||||||
|
|
||||||
|
private String stcd;
|
||||||
|
|
||||||
|
private String ennm;
|
||||||
|
|
||||||
|
private Double srcdis;
|
||||||
|
|
||||||
|
private Double dmhg;
|
||||||
|
|
||||||
|
private Double normz;
|
||||||
|
|
||||||
|
private String recordUser;
|
||||||
|
|
||||||
|
private Date recordTime;
|
||||||
|
|
||||||
|
private String modifyUser;
|
||||||
|
|
||||||
|
private Date modifyTime;
|
||||||
|
|
||||||
|
private Integer isDeleted;
|
||||||
|
|
||||||
|
private Double lgtd;
|
||||||
|
|
||||||
|
private Double lttd;
|
||||||
|
|
||||||
|
private String stlc;
|
||||||
|
}
|
||||||
@ -9,6 +9,7 @@ import com.yfd.platform.qgc_base.domain.SdEngInfoBHRequest;
|
|||||||
import com.yfd.platform.qgc_base.domain.vo.EngBaseInfoVo;
|
import com.yfd.platform.qgc_base.domain.vo.EngBaseInfoVo;
|
||||||
import com.yfd.platform.qgc_base.domain.vo.EngEiaapprovalVo;
|
import com.yfd.platform.qgc_base.domain.vo.EngEiaapprovalVo;
|
||||||
import com.yfd.platform.qgc_base.domain.vo.EngOperatVo;
|
import com.yfd.platform.qgc_base.domain.vo.EngOperatVo;
|
||||||
|
import com.yfd.platform.qgc_base.domain.vo.EngRsvrcscdBVo;
|
||||||
import com.yfd.platform.qgc_base.domain.vo.EngPointVo;
|
import com.yfd.platform.qgc_base.domain.vo.EngPointVo;
|
||||||
import com.yfd.platform.qgc_base.domain.vo.EngStInfoResultVo;
|
import com.yfd.platform.qgc_base.domain.vo.EngStInfoResultVo;
|
||||||
import com.yfd.platform.qgc_base.domain.vo.EngVmsstbprptVo;
|
import com.yfd.platform.qgc_base.domain.vo.EngVmsstbprptVo;
|
||||||
@ -89,4 +90,6 @@ public interface ISdEngInfoBHService extends IService<SdEngInfoBH> {
|
|||||||
DataSourceResult getStbprpDataKendoListCust(DataSourceRequest dataSourceRequest, String tbCode, Boolean ignorePageLimit);
|
DataSourceResult getStbprpDataKendoListCust(DataSourceRequest dataSourceRequest, String tbCode, Boolean ignorePageLimit);
|
||||||
|
|
||||||
DataSourceResult<EngPointVo> getEngPointKendoListCust(DataSourceRequest dataSourceRequest);
|
DataSourceResult<EngPointVo> getEngPointKendoListCust(DataSourceRequest dataSourceRequest);
|
||||||
|
|
||||||
|
DataSourceResult<EngRsvrcscdBVo> getRsvrcscdBKendoList(DataSourceRequest dataSourceRequest);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -27,6 +27,7 @@ import com.yfd.platform.qgc_base.domain.SdEngInfoBHRequest;
|
|||||||
import com.yfd.platform.qgc_base.domain.vo.EngBaseInfoVo;
|
import com.yfd.platform.qgc_base.domain.vo.EngBaseInfoVo;
|
||||||
import com.yfd.platform.qgc_base.domain.vo.EngEiaapprovalVo;
|
import com.yfd.platform.qgc_base.domain.vo.EngEiaapprovalVo;
|
||||||
import com.yfd.platform.qgc_base.domain.vo.EngOperatVo;
|
import com.yfd.platform.qgc_base.domain.vo.EngOperatVo;
|
||||||
|
import com.yfd.platform.qgc_base.domain.vo.EngRsvrcscdBVo;
|
||||||
import com.yfd.platform.qgc_base.domain.vo.EngPointVo;
|
import com.yfd.platform.qgc_base.domain.vo.EngPointVo;
|
||||||
import com.yfd.platform.qgc_base.domain.vo.EngStbprpDataVo;
|
import com.yfd.platform.qgc_base.domain.vo.EngStbprpDataVo;
|
||||||
import com.yfd.platform.qgc_base.domain.vo.EngStBaseInfoVo;
|
import com.yfd.platform.qgc_base.domain.vo.EngStBaseInfoVo;
|
||||||
@ -2689,10 +2690,10 @@ public class SdEngInfoBHServiceImpl extends ServiceImpl<SdEngInfoBHMapper, SdEng
|
|||||||
StringBuilder sql = new StringBuilder();
|
StringBuilder sql = new StringBuilder();
|
||||||
sql.append("SELECT ")
|
sql.append("SELECT ")
|
||||||
.append("t.STCD AS stcd, ")
|
.append("t.STCD AS stcd, ")
|
||||||
.append("t.STNM AS ennm, ")
|
.append("t.ENNM AS ennm, ")
|
||||||
.append("t.LOGO AS logo, ")
|
.append("t.LOGO AS logo, ")
|
||||||
.append("t.STNM AS stnm, ")
|
.append("t.ENNM AS stnm, ")
|
||||||
.append("t.STNM AS titleName, ")
|
.append("t.ENNM AS titleName, ")
|
||||||
.append("t.RVCD AS rvcd, ")
|
.append("t.RVCD AS rvcd, ")
|
||||||
.append("t.ADDVCD AS addvcd, ")
|
.append("t.ADDVCD AS addvcd, ")
|
||||||
.append("t.LGTD AS lgtd, ")
|
.append("t.LGTD AS lgtd, ")
|
||||||
@ -2744,7 +2745,7 @@ public class SdEngInfoBHServiceImpl extends ServiceImpl<SdEngInfoBHMapper, SdEng
|
|||||||
.append(" WHERE NVL(det.IS_DELETED, 0) = 0 AND NVL(cfg.IS_DELETED, 0) = 0 AND cfg.CODE = 'common' ")
|
.append(" WHERE NVL(det.IS_DELETED, 0) = 0 AND NVL(cfg.IS_DELETED, 0) = 0 AND cfg.CODE = 'common' ")
|
||||||
.append(") siteSort ON siteSort.RVCD = t.HBRVCD AND siteSort.STCD = t.STCD ")
|
.append(") siteSort ON siteSort.RVCD = t.HBRVCD AND siteSort.STCD = t.STCD ")
|
||||||
.append("LEFT JOIN ( ")
|
.append("LEFT JOIN ( ")
|
||||||
.append(" SELECT STCD, COUNT(ID) AS configCount ")
|
.append(" SELECT STCD, COUNT(STCD) AS configCount ")
|
||||||
.append(" FROM SD_EQ_B_H ")
|
.append(" FROM SD_EQ_B_H ")
|
||||||
.append(" WHERE NVL(IS_DELETED, 0) = 0 ")
|
.append(" WHERE NVL(IS_DELETED, 0) = 0 ")
|
||||||
.append(" GROUP BY STCD ")
|
.append(" GROUP BY STCD ")
|
||||||
@ -2877,7 +2878,7 @@ public class SdEngInfoBHServiceImpl extends ServiceImpl<SdEngInfoBHMapper, SdEng
|
|||||||
}
|
}
|
||||||
return switch (field) {
|
return switch (field) {
|
||||||
case "stcd" -> "t.STCD";
|
case "stcd" -> "t.STCD";
|
||||||
case "stnm", "ennm", "titleName" -> "t.STNM";
|
case "stnm", "ennm", "titleName" -> "t.ENNM";
|
||||||
case "rvcd" -> "t.RVCD";
|
case "rvcd" -> "t.RVCD";
|
||||||
case "addvcd" -> "t.ADDVCD";
|
case "addvcd" -> "t.ADDVCD";
|
||||||
case "lgtd" -> "t.LGTD";
|
case "lgtd" -> "t.LGTD";
|
||||||
@ -2900,9 +2901,9 @@ public class SdEngInfoBHServiceImpl extends ServiceImpl<SdEngInfoBHMapper, SdEng
|
|||||||
case "rvcdStepSort" -> "rvcdStepSort";
|
case "rvcdStepSort" -> "rvcdStepSort";
|
||||||
case "rstcdStepSort" -> "rstcdStepSort";
|
case "rstcdStepSort" -> "rstcdStepSort";
|
||||||
case "baseStepSort" -> "baseStepSort";
|
case "baseStepSort" -> "baseStepSort";
|
||||||
case "ifEngSpecial" -> "ifEngSpecial";
|
case "ifEngSpecial" -> "(CASE WHEN elec.configCount > 0 THEN 'true' WHEN elec.configCount IS NULL THEN 'false' ELSE 'false' END)";
|
||||||
case "anchoPointState" -> "anchoPointState";
|
case "anchoPointState" -> "(CASE WHEN t.PRSC IN ('1','2') AND t.BLDSTT_CODE = 2 THEN 'large_eng_built' WHEN t.PRSC IN ('1','2') AND t.BLDSTT_CODE = 1 THEN 'large_eng_ubuilt' WHEN t.PRSC IN ('1','2') AND (t.BLDSTT_CODE = 0 OR t.BLDSTT_CODE IS NULL) THEN 'large_eng_nbuilt' WHEN t.PRSC IN ('3') AND t.BLDSTT_CODE = 2 THEN 'mid_eng_built' WHEN t.PRSC IN ('3') AND t.BLDSTT_CODE = 1 THEN 'mid_eng_ubuilt' WHEN t.PRSC IN ('3') AND (t.BLDSTT_CODE = 0 OR t.BLDSTT_CODE IS NULL) THEN 'mid_eng_nbuilt' END)";
|
||||||
case "endInstalledType" -> "endInstalledType";
|
case "endInstalledType" -> "(CASE WHEN t.PRSC IN ('1','2') THEN 1 WHEN t.PRSC IN ('3') THEN 2 END)";
|
||||||
default -> null;
|
default -> null;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@ -2928,4 +2929,198 @@ public class SdEngInfoBHServiceImpl extends ServiceImpl<SdEngInfoBHMapper, SdEng
|
|||||||
}
|
}
|
||||||
return " ORDER BY " + String.join(", ", orderItems);
|
return " ORDER BY " + String.join(", ", orderItems);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public DataSourceResult<EngRsvrcscdBVo> getRsvrcscdBKendoList(DataSourceRequest dataSourceRequest) {
|
||||||
|
DataSourceResult<EngRsvrcscdBVo> result = new DataSourceResult<>();
|
||||||
|
result.setAggregates(new HashMap<>());
|
||||||
|
|
||||||
|
if (dataSourceRequest == null) {
|
||||||
|
result.setData(new ArrayList<>());
|
||||||
|
result.setTotal(0L);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
DataSourceLoadOptionsBase loadOptions = dataSourceRequest.toDevRequest();
|
||||||
|
Page<?> page = loadOptions == null ? null : QgcQueryWrapperUtil.buildPage(loadOptions, loadOptions.getSkip(), loadOptions.getTake());
|
||||||
|
|
||||||
|
Map<String, Object> paramMap = new HashMap<>();
|
||||||
|
StringBuilder sql = new StringBuilder();
|
||||||
|
|
||||||
|
sql.append("SELECT ")
|
||||||
|
.append("r.ID AS id, ")
|
||||||
|
.append("r.RVCD AS rvcd, ")
|
||||||
|
.append("rv.RVNM AS rvcdName, ")
|
||||||
|
.append("r.STCD AS stcd, ")
|
||||||
|
.append("r.ENNM AS ennm, ")
|
||||||
|
.append("r.SRCDIS AS srcdis, ")
|
||||||
|
.append("r.DMHG AS dmhg, ")
|
||||||
|
.append("r.NORMZ AS normz, ")
|
||||||
|
.append("r.RECORD_USER AS recordUser, ")
|
||||||
|
.append("r.RECORD_TIME AS recordTime, ")
|
||||||
|
.append("r.MODIFY_USER AS modifyUser, ")
|
||||||
|
.append("r.MODIFY_TIME AS modifyTime, ")
|
||||||
|
.append("r.IS_DELETED AS isDeleted, ")
|
||||||
|
.append("eng.LGTD AS lgtd, ")
|
||||||
|
.append("eng.LTTD AS lttd, ")
|
||||||
|
.append("eng.STLC AS stlc ")
|
||||||
|
.append("FROM SD_RSVRCSCD_B r ")
|
||||||
|
.append("LEFT JOIN SD_RVCD_DIC rv ON rv.RVCD = r.RVCD ")
|
||||||
|
.append("LEFT JOIN SD_ENGINFO_B_H eng ON eng.STCD = r.STCD AND NVL(eng.IS_DELETED, 0) = 0 ")
|
||||||
|
.append("WHERE NVL(r.IS_DELETED, 0) = 0 ");
|
||||||
|
|
||||||
|
String filterSql = buildRsvrcscdBFilterCondition(dataSourceRequest.getFilter(), paramMap, new int[]{0});
|
||||||
|
if (StringUtils.hasText(filterSql)) {
|
||||||
|
sql.append(" AND ").append(filterSql);
|
||||||
|
}
|
||||||
|
|
||||||
|
sql.append(buildRsvrcscdBOrderBySql(dataSourceRequest.getSort()));
|
||||||
|
|
||||||
|
List<EngRsvrcscdBVo> list = microservicDynamicSQLMapper.pageAllListWithResultType(
|
||||||
|
page, sql.toString(), paramMap, EngRsvrcscdBVo.class);
|
||||||
|
result.setData(list);
|
||||||
|
result.setTotal(page == null ? list.size() : page.getTotal());
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
private String buildRsvrcscdBFilterCondition(DataSourceRequest.FilterDescriptor filter,
|
||||||
|
Map<String, Object> paramMap,
|
||||||
|
int[] indexHolder) {
|
||||||
|
if (filter == null) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
if (StringUtils.hasText(filter.getField())) {
|
||||||
|
return buildRsvrcscdBLeafCondition(filter, paramMap, indexHolder);
|
||||||
|
}
|
||||||
|
if (filter.getFilters() == null || filter.getFilters().isEmpty()) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
List<String> childConditions = new ArrayList<>();
|
||||||
|
for (DataSourceRequest.FilterDescriptor child : filter.getFilters()) {
|
||||||
|
String childSql = buildRsvrcscdBFilterCondition(child, paramMap, indexHolder);
|
||||||
|
if (StringUtils.hasText(childSql)) {
|
||||||
|
childConditions.add("(" + childSql + ")");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (childConditions.isEmpty()) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
String logic = "or".equalsIgnoreCase(filter.getLogic()) ? " OR " : " AND ";
|
||||||
|
return String.join(logic, childConditions);
|
||||||
|
}
|
||||||
|
|
||||||
|
private String buildRsvrcscdBLeafCondition(DataSourceRequest.FilterDescriptor filter,
|
||||||
|
Map<String, Object> paramMap,
|
||||||
|
int[] indexHolder) {
|
||||||
|
String column = mapRsvrcscdBColumn(filter.getField());
|
||||||
|
if (!StringUtils.hasText(column)) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
String operator = filter.getOperator() == null ? "eq" : filter.getOperator().toLowerCase();
|
||||||
|
Object value = filter.getValue();
|
||||||
|
if ("isnull".equals(operator)) {
|
||||||
|
return column + " IS NULL";
|
||||||
|
}
|
||||||
|
if ("isnotnull".equals(operator)) {
|
||||||
|
return column + " IS NOT NULL";
|
||||||
|
}
|
||||||
|
if ("in".equals(operator)) {
|
||||||
|
List<Object> values = normalizeFilterValues(value);
|
||||||
|
if (values.isEmpty()) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
List<String> placeholders = new ArrayList<>();
|
||||||
|
for (Object item : values) {
|
||||||
|
String key = "rsvrParam" + indexHolder[0]++;
|
||||||
|
paramMap.put(key, item);
|
||||||
|
placeholders.add("#{map." + key + "}");
|
||||||
|
}
|
||||||
|
return column + " IN (" + String.join(", ", placeholders) + ")";
|
||||||
|
}
|
||||||
|
if (value == null) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
String key = "rsvrParam" + indexHolder[0]++;
|
||||||
|
return switch (operator) {
|
||||||
|
case "eq" -> {
|
||||||
|
paramMap.put(key, value);
|
||||||
|
yield column + " = #{map." + key + "}";
|
||||||
|
}
|
||||||
|
case "neq" -> {
|
||||||
|
paramMap.put(key, value);
|
||||||
|
yield column + " <> #{map." + key + "}";
|
||||||
|
}
|
||||||
|
case "contains" -> {
|
||||||
|
paramMap.put(key, "%" + value + "%");
|
||||||
|
yield column + " LIKE #{map." + key + "}";
|
||||||
|
}
|
||||||
|
case "startswith" -> {
|
||||||
|
paramMap.put(key, value + "%");
|
||||||
|
yield column + " LIKE #{map." + key + "}";
|
||||||
|
}
|
||||||
|
case "endswith" -> {
|
||||||
|
paramMap.put(key, "%" + value);
|
||||||
|
yield column + " LIKE #{map." + key + "}";
|
||||||
|
}
|
||||||
|
case "gt" -> {
|
||||||
|
paramMap.put(key, value);
|
||||||
|
yield column + " > #{map." + key + "}";
|
||||||
|
}
|
||||||
|
case "gte" -> {
|
||||||
|
paramMap.put(key, value);
|
||||||
|
yield column + " >= #{map." + key + "}";
|
||||||
|
}
|
||||||
|
case "lt" -> {
|
||||||
|
paramMap.put(key, value);
|
||||||
|
yield column + " < #{map." + key + "}";
|
||||||
|
}
|
||||||
|
case "lte" -> {
|
||||||
|
paramMap.put(key, value);
|
||||||
|
yield column + " <= #{map." + key + "}";
|
||||||
|
}
|
||||||
|
default -> "";
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
private String mapRsvrcscdBColumn(String field) {
|
||||||
|
if (!StringUtils.hasText(field)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return switch (field) {
|
||||||
|
case "id" -> "r.ID";
|
||||||
|
case "rvcd" -> "r.RVCD";
|
||||||
|
case "rvcdName" -> "rv.RVNM";
|
||||||
|
case "stcd" -> "r.STCD";
|
||||||
|
case "ennm" -> "r.ENNM";
|
||||||
|
case "srcdis" -> "r.SRCDIS";
|
||||||
|
case "dmhg" -> "r.DMHG";
|
||||||
|
case "normz" -> "r.NORMZ";
|
||||||
|
case "lgtd" -> "eng.LGTD";
|
||||||
|
case "lttd" -> "eng.LTTD";
|
||||||
|
case "stlc" -> "eng.STLC";
|
||||||
|
default -> null;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
private String buildRsvrcscdBOrderBySql(List<DataSourceRequest.SortDescriptor> sortList) {
|
||||||
|
if (sortList == null || sortList.isEmpty()) {
|
||||||
|
return " ORDER BY r.RVCD ASC, r.STCD ASC";
|
||||||
|
}
|
||||||
|
List<String> orderItems = new ArrayList<>();
|
||||||
|
for (DataSourceRequest.SortDescriptor sortDescriptor : sortList) {
|
||||||
|
if (sortDescriptor == null || !StringUtils.hasText(sortDescriptor.getField())) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
String column = mapRsvrcscdBColumn(sortDescriptor.getField());
|
||||||
|
if (!StringUtils.hasText(column)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
String dir = "desc".equalsIgnoreCase(sortDescriptor.getDir()) || "des".equalsIgnoreCase(sortDescriptor.getDir()) ? "DESC" : "ASC";
|
||||||
|
orderItems.add(column + " " + dir + " NULLS LAST");
|
||||||
|
}
|
||||||
|
if (orderItems.isEmpty()) {
|
||||||
|
return " ORDER BY r.RVCD ASC, r.STCD ASC";
|
||||||
|
}
|
||||||
|
return " ORDER BY " + String.join(", ", orderItems);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -60,6 +60,8 @@ import java.util.*;
|
|||||||
@Slf4j
|
@Slf4j
|
||||||
public class FishDraftDataController {
|
public class FishDraftDataController {
|
||||||
|
|
||||||
|
private static final int IN_QUERY_BATCH_SIZE = 900;
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private IFishDraftDataService fishDraftDataService;
|
private IFishDraftDataService fishDraftDataService;
|
||||||
|
|
||||||
@ -368,11 +370,10 @@ public class FishDraftDataController {
|
|||||||
@PostMapping("/batchApproveByApprovalId")
|
@PostMapping("/batchApproveByApprovalId")
|
||||||
@Operation(summary = "根据审批批次全部审批通过")
|
@Operation(summary = "根据审批批次全部审批通过")
|
||||||
public ResponseResult batchApproveByApprovalId(@RequestBody BatchApproveRequest request) {
|
public ResponseResult batchApproveByApprovalId(@RequestBody BatchApproveRequest request) {
|
||||||
if (request.getApprovalIds().isEmpty()) {
|
if (request.getApprovalIds() == null || request.getApprovalIds().isEmpty()) {
|
||||||
return ResponseResult.error("请选择审批批次");
|
return ResponseResult.error("请选择审批批次");
|
||||||
}
|
}
|
||||||
List<FishDraftData> draft = fishDraftDataService.list(new LambdaQueryWrapper<FishDraftData>().eq(FishDraftData::getDeletedFlag, 0).in(FishDraftData::getApprovalId, request.getApprovalIds()).eq(FishDraftData::getStatus, "PENDING").select(FishDraftData::getId));
|
List<String> ids = listDraftIdsByApprovalIdsAndStatus(request.getApprovalIds(), "PENDING");
|
||||||
List<String> ids = draft.stream().map(FishDraftData::getId).toList();
|
|
||||||
boolean result = fishDraftDataService.batchApprove(ids, request.getApproveComment());
|
boolean result = fishDraftDataService.batchApprove(ids, request.getApproveComment());
|
||||||
return result ? ResponseResult.success("审批通过") : ResponseResult.error("审批失败");
|
return result ? ResponseResult.success("审批通过") : ResponseResult.error("审批失败");
|
||||||
}
|
}
|
||||||
@ -388,8 +389,7 @@ public class FishDraftDataController {
|
|||||||
@Operation(summary = "批量驳回")
|
@Operation(summary = "批量驳回")
|
||||||
public ResponseResult batchRejectFull(@RequestBody BatchRejectRequest request) {
|
public ResponseResult batchRejectFull(@RequestBody BatchRejectRequest request) {
|
||||||
if (request.getApprovalIds() != null && !request.getApprovalIds().isEmpty()) {
|
if (request.getApprovalIds() != null && !request.getApprovalIds().isEmpty()) {
|
||||||
List<FishDraftData> draft = fishDraftDataService.list(new LambdaQueryWrapper<FishDraftData>().eq(FishDraftData::getDeletedFlag, 0).in(FishDraftData::getApprovalId, request.getApprovalIds()).eq(FishDraftData::getStatus, "PENDING").select(FishDraftData::getId));
|
List<String> ids = listDraftIdsByApprovalIdsAndStatus(request.getApprovalIds(), "PENDING");
|
||||||
List<String> ids = draft.stream().map(FishDraftData::getId).toList();
|
|
||||||
boolean result = fishDraftDataService.rejectBatch(ids, request.getRejectReason());
|
boolean result = fishDraftDataService.rejectBatch(ids, request.getRejectReason());
|
||||||
return result ? ResponseResult.success("驳回成功") : ResponseResult.error("驳回失败");
|
return result ? ResponseResult.success("驳回成功") : ResponseResult.error("驳回失败");
|
||||||
}
|
}
|
||||||
@ -429,6 +429,47 @@ public class FishDraftDataController {
|
|||||||
return result ? ResponseResult.success("修改成功") : ResponseResult.error("修改失败");
|
return result ? ResponseResult.success("修改成功") : ResponseResult.error("修改失败");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private List<String> listDraftIdsByApprovalIdsAndStatus(List<String> approvalIds, String status) {
|
||||||
|
List<String> normalizedApprovalIds = normalizeBatchValues(approvalIds);
|
||||||
|
if (normalizedApprovalIds.isEmpty()) {
|
||||||
|
return Collections.emptyList();
|
||||||
|
}
|
||||||
|
List<String> ids = new ArrayList<>();
|
||||||
|
for (List<String> batchApprovalIds : splitList(normalizedApprovalIds, IN_QUERY_BATCH_SIZE)) {
|
||||||
|
List<FishDraftData> draft = fishDraftDataService.list(new LambdaQueryWrapper<FishDraftData>()
|
||||||
|
.eq(FishDraftData::getDeletedFlag, 0)
|
||||||
|
.in(FishDraftData::getApprovalId, batchApprovalIds)
|
||||||
|
.eq(FishDraftData::getStatus, status)
|
||||||
|
.select(FishDraftData::getId));
|
||||||
|
ids.addAll(draft.stream().map(FishDraftData::getId).filter(StrUtil::isNotBlank).toList());
|
||||||
|
}
|
||||||
|
return ids;
|
||||||
|
}
|
||||||
|
|
||||||
|
private List<String> normalizeBatchValues(List<String> values) {
|
||||||
|
if (values == null || values.isEmpty()) {
|
||||||
|
return Collections.emptyList();
|
||||||
|
}
|
||||||
|
LinkedHashSet<String> normalized = new LinkedHashSet<>();
|
||||||
|
for (String value : values) {
|
||||||
|
if (StrUtil.isNotBlank(value)) {
|
||||||
|
normalized.add(value.trim());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return new ArrayList<>(normalized);
|
||||||
|
}
|
||||||
|
|
||||||
|
private <T> List<List<T>> splitList(List<T> source, int batchSize) {
|
||||||
|
if (source == null || source.isEmpty()) {
|
||||||
|
return Collections.emptyList();
|
||||||
|
}
|
||||||
|
List<List<T>> result = new ArrayList<>();
|
||||||
|
for (int i = 0; i < source.size(); i += batchSize) {
|
||||||
|
result.add(source.subList(i, Math.min(source.size(), i + batchSize)));
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
@PostMapping("/delete")
|
@PostMapping("/delete")
|
||||||
@Operation(summary = "删除过鱼数据")
|
@Operation(summary = "删除过鱼数据")
|
||||||
public ResponseResult delete(@RequestParam String id) {
|
public ResponseResult delete(@RequestParam String id) {
|
||||||
|
|||||||
@ -2,7 +2,6 @@ package com.yfd.platform.qgc_data.service.impl;
|
|||||||
|
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.yfd.platform.common.DataSourceLoadOptionsBase;
|
import com.yfd.platform.common.DataSourceLoadOptionsBase;
|
||||||
@ -36,6 +35,9 @@ import jakarta.annotation.Resource;
|
|||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
import org.springframework.transaction.TransactionDefinition;
|
||||||
|
import org.springframework.transaction.PlatformTransactionManager;
|
||||||
|
import org.springframework.transaction.support.TransactionTemplate;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
@ -48,6 +50,8 @@ import java.util.*;
|
|||||||
@Slf4j
|
@Slf4j
|
||||||
public class FishDraftDataServiceImpl extends ServiceImpl<FishDraftDataMapper, FishDraftData> implements IFishDraftDataService {
|
public class FishDraftDataServiceImpl extends ServiceImpl<FishDraftDataMapper, FishDraftData> implements IFishDraftDataService {
|
||||||
|
|
||||||
|
private static final int IN_QUERY_BATCH_SIZE = 200;
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private FishDraftDataMapper fishDraftDataMapper;
|
private FishDraftDataMapper fishDraftDataMapper;
|
||||||
|
|
||||||
@ -85,6 +89,9 @@ public class FishDraftDataServiceImpl extends ServiceImpl<FishDraftDataMapper, F
|
|||||||
@Resource
|
@Resource
|
||||||
private ISdFpssRService sdFpssRService;
|
private ISdFpssRService sdFpssRService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private PlatformTransactionManager transactionManager;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Page<FishDraftDataVO> queryPageList(DataSourceRequest dataSourceRequest) {
|
public Page<FishDraftDataVO> queryPageList(DataSourceRequest dataSourceRequest) {
|
||||||
Page<FishDraftDataVO> page = KendoUtil.getPage(dataSourceRequest);
|
Page<FishDraftDataVO> page = KendoUtil.getPage(dataSourceRequest);
|
||||||
@ -254,16 +261,15 @@ public class FishDraftDataServiceImpl extends ServiceImpl<FishDraftDataMapper, F
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean batchRemoveDraft(List<String> ids) {
|
public boolean batchRemoveDraft(List<String> ids) {
|
||||||
long count = this.count(new LambdaQueryWrapper<FishDraftData>().in(FishDraftData::getId, ids).eq(FishDraftData::getLockFlag, 1));
|
long count = countByIdsAndLockFlag(ids, 1);
|
||||||
if(count > 0){
|
if(count > 0){
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
LambdaUpdateWrapper<FishDraftData> updateWrapper = new LambdaUpdateWrapper<>();
|
|
||||||
updateWrapper.in(FishDraftData::getId, ids);
|
|
||||||
updateWrapper.set(FishDraftData::getDeletedFlag, 1);
|
|
||||||
String userId = SecurityUtils.getUserId();
|
String userId = SecurityUtils.getUserId();
|
||||||
updateWrapper.set(FishDraftData::getDeletedBy,userId );
|
return updateByIdsInBatches(ids, entity -> {
|
||||||
return this.update(updateWrapper);
|
entity.setDeletedFlag(1);
|
||||||
|
entity.setDeletedBy(userId);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -295,12 +301,13 @@ public class FishDraftDataServiceImpl extends ServiceImpl<FishDraftDataMapper, F
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
|
||||||
public boolean submitDrafts(List<String> ids) {
|
public boolean submitDrafts(List<String> ids) {
|
||||||
if (ids == null || ids.isEmpty()) {
|
if (ids == null || ids.isEmpty()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
String operatorId = SecurityUtils.getUserId();
|
String operatorId = SecurityUtils.getUserId();
|
||||||
|
Map<String, String> originalStatusMap = new HashMap<>();
|
||||||
|
List<String> succeededIds = new ArrayList<>();
|
||||||
|
|
||||||
ApprovalMain approvalMain = new ApprovalMain();
|
ApprovalMain approvalMain = new ApprovalMain();
|
||||||
approvalMain.setApprovalNo("APR" + System.currentTimeMillis());
|
approvalMain.setApprovalNo("APR" + System.currentTimeMillis());
|
||||||
@ -311,19 +318,46 @@ public class FishDraftDataServiceImpl extends ServiceImpl<FishDraftDataMapper, F
|
|||||||
approvalMain.setStatus("PENDING");
|
approvalMain.setStatus("PENDING");
|
||||||
// 查询当前人的数据权限
|
// 查询当前人的数据权限
|
||||||
setUserDataScope(approvalMain);
|
setUserDataScope(approvalMain);
|
||||||
|
try {
|
||||||
|
executeInNewTransaction(() -> {
|
||||||
approvalMainService.save(approvalMain);
|
approvalMainService.save(approvalMain);
|
||||||
|
return true;
|
||||||
|
});
|
||||||
|
|
||||||
LambdaUpdateWrapper<FishDraftData> updateWrapper = new LambdaUpdateWrapper<>();
|
List<FishDraftData> unlockedDrafts = listDraftsByIdsAndLockFlag(ids, 0);
|
||||||
updateWrapper.in(FishDraftData::getId, ids);
|
for (FishDraftData draft : unlockedDrafts) {
|
||||||
updateWrapper.eq(FishDraftData::getLockFlag, 0);
|
originalStatusMap.put(draft.getId(), draft.getStatus());
|
||||||
updateWrapper.set(FishDraftData::getApprovalId, approvalMain.getId());
|
}
|
||||||
updateWrapper.set(FishDraftData::getStatus, "PENDING");
|
Date submitTime = new Date();
|
||||||
updateWrapper.set(FishDraftData::getSubmitTime, new Date());
|
|
||||||
this.update(updateWrapper);
|
|
||||||
|
|
||||||
|
for (List<FishDraftData> batchDrafts : splitList(unlockedDrafts, IN_QUERY_BATCH_SIZE)) {
|
||||||
|
executeInNewTransaction(() -> {
|
||||||
|
List<String> batchIds = new ArrayList<>();
|
||||||
|
for (FishDraftData batchDraft : batchDrafts) {
|
||||||
|
batchIds.add(batchDraft.getId());
|
||||||
|
}
|
||||||
|
updateByIdsBatch(batchIds, entity -> {
|
||||||
|
entity.setApprovalId(approvalMain.getId());
|
||||||
|
entity.setStatus("PENDING");
|
||||||
|
entity.setSubmitTime(submitTime);
|
||||||
|
});
|
||||||
|
return true;
|
||||||
|
});
|
||||||
|
for (FishDraftData batchDraft : batchDrafts) {
|
||||||
|
succeededIds.add(batchDraft.getId());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
executeInNewTransaction(() -> {
|
||||||
approvalLogService.logSubmit(approvalMain.getId(), operatorId, "批量提交草稿,共" + ids.size() + "条");
|
approvalLogService.logSubmit(approvalMain.getId(), operatorId, "批量提交草稿,共" + ids.size() + "条");
|
||||||
return true;
|
return true;
|
||||||
|
});
|
||||||
|
return true;
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("批量提交草稿失败", e);
|
||||||
|
rollbackSubmittedDrafts(approvalMain.getId(), succeededIds, originalStatusMap, e);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setUserDataScope(ApprovalMain approvalMain) {
|
private void setUserDataScope(ApprovalMain approvalMain) {
|
||||||
@ -413,7 +447,6 @@ public class FishDraftDataServiceImpl extends ServiceImpl<FishDraftDataMapper, F
|
|||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
|
||||||
public boolean batchApprove(List<String> ids, String approveComment) {
|
public boolean batchApprove(List<String> ids, String approveComment) {
|
||||||
if (ids == null || ids.isEmpty()) {
|
if (ids == null || ids.isEmpty()) {
|
||||||
return false;
|
return false;
|
||||||
@ -421,32 +454,42 @@ public class FishDraftDataServiceImpl extends ServiceImpl<FishDraftDataMapper, F
|
|||||||
Date now = new Date();
|
Date now = new Date();
|
||||||
String operatorId = SecurityUtils.getUserId();
|
String operatorId = SecurityUtils.getUserId();
|
||||||
|
|
||||||
List<FishDraftData> dataList = this.listByIds(ids);
|
List<FishDraftData> dataList = listByIdsInBatches(ids);
|
||||||
Set<String> processedApprovalIds = new HashSet<>();
|
Map<String, List<FishDraftData>> approvalDraftMap = new LinkedHashMap<>();
|
||||||
List<String> validIds = new ArrayList<>();
|
|
||||||
List<SdFpssR> fpssRList = new ArrayList<>();
|
|
||||||
|
|
||||||
for (FishDraftData fishDraftData : dataList) {
|
for (FishDraftData fishDraftData : dataList) {
|
||||||
if ("PENDING".equals(fishDraftData.getStatus())) {
|
if ("PENDING".equals(fishDraftData.getStatus())) {
|
||||||
validIds.add(fishDraftData.getId());
|
String approvalId = StrUtil.blankToDefault(fishDraftData.getApprovalId(), "__NO_APPROVAL__");
|
||||||
if (fishDraftData.getApprovalId() != null) {
|
approvalDraftMap.computeIfAbsent(approvalId, key -> new ArrayList<>()).add(fishDraftData);
|
||||||
processedApprovalIds.add(fishDraftData.getApprovalId());
|
|
||||||
}
|
|
||||||
SdFpssR fpssR = convertToSdFpssR(fishDraftData, operatorId);
|
|
||||||
fpssRList.add(fpssR);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!validIds.isEmpty()) {
|
try {
|
||||||
LambdaUpdateWrapper<FishDraftData> updateWrapper = new LambdaUpdateWrapper<>();
|
for (Map.Entry<String, List<FishDraftData>> entry : approvalDraftMap.entrySet()) {
|
||||||
updateWrapper.in(FishDraftData::getId, validIds);
|
String approvalId = entry.getKey();
|
||||||
updateWrapper.set(FishDraftData::getStatus, "APPROVED");
|
List<FishDraftData> approvalDrafts = entry.getValue();
|
||||||
updateWrapper.set(FishDraftData::getApproveTime, now);
|
for (List<FishDraftData> batchDrafts : splitList(approvalDrafts, IN_QUERY_BATCH_SIZE)) {
|
||||||
updateWrapper.set(FishDraftData::getUpdatedBy, operatorId);
|
executeInNewTransaction(() -> {
|
||||||
this.update(updateWrapper);
|
List<String> batchIds = new ArrayList<>();
|
||||||
boolean b = sdFpssRService.saveOrUpdateBatch(fpssRList);
|
List<SdFpssR> fpssRList = new ArrayList<>();
|
||||||
log.info("=======================插入数据条数======================="+fpssRList.size());
|
for (FishDraftData batchDraft : batchDrafts) {
|
||||||
for (String approvalId : processedApprovalIds) {
|
batchIds.add(batchDraft.getId());
|
||||||
|
fpssRList.add(convertToSdFpssR(batchDraft, operatorId));
|
||||||
|
}
|
||||||
|
updateByIdsBatch(batchIds, entity -> {
|
||||||
|
entity.setStatus("APPROVED");
|
||||||
|
entity.setApproveTime(now);
|
||||||
|
entity.setUpdatedBy(operatorId);
|
||||||
|
});
|
||||||
|
boolean saved = sdFpssRService.saveOrUpdateBatch(fpssRList, IN_QUERY_BATCH_SIZE);
|
||||||
|
if (!saved) {
|
||||||
|
throw new RuntimeException("保存正式表失败");
|
||||||
|
}
|
||||||
|
log.info("=======================插入数据条数======================={}", fpssRList.size());
|
||||||
|
return true;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (!"__NO_APPROVAL__".equals(approvalId)) {
|
||||||
|
executeInNewTransaction(() -> {
|
||||||
ApprovalMain approvalMain = approvalMainService.getById(approvalId);
|
ApprovalMain approvalMain = approvalMainService.getById(approvalId);
|
||||||
approvalLogService.logApprove(approvalId, SecurityUtils.getUserId(), approveComment);
|
approvalLogService.logApprove(approvalId, SecurityUtils.getUserId(), approveComment);
|
||||||
if (approvalMain != null) {
|
if (approvalMain != null) {
|
||||||
@ -456,10 +499,15 @@ public class FishDraftDataServiceImpl extends ServiceImpl<FishDraftDataMapper, F
|
|||||||
approvalMain.setRemark(approveComment);
|
approvalMain.setRemark(approveComment);
|
||||||
approvalMainService.updateById(approvalMain);
|
approvalMainService.updateById(approvalMain);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("批量审批失败", e);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private SdFpssR convertToSdFpssR(FishDraftData draft, String operatorId) {
|
private SdFpssR convertToSdFpssR(FishDraftData draft, String operatorId) {
|
||||||
@ -537,7 +585,6 @@ public class FishDraftDataServiceImpl extends ServiceImpl<FishDraftDataMapper, F
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
|
||||||
public boolean rejectBatch(List<String> ids, String rejectReason) {
|
public boolean rejectBatch(List<String> ids, String rejectReason) {
|
||||||
if (ids == null || ids.isEmpty()) {
|
if (ids == null || ids.isEmpty()) {
|
||||||
return false;
|
return false;
|
||||||
@ -548,28 +595,35 @@ public class FishDraftDataServiceImpl extends ServiceImpl<FishDraftDataMapper, F
|
|||||||
Date now = new Date();
|
Date now = new Date();
|
||||||
String operatorId = SecurityUtils.getUserId();
|
String operatorId = SecurityUtils.getUserId();
|
||||||
|
|
||||||
List<FishDraftData> dataList = this.listByIds(ids);
|
List<FishDraftData> dataList = listByIdsInBatches(ids);
|
||||||
Set<String> processedApprovalIds = new HashSet<>();
|
Map<String, List<FishDraftData>> approvalDraftMap = new LinkedHashMap<>();
|
||||||
List<String> validIds = new ArrayList<>();
|
|
||||||
|
|
||||||
for (FishDraftData fishDraftData : dataList) {
|
for (FishDraftData fishDraftData : dataList) {
|
||||||
if ("PENDING".equals(fishDraftData.getStatus())) {
|
if ("PENDING".equals(fishDraftData.getStatus())) {
|
||||||
validIds.add(fishDraftData.getId());
|
String approvalId = StrUtil.blankToDefault(fishDraftData.getApprovalId(), "__NO_APPROVAL__");
|
||||||
if (fishDraftData.getApprovalId() != null) {
|
approvalDraftMap.computeIfAbsent(approvalId, key -> new ArrayList<>()).add(fishDraftData);
|
||||||
processedApprovalIds.add(fishDraftData.getApprovalId());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!validIds.isEmpty()) {
|
try {
|
||||||
LambdaUpdateWrapper<FishDraftData> updateWrapper = new LambdaUpdateWrapper<>();
|
for (Map.Entry<String, List<FishDraftData>> entry : approvalDraftMap.entrySet()) {
|
||||||
updateWrapper.in(FishDraftData::getId, validIds);
|
String approvalId = entry.getKey();
|
||||||
updateWrapper.set(FishDraftData::getStatus, "REJECTED");
|
List<FishDraftData> approvalDrafts = entry.getValue();
|
||||||
updateWrapper.set(FishDraftData::getApproveTime, now);
|
for (List<FishDraftData> batchDrafts : splitList(approvalDrafts, IN_QUERY_BATCH_SIZE)) {
|
||||||
updateWrapper.set(FishDraftData::getUpdatedBy, operatorId);
|
executeInNewTransaction(() -> {
|
||||||
this.update(updateWrapper);
|
List<String> batchIds = new ArrayList<>();
|
||||||
|
for (FishDraftData batchDraft : batchDrafts) {
|
||||||
for (String approvalId : processedApprovalIds) {
|
batchIds.add(batchDraft.getId());
|
||||||
|
}
|
||||||
|
updateByIdsBatch(batchIds, entity -> {
|
||||||
|
entity.setStatus("REJECTED");
|
||||||
|
entity.setApproveTime(now);
|
||||||
|
entity.setUpdatedBy(operatorId);
|
||||||
|
});
|
||||||
|
return true;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (!"__NO_APPROVAL__".equals(approvalId)) {
|
||||||
|
executeInNewTransaction(() -> {
|
||||||
approvalLogService.logReject(approvalId, operatorId, rejectReason);
|
approvalLogService.logReject(approvalId, operatorId, rejectReason);
|
||||||
ApprovalMain approvalMain = approvalMainService.getById(approvalId);
|
ApprovalMain approvalMain = approvalMainService.getById(approvalId);
|
||||||
if (approvalMain != null) {
|
if (approvalMain != null) {
|
||||||
@ -579,10 +633,15 @@ public class FishDraftDataServiceImpl extends ServiceImpl<FishDraftDataMapper, F
|
|||||||
approvalMain.setRemark(rejectReason);
|
approvalMain.setRemark(rejectReason);
|
||||||
approvalMainService.updateById(approvalMain);
|
approvalMainService.updateById(approvalMain);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("批量驳回失败", e);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -679,4 +738,144 @@ public class FishDraftDataServiceImpl extends ServiceImpl<FishDraftDataMapper, F
|
|||||||
log.info("批量保存草稿完成, 共{}条, 耗时{}ms", fishDraftDataList.size(), System.currentTimeMillis() - start);
|
log.info("批量保存草稿完成, 共{}条, 耗时{}ms", fishDraftDataList.size(), System.currentTimeMillis() - start);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private List<FishDraftData> listByIdsInBatches(List<String> ids) {
|
||||||
|
List<String> normalizedIds = normalizeBatchValues(ids);
|
||||||
|
if (normalizedIds.isEmpty()) {
|
||||||
|
return new ArrayList<>();
|
||||||
|
}
|
||||||
|
List<FishDraftData> result = new ArrayList<>();
|
||||||
|
for (List<String> batchIds : splitList(normalizedIds, IN_QUERY_BATCH_SIZE)) {
|
||||||
|
result.addAll(this.list(new LambdaQueryWrapper<FishDraftData>().in(FishDraftData::getId, batchIds)));
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
private long countByIdsAndLockFlag(List<String> ids, Integer lockFlag) {
|
||||||
|
List<String> normalizedIds = normalizeBatchValues(ids);
|
||||||
|
if (normalizedIds.isEmpty()) {
|
||||||
|
return 0L;
|
||||||
|
}
|
||||||
|
long total = 0L;
|
||||||
|
for (List<String> batchIds : splitList(normalizedIds, IN_QUERY_BATCH_SIZE)) {
|
||||||
|
total += this.count(new LambdaQueryWrapper<FishDraftData>()
|
||||||
|
.in(FishDraftData::getId, batchIds)
|
||||||
|
.eq(FishDraftData::getLockFlag, lockFlag));
|
||||||
|
}
|
||||||
|
return total;
|
||||||
|
}
|
||||||
|
|
||||||
|
private List<String> listIdsByLockFlag(List<String> ids, Integer lockFlag) {
|
||||||
|
List<String> normalizedIds = normalizeBatchValues(ids);
|
||||||
|
if (normalizedIds.isEmpty()) {
|
||||||
|
return Collections.emptyList();
|
||||||
|
}
|
||||||
|
List<String> result = new ArrayList<>();
|
||||||
|
for (List<String> batchIds : splitList(normalizedIds, IN_QUERY_BATCH_SIZE)) {
|
||||||
|
List<FishDraftData> records = this.list(new LambdaQueryWrapper<FishDraftData>()
|
||||||
|
.select(FishDraftData::getId)
|
||||||
|
.in(FishDraftData::getId, batchIds)
|
||||||
|
.eq(FishDraftData::getLockFlag, lockFlag));
|
||||||
|
result.addAll(records.stream().map(FishDraftData::getId).filter(StrUtil::isNotBlank).toList());
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
private List<FishDraftData> listDraftsByIdsAndLockFlag(List<String> ids, Integer lockFlag) {
|
||||||
|
List<String> normalizedIds = normalizeBatchValues(ids);
|
||||||
|
if (normalizedIds.isEmpty()) {
|
||||||
|
return Collections.emptyList();
|
||||||
|
}
|
||||||
|
List<FishDraftData> result = new ArrayList<>();
|
||||||
|
for (List<String> batchIds : splitList(normalizedIds, IN_QUERY_BATCH_SIZE)) {
|
||||||
|
result.addAll(this.list(new LambdaQueryWrapper<FishDraftData>()
|
||||||
|
.in(FishDraftData::getId, batchIds)
|
||||||
|
.eq(FishDraftData::getLockFlag, lockFlag)));
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean updateByIdsBatch(List<String> ids,
|
||||||
|
java.util.function.Consumer<FishDraftData> entityCustomizer) {
|
||||||
|
List<String> normalizedIds = normalizeBatchValues(ids);
|
||||||
|
if (normalizedIds.isEmpty()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
List<FishDraftData> batchEntities = new ArrayList<>(normalizedIds.size());
|
||||||
|
for (String batchId : normalizedIds) {
|
||||||
|
FishDraftData entity = new FishDraftData();
|
||||||
|
entity.setId(batchId);
|
||||||
|
entityCustomizer.accept(entity);
|
||||||
|
batchEntities.add(entity);
|
||||||
|
}
|
||||||
|
return this.updateBatchById(batchEntities, IN_QUERY_BATCH_SIZE);
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean updateByIdsInBatches(List<String> ids,
|
||||||
|
java.util.function.Consumer<FishDraftData> entityCustomizer) {
|
||||||
|
List<String> normalizedIds = normalizeBatchValues(ids);
|
||||||
|
if (normalizedIds.isEmpty()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
boolean updated = false;
|
||||||
|
for (List<String> batchIds : splitList(normalizedIds, IN_QUERY_BATCH_SIZE)) {
|
||||||
|
updated = updateByIdsBatch(batchIds, entityCustomizer) || updated;
|
||||||
|
}
|
||||||
|
return updated;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void rollbackSubmittedDrafts(String approvalId,
|
||||||
|
List<String> succeededIds,
|
||||||
|
Map<String, String> originalStatusMap,
|
||||||
|
Exception originalException) {
|
||||||
|
try {
|
||||||
|
for (List<String> batchIds : splitList(normalizeBatchValues(succeededIds), IN_QUERY_BATCH_SIZE)) {
|
||||||
|
executeInNewTransaction(() -> {
|
||||||
|
List<FishDraftData> rollbackEntities = new ArrayList<>();
|
||||||
|
for (String batchId : batchIds) {
|
||||||
|
FishDraftData entity = new FishDraftData();
|
||||||
|
entity.setId(batchId);
|
||||||
|
entity.setApprovalId(null);
|
||||||
|
entity.setSubmitTime(null);
|
||||||
|
entity.setStatus(originalStatusMap.get(batchId));
|
||||||
|
rollbackEntities.add(entity);
|
||||||
|
}
|
||||||
|
return this.updateBatchById(rollbackEntities, IN_QUERY_BATCH_SIZE);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
executeInNewTransaction(() -> approvalMainService.removeById(approvalId));
|
||||||
|
} catch (Exception rollbackException) {
|
||||||
|
log.error("批量提交草稿回退失败,原始异常: {}", originalException.getMessage(), rollbackException);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private <T> T executeInNewTransaction(java.util.function.Supplier<T> action) {
|
||||||
|
TransactionTemplate transactionTemplate = new TransactionTemplate(transactionManager);
|
||||||
|
transactionTemplate.setPropagationBehavior(TransactionDefinition.PROPAGATION_REQUIRES_NEW);
|
||||||
|
return transactionTemplate.execute(status -> action.get());
|
||||||
|
}
|
||||||
|
|
||||||
|
private List<String> normalizeBatchValues(List<String> values) {
|
||||||
|
if (values == null || values.isEmpty()) {
|
||||||
|
return Collections.emptyList();
|
||||||
|
}
|
||||||
|
LinkedHashSet<String> normalized = new LinkedHashSet<>();
|
||||||
|
for (String value : values) {
|
||||||
|
if (StrUtil.isNotBlank(value)) {
|
||||||
|
normalized.add(value.trim());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return new ArrayList<>(normalized);
|
||||||
|
}
|
||||||
|
|
||||||
|
private <T> List<List<T>> splitList(List<T> source, int batchSize) {
|
||||||
|
if (source == null || source.isEmpty()) {
|
||||||
|
return Collections.emptyList();
|
||||||
|
}
|
||||||
|
List<List<T>> result = new ArrayList<>();
|
||||||
|
for (int i = 0; i < source.size(); i += batchSize) {
|
||||||
|
result.add(source.subList(i, Math.min(source.size(), i + batchSize)));
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -181,4 +181,10 @@ public class EngEqDataController {
|
|||||||
StcdInfoVo result = engEqDataService.getStInfoByStcd(stcd);
|
StcdInfoVo result = engEqDataService.getStInfoByStcd(stcd);
|
||||||
return ResponseResult.successData(result);
|
return ResponseResult.successData(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping("/eqds/GetKendoListCust")
|
||||||
|
@Operation(summary = "生态流量泄放设施描点")
|
||||||
|
public ResponseResult getEqdsKendoListCust(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||||
|
return ResponseResult.successData(engEqDataService.getEqdsKendoListCust(dataSourceRequest));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,101 @@
|
|||||||
|
package com.yfd.platform.qgc_eng.eq.entity.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Schema(description = "生态流量泄放设施描点VO")
|
||||||
|
public class EngEqdsVo {
|
||||||
|
|
||||||
|
@Schema(description = "设施编码")
|
||||||
|
private String stcd;
|
||||||
|
|
||||||
|
@Schema(description = "设施名称")
|
||||||
|
private String stnm;
|
||||||
|
|
||||||
|
@Schema(description = "电站编码")
|
||||||
|
private String rstcd;
|
||||||
|
|
||||||
|
@Schema(description = "电站名称")
|
||||||
|
private String ennm;
|
||||||
|
|
||||||
|
@Schema(description = "生态流量泄放方式")
|
||||||
|
private Integer eqtp;
|
||||||
|
|
||||||
|
@Schema(description = "孔口尺寸")
|
||||||
|
private String flksz;
|
||||||
|
|
||||||
|
@Schema(description = "进水口地板高程")
|
||||||
|
private BigDecimal jskdbgc;
|
||||||
|
|
||||||
|
@Schema(description = "出水口地板高程")
|
||||||
|
private BigDecimal cskdbgc;
|
||||||
|
|
||||||
|
@Schema(description = "死水位时保证流量")
|
||||||
|
private BigDecimal ddzgq;
|
||||||
|
|
||||||
|
@Schema(description = "基荷发电工况")
|
||||||
|
private BigDecimal jhfdgk;
|
||||||
|
|
||||||
|
@Schema(description = "最大泄放流量")
|
||||||
|
private String flkq;
|
||||||
|
|
||||||
|
@Schema(description = "基地")
|
||||||
|
private String baseId;
|
||||||
|
|
||||||
|
@Schema(description = "流域")
|
||||||
|
private String rvcd;
|
||||||
|
|
||||||
|
@Schema(description = "行政区")
|
||||||
|
private String addvcd;
|
||||||
|
|
||||||
|
@Schema(description = "经度")
|
||||||
|
private BigDecimal lgtd;
|
||||||
|
|
||||||
|
@Schema(description = "纬度")
|
||||||
|
private BigDecimal lttd;
|
||||||
|
|
||||||
|
@Schema(description = "高程")
|
||||||
|
private BigDecimal dtmel;
|
||||||
|
|
||||||
|
@Schema(description = "工程类型")
|
||||||
|
private String sttp;
|
||||||
|
|
||||||
|
@Schema(description = "工程类型名称")
|
||||||
|
private String sttpName;
|
||||||
|
|
||||||
|
@Schema(description = "锚点类型")
|
||||||
|
private String sttpMap;
|
||||||
|
|
||||||
|
@Schema(description = "设施类型")
|
||||||
|
private String sttpCode;
|
||||||
|
|
||||||
|
@Schema(description = "图例编码")
|
||||||
|
private String anchoPointState;
|
||||||
|
|
||||||
|
@Schema(description = "弹窗名称")
|
||||||
|
private String titleName;
|
||||||
|
|
||||||
|
@Schema(description = "生态流量限值")
|
||||||
|
private BigDecimal qecLimit;
|
||||||
|
|
||||||
|
@Schema(description = "地图避让")
|
||||||
|
private Integer distance;
|
||||||
|
|
||||||
|
@Schema(description = "建设状态 0=规划,1=在建,2=已建")
|
||||||
|
private String bldsttCode;
|
||||||
|
|
||||||
|
@Schema(description = "沿程排序")
|
||||||
|
private Integer siteStepSort;
|
||||||
|
|
||||||
|
@Schema(description = "流域排序")
|
||||||
|
private Integer rvcdStepSort;
|
||||||
|
|
||||||
|
@Schema(description = "电站排序")
|
||||||
|
private Integer rstcdStepSort;
|
||||||
|
|
||||||
|
@Schema(description = "基地排序")
|
||||||
|
private Integer baseStepSort;
|
||||||
|
}
|
||||||
@ -7,6 +7,7 @@ import com.yfd.platform.qgc_eng.eq.entity.vo.EngEqBaseVmsstbprptVo;
|
|||||||
import com.yfd.platform.qgc_eng.eq.entity.vo.EngEqDayDataVo;
|
import com.yfd.platform.qgc_eng.eq.entity.vo.EngEqDayDataVo;
|
||||||
import com.yfd.platform.qgc_eng.eq.entity.vo.EngEqDrtpDataVo;
|
import com.yfd.platform.qgc_eng.eq.entity.vo.EngEqDrtpDataVo;
|
||||||
import com.yfd.platform.qgc_eng.eq.entity.vo.EngEqDayIntervalVo;
|
import com.yfd.platform.qgc_eng.eq.entity.vo.EngEqDayIntervalVo;
|
||||||
|
import com.yfd.platform.qgc_eng.eq.entity.vo.EngEqdsVo;
|
||||||
import com.yfd.platform.qgc_eng.eq.entity.vo.EngEqHourIntervalVo;
|
import com.yfd.platform.qgc_eng.eq.entity.vo.EngEqHourIntervalVo;
|
||||||
import com.yfd.platform.qgc_eng.eq.entity.vo.EngEqIntervalVo;
|
import com.yfd.platform.qgc_eng.eq.entity.vo.EngEqIntervalVo;
|
||||||
import com.yfd.platform.qgc_eng.eq.entity.vo.EngEqLimitQueryVo;
|
import com.yfd.platform.qgc_eng.eq.entity.vo.EngEqLimitQueryVo;
|
||||||
@ -65,4 +66,6 @@ public interface EngEqDataService {
|
|||||||
DataSourceResult<String> getDefaultYear(DataSourceRequest dataSourceRequest);
|
DataSourceResult<String> getDefaultYear(DataSourceRequest dataSourceRequest);
|
||||||
|
|
||||||
StcdInfoVo getStInfoByStcd(String stcd);
|
StcdInfoVo getStInfoByStcd(String stcd);
|
||||||
|
|
||||||
|
DataSourceResult<EngEqdsVo> getEqdsKendoListCust(DataSourceRequest dataSourceRequest);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -18,6 +18,7 @@ import com.yfd.platform.qgc_eng.eq.entity.vo.EngEqDataVo;
|
|||||||
import com.yfd.platform.qgc_eng.eq.entity.vo.EngEqDayDataVo;
|
import com.yfd.platform.qgc_eng.eq.entity.vo.EngEqDayDataVo;
|
||||||
import com.yfd.platform.qgc_eng.eq.entity.vo.EngEqDrtpDataVo;
|
import com.yfd.platform.qgc_eng.eq.entity.vo.EngEqDrtpDataVo;
|
||||||
import com.yfd.platform.qgc_eng.eq.entity.vo.EngEqDayIntervalVo;
|
import com.yfd.platform.qgc_eng.eq.entity.vo.EngEqDayIntervalVo;
|
||||||
|
import com.yfd.platform.qgc_eng.eq.entity.vo.EngEqdsVo;
|
||||||
import com.yfd.platform.qgc_eng.eq.entity.vo.EngEqLimitQueryVo;
|
import com.yfd.platform.qgc_eng.eq.entity.vo.EngEqLimitQueryVo;
|
||||||
import com.yfd.platform.qgc_eng.eq.entity.vo.EngEqLimitVo;
|
import com.yfd.platform.qgc_eng.eq.entity.vo.EngEqLimitVo;
|
||||||
import com.yfd.platform.qgc_eng.eq.entity.vo.EngFidVo;
|
import com.yfd.platform.qgc_eng.eq.entity.vo.EngFidVo;
|
||||||
@ -36,6 +37,7 @@ import com.yfd.platform.qgc_eng.eq.entity.vo.WbsbVo;
|
|||||||
import com.yfd.platform.qgc_eng.eq.entity.vo.StBaseInfo;
|
import com.yfd.platform.qgc_eng.eq.entity.vo.StBaseInfo;
|
||||||
import com.yfd.platform.qgc_eng.eq.entity.vo.StcdInfoVo;
|
import com.yfd.platform.qgc_eng.eq.entity.vo.StcdInfoVo;
|
||||||
import com.yfd.platform.qgc_eng.eq.service.EngEqDataService;
|
import com.yfd.platform.qgc_eng.eq.service.EngEqDataService;
|
||||||
|
import com.yfd.platform.qgc_env.wt.utils.SiteAvoidanceUtils;
|
||||||
import com.yfd.platform.utils.QgcQueryWrapperUtil;
|
import com.yfd.platform.utils.QgcQueryWrapperUtil;
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
@ -5496,6 +5498,7 @@ public class EngEqDataServiceImpl implements EngEqDataService {
|
|||||||
case "bldsttCcode" -> "t.bldsttCcode";
|
case "bldsttCcode" -> "t.bldsttCcode";
|
||||||
case "dtinEnv" -> "t.dtinEnv";
|
case "dtinEnv" -> "t.dtinEnv";
|
||||||
case "DTIN" -> "t.dtin";
|
case "DTIN" -> "t.dtin";
|
||||||
|
case "dtin" -> "t.dtin";
|
||||||
case "runState" -> "t.runState";
|
case "runState" -> "t.runState";
|
||||||
case "baseStepSort" -> "NVL(t.baseStepSort, 999999)";
|
case "baseStepSort" -> "NVL(t.baseStepSort, 999999)";
|
||||||
case "rvcdStepSort" -> "NVL(t.rvcdStepSort, 999999)";
|
case "rvcdStepSort" -> "NVL(t.rvcdStepSort, 999999)";
|
||||||
@ -5889,4 +5892,123 @@ public class EngEqDataServiceImpl implements EngEqDataService {
|
|||||||
}
|
}
|
||||||
return dataSourceResult;
|
return dataSourceResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public DataSourceResult<EngEqdsVo> getEqdsKendoListCust(DataSourceRequest dataSourceRequest) {
|
||||||
|
DataSourceResult<EngEqdsVo> dataSourceResult = new DataSourceResult<>();
|
||||||
|
dataSourceResult.setAggregates(new HashMap<>());
|
||||||
|
|
||||||
|
if (dataSourceRequest == null) {
|
||||||
|
dataSourceResult.setData(new ArrayList<>());
|
||||||
|
dataSourceResult.setTotal(0L);
|
||||||
|
return dataSourceResult;
|
||||||
|
}
|
||||||
|
|
||||||
|
StringBuilder sql = new StringBuilder();
|
||||||
|
sql.append("SELECT ")
|
||||||
|
.append("a.STCD AS stcd, ")
|
||||||
|
.append("a.STNM AS stnm, ")
|
||||||
|
.append("a.RSTCD AS rstcd, ")
|
||||||
|
.append("eng.ENNM AS ennm, ")
|
||||||
|
.append("a.STTP AS sttp, ")
|
||||||
|
.append("a.BASE_ID AS baseId, ")
|
||||||
|
.append("a.LGTD AS lgtd, ")
|
||||||
|
.append("a.LTTD AS lttd, ")
|
||||||
|
.append("a.ELEV AS dtmel, ")
|
||||||
|
.append("a.BLDSTT_CODE AS bldsttCode, ")
|
||||||
|
// .append("a.RVCD AS rvcd, ")
|
||||||
|
// .append("a.ADDVCD AS addvcd, ")
|
||||||
|
.append("NVL(siteSort.SORT, 999999) AS siteStepSort, ")
|
||||||
|
.append("NVL(along.ORDER_INDEX, 999999) AS rvcdStepSort, ")
|
||||||
|
.append("NVL(rstSort.SORT, 999999) AS rstcdStepSort, ")
|
||||||
|
.append("NVL(hb.ORDER_INDEX, 999999) AS baseStepSort ")
|
||||||
|
.append("FROM SD_EQ_B_H a ")
|
||||||
|
.append("LEFT JOIN SD_ENGINFO_B_H eng ON eng.STCD = a.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("LEFT JOIN MS_ALONG_B along ON along.RVCD = eng.HBRVCD AND along.CODE = 'common' AND NVL(along.IS_DELETED, 0) = 0 ")
|
||||||
|
.append("LEFT JOIN ( ")
|
||||||
|
.append(" SELECT det.SORT, cfg.RVCD, det.STCD ")
|
||||||
|
.append(" FROM MS_ALONGDET_B det ")
|
||||||
|
.append(" INNER JOIN MS_ALONG_B cfg ON det.ALONG_ID = cfg.ID ")
|
||||||
|
.append(" WHERE NVL(det.IS_DELETED, 0) = 0 AND NVL(cfg.IS_DELETED, 0) = 0 AND cfg.CODE = 'common' ")
|
||||||
|
.append(") rstSort ON rstSort.RVCD = eng.HBRVCD AND rstSort.STCD = a.RSTCD ")
|
||||||
|
.append("LEFT JOIN ( ")
|
||||||
|
.append(" SELECT det.SORT, cfg.RVCD, det.STCD ")
|
||||||
|
.append(" FROM MS_ALONGDET_B det ")
|
||||||
|
.append(" INNER JOIN MS_ALONG_B cfg ON det.ALONG_ID = cfg.ID ")
|
||||||
|
.append(" WHERE NVL(det.IS_DELETED, 0) = 0 AND NVL(cfg.IS_DELETED, 0) = 0 AND cfg.CODE = 'common' ")
|
||||||
|
.append(") siteSort ON siteSort.RVCD = eng.HBRVCD AND siteSort.STCD = a.STCD ")
|
||||||
|
.append("WHERE NVL(a.IS_DELETED, 0) = 0 ")
|
||||||
|
.append("AND NVL(a.USFL, 1) = 1 ")
|
||||||
|
.append("AND a.LGTD IS NOT NULL ")
|
||||||
|
.append("AND a.LTTD IS NOT NULL ")
|
||||||
|
.append("AND a.STTP IN (SELECT STTP_CODE FROM SD_STTP_B WHERE DESCRIPTION = 'EQ') ")
|
||||||
|
.append("AND a.RSTCD IS NOT NULL ")
|
||||||
|
.append("ORDER BY NVL(siteSort.SORT, 999999), NVL(along.ORDER_INDEX, 999999), NVL(rstSort.SORT, 999999), NVL(hb.ORDER_INDEX, 999999), a.STNM ");
|
||||||
|
|
||||||
|
DataSourceLoadOptionsBase loadOptions = dataSourceRequest.toDevRequest();
|
||||||
|
Page<?> page = loadOptions == null ? null : QgcQueryWrapperUtil.buildPage(loadOptions, loadOptions.getSkip(), loadOptions.getTake());
|
||||||
|
List<EngEqdsVo> eqdsVoList = microservicDynamicSQLMapper.pageAllListWithResultType(page, sql.toString(), new HashMap<>(), EngEqdsVo.class);
|
||||||
|
|
||||||
|
List<EngEqdsVo> resultList = new ArrayList<>();
|
||||||
|
for (EngEqdsVo eqdsVo : eqdsVoList) {
|
||||||
|
String sttpCode = eqdsVo.getSttp();
|
||||||
|
List<String> sttpCodeSplit = StrUtil.split(sttpCode, "_");
|
||||||
|
eqdsVo.setSttpMap(sttpCodeSplit.get(0));
|
||||||
|
eqdsVo.setEqtp(Integer.valueOf(sttpCodeSplit.get(1)));
|
||||||
|
eqdsVo.setSttp(sttpCodeSplit.get(0));
|
||||||
|
eqdsVo.setTitleName(eqdsVo.getStnm());
|
||||||
|
|
||||||
|
String bldsttCode = eqdsVo.getBldsttCode();
|
||||||
|
if ("2".equals(bldsttCode)) {
|
||||||
|
eqdsVo.setAnchoPointState(sttpCode);
|
||||||
|
} else {
|
||||||
|
eqdsVo.setAnchoPointState(sttpCode + "_incomplete");
|
||||||
|
}
|
||||||
|
|
||||||
|
eqdsVo.setSttpCode("EQ");
|
||||||
|
|
||||||
|
String rstcd = eqdsVo.getRstcd();
|
||||||
|
if (rstcd != null && rstcd.contains(",")) {
|
||||||
|
EngEqdsVo eqdsVoNew = new EngEqdsVo();
|
||||||
|
eqdsVoNew.setStcd(eqdsVo.getStcd());
|
||||||
|
eqdsVoNew.setStnm(eqdsVo.getStnm());
|
||||||
|
eqdsVoNew.setSttp(eqdsVo.getSttp());
|
||||||
|
eqdsVoNew.setSttpMap(eqdsVo.getSttpMap());
|
||||||
|
eqdsVoNew.setSttpCode(eqdsVo.getSttpCode());
|
||||||
|
eqdsVoNew.setEqtp(eqdsVo.getEqtp());
|
||||||
|
eqdsVoNew.setAnchoPointState(eqdsVo.getAnchoPointState());
|
||||||
|
eqdsVoNew.setTitleName(eqdsVo.getTitleName());
|
||||||
|
eqdsVoNew.setLgtd(eqdsVo.getLgtd());
|
||||||
|
eqdsVoNew.setLttd(eqdsVo.getLttd());
|
||||||
|
eqdsVoNew.setDtmel(eqdsVo.getDtmel());
|
||||||
|
eqdsVoNew.setBaseId(eqdsVo.getBaseId());
|
||||||
|
eqdsVoNew.setBldsttCode(eqdsVo.getBldsttCode());
|
||||||
|
|
||||||
|
List<String> stcdSplit = StrUtil.split(rstcd, ',');
|
||||||
|
eqdsVo.setRstcd(stcdSplit.get(0));
|
||||||
|
eqdsVoNew.setRstcd(stcdSplit.get(1));
|
||||||
|
|
||||||
|
String ennm = eqdsVo.getEnnm();
|
||||||
|
if (ennm != null && ennm.contains(",")) {
|
||||||
|
List<String> ennmSplit = StrUtil.split(ennm, ',');
|
||||||
|
eqdsVo.setEnnm(ennmSplit.get(0));
|
||||||
|
eqdsVoNew.setEnnm(ennmSplit.get(1));
|
||||||
|
}
|
||||||
|
resultList.add(eqdsVoNew);
|
||||||
|
}
|
||||||
|
resultList.add(eqdsVo);
|
||||||
|
}
|
||||||
|
|
||||||
|
SiteAvoidanceUtils.calcSiteMapLev(resultList,
|
||||||
|
EngEqdsVo::getStcd,
|
||||||
|
EngEqdsVo::getLgtd,
|
||||||
|
EngEqdsVo::getLttd,
|
||||||
|
EngEqdsVo::getAnchoPointState,
|
||||||
|
EngEqdsVo::setDistance);
|
||||||
|
|
||||||
|
dataSourceResult.setData(resultList);
|
||||||
|
dataSourceResult.setTotal(page == null ? resultList.size() : page.getTotal());
|
||||||
|
return dataSourceResult;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4643,8 +4643,8 @@ public class FbStationServiceImpl implements FbStationService {
|
|||||||
.append(" SELECT t.RSTCD AS stcd, COUNT(1) AS lcjStatus ")
|
.append(" SELECT t.RSTCD AS stcd, COUNT(1) AS lcjStatus ")
|
||||||
.append(" FROM SD_ENGFR_R t ")
|
.append(" FROM SD_ENGFR_R t ")
|
||||||
.append(" INNER JOIN SD_RPIMNFISH_R t1 ON t.ID = t1.RPIMN_ID ")
|
.append(" INNER JOIN SD_RPIMNFISH_R t1 ON t.ID = t1.RPIMN_ID ")
|
||||||
.append(" WHERE (t.TASK_STATUS IS NULL OR t.TASK_STATUS = 'Approved') ")
|
.append(" WHERE 1=1 ")
|
||||||
.append(" AND NVL(t.IS_DELETED, 0) = 0 AND NVL(t1.IS_DELETED, 0) = 0 ")
|
.append(" AND t.IS_DELETED = 0 AND t1.IS_DELETED = 0 ")
|
||||||
.append(" AND t.TM BETWEEN ADD_MONTHS(SYSDATE, -12) AND SYSDATE ")
|
.append(" AND t.TM BETWEEN ADD_MONTHS(SYSDATE, -12) AND SYSDATE ")
|
||||||
.append(" GROUP BY t.RSTCD ")
|
.append(" GROUP BY t.RSTCD ")
|
||||||
.append(") b ON a.STCD = b.stcd ")
|
.append(") b ON a.STCD = b.stcd ")
|
||||||
@ -4654,21 +4654,32 @@ public class FbStationServiceImpl implements FbStationService {
|
|||||||
|
|
||||||
Map<String, Object> paramMap = new HashMap<>();
|
Map<String, Object> paramMap = new HashMap<>();
|
||||||
|
|
||||||
if (StrUtil.isNotEmpty(sttp)) {
|
// if (StrUtil.isNotEmpty(sttp)) {
|
||||||
sql.append(" AND a.STTP = :sttp ");
|
// sql.append(" AND a.STTP = #{sttp} ");
|
||||||
paramMap.put("sttp", sttp);
|
// paramMap.put("sttp", sttp);
|
||||||
}
|
// }
|
||||||
if (StrUtil.isNotEmpty(rstcd)) {
|
// if (StrUtil.isNotEmpty(rstcd)) {
|
||||||
sql.append(" AND a.RSTCD LIKE '%' || :rstcd || '%' ");
|
// sql.append(" AND a.RSTCD LIKE '%' || #{rstcd} || '%' ");
|
||||||
paramMap.put("rstcd", rstcd);
|
// paramMap.put("rstcd", rstcd);
|
||||||
}
|
// }
|
||||||
if (StrUtil.isNotEmpty(bldsttCcode)) {
|
// if (StrUtil.isNotEmpty(bldsttCcode)) {
|
||||||
sql.append(" AND a.BLDSTT_CODE = :bldsttCcode ");
|
// sql.append(" AND a.BLDSTT_CODE = #{bldsttCcode} ");
|
||||||
paramMap.put("bldsttCcode", Integer.parseInt(bldsttCcode));
|
// paramMap.put("bldsttCcode", Integer.parseInt(bldsttCcode));
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
String filterSql = QgcQueryWrapperUtil.buildFilterCondition(
|
||||||
|
dataSourceRequest == null ? null : dataSourceRequest.getFilter(),
|
||||||
|
paramMap,
|
||||||
|
new int[]{0},
|
||||||
|
this::mapWeFvColumn
|
||||||
|
);
|
||||||
|
if (StrUtil.isNotBlank(filterSql)) {
|
||||||
|
sql.append("AND ").append(filterSql).append(" ");
|
||||||
}
|
}
|
||||||
|
|
||||||
sql.append(" ORDER BY NVL(siteSort.SORT, 999999) ASC ");
|
sql.append(" ORDER BY NVL(siteSort.SORT, 999999) ASC ");
|
||||||
|
|
||||||
Page<?> page = devRequest == null ? null : QgcQueryWrapperUtil.buildPage(devRequest, devRequest.getSkip(), devRequest.getTake());
|
Page<?> page = devRequest == null ? null : QgcQueryWrapperUtil.buildPage(devRequest, devRequest.getSkip(), devRequest.getTake());
|
||||||
List<FbTracingPointVo> list = microservicDynamicSQLMapper.pageAllListWithResultType(page, sql.toString(), paramMap, FbTracingPointVo.class);
|
List<FbTracingPointVo> list = microservicDynamicSQLMapper.pageAllListWithResultType(page, sql.toString(), paramMap, FbTracingPointVo.class);
|
||||||
|
|
||||||
@ -4686,6 +4697,21 @@ public class FbStationServiceImpl implements FbStationService {
|
|||||||
return dataSourceResult;
|
return dataSourceResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private String mapWeFvColumn(String field) {
|
||||||
|
if (StrUtil.isBlank(field)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return switch (field.toLowerCase()) {
|
||||||
|
case "rstcd" -> "a.RSTCD";
|
||||||
|
case "stcd" -> "a.STCD";
|
||||||
|
case "sttp" -> "a.STTP";
|
||||||
|
case "bldsttccode" -> "a.BLDSTT_CODE";
|
||||||
|
case "lgtd" -> "a.LGTD";
|
||||||
|
default -> null;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private List<FbTracingPointVo> getPointLegend(List<FbTracingPointVo> voList) {
|
private List<FbTracingPointVo> getPointLegend(List<FbTracingPointVo> voList) {
|
||||||
for (FbTracingPointVo pointVo : voList) {
|
for (FbTracingPointVo pointVo : voList) {
|
||||||
Integer bldstt = pointVo.getBldstt();
|
Integer bldstt = pointVo.getBldstt();
|
||||||
|
|||||||
@ -71,4 +71,16 @@ public class FhHabitatController {
|
|||||||
public ResponseResult getStTbYsBVoKendoListCust(@RequestBody DataSourceRequest dataSourceRequest) {
|
public ResponseResult getStTbYsBVoKendoListCust(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||||
return ResponseResult.successData(fhHabitatService.getStTbYsBVoKendoListCust(dataSourceRequest));
|
return ResponseResult.successData(fhHabitatService.getStTbYsBVoKendoListCust(dataSourceRequest));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping("/fhvap/GetKendoListCust")
|
||||||
|
@Operation(summary = "栖息地/珍稀植物园/动物救助站描点")
|
||||||
|
public ResponseResult getFhvapKendoListCust(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||||
|
return ResponseResult.successData(fhHabitatService.getFhvapKendoListCust(dataSourceRequest));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/fhvap/fhPoint/GetKendoListCust")
|
||||||
|
@Operation(summary = "栖息地关联站点描点")
|
||||||
|
public ResponseResult getFhPoint(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||||
|
return ResponseResult.successData(fhHabitatService.getFhPoint(dataSourceRequest));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,28 @@
|
|||||||
|
package com.yfd.platform.qgc_env.fh.entity.vo;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class FhHaVapVo {
|
||||||
|
private String baseId;
|
||||||
|
private String baseName;
|
||||||
|
private String stcd;
|
||||||
|
private String stnm;
|
||||||
|
private String sttp;
|
||||||
|
private String sttpCode;
|
||||||
|
private String sttpMap;
|
||||||
|
private String anchoPointState;
|
||||||
|
private String rstcd;
|
||||||
|
private String ennm;
|
||||||
|
private String rvcd;
|
||||||
|
private String rvcdName;
|
||||||
|
private BigDecimal lgtd;
|
||||||
|
private BigDecimal lttd;
|
||||||
|
private String bldsttCcode;
|
||||||
|
private BigDecimal dtmel;
|
||||||
|
private Integer dtin;
|
||||||
|
private Integer distance;
|
||||||
|
private String titleName;
|
||||||
|
}
|
||||||
@ -0,0 +1,67 @@
|
|||||||
|
package com.yfd.platform.qgc_env.fh.entity.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Accessors(chain = true)
|
||||||
|
@Schema(description = "栖息地关联站点描点")
|
||||||
|
public class FhPointVo implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@Schema(description = "所属栖息地编码")
|
||||||
|
private String fhstcd;
|
||||||
|
|
||||||
|
@Schema(description = "站码")
|
||||||
|
private String stcd;
|
||||||
|
|
||||||
|
@Schema(description = "站名")
|
||||||
|
private String stnm;
|
||||||
|
|
||||||
|
@Schema(description = "所属电站名称")
|
||||||
|
private String ennm;
|
||||||
|
|
||||||
|
@Schema(description = "经度")
|
||||||
|
private BigDecimal lgtd;
|
||||||
|
|
||||||
|
@Schema(description = "纬度")
|
||||||
|
private BigDecimal lttd;
|
||||||
|
|
||||||
|
@Schema(description = "基地编码")
|
||||||
|
private String baseId;
|
||||||
|
|
||||||
|
@Schema(description = "基地名称")
|
||||||
|
private String baseName;
|
||||||
|
|
||||||
|
@Schema(description = "所属流域编码")
|
||||||
|
private String rvcd;
|
||||||
|
|
||||||
|
@Schema(description = "所属流域名称")
|
||||||
|
private String rvcdName;
|
||||||
|
|
||||||
|
@Schema(description = "所属电站编码")
|
||||||
|
private String rstcd;
|
||||||
|
|
||||||
|
@Schema(description = "所属站类编码")
|
||||||
|
private String sttpCode;
|
||||||
|
|
||||||
|
@Schema(description = "基面高程")
|
||||||
|
private BigDecimal dtmel;
|
||||||
|
|
||||||
|
@Schema(description = "是否接入")
|
||||||
|
private Integer dtin;
|
||||||
|
|
||||||
|
@Schema(description = "建设状态分类")
|
||||||
|
private String bldsttCcode;
|
||||||
|
|
||||||
|
@Schema(description = "描点状态")
|
||||||
|
private String anchoPointState;
|
||||||
|
|
||||||
|
@Schema(description = "出入库标识(1 入库水温, 2 出库水温, 3 非出入库水温)")
|
||||||
|
private Integer ioType;
|
||||||
|
}
|
||||||
@ -5,6 +5,8 @@ import com.yfd.platform.common.DataSourceResult;
|
|||||||
import com.yfd.platform.qgc_env.fh.entity.ao.FhDefaultAo;
|
import com.yfd.platform.qgc_env.fh.entity.ao.FhDefaultAo;
|
||||||
import com.yfd.platform.qgc_env.fh.entity.vo.FhBaseInfoVo;
|
import com.yfd.platform.qgc_env.fh.entity.vo.FhBaseInfoVo;
|
||||||
import com.yfd.platform.qgc_env.fh.entity.vo.FhDefaultVo;
|
import com.yfd.platform.qgc_env.fh.entity.vo.FhDefaultVo;
|
||||||
|
import com.yfd.platform.qgc_env.fh.entity.vo.FhHaVapVo;
|
||||||
|
import com.yfd.platform.qgc_env.fh.entity.vo.FhPointVo;
|
||||||
import com.yfd.platform.qgc_env.fh.entity.vo.HabitatVo;
|
import com.yfd.platform.qgc_env.fh.entity.vo.HabitatVo;
|
||||||
|
|
||||||
public interface FhHabitatService {
|
public interface FhHabitatService {
|
||||||
@ -24,4 +26,8 @@ public interface FhHabitatService {
|
|||||||
FhBaseInfoVo getStcdInfo(String stcd);
|
FhBaseInfoVo getStcdInfo(String stcd);
|
||||||
|
|
||||||
DataSourceResult getStTbYsBVoKendoListCust(DataSourceRequest dataSourceRequest);
|
DataSourceResult getStTbYsBVoKendoListCust(DataSourceRequest dataSourceRequest);
|
||||||
|
|
||||||
|
DataSourceResult<FhHaVapVo> getFhvapKendoListCust(DataSourceRequest dataSourceRequest);
|
||||||
|
|
||||||
|
DataSourceResult<FhPointVo> getFhPoint(DataSourceRequest dataSourceRequest);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -16,11 +16,14 @@ import com.yfd.platform.common.exception.BizException;
|
|||||||
import com.yfd.platform.qgc_env.fh.entity.ao.FhDefaultAo;
|
import com.yfd.platform.qgc_env.fh.entity.ao.FhDefaultAo;
|
||||||
import com.yfd.platform.qgc_env.fh.entity.vo.FhBaseInfoVo;
|
import com.yfd.platform.qgc_env.fh.entity.vo.FhBaseInfoVo;
|
||||||
import com.yfd.platform.qgc_env.fh.entity.vo.FhDefaultVo;
|
import com.yfd.platform.qgc_env.fh.entity.vo.FhDefaultVo;
|
||||||
|
import com.yfd.platform.qgc_env.fh.entity.vo.FhHaVapVo;
|
||||||
|
import com.yfd.platform.qgc_env.fh.entity.vo.FhPointVo;
|
||||||
import com.yfd.platform.qgc_env.fh.entity.vo.HabitatVo;
|
import com.yfd.platform.qgc_env.fh.entity.vo.HabitatVo;
|
||||||
import com.yfd.platform.qgc_env.fh.entity.vo.FhMsstbprptVo;
|
import com.yfd.platform.qgc_env.fh.entity.vo.FhMsstbprptVo;
|
||||||
import com.yfd.platform.qgc_env.fh.entity.vo.FhSdriverdayVo;
|
import com.yfd.platform.qgc_env.fh.entity.vo.FhSdriverdayVo;
|
||||||
import com.yfd.platform.qgc_env.fh.entity.vo.FhSdrvwtsVo;
|
import com.yfd.platform.qgc_env.fh.entity.vo.FhSdrvwtsVo;
|
||||||
import com.yfd.platform.qgc_env.fh.service.FhHabitatService;
|
import com.yfd.platform.qgc_env.fh.service.FhHabitatService;
|
||||||
|
import com.yfd.platform.qgc_env.wt.utils.SiteAvoidanceUtils;
|
||||||
import com.yfd.platform.qgc_env.wq.entity.vo.StTbYsVo;
|
import com.yfd.platform.qgc_env.wq.entity.vo.StTbYsVo;
|
||||||
import com.yfd.platform.utils.QgcQueryWrapperUtil;
|
import com.yfd.platform.utils.QgcQueryWrapperUtil;
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
@ -1920,4 +1923,233 @@ public class FhHabitatServiceImpl implements FhHabitatService {
|
|||||||
}
|
}
|
||||||
return sql.toString();
|
return sql.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public DataSourceResult<FhHaVapVo> getFhvapKendoListCust(DataSourceRequest dataSourceRequest) {
|
||||||
|
DataSourceResult<FhHaVapVo> dataSourceResult = new DataSourceResult<>();
|
||||||
|
dataSourceResult.setAggregates(new HashMap<>());
|
||||||
|
|
||||||
|
if (dataSourceRequest == null) {
|
||||||
|
dataSourceResult.setData(new ArrayList<>());
|
||||||
|
dataSourceResult.setTotal(0L);
|
||||||
|
return dataSourceResult;
|
||||||
|
}
|
||||||
|
Map<String, Object> paramMap = new HashMap<>();
|
||||||
|
StringBuilder sql = new StringBuilder();
|
||||||
|
sql.append("SELECT ")
|
||||||
|
.append("t.BASE_ID AS baseId, ")
|
||||||
|
.append("hb.BASENAME AS baseName, ")
|
||||||
|
.append("t.STCD AS stcd, ")
|
||||||
|
.append("t.STNM AS stnm, ")
|
||||||
|
.append("t.STTP_CODE AS sttp, ")
|
||||||
|
.append("t.STTP_CODE AS sttpCode, ")
|
||||||
|
.append("t.STTP_CODE AS sttpMap, ")
|
||||||
|
.append("t.STTP_CODE AS anchoPointState, ")
|
||||||
|
.append("t.RSTCD AS rstcd, ")
|
||||||
|
.append("eng.ENNM AS ennm, ")
|
||||||
|
.append("NVL(t.HBRVCD, eng.HBRVCD) AS rvcd, ")
|
||||||
|
.append("t.LGTD AS lgtd, ")
|
||||||
|
.append("t.LTTD AS lttd, ")
|
||||||
|
.append("t.BLDSTT_CCODE AS bldsttCcode, ")
|
||||||
|
.append("t.ELEV AS dtmel, ")
|
||||||
|
.append("t.DTIN AS dtin ")
|
||||||
|
.append("FROM ( ")
|
||||||
|
.append(" SELECT STCD, STNM, 'FH' AS STTP_CODE, RSTCD, BASE_ID, HBRVCD, LGTD, LTTD, BLPRD AS BLDSTT_CCODE, ELEV, DTIN ")
|
||||||
|
.append(" FROM SD_FHBT_B_H WHERE NVL(IS_DELETED, 0) = 0 AND USFL = 1 ")
|
||||||
|
.append(" UNION ALL ")
|
||||||
|
.append(" SELECT STCD, STNM, STTP AS STTP_CODE, RSTCD, BASE_ID, HBRVCD, LGTD, LTTD, BLDSTT_CODE AS BLDSTT_CCODE, ELEV, DTIN ")
|
||||||
|
.append(" FROM SD_VA_B_H WHERE NVL(IS_DELETED, 0) = 0 AND USFL = 1 ")
|
||||||
|
.append(" UNION ALL ")
|
||||||
|
.append(" SELECT STCD, STNM, STTP AS STTP_CODE, RSTCD, BASE_ID, HBRVCD, LGTD, LTTD, BLDSTT_CODE AS BLDSTT_CCODE, ELEV, DTIN ")
|
||||||
|
.append(" FROM SD_VP_B_H WHERE NVL(IS_DELETED, 0) = 0 AND USFL = 1 ")
|
||||||
|
.append(") t ")
|
||||||
|
.append("LEFT JOIN SD_ENGINFO_B_H eng ON eng.STCD = t.RSTCD AND NVL(eng.IS_DELETED, 0) = 0 ")
|
||||||
|
.append("LEFT JOIN SD_HYDROBASE hb ON hb.BASEID = NVL(t.BASE_ID, eng.BASE_ID) AND NVL(hb.IS_DELETED, 0) = 0 ")
|
||||||
|
.append("WHERE t.LGTD IS NOT NULL AND t.LTTD IS NOT NULL ");
|
||||||
|
|
||||||
|
DataSourceLoadOptionsBase loadOptions = dataSourceRequest.toDevRequest();
|
||||||
|
String filterSql = QgcQueryWrapperUtil.buildFilterCondition(
|
||||||
|
dataSourceRequest == null ? null : dataSourceRequest.getFilter(),
|
||||||
|
paramMap,
|
||||||
|
new int[]{0},
|
||||||
|
this::mapWeFvColumn
|
||||||
|
);
|
||||||
|
if (StrUtil.isNotBlank(filterSql)) {
|
||||||
|
sql.append("AND ").append(filterSql).append(" ");
|
||||||
|
}
|
||||||
|
Page<?> page = loadOptions == null ? null : QgcQueryWrapperUtil.buildPage(loadOptions, loadOptions.getSkip(), loadOptions.getTake());
|
||||||
|
List<FhHaVapVo> vaVpList = microservicDynamicSQLMapper.pageAllListWithResultType(page, sql.toString(), paramMap, FhHaVapVo.class);
|
||||||
|
|
||||||
|
for (FhHaVapVo vo : vaVpList) {
|
||||||
|
String bldsttCcode = vo.getBldsttCcode();
|
||||||
|
if (!"2".equals(bldsttCcode)) {
|
||||||
|
if ("VP".equals(vo.getSttp())) {
|
||||||
|
vo.setAnchoPointState("VP_INCOMPLETE");
|
||||||
|
} else if ("VA".equals(vo.getSttp())) {
|
||||||
|
vo.setAnchoPointState("VA_INCOMPLETE");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
vo.setTitleName(vo.getStnm());
|
||||||
|
vo.setSttpCode(vo.getSttp());
|
||||||
|
}
|
||||||
|
|
||||||
|
SiteAvoidanceUtils.calcSiteMapLev(vaVpList,
|
||||||
|
FhHaVapVo::getStcd,
|
||||||
|
FhHaVapVo::getLgtd,
|
||||||
|
FhHaVapVo::getLttd,
|
||||||
|
FhHaVapVo::getAnchoPointState,
|
||||||
|
FhHaVapVo::setDistance);
|
||||||
|
|
||||||
|
dataSourceResult.setData(vaVpList);
|
||||||
|
dataSourceResult.setTotal(page == null ? vaVpList.size() : page.getTotal());
|
||||||
|
return dataSourceResult;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public DataSourceResult<FhPointVo> getFhPoint(DataSourceRequest dataSourceRequest) {
|
||||||
|
DataSourceResult<FhPointVo> result = new DataSourceResult<>();
|
||||||
|
result.setAggregates(new HashMap<>());
|
||||||
|
|
||||||
|
DataSourceLoadOptionsBase loadOptions = dataSourceRequest == null ? null : dataSourceRequest.toDevRequest();
|
||||||
|
Map<String, Object> paramMap = new HashMap<>();
|
||||||
|
StringBuilder sql = new StringBuilder();
|
||||||
|
sql.append("SELECT ")
|
||||||
|
.append("t.fhstcd AS fhstcd, ")
|
||||||
|
.append("t.stcd AS stcd, ")
|
||||||
|
.append("t.stnm AS stnm, ")
|
||||||
|
.append("eng.ENNM AS ennm, ")
|
||||||
|
.append("t.lgtd AS lgtd, ")
|
||||||
|
.append("t.lttd AS lttd, ")
|
||||||
|
.append("t.baseId AS baseId, ")
|
||||||
|
.append("hb.BASENAME AS baseName, ")
|
||||||
|
.append("t.rvcd AS rvcd, ")
|
||||||
|
.append("rv.RVNM AS rvcdName, ")
|
||||||
|
.append("t.rstcd AS rstcd, ")
|
||||||
|
.append("t.sttpCode AS sttpCode, ")
|
||||||
|
.append("t.dtmel AS dtmel, ")
|
||||||
|
.append("t.dtin AS dtin, ")
|
||||||
|
.append("t.bldsttCcode AS bldsttCcode, ")
|
||||||
|
.append("t.ioType AS ioType ")
|
||||||
|
.append("FROM (")
|
||||||
|
.append("SELECT fh.STCD AS fhstcd, wq.STCD AS stcd, wq.STNM AS stnm, ")
|
||||||
|
.append(" wq.LGTD AS lgtd, wq.LTTD AS lttd, fh.BASE_ID AS baseId, ")
|
||||||
|
.append(" null AS rvcd, wq.RSTCD AS rstcd, ")
|
||||||
|
.append(" 'WQ' AS sttpCode, wq.ELEV AS dtmel, wq.DTIN AS dtin, ")
|
||||||
|
.append(" TO_CHAR(wq.BLDSTT_CODE) AS bldsttCcode, CAST(NULL AS NUMBER) AS ioType ")
|
||||||
|
.append("FROM SD_FHBT_B_H fh ")
|
||||||
|
.append("INNER JOIN SD_WQ_B_H wq ON fh.STCD = wq.FHSTCD ")
|
||||||
|
.append("WHERE NVL(fh.IS_DELETED, 0) = 0 ")
|
||||||
|
.append(" AND NVL(wq.IS_DELETED, 0) = 0 ")
|
||||||
|
.append(" AND fh.BASE_ID <> 'other' ")
|
||||||
|
.append(" AND wq.LGTD IS NOT NULL ")
|
||||||
|
.append("UNION ALL ")
|
||||||
|
.append("SELECT fh.STCD AS fhstcd, wt.STCD AS stcd, wt.STNM AS stnm, ")
|
||||||
|
.append(" wt.LGTD AS lgtd, wt.LTTD AS lttd, fh.BASE_ID AS baseId, ")
|
||||||
|
.append(" NVL(fh.RVCD, engWt.RVCD) AS rvcd, wt.RSTCD AS rstcd, ")
|
||||||
|
.append(" 'WTRV' AS sttpCode, wt.ELEV AS dtmel, wt.DTIN AS dtin, ")
|
||||||
|
.append(" TO_CHAR(wt.BLDSTT_CODE) AS bldsttCcode, ")
|
||||||
|
.append(" CASE WHEN wt.WT_TYPE = 'IWT' THEN 1 ")
|
||||||
|
.append(" WHEN wt.WT_TYPE = 'DWT' THEN 2 ")
|
||||||
|
.append(" ELSE 3 END AS ioType ")
|
||||||
|
.append("FROM SD_FHBT_B_H fh ")
|
||||||
|
.append("INNER JOIN SD_WT_B_H wt ON fh.STCD = wt.FHSTCD ")
|
||||||
|
.append("LEFT JOIN SD_ENGINFO_B_H engWt ON engWt.STCD = wt.RSTCD AND NVL(engWt.IS_DELETED, 0) = 0 ")
|
||||||
|
.append("WHERE NVL(fh.IS_DELETED, 0) = 0 ")
|
||||||
|
.append(" AND NVL(wt.IS_DELETED, 0) = 0 ")
|
||||||
|
.append(" AND fh.BASE_ID <> 'other' ")
|
||||||
|
.append(" AND wt.LGTD IS NOT NULL ")
|
||||||
|
.append(" AND wt.STTP = 'WTRV' ")
|
||||||
|
.append("UNION ALL ")
|
||||||
|
.append("SELECT fh.STCD AS fhstcd, rv.STCD AS stcd, rv.STNM AS stnm, ")
|
||||||
|
.append(" rv.LGTD AS lgtd, rv.LTTD AS lttd, fh.BASE_ID AS baseId, ")
|
||||||
|
.append(" NVL(fh.RVCD, engRv.RVCD) AS rvcd, rv.RSTCD AS rstcd, ")
|
||||||
|
.append(" 'ZQ' AS sttpCode, rv.ELEV AS dtmel, rv.DTIN AS dtin, ")
|
||||||
|
.append(" TO_CHAR(rv.BLDSTT_CODE) AS bldsttCcode, CAST(NULL AS NUMBER) AS ioType ")
|
||||||
|
.append("FROM SD_FHBT_B_H fh ")
|
||||||
|
.append("INNER JOIN SD_RIVER_B_H rv ON fh.STCD = rv.FHSTCD ")
|
||||||
|
.append("LEFT JOIN SD_ENGINFO_B_H engRv ON engRv.STCD = rv.RSTCD AND NVL(engRv.IS_DELETED, 0) = 0 ")
|
||||||
|
.append("WHERE NVL(fh.IS_DELETED, 0) = 0 ")
|
||||||
|
.append(" AND NVL(rv.IS_DELETED, 0) = 0 ")
|
||||||
|
.append(" AND fh.BASE_ID <> 'other' ")
|
||||||
|
.append(" AND rv.LGTD IS NOT NULL ")
|
||||||
|
.append(" AND rv.STTP = 'ZQ' ")
|
||||||
|
.append("UNION ALL ")
|
||||||
|
.append("SELECT fh.STCD AS fhstcd, vd.STCD AS stcd, vd.STNM AS stnm, ")
|
||||||
|
.append(" vd.LGTD AS lgtd, vd.LTTD AS lttd, fh.BASE_ID AS baseId, ")
|
||||||
|
.append(" NVL(vd.RVCD, fh.RVCD) AS rvcd, vd.RSTCD AS rstcd, ")
|
||||||
|
.append(" 'VD' AS sttpCode, vd.ELEV AS dtmel, vd.DTIN AS dtin, ")
|
||||||
|
.append(" TO_CHAR(vd.BLDSTT_CODE) AS bldsttCcode, CAST(NULL AS NUMBER) AS ioType ")
|
||||||
|
.append("FROM SD_FHBT_B_H fh ")
|
||||||
|
.append("INNER JOIN SD_VDINFO_B vd ON fh.STCD = vd.FHSTCD ")
|
||||||
|
.append("WHERE NVL(fh.IS_DELETED, 0) = 0 ")
|
||||||
|
.append(" AND fh.BASE_ID <> 'other' ")
|
||||||
|
.append(" AND vd.LGTD IS NOT NULL ")
|
||||||
|
.append(") t ")
|
||||||
|
.append("LEFT JOIN SD_ENGINFO_B_H eng ON eng.STCD = t.rstcd AND NVL(eng.IS_DELETED, 0) = 0 ")
|
||||||
|
.append("LEFT JOIN SD_HYDROBASE hb ON hb.BASEID = t.baseId AND NVL(hb.IS_DELETED, 0) = 0 ")
|
||||||
|
.append("LEFT JOIN SD_RVCD_DIC rv ON rv.RVCD = t.rvcd ")
|
||||||
|
.append("WHERE 1 = 1 ");
|
||||||
|
|
||||||
|
String filterSql = QgcQueryWrapperUtil.buildFilterCondition(
|
||||||
|
dataSourceRequest == null ? null : dataSourceRequest.getFilter(),
|
||||||
|
paramMap,
|
||||||
|
new int[]{0},
|
||||||
|
this::mapFhPointColumn
|
||||||
|
);
|
||||||
|
if (StrUtil.isNotBlank(filterSql)) {
|
||||||
|
sql.append("AND ").append(filterSql).append(" ");
|
||||||
|
}
|
||||||
|
sql.append("ORDER BY t.fhstcd, t.sttpCode, t.stcd");
|
||||||
|
|
||||||
|
List<FhPointVo> list = microservicDynamicSQLMapper.getAllListWithResultType(sql.toString(), paramMap, FhPointVo.class);
|
||||||
|
for (FhPointVo vo : list) {
|
||||||
|
String sttpCode = StrUtil.blankToDefault(vo.getSttpCode(), "");
|
||||||
|
if ("WQ".equalsIgnoreCase(sttpCode)) {
|
||||||
|
vo.setAnchoPointState("FH_WQ");
|
||||||
|
} else if ("WTRV".equalsIgnoreCase(sttpCode)) {
|
||||||
|
vo.setAnchoPointState("FH_WTRV");
|
||||||
|
} else if ("ZQ".equalsIgnoreCase(sttpCode)) {
|
||||||
|
vo.setAnchoPointState("FH_ZQ");
|
||||||
|
} else if ("VD".equalsIgnoreCase(sttpCode)) {
|
||||||
|
vo.setAnchoPointState("FH_VD");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
result.setData(list);
|
||||||
|
result.setTotal((long) list.size());
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
private String mapWeFvColumn(String field) {
|
||||||
|
if (StrUtil.isBlank(field)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return switch (field.toLowerCase()) {
|
||||||
|
case "sttpcode" -> "t.STTP_CODE";
|
||||||
|
case "lgtd" -> "t.lgtd";
|
||||||
|
default -> null;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
private String mapFhPointColumn(String field) {
|
||||||
|
if (StrUtil.isBlank(field)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return switch (field.toLowerCase()) {
|
||||||
|
case "fhstcd" -> "t.fhstcd";
|
||||||
|
case "stcd" -> "t.stcd";
|
||||||
|
case "stnm" -> "t.stnm";
|
||||||
|
case "ennm" -> "eng.ENNM";
|
||||||
|
case "baseid" -> "t.baseId";
|
||||||
|
case "basename" -> "hb.BASENAME";
|
||||||
|
case "rvcd" -> "t.rvcd";
|
||||||
|
case "rvcdname" -> "rv.RVNM";
|
||||||
|
case "rstcd" -> "t.rstcd";
|
||||||
|
case "sttpcode" -> "t.sttpCode";
|
||||||
|
case "dtin" -> "t.dtin";
|
||||||
|
case "bldsttccode" -> "t.bldsttCcode";
|
||||||
|
case "lgtd" -> "t.lgtd";
|
||||||
|
case "lttd" -> "t.lttd";
|
||||||
|
default -> null;
|
||||||
|
};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -106,6 +106,12 @@ public class FishPassageController {
|
|||||||
return ResponseResult.successData(fpBuildService.getStInfoByStcd(stcd));
|
return ResponseResult.successData(fpBuildService.getStInfoByStcd(stcd));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping("/point/built/GetKendoListCust")
|
||||||
|
@Operation(summary = "过鱼设施地图描点接口(仅查询在建状态的)")
|
||||||
|
public ResponseResult getFpBuiltPointKendoListCust(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||||
|
return ResponseResult.successData(fpBuildService.getFpBuiltPointKendoListCust(dataSourceRequest));
|
||||||
|
}
|
||||||
|
|
||||||
@GetMapping("/run/qgc/year/GetYearFpStatistics")
|
@GetMapping("/run/qgc/year/GetYearFpStatistics")
|
||||||
@Operation(summary = "全过程过鱼统计总数,根据基地分组")
|
@Operation(summary = "全过程过鱼统计总数,根据基地分组")
|
||||||
public ResponseResult getYearFpStatic(@RequestParam("year") String year) {
|
public ResponseResult getYearFpStatic(@RequestParam("year") String year) {
|
||||||
|
|||||||
@ -0,0 +1,89 @@
|
|||||||
|
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 = "过鱼设施锚点VO")
|
||||||
|
public class FpAnchoPointVo {
|
||||||
|
|
||||||
|
@Schema(description = "站点编码")
|
||||||
|
private String stcd;
|
||||||
|
|
||||||
|
@Schema(description = "站名")
|
||||||
|
private String stnm;
|
||||||
|
|
||||||
|
@Schema(description = "弹框站点名称")
|
||||||
|
private String titleName;
|
||||||
|
|
||||||
|
@Schema(description = "建设状态编码")
|
||||||
|
private String bldsttCcode;
|
||||||
|
|
||||||
|
@Schema(description = "建设状态")
|
||||||
|
private String bldstt;
|
||||||
|
|
||||||
|
@Schema(description = "纬度")
|
||||||
|
private BigDecimal lttd;
|
||||||
|
|
||||||
|
@Schema(description = "经度")
|
||||||
|
private BigDecimal lgtd;
|
||||||
|
|
||||||
|
@Schema(description = "高程")
|
||||||
|
private BigDecimal dtmel;
|
||||||
|
|
||||||
|
@Schema(description = "关联电站编码")
|
||||||
|
private String rstcds;
|
||||||
|
|
||||||
|
@Schema(description = "电站名称")
|
||||||
|
private String ennm;
|
||||||
|
|
||||||
|
@Schema(description = "站点类型编码")
|
||||||
|
private String sttpCode;
|
||||||
|
|
||||||
|
@Schema(description = "运行状态")
|
||||||
|
private String run;
|
||||||
|
|
||||||
|
@Schema(description = "设施类型")
|
||||||
|
private String dwtp;
|
||||||
|
|
||||||
|
@Schema(description = "设施类型名称")
|
||||||
|
private String dwtpName;
|
||||||
|
|
||||||
|
@Schema(description = "锚点类型")
|
||||||
|
private String sttpMap;
|
||||||
|
|
||||||
|
@Schema(description = "流域编码")
|
||||||
|
private String rvcd;
|
||||||
|
|
||||||
|
@Schema(description = "行政编码")
|
||||||
|
private String addvcd;
|
||||||
|
|
||||||
|
@Schema(description = "基地编码")
|
||||||
|
private String baseId;
|
||||||
|
|
||||||
|
@Schema(description = "站点类型")
|
||||||
|
private String sttp;
|
||||||
|
|
||||||
|
@Schema(description = "描点状态")
|
||||||
|
private String anchoPointState;
|
||||||
|
|
||||||
|
@Schema(description = "监测方式")
|
||||||
|
private Integer mway;
|
||||||
|
|
||||||
|
@Schema(description = "数据接入")
|
||||||
|
private Integer dtin;
|
||||||
|
|
||||||
|
@Schema(description = "达标状态子类型")
|
||||||
|
private Integer stdSstate;
|
||||||
|
|
||||||
|
@Schema(description = "地图避让")
|
||||||
|
private Integer distance;
|
||||||
|
|
||||||
|
@Schema(description = "过鱼种类")
|
||||||
|
private Integer ftpTypeCount;
|
||||||
|
|
||||||
|
@Schema(description = "过鱼数量")
|
||||||
|
private Integer ftpCount;
|
||||||
|
}
|
||||||
@ -2,6 +2,7 @@ package com.yfd.platform.qgc_env.fp.service;
|
|||||||
|
|
||||||
import com.yfd.platform.common.DataSourceRequest;
|
import com.yfd.platform.common.DataSourceRequest;
|
||||||
import com.yfd.platform.common.DataSourceResult;
|
import com.yfd.platform.common.DataSourceResult;
|
||||||
|
import com.yfd.platform.qgc_env.fp.entity.vo.FpAnchoPointVo;
|
||||||
import com.yfd.platform.qgc_env.fp.entity.vo.FpConstructionSituationVo;
|
import com.yfd.platform.qgc_env.fp.entity.vo.FpConstructionSituationVo;
|
||||||
import com.yfd.platform.qgc_env.fp.entity.vo.FpFishDicVo;
|
import com.yfd.platform.qgc_env.fp.entity.vo.FpFishDicVo;
|
||||||
import com.yfd.platform.qgc_env.fp.entity.vo.FpVmsstbprptVo;
|
import com.yfd.platform.qgc_env.fp.entity.vo.FpVmsstbprptVo;
|
||||||
@ -19,4 +20,6 @@ public interface FpBuildService {
|
|||||||
DataSourceResult<FpVmsstbprptVo> getFpqMsstbprptList(DataSourceRequest dataSourceRequest);
|
DataSourceResult<FpVmsstbprptVo> getFpqMsstbprptList(DataSourceRequest dataSourceRequest);
|
||||||
|
|
||||||
FpVmsstbprptVo getStInfoByStcd(String stcd);
|
FpVmsstbprptVo getStInfoByStcd(String stcd);
|
||||||
|
|
||||||
|
DataSourceResult<FpAnchoPointVo> getFpBuiltPointKendoListCust(DataSourceRequest dataSourceRequest);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -11,9 +11,11 @@ import com.yfd.platform.common.GroupingInfo;
|
|||||||
import com.yfd.platform.common.MicroservicDynamicSQLMapper;
|
import com.yfd.platform.common.MicroservicDynamicSQLMapper;
|
||||||
import com.yfd.platform.common.PageInfo;
|
import com.yfd.platform.common.PageInfo;
|
||||||
import com.yfd.platform.common.exception.BizException;
|
import com.yfd.platform.common.exception.BizException;
|
||||||
|
import com.yfd.platform.qgc_env.fp.entity.vo.FpAnchoPointVo;
|
||||||
import com.yfd.platform.qgc_env.fp.entity.vo.FpConstructionSituationVo;
|
import com.yfd.platform.qgc_env.fp.entity.vo.FpConstructionSituationVo;
|
||||||
import com.yfd.platform.qgc_env.fp.entity.vo.FpFishDicVo;
|
import com.yfd.platform.qgc_env.fp.entity.vo.FpFishDicVo;
|
||||||
import com.yfd.platform.qgc_env.fp.entity.vo.FpVmsstbprptVo;
|
import com.yfd.platform.qgc_env.fp.entity.vo.FpVmsstbprptVo;
|
||||||
|
import com.yfd.platform.qgc_env.wt.utils.SiteAvoidanceUtils;
|
||||||
import com.yfd.platform.qgc_env.fp.service.FpBuildService;
|
import com.yfd.platform.qgc_env.fp.service.FpBuildService;
|
||||||
import com.yfd.platform.utils.QgcQueryWrapperUtil;
|
import com.yfd.platform.utils.QgcQueryWrapperUtil;
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
@ -1142,4 +1144,177 @@ public class FpBuildServiceImpl implements FpBuildService {
|
|||||||
default -> null;
|
default -> null;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public DataSourceResult<FpAnchoPointVo> getFpBuiltPointKendoListCust(DataSourceRequest dataSourceRequest) {
|
||||||
|
DataSourceResult<FpAnchoPointVo> dataSourceResult = new DataSourceResult<>();
|
||||||
|
dataSourceResult.setAggregates(new HashMap<>());
|
||||||
|
|
||||||
|
if (dataSourceRequest == null) {
|
||||||
|
dataSourceResult.setData(new ArrayList<>());
|
||||||
|
dataSourceResult.setTotal(0L);
|
||||||
|
return dataSourceResult;
|
||||||
|
}
|
||||||
|
|
||||||
|
StringBuilder sql = new StringBuilder("SELECT\n" +
|
||||||
|
" fp.STCD AS stcd,\n" +
|
||||||
|
" fp.STNM AS stnm,\n" +
|
||||||
|
" fp.STNM AS titleName,\n" +
|
||||||
|
" fp.BLDSTT_CODE AS bldsttCcode,\n" +
|
||||||
|
" fp.BLDSTT_CODE AS bldstt,\n" +
|
||||||
|
" fp.LTTD AS lttd,\n" +
|
||||||
|
" fp.LGTD AS lgtd,\n" +
|
||||||
|
" fp.ELEV AS dtmel,\n" +
|
||||||
|
" fp.RSTCD AS rstcds,\n" +
|
||||||
|
" eng.ENNM AS ennm,\n" +
|
||||||
|
" 'FP' AS sttpCode,\n" +
|
||||||
|
" fp.STTP AS dwtp,\n" +
|
||||||
|
" CASE\n" +
|
||||||
|
" WHEN fp.STTP = 'FP_1' THEN '鱼道'\n" +
|
||||||
|
" WHEN fp.STTP = 'FP_2' THEN '仿自然通道'\n" +
|
||||||
|
" WHEN fp.STTP = 'FP_3' THEN '集运鱼系统'\n" +
|
||||||
|
" WHEN fp.STTP = 'FP_4' THEN '升鱼机'\n" +
|
||||||
|
" ELSE '其它'\n" +
|
||||||
|
" END AS dwtpName,\n" +
|
||||||
|
" fp.STTP AS sttpMap,\n" +
|
||||||
|
" eng.RVCD AS rvcd,\n" +
|
||||||
|
" eng.ADDVCD AS addvcd,\n" +
|
||||||
|
" eng.BASE_ID AS baseId,\n" +
|
||||||
|
" fp.STTP AS sttp,\n" +
|
||||||
|
" fp.MWAY AS mway,\n" +
|
||||||
|
" fp.DTIN AS dtin\n" +
|
||||||
|
"FROM SD_FPSS_B_H fp\n" +
|
||||||
|
"LEFT JOIN SD_ENGINFO_B_H eng ON eng.STCD = fp.RSTCD AND NVL(eng.IS_DELETED, 0) = 0\n" +
|
||||||
|
"WHERE NVL(fp.IS_DELETED, 0) = 0 AND fp.BLDSTT_CODE = 1 AND fp.LGTD IS NOT NULL AND fp.LTTD IS NOT NULL ");
|
||||||
|
|
||||||
|
Map<String, Object> paramMap = new HashMap<>();
|
||||||
|
|
||||||
|
DataSourceLoadOptionsBase loadOptions = dataSourceRequest.toDevRequest();
|
||||||
|
String filterSql = buildFpPointFilterCondition(dataSourceRequest.getFilter(), paramMap, new int[]{0});
|
||||||
|
if (StrUtil.isNotBlank(filterSql)) {
|
||||||
|
sql.append(" AND ").append(filterSql).append(" ");
|
||||||
|
}
|
||||||
|
|
||||||
|
sql.append(" ORDER BY fp.ORDER_INDEX ASC ");
|
||||||
|
|
||||||
|
Page<?> page = QgcQueryWrapperUtil.buildPage(loadOptions, loadOptions.getSkip(), loadOptions.getTake());
|
||||||
|
List<FpAnchoPointVo> resultList = microservicDynamicSQLMapper.pageAllListWithResultType(page, sql.toString(), paramMap, FpAnchoPointVo.class);
|
||||||
|
|
||||||
|
for (FpAnchoPointVo vo : resultList) {
|
||||||
|
String sttp = vo.getSttp();
|
||||||
|
if ("FP_1".equals(sttp)) {
|
||||||
|
vo.setAnchoPointState("GY_1_BUILT");
|
||||||
|
} else if ("FP_2".equals(sttp)) {
|
||||||
|
vo.setAnchoPointState("GY_2_BUILT");
|
||||||
|
} else if ("FP_3".equals(sttp)) {
|
||||||
|
vo.setAnchoPointState("GY_3_BUILT");
|
||||||
|
} else if ("FP_4".equals(sttp)) {
|
||||||
|
vo.setAnchoPointState("GY_4_BUILT");
|
||||||
|
} else {
|
||||||
|
vo.setAnchoPointState("GY_5_BUILT");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
SiteAvoidanceUtils.calcSiteMapLev(resultList,
|
||||||
|
FpAnchoPointVo::getStcd,
|
||||||
|
FpAnchoPointVo::getLgtd,
|
||||||
|
FpAnchoPointVo::getLttd,
|
||||||
|
FpAnchoPointVo::getAnchoPointState,
|
||||||
|
FpAnchoPointVo::setDistance);
|
||||||
|
|
||||||
|
dataSourceResult.setData(resultList);
|
||||||
|
dataSourceResult.setTotal(page == null ? resultList.size() : page.getTotal());
|
||||||
|
return dataSourceResult;
|
||||||
|
}
|
||||||
|
|
||||||
|
private String buildFpPointFilterCondition(DataSourceRequest.FilterDescriptor filter,
|
||||||
|
Map<String, Object> paramMap,
|
||||||
|
int[] indexHolder) {
|
||||||
|
if (filter == null) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
if (filter.getField() != null && !filter.getField().isBlank()) {
|
||||||
|
return buildFpPointLeafCondition(filter, paramMap, indexHolder);
|
||||||
|
}
|
||||||
|
if (CollectionUtils.isEmpty(filter.getFilters())) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
List<String> conditions = new ArrayList<>();
|
||||||
|
for (DataSourceRequest.FilterDescriptor child : filter.getFilters()) {
|
||||||
|
String childSql = buildFpPointFilterCondition(child, paramMap, indexHolder);
|
||||||
|
if (!childSql.isBlank()) {
|
||||||
|
conditions.add("(" + childSql + ")");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (conditions.isEmpty()) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
String logic = "or".equalsIgnoreCase(filter.getLogic()) ? " OR " : " AND ";
|
||||||
|
return String.join(logic, conditions);
|
||||||
|
}
|
||||||
|
|
||||||
|
private String buildFpPointLeafCondition(DataSourceRequest.FilterDescriptor filter,
|
||||||
|
Map<String, Object> paramMap,
|
||||||
|
int[] indexHolder) {
|
||||||
|
String field = filter.getField();
|
||||||
|
if (field == null || field.isBlank()) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
String column = switch (field) {
|
||||||
|
case "stcd" -> "fp.STCD";
|
||||||
|
case "stnm" -> "fp.STNM";
|
||||||
|
case "baseId" -> "eng.BASE_ID";
|
||||||
|
case "rvcd" -> "eng.RVCD";
|
||||||
|
case "addvcd" -> "eng.ADDVCD";
|
||||||
|
case "sttp" -> "fp.STTP";
|
||||||
|
default -> null;
|
||||||
|
};
|
||||||
|
if (column == null) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
String operator = filter.getOperator() == null ? "eq" : filter.getOperator().toLowerCase();
|
||||||
|
Object value = filter.getValue();
|
||||||
|
if ("isnull".equals(operator)) {
|
||||||
|
return column + " IS NULL";
|
||||||
|
}
|
||||||
|
if ("isnotnull".equals(operator)) {
|
||||||
|
return column + " IS NOT NULL";
|
||||||
|
}
|
||||||
|
if ("in".equals(operator)) {
|
||||||
|
List<Object> values = normalizeValues(value);
|
||||||
|
if (values.isEmpty()) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
List<String> placeholders = new ArrayList<>();
|
||||||
|
for (Object item : values) {
|
||||||
|
String paramKey = "fpPointParam" + indexHolder[0]++;
|
||||||
|
paramMap.put(paramKey, item);
|
||||||
|
placeholders.add("#{map." + paramKey + "}");
|
||||||
|
}
|
||||||
|
return column + " IN (" + String.join(", ", placeholders) + ")";
|
||||||
|
}
|
||||||
|
if (value == null) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
String paramKey = "fpPointParam" + indexHolder[0]++;
|
||||||
|
switch (operator) {
|
||||||
|
case "eq":
|
||||||
|
paramMap.put(paramKey, value);
|
||||||
|
return column + " = #{map." + paramKey + "}";
|
||||||
|
case "neq":
|
||||||
|
paramMap.put(paramKey, value);
|
||||||
|
return column + " <> #{map." + paramKey + "}";
|
||||||
|
case "contains":
|
||||||
|
paramMap.put(paramKey, "%" + value + "%");
|
||||||
|
return column + " LIKE #{map." + paramKey + "}";
|
||||||
|
case "startswith":
|
||||||
|
paramMap.put(paramKey, value + "%");
|
||||||
|
return column + " LIKE #{map." + paramKey + "}";
|
||||||
|
case "endswith":
|
||||||
|
paramMap.put(paramKey, "%" + value);
|
||||||
|
return column + " LIKE #{map." + paramKey + "}";
|
||||||
|
default:
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2332,7 +2332,7 @@ public class FpRunServiceImpl implements FpRunService {
|
|||||||
" FROM ( " +
|
" FROM ( " +
|
||||||
" SELECT STCD, FTP " +
|
" SELECT STCD, FTP " +
|
||||||
" FROM SD_FPRUNPLAN_B " +
|
" FROM SD_FPRUNPLAN_B " +
|
||||||
" WHERE (TASK_STATUS = 'Approved' OR TASK_STATUS IS NULL) " +
|
" WHERE 1=1 " +
|
||||||
" AND IS_DELETED = 0 " +
|
" AND IS_DELETED = 0 " +
|
||||||
" AND STCD = #{map.stcd} " +
|
" AND STCD = #{map.stcd} " +
|
||||||
" AND TO_CHAR(START_TIME, 'yyyy') = #{map.yr} " +
|
" AND TO_CHAR(START_TIME, 'yyyy') = #{map.yr} " +
|
||||||
@ -2356,7 +2356,7 @@ public class FpRunServiceImpl implements FpRunService {
|
|||||||
" FROM ( " +
|
" FROM ( " +
|
||||||
" SELECT STCD, TO_CHAR(START_TIME, 'mm') AS stm, TO_CHAR(END_TIME, 'mm') AS edm, PYCNT AS pycnt " +
|
" SELECT STCD, TO_CHAR(START_TIME, 'mm') AS stm, TO_CHAR(END_TIME, 'mm') AS edm, PYCNT AS pycnt " +
|
||||||
" FROM SD_FPRUNPLAN_B " +
|
" FROM SD_FPRUNPLAN_B " +
|
||||||
" WHERE (TASK_STATUS = 'Approved' OR TASK_STATUS IS NULL) " +
|
" WHERE 1=1 " +
|
||||||
" AND IS_DELETED = 0 " +
|
" AND IS_DELETED = 0 " +
|
||||||
" AND STCD = #{map.stcd} " +
|
" AND STCD = #{map.stcd} " +
|
||||||
" AND TO_CHAR(START_TIME, 'yyyy') = #{map.yr} " +
|
" AND TO_CHAR(START_TIME, 'yyyy') = #{map.yr} " +
|
||||||
@ -2368,7 +2368,7 @@ public class FpRunServiceImpl implements FpRunService {
|
|||||||
" AND STCD NOT IN ( " +
|
" AND STCD NOT IN ( " +
|
||||||
" SELECT STCD " +
|
" SELECT STCD " +
|
||||||
" FROM SD_FPRUNPLAN_B " +
|
" FROM SD_FPRUNPLAN_B " +
|
||||||
" WHERE (TASK_STATUS = 'Approved' OR TASK_STATUS IS NULL) " +
|
" WHERE 1=1 " +
|
||||||
" AND IS_DELETED = 0 " +
|
" AND IS_DELETED = 0 " +
|
||||||
" AND STCD = #{map.stcd} " +
|
" AND STCD = #{map.stcd} " +
|
||||||
" AND TO_CHAR(START_TIME, 'yyyy') = #{map.yr} " +
|
" AND TO_CHAR(START_TIME, 'yyyy') = #{map.yr} " +
|
||||||
|
|||||||
@ -4,9 +4,10 @@ import com.yfd.platform.common.DataSourceRequest;
|
|||||||
import com.yfd.platform.common.DataSourceResult;
|
import com.yfd.platform.common.DataSourceResult;
|
||||||
import com.yfd.platform.config.ResponseResult;
|
import com.yfd.platform.config.ResponseResult;
|
||||||
import com.yfd.platform.qgc_env.fpr.entity.ao.FprdRunDataAo;
|
import com.yfd.platform.qgc_env.fpr.entity.ao.FprdRunDataAo;
|
||||||
import com.yfd.platform.qgc_env.fpr.entity.vo.FprdDetailVo;
|
|
||||||
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.FprFtpChangeInfoVo;
|
||||||
|
import com.yfd.platform.qgc_env.fpr.entity.vo.FprdDetailVo;
|
||||||
|
import com.yfd.platform.qgc_env.fpr.entity.vo.FprdPointInfoVo;
|
||||||
|
import com.yfd.platform.qgc_eng.eq.service.EngEqDataService;
|
||||||
import com.yfd.platform.qgc_env.fpr.entity.vo.FprdRunDataInfoVo;
|
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.entity.vo.FprZyFishDicVo;
|
||||||
import com.yfd.platform.qgc_env.fpr.service.FprMonitorService;
|
import com.yfd.platform.qgc_env.fpr.service.FprMonitorService;
|
||||||
@ -86,6 +87,13 @@ public class FprMonitorController {
|
|||||||
return ResponseResult.successData(result);
|
return ResponseResult.successData(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping("/sdFprdR/point/getFprdPointList")
|
||||||
|
@Operation(summary = "鱼类调查装置锚点信息")
|
||||||
|
public ResponseResult getFprdPointList(@RequestBody FprdRunDataAo ao) {
|
||||||
|
List<FprdPointInfoVo> result = fprMonitorService.getFprdInfoList(ao);
|
||||||
|
return ResponseResult.successData(result);
|
||||||
|
}
|
||||||
|
|
||||||
@PostMapping("/wbsb/GetKendoList")
|
@PostMapping("/wbsb/GetKendoList")
|
||||||
@Operation(summary = "查询基地/基地流域树数据")
|
@Operation(summary = "查询基地/基地流域树数据")
|
||||||
public ResponseResult getWbsbList(@RequestBody DataSourceRequest dataSourceRequest) {
|
public ResponseResult getWbsbList(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||||
|
|||||||
@ -0,0 +1,67 @@
|
|||||||
|
package com.yfd.platform.qgc_env.fpr.entity.vo;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class FprdPointInfoVo {
|
||||||
|
|
||||||
|
private String stcd;
|
||||||
|
|
||||||
|
private String stnm;
|
||||||
|
|
||||||
|
private String titleName;
|
||||||
|
|
||||||
|
private String bldsttCcode;
|
||||||
|
|
||||||
|
private String bldstt;
|
||||||
|
|
||||||
|
private Double lttd;
|
||||||
|
|
||||||
|
private Double lgtd;
|
||||||
|
|
||||||
|
private Double dtmel;
|
||||||
|
|
||||||
|
private String rstcds;
|
||||||
|
|
||||||
|
private String ennm;
|
||||||
|
|
||||||
|
private String sttpCode;
|
||||||
|
|
||||||
|
private String dwtp;
|
||||||
|
|
||||||
|
private String dwtpName;
|
||||||
|
|
||||||
|
private String sttpMap;
|
||||||
|
|
||||||
|
private String rvcd;
|
||||||
|
|
||||||
|
private String rvcdName;
|
||||||
|
|
||||||
|
private String addvcd;
|
||||||
|
|
||||||
|
private String addvcdName;
|
||||||
|
|
||||||
|
private String hbrvcd;
|
||||||
|
|
||||||
|
private String hbrvcdName;
|
||||||
|
|
||||||
|
private String baseId;
|
||||||
|
|
||||||
|
private String baseName;
|
||||||
|
|
||||||
|
private String sttp;
|
||||||
|
|
||||||
|
private String sttpName;
|
||||||
|
|
||||||
|
private String anchoPointState;
|
||||||
|
|
||||||
|
private String mway;
|
||||||
|
|
||||||
|
private Integer dtin;
|
||||||
|
|
||||||
|
private String stdSstate;
|
||||||
|
|
||||||
|
private Integer distance;
|
||||||
|
|
||||||
|
private String stlc;
|
||||||
|
}
|
||||||
@ -2,8 +2,9 @@ package com.yfd.platform.qgc_env.fpr.service;
|
|||||||
|
|
||||||
import com.yfd.platform.common.DataSourceRequest;
|
import com.yfd.platform.common.DataSourceRequest;
|
||||||
import com.yfd.platform.common.DataSourceResult;
|
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.ao.FprdRunDataAo;
|
||||||
|
import com.yfd.platform.qgc_env.fpr.entity.vo.FprFtpChangeInfoVo;
|
||||||
|
import com.yfd.platform.qgc_env.fpr.entity.vo.FprdPointInfoVo;
|
||||||
import com.yfd.platform.qgc_env.fpr.entity.vo.FprFishDicVo;
|
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.FprMsstbprptVo;
|
||||||
import com.yfd.platform.qgc_env.fpr.entity.vo.FprdDetailVo;
|
import com.yfd.platform.qgc_env.fpr.entity.vo.FprdDetailVo;
|
||||||
@ -29,4 +30,6 @@ public interface FprMonitorService {
|
|||||||
DataSourceResult<FprdDetailVo> getFprdDetailList(DataSourceRequest dataSourceRequest);
|
DataSourceResult<FprdDetailVo> getFprdDetailList(DataSourceRequest dataSourceRequest);
|
||||||
|
|
||||||
List<String> getFishInfo();
|
List<String> getFishInfo();
|
||||||
|
|
||||||
|
List<FprdPointInfoVo> getFprdInfoList(FprdRunDataAo ao);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -5,6 +5,7 @@ import cn.hutool.core.bean.copier.CopyOptions;
|
|||||||
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import cn.hutool.core.date.DateUtil;
|
import cn.hutool.core.date.DateUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.yfd.platform.qgc_env.wt.utils.SiteAvoidanceUtils;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.yfd.platform.common.DataSourceLoadOptionsBase;
|
import com.yfd.platform.common.DataSourceLoadOptionsBase;
|
||||||
import com.yfd.platform.common.DataSourceRequest;
|
import com.yfd.platform.common.DataSourceRequest;
|
||||||
@ -18,6 +19,7 @@ import com.yfd.platform.qgc_env.fpr.entity.vo.FprFishDicVo;
|
|||||||
import com.yfd.platform.qgc_env.fpr.entity.vo.FprFtpChangeInfoVo;
|
import com.yfd.platform.qgc_env.fpr.entity.vo.FprFtpChangeInfoVo;
|
||||||
import com.yfd.platform.qgc_env.fpr.entity.vo.FprMsstbprptVo;
|
import com.yfd.platform.qgc_env.fpr.entity.vo.FprMsstbprptVo;
|
||||||
import com.yfd.platform.qgc_env.fpr.entity.vo.FprdDetailVo;
|
import com.yfd.platform.qgc_env.fpr.entity.vo.FprdDetailVo;
|
||||||
|
import com.yfd.platform.qgc_env.fpr.entity.vo.FprdPointInfoVo;
|
||||||
import com.yfd.platform.qgc_env.fpr.entity.vo.FprdRunDataInfoVo;
|
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.entity.vo.FprZyFishDicVo;
|
||||||
import com.yfd.platform.qgc_env.fpr.service.FprMonitorService;
|
import com.yfd.platform.qgc_env.fpr.service.FprMonitorService;
|
||||||
@ -126,6 +128,87 @@ public class FprMonitorServiceImpl implements FprMonitorService {
|
|||||||
.toList();
|
.toList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<FprdPointInfoVo> getFprdInfoList(FprdRunDataAo ao) {
|
||||||
|
validateFprdRunDataAo(ao);
|
||||||
|
|
||||||
|
Map<String, Object> paramMap = new HashMap<>();
|
||||||
|
paramMap.put("baseId", ao.getBaseId());
|
||||||
|
|
||||||
|
StringBuilder sql = new StringBuilder("SELECT ")
|
||||||
|
.append("aim.STCD AS stcd, ")
|
||||||
|
.append("aim.STNM AS stnm, ")
|
||||||
|
.append("aim.STNM AS titleName, ")
|
||||||
|
.append("TO_CHAR(aim.BLDSTT_CODE) AS bldsttCcode, ")
|
||||||
|
.append("TO_CHAR(aim.BLDSTT_CODE) AS bldstt, ")
|
||||||
|
.append("aim.LTTD AS lttd, ")
|
||||||
|
.append("aim.LGTD AS lgtd, ")
|
||||||
|
.append("aim.DTMEL AS dtmel, ")
|
||||||
|
.append("aim.RSTCD AS rstcds, ")
|
||||||
|
.append("eng.ENNM AS ennm, ")
|
||||||
|
.append("aim.STTP AS sttpCode, ")
|
||||||
|
.append("aim.DWTP AS dwtp, ")
|
||||||
|
.append("aim.DWTP AS dwtpName, ")
|
||||||
|
.append("aim.STTP AS sttpMap, ")
|
||||||
|
.append("aim.RVCD AS rvcd, ")
|
||||||
|
.append("rv.RVNM AS rvcdName, ")
|
||||||
|
.append("aim.ADDVCD AS addvcd, ")
|
||||||
|
.append("addv.ADDVCD_NAME AS addvcdName, ")
|
||||||
|
.append("aim.HBRVCD AS hbrvcd, ")
|
||||||
|
.append("hbrv.HBRVNM AS hbrvcdName, ")
|
||||||
|
.append("aim.BASE_ID AS baseId, ")
|
||||||
|
.append("hb.BASENAME AS baseName, ")
|
||||||
|
.append("aim.STTP AS sttp, ")
|
||||||
|
.append("sttp.STTP_NAME AS sttpName, ")
|
||||||
|
.append("'' AS anchoPointState, ")
|
||||||
|
.append("aim.MWAY AS mway, ")
|
||||||
|
.append("aim.DTIN AS dtin, ")
|
||||||
|
.append("aim.STDSSTATE AS stdSstate, ")
|
||||||
|
.append("aim.STLC AS stlc ")
|
||||||
|
.append("FROM SD_AIMONITOR_B_H aim ")
|
||||||
|
.append("LEFT JOIN SD_ENGINFO_B_H eng ON eng.STCD = aim.RSTCD AND NVL(eng.IS_DELETED, 0) = 0 ")
|
||||||
|
.append("LEFT JOIN SD_HYDROBASE hb ON hb.BASEID = aim.BASE_ID AND NVL(hb.IS_DELETED, 0) = 0 ")
|
||||||
|
.append("LEFT JOIN SD_HBRV_DIC hbrv ON hbrv.HBRVCD = aim.HBRVCD ")
|
||||||
|
.append(" AND hbrv.BASEID = aim.BASE_ID ")
|
||||||
|
.append(" AND NVL(hbrv.IS_DELETED, 0) = 0 ")
|
||||||
|
.append(" AND NVL(hbrv.ENABLED, 1) = 1 ")
|
||||||
|
.append("LEFT JOIN SD_RVCD_DIC rv ON rv.RVCD = aim.RVCD ")
|
||||||
|
.append("LEFT JOIN SD_ADDVCD_DIC addv ON addv.ADDVCD = aim.ADDVCD ")
|
||||||
|
.append("LEFT JOIN SD_STTP_B sttp ON sttp.STTP_CODE = aim.STTP ")
|
||||||
|
.append(" AND NVL(sttp.IS_DELETED, 0) = 0 ")
|
||||||
|
.append(" AND NVL(sttp.ENABLE, 1) = 1 ")
|
||||||
|
.append("WHERE NVL(aim.IS_DELETED, 0) = 0 ")
|
||||||
|
.append(" AND aim.STTP = 'FPRD' ")
|
||||||
|
.append(" AND aim.LGTD IS NOT NULL ")
|
||||||
|
.append(" AND aim.BASE_ID = #{map.baseId}");
|
||||||
|
|
||||||
|
if (StrUtil.isNotBlank(ao.getHbrvcd())) {
|
||||||
|
sql.append(" AND aim.HBRVCD = #{map.hbrvcd}");
|
||||||
|
paramMap.put("hbrvcd", ao.getHbrvcd());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (StrUtil.isNotBlank(ao.getStcd())) {
|
||||||
|
sql.append(" AND aim.STCD = #{map.stcd}");
|
||||||
|
paramMap.put("stcd", ao.getStcd());
|
||||||
|
}
|
||||||
|
|
||||||
|
List<FprdPointInfoVo> resultList = microservicDynamicSQLMapper.getAllListWithResultType(
|
||||||
|
sql.toString(),
|
||||||
|
paramMap,
|
||||||
|
FprdPointInfoVo.class
|
||||||
|
);
|
||||||
|
|
||||||
|
SiteAvoidanceUtils.calcSiteMapLev(resultList,
|
||||||
|
FprdPointInfoVo::getStcd,
|
||||||
|
vo -> vo.getLgtd() != null ? java.math.BigDecimal.valueOf(vo.getLgtd()) : null,
|
||||||
|
vo -> vo.getLttd() != null ? java.math.BigDecimal.valueOf(vo.getLttd()) : null,
|
||||||
|
FprdPointInfoVo::getAnchoPointState,
|
||||||
|
FprdPointInfoVo::setDistance
|
||||||
|
);
|
||||||
|
|
||||||
|
return resultList;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public DataSourceResult<FprMsstbprptVo> getMsstbprptList(DataSourceRequest dataSourceRequest) {
|
public DataSourceResult<FprMsstbprptVo> getMsstbprptList(DataSourceRequest dataSourceRequest) {
|
||||||
DataSourceLoadOptionsBase loadOptions = dataSourceRequest == null ? null : dataSourceRequest.toDevRequest();
|
DataSourceLoadOptionsBase loadOptions = dataSourceRequest == null ? null : dataSourceRequest.toDevRequest();
|
||||||
|
|||||||
@ -76,4 +76,16 @@ public class VapConstructionController {
|
|||||||
public ResponseResult getVprYearKendoListCust(@RequestBody DataSourceRequest dataSourceRequest) {
|
public ResponseResult getVprYearKendoListCust(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||||
return ResponseResult.successData(vpConstructionService.getVprYearList(dataSourceRequest));
|
return ResponseResult.successData(vpConstructionService.getVprYearList(dataSourceRequest));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping("/fhvap/built/GetKendoListCust")
|
||||||
|
@Operation(summary = "栖息地/珍稀植物园/动物救助站描点接口(仅查询在建状态的)")
|
||||||
|
public ResponseResult getFhvapBuiltPointKendoListCust(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||||
|
return ResponseResult.successData(vpConstructionService.getFhvapBuiltPointKendoListCust(dataSourceRequest));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/wva/point/GetKendoListCust")
|
||||||
|
@Operation(summary = "野生动物锚点")
|
||||||
|
public ResponseResult getWvaPointKendoListCust(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||||
|
return ResponseResult.successData(vpConstructionService.getWvaPointKendoListCust(dataSourceRequest));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,57 @@
|
|||||||
|
package com.yfd.platform.qgc_env.vap.entity.vo;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class FhvapBuiltPointVo {
|
||||||
|
|
||||||
|
private String stcd;
|
||||||
|
|
||||||
|
private String stnm;
|
||||||
|
|
||||||
|
private String titleName;
|
||||||
|
|
||||||
|
private String bldsttCcode;
|
||||||
|
|
||||||
|
private String bldstt;
|
||||||
|
|
||||||
|
private Double lttd;
|
||||||
|
|
||||||
|
private Double lgtd;
|
||||||
|
|
||||||
|
private Double dtmel;
|
||||||
|
|
||||||
|
private String rstcds;
|
||||||
|
|
||||||
|
private String ennm;
|
||||||
|
|
||||||
|
private String sttpCode;
|
||||||
|
|
||||||
|
private String dwtp;
|
||||||
|
|
||||||
|
private String dwtpName;
|
||||||
|
|
||||||
|
private String sttpMap;
|
||||||
|
|
||||||
|
private String rvcd;
|
||||||
|
|
||||||
|
private String addvcd;
|
||||||
|
|
||||||
|
private String baseId;
|
||||||
|
|
||||||
|
private String sttp;
|
||||||
|
|
||||||
|
private String anchoPointState;
|
||||||
|
|
||||||
|
private String mway;
|
||||||
|
|
||||||
|
private Integer dtin;
|
||||||
|
|
||||||
|
private String stdSstate;
|
||||||
|
|
||||||
|
private Integer distance;
|
||||||
|
|
||||||
|
private Integer ftpTypeCount;
|
||||||
|
|
||||||
|
private Integer ftpCount;
|
||||||
|
}
|
||||||
@ -0,0 +1,47 @@
|
|||||||
|
package com.yfd.platform.qgc_env.vap.entity.vo;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class WvaPointVo {
|
||||||
|
|
||||||
|
private Integer dtin;
|
||||||
|
|
||||||
|
private String stcd;
|
||||||
|
|
||||||
|
private String stnm;
|
||||||
|
|
||||||
|
private String titleName;
|
||||||
|
|
||||||
|
private String bldsttCcode;
|
||||||
|
|
||||||
|
private String bldstt;
|
||||||
|
|
||||||
|
private Double lttd;
|
||||||
|
|
||||||
|
private Double lgtd;
|
||||||
|
|
||||||
|
private Double dtmel;
|
||||||
|
|
||||||
|
private String rstcds;
|
||||||
|
|
||||||
|
private String ennm;
|
||||||
|
|
||||||
|
private String sttpMap;
|
||||||
|
|
||||||
|
private String rvcd;
|
||||||
|
|
||||||
|
private String addvcd;
|
||||||
|
|
||||||
|
private String baseId;
|
||||||
|
|
||||||
|
private String sttp;
|
||||||
|
|
||||||
|
private String anchoPointState;
|
||||||
|
|
||||||
|
private String mway;
|
||||||
|
|
||||||
|
private String sttpCode;
|
||||||
|
|
||||||
|
private Integer distance;
|
||||||
|
}
|
||||||
@ -2,6 +2,8 @@ package com.yfd.platform.qgc_env.vap.service;
|
|||||||
|
|
||||||
import com.yfd.platform.common.DataSourceRequest;
|
import com.yfd.platform.common.DataSourceRequest;
|
||||||
import com.yfd.platform.common.DataSourceResult;
|
import com.yfd.platform.common.DataSourceResult;
|
||||||
|
import com.yfd.platform.qgc_env.vap.entity.vo.FhvapBuiltPointVo;
|
||||||
|
import com.yfd.platform.qgc_env.vap.entity.vo.WvaPointVo;
|
||||||
import com.yfd.platform.qgc_env.vap.entity.vo.VpBasinIntDetailVo;
|
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.VpVarVo;
|
||||||
import com.yfd.platform.qgc_env.vap.entity.vo.VpStInfoResultVo;
|
import com.yfd.platform.qgc_env.vap.entity.vo.VpStInfoResultVo;
|
||||||
@ -27,4 +29,8 @@ public interface VpConstructionService {
|
|||||||
DataSourceResult getVarYearList(DataSourceRequest dataSourceRequest);
|
DataSourceResult getVarYearList(DataSourceRequest dataSourceRequest);
|
||||||
|
|
||||||
DataSourceResult getVprYearList(DataSourceRequest dataSourceRequest);
|
DataSourceResult getVprYearList(DataSourceRequest dataSourceRequest);
|
||||||
|
|
||||||
|
DataSourceResult<FhvapBuiltPointVo> getFhvapBuiltPointKendoListCust(DataSourceRequest dataSourceRequest);
|
||||||
|
|
||||||
|
DataSourceResult<WvaPointVo> getWvaPointKendoListCust(DataSourceRequest dataSourceRequest);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -9,6 +9,8 @@ import com.yfd.platform.common.GroupHelper;
|
|||||||
import com.yfd.platform.common.GroupingInfo;
|
import com.yfd.platform.common.GroupingInfo;
|
||||||
import com.yfd.platform.common.MicroservicDynamicSQLMapper;
|
import com.yfd.platform.common.MicroservicDynamicSQLMapper;
|
||||||
import com.yfd.platform.common.PageInfo;
|
import com.yfd.platform.common.PageInfo;
|
||||||
|
import com.yfd.platform.qgc_env.vap.entity.vo.FhvapBuiltPointVo;
|
||||||
|
import com.yfd.platform.qgc_env.vap.entity.vo.WvaPointVo;
|
||||||
import com.yfd.platform.qgc_env.vap.entity.vo.VpBasinIntDetailVo;
|
import com.yfd.platform.qgc_env.vap.entity.vo.VpBasinIntDetailVo;
|
||||||
import com.yfd.platform.qgc_env.vap.entity.vo.VpConstructionSituationVo;
|
import com.yfd.platform.qgc_env.vap.entity.vo.VpConstructionSituationVo;
|
||||||
import com.yfd.platform.qgc_env.vap.entity.vo.VpVarVo;
|
import com.yfd.platform.qgc_env.vap.entity.vo.VpVarVo;
|
||||||
@ -1908,4 +1910,403 @@ public class VpConstructionServiceImpl implements VpConstructionService {
|
|||||||
dataSourceResult.setTotal(page != null ? page.getTotal() : (long) yList.size());
|
dataSourceResult.setTotal(page != null ? page.getTotal() : (long) yList.size());
|
||||||
return dataSourceResult;
|
return dataSourceResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public DataSourceResult<FhvapBuiltPointVo> getFhvapBuiltPointKendoListCust(DataSourceRequest dataSourceRequest) {
|
||||||
|
DataSourceResult<FhvapBuiltPointVo> dataSourceResult = new DataSourceResult<>();
|
||||||
|
dataSourceResult.setAggregates(new HashMap<>());
|
||||||
|
|
||||||
|
if (dataSourceRequest == null) {
|
||||||
|
dataSourceResult.setData(new ArrayList<>());
|
||||||
|
dataSourceResult.setTotal(0L);
|
||||||
|
return dataSourceResult;
|
||||||
|
}
|
||||||
|
|
||||||
|
StringBuilder sql = new StringBuilder("SELECT\n" +
|
||||||
|
" t.STCD AS stcd,\n" +
|
||||||
|
" t.STNM AS stnm,\n" +
|
||||||
|
" t.STNM AS titleName,\n" +
|
||||||
|
" TO_CHAR(t.BLDSTT_CODE) AS bldsttCcode,\n" +
|
||||||
|
" TO_CHAR(t.BLDSTT_CODE) AS bldstt,\n" +
|
||||||
|
" t.LTTD AS lttd,\n" +
|
||||||
|
" t.LGTD AS lgtd,\n" +
|
||||||
|
" t.ELEV AS dtmel,\n" +
|
||||||
|
" t.RSTCD AS rstcds,\n" +
|
||||||
|
" eng.ENNM AS ennm,\n" +
|
||||||
|
" t.STTP AS sttpCode,\n" +
|
||||||
|
" t.STTP AS dwtp,\n" +
|
||||||
|
" CASE\n" +
|
||||||
|
" WHEN t.STTP = 'VP' THEN '珍稀植物园'\n" +
|
||||||
|
" WHEN t.STTP = 'VA' THEN '动物救助站'\n" +
|
||||||
|
" WHEN t.STTP = 'FH' THEN '栖息地'\n" +
|
||||||
|
" ELSE '其它'\n" +
|
||||||
|
" END AS dwtpName,\n" +
|
||||||
|
" t.STTP AS sttpMap,\n" +
|
||||||
|
" t.RVCD AS rvcd,\n" +
|
||||||
|
" t.ADDVCD AS addvcd,\n" +
|
||||||
|
" t.BASE_ID AS baseId,\n" +
|
||||||
|
" t.STTP AS sttp,\n" +
|
||||||
|
" t.DTIN AS dtin\n" +
|
||||||
|
"FROM (\n" +
|
||||||
|
" SELECT STCD, STNM, STTP, LGTD, LTTD, ELEV, RSTCD, BASE_ID, RVCD, ADDVCD, BLDSTT_CODE, DTIN\n" +
|
||||||
|
" FROM SD_VP_B_H\n" +
|
||||||
|
" WHERE NVL(IS_DELETED, 0) = 0 AND BLDSTT_CODE = 1 AND LGTD IS NOT NULL AND LTTD IS NOT NULL\n" +
|
||||||
|
" UNION ALL\n" +
|
||||||
|
" SELECT STCD, STNM, STTP, LGTD, LTTD, ELEV, RSTCD, BASE_ID, NULL AS RVCD, NULL AS ADDVCD, BLDSTT_CODE, DTIN\n" +
|
||||||
|
" FROM SD_VA_B_H\n" +
|
||||||
|
" WHERE NVL(IS_DELETED, 0) = 0 AND BLDSTT_CODE = 1 AND LGTD IS NOT NULL AND LTTD IS NOT NULL\n" +
|
||||||
|
" UNION ALL\n" +
|
||||||
|
" SELECT STCD, STNM, 'FH' AS STTP, LGTD, LTTD, ELEV, RSTCD, BASE_ID, RVCD, ADDVCD, 1 AS BLDSTT_CODE, DTIN\n" +
|
||||||
|
" FROM SD_FHBT_B_H\n" +
|
||||||
|
" WHERE NVL(IS_DELETED, 0) = 0 AND LGTD IS NOT NULL AND LTTD IS NOT NULL\n" +
|
||||||
|
") t\n" +
|
||||||
|
"LEFT JOIN SD_ENGINFO_B_H eng ON eng.STCD = t.RSTCD AND NVL(eng.IS_DELETED, 0) = 0 ");
|
||||||
|
|
||||||
|
Map<String, Object> paramMap = new HashMap<>();
|
||||||
|
String filterSql = buildFhvapPointFilterCondition(dataSourceRequest.getFilter(), paramMap, new int[]{0});
|
||||||
|
if (StrUtil.isNotBlank(filterSql)) {
|
||||||
|
sql.append(" AND ").append(filterSql);
|
||||||
|
}
|
||||||
|
|
||||||
|
sql.append(buildFhvapPointOrderBySql(dataSourceRequest.getSort()));
|
||||||
|
|
||||||
|
Page<?> page = KendoUtil.getPage(dataSourceRequest);
|
||||||
|
List<FhvapBuiltPointVo> resultList = microservicDynamicSQLMapper.pageAllListWithResultType(page, sql.toString(), paramMap, FhvapBuiltPointVo.class);
|
||||||
|
|
||||||
|
for (FhvapBuiltPointVo vo : resultList) {
|
||||||
|
String sttp = vo.getSttp();
|
||||||
|
if ("VP".equals(sttp)) {
|
||||||
|
vo.setAnchoPointState("GY_1_BUILT");
|
||||||
|
} else if ("VA".equals(sttp)) {
|
||||||
|
vo.setAnchoPointState("GY_2_BUILT");
|
||||||
|
} else if ("FH".equals(sttp)) {
|
||||||
|
vo.setAnchoPointState("GY_3_BUILT");
|
||||||
|
} else {
|
||||||
|
vo.setAnchoPointState("GY_4_BUILT");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
dataSourceResult.setData(resultList);
|
||||||
|
dataSourceResult.setTotal(page == null ? resultList.size() : page.getTotal());
|
||||||
|
return dataSourceResult;
|
||||||
|
}
|
||||||
|
|
||||||
|
private String buildFhvapPointFilterCondition(DataSourceRequest.FilterDescriptor filter,
|
||||||
|
Map<String, Object> paramMap,
|
||||||
|
int[] indexHolder) {
|
||||||
|
if (filter == null) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
if (StrUtil.isNotBlank(filter.getField())) {
|
||||||
|
return buildFhvapPointLeafCondition(filter, paramMap, indexHolder);
|
||||||
|
}
|
||||||
|
if (CollectionUtils.isEmpty(filter.getFilters())) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
List<String> conditions = new ArrayList<>();
|
||||||
|
for (DataSourceRequest.FilterDescriptor child : filter.getFilters()) {
|
||||||
|
String childSql = buildFhvapPointFilterCondition(child, paramMap, indexHolder);
|
||||||
|
if (StrUtil.isNotBlank(childSql)) {
|
||||||
|
conditions.add("(" + childSql + ")");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (conditions.isEmpty()) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
return String.join("or".equalsIgnoreCase(filter.getLogic()) ? " OR " : " AND ", conditions);
|
||||||
|
}
|
||||||
|
|
||||||
|
private String buildFhvapPointLeafCondition(DataSourceRequest.FilterDescriptor filter,
|
||||||
|
Map<String, Object> paramMap,
|
||||||
|
int[] indexHolder) {
|
||||||
|
String field = filter.getField();
|
||||||
|
Object value = filter.getValue();
|
||||||
|
String operator = StrUtil.blankToDefault(filter.getOperator(), "eq").toLowerCase();
|
||||||
|
|
||||||
|
String column = mapFhvapPointColumn(field);
|
||||||
|
if (StrUtil.isBlank(column)) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
if ("isnull".equals(operator)) {
|
||||||
|
return column + " IS NULL";
|
||||||
|
}
|
||||||
|
if ("isnotnull".equals(operator)) {
|
||||||
|
return column + " IS NOT NULL";
|
||||||
|
}
|
||||||
|
if ("in".equals(operator)) {
|
||||||
|
List<Object> values = normalizeValues(value);
|
||||||
|
if (values.isEmpty()) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
List<String> placeholders = new ArrayList<>();
|
||||||
|
for (Object item : values) {
|
||||||
|
String paramKey = "fhvapParam" + indexHolder[0]++;
|
||||||
|
paramMap.put(paramKey, item);
|
||||||
|
placeholders.add("#{map." + paramKey + "}");
|
||||||
|
}
|
||||||
|
return column + " IN (" + String.join(", ", placeholders) + ")";
|
||||||
|
}
|
||||||
|
if (value == null) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
String paramKey = "fhvapParam" + indexHolder[0]++;
|
||||||
|
switch (operator) {
|
||||||
|
case "eq":
|
||||||
|
paramMap.put(paramKey, value);
|
||||||
|
return column + " = #{map." + paramKey + "}";
|
||||||
|
case "neq":
|
||||||
|
paramMap.put(paramKey, value);
|
||||||
|
return column + " <> #{map." + paramKey + "}";
|
||||||
|
case "contains":
|
||||||
|
paramMap.put(paramKey, "%" + value + "%");
|
||||||
|
return column + " LIKE #{map." + paramKey + "}";
|
||||||
|
case "startswith":
|
||||||
|
paramMap.put(paramKey, value + "%");
|
||||||
|
return column + " LIKE #{map." + paramKey + "}";
|
||||||
|
case "endswith":
|
||||||
|
paramMap.put(paramKey, "%" + value);
|
||||||
|
return column + " LIKE #{map." + paramKey + "}";
|
||||||
|
case "gt":
|
||||||
|
paramMap.put(paramKey, value);
|
||||||
|
return column + " > #{map." + paramKey + "}";
|
||||||
|
case "gte":
|
||||||
|
paramMap.put(paramKey, value);
|
||||||
|
return column + " >= #{map." + paramKey + "}";
|
||||||
|
case "lt":
|
||||||
|
paramMap.put(paramKey, value);
|
||||||
|
return column + " < #{map." + paramKey + "}";
|
||||||
|
case "lte":
|
||||||
|
paramMap.put(paramKey, value);
|
||||||
|
return column + " <= #{map." + paramKey + "}";
|
||||||
|
default:
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private String mapFhvapPointColumn(String field) {
|
||||||
|
if (StrUtil.isBlank(field)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
Map<String, String> columnMap = new HashMap<>();
|
||||||
|
columnMap.put("stcd", "t.STCD");
|
||||||
|
columnMap.put("stnm", "t.STNM");
|
||||||
|
columnMap.put("sttpCode", "t.STTP");
|
||||||
|
columnMap.put("bldsttCcode", "t.BLDSTT_CODE");
|
||||||
|
columnMap.put("lgtd", "t.LGTD");
|
||||||
|
columnMap.put("lttd", "t.LTTD");
|
||||||
|
columnMap.put("baseId", "t.BASE_ID");
|
||||||
|
columnMap.put("rvcd", "t.RVCD");
|
||||||
|
columnMap.put("addvcd", "t.ADDVCD");
|
||||||
|
columnMap.put("rstcds", "t.RSTCD");
|
||||||
|
columnMap.put("ennm", "eng.ENNM");
|
||||||
|
return columnMap.get(field);
|
||||||
|
}
|
||||||
|
|
||||||
|
private String buildFhvapPointOrderBySql(List<DataSourceRequest.SortDescriptor> sorts) {
|
||||||
|
if (sorts == null || sorts.isEmpty()) {
|
||||||
|
return " ORDER BY t.BASE_ID ASC, t.STCD ASC";
|
||||||
|
}
|
||||||
|
List<String> orderItems = new ArrayList<>();
|
||||||
|
for (DataSourceRequest.SortDescriptor sort : sorts) {
|
||||||
|
if (sort == null || StrUtil.isBlank(sort.getField())) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
String column = mapFhvapPointColumn(sort.getField());
|
||||||
|
if (StrUtil.isBlank(column)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
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.BASE_ID ASC, t.STCD ASC";
|
||||||
|
}
|
||||||
|
return " ORDER BY " + String.join(", ", orderItems);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public DataSourceResult<WvaPointVo> getWvaPointKendoListCust(DataSourceRequest dataSourceRequest) {
|
||||||
|
DataSourceResult<WvaPointVo> dataSourceResult = new DataSourceResult<>();
|
||||||
|
dataSourceResult.setAggregates(new HashMap<>());
|
||||||
|
|
||||||
|
if (dataSourceRequest == null) {
|
||||||
|
dataSourceResult.setData(new ArrayList<>());
|
||||||
|
dataSourceResult.setTotal(0L);
|
||||||
|
return dataSourceResult;
|
||||||
|
}
|
||||||
|
|
||||||
|
StringBuilder sql = new StringBuilder("SELECT\n" +
|
||||||
|
" we.DTIN AS dtin,\n" +
|
||||||
|
" we.STCD AS stcd,\n" +
|
||||||
|
" we.STNM AS stnm,\n" +
|
||||||
|
" we.STNM AS titleName,\n" +
|
||||||
|
" TO_CHAR(we.BLDSTT_CODE) AS bldsttCcode,\n" +
|
||||||
|
" TO_CHAR(we.BLDSTT_CODE) AS bldstt,\n" +
|
||||||
|
" we.LTTD AS lttd,\n" +
|
||||||
|
" we.LGTD AS lgtd,\n" +
|
||||||
|
" we.ELEV AS dtmel,\n" +
|
||||||
|
" we.RSTCD AS rstcds,\n" +
|
||||||
|
" eng.ENNM AS ennm,\n" +
|
||||||
|
" 'WVA' AS sttpMap,\n" +
|
||||||
|
" we.RVCD AS rvcd,\n" +
|
||||||
|
" we.ADDVCD AS addvcd,\n" +
|
||||||
|
" we.BASE_ID AS baseId,\n" +
|
||||||
|
" 'WVA' AS sttp,\n" +
|
||||||
|
" 'wild_animal_legend' AS anchoPointState,\n" +
|
||||||
|
" 'WVA' AS sttpCode\n" +
|
||||||
|
"FROM SD_WE_B_H we\n" +
|
||||||
|
"LEFT JOIN SD_ENGINFO_B_H eng ON eng.STCD = we.RSTCD AND NVL(eng.IS_DELETED, 0) = 0\n" +
|
||||||
|
"WHERE we.LGTD IS NOT NULL AND we.LTTD IS NOT NULL ");
|
||||||
|
|
||||||
|
Map<String, Object> paramMap = new HashMap<>();
|
||||||
|
String filterSql = buildWvaPointFilterCondition(dataSourceRequest.getFilter(), paramMap, new int[]{0});
|
||||||
|
if (StrUtil.isNotBlank(filterSql)) {
|
||||||
|
sql.append(" AND ").append(filterSql);
|
||||||
|
}
|
||||||
|
|
||||||
|
sql.append(buildWvaPointOrderBySql(dataSourceRequest.getSort()));
|
||||||
|
|
||||||
|
Page<?> page = KendoUtil.getPage(dataSourceRequest);
|
||||||
|
List<WvaPointVo> resultList = microservicDynamicSQLMapper.pageAllListWithResultType(page, sql.toString(), paramMap, WvaPointVo.class);
|
||||||
|
|
||||||
|
dataSourceResult.setData(resultList);
|
||||||
|
dataSourceResult.setTotal(page == null ? resultList.size() : page.getTotal());
|
||||||
|
return dataSourceResult;
|
||||||
|
}
|
||||||
|
|
||||||
|
private String buildWvaPointFilterCondition(DataSourceRequest.FilterDescriptor filter,
|
||||||
|
Map<String, Object> paramMap,
|
||||||
|
int[] indexHolder) {
|
||||||
|
if (filter == null) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
if (StrUtil.isNotBlank(filter.getField())) {
|
||||||
|
return buildWvaPointLeafCondition(filter, paramMap, indexHolder);
|
||||||
|
}
|
||||||
|
if (CollectionUtils.isEmpty(filter.getFilters())) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
List<String> conditions = new ArrayList<>();
|
||||||
|
for (DataSourceRequest.FilterDescriptor child : filter.getFilters()) {
|
||||||
|
String childSql = buildWvaPointFilterCondition(child, paramMap, indexHolder);
|
||||||
|
if (StrUtil.isNotBlank(childSql)) {
|
||||||
|
conditions.add("(" + childSql + ")");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (conditions.isEmpty()) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
return String.join("or".equalsIgnoreCase(filter.getLogic()) ? " OR " : " AND ", conditions);
|
||||||
|
}
|
||||||
|
|
||||||
|
private String buildWvaPointLeafCondition(DataSourceRequest.FilterDescriptor filter,
|
||||||
|
Map<String, Object> paramMap,
|
||||||
|
int[] indexHolder) {
|
||||||
|
String field = filter.getField();
|
||||||
|
Object value = filter.getValue();
|
||||||
|
String operator = StrUtil.blankToDefault(filter.getOperator(), "eq").toLowerCase();
|
||||||
|
|
||||||
|
String column = mapWvaPointColumn(field);
|
||||||
|
if (StrUtil.isBlank(column)) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
if ("isnull".equals(operator)) {
|
||||||
|
return column + " IS NULL";
|
||||||
|
}
|
||||||
|
if ("isnotnull".equals(operator)) {
|
||||||
|
return column + " IS NOT NULL";
|
||||||
|
}
|
||||||
|
if ("in".equals(operator)) {
|
||||||
|
List<Object> values = normalizeValues(value);
|
||||||
|
if (values.isEmpty()) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
List<String> placeholders = new ArrayList<>();
|
||||||
|
for (Object item : values) {
|
||||||
|
String paramKey = "wvaParam" + indexHolder[0]++;
|
||||||
|
paramMap.put(paramKey, item);
|
||||||
|
placeholders.add("#{map." + paramKey + "}");
|
||||||
|
}
|
||||||
|
return column + " IN (" + String.join(", ", placeholders) + ")";
|
||||||
|
}
|
||||||
|
if (value == null) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
String paramKey = "wvaParam" + indexHolder[0]++;
|
||||||
|
switch (operator) {
|
||||||
|
case "eq":
|
||||||
|
paramMap.put(paramKey, value);
|
||||||
|
return column + " = #{map." + paramKey + "}";
|
||||||
|
case "neq":
|
||||||
|
paramMap.put(paramKey, value);
|
||||||
|
return column + " <> #{map." + paramKey + "}";
|
||||||
|
case "contains":
|
||||||
|
paramMap.put(paramKey, "%" + value + "%");
|
||||||
|
return column + " LIKE #{map." + paramKey + "}";
|
||||||
|
case "startswith":
|
||||||
|
paramMap.put(paramKey, value + "%");
|
||||||
|
return column + " LIKE #{map." + paramKey + "}";
|
||||||
|
case "endswith":
|
||||||
|
paramMap.put(paramKey, "%" + value);
|
||||||
|
return column + " LIKE #{map." + paramKey + "}";
|
||||||
|
case "gt":
|
||||||
|
paramMap.put(paramKey, value);
|
||||||
|
return column + " > #{map." + paramKey + "}";
|
||||||
|
case "gte":
|
||||||
|
paramMap.put(paramKey, value);
|
||||||
|
return column + " >= #{map." + paramKey + "}";
|
||||||
|
case "lt":
|
||||||
|
paramMap.put(paramKey, value);
|
||||||
|
return column + " < #{map." + paramKey + "}";
|
||||||
|
case "lte":
|
||||||
|
paramMap.put(paramKey, value);
|
||||||
|
return column + " <= #{map." + paramKey + "}";
|
||||||
|
default:
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private String mapWvaPointColumn(String field) {
|
||||||
|
if (StrUtil.isBlank(field)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
Map<String, String> columnMap = new HashMap<>();
|
||||||
|
columnMap.put("stcd", "we.STCD");
|
||||||
|
columnMap.put("stnm", "we.STNM");
|
||||||
|
columnMap.put("sttpCode", "'WVA'");
|
||||||
|
columnMap.put("lgtd", "we.LGTD");
|
||||||
|
columnMap.put("lttd", "we.LTTD");
|
||||||
|
columnMap.put("baseId", "we.BASE_ID");
|
||||||
|
columnMap.put("rvcd", "we.RVCD");
|
||||||
|
columnMap.put("addvcd", "we.ADDVCD");
|
||||||
|
columnMap.put("rstcds", "we.RSTCD");
|
||||||
|
columnMap.put("ennm", "eng.ENNM");
|
||||||
|
return columnMap.get(field);
|
||||||
|
}
|
||||||
|
|
||||||
|
private String buildWvaPointOrderBySql(List<DataSourceRequest.SortDescriptor> sorts) {
|
||||||
|
if (sorts == null || sorts.isEmpty()) {
|
||||||
|
return " ORDER BY we.BASE_ID ASC, we.STCD ASC";
|
||||||
|
}
|
||||||
|
List<String> orderItems = new ArrayList<>();
|
||||||
|
for (DataSourceRequest.SortDescriptor sort : sorts) {
|
||||||
|
if (sort == null || StrUtil.isBlank(sort.getField())) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
String column = mapWvaPointColumn(sort.getField());
|
||||||
|
if (StrUtil.isBlank(column)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
String direction = "desc".equalsIgnoreCase(sort.getDir()) || "des".equalsIgnoreCase(sort.getDir()) ? "DESC" : "ASC";
|
||||||
|
orderItems.add(column + " " + direction + " NULLS LAST");
|
||||||
|
}
|
||||||
|
if (orderItems.isEmpty()) {
|
||||||
|
return " ORDER BY we.BASE_ID ASC, we.STCD ASC";
|
||||||
|
}
|
||||||
|
return " ORDER BY " + String.join(", ", orderItems);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -523,8 +523,8 @@ public class WarnDataServiceImpl implements WarnDataService {
|
|||||||
sql.append("LEFT JOIN MS_ALONG_B along ON b.HBRVCD = along.RVCD AND along.CODE = 'common' AND NVL(along.IS_DELETED, 0) = 0 ");
|
sql.append("LEFT JOIN MS_ALONG_B along ON b.HBRVCD = along.RVCD AND along.CODE = 'common' AND NVL(along.IS_DELETED, 0) = 0 ");
|
||||||
sql.append("LEFT JOIN (SELECT det.SORT, cfg.RVCD, det.STCD FROM MS_ALONGDET_B det INNER JOIN MS_ALONG_B cfg ON det.ALONG_ID = cfg.ID WHERE NVL(det.IS_DELETED, 0) = 0 AND NVL(cfg.IS_DELETED, 0) = 0 AND cfg.CODE = 'common') rstSort ON rstSort.RVCD = b.HBRVCD AND rstSort.STCD = b.RSTCD ");
|
sql.append("LEFT JOIN (SELECT det.SORT, cfg.RVCD, det.STCD FROM MS_ALONGDET_B det INNER JOIN MS_ALONG_B cfg ON det.ALONG_ID = cfg.ID WHERE NVL(det.IS_DELETED, 0) = 0 AND NVL(cfg.IS_DELETED, 0) = 0 AND cfg.CODE = 'common') rstSort ON rstSort.RVCD = b.HBRVCD AND rstSort.STCD = b.RSTCD ");
|
||||||
sql.append("LEFT JOIN (SELECT det.SORT, cfg.RVCD, det.STCD FROM MS_ALONGDET_B det INNER JOIN MS_ALONG_B cfg ON det.ALONG_ID = cfg.ID WHERE NVL(det.IS_DELETED, 0) = 0 AND NVL(cfg.IS_DELETED, 0) = 0 AND cfg.CODE = 'common') siteSort ON siteSort.RVCD = b.HBRVCD AND siteSort.STCD = b.STCD ");
|
sql.append("LEFT JOIN (SELECT det.SORT, cfg.RVCD, det.STCD FROM MS_ALONGDET_B det INNER JOIN MS_ALONG_B cfg ON det.ALONG_ID = cfg.ID WHERE NVL(det.IS_DELETED, 0) = 0 AND NVL(cfg.IS_DELETED, 0) = 0 AND cfg.CODE = 'common') siteSort ON siteSort.RVCD = b.HBRVCD AND siteSort.STCD = b.STCD ");
|
||||||
sql.append("WHERE NVL(a.IS_DELETED, 0) = 0 ");
|
sql.append("WHERE a.IS_DELETED = 0 ");
|
||||||
sql.append("AND (a.TASK_STATUS IS NULL OR a.TASK_STATUS = 'Approved') ");
|
// sql.append("AND (a.TASK_STATUS IS NULL OR a.TASK_STATUS = 'Approved') ");
|
||||||
sql.append("AND a.FID NOT LIKE '%ORA-%' AND a.FID NOT LIKE '%Out%' ");
|
sql.append("AND a.FID NOT LIKE '%ORA-%' AND a.FID NOT LIKE '%Out%' ");
|
||||||
|
|
||||||
if (StrUtil.isNotBlank(type)) {
|
if (StrUtil.isNotBlank(type)) {
|
||||||
|
|||||||
@ -4575,12 +4575,12 @@ public class EnvWqDataServiceImpl implements EnvWqDataService {
|
|||||||
.append("t.FHSTCD AS fhstcd, ")
|
.append("t.FHSTCD AS fhstcd, ")
|
||||||
.append("t.ORDER_INDEX AS orderIndex, ")
|
.append("t.ORDER_INDEX AS orderIndex, ")
|
||||||
.append("eng.ENNM AS ennm, ")
|
.append("eng.ENNM AS ennm, ")
|
||||||
.append("hb.BASE_NAME AS baseName, ")
|
.append("hb.BASENAME AS baseName, ")
|
||||||
.append("hb.BASEID AS baseId, ")
|
.append("hb.BASEID AS baseId, ")
|
||||||
.append("eng.HBRVCD AS hbrvcd, ")
|
.append("eng.HBRVCD AS hbrvcd, ")
|
||||||
.append("NVL(hbrv.NAME, '') AS hbrvcdName, ")
|
.append("NVL(hbrv.HBRVNM, '') AS hbrvcdName, ")
|
||||||
.append("NVL(rvcd.NAME, '') AS rvcdName, ")
|
.append("NVL(rvcd.RVNM, '') AS rvcdName, ")
|
||||||
.append("NVL(addvcd.NAME, '') AS addvcdName, ")
|
.append("NVL(addvcd.ADDVNM, '') AS addvcdName, ")
|
||||||
.append("NVL(along.ORDER_INDEX, 999999) AS rvcdStepSort, ")
|
.append("NVL(along.ORDER_INDEX, 999999) AS rvcdStepSort, ")
|
||||||
.append("NVL(rstSort.SORT, 999999) AS rstcdStepSort, ")
|
.append("NVL(rstSort.SORT, 999999) AS rstcdStepSort, ")
|
||||||
.append("NVL(siteSort.SORT, 999999) AS siteStepSort, ")
|
.append("NVL(siteSort.SORT, 999999) AS siteStepSort, ")
|
||||||
@ -4590,9 +4590,9 @@ public class EnvWqDataServiceImpl implements EnvWqDataService {
|
|||||||
.append("FROM SD_WQ_B_H t ")
|
.append("FROM SD_WQ_B_H t ")
|
||||||
.append("LEFT JOIN SD_ENGINFO_B_H eng ON eng.STCD = t.RSTCD AND NVL(eng.IS_DELETED, 0) = 0 ")
|
.append("LEFT JOIN SD_ENGINFO_B_H eng ON eng.STCD = t.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("LEFT JOIN SD_HYDROBASE hb ON hb.BASEID = eng.BASE_ID AND NVL(hb.IS_DELETED, 0) = 0 ")
|
||||||
.append("LEFT JOIN SD_HBRV_DIC hbrv ON hbrv.CODE = eng.HBRVCD AND NVL(hbrv.IS_DELETED, 0) = 0 ")
|
.append("LEFT JOIN SD_HBRV_DIC hbrv ON hbrv.HBRVCD = eng.HBRVCD AND NVL(hbrv.IS_DELETED, 0) = 0 ")
|
||||||
.append("LEFT JOIN SD_RVCD_DIC rvcd ON rvcd.CODE = eng.RVCD AND NVL(rvcd.IS_DELETED, 0) = 0 ")
|
.append("LEFT JOIN SD_RVCD_DIC rvcd ON rvcd.RVCD = eng.RVCD AND NVL(rvcd.IS_DELETED, 0) = 0 ")
|
||||||
.append("LEFT JOIN SD_ADDVCD_DIC addvcd ON addvcd.CODE = eng.ADDVCD AND NVL(addvcd.IS_DELETED, 0) = 0 ")
|
.append("LEFT JOIN SD_ADDVCD_DIC addvcd ON addvcd.ADDVCD = eng.ADDVCD ")
|
||||||
.append("LEFT JOIN MS_ALONG_B along ON along.RVCD = eng.HBRVCD AND along.CODE = 'common' AND NVL(along.IS_DELETED, 0) = 0 ")
|
.append("LEFT JOIN MS_ALONG_B along ON along.RVCD = eng.HBRVCD AND along.CODE = 'common' AND NVL(along.IS_DELETED, 0) = 0 ")
|
||||||
.append("LEFT JOIN ( ")
|
.append("LEFT JOIN ( ")
|
||||||
.append(" SELECT det.SORT, cfg.RVCD, det.STCD ")
|
.append(" SELECT det.SORT, cfg.RVCD, det.STCD ")
|
||||||
@ -4607,13 +4607,19 @@ public class EnvWqDataServiceImpl implements EnvWqDataService {
|
|||||||
.append(" WHERE NVL(det.IS_DELETED, 0) = 0 AND NVL(cfg.IS_DELETED, 0) = 0 AND cfg.CODE = 'common' ")
|
.append(" WHERE NVL(det.IS_DELETED, 0) = 0 AND NVL(cfg.IS_DELETED, 0) = 0 AND cfg.CODE = 'common' ")
|
||||||
.append(") siteSort ON siteSort.RVCD = eng.HBRVCD AND siteSort.STCD = t.STCD ")
|
.append(") siteSort ON siteSort.RVCD = eng.HBRVCD AND siteSort.STCD = t.STCD ")
|
||||||
.append("WHERE NVL(t.IS_DELETED, 0) = 0 ")
|
.append("WHERE NVL(t.IS_DELETED, 0) = 0 ")
|
||||||
.append("AND NVL(t.USFL, 1) = 1 ")
|
.append("AND NVL(t.USFL, 1) = 1 ");
|
||||||
.append("AND t.LGTD IS NOT NULL ")
|
|
||||||
.append("AND t.LTTD IS NOT NULL ");
|
Map<String, Object> paramMap = new HashMap<>();
|
||||||
|
String filterSql = buildWqPointFilterCondition(dataSourceRequest.getFilter(), paramMap, new int[]{0});
|
||||||
|
if (StrUtil.isNotBlank(filterSql)) {
|
||||||
|
sql.append(" AND ").append(filterSql);
|
||||||
|
}
|
||||||
|
|
||||||
|
sql.append(buildWqPointOrderBySql(dataSourceRequest.getSort()));
|
||||||
|
|
||||||
DataSourceLoadOptionsBase loadOptions = dataSourceRequest.toDevRequest();
|
DataSourceLoadOptionsBase loadOptions = dataSourceRequest.toDevRequest();
|
||||||
Page<?> page = loadOptions == null ? null : QgcQueryWrapperUtil.buildPage(loadOptions, loadOptions.getSkip(), loadOptions.getTake());
|
Page<?> page = loadOptions == null ? null : QgcQueryWrapperUtil.buildPage(loadOptions, loadOptions.getSkip(), loadOptions.getTake());
|
||||||
List<EnvWqAnchorPointVo> wqVoList = microservicDynamicSQLMapper.pageAllListWithResultType(page, sql.toString(), new HashMap<>(), EnvWqAnchorPointVo.class);
|
List<EnvWqAnchorPointVo> wqVoList = microservicDynamicSQLMapper.pageAllListWithResultType(page, sql.toString(), paramMap, EnvWqAnchorPointVo.class);
|
||||||
|
|
||||||
if (CollectionUtils.isNotEmpty(wqVoList)) {
|
if (CollectionUtils.isNotEmpty(wqVoList)) {
|
||||||
List<String> stcdList = wqVoList.stream()
|
List<String> stcdList = wqVoList.stream()
|
||||||
@ -4622,15 +4628,7 @@ public class EnvWqDataServiceImpl implements EnvWqDataService {
|
|||||||
.distinct()
|
.distinct()
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
String wqDataSql = "SELECT STCD, TM, WQGRD, SFDB, WTMP, PH, DOX, CODMN, CODCR, BOD5, NH3N, TP, TN, CU, ZN, F, SE, ARS, HG, CD, CR6, PB, CN, VLPH, OIL, LAS, S2, FCG, CL, SO4, NO3, THRD, COND, FE, MN, AL, CHLA, CLARITY, TU, CYANO, TOD " +
|
List<EnvWqDataVo> wqDataList = queryWqDataByStcdBatch(stcdList);
|
||||||
"FROM ( " +
|
|
||||||
" SELECT t.*, ROW_NUMBER() OVER (PARTITION BY t.STCD ORDER BY t.TM DESC) AS rn " +
|
|
||||||
" FROM SD_WQ_R t " +
|
|
||||||
" WHERE t.STCD IN (" + String.join(",", stcdList.stream().map(s -> "'" + s + "'").collect(Collectors.toList())) + ") " +
|
|
||||||
" AND NVL(t.IS_DELETED, 0) = 0 " +
|
|
||||||
") WHERE rn = 1";
|
|
||||||
|
|
||||||
List<EnvWqDataVo> wqDataList = microservicDynamicSQLMapper.getAllListWithResultType(wqDataSql, new HashMap<>(), EnvWqDataVo.class);
|
|
||||||
Map<String, EnvWqDataVo> wqDataMap = wqDataList.stream()
|
Map<String, EnvWqDataVo> wqDataMap = wqDataList.stream()
|
||||||
.collect(Collectors.toMap(EnvWqDataVo::getStcd, Function.identity(), (oldValue, newValue) -> newValue));
|
.collect(Collectors.toMap(EnvWqDataVo::getStcd, Function.identity(), (oldValue, newValue) -> newValue));
|
||||||
|
|
||||||
@ -4706,6 +4704,205 @@ public class EnvWqDataServiceImpl implements EnvWqDataService {
|
|||||||
return dataSourceResult;
|
return dataSourceResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private List<EnvWqDataVo> queryWqDataByStcdBatch(List<String> stcdList) {
|
||||||
|
List<EnvWqDataVo> resultList = new ArrayList<>();
|
||||||
|
if (CollectionUtils.isEmpty(stcdList)) {
|
||||||
|
return resultList;
|
||||||
|
}
|
||||||
|
|
||||||
|
int batchSize = 500;
|
||||||
|
List<List<String>> batches = CollUtil.split(stcdList, batchSize);
|
||||||
|
|
||||||
|
for (List<String> batch : batches) {
|
||||||
|
String stcdParams = batch.stream()
|
||||||
|
.map(s -> "'" + s + "'")
|
||||||
|
.collect(Collectors.joining(","));
|
||||||
|
|
||||||
|
String wqDataSql = "SELECT STCD, TM, WQGRD, SFDB, WTMP, PH, DOX, CODMN, CODCR, BOD5, NH3N, TP, TN, CU, ZN, F, SE, ARS, HG, CD, CR6, PB, CN, VLPH, OIL, LAS, S2, FCG, CL, SO4, NO3, THRD, COND, FE, MN, AL, CHLA, CLARITY, TU, CYANO, TOD " +
|
||||||
|
"FROM ( " +
|
||||||
|
" SELECT t.*, ROW_NUMBER() OVER (PARTITION BY t.STCD ORDER BY t.TM DESC) AS rn " +
|
||||||
|
" FROM SD_WQ_R t " +
|
||||||
|
" WHERE t.STCD IN (" + stcdParams + ") " +
|
||||||
|
" AND NVL(t.IS_DELETED, 0) = 0 " +
|
||||||
|
") WHERE rn = 1";
|
||||||
|
|
||||||
|
List<EnvWqDataVo> batchList = microservicDynamicSQLMapper.getAllListWithResultType(wqDataSql, new HashMap<>(), EnvWqDataVo.class);
|
||||||
|
if (CollectionUtils.isNotEmpty(batchList)) {
|
||||||
|
resultList.addAll(batchList);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return resultList;
|
||||||
|
}
|
||||||
|
|
||||||
|
private String buildWqPointFilterCondition(DataSourceRequest.FilterDescriptor filter,
|
||||||
|
Map<String, Object> paramMap,
|
||||||
|
int[] indexHolder) {
|
||||||
|
if (filter == null) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
if (CollUtil.isNotEmpty(filter.getFilters())) {
|
||||||
|
List<String> childConditions = new ArrayList<>();
|
||||||
|
for (DataSourceRequest.FilterDescriptor child : filter.getFilters()) {
|
||||||
|
String childSql = buildWqPointFilterCondition(child, paramMap, indexHolder);
|
||||||
|
if (StrUtil.isNotBlank(childSql)) {
|
||||||
|
childConditions.add(childSql);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (childConditions.isEmpty()) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
String logic = "or".equalsIgnoreCase(filter.getLogic()) ? " OR " : " AND ";
|
||||||
|
return "(" + String.join(logic, childConditions) + ")";
|
||||||
|
}
|
||||||
|
String column = mapWqPointColumn(filter.getField());
|
||||||
|
if (StrUtil.isBlank(column)) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
String operator = StrUtil.blankToDefault(filter.getOperator(), "eq").toLowerCase();
|
||||||
|
Object value = filter.getValue();
|
||||||
|
if ("isnull".equals(operator)) {
|
||||||
|
return column + " IS NULL";
|
||||||
|
}
|
||||||
|
if ("isnotnull".equals(operator)) {
|
||||||
|
return column + " IS NOT NULL";
|
||||||
|
}
|
||||||
|
if ("isempty".equals(operator)) {
|
||||||
|
return "(" + column + " IS NULL OR " + column + " = '')";
|
||||||
|
}
|
||||||
|
if ("isnotempty".equals(operator)) {
|
||||||
|
return "(" + column + " IS NOT NULL AND " + column + " <> '')";
|
||||||
|
}
|
||||||
|
if ("in".equals(operator) || "ni".equals(operator)) {
|
||||||
|
List<Object> values = normalizeFilterValues(value);
|
||||||
|
if (values.isEmpty()) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
List<String> placeholders = new ArrayList<>();
|
||||||
|
for (Object item : values) {
|
||||||
|
String key = "wqPointParam" + indexHolder[0]++;
|
||||||
|
paramMap.put(key, item);
|
||||||
|
placeholders.add("#{map." + key + "}");
|
||||||
|
}
|
||||||
|
return column + ("ni".equals(operator) ? " NOT IN (" : " IN (") + String.join(", ", placeholders) + ")";
|
||||||
|
}
|
||||||
|
if (value == null) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
String key = "wqPointParam" + indexHolder[0]++;
|
||||||
|
return switch (operator) {
|
||||||
|
case "eq" -> {
|
||||||
|
paramMap.put(key, value);
|
||||||
|
yield column + " = #{map." + key + "}";
|
||||||
|
}
|
||||||
|
case "neq" -> {
|
||||||
|
paramMap.put(key, value);
|
||||||
|
yield column + " <> #{map." + key + "}";
|
||||||
|
}
|
||||||
|
case "contains" -> {
|
||||||
|
paramMap.put(key, "%" + value + "%");
|
||||||
|
yield column + " LIKE #{map." + key + "}";
|
||||||
|
}
|
||||||
|
case "doesnotcontain" -> {
|
||||||
|
paramMap.put(key, "%" + value + "%");
|
||||||
|
yield column + " NOT LIKE #{map." + key + "}";
|
||||||
|
}
|
||||||
|
case "startswith" -> {
|
||||||
|
paramMap.put(key, value + "%");
|
||||||
|
yield column + " LIKE #{map." + key + "}";
|
||||||
|
}
|
||||||
|
case "endswith" -> {
|
||||||
|
paramMap.put(key, "%" + value);
|
||||||
|
yield column + " LIKE #{map." + key + "}";
|
||||||
|
}
|
||||||
|
case "gt" -> {
|
||||||
|
paramMap.put(key, value);
|
||||||
|
yield column + " > #{map." + key + "}";
|
||||||
|
}
|
||||||
|
case "gte" -> {
|
||||||
|
paramMap.put(key, value);
|
||||||
|
yield column + " >= #{map." + key + "}";
|
||||||
|
}
|
||||||
|
case "lt" -> {
|
||||||
|
paramMap.put(key, value);
|
||||||
|
yield column + " < #{map." + key + "}";
|
||||||
|
}
|
||||||
|
case "lte" -> {
|
||||||
|
paramMap.put(key, value);
|
||||||
|
yield column + " <= #{map." + key + "}";
|
||||||
|
}
|
||||||
|
default -> "";
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
private String mapWqPointColumn(String field) {
|
||||||
|
if (StrUtil.isBlank(field)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return switch (field) {
|
||||||
|
case "stcd" -> "t.STCD";
|
||||||
|
case "stnm" -> "t.STNM";
|
||||||
|
case "sttp" -> "t.STTP";
|
||||||
|
case "sttpCode" -> "t.STTP";
|
||||||
|
case "lgtd" -> "t.LGTD";
|
||||||
|
case "lttd" -> "t.LTTD";
|
||||||
|
case "dtmel" -> "t.ELEV";
|
||||||
|
case "stlc" -> "t.STLC";
|
||||||
|
case "wwqtg" -> "t.WWQTG";
|
||||||
|
case "dtinType" -> "t.DTIN_TYPE";
|
||||||
|
case "rstcd" -> "t.RSTCD";
|
||||||
|
case "fhstcd" -> "t.FHSTCD";
|
||||||
|
case "orderIndex" -> "t.ORDER_INDEX";
|
||||||
|
case "ennm" -> "eng.ENNM";
|
||||||
|
case "baseName" -> "hb.BASENAME";
|
||||||
|
case "baseId" -> "hb.BASEID";
|
||||||
|
case "hbrvcd" -> "eng.HBRVCD";
|
||||||
|
case "hbrvcdName" -> "hbrv.HBRVNM";
|
||||||
|
case "rvcdName" -> "rvcd.RVNM";
|
||||||
|
case "addvcdName" -> "addvcd.ADDVNM";
|
||||||
|
case "rvcdStepSort" -> "rvcdStepSort";
|
||||||
|
case "rstcdStepSort" -> "rstcdStepSort";
|
||||||
|
case "siteStepSort" -> "siteStepSort";
|
||||||
|
case "baseStepSort" -> "baseStepSort";
|
||||||
|
default -> null;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
private String buildWqPointOrderBySql(List<DataSourceRequest.SortDescriptor> sortList) {
|
||||||
|
if (CollUtil.isEmpty(sortList)) {
|
||||||
|
return " ORDER BY baseStepSort ASC, rvcdStepSort ASC, rstcdStepSort ASC, siteStepSort ASC, stnm ASC";
|
||||||
|
}
|
||||||
|
List<String> orderItems = new ArrayList<>();
|
||||||
|
for (DataSourceRequest.SortDescriptor sortDescriptor : sortList) {
|
||||||
|
if (sortDescriptor == null || StrUtil.isBlank(sortDescriptor.getField())) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
String column = mapWqPointColumn(sortDescriptor.getField());
|
||||||
|
if (StrUtil.isBlank(column)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
String dir = "desc".equalsIgnoreCase(sortDescriptor.getDir()) || "des".equalsIgnoreCase(sortDescriptor.getDir()) ? "DESC" : "ASC";
|
||||||
|
orderItems.add(column + " " + dir);
|
||||||
|
}
|
||||||
|
if (orderItems.isEmpty()) {
|
||||||
|
return " ORDER BY baseStepSort ASC, rvcdStepSort ASC, rstcdStepSort ASC, siteStepSort ASC, stnm ASC";
|
||||||
|
}
|
||||||
|
return " ORDER BY " + String.join(", ", orderItems);
|
||||||
|
}
|
||||||
|
|
||||||
|
private List<Object> normalizeFilterValues(Object value) {
|
||||||
|
List<Object> values = new ArrayList<>();
|
||||||
|
if (value instanceof List) {
|
||||||
|
((List<?>) value).forEach(v -> {
|
||||||
|
if (v != null) {
|
||||||
|
values.add(v);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else if (value != null) {
|
||||||
|
values.add(value);
|
||||||
|
}
|
||||||
|
return values;
|
||||||
|
}
|
||||||
|
|
||||||
private String getAnchorPoint(EnvWqAnchorPointVo anchorPointVo) {
|
private String getAnchorPoint(EnvWqAnchorPointVo anchorPointVo) {
|
||||||
Integer dtinType = anchorPointVo.getDtinType();
|
Integer dtinType = anchorPointVo.getDtinType();
|
||||||
Integer sfdb = anchorPointVo.getSfdb();
|
Integer sfdb = anchorPointVo.getSfdb();
|
||||||
|
|||||||
@ -327,4 +327,10 @@ public class SdWTMonitorController {
|
|||||||
public ResponseResult getFacilityPointKendoListCust(@RequestBody DataSourceRequest dataSourceRequest) {
|
public ResponseResult getFacilityPointKendoListCust(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||||
return ResponseResult.successData(sdWtMonitorService.getFacilityPointKendoListCust(dataSourceRequest));
|
return ResponseResult.successData(sdWtMonitorService.getFacilityPointKendoListCust(dataSourceRequest));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping("/getEngTempPointList/GetKendoListCust")
|
||||||
|
@Operation(summary = "电站出入库水温描点")
|
||||||
|
public ResponseResult getEngTempPointListKendoListCust(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||||
|
return ResponseResult.successData(sdWtMonitorService.getEngTempPointListKendoListCust(dataSourceRequest));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,104 @@
|
|||||||
|
package com.yfd.platform.qgc_env.wt.entity.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Schema(description = "水温监测点描点VO")
|
||||||
|
public class WaterTempMapVO {
|
||||||
|
|
||||||
|
@Schema(description = "站点编码")
|
||||||
|
private String stcd;
|
||||||
|
|
||||||
|
@Schema(description = "站名")
|
||||||
|
private String stnm;
|
||||||
|
|
||||||
|
@Schema(description = "关联电站名称")
|
||||||
|
private String ennm;
|
||||||
|
|
||||||
|
@Schema(description = "站点类型编码")
|
||||||
|
private String sttpCode;
|
||||||
|
|
||||||
|
@Schema(description = "数据接入类型:0=自建,1=国家建,2=人工")
|
||||||
|
private String dtinType;
|
||||||
|
|
||||||
|
@Schema(description = "站点类型")
|
||||||
|
private String sttp;
|
||||||
|
|
||||||
|
@Schema(description = "锚点类型")
|
||||||
|
private String sttpMap;
|
||||||
|
|
||||||
|
@Schema(description = "栖息地名称")
|
||||||
|
private String fhstnm;
|
||||||
|
|
||||||
|
@Schema(description = "是否是垂向水温,0=否 1=是")
|
||||||
|
private Integer enfc;
|
||||||
|
|
||||||
|
@Schema(description = "所在位置")
|
||||||
|
private String location;
|
||||||
|
|
||||||
|
@Schema(description = "运行状态")
|
||||||
|
private String status = "1";
|
||||||
|
|
||||||
|
@Schema(description = "水温")
|
||||||
|
private BigDecimal temperature;
|
||||||
|
|
||||||
|
@Schema(description = "日期")
|
||||||
|
private Date tm;
|
||||||
|
|
||||||
|
@Schema(description = "经度")
|
||||||
|
private BigDecimal lgtd;
|
||||||
|
|
||||||
|
@Schema(description = "纬度")
|
||||||
|
private BigDecimal lttd;
|
||||||
|
|
||||||
|
@Schema(description = "高程")
|
||||||
|
private BigDecimal dtmel;
|
||||||
|
|
||||||
|
@Schema(description = "弹框站点名称")
|
||||||
|
private String titleName;
|
||||||
|
|
||||||
|
@Schema(description = "监测方式")
|
||||||
|
private Integer mway;
|
||||||
|
|
||||||
|
@Schema(description = "垂向水温类型:1=浮动式 2=固定式")
|
||||||
|
private Integer deviceType;
|
||||||
|
|
||||||
|
@Schema(description = "流域编码")
|
||||||
|
private String rvcd;
|
||||||
|
|
||||||
|
@Schema(description = "行政编码")
|
||||||
|
private String addvcd;
|
||||||
|
|
||||||
|
@Schema(description = "基地编码")
|
||||||
|
private String baseId;
|
||||||
|
|
||||||
|
@Schema(description = "关联电站编码")
|
||||||
|
private String rstcds;
|
||||||
|
|
||||||
|
@Schema(description = "描点状态")
|
||||||
|
private String anchoPointState;
|
||||||
|
|
||||||
|
@Schema(description = "地图避让")
|
||||||
|
private Integer distance;
|
||||||
|
|
||||||
|
@Schema(description = "垂向水温站点浮窗数据")
|
||||||
|
private Object wtvtInfo;
|
||||||
|
|
||||||
|
@Schema(description = "水温值")
|
||||||
|
private BigDecimal value;
|
||||||
|
|
||||||
|
@Schema(description = "排序")
|
||||||
|
private Integer orderIndex;
|
||||||
|
|
||||||
|
@Schema(description = "出入库标识 (1 入库水温, 2 出库水温 ,3 非出入库水温)")
|
||||||
|
private Integer ioType;
|
||||||
|
|
||||||
|
public void setTemperature(BigDecimal temperature) {
|
||||||
|
this.temperature = temperature;
|
||||||
|
this.value = temperature;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -14,6 +14,7 @@ import com.yfd.platform.qgc_env.wt.entity.vo.WtrvAmendSaveVo;
|
|||||||
import com.yfd.platform.qgc_env.wt.entity.vo.WtrvVo;
|
import com.yfd.platform.qgc_env.wt.entity.vo.WtrvVo;
|
||||||
import com.yfd.platform.qgc_env.wt.entity.vo.WtrvAmendResultVo;
|
import com.yfd.platform.qgc_env.wt.entity.vo.WtrvAmendResultVo;
|
||||||
import com.yfd.platform.qgc_env.wt.entity.vo.DwSlowFacilityMapVO;
|
import com.yfd.platform.qgc_env.wt.entity.vo.DwSlowFacilityMapVO;
|
||||||
|
import com.yfd.platform.qgc_env.wt.entity.vo.WaterTempMapVO;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@ -54,4 +55,6 @@ public interface SdWtMonitorService {
|
|||||||
List<RstcdTreeInfoVo> getWtvtDefaultTreeStcd(DataSourceRequest dataSourceRequest);
|
List<RstcdTreeInfoVo> getWtvtDefaultTreeStcd(DataSourceRequest dataSourceRequest);
|
||||||
|
|
||||||
DataSourceResult<DwSlowFacilityMapVO> getFacilityPointKendoListCust(DataSourceRequest dataSourceRequest);
|
DataSourceResult<DwSlowFacilityMapVO> getFacilityPointKendoListCust(DataSourceRequest dataSourceRequest);
|
||||||
|
|
||||||
|
DataSourceResult<WaterTempMapVO> getEngTempPointListKendoListCust(DataSourceRequest dataSourceRequest);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -21,10 +21,12 @@ import com.yfd.platform.qgc_env.wt.entity.vo.WtrvAmendResultVo;
|
|||||||
import com.yfd.platform.qgc_env.wt.entity.vo.WtrvAmendSaveVo;
|
import com.yfd.platform.qgc_env.wt.entity.vo.WtrvAmendSaveVo;
|
||||||
import com.yfd.platform.qgc_env.wt.entity.vo.WtrvVo;
|
import com.yfd.platform.qgc_env.wt.entity.vo.WtrvVo;
|
||||||
import com.yfd.platform.qgc_env.wt.entity.vo.DwSlowFacilityMapVO;
|
import com.yfd.platform.qgc_env.wt.entity.vo.DwSlowFacilityMapVO;
|
||||||
|
import com.yfd.platform.qgc_env.wt.entity.vo.WaterTempMapVO;
|
||||||
import com.yfd.platform.qgc_env.wt.mapper.SdWtMonitorMapper;
|
import com.yfd.platform.qgc_env.wt.mapper.SdWtMonitorMapper;
|
||||||
import com.yfd.platform.qgc_env.wt.utils.SiteAvoidanceUtils;
|
import com.yfd.platform.qgc_env.wt.utils.SiteAvoidanceUtils;
|
||||||
import com.yfd.platform.qgc_env.wt.service.SdWtMonitorService;
|
import com.yfd.platform.qgc_env.wt.service.SdWtMonitorService;
|
||||||
import com.yfd.platform.utils.QgcQueryWrapperUtil;
|
import com.yfd.platform.utils.QgcQueryWrapperUtil;
|
||||||
|
import com.yfd.platform.utils.SecurityUtils;
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import org.springframework.jdbc.core.JdbcTemplate;
|
import org.springframework.jdbc.core.JdbcTemplate;
|
||||||
@ -114,7 +116,7 @@ public class SdWtMonitorServiceImpl implements SdWtMonitorService {
|
|||||||
"t.JCDT AS jcdt, " +
|
"t.JCDT AS jcdt, " +
|
||||||
"t.WDDT AS wddt, " +
|
"t.WDDT AS wddt, " +
|
||||||
"t.BLDSTT_CODE AS bldsttCode, " +
|
"t.BLDSTT_CODE AS bldsttCode, " +
|
||||||
"CASE WHEN t.BLDSTT_CODE =2 THEN '已建' WHEN t.BLDSTT_CODE =1 THEN '在建' ELSE '未建/规划' END AS bldsttCcodeName, "+
|
"CASE WHEN t.BLDSTT_CODE =2 THEN '已建' WHEN t.BLDSTT_CODE =1 THEN '在建' ELSE '未建/规划' END AS bldsttCcodeName, " +
|
||||||
"t.INV AS inv, " +
|
"t.INV AS inv, " +
|
||||||
"t.INVINMN AS invinmn, " +
|
"t.INVINMN AS invinmn, " +
|
||||||
"t.INTRODUCE AS introduce, " +
|
"t.INTRODUCE AS introduce, " +
|
||||||
@ -126,7 +128,7 @@ public class SdWtMonitorServiceImpl implements SdWtMonitorService {
|
|||||||
"t.DTIN_TYPE AS dtinType, " +
|
"t.DTIN_TYPE AS dtinType, " +
|
||||||
"t.DTIN_TM AS dtinTm, " +
|
"t.DTIN_TM AS dtinTm, " +
|
||||||
"t.MWAY AS mway, " +
|
"t.MWAY AS mway, " +
|
||||||
"CASE NVL(t.MWAY, 0) WHEN 1 THEN '人工' WHEN 2 THEN '自动' ELSE '未知' END AS mwayName , "+
|
"CASE NVL(t.MWAY, 0) WHEN 1 THEN '人工' WHEN 2 THEN '自动' ELSE '未知' END AS mwayName , " +
|
||||||
"t.STINDX AS stindx, " +
|
"t.STINDX AS stindx, " +
|
||||||
"t.ORDER_INDEX AS orderIndex, " +
|
"t.ORDER_INDEX AS orderIndex, " +
|
||||||
"t.DMSTCD AS dmstcd, " +
|
"t.DMSTCD AS dmstcd, " +
|
||||||
@ -444,7 +446,7 @@ public class SdWtMonitorServiceImpl implements SdWtMonitorService {
|
|||||||
}
|
}
|
||||||
sql.append(buildYearDetailOrderBySql(dataSourceRequest == null ? null : dataSourceRequest.getSort()));
|
sql.append(buildYearDetailOrderBySql(dataSourceRequest == null ? null : dataSourceRequest.getSort()));
|
||||||
|
|
||||||
Page<?> page = QgcQueryWrapperUtil.buildPage(loadOptions,loadOptions.getSkip(), loadOptions.getTake());
|
Page<?> page = QgcQueryWrapperUtil.buildPage(loadOptions, loadOptions.getSkip(), loadOptions.getTake());
|
||||||
List<SdYearDetailVO> list = microservicDynamicSQLMapper.pageAllListWithResultType(page, sql.toString(), paramMap, SdYearDetailVO.class);
|
List<SdYearDetailVO> list = microservicDynamicSQLMapper.pageAllListWithResultType(page, sql.toString(), paramMap, SdYearDetailVO.class);
|
||||||
for (SdYearDetailVO vo : list) {
|
for (SdYearDetailVO vo : list) {
|
||||||
vo.setActualTemp(vo.getWt());
|
vo.setActualTemp(vo.getWt());
|
||||||
@ -489,7 +491,7 @@ public class SdWtMonitorServiceImpl implements SdWtMonitorService {
|
|||||||
}
|
}
|
||||||
sql.append(buildMonthDetailOrderBySql(dataSourceRequest == null ? null : dataSourceRequest.getSort()));
|
sql.append(buildMonthDetailOrderBySql(dataSourceRequest == null ? null : dataSourceRequest.getSort()));
|
||||||
|
|
||||||
Page<?> page = QgcQueryWrapperUtil.buildPage(loadOptions,loadOptions.getSkip(), loadOptions.getTake());
|
Page<?> page = QgcQueryWrapperUtil.buildPage(loadOptions, loadOptions.getSkip(), loadOptions.getTake());
|
||||||
List<SdMonthDetailVO> list = microservicDynamicSQLMapper.pageAllListWithResultType(page, sql.toString(), paramMap, SdMonthDetailVO.class);
|
List<SdMonthDetailVO> list = microservicDynamicSQLMapper.pageAllListWithResultType(page, sql.toString(), paramMap, SdMonthDetailVO.class);
|
||||||
DataSourceResult<SdMonthDetailVO> result = new DataSourceResult<>();
|
DataSourceResult<SdMonthDetailVO> result = new DataSourceResult<>();
|
||||||
result.setData(list);
|
result.setData(list);
|
||||||
@ -517,7 +519,7 @@ public class SdWtMonitorServiceImpl implements SdWtMonitorService {
|
|||||||
Map<String, Object> paramMap = new HashMap<>();
|
Map<String, Object> paramMap = new HashMap<>();
|
||||||
paramMap.put("stcd", stcd);
|
paramMap.put("stcd", stcd);
|
||||||
WtrvVo vo = (WtrvVo) microservicDynamicSQLMapper.getOneBySqlWithResultType(sql, paramMap, WtrvVo.class);
|
WtrvVo vo = (WtrvVo) microservicDynamicSQLMapper.getOneBySqlWithResultType(sql, paramMap, WtrvVo.class);
|
||||||
if (vo == null ) {
|
if (vo == null) {
|
||||||
return buildDefaultWtrvVo(stcd);
|
return buildDefaultWtrvVo(stcd);
|
||||||
}
|
}
|
||||||
return vo;
|
return vo;
|
||||||
@ -576,7 +578,7 @@ public class SdWtMonitorServiceImpl implements SdWtMonitorService {
|
|||||||
paramMap.put("baseId", baseId);
|
paramMap.put("baseId", baseId);
|
||||||
}
|
}
|
||||||
|
|
||||||
Page<?> page = QgcQueryWrapperUtil.buildPage(loadOptions,loadOptions.getSkip(), loadOptions.getTake());
|
Page<?> page = QgcQueryWrapperUtil.buildPage(loadOptions, loadOptions.getSkip(), loadOptions.getTake());
|
||||||
List<WtFishVo> wtFishVoList = microservicDynamicSQLMapper.pageAllListWithResultType(page, sql.toString(), paramMap, WtFishVo.class);
|
List<WtFishVo> wtFishVoList = microservicDynamicSQLMapper.pageAllListWithResultType(page, sql.toString(), paramMap, WtFishVo.class);
|
||||||
String hbrvcd = wtFishVoList.isEmpty() ? null : wtFishVoList.get(0).getHbrvcd();
|
String hbrvcd = wtFishVoList.isEmpty() ? null : wtFishVoList.get(0).getHbrvcd();
|
||||||
|
|
||||||
@ -849,7 +851,7 @@ public class SdWtMonitorServiceImpl implements SdWtMonitorService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
sql.append(buildVmsstbprptOrderBySql(dataSourceRequest.getSort()));
|
sql.append(buildVmsstbprptOrderBySql(dataSourceRequest.getSort()));
|
||||||
Page<?> page = QgcQueryWrapperUtil.buildPage(loadOptions,loadOptions.getSkip(), loadOptions.getTake());
|
Page<?> page = QgcQueryWrapperUtil.buildPage(loadOptions, loadOptions.getSkip(), loadOptions.getTake());
|
||||||
List<SdWtBaseInfoVO> list = microservicDynamicSQLMapper.pageAllListWithResultType(page, sql.toString(), paramMap, SdWtBaseInfoVO.class);
|
List<SdWtBaseInfoVO> list = microservicDynamicSQLMapper.pageAllListWithResultType(page, sql.toString(), paramMap, SdWtBaseInfoVO.class);
|
||||||
|
|
||||||
DataSourceResult<SdWtBaseInfoVO> result = new DataSourceResult<>();
|
DataSourceResult<SdWtBaseInfoVO> result = new DataSourceResult<>();
|
||||||
@ -1152,7 +1154,7 @@ public class SdWtMonitorServiceImpl implements SdWtMonitorService {
|
|||||||
|
|
||||||
appendCxDetailOrderBy(sql, dataSourceRequest.getSort());
|
appendCxDetailOrderBy(sql, dataSourceRequest.getSort());
|
||||||
DataSourceLoadOptionsBase loadOptions = dataSourceRequest.toDevRequest();
|
DataSourceLoadOptionsBase loadOptions = dataSourceRequest.toDevRequest();
|
||||||
Page<?> page = QgcQueryWrapperUtil.buildPage(loadOptions,loadOptions.getSkip(), loadOptions.getTake());
|
Page<?> page = QgcQueryWrapperUtil.buildPage(loadOptions, loadOptions.getSkip(), loadOptions.getTake());
|
||||||
List<WtCxDetailRow> rowList = microservicDynamicSQLMapper.pageAllListWithResultType(page, sql.toString(), paramMap, WtCxDetailRow.class);
|
List<WtCxDetailRow> rowList = microservicDynamicSQLMapper.pageAllListWithResultType(page, sql.toString(), paramMap, WtCxDetailRow.class);
|
||||||
|
|
||||||
List<Double> verticalList = getVerticals(rowList, wtDeviceType);
|
List<Double> verticalList = getVerticals(rowList, wtDeviceType);
|
||||||
@ -2871,7 +2873,7 @@ public class SdWtMonitorServiceImpl implements SdWtMonitorService {
|
|||||||
.append("sttp.STTP_NAME AS sttpName, ")
|
.append("sttp.STTP_NAME AS sttpName, ")
|
||||||
.append("t.DTIN AS dtin, ")
|
.append("t.DTIN AS dtin, ")
|
||||||
.append("NULL AS stdSstate ")
|
.append("NULL AS stdSstate ")
|
||||||
.append("FROM SD_DFLTKW_B_H t ")
|
.append("FROM SD_DW_B_H t ")
|
||||||
.append("LEFT JOIN SD_ENGINFO_B_H eng ON eng.STCD = t.RSTCD AND NVL(eng.IS_DELETED, 0) = 0 ")
|
.append("LEFT JOIN SD_ENGINFO_B_H eng ON eng.STCD = t.RSTCD AND NVL(eng.IS_DELETED, 0) = 0 ")
|
||||||
.append("LEFT JOIN SD_STTP_B sttp ON sttp.STTP_CODE = t.STTP AND NVL(sttp.IS_DELETED, 0) = 0 ")
|
.append("LEFT JOIN SD_STTP_B sttp ON sttp.STTP_CODE = t.STTP AND NVL(sttp.IS_DELETED, 0) = 0 ")
|
||||||
.append("WHERE NVL(t.IS_DELETED, 0) = 0 ")
|
.append("WHERE NVL(t.IS_DELETED, 0) = 0 ")
|
||||||
@ -2921,4 +2923,139 @@ public class SdWtMonitorServiceImpl implements SdWtMonitorService {
|
|||||||
return dataSourceResult;
|
return dataSourceResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public DataSourceResult<WaterTempMapVO> getEngTempPointListKendoListCust(DataSourceRequest dataSourceRequest) {
|
||||||
|
DataSourceResult<WaterTempMapVO> dataSourceResult = new DataSourceResult<>();
|
||||||
|
dataSourceResult.setAggregates(new HashMap<>());
|
||||||
|
|
||||||
|
if (dataSourceRequest == null) {
|
||||||
|
dataSourceResult.setData(new ArrayList<>());
|
||||||
|
dataSourceResult.setTotal(0L);
|
||||||
|
return dataSourceResult;
|
||||||
|
}
|
||||||
|
|
||||||
|
DataSourceLoadOptionsBase loadOptions = dataSourceRequest.toDevRequest();
|
||||||
|
String dtinType = QgcQueryWrapperUtil.getFilterFieldValue(loadOptions, "flag");
|
||||||
|
String sttpCode = QgcQueryWrapperUtil.getFilterFieldValue(loadOptions, "sttpCode");
|
||||||
|
String fhFlag = QgcQueryWrapperUtil.getFilterFieldValue(loadOptions, "fhFlag");
|
||||||
|
|
||||||
|
StringBuilder sql = new StringBuilder("SELECT\n" +
|
||||||
|
" wt.STCD AS stcd,\n" +
|
||||||
|
" wt.STNM AS stnm,\n" +
|
||||||
|
" wt.STNM AS titleName,\n" +
|
||||||
|
" wt.RSTCD AS rstcds,\n" +
|
||||||
|
" CASE\n" +
|
||||||
|
" WHEN wt.STTP = 'WTVT' THEN 1\n" +
|
||||||
|
" ELSE 0\n" +
|
||||||
|
" END AS enfc,\n" +
|
||||||
|
" 'WT' AS sttp,\n" +
|
||||||
|
" wt.STTP AS sttpCode,\n" +
|
||||||
|
" 'WT' AS sttpMap,\n" +
|
||||||
|
" wt.LGTD AS lgtd,\n" +
|
||||||
|
" wt.LTTD AS lttd,\n" +
|
||||||
|
" wt.WT_DEVICE_TYPE AS deviceType,\n" +
|
||||||
|
" wt.ELEV AS dtmel,\n" +
|
||||||
|
// " wt.FHSTNM AS fhstnm,\n" +
|
||||||
|
" wt.MWAY AS mway,\n" +
|
||||||
|
" eng.RVCD AS rvcd,\n" +
|
||||||
|
" eng.ADDVCD AS addvcd,\n" +
|
||||||
|
" eng.BASE_ID AS baseId,\n" +
|
||||||
|
" eng.ENNM AS ennm,\n" +
|
||||||
|
" wt.ORDER_INDEX AS orderIndex,\n" +
|
||||||
|
" wt.DTIN_TYPE AS dtinType,\n" +
|
||||||
|
" (CASE\n" +
|
||||||
|
" WHEN wt.STTP = 'WTRV' AND rel.ENG_IWT_CODE IS NOT NULL THEN 1\n" +
|
||||||
|
" WHEN wt.STTP = 'WTRV' AND rel.ENG_DWT_CODE IS NOT NULL THEN 2\n" +
|
||||||
|
" WHEN wt.STTP = 'WTRV' AND rel.ENG_IWT_CODE IS NULL AND rel.ENG_DWT_CODE IS NULL THEN 3\n" +
|
||||||
|
" END) AS ioType\n" +
|
||||||
|
"FROM SD_WT_B_H wt\n" +
|
||||||
|
"LEFT JOIN SD_ENGINFO_B_H eng ON eng.STCD = wt.RSTCD AND NVL(eng.IS_DELETED, 0) = 0\n" +
|
||||||
|
"LEFT JOIN SD_WTENGRLTN_B rel ON rel.STCD = wt.STCD AND NVL(rel.IS_DELETED, 0) = 0\n" +
|
||||||
|
"WHERE NVL(wt.IS_DELETED, 0) = 0 AND wt.STTP IN ('WTRV', 'WTVT') AND wt.LGTD IS NOT NULL AND wt.LTTD IS NOT NULL ");
|
||||||
|
Map<String, Object> paramMap = new HashMap<>();
|
||||||
|
String filterSql = QgcQueryWrapperUtil.buildFilterCondition(
|
||||||
|
dataSourceRequest == null ? null : dataSourceRequest.getFilter(),
|
||||||
|
paramMap,
|
||||||
|
new int[]{0},
|
||||||
|
this::mapWeFvColumn
|
||||||
|
);
|
||||||
|
if (StrUtil.isNotBlank(filterSql)) {
|
||||||
|
sql.append("AND ").append(filterSql).append(" ");
|
||||||
|
}
|
||||||
|
// if (StrUtil.isNotBlank(sttpCode)) {
|
||||||
|
// sql.append(" AND wt.STTP = #{map.sttpCode} ");
|
||||||
|
// }
|
||||||
|
// if (StrUtil.isNotBlank(dtinType)) {
|
||||||
|
// sql.append(" AND wt.DTIN_TYPE = #{map.dtinType} ");
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// Map<String, Object> paramMap = new HashMap<>();
|
||||||
|
// if (StrUtil.isNotBlank(sttpCode)) {
|
||||||
|
// paramMap.put("sttpCode", sttpCode);
|
||||||
|
// }
|
||||||
|
// if (StrUtil.isNotBlank(dtinType)) {
|
||||||
|
// paramMap.put("dtinType", dtinType);
|
||||||
|
// }
|
||||||
|
|
||||||
|
List<DataSourceRequest.SortDescriptor> sort = dataSourceRequest.getSort();
|
||||||
|
if (sort != null && !sort.isEmpty()) {
|
||||||
|
sql.append(" ORDER BY ");
|
||||||
|
for (int i = 0; i < sort.size(); i++) {
|
||||||
|
String field = sort.get(i).getField();
|
||||||
|
String dir = sort.get(i).getDir();
|
||||||
|
sql.append(field).append(" ").append(dir);
|
||||||
|
if (i < sort.size() - 1) {
|
||||||
|
sql.append(",");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
sql.append(" ORDER BY wt.ORDER_INDEX ASC ");
|
||||||
|
}
|
||||||
|
|
||||||
|
Page<?> page = QgcQueryWrapperUtil.buildPage(loadOptions, loadOptions.getSkip(), loadOptions.getTake());
|
||||||
|
List<WaterTempMapVO> resultList = microservicDynamicSQLMapper.pageAllListWithResultType(page, sql.toString(), paramMap, WaterTempMapVO.class);
|
||||||
|
|
||||||
|
for (WaterTempMapVO vo : resultList) {
|
||||||
|
if (StrUtil.isNotBlank(fhFlag)) {
|
||||||
|
vo.setAnchoPointState("fhwt_legend");
|
||||||
|
} else if (StrUtil.isNotBlank(dtinType)) {
|
||||||
|
if ("0".equals(dtinType)) {
|
||||||
|
vo.setAnchoPointState("stinfo_wtzj_legend");
|
||||||
|
} else if ("2".equals(dtinType)) {
|
||||||
|
vo.setAnchoPointState("stinfo_wtrg_legend");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (vo.getMway() != null && vo.getMway() == 1) {
|
||||||
|
vo.setAnchoPointState("WT_1");
|
||||||
|
} else if (vo.getMway() != null && vo.getMway() == 2) {
|
||||||
|
vo.setAnchoPointState("WT_2");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
SiteAvoidanceUtils.calcSiteMapLev(resultList,
|
||||||
|
WaterTempMapVO::getStcd,
|
||||||
|
WaterTempMapVO::getLgtd,
|
||||||
|
WaterTempMapVO::getLttd,
|
||||||
|
WaterTempMapVO::getAnchoPointState,
|
||||||
|
WaterTempMapVO::setDistance);
|
||||||
|
|
||||||
|
dataSourceResult.setData(resultList);
|
||||||
|
dataSourceResult.setTotal(page == null ? resultList.size() : page.getTotal());
|
||||||
|
return dataSourceResult;
|
||||||
|
}
|
||||||
|
|
||||||
|
private String mapWeFvColumn(String field) {
|
||||||
|
if (StrUtil.isBlank(field)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return switch (field.toLowerCase()) {
|
||||||
|
case "sttpcode" -> "wt.STTP";
|
||||||
|
case "dtintype" -> "wt.DTIN_TYPE";
|
||||||
|
case "lgtd" -> "wt.LGTD";
|
||||||
|
case "fhstcd" -> "wt.FHSTCD";
|
||||||
|
default -> null;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -82,4 +82,10 @@ public class ZqMonitorController {
|
|||||||
public ResponseResult getStcdInfo(@RequestParam String stcd) {
|
public ResponseResult getStcdInfo(@RequestParam String stcd) {
|
||||||
return ResponseResult.successData(zqMonitorService.getStcdInfo(stcd));
|
return ResponseResult.successData(zqMonitorService.getStcdInfo(stcd));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping("/zqpoint/GetKendoListCust")
|
||||||
|
@Operation(summary = "流量站锚点接口")
|
||||||
|
public ResponseResult getZqPointKendoListCust(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||||
|
return ResponseResult.successData(zqMonitorService.getZqPointKendoListCust(dataSourceRequest));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,93 @@
|
|||||||
|
package com.yfd.platform.qgc_env.zq.entity.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Schema(description = "流量站锚点VO")
|
||||||
|
public class ZqPoint {
|
||||||
|
|
||||||
|
@Schema(description = "站点编码")
|
||||||
|
private String stcd;
|
||||||
|
|
||||||
|
@Schema(description = "站名")
|
||||||
|
private String stnm;
|
||||||
|
|
||||||
|
@Schema(description = "流域名称")
|
||||||
|
private String rvnm;
|
||||||
|
|
||||||
|
@Schema(description = "关联电站名称")
|
||||||
|
private String ennm;
|
||||||
|
|
||||||
|
@Schema(description = "栖息地编码")
|
||||||
|
private String fhstcd;
|
||||||
|
|
||||||
|
@Schema(description = "栖息地名称")
|
||||||
|
private String fhstnm;
|
||||||
|
|
||||||
|
@Schema(description = "站点类型名称")
|
||||||
|
private String sttpName;
|
||||||
|
|
||||||
|
@Schema(description = "日期")
|
||||||
|
private Date tm;
|
||||||
|
|
||||||
|
@Schema(description = "水位")
|
||||||
|
private BigDecimal z;
|
||||||
|
|
||||||
|
@Schema(description = "流量")
|
||||||
|
private BigDecimal q;
|
||||||
|
|
||||||
|
@Schema(description = "流速")
|
||||||
|
private BigDecimal v;
|
||||||
|
|
||||||
|
@Schema(description = "数据接入类型")
|
||||||
|
private String dtinType;
|
||||||
|
|
||||||
|
@Schema(description = "站点排序")
|
||||||
|
private Integer siteStepSort;
|
||||||
|
|
||||||
|
@Schema(description = "站点类型编码")
|
||||||
|
private String sttpCode;
|
||||||
|
|
||||||
|
@Schema(description = "站点类型")
|
||||||
|
private String sttp;
|
||||||
|
|
||||||
|
@Schema(description = "锚点类型")
|
||||||
|
private String sttpMap;
|
||||||
|
|
||||||
|
@Schema(description = "经度")
|
||||||
|
private BigDecimal lgtd;
|
||||||
|
|
||||||
|
@Schema(description = "纬度")
|
||||||
|
private BigDecimal lttd;
|
||||||
|
|
||||||
|
@Schema(description = "高程")
|
||||||
|
private BigDecimal dtmel;
|
||||||
|
|
||||||
|
@Schema(description = "描点状态")
|
||||||
|
private String anchoPointState;
|
||||||
|
|
||||||
|
@Schema(description = "弹框站点名称")
|
||||||
|
private String titleName;
|
||||||
|
|
||||||
|
@Schema(description = "流域编码")
|
||||||
|
private String rvcd;
|
||||||
|
|
||||||
|
@Schema(description = "行政编码")
|
||||||
|
private String addvcd;
|
||||||
|
|
||||||
|
@Schema(description = "基地编码")
|
||||||
|
private String baseId;
|
||||||
|
|
||||||
|
@Schema(description = "关联电站编码")
|
||||||
|
private String rstcds;
|
||||||
|
|
||||||
|
@Schema(description = "地图避让")
|
||||||
|
private Integer distance;
|
||||||
|
|
||||||
|
@Schema(description = "站址")
|
||||||
|
private String stlc;
|
||||||
|
}
|
||||||
@ -4,6 +4,7 @@ import com.yfd.platform.common.DataSourceRequest;
|
|||||||
import com.yfd.platform.common.DataSourceResult;
|
import com.yfd.platform.common.DataSourceResult;
|
||||||
import com.yfd.platform.qgc_base.entity.vo.BatchDeleteAo;
|
import com.yfd.platform.qgc_base.entity.vo.BatchDeleteAo;
|
||||||
import com.yfd.platform.qgc_env.zq.entity.vo.ZqBaseInfoVo;
|
import com.yfd.platform.qgc_env.zq.entity.vo.ZqBaseInfoVo;
|
||||||
|
import com.yfd.platform.qgc_env.zq.entity.vo.ZqPoint;
|
||||||
import com.yfd.platform.qgc_env.zq.entity.vo.ZqRiverDayDataVo;
|
import com.yfd.platform.qgc_env.zq.entity.vo.ZqRiverDayDataVo;
|
||||||
import com.yfd.platform.qgc_env.zq.entity.vo.ZqRiverDrtpDataVo;
|
import com.yfd.platform.qgc_env.zq.entity.vo.ZqRiverDrtpDataVo;
|
||||||
import com.yfd.platform.qgc_env.zq.entity.vo.ZqRiverDataVo;
|
import com.yfd.platform.qgc_env.zq.entity.vo.ZqRiverDataVo;
|
||||||
@ -25,4 +26,6 @@ public interface ZqMonitorService {
|
|||||||
boolean updateRiverRData(java.util.Map<String, Object> updateData, String source);
|
boolean updateRiverRData(java.util.Map<String, Object> updateData, String source);
|
||||||
|
|
||||||
ZqBaseInfoVo getStcdInfo(String stcd);
|
ZqBaseInfoVo getStcdInfo(String stcd);
|
||||||
|
|
||||||
|
DataSourceResult<ZqPoint> getZqPointKendoListCust(DataSourceRequest dataSourceRequest);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -18,9 +18,11 @@ import com.yfd.platform.qgc_base.mapper.MsOperationLogDetailMapper;
|
|||||||
import com.yfd.platform.qgc_base.mapper.MsOperationLogMapper;
|
import com.yfd.platform.qgc_base.mapper.MsOperationLogMapper;
|
||||||
import com.yfd.platform.qgc_env.fh.entity.vo.HabitatVo;
|
import com.yfd.platform.qgc_env.fh.entity.vo.HabitatVo;
|
||||||
import com.yfd.platform.qgc_env.zq.entity.vo.ZqBaseInfoVo;
|
import com.yfd.platform.qgc_env.zq.entity.vo.ZqBaseInfoVo;
|
||||||
|
import com.yfd.platform.qgc_env.zq.entity.vo.ZqPoint;
|
||||||
import com.yfd.platform.qgc_env.zq.entity.vo.ZqRiverDayDataVo;
|
import com.yfd.platform.qgc_env.zq.entity.vo.ZqRiverDayDataVo;
|
||||||
import com.yfd.platform.qgc_env.zq.entity.vo.ZqRiverDrtpDataVo;
|
import com.yfd.platform.qgc_env.zq.entity.vo.ZqRiverDrtpDataVo;
|
||||||
import com.yfd.platform.qgc_env.zq.entity.vo.ZqRiverDataVo;
|
import com.yfd.platform.qgc_env.zq.entity.vo.ZqRiverDataVo;
|
||||||
|
import com.yfd.platform.qgc_env.wt.utils.SiteAvoidanceUtils;
|
||||||
import com.yfd.platform.qgc_env.zq.service.ZqMonitorService;
|
import com.yfd.platform.qgc_env.zq.service.ZqMonitorService;
|
||||||
import com.yfd.platform.utils.QgcQueryWrapperUtil;
|
import com.yfd.platform.utils.QgcQueryWrapperUtil;
|
||||||
import com.yfd.platform.utils.SecurityUtils;
|
import com.yfd.platform.utils.SecurityUtils;
|
||||||
@ -2370,4 +2372,78 @@ public class ZqMonitorServiceImpl implements ZqMonitorService {
|
|||||||
}
|
}
|
||||||
return " ORDER BY " + String.join(", ", orderColumns);
|
return " ORDER BY " + String.join(", ", orderColumns);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public DataSourceResult<ZqPoint> getZqPointKendoListCust(DataSourceRequest dataSourceRequest) {
|
||||||
|
DataSourceResult<ZqPoint> dataSourceResult = new DataSourceResult<>();
|
||||||
|
dataSourceResult.setAggregates(new HashMap<>());
|
||||||
|
|
||||||
|
if (dataSourceRequest == null) {
|
||||||
|
dataSourceResult.setData(new ArrayList<>());
|
||||||
|
dataSourceResult.setTotal(0L);
|
||||||
|
return dataSourceResult;
|
||||||
|
}
|
||||||
|
|
||||||
|
StringBuilder sql = new StringBuilder("SELECT\n" +
|
||||||
|
" rb.STCD AS stcd,\n" +
|
||||||
|
" rb.STNM AS stnm,\n" +
|
||||||
|
" rb.STNM AS titleName,\n" +
|
||||||
|
" rb.RSTCD AS rstcds,\n" +
|
||||||
|
" CASE\n" +
|
||||||
|
" WHEN rb.DTIN_TYPE = 0 THEN 'zjllz'\n" +
|
||||||
|
" WHEN rb.DTIN_TYPE = 1 THEN 'gjllz'\n" +
|
||||||
|
" ELSE ''\n" +
|
||||||
|
" END AS anchoPointState,\n" +
|
||||||
|
" 'ZQ' AS sttpMap,\n" +
|
||||||
|
" rb.STTP AS sttp,\n" +
|
||||||
|
" rb.STTP AS sttpCode,\n" +
|
||||||
|
" rb.LGTD AS lgtd,\n" +
|
||||||
|
" rb.LTTD AS lttd,\n" +
|
||||||
|
" rb.ELEV AS dtmel,\n" +
|
||||||
|
" rb.STLC AS stlc,\n" +
|
||||||
|
" eng.RVCD AS rvcd,\n" +
|
||||||
|
" eng.ADDVCD AS addvcd,\n" +
|
||||||
|
" rv.RVNM AS rvnm,\n" +
|
||||||
|
" eng.BASE_ID AS baseId,\n" +
|
||||||
|
" eng.ENNM AS ennm,\n" +
|
||||||
|
" rb.FHSTCD AS fhstcd,\n" +
|
||||||
|
" fh.STNM AS fhstnm,\n" +
|
||||||
|
" rb.DTIN_TYPE AS dtinType,\n" +
|
||||||
|
" NVL(siteSort.SORT, 999999) AS siteStepSort\n" +
|
||||||
|
"FROM SD_RIVER_B_H rb\n" +
|
||||||
|
"LEFT JOIN SD_ENGINFO_B_H eng ON eng.STCD = rb.RSTCD AND NVL(eng.IS_DELETED, 0) = 0\n" +
|
||||||
|
"LEFT JOIN SD_RVCD_DIC rv ON rv.RVCD = eng.RVCD\n" +
|
||||||
|
"LEFT JOIN SD_RIVER_B_H fh ON fh.STCD = rb.FHSTCD AND NVL(fh.IS_DELETED, 0) = 0\n" +
|
||||||
|
"LEFT JOIN (\n" +
|
||||||
|
" SELECT det.SORT, cfg.RVCD, det.STCD\n" +
|
||||||
|
" FROM MS_ALONGDET_B det\n" +
|
||||||
|
" INNER JOIN MS_ALONG_B cfg ON det.ALONG_ID = cfg.ID\n" +
|
||||||
|
" WHERE NVL(det.IS_DELETED, 0) = 0 AND NVL(cfg.IS_DELETED, 0) = 0 AND cfg.CODE = 'common'\n" +
|
||||||
|
") siteSort ON siteSort.RVCD = eng.HBRVCD AND siteSort.STCD = rb.STCD\n" +
|
||||||
|
"WHERE NVL(rb.IS_DELETED, 0) = 0 AND rb.STTP = 'ZQ' AND rb.LGTD IS NOT NULL AND rb.LTTD IS NOT NULL ");
|
||||||
|
|
||||||
|
Map<String, Object> paramMap = new HashMap<>();
|
||||||
|
|
||||||
|
DataSourceLoadOptionsBase loadOptions = dataSourceRequest.toDevRequest();
|
||||||
|
String filterSql = buildMsstbprptFilterCondition(dataSourceRequest == null ? null : dataSourceRequest.getFilter(), paramMap, new int[]{0});
|
||||||
|
if (StrUtil.isNotBlank(filterSql)) {
|
||||||
|
sql.append(" AND ").append(filterSql).append(" ");
|
||||||
|
}
|
||||||
|
|
||||||
|
sql.append(" ORDER BY siteStepSort ASC ");
|
||||||
|
|
||||||
|
Page<?> page = QgcQueryWrapperUtil.buildPage(loadOptions, loadOptions.getSkip(), loadOptions.getTake());
|
||||||
|
List<ZqPoint> resultList = microservicDynamicSQLMapper.pageAllListWithResultType(page, sql.toString(), paramMap, ZqPoint.class);
|
||||||
|
|
||||||
|
SiteAvoidanceUtils.calcSiteMapLev(resultList,
|
||||||
|
ZqPoint::getStcd,
|
||||||
|
ZqPoint::getLgtd,
|
||||||
|
ZqPoint::getLttd,
|
||||||
|
ZqPoint::getAnchoPointState,
|
||||||
|
ZqPoint::setDistance);
|
||||||
|
|
||||||
|
dataSourceResult.setData(resultList);
|
||||||
|
dataSourceResult.setTotal(page == null ? resultList.size() : page.getTotal());
|
||||||
|
return dataSourceResult;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -61,6 +61,7 @@ public class MapLegendController {
|
|||||||
// 执行分页查询
|
// 执行分页查询
|
||||||
Page<MsMaplegendB> page = DataSourceRequestUtil.getPage(dataSourceRequest);
|
Page<MsMaplegendB> page = DataSourceRequestUtil.getPage(dataSourceRequest);
|
||||||
Page<MsMaplegendB> resultPage;
|
Page<MsMaplegendB> resultPage;
|
||||||
|
wrapper.eq("IS_DELETED", 0);
|
||||||
if (page != null) {
|
if (page != null) {
|
||||||
resultPage = mapLegendService.page(page, wrapper);
|
resultPage = mapLegendService.page(page, wrapper);
|
||||||
} else {
|
} else {
|
||||||
@ -110,7 +111,7 @@ public class MapLegendController {
|
|||||||
String parentId = entity.getParentId();
|
String parentId = entity.getParentId();
|
||||||
if (parentId != null && parentMap.containsKey(parentId)) {
|
if (parentId != null && parentMap.containsKey(parentId)) {
|
||||||
MsMaplegendB parent = parentMap.get(parentId);
|
MsMaplegendB parent = parentMap.get(parentId);
|
||||||
entity.setParentCode(parent.getCode());
|
entity.setParentCode(parent.getNameEn());
|
||||||
entity.setParentName(parent.getName());
|
entity.setParentName(parent.getName());
|
||||||
} else {
|
} else {
|
||||||
entity.setParentCode(null);
|
entity.setParentCode(null);
|
||||||
@ -161,18 +162,6 @@ public class MapLegendController {
|
|||||||
if (legend.getDataType() == null) {
|
if (legend.getDataType() == null) {
|
||||||
throw new BizException("图例数据类型(dataType: 1=结构,2=数据)不能为空.");
|
throw new BizException("图例数据类型(dataType: 1=结构,2=数据)不能为空.");
|
||||||
}
|
}
|
||||||
if (legend.getDataType() == 2 && StrUtil.isBlank(legend.getLayerCode())) {
|
|
||||||
throw new BizException("关联的图层编码(layerCode)不能为空.");
|
|
||||||
}
|
|
||||||
if (StrUtil.isNotBlank(legend.getName())){
|
|
||||||
if(StrUtil.isBlank(legend.getGroupName())){
|
|
||||||
legend.setGroupName(legend.getName());
|
|
||||||
}
|
|
||||||
if(StrUtil.isBlank(legend.getParentName())){
|
|
||||||
legend.setGroupName(legend.getName());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
legend.setRecordUser(SecurityUtils.getUserId());
|
|
||||||
mapLegendService.saveOrUpdate(legend);
|
mapLegendService.saveOrUpdate(legend);
|
||||||
return ResponseResult.success("保存成功.");
|
return ResponseResult.success("保存成功.");
|
||||||
}
|
}
|
||||||
|
|||||||
@ -35,7 +35,7 @@ public interface MsMapmoduleBMapper extends BaseMapper<MsMapmoduleB> {
|
|||||||
+ "<when test=\"templateId != null and templateId != ''\"> AND BMM.TEMPLATE_ID = #{templateId}</when>"
|
+ "<when test=\"templateId != null and templateId != ''\"> AND BMM.TEMPLATE_ID = #{templateId}</when>"
|
||||||
+ "<otherwise> AND (BMM.TEMPLATE_ID IS NULL OR BMM.TEMPLATE_ID = '00000000-0000-0000-0000-000000000000')</otherwise>"
|
+ "<otherwise> AND (BMM.TEMPLATE_ID IS NULL OR BMM.TEMPLATE_ID = '00000000-0000-0000-0000-000000000000')</otherwise>"
|
||||||
+ "</choose>"
|
+ "</choose>"
|
||||||
+ "WHERE BML.ENABLE = 1 AND (BML.TYPE NOT IN ('YXDT','DXDT','SLDT') OR BML.TYPE IS NULL) "
|
+ "WHERE BML.ENABLE = 1 AND BML.IS_DELETED =0 AND (BML.TYPE NOT IN ('YXDT','DXDT','SLDT') OR BML.TYPE IS NULL) "
|
||||||
+ "ORDER BY BML.ORDER_INDEX"
|
+ "ORDER BY BML.ORDER_INDEX"
|
||||||
+ "</script>")
|
+ "</script>")
|
||||||
List<MapLayerVo> getMapLayerTree(@Param("moduleId") String moduleId, @Param("sid") String sid,
|
List<MapLayerVo> getMapLayerTree(@Param("moduleId") String moduleId, @Param("sid") String sid,
|
||||||
|
|||||||
@ -178,8 +178,8 @@ public class MapLegendBizServiceImpl implements IMapLegendBizService {
|
|||||||
collect.forEach((str, mapLegendVoList) -> {
|
collect.forEach((str, mapLegendVoList) -> {
|
||||||
MapLegendVo mapLegendVo = new MapLegendVo();
|
MapLegendVo mapLegendVo = new MapLegendVo();
|
||||||
mapLegendVo.setName(str);
|
mapLegendVo.setName(str);
|
||||||
mapLegendVo.setPSort(mapLegendVoList.get(0).getPSort());
|
mapLegendVo.setPSort(mapLegendVoList.getFirst().getPSort());
|
||||||
mapLegendVo.setLayerCode(finalLayerCodeMap.get(mapLegendVoList.get(0).getParentId()));
|
mapLegendVo.setLayerCode(finalLayerCodeMap.get(mapLegendVoList.getFirst().getParentId()));
|
||||||
// 按子级分组名分组
|
// 按子级分组名分组
|
||||||
Map<String, List<MapLegendVo>> collect1 = mapLegendVoList.stream()
|
Map<String, List<MapLegendVo>> collect1 = mapLegendVoList.stream()
|
||||||
.collect(Collectors.groupingBy(MapLegendVo::getGroupName));
|
.collect(Collectors.groupingBy(MapLegendVo::getGroupName));
|
||||||
@ -188,7 +188,7 @@ public class MapLegendBizServiceImpl implements IMapLegendBizService {
|
|||||||
List<MapLegendVo> list1 = collect1.get(groupNameStr);
|
List<MapLegendVo> list1 = collect1.get(groupNameStr);
|
||||||
// 如果子级和父级名称相同,则不用子级
|
// 如果子级和父级名称相同,则不用子级
|
||||||
if (groupNameStr.equalsIgnoreCase(str)) {
|
if (groupNameStr.equalsIgnoreCase(str)) {
|
||||||
childrenList = list1;
|
childrenList.addAll(list1);
|
||||||
} else {
|
} else {
|
||||||
MapLegendVo mapLegendVoChild = new MapLegendVo();
|
MapLegendVo mapLegendVoChild = new MapLegendVo();
|
||||||
mapLegendVoChild.setName(groupNameStr);
|
mapLegendVoChild.setName(groupNameStr);
|
||||||
|
|||||||
@ -11,10 +11,13 @@ import com.yfd.platform.qgc_sys.mapLayer.domain.MsMapmoduleB;
|
|||||||
import com.yfd.platform.qgc_sys.mapLayer.mapper.MsMaplegendBMapper;
|
import com.yfd.platform.qgc_sys.mapLayer.mapper.MsMaplegendBMapper;
|
||||||
import com.yfd.platform.qgc_sys.mapLayer.mapper.MsMapmoduleBMapper;
|
import com.yfd.platform.qgc_sys.mapLayer.mapper.MsMapmoduleBMapper;
|
||||||
import com.yfd.platform.qgc_sys.mapLayer.service.IMapLegendService;
|
import com.yfd.platform.qgc_sys.mapLayer.service.IMapLegendService;
|
||||||
|
import com.yfd.platform.utils.SecurityUtils;
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.Comparator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 地图图例基础服务实现
|
* 地图图例基础服务实现
|
||||||
@ -71,7 +74,7 @@ public class MapLegendServiceImpl extends ServiceImpl<MsMaplegendBMapper, MsMapl
|
|||||||
// 判断父级是否存在
|
// 判断父级是否存在
|
||||||
if (StrUtil.isBlank(legend.getParentId())) {
|
if (StrUtil.isBlank(legend.getParentId())) {
|
||||||
this.removeById(id); // 逻辑删除
|
this.removeById(id); // 逻辑删除
|
||||||
return;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 删除数据
|
// 删除数据
|
||||||
@ -82,7 +85,8 @@ public class MapLegendServiceImpl extends ServiceImpl<MsMaplegendBMapper, MsMapl
|
|||||||
MsMaplegendB parent = this.getById(legend.getParentId());
|
MsMaplegendB parent = this.getById(legend.getParentId());
|
||||||
if (parent != null) {
|
if (parent != null) {
|
||||||
LambdaQueryWrapper<MsMaplegendB> siblingWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<MsMaplegendB> siblingWrapper = new LambdaQueryWrapper<>();
|
||||||
siblingWrapper.eq(MsMaplegendB::getParentId, parent.getId());
|
siblingWrapper.eq(MsMaplegendB::getParentId, parent.getId())
|
||||||
|
.eq(MsMaplegendB::getIsDeleted, 0);
|
||||||
List<MsMaplegendB> siblings = this.list(siblingWrapper);
|
List<MsMaplegendB> siblings = this.list(siblingWrapper);
|
||||||
if (siblings.size() == 1 && id.equals(siblings.get(0).getId())) {
|
if (siblings.size() == 1 && id.equals(siblings.get(0).getId())) {
|
||||||
MsMaplegendB updateParent = new MsMaplegendB();
|
MsMaplegendB updateParent = new MsMaplegendB();
|
||||||
@ -94,4 +98,143 @@ public class MapLegendServiceImpl extends ServiceImpl<MsMaplegendBMapper, MsMapl
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean saveOrUpdate(MsMaplegendB legend) {
|
||||||
|
if (hasSameCode(legend)) {
|
||||||
|
throw new BizException("存在相同编码的数据");
|
||||||
|
}
|
||||||
|
if (StrUtil.isNotBlank(legend.getId())) {
|
||||||
|
updateSetLegend(legend);
|
||||||
|
super.updateById(legend);
|
||||||
|
} else {
|
||||||
|
if (legend.getDataType() == 2 && StrUtil.isBlank(legend.getParentId())) {
|
||||||
|
throw new BizException("请先创建图例父级结构再添加数据.");
|
||||||
|
}
|
||||||
|
if (legend.getDataType() == 2 && StrUtil.isBlank(legend.getLayerCode())) {
|
||||||
|
throw new BizException("图层编码不能为空.");
|
||||||
|
}
|
||||||
|
List<MsMaplegendB> list = getSubLegendList(legend.getParentId());
|
||||||
|
Integer maxOrderIndex = getMaxOrderIndex(list);
|
||||||
|
legend.setOrderIndex(maxOrderIndex + 1);
|
||||||
|
MsMaplegendB parentLegend = null;
|
||||||
|
if (StrUtil.isNotBlank(legend.getParentId())) {
|
||||||
|
parentLegend = this.getById(legend.getParentId());
|
||||||
|
if (parentLegend == null) {
|
||||||
|
throw new BizException("获取父级图例信息失败.请检查父级图例(parentId)是否存在.");
|
||||||
|
}
|
||||||
|
legend.setFullPath(parentLegend.getFullPath() + legend.getId() + ",");
|
||||||
|
legend.setTreeLevel(parentLegend.getTreeLevel() + 1);
|
||||||
|
legend.setHasChildren(0);
|
||||||
|
} else {
|
||||||
|
legend.setTreeLevel(1);
|
||||||
|
legend.setFullPath(legend.getId() + ",");
|
||||||
|
legend.setHasChildren(0);
|
||||||
|
}
|
||||||
|
if (legend.getDataType() == 1) {
|
||||||
|
legend.setGroupName(legend.getName());
|
||||||
|
legend.setParentName(legend.getName());
|
||||||
|
} else {
|
||||||
|
String fullPath = parentLegend.getFullPath();
|
||||||
|
if (StrUtil.isNotBlank(fullPath)) {
|
||||||
|
String[] path = fullPath.split(",");
|
||||||
|
if (path.length == 1) {
|
||||||
|
legend.setGroupName(parentLegend.getName());
|
||||||
|
legend.setParentName(parentLegend.getName());
|
||||||
|
} else if (path.length == 2) {
|
||||||
|
legend.setGroupName(parentLegend.getName());
|
||||||
|
MsMaplegendB root = this.getById(path[0]);
|
||||||
|
if (root == null) {
|
||||||
|
legend.setParentName(parentLegend.getParentName());
|
||||||
|
} else {
|
||||||
|
legend.setParentName(root.getName());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (parentLegend != null && StrUtil.isBlank(legend.getLayerCode())) {
|
||||||
|
legend.setLayerCode(parentLegend.getLayerCode());
|
||||||
|
}
|
||||||
|
legend.setIfShow(0);
|
||||||
|
legend.setInternal(0);
|
||||||
|
legend.setEnable(0);
|
||||||
|
legend.setRecordUser(SecurityUtils.getUserId());
|
||||||
|
legend.setModifyUser(SecurityUtils.getUserId());
|
||||||
|
this.save(legend);
|
||||||
|
if (parentLegend != null) {
|
||||||
|
MsMaplegendB temp = new MsMaplegendB();
|
||||||
|
temp.setId(parentLegend.getId());
|
||||||
|
temp.setHasChildren(1);
|
||||||
|
this.updateById(temp);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void updateSetLegend(MsMaplegendB legend) {
|
||||||
|
if (StrUtil.isNotBlank(legend.getParentId())) {
|
||||||
|
MsMaplegendB parent = this.getById(legend.getParentId());
|
||||||
|
if (parent != null) {
|
||||||
|
if (legend.getDataType() == 1) {
|
||||||
|
legend.setParentName(parent.getName());
|
||||||
|
legend.setFullPath(parent.getFullPath() + legend.getId() + ",");
|
||||||
|
} else {
|
||||||
|
legend.setGroupName(parent.getName());
|
||||||
|
if (StrUtil.isNotBlank(parent.getFullPath())) {
|
||||||
|
MsMaplegendB root = this.getById(parent.getFullPath().split(",")[0]);
|
||||||
|
if (root != null) {
|
||||||
|
legend.setParentName(root.getName());
|
||||||
|
}
|
||||||
|
legend.setFullPath(parent.getFullPath() + legend.getId() + ",");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (StrUtil.isNotBlank(legend.getFullPath())) {
|
||||||
|
legend.setTreeLevel(legend.getFullPath().split(",").length);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (legend.getDataType() == 1) {
|
||||||
|
legend.setGroupName(legend.getName());
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (legend.getDataType() == 1) {
|
||||||
|
legend.setGroupName(legend.getName());
|
||||||
|
legend.setParentName(legend.getName());
|
||||||
|
}
|
||||||
|
legend.setFullPath(legend.getId() + ",");
|
||||||
|
legend.setTreeLevel(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<MsMaplegendB> getSubLegendList(String parentId) {
|
||||||
|
if (StrUtil.isNotBlank(parentId)) {
|
||||||
|
return this.lambdaQuery()
|
||||||
|
.eq(MsMaplegendB::getParentId, parentId)
|
||||||
|
.orderByAsc(MsMaplegendB::getOrderIndex)
|
||||||
|
.list();
|
||||||
|
} else {
|
||||||
|
return this.lambdaQuery()
|
||||||
|
.eq(MsMaplegendB::getTreeLevel, 1)
|
||||||
|
.orderByAsc(MsMaplegendB::getOrderIndex)
|
||||||
|
.list();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getMaxOrderIndex(List<MsMaplegendB> list) {
|
||||||
|
if (CollectionUtil.isEmpty(list)) {
|
||||||
|
return 0;
|
||||||
|
} else {
|
||||||
|
return list.stream()
|
||||||
|
.sorted(Comparator.comparing(MsMaplegendB::getOrderIndex).reversed())
|
||||||
|
.toList()
|
||||||
|
.getFirst()
|
||||||
|
.getOrderIndex();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean hasSameCode(MsMaplegendB legend) {
|
||||||
|
List<MsMaplegendB> list = this.lambdaQuery()
|
||||||
|
.eq(MsMaplegendB::getNameEn, legend.getNameEn())
|
||||||
|
.list();
|
||||||
|
return !CollectionUtil.isEmpty(list) && !list.get(0).getId().equals(legend.getId());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@ -68,8 +68,10 @@ public class MapmoduleBController {
|
|||||||
// 3. 执行分页查询
|
// 3. 执行分页查询
|
||||||
Page<MsMapmoduleB> resultPage;
|
Page<MsMapmoduleB> resultPage;
|
||||||
if (page != null) {
|
if (page != null) {
|
||||||
|
wrapper.eq("IS_DELETED", 0);
|
||||||
resultPage = mapmoduleBService.page(page, wrapper);
|
resultPage = mapmoduleBService.page(page, wrapper);
|
||||||
} else {
|
} else {
|
||||||
|
wrapper.eq("IS_DELETED", 0);
|
||||||
List<MsMapmoduleB> list = mapmoduleBService.list(wrapper);
|
List<MsMapmoduleB> list = mapmoduleBService.list(wrapper);
|
||||||
resultPage = new Page<>();
|
resultPage = new Page<>();
|
||||||
resultPage.setRecords(list);
|
resultPage.setRecords(list);
|
||||||
|
|||||||
@ -17,6 +17,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
import java.util.Set;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@ -162,7 +163,7 @@ public class SmsVerifyCodeServiceImpl extends ServiceImpl<SmsVerifyCodeMapper, S
|
|||||||
log.warn("催促短信发送失败:未找到有效的手机号,userIds: {}", ids);
|
log.warn("催促短信发送失败:未找到有效的手机号,userIds: {}", ids);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
List<String> validPhones = sysUsers.stream().map(SysUser::getPhone).filter(this::isValidPhone).toList();
|
Set<String> validPhones = sysUsers.stream().map(SysUser::getPhone).filter(this::isValidPhone).collect(Collectors.toSet());
|
||||||
|
|
||||||
if (validPhones.isEmpty()) {
|
if (validPhones.isEmpty()) {
|
||||||
log.warn("催促短信发送失败:没有合规的手机号");
|
log.warn("催促短信发送失败:没有合规的手机号");
|
||||||
|
|||||||
43
backend/src/main/java/com/yfd/platform/utils/UUIDUtil.java
Normal file
43
backend/src/main/java/com/yfd/platform/utils/UUIDUtil.java
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
package com.yfd.platform.utils;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
public class UUIDUtil {
|
||||||
|
public UUIDUtil() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String generateTenantUUID(String tenantId) {
|
||||||
|
return tenantId + generateUUID();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String generateUUID() {
|
||||||
|
return UUID.randomUUID().toString().replaceAll("-", "");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String generateUUIDWithEnDash() {
|
||||||
|
return UUID.randomUUID().toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String generateUpperUUIDWithEnDash() {
|
||||||
|
return UUID.randomUUID().toString().toUpperCase();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean checkUuid(String uuid) {
|
||||||
|
boolean isUuid = false;
|
||||||
|
return uuid.matches("([0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}?)") ? true : isUuid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String md5ToUUID(String md5) {
|
||||||
|
if (!StringUtils.isBlank(md5) && md5.length() == 32) {
|
||||||
|
md5 = md5.toUpperCase();
|
||||||
|
String var1 = md5.substring(0, 8);
|
||||||
|
String var2 = md5.substring(8, 12);
|
||||||
|
String var3 = md5.substring(12, 16);
|
||||||
|
String var4 = md5.substring(16, 20);
|
||||||
|
String var5 = md5.substring(20);
|
||||||
|
return var1 + "-" + var2 + "-" + var3 + "-" + var4 + "-" + var5;
|
||||||
|
} else {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -111,6 +111,19 @@ spring:
|
|||||||
mvc:
|
mvc:
|
||||||
pathmatch:
|
pathmatch:
|
||||||
matching-strategy: ant_path_matcher
|
matching-strategy: ant_path_matcher
|
||||||
|
data:
|
||||||
|
redis:
|
||||||
|
host: "${REDIS_HOST:172.16.21.142}"
|
||||||
|
port: "${REDIS_PORT:6379}"
|
||||||
|
password: "${REDIS_PASSWORD:zny5678}"
|
||||||
|
database: "${REDIS_DATABASE:15}"
|
||||||
|
timeout: 10000ms
|
||||||
|
lettuce:
|
||||||
|
pool:
|
||||||
|
max-active: 8
|
||||||
|
max-idle: 8
|
||||||
|
min-idle: 2
|
||||||
|
max-wait: 10000ms
|
||||||
servlet:
|
servlet:
|
||||||
multipart:
|
multipart:
|
||||||
max-file-size: 300MB
|
max-file-size: 300MB
|
||||||
|
|||||||
@ -111,10 +111,10 @@ spring:
|
|||||||
matching-strategy: ant_path_matcher
|
matching-strategy: ant_path_matcher
|
||||||
data:
|
data:
|
||||||
redis:
|
redis:
|
||||||
host: ${REDIS_HOST:172.16.21.142}
|
host: "${REDIS_HOST:172.16.21.142}"
|
||||||
port: ${REDIS_PORT:6379}
|
port: "${REDIS_PORT:6379}"
|
||||||
password: ${REDIS_PASSWORD:zny5678}
|
password: "${REDIS_PASSWORD:zny5678}"
|
||||||
database: ${REDIS_DATABASE:15}
|
database: "${REDIS_DATABASE:15}"
|
||||||
timeout: 10000ms
|
timeout: 10000ms
|
||||||
lettuce:
|
lettuce:
|
||||||
pool:
|
pool:
|
||||||
|
|||||||
@ -7,7 +7,7 @@ VITE_APP_TITLE = '水电水利建设项目全过程环境管理信息平台'
|
|||||||
VITE_APP_PORT = 3000
|
VITE_APP_PORT = 3000
|
||||||
VITE_APP_BASE_API = '/dev-api'
|
VITE_APP_BASE_API = '/dev-api'
|
||||||
# 本地环境
|
# 本地环境
|
||||||
VITE_APP_BASE_URL = 'http://10.84.121.127:8093'
|
VITE_APP_BASE_URL = 'http://10.84.111.235:8093'
|
||||||
# 测试环境
|
# 测试环境
|
||||||
# VITE_APP_BASE_URL = 'http://172.16.21.142:8093'
|
# VITE_APP_BASE_URL = 'http://172.16.21.142:8093'
|
||||||
# VITE_APP_BASE_URL = 'http://172.16.21.142:8096'
|
# VITE_APP_BASE_URL = 'http://172.16.21.142:8096'
|
||||||
|
|||||||
@ -7,17 +7,14 @@ VITE_APP_TITLE = '水电水利建设项目全过程环境管理信息平台'
|
|||||||
VITE_APP_PORT = 3000
|
VITE_APP_PORT = 3000
|
||||||
VITE_APP_BASE_API = '/dev-api'
|
VITE_APP_BASE_API = '/dev-api'
|
||||||
# 本地环境
|
# 本地环境
|
||||||
# VITE_APP_BASE_URL = 'http://172.16.54.1:8093'
|
# VITE_APP_BASE_URL = 'http://localhost:8093'
|
||||||
# 测试环境
|
# 测试环境
|
||||||
# VITE_APP_BASE_URL = 'http://172.16.21.142:8093'
|
# VITE_APP_BASE_URL = 'http://172.16.21.142:8093'
|
||||||
# VITE_APP_BASE_URL = 'http://172.16.21.142:8096'
|
# VITE_APP_BASE_URL = 'http://172.16.21.142:8096'
|
||||||
# 汤伟
|
# 汤伟
|
||||||
VITE_APP_BASE_URL = 'http://10.84.121.127:8093'
|
# VITE_APP_BASE_URL = 'http://10.84.111.235:8093'
|
||||||
# 李林
|
# 李林
|
||||||
# VITE_APP_BASE_URL = 'http://10.84.121.43:8093'
|
VITE_APP_BASE_URL = 'http://10.84.111.25:8093'
|
||||||
# VITE_APP_BASE_URL = 'http://192.168.1.162:8093'
|
|
||||||
# 李林
|
|
||||||
# VITE_APP_BASE_URL = 'http://10.84.121.43:8093'
|
|
||||||
|
|
||||||
# 测试环境线上10.84.121.122:
|
# 测试环境线上10.84.121.122:
|
||||||
VITE_APP_TEST_ONLINE_URL = 'https://211.99.26.225:12122'
|
VITE_APP_TEST_ONLINE_URL = 'https://211.99.26.225:12122'
|
||||||
|
|||||||
@ -24,9 +24,11 @@
|
|||||||
| 2026-06-26 | <br /> | 14 | 地图抽吸 碰撞检测 放大到具体层级锚点抽吸了但是 popup 弹框还在显示 | ⚠ | <br /> |
|
| 2026-06-26 | <br /> | 14 | 地图抽吸 碰撞检测 放大到具体层级锚点抽吸了但是 popup 弹框还在显示 | ⚠ | <br /> |
|
||||||
| 2026-06-26 | <br /> | 15 | 地图比如积石峡 放大到层级被公伯峡隐藏掉了,然后在放大才显示 抽吸的问题 | ⚠ | <br /> |
|
| 2026-06-26 | <br /> | 15 | 地图比如积石峡 放大到层级被公伯峡隐藏掉了,然后在放大才显示 抽吸的问题 | ⚠ | <br /> |
|
||||||
| 2026-06-26 | <br /> | 16 | 运行情况 计划开始运行时间 接口没接 | ⚠ | <br /> |
|
| 2026-06-26 | <br /> | 16 | 运行情况 计划开始运行时间 接口没接 | ⚠ | <br /> |
|
||||||
| 2026-07-01 | 王 | 17 | 所有弹框加拖动 | <br /> | <br /> |
|
| 2026-07-01 | 王 | 17 | 所有弹框加拖动 | ✅ | <br /> |
|
||||||
| 2026-07-01 | 王 | 18 | 所有弹框检查宽度有的是固定的 | <br /> | <br /> |
|
| 2026-07-01 | 王 | 18 | 所有弹框检查宽度有的是固定的 | ✅ | <br /> |
|
||||||
|
| 2026-07-01 | 王 | 18 | 所有导出的添加 | <br /> | <br /> |
|
||||||
| 2026-07-02 | 扈 | 19 | 地图点击基地切换偶发性会全部展示出来所有锚点 | <br /> | <br /> |
|
| 2026-07-02 | 扈 | 19 | 地图点击基地切换偶发性会全部展示出来所有锚点 | <br /> | <br /> |
|
||||||
|
| 2026-07-03 | 汤 | 20 | 图例数据关了选中配置需要添加一个字段是默认不显示 | <br /> | <br /> |
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|||||||
@ -106,3 +106,11 @@ export function uploadFile(data: any) {
|
|||||||
headers: { 'Content-Type': 'multipart/form-data' }
|
headers: { 'Content-Type': 'multipart/form-data' }
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
// 所在位置下拉列表
|
||||||
|
export function getAddvcdDropdownByRvcd(params: any) {
|
||||||
|
return request({
|
||||||
|
url: '/base/msalongb/noAuth/GetKendoList',
|
||||||
|
method: 'post',
|
||||||
|
params
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|||||||
@ -3,7 +3,7 @@ import request from '@/utils/request';
|
|||||||
// 获取所有沿程配置数据
|
// 获取所有沿程配置数据
|
||||||
export function getAllConfigTree(data: any) {
|
export function getAllConfigTree(data: any) {
|
||||||
return request({
|
return request({
|
||||||
url: '/api/dec-lygk-base-server/base/msalongb/GetKendoList',
|
url: '/base/msalongb/GetKendoList',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: data
|
data: data
|
||||||
});
|
});
|
||||||
@ -11,7 +11,7 @@ export function getAllConfigTree(data: any) {
|
|||||||
// 保存沿程配置
|
// 保存沿程配置
|
||||||
export function saveBaseWbsb(data: any) {
|
export function saveBaseWbsb(data: any) {
|
||||||
return request({
|
return request({
|
||||||
url: '/api/dec-lygk-base-server/base/wbsb/addOrUpdate',
|
url: '/base/msalongb/save',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: data
|
data: data
|
||||||
});
|
});
|
||||||
@ -19,8 +19,24 @@ export function saveBaseWbsb(data: any) {
|
|||||||
// 删除沿程配置
|
// 删除沿程配置
|
||||||
export function deleteBaseWbsb(data: any) {
|
export function deleteBaseWbsb(data: any) {
|
||||||
return request({
|
return request({
|
||||||
url: '/api/dec-lygk-base-server/base/wbsb/delete',
|
url: '/base/msalongb/delete',
|
||||||
method: 'get',
|
method: 'post',
|
||||||
params: data
|
data
|
||||||
|
});
|
||||||
|
}
|
||||||
|
// 保存沿程配置子节点
|
||||||
|
export function saveBaseWbsbChild(data: any) {
|
||||||
|
return request({
|
||||||
|
url: '/base/msalongb/save',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
export function saveBaseWbsbChildDetail(data: any) {
|
||||||
|
return request({
|
||||||
|
url: '/base/msalongdetb/save',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@ -26,7 +26,7 @@ export function overviewGetOverviewSecond(data: any) {
|
|||||||
data
|
data
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
//增殖站介绍 /api/dec-lygk-base-server/base/msstbprpt/GetKendoList
|
//增殖站介绍
|
||||||
export function msstbprptGetKendoList(data: any) {
|
export function msstbprptGetKendoList(data: any) {
|
||||||
return request({
|
return request({
|
||||||
url: '/fb/msstbprpt/GetKendoList',
|
url: '/fb/msstbprpt/GetKendoList',
|
||||||
|
|||||||
@ -177,7 +177,84 @@
|
|||||||
</a-select>
|
</a-select>
|
||||||
</a-form-item-rest>
|
</a-form-item-rest>
|
||||||
</div>
|
</div>
|
||||||
|
<!-- 基地电站下拉框 -->
|
||||||
|
|
||||||
|
<div
|
||||||
|
class="flex gap-[10px]"
|
||||||
|
v-else-if="item.type === 'jidiData'"
|
||||||
|
>
|
||||||
|
<a-form-item-rest>
|
||||||
|
<!-- 基地下拉框 -->
|
||||||
|
<a-select
|
||||||
|
:value="formData[item.name]"
|
||||||
|
placeholder="请选择"
|
||||||
|
@change="val => dataDimensionDataChange(val, item.name)"
|
||||||
|
show-search
|
||||||
|
allow-clear
|
||||||
|
:loading="shuJuTianBaoStore.baseLoading"
|
||||||
|
:filter-option="filterOption"
|
||||||
|
style="width: 135px"
|
||||||
|
>
|
||||||
|
<a-select-option
|
||||||
|
v-for="opt in shuJuTianBaoStore.baseOption"
|
||||||
|
:key="opt.baseid"
|
||||||
|
:value="opt.baseid"
|
||||||
|
:label="opt.basename"
|
||||||
|
>
|
||||||
|
{{ opt.basename }}
|
||||||
|
</a-select-option>
|
||||||
|
</a-select>
|
||||||
|
<!-- 电站下拉框 -->
|
||||||
|
<a-select
|
||||||
|
v-if="props.zhujianfujian == 'fu'"
|
||||||
|
:value="formData.rstcd"
|
||||||
|
placeholder="请选择电站"
|
||||||
|
@change="stcdIdChange"
|
||||||
|
show-search
|
||||||
|
allow-clear
|
||||||
|
:loading="shuJuTianBaoStore.engLoading"
|
||||||
|
:filter-option="filterOption"
|
||||||
|
style="width: 135px"
|
||||||
|
:dropdown-style="{
|
||||||
|
maxHeight: '400px',
|
||||||
|
overflow: 'auto',
|
||||||
|
minWidth: '300px'
|
||||||
|
}"
|
||||||
|
>
|
||||||
|
<a-select-option
|
||||||
|
v-for="opt in shuJuTianBaoStore.engOption"
|
||||||
|
:key="opt.stcd"
|
||||||
|
:value="opt.stcd"
|
||||||
|
:label="opt.ennm"
|
||||||
|
:title="opt.ennm + ',' + opt.reachcdName"
|
||||||
|
:reachcdName="opt.reachcdName"
|
||||||
|
>
|
||||||
|
{{ opt.ennm }},{{ opt.reachcdName }}
|
||||||
|
</a-select-option>
|
||||||
|
</a-select>
|
||||||
|
<!-- 电站下拉框 -->
|
||||||
|
<a-select
|
||||||
|
v-if="props.zhujianfujian == 'zhu'"
|
||||||
|
:value="formData.stcd"
|
||||||
|
placeholder="请选择电站"
|
||||||
|
@change="stcdIdChange"
|
||||||
|
show-search
|
||||||
|
allow-clear
|
||||||
|
:loading="shuJuTianBaoStore.engLoading"
|
||||||
|
:filter-option="filterOption"
|
||||||
|
style="width: 135px"
|
||||||
|
>
|
||||||
|
<a-select-option
|
||||||
|
v-for="opt in shuJuTianBaoStore.engOption"
|
||||||
|
:key="opt.stcd"
|
||||||
|
:value="opt.stcd"
|
||||||
|
:label="opt.ennm"
|
||||||
|
>
|
||||||
|
{{ opt.ennm }}
|
||||||
|
</a-select-option>
|
||||||
|
</a-select>
|
||||||
|
</a-form-item-rest>
|
||||||
|
</div>
|
||||||
<!-- 下拉选择 -->
|
<!-- 下拉选择 -->
|
||||||
<!-- <div v-else-if="item.type === 'Select'">
|
<!-- <div v-else-if="item.type === 'Select'">
|
||||||
<div v-for="i in item.options"> {{ i[item.values?.name] }} {{ i[item.values?.value] }}</div>
|
<div v-for="i in item.options"> {{ i[item.values?.name] }} {{ i[item.values?.value] }}</div>
|
||||||
@ -362,9 +439,13 @@ const initForm = () => {
|
|||||||
validSearchList.value.forEach(item => {
|
validSearchList.value.forEach(item => {
|
||||||
if (item.type == 'waterStation') {
|
if (item.type == 'waterStation') {
|
||||||
// 下拉菜单
|
// 下拉菜单
|
||||||
// shuJuTianBaoStore.getBaseOption();
|
shuJuTianBaoStore.getBaseOption();
|
||||||
shuJuTianBaoStore.getSelectForOption();
|
shuJuTianBaoStore.getSelectForOption();
|
||||||
shuJuTianBaoStore.getEngOption(formData.rvcd);
|
shuJuTianBaoStore.getEngOption(formData.rvcd,'rvcd');
|
||||||
|
}
|
||||||
|
if (item.type == 'jidiData') {
|
||||||
|
shuJuTianBaoStore.getBaseOption();
|
||||||
|
shuJuTianBaoStore.getEngOption(formData[item.name] || 'all','baseId');
|
||||||
}
|
}
|
||||||
if (item.fieldProps?.required) {
|
if (item.fieldProps?.required) {
|
||||||
rules[item.name] = [
|
rules[item.name] = [
|
||||||
@ -387,19 +468,19 @@ const triggerManualValuesChange = (changedKey: string, newValue: any) => {
|
|||||||
emit('valuesChange', changedValues, { ...formData });
|
emit('valuesChange', changedValues, { ...formData });
|
||||||
};
|
};
|
||||||
|
|
||||||
// const dataDimensionDataChange = (value: any) => {
|
const dataDimensionDataChange = (value: any, fieldName: string = 'baseId') => {
|
||||||
// formData.baseId = value;
|
formData[fieldName] = value;
|
||||||
// formData.rstcd = "";
|
formData.rstcd = "";
|
||||||
// shuJuTianBaoStore.getEngOption(formData.baseId);
|
shuJuTianBaoStore.getEngOption(value,'baseId');
|
||||||
|
triggerManualValuesChange('baseId', formData.baseId);
|
||||||
// // 【关键修改】手动触发 valuesChange,因为 a-form-item-rest 阻断了自动监听
|
// 一次性触发所有变更通知,避免多次调用
|
||||||
// triggerManualValuesChange("baseId", formData.baseId);
|
// emit('valuesChange', { [fieldName]: value, rstcd: "" }, { ...formData });
|
||||||
// };
|
};
|
||||||
|
|
||||||
const lyChange = (value: any) => {
|
const lyChange = (value: any) => {
|
||||||
formData.rvcd = value;
|
formData.rvcd = value;
|
||||||
formData.rstcd = '';
|
formData.rstcd = '';
|
||||||
shuJuTianBaoStore.getEngOption(formData.rvcd);
|
shuJuTianBaoStore.getEngOption(formData.rvcd,'rvcd');
|
||||||
|
|
||||||
// 【关键修改】手动触发 valuesChange,因为 a-form-item-rest 阻断了自动监听
|
// 【关键修改】手动触发 valuesChange,因为 a-form-item-rest 阻断了自动监听
|
||||||
triggerManualValuesChange('rvcd', formData.rvcd);
|
triggerManualValuesChange('rvcd', formData.rvcd);
|
||||||
@ -408,12 +489,12 @@ const lyChange = (value: any) => {
|
|||||||
const stcdIdChange = (value: any) => {
|
const stcdIdChange = (value: any) => {
|
||||||
if (props.zhujianfujian == 'fu') {
|
if (props.zhujianfujian == 'fu') {
|
||||||
formData.rstcd = value;
|
formData.rstcd = value;
|
||||||
shuJuTianBaoStore.getFpssOption(formData.rvcd, value);
|
shuJuTianBaoStore.getFpssOption(formData.baseId, value);
|
||||||
// 【关键修改】手动触发 valuesChange
|
// 【关键修改】手动触发 valuesChange
|
||||||
triggerManualValuesChange('rstcd', formData.rstcd);
|
triggerManualValuesChange('rstcd', formData.rstcd);
|
||||||
} else {
|
} else {
|
||||||
formData.stcd = value;
|
formData.stcd = value;
|
||||||
shuJuTianBaoStore.getFpssOption(formData.rvcd, value);
|
shuJuTianBaoStore.getFpssOption(formData.baseId, value);
|
||||||
// 【关键修改】手动触发 valuesChange
|
// 【关键修改】手动触发 valuesChange
|
||||||
triggerManualValuesChange('stcd', formData.stcd);
|
triggerManualValuesChange('stcd', formData.stcd);
|
||||||
}
|
}
|
||||||
|
|||||||
282
frontend/src/components/FishResource/FishResourceSearch.vue
Normal file
282
frontend/src/components/FishResource/FishResourceSearch.vue
Normal file
@ -0,0 +1,282 @@
|
|||||||
|
<template>
|
||||||
|
<div class="approval-search">
|
||||||
|
<BasicSearch
|
||||||
|
ref="basicSearchRef"
|
||||||
|
:searchList="searchList"
|
||||||
|
:initial-values="initSearchData"
|
||||||
|
:zhujianfujian="'fu'"
|
||||||
|
@reset="handleResetWrapper"
|
||||||
|
@finish="onSearchFinish"
|
||||||
|
@values-change="onValuesChange"
|
||||||
|
><template #jcdt>
|
||||||
|
<a-date-picker
|
||||||
|
class="w-[120px]"
|
||||||
|
v-model:value="jcdt.min"
|
||||||
|
format="YYYY-MM-DD"
|
||||||
|
value-format="YYYY-MM-DD HH:mm:ss"
|
||||||
|
placeholder="起始时间"
|
||||||
|
:showToday="false"
|
||||||
|
>
|
||||||
|
<template #renderExtraFooter>
|
||||||
|
<div class="flex items-center flex-wrap px-2">
|
||||||
|
<span
|
||||||
|
v-for="item in DateSetting.RangeButton.days1"
|
||||||
|
:key="item"
|
||||||
|
@click="handleRangeClick(item)"
|
||||||
|
>
|
||||||
|
<a class="text-[#1890ff] mr-1"> {{ item.label }}</a>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</a-date-picker>
|
||||||
|
至
|
||||||
|
<a-form-item-rest>
|
||||||
|
<a-date-picker
|
||||||
|
class="w-[120px]"
|
||||||
|
v-model:value="jcdt.max"
|
||||||
|
format="YYYY-MM-DD"
|
||||||
|
value-format="YYYY-MM-DD HH:mm:ss"
|
||||||
|
:disabledDate="disabledEndDate"
|
||||||
|
placeholder="结束时间"
|
||||||
|
:showToday="false"
|
||||||
|
>
|
||||||
|
<template #renderExtraFooter>
|
||||||
|
<div class="flex items-center flex-wrap px-2">
|
||||||
|
<span
|
||||||
|
v-for="item in DateSetting.RangeButton.days1"
|
||||||
|
:key="item"
|
||||||
|
@click="handleRangeClick(item)"
|
||||||
|
>
|
||||||
|
<a class="text-[#1890ff] mr-1"> {{ item.label }}</a>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</a-date-picker>
|
||||||
|
</a-form-item-rest>
|
||||||
|
</template>
|
||||||
|
<template #actions>
|
||||||
|
<a-button :loading="exportLoading" @click="exportBtn">导出</a-button>
|
||||||
|
</template>
|
||||||
|
</BasicSearch>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { ref, computed, onMounted } from 'vue';
|
||||||
|
import dayjs from 'dayjs';
|
||||||
|
import BasicSearch from '@/components/BasicSearch/index.vue';
|
||||||
|
import { DateSetting } from '@/utils/enumeration';
|
||||||
|
import { useTimeScale } from '@/store/composables/useTimeScale';
|
||||||
|
import { getFishReleaseMonitorSectionList } from '@/api/DataQueryMenuModule';
|
||||||
|
|
||||||
|
const emit = defineEmits<{
|
||||||
|
(e: 'export-btn'): void;
|
||||||
|
(e: 'reset', values: any): void;
|
||||||
|
(e: 'search-finish', values: any): void;
|
||||||
|
}>();
|
||||||
|
|
||||||
|
const basicSearchRef = ref<any>();
|
||||||
|
const btnLoading = ref<boolean>(false);
|
||||||
|
|
||||||
|
const props = defineProps<{
|
||||||
|
exportLoading?: boolean;
|
||||||
|
modalData: any;
|
||||||
|
}>();
|
||||||
|
const initSearchData = {
|
||||||
|
baseId: props.modalData.baseid ?? 'all',
|
||||||
|
rstcd: null,
|
||||||
|
stcd: '',
|
||||||
|
mway: '1'
|
||||||
|
};
|
||||||
|
|
||||||
|
const searchData = ref<any>({ ...initSearchData });
|
||||||
|
|
||||||
|
const {
|
||||||
|
jcdt,
|
||||||
|
currentTimeScale,
|
||||||
|
handleRangeClick,
|
||||||
|
disabledEndDate,
|
||||||
|
handleSearchFinish,
|
||||||
|
handleValuesChange,
|
||||||
|
init,
|
||||||
|
setDefaultTimeRange
|
||||||
|
} = useTimeScale({
|
||||||
|
defaultTimeScale: initSearchData.timeScale,
|
||||||
|
onSearchFinish: values => emit('search-finish', values),
|
||||||
|
onReset: () => emit('reset', initSearchData)
|
||||||
|
});
|
||||||
|
const crossSectionListLoading = ref<any>(false);
|
||||||
|
const crossSectionList = ref<any>([]);
|
||||||
|
|
||||||
|
const searchList: any = computed(() => [
|
||||||
|
// {
|
||||||
|
// type: 'waterStation',
|
||||||
|
// name: 'rvcd',
|
||||||
|
// label: '流域',
|
||||||
|
// placeholder: '请输入流域名称',
|
||||||
|
// fieldProps: {
|
||||||
|
// allowClear: true
|
||||||
|
// },
|
||||||
|
// options: []
|
||||||
|
// },
|
||||||
|
{
|
||||||
|
type: 'jidiData',
|
||||||
|
name: 'baseId',
|
||||||
|
label: '水电基地',
|
||||||
|
placeholder: '请输入水电基地名称',
|
||||||
|
fieldProps: {
|
||||||
|
allowClear: true
|
||||||
|
},
|
||||||
|
options: []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'Select',
|
||||||
|
name: 'stcd',
|
||||||
|
label: '过鱼设施名称',
|
||||||
|
width: 200,
|
||||||
|
placeholder: '请选择过鱼设施名称',
|
||||||
|
fieldProps: {
|
||||||
|
allowClear: true
|
||||||
|
},
|
||||||
|
loading: crossSectionListLoading.value,
|
||||||
|
options: crossSectionList.value.map(item => ({
|
||||||
|
label: item.stnm,
|
||||||
|
value: item.stcd
|
||||||
|
}))
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'Radio',
|
||||||
|
name: 'mway',
|
||||||
|
label: '数据类型',
|
||||||
|
width: 140,
|
||||||
|
options: [
|
||||||
|
{
|
||||||
|
label: '人工',
|
||||||
|
value: '1'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '自动',
|
||||||
|
value: '2'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'custom',
|
||||||
|
name: 'jcdt',
|
||||||
|
label: '时间',
|
||||||
|
fieldProps: {
|
||||||
|
allowClear: false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]);
|
||||||
|
|
||||||
|
const onSearchFinish = (values: any) => {
|
||||||
|
handleSearchFinish(values);
|
||||||
|
};
|
||||||
|
|
||||||
|
const exportBtn = () => {
|
||||||
|
emit('export-btn');
|
||||||
|
};
|
||||||
|
const initCrossSectionList = params => {
|
||||||
|
const filters = [];
|
||||||
|
if (params) {
|
||||||
|
if (params.baseId != '' && params.baseId != 'all') {
|
||||||
|
filters.push({
|
||||||
|
field: 'baseId',
|
||||||
|
operator: 'contains',
|
||||||
|
dataType: 'string',
|
||||||
|
value: params.baseId
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (params.rstcd != '' && params.rstcd != null) {
|
||||||
|
filters.push({
|
||||||
|
field: 'rstcd',
|
||||||
|
operator: 'contains',
|
||||||
|
dataType: 'string',
|
||||||
|
value: params.rstcd
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
crossSectionListLoading.value = true;
|
||||||
|
getFishReleaseMonitorSectionList({
|
||||||
|
filter: {
|
||||||
|
logic: 'and',
|
||||||
|
filters: filters
|
||||||
|
},
|
||||||
|
select: ['stcd', 'stnm', 'wtDeviceType', 'dtinType', 'mway']
|
||||||
|
}).then(res => {
|
||||||
|
if (res.data?.data) {
|
||||||
|
crossSectionList.value = res.data?.data;
|
||||||
|
}
|
||||||
|
crossSectionListLoading.value = false;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
const onValuesChange = (changedValues: any, allValues: any) => {
|
||||||
|
// 当基地或断面变化时,清空过鱼设施选中并重新请求列表
|
||||||
|
if ('baseId' in changedValues || 'rstcd' in changedValues) {
|
||||||
|
allValues.stcd = null;
|
||||||
|
if (basicSearchRef.value?.formData) {
|
||||||
|
basicSearchRef.value.formData.stcd = null;
|
||||||
|
}
|
||||||
|
initCrossSectionList(allValues);
|
||||||
|
}
|
||||||
|
|
||||||
|
handleValuesChange(changedValues, allValues);
|
||||||
|
searchData.value = { ...searchData.value, ...allValues };
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleResetWrapper = () => {
|
||||||
|
// 手动重置内部状态,避免触发两次请求
|
||||||
|
currentTimeScale.value = initSearchData.timeScale;
|
||||||
|
const now = dayjs();
|
||||||
|
if (props.modalData.year) {
|
||||||
|
jcdt.value = {
|
||||||
|
min: `${props.modalData.year}-01-01 00:00:00`,
|
||||||
|
max: `${props.modalData.year}-12-31 23:59:59`
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
jcdt.value = {
|
||||||
|
min: `${now
|
||||||
|
.subtract(5, 'year')
|
||||||
|
.startOf('year')
|
||||||
|
.format('YYYY-MM-DD')} 00:00:00`,
|
||||||
|
max: `${now.endOf('year').format('YYYY-MM-DD')} 23:59:59`
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
setDefaultTimeRange(initSearchData.timeScale);
|
||||||
|
// 触发搜索,使用当前状态而非 initSearchData
|
||||||
|
handleSearchFinish({
|
||||||
|
...initSearchData
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
defineExpose({
|
||||||
|
btnLoading,
|
||||||
|
searchData
|
||||||
|
});
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
init();
|
||||||
|
// 设置默认年份:前一年到当前年
|
||||||
|
const now = dayjs();
|
||||||
|
if (props.modalData.year) {
|
||||||
|
jcdt.value = {
|
||||||
|
min: `${props.modalData.year}-01-01 00:00:00`,
|
||||||
|
max: `${props.modalData.year}-12-31 23:59:59`
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
jcdt.value = {
|
||||||
|
min: `${now.subtract(5, 'year').format('YYYY-MM-DD')} 00:00:00`,
|
||||||
|
max: `${now.format('YYYY-MM-DD')} 23:59:59`
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
initCrossSectionList();
|
||||||
|
// 使用 handleSearchFinish 确保包含 jcdt 等完整参数
|
||||||
|
handleSearchFinish({ ...initSearchData });
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss"></style>
|
||||||
554
frontend/src/components/FishResource/index.vue
Normal file
554
frontend/src/components/FishResource/index.vue
Normal file
@ -0,0 +1,554 @@
|
|||||||
|
<template>
|
||||||
|
<div class="w-full h-full flex flex-col" style="height:calc(60vh)">
|
||||||
|
<!-- 搜索组件 -->
|
||||||
|
<FishDataSearch
|
||||||
|
@export-btn="exportBtn"
|
||||||
|
@search-finish="onSearchFinish"
|
||||||
|
@reset="onReset"
|
||||||
|
:exportLoading="exportLoading"
|
||||||
|
:modalData = "props.modalData"
|
||||||
|
ref="searchRef"
|
||||||
|
/>
|
||||||
|
<!-- 表格组件 -->
|
||||||
|
<BasicTable
|
||||||
|
ref="tableRef"
|
||||||
|
:scrollX="tableScrollX"
|
||||||
|
:scrollY="tableScrollY"
|
||||||
|
:columns="tableColumns"
|
||||||
|
:list-url="getFishReleaseMonitorList"
|
||||||
|
:searchParams="{
|
||||||
|
sort: sort
|
||||||
|
}"
|
||||||
|
>
|
||||||
|
</BasicTable>
|
||||||
|
|
||||||
|
<!-- 图片预览弹框 -->
|
||||||
|
<a-modal
|
||||||
|
v-model:open="imagePreviewVisible"
|
||||||
|
title="图片预览"
|
||||||
|
:footer="null"
|
||||||
|
width="800px"
|
||||||
|
>
|
||||||
|
<div style="text-align: center">
|
||||||
|
<img :src="previewImageUrl" style="width: 100%; height: 600px" />
|
||||||
|
</div>
|
||||||
|
</a-modal>
|
||||||
|
|
||||||
|
<!-- 视频预览弹框 -->
|
||||||
|
<a-modal
|
||||||
|
v-model:open="videoPreviewVisible"
|
||||||
|
title="视频预览"
|
||||||
|
:footer="null"
|
||||||
|
width="800px"
|
||||||
|
>
|
||||||
|
<div style="text-align: center">
|
||||||
|
<video
|
||||||
|
:src="previewVideoUrl"
|
||||||
|
controls
|
||||||
|
style="width: 100%; height: 600px"
|
||||||
|
></video>
|
||||||
|
</div>
|
||||||
|
</a-modal>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { ref, computed, onMounted, nextTick, h } from 'vue';
|
||||||
|
import dayjs from 'dayjs';
|
||||||
|
import { Button } from 'ant-design-vue';
|
||||||
|
import FishDataSearch from './FishResourceSearch.vue';
|
||||||
|
import BasicTable from '@/components/BasicTable/index.vue';
|
||||||
|
import { getFishReleaseMonitorList } from '@/api/DataQueryMenuModule';
|
||||||
|
import { calcTableScrollY } from '@/utils/index';
|
||||||
|
import { useDraggable } from '@/utils/drag';
|
||||||
|
const props = defineProps<{
|
||||||
|
modalData?: any;
|
||||||
|
}>();
|
||||||
|
const sort = ref<any>([
|
||||||
|
{
|
||||||
|
field: 'baseStepSort',
|
||||||
|
dir: 'asc'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'rvcdStepSort',
|
||||||
|
dir: 'asc'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'rstcdStepSort',
|
||||||
|
dir: 'asc'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'ttpwr',
|
||||||
|
dir: 'asc'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'tm',
|
||||||
|
dir: 'desc'
|
||||||
|
}
|
||||||
|
]);
|
||||||
|
const tableRef = ref();
|
||||||
|
const searchRef = ref();
|
||||||
|
const tableScrollY = ref<string | number>(0);
|
||||||
|
const currentSearchParams = ref<any>({});
|
||||||
|
const exportLoading = ref(false);
|
||||||
|
|
||||||
|
// 图片预览
|
||||||
|
const imagePreviewVisible = ref(false);
|
||||||
|
const previewImageUrl = ref('');
|
||||||
|
// 视频预览
|
||||||
|
const videoPreviewVisible = ref(false);
|
||||||
|
const previewVideoUrl = ref('');
|
||||||
|
useDraggable(imagePreviewVisible, { boundary: true, resetOnOpen: true });
|
||||||
|
useDraggable(videoPreviewVisible, { boundary: true, resetOnOpen: true });
|
||||||
|
const openImagePreview = (url: string) => {
|
||||||
|
previewImageUrl.value = import.meta.env.VITE_APP_ATTACHMENT_URL + '/?' + url;
|
||||||
|
imagePreviewVisible.value = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
const openVideoPreview = (url: string) => {
|
||||||
|
previewVideoUrl.value = import.meta.env.VITE_APP_ATTACHMENT_URL + '/?' + url;
|
||||||
|
videoPreviewVisible.value = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
const tableScrollX = computed(() =>
|
||||||
|
Math.max(
|
||||||
|
tableColumns.value.reduce(
|
||||||
|
(sum: number, col: any) => sum + (col.width || 180),
|
||||||
|
0
|
||||||
|
),
|
||||||
|
600
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
// 人工列
|
||||||
|
const columnsManual: any[] = [
|
||||||
|
{
|
||||||
|
key: 'stnm',
|
||||||
|
title: '电站名称',
|
||||||
|
dataIndex: 'stnm',
|
||||||
|
visible: true,
|
||||||
|
width: 200,
|
||||||
|
sort: true,
|
||||||
|
merge: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'baseName',
|
||||||
|
title: '所属基地',
|
||||||
|
dataIndex: 'baseName',
|
||||||
|
sort: true,
|
||||||
|
width: 120
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'stnm',
|
||||||
|
title: '过鱼设施名称',
|
||||||
|
dataIndex: 'stnm',
|
||||||
|
sort: true,
|
||||||
|
width: 200
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'strdt',
|
||||||
|
title: '开始时间',
|
||||||
|
dataIndex: 'strdt',
|
||||||
|
sort: true,
|
||||||
|
width: 100,
|
||||||
|
customRender: ({ text }) => dayjs(text).format('YYYY-MM-DD') || '-'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'enddt',
|
||||||
|
title: '结束时间',
|
||||||
|
dataIndex: 'enddt',
|
||||||
|
sort: true,
|
||||||
|
width: 100,
|
||||||
|
customRender: ({ text }) => dayjs(text).format('YYYY-MM-DD') || '-'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'tm',
|
||||||
|
title: '填报时间',
|
||||||
|
dataIndex: 'tm',
|
||||||
|
sort: true,
|
||||||
|
width: 160
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'ftp',
|
||||||
|
title: '鱼种类',
|
||||||
|
dataIndex: 'ftp',
|
||||||
|
sort: true,
|
||||||
|
width: 120
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'fcnt',
|
||||||
|
title: '过鱼数量(尾)',
|
||||||
|
dataIndex: 'fcnt',
|
||||||
|
sort: true,
|
||||||
|
width: 120
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'directionName',
|
||||||
|
title: '鱼游向',
|
||||||
|
dataIndex: 'directionName',
|
||||||
|
sort: true,
|
||||||
|
width: 120
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'fsz',
|
||||||
|
title: '鱼类规格',
|
||||||
|
dataIndex: 'fsz',
|
||||||
|
sort: true,
|
||||||
|
width: 160
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'firstimgurl',
|
||||||
|
title: '图片',
|
||||||
|
dataIndex: 'firstimgurl',
|
||||||
|
align: 'center',
|
||||||
|
width: 110,
|
||||||
|
customRender: ({ text }: any) => {
|
||||||
|
const hasValidUrl =
|
||||||
|
text &&
|
||||||
|
text !== '-' &&
|
||||||
|
text.trim() !== '' &&
|
||||||
|
text !== 'null' &&
|
||||||
|
text !== 'undefined';
|
||||||
|
return h(
|
||||||
|
Button,
|
||||||
|
{
|
||||||
|
type: 'link',
|
||||||
|
disabled: !hasValidUrl,
|
||||||
|
style: {
|
||||||
|
color: !hasValidUrl ? '#ccc' : '#1890ff',
|
||||||
|
cursor: !hasValidUrl ? 'not-allowed' : 'pointer'
|
||||||
|
},
|
||||||
|
onClick: () => {
|
||||||
|
if (hasValidUrl) {
|
||||||
|
openImagePreview(text);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
() => '查看图片'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'videourl',
|
||||||
|
title: '视频',
|
||||||
|
dataIndex: 'videourl',
|
||||||
|
align: 'center',
|
||||||
|
width: 110,
|
||||||
|
customRender: ({ text }: any) => {
|
||||||
|
const hasValidUrl =
|
||||||
|
text &&
|
||||||
|
text !== '-' &&
|
||||||
|
text.trim() !== '' &&
|
||||||
|
text !== 'null' &&
|
||||||
|
text !== 'undefined';
|
||||||
|
return h(
|
||||||
|
Button,
|
||||||
|
{
|
||||||
|
type: 'link',
|
||||||
|
disabled: !hasValidUrl,
|
||||||
|
style: {
|
||||||
|
color: !hasValidUrl ? '#ccc' : '#1890ff',
|
||||||
|
cursor: !hasValidUrl ? 'not-allowed' : 'pointer'
|
||||||
|
},
|
||||||
|
onClick: () => {
|
||||||
|
if (hasValidUrl) {
|
||||||
|
openVideoPreview(text);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
() => '查看视频'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
// 自动列
|
||||||
|
const columnsAuto: any[] = [
|
||||||
|
{
|
||||||
|
key: 'stnm',
|
||||||
|
title: '电站名称',
|
||||||
|
dataIndex: 'stnm',
|
||||||
|
visible: true,
|
||||||
|
width: 200,
|
||||||
|
sort: true,
|
||||||
|
merge: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'baseName',
|
||||||
|
title: '所属基地',
|
||||||
|
dataIndex: 'baseName',
|
||||||
|
sort: true,
|
||||||
|
width: 120
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'stnm',
|
||||||
|
title: '过鱼设施名称',
|
||||||
|
dataIndex: 'stnm',
|
||||||
|
sort: true,
|
||||||
|
width: 200
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'tm',
|
||||||
|
title: '时间',
|
||||||
|
dataIndex: 'tm',
|
||||||
|
sort: true,
|
||||||
|
width: 160
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'ftp',
|
||||||
|
title: '鱼种类',
|
||||||
|
dataIndex: 'ftp',
|
||||||
|
sort: true,
|
||||||
|
width: 120
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'length',
|
||||||
|
title: '鱼长度(cm)',
|
||||||
|
dataIndex: 'length',
|
||||||
|
sort: true,
|
||||||
|
width: 120
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'width',
|
||||||
|
title: '鱼宽度(cm)',
|
||||||
|
dataIndex: 'width',
|
||||||
|
sort: true,
|
||||||
|
width: 120,
|
||||||
|
customRender: ({ text }: any) => {
|
||||||
|
const num = parseFloat(text);
|
||||||
|
return isNaN(num) ? '-' : num.toFixed(2);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'fishspeed',
|
||||||
|
title: '鱼速度(m/s)',
|
||||||
|
dataIndex: 'fishspeed',
|
||||||
|
sort: true,
|
||||||
|
width: 80,
|
||||||
|
customRender: ({ text }: any) => {
|
||||||
|
const num = parseFloat(text);
|
||||||
|
return isNaN(num) ? '-' : num.toFixed(2);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'directionName',
|
||||||
|
title: '鱼游向',
|
||||||
|
dataIndex: 'directionName',
|
||||||
|
sort: true,
|
||||||
|
width: 160
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'temperature',
|
||||||
|
title: '水温(℃)',
|
||||||
|
dataIndex: 'temperature',
|
||||||
|
sort: true,
|
||||||
|
width: 160,
|
||||||
|
customRender: ({ text }: any) => {
|
||||||
|
const num = parseFloat(text);
|
||||||
|
return isNaN(num) ? '-' : num.toFixed(1);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'speed',
|
||||||
|
title: '流速(m/s)',
|
||||||
|
dataIndex: 'speed',
|
||||||
|
sort: true,
|
||||||
|
width: 160,
|
||||||
|
customRender: ({ text }: any) => {
|
||||||
|
const num = parseFloat(text);
|
||||||
|
return isNaN(num) ? '-' : num.toFixed(2);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'fcnt',
|
||||||
|
title: '过鱼数量(尾)',
|
||||||
|
dataIndex: 'fcnt',
|
||||||
|
sort: true,
|
||||||
|
width: 120
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'channelno',
|
||||||
|
title: '过鱼通道',
|
||||||
|
dataIndex: 'channelno',
|
||||||
|
sort: true,
|
||||||
|
width: 140
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'firstimgurl',
|
||||||
|
title: '轮廓图',
|
||||||
|
dataIndex: 'firstimgurl',
|
||||||
|
align: 'center',
|
||||||
|
width: 110,
|
||||||
|
customRender: ({ text }: any) => {
|
||||||
|
const hasValidUrl =
|
||||||
|
text &&
|
||||||
|
text !== '-' &&
|
||||||
|
text.trim() !== '' &&
|
||||||
|
text !== 'null' &&
|
||||||
|
text !== 'undefined';
|
||||||
|
return h(
|
||||||
|
Button,
|
||||||
|
{
|
||||||
|
type: 'link',
|
||||||
|
disabled: !hasValidUrl,
|
||||||
|
style: {
|
||||||
|
color: !hasValidUrl ? '#ccc' : '#1890ff',
|
||||||
|
cursor: !hasValidUrl ? 'not-allowed' : 'pointer'
|
||||||
|
},
|
||||||
|
onClick: () => {
|
||||||
|
if (hasValidUrl) {
|
||||||
|
openImagePreview(text);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
() => '查看图片'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'videourl',
|
||||||
|
title: '短视频',
|
||||||
|
dataIndex: 'videourl',
|
||||||
|
align: 'center',
|
||||||
|
width: 110,
|
||||||
|
customRender: ({ text }: any) => {
|
||||||
|
const hasValidUrl =
|
||||||
|
text &&
|
||||||
|
text !== '-' &&
|
||||||
|
text.trim() !== '' &&
|
||||||
|
text !== 'null' &&
|
||||||
|
text !== 'undefined';
|
||||||
|
return h(
|
||||||
|
Button,
|
||||||
|
{
|
||||||
|
type: 'link',
|
||||||
|
disabled: !hasValidUrl,
|
||||||
|
style: {
|
||||||
|
color: !hasValidUrl ? '#ccc' : '#1890ff',
|
||||||
|
cursor: !hasValidUrl ? 'not-allowed' : 'pointer'
|
||||||
|
},
|
||||||
|
onClick: () => {
|
||||||
|
if (hasValidUrl) {
|
||||||
|
openVideoPreview(text);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
() => '查看视频'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
// 根据数据类型动态切换列
|
||||||
|
const tableColumns = computed(() => {
|
||||||
|
const mway = currentSearchParams.value.mway;
|
||||||
|
return mway === '2' ? columnsAuto : columnsManual;
|
||||||
|
});
|
||||||
|
|
||||||
|
const onSearchFinish = async (values: any) => {
|
||||||
|
currentSearchParams.value = values;
|
||||||
|
// 等待 prop 更新后再调用 getList
|
||||||
|
await nextTick();
|
||||||
|
initTable(values);
|
||||||
|
};
|
||||||
|
|
||||||
|
const onReset = async (values: any) => {
|
||||||
|
currentSearchParams.value = values;
|
||||||
|
await nextTick();
|
||||||
|
initTable(values);
|
||||||
|
};
|
||||||
|
|
||||||
|
const exportBtn = () => {
|
||||||
|
if (exportLoading.value) return;
|
||||||
|
|
||||||
|
exportLoading.value = true;
|
||||||
|
searchRef.value.btnLoading = true;
|
||||||
|
|
||||||
|
tableRef.value
|
||||||
|
.exportTable({
|
||||||
|
fileName: `过鱼监测数据_${dayjs().format('YYYY-MM-DD HH-mm-ss')}`
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
exportLoading.value = false;
|
||||||
|
searchRef.value.btnLoading = false;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
const initTable = (values: any) => {
|
||||||
|
console.log(values);
|
||||||
|
const filters = [
|
||||||
|
values.baseId && values.baseId !== 'all'
|
||||||
|
? {
|
||||||
|
field: 'baseId',
|
||||||
|
operator: 'contains',
|
||||||
|
dataType: 'string',
|
||||||
|
value: values.baseId
|
||||||
|
}
|
||||||
|
: null,
|
||||||
|
values.rstcd
|
||||||
|
? {
|
||||||
|
field: 'rstcd',
|
||||||
|
operator: 'eq',
|
||||||
|
dataType: 'string',
|
||||||
|
value: values.rstcd
|
||||||
|
}
|
||||||
|
: null,
|
||||||
|
values.mway
|
||||||
|
? {
|
||||||
|
field: 'mway',
|
||||||
|
operator: 'eq',
|
||||||
|
dataType: 'string',
|
||||||
|
value: values.mway
|
||||||
|
}
|
||||||
|
: null
|
||||||
|
].filter(Boolean); // 移除空项
|
||||||
|
if (values.stcd) {
|
||||||
|
filters.push({
|
||||||
|
logic: 'or',
|
||||||
|
filters: [
|
||||||
|
{
|
||||||
|
field: 'stcd',
|
||||||
|
operator: 'eq',
|
||||||
|
dataType: 'string',
|
||||||
|
value: values.stcd
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'stcode',
|
||||||
|
operator: 'eq',
|
||||||
|
dataType: 'string',
|
||||||
|
value: values.stcd
|
||||||
|
}
|
||||||
|
]
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (values.jcdt) {
|
||||||
|
filters.push(
|
||||||
|
{
|
||||||
|
field: 'tm',
|
||||||
|
operator: 'gte',
|
||||||
|
dataType: 'date',
|
||||||
|
value: dayjs(values.jcdt.min).format('YYYY-MM-DD HH:mm:ss')
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'tm',
|
||||||
|
operator: 'lte',
|
||||||
|
dataType: 'date',
|
||||||
|
value: dayjs(values.jcdt.max).format('YYYY-MM-DD HH:mm:ss')
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
const params = {
|
||||||
|
logic: 'and',
|
||||||
|
filters
|
||||||
|
};
|
||||||
|
tableRef.value.getList(params);
|
||||||
|
};
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
nextTick(() => {
|
||||||
|
tableScrollY.value = calcTableScrollY();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss"></style>
|
||||||
@ -245,6 +245,7 @@ import { useModelStore } from '@/store/modules/model';
|
|||||||
import videoCover from '@/assets/images/videFm.jpg';
|
import videoCover from '@/assets/images/videFm.jpg';
|
||||||
import MediaViewer from './MediaViewer.vue';
|
import MediaViewer from './MediaViewer.vue';
|
||||||
import AttachmentPreview from './AttachmentPreview.vue';
|
import AttachmentPreview from './AttachmentPreview.vue';
|
||||||
|
import { useDraggable } from '@/utils/drag';
|
||||||
|
|
||||||
const modelStore = useModelStore();
|
const modelStore = useModelStore();
|
||||||
|
|
||||||
@ -875,7 +876,8 @@ const notRunningMediaViewerRef = ref();
|
|||||||
// 附件预览弹窗
|
// 附件预览弹窗
|
||||||
const attachmentModalVisible = ref(false);
|
const attachmentModalVisible = ref(false);
|
||||||
const currentAttachmentFid = ref('');
|
const currentAttachmentFid = ref('');
|
||||||
|
useDraggable(detailModalVisible, { boundary: true, resetOnOpen: true });
|
||||||
|
useDraggable(attachmentModalVisible, { boundary: true, resetOnOpen: true });
|
||||||
// 查看附件
|
// 查看附件
|
||||||
const handleViewAttachment = (record: any) => {
|
const handleViewAttachment = (record: any) => {
|
||||||
if (!record.fid) {
|
if (!record.fid) {
|
||||||
|
|||||||
@ -152,7 +152,7 @@ import { getStcdDetail } from '@/api/mapModal';
|
|||||||
const baseUrl = import.meta.env.VITE_APP_ATTACHMENT_URL;
|
const baseUrl = import.meta.env.VITE_APP_ATTACHMENT_URL;
|
||||||
const modelStore = useModelStore();
|
const modelStore = useModelStore();
|
||||||
const hasLoaded = ref(false); // 标记是否已经请求过
|
const hasLoaded = ref(false); // 标记是否已经请求过
|
||||||
|
import { useDraggable } from '@/utils/drag';
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
url: {
|
url: {
|
||||||
type: String,
|
type: String,
|
||||||
@ -168,6 +168,7 @@ const isLogo = ref(false);
|
|||||||
const loading = ref(false);
|
const loading = ref(false);
|
||||||
const data2: any = ref({});
|
const data2: any = ref({});
|
||||||
const tabledata = ref([]);
|
const tabledata = ref([]);
|
||||||
|
useDraggable(visible, { boundary: true, resetOnOpen: true });
|
||||||
const columnsConfig = ref([
|
const columnsConfig = ref([
|
||||||
{
|
{
|
||||||
type: 'ENG',
|
type: 'ENG',
|
||||||
|
|||||||
@ -56,6 +56,7 @@ import { getMonitorDataFpq, getMonitorDataOnline } from '@/api/mapModal';
|
|||||||
import { useModelStore } from '@/store/modules/model';
|
import { useModelStore } from '@/store/modules/model';
|
||||||
import { DateSetting } from '@/utils/enumeration';
|
import { DateSetting } from '@/utils/enumeration';
|
||||||
import dayjs from 'dayjs';
|
import dayjs from 'dayjs';
|
||||||
|
import { useDraggable } from '@/utils/drag';
|
||||||
|
|
||||||
const loading = ref(false);
|
const loading = ref(false);
|
||||||
const modelStore = useModelStore();
|
const modelStore = useModelStore();
|
||||||
@ -72,7 +73,8 @@ const previewImageUrl = ref('');
|
|||||||
// 视频预览
|
// 视频预览
|
||||||
const videoPreviewVisible = ref(false);
|
const videoPreviewVisible = ref(false);
|
||||||
const previewVideoUrl = ref('');
|
const previewVideoUrl = ref('');
|
||||||
|
useDraggable(imagePreviewVisible, { boundary: true, resetOnOpen: true });
|
||||||
|
useDraggable(videoPreviewVisible, { boundary: true, resetOnOpen: true });
|
||||||
const openImagePreview = (url: string) => {
|
const openImagePreview = (url: string) => {
|
||||||
previewImageUrl.value = import.meta.env.VITE_APP_ATTACHMENT_URL + '/?' + url;
|
previewImageUrl.value = import.meta.env.VITE_APP_ATTACHMENT_URL + '/?' + url;
|
||||||
imagePreviewVisible.value = true;
|
imagePreviewVisible.value = true;
|
||||||
|
|||||||
@ -102,6 +102,7 @@ import { getDictItemsByCode } from '@/api/dict';
|
|||||||
import { getFishDictoryDropdown } from '@/api/select';
|
import { getFishDictoryDropdown } from '@/api/select';
|
||||||
import { useModelStore } from '@/store/modules/model';
|
import { useModelStore } from '@/store/modules/model';
|
||||||
import dayjs from 'dayjs';
|
import dayjs from 'dayjs';
|
||||||
|
import { useDraggable } from '@/utils/drag';
|
||||||
|
|
||||||
const loading = ref(false);
|
const loading = ref(false);
|
||||||
const modelStore = useModelStore();
|
const modelStore = useModelStore();
|
||||||
@ -125,7 +126,8 @@ const previewImageUrl = ref('');
|
|||||||
// 视频预览
|
// 视频预览
|
||||||
const videoPreviewVisible = ref(false);
|
const videoPreviewVisible = ref(false);
|
||||||
const currentVideoUrl = ref('');
|
const currentVideoUrl = ref('');
|
||||||
|
useDraggable(imagePreviewVisible, { boundary: true, resetOnOpen: true });
|
||||||
|
useDraggable(videoPreviewVisible, { boundary: true, resetOnOpen: true });
|
||||||
// 鱼类搜索过滤
|
// 鱼类搜索过滤
|
||||||
const filterFtpOption = (input: string, option: any) => {
|
const filterFtpOption = (input: string, option: any) => {
|
||||||
console.log('filterOption', input, option);
|
console.log('filterOption', input, option);
|
||||||
|
|||||||
@ -79,6 +79,7 @@ import { queryPostUrlList } from '@/api/mapModal';
|
|||||||
import { useModelStore } from '@/store/modules/model';
|
import { useModelStore } from '@/store/modules/model';
|
||||||
import BasicTable from '@/components/BasicTable/index.vue';
|
import BasicTable from '@/components/BasicTable/index.vue';
|
||||||
import { DateSetting } from '@/utils/enumeration';
|
import { DateSetting } from '@/utils/enumeration';
|
||||||
|
import { useDraggable } from '@/utils/drag';
|
||||||
|
|
||||||
const modelStore = useModelStore();
|
const modelStore = useModelStore();
|
||||||
|
|
||||||
@ -102,7 +103,7 @@ let chartInstance: echarts.ECharts | null = null;
|
|||||||
const videoModalVisible = ref(false);
|
const videoModalVisible = ref(false);
|
||||||
const videoModalTitle = ref('');
|
const videoModalTitle = ref('');
|
||||||
const currentVideoUrl = ref('');
|
const currentVideoUrl = ref('');
|
||||||
|
useDraggable(videoModalVisible, { boundary: true, resetOnOpen: true });
|
||||||
const tabsList = [{ name: '流量监测', key: 'flowMeasure' }];
|
const tabsList = [{ name: '流量监测', key: 'flowMeasure' }];
|
||||||
const activeTabKey = ref('flowMeasure');
|
const activeTabKey = ref('flowMeasure');
|
||||||
|
|
||||||
|
|||||||
@ -110,6 +110,7 @@ import {
|
|||||||
type OperationFilterField,
|
type OperationFilterField,
|
||||||
type OperationTableItem
|
type OperationTableItem
|
||||||
} from './operationConfig';
|
} from './operationConfig';
|
||||||
|
import { useDraggable } from '@/utils/drag';
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
isActive: { type: Boolean, default: false }
|
isActive: { type: Boolean, default: false }
|
||||||
@ -141,6 +142,7 @@ const loadYear = ref(false);
|
|||||||
const loadFtp = ref(false);
|
const loadFtp = ref(false);
|
||||||
const tableRef = ref();
|
const tableRef = ref();
|
||||||
const attachmentModalVisible = ref(false);
|
const attachmentModalVisible = ref(false);
|
||||||
|
useDraggable(attachmentModalVisible, { boundary: true, resetOnOpen: true });
|
||||||
const currentAttachmentFid = ref('');
|
const currentAttachmentFid = ref('');
|
||||||
const fieldOptionsMap = reactive<Record<string, OperationFilterOption[]>>({});
|
const fieldOptionsMap = reactive<Record<string, OperationFilterOption[]>>({});
|
||||||
const selectLoadingMap = reactive<Record<string, boolean>>({});
|
const selectLoadingMap = reactive<Record<string, boolean>>({});
|
||||||
|
|||||||
@ -7,7 +7,7 @@
|
|||||||
<a-modal
|
<a-modal
|
||||||
v-model:open="modalVisible"
|
v-model:open="modalVisible"
|
||||||
title="水电开发情况"
|
title="水电开发情况"
|
||||||
width="1536px"
|
width="80%"
|
||||||
:footer="null"
|
:footer="null"
|
||||||
:destroy-on-close="true"
|
:destroy-on-close="true"
|
||||||
>
|
>
|
||||||
@ -28,7 +28,7 @@ import * as echarts from 'echarts';
|
|||||||
import { getVmsstbprptKendoList } from '@/api/home';
|
import { getVmsstbprptKendoList } from '@/api/home';
|
||||||
import { useJidiSelectEventStore } from '@/store/modules/jidiSelectEvent';
|
import { useJidiSelectEventStore } from '@/store/modules/jidiSelectEvent';
|
||||||
import ShuiDianKaiFQKTwoLayer from '@/modules/shuidianhuangjingjieruMod/TwoLayer/ShuiDianKaiFQKTwoLayer.vue';
|
import ShuiDianKaiFQKTwoLayer from '@/modules/shuidianhuangjingjieruMod/TwoLayer/ShuiDianKaiFQKTwoLayer.vue';
|
||||||
|
import { useDraggable } from '@/utils/drag';
|
||||||
defineOptions({
|
defineOptions({
|
||||||
name: 'developStatusChart'
|
name: 'developStatusChart'
|
||||||
});
|
});
|
||||||
@ -41,7 +41,7 @@ const dataLoading = ref(false);
|
|||||||
|
|
||||||
const modalVisible = ref(false);
|
const modalVisible = ref(false);
|
||||||
const modalProps = ref<any>({});
|
const modalProps = ref<any>({});
|
||||||
|
useDraggable(modalVisible, { boundary: true, resetOnOpen: true });
|
||||||
function openModal(props: any) {
|
function openModal(props: any) {
|
||||||
modalProps.value = props;
|
modalProps.value = props;
|
||||||
modalVisible.value = true;
|
modalVisible.value = true;
|
||||||
|
|||||||
@ -42,7 +42,7 @@
|
|||||||
<a-modal
|
<a-modal
|
||||||
v-model:open="modalVisible"
|
v-model:open="modalVisible"
|
||||||
title="环境监测数据接入情况"
|
title="环境监测数据接入情况"
|
||||||
width="1536px"
|
width="80%"
|
||||||
:footer="null"
|
:footer="null"
|
||||||
:destroy-on-close="true"
|
:destroy-on-close="true"
|
||||||
>
|
>
|
||||||
@ -60,7 +60,7 @@ import { ref, watch } from 'vue';
|
|||||||
import { getVmsstbprptKendoList } from '@/api/home';
|
import { getVmsstbprptKendoList } from '@/api/home';
|
||||||
import { useJidiSelectEventStore } from '@/store/modules/jidiSelectEvent';
|
import { useJidiSelectEventStore } from '@/store/modules/jidiSelectEvent';
|
||||||
import HuanJingSJJRQK from '@/modules/shuidianhuangjingjieruMod/TwoLayer/HuanJingSJJRQK.vue';
|
import HuanJingSJJRQK from '@/modules/shuidianhuangjingjieruMod/TwoLayer/HuanJingSJJRQK.vue';
|
||||||
|
import { useDraggable } from '@/utils/drag';
|
||||||
defineOptions({
|
defineOptions({
|
||||||
name: 'EngEnvironmentData'
|
name: 'EngEnvironmentData'
|
||||||
});
|
});
|
||||||
@ -72,7 +72,7 @@ const data = ref<Record<string, number>>({ one: 0, two: 0, three: 0 });
|
|||||||
|
|
||||||
const modalVisible = ref(false);
|
const modalVisible = ref(false);
|
||||||
const modalProps = ref<any>({});
|
const modalProps = ref<any>({});
|
||||||
|
useDraggable(modalVisible, { boundary: true, resetOnOpen: true });
|
||||||
function openModal(props: any) {
|
function openModal(props: any) {
|
||||||
modalProps.value = props;
|
modalProps.value = props;
|
||||||
modalVisible.value = true;
|
modalVisible.value = true;
|
||||||
|
|||||||
@ -63,6 +63,7 @@ import SidePanelItem from '@/components/SidePanelItem/index.vue';
|
|||||||
import { useJidiSelectEventStore } from '@/store/modules/jidiSelectEvent';
|
import { useJidiSelectEventStore } from '@/store/modules/jidiSelectEvent';
|
||||||
import { vpcGetKendoListCust } from '@/api/zxdzw';
|
import { vpcGetKendoListCust } from '@/api/zxdzw';
|
||||||
import ArtsDetail from '@/components/carouselIntroduce/ArtsDetail.vue';
|
import ArtsDetail from '@/components/carouselIntroduce/ArtsDetail.vue';
|
||||||
|
import { useDraggable } from '@/utils/drag';
|
||||||
|
|
||||||
// 定义组件名(便于调试和递归)
|
// 定义组件名(便于调试和递归)
|
||||||
defineOptions({
|
defineOptions({
|
||||||
@ -83,7 +84,7 @@ const baseid = ref('');
|
|||||||
// 弹框控制
|
// 弹框控制
|
||||||
const modalVisible = ref(false);
|
const modalVisible = ref(false);
|
||||||
const currentItem = ref<any>(null);
|
const currentItem = ref<any>(null);
|
||||||
|
useDraggable(modalVisible, { boundary: true, resetOnOpen: true });
|
||||||
// 加载状态
|
// 加载状态
|
||||||
const loading = ref(false);
|
const loading = ref(false);
|
||||||
|
|
||||||
|
|||||||
@ -109,6 +109,7 @@ import isSameOrAfter from 'dayjs/plugin/isSameOrAfter'
|
|||||||
import BasicTable from '@/components/BasicTable/index.vue'
|
import BasicTable from '@/components/BasicTable/index.vue'
|
||||||
import { wqGetKendoList } from '@/api/sz'
|
import { wqGetKendoList } from '@/api/sz'
|
||||||
import HJMZDTwoLays from "./HJMZDTwoLays.vue"
|
import HJMZDTwoLays from "./HJMZDTwoLays.vue"
|
||||||
|
import { useDraggable } from '@/utils/drag';
|
||||||
|
|
||||||
// 注册 dayjs 插件
|
// 注册 dayjs 插件
|
||||||
dayjs.extend(isSameOrAfter)
|
dayjs.extend(isSameOrAfter)
|
||||||
@ -155,7 +156,7 @@ const detailModalVisible = ref(false)
|
|||||||
const detailData = ref<any>({})
|
const detailData = ref<any>({})
|
||||||
const mapModalVisible = ref(false)
|
const mapModalVisible = ref(false)
|
||||||
const mapModalData = ref<any>({})
|
const mapModalData = ref<any>({})
|
||||||
|
useDraggable(detailModalVisible, { boundary: true, resetOnOpen: true });
|
||||||
// 排序配置
|
// 排序配置
|
||||||
const sortConfig = computed(() => [
|
const sortConfig = computed(() => [
|
||||||
{ field: 'rstcdStepSort', dir: 'asc' },
|
{ field: 'rstcdStepSort', dir: 'asc' },
|
||||||
|
|||||||
@ -36,6 +36,8 @@ import SidePanelItem from '@/components/SidePanelItem/index.vue';
|
|||||||
import { wqGetKendoListCust } from '@/api/sz'
|
import { wqGetKendoListCust } from '@/api/sz'
|
||||||
import { useJidiSelectEventStore } from "@/store/modules/jidiSelectEvent";
|
import { useJidiSelectEventStore } from "@/store/modules/jidiSelectEvent";
|
||||||
import EnvironmentalQualityTwoLayers from "./TwoLayers/EnvironmentalQualityTwoLayers.vue"
|
import EnvironmentalQualityTwoLayers from "./TwoLayers/EnvironmentalQualityTwoLayers.vue"
|
||||||
|
import { useDraggable } from '@/utils/drag';
|
||||||
|
|
||||||
// 定义组件名(便于调试和递归)
|
// 定义组件名(便于调试和递归)
|
||||||
defineOptions({
|
defineOptions({
|
||||||
name: 'EnvironmentalQuality'
|
name: 'EnvironmentalQuality'
|
||||||
@ -774,7 +776,7 @@ onUnmounted(() => {
|
|||||||
// 弹框相关状态
|
// 弹框相关状态
|
||||||
const modalVisible = ref(false);
|
const modalVisible = ref(false);
|
||||||
const clickedBarData = ref<{ name: string; current: number | null; lastYear: number | null; selectedId?: string } | null>(null);
|
const clickedBarData = ref<{ name: string; current: number | null; lastYear: number | null; selectedId?: string } | null>(null);
|
||||||
|
useDraggable(modalVisible, { boundary: true, resetOnOpen: true });
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -1,6 +1,10 @@
|
|||||||
<!-- SidePanelItem.vue -->
|
<!-- SidePanelItem.vue -->
|
||||||
<template>
|
<template>
|
||||||
<SidePanelItem :title="title" :datetimePicker="datetimePicker" @update-values="handlePanelChange1">
|
<SidePanelItem
|
||||||
|
:title="title"
|
||||||
|
:datetimePicker="datetimePicker"
|
||||||
|
@update-values="handlePanelChange1"
|
||||||
|
>
|
||||||
<!-- 加载状态 -->
|
<!-- 加载状态 -->
|
||||||
<div v-if="loading" class="loading-container">
|
<div v-if="loading" class="loading-container">
|
||||||
<a-spin tip="加载中..." />
|
<a-spin tip="加载中..." />
|
||||||
@ -12,12 +16,24 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 正常显示图表 -->
|
<!-- 正常显示图表 -->
|
||||||
<div v-else class="container" @mouseenter="handleMouseEnter" @mouseleave="handleMouseLeave">
|
<div
|
||||||
|
v-else
|
||||||
|
class="container"
|
||||||
|
@mouseenter="handleMouseEnter"
|
||||||
|
@mouseleave="handleMouseLeave"
|
||||||
|
>
|
||||||
<!-- 跑马灯轨道容器 -->
|
<!-- 跑马灯轨道容器 -->
|
||||||
<div class="carousel-track" :class="{ 'no-transition': isTransitioning }"
|
<div
|
||||||
:style="{ transform: `translateX(-${currentIndex * 100}%)` }">
|
class="carousel-track"
|
||||||
|
:class="{ 'no-transition': isTransitioning }"
|
||||||
|
:style="{ transform: `translateX(-${currentIndex * 100}%)` }"
|
||||||
|
>
|
||||||
<!-- 遍历所有图表项(包含克隆项) -->
|
<!-- 遍历所有图表项(包含克隆项) -->
|
||||||
<div v-for="(item, index) in renderChartData" :key="index" class="carousel-item">
|
<div
|
||||||
|
v-for="(item, index) in renderChartData"
|
||||||
|
:key="index"
|
||||||
|
class="carousel-item"
|
||||||
|
>
|
||||||
<div class="pie-chart-container">
|
<div class="pie-chart-container">
|
||||||
<!-- 图表区域 -->
|
<!-- 图表区域 -->
|
||||||
<div :ref="el => setChartRef(el, index)" class="chart"></div>
|
<div :ref="el => setChartRef(el, index)" class="chart"></div>
|
||||||
@ -31,45 +47,12 @@
|
|||||||
<!-- 详情弹框 -->
|
<!-- 详情弹框 -->
|
||||||
<a-modal
|
<a-modal
|
||||||
v-model:open="modalVisible"
|
v-model:open="modalVisible"
|
||||||
:title="modalTitle"
|
:title="'过鱼监测数据'"
|
||||||
width="1650px"
|
width="1650px"
|
||||||
:footer="null"
|
:footer="null"
|
||||||
@cancel="handleModalClose"
|
@cancel="handleModalClose"
|
||||||
>
|
>
|
||||||
<div class="modal-content">
|
<FishResource v-if="modalVisible" :modalData = "modalData" />
|
||||||
<a-descriptions bordered :column="2" size="small">
|
|
||||||
<a-descriptions-item label="年份">
|
|
||||||
{{ modalData.year }}
|
|
||||||
</a-descriptions-item>
|
|
||||||
<a-descriptions-item label="流域/设施">
|
|
||||||
{{ modalData.basinName }}
|
|
||||||
</a-descriptions-item>
|
|
||||||
<a-descriptions-item label="鱼类总数">
|
|
||||||
<span style="color: #1890ff; font-weight: bold;">
|
|
||||||
{{ modalData.totalCount }} {{ getUnit() }}
|
|
||||||
</span>
|
|
||||||
</a-descriptions-item>
|
|
||||||
<a-descriptions-item label="">
|
|
||||||
{{ modalData.baseid }}
|
|
||||||
</a-descriptions-item>
|
|
||||||
</a-descriptions>
|
|
||||||
|
|
||||||
<a-divider orientation="left">鱼类分布详情</a-divider>
|
|
||||||
|
|
||||||
<a-table
|
|
||||||
:columns="fishColumns"
|
|
||||||
:data-source="modalData.fishList"
|
|
||||||
:pagination="false"
|
|
||||||
size="small"
|
|
||||||
:scroll="{ y: 300 }"
|
|
||||||
>
|
|
||||||
<template #bodyCell="{ column, record }">
|
|
||||||
<template v-if="column.key === 'percentage'">
|
|
||||||
{{ record.percentage }}%
|
|
||||||
</template>
|
|
||||||
</template>
|
|
||||||
</a-table>
|
|
||||||
</div>
|
|
||||||
</a-modal>
|
</a-modal>
|
||||||
</SidePanelItem>
|
</SidePanelItem>
|
||||||
</template>
|
</template>
|
||||||
@ -80,8 +63,10 @@ import * as echarts from 'echarts';
|
|||||||
import type { ECharts } from 'echarts';
|
import type { ECharts } from 'echarts';
|
||||||
import SidePanelItem from '@/components/SidePanelItem/index.vue';
|
import SidePanelItem from '@/components/SidePanelItem/index.vue';
|
||||||
import { yearGetYearFpStatistics } from '@/api/gyss';
|
import { yearGetYearFpStatistics } from '@/api/gyss';
|
||||||
import { useJidiSelectEventStore } from "@/store/modules/jidiSelectEvent";
|
import { useJidiSelectEventStore } from '@/store/modules/jidiSelectEvent';
|
||||||
import type { ColumnsType } from 'ant-design-vue/es/table/Table';
|
import type { ColumnsType } from 'ant-design-vue/es/table/Table';
|
||||||
|
import { useDraggable } from '@/utils/drag';
|
||||||
|
import FishResource from '@/components/FishResource/index.vue';
|
||||||
|
|
||||||
// API 数据类型定义
|
// API 数据类型定义
|
||||||
interface FpFtpStatisticsVo {
|
interface FpFtpStatisticsVo {
|
||||||
@ -108,10 +93,11 @@ const JidiSelectEventStore = useJidiSelectEventStore();
|
|||||||
const baseid = ref('');
|
const baseid = ref('');
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
title: { // 标题
|
title: {
|
||||||
|
// 标题
|
||||||
type: String,
|
type: String,
|
||||||
default: '过鱼总量'
|
default: '过鱼总量'
|
||||||
},
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
const datetimePicker = ref({
|
const datetimePicker = ref({
|
||||||
@ -134,7 +120,7 @@ const currentYear = ref<string>(''); // 当前选中的年份
|
|||||||
interface ChartDataItem {
|
interface ChartDataItem {
|
||||||
title: string;
|
title: string;
|
||||||
baseid?: string; // 流域ID(用于标识该图表所属的流域)
|
baseid?: string; // 流域ID(用于标识该图表所属的流域)
|
||||||
data: Array<{ name: string; value: number; baseId?: string }>; // 扩展数据项,支持存储流域ID
|
data: Array<{ name: string; value: number; baseId?: string; ftp?: string }>;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 原始图表数据(多组数据用于跑马灯)
|
// 原始图表数据(多组数据用于跑马灯)
|
||||||
@ -151,13 +137,16 @@ let timer: any = null;
|
|||||||
|
|
||||||
// 弹框相关状态
|
// 弹框相关状态
|
||||||
const modalVisible = ref(false);
|
const modalVisible = ref(false);
|
||||||
|
useDraggable(modalVisible, { boundary: true, resetOnOpen: true });
|
||||||
const modalTitle = ref('');
|
const modalTitle = ref('');
|
||||||
const modalData = ref<{
|
const modalData = ref<{
|
||||||
year: string;
|
year: string;
|
||||||
basinName: string;
|
basinName: string;
|
||||||
baseid?: string; // 添加流域ID
|
baseid?: string;
|
||||||
totalCount: number;
|
totalCount: number;
|
||||||
fishTypes: number;
|
fishTypes: number;
|
||||||
|
fishName?: string;
|
||||||
|
ftp?: string;
|
||||||
fishList: Array<{
|
fishList: Array<{
|
||||||
name: string;
|
name: string;
|
||||||
value: number;
|
value: number;
|
||||||
@ -169,6 +158,8 @@ const modalData = ref<{
|
|||||||
baseid: '',
|
baseid: '',
|
||||||
totalCount: 0,
|
totalCount: 0,
|
||||||
fishTypes: 0,
|
fishTypes: 0,
|
||||||
|
fishName: '',
|
||||||
|
ftp: '',
|
||||||
fishList: []
|
fishList: []
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -351,12 +342,12 @@ const updateChart = (index: number) => {
|
|||||||
textStyle: {
|
textStyle: {
|
||||||
fontSize: 24,
|
fontSize: 24,
|
||||||
fontWeight: 'bold',
|
fontWeight: 'bold',
|
||||||
color: '#333',
|
color: '#333'
|
||||||
},
|
},
|
||||||
subtextStyle: {
|
subtextStyle: {
|
||||||
fontSize: 12,
|
fontSize: 12,
|
||||||
color: '#999',
|
color: '#999',
|
||||||
align: 'center',
|
align: 'center'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@ -377,7 +368,8 @@ const updateChart = (index: number) => {
|
|||||||
const found = chartData.data.find(item => item.name === name);
|
const found = chartData.data.find(item => item.name === name);
|
||||||
const value = found ? found.value : '-';
|
const value = found ? found.value : '-';
|
||||||
const maxLength = 7;
|
const maxLength = 7;
|
||||||
const truncatedName = name.length > maxLength ? name.substring(0, maxLength) + '...' : name;
|
const truncatedName =
|
||||||
|
name.length > maxLength ? name.substring(0, maxLength) + '...' : name;
|
||||||
return `${truncatedName} ${value}${unit}`;
|
return `${truncatedName} ${value}${unit}`;
|
||||||
},
|
},
|
||||||
textStyle: {
|
textStyle: {
|
||||||
@ -538,13 +530,17 @@ onUnmounted(() => {
|
|||||||
/**
|
/**
|
||||||
* 构建单一流域的图表数据
|
* 构建单一流域的图表数据
|
||||||
*/
|
*/
|
||||||
const buildSingleBasinChartData = (basin: BasinData, year: string): ChartDataItem => {
|
const buildSingleBasinChartData = (
|
||||||
|
basin: BasinData,
|
||||||
|
year: string
|
||||||
|
): ChartDataItem => {
|
||||||
return {
|
return {
|
||||||
title: `${basin.baseName}`,
|
title: `${basin.baseName}`,
|
||||||
baseid: basin.baseId, // 保存流域ID
|
baseid: basin.baseId, // 保存流域ID
|
||||||
data: basin.fpFtpStatitcsVos.map((fish: FpFtpStatisticsVo) => ({
|
data: basin.fpFtpStatitcsVos.map((fish: FpFtpStatisticsVo) => ({
|
||||||
name: fish.fishName,
|
name: fish.fishName,
|
||||||
value: fish.fcnt
|
value: fish.fcnt,
|
||||||
|
ftp: fish.ftp
|
||||||
}))
|
}))
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
@ -552,12 +548,17 @@ const buildSingleBasinChartData = (basin: BasinData, year: string): ChartDataIte
|
|||||||
/**
|
/**
|
||||||
* 构建全部流域的图表数据(包含流域对比图和各流域鱼类分布图)
|
* 构建全部流域的图表数据(包含流域对比图和各流域鱼类分布图)
|
||||||
*/
|
*/
|
||||||
const buildAllBasinsChartData = (apiData: BasinData[], year: string): ChartDataItem[] => {
|
const buildAllBasinsChartData = (
|
||||||
|
apiData: BasinData[],
|
||||||
|
year: string
|
||||||
|
): ChartDataItem[] => {
|
||||||
const charts: ChartDataItem[] = [];
|
const charts: ChartDataItem[] = [];
|
||||||
|
|
||||||
// 1️⃣ 第一张:各流域总量对比图(使用 fpCount)
|
// 1️⃣ 第一张:各流域总量对比图(使用 fpCount)
|
||||||
const basinComparisonData = apiData
|
const basinComparisonData = apiData
|
||||||
.filter(basin => basin.fpFtpStatitcsVos && basin.fpFtpStatitcsVos.length > 0)
|
.filter(
|
||||||
|
basin => basin.fpFtpStatitcsVos && basin.fpFtpStatitcsVos.length > 0
|
||||||
|
)
|
||||||
.map(basin => ({
|
.map(basin => ({
|
||||||
name: basin.baseName,
|
name: basin.baseName,
|
||||||
value: basin.fpCount,
|
value: basin.fpCount,
|
||||||
@ -613,7 +614,8 @@ const rebuildCharts = async () => {
|
|||||||
*/
|
*/
|
||||||
const controlCarousel = () => {
|
const controlCarousel = () => {
|
||||||
// 判断是否需要停止跑马灯
|
// 判断是否需要停止跑马灯
|
||||||
const shouldStop = baseid.value !== 'all' || originalChartData.value.length <= 1;
|
const shouldStop =
|
||||||
|
baseid.value !== 'all' || originalChartData.value.length <= 1;
|
||||||
|
|
||||||
if (shouldStop) {
|
if (shouldStop) {
|
||||||
stopAutoPlay(); // 停止轮播,但不重置 currentIndex
|
stopAutoPlay(); // 停止轮播,但不重置 currentIndex
|
||||||
@ -636,12 +638,21 @@ const updateChartByBaseid = () => {
|
|||||||
|
|
||||||
if (baseid.value === 'all') {
|
if (baseid.value === 'all') {
|
||||||
// === 全部流域模式 ===
|
// === 全部流域模式 ===
|
||||||
originalChartData.value = buildAllBasinsChartData(cachedApiData.value, currentYear.value);
|
originalChartData.value = buildAllBasinsChartData(
|
||||||
|
cachedApiData.value,
|
||||||
|
currentYear.value
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
// === 单一流域模式 ===
|
// === 单一流域模式 ===
|
||||||
const targetBasin = cachedApiData.value.find(item => item.baseId === baseid.value);
|
const targetBasin = cachedApiData.value.find(
|
||||||
|
item => item.baseId === baseid.value
|
||||||
|
);
|
||||||
|
|
||||||
if (!targetBasin || !targetBasin.fpFtpStatitcsVos || targetBasin.fpFtpStatitcsVos.length === 0) {
|
if (
|
||||||
|
!targetBasin ||
|
||||||
|
!targetBasin.fpFtpStatitcsVos ||
|
||||||
|
targetBasin.fpFtpStatitcsVos.length === 0
|
||||||
|
) {
|
||||||
hasData.value = false;
|
hasData.value = false;
|
||||||
originalChartData.value = [];
|
originalChartData.value = [];
|
||||||
renderChartData.value = []; // 清空渲染数据
|
renderChartData.value = []; // 清空渲染数据
|
||||||
@ -649,7 +660,9 @@ const updateChartByBaseid = () => {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
originalChartData.value = [buildSingleBasinChartData(targetBasin, currentYear.value)];
|
originalChartData.value = [
|
||||||
|
buildSingleBasinChartData(targetBasin, currentYear.value)
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
// 先构建渲染数据
|
// 先构建渲染数据
|
||||||
@ -720,7 +733,6 @@ const getechartsdata = async (yearOne: string) => {
|
|||||||
currentYear.value = yearOne;
|
currentYear.value = yearOne;
|
||||||
// 根据 baseid 更新显示
|
// 根据 baseid 更新显示
|
||||||
updateChartByBaseid();
|
updateChartByBaseid();
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('获取过鱼统计数据失败:', error);
|
console.error('获取过鱼统计数据失败:', error);
|
||||||
hasData.value = false;
|
hasData.value = false;
|
||||||
@ -755,40 +767,43 @@ const handlePanelChange1 = (data: any) => {
|
|||||||
* @param params ECharts 点击事件参数(可选)
|
* @param params ECharts 点击事件参数(可选)
|
||||||
*/
|
*/
|
||||||
const handleChartClick = (item: ChartDataItem, index: number, params?: any) => {
|
const handleChartClick = (item: ChartDataItem, index: number, params?: any) => {
|
||||||
// 计算总数量和百分比
|
|
||||||
const totalCount = getTotalAmount(item.data);
|
const totalCount = getTotalAmount(item.data);
|
||||||
const fishList = item.data.map(fish => ({
|
const fishList = item.data.map(fish => ({
|
||||||
name: fish.name,
|
name: fish.name,
|
||||||
value: fish.value,
|
value: fish.value,
|
||||||
percentage: totalCount > 0 ? ((fish.value / totalCount) * 100).toFixed(2) : '0.00'
|
percentage:
|
||||||
|
totalCount > 0 ? ((fish.value / totalCount) * 100).toFixed(2) : '0.00'
|
||||||
}));
|
}));
|
||||||
|
|
||||||
// 确定流域ID
|
|
||||||
let clickedBaseId: string | undefined;
|
let clickedBaseId: string | undefined;
|
||||||
|
let fishName = '';
|
||||||
|
let ftp = '';
|
||||||
|
|
||||||
if (params && params.data && params.data.baseId) {
|
if (params && params.data && params.data.baseId) {
|
||||||
// 情况1:总量对比图,点击了某个流域的数据项
|
|
||||||
clickedBaseId = params.data.baseId;
|
clickedBaseId = params.data.baseId;
|
||||||
} else if (item.baseid && item.baseid !== 'all') {
|
} else if (item.baseid && item.baseid !== 'all') {
|
||||||
// 情况2:单一流域图,使用图表整体的 baseid
|
|
||||||
clickedBaseId = item.baseid;
|
clickedBaseId = item.baseid;
|
||||||
} else {
|
} else {
|
||||||
// 情况3:总量图表但未获取到具体数据项的 baseId(理论上不应该发生)
|
|
||||||
clickedBaseId = item.baseid;
|
clickedBaseId = item.baseid;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 设置弹框数据
|
if (item.baseid !== 'all' && params && params.data) {
|
||||||
|
fishName = params.data.name || '';
|
||||||
|
ftp = params.data.ftp || '';
|
||||||
|
}
|
||||||
|
|
||||||
modalTitle.value = `${item.title} - 详情`;
|
modalTitle.value = `${item.title} - 详情`;
|
||||||
modalData.value = {
|
modalData.value = {
|
||||||
year: currentYear.value || '-',
|
year: currentYear.value || '-',
|
||||||
basinName: params?.name || item.title, // 优先使用被点击的数据项名称
|
basinName: params?.name || item.title,
|
||||||
baseid: clickedBaseId, // 保存正确的流域ID
|
baseid: clickedBaseId,
|
||||||
totalCount: totalCount,
|
totalCount: totalCount,
|
||||||
fishTypes: item.data.length,
|
fishTypes: item.data.length,
|
||||||
|
fishName,
|
||||||
|
ftp,
|
||||||
fishList: fishList
|
fishList: fishList
|
||||||
};
|
};
|
||||||
|
|
||||||
// 打开弹框
|
|
||||||
modalVisible.value = true;
|
modalVisible.value = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -801,7 +816,7 @@ const handleModalClose = () => {
|
|||||||
|
|
||||||
watch(
|
watch(
|
||||||
() => JidiSelectEventStore.selectedItem,
|
() => JidiSelectEventStore.selectedItem,
|
||||||
(newVal) => {
|
newVal => {
|
||||||
if (newVal && newVal.wbsCode) {
|
if (newVal && newVal.wbsCode) {
|
||||||
baseid.value = newVal.wbsCode;
|
baseid.value = newVal.wbsCode;
|
||||||
|
|
||||||
@ -813,7 +828,6 @@ watch(
|
|||||||
},
|
},
|
||||||
{ deep: true, immediate: true }
|
{ deep: true, immediate: true }
|
||||||
);
|
);
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|||||||
@ -32,6 +32,7 @@ import SidePanelItem from '@/components/SidePanelItem/index.vue';
|
|||||||
import { vpcGetKendoListCust } from '@/api/zxdzw';
|
import { vpcGetKendoListCust } from '@/api/zxdzw';
|
||||||
import { useJidiSelectEventStore } from '@/store/modules/jidiSelectEvent';
|
import { useJidiSelectEventStore } from '@/store/modules/jidiSelectEvent';
|
||||||
import ZhiWuYuanDetailTable from './ZhiWuYuanDetailTable.vue';
|
import ZhiWuYuanDetailTable from './ZhiWuYuanDetailTable.vue';
|
||||||
|
import { useDraggable } from '@/utils/drag';
|
||||||
|
|
||||||
// 定义组件名(便于调试和递归)
|
// 定义组件名(便于调试和递归)
|
||||||
defineOptions({
|
defineOptions({
|
||||||
@ -50,7 +51,7 @@ const loading = ref(false);
|
|||||||
// 弹窗状态
|
// 弹窗状态
|
||||||
const modalVisible = ref(false);
|
const modalVisible = ref(false);
|
||||||
const modalJidi = ref('all');
|
const modalJidi = ref('all');
|
||||||
|
useDraggable(modalVisible, { boundary: true, resetOnOpen: true });
|
||||||
// 基地选项(用于弹窗中的下拉)
|
// 基地选项(用于弹窗中的下拉)
|
||||||
const jidiOptions = ref<any[]>([]);
|
const jidiOptions = ref<any[]>([]);
|
||||||
|
|
||||||
|
|||||||
@ -54,6 +54,7 @@ import Yanchengyulei from './TwoLayers/Yanchengyulei.vue';
|
|||||||
import { useJidiSelectEventStore } from '@/store/modules/jidiSelectEvent';
|
import { useJidiSelectEventStore } from '@/store/modules/jidiSelectEvent';
|
||||||
import { wbsbGetKendoList, getDftYear, fishChanges2 } from '@/api/stdc';
|
import { wbsbGetKendoList, getDftYear, fishChanges2 } from '@/api/stdc';
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
|
import { useDraggable } from '@/utils/drag';
|
||||||
|
|
||||||
defineOptions({
|
defineOptions({
|
||||||
name: 'alongFishMod'
|
name: 'alongFishMod'
|
||||||
@ -108,7 +109,7 @@ const modalHbrvcd = ref('');
|
|||||||
const modalStateName = ref('');
|
const modalStateName = ref('');
|
||||||
const modalSectionName = ref('');
|
const modalSectionName = ref('');
|
||||||
const modalStcd = ref('');
|
const modalStcd = ref('');
|
||||||
|
useDraggable(modalVisible, { boundary: true, resetOnOpen: true });
|
||||||
// ==================== 图表相关 ====================
|
// ==================== 图表相关 ====================
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -53,6 +53,8 @@ import { getVmsstbprpt, inOutOneGetKendoListCust } from '@/api/sw';
|
|||||||
import { useJidiSelectEventStore } from '@/store/modules/jidiSelectEvent';
|
import { useJidiSelectEventStore } from '@/store/modules/jidiSelectEvent';
|
||||||
import churukushuiwen from './churukushuiwen.vue';
|
import churukushuiwen from './churukushuiwen.vue';
|
||||||
import { MapClass } from '@/components/gis/map.class';
|
import { MapClass } from '@/components/gis/map.class';
|
||||||
|
import { useDraggable } from '@/utils/drag';
|
||||||
|
|
||||||
// ==================== 组件基础配置 ====================
|
// ==================== 组件基础配置 ====================
|
||||||
// 定义组件名(便于调试和递归)
|
// 定义组件名(便于调试和递归)
|
||||||
defineOptions({
|
defineOptions({
|
||||||
@ -96,7 +98,7 @@ const modalVisible = ref(false); // 弹框显示状态
|
|||||||
const clickDataInfo = ref<any>(null); // 点击的数据点信息
|
const clickDataInfo = ref<any>(null); // 点击的数据点信息
|
||||||
const stationName = ref(''); // 站点名称
|
const stationName = ref(''); // 站点名称
|
||||||
// ==================== 数据处理函数 ====================
|
// ==================== 数据处理函数 ====================
|
||||||
|
useDraggable(modalVisible, { boundary: true, resetOnOpen: true });
|
||||||
/**
|
/**
|
||||||
* 转换图表数据格式
|
* 转换图表数据格式
|
||||||
* 将后端返回的扁平数据结构转换为ECharts所需的双线数据格式
|
* 将后端返回的扁平数据结构转换为ECharts所需的双线数据格式
|
||||||
|
|||||||
@ -53,7 +53,7 @@
|
|||||||
</SidePanelItem>
|
</SidePanelItem>
|
||||||
|
|
||||||
<!-- 设施详情弹框 -->
|
<!-- 设施详情弹框 -->
|
||||||
<a-modal v-model:open="modalVisible" :title="'设施详情'" width="1536px" :footer="null">
|
<a-modal v-model:open="modalVisibleone" :title="'设施详情'" width="80%" :footer="null">
|
||||||
<div v-if="currentItem" class="detail-container">
|
<div v-if="currentItem" class="detail-container">
|
||||||
<ArtsDetail :dataSource="currentItem" :index="getCurrentRealIndex()" />
|
<ArtsDetail :dataSource="currentItem" :index="getCurrentRealIndex()" />
|
||||||
</div>
|
</div>
|
||||||
@ -66,6 +66,7 @@ import SidePanelItem from '@/components/SidePanelItem/index.vue';
|
|||||||
import ArtsDetail from '@/components/carouselIntroduce/ArtsDetail.vue';
|
import ArtsDetail from '@/components/carouselIntroduce/ArtsDetail.vue';
|
||||||
import { getMsstbprptKendoList } from '@/api/home';
|
import { getMsstbprptKendoList } from '@/api/home';
|
||||||
import { useJidiSelectEventStore } from '@/store/modules/jidiSelectEvent';
|
import { useJidiSelectEventStore } from '@/store/modules/jidiSelectEvent';
|
||||||
|
import { useDraggable } from '@/utils/drag';
|
||||||
|
|
||||||
// 定义组件名(便于调试和递归)
|
// 定义组件名(便于调试和递归)
|
||||||
defineOptions({
|
defineOptions({
|
||||||
@ -84,9 +85,9 @@ interface MediaItem {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 弹框控制
|
// 弹框控制
|
||||||
const modalVisible = ref(false);
|
const modalVisibleone = ref(false);
|
||||||
const currentItem = ref<any>(null);
|
const currentItem = ref<any>(null);
|
||||||
|
useDraggable(modalVisibleone, { boundary: true, resetOnOpen: true });
|
||||||
// 加载状态
|
// 加载状态
|
||||||
const loading = ref(false);
|
const loading = ref(false);
|
||||||
|
|
||||||
@ -217,7 +218,7 @@ const handleItemClick = () => {
|
|||||||
description: item.description || '',
|
description: item.description || '',
|
||||||
title: item.title || ''
|
title: item.title || ''
|
||||||
}));
|
}));
|
||||||
modalVisible.value = true;
|
modalVisibleone.value = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
// 处理下拉选择变化
|
// 处理下拉选择变化
|
||||||
|
|||||||
@ -36,6 +36,8 @@ import SidePanelItem from '@/components/SidePanelItem/index.vue';
|
|||||||
import { dwInfoGetKendoListCust } from "@/api/sw";
|
import { dwInfoGetKendoListCust } from "@/api/sw";
|
||||||
import { useJidiSelectEventStore } from "@/store/modules/jidiSelectEvent";
|
import { useJidiSelectEventStore } from "@/store/modules/jidiSelectEvent";
|
||||||
import DiwenshuijianhuansheshileixingzuchengjijieruqingkuangTwoLayers from "./TwoLayers/diwenshuijianhuansheshileixingzuchengjijieruqingkuangTwoLayers.vue"
|
import DiwenshuijianhuansheshileixingzuchengjijieruqingkuangTwoLayers from "./TwoLayers/diwenshuijianhuansheshileixingzuchengjijieruqingkuangTwoLayers.vue"
|
||||||
|
import { useDraggable } from '@/utils/drag';
|
||||||
|
|
||||||
const JidiSelectEventStore = useJidiSelectEventStore();
|
const JidiSelectEventStore = useJidiSelectEventStore();
|
||||||
// 定义组件名(便于调试和递归)
|
// 定义组件名(便于调试和递归)
|
||||||
defineOptions({
|
defineOptions({
|
||||||
@ -73,7 +75,7 @@ const baseid = ref('')
|
|||||||
const modalVisible = ref(false);
|
const modalVisible = ref(false);
|
||||||
const selectedItem: any = ref<DataString | null>(null);
|
const selectedItem: any = ref<DataString | null>(null);
|
||||||
const twoLayersRef = ref();
|
const twoLayersRef = ref();
|
||||||
|
useDraggable(modalVisible, { boundary: true, resetOnOpen: true });
|
||||||
|
|
||||||
const getListData = async () => {
|
const getListData = async () => {
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
|
|||||||
@ -4,9 +4,17 @@
|
|||||||
:datetimePicker="datetimePicker"
|
:datetimePicker="datetimePicker"
|
||||||
@update-values="handlePanelChange"
|
@update-values="handlePanelChange"
|
||||||
>
|
>
|
||||||
<a-spin :spinning="loading" style="width: 100%;">
|
<a-spin :spinning="loading" style="width: 100%">
|
||||||
<div ref="chartContainer" class="chart-container" v-show="sourceData.length > 0"></div>
|
<div
|
||||||
<a-empty v-show="sourceData.length === 0" description="暂无数据" class="empty-container" />
|
ref="chartContainer"
|
||||||
|
class="chart-container"
|
||||||
|
v-show="sourceData.length > 0"
|
||||||
|
></div>
|
||||||
|
<a-empty
|
||||||
|
v-show="sourceData.length === 0"
|
||||||
|
description="暂无数据"
|
||||||
|
class="empty-container"
|
||||||
|
/>
|
||||||
</a-spin>
|
</a-spin>
|
||||||
</SidePanelItem>
|
</SidePanelItem>
|
||||||
</template>
|
</template>
|
||||||
@ -296,8 +304,12 @@ onUnmounted(() => {
|
|||||||
}
|
}
|
||||||
.empty-container {
|
.empty-container {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
height: 200px;
|
height: 200px;
|
||||||
|
p{
|
||||||
|
text-indent:0px !important;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -68,6 +68,8 @@ import SidePanelItem from '@/components/SidePanelItem/index.vue';
|
|||||||
import { fishDicGetKendoList, wbsbGetKendoList } from '@/api/yldc';
|
import { fishDicGetKendoList, wbsbGetKendoList } from '@/api/yldc';
|
||||||
import { useJidiSelectEventStore } from '@/store/modules/jidiSelectEvent';
|
import { useJidiSelectEventStore } from '@/store/modules/jidiSelectEvent';
|
||||||
import ArtsDetail from '@/components/carouselIntroduce/ArtsDetail.vue';
|
import ArtsDetail from '@/components/carouselIntroduce/ArtsDetail.vue';
|
||||||
|
import { useDraggable } from '@/utils/drag';
|
||||||
|
|
||||||
// 定义组件名(便于调试和递归)
|
// 定义组件名(便于调试和递归)
|
||||||
defineOptions({
|
defineOptions({
|
||||||
name: 'zengZhiZhanJieShaoMod'
|
name: 'zengZhiZhanJieShaoMod'
|
||||||
@ -87,7 +89,7 @@ let rvcd = ref('');
|
|||||||
// 弹框控制
|
// 弹框控制
|
||||||
const modalVisible = ref(false);
|
const modalVisible = ref(false);
|
||||||
const currentItem = ref<any>(null);
|
const currentItem = ref<any>(null);
|
||||||
|
useDraggable(modalVisible, { boundary: true, resetOnOpen: true });
|
||||||
// 加载状态
|
// 加载状态
|
||||||
const loading = ref(false);
|
const loading = ref(false);
|
||||||
|
|
||||||
|
|||||||
@ -62,6 +62,8 @@ import { ref, onMounted, onUnmounted, computed } from 'vue';
|
|||||||
import SidePanelItem from '@/components/SidePanelItem/index.vue';
|
import SidePanelItem from '@/components/SidePanelItem/index.vue';
|
||||||
import { msstbprptGetKendoList } from '@/api/yldc';
|
import { msstbprptGetKendoList } from '@/api/yldc';
|
||||||
import ArtsDetail from '@/components/carouselIntroduce/ArtsDetail.vue';
|
import ArtsDetail from '@/components/carouselIntroduce/ArtsDetail.vue';
|
||||||
|
import { useDraggable } from '@/utils/drag';
|
||||||
|
|
||||||
// 定义组件名(便于调试和递归)
|
// 定义组件名(便于调试和递归)
|
||||||
defineOptions({
|
defineOptions({
|
||||||
name: 'zengZhiZhanJieShaoMod'
|
name: 'zengZhiZhanJieShaoMod'
|
||||||
@ -79,7 +81,7 @@ const baseUrl = import.meta.env.VITE_APP_ATTACHMENT_URL;
|
|||||||
// 弹框控制
|
// 弹框控制
|
||||||
const modalVisible = ref(false);
|
const modalVisible = ref(false);
|
||||||
const currentItem = ref<any>(null);
|
const currentItem = ref<any>(null);
|
||||||
|
useDraggable(modalVisible, { boundary: true, resetOnOpen: true });
|
||||||
// 加载状态
|
// 加载状态
|
||||||
const loading = ref(false);
|
const loading = ref(false);
|
||||||
|
|
||||||
|
|||||||
@ -36,6 +36,8 @@ import SidePanelItem from '@/components/SidePanelItem/index.vue';
|
|||||||
import { vmsstbprptGetKendoList } from '@/api/gyss'
|
import { vmsstbprptGetKendoList } from '@/api/gyss'
|
||||||
import { useJidiSelectEventStore } from "@/store/modules/jidiSelectEvent";
|
import { useJidiSelectEventStore } from "@/store/modules/jidiSelectEvent";
|
||||||
import FPVDDetailMD from './components/FPVDDetailMD.vue'
|
import FPVDDetailMD from './components/FPVDDetailMD.vue'
|
||||||
|
import { useDraggable } from '@/utils/drag';
|
||||||
|
|
||||||
// 定义组件名(便于调试和递归)
|
// 定义组件名(便于调试和递归)
|
||||||
defineOptions({
|
defineOptions({
|
||||||
name: 'guoyusheshijiansheqingkuang'
|
name: 'guoyusheshijiansheqingkuang'
|
||||||
@ -81,6 +83,7 @@ const loading = ref(false);
|
|||||||
const modalVisible = ref(false);
|
const modalVisible = ref(false);
|
||||||
const selectedFacility = ref<any>(null);
|
const selectedFacility = ref<any>(null);
|
||||||
const title = ref('');
|
const title = ref('');
|
||||||
|
useDraggable(modalVisible, { boundary: true, resetOnOpen: true });
|
||||||
// 处理卡片点击事件
|
// 处理卡片点击事件
|
||||||
const handleCardClick = (facility: any) => {
|
const handleCardClick = (facility: any) => {
|
||||||
selectedFacility.value = facility;
|
selectedFacility.value = facility;
|
||||||
|
|||||||
@ -3,25 +3,49 @@
|
|||||||
<SidePanelItem title="过鱼设施">
|
<SidePanelItem title="过鱼设施">
|
||||||
<a-spin :spinning="loading" tip="加载中...">
|
<a-spin :spinning="loading" tip="加载中...">
|
||||||
<div class="facility-grid">
|
<div class="facility-grid">
|
||||||
<div v-for="facility in facilities" :key="facility.name" class="facility-card"
|
<div
|
||||||
@click="handleFacilityClick(facility)">
|
v-for="facility in facilities"
|
||||||
<div style="width: 60px;height: 62px;display: flex;align-items: center;justify-content: center;">
|
:key="facility.name"
|
||||||
|
class="facility-card"
|
||||||
|
@click="handleFacilityClick(facility)"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
style="
|
||||||
|
width: 60px;
|
||||||
|
height: 62px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
"
|
||||||
|
>
|
||||||
<div class="facility-icon">
|
<div class="facility-icon">
|
||||||
<i style="color: #fff;" :class="facility.icon" type="icon-shengtailiuliang2"></i>
|
<i
|
||||||
|
style="color: #fff"
|
||||||
|
:class="facility.icon"
|
||||||
|
type="icon-shengtailiuliang2"
|
||||||
|
></i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="facility-info">
|
<div class="facility-info">
|
||||||
<div class="facility-name">{{ facility.name }}</div>
|
<div class="facility-name">{{ facility.name }}</div>
|
||||||
<div style="font-size: 16px;"> <span class="facility-count">{{ facility.count
|
<div style="font-size: 16px">
|
||||||
}}</span><span>座</span></div>
|
<span class="facility-count">{{ facility.count }}</span
|
||||||
|
><span>座</span>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</a-spin>
|
</a-spin>
|
||||||
</SidePanelItem>
|
</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"
|
||||||
|
>
|
||||||
<ModalPage v-if="currentFacility" :data="currentFacility" :jdId="'all'" />
|
<ModalPage v-if="currentFacility" :data="currentFacility" :jdId="'all'" />
|
||||||
</a-modal>
|
</a-modal>
|
||||||
</template>
|
</template>
|
||||||
@ -29,9 +53,11 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ref, onMounted, onUnmounted, watch, nextTick } from 'vue';
|
import { ref, onMounted, onUnmounted, watch, nextTick } from 'vue';
|
||||||
import SidePanelItem from '@/components/SidePanelItem/index.vue';
|
import SidePanelItem from '@/components/SidePanelItem/index.vue';
|
||||||
import { useJidiSelectEventStore } from "@/store/modules/jidiSelectEvent";
|
import { useJidiSelectEventStore } from '@/store/modules/jidiSelectEvent';
|
||||||
import { buildGetKendoListCust } from '@/api/gyss';
|
import { buildGetKendoListCust } from '@/api/gyss';
|
||||||
import ModalPage from './ModalPage/index.vue'
|
import ModalPage from './ModalPage/index.vue';
|
||||||
|
import { useDraggable } from '@/utils/drag';
|
||||||
|
|
||||||
// 定义组件名(便于调试和递归)
|
// 定义组件名(便于调试和递归)
|
||||||
defineOptions({
|
defineOptions({
|
||||||
name: 'qixidibaohugongzuokaizhanQK'
|
name: 'qixidibaohugongzuokaizhanQK'
|
||||||
@ -64,23 +90,23 @@ const facilities = ref([
|
|||||||
count: 0,
|
count: 0,
|
||||||
icon: 'icon iconfont icon-map-gyssQita',
|
icon: 'icon iconfont icon-map-gyssQita',
|
||||||
key: 'FP_5'
|
key: 'FP_5'
|
||||||
},
|
}
|
||||||
|
|
||||||
]);
|
]);
|
||||||
const baseid = ref('')
|
const baseid = ref('');
|
||||||
// 弹框相关状态
|
// 弹框相关状态
|
||||||
const modalVisible = ref(false);
|
const modalVisible = ref(false);
|
||||||
const currentFacility = ref<any>(null);
|
const currentFacility = ref<any>(null);
|
||||||
|
useDraggable(modalVisible, { boundary: true, resetOnOpen: true });
|
||||||
//获取页面数据
|
//获取页面数据
|
||||||
const getData = async () => {
|
const getData = async () => {
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
try {
|
try {
|
||||||
let params = {
|
let params = {
|
||||||
"filter": {
|
filter: {
|
||||||
"logic": "and",
|
logic: 'and',
|
||||||
"filters": []
|
filters: []
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
};
|
||||||
const res = await buildGetKendoListCust(params); //适配监控-VD
|
const res = await buildGetKendoListCust(params); //适配监控-VD
|
||||||
let data = res?.data?.data || res?.data || [];
|
let data = res?.data?.data || res?.data || [];
|
||||||
|
|
||||||
@ -91,15 +117,21 @@ const getData = async () => {
|
|||||||
|
|
||||||
// 遍历接口返回的所有数据
|
// 遍历接口返回的所有数据
|
||||||
data.forEach(item => {
|
data.forEach(item => {
|
||||||
const matchedFacility = facilities.value.find(facility => facility.key === item.sttpCode);
|
const matchedFacility = facilities.value.find(
|
||||||
|
facility => facility.key === item.sttpCode
|
||||||
|
);
|
||||||
if (matchedFacility) {
|
if (matchedFacility) {
|
||||||
// 如果在facilities中找到对应的key,累加到该设施
|
// 如果在facilities中找到对应的key,累加到该设施
|
||||||
matchedFacility.count += Number(item.built) + Number(item.building) || 0;
|
matchedFacility.count +=
|
||||||
|
Number(item.built) + Number(item.building) || 0;
|
||||||
} else {
|
} else {
|
||||||
// 如果没有找到对应的key,累加到FP_5(其他)
|
// 如果没有找到对应的key,累加到FP_5(其他)
|
||||||
const otherFacility = facilities.value.find(facility => facility.key === 'FP_5');
|
const otherFacility = facilities.value.find(
|
||||||
|
facility => facility.key === 'FP_5'
|
||||||
|
);
|
||||||
if (otherFacility) {
|
if (otherFacility) {
|
||||||
otherFacility.count += Number(item.built) + Number(item.building) || 0;
|
otherFacility.count +=
|
||||||
|
Number(item.built) + Number(item.building) || 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -108,13 +140,11 @@ const getData = async () => {
|
|||||||
} finally {
|
} finally {
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
// 点击处理函数
|
// 点击处理函数
|
||||||
const handleFacilityClick = (facility: any) => {
|
const handleFacilityClick = (facility: any) => {
|
||||||
currentFacility.value = facility;
|
currentFacility.value = facility;
|
||||||
modalVisible.value = true;
|
modalVisible.value = true;
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
// 关闭弹框
|
// 关闭弹框
|
||||||
const handleCloseModal = () => {
|
const handleCloseModal = () => {
|
||||||
@ -124,22 +154,19 @@ const handleCloseModal = () => {
|
|||||||
|
|
||||||
watch(
|
watch(
|
||||||
() => JidiSelectEventStore.selectedItem,
|
() => JidiSelectEventStore.selectedItem,
|
||||||
(newVal) => {
|
newVal => {
|
||||||
baseid.value = newVal.wbsCode;
|
baseid.value = newVal.wbsCode;
|
||||||
getData()
|
getData();
|
||||||
},
|
},
|
||||||
{ deep: true, immediate: true }
|
{ deep: true, immediate: true }
|
||||||
);
|
);
|
||||||
// 页面加载时执行
|
// 页面加载时执行
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
// 延迟初始化,确保容器已渲染
|
// 延迟初始化,确保容器已渲染
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// 组件卸载时清理
|
// 组件卸载时清理
|
||||||
onUnmounted(() => {
|
onUnmounted(() => {});
|
||||||
|
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
@ -148,7 +175,9 @@ onUnmounted(() => {
|
|||||||
flex-flow: wrap;
|
flex-flow: wrap;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, Noto Sans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji;
|
font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto,
|
||||||
|
Helvetica Neue, Arial, Noto Sans, sans-serif, Apple Color Emoji,
|
||||||
|
Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji;
|
||||||
}
|
}
|
||||||
|
|
||||||
.facility-card {
|
.facility-card {
|
||||||
|
|||||||
@ -3,13 +3,25 @@
|
|||||||
<SidePanelItem title="过鱼设施介绍">
|
<SidePanelItem title="过鱼设施介绍">
|
||||||
<!-- Loading 和空状态容器 -->
|
<!-- Loading 和空状态容器 -->
|
||||||
<a-spin :spinning="loading" class="carousel-container-wrapper">
|
<a-spin :spinning="loading" class="carousel-container-wrapper">
|
||||||
<div v-if="hasData" class="container" @mouseenter="handleMouseEnter" @mouseleave="handleMouseLeave">
|
<div
|
||||||
|
v-if="hasData"
|
||||||
|
class="container"
|
||||||
|
@mouseenter="handleMouseEnter"
|
||||||
|
@mouseleave="handleMouseLeave"
|
||||||
|
>
|
||||||
<!-- 跑马灯轨道容器 -->
|
<!-- 跑马灯轨道容器 -->
|
||||||
<div class="carousel-track" :class="{ 'no-transition': isTransitioning }"
|
<div
|
||||||
:style="{ transform: `translateX(-${currentIndex * 100}%)` }">
|
class="carousel-track"
|
||||||
|
:class="{ 'no-transition': isTransitioning }"
|
||||||
|
:style="{ transform: `translateX(-${currentIndex * 100}%)` }"
|
||||||
|
>
|
||||||
<!-- 遍历所有媒体项(包含克隆项) -->
|
<!-- 遍历所有媒体项(包含克隆项) -->
|
||||||
<div v-for="(item, index) in renderMediaData" :key="index" class="carousel-item"
|
<div
|
||||||
@click="handleItemClick(originalMediaData)">
|
v-for="(item, index) in renderMediaData"
|
||||||
|
:key="index"
|
||||||
|
class="carousel-item"
|
||||||
|
@click="handleItemClick(originalMediaData)"
|
||||||
|
>
|
||||||
<!-- 图片 -->
|
<!-- 图片 -->
|
||||||
<img :src="item.url" :alt="item.stnm" loading="lazy" />
|
<img :src="item.url" :alt="item.stnm" loading="lazy" />
|
||||||
<!-- 说明文字(随媒体项移动) -->
|
<!-- 说明文字(随媒体项移动) -->
|
||||||
@ -19,36 +31,50 @@
|
|||||||
|
|
||||||
<!-- 面板指示器(固定在底部右侧) -->
|
<!-- 面板指示器(固定在底部右侧) -->
|
||||||
<div class="pagination-dots-fixed">
|
<div class="pagination-dots-fixed">
|
||||||
<span v-for="(dot, index) in originalMediaData" :key="index" class="dot"
|
<span
|
||||||
:class="{ active: currentRealIndex === index }" @click="goToSlide(index)"></span>
|
v-for="(dot, index) in originalMediaData"
|
||||||
|
:key="index"
|
||||||
|
class="dot"
|
||||||
|
:class="{ active: currentRealIndex === index }"
|
||||||
|
@click="goToSlide(index)"
|
||||||
|
></span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- 暂无数据状态 -->
|
<!-- 暂无数据状态 -->
|
||||||
|
|
||||||
<!-- 独立的文字说明区域(随跑马灯切换而变化) -->
|
<!-- 独立的文字说明区域(随跑马灯切换而变化) -->
|
||||||
<div v-if="hasData" class="description-text" @click="handleItemClick(originalMediaData)">
|
<div
|
||||||
|
v-if="hasData"
|
||||||
|
class="description-text"
|
||||||
|
@click="handleItemClick(originalMediaData)"
|
||||||
|
>
|
||||||
{{ currentDescription }}
|
{{ currentDescription }}
|
||||||
</div>
|
</div>
|
||||||
<a-empty v-else description="暂无数据" :image="simpleImage" />
|
<a-empty v-else description="暂无数据" :image="simpleImage" />
|
||||||
</a-spin>
|
</a-spin>
|
||||||
</SidePanelItem>
|
</SidePanelItem>
|
||||||
<!-- 设施详情弹框 -->
|
<!-- 设施详情弹框 -->
|
||||||
<a-modal v-model:open="modalVisible" :title="'设施类型介绍'" width="1536px" :footer="null">
|
<a-modal
|
||||||
|
v-model:open="modalVisible"
|
||||||
|
:title="'设施类型介绍'"
|
||||||
|
width="1536px"
|
||||||
|
:footer="null"
|
||||||
|
>
|
||||||
<!-- 你在这里编写弹框内容 -->
|
<!-- 你在这里编写弹框内容 -->
|
||||||
<div v-if="currentItem">
|
<div v-if="currentItem">
|
||||||
<ArtsDetail :dataSource='currentItem' :index="getCurrentRealIndex()" />
|
<ArtsDetail :dataSource="currentItem" :index="getCurrentRealIndex()" />
|
||||||
</div>
|
</div>
|
||||||
</a-modal>
|
</a-modal>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ref, onMounted, onUnmounted, computed, watch } from 'vue';
|
import { ref, onMounted, onUnmounted, computed, watch } from 'vue';
|
||||||
import SidePanelItem from '@/components/SidePanelItem/index.vue';
|
import SidePanelItem from '@/components/SidePanelItem/index.vue';
|
||||||
import { useJidiSelectEventStore } from "@/store/modules/jidiSelectEvent";
|
import { useJidiSelectEventStore } from '@/store/modules/jidiSelectEvent';
|
||||||
import { fpVmsstbprptGetKendoList } from '@/api/gyss';
|
import { fpVmsstbprptGetKendoList } from '@/api/gyss';
|
||||||
import ArtsDetail from '@/components/carouselIntroduce/ArtsDetail.vue';
|
import ArtsDetail from '@/components/carouselIntroduce/ArtsDetail.vue';
|
||||||
import { Empty } from 'ant-design-vue';
|
import { Empty } from 'ant-design-vue';
|
||||||
|
import { useDraggable } from '@/utils/drag';
|
||||||
|
|
||||||
// ==================== 类型定义 ====================
|
// ==================== 类型定义 ====================
|
||||||
interface MediaItem {
|
interface MediaItem {
|
||||||
@ -79,6 +105,7 @@ const baseUrl = import.meta.env.VITE_APP_ATTACHMENT_URL;
|
|||||||
// 弹框控制
|
// 弹框控制
|
||||||
const modalVisible = ref(false);
|
const modalVisible = ref(false);
|
||||||
const currentItem = ref<any>(null);
|
const currentItem = ref<any>(null);
|
||||||
|
useDraggable(modalVisible, { boundary: true, resetOnOpen: true });
|
||||||
// ==================== 数据状态 ====================
|
// ==================== 数据状态 ====================
|
||||||
// 加载状态
|
// 加载状态
|
||||||
const loading = ref(false);
|
const loading = ref(false);
|
||||||
@ -247,12 +274,14 @@ const getCarouselData = async () => {
|
|||||||
operator: 'isnotnull',
|
operator: 'isnotnull',
|
||||||
dataType: 'string'
|
dataType: 'string'
|
||||||
},
|
},
|
||||||
baseid.value !== 'all' ? {
|
baseid.value !== 'all'
|
||||||
|
? {
|
||||||
field: 'baseId',
|
field: 'baseId',
|
||||||
operator: 'eq',
|
operator: 'eq',
|
||||||
dataType: 'string',
|
dataType: 'string',
|
||||||
value: baseid.value
|
value: baseid.value
|
||||||
} : null
|
}
|
||||||
|
: null
|
||||||
].filter(Boolean)
|
].filter(Boolean)
|
||||||
},
|
},
|
||||||
select: ['introduce', 'logo', 'stnm', 'precis'],
|
select: ['introduce', 'logo', 'stnm', 'precis'],
|
||||||
@ -298,7 +327,7 @@ onUnmounted(() => {
|
|||||||
// ==================== 监听器 ====================
|
// ==================== 监听器 ====================
|
||||||
watch(
|
watch(
|
||||||
() => JidiSelectEventStore.selectedItem,
|
() => JidiSelectEventStore.selectedItem,
|
||||||
(newVal) => {
|
newVal => {
|
||||||
if (newVal?.wbsCode) {
|
if (newVal?.wbsCode) {
|
||||||
baseid.value = newVal.wbsCode;
|
baseid.value = newVal.wbsCode;
|
||||||
} else {
|
} else {
|
||||||
@ -391,7 +420,7 @@ const handleItemClick = (item: any) => {
|
|||||||
width: 5px;
|
width: 5px;
|
||||||
height: 5px;
|
height: 5px;
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
background-color: #D8D8D8;
|
background-color: #d8d8d8;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
transition: background-color 0.3s ease;
|
transition: background-color 0.3s ease;
|
||||||
|
|
||||||
|
|||||||
@ -30,7 +30,7 @@
|
|||||||
<a-modal
|
<a-modal
|
||||||
v-model:open="modalVisible"
|
v-model:open="modalVisible"
|
||||||
title="环保设施情况"
|
title="环保设施情况"
|
||||||
width="1536px"
|
width="80%"
|
||||||
:footer="null"
|
:footer="null"
|
||||||
>
|
>
|
||||||
<HuanbaoModTwoLayers
|
<HuanbaoModTwoLayers
|
||||||
@ -49,6 +49,7 @@ import SidePanelItem from '@/components/SidePanelItem/index.vue';
|
|||||||
import { environmentalProtectionConstruction } from '@/api/home';
|
import { environmentalProtectionConstruction } from '@/api/home';
|
||||||
import { useJidiSelectEventStore } from '@/store/modules/jidiSelectEvent';
|
import { useJidiSelectEventStore } from '@/store/modules/jidiSelectEvent';
|
||||||
import HuanbaoModTwoLayers from './TwoLayers/HuanbaoModTwoLayers.vue';
|
import HuanbaoModTwoLayers from './TwoLayers/HuanbaoModTwoLayers.vue';
|
||||||
|
import { useDraggable } from '@/utils/drag';
|
||||||
|
|
||||||
// 定义组件名(便于调试和递归)
|
// 定义组件名(便于调试和递归)
|
||||||
defineOptions({
|
defineOptions({
|
||||||
@ -82,7 +83,7 @@ const modalRes = ref({
|
|||||||
bldstt: '',
|
bldstt: '',
|
||||||
hydrodtin: '1'
|
hydrodtin: '1'
|
||||||
});
|
});
|
||||||
|
useDraggable(modalVisible, { boundary: true, resetOnOpen: true });
|
||||||
// 获取数据
|
// 获取数据
|
||||||
const getData = async () => {
|
const getData = async () => {
|
||||||
if (!baseid.value) return;
|
if (!baseid.value) return;
|
||||||
|
|||||||
@ -68,6 +68,7 @@ import svg_liuliangjiancezhan from '@/assets/svg/liuliangjiancezhan.svg';
|
|||||||
import svg_shuizhijiancezhan from '@/assets/svg/shuizhijiancezhan.svg';
|
import svg_shuizhijiancezhan from '@/assets/svg/shuizhijiancezhan.svg';
|
||||||
import svg_zengzhizhanshuizhizhan from '@/assets/svg/zengzhizhanshuizhizhan.svg';
|
import svg_zengzhizhanshuizhizhan from '@/assets/svg/zengzhizhanshuizhizhan.svg';
|
||||||
import svg_qixidi from '@/assets/svg/qixidi.svg';
|
import svg_qixidi from '@/assets/svg/qixidi.svg';
|
||||||
|
import { useDraggable } from '@/utils/drag';
|
||||||
|
|
||||||
defineOptions({
|
defineOptions({
|
||||||
name: 'huanbaoMod'
|
name: 'huanbaoMod'
|
||||||
@ -103,7 +104,7 @@ const baseid = ref('');
|
|||||||
// 弹框相关状态
|
// 弹框相关状态
|
||||||
const modalVisible = ref(false);
|
const modalVisible = ref(false);
|
||||||
const currentFacility = ref<IFacility | null>(null);
|
const currentFacility = ref<IFacility | null>(null);
|
||||||
|
useDraggable(modalVisible, { boundary: true, resetOnOpen: true });
|
||||||
const fetchData = () => {
|
const fetchData = () => {
|
||||||
let params = {
|
let params = {
|
||||||
filter: {
|
filter: {
|
||||||
|
|||||||
@ -316,7 +316,8 @@ import { postIdUrl } from '@/api/mapModal';
|
|||||||
import dayjs from 'dayjs';
|
import dayjs from 'dayjs';
|
||||||
import { useJidiSelectEventStore } from '@/store/modules/jidiSelectEvent';
|
import { useJidiSelectEventStore } from '@/store/modules/jidiSelectEvent';
|
||||||
import videoCover from '@/assets/images/videFm.jpg';
|
import videoCover from '@/assets/images/videFm.jpg';
|
||||||
|
import { useDraggable } from '@/utils/drag';
|
||||||
|
;
|
||||||
const baseUrl = import.meta.env.VITE_APP_ATTACHMENT_URL;
|
const baseUrl = import.meta.env.VITE_APP_ATTACHMENT_URL;
|
||||||
|
|
||||||
// ==================== Props ====================
|
// ==================== Props ====================
|
||||||
@ -397,7 +398,7 @@ const calendarValue = ref(searchData.value.month);
|
|||||||
const detailModalVisible = ref(false);
|
const detailModalVisible = ref(false);
|
||||||
const detailActiveKey = ref('2');
|
const detailActiveKey = ref('2');
|
||||||
const detailDate = ref('');
|
const detailDate = ref('');
|
||||||
|
useDraggable(detailModalVisible, { boundary: true, resetOnOpen: true })
|
||||||
// 日历状态映射(运行/未运行)
|
// 日历状态映射(运行/未运行)
|
||||||
const calendarStatusMap: Record<
|
const calendarStatusMap: Record<
|
||||||
string,
|
string,
|
||||||
|
|||||||
@ -51,6 +51,7 @@ import SidePanelItem from '@/components/SidePanelItem/index.vue';
|
|||||||
import AISPTK from './AISPTK.vue';
|
import AISPTK from './AISPTK.vue';
|
||||||
import { getAiGyssList } from '@/api/zngj';
|
import { getAiGyssList } from '@/api/zngj';
|
||||||
import dayjs from 'dayjs';
|
import dayjs from 'dayjs';
|
||||||
|
import { useDraggable } from '@/utils/drag';
|
||||||
|
|
||||||
// 定义组件名(便于调试和递归)
|
// 定义组件名(便于调试和递归)
|
||||||
defineOptions({
|
defineOptions({
|
||||||
@ -65,7 +66,7 @@ const panelDetail = ref<any>({});
|
|||||||
// ==================== 弹框状态 ====================
|
// ==================== 弹框状态 ====================
|
||||||
const modalVisible = ref(false);
|
const modalVisible = ref(false);
|
||||||
const currentAction = ref('AI_5006');
|
const currentAction = ref('AI_5006');
|
||||||
|
useDraggable(modalVisible, { boundary: true, resetOnOpen: true });
|
||||||
const lyName = computed(() => baseid.value === '02' ? '升鱼斗运行' : '升鱼机运行');
|
const lyName = computed(() => baseid.value === '02' ? '升鱼斗运行' : '升鱼机运行');
|
||||||
|
|
||||||
// ==================== 日期选择器配置 ====================
|
// ==================== 日期选择器配置 ====================
|
||||||
|
|||||||
@ -40,6 +40,7 @@ import { useJidiSelectEventStore } from '@/store/modules/jidiSelectEvent';
|
|||||||
import SidePanelItem from "@/components/SidePanelItem/index.vue";
|
import SidePanelItem from "@/components/SidePanelItem/index.vue";
|
||||||
import { getStllGaojingList } from '@/api/zngj';
|
import { getStllGaojingList } from '@/api/zngj';
|
||||||
import ModeGaoJing from './ModeGaoJing.vue';
|
import ModeGaoJing from './ModeGaoJing.vue';
|
||||||
|
import { useDraggable } from '@/utils/drag';
|
||||||
|
|
||||||
// 定义组件名(便于调试和递归)
|
// 定义组件名(便于调试和递归)
|
||||||
defineOptions({
|
defineOptions({
|
||||||
@ -51,7 +52,7 @@ const baseid = ref('');
|
|||||||
const dataLoading = ref(false);
|
const dataLoading = ref(false);
|
||||||
const isModalOpen = ref(false);
|
const isModalOpen = ref(false);
|
||||||
const currentWarnState = ref('');
|
const currentWarnState = ref('');
|
||||||
|
useDraggable(isModalOpen, { boundary: true, resetOnOpen: true });
|
||||||
const data = ref([
|
const data = ref([
|
||||||
{
|
{
|
||||||
name:'正常',
|
name:'正常',
|
||||||
|
|||||||
@ -38,6 +38,7 @@ import { useJidiSelectEventStore } from '@/store/modules/jidiSelectEvent';
|
|||||||
import SidePanelItem from "@/components/SidePanelItem/index.vue";
|
import SidePanelItem from "@/components/SidePanelItem/index.vue";
|
||||||
import { getShuizhiGaojingList } from '@/api/zngj';
|
import { getShuizhiGaojingList } from '@/api/zngj';
|
||||||
import ModeGaoJing from './ModeGaoJing.vue';
|
import ModeGaoJing from './ModeGaoJing.vue';
|
||||||
|
import { useDraggable } from '@/utils/drag';
|
||||||
|
|
||||||
defineOptions({
|
defineOptions({
|
||||||
name: "shuizhijianceshuju",
|
name: "shuizhijianceshuju",
|
||||||
@ -51,7 +52,7 @@ const defaultValue = ref<string>('0');
|
|||||||
// 弹框状态
|
// 弹框状态
|
||||||
const modalVisible = ref(false);
|
const modalVisible = ref(false);
|
||||||
const currentWarnState = ref('');
|
const currentWarnState = ref('');
|
||||||
|
useDraggable(modalVisible, { boundary: true, resetOnOpen: true });
|
||||||
const handleCardClick = (warnState: string) => {
|
const handleCardClick = (warnState: string) => {
|
||||||
currentWarnState.value = warnState;
|
currentWarnState.value = warnState;
|
||||||
modalVisible.value = true;
|
modalVisible.value = true;
|
||||||
|
|||||||
@ -68,6 +68,7 @@ import SidePanelItem from '@/components/SidePanelItem/index.vue';
|
|||||||
import LsstjkTk from './LsstjkTk.vue';
|
import LsstjkTk from './LsstjkTk.vue';
|
||||||
import { wbsbGetKendoList, getEvnmAutoMonitor } from '@/api/stdc';
|
import { wbsbGetKendoList, getEvnmAutoMonitor } from '@/api/stdc';
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
|
import { useDraggable } from '@/utils/drag';
|
||||||
|
|
||||||
// 定义组件名
|
// 定义组件名
|
||||||
defineOptions({
|
defineOptions({
|
||||||
@ -81,7 +82,7 @@ const dataLoading = ref(false);
|
|||||||
// ==================== 弹框状态 ====================
|
// ==================== 弹框状态 ====================
|
||||||
const modalVisible = ref(false);
|
const modalVisible = ref(false);
|
||||||
const currentOrderIndex = ref('16');
|
const currentOrderIndex = ref('16');
|
||||||
|
useDraggable(modalVisible, { boundary: true, resetOnOpen: true });
|
||||||
// ==================== 响应式变量定义 ====================
|
// ==================== 响应式变量定义 ====================
|
||||||
// 选择器配置
|
// 选择器配置
|
||||||
const select = ref({
|
const select = ref({
|
||||||
|
|||||||
@ -70,6 +70,7 @@ import dayjs from 'dayjs';
|
|||||||
import { ZoomInOutlined } from '@ant-design/icons-vue';
|
import { ZoomInOutlined } from '@ant-design/icons-vue';
|
||||||
import type { Dayjs } from 'dayjs';
|
import type { Dayjs } from 'dayjs';
|
||||||
import MonthlyAverage from '../monthlyAverage.vue';
|
import MonthlyAverage from '../monthlyAverage.vue';
|
||||||
|
import { useDraggable } from '@/utils/drag';
|
||||||
|
|
||||||
defineOptions({
|
defineOptions({
|
||||||
name: 'MonthlyAverageMaxModal'
|
name: 'MonthlyAverageMaxModal'
|
||||||
@ -101,7 +102,7 @@ const detailModalData = ref<any>(null);
|
|||||||
// 选择器相关 - 内部状态管理
|
// 选择器相关 - 内部状态管理
|
||||||
const selectValue = ref('');
|
const selectValue = ref('');
|
||||||
const selectOptions = ref<any[]>([]);
|
const selectOptions = ref<any[]>([]);
|
||||||
|
useDraggable(detailModalVisible, { boundary: true, resetOnOpen: true });
|
||||||
// 树形选择器展开状态管理
|
// 树形选择器展开状态管理
|
||||||
const treeExpandedKeys = ref<string[]>([])
|
const treeExpandedKeys = ref<string[]>([])
|
||||||
const nodeMap = new Map<string, { node: any; parentKey: string | null }>()
|
const nodeMap = new Map<string, { node: any; parentKey: string | null }>()
|
||||||
|
|||||||
@ -41,6 +41,7 @@ import dayjs from 'dayjs'
|
|||||||
import {
|
import {
|
||||||
ZoomInOutlined
|
ZoomInOutlined
|
||||||
} from '@ant-design/icons-vue';
|
} from '@ant-design/icons-vue';
|
||||||
|
import { useDraggable } from '@/utils/drag';
|
||||||
|
|
||||||
defineOptions({
|
defineOptions({
|
||||||
name: 'monthlyAvgWaterTemCompareHistory'
|
name: 'monthlyAvgWaterTemCompareHistory'
|
||||||
@ -68,7 +69,8 @@ const stationName = ref('');
|
|||||||
|
|
||||||
// 图表放大展示弹框状态
|
// 图表放大展示弹框状态
|
||||||
const zoomModalVisible = ref(false);
|
const zoomModalVisible = ref(false);
|
||||||
|
useDraggable(modalVisible, { boundary: true, resetOnOpen: true });
|
||||||
|
useDraggable(zoomModalVisible, { boundary: true, resetOnOpen: true });
|
||||||
// 选择器配置
|
// 选择器配置
|
||||||
const select = ref({
|
const select = ref({
|
||||||
show: true,
|
show: true,
|
||||||
|
|||||||
@ -3,36 +3,66 @@
|
|||||||
<SidePanelItem title="栖息地保护工作开展情况">
|
<SidePanelItem title="栖息地保护工作开展情况">
|
||||||
<a-spin :spinning="loading" tip="加载中...">
|
<a-spin :spinning="loading" tip="加载中...">
|
||||||
<div class="facility-grid">
|
<div class="facility-grid">
|
||||||
<div v-for="facility in facilities" :key="facility.name" class="facility-card"
|
<div
|
||||||
@click="handleFacilityClick(facility)">
|
v-for="facility in facilities"
|
||||||
<div style="width: 60px;height: 62px;display: flex;align-items: center;justify-content: center;">
|
:key="facility.name"
|
||||||
|
class="facility-card"
|
||||||
|
@click="handleFacilityClick(facility)"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
style="
|
||||||
|
width: 60px;
|
||||||
|
height: 62px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
"
|
||||||
|
>
|
||||||
<div class="facility-icon">
|
<div class="facility-icon">
|
||||||
<i style="color: #fff;" :class="facility.icon" type="icon-shengtailiuliang2"></i>
|
<i
|
||||||
|
style="color: #fff"
|
||||||
|
:class="facility.icon"
|
||||||
|
type="icon-shengtailiuliang2"
|
||||||
|
></i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="facility-info">
|
<div class="facility-info">
|
||||||
<div class="facility-name">{{ facility.name }}</div>
|
<div class="facility-name">{{ facility.name }}</div>
|
||||||
<div style="font-size: 16px;"> <span class="facility-count">{{ facility.count
|
<div style="font-size: 16px">
|
||||||
}}</span><span>个</span></div>
|
<span class="facility-count">{{ facility.count }}</span
|
||||||
|
><span>个</span>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</a-spin>
|
</a-spin>
|
||||||
</SidePanelItem>
|
</SidePanelItem>
|
||||||
<!-- 弹框 -->
|
<!-- 弹框 -->
|
||||||
<a-modal v-model:open="modalVisible" :title="'栖息地保护工作开展情况'" :footer="null" width="1536px" @cancel="handleCloseModal">
|
<a-modal
|
||||||
<QixidiheduanjianceqingkuangEJ v-if="currentFacility" :activeKey="currentFacility.sttpCode" :tabs="facilities"
|
v-model:open="modalVisible"
|
||||||
:baseId="baseid" />
|
:title="'栖息地保护工作开展情况'"
|
||||||
|
:footer="null"
|
||||||
|
width="1536px"
|
||||||
|
@cancel="handleCloseModal"
|
||||||
|
>
|
||||||
|
<QixidiheduanjianceqingkuangEJ
|
||||||
|
v-if="currentFacility"
|
||||||
|
:activeKey="currentFacility.sttpCode"
|
||||||
|
:tabs="facilities"
|
||||||
|
:baseId="baseid"
|
||||||
|
/>
|
||||||
</a-modal>
|
</a-modal>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ref, onMounted, onUnmounted, watch, nextTick } from 'vue';
|
import { ref, onMounted, onUnmounted, watch, nextTick } from 'vue';
|
||||||
import SidePanelItem from '@/components/SidePanelItem/index.vue';
|
import SidePanelItem from '@/components/SidePanelItem/index.vue';
|
||||||
import { useJidiSelectEventStore } from "@/store/modules/jidiSelectEvent";
|
import { useJidiSelectEventStore } from '@/store/modules/jidiSelectEvent';
|
||||||
import { fhGetKendoListCust } from '@/api/qxd'
|
import { fhGetKendoListCust } from '@/api/qxd';
|
||||||
import QixidiheduanjianceqingkuangEJ from "./qixidiheduanjianceqingkuangEJ/index.vue"
|
import QixidiheduanjianceqingkuangEJ from './qixidiheduanjianceqingkuangEJ/index.vue';
|
||||||
|
import { useDraggable } from '@/utils/drag';
|
||||||
|
|
||||||
// 定义组件名(便于调试和递归)
|
// 定义组件名(便于调试和递归)
|
||||||
defineOptions({
|
defineOptions({
|
||||||
name: 'qixidibaohugongzuokaizhanQK'
|
name: 'qixidibaohugongzuokaizhanQK'
|
||||||
@ -65,43 +95,47 @@ const facilities = ref([
|
|||||||
count: 0,
|
count: 0,
|
||||||
icon: 'icon iconfont icon-shipinjiankongshebei',
|
icon: 'icon iconfont icon-shipinjiankongshebei',
|
||||||
sttpCode: 'VD'
|
sttpCode: 'VD'
|
||||||
},
|
}
|
||||||
|
|
||||||
]);
|
]);
|
||||||
const baseid = ref('')
|
const baseid = ref('');
|
||||||
// 弹框相关状态
|
// 弹框相关状态
|
||||||
const modalVisible = ref(false);
|
const modalVisible = ref(false);
|
||||||
const currentFacility = ref<any>(null);
|
const currentFacility = ref<any>(null);
|
||||||
|
useDraggable(modalVisible, { boundary: true, resetOnOpen: true });
|
||||||
//获取页面数据
|
//获取页面数据
|
||||||
const getData = async () => {
|
const getData = async () => {
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
try {
|
try {
|
||||||
let params = {
|
let params = {
|
||||||
"filter": {
|
filter: {
|
||||||
"logic": "and",
|
logic: 'and',
|
||||||
"filters": [
|
filters: [
|
||||||
baseid.value != 'all' ? {
|
baseid.value != 'all'
|
||||||
"field": "baseId",
|
? {
|
||||||
"operator": "eq",
|
field: 'baseId',
|
||||||
"dataType": "string",
|
operator: 'eq',
|
||||||
"value": baseid.value
|
dataType: 'string',
|
||||||
} : null
|
value: baseid.value
|
||||||
|
}
|
||||||
|
: null
|
||||||
].filter(Boolean)
|
].filter(Boolean)
|
||||||
},
|
},
|
||||||
"group": [
|
group: [
|
||||||
{
|
{
|
||||||
"dir": "asc",
|
dir: 'asc',
|
||||||
"field": "sttpCode"
|
field: 'sttpCode'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"groupResultFlat": true
|
groupResultFlat: true
|
||||||
}
|
};
|
||||||
const res = await fhGetKendoListCust(params); //适配监控-VD
|
const res = await fhGetKendoListCust(params); //适配监控-VD
|
||||||
let data = res?.data?.data || res?.data || [];
|
let data = res?.data?.data || res?.data || [];
|
||||||
|
|
||||||
// 根据接口返回的数据更新 facilities 的 count
|
// 根据接口返回的数据更新 facilities 的 count
|
||||||
facilities.value.forEach(facility => {
|
facilities.value.forEach(facility => {
|
||||||
const matchedItem = data.find(item => item.sttpCode === facility.sttpCode);
|
const matchedItem = data.find(
|
||||||
|
item => item.sttpCode === facility.sttpCode
|
||||||
|
);
|
||||||
if (matchedItem) {
|
if (matchedItem) {
|
||||||
facility.count = matchedItem.count_sttpCode || 0;
|
facility.count = matchedItem.count_sttpCode || 0;
|
||||||
} else {
|
} else {
|
||||||
@ -113,13 +147,11 @@ const getData = async () => {
|
|||||||
} finally {
|
} finally {
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
// 点击处理函数
|
// 点击处理函数
|
||||||
const handleFacilityClick = (facility: any) => {
|
const handleFacilityClick = (facility: any) => {
|
||||||
currentFacility.value = facility;
|
currentFacility.value = facility;
|
||||||
modalVisible.value = true;
|
modalVisible.value = true;
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
// 关闭弹框
|
// 关闭弹框
|
||||||
const handleCloseModal = () => {
|
const handleCloseModal = () => {
|
||||||
@ -129,22 +161,19 @@ const handleCloseModal = () => {
|
|||||||
|
|
||||||
watch(
|
watch(
|
||||||
() => JidiSelectEventStore.selectedItem,
|
() => JidiSelectEventStore.selectedItem,
|
||||||
(newVal) => {
|
newVal => {
|
||||||
baseid.value = newVal.wbsCode;
|
baseid.value = newVal.wbsCode;
|
||||||
getData()
|
getData();
|
||||||
},
|
},
|
||||||
{ deep: true, immediate: true }
|
{ deep: true, immediate: true }
|
||||||
);
|
);
|
||||||
// 页面加载时执行
|
// 页面加载时执行
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
// 延迟初始化,确保容器已渲染
|
// 延迟初始化,确保容器已渲染
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// 组件卸载时清理
|
// 组件卸载时清理
|
||||||
onUnmounted(() => {
|
onUnmounted(() => {});
|
||||||
|
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
@ -153,7 +182,9 @@ onUnmounted(() => {
|
|||||||
flex-flow: wrap;
|
flex-flow: wrap;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, Noto Sans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji;
|
font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto,
|
||||||
|
Helvetica Neue, Arial, Noto Sans, sans-serif, Apple Color Emoji,
|
||||||
|
Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji;
|
||||||
}
|
}
|
||||||
|
|
||||||
.facility-card {
|
.facility-card {
|
||||||
|
|||||||
@ -55,7 +55,7 @@
|
|||||||
ref="tableRef"
|
ref="tableRef"
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
:scrollY="380"
|
:scrollY="380"
|
||||||
:scrollX="100"
|
|
||||||
:list-url="vmsstbprptGetKendoList"
|
:list-url="vmsstbprptGetKendoList"
|
||||||
:search-params="searchParams"
|
:search-params="searchParams"
|
||||||
:transform-data="customTransform"
|
:transform-data="customTransform"
|
||||||
@ -834,7 +834,6 @@ const handleResize = () => {
|
|||||||
width: 35%;
|
width: 35%;
|
||||||
height: 482px;
|
height: 482px;
|
||||||
// position: relative;
|
// position: relative;
|
||||||
min-width: 521px;
|
|
||||||
|
|
||||||
.pie-chart {
|
.pie-chart {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|||||||
@ -37,7 +37,7 @@
|
|||||||
<a-modal
|
<a-modal
|
||||||
v-model:open="modalVisible"
|
v-model:open="modalVisible"
|
||||||
:title="'生态流量泄放方式'"
|
:title="'生态流量泄放方式'"
|
||||||
width="1536px"
|
width="80%"
|
||||||
@cancel="handleModalCancel"
|
@cancel="handleModalCancel"
|
||||||
>
|
>
|
||||||
<STLLXFFS
|
<STLLXFFS
|
||||||
@ -57,6 +57,8 @@ import type { ECharts } from 'echarts';
|
|||||||
import { msstbprptGetKendoList } from '@/api/stll';
|
import { msstbprptGetKendoList } from '@/api/stll';
|
||||||
import { useJidiSelectEventStore } from '@/store/modules/jidiSelectEvent';
|
import { useJidiSelectEventStore } from '@/store/modules/jidiSelectEvent';
|
||||||
import STLLXFFS from './TwoLayer/STLLXFFS.vue';
|
import STLLXFFS from './TwoLayer/STLLXFFS.vue';
|
||||||
|
import { useDraggable } from '@/utils/drag';
|
||||||
|
|
||||||
// 定义组件名(便于调试和递归)
|
// 定义组件名(便于调试和递归)
|
||||||
defineOptions({
|
defineOptions({
|
||||||
name: 'xieFangFangShi'
|
name: 'xieFangFangShi'
|
||||||
@ -78,7 +80,7 @@ const apiRawData = ref<any[]>([]); // 保存原始 API 数据
|
|||||||
const modalVisible = ref(false);
|
const modalVisible = ref(false);
|
||||||
const modalTitle = ref('');
|
const modalTitle = ref('');
|
||||||
const selectedData = ref<any>(null);
|
const selectedData = ref<any>(null);
|
||||||
|
useDraggable(modalVisible, { boundary: true, resetOnOpen: true });
|
||||||
// 颜色配置(根据图片配色)
|
// 颜色配置(根据图片配色)
|
||||||
const colors = [
|
const colors = [
|
||||||
'#9556a4', // 基荷发电 - 紫色
|
'#9556a4', // 基荷发电 - 紫色
|
||||||
|
|||||||
@ -676,7 +676,7 @@ onUnmounted(() => {
|
|||||||
.chart-section {
|
.chart-section {
|
||||||
width: 35%;
|
width: 35%;
|
||||||
height: 482px;
|
height: 482px;
|
||||||
min-width: 521px;
|
|
||||||
|
|
||||||
.pie-chart {
|
.pie-chart {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|||||||
@ -10,7 +10,7 @@
|
|||||||
<a-modal
|
<a-modal
|
||||||
v-model:open="modalVisible"
|
v-model:open="modalVisible"
|
||||||
title="泄放方式分布情况"
|
title="泄放方式分布情况"
|
||||||
width="1536px"
|
width="80%"
|
||||||
:footer="null"
|
:footer="null"
|
||||||
@cancel="handleModalCancel"
|
@cancel="handleModalCancel"
|
||||||
>
|
>
|
||||||
@ -38,6 +38,8 @@ import type { ECharts } from 'echarts';
|
|||||||
import { vmsstbprptGetKendoList } from '@/api/stll';
|
import { vmsstbprptGetKendoList } from '@/api/stll';
|
||||||
import { useJidiSelectEventStore } from '@/store/modules/jidiSelectEvent';
|
import { useJidiSelectEventStore } from '@/store/modules/jidiSelectEvent';
|
||||||
import FBQKTwolayer from './TwoLayer/FenBuQingKuangTwoLayer.vue';
|
import FBQKTwolayer from './TwoLayer/FenBuQingKuangTwoLayer.vue';
|
||||||
|
import { useDraggable } from '@/utils/drag';
|
||||||
|
|
||||||
// 定义组件名
|
// 定义组件名
|
||||||
defineOptions({
|
defineOptions({
|
||||||
name: 'XieFangFenBu'
|
name: 'XieFangFenBu'
|
||||||
@ -59,7 +61,7 @@ const wbsCode = ref('');
|
|||||||
const modalVisible = ref(false);
|
const modalVisible = ref(false);
|
||||||
const selectData = ref(''); // 选中的设施类型名称
|
const selectData = ref(''); // 选中的设施类型名称
|
||||||
const jidiName = ref(''); // 选中的基地名称
|
const jidiName = ref(''); // 选中的基地名称
|
||||||
|
useDraggable(modalVisible, { boundary: true, resetOnOpen: true });
|
||||||
// 设施类型配置
|
// 设施类型配置
|
||||||
const typeName = [
|
const typeName = [
|
||||||
{ label: '生态放流孔', eqtp: 'EQ_1' },
|
{ label: '生态放流孔', eqtp: 'EQ_1' },
|
||||||
|
|||||||
@ -105,6 +105,8 @@ import { useMapViewStore } from '@/modules/map/stores/map-view.store';
|
|||||||
import STLLXFFS from './TwoLayer/ShengTaiLiuLiangDaBQKTwoLayer.vue';
|
import STLLXFFS from './TwoLayer/ShengTaiLiuLiangDaBQKTwoLayer.vue';
|
||||||
import ModalYkzhbzdjcgz from './TwoLayer/ModalYkzhbzdjcgz.vue';
|
import ModalYkzhbzdjcgz from './TwoLayer/ModalYkzhbzdjcgz.vue';
|
||||||
import HuanbaoZDJCGZKZ from '@/modules/huanbaozdjcgzkzQK/index.vue';
|
import HuanbaoZDJCGZKZ from '@/modules/huanbaozdjcgzkzQK/index.vue';
|
||||||
|
import { useDraggable } from '@/utils/drag';
|
||||||
|
|
||||||
// 定义组件名(便于调试和递归)
|
// 定义组件名(便于调试和递归)
|
||||||
defineOptions({
|
defineOptions({
|
||||||
name: 'shengtaidabiaoMod'
|
name: 'shengtaidabiaoMod'
|
||||||
@ -149,7 +151,8 @@ const modalVisible = ref(false);
|
|||||||
const modalTitle = ref('');
|
const modalTitle = ref('');
|
||||||
const selectedItem = ref<any>(null);
|
const selectedItem = ref<any>(null);
|
||||||
const huanbaoModalVisible = ref(false);
|
const huanbaoModalVisible = ref(false);
|
||||||
|
useDraggable(modalVisible, { boundary: true, resetOnOpen: true });
|
||||||
|
useDraggable(huanbaoModalVisible, { boundary: true, resetOnOpen: true });
|
||||||
// 处理电站数量点击事件
|
// 处理电站数量点击事件
|
||||||
const handleStationClick = () => {
|
const handleStationClick = () => {
|
||||||
huanbaoModalVisible.value = true;
|
huanbaoModalVisible.value = true;
|
||||||
|
|||||||
@ -67,6 +67,8 @@ import { eqqecRateCount, evnmAutoMonitorGetKendoListCust } from '@/api/stll';
|
|||||||
import ModalYkzhbzdjcgz from '../shengtaidabiaoMod/TwoLayer/ModalYkzhbzdjcgz.vue';
|
import ModalYkzhbzdjcgz from '../shengtaidabiaoMod/TwoLayer/ModalYkzhbzdjcgz.vue';
|
||||||
import STLLXFFS from './TwoLayer/STLLXFFS.vue'
|
import STLLXFFS from './TwoLayer/STLLXFFS.vue'
|
||||||
import { useMapViewStore } from '@/modules/map/stores/map-view.store';
|
import { useMapViewStore } from '@/modules/map/stores/map-view.store';
|
||||||
|
import { useDraggable } from '@/utils/drag';
|
||||||
|
|
||||||
// 定义组件名(便于调试和递归)
|
// 定义组件名(便于调试和递归)
|
||||||
defineOptions({
|
defineOptions({
|
||||||
name: 'shengtaidabiaoMod'
|
name: 'shengtaidabiaoMod'
|
||||||
@ -604,6 +606,8 @@ watch(
|
|||||||
const detailModalVisible = ref(false);
|
const detailModalVisible = ref(false);
|
||||||
const detailModalTitle = ref('');
|
const detailModalTitle = ref('');
|
||||||
const detailData = ref<any[]>([]);
|
const detailData = ref<any[]>([]);
|
||||||
|
useDraggable(huanbaoModalVisible, { boundary: true, resetOnOpen: true });
|
||||||
|
useDraggable(detailModalVisible, { boundary: true, resetOnOpen: true });
|
||||||
const detailColumns = ref([
|
const detailColumns = ref([
|
||||||
{
|
{
|
||||||
title: mode.value === 'top' ? '基地名称' : '调节性能',
|
title: mode.value === 'top' ? '基地名称' : '调节性能',
|
||||||
|
|||||||
@ -68,6 +68,8 @@ import { eqqecRateCount, evnmAutoMonitorGetKendoListCust } from '@/api/stll';
|
|||||||
import ModalYkzhbzdjcgz from '../shengtaidabiaoMod/TwoLayer/ModalYkzhbzdjcgz.vue';
|
import ModalYkzhbzdjcgz from '../shengtaidabiaoMod/TwoLayer/ModalYkzhbzdjcgz.vue';
|
||||||
import STLLXFFS from './TwoLayer/STLLXFFS.vue'
|
import STLLXFFS from './TwoLayer/STLLXFFS.vue'
|
||||||
import { useMapViewStore } from '@/modules/map/stores/map-view.store';
|
import { useMapViewStore } from '@/modules/map/stores/map-view.store';
|
||||||
|
import { useDraggable } from '@/utils/drag';
|
||||||
|
|
||||||
// 定义组件名(便于调试和递归)
|
// 定义组件名(便于调试和递归)
|
||||||
defineOptions({
|
defineOptions({
|
||||||
name: 'shengtaidabiaoMod'
|
name: 'shengtaidabiaoMod'
|
||||||
@ -97,6 +99,7 @@ const huanbaoModalVisible = ref(false);
|
|||||||
const handleStationClick = () => {
|
const handleStationClick = () => {
|
||||||
huanbaoModalVisible.value = true;
|
huanbaoModalVisible.value = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
// 加载数据
|
// 加载数据
|
||||||
const loadData = async () => {
|
const loadData = async () => {
|
||||||
spinning.value = true;
|
spinning.value = true;
|
||||||
@ -633,6 +636,8 @@ const detailColumns = ref([
|
|||||||
watch(mode, () => {
|
watch(mode, () => {
|
||||||
loadData();
|
loadData();
|
||||||
});
|
});
|
||||||
|
useDraggable(huanbaoModalVisible, { boundary: true, resetOnOpen: true });
|
||||||
|
useDraggable(detailModalVisible, { boundary: true, resetOnOpen: true });
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|||||||
@ -62,6 +62,8 @@ import { ref, onMounted, onUnmounted, computed } from 'vue';
|
|||||||
import SidePanelItem from '@/components/SidePanelItem/index.vue';
|
import SidePanelItem from '@/components/SidePanelItem/index.vue';
|
||||||
import ArtsDetail from '@/components/carouselIntroduce/ArtsDetail.vue';
|
import ArtsDetail from '@/components/carouselIntroduce/ArtsDetail.vue';
|
||||||
import { sttpbGetKendoList } from '@/api/sw';
|
import { sttpbGetKendoList } from '@/api/sw';
|
||||||
|
import { useDraggable } from '@/utils/drag';
|
||||||
|
|
||||||
// 定义组件名(便于调试和递归)
|
// 定义组件名(便于调试和递归)
|
||||||
defineOptions({
|
defineOptions({
|
||||||
name: 'diwenshuijianhuansheshileixingzuchengjijieruqingkuang'
|
name: 'diwenshuijianhuansheshileixingzuchengjijieruqingkuang'
|
||||||
@ -96,6 +98,7 @@ const isTransitioning = ref(false);
|
|||||||
// 弹框控制
|
// 弹框控制
|
||||||
const modalVisible = ref(false);
|
const modalVisible = ref(false);
|
||||||
const currentItem = ref<any>(null);
|
const currentItem = ref<any>(null);
|
||||||
|
useDraggable(modalVisible, { boundary: true, resetOnOpen: true });
|
||||||
// 初始化渲染数组(克隆首尾项)
|
// 初始化渲染数组(克隆首尾项)
|
||||||
const initRenderData = () => {
|
const initRenderData = () => {
|
||||||
const length = originalMediaData.value.length;
|
const length = originalMediaData.value.length;
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user