feat: 流量站锚点接口
This commit is contained in:
parent
275cb5e454
commit
aa71489035
@ -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(loadOptions.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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user