فهرست منبع

级联查询图层未配置,会进行警告

DESKTOP-2K9OVK9\siwei 4 ماه پیش
والد
کامیت
36ff54b1c2

+ 1 - 1
onemap-modules/onemap-apply/src/main/java/com/onemap/apply/controller/table/TableDataSelectController.java

@@ -36,7 +36,7 @@ public class TableDataSelectController extends BaseController {
     }
 
     @GetMapping("/query/layer")
-    public RequestResult queryLayerList(String defaultType, String layerId) {
+    public RequestResult queryLayerList(String defaultType, String layerId) throws Exception {
         return RequestResult.success(tableDataSelectService.dataQueryLayer(defaultType, layerId));
     }
 

+ 4 - 1
onemap-modules/onemap-apply/src/main/java/com/onemap/apply/service/impl/table/TableDataSelectServiceImpl.java

@@ -825,13 +825,16 @@ public class TableDataSelectServiceImpl implements TableDataSelectService {
 
 
     @Override
-    public List<TableLayerDTO> dataQueryLayer(String defaultType, String layerId) {
+    public List<TableLayerDTO> dataQueryLayer(String defaultType, String layerId) throws Exception {
         List<TableLayerDTO> retList = new ArrayList<>();
         if (StringUtils.isNotBlank(layerId)) {
             QueryWrapper<TableLayerDTO> queryTableLayerWrapper = new QueryWrapper<>();
             queryTableLayerWrapper.eq("layer_id", layerId);
             retList = tableLayerMapper.selectList(queryTableLayerWrapper);
         }
+        if (retList == null || retList.isEmpty()) {
+            throw new Exception("图层未配置,请配置相应图层信息");
+        }
         QueryWrapper<TableLayerDTO> queryTableLayerWrapper = new QueryWrapper<>();
         if (StringUtils.isNotBlank(defaultType)) {
             queryTableLayerWrapper.eq("default_type", defaultType);