Эх сурвалжийг харах

Merge branch 'dev' of http://114.244.114.158:8802/siwei/sanya-data-management-back

DESKTOP-2K9OVK9\siwei 2 сар өмнө
parent
commit
b11dc5109e

+ 1 - 0
README.md

@@ -1,6 +1,7 @@
 # sanya-data-management-back
 
 实景三维三亚后台管理系统
+1
 
 # 数据处理
 

+ 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));
     }
 

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

@@ -283,7 +283,7 @@ public class TableDataSelectServiceImpl implements TableDataSelectService {
             return;
         }
         if (StringUtils.isEmpty(groupColumn)) {
-            return;
+            groupColumn = ",siweiarea,geom";
         }
         String[] groupColumns = groupColumn.split(",", -1);
         if (groupColumns.length < 3) {
@@ -297,7 +297,7 @@ public class TableDataSelectServiceImpl implements TableDataSelectService {
             TableLayerJgTempDTO map = new TableLayerJgTempDTO();
             map.setId(uid);
             for (TableDataVo tableVo : dataVo) {
-                if (tableVo.getFiled().equals(groupValue)) {
+                if (StringUtils.isNotEmpty(groupValue) && tableVo.getFiled().equals(groupValue)) {
                     map.setGroupvalue(tableVo.getData().toString());
                 } else if (tableVo.getFiled().equals(sumValue)) {
                     map.setSumvalue(tableVo.getData().toString());
@@ -305,6 +305,9 @@ public class TableDataSelectServiceImpl implements TableDataSelectService {
                     map.setGeomvalue(tableVo.getData().toString());
                 }
             }
+            if (StringUtils.isEmpty(groupValue)) {
+                map.setGroupvalue("未知");
+            }
             retList.add(map);
         }
         tableLayerJgTempMapper.insertTableLayerJgTempList(retList);
@@ -377,7 +380,7 @@ public class TableDataSelectServiceImpl implements TableDataSelectService {
         if (retDataList == null || retDataList.size() <= 0) {
             return retList;
         }
-        return dataMapTransFormZh(retDataList, filedlist);
+        return dataMapTransFormZhV1(retDataList, filedlist);
     }
 
     //取并集的函数
@@ -805,6 +808,64 @@ public class TableDataSelectServiceImpl implements TableDataSelectService {
                 v_dataList.add(tableDataVo);
             }
             Object siweiarea = v_data.get("siweiarea");
+            if (StringUtils.isNotNull(siweiarea)) {
+                // 面积
+                Double siweimj = new BigDecimal(String.valueOf(siweiarea)).setScale(2, RoundingMode.HALF_UP).doubleValue();
+                TableDataVo tableDataVo = new TableDataVo();
+                tableDataVo.setData(siweimj);
+                tableDataVo.setFiledZH("面积(平方米)");
+                tableDataVo.setFiled("siweiarea");
+                v_dataList.add(tableDataVo);
+                if (siweimj > 0.01) {
+                    retList.add(v_dataList);
+                }
+            }
+
+        }
+        return retList;
+    }
+
+    /**
+     * 汉化判断,如果没有就是要原始类型
+     *
+     * @param from_jg
+     * @param filedList
+     * @return
+     */
+    public List<List<TableDataVo>> dataMapTransFormZhV1(List<Map> from_jg, List<TableFiledDTO> filedList) {
+        List<List<TableDataVo>> retList = new ArrayList<>();
+        if (from_jg == null || from_jg.size() == 0) {
+            return retList;
+        }
+        //循环结果
+        for (Map v_data : from_jg) {
+            //循环字段
+            List<TableDataVo> v_dataList = new ArrayList<>();
+            if (filedList == null || filedList.size() == 0) {
+                for (Object key : v_data.keySet()) {
+                    if (!"siweiarea".equals(key)) {
+                        String keyString = (String) key;
+                        Object v_filedData = v_data.get(keyString);
+                        TableDataVo tableDataVo = new TableDataVo();
+                        tableDataVo.setData(v_filedData);
+                        tableDataVo.setFiledZH(keyString);
+                        tableDataVo.setFiled(keyString);
+                        v_dataList.add(tableDataVo);
+                    }
+                }
+            } else {
+                for (TableFiledDTO v_filed_data : filedList) {
+                    String v_filedName = v_filed_data.getFiledName();
+                    String v_filedZh = v_filed_data.getFiledZh();
+                    Object v_filedData = v_data.get(v_filedName);
+                    TableDataVo tableDataVo = new TableDataVo();
+                    tableDataVo.setData(v_filedData);
+                    tableDataVo.setFiledZH(v_filedZh);
+                    tableDataVo.setFiled(v_filedName);
+                    v_dataList.add(tableDataVo);
+                }
+            }
+            Object siweiarea = v_data.get("siweiarea");
             if (StringUtils.isNotNull(siweiarea)) {
                 // 面积
                 TableDataVo tableDataVo = new TableDataVo();
@@ -825,13 +886,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);

+ 1 - 1
onemap-modules/onemap-apply/src/main/java/com/onemap/apply/service/table/TableDataSelectService.java

@@ -21,5 +21,5 @@ public interface TableDataSelectService {
     Map dataQueryByPolygon(String sourceDataId, String sourcePolygonWkt, String sourceLayerId, String sourceLayerType, String queryTableId);
 
 
-    List<TableLayerDTO> dataQueryLayer(String defaultType, String layerId);
+    List<TableLayerDTO> dataQueryLayer(String defaultType, String layerId) throws Exception;
 }