初始化
This commit is contained in:
parent
ec7a1d2c09
commit
3e10221805
@ -4,13 +4,15 @@ package com.gis3c.ol.service;
|
||||
import com.gis3c.ol.entity.Layer;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* Created by hukekuan on 2017/12/15.
|
||||
*/
|
||||
public interface LayerService {
|
||||
public List<Layer> findLayerList();
|
||||
public List<Map<String,Object>> findLayerList();
|
||||
public List<Layer> findSimpleLayerList();
|
||||
public List<java.util.Map<String,Object>> findLayersByPage(Integer pageSize,Integer currentPage);
|
||||
|
||||
public Layer findeLayerById(String layerId);
|
||||
|
||||
@ -2,6 +2,7 @@ package com.gis3c.ol.service.impl;
|
||||
import com.gis3c.common.bean.BeanUtil;
|
||||
import com.gis3c.common.exception.BusinessException;
|
||||
import com.gis3c.ol.dao.LayerDao;
|
||||
import com.gis3c.ol.dao.SourceDao;
|
||||
import com.gis3c.ol.entity.Layer;
|
||||
import com.gis3c.ol.service.LayerService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@ -17,9 +18,30 @@ public class LayerServiceImpl implements LayerService {
|
||||
@Autowired
|
||||
private LayerDao layerDao;
|
||||
|
||||
@Autowired
|
||||
private SourceDao sourceDao;
|
||||
|
||||
@Override
|
||||
public List<Layer> findAllList() {
|
||||
return layerDao.findAllList();
|
||||
public List<Map<String, Object>> findLayerList() {
|
||||
List<Map<String, Object>> result = new ArrayList<>();
|
||||
Map<String, Object> layerMap;
|
||||
String sourceId;
|
||||
List<Layer> layerList = layerDao.findLayerList();
|
||||
for(int i = 0,len = layerList.size();i < len;i++){
|
||||
layerMap = new HashMap<>();
|
||||
layerMap.put("layer",layerList.get(i));
|
||||
sourceId = layerList.get(i).getSource();
|
||||
if(sourceId != null && !"".equals(sourceId)){
|
||||
layerMap.put("source",sourceDao.findSourceById(sourceId));
|
||||
}
|
||||
result.add(layerMap);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Layer> findSimpleLayerList() {
|
||||
return layerDao.findLayerList();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -29,6 +29,10 @@ public class App {
|
||||
MapService mapService = context.getBean(MapService.class);
|
||||
TestService testService = context.getBean(TestService.class);
|
||||
|
||||
|
||||
List<Layer> layerList = layerService.findSimpleLayerList();
|
||||
System.out.println(layerList);
|
||||
|
||||
// java.util.Map<String,Object> layerOptions = new HashMap<>();
|
||||
// layerOptions.put("a","aaaaaaaa");
|
||||
// layerOptions.put("b","bbbbbbbb");
|
||||
@ -123,13 +127,13 @@ public class App {
|
||||
//
|
||||
// System.out.println("插入成功");
|
||||
|
||||
mapService.bindLayer("15a67947-8dc7-46f4-bc06-5c2fc51609d9",new String[]{
|
||||
"e8819b8e-9397-4609-8b23-9f18c9588d6b",
|
||||
"9e3a9812-5921-45c9-9043-e52d81fff1bb",
|
||||
"ea6444b3-710f-4516-af9a-aa8270276883",
|
||||
"aabb842e-239e-491d-9c70-a2cec1f65886"
|
||||
});
|
||||
System.out.println("修改成功");
|
||||
// mapService.bindLayer("15a67947-8dc7-46f4-bc06-5c2fc51609d9",new String[]{
|
||||
// "e8819b8e-9397-4609-8b23-9f18c9588d6b",
|
||||
// "9e3a9812-5921-45c9-9043-e52d81fff1bb",
|
||||
// "ea6444b3-710f-4516-af9a-aa8270276883",
|
||||
// "aabb842e-239e-491d-9c70-a2cec1f65886"
|
||||
// });
|
||||
// System.out.println("修改成功");
|
||||
|
||||
//图层接口
|
||||
// Layer layer = new Layer();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user