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 index 3ad7fa4a..03d26c78 100644 --- 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 @@ -49,6 +49,9 @@ public class MapLegendVo { @Schema(description = "是否默认勾选;0=否;1=是") private Integer checked; + @Schema(description = "0=否;1=是") + private Integer enable; + @Schema(description = "是否可勾选;0=否;1=是") private Integer canBeChecked; 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 e0b8ba83..4422193a 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 @@ -8,7 +8,11 @@ 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.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.MsMaplayerBMapper; +import com.yfd.platform.qgc_sys.mapLayer.service.IMapLegendService; 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; @@ -39,6 +43,11 @@ public class MapmoduleBController { @Resource private SysMenuMapper sysMenuMapper; + @Resource + private IMapLegendService mapLegendService; + + @Resource + private MsMaplayerBMapper msMaplayerBMapper; /** * 条件过滤数据列表(Kendo UI 数据源) */ @@ -136,6 +145,43 @@ public class MapmoduleBController { if (StrUtil.isBlank(mapmoduleB.getResId())) { throw new BizException("资源(resId)不能为空."); } + + if ("legend".equals(mapmoduleB.getResType())) { + MsMaplegendB maplegendB = mapLegendService.getById(mapmoduleB.getResId()); + if (maplegendB != null && StrUtil.isNotBlank(maplegendB.getLayerCode())) { + LambdaQueryWrapper layerWrapper = new LambdaQueryWrapper<>(); + layerWrapper.eq(MsMaplayerB::getCode, maplegendB.getLayerCode()); + layerWrapper.eq(MsMaplayerB::getIsDeleted, 0); + MsMaplayerB layer = msMaplayerBMapper.selectOne(layerWrapper); + if (layer != null) { + LambdaQueryWrapper moduleWrapper = new LambdaQueryWrapper<>(); + moduleWrapper.eq(MsMapmoduleB::getModuleId, mapmoduleB.getModuleId()); + moduleWrapper.eq(MsMapmoduleB::getSystemId, mapmoduleB.getSystemId()); + moduleWrapper.eq(MsMapmoduleB::getResType, "layer"); + moduleWrapper.eq(MsMapmoduleB::getResId, layer.getId()); + moduleWrapper.eq(MsMapmoduleB::getIsDeleted, 0); + MsMapmoduleB existingLayerModule = mapmoduleBService.getOne(moduleWrapper); + + if (existingLayerModule == null) { + MsMapmoduleB layerModule = new MsMapmoduleB(); + layerModule.setModuleId(mapmoduleB.getModuleId()); + layerModule.setSystemId(mapmoduleB.getSystemId()); + layerModule.setResType("layer"); + layerModule.setResId(layer.getId()); + layerModule.setChildNode(mapmoduleB.getChildNode()); + layerModule.setMultiSelect(mapmoduleB.getMultiSelect()); + layerModule.setCanBeChecked(mapmoduleB.getCanBeChecked()); + layerModule.setChecked(mapmoduleB.getChecked()); + layerModule.setDescription(mapmoduleB.getDescription()); + layerModule.setEnable(mapmoduleB.getEnable()); + layerModule.setOrderIndex(mapmoduleB.getOrderIndex()); + layerModule.setFilterContent(mapmoduleB.getFilterContent()); + mapmoduleBService.saveOrUpdate(layerModule); + } + } + } + } + return ResponseResult.successData(mapmoduleBService.saveOrUpdate(mapmoduleB)); } diff --git a/backend/src/main/resources/application-dev.yml b/backend/src/main/resources/application-dev.yml index bd24f5a8..ccbcb104 100644 --- a/backend/src/main/resources/application-dev.yml +++ b/backend/src/main/resources/application-dev.yml @@ -22,6 +22,18 @@ spring: mvc: pathmatch: matching-strategy: ant_path_matcher + data: + redis: + host: ${REDIS_HOST:localhost} + port: ${REDIS_PORT:6379} + password: ${REDIS_PASSWORD:} + timeout: 10000ms + lettuce: + pool: + max-active: 8 + max-idle: 8 + min-idle: 2 + max-wait: 10000ms servlet: multipart: max-file-size: 300MB diff --git a/backend/src/main/resources/application-prod.yml b/backend/src/main/resources/application-prod.yml index b125d232..294c61ea 100644 --- a/backend/src/main/resources/application-prod.yml +++ b/backend/src/main/resources/application-prod.yml @@ -109,6 +109,18 @@ spring: mvc: pathmatch: matching-strategy: ant_path_matcher + data: + redis: + host: ${REDIS_HOST:localhost} + port: ${REDIS_PORT:6379} + password: ${REDIS_PASSWORD:} + timeout: 10000ms + lettuce: + pool: + max-active: 8 + max-idle: 8 + min-idle: 2 + max-wait: 10000ms servlet: multipart: max-file-size: 300MB