feat: 电站出入库水温描点

This commit is contained in:
tangwei 2026-07-06 10:18:43 +08:00
parent 85cf3bc358
commit 275cb5e454
4 changed files with 227 additions and 0 deletions

View File

@ -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));
}
} }

View File

@ -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;
}
}

View File

@ -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);
} }

View File

@ -21,6 +21,7 @@ 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;
@ -2921,4 +2922,117 @@ 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 ");
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;
}
} }