Prechádzať zdrojové kódy

空间工程启动成功

gushoubang 11 mesiacov pred
rodič
commit
45732c8dfd
17 zmenil súbory, kde vykonal 293 pridanie a 271 odobranie
  1. 0 21
      onemap-modules/onemap-analyse/src/main/java/com/onemap/analyse/controller/analyse/ImageController.java
  2. 0 5
      onemap-modules/onemap-analyse/src/main/java/com/onemap/analyse/service/IImageService.java
  3. 0 140
      onemap-modules/onemap-analyse/src/main/java/com/onemap/analyse/service/impl/ImageServiceImpl.java
  4. 49 4
      onemap-modules/onemap-spatial/pom.xml
  5. 8 6
      onemap-modules/onemap-spatial/src/main/java/com/onemap/spatial/OneMapSpatialApplication.java
  6. 21 0
      onemap-modules/onemap-spatial/src/main/java/com/onemap/spatial/controller/ImageController.java
  7. 11 0
      onemap-modules/onemap-spatial/src/main/java/com/onemap/spatial/domain/ImageRaster.java
  8. 11 0
      onemap-modules/onemap-spatial/src/main/java/com/onemap/spatial/mapper/ImageMapper.java
  9. 11 0
      onemap-modules/onemap-spatial/src/main/java/com/onemap/spatial/service/IImageService.java
  10. 94 0
      onemap-modules/onemap-spatial/src/main/java/com/onemap/spatial/service/impl/ImageServiceImpl.java
  11. 0 9
      onemap-modules/onemap-spatial/src/main/resources/META-INF/maven/archetype.xml
  12. 0 15
      onemap-modules/onemap-spatial/src/main/resources/archetype-resources/pom.xml
  13. 0 13
      onemap-modules/onemap-spatial/src/main/resources/archetype-resources/src/main/java/App.java
  14. 0 38
      onemap-modules/onemap-spatial/src/main/resources/archetype-resources/src/test/java/AppTest.java
  15. 8 0
      onemap-modules/onemap-spatial/src/main/resources/banner.txt
  16. 6 20
      onemap-modules/onemap-spatial/src/main/resources/bootstrap.yml
  17. 74 0
      onemap-modules/onemap-spatial/src/main/resources/logback.xml

+ 0 - 21
onemap-modules/onemap-analyse/src/main/java/com/onemap/analyse/controller/analyse/ImageController.java

@@ -1,21 +0,0 @@
-package com.onemap.analyse.controller.analyse;
-
-import com.onemap.analyse.service.IImageService;
-import com.onemap.analyse.service.ISlopService;
-import com.onemap.common.core.web.domain.RequestResult;
-import com.onemap.common.datasource.annotation.Slave;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestParam;
-
-import javax.annotation.Resource;
-
-public class ImageController {
-    @Resource
-    private IImageService iSlopService;
-
-    @GetMapping("/average")
-    @Slave
-    public RequestResult getAveSlop(@RequestParam(value = "geom") String geom) {
-        return RequestResult.success(iSlopService.getSensingImage(geom));
-    }
-}

+ 0 - 5
onemap-modules/onemap-analyse/src/main/java/com/onemap/analyse/service/IImageService.java

@@ -1,5 +0,0 @@
-package com.onemap.analyse.service;
-
-public interface IImageService {
-    String getSensingImage(String geomWkt);
-}

+ 0 - 140
onemap-modules/onemap-analyse/src/main/java/com/onemap/analyse/service/impl/ImageServiceImpl.java

