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