feat: 水电站-地图锚点
This commit is contained in:
parent
739f1e6f57
commit
da3bd76063
@ -44,4 +44,10 @@ public class SdEngMonitorController {
|
||||
public ResponseResult getOperatKendoList(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||
return ResponseResult.successData(engInfoBHService.getOperatKendoList(dataSourceRequest));
|
||||
}
|
||||
|
||||
@PostMapping("/point/GetKendoListCust")
|
||||
@Operation(summary = "水电站-地图锚点")
|
||||
public ResponseResult getEngPointKendoListCust(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||
return ResponseResult.successData(engInfoBHService.getEngPointKendoListCust(dataSourceRequest));
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,102 @@
|
||||
package com.yfd.platform.qgc_base.domain.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@Schema(description = "水电站描点")
|
||||
public class EngPointVo {
|
||||
|
||||
@Schema(description = "站码")
|
||||
private String stcd;
|
||||
|
||||
@Schema(description = "站点名称")
|
||||
private String stnm;
|
||||
|
||||
@Schema(description = "电站名称")
|
||||
private String ennm;
|
||||
|
||||
@Schema(description = "电站图片")
|
||||
private String logo;
|
||||
|
||||
@Schema(description = "标题名称")
|
||||
private String titleName;
|
||||
|
||||
@Schema(description = "流域编码")
|
||||
private String rvcd;
|
||||
|
||||
@Schema(description = "行政区编码")
|
||||
private String addvcd;
|
||||
|
||||
@Schema(description = "经度")
|
||||
private BigDecimal lgtd;
|
||||
|
||||
@Schema(description = "纬度")
|
||||
private BigDecimal lttd;
|
||||
|
||||
@Schema(description = "多年平均流量")
|
||||
private BigDecimal avq;
|
||||
|
||||
@Schema(description = "装机容量(MW)")
|
||||
private BigDecimal ttpwr;
|
||||
|
||||
@Schema(description = "正常蓄水位")
|
||||
private BigDecimal normz;
|
||||
|
||||
@Schema(description = "多年平均发电量")
|
||||
private BigDecimal yrge;
|
||||
|
||||
@Schema(description = "所属基地编码")
|
||||
private String baseId;
|
||||
|
||||
@Schema(description = "建成日期")
|
||||
private Date jcdt;
|
||||
|
||||
@Schema(description = "所属行政区名称")
|
||||
private String addvcdName;
|
||||
|
||||
@Schema(description = "站点类型")
|
||||
private String sttp;
|
||||
|
||||
@Schema(description = "站点类型编码")
|
||||
private String sttpCode;
|
||||
|
||||
@Schema(description = "站点类型映射")
|
||||
private String sttpMap;
|
||||
|
||||
@Schema(description = "遥测方式")
|
||||
private String dtmel;
|
||||
|
||||
@Schema(description = "站点排序")
|
||||
private Integer siteStepSort;
|
||||
|
||||
@Schema(description = "流域沿程")
|
||||
private Integer rvcdStepSort;
|
||||
|
||||
@Schema(description = "电站沿程")
|
||||
private Integer rstcdStepSort;
|
||||
|
||||
@Schema(description = "是否电站专题电站")
|
||||
private String ifEngSpecial;
|
||||
|
||||
@Schema(description = "电站装机类型")
|
||||
private Integer endInstalledType;
|
||||
|
||||
@Schema(description = "描点状态")
|
||||
private String anchoPointState;
|
||||
|
||||
@Schema(description = "工程规模")
|
||||
private Integer prsc;
|
||||
|
||||
@Schema(description = "图标旋转角度")
|
||||
private Integer iconRotate;
|
||||
|
||||
@Schema(description = "建设状态")
|
||||
private Integer bldsttCcode;
|
||||
|
||||
@Schema(description = "基地排序")
|
||||
private Integer baseStepSort;
|
||||
}
|
||||
@ -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.EngEiaapprovalVo;
|
||||
import com.yfd.platform.qgc_base.domain.vo.EngOperatVo;
|
||||
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.EngVmsstbprptVo;
|
||||
|
||||
@ -86,4 +87,6 @@ public interface ISdEngInfoBHService extends IService<SdEngInfoBH> {
|
||||
DataSourceResult<EngOperatVo> getOperatKendoList(DataSourceRequest dataSourceRequest);
|
||||
|
||||
DataSourceResult getStbprpDataKendoListCust(DataSourceRequest dataSourceRequest, String tbCode, Boolean ignorePageLimit);
|
||||
|
||||
DataSourceResult<EngPointVo> getEngPointKendoListCust(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.EngEiaapprovalVo;
|
||||
import com.yfd.platform.qgc_base.domain.vo.EngOperatVo;
|
||||
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.EngStBaseInfoVo;
|
||||
import com.yfd.platform.qgc_base.domain.vo.EngStInfoResultVo;
|
||||
@ -2673,4 +2674,258 @@ public class SdEngInfoBHServiceImpl extends ServiceImpl<SdEngInfoBHMapper, SdEng
|
||||
|
||||
private record StbprpTableMeta(String id, String tableName, String tbCode, String stcdMapping, String tmMapping) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public DataSourceResult<EngPointVo> getEngPointKendoListCust(DataSourceRequest dataSourceRequest) {
|
||||
DataSourceResult<EngPointVo> result = new DataSourceResult<>();
|
||||
result.setAggregates(new HashMap<>());
|
||||
|
||||
if (dataSourceRequest == null) {
|
||||
result.setData(new ArrayList<>());
|
||||
result.setTotal(0L);
|
||||
return result;
|
||||
}
|
||||
|
||||
StringBuilder sql = new StringBuilder();
|
||||
sql.append("SELECT ")
|
||||
.append("t.STCD AS stcd, ")
|
||||
.append("t.STNM AS ennm, ")
|
||||
.append("t.LOGO AS logo, ")
|
||||
.append("t.STNM AS stnm, ")
|
||||
.append("t.STNM AS titleName, ")
|
||||
.append("t.RVCD AS rvcd, ")
|
||||
.append("t.ADDVCD AS addvcd, ")
|
||||
.append("t.LGTD AS lgtd, ")
|
||||
.append("t.LTTD AS lttd, ")
|
||||
.append("t.AVQ AS avq, ")
|
||||
.append("t.YRGEB AS ttpwr, ")
|
||||
.append("t.FSLTDZ AS normz, ")
|
||||
.append("t.YRGEB AS yrge, ")
|
||||
.append("t.BASE_ID AS baseId, ")
|
||||
.append("t.JCDT AS jcdt, ")
|
||||
.append("t.ADDVCD_NAME AS addvcdName, ")
|
||||
.append("t.PRSC AS prsc, ")
|
||||
.append("CAST(NULL AS NUMBER) AS iconRotate, ")
|
||||
.append("t.BLDSTT_CODE AS bldsttCcode, ")
|
||||
.append("'ENG' AS sttpMap, ")
|
||||
.append("'ENG' AS sttp, ")
|
||||
.append("'ENG' AS sttpCode, ")
|
||||
.append("t.DTIN_ENV AS dtmel, ")
|
||||
.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("CASE WHEN elec.configCount > 0 THEN 'true' WHEN elec.configCount IS NULL THEN 'false' ELSE 'false' END AS ifEngSpecial, ")
|
||||
.append("CASE ")
|
||||
.append(" WHEN t.PRSC IN ('1','2') AND t.BLDSTT_CODE = 2 THEN 'large_eng_built' ")
|
||||
.append(" WHEN t.PRSC IN ('1','2') AND t.BLDSTT_CODE = 1 THEN 'large_eng_ubuilt' ")
|
||||
.append(" WHEN t.PRSC IN ('1','2') AND (t.BLDSTT_CODE = 0 OR t.BLDSTT_CODE IS NULL) THEN 'large_eng_nbuilt' ")
|
||||
.append(" WHEN t.PRSC IN ('3') AND t.BLDSTT_CODE = 2 THEN 'mid_eng_built' ")
|
||||
.append(" WHEN t.PRSC IN ('3') AND t.BLDSTT_CODE = 1 THEN 'mid_eng_ubuilt' ")
|
||||
.append(" WHEN t.PRSC IN ('3') AND (t.BLDSTT_CODE = 0 OR t.BLDSTT_CODE IS NULL) THEN 'mid_eng_nbuilt' ")
|
||||
.append(" END AS anchoPointState, ")
|
||||
.append("CASE ")
|
||||
.append(" WHEN t.PRSC IN ('1','2') THEN 1 ")
|
||||
.append(" WHEN t.PRSC IN ('3') THEN 2 ")
|
||||
.append(" END AS endInstalledType ")
|
||||
.append("FROM SD_ENGINFO_B_H t ")
|
||||
.append("LEFT JOIN SD_HYDROBASE hb ON hb.BASEID = t.BASE_ID AND NVL(hb.IS_DELETED, 0) = 0 ")
|
||||
.append("LEFT JOIN MS_ALONG_B along ON along.RVCD = t.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 = t.HBRVCD AND rstSort.STCD = t.STCD ")
|
||||
.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 = t.HBRVCD AND siteSort.STCD = t.STCD ")
|
||||
.append("LEFT JOIN ( ")
|
||||
.append(" SELECT STCD, COUNT(ID) AS configCount ")
|
||||
.append(" FROM SD_EQ_B_H ")
|
||||
.append(" WHERE NVL(IS_DELETED, 0) = 0 ")
|
||||
.append(" GROUP BY STCD ")
|
||||
.append(") elec ON t.STCD = elec.STCD ")
|
||||
.append("WHERE NVL(t.IS_DELETED, 0) = 0 ")
|
||||
.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 = buildEngPointFilterCondition(dataSourceRequest.getFilter(), paramMap, new int[]{0});
|
||||
if (StrUtil.isNotBlank(filterSql)) {
|
||||
sql.append(" AND ").append(filterSql);
|
||||
}
|
||||
|
||||
sql.append(buildEngPointOrderBySql(dataSourceRequest.getSort()));
|
||||
|
||||
DataSourceLoadOptionsBase loadOptions = dataSourceRequest.toDevRequest();
|
||||
Page<?> page = loadOptions == null ? null : QgcQueryWrapperUtil.buildPage(loadOptions, loadOptions.getSkip(), loadOptions.getTake());
|
||||
List<EngPointVo> list = microservicDynamicSQLMapper.pageAllListWithResultType(page, sql.toString(), paramMap, EngPointVo.class);
|
||||
|
||||
result.setData(list);
|
||||
result.setTotal(page == null ? list.size() : page.getTotal());
|
||||
return result;
|
||||
}
|
||||
|
||||
private String buildEngPointFilterCondition(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 = buildEngPointFilterCondition(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 = mapEngPointColumn(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 = "engPointParam" + 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 = "engPointParam" + 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 mapEngPointColumn(String field) {
|
||||
if (StrUtil.isBlank(field)) {
|
||||
return null;
|
||||
}
|
||||
return switch (field) {
|
||||
case "stcd" -> "t.STCD";
|
||||
case "stnm", "ennm", "titleName" -> "t.STNM";
|
||||
case "rvcd" -> "t.RVCD";
|
||||
case "addvcd" -> "t.ADDVCD";
|
||||
case "lgtd" -> "t.LGTD";
|
||||
case "lttd" -> "t.LTTD";
|
||||
case "avq" -> "t.AVQ";
|
||||
case "ttpwr" -> "t.YRGEB";
|
||||
case "normz" -> "t.FSLTDZ";
|
||||
case "yrge" -> "t.YRGEB";
|
||||
case "baseId" -> "t.BASE_ID";
|
||||
case "jcdt" -> "t.JCDT";
|
||||
case "addvcdName" -> "t.ADDVCD_NAME";
|
||||
case "prsc" -> "t.PRSC";
|
||||
case "iconRotate" -> "t.ICON_ROTATE";
|
||||
case "bldsttCcode" -> "t.BLDSTT_CODE";
|
||||
case "sttp" -> "'ENG'";
|
||||
case "sttpCode" -> "'ENG'";
|
||||
case "sttpMap" -> "'ENG'";
|
||||
case "dtmel" -> "t.DTIN_ENV";
|
||||
case "siteStepSort" -> "siteStepSort";
|
||||
case "rvcdStepSort" -> "rvcdStepSort";
|
||||
case "rstcdStepSort" -> "rstcdStepSort";
|
||||
case "baseStepSort" -> "baseStepSort";
|
||||
case "ifEngSpecial" -> "ifEngSpecial";
|
||||
case "anchoPointState" -> "anchoPointState";
|
||||
case "endInstalledType" -> "endInstalledType";
|
||||
default -> null;
|
||||
};
|
||||
}
|
||||
|
||||
private String buildEngPointOrderBySql(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 = mapEngPointColumn(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);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1875,6 +1875,7 @@ public class WarnDataServiceImpl implements WarnDataService {
|
||||
case "rstcd" -> "ai.RSTCD";
|
||||
case "ennm", "stnmEng" -> "eng.ENNM";
|
||||
case "baseId" -> "ai.BASE_ID";
|
||||
case "baseName" -> "hb.BASENAME";
|
||||
case "hbrvcd" -> "ai.HBRVCD";
|
||||
case "rvcd" -> "ai.RVCD";
|
||||
case "tm" -> "rec.TM";
|
||||
|
||||
Loading…
Reference in New Issue
Block a user