@@ -1,140 +0,0 @@
-package com.onemap.analyse.service.impl;
-
-import com.onemap.analyse.service.IImageService;
-import org.geotools.coverage.grid.GridCoverage2D;
-import org.geotools.coverage.grid.io.AbstractGridCoverage2DReader;
-import org.geotools.data.DataStoreFinder;
-import org.geotools.data.FeatureSource;
-import org.geotools.data.collection.ListFeatureCollection;
-import org.geotools.data.simple.SimpleFeatureCollection;
-import org.geotools.data.simple.SimpleFeatureSource;
-import org.opengis.feature.simple.SimpleFeature;
-import org.geotools.feature.simple.SimpleFeatureBuilder;
-import org.geotools.feature.simple.SimpleFeatureTypeBuilder;
-import org.geotools.geometry.jts.ReferencedEnvelope;
-import org.geotools.map.FeatureLayer;
-import org.geotools.map.GridReaderLayer;
-import org.geotools.map.Layer;
-import org.geotools.map.MapContent;
-import org.geotools.referencing.crs.DefaultGeographicCRS;
-import org.geotools.renderer.lite.StreamingRenderer;
-import org.geotools.renderer.style.Style;
-import org.geotools.styling.SLD;
-import org.geotools.util.factory.Hints;
-import org.locationtech.jts.geom.Geometry;
-import org.locationtech.jts.io.ParseException;
-import org.locationtech.jts.io.WKTReader;
-
-import org.opengis.feature.simple.SimpleFeatureType;
-import org.opengis.feature.type.FeatureType;
-
-import javax.imageio.ImageIO;
-import java.awt.*;
-import java.awt.image.BufferedImage;
-import java.io.File;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * 生成图片服务
- */
-public class ImageServiceImpl implements IImageService {
-    /**
-     * 获取遥感图像
-     *
-     * @param geomWkt
-     * @return
-     */
-    @Override
-    public String getSensingImage(String geomWkt) {
-        // try {
-        //     SimpleFeatureSource geometrySource = (SimpleFeatureSource) getFeatureResource(geomWkt);
-        //
-        //     // 加载影像数据
-        //     Hints hints = new Hints(Hints.FORCE_LONGITUDE_FIRST_AXIS_ORDER, Boolean.TRUE);
-        //     // AbstractGridCoverage2DReader rasterReader = (AbstractGridCoverage2DReader) DataStoreFinder.getDataStore(postgisParams).getFeatureSource("your_raster_table").getGridCoverageReader(new Hints());
-        //     AbstractGridCoverage2DReader rasterReader = null;
-        //     // 创建样式
-        //     Style geometryStyle = (Style) SLD.createSimpleStyle(geometrySource.getSchema());
-        //     GridCoverage2D coverage = (GridCoverage2D) rasterReader.read(null);
-        //     // Style rasterStyle = SLD.wrapGridCoverage(coverage);
-        //     Style rasterStyle = null;
-        //
-        //     // 创建地图内容
-        //     MapContent map = new MapContent();
-        //     map.setTitle("PostGIS Raster and Geometry Screenshot");
-        //
-        //     // 添加几何图层
-        //     Layer geometryLayer = new FeatureLayer((FeatureSource) geometrySource, geometryStyle);
-        //     map.addLayer(geometryLayer);
-        //
-        //     // 添加影像图层
-        //     Layer rasterLayer = new GridReaderLayer(rasterReader, rasterStyle);
-        //     map.addLayer(rasterLayer);
-        //
-        //     // 创建渲染器
-        //     StreamingRenderer renderer = new StreamingRenderer();
-        //     renderer.setMapContent(map);
-        //
-        //     // 创建BufferedImage
-        //     int imageWidth = 800;
-        //     int imageHeight = 600;
-        //     BufferedImage image = new BufferedImage(imageWidth, imageHeight, BufferedImage.TYPE_INT_ARGB);
-        //     Graphics2D graphics = image.createGraphics();
-        //
-        //     // 设置背景颜色
-        //     graphics.setPaint(Color.WHITE);
-        //     graphics.fillRect(0, 0, imageWidth, imageHeight);
-        //
-        //     // 设置视图
-        //     ReferencedEnvelope mapBounds = map.getMaxBounds();
-        //     renderer.paint(graphics, new java.awt.Rectangle(imageWidth, imageHeight), mapBounds);
-        //
-        //     // 保存截图
-        //     File outputfile = new File("screenshot.png");
-        //     ImageIO.write(image, "png", outputfile);
-        //
-        //     System.out.println("截图已保存到: " + outputfile.getAbsolutePath());
-        //
-        // } catch (Exception e) {
-        //     e.printStackTrace();
-        //     return "";
-        // }
-        return "";
-    }
-
-    public SimpleFeatureSource getFeatureResource(String geomWkt) throws ParseException {
-        // // 1. 解析WKT数据为Geometry对象
-        // WKTReader reader = new WKTReader();
-        // Geometry geometry = reader.read(geomWkt);
-        //
-        // // 2. 创建SimpleFeatureType,定义Feature的结构
-        // SimpleFeatureTypeBuilder typeBuilder = new SimpleFeatureTypeBuilder();
-        // typeBuilder.setName("PolygonFeatureType");
-        // typeBuilder.setCRS(org.geotools.referencing.crs.DefaultGeographicCRS.WGS84);
-        // typeBuilder.add("geometry", Geometry.class);
-        // SimpleFeatureType featureType = typeBuilder.buildFeatureType();
-        //
-        // // 3. 创建SimpleFeature,将Geometry对象放入Feature中
-        // SimpleFeatureBuilder featureBuilder = new SimpleFeatureBuilder(featureType);
-        // featureBuilder.add(geometry);
-        // SimpleFeature feature = featureBuilder.buildFeature(null);
-        //
-        //
-        // // 4. 创建FeatureCollection,将Feature放入其中
-        //
-        // List<SimpleFeature> features = new ArrayList<>();
-        // features.add(feature);
-        // SimpleFeatureCollection collection = new ListFeatureCollection(featureType, features);
-        //
-        // // // 5. 创建FeatureSource
-        // // // FeatureType ft = collection.getSchema();
-        // // // FeatureSource featureSource = DataUtilities.source(collection);
-        SimpleFeatureSource featureSource = null;
-
-        return featureSource;
-    }
-}
-
-

