| | |
| | | |
| | | private String queryType; |
| | | |
| | | private String shpName; |
| | | |
| | | public SeLayer() { |
| | | this.data = new JSONArray(); |
| | | } |
| | |
| | | this.data = new JSONArray(); |
| | | } |
| | | |
| | | public SeLayer(String id, String name, Integer dataType, List<SeField> fields) { |
| | | public SeLayer(String id, String name, String shpName, Integer dataType, List<SeField> fields) { |
| | | this(); |
| | | this.id = id; |
| | | this.name = name; |
| | | this.shpName = shpName; |
| | | this.dataType = dataType; |
| | | this.fields = fields; |
| | | this.queryType = getQueryType(dataType); |
| | |
| | | } |
| | | } |
| | | |
| | | public void addData(JSONArray arr){ |
| | | public void addData(JSONArray arr) { |
| | | this.data.addAll(arr); |
| | | } |
| | | |
| | |
| | | public void setQueryType(String queryType) { |
| | | this.queryType = queryType; |
| | | } |
| | | |
| | | public String getShpName() { |
| | | return shpName; |
| | | } |
| | | |
| | | public void setShpName(String shpName) { |
| | | this.shpName = shpName; |
| | | } |
| | | } |
| | |
| | | @Value("#{'${sedb.layerNames}'}") |
| | | List<String> layerNames; |
| | | |
| | | @Value("#{'${sedb.shpNames}'}") |
| | | List<String> shpNames; |
| | | |
| | | @Value("#{'${sedb.sysFields}'}") |
| | | List<String> sysFields; |
| | | |
| | |
| | | Integer dataType = jb.getInt("_data_type"); |
| | | List<SeField> fields = JSONUtil.toList(jb.getJSONArray("fields"), SeField.class); |
| | | fields = fields.stream().filter(f -> !sysFields.contains(f.getName())).collect(Collectors.toList()); |
| | | String shpName = shpNames.get(layerNames.indexOf(name)); |
| | | |
| | | layers.add(new SeLayer(id, name, dataType, fields)); |
| | | layers.add(new SeLayer(id, name, shpName, dataType, fields)); |
| | | } |
| | | } |
| | | |
| | |
| | | dbName: 通州水利仿真4548 |
| | | pageSize: 2000 |
| | | layerNames: 管点,管线,建筑物 |
| | | shpNames: pipePoint,pipeLine,building |
| | | sysFields: _ext_attr,_meta_id,_attach_files,_x,_y,_z,operatetime,operator,_is_latest,_data_type,groupid,id,shape_length,shape_area |