初始化

This commit is contained in:
hukekuan@163.com 2018-02-06 18:17:48 +08:00
parent 9ba507cb45
commit 968f8c4d98
10 changed files with 49 additions and 22 deletions

View File

@ -19,7 +19,9 @@ public interface SourceDao {
@Param("currentPage") Integer currentPage); @Param("currentPage") Integer currentPage);
public Source findSourceById(String sourceId); public Source findSourceById(String sourceId);
public Source findSourceByName(String sourceName); public Source findSourceByName(String sourceName);
public List<Source> findSourceByType(String[] sourceTypes); public List<Source> findSourceByType(
@Param("sourceTypes") String[] sourceTypes,
@Param("projection") String projection);
public Integer insertSource(Source source); public Integer insertSource(Source source);
public Integer deleteSourcesById(Set<String> sourceIds); public Integer deleteSourcesById(Set<String> sourceIds);

View File

@ -18,6 +18,7 @@ public class Layer {
private Integer zIndex = 0; private Integer zIndex = 0;
private BigDecimal maxResolution; private BigDecimal maxResolution;
private BigDecimal minResolution; private BigDecimal minResolution;
private String projection;
private String type; private String type;
private java.util.Map<String,Object> options; private java.util.Map<String,Object> options;
private String description; private String description;
@ -149,4 +150,12 @@ public class Layer {
return sourceTypeArray; return sourceTypeArray;
} }
public String getProjection() {
return projection;
}
public void setProjection(String projection) {
this.projection = projection;
}
} }

View File

@ -10,6 +10,7 @@ public class Source {
private String sourceId; private String sourceId;
private String sourceName; private String sourceName;
private String type; private String type;
private String projection;
private java.util.Map<String,Object> options; private java.util.Map<String,Object> options;
private String description; private String description;
@ -45,6 +46,14 @@ public class Source {
this.type = type; this.type = type;
} }
public String getProjection() {
return projection;
}
public void setProjection(String projection) {
this.projection = projection;
}
public Map<String, Object> getOptions() { public Map<String, Object> getOptions() {
return options; return options;
} }

View File

@ -14,7 +14,7 @@ public interface SourceService {
public List<java.util.Map<String,Object>> findSourcesByPage(Integer pageSize,Integer currentPage); public List<java.util.Map<String,Object>> findSourcesByPage(Integer pageSize,Integer currentPage);
public Source findSourceById(String sourceId); public Source findSourceById(String sourceId);
public Source findSourceByName(String sourceName); public Source findSourceByName(String sourceName);
public List<Source> findSourceByType(String[] sourceTypes); public List<Source> findSourceByType(String[] sourceTypes,String projection);
public Integer insertSource(Source source); public Integer insertSource(Source source);

View File

@ -1,10 +1,8 @@
package com.gis3c.ol.service.impl; 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.entity.Layer; import com.gis3c.ol.entity.Layer;
import com.gis3c.ol.entity.Source;
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;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;

View File

@ -3,7 +3,6 @@ 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.SourceDao; import com.gis3c.ol.dao.SourceDao;
import com.gis3c.ol.entity.Map;
import com.gis3c.ol.entity.Source; import com.gis3c.ol.entity.Source;
import com.gis3c.ol.service.SourceService; import com.gis3c.ol.service.SourceService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -49,8 +48,8 @@ public class SourceServiceImpl implements SourceService {
} }
@Override @Override
public List<Source> findSourceByType(String[] sourceTypes) { public List<Source> findSourceByType(String[] sourceTypes,String projection) {
return sourceDao.findSourceByType(sourceTypes); return sourceDao.findSourceByType(sourceTypes,projection);
} }
@Override @Override

View File

@ -135,6 +135,7 @@ create table c3gis_ol_source(
sourceId varchar(50) not null PRIMARY KEY, sourceId varchar(50) not null PRIMARY KEY,
sourceName varchar(50) not null, sourceName varchar(50) not null,
type varchar(50) not null, type varchar(50) not null,
projection varchar(50) not null,
options jsonb, options jsonb,
description varchar(50) description varchar(50)
); );

View File