+ 49 - 4
onemap-modules/onemap-spatial/pom.xml

@@ -17,6 +17,46 @@
     </properties>
 
     <dependencies>
+        <!--common-->
+        <!-- RuoYi Common DataSource -->
+        <dependency>
+            <groupId>com.onemap</groupId>
+            <artifactId>onemap-common-datasource</artifactId>
+        </dependency>
+        <!-- RuoYi Common DataScope -->
+        <dependency>
+            <groupId>com.onemap</groupId>
+            <artifactId>onemap-common-datascope</artifactId>
+        </dependency>
+
+        <!--spring-->
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-web</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.projectlombok</groupId>
+            <artifactId>lombok</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-web</artifactId>
+        </dependency>
+
+        <!--pg库-->
+        <dependency>
+            <groupId>org.postgresql</groupId>
+            <artifactId>postgresql</artifactId>
+            <version>${org.postgresql.version}</version>
+        </dependency>
+
+        <!--mybatis-plus-->
+        <dependency>
+            <groupId>com.baomidou</groupId>
+            <artifactId>mybatis-plus-core</artifactId>
+            <version>3.5.2</version>
+            <scope>compile</scope>
+        </dependency>
 
         <!--geotools-->
         <dependency>
@@ -40,10 +80,16 @@
             <version>${org.geotools.version}</version>
         </dependency>
         <dependency>
-            <groupId>org.postgresql</groupId>
-            <artifactId>postgresql</artifactId>
-            <version>${org.postgresql.version}</version>
+            <groupId>org.geotools</groupId>
+            <artifactId>gt-render</artifactId>
+            <version>${org.geotools.version}</version>
         </dependency>
+        <dependency>
+            <groupId>org.locationtech.jts</groupId>
+            <artifactId>jts-core</artifactId>
+            <version>1.19.0</version>
+        </dependency>
+
     </dependencies>
 
     <repositories>
@@ -70,5 +116,4 @@
             </releases>
         </repository>
     </repositories>
-
 </project>

+ 8 - 6
onemap-modules/onemap-spatial/src/main/java/com/onemap/spatial/OneMapSpatialApplication.java

@@ -1,20 +1,22 @@
 package com.onemap.spatial;
 
+import com.onemap.common.security.annotation.EnableCustomConfig;
+import com.onemap.common.security.annotation.EnableRyFeignClients;
+import com.onemap.common.swagger.annotation.EnableCustomSwagger2;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.scheduling.annotation.EnableScheduling;
 
 /**
  * 文件服务
  *
  * @author onemap
  */
-// @EnableScheduling
-// @EnableCustomConfig
-// @EnableCustomSwagger2
-// @EnableRyFeignClients
+@EnableScheduling
+@EnableCustomConfig
+@EnableCustomSwagger2
+@EnableRyFeignClients
 @SpringBootApplication
