feat: 视频站锚点接口详情
This commit is contained in:
parent
d6be29b0fa
commit
332bde605b
@ -0,0 +1,86 @@
|
||||
package com.yfd.platform.qgc_env.vd.entity.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
@Schema(description = "视频站锚点信息")
|
||||
public class VdPointVo implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "视频站子站类")
|
||||
private String sttp;
|
||||
|
||||
@Schema(description = "视频站编码")
|
||||
private String stcd;
|
||||
|
||||
@Schema(description = "经度")
|
||||
private BigDecimal lgtd;
|
||||
|
||||
@Schema(description = "纬度")
|
||||
private BigDecimal lttd;
|
||||
|
||||
@Schema(description = "高程")
|
||||
private BigDecimal dtmel;
|
||||
|
||||
@Schema(description = "锚点状态")
|
||||
private String anchoPointState;
|
||||
|
||||
@Schema(description = "站类地图标识")
|
||||
private String sttpMap;
|
||||
|
||||
@Schema(description = "标题")
|
||||
private String titleName;
|
||||
|
||||
@Schema(description = "默认距离")
|
||||
private Integer distance;
|
||||
|
||||
@Schema(description = "流域编码")
|
||||
private String rvcd;
|
||||
|
||||
@Schema(description = "行政区编码")
|
||||
private String addvcd;
|
||||
|
||||
@Schema(description = "基地编码")
|
||||
private String baseId;
|
||||
|
||||
@Schema(description = "所属电站编码")
|
||||
private String rstcds;
|
||||
|
||||
@Schema(description = "站类编码")
|
||||
private String sttpCode;
|
||||
|
||||
@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 String stlc;
|
||||
|
||||
@Schema(description = "播放方式")
|
||||
private String playWay;
|
||||
|
||||
@Schema(description = "站点排序")
|
||||
private Integer siteStepSort;
|
||||
|
||||
@Schema(description = "基地流域编码")
|
||||
private String hbrvcd;
|
||||
}
|
||||
@ -13,7 +13,7 @@ public interface VdMonitorService {
|
||||
|
||||
DataSourceResult<VdRunDataVo> getKendoListCust(DataSourceRequest dataSourceRequest);
|
||||
|
||||
DataSourceResult<VdRunDataVo> getVdPointKendoListCust(DataSourceRequest dataSourceRequest);
|
||||
DataSourceResult<?> getVdPointKendoListCust(DataSourceRequest dataSourceRequest);
|
||||
|
||||
DataSourceResult<VdRunDataVo> getRunDataKendoListCust(DataSourceRequest dataSourceRequest);
|
||||
}
|
||||
|
||||
@ -9,6 +9,7 @@ import com.yfd.platform.common.DataSourceResult;
|
||||
import com.yfd.platform.common.GroupHelper;
|
||||
import com.yfd.platform.common.GroupingInfo;
|
||||
import com.yfd.platform.common.MicroservicDynamicSQLMapper;
|
||||
import com.yfd.platform.qgc_env.vd.entity.vo.VdPointVo;
|
||||
import com.yfd.platform.qgc_env.vd.entity.vo.VdRunDataVo;
|
||||
import com.yfd.platform.qgc_env.vd.entity.vo.VdVmsstbprptVo;
|
||||
import com.yfd.platform.qgc_env.vd.service.VdMonitorService;
|
||||
@ -119,8 +120,12 @@ public class VdMonitorServiceImpl implements VdMonitorService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public DataSourceResult<VdRunDataVo> getVdPointKendoListCust(DataSourceRequest dataSourceRequest) {
|
||||
return getKendoListCust(dataSourceRequest);
|
||||
public DataSourceResult<?> getVdPointKendoListCust(DataSourceRequest dataSourceRequest) {
|
||||
DataSourceLoadOptionsBase loadOptions = dataSourceRequest == null ? null : dataSourceRequest.toDevRequest();
|
||||
if (CollUtil.isNotEmpty(dataSourceRequest == null ? null : dataSourceRequest.getGroup())) {
|
||||
return getKendoListCust(dataSourceRequest);
|
||||
}
|
||||
return queryVdPointDetailList(dataSourceRequest, loadOptions);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -336,6 +341,32 @@ public class VdMonitorServiceImpl implements VdMonitorService {
|
||||
return queryRunDataGroupList(dataSourceRequest, loadOptions, buildLatestRunDataCoreSql());
|
||||
}
|
||||
|
||||
private DataSourceResult<VdPointVo> queryVdPointDetailList(DataSourceRequest dataSourceRequest,
|
||||
DataSourceLoadOptionsBase loadOptions) {
|
||||
Page<?> page = loadOptions == null ? null : QgcQueryWrapperUtil.buildPage(loadOptions, loadOptions.getSkip(), loadOptions.getTake());
|
||||
StringBuilder sql = new StringBuilder();
|
||||
sql.append("SELECT ")
|
||||
.append(buildVdPointSelectSql())
|
||||
.append("FROM (")
|
||||
.append(buildVdPointCoreSql())
|
||||
.append(") t WHERE 1 = 1 ");
|
||||
|
||||
Map<String, Object> paramMap = new HashMap<>();
|
||||
String filterSql = buildFilterCondition(dataSourceRequest == null ? null : dataSourceRequest.getFilter(), paramMap, new int[]{0});
|
||||
if (StrUtil.isNotBlank(filterSql)) {
|
||||
sql.append(" AND ").append(filterSql).append(" ");
|
||||
}
|
||||
sql.append(buildVdPointOrderBySql(dataSourceRequest == null ? null : dataSourceRequest.getSort()));
|
||||
|
||||
List<VdPointVo> list = microservicDynamicSQLMapper.pageAllListWithResultType(
|
||||
page, sql.toString(), paramMap, VdPointVo.class);
|
||||
DataSourceResult<VdPointVo> result = new DataSourceResult<>();
|
||||
result.setData(list);
|
||||
result.setTotal(page != null ? page.getTotal() : list.size());
|
||||
result.setAggregates(new HashMap<>());
|
||||
return result;
|
||||
}
|
||||
|
||||
private DataSourceResult<VdRunDataVo> queryRunDataGroupList(DataSourceRequest dataSourceRequest,
|
||||
DataSourceLoadOptionsBase loadOptions,
|
||||
String coreSql) {
|
||||
@ -478,6 +509,52 @@ public class VdMonitorServiceImpl implements VdMonitorService {
|
||||
"FROM SD_SONAR_B_H sonar WHERE NVL(sonar.IS_DELETED, 0) = 0 AND sonar.STTP IN ('VD_WVD', 'VD_SN') ";
|
||||
}
|
||||
|
||||
private String buildVdPointCoreSql() {
|
||||
return "SELECT " +
|
||||
"src.STTP AS sttp, " +
|
||||
"src.STCD AS stcd, " +
|
||||
"src.LGTD AS lgtd, " +
|
||||
"src.LTTD AS lttd, " +
|
||||
"CAST(NULL AS NUMBER(10, 6)) AS dtmel, " +
|
||||
"CASE " +
|
||||
" WHEN NVL(eng.HBRVCD, src.HBRVCD) = 'SJLY126' THEN CASE src.STTP " +
|
||||
" WHEN 'VD_FBFM' THEN 'fbfm_spjk' " +
|
||||
" WHEN 'VD_EQS' THEN 'eqs_spjk' " +
|
||||
" WHEN 'VD_FB' THEN 'fb_spjk' " +
|
||||
" WHEN 'VD_FP' THEN 'fp_spjk' " +
|
||||
" WHEN 'VD_FH' THEN 'fh_spjk' " +
|
||||
" WHEN 'VD_VA' THEN 'va_spjk' " +
|
||||
" WHEN 'VD_VP' THEN 'vp_spjk' " +
|
||||
" WHEN 'VD_DW' THEN 'dw_spjk' " +
|
||||
" WHEN 'VD_WQ' THEN 'wq_spjk' " +
|
||||
" ELSE 'spjk' END " +
|
||||
" ELSE 'spjk' END AS anchoPointState, " +
|
||||
"'VD' AS sttpMap, " +
|
||||
"src.STNM AS titleName, " +
|
||||
"400000 AS distance, " +
|
||||
"NVL(eng.RVCD, src.RVCD) AS rvcd, " +
|
||||
"NVL(eng.ADDVCD, src.ADDVCD) AS addvcd, " +
|
||||
"NVL(eng.BASE_ID, src.BASE_ID) AS baseId, " +
|
||||
"src.RSTCD AS rstcds, " +
|
||||
"'VD' AS sttpCode, " +
|
||||
"src.STNM AS stnm, " +
|
||||
"rv.RVNM AS rvnm, " +
|
||||
"eng.ENNM AS ennm, " +
|
||||
"src.FHSTCD AS fhstcd, " +
|
||||
"fh.STNM AS fhstnm, " +
|
||||
"sttp.STTP_NAME AS sttpName, " +
|
||||
"src.STLC AS stlc, " +
|
||||
"CASE WHEN src.URL IS NULL THEN NULL WHEN INSTR(src.URL, 'm3u8') > 0 THEN '1' ELSE '0' END AS playWay, " +
|
||||
"src.ORDER_INDEX AS siteStepSort, " +
|
||||
"NVL(eng.HBRVCD, src.HBRVCD) AS hbrvcd " +
|
||||
"FROM (" + buildVdDeviceBaseSql() + ") src " +
|
||||
"LEFT JOIN SD_ENGINFO_B_H eng ON eng.STCD = src.RSTCD AND NVL(eng.IS_DELETED, 0) = 0 " +
|
||||
"LEFT JOIN SD_FHBT_B_H fh ON fh.STCD = src.FHSTCD AND NVL(fh.IS_DELETED, 0) = 0 " +
|
||||
"LEFT JOIN SD_RVCD_DIC rv ON rv.RVCD = NVL(eng.RVCD, src.RVCD) " +
|
||||
"LEFT JOIN SD_STTP_B sttp ON sttp.STTP_CODE = src.STTP " +
|
||||
" AND NVL(sttp.IS_DELETED, 0) = 0 AND NVL(sttp.ENABLE, 1) = 1 ";
|
||||
}
|
||||
|
||||
private String buildRunDataCoreSql() {
|
||||
return "SELECT " +
|
||||
"run.ID AS id, " +
|
||||
@ -633,6 +710,33 @@ public class VdMonitorServiceImpl implements VdMonitorService {
|
||||
return String.join(", ", actualColumns);
|
||||
}
|
||||
|
||||
private String buildVdPointSelectSql() {
|
||||
return "t.sttp AS sttp, " +
|
||||
"t.stcd AS stcd, " +
|
||||
"t.lgtd AS lgtd, " +
|
||||
"t.lttd AS lttd, " +
|
||||
"t.dtmel AS dtmel, " +
|
||||
"t.anchoPointState AS anchoPointState, " +
|
||||
"t.sttpMap AS sttpMap, " +
|
||||
"t.titleName AS titleName, " +
|
||||
"t.distance AS distance, " +
|
||||
"t.rvcd AS rvcd, " +
|
||||
"t.addvcd AS addvcd, " +
|
||||
"t.baseId AS baseId, " +
|
||||
"t.rstcds AS rstcds, " +
|
||||
"t.sttpCode AS sttpCode, " +
|
||||
"t.stnm AS stnm, " +
|
||||
"t.rvnm AS rvnm, " +
|
||||
"t.ennm AS ennm, " +
|
||||
"t.fhstcd AS fhstcd, " +
|
||||
"t.fhstnm AS fhstnm, " +
|
||||
"t.sttpName AS sttpName, " +
|
||||
"t.stlc AS stlc, " +
|
||||
"t.playWay AS playWay, " +
|
||||
"t.siteStepSort AS siteStepSort, " +
|
||||
"t.hbrvcd AS hbrvcd ";
|
||||
}
|
||||
|
||||
private String buildRunDataOrderBySql(List<DataSourceRequest.SortDescriptor> sortList) {
|
||||
if (CollUtil.isEmpty(sortList)) {
|
||||
return " ORDER BY t.baseStepSort ASC, t.rvcdStepSort ASC, t.rstcdStepSort ASC, t.siteStepSort ASC, t.stcd ASC, t.tm DESC";
|
||||
@ -655,6 +759,28 @@ public class VdMonitorServiceImpl implements VdMonitorService {
|
||||
return " ORDER BY " + String.join(", ", orderItems);
|
||||
}
|
||||
|
||||
private String buildVdPointOrderBySql(List<DataSourceRequest.SortDescriptor> sortList) {
|
||||
if (CollUtil.isEmpty(sortList)) {
|
||||
return " ORDER BY t.siteStepSort ASC NULLS LAST, t.stcd ASC";
|
||||
}
|
||||
List<String> orderItems = new ArrayList<>();
|
||||
for (DataSourceRequest.SortDescriptor sort : sortList) {
|
||||
if (sort == null || StrUtil.isBlank(sort.getField())) {
|
||||
continue;
|
||||
}
|
||||
String column = mapColumn(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.siteStepSort ASC NULLS LAST, t.stcd ASC";
|
||||
}
|
||||
return " ORDER BY " + String.join(", ", orderItems);
|
||||
}
|
||||
|
||||
private String buildRunDataGroupOrderBySql(List<DataSourceRequest.GroupDescriptor> groups) {
|
||||
if (CollUtil.isEmpty(groups)) {
|
||||
return "";
|
||||
@ -886,6 +1012,7 @@ public class VdMonitorServiceImpl implements VdMonitorService {
|
||||
return null;
|
||||
}
|
||||
return switch (field) {
|
||||
case "sttp" -> "t.sttp";
|
||||
case "sttpCode" -> "t.sttpCode";
|
||||
case "sttpName" -> "t.sttpName";
|
||||
case "sttpFullPath" -> "t.sttpFullPath";
|
||||
@ -920,11 +1047,15 @@ public class VdMonitorServiceImpl implements VdMonitorService {
|
||||
case "vlsr" -> "t.vlsr";
|
||||
case "vlsrTm" -> "t.vlsrTm";
|
||||
case "rvcd" -> "t.rvcd";
|
||||
case "rvnm" -> "t.rvnm";
|
||||
case "addvcd" -> "t.addvcd";
|
||||
case "dtin" -> "t.dtin";
|
||||
case "usfl" -> "t.usfl";
|
||||
case "url" -> "t.url";
|
||||
case "playWay" -> "t.playWay";
|
||||
case "titleName" -> "t.titleName";
|
||||
case "rstcds" -> "t.rstcds";
|
||||
case "anchoPointState" -> "t.anchoPointState";
|
||||
case "sourceTable" -> "t.sourceTable";
|
||||
case "baseStepSort" -> "t.baseStepSort";
|
||||
case "rstcdStepSort" -> "t.rstcdStepSort";
|
||||
|
||||
Loading…
Reference in New Issue
Block a user