From 4ad2014e6128a256414ab0a63462f00b676592ec Mon Sep 17 00:00:00 2001 From: lilin <18811154576@163.com> Date: Wed, 17 Jun 2026 11:42:49 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E5=9B=BE=E5=B1=82=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E5=9B=BE=E4=BE=8B=E7=AE=A1=E7=90=86=E4=BB=A3=E7=A0=81=E6=8F=90?= =?UTF-8?q?=E4=BA=A4=EF=BC=8C=E6=9F=A5=E8=AF=A2=20=E6=96=B0=E5=A2=9E=20?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=20=E5=88=A0=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../yfd/platform/config/SecurityConfig.java | 2 + .../yfd/platform/config/SwaggerConfig.java | 16 ++ .../controller/MapLayerController.java | 71 +++++ .../controller/MapLegendController.java | 102 +++++++ .../qgc_sys/mapLayer/domain/MsMaplayerB.java | 191 +++++++++++++ .../qgc_sys/mapLayer/domain/MsMaplegendB.java | 134 +++++++++ .../qgc_sys/mapLayer/domain/MsMapmoduleB.java | 95 +++++++ .../mapLayer/entity/vo/MapLayerAo.java | 15 + .../mapLayer/mapper/MsMaplayerBMapper.java | 14 + .../mapLayer/mapper/MsMaplegendBMapper.java | 14 + .../mapLayer/mapper/MsMapmoduleBMapper.java | 14 + .../mapLayer/service/IMapLayerBizService.java | 22 ++ .../mapLayer/service/IMapLayerService.java | 28 ++ .../mapLayer/service/IMapLegendService.java | 22 ++ .../service/impl/MapLayerBizServiceImpl.java | 165 +++++++++++ .../service/impl/MapLayerServiceImpl.java | 256 ++++++++++++++++++ .../service/impl/MapLegendServiceImpl.java | 97 +++++++ .../controller/MapmoduleBController.java | 101 +++++++ .../mapcfg/service/IMapmoduleBService.java | 36 +++ .../service/impl/MapmoduleBServiceImpl.java | 92 +++++++ 20 files changed, 1487 insertions(+) create mode 100644 backend/src/main/java/com/yfd/platform/qgc_sys/mapLayer/controller/MapLayerController.java create mode 100644 backend/src/main/java/com/yfd/platform/qgc_sys/mapLayer/controller/MapLegendController.java create mode 100644 backend/src/main/java/com/yfd/platform/qgc_sys/mapLayer/domain/MsMaplayerB.java create mode 100644 backend/src/main/java/com/yfd/platform/qgc_sys/mapLayer/domain/MsMaplegendB.java create mode 100644 backend/src/main/java/com/yfd/platform/qgc_sys/mapLayer/domain/MsMapmoduleB.java create mode 100644 backend/src/main/java/com/yfd/platform/qgc_sys/mapLayer/entity/vo/MapLayerAo.java create mode 100644 backend/src/main/java/com/yfd/platform/qgc_sys/mapLayer/mapper/MsMaplayerBMapper.java create mode 100644 backend/src/main/java/com/yfd/platform/qgc_sys/mapLayer/mapper/MsMaplegendBMapper.java create mode 100644 backend/src/main/java/com/yfd/platform/qgc_sys/mapLayer/mapper/MsMapmoduleBMapper.java create mode 100644 backend/src/main/java/com/yfd/platform/qgc_sys/mapLayer/service/IMapLayerBizService.java create mode 100644 backend/src/main/java/com/yfd/platform/qgc_sys/mapLayer/service/IMapLayerService.java create mode 100644 backend/src/main/java/com/yfd/platform/qgc_sys/mapLayer/service/IMapLegendService.java create mode 100644 backend/src/main/java/com/yfd/platform/qgc_sys/mapLayer/service/impl/MapLayerBizServiceImpl.java create mode 100644 backend/src/main/java/com/yfd/platform/qgc_sys/mapLayer/service/impl/MapLayerServiceImpl.java create mode 100644 backend/src/main/java/com/yfd/platform/qgc_sys/mapLayer/service/impl/MapLegendServiceImpl.java create mode 100644 backend/src/main/java/com/yfd/platform/qgc_sys/mapcfg/controller/MapmoduleBController.java create mode 100644 backend/src/main/java/com/yfd/platform/qgc_sys/mapcfg/service/IMapmoduleBService.java create mode 100644 backend/src/main/java/com/yfd/platform/qgc_sys/mapcfg/service/impl/MapmoduleBServiceImpl.java diff --git a/backend/src/main/java/com/yfd/platform/config/SecurityConfig.java b/backend/src/main/java/com/yfd/platform/config/SecurityConfig.java index 79a4e331..d0fca320 100644 --- a/backend/src/main/java/com/yfd/platform/config/SecurityConfig.java +++ b/backend/src/main/java/com/yfd/platform/config/SecurityConfig.java @@ -71,6 +71,8 @@ public class SecurityConfig { // .requestMatchers("/fp/**").permitAll() // .requestMatchers("/fh/**").permitAll() // .requestMatchers("/data/**").permitAll() + .requestMatchers("/mapLayer/**").permitAll() + .requestMatchers("/mapLegend/**").permitAll() .requestMatchers("/sms/**").permitAll() .requestMatchers(HttpMethod.GET, "/").permitAll() .requestMatchers(HttpMethod.GET, diff --git a/backend/src/main/java/com/yfd/platform/config/SwaggerConfig.java b/backend/src/main/java/com/yfd/platform/config/SwaggerConfig.java index 443e06a6..c07a6cf5 100644 --- a/backend/src/main/java/com/yfd/platform/config/SwaggerConfig.java +++ b/backend/src/main/java/com/yfd/platform/config/SwaggerConfig.java @@ -146,4 +146,20 @@ public class SwaggerConfig { .packagesToScan("com.yfd.platform.qgc_eng.eq.controller") .build(); } + + @Bean + public GroupedOpenApi groupSysApi() { + return GroupedOpenApi.builder() + .group("5. 图层管理") + .packagesToScan("com.yfd.platform.qgc_sys.mapLayer.controller") + .build(); + } + + @Bean + public GroupedOpenApi groupSysMlgApi() { + return GroupedOpenApi.builder() + .group("5.1 图例结构管理") + .packagesToScan("com.yfd.platform.qgc_sys.mapLegend.controller") + .build(); + } } \ No newline at end of file diff --git a/backend/src/main/java/com/yfd/platform/qgc_sys/mapLayer/controller/MapLayerController.java b/backend/src/main/java/com/yfd/platform/qgc_sys/mapLayer/controller/MapLayerController.java new file mode 100644 index 00000000..981346ce --- /dev/null +++ b/backend/src/main/java/com/yfd/platform/qgc_sys/mapLayer/controller/MapLayerController.java @@ -0,0 +1,71 @@ +package com.yfd.platform.qgc_sys.mapLayer.controller; + +import cn.hutool.core.util.StrUtil; +import com.yfd.platform.common.exception.BizException; +import com.yfd.platform.config.ResponseResult; +import com.yfd.platform.qgc_sys.mapLayer.domain.MsMaplayerB; +import com.yfd.platform.qgc_sys.mapLayer.entity.vo.MapLayerAo; +import com.yfd.platform.qgc_sys.mapLayer.service.IMapLayerBizService; +import com.yfd.platform.qgc_sys.mapLayer.service.IMapLayerService; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.annotation.Resource; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +/** + * 地图图层管理 + * + * @author migration + */ +@RestController +@RequestMapping("/mapLayer") +@Tag(name = "地图图层管理") +public class MapLayerController { + + @Resource + private IMapLayerBizService mapLayerBizService; + + @Resource + private IMapLayerService layerService; + + /** + * 地图图层管理图层树(所有) + */ + @Operation(summary = "地图图层管理图层树(所有)") + @PostMapping("/getAllMapLayerTree") + public ResponseResult getAllMapLayerTree(@RequestBody MapLayerAo flag) { + List tree = mapLayerBizService.getMapLayerTree(flag); + return ResponseResult.successData(tree); + } + + /** + * 图层新增修改 + */ + @Operation(summary = "图层新增修改") + @PostMapping("/save") + public ResponseResult addLayer(@RequestBody MsMaplayerB layer) { + if (layer == null) { + return ResponseResult.error("图层信息不能为空."); + } + if (StrUtil.isBlank(layer.getCode())) { + throw new BizException("图层编码(code)不能为空."); + } + if (StrUtil.isBlank(layer.getTitle())) { + throw new BizException("图层名称(title)不能为空."); + } + layerService.saveOrUpdate(layer); + return ResponseResult.success("保存成功."); + } + + /** + * 图层删除 + */ + @Operation(summary = "图层删除") + @PostMapping("/delete") + public ResponseResult deleteLayer(@RequestBody List ids) { + layerService.delelteByIds(ids); + return ResponseResult.success("删除成功."); + } +} \ No newline at end of file diff --git a/backend/src/main/java/com/yfd/platform/qgc_sys/mapLayer/controller/MapLegendController.java b/backend/src/main/java/com/yfd/platform/qgc_sys/mapLayer/controller/MapLegendController.java new file mode 100644 index 00000000..f038b8e7 --- /dev/null +++ b/backend/src/main/java/com/yfd/platform/qgc_sys/mapLayer/controller/MapLegendController.java @@ -0,0 +1,102 @@ +package com.yfd.platform.qgc_sys.mapLayer.controller; + + +import cn.hutool.core.collection.CollectionUtil; +import cn.hutool.core.util.StrUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.yfd.platform.common.DataSourceRequest; +import com.yfd.platform.common.DataSourceResult; +import com.yfd.platform.common.exception.BizException; +import com.yfd.platform.config.ResponseResult; +import com.yfd.platform.qgc_sys.mapLayer.domain.MsMaplegendB; +import com.yfd.platform.qgc_sys.mapLayer.service.IMapLegendService; +import com.yfd.platform.utils.DataSourceRequestUtil; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.annotation.Resource; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +/** + * 地图图例管理 + * + * @author migration + */ +@RestController +@RequestMapping("/mapLegend") +@Tag(name = "地图图例管理") +public class MapLegendController { + + @Resource + private IMapLegendService mapLegendService; + + /** + * 条件过滤数据列表(Kendo UI 数据源) + */ + @Operation(summary = "条件过滤数据列表") + @PostMapping("/GetKendoList") + public ResponseResult getKendoList(@RequestBody DataSourceRequest dataSourceRequest) { + // 构建查询条件 + QueryWrapper wrapper = DataSourceRequestUtil.buildQueryWrapper( + dataSourceRequest, MsMaplegendB.class); + + // 执行分页查询 + Page page = DataSourceRequestUtil.getPage(dataSourceRequest); + Page resultPage; + if (page != null) { + resultPage = mapLegendService.page(page, wrapper); + } else { + List list = mapLegendService.list(wrapper); + resultPage = new Page<>(); + resultPage.setRecords(list); + resultPage.setTotal(list.size()); + } + + // 构建 Kendo 数据源结果 + DataSourceResult dataSourceResult = new DataSourceResult<>(); + dataSourceResult.setData(resultPage.getRecords()); + dataSourceResult.setTotal(resultPage.getTotal()); + + return ResponseResult.successData(dataSourceResult); + } + + /** + * 图例新增修改 + */ + @Operation(summary = "图例新增修改") + @PostMapping("/save") + public ResponseResult addLayer(@RequestBody MsMaplegendB legend) { + if (legend == null) { + return ResponseResult.error("图例信息不能为空."); + } + if (StrUtil.isBlank(legend.getCode())) { + throw new BizException("图例类型(code: pointLayer=用于锚点,baseLayer=地图GIS)不能为空."); + } + if (StrUtil.isBlank(legend.getName())) { + throw new BizException("图例名称(name)不能为空."); + } + if (StrUtil.isBlank(legend.getNameEn())) { + throw new BizException("图例编码(nameEn)不能为空."); + } + if (legend.getDataType() == null) { + throw new BizException("图例数据类型(dataType: 1=结构,2=数据)不能为空."); + } + if (legend.getDataType() == 2 && StrUtil.isBlank(legend.getLayerCode())) { + throw new BizException("关联的图层编码(layerCode)不能为空."); + } + mapLegendService.saveOrUpdate(legend); + return ResponseResult.success("保存成功."); + } + + /** + * 图例删除 + */ + @Operation(summary = "图例删除") + @PostMapping("/delete") + public ResponseResult deleteLayer(@RequestBody List ids) { + mapLegendService.delelteByIds(ids); + return ResponseResult.success("删除成功."); + } +} diff --git a/backend/src/main/java/com/yfd/platform/qgc_sys/mapLayer/domain/MsMaplayerB.java b/backend/src/main/java/com/yfd/platform/qgc_sys/mapLayer/domain/MsMaplayerB.java new file mode 100644 index 00000000..25904a0b --- /dev/null +++ b/backend/src/main/java/com/yfd/platform/qgc_sys/mapLayer/domain/MsMaplayerB.java @@ -0,0 +1,191 @@ +package com.yfd.platform.qgc_sys.mapLayer.domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; +import java.util.List; + +/** + * 地图图层表 + * + * @author migration + */ +@Data +@TableName("MS_MAPLAYER_B") +public class MsMaplayerB implements Serializable { + + private static final long serialVersionUID = 1L; + + @TableId(type = IdType.ASSIGN_UUID) + private String id; + + /** 类型 */ + @TableField("TYPE") + private String type; + + /** 标识字段 */ + @TableField("KEY") + private String key; + + /** 编码 */ + @TableField("CODE") + private String code; + + /** 名称 */ + @TableField("TITLE") + private String title; + + /** 名称英文 */ + @TableField("TITLE_EN") + private String titleEn; + + /** 所属父节点 */ + @TableField("PARENT_ID") + private String parentId; + + /** 树全路径 */ + @TableField("FULL_PATH") + private String fullPath; + + /** 层级 */ + @TableField("TREE_LEVEL") + private Integer treeLevel; + + /** 是否有子集:0=否 1=有 */ + @TableField("HAS_CHILDREN") + private Integer hasChildren; + + /** 对应锚点接口 */ + @TableField("URL") + private String url; + + /** 对应三维锚点接口 */ + @TableField("URL_THD") + private String urlThd; + + /** 参数设置 */ + @TableField("OPTIONS") + private String options; + + /** 访问令牌 */ + @TableField("TOKEN") + private String token; + + /** 用户名 */ + @TableField("USERNAME") + private String username; + + /** 密码 */ + @TableField("PASSWORD") + private String password; + + /** 地图中心点经度 */ + @TableField("CENTER_LGTD") + private BigDecimal centerLgtd; + + /** 地图中心点纬度 */ + @TableField("CENTER_LTTD") + private BigDecimal centerLttd; + + /** 默认缩放级别 */ + @TableField("DEFAULT_ZOOM") + private String defaultZoom; + + /** 所属国家 */ + @TableField("COUNTRY") + private String country; + + /** 图标 */ + @TableField("ICON") + private String icon; + + /** 是否可选择:0=否 1=是 */ + @TableField("CHECKABLE") + private Integer checkable; + + /** 图层上下层层级关系 */ + @TableField("Z_INDEX") + private String zIndex; + + /** 各类站点图层对应类型 */ + @TableField("STTP_TYPE") + private String sttpType; + + /** 图层展示数据格式 */ + @TableField("LAYERS") + private String layers; + + /** 图层透明度 */ + @TableField("OPACITY") + private BigDecimal opacity; + + /** 额外参数 */ + @TableField("PARAMJSON") + private String paramJson; + + /** 备注 */ + @TableField("DESCRIPTION") + private String description; + + /** 是否启用:0=禁用 1=启用 */ + @TableField("ENABLE") + private Integer enable; + + /** 排序 */ + @TableField("ORDER_INDEX") + private Integer orderIndex; + + /** 过滤内容 */ + @TableField("FILTER_CONTENT") + private String filterContent; + + /** 创建人 */ + @TableField("RECORD_USER") + private String recordUser; + + /** 创建时间 */ + @TableField("RECORD_TIME") + private Date recordTime; + + /** 更新人 */ + @TableField("MODIFY_USER") + private String modifyUser; + + /** 更新时间 */ + @TableField("MODIFY_TIME") + private Date modifyTime; + + /** 是否已删除:0=未删除 1=已删除 */ + @TableField("IS_DELETED") + private Integer isDeleted; + + /** 删除人 */ + @TableField("DELETE_USER") + private String deleteUser; + + /** 删除时间 */ + @TableField("DELETE_TIME") + private Date deleteTime; + + /** 数据类型:1=结构,2=数据 */ + @TableField("DATA_TYPE") + private Integer dataType; + + /** 标签层级 */ + @TableField("LABEL_LEVEL") + private Integer labelLevel; + + /** 子级集合(非数据库字段) */ + @TableField(exist = false) + private List children; + + /** 创建人名称(非数据库字段) */ + @TableField(exist = false) + private String displayRecordUser; +} \ No newline at end of file diff --git a/backend/src/main/java/com/yfd/platform/qgc_sys/mapLayer/domain/MsMaplegendB.java b/backend/src/main/java/com/yfd/platform/qgc_sys/mapLayer/domain/MsMaplegendB.java new file mode 100644 index 00000000..6147f6c3 --- /dev/null +++ b/backend/src/main/java/com/yfd/platform/qgc_sys/mapLayer/domain/MsMaplegendB.java @@ -0,0 +1,134 @@ +package com.yfd.platform.qgc_sys.mapLayer.domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +/** + * 地图图例表 + * + * @author migration + */ +@Data +@TableName("MS_MAPLEGEND_B") +public class MsMaplegendB implements Serializable { + + private static final long serialVersionUID = 1L; + + @TableId(type = IdType.ASSIGN_UUID) + private String id; + + @TableField("NAME") + private String name; + + @TableField("NAME_EN") + private String nameEn; + + @TableField("CODE") + private String code; + + @TableField("ICON") + private String icon; + + @TableField("GROUP_NAME") + private String groupName; + + @TableField("PARENT_NAME") + private String parentName; + + @TableField("LAYER_CODE") + private String layerCode; + + @TableField("MIN_ZOOM") + private Integer minZoom; + + @TableField("MAX_ZOOM") + private Integer maxZoom; + + @TableField("MIN_HEIGHT_THD") + private BigDecimal minHeightThd; + + @TableField("MAX_HEIGHT_THD") + private BigDecimal maxHeightThd; + + @TableField("DESCRIPTION") + private String description; + + @TableField("ENABLE") + private Integer enable; + + @TableField("INTERNAL") + private Integer internal; + + @TableField("ORDER_INDEX") + private Integer orderIndex; + + @TableField("FILTER_CONTENT") + private String filterContent; + + @TableField("RECORD_USER") + private String recordUser; + + @TableField("RECORD_TIME") + private Date recordTime; + + @TableField("MODIFY_USER") + private String modifyUser; + + @TableField("MODIFY_TIME") + private Date modifyTime; + + @TableField("IS_DELETED") + private Integer isDeleted; + + @TableField("DELETE_USER") + private String deleteUser; + + @TableField("DELETE_TIME") + private Date deleteTime; + + @TableField("IF_SHOW") + private Integer ifShow; + + @TableField("EXPRESSION") + private String expression; + + @TableField("EXT") + private String ext; + + @TableField("DATA_TYPE") + private Integer dataType; + + @TableField("PARENT_ID") + private String parentId; + + @TableField("FULL_PATH") + private String fullPath; + + @TableField("TREE_LEVEL") + private Integer treeLevel; + + @TableField("HAS_CHILDREN") + private Integer hasChildren; + + @TableField("COLOR") + private String color; + + @TableField("SHAPE") + private String shape; + + @TableField("MIN_VAL") + private BigDecimal minVal; + + @TableField("MAX_VAL") + private BigDecimal maxVal; + + @TableField("IS_FILTER") + private Integer isFilter; +} \ No newline at end of file diff --git a/backend/src/main/java/com/yfd/platform/qgc_sys/mapLayer/domain/MsMapmoduleB.java b/backend/src/main/java/com/yfd/platform/qgc_sys/mapLayer/domain/MsMapmoduleB.java new file mode 100644 index 00000000..aac57f40 --- /dev/null +++ b/backend/src/main/java/com/yfd/platform/qgc_sys/mapLayer/domain/MsMapmoduleB.java @@ -0,0 +1,95 @@ +package com.yfd.platform.qgc_sys.mapLayer.domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 地图与菜单映射表 + * + * @author migration + */ +@Data +@TableName("MS_MAPMODULE_B") +public class MsMapmoduleB implements Serializable { + + private static final long serialVersionUID = 1L; + + @TableId(type = IdType.ASSIGN_UUID) + private String id; + + @TableField("MODULE_ID") + private String moduleId; + + @TableField("RES_TYPE") + private String resType; + + @TableField("RES_ID") + private String resId; + + @TableField("CHILD_NODE") + private Integer childNode; + + @TableField("MULTI_SELECT") + private Integer multiSelect; + + @TableField("CAN_BE_CHECKED") + private Integer canBeChecked; + + @TableField("CHECKED") + private Integer checked; + + @TableField("DESCRIPTION") + private String description; + + @TableField("ENABLE") + private Integer enable; + + @TableField("ORDER_INDEX") + private Integer orderIndex; + + @TableField("FILTER_CONTENT") + private String filterContent; + + @TableField("RECORD_USER") + private String recordUser; + + @TableField("RECORD_TIME") + private Date recordTime; + + @TableField("MODIFY_USER") + private String modifyUser; + + @TableField("MODIFY_TIME") + private Date modifyTime; + + @TableField("IS_DELETED") + private Integer isDeleted; + + @TableField("DELETE_USER") + private String deleteUser; + + @TableField("DELETE_TIME") + private Date deleteTime; + + @TableField("TEMPLATE_ID") + private String templateId; + + /** + * 归属的系统ID(非数据库字段,用于字典翻译) + */ + @TableField(exist = false) + private String systemId; + + /** + * 菜单名称(非数据库字段,用于字典翻译) + */ + @TableField(exist = false) + private String moduleName; + +} \ No newline at end of file diff --git a/backend/src/main/java/com/yfd/platform/qgc_sys/mapLayer/entity/vo/MapLayerAo.java b/backend/src/main/java/com/yfd/platform/qgc_sys/mapLayer/entity/vo/MapLayerAo.java new file mode 100644 index 00000000..9d8e38ae --- /dev/null +++ b/backend/src/main/java/com/yfd/platform/qgc_sys/mapLayer/entity/vo/MapLayerAo.java @@ -0,0 +1,15 @@ +package com.yfd.platform.qgc_sys.mapLayer.entity.vo; + +import lombok.Data; + +/** + * 地图图层查询参数 + * + * @author migration + */ +@Data +public class MapLayerAo { + + /** 图层名称(模糊查询) */ + private String title; +} \ No newline at end of file diff --git a/backend/src/main/java/com/yfd/platform/qgc_sys/mapLayer/mapper/MsMaplayerBMapper.java b/backend/src/main/java/com/yfd/platform/qgc_sys/mapLayer/mapper/MsMaplayerBMapper.java new file mode 100644 index 00000000..50a275ec --- /dev/null +++ b/backend/src/main/java/com/yfd/platform/qgc_sys/mapLayer/mapper/MsMaplayerBMapper.java @@ -0,0 +1,14 @@ +package com.yfd.platform.qgc_sys.mapLayer.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.yfd.platform.qgc_sys.mapLayer.domain.MsMaplayerB; +import org.apache.ibatis.annotations.Mapper; + +/** + * 地图图层表 Mapper 接口 + * + * @author migration + */ +@Mapper +public interface MsMaplayerBMapper extends BaseMapper { +} \ No newline at end of file diff --git a/backend/src/main/java/com/yfd/platform/qgc_sys/mapLayer/mapper/MsMaplegendBMapper.java b/backend/src/main/java/com/yfd/platform/qgc_sys/mapLayer/mapper/MsMaplegendBMapper.java new file mode 100644 index 00000000..d6df58bc --- /dev/null +++ b/backend/src/main/java/com/yfd/platform/qgc_sys/mapLayer/mapper/MsMaplegendBMapper.java @@ -0,0 +1,14 @@ +package com.yfd.platform.qgc_sys.mapLayer.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.yfd.platform.qgc_sys.mapLayer.domain.MsMaplegendB; +import org.apache.ibatis.annotations.Mapper; + +/** + * 地图图例表 Mapper 接口 + * + * @author migration + */ +@Mapper +public interface MsMaplegendBMapper extends BaseMapper { +} \ No newline at end of file diff --git a/backend/src/main/java/com/yfd/platform/qgc_sys/mapLayer/mapper/MsMapmoduleBMapper.java b/backend/src/main/java/com/yfd/platform/qgc_sys/mapLayer/mapper/MsMapmoduleBMapper.java new file mode 100644 index 00000000..774e4c00 --- /dev/null +++ b/backend/src/main/java/com/yfd/platform/qgc_sys/mapLayer/mapper/MsMapmoduleBMapper.java @@ -0,0 +1,14 @@ +package com.yfd.platform.qgc_sys.mapLayer.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.yfd.platform.qgc_sys.mapLayer.domain.MsMapmoduleB; +import org.apache.ibatis.annotations.Mapper; + +/** + * 地图与菜单映射表 Mapper 接口 + * + * @author migration + */ +@Mapper +public interface MsMapmoduleBMapper extends BaseMapper { +} \ No newline at end of file diff --git a/backend/src/main/java/com/yfd/platform/qgc_sys/mapLayer/service/IMapLayerBizService.java b/backend/src/main/java/com/yfd/platform/qgc_sys/mapLayer/service/IMapLayerBizService.java new file mode 100644 index 00000000..f0933a77 --- /dev/null +++ b/backend/src/main/java/com/yfd/platform/qgc_sys/mapLayer/service/IMapLayerBizService.java @@ -0,0 +1,22 @@ +package com.yfd.platform.qgc_sys.mapLayer.service; + +import com.yfd.platform.qgc_sys.mapLayer.domain.MsMaplayerB; +import com.yfd.platform.qgc_sys.mapLayer.entity.vo.MapLayerAo; + +import java.util.List; + +/** + * 地图图层业务服务接口 + * + * @author migration + */ +public interface IMapLayerBizService { + + /** + * 获取所有地图图层树 + * + * @param flag 查询参数 + * @return 图层树列表 + */ + List getMapLayerTree(MapLayerAo flag); +} \ No newline at end of file diff --git a/backend/src/main/java/com/yfd/platform/qgc_sys/mapLayer/service/IMapLayerService.java b/backend/src/main/java/com/yfd/platform/qgc_sys/mapLayer/service/IMapLayerService.java new file mode 100644 index 00000000..7aff13e5 --- /dev/null +++ b/backend/src/main/java/com/yfd/platform/qgc_sys/mapLayer/service/IMapLayerService.java @@ -0,0 +1,28 @@ +package com.yfd.platform.qgc_sys.mapLayer.service; + +import com.yfd.platform.qgc_sys.mapLayer.domain.MsMaplayerB; + +import java.util.List; + +/** + * 地图图层基础服务接口 + * + * @author migration + */ +public interface IMapLayerService { + + /** + * 新增或修改图层 + * + * @param layer 图层实体 + * @return 是否成功 + */ + boolean saveOrUpdate(MsMaplayerB layer); + + /** + * 根据ID列表删除图层 + * + * @param ids 图层ID列表 + */ + void delelteByIds(List ids); +} \ No newline at end of file diff --git a/backend/src/main/java/com/yfd/platform/qgc_sys/mapLayer/service/IMapLegendService.java b/backend/src/main/java/com/yfd/platform/qgc_sys/mapLayer/service/IMapLegendService.java new file mode 100644 index 00000000..273398ae --- /dev/null +++ b/backend/src/main/java/com/yfd/platform/qgc_sys/mapLayer/service/IMapLegendService.java @@ -0,0 +1,22 @@ +package com.yfd.platform.qgc_sys.mapLayer.service; + + +import com.baomidou.mybatisplus.extension.service.IService; +import com.yfd.platform.qgc_sys.mapLayer.domain.MsMaplegendB; + +import java.util.List; + +/** + * 地图图例基础服务接口 + * + * @author migration + */ +public interface IMapLegendService extends IService { + + /** + * 根据ID列表删除图例 + * + * @param ids 图例ID列表 + */ + void delelteByIds(List ids); +} \ No newline at end of file diff --git a/backend/src/main/java/com/yfd/platform/qgc_sys/mapLayer/service/impl/MapLayerBizServiceImpl.java b/backend/src/main/java/com/yfd/platform/qgc_sys/mapLayer/service/impl/MapLayerBizServiceImpl.java new file mode 100644 index 00000000..4ba92e0a --- /dev/null +++ b/backend/src/main/java/com/yfd/platform/qgc_sys/mapLayer/service/impl/MapLayerBizServiceImpl.java @@ -0,0 +1,165 @@ +package com.yfd.platform.qgc_sys.mapLayer.service.impl; + +import cn.hutool.core.util.StrUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.yfd.platform.qgc_sys.mapLayer.domain.MsMaplayerB; +import com.yfd.platform.qgc_sys.mapLayer.entity.vo.MapLayerAo; +import com.yfd.platform.qgc_sys.mapLayer.mapper.MsMaplayerBMapper; +import com.yfd.platform.qgc_sys.mapLayer.service.IMapLayerBizService; +import com.yfd.platform.system.domain.SysDictionary; +import com.yfd.platform.system.domain.SysDictionaryItems; +import com.yfd.platform.system.domain.SysUser; +import com.yfd.platform.system.mapper.SysDictionaryItemsMapper; +import com.yfd.platform.system.mapper.SysDictionaryMapper; +import com.yfd.platform.system.mapper.SysUserMapper; +import jakarta.annotation.Resource; +import org.springframework.stereotype.Service; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * 地图图层业务服务实现 + * + * @author migration + */ +@Service +public class MapLayerBizServiceImpl implements IMapLayerBizService { + + @Resource + private MsMaplayerBMapper msMaplayerBMapper; + + @Resource + private SysDictionaryMapper sysDictionaryMapper; + + @Resource + private SysDictionaryItemsMapper sysDictionaryItemsMapper; + + @Resource + private SysUserMapper sysUserMapper; + + @Override + public List getMapLayerTree(MapLayerAo flag) { + // 1. 查询字典 "DTZJLX" 获取需要排除的图层类型 + Set excludeTypes = getExcludeTypes(); + + // 2. 查询所有未删除的图层数据,排除特殊类型,支持按名称模糊查询 + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(MsMaplayerB::getIsDeleted, 0); + + // 排除特殊类型 + if (!excludeTypes.isEmpty()) { + wrapper.and(w -> w.notIn(MsMaplayerB::getType, excludeTypes).or().isNull(MsMaplayerB::getType)); + } + + // 按名称模糊查询 + if (StrUtil.isNotBlank(flag.getTitle())) { + wrapper.like(MsMaplayerB::getTitle, flag.getTitle()); + } + + List mapLayers = msMaplayerBMapper.selectList(wrapper); + + // 3. 当按名称过滤时,补充缺失的父级节点 + if (StrUtil.isNotBlank(flag.getTitle()) && !mapLayers.isEmpty()) { + Set hasKeys = mapLayers.stream() + .filter(it -> StrUtil.isNotBlank(it.getKey())) + .map(MsMaplayerB::getKey) + .collect(Collectors.toSet()); + + Set idList = new HashSet<>(); + for (MsMaplayerB layer : mapLayers) { + if (StrUtil.isNotBlank(layer.getFullPath()) && StrUtil.isNotBlank(layer.getKey())) { + String[] ids = layer.getFullPath().replace(layer.getKey() + ",", "").split(","); + for (String id : ids) { + if (StrUtil.isNotBlank(id) && !hasKeys.contains(id)) { + idList.add(id); + } + } + } + } + + if (!idList.isEmpty()) { + LambdaQueryWrapper parentWrapper = new LambdaQueryWrapper<>(); + parentWrapper.eq(MsMaplayerB::getIsDeleted, 0) + .in(MsMaplayerB::getKey, idList); + List parentLayers = msMaplayerBMapper.selectList(parentWrapper); + if (!parentLayers.isEmpty()) { + mapLayers.addAll(parentLayers); + } + } + } + + // 4. 填充创建人名称 + if (!mapLayers.isEmpty()) { + LambdaQueryWrapper userWrapper = new LambdaQueryWrapper<>(); + List users = sysUserMapper.selectList(userWrapper); + Map userMap = users.stream() + .collect(Collectors.toMap(SysUser::getId, SysUser::getNickname, (v1, v2) -> v1)); + + for (MsMaplayerB layer : mapLayers) { + if (StrUtil.isNotBlank(layer.getRecordUser())) { + layer.setDisplayRecordUser(userMap.get(layer.getRecordUser())); + } + } + } + + // 5. 构建树结构:取第一级 + List parents = mapLayers.stream() + .filter(p -> StrUtil.isBlank(p.getParentId())) + .sorted(Comparator.comparing(MsMaplayerB::getRecordTime, Comparator.nullsLast(Comparator.reverseOrder()))) + .collect(Collectors.toList()); + + // 通过父级id分组子节点 + Map> childrenMap = mapLayers.stream() + .filter(p -> StrUtil.isNotBlank(p.getParentId())) + .collect(Collectors.groupingBy(MsMaplayerB::getParentId)); + + // 递归构建树 + convertTree(parents, childrenMap); + + return parents; + } + + /** + * 查询字典 "DTZJLX" 中需要排除的图层类型值 + */ + private Set getExcludeTypes() { + Set excludeTypes = new HashSet<>(); + try { + LambdaQueryWrapper dictWrapper = new LambdaQueryWrapper<>(); + dictWrapper.eq(SysDictionary::getDictCode, "DTZJLX"); + SysDictionary dictionary = sysDictionaryMapper.selectOne(dictWrapper); + if (dictionary != null) { + LambdaQueryWrapper itemWrapper = new LambdaQueryWrapper<>(); + itemWrapper.eq(SysDictionaryItems::getDictId, dictionary.getId()); + List items = sysDictionaryItemsMapper.selectList(itemWrapper); + if (items != null) { + excludeTypes = items.stream() + .map(SysDictionaryItems::getDictName) + .filter(StrUtil::isNotBlank) + .collect(Collectors.toSet()); + } + } + } catch (Exception e) { + // 字典查询失败时不中断主流程 + } + return excludeTypes; + } + + /** + * 递归转换图层数据为树结构 + */ + private void convertTree(List parents, Map> childrenMap) { + if (parents == null || parents.isEmpty()) { + return; + } + for (MsMaplayerB parent : parents) { + String id = parent.getId(); + List children = childrenMap.get(id); + if (children != null && !children.isEmpty()) { + parent.setChildren(children); + convertTree(children, childrenMap); + } + } + } +} \ No newline at end of file diff --git a/backend/src/main/java/com/yfd/platform/qgc_sys/mapLayer/service/impl/MapLayerServiceImpl.java b/backend/src/main/java/com/yfd/platform/qgc_sys/mapLayer/service/impl/MapLayerServiceImpl.java new file mode 100644 index 00000000..fbe64e5b --- /dev/null +++ b/backend/src/main/java/com/yfd/platform/qgc_sys/mapLayer/service/impl/MapLayerServiceImpl.java @@ -0,0 +1,256 @@ +package com.yfd.platform.qgc_sys.mapLayer.service.impl; + +import cn.hutool.core.util.IdUtil; +import cn.hutool.core.util.StrUtil; +import cn.hutool.json.JSONUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.yfd.platform.common.exception.BizException; +import com.yfd.platform.qgc_sys.mapLayer.domain.MsMaplegendB; +import com.yfd.platform.qgc_sys.mapLayer.domain.MsMaplayerB; +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.MsMaplayerBMapper; +import com.yfd.platform.qgc_sys.mapLayer.mapper.MsMapmoduleBMapper; +import com.yfd.platform.qgc_sys.mapLayer.service.IMapLayerService; +import com.yfd.platform.utils.SecurityUtils; +import jakarta.annotation.Resource; +import org.springframework.stereotype.Service; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * 地图图层基础服务实现 + * + * @author migration + */ +@Service +public class MapLayerServiceImpl implements IMapLayerService { + + @Resource + private MsMaplayerBMapper msMaplayerBMapper; + + @Resource + private MsMaplegendBMapper msMaplegendBMapper; + + @Resource + private MsMapmoduleBMapper msMapmoduleBMapper; + + @Override + public boolean saveOrUpdate(MsMaplayerB layer) { + // 校验编码唯一性 + if (hasSameCode(layer)) { + throw new BizException("存在相同编码的数据"); + } + + // 当type等于SLDT/DXDT/YXDT,校验地图json格式 + String paramJson = layer.getParamJson(); + String type = layer.getType(); + if (("SLDT".equals(type) || "DXDT".equals(type) || "YXDT".equals(type)) + && StrUtil.isNotBlank(paramJson)) { + try { + JSONUtil.toBean(paramJson, HashMap.class); + } catch (Exception e) { + throw new BizException("请检查地图json格式"); + } + } + + if (StrUtil.isNotBlank(layer.getId())) { + // 修改 + msMaplayerBMapper.updateById(layer); + + // 判断是否启用且有子级,则子数据都要设置为启用状态 + if (layer.getEnable() != null && layer.getEnable() == 1 + && layer.getHasChildren() != null && layer.getHasChildren() == 1) { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(MsMaplayerB::getIsDeleted, 0) + .like(MsMaplayerB::getFullPath, layer.getId() + ","); + List children = msMaplayerBMapper.selectList(wrapper); + for (MsMaplayerB child : children) { + MsMaplayerB temp = new MsMaplayerB(); + temp.setId(child.getId()); + temp.setEnable(1); + msMaplayerBMapper.updateById(temp); + } + } + } else { + // 新增 + String id = IdUtil.fastSimpleUUID(); + layer.setId(id); + + // 获取同级子节点,计算最大排序号 + List subList = getSubList(layer.getParentId()); + Integer maxOrderIndex = getMaxOrderIndex(subList); + layer.setOrderIndex(maxOrderIndex + 1); + + MsMaplayerB parentLayer = null; + if (StrUtil.isNotBlank(layer.getParentId())) { + // 获取父级信息 + parentLayer = msMaplayerBMapper.selectById(layer.getParentId()); + if (parentLayer == null) { + throw new BizException("获取父级图层信息失败.请检查父级图层(parentId)是否存在."); + } + // 设置key + layer.setKey(parentLayer.getKey() + "-" + layer.getOrderIndex()); + // 设置fullPath + layer.setFullPath(parentLayer.getFullPath() + layer.getKey() + ","); + // 设置treeLevel + layer.setTreeLevel(parentLayer.getTreeLevel() + 1); + // 设置hasChildren + layer.setHasChildren(0); + } else { + // 无父级,则为创建的顶级图层 + layer.setTreeLevel(1); + layer.setKey("0-" + layer.getOrderIndex()); + layer.setFullPath(layer.getKey() + ","); + layer.setHasChildren(0); + } + + // 设置可选 + layer.setCheckable(0); + // 设置不可用 + layer.setEnable(0); + + String userId = getCurrentUserId(); + layer.setRecordUser(userId); + layer.setModifyUser(userId); + layer.setRecordTime(new Date()); + + msMaplayerBMapper.insert(layer); + + // 新增完成后,设置父级hasChildren为1 + if (parentLayer != null) { + MsMaplayerB temp = new MsMaplayerB(); + temp.setId(parentLayer.getId()); + temp.setHasChildren(1); + msMaplayerBMapper.updateById(temp); + } + } + return true; + } + + @Override + public void delelteByIds(List ids) { + if (ids == null || ids.isEmpty()) { + return; + } + for (String id : ids) { + // 根据id查询是否有子级数据 + MsMaplayerB layer = msMaplayerBMapper.selectById(id); + if (layer == null) { + continue; + } + + LambdaQueryWrapper childWrapper = new LambdaQueryWrapper<>(); + childWrapper.eq(MsMaplayerB::getParentId, id); + List children = msMaplayerBMapper.selectList(childWrapper); + if (!children.isEmpty()) { + throw new BizException("有子级图层,无法删除."); + } + + // 判断是否启用 + if (layer.getEnable() != null && layer.getEnable() == 1) { + throw new BizException("无法删除已启用的图层."); + } + + // 判断是否已经关联了图例 + QueryWrapper legendWrapper = new QueryWrapper<>(); + legendWrapper.eq("LAYER_CODE", layer.getCode()); + legendWrapper.eq("IS_DELETED", 0); + List legendList = msMaplegendBMapper.selectList(legendWrapper); + if (!legendList.isEmpty()) { + throw new BizException("图层关联了图例,无法删除."); + } + + // 判断父级是否存在 + if (StrUtil.isBlank(layer.getParentId())) { + // 逻辑删除 + msMaplayerBMapper.deleteById(id); + } else { + MsMaplayerB parent = msMaplayerBMapper.selectById(layer.getParentId()); + // 逻辑删除 + msMaplayerBMapper.deleteById(id); + + // 判断父级下是否只有一个子级,如果是当前图层,则设置父级hasChildren为0 + if (parent != null) { + LambdaQueryWrapper siblingWrapper = new LambdaQueryWrapper<>(); + siblingWrapper.eq(MsMaplayerB::getParentId, parent.getId()); + List siblings = msMaplayerBMapper.selectList(siblingWrapper); + if (siblings.size() == 1 && id.equals(siblings.get(0).getId())) { + MsMaplayerB temp = new MsMaplayerB(); + temp.setId(parent.getId()); + temp.setHasChildren(0); + msMaplayerBMapper.updateById(temp); + } + } + } + + // 判断是否关联菜单,删除关联 + QueryWrapper moduleWrapper = new QueryWrapper<>(); + moduleWrapper.eq("RES_TYPE", "layer"); + moduleWrapper.eq("IS_DELETED", 0); + moduleWrapper.eq("RES_ID", id); + List moduleList = msMapmoduleBMapper.selectList(moduleWrapper); + if (!moduleList.isEmpty()) { + Set moduleIds = moduleList.stream() + .map(MsMapmoduleB::getId) + .collect(Collectors.toSet()); + msMapmoduleBMapper.deleteBatchIds(moduleIds); + } + } + } + + /** + * 获取当前用户ID + */ + private String getCurrentUserId() { + try { + return SecurityUtils.getUserId(); + } catch (Exception e) { + return null; + } + } + + /** + * 根据父级编码查询子一级数据 + */ + private List getSubList(String parentId) { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + if (StrUtil.isNotBlank(parentId)) { + wrapper.eq(MsMaplayerB::getParentId, parentId); + } else { + wrapper.eq(MsMaplayerB::getTreeLevel, 1); + } + wrapper.orderByAsc(MsMaplayerB::getOrderIndex); + return msMaplayerBMapper.selectList(wrapper); + } + + /** + * 获取最大排序号 + */ + private Integer getMaxOrderIndex(List list) { + if (list.isEmpty()) { + return 0; + } + return list.stream() + .sorted(Comparator.comparing(MsMaplayerB::getOrderIndex, Comparator.nullsLast(Comparator.reverseOrder()))) + .collect(Collectors.toList()) + .get(0) + .getOrderIndex(); + } + + /** + * 判断同级下是否有编码一样的数据 + */ + private boolean hasSameCode(MsMaplayerB layer) { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(MsMaplayerB::getCode, layer.getCode()) + .eq(MsMaplayerB::getIsDeleted, 0); + List list = msMaplayerBMapper.selectList(wrapper); + if (list.isEmpty()) { + return false; + } + return !list.get(0).getId().equals(layer.getId()); + } +} \ No newline at end of file diff --git a/backend/src/main/java/com/yfd/platform/qgc_sys/mapLayer/service/impl/MapLegendServiceImpl.java b/backend/src/main/java/com/yfd/platform/qgc_sys/mapLayer/service/impl/MapLegendServiceImpl.java new file mode 100644 index 00000000..5152e819 --- /dev/null +++ b/backend/src/main/java/com/yfd/platform/qgc_sys/mapLayer/service/impl/MapLegendServiceImpl.java @@ -0,0 +1,97 @@ +package com.yfd.platform.qgc_sys.mapLayer.service.impl; + +import cn.hutool.core.collection.CollectionUtil; +import cn.hutool.core.util.StrUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.yfd.platform.common.exception.BizException; +import com.yfd.platform.qgc_sys.mapLayer.domain.MsMaplegendB; +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.MsMapmoduleBMapper; +import com.yfd.platform.qgc_sys.mapLayer.service.IMapLegendService; +import jakarta.annotation.Resource; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 地图图例基础服务实现 + * + * @author migration + */ +@Service +public class MapLegendServiceImpl extends ServiceImpl + implements IMapLegendService { + + @Resource + private MsMapmoduleBMapper msMapmoduleBMapper; + + @Override + public void delelteByIds(List ids) { + if (CollectionUtil.isEmpty(ids)) { + return; + } + for (String id : ids) { + // 根据id查询是否有数据或者子级数据 + MsMaplegendB legend = this.getById(id); + if (legend == null) { + continue; + } + + LambdaQueryWrapper childWrapper = new LambdaQueryWrapper<>(); + childWrapper.eq(MsMaplegendB::getParentId, id) + .eq(MsMaplegendB::getIsDeleted, 0); + List children = this.list(childWrapper); + if (!children.isEmpty()) { + throw new BizException("有子级图例,无法删除."); + } + + // 判断是否内置的数据 + if (legend.getInternal() != null && legend.getInternal() == 1) { + throw new BizException("无法删除系统内置的图例."); + } + + // 判断是否启用 + if (legend.getEnable() != null && legend.getEnable() == 1) { + throw new BizException("无法删除已启用的图例."); + } + + // 判断图例是否关联了菜单 + QueryWrapper moduleWrapper = new QueryWrapper<>(); + moduleWrapper.eq("IS_DELETED", 0); + moduleWrapper.eq("RES_TYPE", "legend"); + moduleWrapper.eq("RES_ID", id); + List moduleList = msMapmoduleBMapper.selectList(moduleWrapper); + if (!moduleList.isEmpty()) { + throw new BizException("无法删除:图例关联了菜单."); + } + + // 判断父级是否存在 + if (StrUtil.isBlank(legend.getParentId())) { + this.removeById(id); // 逻辑删除 + return; + } + + // 删除数据 + this.removeById(id); // 逻辑删除 + + if (StrUtil.isNotBlank(legend.getParentId())) { + // 判断父级下是否只有一个子级,如果只有一个子级并且是当前图例,则需要设置父级的hasChildren为0 + MsMaplegendB parent = this.getById(legend.getParentId()); + if (parent != null) { + LambdaQueryWrapper siblingWrapper = new LambdaQueryWrapper<>(); + siblingWrapper.eq(MsMaplegendB::getParentId, parent.getId()); + List siblings = this.list(siblingWrapper); + if (siblings.size() == 1 && id.equals(siblings.get(0).getId())) { + MsMaplegendB updateParent = new MsMaplegendB(); + updateParent.setId(parent.getId()); + updateParent.setHasChildren(0); + this.updateById(updateParent); + } + } + } + } + } +} \ No newline at end of file diff --git a/backend/src/main/java/com/yfd/platform/qgc_sys/mapcfg/controller/MapmoduleBController.java b/backend/src/main/java/com/yfd/platform/qgc_sys/mapcfg/controller/MapmoduleBController.java new file mode 100644 index 00000000..09204d83 --- /dev/null +++ b/backend/src/main/java/com/yfd/platform/qgc_sys/mapcfg/controller/MapmoduleBController.java @@ -0,0 +1,101 @@ +package com.yfd.platform.qgc_sys.mapcfg.controller; +import cn.hutool.core.util.StrUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.yfd.platform.common.DataSourceRequest; +import com.yfd.platform.common.DataSourceResult; +import com.yfd.platform.config.ResponseResult; +import com.yfd.platform.common.exception.BizException; +import com.yfd.platform.qgc_sys.mapLayer.domain.MsMapmoduleB; +import com.yfd.platform.qgc_sys.mapcfg.service.IMapmoduleBService; +import com.yfd.platform.utils.DataSourceRequestUtil; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.annotation.Resource; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +/** + * 地图菜单配置控制层 + * + * @author migration + */ +@RestController +@RequestMapping("/mapmodule") +@Tag(name = "地图菜单配置") +public class MapmoduleBController { + + @Resource + private IMapmoduleBService mapmoduleBService; + + /** + * 条件过滤数据列表(Kendo UI 数据源) + */ + @Operation(summary = "条件过滤数据列表") + @PostMapping("/GetKendoList") + public ResponseResult getKendoList(@RequestBody DataSourceRequest dataSourceRequest) { + // 构建查询条件 + QueryWrapper wrapper = DataSourceRequestUtil.buildQueryWrapper( + dataSourceRequest, MsMapmoduleB.class); + + // 执行分页查询 + Page page = DataSourceRequestUtil.getPage(dataSourceRequest); + Page resultPage; + if (page != null) { + resultPage = mapmoduleBService.page(page, wrapper); + } else { + List list = mapmoduleBService.list(wrapper); + resultPage = new Page<>(); + resultPage.setRecords(list); + resultPage.setTotal(list.size()); + } + + // 构建 Kendo 数据源结果 + DataSourceResult dataSourceResult = new DataSourceResult<>(); + List dataList = resultPage.getRecords(); + dataSourceResult.setData(dataList); + dataSourceResult.setTotal(resultPage.getTotal()); + + // 翻译字典值(菜单名称) + if (dataList != null && !dataList.isEmpty()) { + mapmoduleBService.translateDict(dataList); + } + + return ResponseResult.successData(dataSourceResult); + } + + /** + * 地图图例关联系统及菜单 + */ + @Operation(summary = "地图图例关联系统及菜单") + @PostMapping("/save") + public ResponseResult saveOrUpdate(@RequestBody MsMapmoduleB mapmoduleB) { + if (mapmoduleB == null) { + throw new BizException("对象不能为空."); + } + if (StrUtil.isBlank(mapmoduleB.getModuleId())) { + throw new BizException("关联菜单(moduleId)不能为空."); + } + if (StrUtil.isBlank(mapmoduleB.getSystemId())) { + throw new BizException("关联系统(systemId)不能为空."); + } + if (StrUtil.isBlank(mapmoduleB.getResType())) { + throw new BizException("资源类型(resType: layer=图层,legend=图例,mapbox=地图)不能为空"); + } + if (StrUtil.isBlank(mapmoduleB.getResId())) { + throw new BizException("资源(resId)不能为空."); + } + return ResponseResult.successData(mapmoduleBService.saveOrUpdate(mapmoduleB)); + } + + /** + * 图例与系统菜单关联关系删除 + */ + @Operation(summary = "图例与系统菜单关联关系删除") + @PostMapping("/delete") + public ResponseResult deleteData(@RequestBody List ids) { + mapmoduleBService.delelteByIds(ids); + return ResponseResult.success("删除成功."); + } +} \ No newline at end of file diff --git a/backend/src/main/java/com/yfd/platform/qgc_sys/mapcfg/service/IMapmoduleBService.java b/backend/src/main/java/com/yfd/platform/qgc_sys/mapcfg/service/IMapmoduleBService.java new file mode 100644 index 00000000..26c34a34 --- /dev/null +++ b/backend/src/main/java/com/yfd/platform/qgc_sys/mapcfg/service/IMapmoduleBService.java @@ -0,0 +1,36 @@ +package com.yfd.platform.qgc_sys.mapcfg.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.yfd.platform.qgc_sys.mapLayer.domain.MsMapmoduleB; + +import java.util.List; + +/** + * 地图菜单配置服务接口 + * + * @author migration + */ +public interface IMapmoduleBService extends IService { + + /** + * 新增或修改 + * + * @param entity 实体 + * @return 是否成功 + */ + boolean saveOrUpdate(MsMapmoduleB entity); + + /** + * 翻译字典值(菜单名称) + * + * @param list 数据列表 + */ + void translateDict(List list); + + /** + * 根据ID列表删除关联关系 + * + * @param ids ID列表 + */ + void delelteByIds(List ids); +} \ No newline at end of file diff --git a/backend/src/main/java/com/yfd/platform/qgc_sys/mapcfg/service/impl/MapmoduleBServiceImpl.java b/backend/src/main/java/com/yfd/platform/qgc_sys/mapcfg/service/impl/MapmoduleBServiceImpl.java new file mode 100644 index 00000000..d650bb50 --- /dev/null +++ b/backend/src/main/java/com/yfd/platform/qgc_sys/mapcfg/service/impl/MapmoduleBServiceImpl.java @@ -0,0 +1,92 @@ +package com.yfd.platform.qgc_sys.mapcfg.service.impl; + +import cn.hutool.core.util.StrUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.yfd.platform.qgc_sys.mapLayer.domain.MsMapmoduleB; +import com.yfd.platform.qgc_sys.mapLayer.mapper.MsMapmoduleBMapper; +import com.yfd.platform.qgc_sys.mapcfg.service.IMapmoduleBService; +import com.yfd.platform.system.domain.SysMenu; +import com.yfd.platform.system.mapper.SysMenuMapper; +import com.yfd.platform.utils.SecurityUtils; +import jakarta.annotation.Resource; +import org.springframework.stereotype.Service; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * 地图菜单配置服务实现类 + * + * @author migration + */ +@Service +public class MapmoduleBServiceImpl extends ServiceImpl + implements IMapmoduleBService { + + @Resource + private SysMenuMapper sysMenuMapper; + + + @Override + public boolean saveOrUpdate(MsMapmoduleB entity) { + if (StrUtil.isBlank(entity.getId())) { + // 新增 + entity.setRecordUser(SecurityUtils.getUserId()); + this.baseMapper.insert(entity); + } else { + // 修改 + this.baseMapper.updateById(entity); + } + return true; + } + + @Override + public void delelteByIds(List ids) { + if (ids != null) { + for (String id : ids) { + this.baseMapper.deleteById(id); + } + } + } + + @Override + public void translateDict(List list) { + if (list == null || list.isEmpty()) { + return; + } + // 收集所有 moduleId + List moduleIds = list.stream() + .filter(it -> StrUtil.isNotBlank(it.getModuleId())) + .map(MsMapmoduleB::getModuleId) + .distinct() + .collect(Collectors.toList()); + + if (moduleIds.isEmpty()) { + return; + } + + // 查询本地菜单表获取名称 + LambdaQueryWrapper menuWrapper = new LambdaQueryWrapper<>(); + menuWrapper.in(SysMenu::getId, moduleIds); + List menus = sysMenuMapper.selectList(menuWrapper); + + Map menuMap = new HashMap<>(); + menuMap.put("common", "通用菜单"); + for (SysMenu menu : menus) { + menuMap.put(menu.getId(), menu.getName()); + } + + // 设置菜单名称 + for (MsMapmoduleB item : list) { + if (StrUtil.isNotBlank(item.getModuleId())) { + String name = menuMap.get(item.getModuleId()); + if (name != null) { + item.setModuleName(name); + } + } + } + } +} \ No newline at end of file From 27cf1e504c161b547206e6dffd1ca0937e01b4de Mon Sep 17 00:00:00 2001 From: lilin <18811154576@163.com> Date: Wed, 1 Jul 2026 09:11:16 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E5=9B=BE=E4=BE=8B=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E4=BB=A3=E7=A0=81=E6=8F=90=E4=BA=A4=EF=BC=8C?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=20=E6=96=B0=E5=A2=9E=20=E4=BF=AE=E6=94=B9=20?= =?UTF-8?q?=E5=88=A0=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../yfd/platform/config/SecurityConfig.java | 1 + .../yfd/platform/config/SwaggerConfig.java | 4 +- .../controller/MapLayerController.java | 21 +- .../controller/MapLegendController.java | 99 +++++++++- .../qgc_sys/mapLayer/domain/MsMaplegendB.java | 6 + .../qgc_sys/mapLayer/domain/MsMapmoduleB.java | 5 +- .../mapLayer/domain/MsMaptoolboxB.java | 186 ++++++++++++++++++ .../mapLayer/entity/vo/MapLayerVo.java | 80 ++++++++ .../mapLayer/entity/vo/MapLegendVo.java | 97 +++++++++ .../mapLayer/mapper/MsMapmoduleBMapper.java | 76 +++++++ .../mapLayer/mapper/MsMaptoolboxBMapper.java | 15 ++ .../mapLayer/service/IMapLayerBizService.java | 12 ++ .../service/IMapLegendBizService.java | 33 ++++ .../service/impl/MapLayerBizServiceImpl.java | 49 +++++ .../service/impl/MapLegendBizServiceImpl.java | 145 ++++++++++++++ .../controller/MapmoduleBController.java | 69 ++++++- .../qgc_sys/mapcfg/entity/MapmoduleVo.java | 47 +++++ .../mapcfg/service/IMapmoduleBService.java | 9 + .../service/impl/MapmoduleBServiceImpl.java | 91 +++++++++ 19 files changed, 1038 insertions(+), 7 deletions(-) create mode 100644 backend/src/main/java/com/yfd/platform/qgc_sys/mapLayer/domain/MsMaptoolboxB.java create mode 100644 backend/src/main/java/com/yfd/platform/qgc_sys/mapLayer/entity/vo/MapLayerVo.java create mode 100644 backend/src/main/java/com/yfd/platform/qgc_sys/mapLayer/entity/vo/MapLegendVo.java create mode 100644 backend/src/main/java/com/yfd/platform/qgc_sys/mapLayer/mapper/MsMaptoolboxBMapper.java create mode 100644 backend/src/main/java/com/yfd/platform/qgc_sys/mapLayer/service/IMapLegendBizService.java create mode 100644 backend/src/main/java/com/yfd/platform/qgc_sys/mapLayer/service/impl/MapLegendBizServiceImpl.java create mode 100644 backend/src/main/java/com/yfd/platform/qgc_sys/mapcfg/entity/MapmoduleVo.java diff --git a/backend/src/main/java/com/yfd/platform/config/SecurityConfig.java b/backend/src/main/java/com/yfd/platform/config/SecurityConfig.java index 7648c9b2..bedbb152 100644 --- a/backend/src/main/java/com/yfd/platform/config/SecurityConfig.java +++ b/backend/src/main/java/com/yfd/platform/config/SecurityConfig.java @@ -73,6 +73,7 @@ public class SecurityConfig { // .requestMatchers("/fh/**").permitAll() // .requestMatchers("/data/**").permitAll() .requestMatchers("/mapLayer/**").permitAll() + .requestMatchers("/mapmodule/**").permitAll() .requestMatchers("/mapLegend/**").permitAll() .requestMatchers("/sms/**").permitAll() .requestMatchers(HttpMethod.GET, "/").permitAll() diff --git a/backend/src/main/java/com/yfd/platform/config/SwaggerConfig.java b/backend/src/main/java/com/yfd/platform/config/SwaggerConfig.java index e6a0b033..fd4d2841 100644 --- a/backend/src/main/java/com/yfd/platform/config/SwaggerConfig.java +++ b/backend/src/main/java/com/yfd/platform/config/SwaggerConfig.java @@ -164,10 +164,10 @@ public class SwaggerConfig { } @Bean - public GroupedOpenApi groupSysMlgApi() { + public GroupedOpenApi groupSysMcfgApi() { return GroupedOpenApi.builder() .group("5.1 图例结构管理") - .packagesToScan("com.yfd.platform.qgc_sys.mapLegend.controller") + .packagesToScan("com.yfd.platform.qgc_sys.mapcfg.controller") .build(); } } \ No newline at end of file diff --git a/backend/src/main/java/com/yfd/platform/qgc_sys/mapLayer/controller/MapLayerController.java b/backend/src/main/java/com/yfd/platform/qgc_sys/mapLayer/controller/MapLayerController.java index 981346ce..84c0ef86 100644 --- a/backend/src/main/java/com/yfd/platform/qgc_sys/mapLayer/controller/MapLayerController.java +++ b/backend/src/main/java/com/yfd/platform/qgc_sys/mapLayer/controller/MapLayerController.java @@ -1,9 +1,11 @@ package com.yfd.platform.qgc_sys.mapLayer.controller; import cn.hutool.core.util.StrUtil; +import com.yfd.platform.common.DataSourceResult; import com.yfd.platform.common.exception.BizException; import com.yfd.platform.config.ResponseResult; import com.yfd.platform.qgc_sys.mapLayer.domain.MsMaplayerB; +import com.yfd.platform.qgc_sys.mapLayer.domain.MsMaplegendB; import com.yfd.platform.qgc_sys.mapLayer.entity.vo.MapLayerAo; import com.yfd.platform.qgc_sys.mapLayer.service.IMapLayerBizService; import com.yfd.platform.qgc_sys.mapLayer.service.IMapLayerService; @@ -37,7 +39,24 @@ public class MapLayerController { @PostMapping("/getAllMapLayerTree") public ResponseResult getAllMapLayerTree(@RequestBody MapLayerAo flag) { List tree = mapLayerBizService.getMapLayerTree(flag); - return ResponseResult.successData(tree); + // 构建 Kendo 数据源结果 + DataSourceResult dataSourceResult = new DataSourceResult<>(); + dataSourceResult.setData(tree); + // 计算总节点数 + long total = countTreeNodes(tree); + dataSourceResult.setTotal(tree.size()); + return ResponseResult.successData(dataSourceResult); + } + private long countTreeNodes(List nodes) { + if (nodes == null) return 0; + long count = 0; + for (MsMaplayerB node : nodes) { + count++; // 当前节点 + if (node.getChildren() != null && !node.getChildren().isEmpty()) { + count += countTreeNodes(node.getChildren()); + } + } + return count; } /** diff --git a/backend/src/main/java/com/yfd/platform/qgc_sys/mapLayer/controller/MapLegendController.java b/backend/src/main/java/com/yfd/platform/qgc_sys/mapLayer/controller/MapLegendController.java index f038b8e7..bb5830c7 100644 --- a/backend/src/main/java/com/yfd/platform/qgc_sys/mapLayer/controller/MapLegendController.java +++ b/backend/src/main/java/com/yfd/platform/qgc_sys/mapLayer/controller/MapLegendController.java @@ -3,21 +3,32 @@ package com.yfd.platform.qgc_sys.mapLayer.controller; import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.util.StrUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.yfd.platform.common.DataSourceRequest; import com.yfd.platform.common.DataSourceResult; import com.yfd.platform.common.exception.BizException; import com.yfd.platform.config.ResponseResult; +import com.yfd.platform.qgc_sys.mapLayer.domain.MsMaplayerB; import com.yfd.platform.qgc_sys.mapLayer.domain.MsMaplegendB; +import com.yfd.platform.qgc_sys.mapLayer.mapper.MsMaplayerBMapper; +import com.yfd.platform.qgc_sys.mapLayer.service.IMapLayerService; import com.yfd.platform.qgc_sys.mapLayer.service.IMapLegendService; +import com.yfd.platform.qgc_sys.mapLayer.entity.vo.MapLegendVo; +import com.yfd.platform.qgc_sys.mapLayer.service.IMapLegendBizService; import com.yfd.platform.utils.DataSourceRequestUtil; +import com.yfd.platform.utils.SecurityUtils; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; import jakarta.annotation.Resource; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; -import java.util.List; +import java.util.*; +import java.util.function.Function; +import java.util.stream.Collectors; /** * 地图图例管理 @@ -32,6 +43,11 @@ public class MapLegendController { @Resource private IMapLegendService mapLegendService; + @Resource + private IMapLegendBizService mapLegendBizService; + + @Resource + private MsMaplayerBMapper msMaplayerBMapper; // 新增注入 /** * 条件过滤数据列表(Kendo UI 数据源) */ @@ -54,6 +70,68 @@ public class MapLegendController { resultPage.setTotal(list.size()); } + List records = resultPage.getRecords(); + if (records != null && !records.isEmpty()) { + // ---------- 2. 批量获取父级信息(用于 parentCode、parentName)---------- + Set parentIds = records.stream() + .filter(e -> e.getDataType() != null && e.getDataType() == 2) // 只处理图例数据 + .map(MsMaplegendB::getParentId) + .filter(Objects::nonNull) + .collect(Collectors.toSet()); + + Map parentMap = new HashMap<>(); + if (!parentIds.isEmpty()) { + List parents = mapLegendService.listByIds(parentIds); + parentMap = parents.stream() + .collect(Collectors.toMap(MsMaplegendB::getId, Function.identity())); + } + + // ---------- 3. 批量获取图层名称(根据 layerCode 查 MS_MAPLAYER_B)---------- + Set layerCodes = records.stream() + .map(MsMaplegendB::getLayerCode) + .filter(Objects::nonNull) + .collect(Collectors.toSet()); + + Map layerCodeNameMap = new HashMap<>(); + if (!layerCodes.isEmpty()) { + // 使用 Mapper 查询 + List layerList = msMaplayerBMapper.selectList( + new LambdaQueryWrapper() + .in(MsMaplayerB::getCode, layerCodes) + ); + layerCodeNameMap = layerList.stream() + .collect(Collectors.toMap(MsMaplayerB::getCode, MsMaplayerB::getTitle)); + } + + // ---------- 4. 遍历记录,填充三个额外字段 ---------- + for (MsMaplegendB entity : records) { + // 4.1 填充 parentCode / parentName(仅 dataType=2) + if (entity.getDataType() != null && entity.getDataType() == 2) { + String parentId = entity.getParentId(); + if (parentId != null && parentMap.containsKey(parentId)) { + MsMaplegendB parent = parentMap.get(parentId); + entity.setParentCode(parent.getCode()); + entity.setParentName(parent.getName()); + } else { + entity.setParentCode(null); + entity.setParentName(null); + } + } else { + // 非 dataType=2 的记录,这两个字段置空 + entity.setParentCode(null); + entity.setParentName(null); + } + + // 4.2 填充 layerCodeName(所有记录均可填充,如果图层不存在则置空) + String layerCode = entity.getLayerCode(); + if (layerCode != null && layerCodeNameMap.containsKey(layerCode)) { + entity.setLayerCodeName(layerCodeNameMap.get(layerCode)); + } else { + entity.setLayerCodeName(null); + } + } + } + // 构建 Kendo 数据源结果 DataSourceResult dataSourceResult = new DataSourceResult<>(); dataSourceResult.setData(resultPage.getRecords()); @@ -86,6 +164,15 @@ public class MapLegendController { 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); return ResponseResult.success("保存成功."); } @@ -99,4 +186,14 @@ public class MapLegendController { mapLegendService.delelteByIds(ids); return ResponseResult.success("删除成功."); } + + /** + * 地图图例管理图层树(下拉选) + */ + @Operation(summary = "地图图例管理图层树(下拉选)") + @GetMapping("/getAllMapLegendTree") + public ResponseResult getAllMapLayerTree(Integer flag) { + List tree = mapLegendBizService.getMapLegendTree(flag); + return ResponseResult.successData(tree); + } } diff --git a/backend/src/main/java/com/yfd/platform/qgc_sys/mapLayer/domain/MsMaplegendB.java b/backend/src/main/java/com/yfd/platform/qgc_sys/mapLayer/domain/MsMaplegendB.java index 6147f6c3..3e2151d7 100644 --- a/backend/src/main/java/com/yfd/platform/qgc_sys/mapLayer/domain/MsMaplegendB.java +++ b/backend/src/main/java/com/yfd/platform/qgc_sys/mapLayer/domain/MsMaplegendB.java @@ -131,4 +131,10 @@ public class MsMaplegendB implements Serializable { @TableField("IS_FILTER") private Integer isFilter; + + @TableField(exist = false) + private String layerCodeName; + + @TableField(exist = false) + private String parentCode; } \ No newline at end of file diff --git a/backend/src/main/java/com/yfd/platform/qgc_sys/mapLayer/domain/MsMapmoduleB.java b/backend/src/main/java/com/yfd/platform/qgc_sys/mapLayer/domain/MsMapmoduleB.java index aac57f40..84c2f75d 100644 --- a/backend/src/main/java/com/yfd/platform/qgc_sys/mapLayer/domain/MsMapmoduleB.java +++ b/backend/src/main/java/com/yfd/platform/qgc_sys/mapLayer/domain/MsMapmoduleB.java @@ -80,11 +80,14 @@ public class MsMapmoduleB implements Serializable { @TableField("TEMPLATE_ID") private String templateId; + @TableField("SYSTEM_ID") + private String systemId; + /** * 归属的系统ID(非数据库字段,用于字典翻译) */ @TableField(exist = false) - private String systemId; + private String systemName; /** * 菜单名称(非数据库字段,用于字典翻译) diff --git a/backend/src/main/java/com/yfd/platform/qgc_sys/mapLayer/domain/MsMaptoolboxB.java b/backend/src/main/java/com/yfd/platform/qgc_sys/mapLayer/domain/MsMaptoolboxB.java new file mode 100644 index 00000000..1439c017 --- /dev/null +++ b/backend/src/main/java/com/yfd/platform/qgc_sys/mapLayer/domain/MsMaptoolboxB.java @@ -0,0 +1,186 @@ +package com.yfd.platform.qgc_sys.mapLayer.domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; +import java.util.List; + +/** + * 地图工具箱表 + * + * @author migration + */ +@Data +@TableName("MS_MAPTOOLBOX_B") +public class MsMaptoolboxB implements Serializable { + + private static final long serialVersionUID = 1L; + + @TableId(type = IdType.ASSIGN_UUID) + private String id; + + /** + * 名称 + */ + @TableField("NAME") + private String name; + + /** + * 名称(英文) + */ + @TableField("NAME_EN") + private String nameEn; + + /** + * 编码 + */ + @TableField("CODE") + private String code; + + /** + * 地图模式 + */ + @TableField("MAP_MODEL") + private String mapModel; + + /** + * 所属父节点 + */ + @TableField("PATENT_ID") + private String patentId; + + /** + * 树全路径 + */ + @TableField("FULL_PATH") + private String fullPath; + + /** + * 层级 + */ + @TableField("TREE_LEVEL") + private Integer treeLevel; + + /** + * 是否有子集 + */ + @TableField("HAS_CHILDREN") + private Integer hasChildren; + + /** + * 图标 + */ + @TableField("ICON") + private String icon; + + /** + * 备注 + */ + @TableField("DESCRIPTION") + private String description; + + /** + * 是否启用 + */ + @TableField("ENABLE") + private Integer enable; + + /** + * 系统内置项 + */ + @TableField("INTERNAL") + private Integer internal; + + /** + * 排序 + */ + @TableField("ORDER_INDEX") + private Integer orderIndex; + + /** + * 过滤内容 + */ + @TableField("FILTER_CONTENT") + private String filterContent; + + /** + * 创建人 + */ + @TableField("RECORD_USER") + private String recordUser; + + /** + * 创建时间 + */ + @TableField("RECORD_TIME") + private Date recordTime; + + /** + * 更新人 + */ + @TableField("MODIFY_USER") + private String modifyUser; + + /** + * 更新时间 + */ + @TableField("MODIFY_TIME") + private Date modifyTime; + + /** + * 是否已删除 + */ + @TableField("IS_DELETED") + private Integer isDeleted; + + /** + * 删除人 + */ + @TableField("DELETE_USER") + private String deleteUser; + + /** + * 删除时间 + */ + @TableField("DELETE_TIME") + private Date deleteTime; + + /** + * 类型:0-功能区 1-地形 2-图例 + */ + @TableField("TOOL_TYPE") + private Integer toolType; + + /** + * 归属的系统ID(非数据库字段,来自MS_MAPMODULE_B关联) + */ + @TableField(exist = false) + private String systemId; + + /** + * 是否默认勾选(非数据库字段,来自MS_MAPMODULE_B关联) + */ + @TableField(exist = false) + private Integer checked; + + /** + * 是否可勾选(非数据库字段,来自MS_MAPMODULE_B关联) + */ + @TableField(exist = false) + private Integer canBeChecked; + + /** + * 是否多选(非数据库字段,来自MS_MAPMODULE_B关联) + */ + @TableField(exist = false) + private Integer multiSelect; + + /** 子级集合(非数据库字段) */ + @TableField(exist = false) + private List children; +} diff --git a/backend/src/main/java/com/yfd/platform/qgc_sys/mapLayer/entity/vo/MapLayerVo.java b/backend/src/main/java/com/yfd/platform/qgc_sys/mapLayer/entity/vo/MapLayerVo.java new file mode 100644 index 00000000..55c7ad5e --- /dev/null +++ b/backend/src/main/java/com/yfd/platform/qgc_sys/mapLayer/entity/vo/MapLayerVo.java @@ -0,0 +1,80 @@ +package com.yfd.platform.qgc_sys.mapLayer.entity.vo; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.List; + +/** + * 地图图层管理封装VO + * + * @author migration + */ +@Data +@Schema(description = "地图图层管理封装VO") +public class MapLayerVo { + + @Schema(description = "主键") + private String id; + + @Schema(description = "父id") + private String parentId; + + @Schema(description = "标题名称") + private String title; + + @Schema(description = "图层标识") + @JsonProperty(value = "key") + private String code; + + @Schema(description = "标签层级") + @JsonProperty(value = "labelLevel") + private Integer labelLevel; + + @Schema(description = "是否可以选择:0=否 1=是") + private Integer checkable; + + @Schema(description = "图层分类") + private String type; + + @Schema(description = "图层上下层层级关系") + @JsonProperty(value = "zIndex") + private String zIndex; + + @Schema(description = "各类站点图层对应类型") + private String sttpType; + + @Schema(description = "图层展示数据格式") + private String layers; + + @Schema(description = "url地址") + private String url; + + @Schema(description = "3D url地址") + private String urlThd; + + @Schema(description = "图层透明度") + private BigDecimal opacity; + + @Schema(description = "子级集合") + private List children; + + @Schema(description = "参数json") + private String paramJson; + + @Schema(description = "排序") + private String orderIndex; + + @Schema(description = "是否默认勾选:0=否 1=是") + private Integer checked; + + @Schema(description = "是否可勾选:0=否 1=是") + private Integer canBeChecked; + + @Schema(description = "是否多选:0=否 1=是") + private Integer multiSelect; + @Schema(description = "参数设置:steady=静态 dynamic=动态") + private String options; +} diff --git a/backend/src/main/java/com/yfd/platform/qgc_sys/mapLayer/entity/vo/MapLegendVo.java b/backend/src/main/java/com/yfd/platform/qgc_sys/mapLayer/entity/vo/MapLegendVo.java new file mode 100644 index 00000000..3ad7fa4a --- /dev/null +++ b/backend/src/main/java/com/yfd/platform/qgc_sys/mapLayer/entity/vo/MapLegendVo.java @@ -0,0 +1,97 @@ +package com.yfd.platform.qgc_sys.mapLayer.entity.vo; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.List; + +/** + * 地图图例VO + * + * @author migration + */ +@Data +@Schema(description = "地图图例VO") +public class MapLegendVo { + + @Schema(description = "图例id") + private String id; + + @Schema(description = "父级id") + private String parentId; + + @Schema(description = "分组名") + private String groupName; + + @Schema(description = "层级名称") + private String parentName; + + @Schema(description = "图例名") + private String name; + + @Schema(description = "图例code") + private String code; + + @Schema(description = "图例icon") + private String icon; + + @Schema(description = "图例英文(对应描点数据中的状态)") + private String nameEn; + + @Schema(description = "图层code") + private String layerCode; + + @Schema(description = "是否多选;0=否;1=是") + private Integer multiSelect; + + @Schema(description = "是否默认勾选;0=否;1=是") + private Integer checked; + + @Schema(description = "是否可勾选;0=否;1=是") + private Integer canBeChecked; + + @Schema(description = "子排序") + private Integer orderIndex; + + @Schema(description = "父排序") + private Integer pSort; + + @Schema(description = "最小缩放等级") + private Integer minZoom; + + @Schema(description = "最大缩放等级") + private Integer maxZoom; + + @Schema(description = "最小高程-三维") + private BigDecimal minHeightThd; + + @Schema(description = "最大高程-三维") + private BigDecimal maxHeightThd; + + @Schema(description = "是否显示;0=否;1=是") + private Integer ifShow; + + @Schema(description = "是否过滤;0=否;1=是") + private Integer isFilter; + + @JsonProperty(value = "color") + @Schema(description = "图例颜色") + private String color; + + @JsonProperty(value = "shape") + @Schema(description = "图例形状") + private String shape; + + @JsonProperty(value = "minVal") + @Schema(description = "区间最小值") + private BigDecimal minVal; + + @JsonProperty(value = "maxVal") + @Schema(description = "区间最大值") + private BigDecimal maxVal; + + @Schema(description = "子级") + private List childrenList; +} \ No newline at end of file diff --git a/backend/src/main/java/com/yfd/platform/qgc_sys/mapLayer/mapper/MsMapmoduleBMapper.java b/backend/src/main/java/com/yfd/platform/qgc_sys/mapLayer/mapper/MsMapmoduleBMapper.java index 774e4c00..e219ae10 100644 --- a/backend/src/main/java/com/yfd/platform/qgc_sys/mapLayer/mapper/MsMapmoduleBMapper.java +++ b/backend/src/main/java/com/yfd/platform/qgc_sys/mapLayer/mapper/MsMapmoduleBMapper.java @@ -2,7 +2,14 @@ package com.yfd.platform.qgc_sys.mapLayer.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.yfd.platform.qgc_sys.mapLayer.domain.MsMapmoduleB; +import com.yfd.platform.qgc_sys.mapLayer.domain.MsMaptoolboxB; +import com.yfd.platform.qgc_sys.mapLayer.entity.vo.MapLayerVo; +import com.yfd.platform.qgc_sys.mapLayer.entity.vo.MapLegendVo; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Select; + +import java.util.List; /** * 地图与菜单映射表 Mapper 接口 @@ -11,4 +18,73 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface MsMapmoduleBMapper extends BaseMapper { + + /** + * 查询地图图层树(关联MS_MAPMODULE_B与MS_MAPLAYER_B) + */ + @Select("") + List getMapLayerTree(@Param("moduleId") String moduleId, @Param("sid") String sid, + @Param("templateId") String templateId); + + /** + * 查询地图工具箱(关联MS_MAPMODULE_B与MS_MAPTOOLBOX_B) + */ + @Select("") + List getMapToolBox(@Param("moduleId") String moduleId, @Param("sid") String sid, + @Param("templateId") String templateId); + + /** + * 查询模块关联的图例列表(关联MS_MAPMODULE_B与MS_MAPLEGEND_B) + */ + @Select("") + List getModuleMapLegendList(@Param("moduleId") String moduleId, @Param("sid") String sid, + @Param("templateId") String templateId); } \ No newline at end of file diff --git a/backend/src/main/java/com/yfd/platform/qgc_sys/mapLayer/mapper/MsMaptoolboxBMapper.java b/backend/src/main/java/com/yfd/platform/qgc_sys/mapLayer/mapper/MsMaptoolboxBMapper.java new file mode 100644 index 00000000..cff67cc6 --- /dev/null +++ b/backend/src/main/java/com/yfd/platform/qgc_sys/mapLayer/mapper/MsMaptoolboxBMapper.java @@ -0,0 +1,15 @@ +package com.yfd.platform.qgc_sys.mapLayer.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.yfd.platform.qgc_sys.mapLayer.domain.MsMaptoolboxB; +import org.apache.ibatis.annotations.Mapper; + +/** + * 地图工具箱表 Mapper 接口 + * + * @author migration + */ +@Mapper +public interface MsMaptoolboxBMapper extends BaseMapper { + +} \ No newline at end of file diff --git a/backend/src/main/java/com/yfd/platform/qgc_sys/mapLayer/service/IMapLayerBizService.java b/backend/src/main/java/com/yfd/platform/qgc_sys/mapLayer/service/IMapLayerBizService.java index f0933a77..6705b7df 100644 --- a/backend/src/main/java/com/yfd/platform/qgc_sys/mapLayer/service/IMapLayerBizService.java +++ b/backend/src/main/java/com/yfd/platform/qgc_sys/mapLayer/service/IMapLayerBizService.java @@ -2,6 +2,7 @@ package com.yfd.platform.qgc_sys.mapLayer.service; import com.yfd.platform.qgc_sys.mapLayer.domain.MsMaplayerB; import com.yfd.platform.qgc_sys.mapLayer.entity.vo.MapLayerAo; +import com.yfd.platform.qgc_sys.mapLayer.entity.vo.MapLayerVo; import java.util.List; @@ -19,4 +20,15 @@ public interface IMapLayerBizService { * @return 图层树列表 */ List getMapLayerTree(MapLayerAo flag); + + /** + * 根据模块ID、系统ID、模板ID获取地图图层树(关联MS_MAPMODULE_B) + * + * @param moduleId 模块ID + * @param systemId 系统ID + * @param templateId 模板ID + * @return 图层树列表 + */ + List getMapLayerTree(String moduleId, String systemId, String templateId); + } \ No newline at end of file diff --git a/backend/src/main/java/com/yfd/platform/qgc_sys/mapLayer/service/IMapLegendBizService.java b/backend/src/main/java/com/yfd/platform/qgc_sys/mapLayer/service/IMapLegendBizService.java new file mode 100644 index 00000000..30d35833 --- /dev/null +++ b/backend/src/main/java/com/yfd/platform/qgc_sys/mapLayer/service/IMapLegendBizService.java @@ -0,0 +1,33 @@ +package com.yfd.platform.qgc_sys.mapLayer.service; + +import com.yfd.platform.qgc_sys.mapLayer.entity.vo.MapLegendVo; + +import java.util.List; + +/** + * 地图图例业务服务接口 + * + * @author migration + */ +public interface IMapLegendBizService { + + /** + * 获取地图图例树(下拉选) + * + * @param flag 数据类型过滤:null=全部, 1=结构, 2=数据 + * @return 图例树 + */ + List getMapLegendTree(Integer flag); + + + /** + * 根据模块ID、系统ID、模板ID获取模块关联的图例列表 + * + * @param moduleId 模块ID + * @param systemId 系统ID + * @param templateId 模板ID + * @return 图例列表 + */ + List getModuleMapLegendList(String moduleId, String systemId, String templateId); + +} \ No newline at end of file diff --git a/backend/src/main/java/com/yfd/platform/qgc_sys/mapLayer/service/impl/MapLayerBizServiceImpl.java b/backend/src/main/java/com/yfd/platform/qgc_sys/mapLayer/service/impl/MapLayerBizServiceImpl.java index 4ba92e0a..0bab5095 100644 --- a/backend/src/main/java/com/yfd/platform/qgc_sys/mapLayer/service/impl/MapLayerBizServiceImpl.java +++ b/backend/src/main/java/com/yfd/platform/qgc_sys/mapLayer/service/impl/MapLayerBizServiceImpl.java @@ -4,7 +4,9 @@ import cn.hutool.core.util.StrUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.yfd.platform.qgc_sys.mapLayer.domain.MsMaplayerB; import com.yfd.platform.qgc_sys.mapLayer.entity.vo.MapLayerAo; +import com.yfd.platform.qgc_sys.mapLayer.entity.vo.MapLayerVo; import com.yfd.platform.qgc_sys.mapLayer.mapper.MsMaplayerBMapper; +import com.yfd.platform.qgc_sys.mapLayer.mapper.MsMapmoduleBMapper; import com.yfd.platform.qgc_sys.mapLayer.service.IMapLayerBizService; import com.yfd.platform.system.domain.SysDictionary; import com.yfd.platform.system.domain.SysDictionaryItems; @@ -38,6 +40,9 @@ public class MapLayerBizServiceImpl implements IMapLayerBizService { @Resource private SysUserMapper sysUserMapper; + @Resource + private MsMapmoduleBMapper msMapmoduleBMapper; + @Override public List getMapLayerTree(MapLayerAo flag) { // 1. 查询字典 "DTZJLX" 获取需要排除的图层类型 @@ -159,6 +164,50 @@ public class MapLayerBizServiceImpl implements IMapLayerBizService { if (children != null && !children.isEmpty()) { parent.setChildren(children); convertTree(children, childrenMap); + }else { + // 当没有子节点时,显式设置为空列表,保证 JSON 输出为 [] 而不是 null + parent.setChildren(new ArrayList<>()); + } + } + } + + @Override + public List getMapLayerTree(String moduleId, String systemId, String templateId) { + // 通过 JOIN 查询 MS_MAPLAYER_B 和 MS_MAPMODULE_B + List allLayers = msMapmoduleBMapper.getMapLayerTree(moduleId, systemId, templateId); + + if (allLayers == null || allLayers.isEmpty()) { + return new ArrayList<>(); + } + + // 取第一级 + List parents = allLayers.stream() + .filter(p -> StrUtil.isBlank(p.getParentId())) + .collect(Collectors.toList()); + + // 通过父级id分组子节点 + Map> childrenMap = allLayers.stream() + .filter(p -> StrUtil.isNotBlank(p.getParentId())) + .collect(Collectors.groupingBy(MapLayerVo::getParentId)); + + // 递归构建树 + convertLayerVoTree(parents, childrenMap); + return parents; + } + + /** + * 递归转换图层VO为树结构 + */ + private void convertLayerVoTree(List parents, Map> childrenMap) { + if (parents == null || parents.isEmpty()) { + return; + } + for (MapLayerVo parent : parents) { + String id = parent.getId(); + List children = childrenMap.get(id); + if (children != null && !children.isEmpty()) { + parent.setChildren(children); + convertLayerVoTree(children, childrenMap); } } } diff --git a/backend/src/main/java/com/yfd/platform/qgc_sys/mapLayer/service/impl/MapLegendBizServiceImpl.java b/backend/src/main/java/com/yfd/platform/qgc_sys/mapLayer/service/impl/MapLegendBizServiceImpl.java new file mode 100644 index 00000000..cdc7a489 --- /dev/null +++ b/backend/src/main/java/com/yfd/platform/qgc_sys/mapLayer/service/impl/MapLegendBizServiceImpl.java @@ -0,0 +1,145 @@ +package com.yfd.platform.qgc_sys.mapLayer.service.impl; + +import cn.hutool.core.bean.BeanUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.yfd.platform.qgc_sys.mapLayer.domain.MsMaplegendB; +import com.yfd.platform.qgc_sys.mapLayer.entity.vo.MapLegendVo; +import com.yfd.platform.qgc_sys.mapLayer.mapper.MsMapmoduleBMapper; +import com.yfd.platform.qgc_sys.mapLayer.service.IMapLegendBizService; +import com.yfd.platform.qgc_sys.mapLayer.service.IMapLegendService; +import jakarta.annotation.Resource; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * 地图图例业务服务实现类 + * + * @author migration + */ +@Service +public class MapLegendBizServiceImpl implements IMapLegendBizService { + + @Resource + private IMapLegendService legendService; + @Resource + private MsMapmoduleBMapper msMapmoduleBMapper; + /** + * 数据类型枚举:1=结构 + */ + private static final int DATA_TYPE_STRUCT = 1; + /** + * 数据类型枚举:2=数据 + */ + private static final int DATA_TYPE_DATA = 2; + + @Override + public List getMapLegendTree(Integer flag) { + // 查询所有数据 + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(MsMaplegendB::getIsDeleted, 0); + if (flag != null) { + if (flag == DATA_TYPE_STRUCT) { + wrapper.eq(MsMaplegendB::getDataType, DATA_TYPE_STRUCT); + } else if (flag == DATA_TYPE_DATA) { + wrapper.eq(MsMaplegendB::getDataType, DATA_TYPE_DATA); + } + } + List legendList = legendService.list(wrapper); + + // 转换为VO + List list = new ArrayList<>(); + for (MsMaplegendB legend : legendList) { + MapLegendVo vo = new MapLegendVo(); + BeanUtil.copyProperties(legend, vo); + list.add(vo); + } + + // 取第一级 + List parents = list.stream() + .filter(p -> StringUtils.isBlank(p.getParentId())) + .sorted(Comparator.comparing(MapLegendVo::getOrderIndex, Comparator.nullsLast(Integer::compareTo))) + .collect(Collectors.toList()); + + // 通过父级id分组 + Map> mapList = list.stream() + .filter(p -> StringUtils.isNotBlank(p.getParentId())) + .collect(Collectors.groupingBy(MapLegendVo::getParentId)); + + // 递归转换数据为树结构 + convertTree(parents, mapList); + return parents; + } + + /** + * 递归转换树结构 + */ + private void convertTree(List parents, Map> subList) { + if (parents == null || parents.isEmpty()) { + return; + } + for (MapLegendVo p : parents) { + String id = p.getId(); + for (Map.Entry> entry : subList.entrySet()) { + String pid = entry.getKey(); + List children = entry.getValue(); + if (id.equals(pid)) { + p.setChildrenList(children); + convertTree(children, subList); + } + } + } + } + + + @Override + public List getModuleMapLegendList(String moduleId, String systemId, String templateId) { + List list = new ArrayList<>(); + // 通过 JOIN 查询 MS_MAPLEGEND_B 和 MS_MAPMODULE_B + List bbiMapLegendList = msMapmoduleBMapper.getModuleMapLegendList(moduleId, systemId, templateId); + + if (bbiMapLegendList == null || bbiMapLegendList.isEmpty()) { + return list; + } + + // 按父级分组 + Map> collect = bbiMapLegendList.stream() + .collect(Collectors.groupingBy(MapLegendVo::getParentName)); + + // 遍历 + collect.forEach((str, mapLegendVoList) -> { + MapLegendVo mapLegendVo = new MapLegendVo(); + mapLegendVo.setName(str); + mapLegendVo.setPSort(mapLegendVoList.get(0).getPSort()); + // 按子级分组名分组 + Map> collect1 = mapLegendVoList.stream() + .collect(Collectors.groupingBy(MapLegendVo::getGroupName)); + List childrenList = new ArrayList<>(); + for (String groupNameStr : collect1.keySet()) { + List list1 = collect1.get(groupNameStr); + // 如果子级和父级名称相同,则不用子级 + if (groupNameStr.equalsIgnoreCase(str)) { + childrenList = list1; + } else { + MapLegendVo mapLegendVoChild = new MapLegendVo(); + mapLegendVoChild.setName(groupNameStr); + if (null != list1 && list1.size() > 0) { + mapLegendVoChild.setPSort(list1.get(0).getPSort()); + } + mapLegendVoChild.setChildrenList(list1); + childrenList.add(mapLegendVoChild); + } + } + List collect2 = childrenList.stream() + .sorted(Comparator.comparing(MapLegendVo::getPSort, Comparator.nullsLast(Integer::compareTo))) + .collect(Collectors.toList()); + mapLegendVo.setChildrenList(collect2); + list.add(mapLegendVo); + }); + return list.stream() + .sorted(Comparator.comparing(MapLegendVo::getPSort, Comparator.nullsLast(Integer::compareTo))) + .collect(Collectors.toList()); + } +} \ No newline at end of file diff --git a/backend/src/main/java/com/yfd/platform/qgc_sys/mapcfg/controller/MapmoduleBController.java b/backend/src/main/java/com/yfd/platform/qgc_sys/mapcfg/controller/MapmoduleBController.java index 09204d83..0ddd61ef 100644 --- a/backend/src/main/java/com/yfd/platform/qgc_sys/mapcfg/controller/MapmoduleBController.java +++ b/backend/src/main/java/com/yfd/platform/qgc_sys/mapcfg/controller/MapmoduleBController.java @@ -1,5 +1,6 @@ package com.yfd.platform.qgc_sys.mapcfg.controller; import cn.hutool.core.util.StrUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.yfd.platform.common.DataSourceRequest; @@ -8,13 +9,17 @@ import com.yfd.platform.config.ResponseResult; import com.yfd.platform.common.exception.BizException; import com.yfd.platform.qgc_sys.mapLayer.domain.MsMapmoduleB; import com.yfd.platform.qgc_sys.mapcfg.service.IMapmoduleBService; +import com.yfd.platform.qgc_sys.mapcfg.entity.MapmoduleVo; +import com.yfd.platform.system.domain.SysMenu; +import com.yfd.platform.system.mapper.SysMenuMapper; import com.yfd.platform.utils.DataSourceRequestUtil; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; import jakarta.annotation.Resource; import org.springframework.web.bind.annotation.*; -import java.util.List; +import java.util.*; +import java.util.stream.Collectors; /** * 地图菜单配置控制层 @@ -29,6 +34,9 @@ public class MapmoduleBController { @Resource private IMapmoduleBService mapmoduleBService; + @Resource + private SysMenuMapper sysMenuMapper; + /** * 条件过滤数据列表(Kendo UI 数据源) */ @@ -57,9 +65,55 @@ public class MapmoduleBController { dataSourceResult.setData(dataList); dataSourceResult.setTotal(resultPage.getTotal()); - // 翻译字典值(菜单名称) + // 翻译字典值(原有逻辑,可能处理其他字段) if (dataList != null && !dataList.isEmpty()) { mapmoduleBService.translateDict(dataList); + + // ----- 新增:填充 moduleName ----- + // 1. 先收集需要从数据库查询的 moduleId(排除 "tycd") + Set needQueryIds = dataList.stream() + .map(MsMapmoduleB::getModuleId) + .filter(id -> id != null && !"tycd".equals(id)) // 过滤掉 "tycd" + .collect(Collectors.toSet()); + + Map menuNameMap = new HashMap<>(); + if (!needQueryIds.isEmpty()) { + // 查询 SYS_MENU 表(假设实体为 SysMenu,Mapper 为 sysMenuMapper) + List menus = sysMenuMapper.selectList( + new LambdaQueryWrapper() + .in(SysMenu::getId, needQueryIds) // 注意 id 类型需匹配 + ); + menuNameMap = menus.stream() + .collect(Collectors.toMap( + menu -> String.valueOf(menu.getId()), // 统一转为字符串 + SysMenu::getName + )); + } + + // 2. 遍历 dataList 设置 moduleName + for (MsMapmoduleB entity : dataList) { + String moduleId = entity.getModuleId(); + if (moduleId == null) { + entity.setModuleName(null); + } else if ("tycd".equals(moduleId)) { + // 特殊处理:固定为 "通用菜单" + entity.setModuleName("通用菜单"); + } else { + // 从查询结果中获取 + entity.setModuleName(menuNameMap.get(moduleId)); + // 如果 menuNameMap 中不存在,则置 null(或保留原值,视业务而定) + if (entity.getModuleName() == null) { + entity.setModuleName(null); // 或者 entity.setModuleName(""); + } + } + } + // ========== 2. 处理 systemName 特殊值 ========== + for (MsMapmoduleB entity : dataList) { + if ("qgc".equals(entity.getSystemId())) { + entity.setSystemName("qgc"); + } + // 其他 systemId 保留字典翻译的结果 + } } return ResponseResult.successData(dataSourceResult); @@ -98,4 +152,15 @@ public class MapmoduleBController { mapmoduleBService.delelteByIds(ids); return ResponseResult.success("删除成功."); } + + + /** + * 地图图层管理数据 + */ + @Operation(summary = "地图图层管理数据") + @PostMapping("/getMapData") + public ResponseResult getMapData(@RequestBody MsMapmoduleB mapmoduleB) { + MapmoduleVo result = mapmoduleBService.getMapData(mapmoduleB); + return ResponseResult.successData(result); + } } \ No newline at end of file diff --git a/backend/src/main/java/com/yfd/platform/qgc_sys/mapcfg/entity/MapmoduleVo.java b/backend/src/main/java/com/yfd/platform/qgc_sys/mapcfg/entity/MapmoduleVo.java new file mode 100644 index 00000000..30134555 --- /dev/null +++ b/backend/src/main/java/com/yfd/platform/qgc_sys/mapcfg/entity/MapmoduleVo.java @@ -0,0 +1,47 @@ +package com.yfd.platform.qgc_sys.mapcfg.entity; + +import com.yfd.platform.qgc_sys.mapLayer.domain.MsMaptoolboxB; +import com.yfd.platform.qgc_sys.mapLayer.entity.vo.MapLayerVo; +import com.yfd.platform.qgc_sys.mapLayer.entity.vo.MapLegendVo; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.List; + +/** + * 地图与菜单查询返回实体类 + * + * @author migration + */ +@Data +@Schema(description = "地图菜单配置实体类") +public class MapmoduleVo { + + /** GIS地图多功能区 */ + @Schema(description = "GIS地图多功能区") + private List maptoolbox; + + /** GIS默认数据加载 - 地形 */ + @Schema(description = "GIS默认数据加载 - 地形") + private List terrain; + + /** GIS默认数据加载 - 图例 */ + @Schema(description = "GIS默认数据加载 - 图例") + private List legend; + + /** GIS默认数据加载 - 内容模块 */ + @Schema(description = "GIS默认数据加载 - 内容模块") + private List content; + + /** GIS默认数据加载 - 环保监测 */ + @Schema(description = "GIS默认数据加载 - 环保监测") + private List hbcj; + + /** GIS图层区 */ + @Schema(description = "GIS图层区") + private List mapLayerVos; + + /** 地图图例 */ + @Schema(description = "地图图例") + private List mapLegendVos; +} \ No newline at end of file diff --git a/backend/src/main/java/com/yfd/platform/qgc_sys/mapcfg/service/IMapmoduleBService.java b/backend/src/main/java/com/yfd/platform/qgc_sys/mapcfg/service/IMapmoduleBService.java index 26c34a34..c6dcf69c 100644 --- a/backend/src/main/java/com/yfd/platform/qgc_sys/mapcfg/service/IMapmoduleBService.java +++ b/backend/src/main/java/com/yfd/platform/qgc_sys/mapcfg/service/IMapmoduleBService.java @@ -2,6 +2,7 @@ package com.yfd.platform.qgc_sys.mapcfg.service; import com.baomidou.mybatisplus.extension.service.IService; import com.yfd.platform.qgc_sys.mapLayer.domain.MsMapmoduleB; +import com.yfd.platform.qgc_sys.mapcfg.entity.MapmoduleVo; import java.util.List; @@ -33,4 +34,12 @@ public interface IMapmoduleBService extends IService { * @param ids ID列表 */ void delelteByIds(List ids); + + /** + * 获取地图数据(图层树、图例、工具箱) + * + * @param mapmoduleB 查询参数 + * @return 地图数据 + */ + MapmoduleVo getMapData(MsMapmoduleB mapmoduleB); } \ No newline at end of file diff --git a/backend/src/main/java/com/yfd/platform/qgc_sys/mapcfg/service/impl/MapmoduleBServiceImpl.java b/backend/src/main/java/com/yfd/platform/qgc_sys/mapcfg/service/impl/MapmoduleBServiceImpl.java index d650bb50..1b7b5098 100644 --- a/backend/src/main/java/com/yfd/platform/qgc_sys/mapcfg/service/impl/MapmoduleBServiceImpl.java +++ b/backend/src/main/java/com/yfd/platform/qgc_sys/mapcfg/service/impl/MapmoduleBServiceImpl.java @@ -4,8 +4,15 @@ import cn.hutool.core.util.StrUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.yfd.platform.qgc_sys.mapLayer.domain.MsMapmoduleB; +import com.yfd.platform.qgc_sys.mapLayer.domain.MsMaptoolboxB; import com.yfd.platform.qgc_sys.mapLayer.mapper.MsMapmoduleBMapper; +import com.yfd.platform.qgc_sys.mapLayer.service.IMapLayerBizService; +import com.yfd.platform.qgc_sys.mapLayer.service.IMapLegendBizService; import com.yfd.platform.qgc_sys.mapcfg.service.IMapmoduleBService; +import com.yfd.platform.qgc_sys.mapLayer.entity.vo.MapLayerVo; +import com.yfd.platform.qgc_sys.mapLayer.entity.vo.MapLegendVo; +import com.yfd.platform.qgc_sys.mapcfg.entity.MapmoduleVo; + import com.yfd.platform.system.domain.SysMenu; import com.yfd.platform.system.mapper.SysMenuMapper; import com.yfd.platform.utils.SecurityUtils; @@ -29,6 +36,13 @@ public class MapmoduleBServiceImpl extends ServiceImpl lambdaQueryWrapper = new LambdaQueryWrapper<>(); + // lambdaQueryWrapper.eq(MsTemplateB::getIsDefault, 1); + // lambdaQueryWrapper.eq(MsTemplateB::getIsDeleted, 0); + // lambdaQueryWrapper.eq(MsTemplateB::getModuleId, mapmoduleB.getModuleId()); + // MsTemplateB msTemplateB = msTemplateBMapper.selectOne(lambdaQueryWrapper); + // if (msTemplateB != null) { + // templateId = msTemplateB.getId(); + // } + // } else { + // templateId = mapmoduleB.getTemplateId(); + // } + // ========== 预留代码结束 ========== + + MapmoduleVo mapmoduleVo = new MapmoduleVo(); + + // 1. GIS图层区 + List layer = mapLayerBizService.getMapLayerTree( + mapmoduleB.getModuleId(), mapmoduleB.getSystemId(), templateId); + mapmoduleVo.setMapLayerVos(layer); + + // 2. 地图图例 + List legend = mapLegendBizService.getModuleMapLegendList( + mapmoduleB.getModuleId(), mapmoduleB.getSystemId(), templateId); + mapmoduleVo.setMapLegendVos(legend); + + // 3. 地图工具箱 + List mapToolBox = baseMapper.getMapToolBox( + mapmoduleB.getModuleId(), mapmoduleB.getSystemId(), templateId); + + // 按toolType分组 + Map> groupedByType = mapToolBox.stream() + .collect(Collectors.groupingBy(MsMaptoolboxB::getToolType)); + + // 图例(toolType=2) + mapmoduleVo.setLegend(groupedByType.get(2)); + + // 内容模块(toolType=3) + List contentLayerTree = getContentLayerTree(groupedByType); + mapmoduleVo.setContent(contentLayerTree); + + // 环保监测(toolType=4) + mapmoduleVo.setHbcj(groupedByType.get(4)); + + return mapmoduleVo; + } + + /** + * 获取内容模块图层树 + */ + private List getContentLayerTree(Map> groupedByType) { + List msMaptoolboxBList = new java.util.ArrayList<>(); + List contentToolBoxList = groupedByType.get(3); + if (contentToolBoxList != null) { + for (MsMaptoolboxB msMaptoolboxB : contentToolBoxList) { + if (StrUtil.isNotBlank(msMaptoolboxB.getPatentId())) { + // 如果内容模块没有进行配置,则默认全部勾选 + if (msMaptoolboxB.getChecked() == null) { + msMaptoolboxB.setChecked(1); + } + msMaptoolboxBList.add(msMaptoolboxB); + } + } + } + return msMaptoolboxBList; + } } \ No newline at end of file From e0b8dd2e49a81fc6fa62dfb1a19537898b518ee3 Mon Sep 17 00:00:00 2001 From: lilin <18811154576@163.com> Date: Wed, 1 Jul 2026 18:19:37 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E5=9C=B0=E5=9B=BE=E5=9B=BE=E4=BE=8B?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E4=BB=A3=E7=A0=81=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/MapLegendController.java | 10 +++ .../mapLayer/mapper/MsMapmoduleBMapper.java | 24 +++++++ .../service/IMapLegendBizService.java | 9 +++ .../service/impl/MapLegendBizServiceImpl.java | 67 +++++++++++++++++++ .../controller/MapmoduleBController.java | 40 +++++------ 5 files changed, 128 insertions(+), 22 deletions(-) diff --git a/backend/src/main/java/com/yfd/platform/qgc_sys/mapLayer/controller/MapLegendController.java b/backend/src/main/java/com/yfd/platform/qgc_sys/mapLayer/controller/MapLegendController.java index bb5830c7..87e3187a 100644 --- a/backend/src/main/java/com/yfd/platform/qgc_sys/mapLayer/controller/MapLegendController.java +++ b/backend/src/main/java/com/yfd/platform/qgc_sys/mapLayer/controller/MapLegendController.java @@ -196,4 +196,14 @@ public class MapLegendController { List tree = mapLegendBizService.getMapLegendTree(flag); return ResponseResult.successData(tree); } + + /** + * 地图图例列表 + */ + @Operation(summary = "地图图例列表") + @GetMapping("/getModuleMapLegendList") + public ResponseResult getModuleMapLegendList(@RequestParam(required = false) String moduleId) { + List list = mapLegendBizService.getModuleMapLegendList(moduleId); + return ResponseResult.successData(list); + } } diff --git a/backend/src/main/java/com/yfd/platform/qgc_sys/mapLayer/mapper/MsMapmoduleBMapper.java b/backend/src/main/java/com/yfd/platform/qgc_sys/mapLayer/mapper/MsMapmoduleBMapper.java index e219ae10..d0858123 100644 --- a/backend/src/main/java/com/yfd/platform/qgc_sys/mapLayer/mapper/MsMapmoduleBMapper.java +++ b/backend/src/main/java/com/yfd/platform/qgc_sys/mapLayer/mapper/MsMapmoduleBMapper.java @@ -87,4 +87,28 @@ public interface MsMapmoduleBMapper extends BaseMapper { + "") List getModuleMapLegendList(@Param("moduleId") String moduleId, @Param("sid") String sid, @Param("templateId") String templateId); + + + /** + * 查询模块关联的图例列表(单参数版本,用于地图图例管理页面) + */ + @Select("") + List getModuleMapLegendList(@Param("moduleId") String moduleId); + } \ No newline at end of file diff --git a/backend/src/main/java/com/yfd/platform/qgc_sys/mapLayer/service/IMapLegendBizService.java b/backend/src/main/java/com/yfd/platform/qgc_sys/mapLayer/service/IMapLegendBizService.java index 30d35833..23874190 100644 --- a/backend/src/main/java/com/yfd/platform/qgc_sys/mapLayer/service/IMapLegendBizService.java +++ b/backend/src/main/java/com/yfd/platform/qgc_sys/mapLayer/service/IMapLegendBizService.java @@ -30,4 +30,13 @@ public interface IMapLegendBizService { */ List getModuleMapLegendList(String moduleId, String systemId, String templateId); + /** + * 根据模块ID获取模块关联的图例列表(单参数版本) + * + * @param moduleId 模块ID + * @return 图例列表 + */ + List getModuleMapLegendList(String moduleId); + + } \ No newline at end of file diff --git a/backend/src/main/java/com/yfd/platform/qgc_sys/mapLayer/service/impl/MapLegendBizServiceImpl.java b/backend/src/main/java/com/yfd/platform/qgc_sys/mapLayer/service/impl/MapLegendBizServiceImpl.java index cdc7a489..5ca81ae0 100644 --- a/backend/src/main/java/com/yfd/platform/qgc_sys/mapLayer/service/impl/MapLegendBizServiceImpl.java +++ b/backend/src/main/java/com/yfd/platform/qgc_sys/mapLayer/service/impl/MapLegendBizServiceImpl.java @@ -8,6 +8,7 @@ import com.yfd.platform.qgc_sys.mapLayer.mapper.MsMapmoduleBMapper; import com.yfd.platform.qgc_sys.mapLayer.service.IMapLegendBizService; import com.yfd.platform.qgc_sys.mapLayer.service.IMapLegendService; import jakarta.annotation.Resource; +import cn.hutool.core.collection.CollectionUtil; import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; @@ -142,4 +143,70 @@ public class MapLegendBizServiceImpl implements IMapLegendBizService { .sorted(Comparator.comparing(MapLegendVo::getPSort, Comparator.nullsLast(Integer::compareTo))) .collect(Collectors.toList()); } + + @Override + public List getModuleMapLegendList(String moduleId) { + List list = new ArrayList<>(); + // 通过 JOIN 查询 MS_MAPLEGEND_B 和 MS_MAPMODULE_B(单参数版本) + List bbiMapLegendList = msMapmoduleBMapper.getModuleMapLegendList(moduleId); + + if (bbiMapLegendList == null || bbiMapLegendList.isEmpty()) { + return list; + } + + // 收集父级ID,查询父级图例的layerCode + Set parentIdList = bbiMapLegendList.stream() + .map(MapLegendVo::getParentId) + .filter(Objects::nonNull) + .collect(Collectors.toSet()); + Map layerCodeMap = new HashMap<>(); + if (CollectionUtil.isNotEmpty(parentIdList)) { + List parentLegendList = legendService.lambdaQuery() + .in(MsMaplegendB::getId, parentIdList) + .list(); + layerCodeMap = parentLegendList.stream() + .filter(item -> item.getLayerCode() != null) + .collect(Collectors.toMap(MsMaplegendB::getId, MsMaplegendB::getLayerCode, (v1, v2) -> v1)); + } + + // 按父级分组 + Map> collect = bbiMapLegendList.stream() + .collect(Collectors.groupingBy(MapLegendVo::getParentName)); + + // 遍历 + Map finalLayerCodeMap = layerCodeMap; + collect.forEach((str, mapLegendVoList) -> { + MapLegendVo mapLegendVo = new MapLegendVo(); + mapLegendVo.setName(str); + mapLegendVo.setPSort(mapLegendVoList.get(0).getPSort()); + mapLegendVo.setLayerCode(finalLayerCodeMap.get(mapLegendVoList.get(0).getParentId())); + // 按子级分组名分组 + Map> collect1 = mapLegendVoList.stream() + .collect(Collectors.groupingBy(MapLegendVo::getGroupName)); + List childrenList = new ArrayList<>(); + for (String groupNameStr : collect1.keySet()) { + List list1 = collect1.get(groupNameStr); + // 如果子级和父级名称相同,则不用子级 + if (groupNameStr.equalsIgnoreCase(str)) { + childrenList = list1; + } else { + MapLegendVo mapLegendVoChild = new MapLegendVo(); + mapLegendVoChild.setName(groupNameStr); + if (null != list1 && list1.size() > 0) { + mapLegendVoChild.setPSort(list1.get(0).getPSort()); + } + mapLegendVoChild.setChildrenList(list1); + childrenList.add(mapLegendVoChild); + } + } + List collect2 = childrenList.stream() + .sorted(Comparator.comparing(MapLegendVo::getPSort, Comparator.nullsLast(Integer::compareTo))) + .collect(Collectors.toList()); + mapLegendVo.setChildrenList(collect2); + list.add(mapLegendVo); + }); + return list.stream() + .sorted(Comparator.comparing(MapLegendVo::getPSort, Comparator.nullsLast(Integer::compareTo))) + .collect(Collectors.toList()); + } } \ No newline at end of file diff --git a/backend/src/main/java/com/yfd/platform/qgc_sys/mapcfg/controller/MapmoduleBController.java b/backend/src/main/java/com/yfd/platform/qgc_sys/mapcfg/controller/MapmoduleBController.java index 0ddd61ef..e0b8ba83 100644 --- a/backend/src/main/java/com/yfd/platform/qgc_sys/mapcfg/controller/MapmoduleBController.java +++ b/backend/src/main/java/com/yfd/platform/qgc_sys/mapcfg/controller/MapmoduleBController.java @@ -3,6 +3,7 @@ import cn.hutool.core.util.StrUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.yfd.platform.common.DataSourceLoadOptionsBase; import com.yfd.platform.common.DataSourceRequest; import com.yfd.platform.common.DataSourceResult; import com.yfd.platform.config.ResponseResult; @@ -13,6 +14,7 @@ import com.yfd.platform.qgc_sys.mapcfg.entity.MapmoduleVo; import com.yfd.platform.system.domain.SysMenu; import com.yfd.platform.system.mapper.SysMenuMapper; import com.yfd.platform.utils.DataSourceRequestUtil; +import com.yfd.platform.utils.QgcQueryWrapperUtil; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; import jakarta.annotation.Resource; @@ -43,12 +45,16 @@ public class MapmoduleBController { @Operation(summary = "条件过滤数据列表") @PostMapping("/GetKendoList") public ResponseResult getKendoList(@RequestBody DataSourceRequest dataSourceRequest) { - // 构建查询条件 + // 1. 构建查询条件 QueryWrapper wrapper = DataSourceRequestUtil.buildQueryWrapper( dataSourceRequest, MsMapmoduleB.class); - // 执行分页查询 - Page page = DataSourceRequestUtil.getPage(dataSourceRequest); + // 2. 分页参数处理(与 getMsstbprptList 完全一致) + DataSourceLoadOptionsBase loadOptions = dataSourceRequest == null ? null : dataSourceRequest.toDevRequest(); + Page page = loadOptions == null ? null + : (Page) QgcQueryWrapperUtil.buildPage(loadOptions, loadOptions.getSkip(), loadOptions.getTake()); + + // 3. 执行分页查询 Page resultPage; if (page != null) { resultPage = mapmoduleBService.page(page, wrapper); @@ -59,60 +65,50 @@ public class MapmoduleBController { resultPage.setTotal(list.size()); } - // 构建 Kendo 数据源结果 + // 4. 构建 Kendo 数据源结果 DataSourceResult dataSourceResult = new DataSourceResult<>(); List dataList = resultPage.getRecords(); dataSourceResult.setData(dataList); dataSourceResult.setTotal(resultPage.getTotal()); - // 翻译字典值(原有逻辑,可能处理其他字段) + // 5. 翻译与额外字段填充(原有逻辑保持不变) if (dataList != null && !dataList.isEmpty()) { mapmoduleBService.translateDict(dataList); - // ----- 新增:填充 moduleName ----- - // 1. 先收集需要从数据库查询的 moduleId(排除 "tycd") Set needQueryIds = dataList.stream() .map(MsMapmoduleB::getModuleId) - .filter(id -> id != null && !"tycd".equals(id)) // 过滤掉 "tycd" + .filter(id -> id != null && !"tycd".equals(id)) .collect(Collectors.toSet()); Map menuNameMap = new HashMap<>(); if (!needQueryIds.isEmpty()) { - // 查询 SYS_MENU 表(假设实体为 SysMenu,Mapper 为 sysMenuMapper) List menus = sysMenuMapper.selectList( new LambdaQueryWrapper() - .in(SysMenu::getId, needQueryIds) // 注意 id 类型需匹配 + .in(SysMenu::getId, needQueryIds) ); menuNameMap = menus.stream() .collect(Collectors.toMap( - menu -> String.valueOf(menu.getId()), // 统一转为字符串 + menu -> String.valueOf(menu.getId()), SysMenu::getName )); } - // 2. 遍历 dataList 设置 moduleName for (MsMapmoduleB entity : dataList) { + // 填充 moduleName String moduleId = entity.getModuleId(); if (moduleId == null) { entity.setModuleName(null); } else if ("tycd".equals(moduleId)) { - // 特殊处理:固定为 "通用菜单" entity.setModuleName("通用菜单"); + entity.setChecked(1); } else { - // 从查询结果中获取 entity.setModuleName(menuNameMap.get(moduleId)); - // 如果 menuNameMap 中不存在,则置 null(或保留原值,视业务而定) - if (entity.getModuleName() == null) { - entity.setModuleName(null); // 或者 entity.setModuleName(""); - } } - } - // ========== 2. 处理 systemName 特殊值 ========== - for (MsMapmoduleB entity : dataList) { + + // 特殊 systemName if ("qgc".equals(entity.getSystemId())) { entity.setSystemName("qgc"); } - // 其他 systemId 保留字典翻译的结果 } } From 03fb75980f69be9dcc6e45f0f8236f9dcde0934a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=85=B4=E5=87=AF?= <2448379534@qq.com> Date: Wed, 1 Jul 2026 18:23:41 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E9=A6=96=E9=A1=B5=EF=BC=8C=E7=94=9F?= =?UTF-8?q?=E6=80=81=E8=B0=83=E6=9F=A5=EF=BC=8C=E6=99=BA=E8=83=BD=E5=91=8A?= =?UTF-8?q?=E8=AD=A6=E9=A1=B5=E9=9D=A2=E7=BA=BF=E4=B8=8A=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E5=AF=B9=E6=8E=A5=EF=BC=8C=E4=BA=8C=E7=BA=A7=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E5=BC=80=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/.env.development | 2 +- frontend/src/api/home/index.ts | 99 + frontend/src/api/mapModal/index.ts | 2 +- frontend/src/api/stdc/index.ts | 61 +- frontend/src/api/stll/index.ts | 7 + frontend/src/api/yldc/index.ts | 7 + frontend/src/api/zngj/index.ts | 91 + frontend/src/assets/svg/diwenshuijianhuan.svg | 4 + frontend/src/assets/svg/guojiashuiwenzhan.svg | 16 + frontend/src/assets/svg/guojiashuizhizhan.svg | 13 + .../src/assets/svg/liuliangjiancezhan.svg | 6 + frontend/src/assets/svg/qixiangzhan.svg | 16 + frontend/src/assets/svg/qixidi.svg | 9 + .../src/assets/svg/shipinjiankongshebei.svg | 4 + frontend/src/assets/svg/shuizhijiancezhan.svg | 1 + .../src/assets/svg/zengzhizhanshuizhizhan.svg | 9 + frontend/src/assets/svg/zijianshuiwenzhan.svg | 16 + .../src/components/MapModal/column.config.ts | 98 +- .../MapModal/components/BasicInfo.vue | 10 + .../src/components/MapModal/setting.config.ts | 53 +- .../src/components/SidePanelItem/index.vue | 14 +- .../components/developStatusChart/index.vue | 323 ++- .../components/engEnvironmentData/index.vue | 116 +- .../alongFishMod/TwoLayers/Yanchengyulei.vue | 261 ++- frontend/src/modules/alongFishMod/index.vue | 6 +- .../modules/dianxingcuoshijieshao/index.vue | 490 ++++- .../modules/fishSurvey/FishVideo/index.vue | 4 +- .../TwoLayers/HuanbaoModTwoLayers.vue | 390 ++++ frontend/src/modules/huanbaoMod/index.vue | 269 ++- .../huanbaozidongjianceEJ/index.vue | 591 ++++++ .../src/modules/huanbaozdjcgzkzQK/index.vue | 301 +-- frontend/src/modules/jidiInfoMod/index.vue | 10 +- .../src/modules/liuyu/ai/spdzwaijc/index.vue | 146 +- .../ModeGaoJing.vue | 289 +++ .../shengtailiuliangxianshuju.vue | 146 +- .../shuizhijiancegaojing/ModeGaoJing.vue | 289 +++ .../shuizhijianceshuju.vue | 243 ++- .../xieFangFangShi/TwoLayer/STLLXFFS.vue | 118 +- .../TwoLayer/ModalYkzhbzdjcgz.vue | 6 +- .../ShengTaiLiuLiangDaBQKTwoLayer.vue | 6 +- .../src/modules/shengtaidabiaoMod/index.vue | 66 +- .../TwoLayer/ModalYkzhbzdjcgz.vue | 386 ++++ .../ShengTaiLiuLiangDaBQKTwoLayer.vue | 939 +++++++++ .../src/modules/shengtaidabiaoModJZ/index.vue | 439 +++++ .../TwoLayer/STLLXFFS.vue | 14 +- .../TwoLayer/STLLXFFS.vue | 796 ++++++++ .../modules/shengtaidabiaoTwoModJJ/index.vue | 675 +++++++ .../shuiShengShengTaiDiaoCha/index.vue | 619 ++++-- .../shuidianhuangjingjieruMod/DataTable.vue | 311 ++- .../TwoLayer/HuanJingSJJRQK.vue | 439 +++++ .../shuidianhuangjingjieruMod/index.vue | 100 +- .../shuishengshengtaijiance/SsstdcgkTk.vue | 5 +- .../modules/stllyanchengChangeModJJ/index.vue | 614 ++++++ .../yunXingGaoJIng/Aisbdbyx/AISBTK.vue | 1737 +++++++++++++++++ .../modules/yunXingGaoJIng/Aisbdbyx/index.vue | 181 +- frontend/src/shims.d.ts | 6 +- frontend/src/store/modules/jidiSelectEvent.ts | 6 +- frontend/src/utils/request.ts | 2 +- .../views/fish-survey/fishSurveyZhuanZhi.vue | 18 +- .../shuiShengShengTaiDiaoCha.vue | 75 +- .../shuiShengShengTaiDiaoCha/SSSTDCDB.vue | 441 +++++ .../shengTaiLiuLiangManZuQingKuangJiangJu.vue | 36 + 62 files changed, 11362 insertions(+), 1085 deletions(-) create mode 100644 frontend/src/api/zngj/index.ts create mode 100644 frontend/src/assets/svg/diwenshuijianhuan.svg create mode 100644 frontend/src/assets/svg/guojiashuiwenzhan.svg create mode 100644 frontend/src/assets/svg/guojiashuizhizhan.svg create mode 100644 frontend/src/assets/svg/liuliangjiancezhan.svg create mode 100644 frontend/src/assets/svg/qixiangzhan.svg create mode 100644 frontend/src/assets/svg/qixidi.svg create mode 100644 frontend/src/assets/svg/shipinjiankongshebei.svg create mode 100644 frontend/src/assets/svg/shuizhijiancezhan.svg create mode 100644 frontend/src/assets/svg/zengzhizhanshuizhizhan.svg create mode 100644 frontend/src/assets/svg/zijianshuiwenzhan.svg create mode 100644 frontend/src/modules/huanbaoMod/TwoLayers/HuanbaoModTwoLayers.vue create mode 100644 frontend/src/modules/huanbaozdjcgzkzQK/huanbaozidongjianceEJ/index.vue create mode 100644 frontend/src/modules/liuyu/yichangyujing/shengtailiuliangxianzhigaojing/ModeGaoJing.vue create mode 100644 frontend/src/modules/liuyu/yichangyujing/shuizhijiancegaojing/ModeGaoJing.vue create mode 100644 frontend/src/modules/shengtaidabiaoModJZ/TwoLayer/ModalYkzhbzdjcgz.vue create mode 100644 frontend/src/modules/shengtaidabiaoModJZ/TwoLayer/ShengTaiLiuLiangDaBQKTwoLayer.vue create mode 100644 frontend/src/modules/shengtaidabiaoModJZ/index.vue create mode 100644 frontend/src/modules/shengtaidabiaoTwoModJJ/TwoLayer/STLLXFFS.vue create mode 100644 frontend/src/modules/shengtaidabiaoTwoModJJ/index.vue create mode 100644 frontend/src/modules/shuidianhuangjingjieruMod/TwoLayer/HuanJingSJJRQK.vue create mode 100644 frontend/src/modules/stllyanchengChangeModJJ/index.vue create mode 100644 frontend/src/modules/yunXingGaoJIng/Aisbdbyx/AISBTK.vue create mode 100644 frontend/src/views/shengTaiDiaoCha/shuiShengShengTaiDiaoCha/SSSTDCDB.vue create mode 100644 frontend/src/views/shengTaiLiuLiang/shengTaiLiuLiangManZuQingKuangJiangJu.vue diff --git a/frontend/.env.development b/frontend/.env.development index 95ce05a0..6d37ed54 100644 --- a/frontend/.env.development +++ b/frontend/.env.development @@ -7,7 +7,7 @@ VITE_APP_TITLE = '水电水利建设项目全过程环境管理信息平台' VITE_APP_PORT = 3000 VITE_APP_BASE_API = '/dev-api' # 本地环境 -VITE_APP_BASE_URL = 'http://localhost:8093' +# VITE_APP_BASE_URL = 'http://10.84.121.122:8093' # 测试环境 # VITE_APP_BASE_URL = 'http://172.16.21.142:8093' # VITE_APP_BASE_URL = 'http://172.16.21.142:8096' diff --git a/frontend/src/api/home/index.ts b/frontend/src/api/home/index.ts index 0ead2e2c..6c3732c4 100644 --- a/frontend/src/api/home/index.ts +++ b/frontend/src/api/home/index.ts @@ -8,3 +8,102 @@ export function getBaseWbsb(data: any) { data: data }); } + +// 水电开发及环境监测 - 获取列表数据 +export function getVmsstbprptKendoList(data: any) { + return request({ + url: '/api/dec-lygk-base-server/base/vmsstbprpt/GetKendoList', + method: 'post', + data: data + }); +} + +// 环保设施建设情况 +export function environmentalProtectionConstruction(data: any) { + return request({ + url: '/api/wmp-env-server/env/operat/GetKendoListCust', + method: 'post', + data: data + }); +} + +// 环保设施弹框表格 +export function envOpdGetKendoListCust(data: any) { + return request({ + url: '/api/wmp-env-server/env/oped/GetKendoListCust', + method: 'post', + data: data + }); +} + +// 获取基地列表 +export function getBaseList(data: any) { + return request({ + url: '/api/dec-lygk-base-server/base/wbsb/GetKendoList', + method: 'post', + data: data + }); +} + +// 获取设施介绍列表 +export function getMsstbprptKendoList(data: any) { + return request({ + url: '/api/dec-lygk-base-server/base/msstbprpt/GetKendoList', + method: 'post', + data: data + }); +} + +// 环保自动监测工作开展情况 +export function baseEvnmAutoMonitorGetKendoListCust(data: any) { + return request({ + url: '/api/dec-lygk-base-server/base/evnmAutoMonitor/GetKendoListCust', + method: 'post', + data: data + }); +} + +// 环保自动监测弹窗列表 +export function vmsstbprptGetKendoList(data: any) { + return request({ + url: '/api/dec-lygk-base-server/base/vmsstbprpt/GetKendoList', + method: 'post', + data: data + }); +} + +// 获取基本信息 +export function baseMsstbprptGetKendoList(data: any) { + return request({ + url: '/api/dec-lygk-base-server/base/msstbprpt/GetKendoList', + method: 'post', + data: data + }); +} + +// 降水量实时数据 +export function getBaseStbprpDataPPTNR(data: any) { + return request({ + url: '/api/dec-lygk-base-server/base/stbprpData/GetKendoListCust?tbCode=PPTN_R', + method: 'post', + data: data + }); +} + +// 气温气压实时数据 +export function getBaseStbprpDataTMPR(data: any) { + return request({ + url: '/api/dec-lygk-base-server/base/stbprpData/GetKendoListCust?tbCode=TMP_R', + method: 'post', + data: data + }); +} + +// 风速风向实时数据 +export function getBaseStbprpDataWNDR(data: any) { + return request({ + url: '/api/dec-lygk-base-server/base/stbprpData/GetKendoListCust?tbCode=WND_R', + method: 'post', + data: data + }); +} diff --git a/frontend/src/api/mapModal/index.ts b/frontend/src/api/mapModal/index.ts index 1cb7afb2..3a4a1ecb 100644 --- a/frontend/src/api/mapModal/index.ts +++ b/frontend/src/api/mapModal/index.ts @@ -547,7 +547,7 @@ export function getFlowDischargeYear(data: any) { } export function getFlowDischargeList(code: string, data: any) { return request({ - url: `/apo/dec-lygk-base-server/base/stbprpData/GetKendoListCust?tbCode=${code}`, + url: `/api/dec-lygk-base-server/base/stbprpData/GetKendoListCust?tbCode=${code}`, method: 'post', data }); diff --git a/frontend/src/api/stdc/index.ts b/frontend/src/api/stdc/index.ts index ce9c8d6e..db86bca5 100644 --- a/frontend/src/api/stdc/index.ts +++ b/frontend/src/api/stdc/index.ts @@ -3,16 +3,16 @@ import request from '@/utils/request'; //水生生态调查情况-下拉选择框 export function wbsbGetKendoList(data: any) { return request({ - url: '/api/dec-lygk-base-server/base/wbsb/GetKendoList', + url: '/eq/wbsb/GetKendoList', method: 'post', data }); } -// 水生生态调查情况-获取默认年份 +// 水生生态调查情况-获取默认年份 export function getDftYear(data: any) { return request({ - url: '/api/wmp-env-server/env/we/fisht/year/qgc/GetKendoListCust', + url: '/wte/we/fisht/year/qgc/GetKendoListCust', method: 'post', data }); @@ -21,7 +21,7 @@ export function getDftYear(data: any) { // 水生生态调查情况-获取统计数据 export function getWeFisht(data: any) { return request({ - url: '/api/wmp-env-server/env/we/fisht/statics/GetKendoListCust', + url: '/wte/we/fisht/statics/GetKendoListCust', method: 'post', data }); @@ -30,7 +30,7 @@ export function getWeFisht(data: any) { // 水生生态调查概况-表格数据接口 export function getWeStaticsSecond(data: any) { return request({ - url: '/api/wmp-env-server/env/we/fisht/statics/getWeStaticsSecond', + url: '/wte/we/fisht/statics/getWeStaticsSecond', method: 'post', data }); @@ -39,7 +39,7 @@ export function getWeStaticsSecond(data: any) { // 沿程鱼类变化-图表数据接口 export function fishChanges2(data: any) { return request({ - url: '/api/wmp-env-server/env/we/fisht/stat/GetKendoListCust', + url: '/wte/we/fisht/stat/GetKendoListCust', method: 'post', data }); @@ -48,7 +48,7 @@ export function fishChanges2(data: any) { // 沿程鱼类变化-详情表格接口 export function fishDetail(data: any) { return request({ - url: '/api/wmp-env-server/env/we/fisht/detail/GetKendoListCust', + url: '/wte/we/fisht/detail/GetKendoListCust', method: 'post', data }); @@ -57,7 +57,7 @@ export function fishDetail(data: any) { // 沿程鱼类变化-Tab数量统计接口 export function getTabNum(data: any) { return request({ - url: '/api/wmp-env-server/env/we/fisht/statTab/GetKendoListCust', + url: '/wte/we/fisht/statTab/GetKendoListCust', method: 'post', data }); @@ -66,11 +66,11 @@ export function getTabNum(data: any) { // 沿程鱼类变化-获取断面列表 export function getStcdList(data: any) { return request({ - url: '/api/dec-lygk-base-server/base/vmsstbprpt/noWqDtinType0Auth/GetKendoList', + url: '/eq/base/vmsstbprpt/GetKendoList', method: 'post', data: { filter: data, - orders: JSON.stringify({ siteStepSort: 'asc' }) + orders: { siteStepSort: 'asc' } } }); } @@ -78,7 +78,16 @@ export function getStcdList(data: any) { // 沿程鱼类变化-基地模式详情表格接口 export function fishQgcDetail(data: any) { return request({ - url: '/api/wmp-env-server/env/we/fisht/qgcDetail/GetKendoListCust', + url: '/wte/we/fisht/qgcDetail/GetKendoListCust', + method: 'post', + data + }); +} + +// 水生生态调查-鱼类列表统计 +export function getFishListStat(data: any) { + return request({ + url: '/wte/we/fishList/stat/qgc/GetKendoListCust', method: 'post', data }); @@ -87,7 +96,7 @@ export function fishQgcDetail(data: any) { // 陆生生态监测情况-获取统计数据 export function getEvnmAutoMonitor(data: any) { return request({ - url: '/api/dec-lygk-base-server/base/evnmAutoMonitor/GetKendoListCust', + url: '/wte/base/evnmAutoMonitor/GetKendoListCust', method: 'post', data }); @@ -96,7 +105,7 @@ export function getEvnmAutoMonitor(data: any) { // 陆生生态监测-红外相机信息表格 export function getVmsstbprptList(data: any) { return request({ - url: '/api/dec-lygk-base-server/base/vmsstbprpt/GetKendoList', + url: '/wte/vmsstbprpt/GetKendoList', method: 'post', data }); @@ -105,7 +114,7 @@ export function getVmsstbprptList(data: any) { // 陆生生态监测-重点陆生动物表格 export function getTetSpecList(data: any) { return request({ - url: '/api/wmp-env-server/te/tet/spec/GetKendoListCust', + url: '/wte/te/tet/spec/GetKendoListCust', method: 'post', data }); @@ -114,7 +123,7 @@ export function getTetSpecList(data: any) { // 野生动物监测-获取运行数据 export function getWvaData(data: any) { return request({ - url: '/api/wmp-env-server/env/wva/GetKendoListCust', + url: '/wte/wva/GetKendoListCust', method: 'post', data }); @@ -123,7 +132,7 @@ export function getWvaData(data: any) { // 野生动物监测-获取默认数据 export function getWvaDftData(data: any) { return request({ - url: '/api/wmp-env-server/env/wva/default/GetKendoListCust', + url: '/wte/wva/default/GetKendoListCust', method: 'post', data }); @@ -132,7 +141,25 @@ export function getWvaDftData(data: any) { // 野生动物监测-获取默认年份列表 export function getWvaDftTm(data: any) { return request({ - url: '/api/wmp-env-server/env/wva/year/GetKendoListCust', + url: '/wte/wva/year/GetKendoListCust', + method: 'post', + data + }); +} + +// 水生生态调查对比-获取断面和批次列表 +export function getFishtKendoList(data: any) { + return request({ + url: '/wte/we/fisht/GetKendoListCust', + method: 'post', + data + }); +} + +// 水生生态调查对比-获取对比柱状图数据 +export function getCompareBar(data: any) { + return request({ + url: '/wte/we/compareBar/GetKendoListCust', method: 'post', data }); diff --git a/frontend/src/api/stll/index.ts b/frontend/src/api/stll/index.ts index 58db464a..bfa8ced7 100644 --- a/frontend/src/api/stll/index.ts +++ b/frontend/src/api/stll/index.ts @@ -39,6 +39,13 @@ export function vmsstbprptGetKendoList(queryParams: any) { data: queryParams }); } +export function vmsstbprptGetKendoList1(queryParams: any) { + return request({ + url: '/eq/vmsstbprpt/GetKendoList', + method: 'post', + data: queryParams + }); +} //生态流量达标情况 export function eqqecRateCount(queryParams: any) { return request({ diff --git a/frontend/src/api/yldc/index.ts b/frontend/src/api/yldc/index.ts index 4643b2f1..3282a2ac 100644 --- a/frontend/src/api/yldc/index.ts +++ b/frontend/src/api/yldc/index.ts @@ -15,6 +15,13 @@ export function msstbprptGetKendoList(data: any) { data }); } +export function VDmsstbprptGetKendoList(data: any) { + return request({ + url: '/vd/msstbprpt/GetKendoList', + method: 'post', + data + }); +} //获取鱼类介绍 export function fishDicGetKendoList(data: any) { return request({ diff --git a/frontend/src/api/zngj/index.ts b/frontend/src/api/zngj/index.ts new file mode 100644 index 00000000..c7b1bc6b --- /dev/null +++ b/frontend/src/api/zngj/index.ts @@ -0,0 +1,91 @@ +import request from '@/utils/request'; + +// AI识别大坝环境-获取统计数据(Tab数量) +export function getAisbdbyxList(data: any) { + return request({ + url: '/api/wmp-env-server/env/ai/com/qgcDmRun/GetKendoListCust', + method: 'post', + data + }); +} + +// AI识别大坝环境-获取饼图+表格数据 +export function getAiChartTable(data: any) { + return request({ + url: '/api/wmp-env-server/env/ai/com/GetKendoListCust', + method: 'post', + data + }); +} + +// AI识别大坝环境-获取电站列表 +export function getAiRstcd(data: any) { + return request({ + url: '/api/wmp-env-server/env/ai/com/qgc/aiRstcd/GetKendoListCust', + method: 'post', + data + }); +} + +// AI识别过鱼设施运行-获取统计数据 +export function getAiGyssList(data: any) { + return request({ + url: '/api/wmp-env-server/env/ai/com/qgcProtect/GetKendoListCust', + method: 'post', + data + }); +} + +// 生态流量低于限值告警-获取统计数据 +export function getStllGaojingList(data: any) { + return request({ + url: '/api/wmp-env-server/env/warn/stcd/eng/GetKendoListCust', + method: 'post', + data + }); +} + +// 生态流量低于限值告警-获取表格详情数据 +export function getStllGaojingDetail(data: any) { + return request({ + url: '/api/wmp-env-server/env/warn/stcd/GetKendoListCust', + method: 'post', + data + }); +} + +// 水质监测数据告警-获取统计数据 +export function getShuizhiGaojingList(data: any) { + return request({ + url: '/api/dec-lygk-base-server/base/msstbprpt/GetKendoList', + method: 'post', + data + }); +} + +// AI识别大坝环境-获取漂浮物/清漂日历数据 +export function getAiPfwRecord(data: any) { + return request({ + url: '/api/wmp-env-server/env/ai/com/qgc/aiPfwRecord/GetKendoListCust', + method: 'post', + data + }); +} + +// AI识别大坝环境-获取叠梁门日历数据 +export function getAiRecord(data: any) { + return request({ + url: '/api/wmp-env-server/env/ai/com/qgc/aiRecord/GetKendoListCust', + method: 'post', + data + }); +} + +// AI识别大坝环境-获取日历详情视频数据 +export function getAiFile(data: any) { + return request({ + url: '/api/wmp-env-server/env/ai/com/qgc/aiFile/GetKendoListCust', + method: 'post', + data + }); +} diff --git a/frontend/src/assets/svg/diwenshuijianhuan.svg b/frontend/src/assets/svg/diwenshuijianhuan.svg new file mode 100644 index 00000000..334378b6 --- /dev/null +++ b/frontend/src/assets/svg/diwenshuijianhuan.svg @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/frontend/src/assets/svg/guojiashuiwenzhan.svg b/frontend/src/assets/svg/guojiashuiwenzhan.svg new file mode 100644 index 00000000..ac788c8e --- /dev/null +++ b/frontend/src/assets/svg/guojiashuiwenzhan.svg @@ -0,0 +1,16 @@ + + + guojiashuiwenzhan + + + + + + + + + + + + + \ No newline at end of file diff --git a/frontend/src/assets/svg/guojiashuizhizhan.svg b/frontend/src/assets/svg/guojiashuizhizhan.svg new file mode 100644 index 00000000..8244b65f --- /dev/null +++ b/frontend/src/assets/svg/guojiashuizhizhan.svg @@ -0,0 +1,13 @@ + + + guojiashuizhizhan + + + + + + + + + + \ No newline at end of file diff --git a/frontend/src/assets/svg/liuliangjiancezhan.svg b/frontend/src/assets/svg/liuliangjiancezhan.svg new file mode 100644 index 00000000..8575ff7b --- /dev/null +++ b/frontend/src/assets/svg/liuliangjiancezhan.svg @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/frontend/src/assets/svg/qixiangzhan.svg b/frontend/src/assets/svg/qixiangzhan.svg new file mode 100644 index 00000000..35374b96 --- /dev/null +++ b/frontend/src/assets/svg/qixiangzhan.svg @@ -0,0 +1,16 @@ + + + qixiangzhan + + + + + + + + + + + + + \ No newline at end of file diff --git a/frontend/src/assets/svg/qixidi.svg b/frontend/src/assets/svg/qixidi.svg new file mode 100644 index 00000000..ea3b599c --- /dev/null +++ b/frontend/src/assets/svg/qixidi.svg @@ -0,0 +1,9 @@ + + + qixidi + + + + + + \ No newline at end of file diff --git a/frontend/src/assets/svg/shipinjiankongshebei.svg b/frontend/src/assets/svg/shipinjiankongshebei.svg new file mode 100644 index 00000000..74cbd7ce --- /dev/null +++ b/frontend/src/assets/svg/shipinjiankongshebei.svg @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/frontend/src/assets/svg/shuizhijiancezhan.svg b/frontend/src/assets/svg/shuizhijiancezhan.svg new file mode 100644 index 00000000..0925a2c4 --- /dev/null +++ b/frontend/src/assets/svg/shuizhijiancezhan.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/src/assets/svg/zengzhizhanshuizhizhan.svg b/frontend/src/assets/svg/zengzhizhanshuizhizhan.svg new file mode 100644 index 00000000..7632b476 --- /dev/null +++ b/frontend/src/assets/svg/zengzhizhanshuizhizhan.svg @@ -0,0 +1,9 @@ + + + zengzhizhanshuizhizhan + + + + + + \ No newline at end of file diff --git a/frontend/src/assets/svg/zijianshuiwenzhan.svg b/frontend/src/assets/svg/zijianshuiwenzhan.svg new file mode 100644 index 00000000..9114c677 --- /dev/null +++ b/frontend/src/assets/svg/zijianshuiwenzhan.svg @@ -0,0 +1,16 @@ + + + zijianshuiwenzhan + + + + + + + + + + + + + \ No newline at end of file diff --git a/frontend/src/components/MapModal/column.config.ts b/frontend/src/components/MapModal/column.config.ts index e4e1b39d..f40cef4d 100644 --- a/frontend/src/components/MapModal/column.config.ts +++ b/frontend/src/components/MapModal/column.config.ts @@ -3288,6 +3288,45 @@ const DwSixPointColumns: Array = [ url: '' } ]; +//DW +const DwPointColumnsyuan: Array = [ + { + name: '基本属性', + visible: false, + ruleTips: '', + type: '', + url: '' + }, + { + name: '设施名称', + filed: 'stnm', + visible: true, + type: 'input', + url: '' + }, + + { + name: '站址', + filed: 'stlc', + visible: true, + type: 'select', + url: '' + }, + { + name: '所属流域', + filed: 'hbrvcdName', + visible: true, + type: 'select', + url: '' + }, + { + name: '所属电站', + filed: 'ennm', + visible: true, + type: 'select', + url: '' + }, +]; //夹岩双层取水 const DwOnePointColumns: Array = [ { @@ -4145,8 +4184,7 @@ const EQPointColumns7: Array = [ visible: true, type: 'select', url: '' - }, - + } ]; //阶段属性 const basicFilterColumns: Array = [ @@ -4831,6 +4869,58 @@ const tableColumns5: Array = [ setting: {} } ]; +//气象监测 +const MMColumns: Array = [ + { + name: '基本属性', + visible: false, + ruleTips: '', + type: '', + url: '' + }, { + name: '测站名称', + filed: 'stnm', + visible: true, + type: 'input', + url: '' + }, + { + name: '测站类型', + filed: 'sttpName', + visible: true, + type: 'select', + url: '' + }, + { + name: '站址', + filed: 'addvcdName', + visible: true, + type: 'input', + url: '' + }, + { + name: '所属流域', + filed: 'hbrvcdName', + visible: true, + type: 'select', + url: '' + }, + { + name: '所在水系', + filed: 'addvcdName', + visible: true, + type: 'input', + url: '' + }, + { + name: '建成日期', + filed: 'jcdt', + visible: true, + type: 'date', + format: 'YYYY-MM-DD', + url: '' + }, +]; //生态流量 const EcologicalFlowColumns: Array = []; @@ -4873,6 +4963,7 @@ export { DwFivePointColumns, DwSixPointColumns, DwOnePointColumns, + DwPointColumnsyuan, EQPointColumns2, EQPointColumns5, EQPointColumns3, @@ -4886,5 +4977,6 @@ export { tableColumns2, tableColumns3, tableColumns4, - tableColumns5 + tableColumns5, + MMColumns }; diff --git a/frontend/src/components/MapModal/components/BasicInfo.vue b/frontend/src/components/MapModal/components/BasicInfo.vue index fcdaa8ef..c66884fa 100644 --- a/frontend/src/components/MapModal/components/BasicInfo.vue +++ b/frontend/src/components/MapModal/components/BasicInfo.vue @@ -142,6 +142,8 @@ import { DwFivePointColumns, DwSixPointColumns, DwOnePointColumns, + DwPointColumnsyuan, + MMColumns, StinfoAiVidoPointColumns } from '../column.config'; import { useModelStore } from '@/store/modules/model'; @@ -318,6 +320,14 @@ const columnsConfig = ref([ { type: 'ZQ', columns: FhZQPointColumns + }, + { + type: 'DW', + columns: DwPointColumnsyuan + }, + { + type:'MM', + columns:MMColumns } //DW_1 diff --git a/frontend/src/components/MapModal/setting.config.ts b/frontend/src/components/MapModal/setting.config.ts index aeea96a7..a8231528 100644 --- a/frontend/src/components/MapModal/setting.config.ts +++ b/frontend/src/components/MapModal/setting.config.ts @@ -199,14 +199,14 @@ const ENGEQTabs: Array = [ ].filter(Boolean); // // 水电站生态流量 - 江局单独看 √ -// const ENGEQTabsJuangJu: Array = [ -// { -// name: '生态流量', -// key: 'EcologicalFlow', -// type: 'EcologicalFlow' -// }, - -// ].filter(Boolean) +const ENGEQTabsJuangJu: Array = [ + { + name: '生态流量', + key: 'EcologicalFlow', + type: 'EcologicalFlow', + default: true + } +].filter(Boolean); // //生态流量泄放设施 √ const EQTabs: Array = [ { @@ -310,9 +310,8 @@ const FPTabs1: Array = [ name: '基础信息', key: 'basicInfo', type: 'basic', - default: true, // 默认显示 - url: '/api/dec-lygk-base-server/base/msstbprpt/getStcdInfo', - + default: true, // 默认显示 + url: '/api/dec-lygk-base-server/base/msstbprpt/getStcdInfo' }, { name: '实时视频', @@ -956,15 +955,23 @@ const CommonTabs: any = [ } ]; -// // 气象站 -// const WeatherTabs: any = [ -// { -// name: '基础信息', -// key: 'basicInfo', -// type: 'basic', -// url: '/bbi/siteBipc/getSiteBasicInfo' -// } -// ] +// 气象站 +const WeatherTabs: any = [ + { + name: '基础信息', + key: 'basicInfo', + type: 'basic', + url: '/api/dec-lygk-base-server/base/msstbprpt/getStcdInfo', + default: true // 默认显示 + }, + { + name: '监测数据', + key: '', + type: '', + url: '' + }, + +] // const WaterQualityMonitoring: any = [ // { @@ -1033,6 +1040,8 @@ const handleTabs = (modaldata: any) => { const sttp = modaldata?.sttp ? modaldata?.sttp.toUpperCase() : ''; console.log('sttp', sttp); switch (sttp) { + case 'ENGJJ': + return ENGEQTabsJuangJu; case 'ENG': if (modaldata?.eqtp == 'QEC') { return ENGEQTabs; @@ -1223,8 +1232,8 @@ const handleTabs = (modaldata: any) => { // } // case 'WE': // return WETabs - // case 'MM': - // return WeatherTabs + case 'MM': + return WeatherTabs // case 'WARN': // return WaterQualityMonitoring // case 'AI': diff --git a/frontend/src/components/SidePanelItem/index.vue b/frontend/src/components/SidePanelItem/index.vue index abbfc6d5..e8dd8708 100644 --- a/frontend/src/components/SidePanelItem/index.vue +++ b/frontend/src/components/SidePanelItem/index.vue @@ -47,7 +47,6 @@
-
@@ -78,7 +77,7 @@ >
-
+
@@ -190,6 +189,7 @@ interface SelectConfig { value?: string | undefined; options?: SelectProps['options']; width?: string; + minWidth?: string; } // 定义组件名(便于调试和递归) @@ -248,7 +248,8 @@ const props = defineProps({ show: false, value: undefined, options: [], - width: '' + width: '', + minWidth: '' }) }, moreSelect: { @@ -661,7 +662,7 @@ const handleTreeSelect = (selectedKeys: string | string[], info: any) => { } moreSelectValue.value = selectedValue; - // + // // 保存选中节点的额外属性(如 lgtd、lttd 等) if (info && typeof info === 'object') { selectedNodeExtra.value = { @@ -690,7 +691,6 @@ const handleTreeExpand = (keys: string[]) => { // 下拉选择框事件处理 const handleChange = (value: string) => { - // Handle change }; diff --git a/frontend/src/components/developStatusChart/index.vue b/frontend/src/components/developStatusChart/index.vue index 5b0fd9fb..235a8a25 100644 --- a/frontend/src/components/developStatusChart/index.vue +++ b/frontend/src/components/developStatusChart/index.vue @@ -1,49 +1,29 @@ - + \ No newline at end of file + diff --git a/frontend/src/components/engEnvironmentData/index.vue b/frontend/src/components/engEnvironmentData/index.vue index f95868b1..77bc1cd0 100644 --- a/frontend/src/components/engEnvironmentData/index.vue +++ b/frontend/src/components/engEnvironmentData/index.vue @@ -1,9 +1,6 @@ \ No newline at end of file + const baseFilters: any[] = [ + { field: 'sttpCode', operator: 'eq', dataType: 'string', value: 'ENG' }, + { field: 'bldsttCcode', operator: 'in', dataType: 'string', value: ['1', '2'] } + ]; + if (baseid.value !== 'all') { + baseFilters.unshift({ field: 'baseId', operator: 'eq', dataType: 'string', value: baseid.value }); + } + + const params1 = { + filter: { + logic: 'and', + filters: [ + ...baseFilters, + { field: 'prsc', operator: 'in', dataType: 'string', value: ['1', '2', '3'] } + ] + } + }; + + const params2 = { + filter: { + logic: 'and', + filters: [ + ...baseFilters, + { field: 'runState', operator: 'eq', dataType: 'number', value: 4 }, + { field: 'dtin', operator: 'eq', dataType: 'number', value: 1 } + ] + } + }; + + const params3 = { + filter: { + logic: 'and', + filters: [ + ...baseFilters, + { field: 'prsc', operator: 'in', dataType: 'string', value: ['1', '2', '3'] }, + { field: 'dtinEnv', operator: 'in', dataType: 'string', value: ['2'] } + ] + } + }; + + try { + dataLoading.value = true; + const [res1, res2, res3] = await Promise.all([ + getVmsstbprptKendoList(params1), + getVmsstbprptKendoList(params2), + getVmsstbprptKendoList(params3) + ]); + + const record = { one: 0, two: 0, three: 0 }; + const responses = [res1, res2, res3]; + responses.forEach((res, index) => { + const total = res?.data?.total ?? 0; + switch (index) { + case 0: + record.one = total; + break; + case 1: + record.two = total; + break; + case 2: + record.three = total; + break; + } + }); + data.value = record; + // debugger + } catch (error) { + console.error('EngEnvironmentData getData error:', error); + } finally { + dataLoading.value = false; + } +}; + +const handleItemClick = (name: string) => { + emit('item-click', { name }); +}; + +watch( + () => JidiSelectEventStore.selectedItem, + newVal => { + if (newVal && newVal.wbsCode) { + baseid.value = newVal.wbsCode; + getData(); + } + }, + { deep: true, immediate: true } +); + diff --git a/frontend/src/modules/alongFishMod/TwoLayers/Yanchengyulei.vue b/frontend/src/modules/alongFishMod/TwoLayers/Yanchengyulei.vue index 8d7f6e9f..6b43cfe6 100644 --- a/frontend/src/modules/alongFishMod/TwoLayers/Yanchengyulei.vue +++ b/frontend/src/modules/alongFishMod/TwoLayers/Yanchengyulei.vue @@ -3,15 +3,22 @@
- - + + + > + + {{ opt.label }} + + @@ -20,21 +27,35 @@ v-model:value="formState.rvcd" placeholder="请选择" style="width: 150px" - :options="lyOptions" @change="handleRvcdChange" - /> + > + + {{ opt.label }} + + - + @@ -57,11 +78,20 @@ - - + +
- + -