-// @EnableFeignClients(basePackages = "com.onemap.file.controller")
-// @MapperScan("com.onemap.file.mapper")
 public class OneMapSpatialApplication {
     public static void main(String[] args) {
         SpringApplication.run(OneMapSpatialApplication.class, args);

+ 21 - 0
onemap-modules/onemap-spatial/src/main/java/com/onemap/spatial/controller/ImageController.java

@@ -0,0 +1,21 @@
+package com.onemap.spatial.controller;
+
+import com.onemap.common.core.web.domain.RequestResult;
+import com.onemap.spatial.service.IImageService;
+import org.geotools.filter.text.cql2.CQLException;
+import org.locationtech.jts.io.ParseException;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+
+import javax.annotation.Resource;
+import java.io.IOException;
+
+public class ImageController {
+    @Resource
+    private IImageService imageService;
+
+    @GetMapping("/image")
+    public RequestResult getImage(@RequestParam(value = "geom") String geom) throws IOException, CQLException, ParseException {
+        return RequestResult.success(imageService.getSensingImage(geom));
+    }
+}

+ 11 - 0
onemap-modules/onemap-spatial/src/main/java/com/onemap/spatial/domain/ImageRaster.java

@@ -0,0 +1,11 @@
+package com.onemap.spatial.domain;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+@TableName("image_16")
+@Data
+public class ImageRaster {
+    private Integer rid;
+    private byte[] rast;
+}

+ 11 - 0
onemap-modules/onemap-spatial/src/main/java/com/onemap/spatial/mapper/ImageMapper.java

@@ -0,0 +1,11 @@
+package com.onemap.spatial.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.onemap.spatial.domain.ImageRaster;
+import org.apache.ibatis.annotations.Param;
+import org.apache.ibatis.annotations.Select;
+
+public interface ImageMapper extends BaseMapper<ImageRaster> {
+    @Select("SELECT rid, ST_AsPNG(rast) as rast FROM image WHERE ST_Intersects(rast, ST_GeomFromText(#{wkt}, 4326))")
+    ImageRaster selectRasterByWkt(@Param("wkt") String wkt);
+}

+ 11 - 0
onemap-modules/onemap-spatial/src/main/java/com/onemap/spatial/service/IImageService.java

@@ -0,0 +1,11 @@
+package com.onemap.spatial.service;
+
+import org.geotools.filter.text.cql2.CQLException;
+import org.locationtech.jts.io.ParseException;
+
+import java.io.FileNotFoundException;
+import java.io.IOException;
+
+public interface IImageService {
+    String getSensingImage(String geomWkt) throws IOException, CQLException, ParseException;
+}

+ 94 - 0
onemap-modules/onemap-spatial/src/main/java/com/onemap/spatial/service/impl/ImageServiceImpl.java

@@ -0,0 +1,94 @@
+package com.onemap.spatial.service.impl;
+
+import com.onemap.spatial.domain.ImageRaster;
+import com.onemap.spatial.mapper.ImageMapper;
+import com.onemap.spatial.service.IImageService;
+import org.geotools.coverage.grid.GridCoverage2D;
+import org.geotools.coverage.grid.io.AbstractGridCoverage2DReader;
+import org.geotools.coverage.grid.io.AbstractGridFormat;
+import org.geotools.coverage.grid.io.GridFormatFinder;
+import org.geotools.data.DataUtilities;
+import org.geotools.data.simple.SimpleFeatureCollection;
+import org.geotools.factory.CommonFactoryFinder;
+import org.geotools.filter.text.cql2.CQL;
+import org.geotools.filter.text.cql2.CQLException;
+import org.geotools.geometry.jts.JTSFactoryFinder;
+import org.geotools.geometry.jts.ReferencedEnvelope;
+import org.geotools.map.FeatureLayer;
+import org.geotools.map.GridReaderLayer;
+import org.geotools.map.Layer;
+import org.geotools.map.MapContent;
+import org.geotools.renderer.lite.StreamingRenderer;
+import org.geotools.styling.SLD;
+import org.geotools.styling.Style;
+import org.locationtech.jts.geom.Geometry;
+import org.locationtech.jts.io.ParseException;
+import org.locationtech.jts.io.WKTReader;
+import org.opengis.feature.simple.SimpleFeature;
+import org.opengis.filter.Filter;
+import org.opengis.filter.FilterFactory2;
+import org.opengis.geometry.DirectPosition;
+
+import javax.annotation.Resource;
+import javax.imageio.ImageIO;
+import java.awt.*;
+import java.awt.image.BufferedImage;
+import java.io.*;
+import java.nio.file.Paths;
+import java.util.Base64;
+import java.util.UUID;
+
+/**
+ * 生成图片服务
+ */
+public class ImageServiceImpl implements IImageService {
+    @Resource
+    private ImageMapper imageMapper;
+
+    /**
+     * 获取遥感图像
+     *
+     * @param wkt
+     * @return
+     */
+    @Override
+    public String getSensingImage(String wkt) throws ParseException, IOException {
+        ImageRaster imageEntity = imageMapper.selectRasterByWkt(wkt);
+        // Convert WKT to Geometry
+        WKTReader reader = new WKTReader(JTSFactoryFinder.getGeometryFactory());
+        Geometry geometry = reader.read(wkt);
+
+
+        BufferedImage image = null;
+        if (imageEntity != null && imageEntity.getRast() != null) {
+            image = ImageIO.read(new ByteArrayInputStream(imageEntity.getRast()));
+        }
+
+        // Overlay WKT on the image
+        if (image != null) {
+            Graphics2D g = image.createGraphics();
+            g.setColor(Color.RED);
+            g.drawRect((int) geometry.getEnvelopeInternal().getMinX(),
+                    (int) geometry.getEnvelopeInternal().getMinY(),
+                    (int) geometry.getEnvelopeInternal().getWidth(),
+                    (int) geometry.getEnvelopeInternal().getHeight());
+            g.dispose();
+
+            // Save image to local file system
+            String fileName = "overlay_" + UUID.randomUUID().toString() + ".png";
+            String filePath = Paths.get(System.getProperty("user.dir"), "images", fileName).toString();
+            File outputFile = new File(filePath);
+
+            // Create directory if it doesn't exist
+            outputFile.getParentFile().mkdirs();
+
+            ImageIO.write(image, "png", outputFile);
+
+            // Return the file path as the response
+            return filePath;
+        }
+        return "No image found for the provided WKT.";
+    }
+}
+
+

+ 0 - 9
onemap-modules/onemap-spatial/src/main/resources/META-INF/maven/archetype.xml

@@ -1,9 +0,0 @@
-<archetype>
-  <id>onemap-spatial</id>
-  <sources>
-    <source>src/main/java/App.java</source>
-  </sources>
-  <testSources>
-    <source>src/test/java/AppTest.java</source>
-  </testSources>
-</archetype>

+ 0 - 15
onemap-modules/onemap-spatial/src/main/resources/archetype-resources/pom.xml

@@ -1,15 +0,0 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-  <modelVersion>4.0.0</modelVersion>
-  <groupId>$com.onemap</groupId>
-  <artifactId>$onemap-spatial</artifactId>
-  <version>$3.6.1</version>
-  <dependencies>
-    <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
-      <version>3.8.1</version>
-      <scope>test</scope>
-    </dependency>
-  </dependencies>
-</project>

+ 0 - 13
onemap-modules/onemap-spatial/src/main/resources/archetype-resources/src/main/java/App.java

@@ -1,13 +0,0 @@
-package $com.onemap;
-
-/**
- * Hello world!
- *
- */
-public class App 
-{
-    public static void main( String[] args )
-    {
-        System.out.println( "Hello World!" );
-    }
-}

+ 0 - 38
onemap-modules/onemap-spatial/src/main/resources/archetype-resources/src/test/java/AppTest.java

@@ -1,38 +0,0 @@
-package $com.onemap;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-/**
- * Unit test for simple App.
- */
-public class AppTest 
-    extends TestCase
-{
-    /**
-     * Create the test case
-     *
-     * @param testName name of the test case
-     */
-    public AppTest( String testName )
-    {
-        super( testName );
-    }
-
-    /**
-     * @return the suite of tests being tested
-     */
-    public static Test suite()
-    {
-        return new TestSuite( AppTest.class );
-    }
-
-    /**
-     * Rigourous Test :-)
-     */
-    public void testApp()
-    {
-        assertTrue( true );
-    }
-}

+ 8 - 0
onemap-modules/onemap-spatial/src/main/resources/banner.txt

@@ -0,0 +1,8 @@
+Spring Boot Version: ${spring-boot.version}
+Spring Application Name: ${spring.application.name}
+  _____.__.__
+_/ ____\__|  |   ____
+\   __\|  |  | _/ __ \
+ |  |  |  |  |_\  ___/
+ |__|  |__|____/\___  >
+                    \/

+ 6 - 20
onemap-modules/onemap-spatial/src/main/resources/bootstrap.yml

@@ -1,28 +1,14 @@
-#Feign Client配置
-feign:
-  client:
-    config:
-      FooClient: #contextId
-        connectTimeout: 1000000
-        readTimeout: 2000000
-      default:
-        connectTimeout: 6000000
-        readTimeout: 1000000
 # Tomcat
 server:
   port: 9206
-  #配置springboot的http字符编码支持
-  servlet:
-    encoding:
-      force: true
 
 # Spring
 spring:
-#  servlet:
-#    multipart:
-#      enabled: true
-#      max-file-size: 10240MB
-#      max-request-size: 10240MB
+  servlet:
+    multipart:
+      enabled: true
+      max-file-size: 1024MB
+      max-request-size: 1024MB
   application:
     # 应用名称
     name: onemap-spatial
@@ -43,4 +29,4 @@ spring:
         file-extension: yml
         # 共享配置
         shared-configs:
-          - application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
+          - application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}

+ 74 - 0
onemap-modules/onemap-spatial/src/main/resources/logback.xml

@@ -0,0 +1,74 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<configuration scan="true" scanPeriod="60 seconds" debug="false">
+    <!-- 日志存放路径 -->
+	<property name="log.path" value="logs/onemap-file" />
+   <!-- 日志输出格式 -->
+	<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n" />
+
+    <!-- 控制台输出 -->
+	<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
+		<encoder>
+			<pattern>${log.pattern}</pattern>
+		</encoder>
+	</appender>
+
+    <!-- 系统日志输出 -->
+	<appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender">
+	    <file>${log.path}/info.log</file>
+        <!-- 循环政策:基于时间创建日志文件 -->
+		<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
+            <!-- 日志文件名格式 -->
+			<fileNamePattern>${log.path}/info.%d{yyyy-MM-dd}.log</fileNamePattern>
+			<!-- 日志最大的历史 60天 -->
+			<maxHistory>60</maxHistory>
+		</rollingPolicy>
+		<encoder>
+			<pattern>${log.pattern}</pattern>
+		</encoder>
+		<filter class="ch.qos.logback.classic.filter.LevelFilter">
+            <!-- 过滤的级别 -->
+            <level>INFO</level>
+            <!-- 匹配时的操作:接收(记录) -->
+            <onMatch>ACCEPT</onMatch>
+            <!-- 不匹配时的操作:拒绝(不记录) -->
+            <onMismatch>DENY</onMismatch>
+        </filter>
+	</appender>
+
+    <appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender">
+	    <file>${log.path}/error.log</file>
+        <!-- 循环政策:基于时间创建日志文件 -->
+        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
+            <!-- 日志文件名格式 -->
+            <fileNamePattern>${log.path}/error.%d{yyyy-MM-dd}.log</fileNamePattern>
+			<!-- 日志最大的历史 60天 -->
+			<maxHistory>60</maxHistory>
+        </rollingPolicy>
+        <encoder>
+            <pattern>${log.pattern}</pattern>
+        </encoder>
+        <filter class="ch.qos.logback.classic.filter.LevelFilter">
+            <!-- 过滤的级别 -->
+            <level>ERROR</level>
+			<!-- 匹配时的操作:接收(记录) -->
+            <onMatch>ACCEPT</onMatch>
+			<!-- 不匹配时的操作:拒绝(不记录) -->
+            <onMismatch>DENY</onMismatch>
+        </filter>
+    </appender>
+
+    <!-- 系统模块日志级别控制  -->
+	<logger name="com.onemap" level="info" />
+	<!-- Spring日志级别控制  -->
+	<logger name="org.springframework" level="warn" />
+
+	<root level="info">
+		<appender-ref ref="console" />
+	</root>
+	
+	<!--系统操作日志-->
+    <root level="info">
+        <appender-ref ref="file_info" />
+        <appender-ref ref="file_error" />
+    </root>
+</configuration>