Merge branch 'main' of http://121.37.111.42:3000/zhengsl/WholeProcessPlatform into main_hzz
This commit is contained in:
commit
f55b061bf2
@ -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));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -99,4 +99,10 @@ public class SdHbrvDic implements Serializable {
|
|||||||
* 删除时间
|
* 删除时间
|
||||||
*/
|
*/
|
||||||
private Date deleteTime;
|
private Date deleteTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 基地名称
|
||||||
|
*/
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String basename;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -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;
|
||||||
|
}
|
||||||
@ -1,8 +1,10 @@
|
|||||||
package com.yfd.platform.qgc_base.mapper;
|
package com.yfd.platform.qgc_base.mapper;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.yfd.platform.common.DataSourceRequest;
|
||||||
import com.yfd.platform.qgc_base.domain.SdHbrvDic;
|
import com.yfd.platform.qgc_base.domain.SdHbrvDic;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
import org.apache.ibatis.annotations.Select;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@ -27,4 +29,16 @@ public interface SdHbrvDicMapper extends BaseMapper<SdHbrvDic> {
|
|||||||
* 查询所有启用的流域
|
* 查询所有启用的流域
|
||||||
*/
|
*/
|
||||||
List<SdHbrvDic> selectEnabledList();
|
List<SdHbrvDic> selectEnabledList();
|
||||||
|
|
||||||
|
@Select("SELECT\n" +
|
||||||
|
" shd.*,\n" +
|
||||||
|
" sh.BASENAME\n" +
|
||||||
|
"FROM\n" +
|
||||||
|
" SD_HBRV_DIC shd\n" +
|
||||||
|
" LEFT JOIN SD_HYDROBASE sh ON sh.BASEID = shd.BASEID\n" +
|
||||||
|
"WHERE\n" +
|
||||||
|
" 1 = 1 \n" +
|
||||||
|
" AND shd.IS_DELETED = 0 \n" +
|
||||||
|
" AND sh.IS_DELETED = 0")
|
||||||
|
List<SdHbrvDic> getWbsbList(DataSourceRequest dataSourceRequest);
|
||||||
}
|
}
|
||||||
@ -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);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -62,4 +62,5 @@ public interface ISdHbrvDicService extends IService<SdHbrvDic> {
|
|||||||
|
|
||||||
List<HbrvWbsVo> getHbrvdList(DataSourceRequest dataSourceRequest);
|
List<HbrvWbsVo> getHbrvdList(DataSourceRequest dataSourceRequest);
|
||||||
|
|
||||||
|
List<SdHbrvDic> getWbsbList(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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -52,6 +52,7 @@ public class SdHbrvDicServiceImpl extends ServiceImpl<SdHbrvDicMapper, SdHbrvDic
|
|||||||
@Resource
|
@Resource
|
||||||
private IAdminAuthService adminAuthService;
|
private IAdminAuthService adminAuthService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
private SdHbrvDicMapper hbrvDicMapper;
|
private SdHbrvDicMapper hbrvDicMapper;
|
||||||
|
|
||||||
|
|
||||||
@ -294,4 +295,10 @@ public class SdHbrvDicServiceImpl extends ServiceImpl<SdHbrvDicMapper, SdHbrvDic
|
|||||||
vo.setBaseName(baseName);
|
vo.setBaseName(baseName);
|
||||||
return vo;
|
return vo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<SdHbrvDic> getWbsbList(DataSourceRequest dataSourceRequest) {
|
||||||
|
List<SdHbrvDic> sdHbrvDics = hbrvDicMapper.getWbsbList(dataSourceRequest);
|
||||||
|
return sdHbrvDics;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -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);
|
||||||
approvalMainService.save(approvalMain);
|
try {
|
||||||
|
executeInNewTransaction(() -> {
|
||||||
|
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());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
approvalLogService.logSubmit(approvalMain.getId(), operatorId, "批量提交草稿,共" + ids.size() + "条");
|
executeInNewTransaction(() -> {
|
||||||
return true;
|
approvalLogService.logSubmit(approvalMain.getId(), operatorId, "批量提交草稿,共" + ids.size() + "条");
|
||||||
|
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,45 +454,60 @@ 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());
|
||||||
ApprovalMain approvalMain = approvalMainService.getById(approvalId);
|
fpssRList.add(convertToSdFpssR(batchDraft, operatorId));
|
||||||
approvalLogService.logApprove(approvalId, SecurityUtils.getUserId(), approveComment);
|
}
|
||||||
if (approvalMain != null) {
|
updateByIdsBatch(batchIds, entity -> {
|
||||||
approvalMain.setStatus("APPROVED");
|
entity.setStatus("APPROVED");
|
||||||
approvalMain.setApproverId(operatorId);
|
entity.setApproveTime(now);
|
||||||
approvalMain.setApproveTime(now);
|
entity.setUpdatedBy(operatorId);
|
||||||
approvalMain.setRemark(approveComment);
|
});
|
||||||
approvalMainService.updateById(approvalMain);
|
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);
|
||||||
|
approvalLogService.logApprove(approvalId, SecurityUtils.getUserId(), approveComment);
|
||||||
|
if (approvalMain != null) {
|
||||||
|
approvalMain.setStatus("APPROVED");
|
||||||
|
approvalMain.setApproverId(operatorId);
|
||||||
|
approvalMain.setApproveTime(now);
|
||||||
|
approvalMain.setRemark(approveComment);
|
||||||
|
approvalMainService.updateById(approvalMain);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return true;
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("批量审批失败", e);
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
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,41 +595,53 @@ 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());
|
||||||
approvalLogService.logReject(approvalId, operatorId, rejectReason);
|
}
|
||||||
ApprovalMain approvalMain = approvalMainService.getById(approvalId);
|
updateByIdsBatch(batchIds, entity -> {
|
||||||
if (approvalMain != null) {
|
entity.setStatus("REJECTED");
|
||||||
approvalMain.setStatus("REJECTED");
|
entity.setApproveTime(now);
|
||||||
approvalMain.setApproverId(operatorId);
|
entity.setUpdatedBy(operatorId);
|
||||||
approvalMain.setApproveTime(now);
|
});
|
||||||
approvalMain.setRemark(rejectReason);
|
return true;
|
||||||
approvalMainService.updateById(approvalMain);
|
});
|
||||||
|
}
|
||||||
|
if (!"__NO_APPROVAL__".equals(approvalId)) {
|
||||||
|
executeInNewTransaction(() -> {
|
||||||
|
approvalLogService.logReject(approvalId, operatorId, rejectReason);
|
||||||
|
ApprovalMain approvalMain = approvalMainService.getById(approvalId);
|
||||||
|
if (approvalMain != null) {
|
||||||
|
approvalMain.setStatus("REJECTED");
|
||||||
|
approvalMain.setApproverId(operatorId);
|
||||||
|
approvalMain.setApproveTime(now);
|
||||||
|
approvalMain.setRemark(rejectReason);
|
||||||
|
approvalMainService.updateById(approvalMain);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return true;
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("批量驳回失败", e);
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -7,16 +7,18 @@ import com.yfd.platform.common.DataSourceRequest;
|
|||||||
import com.yfd.platform.common.DataSourceResult;
|
import com.yfd.platform.common.DataSourceResult;
|
||||||
import com.yfd.platform.common.exception.BizException;
|
import com.yfd.platform.common.exception.BizException;
|
||||||
import com.yfd.platform.config.ResponseResult;
|
import com.yfd.platform.config.ResponseResult;
|
||||||
|
import com.yfd.platform.qgc_base.service.ISdHbrvDicService;
|
||||||
|
import com.yfd.platform.qgc_env.wt.service.SdWtMonitorService;
|
||||||
import com.yfd.platform.qgc_lygk.along.domain.MsAlongB;
|
import com.yfd.platform.qgc_lygk.along.domain.MsAlongB;
|
||||||
import com.yfd.platform.qgc_lygk.along.service.IMsAlongBService;
|
import com.yfd.platform.qgc_lygk.along.service.IMsAlongBService;
|
||||||
|
import com.yfd.platform.qgc_sys.mapcfg.service.IMapmoduleBService;
|
||||||
import com.yfd.platform.utils.DataSourceRequestUtil;
|
import com.yfd.platform.utils.DataSourceRequestUtil;
|
||||||
|
import com.yfd.platform.utils.SecurityUtils;
|
||||||
|
import io.lettuce.core.dynamic.annotation.Param;
|
||||||
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;
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@ -32,6 +34,12 @@ public class MsAlongBController {
|
|||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private IMsAlongBService msAlongBService;
|
private IMsAlongBService msAlongBService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private SdWtMonitorService sdWtMonitorService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ISdHbrvDicService hbrvDicService;
|
||||||
/**
|
/**
|
||||||
* 条件过滤数据列表
|
* 条件过滤数据列表
|
||||||
*/
|
*/
|
||||||
@ -57,14 +65,29 @@ public class MsAlongBController {
|
|||||||
if (StrUtil.isBlank(msAlongB.getCode())) {
|
if (StrUtil.isBlank(msAlongB.getCode())) {
|
||||||
throw new BizException("沿程配置编码(code)不能为空.");
|
throw new BizException("沿程配置编码(code)不能为空.");
|
||||||
}
|
}
|
||||||
|
msAlongB.setRecordUser(SecurityUtils.getUserId());
|
||||||
|
//msAlongB.setRecordUser(SecurityUtils.getCurrentUsername());
|
||||||
msAlongBService.saveOrUpdate(msAlongB);
|
msAlongBService.saveOrUpdate(msAlongB);
|
||||||
return ResponseResult.success("保存成功.");
|
return ResponseResult.successData(msAlongB.getId());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// @Operation(summary = "沿程配置删除")
|
@PostMapping("/wbsb/GetKendoList")
|
||||||
// @PostMapping("/delete")
|
@Operation(summary = "查询水电基地流域字典列表")
|
||||||
// public ResponseResult deleteData(@RequestBody List<String> ids) {
|
public ResponseResult getWbsbList(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||||
// mapmoduleBService.delelteByIds(ids);
|
return ResponseResult.successData(hbrvDicService.getWbsbList(dataSourceRequest));
|
||||||
// return ResponseResult.success("删除成功.");
|
}
|
||||||
// }
|
|
||||||
|
@Operation(summary = "沿程配置删除")
|
||||||
|
@PostMapping("/delete")
|
||||||
|
public ResponseResult deleteData(@RequestBody List<String> ids) {
|
||||||
|
msAlongBService.delelteByIds(ids);
|
||||||
|
return ResponseResult.success("删除成功.");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/noAuth/GetKendoList")
|
||||||
|
@Operation(summary = "查询水电基地流域字典列表")
|
||||||
|
public ResponseResult getWbsbList(@RequestParam String stcd) {
|
||||||
|
return ResponseResult.successData(msAlongBService.getWbsbList(stcd));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@ -1,5 +1,6 @@
|
|||||||
package com.yfd.platform.qgc_lygk.along.controller;
|
package com.yfd.platform.qgc_lygk.along.controller;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.yfd.platform.common.DataSourceRequest;
|
import com.yfd.platform.common.DataSourceRequest;
|
||||||
import com.yfd.platform.common.DataSourceResult;
|
import com.yfd.platform.common.DataSourceResult;
|
||||||
@ -7,6 +8,7 @@ import com.yfd.platform.common.exception.BizException;
|
|||||||
import com.yfd.platform.config.ResponseResult;
|
import com.yfd.platform.config.ResponseResult;
|
||||||
import com.yfd.platform.qgc_lygk.along.domain.MsAlongB;
|
import com.yfd.platform.qgc_lygk.along.domain.MsAlongB;
|
||||||
import com.yfd.platform.qgc_lygk.along.domain.MsAlongDetB;
|
import com.yfd.platform.qgc_lygk.along.domain.MsAlongDetB;
|
||||||
|
import com.yfd.platform.qgc_lygk.along.domain.MsAlongDetTreeDto;
|
||||||
import com.yfd.platform.qgc_lygk.along.service.IMsAlongDetBService;
|
import com.yfd.platform.qgc_lygk.along.service.IMsAlongDetBService;
|
||||||
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;
|
||||||
@ -16,6 +18,8 @@ import org.springframework.web.bind.annotation.RequestBody;
|
|||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 沿程配置明细表控制器
|
* 沿程配置明细表控制器
|
||||||
*
|
*
|
||||||
@ -44,11 +48,21 @@ public class MsAlongDetBController {
|
|||||||
*/
|
*/
|
||||||
@Operation(summary = "保存或修改")
|
@Operation(summary = "保存或修改")
|
||||||
@PostMapping("/save")
|
@PostMapping("/save")
|
||||||
public ResponseResult save(@RequestBody MsAlongDetB msAlongDetB) {
|
public ResponseResult save(@RequestBody List<MsAlongDetTreeDto> treeList) {
|
||||||
if (msAlongDetB == null) {
|
if (CollUtil.isEmpty(treeList)) {
|
||||||
return ResponseResult.error("沿程配置明细信息不能为空.");
|
return ResponseResult.error("数据不能为空.");
|
||||||
}
|
}
|
||||||
msAlongDetBService.saveOrUpdate(msAlongDetB);
|
msAlongDetBService.saveOrUpdateBatchData(treeList);
|
||||||
return ResponseResult.success("保存成功.");
|
return ResponseResult.success("保存成功.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 条件过滤数据列表定制
|
||||||
|
*/
|
||||||
|
@Operation(summary = "条件过滤数据列表定制")
|
||||||
|
@PostMapping("/GetKendoListCust")
|
||||||
|
public ResponseResult getKendoListCust(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||||
|
DataSourceResult<MsAlongDetB> result = msAlongDetBService.getKendoList(dataSourceRequest);
|
||||||
|
return ResponseResult.successData(result);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@ -0,0 +1,18 @@
|
|||||||
|
package com.yfd.platform.qgc_lygk.along.domain;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class MsAlongDetTreeDto {
|
||||||
|
private String id; // 记录ID(更新时传)
|
||||||
|
private String alongId; // 关联主表ID
|
||||||
|
private String stcd; // 断面编码
|
||||||
|
private String sttp; // 类型编码
|
||||||
|
private Integer sort; // 排序
|
||||||
|
private String stnm; // 仅用于显示,不存表
|
||||||
|
private String rstcd; // 仅用于显示,不存表
|
||||||
|
private String parentId; // 前端用,不存表
|
||||||
|
private List<MsAlongDetTreeDto> children; // 子节点
|
||||||
|
}
|
||||||
@ -0,0 +1,26 @@
|
|||||||
|
package com.yfd.platform.qgc_lygk.along.domain;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
@Data
|
||||||
|
public class PowerDto {
|
||||||
|
// 水电水利工程编码
|
||||||
|
private String stcd;
|
||||||
|
|
||||||
|
// 水电水利工程名称
|
||||||
|
private String stnm;
|
||||||
|
|
||||||
|
// 水电水利工程名称
|
||||||
|
private String sttp;
|
||||||
|
|
||||||
|
// 主表实体
|
||||||
|
private String sttpCode;
|
||||||
|
|
||||||
|
// 主表实体
|
||||||
|
private String sttpName;
|
||||||
|
|
||||||
|
// 主表实体
|
||||||
|
private String rstcd;
|
||||||
|
|
||||||
|
}
|
||||||
@ -2,7 +2,10 @@ package com.yfd.platform.qgc_lygk.along.mapper;
|
|||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.yfd.platform.qgc_lygk.along.domain.MsAlongB;
|
import com.yfd.platform.qgc_lygk.along.domain.MsAlongB;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import com.yfd.platform.qgc_lygk.along.domain.PowerDto;
|
||||||
|
import org.apache.ibatis.annotations.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 沿程配置表 Mapper 接口
|
* 沿程配置表 Mapper 接口
|
||||||
@ -12,4 +15,16 @@ import org.apache.ibatis.annotations.Mapper;
|
|||||||
@Mapper
|
@Mapper
|
||||||
public interface MsAlongBMapper extends BaseMapper<MsAlongB> {
|
public interface MsAlongBMapper extends BaseMapper<MsAlongB> {
|
||||||
|
|
||||||
|
@Select("SELECT STCD, STNM, STTP, STTP_CODE, STTP_NAME, RSTCD " +
|
||||||
|
"FROM V_MS_STBPRP_T " +
|
||||||
|
"WHERE RSTCD = #{stcd}")
|
||||||
|
@Results({
|
||||||
|
@Result(column = "STCD", property = "stcd"),
|
||||||
|
@Result(column = "STNM", property = "stnm"),
|
||||||
|
@Result(column = "STTP", property = "sttp"),
|
||||||
|
@Result(column = "STTP_CODE", property = "sttpCode"),
|
||||||
|
@Result(column = "STTP_NAME", property = "sttpName"),
|
||||||
|
@Result(column = "RSTCD", property = "rstcd")
|
||||||
|
})
|
||||||
|
List<PowerDto> getWbsbList(@Param("stcd") String stcd);
|
||||||
}
|
}
|
||||||
@ -2,7 +2,10 @@ package com.yfd.platform.qgc_lygk.along.mapper;
|
|||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.yfd.platform.qgc_lygk.along.domain.MsAlongDetB;
|
import com.yfd.platform.qgc_lygk.along.domain.MsAlongDetB;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import com.yfd.platform.qgc_lygk.along.domain.PowerDto;
|
||||||
|
import org.apache.ibatis.annotations.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 沿程配置明细表 Mapper 接口
|
* 沿程配置明细表 Mapper 接口
|
||||||
@ -12,4 +15,16 @@ import org.apache.ibatis.annotations.Mapper;
|
|||||||
@Mapper
|
@Mapper
|
||||||
public interface MsAlongDetBMapper extends BaseMapper<MsAlongDetB> {
|
public interface MsAlongDetBMapper extends BaseMapper<MsAlongDetB> {
|
||||||
|
|
||||||
|
@Select("SELECT STCD, STNM, STTP, STTP_CODE, STTP_NAME, RSTCD " +
|
||||||
|
"FROM V_MS_STBPRP_T " +
|
||||||
|
"WHERE STCD = #{stcd}")
|
||||||
|
@Results({
|
||||||
|
@Result(column = "STCD", property = "stcd"),
|
||||||
|
@Result(column = "STNM", property = "stnm"),
|
||||||
|
@Result(column = "STTP", property = "sttp"),
|
||||||
|
@Result(column = "STTP_CODE", property = "sttpCode"),
|
||||||
|
@Result(column = "STTP_NAME", property = "sttpName"),
|
||||||
|
@Result(column = "RSTCD", property = "rstcd")
|
||||||
|
})
|
||||||
|
List<PowerDto> getWbsbList(@Param("stcd") String stcd);
|
||||||
}
|
}
|
||||||
@ -4,6 +4,9 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
|||||||
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_lygk.along.domain.MsAlongB;
|
import com.yfd.platform.qgc_lygk.along.domain.MsAlongB;
|
||||||
|
import com.yfd.platform.qgc_lygk.along.domain.PowerDto;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 沿程配置表 Service 接口
|
* 沿程配置表 Service 接口
|
||||||
@ -19,6 +22,10 @@ public interface IMsAlongBService extends IService<MsAlongB> {
|
|||||||
*/
|
*/
|
||||||
DataSourceResult<MsAlongB> getKendoList(DataSourceRequest dataSourceRequest);
|
DataSourceResult<MsAlongB> getKendoList(DataSourceRequest dataSourceRequest);
|
||||||
|
|
||||||
|
void delelteByIds(List<String> ids);
|
||||||
|
|
||||||
|
List<PowerDto> getWbsbList(String stcd);
|
||||||
|
|
||||||
// /**
|
// /**
|
||||||
// * 保存或更新沿程配置
|
// * 保存或更新沿程配置
|
||||||
// *
|
// *
|
||||||
|
|||||||
@ -3,7 +3,11 @@ package com.yfd.platform.qgc_lygk.along.service;
|
|||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
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.config.ResponseResult;
|
||||||
import com.yfd.platform.qgc_lygk.along.domain.MsAlongDetB;
|
import com.yfd.platform.qgc_lygk.along.domain.MsAlongDetB;
|
||||||
|
import com.yfd.platform.qgc_lygk.along.domain.MsAlongDetTreeDto;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 沿程配置明细表 Service 接口
|
* 沿程配置明细表 Service 接口
|
||||||
@ -19,4 +23,6 @@ public interface IMsAlongDetBService extends IService<MsAlongDetB> {
|
|||||||
* @return 数据源结果
|
* @return 数据源结果
|
||||||
*/
|
*/
|
||||||
DataSourceResult<MsAlongDetB> getKendoList(DataSourceRequest dataSourceRequest);
|
DataSourceResult<MsAlongDetB> getKendoList(DataSourceRequest dataSourceRequest);
|
||||||
|
|
||||||
|
ResponseResult saveOrUpdateBatchData(List<MsAlongDetTreeDto> treeList);
|
||||||
}
|
}
|
||||||
@ -1,19 +1,28 @@
|
|||||||
package com.yfd.platform.qgc_lygk.along.service.impl;
|
package com.yfd.platform.qgc_lygk.along.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
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;
|
||||||
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_base.domain.SdRvcdDic;
|
||||||
|
import com.yfd.platform.qgc_base.mapper.SdRvcdDicMapper;
|
||||||
import com.yfd.platform.qgc_lygk.along.domain.MsAlongB;
|
import com.yfd.platform.qgc_lygk.along.domain.MsAlongB;
|
||||||
|
import com.yfd.platform.qgc_lygk.along.domain.PowerDto;
|
||||||
import com.yfd.platform.qgc_lygk.along.mapper.MsAlongBMapper;
|
import com.yfd.platform.qgc_lygk.along.mapper.MsAlongBMapper;
|
||||||
import com.yfd.platform.qgc_lygk.along.service.IMsAlongBService;
|
import com.yfd.platform.qgc_lygk.along.service.IMsAlongBService;
|
||||||
|
import com.yfd.platform.utils.CodeToNameMetadataBo;
|
||||||
import com.yfd.platform.utils.DataSourceRequestUtil;
|
import com.yfd.platform.utils.DataSourceRequestUtil;
|
||||||
|
import com.yfd.platform.utils.DictCodeToNameConverter;
|
||||||
import com.yfd.platform.utils.QgcQueryWrapperUtil;
|
import com.yfd.platform.utils.QgcQueryWrapperUtil;
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.*;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 沿程配置表 Service 实现类
|
* 沿程配置表 Service 实现类
|
||||||
@ -23,6 +32,11 @@ import java.util.List;
|
|||||||
@Service
|
@Service
|
||||||
public class MsAlongBServiceImpl extends ServiceImpl<MsAlongBMapper, MsAlongB> implements IMsAlongBService {
|
public class MsAlongBServiceImpl extends ServiceImpl<MsAlongBMapper, MsAlongB> implements IMsAlongBService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private MsAlongBMapper msAlongBMapper;
|
||||||
|
@Resource
|
||||||
|
private SdRvcdDicMapper sdRvcdDicMapper;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public DataSourceResult<MsAlongB> getKendoList(DataSourceRequest dataSourceRequest) {
|
public DataSourceResult<MsAlongB> getKendoList(DataSourceRequest dataSourceRequest) {
|
||||||
// 1. 构建查询条件
|
// 1. 构建查询条件
|
||||||
@ -45,13 +59,48 @@ public class MsAlongBServiceImpl extends ServiceImpl<MsAlongBMapper, MsAlongB> i
|
|||||||
resultPage.setTotal(list.size());
|
resultPage.setTotal(list.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
// 4. 构建结果
|
// 4. 循环填充 rvnm
|
||||||
|
List<MsAlongB> records = resultPage.getRecords();
|
||||||
|
if (CollUtil.isNotEmpty(records)) {
|
||||||
|
for (MsAlongB record : records) {
|
||||||
|
String rvcd = record.getRvcd();
|
||||||
|
if (StrUtil.isNotBlank(rvcd)) {
|
||||||
|
// 调用现有 Mapper 方法,查询单个 rvcd
|
||||||
|
List<SdRvcdDic> dictList = sdRvcdDicMapper.selectRegDropdown(null, rvcd);
|
||||||
|
if (CollUtil.isNotEmpty(dictList)) {
|
||||||
|
// 取第一条记录的 RVNM(即 DISPLAY_RVNM)
|
||||||
|
String displayRvnm = dictList.get(0).getRvnm();
|
||||||
|
// 如果只需要末级名称,可截取最后一个 '-' 后的部分
|
||||||
|
// 如果直接使用完整路径,则直接赋值
|
||||||
|
record.setRvnm(displayRvnm);
|
||||||
|
// 若需要末级名称:
|
||||||
|
// int lastDash = displayRvnm.lastIndexOf('-');
|
||||||
|
// record.setRvnm(lastDash > 0 ? displayRvnm.substring(lastDash + 1) : displayRvnm);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 5. 构建结果
|
||||||
DataSourceResult<MsAlongB> dataSourceResult = new DataSourceResult<>();
|
DataSourceResult<MsAlongB> dataSourceResult = new DataSourceResult<>();
|
||||||
dataSourceResult.setData(resultPage.getRecords());
|
dataSourceResult.setData(resultPage.getRecords());
|
||||||
dataSourceResult.setTotal(resultPage.getTotal());
|
dataSourceResult.setTotal(resultPage.getTotal());
|
||||||
return dataSourceResult;
|
return dataSourceResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void delelteByIds(List<String> ids) {
|
||||||
|
for (String id : ids) {
|
||||||
|
this.removeById(id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<PowerDto> getWbsbList(String stcd) {
|
||||||
|
List<PowerDto> powerDtos = msAlongBMapper.getWbsbList(stcd);
|
||||||
|
return powerDtos;
|
||||||
|
}
|
||||||
|
|
||||||
// @Override
|
// @Override
|
||||||
// public boolean saveOrUpdate(MsAlongB msAlongB) {
|
// public boolean saveOrUpdate(MsAlongB msAlongB) {
|
||||||
// super.saveOrUpdate(msAlongB);
|
// super.saveOrUpdate(msAlongB);
|
||||||
|
|||||||
@ -1,23 +1,29 @@
|
|||||||
package com.yfd.platform.qgc_lygk.along.service.impl;
|
package com.yfd.platform.qgc_lygk.along.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
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;
|
||||||
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.config.ResponseResult;
|
||||||
import com.yfd.platform.qgc_lygk.along.domain.MsAlongDetB;
|
import com.yfd.platform.qgc_lygk.along.domain.MsAlongDetB;
|
||||||
|
import com.yfd.platform.qgc_lygk.along.domain.MsAlongDetTreeDto;
|
||||||
|
import com.yfd.platform.qgc_lygk.along.domain.PowerDto;
|
||||||
|
import com.yfd.platform.qgc_lygk.along.mapper.MsAlongBMapper;
|
||||||
import com.yfd.platform.qgc_lygk.along.mapper.MsAlongDetBMapper;
|
import com.yfd.platform.qgc_lygk.along.mapper.MsAlongDetBMapper;
|
||||||
import com.yfd.platform.qgc_lygk.along.service.IMsAlongDetBService;
|
import com.yfd.platform.qgc_lygk.along.service.IMsAlongDetBService;
|
||||||
import com.yfd.platform.utils.CodeToNameMetadataBo;
|
import com.yfd.platform.utils.*;
|
||||||
import com.yfd.platform.utils.DataSourceRequestUtil;
|
|
||||||
import com.yfd.platform.utils.DictCodeToNameConverter;
|
|
||||||
import com.yfd.platform.utils.QgcQueryWrapperUtil;
|
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Set;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 沿程配置明细表 Service 实现类
|
* 沿程配置明细表 Service 实现类
|
||||||
@ -30,6 +36,9 @@ public class MsAlongDetBServiceImpl extends ServiceImpl<MsAlongDetBMapper, MsAlo
|
|||||||
@Resource
|
@Resource
|
||||||
private DictCodeToNameConverter dictCodeToNameConverter;
|
private DictCodeToNameConverter dictCodeToNameConverter;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private MsAlongDetBMapper msAlongDetBMapper;
|
||||||
|
|
||||||
private static final List<CodeToNameMetadataBo> CODE_TO_NAME_META_LIST = new ArrayList<>();
|
private static final List<CodeToNameMetadataBo> CODE_TO_NAME_META_LIST = new ArrayList<>();
|
||||||
|
|
||||||
static {
|
static {
|
||||||
@ -62,10 +71,99 @@ public class MsAlongDetBServiceImpl extends ServiceImpl<MsAlongDetBMapper, MsAlo
|
|||||||
resultPage.setTotal(list.size());
|
resultPage.setTotal(list.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ========== 新增:填充 stnm ==========
|
||||||
|
List<MsAlongDetB> records = resultPage.getRecords();
|
||||||
|
if (CollUtil.isNotEmpty(records)) {
|
||||||
|
for (MsAlongDetB record : records) {
|
||||||
|
String stcd = record.getStcd();
|
||||||
|
if (StrUtil.isNotBlank(stcd)) {
|
||||||
|
// 调用 Mapper 方法查询测站信息
|
||||||
|
List<PowerDto> powerDtos = msAlongDetBMapper.getWbsbList(stcd);
|
||||||
|
if (CollUtil.isNotEmpty(powerDtos)) {
|
||||||
|
// 取第一个结果(通常一个 STCD 只对应一条记录)
|
||||||
|
String stnm = powerDtos.get(0).getStnm();
|
||||||
|
record.setStnm(stnm);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 4. 构建结果
|
// 4. 构建结果
|
||||||
DataSourceResult<MsAlongDetB> dataSourceResult = new DataSourceResult<>();
|
DataSourceResult<MsAlongDetB> dataSourceResult = new DataSourceResult<>();
|
||||||
dataSourceResult.setData(resultPage.getRecords());
|
dataSourceResult.setData(resultPage.getRecords());
|
||||||
dataSourceResult.setTotal(resultPage.getTotal());
|
dataSourceResult.setTotal(resultPage.getTotal());
|
||||||
return dataSourceResult;
|
return dataSourceResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ResponseResult saveOrUpdateBatchData(List<MsAlongDetTreeDto> treeList) {
|
||||||
|
// 1. 递归扁平化:将树形结构转为平铺的实体列表
|
||||||
|
List<MsAlongDetB> flatList = new ArrayList<>();
|
||||||
|
for (MsAlongDetTreeDto root : treeList) {
|
||||||
|
flattenTree(root, flatList);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (flatList.isEmpty()) {
|
||||||
|
return ResponseResult.error("没有有效数据.");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 2. 校验每条记录的 alongId 不为空
|
||||||
|
for (MsAlongDetB item : flatList) {
|
||||||
|
if (StrUtil.isBlank(item.getAlongId())) {
|
||||||
|
return ResponseResult.error("沿程配置ID(alongId)不能为空.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 3. 【新增】提取所有不同的 alongId,删除这些主键下的旧明细
|
||||||
|
Set<String> alongIdSet = flatList.stream()
|
||||||
|
.map(MsAlongDetB::getAlongId)
|
||||||
|
.filter(StrUtil::isNotBlank)
|
||||||
|
.collect(Collectors.toSet());
|
||||||
|
|
||||||
|
if (CollUtil.isNotEmpty(alongIdSet)) {
|
||||||
|
LambdaUpdateWrapper<MsAlongDetB> deleteWrapper = new LambdaUpdateWrapper<>();
|
||||||
|
deleteWrapper.in(MsAlongDetB::getAlongId, alongIdSet)
|
||||||
|
.set(MsAlongDetB::getIsDeleted, "1"); // 逻辑删除标记
|
||||||
|
this.update(deleteWrapper);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 4. 插入新数据(注意:需要清空旧记录的主键ID,让数据库自增或雪花ID生成)
|
||||||
|
for (MsAlongDetB item : flatList) {
|
||||||
|
item.setId(null); // 确保都是新增
|
||||||
|
}
|
||||||
|
|
||||||
|
// 5. 批量保存(有则更新,无则新增)
|
||||||
|
this.saveOrUpdateBatch(flatList);
|
||||||
|
|
||||||
|
return ResponseResult.success("保存成功.");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 递归展开树形节点,将每个节点转换为 MsAlongDetB 实体
|
||||||
|
*/
|
||||||
|
private void flattenTree(MsAlongDetTreeDto node, List<MsAlongDetB> flatList) {
|
||||||
|
// 1. 将当前节点转为实体
|
||||||
|
MsAlongDetB entity = new MsAlongDetB();
|
||||||
|
// 仅复制表中存在的字段
|
||||||
|
entity.setId(node.getId());
|
||||||
|
entity.setAlongId(node.getAlongId());
|
||||||
|
entity.setStcd(node.getStcd());
|
||||||
|
entity.setSttp(node.getSttp());
|
||||||
|
entity.setRstcd(node.getRstcd());
|
||||||
|
entity.setRecordUser(SecurityUtils.getUserId()); // 创建人
|
||||||
|
//entity.setRecordUser(SecurityUtils.getCurrentUsername()); // 创建人
|
||||||
|
if (node.getSort() != null){
|
||||||
|
entity.setSort(String.valueOf(node.getSort())); // 若传了排序
|
||||||
|
}
|
||||||
|
if (StrUtil.isBlank(entity.getId())) {
|
||||||
|
entity.setId(null);
|
||||||
|
}
|
||||||
|
flatList.add(entity);
|
||||||
|
// 2. 递归处理子节点
|
||||||
|
if (CollUtil.isNotEmpty(node.getChildren())) {
|
||||||
|
for (MsAlongDetTreeDto child : node.getChildren()) {
|
||||||
|
flattenTree(child, flatList);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@ -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,
|
||||||
@ -109,6 +109,27 @@ public interface MsMapmoduleBMapper extends BaseMapper<MsMapmoduleB> {
|
|||||||
+ "</choose>"
|
+ "</choose>"
|
||||||
+ "ORDER BY BMM.ORDER_INDEX, BML.ORDER_INDEX"
|
+ "ORDER BY BMM.ORDER_INDEX, BML.ORDER_INDEX"
|
||||||
+ "</script>")
|
+ "</script>")
|
||||||
List<MapLegendVo> getModuleMapLegendList(@Param("moduleId") String moduleId);
|
List<MapLegendVo> getModuleMapLegendListData(@Param("moduleId") String moduleId);
|
||||||
|
|
||||||
|
@Select("SELECT *\n" +
|
||||||
|
"FROM MS_MAPMODULE_B\n" +
|
||||||
|
"WHERE MODULE_ID = (\n" +
|
||||||
|
" SELECT msdmb.MODULE_ID\n" +
|
||||||
|
" FROM MS_MAPMODULE_B msdmb\n" +
|
||||||
|
" LEFT JOIN MS_MAPLEGEND_B mslmb ON msdmb.RES_ID = mslmb.ID\n" +
|
||||||
|
" LEFT JOIN MS_MAPLAYER_B msmab ON msmab.CODE = mslmb.LAYER_CODE\n" +
|
||||||
|
" WHERE msdmb.ID = #{id}\n" +
|
||||||
|
" AND msdmb.IS_DELETED = 0\n" +
|
||||||
|
")\n" +
|
||||||
|
"AND RES_TYPE = 'layer'\n" +
|
||||||
|
"AND RES_ID = (\n" +
|
||||||
|
" SELECT msmab.id\n" +
|
||||||
|
" FROM MS_MAPMODULE_B msdmb\n" +
|
||||||
|
" LEFT JOIN MS_MAPLEGEND_B mslmb ON msdmb.RES_ID = mslmb.ID\n" +
|
||||||
|
" LEFT JOIN MS_MAPLAYER_B msmab ON msmab.CODE = mslmb.LAYER_CODE\n" +
|
||||||
|
" WHERE msdmb.ID = #{id}\n" +
|
||||||
|
" AND msdmb.IS_DELETED = 0\n" +
|
||||||
|
")\n" +
|
||||||
|
"AND IS_DELETED = 0")
|
||||||
|
MsMapmoduleB selectLayerById(@Param("id") String id);
|
||||||
}
|
}
|
||||||
@ -148,7 +148,7 @@ public class MapLegendBizServiceImpl implements IMapLegendBizService {
|
|||||||
public List<MapLegendVo> getModuleMapLegendList(String moduleId) {
|
public List<MapLegendVo> getModuleMapLegendList(String moduleId) {
|
||||||
List<MapLegendVo> list = new ArrayList<>();
|
List<MapLegendVo> list = new ArrayList<>();
|
||||||
// 通过 JOIN 查询 MS_MAPLEGEND_B 和 MS_MAPMODULE_B(单参数版本)
|
// 通过 JOIN 查询 MS_MAPLEGEND_B 和 MS_MAPMODULE_B(单参数版本)
|
||||||
List<MapLegendVo> bbiMapLegendList = msMapmoduleBMapper.getModuleMapLegendList(moduleId);
|
List<MapLegendVo> bbiMapLegendList = msMapmoduleBMapper.getModuleMapLegendListData(moduleId);
|
||||||
|
|
||||||
if (bbiMapLegendList == null || bbiMapLegendList.isEmpty()) {
|
if (bbiMapLegendList == null || bbiMapLegendList.isEmpty()) {
|
||||||
return list;
|
return list;
|
||||||
@ -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);
|
||||||
|
|||||||
@ -59,10 +59,12 @@ public class MapmoduleBServiceImpl extends ServiceImpl<MsMapmoduleBMapper, MsMap
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void delelteByIds(List<String> ids) {
|
public void delelteByIds(List<String> ids) {
|
||||||
if (ids != null) {
|
for (String id : ids) {
|
||||||
for (String id : ids) {
|
MsMapmoduleB msMapmoduleB = baseMapper.selectLayerById(id);
|
||||||
this.baseMapper.deleteById(id);
|
if (msMapmoduleB != null && msMapmoduleB.getId() != null){
|
||||||
|
this.baseMapper.deleteById(msMapmoduleB.getId());
|
||||||
}
|
}
|
||||||
|
this.baseMapper.deleteById(id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -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,9 +111,10 @@ spring:
|
|||||||
matching-strategy: ant_path_matcher
|
matching-strategy: ant_path_matcher
|
||||||
data:
|
data:
|
||||||
redis:
|
redis:
|
||||||
host: ${REDIS_HOST:localhost}
|
host: "${REDIS_HOST:172.16.21.142}"
|
||||||
port: ${REDIS_PORT:6379}
|
port: "${REDIS_PORT:6379}"
|
||||||
password: ${REDIS_PASSWORD:}
|
password: "${REDIS_PASSWORD:zny5678}"
|
||||||
|
database: "${REDIS_DATABASE:15}"
|
||||||
timeout: 10000ms
|
timeout: 10000ms
|
||||||
lettuce:
|
lettuce:
|
||||||
pool:
|
pool:
|
||||||
|
|||||||
@ -266,6 +266,10 @@ const columnsConfig = ref([
|
|||||||
type: 'EQ_7',
|
type: 'EQ_7',
|
||||||
columns: EQPointColumns7
|
columns: EQPointColumns7
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
type: 'EQ',
|
||||||
|
columns: EQPointColumns7
|
||||||
|
},
|
||||||
{
|
{
|
||||||
type: 'WE',
|
type: 'WE',
|
||||||
columns: wePointColumns
|
columns: wePointColumns
|
||||||
@ -365,9 +369,10 @@ const getData = async () => {
|
|||||||
item =>
|
item =>
|
||||||
item.type ==
|
item.type ==
|
||||||
(modelStore.params.sttp == 'EQ'
|
(modelStore.params.sttp == 'EQ'
|
||||||
? modelStore.params.anchoPointState
|
? modelStore.params.sttp
|
||||||
: modelStore.params.sttp)
|
: modelStore.params.sttp)
|
||||||
).columns;
|
).columns;
|
||||||
|
// debugger
|
||||||
|
|
||||||
columns.forEach(item => {
|
columns.forEach(item => {
|
||||||
if (item.visible) {
|
if (item.visible) {
|
||||||
|
|||||||
@ -1707,6 +1707,7 @@ onBeforeUnmount(() => {
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
background:#fff;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -314,4 +314,7 @@ onMounted(() => {
|
|||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
:deep(.media-empty){
|
||||||
|
background:#fff !important;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -196,9 +196,7 @@ const getSelectConfig = async () => {
|
|||||||
return indexA - indexB;
|
return indexA - indexB;
|
||||||
})
|
})
|
||||||
select.value.options = filterSelectOptions(dataMapNameArr)
|
select.value.options = filterSelectOptions(dataMapNameArr)
|
||||||
if (baseid.value === 'all') {
|
if (filterSelectOptions(dataMapNameArr)[0]?.children) {
|
||||||
select.value.value = 'SJLY176'
|
|
||||||
} else if (filterSelectOptions(dataMapNameArr)[0]?.children) {
|
|
||||||
select.value.value = filterSelectOptions(dataMapNameArr)[0]?.children[0]?.value
|
select.value.value = filterSelectOptions(dataMapNameArr)[0]?.children[0]?.value
|
||||||
} else if (filterSelectOptions(dataMapNameArr)[0]?.value) {
|
} else if (filterSelectOptions(dataMapNameArr)[0]?.value) {
|
||||||
select.value.value = filterSelectOptions(dataMapNameArr)[0]?.value
|
select.value.value = filterSelectOptions(dataMapNameArr)[0]?.value
|
||||||
|
|||||||
@ -368,7 +368,7 @@ const chartSetting = computed<EChartsOption>(() => {
|
|||||||
title: [
|
title: [
|
||||||
{
|
{
|
||||||
text: String(total || 0),
|
text: String(total || 0),
|
||||||
left: '28%',
|
left: '30%',
|
||||||
top: '43%',
|
top: '43%',
|
||||||
textStyle: { fontSize: 24, fontWeight: 'bold', color: '#333' }
|
textStyle: { fontSize: 24, fontWeight: 'bold', color: '#333' }
|
||||||
},
|
},
|
||||||
|
|||||||
@ -230,47 +230,23 @@ async function fetchPieData(params: any): Promise<PieDataItem[]> {
|
|||||||
let list = resData.flatMap((item: any) => {
|
let list = resData.flatMap((item: any) => {
|
||||||
let arr: PieDataItem[] = [];
|
let arr: PieDataItem[] = [];
|
||||||
|
|
||||||
const itmeData =
|
const itmeData = item?.items;
|
||||||
qid.value === 'all' || qid.value === 'other'
|
|
||||||
? item?.items
|
|
||||||
: item?.items[0]?.items;
|
|
||||||
|
|
||||||
itmeData?.map((outItem: any) => {
|
itmeData?.map((outItem: any) => {
|
||||||
const level5Data =
|
const level5Data = outItem?.items?.[0]?.items?.[0]?.items?.[0];
|
||||||
qid.value === 'all' || qid.value === 'other'
|
|
||||||
? outItem?.items?.[0]?.items?.[0]?.items?.[0]
|
|
||||||
: outItem?.items?.[0]?.items?.[0];
|
|
||||||
|
|
||||||
const name =
|
const name = outItem?.items?.[0]?.key;
|
||||||
qid.value === 'all'
|
|
||||||
? outItem?.items?.[0]?.key
|
|
||||||
: qid.value === 'other'
|
|
||||||
? outItem?.items?.[0]?.key
|
|
||||||
: outItem?.key || outItem?.HBRVCDNAME;
|
|
||||||
|
|
||||||
if (name) {
|
if (name) {
|
||||||
arr.push({
|
arr.push({
|
||||||
key:
|
key: outItem?.key,
|
||||||
qid.value === 'all'
|
|
||||||
? outItem?.key
|
|
||||||
: qid.value === 'other'
|
|
||||||
? outItem?.key
|
|
||||||
: outItem?.HBRVCD || outItem?.key,
|
|
||||||
dataDimensionRecursive: 'true',
|
dataDimensionRecursive: 'true',
|
||||||
name: name,
|
name: name,
|
||||||
unit: '',
|
unit: '',
|
||||||
value:
|
value:
|
||||||
qid.value === 'all' && useTtpwrFilter
|
useTtpwrFilter
|
||||||
? level5Data?.SUM_TTPWR && +transUnit(level5Data?.SUM_TTPWR)
|
? level5Data?.SUM_TTPWR && +transUnit(level5Data?.SUM_TTPWR)
|
||||||
: qid.value === 'all' && !useTtpwrFilter
|
: level5Data?.COUNT_BLDSTTCCODE
|
||||||
? level5Data?.COUNT_BLDSTTCCODE
|
|
||||||
: qid.value === 'other' && useTtpwrFilter
|
|
||||||
? level5Data?.SUM_TTPWR && +transUnit(level5Data?.SUM_TTPWR)
|
|
||||||
: qid.value === 'other' && !useTtpwrFilter
|
|
||||||
? level5Data?.COUNT_BLDSTTCCODE
|
|
||||||
: (level5Data?.SUM_TTPWR &&
|
|
||||||
+transUnit(level5Data?.SUM_TTPWR)) ||
|
|
||||||
level5Data?.COUNT_BLDSTTCCODE
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@ -2041,6 +2041,7 @@ onBeforeUnmount(() => {
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
background:#fff;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -215,4 +215,7 @@ const handlePageChange = (page: number, pageSize: number) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* 样式继承自父组件 */
|
/* 样式继承自父组件 */
|
||||||
|
:deep(.media-empty){
|
||||||
|
background:#fff !important;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -118,3 +118,8 @@ svg {
|
|||||||
.ant-select-tree-node-selected {
|
.ant-select-tree-node-selected {
|
||||||
background-color: #bae7ff !important;
|
background-color: #bae7ff !important;
|
||||||
}
|
}
|
||||||
|
.ant-empty{
|
||||||
|
p{
|
||||||
|
text-indent: 0em !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@ -5,136 +5,8 @@ import RightDrawer from '@/components/RightDrawer/index.vue';
|
|||||||
import jidiInfoMod from '@/modules/jidiInfoMod/index.vue';
|
import jidiInfoMod from '@/modules/jidiInfoMod/index.vue';
|
||||||
import shuidianhuangjingjieruMod from '@/modules/shuidianhuangjingjieruMod/index.vue';
|
import shuidianhuangjingjieruMod from '@/modules/shuidianhuangjingjieruMod/index.vue';
|
||||||
import { useModelStore } from '@/store/modules/model';
|
import { useModelStore } from '@/store/modules/model';
|
||||||
|
|
||||||
const modelStore = useModelStore();
|
|
||||||
// import { getQgcStaticData } from "@/api/ecoFlow";
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
// const params = {
|
|
||||||
// filter: {
|
|
||||||
// logic: "and",
|
|
||||||
// filters: [
|
|
||||||
// { field: "dtin", operator: "eq", dataType: "string", value: "1" },
|
|
||||||
// { field: "type", operator: "eq", dataType: "string", value: "hour" },
|
|
||||||
// { field: "tm", operator: "gte", dataType: "date", value: "2026-03-02 00:00:00" },
|
|
||||||
// { field: "tm", operator: "lte", dataType: "date", value: "2026-04-02 23:59:59" },
|
|
||||||
// ],
|
|
||||||
// },
|
|
||||||
// };
|
|
||||||
// getQgcStaticData(params).then((res) => {
|
|
||||||
// console.log(res);
|
|
||||||
// });
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const showMapModal = () => {
|
|
||||||
modelStore.modalVisible = true;
|
|
||||||
modelStore.params.sttp = 'ENG';
|
|
||||||
modelStore.title = '三峡 ';
|
|
||||||
modelStore.isBasicEdit = true;
|
|
||||||
};
|
|
||||||
const showMapModal1 = () => {
|
|
||||||
modelStore.modalVisible = true;
|
|
||||||
modelStore.params.sttp = 'WT';
|
|
||||||
modelStore.title = '水温 ';
|
|
||||||
modelStore.isBasicEdit = true;
|
|
||||||
};
|
|
||||||
const showMapModal2 = () => {
|
|
||||||
modelStore.modalVisible = true;
|
|
||||||
modelStore.params.sttp = 'WQFB';
|
|
||||||
modelStore.title = '水质 ';
|
|
||||||
modelStore.isBasicEdit = true;
|
|
||||||
};
|
|
||||||
const showMapModal3 = () => {
|
|
||||||
modelStore.modalVisible = true;
|
|
||||||
modelStore.params.sttp = 'FH';
|
|
||||||
modelStore.title = '栖息地 ';
|
|
||||||
modelStore.isBasicEdit = true;
|
|
||||||
}; //
|
|
||||||
const showMapModal4 = () => {
|
|
||||||
modelStore.modalVisible = true;
|
|
||||||
modelStore.params.sttp = 'fh_zq_point';
|
|
||||||
modelStore.title = '栖息地流量 ';
|
|
||||||
modelStore.isBasicEdit = true;
|
|
||||||
};
|
|
||||||
const showMapModal5 = () => {
|
|
||||||
modelStore.modalVisible = true;
|
|
||||||
modelStore.params.sttp = 'fp_point';
|
|
||||||
modelStore.title = '过鱼设施 ';
|
|
||||||
modelStore.isBasicEdit = true;
|
|
||||||
};
|
|
||||||
const showMapModal6 = () => {
|
|
||||||
modelStore.modalVisible = true;
|
|
||||||
modelStore.params.sttp = 'FB';
|
|
||||||
modelStore.title = '鱼类增殖站 ';
|
|
||||||
modelStore.isBasicEdit = true;
|
|
||||||
};
|
|
||||||
//
|
|
||||||
const showMapModal7 = () => {
|
|
||||||
modelStore.modalVisible = true;
|
|
||||||
modelStore.params.sttp = 'VA';
|
|
||||||
modelStore.title = '动物救助站 ';
|
|
||||||
modelStore.isBasicEdit = true;
|
|
||||||
};
|
|
||||||
const showMapModal8 = () => {
|
|
||||||
modelStore.modalVisible = true;
|
|
||||||
modelStore.params.sttp = 'VP';
|
|
||||||
modelStore.title = '珍稀植物园 ';
|
|
||||||
modelStore.isBasicEdit = true;
|
|
||||||
};
|
|
||||||
const showMapModal9 = () => {
|
|
||||||
modelStore.modalVisible = true;
|
|
||||||
modelStore.params.sttp = 'WE';
|
|
||||||
modelStore.title = '水生生态调查断面 ';
|
|
||||||
modelStore.isBasicEdit = true;
|
|
||||||
};
|
|
||||||
const showMapModal10 = () => {
|
|
||||||
modelStore.modalVisible = true;
|
|
||||||
modelStore.params.sttp = 'WVA';
|
|
||||||
modelStore.title = '野生动物监测 ';
|
|
||||||
modelStore.isBasicEdit = true;
|
|
||||||
};
|
|
||||||
const showMapModal11 = () => {
|
|
||||||
modelStore.modalVisible = true;
|
|
||||||
modelStore.params.sttp = 'VD_FBFM';
|
|
||||||
modelStore.title = 'AI视频监控站 ';
|
|
||||||
modelStore.isBasicEdit = true;
|
|
||||||
};
|
|
||||||
const showMapModal12 = () => {
|
|
||||||
modelStore.modalVisible = true;
|
|
||||||
modelStore.params.sttp = 'eng_alarm_point';
|
|
||||||
modelStore.title = '水电站告警情况 ';
|
|
||||||
modelStore.isBasicEdit = true;
|
|
||||||
};
|
|
||||||
const showMapModal13 = () => {
|
|
||||||
modelStore.modalVisible = true;
|
|
||||||
modelStore.params.sttp = 'FPRD';
|
|
||||||
modelStore.title = '鱼类调查装置 ';
|
|
||||||
modelStore.isBasicEdit = true;
|
|
||||||
};
|
|
||||||
const showMapModal14 = () => {
|
|
||||||
modelStore.modalVisible = true;
|
|
||||||
modelStore.params.sttp = 'DW_2';
|
|
||||||
modelStore.title = '低温水减缓设施-叠梁门 ';
|
|
||||||
modelStore.isBasicEdit = true;
|
|
||||||
};
|
|
||||||
const showMapModal15 = () => {
|
|
||||||
modelStore.modalVisible = true;
|
|
||||||
modelStore.params.sttp = 'DW_5';
|
|
||||||
modelStore.title = '前置挡墙 ';
|
|
||||||
modelStore.isBasicEdit = true;
|
|
||||||
};
|
|
||||||
const showMapModal16 = () => {
|
|
||||||
modelStore.modalVisible = true;
|
|
||||||
modelStore.params.sttp = 'DW_6';
|
|
||||||
modelStore.title = '隔水幕墙 ';
|
|
||||||
modelStore.isBasicEdit = true;
|
|
||||||
};
|
|
||||||
const showMapModal17 = () => {
|
|
||||||
modelStore.modalVisible = true;
|
|
||||||
modelStore.params.sttp = 'DW_1';
|
|
||||||
modelStore.title = '夹岩双层取水 ';
|
|
||||||
modelStore.isBasicEdit = true;
|
|
||||||
};
|
|
||||||
//DW_5
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@ -144,25 +16,6 @@ const showMapModal17 = () => {
|
|||||||
</div>
|
</div>
|
||||||
<div class="rightContent">
|
<div class="rightContent">
|
||||||
<RightDrawer>
|
<RightDrawer>
|
||||||
<a-button @click="showMapModal">打开电站弹窗</a-button>
|
|
||||||
<a-button @click="showMapModal1">打开水温弹窗</a-button>
|
|
||||||
<!-- <a-button @click="showMapModal2">打开水质弹窗</a-button> -->
|
|
||||||
<!-- <a-button @click="showMapModal3">打开栖息地弹窗</a-button> -->
|
|
||||||
<a-button @click="showMapModal4">打开栖息地流量弹窗</a-button>
|
|
||||||
<!-- <a-button @click="showMapModal5">打开过鱼设施弹窗</a-button> -->
|
|
||||||
<!-- <a-button @click="showMapModal6">打开鱼类增殖站弹窗</a-button> -->
|
|
||||||
<!-- <a-button @click="showMapModal7">打开动物救助站弹窗</a-button> -->
|
|
||||||
<!-- <a-button @click="showMapModal8">打开珍稀植物园弹窗</a-button> -->
|
|
||||||
<!-- <a-button @click="showMapModal9">打开水生生态调查断面弹窗</a-button> -->
|
|
||||||
<a-button @click="showMapModal10">打开野生动物监测弹窗</a-button>
|
|
||||||
<!-- <a-button @click="showMapModal11">打开AI视频监控站弹窗</a-button> -->
|
|
||||||
<!-- <a-button @click="showMapModal12">打开水电站告警情况弹窗</a-button> -->
|
|
||||||
<!-- <a-button @click="showMapModal13">打开鱼类调查装置弹窗</a-button> -->
|
|
||||||
<!-- <a-button @click="showMapModal14">打开低温水减缓设施-叠梁门弹窗</a-button> -->
|
|
||||||
<!-- <a-button @click="showMapModal15">打开前置挡墙弹窗</a-button> -->
|
|
||||||
<!-- <a-button @click="showMapModal16">打开隔水幕墙弹窗</a-button> -->
|
|
||||||
<!-- <a-button @click="showMapModal17">打开夹岩双层取水弹窗</a-button> -->
|
|
||||||
|
|
||||||
<jidiInfoMod />
|
<jidiInfoMod />
|
||||||
<shuidianhuangjingjieruMod />
|
<shuidianhuangjingjieruMod />
|
||||||
</RightDrawer>
|
</RightDrawer>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user