@ -29,11 +29,14 @@ 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);
Integer result = layerService.bindSource("aabb842e-239e-491d-9c70-a2cec1f65886","d67de989-d351-4ba2-b3ac-021130ae19d4"); // Integer result = layerService.bindSource("aabb842e-239e-491d-9c70-a2cec1f65886","d67de989-d351-4ba2-b3ac-021130ae19d4");
System.out.println(result); // System.out.println(result);
// List<Source> sourceList = sourceService.findSourceByType(new String[]{"a","b","c"}); // Layer queryLayer = layerService.findeLayerById("123");
// System.out.println(queryLayer);
// List<Source> sourceList = sourceService.findSourceByType(new String[]{"ol.source.WMTS"},"EPSG:4326");
//
// System.out.println(sourceList); // System.out.println(sourceList);
// sourceList.forEach(u -> System.out.println(u)); // sourceList.forEach(u -> System.out.println(u));
@ -110,16 +113,13 @@ public class App {
// System.out.println("插入成功"); // System.out.println("插入成功");
//图层接口 //图层接口
// Layer layer = new Layer(); Layer layer = new Layer();
// layer.setLayerName("streetmap"); layer.setLayerName("sdkqbigdata");
// layer.setAliasName("超图行政区图"); layer.setAliasName("大屏行政区");
// layer.setSource("d7cb5f6f-ee31-4a6e-b8fd-72603a066c2b"); layer.setType("ol.layer.Tile");
// layer.setType("ol.layer.Tile"); layer.setProjection("EPSG:3857");
// java.util.Map<String,Object> options = new HashMap<>(); layerService.insertLayer(layer);
// options.put("projection","EPSG:4326"); System.out.println("插入成功");
// layer.setOptions(options);
// layerService.insertLayer(layer);
// System.out.println("插入成功");
//资源接口 //资源接口

View File

@ -12,6 +12,7 @@
<result property="zIndex" column="zIndex" /> <result property="zIndex" column="zIndex" />
<result property="maxResolution" column="maxResolution" /> <result property="maxResolution" column="maxResolution" />
<result property="minResolution" column="minResolution" /> <result property="minResolution" column="minResolution" />
<result property="projection" column="projection" />
<result property="type" column="type" /> <result property="type" column="type" />
<result property="options" column="options" javaType="ObjectJSON"/> <result property="options" column="options" javaType="ObjectJSON"/>
<result property="description" column="description" /> <result property="description" column="description" />
@ -28,6 +29,7 @@
, zIndex , zIndex
, minResolution , minResolution
, maxResolution , maxResolution
, projection
, type , type
, options , options
, description , description
@ -71,6 +73,7 @@
, zIndex , zIndex
, minResolution , minResolution
, maxResolution , maxResolution
, projection
, type , type
, options , options
, description , description
@ -85,6 +88,7 @@
, #{zIndex} , #{zIndex}
, #{maxResolution} , #{maxResolution}
, #{minResolution} , #{minResolution}
, #{projection}
, #{type} , #{type}
, #{options, javaType=ObjectJSON}::jsonb , #{options, javaType=ObjectJSON}::jsonb
, #{description} , #{description}

View File

@ -5,6 +5,7 @@
<result property="sourceId" column="sourceId" /> <result property="sourceId" column="sourceId" />
<result property="sourceName" column="sourceName" /> <result property="sourceName" column="sourceName" />
<result property="type" column="type" /> <result property="type" column="type" />
<result property="projection" column="projection" />
<result property="options" column="options" javaType="ObjectJSON"/> <result property="options" column="options" javaType="ObjectJSON"/>
<result property="description" column="description" /> <result property="description" column="description" />
</resultMap> </resultMap>
@ -13,6 +14,7 @@
sourceId sourceId
, sourceName , sourceName
, type , type
, projection
, options , options
, description , description
</sql> </sql>
@ -47,22 +49,25 @@
<include refid="sourceColumns"/> <include refid="sourceColumns"/>
FROM c3gis_ol_source FROM c3gis_ol_source
WHERE type in WHERE type in
<foreach collection ="array" item="item" index="index" open="(" separator="," close=")"> <foreach collection ="sourceTypes" item="item" index="index" open="(" separator="," close=")">
#{item, javaType=java.lang.String} #{item, javaType=java.lang.String}
</foreach> </foreach>
ORDER BY type; and projection = #{projection, javaType=java.lang.String}
ORDER BY sourceName;
</select> </select>
<insert id="insertSource" parameterType="com.gis3c.ol.entity.Source"> <insert id="insertSource" parameterType="com.gis3c.ol.entity.Source">
INSERT INTO c3gis_ol_source(sourceId INSERT INTO c3gis_ol_source(sourceId
, sourceName , sourceName
, type , type
, projection
, options , options
, description , description
) )
VALUES(#{sourceId} VALUES(#{sourceId}
, #{sourceName} , #{sourceName}
, #{type} , #{type}
, #{projection}
, #{options, javaType=ObjectJSON}::jsonb , #{options, javaType=ObjectJSON}::jsonb
, #{description} , #{description}
); );