¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4"> |
| | | <component name="FacetManager"> |
| | | <facet type="Spring" name="Spring"> |
| | | <configuration /> |
| | | </facet> |
| | | <facet type="web" name="Web"> |
| | | <configuration> |
| | | <webroots> |
| | | <root url="file://$MODULE_DIR$/src/main/webapp" relative="/" /> |
| | | </webroots> |
| | | </configuration> |
| | | </facet> |
| | | </component> |
| | | <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8"> |
| | | <output url="file://$MODULE_DIR$/target/classes" /> |
| | | <output-test url="file://$MODULE_DIR$/target/test-classes" /> |
| | | <content url="file://$MODULE_DIR$"> |
| | | <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" /> |
| | | <sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" /> |
| | | <excludeFolder url="file://$MODULE_DIR$/target" /> |
| | | </content> |
| | | <orderEntry type="jdk" jdkName="jdk-1.8" jdkType="JavaSDK" /> |
| | | <orderEntry type="sourceFolder" forTests="false" /> |
| | | <orderEntry type="library" scope="TEST" name="Maven: org.springframework.boot:spring-boot-starter-test:1.5.6.RELEASE" level="project" /> |
| | | <orderEntry type="library" scope="TEST" name="Maven: org.springframework.boot:spring-boot-test:1.5.6.RELEASE" level="project" /> |
| | | <orderEntry type="library" scope="TEST" name="Maven: org.springframework.boot:spring-boot-test-autoconfigure:1.5.6.RELEASE" level="project" /> |
| | | <orderEntry type="library" scope="TEST" name="Maven: com.jayway.jsonpath:json-path:2.2.0" level="project" /> |
| | | <orderEntry type="library" scope="TEST" name="Maven: net.minidev:json-smart:2.2.1" level="project" /> |
| | | <orderEntry type="library" scope="TEST" name="Maven: net.minidev:accessors-smart:1.1" level="project" /> |
| | | <orderEntry type="library" scope="TEST" name="Maven: org.ow2.asm:asm:5.0.3" level="project" /> |
| | | <orderEntry type="library" name="Maven: junit:junit:4.12" level="project" /> |
| | | <orderEntry type="library" scope="TEST" name="Maven: org.assertj:assertj-core:2.6.0" level="project" /> |
| | | <orderEntry type="library" scope="TEST" name="Maven: org.mockito:mockito-core:1.10.19" level="project" /> |
| | | <orderEntry type="library" scope="TEST" name="Maven: org.objenesis:objenesis:2.1" level="project" /> |
| | | <orderEntry type="library" name="Maven: org.hamcrest:hamcrest-core:1.3" level="project" /> |
| | | <orderEntry type="library" scope="TEST" name="Maven: org.hamcrest:hamcrest-library:1.3" level="project" /> |
| | | <orderEntry type="library" scope="TEST" name="Maven: org.skyscreamer:jsonassert:1.4.0" level="project" /> |
| | | <orderEntry type="library" name="Maven: org.springframework:spring-core:4.3.10.RELEASE" level="project" /> |
| | | <orderEntry type="library" scope="TEST" name="Maven: org.springframework:spring-test:4.3.10.RELEASE" level="project" /> |
| | | <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-web:1.5.6.RELEASE" level="project" /> |
| | | <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter:1.5.6.RELEASE" level="project" /> |
| | | <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-logging:1.5.6.RELEASE" level="project" /> |
| | | <orderEntry type="library" name="Maven: ch.qos.logback:logback-classic:1.1.11" level="project" /> |
| | | <orderEntry type="library" name="Maven: ch.qos.logback:logback-core:1.1.11" level="project" /> |
| | | <orderEntry type="library" name="Maven: org.slf4j:jul-to-slf4j:1.7.25" level="project" /> |
| | | <orderEntry type="library" name="Maven: org.slf4j:log4j-over-slf4j:1.7.25" level="project" /> |
| | | <orderEntry type="library" scope="RUNTIME" name="Maven: org.yaml:snakeyaml:1.17" level="project" /> |
| | | <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-tomcat:1.5.6.RELEASE" level="project" /> |
| | | <orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-core:8.5.16" level="project" /> |
| | | <orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-el:8.5.16" level="project" /> |
| | | <orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-websocket:8.5.16" level="project" /> |
| | | <orderEntry type="library" name="Maven: org.hibernate:hibernate-validator:5.3.5.Final" level="project" /> |
| | | <orderEntry type="library" name="Maven: javax.validation:validation-api:1.1.0.Final" level="project" /> |
| | | <orderEntry type="library" name="Maven: org.jboss.logging:jboss-logging:3.3.1.Final" level="project" /> |
| | | <orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-databind:2.8.9" level="project" /> |
| | | <orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-annotations:2.8.0" level="project" /> |
| | | <orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-core:2.8.9" level="project" /> |
| | | <orderEntry type="library" name="Maven: org.springframework:spring-web:4.3.10.RELEASE" level="project" /> |
| | | <orderEntry type="library" name="Maven: org.springframework:spring-webmvc:4.3.10.RELEASE" level="project" /> |
| | | <orderEntry type="library" name="Maven: org.springframework:spring-expression:4.3.10.RELEASE" level="project" /> |
| | | <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-actuator:1.5.6.RELEASE" level="project" /> |
| | | <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-actuator:1.5.6.RELEASE" level="project" /> |
| | | <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-aop:1.5.6.RELEASE" level="project" /> |
| | | <orderEntry type="library" name="Maven: org.springframework:spring-aop:4.3.10.RELEASE" level="project" /> |
| | | <orderEntry type="library" name="Maven: org.aspectj:aspectjweaver:1.8.10" level="project" /> |
| | | <orderEntry type="library" name="Maven: org.springframework:spring-context-support:4.3.10.RELEASE" level="project" /> |
| | | <orderEntry type="library" name="Maven: org.springframework:spring-beans:4.3.10.RELEASE" level="project" /> |
| | | <orderEntry type="library" name="Maven: org.springframework:spring-context:4.3.10.RELEASE" level="project" /> |
| | | <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-data-redis:1.5.6.RELEASE" level="project" /> |
| | | <orderEntry type="library" name="Maven: org.springframework.data:spring-data-redis:1.8.6.RELEASE" level="project" /> |
| | | <orderEntry type="library" name="Maven: org.springframework.data:spring-data-keyvalue:1.2.6.RELEASE" level="project" /> |
| | | <orderEntry type="library" name="Maven: org.springframework.data:spring-data-commons:1.13.6.RELEASE" level="project" /> |
| | | <orderEntry type="library" name="Maven: org.springframework:spring-tx:4.3.10.RELEASE" level="project" /> |
| | | <orderEntry type="library" name="Maven: org.springframework:spring-oxm:4.3.10.RELEASE" level="project" /> |
| | | <orderEntry type="library" name="Maven: org.slf4j:jcl-over-slf4j:1.7.25" level="project" /> |
| | | <orderEntry type="library" name="Maven: redis.clients:jedis:2.9.0" level="project" /> |
| | | <orderEntry type="library" name="Maven: org.apache.commons:commons-pool2:2.4.2" level="project" /> |
| | | <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-configuration-processor:1.5.6.RELEASE" level="project" /> |
| | | <orderEntry type="library" name="Maven: com.vaadin.external.google:android-json:0.0.20131108.vaadin1" level="project" /> |
| | | <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-thymeleaf:1.5.6.RELEASE" level="project" /> |
| | | <orderEntry type="library" name="Maven: org.thymeleaf:thymeleaf-spring4:2.1.5.RELEASE" level="project" /> |
| | | <orderEntry type="library" name="Maven: org.thymeleaf:thymeleaf:2.1.5.RELEASE" level="project" /> |
| | | <orderEntry type="library" name="Maven: ognl:ognl:3.0.8" level="project" /> |
| | | <orderEntry type="library" name="Maven: org.javassist:javassist:3.21.0-GA" level="project" /> |
| | | <orderEntry type="library" name="Maven: org.unbescape:unbescape:1.1.0.RELEASE" level="project" /> |
| | | <orderEntry type="library" name="Maven: nz.net.ultraq.thymeleaf:thymeleaf-layout-dialect:1.4.0" level="project" /> |
| | | <orderEntry type="library" name="Maven: org.codehaus.groovy:groovy:2.4.12" level="project" /> |
| | | <orderEntry type="library" name="Maven: net.sourceforge.nekohtml:nekohtml:1.9.22" level="project" /> |
| | | <orderEntry type="library" name="Maven: xerces:xercesImpl:2.11.0" level="project" /> |
| | | <orderEntry type="library" name="Maven: xml-apis:xml-apis:1.4.01" level="project" /> |
| | | <orderEntry type="library" name="Maven: net.java.dev.jna:jna-platform:4.5.2" level="project" /> |
| | | <orderEntry type="library" name="Maven: net.java.dev.jna:jna:4.5.2" level="project" /> |
| | | <orderEntry type="library" name="Maven: org.mybatis.spring.boot:mybatis-spring-boot-starter:1.3.0" level="project" /> |
| | | <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-jdbc:1.5.6.RELEASE" level="project" /> |
| | | <orderEntry type="library" name="Maven: org.apache.tomcat:tomcat-jdbc:8.5.16" level="project" /> |
| | | <orderEntry type="library" name="Maven: org.apache.tomcat:tomcat-juli:8.5.16" level="project" /> |
| | | <orderEntry type="library" name="Maven: org.springframework:spring-jdbc:4.3.10.RELEASE" level="project" /> |
| | | <orderEntry type="library" name="Maven: org.mybatis.spring.boot:mybatis-spring-boot-autoconfigure:1.3.0" level="project" /> |
| | | <orderEntry type="library" name="Maven: org.mybatis:mybatis:3.4.4" level="project" /> |
| | | <orderEntry type="library" name="Maven: org.mybatis:mybatis-spring:1.3.1" level="project" /> |
| | | <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-security:1.5.6.RELEASE" level="project" /> |
| | | <orderEntry type="library" name="Maven: org.springframework.security:spring-security-config:4.2.3.RELEASE" level="project" /> |
| | | <orderEntry type="library" name="Maven: org.springframework.security:spring-security-web:4.2.3.RELEASE" level="project" /> |
| | | <orderEntry type="library" name="Maven: org.springframework.security:spring-security-cas:4.2.3.RELEASE" level="project" /> |
| | | <orderEntry type="library" name="Maven: org.jasig.cas.client:cas-client-core:3.4.1" level="project" /> |
| | | <orderEntry type="library" name="Maven: org.springframework.security:spring-security-core:4.2.3.RELEASE" level="project" /> |
| | | <orderEntry type="library" name="Maven: aopalliance:aopalliance:1.0" level="project" /> |
| | | <orderEntry type="library" name="Maven: javax.inject:javax.inject:1" level="project" /> |
| | | <orderEntry type="library" name="Maven: org.postgresql:postgresql:42.3.1" level="project" /> |
| | | <orderEntry type="library" scope="RUNTIME" name="Maven: org.checkerframework:checker-qual:3.5.0" level="project" /> |
| | | <orderEntry type="library" name="Maven: com.alibaba:druid-spring-boot-starter:1.1.3" level="project" /> |
| | | <orderEntry type="library" name="Maven: com.alibaba:druid:1.1.3" level="project" /> |
| | | <orderEntry type="module-library"> |
| | | <library name="Maven: com.alibaba:jconsole:1.8.0"> |
| | | <CLASSES> |
| | | <root url="jar://$MODULE_DIR$/../../../soft/Java18/jdk1.8/lib/jconsole.jar!/" /> |
| | | </CLASSES> |
| | | <JAVADOC /> |
| | | <SOURCES /> |
| | | </library> |
| | | </orderEntry> |
| | | <orderEntry type="module-library"> |
| | | <library name="Maven: com.alibaba:tools:1.8.0"> |
| | | <CLASSES> |
| | | <root url="jar://$MODULE_DIR$/../../../soft/Java18/jdk1.8/lib/tools.jar!/" /> |
| | | </CLASSES> |
| | | <JAVADOC /> |
| | | <SOURCES /> |
| | | </library> |
| | | </orderEntry> |
| | | <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-autoconfigure:1.5.6.RELEASE" level="project" /> |
| | | <orderEntry type="library" name="Maven: commons-lang:commons-lang:2.6" level="project" /> |
| | | <orderEntry type="library" name="Maven: commons-fileupload:commons-fileupload:1.3.1" level="project" /> |
| | | <orderEntry type="library" name="Maven: commons-io:commons-io:2.5" level="project" /> |
| | | <orderEntry type="library" name="Maven: commons-codec:commons-codec:1.10" level="project" /> |
| | | <orderEntry type="library" name="Maven: commons-configuration:commons-configuration:1.10" level="project" /> |
| | | <orderEntry type="library" name="Maven: commons-logging:commons-logging:1.1.1" level="project" /> |
| | | <orderEntry type="library" name="Maven: org.apache.shiro:shiro-core:1.3.2" level="project" /> |
| | | <orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.25" level="project" /> |
| | | <orderEntry type="library" name="Maven: commons-beanutils:commons-beanutils:1.9.3" level="project" /> |
| | | <orderEntry type="library" name="Maven: org.apache.shiro:shiro-spring:1.3.2" level="project" /> |
| | | <orderEntry type="library" name="Maven: org.apache.shiro:shiro-web:1.3.2" level="project" /> |
| | | <orderEntry type="library" name="Maven: org.apache.shiro:shiro-ehcache:1.3.2" level="project" /> |
| | | <orderEntry type="library" name="Maven: net.sf.ehcache:ehcache-core:2.5.3" level="project" /> |
| | | <orderEntry type="library" name="Maven: com.github.theborakompanioni:thymeleaf-extras-shiro:1.2.1" level="project" /> |
| | | <orderEntry type="library" name="Maven: org.ehcache:ehcache:3.3.1" level="project" /> |
| | | <orderEntry type="library" name="Maven: cglib:cglib:3.1" level="project" /> |
| | | <orderEntry type="library" name="Maven: cn.hutool:hutool-all:4.0.9" level="project" /> |
| | | <orderEntry type="library" name="Maven: com.github.axet:kaptcha:0.0.9" level="project" /> |
| | | <orderEntry type="library" name="Maven: com.jhlabs:filters:2.0.235" level="project" /> |
| | | <orderEntry type="library" name="Maven: com.qiniu:qiniu-java-sdk:7.2.29" level="project" /> |
| | | <orderEntry type="library" scope="RUNTIME" name="Maven: com.squareup.okhttp3:okhttp:3.14.4" level="project" /> |
| | | <orderEntry type="library" scope="RUNTIME" name="Maven: com.squareup.okio:okio:1.17.2" level="project" /> |
| | | <orderEntry type="library" name="Maven: com.qcloud:cos_api:4.4" level="project" /> |
| | | <orderEntry type="library" name="Maven: org.apache.httpcomponents:httpclient:4.5.3" level="project" /> |
| | | <orderEntry type="library" name="Maven: org.apache.httpcomponents:httpcore:4.4.6" level="project" /> |
| | | <orderEntry type="library" name="Maven: org.apache.httpcomponents:httpmime:4.5.3" level="project" /> |
| | | <orderEntry type="library" name="Maven: org.json:json:20140107" level="project" /> |
| | | <orderEntry type="library" name="Maven: org.jsoup:jsoup:1.10.3" level="project" /> |
| | | <orderEntry type="library" name="Maven: com.alibaba:fastjson:1.2.37" level="project" /> |
| | | <orderEntry type="library" name="Maven: org.apache.velocity:velocity:1.7" level="project" /> |
| | | <orderEntry type="library" name="Maven: commons-collections:commons-collections:3.2.2" level="project" /> |
| | | <orderEntry type="library" name="Maven: com.belerweb:pinyin4j:2.5.1" level="project" /> |
| | | <orderEntry type="library" name="Maven: com.github.stuxuhai:jpinyin:1.1.7" level="project" /> |
| | | <orderEntry type="library" name="Maven: io.jsonwebtoken:jjwt:0.8.0" level="project" /> |
| | | <orderEntry type="library" name="Maven: io.springfox:springfox-swagger2:2.7.0" level="project" /> |
| | | <orderEntry type="library" name="Maven: io.swagger:swagger-annotations:1.5.13" level="project" /> |
| | | <orderEntry type="library" name="Maven: io.swagger:swagger-models:1.5.13" level="project" /> |
| | | <orderEntry type="library" name="Maven: io.springfox:springfox-spi:2.7.0" level="project" /> |
| | | <orderEntry type="library" name="Maven: io.springfox:springfox-core:2.7.0" level="project" /> |
| | | <orderEntry type="library" name="Maven: net.bytebuddy:byte-buddy:1.6.14" level="project" /> |
| | | <orderEntry type="library" name="Maven: io.springfox:springfox-schema:2.7.0" level="project" /> |
| | | <orderEntry type="library" name="Maven: io.springfox:springfox-swagger-common:2.7.0" level="project" /> |
| | | <orderEntry type="library" name="Maven: io.springfox:springfox-spring-web:2.7.0" level="project" /> |
| | | <orderEntry type="library" name="Maven: org.reflections:reflections:0.9.11" level="project" /> |
| | | <orderEntry type="library" name="Maven: com.fasterxml:classmate:1.3.3" level="project" /> |
| | | <orderEntry type="library" name="Maven: org.springframework.plugin:spring-plugin-core:1.2.0.RELEASE" level="project" /> |
| | | <orderEntry type="library" name="Maven: org.springframework.plugin:spring-plugin-metadata:1.2.0.RELEASE" level="project" /> |
| | | <orderEntry type="library" name="Maven: org.mapstruct:mapstruct:1.1.0.Final" level="project" /> |
| | | <orderEntry type="library" name="Maven: io.springfox:springfox-swagger-ui:2.7.0" level="project" /> |
| | | <orderEntry type="library" name="Maven: org.apache.poi:poi:3.16" level="project" /> |
| | | <orderEntry type="library" name="Maven: org.apache.commons:commons-collections4:4.1" level="project" /> |
| | | <orderEntry type="library" name="Maven: org.apache.poi:poi-ooxml:3.16" level="project" /> |
| | | <orderEntry type="library" name="Maven: com.github.virtuald:curvesapi:1.04" level="project" /> |
| | | <orderEntry type="library" name="Maven: org.apache.poi:poi-scratchpad:3.16" level="project" /> |
| | | <orderEntry type="library" name="Maven: org.apache.poi:poi-ooxml-schemas:3.16" level="project" /> |
| | | <orderEntry type="library" name="Maven: org.apache.xmlbeans:xmlbeans:2.6.0" level="project" /> |
| | | <orderEntry type="library" name="Maven: stax:stax-api:1.0.1" level="project" /> |
| | | <orderEntry type="library" name="Maven: org.apache.poi:ooxml-schemas:1.3" level="project" /> |
| | | <orderEntry type="library" name="Maven: eu.bitwalker:UserAgentUtils:1.20" level="project" /> |
| | | <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-devtools:1.5.6.RELEASE" level="project" /> |
| | | <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot:1.5.6.RELEASE" level="project" /> |
| | | <orderEntry type="library" name="Maven: com.github.pagehelper:pagehelper:4.1.6" level="project" /> |
| | | <orderEntry type="library" name="Maven: com.github.jsqlparser:jsqlparser:0.9.5" level="project" /> |
| | | <orderEntry type="library" name="Maven: com.github.oshi:oshi-core:3.4.4" level="project" /> |
| | | <orderEntry type="library" name="Maven: org.threeten:threetenbp:1.3.6" level="project" /> |
| | | <orderEntry type="library" name="Maven: org.apache.axis:axis:1.4" level="project" /> |
| | | <orderEntry type="library" name="Maven: javax.xml.rpc:javax.xml.rpc-api:1.1.1" level="project" /> |
| | | <orderEntry type="library" name="Maven: org.apache.commons:commons-lang3:3.6" level="project" /> |
| | | <orderEntry type="library" name="Maven: wsdl4j:wsdl4j:1.6.3" level="project" /> |
| | | <orderEntry type="library" name="Maven: commons-discovery:commons-discovery:0.2" level="project" /> |
| | | <orderEntry type="library" name="Maven: com.alibaba:easyexcel:2.2.6" level="project" /> |
| | | <orderEntry type="library" name="Maven: com.google.guava:guava:15.0" level="project" /> |
| | | <orderEntry type="library" name="Maven: com.google.code.gson:gson:2.8.2" level="project" /> |
| | | </component> |
| | | </module> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <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/xsd/maven-4.0.0.xsd"> |
| | | <modelVersion>4.0.0</modelVersion> |
| | | <groupId>com.landtool</groupId> |
| | | <artifactId>lanCatalog</artifactId> |
| | | <version>1.0.0</version> |
| | | <!-- <packaging>jar</packaging>--> |
| | | <packaging>war</packaging> |
| | | <description>lanCatalog</description> |
| | | |
| | | <parent> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-parent</artifactId> |
| | | <version>1.5.6.RELEASE</version> |
| | | </parent> |
| | | |
| | | <properties> |
| | | <argLine>-Dfile.encoding=UTF-8</argLine> |
| | | <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> |
| | | <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> |
| | | <java.version>1.8</java.version> |
| | | <mybatis.spring.boot.version>1.3.0</mybatis.spring.boot.version> |
| | | <mysql.version>5.1.38</mysql.version> |
| | | <druid.version>1.1.3</druid.version> |
| | | <commons.lang.version>2.6</commons.lang.version> |
| | | <commons.fileupload.version>1.3.1</commons.fileupload.version> |
| | | <commons.io.version>2.5</commons.io.version> |
| | | <commons.codec.version>1.10</commons.codec.version> |
| | | <commons.configuration.version>1.10</commons.configuration.version> |
| | | <shiro.version>1.3.2</shiro.version> |
| | | <kaptcha.version>0.0.9</kaptcha.version> |
| | | <qiniu.version>[7.2.0, 7.2.99]</qiniu.version> |
| | | <qcloud.cos.version>4.4</qcloud.cos.version> |
| | | <ehcache.version>3.3.1</ehcache.version> |
| | | <jsoup.version>1.10.3</jsoup.version> |
| | | <fastjson.version>1.2.37</fastjson.version> |
| | | <velocity.version>1.7</velocity.version> |
| | | <pinyin4j.version>2.5.1</pinyin4j.version> |
| | | <jpinyin.version>1.1.7</jpinyin.version> |
| | | <jwt.version>0.8.0</jwt.version> |
| | | <swagger.version>2.7.0</swagger.version> |
| | | <poi.version>3.16</poi.version> |
| | | <ooxml.version>1.3</ooxml.version> |
| | | <landtool.nctojson.version>1.0.7</landtool.nctojson.version> |
| | | </properties> |
| | | |
| | | <dependencies> |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-test</artifactId> |
| | | <scope>test</scope> |
| | | </dependency> |
| | | <!--æé¤å
ç½®tomcat--> |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-web</artifactId> |
| | | <!-- <exclusions>--> |
| | | <!-- <exclusion>--> |
| | | <!-- <groupId>org.springframework.boot</groupId>--> |
| | | <!-- <artifactId>spring-boot-starter-tomcat</artifactId>--> |
| | | <!-- </exclusion>--> |
| | | <!-- </exclusions>--> |
| | | </dependency> |
| | | <!--æ·»å servletä¾èµ--> |
| | | <!-- <dependency>--> |
| | | <!-- <groupId>javax.servlet</groupId>--> |
| | | <!-- <artifactId>javax.servlet-api</artifactId>--> |
| | | <!-- <version>3.1.0</version>--> |
| | | <!-- <scope>provided</scope>--> |
| | | <!-- </dependency>--> |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-actuator</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-aop</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.springframework</groupId> |
| | | <artifactId>spring-context-support</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-data-redis</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-configuration-processor</artifactId> |
| | | <optional>true</optional> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-thymeleaf</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>net.sourceforge.nekohtml</groupId> |
| | | <artifactId>nekohtml</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>net.java.dev.jna</groupId> |
| | | <artifactId>jna-platform</artifactId> |
| | | <version>4.5.2</version> |
| | | <exclusions> |
| | | <exclusion> |
| | | <groupId>net.java.dev.jna</groupId> |
| | | <artifactId>jna</artifactId> |
| | | </exclusion> |
| | | </exclusions> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>net.java.dev.jna</groupId> |
| | | <artifactId>jna</artifactId> |
| | | <version>4.5.2</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.mybatis.spring.boot</groupId> |
| | | <artifactId>mybatis-spring-boot-starter</artifactId> |
| | | <version>${mybatis.spring.boot.version}</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-security</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.springframework.security</groupId> |
| | | <artifactId>spring-security-cas</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>javax.inject</groupId> |
| | | <artifactId>javax.inject</artifactId> |
| | | <version>1</version> |
| | | </dependency> |
| | | <!--ç髿°æ®åºé©±å¨--> |
| | | <!-- <dependency>--> |
| | | <!-- <groupId>com.highgo</groupId>--> |
| | | <!-- <artifactId>hgdb-jdbc42</artifactId>--> |
| | | <!-- <version>4.0</version>--> |
| | | <!-- </dependency>--> |
| | | <!-- <dependency>--> |
| | | <!-- <groupId>org.springframework.boot</groupId>--> |
| | | <!-- <artifactId>spring-boot-starter-data-jpa</artifactId>--> |
| | | <!-- </dependency>--> |
| | | <dependency> |
| | | <groupId>org.postgresql</groupId> |
| | | <artifactId>postgresql</artifactId> |
| | | <version>42.3.1</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.alibaba</groupId> |
| | | <artifactId>druid-spring-boot-starter</artifactId> |
| | | <version>${druid.version}</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>commons-lang</groupId> |
| | | <artifactId>commons-lang</artifactId> |
| | | <version>${commons.lang.version}</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>commons-fileupload</groupId> |
| | | <artifactId>commons-fileupload</artifactId> |
| | | <version>${commons.fileupload.version}</version> |
| | | <exclusions> |
| | | <exclusion> |
| | | <groupId>commons-io</groupId> |
| | | <artifactId>commons-io</artifactId> |
| | | </exclusion> |
| | | </exclusions> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>commons-io</groupId> |
| | | <artifactId>commons-io</artifactId> |
| | | <version>${commons.io.version}</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>commons-codec</groupId> |
| | | <artifactId>commons-codec</artifactId> |
| | | <version>${commons.codec.version}</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>commons-configuration</groupId> |
| | | <artifactId>commons-configuration</artifactId> |
| | | <version>${commons.configuration.version}</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.apache.shiro</groupId> |
| | | <artifactId>shiro-core</artifactId> |
| | | <version>${shiro.version}</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.apache.shiro</groupId> |
| | | <artifactId>shiro-spring</artifactId> |
| | | <version>${shiro.version}</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.apache.shiro</groupId> |
| | | <artifactId>shiro-ehcache</artifactId> |
| | | <version>${shiro.version}</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.github.theborakompanioni</groupId> |
| | | <artifactId>thymeleaf-extras-shiro</artifactId> |
| | | <version>1.2.1</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.ehcache</groupId> |
| | | <artifactId>ehcache</artifactId> |
| | | <version>${ehcache.version}</version> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>cglib</groupId> |
| | | <artifactId>cglib</artifactId> |
| | | <version>3.1</version> |
| | | <exclusions> |
| | | <exclusion> |
| | | <groupId>org.ow2.asm</groupId> |
| | | <artifactId>asm</artifactId> |
| | | </exclusion> |
| | | </exclusions> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>cn.hutool</groupId> |
| | | <artifactId>hutool-all</artifactId> |
| | | <version>4.0.9</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.github.axet</groupId> |
| | | <artifactId>kaptcha</artifactId> |
| | | <version>${kaptcha.version}</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.qiniu</groupId> |
| | | <artifactId>qiniu-java-sdk</artifactId> |
| | | <version>${qiniu.version}</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.qcloud</groupId> |
| | | <artifactId>cos_api</artifactId> |
| | | <version>${qcloud.cos.version}</version> |
| | | <exclusions> |
| | | <exclusion> |
| | | <groupId>org.slf4j</groupId> |
| | | <artifactId>slf4j-log4j12</artifactId> |
| | | </exclusion> |
| | | </exclusions> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.jsoup</groupId> |
| | | <artifactId>jsoup</artifactId> |
| | | <version>${jsoup.version}</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.alibaba</groupId> |
| | | <artifactId>fastjson</artifactId> |
| | | <version>${fastjson.version}</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.apache.velocity</groupId> |
| | | <artifactId>velocity</artifactId> |
| | | <version>${velocity.version}</version> |
| | | <exclusions> |
| | | <exclusion> |
| | | <groupId>commons-lang</groupId> |
| | | <artifactId>commons-lang</artifactId> |
| | | </exclusion> |
| | | </exclusions> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.belerweb</groupId> |
| | | <artifactId>pinyin4j</artifactId> |
| | | <version>${pinyin4j.version}</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.github.stuxuhai</groupId> |
| | | <artifactId>jpinyin</artifactId> |
| | | <version>${jpinyin.version}</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>io.jsonwebtoken</groupId> |
| | | <artifactId>jjwt</artifactId> |
| | | <version>${jwt.version}</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>io.springfox</groupId> |
| | | <artifactId>springfox-swagger2</artifactId> |
| | | <version>${swagger.version}</version> |
| | | <exclusions> |
| | | <exclusion> |
| | | <groupId>com.google.guava</groupId> |
| | | <artifactId>guava</artifactId> |
| | | </exclusion> |
| | | </exclusions> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>io.springfox</groupId> |
| | | <artifactId>springfox-swagger-ui</artifactId> |
| | | <version>${swagger.version}</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.apache.poi</groupId> |
| | | <artifactId>poi</artifactId> |
| | | <version>${poi.version}</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.apache.poi</groupId> |
| | | <artifactId>poi-ooxml</artifactId> |
| | | <version>${poi.version}</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.apache.poi</groupId> |
| | | <artifactId>poi-scratchpad</artifactId> |
| | | <version>${poi.version}</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.apache.poi</groupId> |
| | | <artifactId>poi-ooxml-schemas</artifactId> |
| | | <version>${poi.version}</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.apache.poi</groupId> |
| | | <artifactId>ooxml-schemas</artifactId> |
| | | <version>${ooxml.version}</version> |
| | | <exclusions> |
| | | <exclusion> |
| | | <groupId>org.apache.xmlbeans</groupId> |
| | | <artifactId>xmlbeans</artifactId> |
| | | </exclusion> |
| | | </exclusions> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>eu.bitwalker</groupId> |
| | | <artifactId>UserAgentUtils</artifactId> |
| | | <version>1.20</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-devtools</artifactId> |
| | | <optional>true</optional> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.github.pagehelper</groupId> |
| | | <artifactId>pagehelper</artifactId> |
| | | <version>4.1.6</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.github.oshi</groupId> |
| | | <artifactId>oshi-core</artifactId> |
| | | <version>3.4.4</version> |
| | | <exclusions> |
| | | <exclusion> |
| | | <groupId>net.java.dev.jna</groupId> |
| | | <artifactId>jna-platform</artifactId> |
| | | </exclusion> |
| | | <exclusion> |
| | | <groupId>net.java.dev.jna</groupId> |
| | | <artifactId>jna</artifactId> |
| | | </exclusion> |
| | | <exclusion> |
| | | <groupId>net.java.dev.jna</groupId> |
| | | <artifactId>jna</artifactId> |
| | | </exclusion> |
| | | <exclusion> |
| | | <groupId>org.threeten</groupId> |
| | | <artifactId>threetenbp</artifactId> |
| | | </exclusion> |
| | | </exclusions> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.threeten</groupId> |
| | | <artifactId>threetenbp</artifactId> |
| | | <version>1.3.6</version> |
| | | </dependency> |
| | | <!-- <dependency>--> |
| | | <!-- <groupId>com.microsoft.sqlserver</groupId>--> |
| | | <!-- <artifactId>sqljdbc4</artifactId>--> |
| | | <!-- <version>4.0</version>--> |
| | | <!-- </dependency>--> |
| | | <dependency> |
| | | <groupId>org.apache.axis</groupId> |
| | | <artifactId>axis</artifactId> |
| | | <version>1.4</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>javax.xml.rpc</groupId> |
| | | <artifactId>javax.xml.rpc-api</artifactId> |
| | | <version>1.1.1</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.apache.commons</groupId> |
| | | <artifactId>commons-lang3</artifactId> |
| | | <version>3.6</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>wsdl4j</groupId> |
| | | <artifactId>wsdl4j</artifactId> |
| | | <version>1.6.3</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>commons-discovery</groupId> |
| | | <artifactId>commons-discovery</artifactId> |
| | | <exclusions> |
| | | <exclusion> |
| | | <groupId>commons-logging</groupId> |
| | | <artifactId>commons-logging</artifactId> |
| | | </exclusion> |
| | | </exclusions> |
| | | <version>0.2</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.github.theborakompanioni</groupId> |
| | | <artifactId>thymeleaf-extras-shiro</artifactId> |
| | | <version>1.2.1</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.alibaba</groupId> |
| | | <artifactId>easyexcel</artifactId> |
| | | <version>2.2.6</version> |
| | | <exclusions> |
| | | <exclusion> |
| | | <artifactId>poi-ooxml-schemas</artifactId> |
| | | <groupId>org.apache.poi</groupId> |
| | | </exclusion> |
| | | <exclusion> |
| | | <artifactId>poi-ooxml</artifactId> |
| | | <groupId>org.apache.poi</groupId> |
| | | </exclusion> |
| | | <exclusion> |
| | | <groupId>org.apache.poi</groupId> |
| | | <artifactId>poi</artifactId> |
| | | </exclusion> |
| | | <exclusion> |
| | | <groupId>cglib</groupId> |
| | | <artifactId>cglib</artifactId> |
| | | </exclusion> |
| | | <exclusion> |
| | | <groupId>org.ow2.asm</groupId> |
| | | <artifactId>asm</artifactId> |
| | | </exclusion> |
| | | <exclusion> |
| | | <groupId>org.ehcache</groupId> |
| | | <artifactId>ehcache</artifactId> |
| | | </exclusion> |
| | | </exclusions> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.google.guava</groupId> |
| | | <artifactId>guava</artifactId> |
| | | <version>15.0</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.google.code.gson</groupId> |
| | | <artifactId>gson</artifactId> |
| | | <version>2.8.2</version> |
| | | </dependency> |
| | | </dependencies> |
| | | |
| | | <build> |
| | | <finalName>lancatalog</finalName> |
| | | <plugins> |
| | | <plugin> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-maven-plugin</artifactId> |
| | | <configuration> |
| | | <mainClass>com.landtool.lanbase.LanbaseApplication</mainClass> |
| | | <fork>true</fork> |
| | | </configuration> |
| | | <executions> |
| | | <execution> |
| | | <goals> |
| | | <goal>repackage</goal> |
| | | </goals> |
| | | </execution> |
| | | </executions> |
| | | </plugin> |
| | | <plugin> |
| | | <groupId>org.mybatis.generator</groupId> |
| | | <artifactId>mybatis-generator-maven-plugin</artifactId> |
| | | <version>1.3.2</version> |
| | | <configuration> |
| | | <configurationFile>${basedir}/src/main/resources/templates/generator/generatorConfig.xml |
| | | </configurationFile> |
| | | <overwrite>true</overwrite> |
| | | <verbose>true</verbose> |
| | | </configuration> |
| | | </plugin> |
| | | |
| | | <plugin> |
| | | <groupId>com.spotify</groupId> |
| | | <artifactId>docker-maven-plugin</artifactId> |
| | | <version>0.4.14</version> |
| | | <configuration> |
| | | <imageName>lanbase/image</imageName> |
| | | <dockerDirectory>${project.basedir}</dockerDirectory> |
| | | <resources> |
| | | <resource> |
| | | <targetPath>/</targetPath> |
| | | <directory>${project.build.directory}</directory> |
| | | <include>${project.build.finalName}.jar</include> |
| | | </resource> |
| | | </resources> |
| | | </configuration> |
| | | </plugin> |
| | | </plugins> |
| | | </build> |
| | | |
| | | <!--<repositories> |
| | | <repository> |
| | | <id>maven-public</id> |
| | | <name>landtool nexus</name> |
| | | <url>http://192.168.0.178:8181/repository/maven-public/</url> |
| | | <releases> |
| | | <enabled>true</enabled> |
| | | </releases> |
| | | </repository> |
| | | </repositories> |
| | | <pluginRepositories> |
| | | <pluginRepository> |
| | | <id>maven-public</id> |
| | | <name>landtool nexus</name> |
| | | <url>http://192.168.0.178:8181/repository/maven-public/</url> |
| | | <releases> |
| | | <enabled>true</enabled> |
| | | </releases> |
| | | <snapshots> |
| | | <enabled>false</enabled> |
| | | </snapshots> |
| | | </pluginRepository> |
| | | </pluginRepositories>--> |
| | | |
| | | </project> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.landtool.lanbase; |
| | | |
| | | import java.sql.Timestamp; |
| | | import java.text.DateFormat; |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import java.util.Locale; |
| | | import java.util.Properties; |
| | | |
| | | import org.springframework.boot.SpringApplication; |
| | | import org.springframework.boot.autoconfigure.SpringBootApplication; |
| | | import org.springframework.boot.builder.SpringApplicationBuilder; |
| | | import org.springframework.boot.web.support.SpringBootServletInitializer; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.core.convert.converter.Converter; |
| | | |
| | | import com.github.pagehelper.PageHelper; |
| | | |
| | | import at.pollux.thymeleaf.shiro.dialect.ShiroDialect; |
| | | import org.springframework.scheduling.annotation.EnableScheduling; |
| | | |
| | | @SpringBootApplication |
| | | @EnableScheduling |
| | | public class LanbaseApplication extends SpringBootServletInitializer { |
| | | |
| | | |
| | | |
| | | /** |
| | | * å¯å¨ç¨åºæ¹æ³ |
| | | */ |
| | | public static void main(String[] args) { |
| | | //showEnvironment(); |
| | | SpringApplication.run(LanbaseApplication.class, args); |
| | | } |
| | | |
| | | @Override |
| | | protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { |
| | | return application.sources(LanbaseApplication.class); |
| | | } |
| | | @Bean |
| | | public Converter<String, Timestamp> addNewConvert() { |
| | | return new Converter<String, Timestamp>() { |
| | | @Override |
| | | public Timestamp convert(String source) { |
| | | if(source.equals("")){ |
| | | return null; |
| | | }else { |
| | | DateFormat dateFormat; |
| | | dateFormat = new SimpleDateFormat("yyyy-MM-dd", Locale.ENGLISH);//è®¾å®æ ¼å¼ |
| | | //dateFormat = new SimpleDateFormat("yyyy-MM-dd kk:mm:ss", Locale.ENGLISH); |
| | | dateFormat.setLenient(false); |
| | | Date timeDate = null;//utilç±»å |
| | | try { |
| | | timeDate = dateFormat.parse(source); |
| | | } catch (ParseException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | java.sql.Timestamp dateTime = new java.sql.Timestamp(timeDate.getTime());//Timestampç±»å,timeDate.getTime()è¿åä¸ä¸ªlongå |
| | | return dateTime; |
| | | } |
| | | |
| | | } |
| | | }; |
| | | } |
| | | @Bean |
| | | public PageHelper pageHelper(){ |
| | | PageHelper pageHelper = new PageHelper(); |
| | | Properties properties = new Properties(); |
| | | properties.setProperty("offsetAsPageNum","true"); |
| | | properties.setProperty("rowBoundsWithCount","true"); |
| | | properties.setProperty("reasonable","true"); |
| | | properties.setProperty("dialect","PostgreSQL"); |
| | | pageHelper.setProperties(properties); |
| | | return pageHelper; |
| | | } |
| | | |
| | | // <!--shiroæ´åthymeleaf--> |
| | | @Bean |
| | | public ShiroDialect shiroDialect() { |
| | | return new ShiroDialect(); |
| | | } |
| | | |
| | | private static void showEnvironment(){ |
| | | System.out.println("javaçæ¬å·ï¼" + System.getProperty("java.version")); |
| | | System.out.println("Javaæä¾ååç§°ï¼" + System.getProperty("java.vendor")); |
| | | // System.out.println("Javaæä¾åç½ç«ï¼" + System.getProperty("java.vendor.url")); |
| | | System.out.println("jre主ç®å½ï¼" + System.getProperty("java.home")); |
| | | // System.out.println("Javaèææºè§èçæ¬å·ï¼" + System.getProperty("java.vm.specification.version")); |
| | | // System.out.println("Javaèææºè§èæä¾åï¼" + System.getProperty("java.vm.specification.vendor")); |
| | | // System.out.println("Javaèææºè§èåç§°ï¼" + System.getProperty("java.vm.specification.name")); |
| | | System.out.println("Javaèææºçæ¬å·ï¼" + System.getProperty("java.vm.version")); |
| | | System.out.println("Javaèææºæä¾åï¼" + System.getProperty("java.vm.vendor")); |
| | | System.out.println("Javaèææºåç§°ï¼" + System.getProperty("java.vm.name")); |
| | | // System.out.println("Javaè§èçæ¬å·ï¼" + System.getProperty("java.specification.version")); |
| | | // System.out.println("Javaè§èæä¾åï¼" + System.getProperty("java.specification.vendor")); |
| | | // System.out.println("Javaè§èåç§°ï¼" + System.getProperty("java.specification.name")); |
| | | System.out.println("Javaç±»çæ¬å·ï¼" + System.getProperty("java.class.version")); |
| | | System.out.println("Java类路å¾ï¼" + System.getProperty("java.class.path")); |
| | | System.out.println("Java libè·¯å¾ï¼" + System.getProperty("java.library.path")); |
| | | System.out.println("Javaè¾å
¥è¾åºä¸´æ¶è·¯å¾ï¼" + System.getProperty("java.io.tmpdir")); |
| | | System.out.println("Javaç¼è¯å¨ï¼" + System.getProperty("java.compiler")); |
| | | System.out.println("Javaæ§è¡è·¯å¾ï¼" + System.getProperty("java.ext.dirs")); |
| | | System.out.println("æä½ç³»ç»åç§°ï¼" + System.getProperty("os.name")); |
| | | System.out.println("æä½ç³»ç»çæ¶æï¼" + System.getProperty("os.arch")); |
| | | System.out.println("æä½ç³»ç»çæ¬å·ï¼" + System.getProperty("os.version")); |
| | | System.out.println("æä»¶åé符ï¼" + System.getProperty("file.separator")); |
| | | System.out.println("è·¯å¾åé符ï¼" + System.getProperty("path.separator")); |
| | | System.out.println("ç´çº¿åé符ï¼" + System.getProperty("line.separator")); |
| | | System.out.println("æä½ç³»ç»ç¨æ·åï¼" + System.getProperty("user.name")); |
| | | System.out.println("æä½ç³»ç»ç¨æ·ç主ç®å½ï¼" + System.getProperty("user.home")); |
| | | System.out.println("å½åç¨åºæå¨ç®å½ï¼" + System.getProperty("user.dir")); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.landtool.lanbase.common; |
| | | |
| | | /** |
| | | * @author lanbase |
| | | * @Description: TODO(常é) |
| | | * @date 2017-6-23 15:07 |
| | | */ |
| | | public class Constant { |
| | | |
| | | /** |
| | | * ç»å½éè¯¯æ¬¡æ° |
| | | */ |
| | | public static final String LOGIN_ERROR_TIMES= "login_error_times"; |
| | | |
| | | /** |
| | | * è¶
级管çåID |
| | | */ |
| | | public static final int SUPER_ADMIN = 1; |
| | | |
| | | /** |
| | | * utf-8ç¼ç |
| | | */ |
| | | public static final String ENCODING_UTF_8="UTF-8"; |
| | | |
| | | /** |
| | | * èåç±»å |
| | | */ |
| | | public enum MenuType { |
| | | /** |
| | | * ç®å½ |
| | | */ |
| | | CATALOG(0), |
| | | /** |
| | | * èå |
| | | */ |
| | | MENU(1), |
| | | /** |
| | | * æé® |
| | | */ |
| | | BUTTON(2); |
| | | |
| | | private int value; |
| | | |
| | | MenuType(int value) { |
| | | this.value = value; |
| | | } |
| | | |
| | | public int getValue() { |
| | | return value; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * ç¨æ· ç¶æ |
| | | */ |
| | | public enum UserStatus { |
| | | /** |
| | | * ç¦ç¨ |
| | | */ |
| | | DISABLE(1), |
| | | /** |
| | | * æ£å¸¸ |
| | | */ |
| | | NORMAL(0); |
| | | |
| | | private int value; |
| | | |
| | | UserStatus(int value) { |
| | | this.value = value; |
| | | } |
| | | |
| | | public int getValue() { |
| | | return value; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * Taxonomyç±»å |
| | | */ |
| | | public enum TaxonomyType { |
| | | /** |
| | | * åç±» |
| | | */ |
| | | CATEGORY(0), |
| | | /** |
| | | * ä¸é¢ |
| | | */ |
| | | FEATURE(1), |
| | | /** |
| | | * æ ç¾ |
| | | */ |
| | | TAG(2); |
| | | |
| | | private int value; |
| | | |
| | | TaxonomyType(int value) { |
| | | this.value = value; |
| | | } |
| | | |
| | | public int getValue() { |
| | | return value; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * Contentç¶æ |
| | | */ |
| | | public enum ContentStatus { |
| | | /** |
| | | * è稿 |
| | | */ |
| | | DRAFT(0), |
| | | /** |
| | | * æ£å¸¸ |
| | | */ |
| | | NORMAL(1), |
| | | /** |
| | | * å é¤ |
| | | */ |
| | | DELETE(2); |
| | | |
| | | private int value; |
| | | |
| | | ContentStatus(int value) { |
| | | this.value = value; |
| | | } |
| | | |
| | | public int getValue() { |
| | | return value; |
| | | } |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.landtool.lanbase.common.annotation; |
| | | |
| | | import java.lang.annotation.Documented; |
| | | import java.lang.annotation.ElementType; |
| | | import java.lang.annotation.Retention; |
| | | import java.lang.annotation.RetentionPolicy; |
| | | import java.lang.annotation.Target; |
| | | |
| | | @Target({ElementType.METHOD,ElementType.TYPE}) |
| | | @Retention(RetentionPolicy.RUNTIME) |
| | | @Documented |
| | | public @interface LogAction { |
| | | String value() default ""; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.landtool.lanbase.common.annotation; |
| | | |
| | | import java.lang.annotation.Documented; |
| | | import java.lang.annotation.ElementType; |
| | | import java.lang.annotation.Retention; |
| | | import java.lang.annotation.RetentionPolicy; |
| | | import java.lang.annotation.Target; |
| | | |
| | | @Target({ElementType.METHOD,ElementType.TYPE}) |
| | | @Retention(RetentionPolicy.RUNTIME) |
| | | @Documented |
| | | public @interface LogLogininfo { |
| | | String value() default ""; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.landtool.lanbase.common.annotation; |
| | | |
| | | import java.lang.annotation.Documented; |
| | | import java.lang.annotation.ElementType; |
| | | import java.lang.annotation.Retention; |
| | | import java.lang.annotation.RetentionPolicy; |
| | | import java.lang.annotation.Target; |
| | | |
| | | /** |
| | | * @author lanbase |
| | | * @Description: TODO(ç³»ç»æ¥å¿æ³¨è§£) |
| | | * @date 2017-6-23 15:07 |
| | | */ |
| | | @Target(ElementType.METHOD) |
| | | @Retention(RetentionPolicy.RUNTIME) |
| | | @Documented |
| | | public @interface SysLog { |
| | | String value() default ""; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.landtool.lanbase.common.aspect; |
| | | |
| | | import java.lang.reflect.Method; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | |
| | | import org.apache.shiro.SecurityUtils; |
| | | import org.aspectj.lang.ProceedingJoinPoint; |
| | | import org.aspectj.lang.annotation.Around; |
| | | import org.aspectj.lang.annotation.Aspect; |
| | | import org.aspectj.lang.annotation.Pointcut; |
| | | import org.aspectj.lang.reflect.MethodSignature; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import com.landtool.lanbase.common.utils.HttpContextUtils; |
| | | import com.landtool.lanbase.common.utils.IPUtils; |
| | | import com.landtool.lanbase.config.LoginConfigProperties; |
| | | import com.landtool.lanbase.modules.log.entity.LogAction; |
| | | import com.landtool.lanbase.modules.log.service.LogActionService; |
| | | import com.landtool.lanbase.modules.org.entity.OrgUser; |
| | | import com.landtool.lanbase.modules.res.entity.Res_Ext3D; |
| | | import com.landtool.lanbase.modules.res.entity.Res_ExtBaseMap; |
| | | import com.landtool.lanbase.modules.res.entity.Res_ExtBusinessLayer; |
| | | import com.landtool.lanbase.modules.res.entity.Res_ExtDataBase; |
| | | import com.landtool.lanbase.modules.res.entity.Res_ExtIntegrate; |
| | | import com.landtool.lanbase.modules.res.entity.Res_ExtInterFaceService; |
| | | import com.landtool.lanbase.modules.res.entity.Res_ExtSpaceServerWithBLOBs; |
| | | import com.landtool.lanbase.modules.res.entity.Res_ExtThemeMap; |
| | | import com.landtool.lanbase.modules.res.entity.Res_MainInfo; |
| | | import com.landtool.lanbase.modules.res.service.ResMainInfoService; |
| | | |
| | | @Aspect |
| | | @Component |
| | | public class LogActionAspect { |
| | | @Autowired |
| | | private LogActionService logActionService; |
| | | |
| | | @Autowired |
| | | private LoginConfigProperties loginConfig; |
| | | |
| | | @Autowired |
| | | private ResMainInfoService resMainInfoService; |
| | | |
| | | @Pointcut("@annotation(com.landtool.lanbase.common.annotation.LogAction)") |
| | | public void logPointCut() { |
| | | |
| | | } |
| | | |
| | | @Around("logPointCut()") |
| | | public Object around(ProceedingJoinPoint point) throws Throwable { |
| | | long beginTime = System.currentTimeMillis(); |
| | | //æ§è¡æ¹æ³ |
| | | Object result = point.proceed(); |
| | | //æ§è¡æ¶é¿(毫ç§) |
| | | long time = System.currentTimeMillis() - beginTime; |
| | | //System.out.println("time"+time); |
| | | |
| | | //ä¿åæ¥å¿ |
| | | saveLogAction(point, time); |
| | | |
| | | return result; |
| | | } |
| | | |
| | | private void saveLogAction(ProceedingJoinPoint joinPoint, long time) { |
| | | MethodSignature signature = (MethodSignature) joinPoint.getSignature(); |
| | | Method method = signature.getMethod(); |
| | | LogAction logAction = new LogAction(); |
| | | com.landtool.lanbase.common.annotation.LogAction log = method.getAnnotation(com.landtool.lanbase.common.annotation.LogAction.class); |
| | | if(log != null){ |
| | | //注解ä¸çæè¿° |
| | | String[] list = log.value().split(","); |
| | | logAction.setLargemodel(list[0]); //大模å |
| | | logAction.setSmallmodel(list[1]);//å°æ¨¡å |
| | | logAction.setRemark(list[2]); //夿³¨ |
| | | //è®°å½èµæºidåæ é¢ |
| | | if(list[3].indexOf("|")!=-1){ |
| | | logAction.setActiontype(list[3].substring(0,list[3].indexOf("|")));//æä½ç±»å |
| | | if(joinPoint.getArgs() != null && joinPoint.getArgs()[0] != null && joinPoint.getArgs().length > 0 ){ |
| | | Integer resourceid = 0; |
| | | String title = ""; |
| | | try{ |
| | | resourceid = Integer.parseInt(joinPoint.getArgs()[0].toString()); |
| | | }catch(Exception ex){ |
| | | String className = joinPoint.getArgs()[0].getClass().getName().substring(joinPoint.getArgs()[0].getClass().getName().lastIndexOf(".")+1,joinPoint.getArgs()[0].getClass().getName().length()); |
| | | switch (className){ |
| | | case "Res_MainInfo": |
| | | Res_MainInfo mainInfo = (Res_MainInfo)joinPoint.getArgs()[0]; |
| | | if(mainInfo != null && mainInfo.getResourceid() != null) resourceid = mainInfo.getResourceid(); |
| | | break; |
| | | case "Res_ExtDataBase": |
| | | Res_ExtDataBase resExtDataBase = (Res_ExtDataBase)joinPoint.getArgs()[0]; |
| | | if(resExtDataBase != null && resExtDataBase.getResourceid() != null) resourceid = resExtDataBase.getResourceid(); |
| | | break; |
| | | case "Res_ExtInterFaceService": |
| | | Res_ExtInterFaceService resExtInterFaceService = (Res_ExtInterFaceService)joinPoint.getArgs()[0]; |
| | | if(resExtInterFaceService != null && resExtInterFaceService.getResourceid() != null) resourceid = resExtInterFaceService.getResourceid(); |
| | | break; |
| | | case "Res_ExtIntegrate": |
| | | Res_ExtIntegrate resExtIntegrate = (Res_ExtIntegrate)joinPoint.getArgs()[0]; |
| | | if(resExtIntegrate != null && resExtIntegrate.getResourceid() != null) resourceid = resExtIntegrate.getResourceid(); |
| | | break; |
| | | case "Res_ExtBaseMap": |
| | | Res_ExtBaseMap resExtBaseMap = (Res_ExtBaseMap)joinPoint.getArgs()[0]; |
| | | if(resExtBaseMap != null && resExtBaseMap.getResourceid() != null) resourceid = resExtBaseMap.getResourceid(); |
| | | break; |
| | | case "Res_ExtThemeMap": |
| | | Res_ExtThemeMap resExtThemeMap = (Res_ExtThemeMap)joinPoint.getArgs()[0]; |
| | | if(resExtThemeMap != null && resExtThemeMap.getResourceid() != null) resourceid = resExtThemeMap.getResourceid(); |
| | | break; |
| | | case "Res_ExtSpaceServerWithBLOBs": |
| | | Res_ExtSpaceServerWithBLOBs resExtSpaceServerWithBLOBs = (Res_ExtSpaceServerWithBLOBs)joinPoint.getArgs()[0]; |
| | | if(resExtSpaceServerWithBLOBs != null && resExtSpaceServerWithBLOBs.getResourceid() != null) resourceid = resExtSpaceServerWithBLOBs.getResourceid(); |
| | | break; |
| | | case "Res_Ext3D": |
| | | Res_Ext3D resExt3D = (Res_Ext3D)joinPoint.getArgs()[0]; |
| | | if(resExt3D != null && resExt3D.getResourceid() != null) resourceid = resExt3D.getResourceid(); |
| | | break; |
| | | case "Res_ExtBusinessLayer": |
| | | Res_ExtBusinessLayer resExtBusinessLayer = (Res_ExtBusinessLayer)joinPoint.getArgs()[0]; |
| | | if(resExtBusinessLayer != null && resExtBusinessLayer.getResourceid() != null) resourceid = resExtBusinessLayer.getResourceid(); |
| | | break; |
| | | } |
| | | } |
| | | logAction.setResourceid(resourceid); |
| | | if(list[3].indexOf("å é¤") != -1) { |
| | | title = joinPoint.getArgs()[1].toString(); |
| | | }else{ |
| | | if (resourceid != null && resourceid != 0) { |
| | | title = resMainInfoService.selectByPrimaryKey(resourceid) != null ? resMainInfoService.selectByPrimaryKey(resourceid).getTitle() : ""; |
| | | } |
| | | } |
| | | logAction.setTitle(title); |
| | | } |
| | | }else{ |
| | | logAction.setActiontype(list[3]);//æä½ç±»å |
| | | } |
| | | } |
| | | |
| | | //è·årequest |
| | | HttpServletRequest request = HttpContextUtils.getHttpServletRequest(); |
| | | String url=request.getServletPath(); |
| | | logAction.setRequesturl(url); |
| | | //设置IPå°å |
| | | logAction.setRequestip(IPUtils.getIpAddr(request)); |
| | | |
| | | //ç¨æ·å |
| | | Long userid = ((OrgUser) SecurityUtils.getSubject().getPrincipal()).getUserid(); |
| | | logAction.setUserid(userid); |
| | | |
| | | logAction.setAppid(loginConfig.getAppId()); |
| | | |
| | | // logAction.setLargemodel(loginConfig.getAppFullName()); |
| | | |
| | | |
| | | //ä¿åç³»ç»æ¥å¿ |
| | | logActionService.save(logAction); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.landtool.lanbase.common.aspect; |
| | | |
| | | import org.aspectj.lang.ProceedingJoinPoint; |
| | | import org.aspectj.lang.annotation.Around; |
| | | import org.aspectj.lang.annotation.Aspect; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.context.annotation.Configuration; |
| | | |
| | | import com.landtool.lanbase.common.exception.LanbaseException; |
| | | |
| | | /** |
| | | * @author lanbase |
| | | * @Description: TODO(Redisåé¢å¤çç±») |
| | | * @date 2017-6-23 15:07 |
| | | */ |
| | | @Aspect |
| | | @Configuration |
| | | public class RedisAspect { |
| | | |
| | | private Logger logger = LoggerFactory.getLogger(getClass()); |
| | | |
| | | //æ¯å¦å¼å¯redisç¼å trueå¼å¯ falseå
³é |
| | | @Value("${spring.redis.open: #{false}}") |
| | | private boolean open; |
| | | |
| | | @Around("execution(* com.landtool.lanbase.common.utils.RedisUtils.*(..))") |
| | | public Object around(ProceedingJoinPoint point) throws Throwable { |
| | | Object result = null; |
| | | if(open){ |
| | | try{ |
| | | result = point.proceed(); |
| | | }catch (Exception e){ |
| | | logger.error("redis error", e); |
| | | throw new LanbaseException("Redisæå¡å¼å¸¸"); |
| | | } |
| | | } |
| | | return result; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.landtool.lanbase.common.aspect; |
| | | |
| | | import java.lang.reflect.Method; |
| | | |
| | | import org.aspectj.lang.ProceedingJoinPoint; |
| | | import org.aspectj.lang.annotation.Around; |
| | | import org.aspectj.lang.annotation.Aspect; |
| | | import org.aspectj.lang.annotation.Pointcut; |
| | | import org.aspectj.lang.reflect.MethodSignature; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | /** |
| | | * @author lanbase |
| | | * @Description: TODO(ç³»ç»æ¥å¿ï¼åé¢å¤çç±») |
| | | * @date 2017-6-23 15:07 |
| | | */ |
| | | @Aspect |
| | | @Component |
| | | public class SysLogAspect { |
| | | |
| | | // @Autowired |
| | | // private SysLogService sysLogService; |
| | | |
| | | @Pointcut("@annotation(com.landtool.lanbase.common.annotation.SysLog)") |
| | | public void logPointCut() { |
| | | |
| | | } |
| | | |
| | | @Around("logPointCut()") |
| | | public Object around(ProceedingJoinPoint point) throws Throwable { |
| | | long beginTime = System.currentTimeMillis(); |
| | | //æ§è¡æ¹æ³ |
| | | Object result = point.proceed(); |
| | | //æ§è¡æ¶é¿(毫ç§) |
| | | long time = System.currentTimeMillis() - beginTime; |
| | | |
| | | //ä¿åæ¥å¿ |
| | | saveSysLog(point, time); |
| | | |
| | | return result; |
| | | } |
| | | |
| | | private void saveSysLog(ProceedingJoinPoint joinPoint, long time) { |
| | | MethodSignature signature = (MethodSignature) joinPoint.getSignature(); |
| | | Method method = signature.getMethod(); |
| | | /* |
| | | SysLog sysLog = new SysLog(); |
| | | com.landtool.lanbase.common.annotation.SysLog log = method.getAnnotation(com.landtool.lanbase.common.annotation.SysLog.class); |
| | | if(log != null){ |
| | | //注解ä¸çæè¿° |
| | | sysLog.setOperation(log.value()); |
| | | } |
| | | |
| | | //请æ±çæ¹æ³å |
| | | String className = joinPoint.getTarget().getClass().getName(); |
| | | String methodName = signature.getName(); |
| | | sysLog.setMethod(className + "." + methodName + "()"); |
| | | |
| | | //请æ±çåæ° |
| | | Object[] args = joinPoint.getArgs(); |
| | | try{ |
| | | String params = new Gson().toJson(args[0]); |
| | | sysLog.setParams(params); |
| | | }catch (Exception e){ |
| | | |
| | | } |
| | | |
| | | //è·årequest |
| | | HttpServletRequest request = HttpContextUtils.getHttpServletRequest(); |
| | | //设置IPå°å |
| | | sysLog.setIp(IPUtils.getIpAddr(request)); |
| | | |
| | | //ç¨æ·å |
| | | String username = ((SysUser) SecurityUtils.getSubject().getPrincipal()).getUsername(); |
| | | sysLog.setUsername(username); |
| | | |
| | | sysLog.setTime(time); |
| | | sysLog.setCreateTime(new Date()); |
| | | //ä¿åç³»ç»æ¥å¿ |
| | | sysLogService.save(sysLog); */ |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.landtool.lanbase.common.cache; |
| | | |
| | | /** |
| | | * @author lanbase |
| | | * @Description: TODO(ç¼åå·¥ååºç±») |
| | | * @date 2017-6-23 15:07 |
| | | */ |
| | | public abstract class BaseCacheFactory implements ICache { |
| | | |
| | | @SuppressWarnings("unchecked") |
| | | public <T> T get(String cacheName, Object key, ILoader iLoader) { |
| | | Object data = get(cacheName, key); |
| | | if (data == null) { |
| | | data = iLoader.load(); |
| | | put(cacheName, key, data); |
| | | } |
| | | return (T) data; |
| | | } |
| | | |
| | | @SuppressWarnings("unchecked") |
| | | public <T> T get(String cacheName, Object key, Class<? extends ILoader> iLoaderClass) { |
| | | Object data = get(cacheName, key); |
| | | if (data == null) { |
| | | try { |
| | | ILoader dataLoader = iLoaderClass.newInstance(); |
| | | data = dataLoader.load(); |
| | | put(cacheName, key, data); |
| | | } catch (Exception e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | } |
| | | return (T) data; |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.landtool.lanbase.common.cache; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author lanbase |
| | | * @Description: TODO(ç¼åå·¥å
·ç±») |
| | | * @date 2017-6-23 15:07 |
| | | */ |
| | | public class CacheKit { |
| | | |
| | | private static ICache defaultCacheFactory = new EhcacheFactory(); |
| | | |
| | | public static void put(String cacheName, Object key, Object value) { |
| | | defaultCacheFactory.put(cacheName, key, value); |
| | | } |
| | | |
| | | public static <T> T get(String cacheName, Object key) { |
| | | return defaultCacheFactory.get(cacheName, key); |
| | | } |
| | | |
| | | @SuppressWarnings("rawtypes") |
| | | public static List getKeys(String cacheName) { |
| | | return defaultCacheFactory.getKeys(cacheName); |
| | | } |
| | | |
| | | public static void remove(String cacheName, Object key) { |
| | | defaultCacheFactory.remove(cacheName, key); |
| | | } |
| | | |
| | | public static void removeAll(String cacheName) { |
| | | defaultCacheFactory.removeAll(cacheName); |
| | | } |
| | | |
| | | public static <T> T get(String cacheName, Object key, ILoader iLoader) { |
| | | return defaultCacheFactory.get(cacheName, key, iLoader); |
| | | } |
| | | |
| | | public static <T> T get(String cacheName, Object key, Class<? extends ILoader> iLoaderClass) { |
| | | return defaultCacheFactory.get(cacheName, key, iLoaderClass); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.landtool.lanbase.common.cache; |
| | | |
| | | import java.util.List; |
| | | |
| | | import org.apache.log4j.Logger; |
| | | |
| | | import net.sf.ehcache.Cache; |
| | | import net.sf.ehcache.CacheManager; |
| | | import net.sf.ehcache.Element; |
| | | |
| | | /** |
| | | * @author lanbase |
| | | * @Description: TODO(Ehcacheç¼åå·¥å) |
| | | * @date 2017-6-23 15:07 |
| | | */ |
| | | public class EhcacheFactory extends BaseCacheFactory { |
| | | |
| | | private static CacheManager cacheManager; |
| | | private static volatile Object locker = new Object(); |
| | | private static final Logger log = Logger.getLogger(EhcacheFactory.class); |
| | | |
| | | private static CacheManager getCacheManager() { |
| | | if (cacheManager == null) { |
| | | synchronized (EhcacheFactory.class) { |
| | | if (cacheManager == null) { |
| | | cacheManager = CacheManager.create(); |
| | | } |
| | | } |
| | | } |
| | | return cacheManager; |
| | | } |
| | | |
| | | static Cache getOrAddCache(String cacheName) { |
| | | CacheManager cacheManager = getCacheManager(); |
| | | Cache cache = cacheManager.getCache(cacheName); |
| | | if (cache == null) { |
| | | synchronized(locker) { |
| | | cache = cacheManager.getCache(cacheName); |
| | | if (cache == null) { |
| | | log.warn("æ æ³æ¾å°ç¼å [" + cacheName + "]çé
ç½®, 使ç¨é»è®¤é
ç½®."); |
| | | cacheManager.addCacheIfAbsent(cacheName); |
| | | cache = cacheManager.getCache(cacheName); |
| | | log.debug("ç¼å [" + cacheName + "] å¯å¨."); |
| | | } |
| | | } |
| | | } |
| | | return cache; |
| | | } |
| | | |
| | | public void put(String cacheName, Object key, Object value) { |
| | | getOrAddCache(cacheName).put(new Element(key, value)); |
| | | } |
| | | |
| | | @SuppressWarnings("unchecked") |
| | | public <T> T get(String cacheName, Object key) { |
| | | Element element = getOrAddCache(cacheName).get(key); |
| | | return element != null ? (T)element.getObjectValue() : null; |
| | | } |
| | | |
| | | @SuppressWarnings("rawtypes") |
| | | public List getKeys(String cacheName) { |
| | | return getOrAddCache(cacheName).getKeys(); |
| | | } |
| | | |
| | | public void remove(String cacheName, Object key) { |
| | | getOrAddCache(cacheName).remove(key); |
| | | } |
| | | |
| | | public void removeAll(String cacheName) { |
| | | getOrAddCache(cacheName).removeAll(); |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.landtool.lanbase.common.cache; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author lanbase |
| | | * @Description: TODO(éç¨ç¼åæ¥å£) |
| | | * @date 2017-6-23 15:07 |
| | | */ |
| | | public interface ICache { |
| | | |
| | | void put(String cacheName, Object key, Object value); |
| | | |
| | | <T> T get(String cacheName, Object key); |
| | | |
| | | @SuppressWarnings("rawtypes") |
| | | List getKeys(String cacheName); |
| | | |
| | | void remove(String cacheName, Object key); |
| | | |
| | | void removeAll(String cacheName); |
| | | |
| | | <T> T get(String cacheName, Object key, ILoader iLoader); |
| | | |
| | | <T> T get(String cacheName, Object key, Class<? extends ILoader> iLoaderClass); |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.landtool.lanbase.common.cache; |
| | | |
| | | /** |
| | | * @author lanbase |
| | | * @Description: TODO(æ°æ®éè½½) |
| | | * @date 2017-6-23 15:07 |
| | | */ |
| | | public interface ILoader { |
| | | |
| | | Object load(); |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.landtool.lanbase.common.datasource; |
| | | |
| | | /** |
| | | * @author lanbase |
| | | * @Description: TODO(é
ç½®å¤æ°æ®æºçåå) |
| | | * @date 2017-9-26 16:58 |
| | | */ |
| | | public interface DataSourceNames { |
| | | |
| | | String FIRST = "first"; |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.landtool.lanbase.common.datasource; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | import javax.sql.DataSource; |
| | | |
| | | import org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource; |
| | | |
| | | /** |
| | | * @author lanbase |
| | | * @Description: TODO(å¨ææ°æ®æº) |
| | | * @date 2017-6-23 15:07 |
| | | */ |
| | | public class DynamicDataSource extends AbstractRoutingDataSource { |
| | | |
| | | private static final ThreadLocal<String> contextHolder = new ThreadLocal<>(); |
| | | |
| | | public DynamicDataSource(DataSource defaultTargetDataSource, Map<String, DataSource> targetDataSources) { |
| | | super.setDefaultTargetDataSource(defaultTargetDataSource); |
| | | super.setTargetDataSources(new HashMap<>(targetDataSources)); |
| | | super.afterPropertiesSet(); |
| | | } |
| | | |
| | | @Override |
| | | protected Object determineCurrentLookupKey() { |
| | | return getDataSource(); |
| | | } |
| | | |
| | | public static void setDataSource(String dataSource) { |
| | | contextHolder.set(dataSource); |
| | | } |
| | | |
| | | public static String getDataSource() { |
| | | return contextHolder.get(); |
| | | } |
| | | |
| | | public static void clearDataSource() { |
| | | contextHolder.remove(); |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.landtool.lanbase.common.datasource.annotation; |
| | | |
| | | import java.lang.annotation.Documented; |
| | | import java.lang.annotation.ElementType; |
| | | import java.lang.annotation.Retention; |
| | | import java.lang.annotation.RetentionPolicy; |
| | | import java.lang.annotation.Target; |
| | | |
| | | /** |
| | | * @author lanbase |
| | | * @Description: TODO(夿°æ®æºæ³¨è§£) |
| | | * @date 2017-9-26 16:53 |
| | | */ |
| | | @Target(ElementType.METHOD) |
| | | @Retention(RetentionPolicy.RUNTIME) |
| | | @Documented |
| | | public @interface DataSource { |
| | | |
| | | String name() default ""; |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.landtool.lanbase.common.datasource.aspect; |
| | | |
| | | import java.lang.reflect.Method; |
| | | |
| | | import org.aspectj.lang.ProceedingJoinPoint; |
| | | import org.aspectj.lang.annotation.Around; |
| | | import org.aspectj.lang.annotation.Aspect; |
| | | import org.aspectj.lang.annotation.Pointcut; |
| | | import org.aspectj.lang.reflect.MethodSignature; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.core.Ordered; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import com.landtool.lanbase.common.datasource.DataSourceNames; |
| | | import com.landtool.lanbase.common.datasource.DynamicDataSource; |
| | | import com.landtool.lanbase.common.datasource.annotation.DataSource; |
| | | |
| | | /** |
| | | * @author lanbase |
| | | * @Description: TODO(夿°æ®æºåé¢å¤çç±»-æ³¨è§£åæ¢æ°æ®æº) |
| | | * @date 2017-9-26 16:55 |
| | | */ |
| | | @Aspect |
| | | @Component |
| | | public class DataSourceAspect implements Ordered { |
| | | |
| | | protected Logger logger = LoggerFactory.getLogger(getClass()); |
| | | |
| | | @Pointcut("@annotation(com.landtool.lanbase.common.datasource.annotation.DataSource)") |
| | | public void dataSourcePointCut() { |
| | | |
| | | } |
| | | |
| | | @Around("dataSourcePointCut()") |
| | | public Object around(ProceedingJoinPoint point) throws Throwable { |
| | | MethodSignature signature = (MethodSignature) point.getSignature(); |
| | | Method method = signature.getMethod(); |
| | | |
| | | //è½¬æ¢æ°æ®æº |
| | | DataSource ds = method.getAnnotation(DataSource.class); |
| | | if(ds == null){ |
| | | DynamicDataSource.setDataSource(DataSourceNames.FIRST); |
| | | logger.debug("set datasource is " + DataSourceNames.FIRST); |
| | | }else { |
| | | DynamicDataSource.setDataSource(ds.name()); |
| | | logger.debug("set datasource is " + ds.name()); |
| | | } |
| | | |
| | | try { |
| | | return point.proceed(); |
| | | } finally { |
| | | DynamicDataSource.clearDataSource(); |
| | | logger.debug("clean datasource"); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public int getOrder() { |
| | | return 1; |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.landtool.lanbase.common.exception; |
| | | |
| | | /** |
| | | * @author lanbase |
| | | * @Description: TODO(èªå®ä¹å¼å¸¸) |
| | | * @date 2017-6-23 15:07 |
| | | */ |
| | | public class LanbaseException extends RuntimeException { |
| | | |
| | | private String msg; |
| | | |
| | | private int code = 500; |
| | | |
| | | public LanbaseException(String msg) { |
| | | super(msg); |
| | | this.msg = msg; |
| | | } |
| | | |
| | | public LanbaseException(String msg, Throwable e) { |
| | | super(msg, e); |
| | | this.msg = msg; |
| | | } |
| | | |
| | | public LanbaseException(String msg, int code) { |
| | | super(msg); |
| | | this.msg = msg; |
| | | this.code = code; |
| | | } |
| | | |
| | | public LanbaseException(String msg, int code, Throwable e) { |
| | | super(msg, e); |
| | | this.msg = msg; |
| | | this.code = code; |
| | | } |
| | | |
| | | public String getMsg() { |
| | | return msg; |
| | | } |
| | | |
| | | public void setMsg(String msg) { |
| | | this.msg = msg; |
| | | } |
| | | |
| | | public int getCode() { |
| | | return code; |
| | | } |
| | | |
| | | public void setCode(int code) { |
| | | this.code = code; |
| | | } |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.landtool.lanbase.common.exception; |
| | | |
| | | import org.apache.shiro.authz.AuthorizationException; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.dao.DuplicateKeyException; |
| | | import org.springframework.web.bind.annotation.ExceptionHandler; |
| | | import org.springframework.web.bind.annotation.RestControllerAdvice; |
| | | |
| | | import com.landtool.lanbase.common.utils.Result; |
| | | |
| | | /** |
| | | * @author lanbase |
| | | * @Description: TODO(å¼å¸¸å¤çå¨) |
| | | * @date 2017-6-23 15:07 |
| | | */ |
| | | @RestControllerAdvice |
| | | public class LanbaseExceptionHandler { |
| | | |
| | | private Logger logger = LoggerFactory.getLogger(getClass()); |
| | | |
| | | /** |
| | | * èªå®ä¹å¼å¸¸ |
| | | */ |
| | | @ExceptionHandler(LanbaseException.class) |
| | | public Result handleLanbaseException(LanbaseException e){ |
| | | return Result.error(e.getCode(), e.getMessage()); |
| | | } |
| | | |
| | | @ExceptionHandler(DuplicateKeyException.class) |
| | | public Result handleDuplicateKeyException(DuplicateKeyException e){ |
| | | logger.error(e.getMessage(), e); |
| | | return Result.error("æ°æ®åºä¸å·²åå¨è¯¥è®°å½"); |
| | | } |
| | | |
| | | @ExceptionHandler(AuthorizationException.class) |
| | | public Result handleAuthorizationException(AuthorizationException e){ |
| | | logger.error(e.getMessage(), e); |
| | | return Result.error("没ææéï¼è¯·è系管çåææ"); |
| | | } |
| | | |
| | | @ExceptionHandler(Exception.class) |
| | | public Result handleException(Exception e){ |
| | | logger.error(e.getMessage(), e); |
| | | return Result.error(); |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.landtool.lanbase.common.map; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.landtool.lanbase.common.utils.HttpOperateUtils; |
| | | import com.landtool.lanbase.config.SysTemPropertyConfig; |
| | | |
| | | import java.io.IOException; |
| | | |
| | | import static com.landtool.lanbase.common.utils.HttpOperateUtils.httpGet; |
| | | |
| | | public class EsbToken { |
| | | |
| | | /** |
| | | * è·åèµæºæå¡å°å |
| | | * @param Url æå¡å°å |
| | | * @param userid ç»å½ç¨æ·å |
| | | * @param RemoteAddr 客æ·ç«¯IP |
| | | * @param ResourceId èµæºID |
| | | * @param Espproxy æ¯å¦ä»£ç |
| | | * @param sysConfig é
置读å对象 |
| | | * @param subzyids åå¾å±id |
| | | * @param isPubzy æ¯å¦å®å
¨å
¬å¼ |
| | | * @param tokenValue tokenå¼ |
| | | * @param returnToken æ¯å¦åªè¿åtoken |
| | | * @return |
| | | */ |
| | | public static String getEsbUrl(String Url, Integer userid, String identyinfo, Integer ResourceId, Integer Espproxy, SysTemPropertyConfig sysConfig, String subzyids, Boolean isPubzy, String tokenValue, Boolean returnToken) { |
| | | String ServerUrl = ""; |
| | | String token = "";// token |
| | | if (Url != null && !Url.equals("")) { |
| | | ServerUrl = Url; |
| | | String urlEncode = ""; |
| | | String getTokenUrl = sysConfig.getTokenWebRoot() + "?userid=servdl&password=servdl123" + "&resourceid=" + ResourceId + "&expireSeconds=86400&identyinfo=" + identyinfo;// tokenè·åå°å |
| | | String TokenResponse = null;// 请æ±token |
| | | try { |
| | | TokenResponse = httpGet(getTokenUrl); |
| | | } catch (IOException e) { |
| | | return ServerUrl; |
| | | } |
| | | JSONObject object = JSONObject.parseObject(TokenResponse);// 转æ¢è¿åJSONå符串 |
| | | token = object.getString("data");// è·åè¿åtoken |
| | | if (token != null && !token.isEmpty()) { |
| | | if (ServerUrl.indexOf("?") > -1) { |
| | | ServerUrl += "&token=" + token; |
| | | } else { |
| | | ServerUrl += "?token=" + token; |
| | | } |
| | | } |
| | | } |
| | | return ServerUrl; |
| | | } |
| | | |
| | | /** |
| | | * è·åèµæºæå¡å°å |
| | | * @param userid ç»å½ç¨æ·å |
| | | * @param appId åºç¨ç¨åºID |
| | | * @param appUrl åºç¨ç¨åºå°å |
| | | * @param ResourceId èµæºID |
| | | * @param Espproxy æ¯å¦ä»£ç |
| | | * @param sysConfig é
置读å对象 |
| | | * @param subzyids åå¾å±id |
| | | * @param tokenValue tokenå¼ |
| | | * @return |
| | | */ |
| | | public static String getAppEsbToken(Integer userid, Integer appId, String appUrl, Integer ResourceId, Integer Espproxy, |
| | | SysTemPropertyConfig sysConfig, String subzyids, String tokenValue) { |
| | | String token = "";// token |
| | | String urlEncode = ""; |
| | | if (Espproxy == 1) { |
| | | try { |
| | | String getTokenUrl = sysConfig.getApptokenWebRoot() + "?userId=" + userid + "&resourceId=" + ResourceId |
| | | + "&expireSeconds=86400&appId=" + appId + "&appUrl=" + appUrl + "&subzyids=" + subzyids;// tokenè·åå°å |
| | | String TokenResponse = httpGet(getTokenUrl);// 请æ±token |
| | | JSONObject object = JSONObject.parseObject(TokenResponse);// 转æ¢è¿åJSONå符串 |
| | | token = object.getString("token");// è·åè¿åtoken |
| | | } catch (Exception e) { |
| | | |
| | | } |
| | | } else if (Espproxy == 0) { |
| | | if (tokenValue != "" && tokenValue != null) { |
| | | token = tokenValue; |
| | | } |
| | | } |
| | | |
| | | return token; |
| | | } |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.landtool.lanbase.common.map; |
| | | |
| | | import javax.annotation.PostConstruct; |
| | | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import com.landtool.lanbase.common.utils.HttpOperateUtils; |
| | | import com.landtool.lanbase.config.SysTemPropertyConfig; |
| | | import com.landtool.lanbase.modules.res.entity.Res_MainInfo; |
| | | import com.landtool.lanbase.modules.res.service.ResMainInfoService; |
| | | |
| | | @Component |
| | | public class TerraToken { |
| | | @Autowired |
| | | private ResMainInfoService resMainInfoService; |
| | | |
| | | private static TerraToken ter; |
| | | |
| | | |
| | | @PostConstruct |
| | | public void init(){ |
| | | ter=this; |
| | | ter.resMainInfoService=this.resMainInfoService; |
| | | } |
| | | public static String getToken(String Url, Integer userid, String RemoteAddr, Integer ResourceId, Integer Espproxy, SysTemPropertyConfig sysConfig, String subzyids, Boolean isPubzy, String tokenValue, Boolean returnToken) { |
| | | String ServerUrl = ""; |
| | | Res_MainInfo resMainInfo = ter.resMainInfoService.selectByPrimaryKey(ResourceId); |
| | | // long expiration=resMainInfo.getExpiration()!=null?resMainInfo.getExpiration():null; |
| | | String token = "";// token |
| | | if (Url != null && !Url.equals("")) { |
| | | ServerUrl = Url; |
| | | String urlEncode = ""; |
| | | if (Espproxy == 1) { |
| | | try { |
| | | String getTokenUrl = sysConfig.getTerraTokenWebRoot() + "?userid=" + userid + "&resourceId=" + ResourceId +"&clientIp=" + RemoteAddr + "&subzyids=" + subzyids + "&isPubzy=" + isPubzy;// tokenè·åå°å;// tokenè·åå°å |
| | | String TokenResponse = HttpOperateUtils.httpGet(getTokenUrl);// 请æ±token |
| | | // JSONObject object = JSONObject.parseObject(TokenResponse);// 转æ¢è¿åJSONå符串 |
| | | token = TokenResponse;// è·åè¿åtoken |
| | | if(token != null && !token.isEmpty()) { |
| | | if (ServerUrl.indexOf("?") > -1) { |
| | | ServerUrl += "&token=" + token; |
| | | } else { |
| | | ServerUrl += "?token=" + token; |
| | | } |
| | | } |
| | | } catch (Exception e) { |
| | | //if (ServerUrl.indexOf("?") > -1) { |
| | | // ServerUrl += "&token="; |
| | | //} else { |
| | | // ServerUrl += "?token="; |
| | | //} |
| | | } |
| | | } else if (Espproxy == 0 && tokenValue != null && !tokenValue.isEmpty()) { |
| | | if (ServerUrl.indexOf("?") > -1) { |
| | | ServerUrl += "&token=" + tokenValue; |
| | | } else { |
| | | ServerUrl += "?token=" + tokenValue; |
| | | } |
| | | token = tokenValue; |
| | | } |
| | | } |
| | | if(returnToken) return token; |
| | | return ServerUrl; |
| | | } |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.landtool.lanbase.common.scheduletask; |
| | | |
| | | import cn.hutool.core.collection.CollectionUtil; |
| | | import com.landtool.lanbase.common.utils.HttpUtils; |
| | | import com.landtool.lanbase.modules.res.entity.Res_ExtMapUrl; |
| | | import com.landtool.lanbase.modules.res.entity.Res_MainInfo; |
| | | import com.landtool.lanbase.modules.res.entity.Res_ProblemFeedback; |
| | | import com.landtool.lanbase.modules.res.service.impl.ResMainInfoServiceImpl; |
| | | import com.landtool.lanbase.modules.res.service.impl.ResProblemFeedbackServiceImpl; |
| | | import org.apache.commons.lang.StringUtils; |
| | | import org.apache.ibatis.transaction.Transaction; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.context.annotation.Configuration; |
| | | import org.springframework.scheduling.annotation.EnableScheduling; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import com.landtool.lanbase.modules.res.controller.ResMainInfoController; |
| | | import com.landtool.lanbase.modules.res.service.impl.ResExtMapUrlServiceImpl; |
| | | |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @Component |
| | | @Configuration |
| | | public class ScheduelTask { |
| | | |
| | | public Logger log=LoggerFactory.getLogger(ScheduelTask.class); |
| | | |
| | | @Autowired |
| | | ResMainInfoServiceImpl resMainInfoService; |
| | | @Autowired |
| | | ResExtMapUrlServiceImpl resExtMapUrlService; |
| | | @Autowired |
| | | private ResProblemFeedbackServiceImpl resProblemFeedbackService; |
| | | /* |
| | | * 宿¶æ£éªæ£å¸¸æå¡ å¼å¸¸æå¡æ´æ° |
| | | * add by zsx |
| | | * æ¯å¤©åæ¨6ç¹ |
| | | * æ¥è¯¢ææèµæºåå§å°å http请æ±å°å |
| | | * 1.è¯·æ±æ£å¸¸ å¦æèµæºä¹åç¶æä¸ºå¼å¸¸åæ´æ°æ£å¸¸ |
| | | * 2.请æ±å¼å¸¸ è¥åå¨å¼å¸¸è®°å½ åæ´æ°è®°å½æ¶é´ å¦åæå
¥ä¸æ¡æ°çè®°å½ (对åºèµæºç¶æä¸ºæ£å¸¸åæ´æ°ä¸ºå¼å¸¸) |
| | | // */ |
| | | @Scheduled(cron = "0 0 6 * * ?") |
| | | public void checkServiceUrl() { |
| | | //è·åææçæå¡èµæº |
| | | List<Res_ExtMapUrl> list = resExtMapUrlService.checkAllUrls(); |
| | | log.info("æå¡çæ§å¼å§"); |
| | | for (Res_ExtMapUrl res_extMapUrl : list) { |
| | | int status=0; //æå
¥è®°å½æ°æ® serverStatus 0 æ£å¸¸ 1å¼å¸¸ |
| | | boolean flag=false; |
| | | Integer resourceid = res_extMapUrl.getResourceid(); |
| | | Integer serverResource = res_extMapUrl.getServerResource(); |
| | | try { |
| | | String serverurl = res_extMapUrl.getServerurl(); |
| | | if(StringUtils.isNotBlank(serverurl)){ |
| | | String s = HttpUtils.get(serverurl); |
| | | //æ£å¸¸ 妿åå¨ä¹åå¼å¸¸æ°æ®åæ´æ°ç¶æä¸ºæ£å¸¸ |
| | | if(1== serverResource){ |
| | | updateServerStatus(resourceid,status); |
| | | } |
| | | } |
| | | } catch (Exception e) { |
| | | status=1; |
| | | //å¼å¸¸æåºè®¤ä¸ºæ¯æå¡ä¸è½æ£å¸¸ä½¿ç¨ ä¹åå¼å¸¸ä¸éå¤è®°å½(æ´æ°æ ¡éªæ¶é´), |
| | | List<Res_ProblemFeedback> problemFeedbacks = resProblemFeedbackService.selectByResourceid(resourceid); |
| | | if(!CollectionUtil.isNotEmpty(problemFeedbacks)){ |
| | | flag=true; |
| | | } |
| | | //馿¬¡è®°å½å¼å¸¸è®°å½ |
| | | InsertProblem(resourceid,status,flag); |
| | | //妿åå¨ä¹åæ£å¸¸æ°æ®åæ´æ°ç¶æä¸ºå¼å¸¸ |
| | | if(0== serverResource){ |
| | | updateServerStatus(resourceid,status); |
| | | } |
| | | } |
| | | } |
| | | log.info("æå¡çæ§ç»æ"); |
| | | |
| | | } |
| | | |
| | | //æ´æ°å¼å¸¸è®°å½ç¶æ |
| | | private void updateServerStatus(Integer resourceid, Integer status) { |
| | | Res_MainInfo mainInfo = new Res_MainInfo(); |
| | | mainInfo.setResourceid(resourceid); |
| | | mainInfo.setResourcestatus(status); //ç¶ææ´æ°åæ¥ |
| | | resMainInfoService.updateByPrimaryKeySelective(mainInfo); |
| | | } |
| | | //æå
¥é®é¢æ¶æ¯ |
| | | private void InsertProblem(Integer resourceid, Integer status,Boolean flag) { |
| | | Res_ProblemFeedback model = new Res_ProblemFeedback(); |
| | | java.sql.Timestamp time = new java.sql.Timestamp(new Date().getTime()); |
| | | model.setResourceid(resourceid); |
| | | model.setAddtime(time); |
| | | if (flag){ |
| | | model.setCreateuserid(0); //管çåæä½ |
| | | model.setFeedbacktype("ç³»ç»"); |
| | | model.setServerstatus(status); |
| | | model.setFeedbackstatus("æå¡é®é¢"); |
| | | model.setRemark("èµæºæä¸å¼"); |
| | | resProblemFeedbackService.insertSelective(model); |
| | | }else { |
| | | resProblemFeedbackService.updateByResourceId(model); |
| | | } |
| | | } |
| | | |
| | | public static void main(String[] args) { |
| | | try { |
| | | HttpUtils.get("http://71.3.251.104:8066/arcgis/rest/services/6257/MapServer"); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Licensed to Jasig under one or more contributor license |
| | | * agreements. See the NOTICE file distributed with this work |
| | | * for additional information regarding copyright ownership. |
| | | * Jasig licenses this file to you under the Apache License, |
| | | * Version 2.0 (the "License"); you may not use this file |
| | | * except in compliance with the License. You may obtain a |
| | | * copy of the License at the following location: |
| | | * |
| | | * http://www.apache.org/licenses/LICENSE-2.0 |
| | | * |
| | | * Unless required by applicable law or agreed to in writing, |
| | | * software distributed under the License is distributed on an |
| | | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| | | * KIND, either express or implied. See the License for the |
| | | * specific language governing permissions and limitations |
| | | * under the License. |
| | | */ |
| | | package com.landtool.lanbase.common.shiro; |
| | | |
| | | import java.io.IOException; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | import javax.servlet.FilterChain; |
| | | import javax.servlet.FilterConfig; |
| | | import javax.servlet.ServletException; |
| | | import javax.servlet.ServletRequest; |
| | | import javax.servlet.ServletResponse; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import javax.servlet.http.HttpSession; |
| | | |
| | | import org.apache.commons.lang.StringUtils; |
| | | import org.jasig.cas.client.Protocol; |
| | | import org.jasig.cas.client.authentication.AuthenticationRedirectStrategy; |
| | | import org.jasig.cas.client.authentication.ContainsPatternUrlPatternMatcherStrategy; |
| | | import org.jasig.cas.client.authentication.DefaultAuthenticationRedirectStrategy; |
| | | import org.jasig.cas.client.authentication.DefaultGatewayResolverImpl; |
| | | import org.jasig.cas.client.authentication.ExactUrlPatternMatcherStrategy; |
| | | import org.jasig.cas.client.authentication.GatewayResolver; |
| | | import org.jasig.cas.client.authentication.RegexUrlPatternMatcherStrategy; |
| | | import org.jasig.cas.client.authentication.UrlPatternMatcherStrategy; |
| | | import org.jasig.cas.client.configuration.ConfigurationKeys; |
| | | import org.jasig.cas.client.util.AbstractCasFilter; |
| | | import org.jasig.cas.client.util.CommonUtils; |
| | | import org.jasig.cas.client.util.ReflectUtils; |
| | | import org.jasig.cas.client.validation.Assertion; |
| | | |
| | | /** |
| | | * Filter implementation to intercept all requests and attempt to authenticate |
| | | * the user by redirecting them to CAS (unless the user has a ticket). |
| | | * <p> |
| | | * This filter allows you to specify the following parameters (at either the context-level or the filter-level): |
| | | * <ul> |
| | | * <li><code>casServerLoginUrl</code> - the url to log into CAS, i.e. https://cas.rutgers.edu/login</li> |
| | | * <li><code>renew</code> - true/false on whether to use renew or not.</li> |
| | | * <li><code>gateway</code> - true/false on whether to use gateway or not.</li> |
| | | * </ul> |
| | | * |
| | | * <p>Please see AbstractCasFilter for additional properties.</p> |
| | | * |
| | | * @author Scott Battaglia |
| | | * @author Misagh Moayyed |
| | | * @since 3.0 |
| | | */ |
| | | public class CasAuthenticationFilter extends AbstractCasFilter { |
| | | /** |
| | | * The URL to the CAS Server login. |
| | | */ |
| | | private String casServerLoginUrl; |
| | | |
| | | /** |
| | | * Whether to send the renew request or not. |
| | | */ |
| | | private boolean renew = false; |
| | | |
| | | /** |
| | | * Whether to send the gateway request or not. |
| | | */ |
| | | private boolean gateway = false; |
| | | |
| | | private GatewayResolver gatewayStorage = new DefaultGatewayResolverImpl(); |
| | | |
| | | private AuthenticationRedirectStrategy authenticationRedirectStrategy = new DefaultAuthenticationRedirectStrategy(); |
| | | |
| | | private UrlPatternMatcherStrategy ignoreUrlPatternMatcherStrategyClass = null; |
| | | |
| | | private static final Map<String, Class<? extends UrlPatternMatcherStrategy>> PATTERN_MATCHER_TYPES = |
| | | new HashMap<String, Class<? extends UrlPatternMatcherStrategy>>(); |
| | | |
| | | static { |
| | | PATTERN_MATCHER_TYPES.put("CONTAINS", ContainsPatternUrlPatternMatcherStrategy.class); |
| | | PATTERN_MATCHER_TYPES.put("REGEX", RegexUrlPatternMatcherStrategy.class); |
| | | PATTERN_MATCHER_TYPES.put("EXACT", ExactUrlPatternMatcherStrategy.class); |
| | | } |
| | | |
| | | public CasAuthenticationFilter() { |
| | | this(Protocol.CAS2); |
| | | } |
| | | |
| | | protected CasAuthenticationFilter(final Protocol protocol) { |
| | | super(protocol); |
| | | } |
| | | |
| | | protected void initInternal(final FilterConfig filterConfig) throws ServletException { |
| | | if (!isIgnoreInitConfiguration()) { |
| | | super.initInternal(filterConfig); |
| | | setCasServerLoginUrl(getString(ConfigurationKeys.CAS_SERVER_LOGIN_URL)); |
| | | setRenew(getBoolean(ConfigurationKeys.RENEW)); |
| | | setGateway(getBoolean(ConfigurationKeys.GATEWAY)); |
| | | |
| | | final String ignorePattern = getString(ConfigurationKeys.IGNORE_PATTERN); |
| | | final String ignoreUrlPatternType = getString(ConfigurationKeys.IGNORE_URL_PATTERN_TYPE); |
| | | |
| | | if (ignorePattern != null) { |
| | | final Class<? extends UrlPatternMatcherStrategy> ignoreUrlMatcherClass = PATTERN_MATCHER_TYPES.get(ignoreUrlPatternType); |
| | | if (ignoreUrlMatcherClass != null) { |
| | | this.ignoreUrlPatternMatcherStrategyClass = ReflectUtils.newInstance(ignoreUrlMatcherClass.getName()); |
| | | } else { |
| | | try { |
| | | logger.trace("Assuming {} is a qualified class name...", ignoreUrlPatternType); |
| | | this.ignoreUrlPatternMatcherStrategyClass = ReflectUtils.newInstance(ignoreUrlPatternType); |
| | | } catch (final IllegalArgumentException e) { |
| | | logger.error("Could not instantiate class [{}]", ignoreUrlPatternType, e); |
| | | } |
| | | } |
| | | if (this.ignoreUrlPatternMatcherStrategyClass != null) { |
| | | this.ignoreUrlPatternMatcherStrategyClass.setPattern(ignorePattern); |
| | | } |
| | | } |
| | | |
| | | final Class<? extends GatewayResolver> gatewayStorageClass = getClass(ConfigurationKeys.GATEWAY_STORAGE_CLASS); |
| | | |
| | | if (gatewayStorageClass != null) { |
| | | setGatewayStorage(ReflectUtils.newInstance(gatewayStorageClass)); |
| | | } |
| | | |
| | | final Class<? extends AuthenticationRedirectStrategy> authenticationRedirectStrategyClass = getClass(ConfigurationKeys.AUTHENTICATION_REDIRECT_STRATEGY_CLASS); |
| | | |
| | | if (authenticationRedirectStrategyClass != null) { |
| | | this.authenticationRedirectStrategy = ReflectUtils.newInstance(authenticationRedirectStrategyClass); |
| | | } |
| | | } |
| | | } |
| | | |
| | | public void init() { |
| | | super.init(); |
| | | CommonUtils.assertNotNull(this.casServerLoginUrl, "casServerLoginUrl cannot be null."); |
| | | } |
| | | |
| | | public final void doFilter(final ServletRequest servletRequest, final ServletResponse servletResponse, |
| | | final FilterChain filterChain) throws IOException, ServletException { |
| | | |
| | | final HttpServletRequest request = (HttpServletRequest) servletRequest; |
| | | final HttpServletResponse response = (HttpServletResponse) servletResponse; |
| | | |
| | | //String loginNamd= AssertionHolder.getAssertion().getPrincipal().getName(); |
| | | |
| | | String username = request.getRemoteUser(); |
| | | if (!StringUtils.isBlank(username)) { |
| | | return ; |
| | | } |
| | | |
| | | if (isRequestUrlExcluded(request)) { |
| | | logger.debug("Request is ignored."); |
| | | filterChain.doFilter(request, response); |
| | | return; |
| | | } |
| | | |
| | | final HttpSession session = request.getSession(false); |
| | | final Assertion assertion = session != null ? (Assertion) session.getAttribute(CONST_CAS_ASSERTION) : null; |
| | | |
| | | if (assertion != null) { |
| | | filterChain.doFilter(request, response); |
| | | return; |
| | | } |
| | | |
| | | final String serviceUrl = constructServiceUrl(request, response); |
| | | final String ticket = retrieveTicketFromRequest(request); |
| | | final boolean wasGatewayed = this.gateway && this.gatewayStorage.hasGatewayedAlready(request, serviceUrl); |
| | | |
| | | if (CommonUtils.isNotBlank(ticket) || wasGatewayed) { |
| | | filterChain.doFilter(request, response); |
| | | return; |
| | | } |
| | | |
| | | final String modifiedServiceUrl; |
| | | |
| | | logger.debug("no ticket and no assertion found"); |
| | | if (this.gateway) { |
| | | logger.debug("setting gateway attribute in session"); |
| | | modifiedServiceUrl = this.gatewayStorage.storeGatewayInformation(request, serviceUrl); |
| | | } else { |
| | | modifiedServiceUrl = serviceUrl; |
| | | } |
| | | |
| | | logger.debug("Constructed service url: {}", modifiedServiceUrl); |
| | | |
| | | final String urlToRedirectTo = CommonUtils.constructRedirectUrl(this.casServerLoginUrl, |
| | | getProtocol().getServiceParameterName(), modifiedServiceUrl, this.renew, this.gateway); |
| | | |
| | | logger.debug("redirecting to \"{}\"", urlToRedirectTo); |
| | | this.authenticationRedirectStrategy.redirect(request, response, urlToRedirectTo); |
| | | } |
| | | |
| | | public final void setRenew(final boolean renew) { |
| | | this.renew = renew; |
| | | } |
| | | |
| | | public final void setGateway(final boolean gateway) { |
| | | this.gateway = gateway; |
| | | } |
| | | |
| | | public final void setCasServerLoginUrl(final String casServerLoginUrl) { |
| | | this.casServerLoginUrl = casServerLoginUrl; |
| | | } |
| | | |
| | | public final void setGatewayStorage(final GatewayResolver gatewayStorage) { |
| | | this.gatewayStorage = gatewayStorage; |
| | | } |
| | | |
| | | private boolean isRequestUrlExcluded(final HttpServletRequest request) { |
| | | if (this.ignoreUrlPatternMatcherStrategyClass == null) { |
| | | return false; |
| | | } |
| | | |
| | | final StringBuffer urlBuffer = request.getRequestURL(); |
| | | if (request.getQueryString() != null) { |
| | | urlBuffer.append("?").append(request.getQueryString()); |
| | | } |
| | | final String requestUri = urlBuffer.toString(); |
| | | return this.ignoreUrlPatternMatcherStrategyClass.matches(requestUri); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.landtool.lanbase.common.shiro; |
| | | |
| | | import java.io.IOException; |
| | | import java.net.URLEncoder; |
| | | |
| | | import javax.servlet.ServletRequest; |
| | | import javax.servlet.ServletResponse; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | import org.apache.http.HttpStatus; |
| | | import org.apache.shiro.SecurityUtils; |
| | | import org.apache.shiro.authc.AuthenticationException; |
| | | import org.apache.shiro.authc.AuthenticationToken; |
| | | import org.apache.shiro.session.Session; |
| | | import org.apache.shiro.subject.Subject; |
| | | import org.apache.shiro.util.StringUtils; |
| | | import org.apache.shiro.web.filter.authc.AuthenticatingFilter; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.web.bind.annotation.RequestMethod; |
| | | |
| | | import com.google.gson.Gson; |
| | | import com.landtool.lanbase.common.utils.HttpUtils; |
| | | import com.landtool.lanbase.common.utils.Result; |
| | | |
| | | /** |
| | | * @author lanbase |
| | | * @Description: TODO(shiro 认è¯è¿æ»¤å¨) |
| | | * @date 2017-6-23 15:07 |
| | | */ |
| | | public class ShiroAuthenticatingFilter extends AuthenticatingFilter { |
| | | |
| | | private static String loginUrl; // http://127.0.0.1:8082/login |
| | | private static String CasHost;// https://cas.nmsmp.com/cas/ |
| | | |
| | | private Logger logger = LoggerFactory.getLogger(getClass()); |
| | | |
| | | public ShiroAuthenticatingFilter(String loginUrl,String casHost) |
| | | { |
| | | this.loginUrl=loginUrl; |
| | | this.CasHost=casHost; |
| | | } |
| | | |
| | | // å建shiro认è¯çtoken |
| | | @Override |
| | | protected AuthenticationToken createToken(ServletRequest request, ServletResponse response) throws Exception { |
| | | HttpServletRequest httpRequest = (HttpServletRequest) request; |
| | | String username = httpRequest.getRemoteUser(); |
| | | // è·å请æ±token |
| | | String token = getRequestToken((HttpServletRequest) request); |
| | | ShiroToken shiroToken = null; |
| | | // if (!StringUtils.isBlank(token)) { |
| | | // shiroToken = new ShiroToken(token); |
| | | // } else if (!StringUtils.isBlank(username)) { |
| | | // shiroToken = new ShiroToken(username, true); |
| | | // } else { |
| | | // return null; |
| | | // } |
| | | return shiroToken; |
| | | } |
| | | |
| | | // protected boolean preHandle(ServletRequest request, ServletResponse |
| | | // response) throws Exception { |
| | | // HttpServletRequest httpRequest = WebUtils.toHttp(request); |
| | | // HttpServletResponse httpResponse = WebUtils.toHttp(response); |
| | | // if (httpRequest.getMethod().equals(RequestMethod.OPTIONS.name())) { |
| | | // httpResponse.setHeader("Access-control-Allow-Origin", origin); |
| | | // httpResponse.setHeader("Access-Control-Allow-Methods", |
| | | // httpRequest.getMethod()); |
| | | // httpResponse.setHeader("Access-Control-Allow-Headers", |
| | | // httpRequest.getHeader("Access-Control-Request-Headers")); |
| | | // httpResponse.setStatus(HttpStatus.OK.value()); |
| | | // return false; |
| | | // } |
| | | // return super.preHandle(request, response); |
| | | // } |
| | | |
| | | // æ¯å¦å
è®¸è®¿é® |
| | | @Override |
| | | protected boolean isAccessAllowed(ServletRequest request, ServletResponse response, Object mappedValue) { |
| | | return false; |
| | | } |
| | | |
| | | // æç»è®¿é®çåºæ¥ |
| | | @Override |
| | | protected boolean onAccessDenied(ServletRequest request, ServletResponse response) throws Exception { |
| | | HttpServletRequest httpRequest = (HttpServletRequest) request; |
| | | HttpServletResponse httpResponse = (HttpServletResponse) response; |
| | | // å¤çCORSçoptionsè¯·æ± by Tanbin |
| | | if (httpRequest.getMethod().equals(RequestMethod.OPTIONS.name())) { |
| | | String origin = httpRequest.getHeader("Origin"); |
| | | httpResponse.setHeader("Access-control-Allow-Origin", origin); |
| | | httpResponse.setHeader("Access-Control-Allow-Methods", httpRequest.getMethod()); |
| | | httpResponse.setHeader("Access-Control-Allow-Credentials", "true"); |
| | | httpResponse.setHeader("Access-Control-Allow-Headers", |
| | | httpRequest.getHeader("Access-Control-Request-Headers")); |
| | | httpResponse.setStatus(HttpStatus.SC_OK); |
| | | return false; |
| | | } |
| | | |
| | | |
| | | String username = httpRequest.getRemoteUser(); |
| | | if (StringUtils.hasText(username)) {// å·²ç»ç»å½shiro |
| | | logger.debug("0----å·²ç»ç»å½shiro:" + username); |
| | | return true ; |
| | | } else { |
| | | username = getLoginNamefromXml(httpRequest); |
| | | if (StringUtils.hasText(username)) { |
| | | Subject subject = SecurityUtils.getSubject(); |
| | | ShiroToken shiroToken = new ShiroToken(username, true); |
| | | if(!subject.isAuthenticated()) |
| | | { |
| | | subject.login(shiroToken); |
| | | logger.debug("8----loginshiro:" ); |
| | | } |
| | | |
| | | String redirectUrl= getValidateTicketServer(httpRequest); |
| | | |
| | | logger.debug("3----RedirectOldurl:" + redirectUrl); |
| | | //WebUtils.issueRedirect(request, response, oldUrl); |
| | | httpResponse.setHeader("P3P", "CP=CAO PSA OUR"); |
| | | httpResponse.sendRedirect(redirectUrl); |
| | | |
| | | } else { |
| | | String reloginUrl= getFirstServer(httpRequest); |
| | | reloginUrl= CasHost + "login?service="+URLEncoder.encode( reloginUrl); |
| | | logger.debug("1----RedirectCasloginUrl:" + reloginUrl); |
| | | httpResponse.sendRedirect(reloginUrl);// ç¨æ·åä¸åå¨è·³è½¬åç»å½é¡µé¢ |
| | | return false; |
| | | } |
| | | } |
| | | return true ; |
| | | } |
| | | |
| | | @Override |
| | | protected boolean onLoginFailure(AuthenticationToken token, AuthenticationException e, ServletRequest request, |
| | | ServletResponse response) { |
| | | HttpServletResponse httpResponse = (HttpServletResponse) response; |
| | | httpResponse.setContentType("application/json;charset=utf-8"); |
| | | try { |
| | | // å¤çç»å½å¤±è´¥çå¼å¸¸ |
| | | Throwable throwable = e.getCause() == null ? e : e.getCause(); |
| | | Result r = Result.error(HttpStatus.SC_UNAUTHORIZED, throwable.getMessage()); |
| | | |
| | | String json = new Gson().toJson(r); |
| | | httpResponse.getWriter().print(json); |
| | | } catch (IOException e1) { |
| | | |
| | | } |
| | | |
| | | return false; |
| | | } |
| | | |
| | | /** |
| | | * è·å请æ±çtoken |
| | | */ |
| | | private String getRequestToken(HttpServletRequest httpRequest) { |
| | | // ä»headerä¸è·åtoken |
| | | String token = httpRequest.getHeader("token"); |
| | | |
| | | // 妿headerä¸ä¸åå¨tokenï¼åä»åæ°ä¸è·åtoken |
| | | if (!StringUtils.hasText(token)) { |
| | | token = httpRequest.getParameter("token"); |
| | | } |
| | | |
| | | return token; |
| | | } |
| | | |
| | | |
| | | |
| | | private String getLoginNamefromXml(HttpServletRequest request) throws Exception { |
| | | String username = ""; |
| | | |
| | | Subject subject = SecurityUtils.getSubject(); |
| | | Session session =subject.getSession(true); |
| | | username = session.getAttribute("shirousername") == null ? "" |
| | | : session.getAttribute("shirousername").toString(); |
| | | logger.debug("4----shirousername:" + session.getAttribute("shirousername") +(session.getId() )); |
| | | if (org.springframework.util.StringUtils.isEmpty(username)) { |
| | | |
| | | |
| | | String ticket = request.getParameter("ticket"); |
| | | |
| | | if (!org.springframework.util.StringUtils.isEmpty(ticket)) { |
| | | |
| | | String reloginUrl= getValidateTicketServer(request); |
| | | |
| | | String url = CasHost.replace("https", "http"); |
| | | String validateurl = url + "serviceValidate?ticket=" + ticket + "&service=" + URLEncoder.encode(reloginUrl); |
| | | |
| | | logger.debug("2----ServiceValidate:" + validateurl); |
| | | |
| | | String casxml; |
| | | casxml = HttpUtils.get(validateurl); |
| | | logger.debug(casxml); |
| | | Integer index = casxml.indexOf("<cas:user>"); |
| | | Integer end = casxml.indexOf("</cas:user>"); |
| | | |
| | | if (index > 0) { |
| | | username = casxml.substring(index + 10, end); |
| | | } |
| | | } |
| | | } |
| | | return username; |
| | | } |
| | | |
| | | private String getValidateTicketServer(HttpServletRequest request) { |
| | | String server = getServerParameter(request); |
| | | |
| | | String reloginUrl= request.getRequestURL().toString(); |
| | | if(StringUtils.hasText( server)) |
| | | { |
| | | reloginUrl+="?"+server; |
| | | } |
| | | return reloginUrl; |
| | | } |
| | | |
| | | |
| | | private String getServerParameter(HttpServletRequest request) { |
| | | String server = request.getQueryString(); |
| | | String ticket = request.getParameter("ticket"); |
| | | if (!org.springframework.util.StringUtils.isEmpty(ticket)) { |
| | | server = server.replace("ticket=" + ticket, ""); |
| | | if (server.endsWith("&")) |
| | | server = server.substring(0, server.length() - 1); |
| | | } |
| | | return server; |
| | | } |
| | | |
| | | |
| | | /*** |
| | | * è·ååå§è®¿é®è·¯å¾ |
| | | * |
| | | * @return |
| | | */ |
| | | private String getFirstServer(HttpServletRequest httpRequest) { |
| | | String reloginUrl= httpRequest.getRequestURL().toString(); |
| | | if(StringUtils.hasText( httpRequest.getQueryString())) |
| | | { |
| | | reloginUrl+="?"+httpRequest.getQueryString(); |
| | | } |
| | | return reloginUrl; |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | //package com.landtool.lanbase.common.shiro; |
| | | // |
| | | //import java.util.Set; |
| | | // |
| | | //import org.apache.shiro.authz.AuthorizationInfo; |
| | | //import org.apache.shiro.authz.SimpleAuthorizationInfo; |
| | | //import org.apache.shiro.cas.CasRealm; |
| | | //import org.apache.shiro.subject.PrincipalCollection; |
| | | //import org.slf4j.Logger; |
| | | //import org.slf4j.LoggerFactory; |
| | | //import org.springframework.beans.factory.annotation.Autowired; |
| | | // |
| | | //import com.landtool.lanbase.modules.org.entity.OrgUser; |
| | | //import com.landtool.lanbase.modules.sys.service.OrgUserService; |
| | | // |
| | | //public class ShiroCasRealm extends CasRealm{ |
| | | // |
| | | // private static final Logger logger = LoggerFactory.getLogger(ShiroCasRealm.class); |
| | | // |
| | | // @Autowired |
| | | // private OrgUserService OrgUserService; |
| | | // |
| | | //// @PostConstruct |
| | | //// public void initProperty(){ |
| | | ////// setDefaultRoles("ROLE_USER"); |
| | | //// setCasServerUrlPrefix(ShiroCasConfiguration.casServerUrlPrefix); |
| | | //// // 客æ·ç«¯åè°å°å |
| | | //// setCasService(ShiroCasConfiguration.shiroServerUrlPrefix + ShiroCasConfiguration.casFilterUrlPattern); |
| | | //// } |
| | | // |
| | | // /** |
| | | // * æé认è¯ï¼ä¸ºå½åç»å½çSubjectæäºè§è²åæé |
| | | // * @see ç»æµè¯ï¼æ¬ä¾ä¸è¯¥æ¹æ³çè°ç¨æ¶æºä¸ºéææèµæºè¢«è®¿é®æ¶ |
| | | // * @see ç»æµè¯ï¼å¹¶ä¸æ¯æ¬¡è®¿é®éææèµæºæ¶é½ä¼æ§è¡è¯¥æ¹æ³ä¸çé»è¾ï¼è¿è¡¨ææ¬ä¾ä¸é»è®¤å¹¶æªå¯ç¨AuthorizationCache |
| | | // * @see ç»æµè¯ï¼å¦æè¿ç»è®¿é®åä¸ä¸ªURLï¼æ¯å¦å·æ°ï¼ï¼è¯¥æ¹æ³ä¸ä¼è¢«éå¤è°ç¨ï¼Shiroæä¸ä¸ªæ¶é´é´éï¼ä¹å°±æ¯cacheæ¶é´ï¼å¨ehcache-shiro.xmlä¸é
ç½®ï¼ï¼è¶
è¿è¿ä¸ªæ¶é´é´éåå·æ°é¡µé¢ï¼è¯¥æ¹æ³ä¼è¢«æ§è¡ |
| | | // */ |
| | | // @Override |
| | | // protected AuthorizationInfo doGetAuthorizationInfo(PrincipalCollection principalCollection) { |
| | | // logger.info("##################æ§è¡Shiroæé认è¯##################"); |
| | | // //è·åå½åç»å½è¾å
¥çç¨æ·åï¼çä»·äº(String) principalCollection.fromRealm(getName()).iterator().next(); |
| | | // String loginName = (String)super.getAvailablePrincipal(principalCollection); |
| | | // //å°æ°æ®åºæ¥æ¯å¦ææ¤å¯¹è±¡ |
| | | //// User user=userDao.findByName(loginName);// å®é
项ç®ä¸ï¼è¿éå¯ä»¥æ ¹æ®å®é
æ
åµåç¼åï¼å¦æä¸åï¼Shiroèªå·±ä¹æ¯ææ¶é´é´éæºå¶ï¼2åéå
ä¸ä¼é夿§è¡è¯¥æ¹æ³ |
| | | // //ç¨æ·ä¿¡æ¯ |
| | | // OrgUser user = OrgUserService.queryByUserName(loginName); |
| | | // //è´¦å·ä¸åå¨ |
| | | //// if(user == null) { |
| | | //// ShiroUtils.setSessionAttribute(Constant.LOGIN_ERROR_TIMES, ++errorTimes); |
| | | //// return Result.error("è´¦å·ä¸åå¨").put("errorTimes", errorTimes); |
| | | //// } |
| | | // if(user!=null){ |
| | | // Long userId = user.getId(); |
| | | // //ç¨æ·æéå表 |
| | | // Set<String> permsSet = OrgUserService.getUserPermissions(userId); |
| | | // SimpleAuthorizationInfo info = new SimpleAuthorizationInfo(); |
| | | // info.setStringPermissions(permsSet); |
| | | // |
| | | // //æéä¿¡æ¯å¯¹è±¡info,ç¨æ¥åæ¾æ¥åºçç¨æ·çææçè§è²ï¼roleï¼åæéï¼permissionï¼ |
| | | //// SimpleAuthorizationInfo info=new SimpleAuthorizationInfo(); |
| | | // //ç¨æ·çè§è²éå |
| | | //// info.setRoles(user.getRolesName()); |
| | | //// //ç¨æ·çè§è²å¯¹åºçæææéï¼å¦æåªä½¿ç¨è§è²å®ä¹è®¿é®æéï¼ä¸é¢çåè¡å¯ä»¥ä¸è¦ |
| | | //// List<Role> roleList=user.getRoleList(); |
| | | //// for (Role role : roleList) { |
| | | //// info.addStringPermissions(role.getPermissionsName()); |
| | | //// } |
| | | // // æè
æä¸é¢è¿æ ·æ·»å |
| | | // //æ·»å ä¸ä¸ªè§è²,䏿¯é
ç½®æä¹ä¸çæ·»å ,èæ¯è¯æè¯¥ç¨æ·æ¥æadminè§è² |
| | | //// simpleAuthorInfo.addRole("admin"); |
| | | // //æ·»å æé |
| | | //// simpleAuthorInfo.addStringPermission("admin:manage"); |
| | | //// logger.info("å·²ä¸ºç¨æ·[mike]èµäºäº[admin]è§è²å[admin:manage]æé"); |
| | | // return info; |
| | | // } |
| | | // // è¿ånullçè¯ï¼å°±ä¼å¯¼è´ä»»ä½ç¨æ·è®¿é®è¢«æ¦æªçè¯·æ±æ¶ï¼é½ä¼èªå¨è·³è½¬å°unauthorizedUrlæå®çå°å |
| | | // return null; |
| | | // } |
| | | // |
| | | //} |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.landtool.lanbase.common.shiro; |
| | | |
| | | import java.util.Set; |
| | | |
| | | import org.apache.shiro.authc.AuthenticationException; |
| | | import org.apache.shiro.authc.AuthenticationInfo; |
| | | import org.apache.shiro.authc.AuthenticationToken; |
| | | import org.apache.shiro.authc.ExpiredCredentialsException; |
| | | import org.apache.shiro.authc.LockedAccountException; |
| | | import org.apache.shiro.authc.SimpleAuthenticationInfo; |
| | | import org.apache.shiro.authz.AuthorizationInfo; |
| | | import org.apache.shiro.authz.SimpleAuthorizationInfo; |
| | | import org.apache.shiro.realm.AuthorizingRealm; |
| | | import org.apache.shiro.subject.PrincipalCollection; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import com.landtool.lanbase.common.Constant; |
| | | import com.landtool.lanbase.modules.org.entity.OrgUser; |
| | | import com.landtool.lanbase.modules.org.service.OrgUserService; |
| | | import com.landtool.lanbase.modules.sys.entity.SysUserToken; |
| | | import com.landtool.lanbase.modules.sys.service.SysUserTokenService; |
| | | |
| | | /** |
| | | * @author lanbase |
| | | * @Description: TODO(认è¯) |
| | | * @date 2017-6-23 15:07 |
| | | */ |
| | | @Component |
| | | public class ShiroRealm extends AuthorizingRealm { |
| | | |
| | | @Autowired |
| | | private OrgUserService orgUserService; |
| | | |
| | | @Autowired |
| | | private SysUserTokenService sysUserTokenService; |
| | | |
| | | @Override |
| | | public boolean supports(AuthenticationToken token) { |
| | | return token instanceof ShiroToken; |
| | | } |
| | | |
| | | /** |
| | | * ææ |
| | | */ |
| | | @Override |
| | | protected AuthorizationInfo doGetAuthorizationInfo(PrincipalCollection principals) { |
| | | OrgUser user = (OrgUser)principals.getPrimaryPrincipal(); |
| | | Long userId = user.getUserid(); |
| | | |
| | | //ç¨æ·æéå表 |
| | | Set<String> permsSet = orgUserService.getUserPermissions(userId); |
| | | |
| | | SimpleAuthorizationInfo info = new SimpleAuthorizationInfo(); |
| | | info.setStringPermissions(permsSet); |
| | | return info; |
| | | } |
| | | |
| | | /** |
| | | * è®¤è¯ |
| | | */ |
| | | @Override |
| | | protected AuthenticationInfo doGetAuthenticationInfo(AuthenticationToken token) throws AuthenticationException { |
| | | ShiroToken accessToken = (ShiroToken) token; |
| | | OrgUser user; |
| | | if (!accessToken.IsCasToken()) { |
| | | // æ ¹æ®accessTokenï¼æ¥è¯¢ç¨æ·ä¿¡æ¯ |
| | | SysUserToken tokenEntity = sysUserTokenService.queryByToken(accessToken.getPrincipal()); |
| | | // token失æ |
| | | if (tokenEntity == null || tokenEntity.getExpireTime().getTime() < System.currentTimeMillis()) { |
| | | throw new ExpiredCredentialsException("token失æï¼è¯·éæ°ç»å½"); |
| | | } |
| | | user = orgUserService.queryObject(tokenEntity.getUserId()); |
| | | } |
| | | else |
| | | { |
| | | //ç¨æ·ä¿¡æ¯ |
| | | user = orgUserService.queryByUserName(accessToken.getPrincipal()); |
| | | } |
| | | //è´¦å·éå® |
| | | if(Constant.UserStatus.DISABLE.getValue()==user.getUserstatus()){ |
| | | throw new LockedAccountException("è´¦å·å·²è¢«éå®,请è系管çå"); |
| | | } |
| | | |
| | | SimpleAuthenticationInfo info = new SimpleAuthenticationInfo(user, token.getPrincipal(), getName()); |
| | | return info; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.landtool.lanbase.common.shiro; |
| | | |
| | | import org.apache.shiro.authc.AuthenticationToken; |
| | | |
| | | /** |
| | | * @author lanbase |
| | | * @Description: TODO(token) |
| | | * @date 2017-6-23 15:07 |
| | | */ |
| | | public class ShiroToken implements AuthenticationToken { |
| | | |
| | | private String token; |
| | | private boolean isCasToken; |
| | | |
| | | public ShiroToken(String token) { |
| | | this.token = token; |
| | | this.isCasToken = false; |
| | | } |
| | | |
| | | public ShiroToken(String token, boolean isCasToken) { |
| | | this.token = token; |
| | | this.isCasToken = isCasToken; |
| | | } |
| | | |
| | | @Override |
| | | public String getPrincipal() { |
| | | return token; |
| | | } |
| | | |
| | | @Override |
| | | public Object getCredentials() { |
| | | return token; |
| | | } |
| | | |
| | | public boolean IsCasToken() { |
| | | return isCasToken; |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.landtool.lanbase.common.shiro; |
| | | |
| | | import java.security.MessageDigest; |
| | | import java.util.UUID; |
| | | |
| | | import com.landtool.lanbase.common.exception.LanbaseException; |
| | | |
| | | /** |
| | | * @author lanbase |
| | | * @Description: TODO(çætoken) |
| | | * @date 2017-6-23 15:07 |
| | | */ |
| | | public class TokenGenerator { |
| | | |
| | | public static String generateValue() { |
| | | return generateValue(UUID.randomUUID().toString()); |
| | | } |
| | | |
| | | private static final char[] hexCode = "0123456789abcdef".toCharArray(); |
| | | |
| | | public static String toHexString(byte[] data) { |
| | | if(data == null) { |
| | | return null; |
| | | } |
| | | StringBuilder r = new StringBuilder(data.length*2); |
| | | for ( byte b : data) { |
| | | r.append(hexCode[(b >> 4) & 0xF]); |
| | | r.append(hexCode[(b & 0xF)]); |
| | | } |
| | | return r.toString(); |
| | | } |
| | | |
| | | public static String generateValue(String param) { |
| | | try { |
| | | MessageDigest algorithm = MessageDigest.getInstance("MD5"); |
| | | algorithm.reset(); |
| | | algorithm.update(param.getBytes()); |
| | | byte[] messageDigest = algorithm.digest(); |
| | | return toHexString(messageDigest); |
| | | } catch (Exception e) { |
| | | throw new LanbaseException("çæToken失败", e); |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | /** |
| | | * Licensed under the GNU Lesser General Public License (LGPL) ,Version 3.0 (the "License"); |
| | | * you may not use this file except in compliance with the License. |
| | | * You may obtain a copy of the License at |
| | | * |
| | | * http://www.gnu.org/licenses/lgpl-3.0.txt |
| | | * |
| | | * Unless required by applicable law or agreed to in writing, software |
| | | * distributed under the License is distributed on an "AS IS" BASIS, |
| | | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| | | * See the License for the specific language governing permissions and |
| | | * limitations under the License. |
| | | */ |
| | | package com.landtool.lanbase.common.utils; |
| | | |
| | | import java.io.File; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.UUID; |
| | | |
| | | import org.apache.commons.lang.StringUtils; |
| | | |
| | | /** |
| | | * @author lanbase |
| | | * @Description: TODO(attachmentæä»¶å¤ç) |
| | | * @date 2017-6-23 15:07 |
| | | */ |
| | | public class AttachmentUtils { |
| | | |
| | | static SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd"); |
| | | |
| | | /** |
| | | * å建æä»¶å |
| | | * @param suffix |
| | | * @return |
| | | */ |
| | | public static String newFileName(String suffix){ |
| | | String webRoot = FileUtils.getTempPath(); |
| | | |
| | | String uuid = UUID.randomUUID().toString().replace("-", ""); |
| | | |
| | | StringBuilder newFileName = new StringBuilder(webRoot).append(File.separator).append("attachment") |
| | | .append(File.separator).append(dateFormat.format(new Date())).append(File.separator).append(uuid) |
| | | .append(suffix); |
| | | |
| | | File newfile = new File(newFileName.toString()); |
| | | |
| | | if (!newfile.getParentFile().exists()) { |
| | | newfile.getParentFile().mkdirs(); |
| | | } |
| | | |
| | | return newFileName.toString(); |
| | | } |
| | | |
| | | /** |
| | | * å建æä»¶å |
| | | * @param suffix |
| | | * @param root |
| | | * @param category |
| | | * @return |
| | | */ |
| | | public static String newFileName(String suffix,String root,String category){ |
| | | String webRoot = root; |
| | | |
| | | String uuid = UUID.randomUUID().toString().replace("-", ""); |
| | | |
| | | StringBuilder newFileName = new StringBuilder(webRoot).append(File.separator).append("attachment") |
| | | .append(File.separator).append(category).append(File.separator).append(uuid) |
| | | .append(suffix); |
| | | |
| | | File newfile = new File(newFileName.toString()); |
| | | |
| | | if (!newfile.getParentFile().exists()) { |
| | | newfile.getParentFile().mkdirs(); |
| | | } |
| | | |
| | | return newFileName.toString(); |
| | | } |
| | | |
| | | static List<String> imageSuffix = new ArrayList<String>(); |
| | | |
| | | static { |
| | | imageSuffix.add(".jpg"); |
| | | imageSuffix.add(".jpeg"); |
| | | imageSuffix.add(".png"); |
| | | imageSuffix.add(".bmp"); |
| | | imageSuffix.add(".gif"); |
| | | } |
| | | |
| | | public static boolean isImage(String path) { |
| | | String sufffix = FileUtils.getSuffix(path); |
| | | if (StringUtils.isNotBlank(sufffix)) |
| | | return imageSuffix.contains(sufffix.toLowerCase()); |
| | | return false; |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.landtool.lanbase.common.utils; |
| | | |
| | | |
| | | import java.security.MessageDigest; |
| | | import java.util.Base64; |
| | | |
| | | import javax.crypto.KeyGenerator; |
| | | import javax.crypto.Mac; |
| | | import javax.crypto.SecretKey; |
| | | import javax.crypto.spec.SecretKeySpec; |
| | | |
| | | |
| | | //import sun.misc.BASE64Decoder; |
| | | //import sun.misc.BASE64Encoder; |
| | | |
| | | /** |
| | | * åºç¡å å¯ç»ä»¶ |
| | | * @author TanBin |
| | | */ |
| | | public abstract class CoderUtils { |
| | | public static final String KEY_SHA = "SHA"; |
| | | public static final String KEY_MD5 = "MD5"; |
| | | |
| | | /** |
| | | * MACç®æ³å¯é以ä¸å¤ç§ç®æ³ |
| | | * <pre> |
| | | * HmacMD5 |
| | | * HmacSHA1 |
| | | * HmacSHA256 |
| | | * HmacSHA384 |
| | | * HmacSHA512 |
| | | * </pre> |
| | | */ |
| | | public static final String KEY_MAC = "HmacMD5"; |
| | | |
| | | /** |
| | | * BASE64å å¯ |
| | | * @param key |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | public static String encryptBASE64(byte[] data) { |
| | | //text.getBytes("UTF-8"); new String(decoder.decode(encodedText), "UTF-8") |
| | | //æ³1ï¼ä½¿ç¨sun.miscå¥ä»¶ã1.6ä¹åï¼ æçä¸å¥½ï¼æ°JDK䏿¯æ |
| | | // return (new BASE64Encoder()).encodeBuffer(data); |
| | | |
| | | //æ³2ï¼ä½¿ç¨Apache Commons Codecã |
| | | // return (new Base64()).encodeToString(data); |
| | | |
| | | //æ³3ï¼ä½¿ç¨Java 8çjava.utilå¥ä»¶ã æçæ¯1ç11åï¼æ¯2ç3å以ä¸ã |
| | | return Base64.getEncoder().encodeToString(data); |
| | | } |
| | | |
| | | /** |
| | | * BASE64è§£å¯ |
| | | * @param key |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | public static byte[] decryptBASE64(String key) { |
| | | //æ³1ï¼ä½¿ç¨sun.miscå¥ä»¶ã æçä¸å¥½ï¼æ°JDK䏿¯æ |
| | | // return (new BASE64Decoder()).decodeBuffer(key); |
| | | |
| | | //æ³2ï¼ä½¿ç¨Apache Commons Codecã |
| | | // return (new Base64()).decode(key); |
| | | |
| | | //æ³3ï¼ä½¿ç¨Java 8çjava.utilå¥ä»¶ã æçæ¯1ç11åï¼æ¯2ç3å以ä¸ã |
| | | return Base64.getDecoder().decode(key); |
| | | } |
| | | |
| | | /** |
| | | * MD5å å¯ |
| | | * @param data |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | public static byte[] encryptMD5(byte[] data) throws Exception{ |
| | | MessageDigest md5 = MessageDigest.getInstance(KEY_MD5); |
| | | md5.update(data); |
| | | return md5.digest(); |
| | | } |
| | | |
| | | /** |
| | | * èå¾çMD5å å¯ç®æ³ |
| | | * @param text |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | public static String lantuEncryptMD5(String text) throws Exception{ |
| | | byte[] b = encryptMD5(text.getBytes("UTF-8")); |
| | | String key = convertToHexString(b); |
| | | //转为大å |
| | | key = key.toUpperCase(); |
| | | //ååº |
| | | char[] array = key.toCharArray(); |
| | | String reverseKey = ""; |
| | | for (int i = array.length-1; i >= 0; i--) { |
| | | reverseKey += array[i]; |
| | | } |
| | | return reverseKey; |
| | | } |
| | | |
| | | /** |
| | | * åèæ°ç»è½¬ä¸º32ä½å符串 |
| | | * @param data |
| | | * @return |
| | | */ |
| | | private static String convertToHexString(byte data[]) { |
| | | StringBuffer strBuffer = new StringBuffer(); |
| | | for (int i = 0; i < data.length; i++) { |
| | | //strBuffer.append(Integer.toHexString(0xff & data[i])); //30bit |
| | | String haxHex = Integer.toHexString(data[i] & 0xFF); |
| | | if(haxHex.length() < 2){ |
| | | strBuffer.append("0"); |
| | | } |
| | | strBuffer.append(haxHex); |
| | | } |
| | | return strBuffer.toString(); |
| | | } |
| | | |
| | | /** |
| | | * SHAå å¯ |
| | | * @param data |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | public static byte[] encryptSHA(byte[] data) throws Exception{ |
| | | MessageDigest sha = MessageDigest.getInstance(KEY_SHA); |
| | | sha.update(data); |
| | | return sha.digest(); |
| | | } |
| | | |
| | | /** |
| | | * åå§åHMACå¯é¥ |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | public static String initMacKey() throws Exception{ |
| | | KeyGenerator keyGenerator = KeyGenerator.getInstance(KEY_MAC); |
| | | SecretKey secretKey = keyGenerator.generateKey(); |
| | | return encryptBASE64(secretKey.getEncoded()); |
| | | } |
| | | |
| | | /** |
| | | * HMACå å¯ |
| | | * @param data |
| | | * @param key |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | public static byte[] encryptHMAC(byte[] data, String key) throws Exception{ |
| | | SecretKey secretKey = new SecretKeySpec(decryptBASE64(key), KEY_MAC); |
| | | Mac mac = Mac.getInstance(secretKey.getAlgorithm()); |
| | | mac.init(secretKey); |
| | | return mac.doFinal(data); |
| | | } |
| | | |
| | | public static void main(String[] args) { |
| | | String inputStr = "123456"; |
| | | System.err.println("åæ:" + inputStr); |
| | | try { |
| | | String codeBASE64 = encryptBASE64(inputStr.getBytes("UTF-8")); |
| | | String codeMD5 = lantuEncryptMD5(inputStr); |
| | | byte[] codeSHA = encryptSHA(inputStr.getBytes("UTF-8")); |
| | | |
| | | String key = initMacKey(); |
| | | System.err.println("Macå¯é¥:" + key); |
| | | byte[] codeHMAC = encryptHMAC(inputStr.getBytes("UTF-8"), key); |
| | | |
| | | System.err.println("\nBASE64:" + codeBASE64); |
| | | System.err.println("BASE64è§£å¯:" + new String(decryptBASE64(codeBASE64),"UTF-8")); |
| | | System.err.println("MD5:" + codeMD5); |
| | | System.err.println("SHA:" + codeSHA); |
| | | System.err.println("HMAC:" + codeHMAC); |
| | | |
| | | } catch (Exception e) { |
| | | // TODO Auto-generated catch block |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.landtool.lanbase.common.utils; |
| | | |
| | | public class CommonUtils { |
| | | public static String subStringUtils(String str, int end) { |
| | | int length = 0; |
| | | char[] ch = str.toCharArray(); |
| | | String str2 = ""; |
| | | for (int i = 0; i < str.length(); i++) { |
| | | int num = str.codePointAt(i); |
| | | if (num >= 0 && num <= 255) { |
| | | length++; |
| | | } else { |
| | | length += 2; |
| | | } |
| | | if (length < end) { |
| | | str2 += ch[i]; |
| | | } else if (length == end) { |
| | | str2 += ch[i]; |
| | | if (i < str.length() - 1) { |
| | | str2 += "..."; |
| | | } |
| | | break; |
| | | } else { |
| | | break; |
| | | } |
| | | |
| | | } |
| | | return str2; |
| | | } |
| | | |
| | | /** |
| | | * ä¸æè½¬Unicode |
| | | * @param gbString 转æ¢ä¸æå符串 |
| | | * @return 转æ¢åUnicode |
| | | */ |
| | | public static String gbEncoding(final String gbString) { |
| | | char[] utfBytes = gbString.toCharArray(); |
| | | String unicodeBytes = ""; |
| | | for(int byteIndex = 0; byteIndex < utfBytes.length; byteIndex++) { |
| | | String hexB = Integer.toHexString(utfBytes[byteIndex]);//转æ¢ä¸º16è¿å¶æ´åå符串 |
| | | if(hexB.length() <= 2) { |
| | | hexB = "00" + hexB; |
| | | } |
| | | unicodeBytes = unicodeBytes + "\\u" + hexB; |
| | | } |
| | | |
| | | return unicodeBytes; |
| | | } |
| | | |
| | | /** |
| | | * Unicodeè½¬ä¸æ |
| | | * @param dataStr Unicodeå符串 |
| | | * @return 转æ¢å䏿 |
| | | */ |
| | | public static String decodeUnicode(final String dataStr) { |
| | | int start = 0; |
| | | int end = 0; |
| | | final StringBuffer buffer = new StringBuffer(); |
| | | while (start > -1){ |
| | | end = dataStr.indexOf("\\u", start + 2); |
| | | String charStr = ""; |
| | | if(end == -1) { |
| | | charStr = dataStr.substring(start +2, dataStr.length()); |
| | | } else { |
| | | charStr = dataStr.substring(start + 2, end); |
| | | } |
| | | char letter = (char) Integer.parseInt(charStr, 16); |
| | | buffer.append(new Character(letter).toString()); |
| | | start = end; |
| | | } |
| | | |
| | | return buffer.toString(); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.landtool.lanbase.common.utils; |
| | | |
| | | import java.security.InvalidParameterException; |
| | | import java.sql.Timestamp; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Calendar; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author lanbase |
| | | * @Description: TODO(æ¥æå¤ç) |
| | | * @date 2017-6-23 15:07 |
| | | */ |
| | | public class DateUtils { |
| | | /** æ¶é´æ ¼å¼(yyyy-MM-dd) */ |
| | | public final static String DATE_PATTERN = "yyyy-MM-dd"; |
| | | /** æ¶é´æ ¼å¼(yyyy-MM-dd HH:mm:ss) */ |
| | | public final static String DATE_TIME_PATTERN = "yyyy-MM-dd HH:mm:ss"; |
| | | |
| | | public static String format(Date date) { |
| | | return format(date, DATE_PATTERN); |
| | | } |
| | | |
| | | public static String format(Date date, String pattern) { |
| | | if(date != null){ |
| | | SimpleDateFormat df = new SimpleDateFormat(pattern); |
| | | return df.format(date); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | /** |
| | | * ç»è®¡ä¸¤ä¸ªæ¥æä¹é´å
å«ç天æ°ã |
| | | * |
| | | * @param date1 |
| | | * @param date2 |
| | | * @return |
| | | */ |
| | | public static int getDayDiff(Date date1, Date date2) { |
| | | if (date1 == null || date2 == null) { |
| | | throw new InvalidParameterException("date1 and date2 cannot be null!"); |
| | | } |
| | | long millSecondsInOneDay = 24 * 60 * 60 * 1000; |
| | | return (int) ((date1.getTime() - date2.getTime()) / millSecondsInOneDay); |
| | | } |
| | | |
| | | //æ ¹æ®éæ©æ¶é´è¡¥å
¨ç³»ç»æ¶åç§ |
| | | public static Timestamp getFunllDate(Timestamp selectDate){ |
| | | if(selectDate != null){ |
| | | String dateStr = selectDate.toString().substring(0,10); |
| | | //ç³»ç»æ¶é´æ¶åç§ |
| | | Calendar sysdate = Calendar.getInstance(); |
| | | dateStr += " "+ sysdate.get(Calendar.HOUR_OF_DAY) + ":" |
| | | + sysdate.get(Calendar.MINUTE) + ":" |
| | | + sysdate.get(Calendar.SECOND); |
| | | return Timestamp.valueOf(dateStr); |
| | | }else{ |
| | | return selectDate; |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.landtool.lanbase.common.utils; |
| | | |
| | | import java.io.IOException; |
| | | |
| | | /** |
| | | * esri token 帮å©ç±» |
| | | * Xiexx 2018.3.30 |
| | | */ |
| | | public class EsriTokenUtils { |
| | | /** |
| | | * è·åEsri Token |
| | | * @param requestUri |
| | | * @param UserName |
| | | * @param PassWord |
| | | * @param ClientId |
| | | * @return Tokenï¼Stringï¼ |
| | | */ |
| | | public static String GetEsriServerToken(String requestUri, String UserName, String PassWord, String ClientId) throws IOException { |
| | | String token = ""; //è¿å对象 |
| | | String infoUrl = ""; //请æ±å°å |
| | | |
| | | if(requestUri.toLowerCase().contains("/generatetoken")) { |
| | | String tokenResponse = HttpOperateUtils.httpGet(requestUri); |
| | | token = getJsonValue(tokenResponse, "token"); |
| | | return token; |
| | | } else { |
| | | if(requestUri.toLowerCase().contains("/rest/")) { |
| | | infoUrl = requestUri.substring(0, requestUri.toLowerCase().indexOf("/rest/")); |
| | | } |
| | | else if (requestUri.toLowerCase().contains("/sharing/")) { |
| | | infoUrl = requestUri.substring(0, requestUri.toLowerCase().indexOf("/sharing/")); |
| | | infoUrl = infoUrl + "/sharing"; |
| | | } |
| | | } |
| | | if (infoUrl != ""){ |
| | | infoUrl += "/rest/info?f=json"; |
| | | String infoResponse = HttpOperateUtils.httpGet(infoUrl); |
| | | String tokenServiceUri = getJsonValue(infoResponse, "tokenServicesUrl"); |
| | | if (tokenServiceUri != null && !tokenServiceUri.isEmpty()) |
| | | { |
| | | String owningSystemUrl = getJsonValue(infoResponse, "owningSystemUrl"); |
| | | if (owningSystemUrl != null && !owningSystemUrl.isEmpty()) |
| | | { |
| | | tokenServiceUri = owningSystemUrl + "/sharing/generateToken"; |
| | | } |
| | | } |
| | | if (tokenServiceUri != null && tokenServiceUri != "") |
| | | { |
| | | String tokenExpiration = "3600";//Tokenæææ¶é´(åé) |
| | | String uri = tokenServiceUri + "?f=json&request=getToken&&client=referer&referer=" + ClientId + "&expiration="+ tokenExpiration + "&username=" + UserName + "&password=" + PassWord; |
| | | String tokenResponse = HttpOperateUtils.httpGet(uri); |
| | | token = getJsonValue(tokenResponse, "token"); |
| | | } |
| | | } |
| | | |
| | | return token; |
| | | } |
| | | |
| | | //è·åJsonæå®Keyçå¼ |
| | | private static String getJsonValue(String text, String key) |
| | | { |
| | | int i = text.indexOf(key);//è·åKeyä½ç½® |
| | | String value = ""; |
| | | if (i > -1) |
| | | { |
| | | value = text.substring(text.indexOf(':', i) + 1).trim(); |
| | | value = value.length() > 0 && value.startsWith("\"") ? |
| | | value.substring(1, value.indexOf('"', 1) - 1) : |
| | | value.substring(0, Math.max(0, Math.min(Math.min(value.indexOf(","), value.indexOf("]")), value.indexOf("}")))); |
| | | } |
| | | return value; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | //package com.landtool.lanbase.common.utils; |
| | | // |
| | | //import com.alibaba.fastjson.JSONArray; |
| | | //import com.alibaba.fastjson.JSONObject; |
| | | //import com.landtool.lanbase.config.SysTemPropertyConfig; |
| | | //import com.landtool.lanbase.modules.sys.entity.SysFieldvalue; |
| | | //import com.landtool.lanbase.modules.sys.entity.SysResource; |
| | | // |
| | | //import org.apache.http.HttpEntity; |
| | | //import org.apache.http.HttpResponse; |
| | | //import org.apache.http.client.HttpClient; |
| | | //import org.apache.http.client.methods.HttpGet; |
| | | //import org.apache.http.impl.client.DefaultHttpClient; |
| | | //import org.apache.http.util.EntityUtils; |
| | | //import org.springframework.beans.factory.annotation.Autowired; |
| | | // |
| | | //import java.io.IOException; |
| | | //import java.util.ArrayList; |
| | | //import java.util.LinkedHashMap; |
| | | //import java.util.List; |
| | | // |
| | | ///** |
| | | // * @author lanCatalog |
| | | // * @Description: TODO(è·ååå
¸ä¿¡æ¯) |
| | | // * @date 2018-3-22 15:09 |
| | | // */ |
| | | //public class FieldUtils { |
| | | // /** |
| | | // * æ ¹æ®åå
¸keyè·å对åºåå
¸å¼ |
| | | // * @param Key |
| | | // * @return |
| | | // */ |
| | | // public static LinkedHashMap<String, String> getFieldListByKey(String Key, SysTemPropertyConfig sysConfig) { |
| | | // |
| | | // LinkedHashMap<String, String> map = new LinkedHashMap<String, String>(); |
| | | // List<SysFieldvalue> permsList = new ArrayList<SysFieldvalue>(); |
| | | // try { |
| | | // String url =sysConfig.getApiServer()+ "/api/sys/field/queryListByKey/" + Key; |
| | | // permsList= HttpOperateUtils.getJsonObjectArray(url,SysFieldvalue.class); |
| | | // if (permsList != null) { |
| | | // for (int i = 0; i < permsList.size(); i++) { |
| | | // SysFieldvalue item = permsList.get(i); |
| | | // String key =item.getVcode(); |
| | | // String value =item.getVtext(); |
| | | // map.put(key, value); |
| | | // } |
| | | // } |
| | | // |
| | | // } catch (IOException e) { |
| | | // e.printStackTrace(); |
| | | // } |
| | | // return map; |
| | | // } |
| | | //} |
| | | |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | /** |
| | | * Licensed under the GNU Lesser General Public License (LGPL) ,Version 3.0 (the "License"); |
| | | * you may not use this file except in compliance with the License. |
| | | * You may obtain a copy of the License at |
| | | * |
| | | * http://www.gnu.org/licenses/lgpl-3.0.txt |
| | | * |
| | | * Unless required by applicable law or agreed to in writing, software |
| | | * distributed under the License is distributed on an "AS IS" BASIS, |
| | | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| | | * See the License for the specific language governing permissions and |
| | | * limitations under the License. |
| | | */ |
| | | package com.landtool.lanbase.common.utils; |
| | | |
| | | import java.io.BufferedInputStream; |
| | | import java.io.BufferedOutputStream; |
| | | import java.io.ByteArrayOutputStream; |
| | | import java.io.File; |
| | | import java.io.FileInputStream; |
| | | import java.io.FileOutputStream; |
| | | import java.io.IOException; |
| | | import java.io.InputStream; |
| | | import java.io.OutputStream; |
| | | import java.text.DecimalFormat; |
| | | import java.util.Enumeration; |
| | | import java.util.zip.ZipEntry; |
| | | import java.util.zip.ZipFile; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | import com.landtool.lanbase.common.Constant; |
| | | import com.landtool.lanbase.common.exception.LanbaseException; |
| | | |
| | | /** |
| | | * @author lanbase |
| | | * @Description: TODO(æä»¶å¤ç) |
| | | * @date 2017-6-23 15:07 |
| | | */ |
| | | public class FileUtils { |
| | | |
| | | public static String getSuffix(String fileName) { |
| | | if (fileName != null && fileName.contains(".")) { |
| | | return fileName.substring(fileName.lastIndexOf(".")); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public static String removePrefix(String src, String prefix) { |
| | | if (src != null && src.startsWith(prefix)) { |
| | | return src.substring(prefix.length()); |
| | | } |
| | | return src; |
| | | } |
| | | |
| | | public static String readString(File file) { |
| | | ByteArrayOutputStream baos = null; |
| | | FileInputStream fis = null; |
| | | try { |
| | | fis = new FileInputStream(file); |
| | | baos = new ByteArrayOutputStream(); |
| | | byte[] buffer = new byte[1024]; |
| | | for (int len = 0; (len = fis.read(buffer)) > 0;) { |
| | | baos.write(buffer, 0, len); |
| | | } |
| | | return new String(baos.toByteArray(), Constant.ENCODING_UTF_8); |
| | | } catch (Exception e) { |
| | | } finally { |
| | | close(fis, baos); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public static void writeString(File file, String string) { |
| | | FileOutputStream fos = null; |
| | | try { |
| | | fos = new FileOutputStream(file, false); |
| | | fos.write(string.getBytes(Constant.ENCODING_UTF_8)); |
| | | } catch (Exception e) { |
| | | } finally { |
| | | close(null, fos); |
| | | } |
| | | } |
| | | |
| | | private static void close(InputStream is, OutputStream os) { |
| | | if (is != null) |
| | | try { |
| | | is.close(); |
| | | } catch (IOException e) { |
| | | } |
| | | if (os != null) |
| | | try { |
| | | os.close(); |
| | | } catch (IOException e) { |
| | | } |
| | | } |
| | | |
| | | public static void unzip(String zipFilePath) throws IOException { |
| | | String targetPath = zipFilePath.substring(0, zipFilePath.lastIndexOf(".")); |
| | | unzip(zipFilePath, targetPath); |
| | | } |
| | | |
| | | public static void unzip(String zipFilePath, String targetPath) throws IOException { |
| | | ZipFile zipFile = new ZipFile(zipFilePath); |
| | | try{ |
| | | Enumeration<?> entryEnum = zipFile.entries(); |
| | | if (null != entryEnum) { |
| | | while (entryEnum.hasMoreElements()) { |
| | | OutputStream os = null; |
| | | InputStream is = null; |
| | | try { |
| | | ZipEntry zipEntry = (ZipEntry) entryEnum.nextElement(); |
| | | if (!zipEntry.isDirectory()) { |
| | | File targetFile = new File(targetPath + File.separator + zipEntry.getName()); |
| | | if (!targetFile.getParentFile().exists()) { |
| | | targetFile.getParentFile().mkdirs(); |
| | | } |
| | | os = new BufferedOutputStream(new FileOutputStream(targetFile)); |
| | | is = zipFile.getInputStream(zipEntry); |
| | | byte[] buffer = new byte[4096]; |
| | | int readLen = 0; |
| | | while ((readLen = is.read(buffer, 0, 4096)) > 0) { |
| | | os.write(buffer, 0, readLen); |
| | | } |
| | | } |
| | | } finally { |
| | | if (is != null) |
| | | is.close(); |
| | | if (os != null) |
| | | os.close(); |
| | | } |
| | | } |
| | | } |
| | | }finally{ |
| | | zipFile.close(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * è·å临æ¶ç®å½ |
| | | */ |
| | | public static String getTempPath(){ |
| | | return System.getProperty("java.io.tmpdir"); |
| | | } |
| | | |
| | | /** |
| | | * æä»¶ä¸è½½ |
| | | * @param path |
| | | * @param fileName |
| | | * @param response |
| | | */ |
| | | public static void download(String path, String fileName, HttpServletResponse response){ |
| | | File file=new File(path); |
| | | if(!file.exists()){ |
| | | throw new LanbaseException("æä»¶ä¸åå¨"); |
| | | }else{ |
| | | response.setContentType("application/force-download"); |
| | | response.setHeader("Content-Disposition", "attachment;fileName=" + fileName); |
| | | |
| | | byte[] buffer = new byte[1024]; |
| | | FileInputStream fis = null; |
| | | BufferedInputStream bis = null; |
| | | |
| | | OutputStream os = null; |
| | | try { |
| | | os = response.getOutputStream(); |
| | | fis = new FileInputStream(file); |
| | | bis = new BufferedInputStream(fis); |
| | | int i = bis.read(buffer); |
| | | while(i != -1){ |
| | | os.write(buffer); |
| | | i = bis.read(buffer); |
| | | } |
| | | } catch (Exception e) { |
| | | throw new LanbaseException("ç³»ç»å¼å¸¸"); |
| | | } finally { |
| | | try { |
| | | os.close(); |
| | | bis.close(); |
| | | fis.close(); |
| | | } catch (Exception e) { |
| | | throw new LanbaseException("ç³»ç»å¼å¸¸"); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | //æä»¶ä¸´æ¶æä»¶å¤ç |
| | | public static void main(String[] args) { |
| | | String fileName = "D:\\uploadFiles\\resource\\FileSource\\wenjianjia\\201805\\1665"; |
| | | final long start = System.nanoTime(); |
| | | final long total =getTotalSizeOfFilesInDir(new File(fileName)); |
| | | final long end = System.nanoTime(); |
| | | System.out.println("Total Size: " + total); |
| | | System.out.println("Time taken: " + (end - start) / 1.0e9); |
| | | } |
| | | |
| | | public static void copy(File file, File toFile) throws Exception { |
| | | byte[] b = new byte[1024]; |
| | | int a; |
| | | FileInputStream fis; |
| | | FileOutputStream fos; |
| | | if (file.isDirectory()) { |
| | | String filepath = file.getAbsolutePath(); |
| | | filepath=filepath.replaceAll("\\\\", "/"); |
| | | String toFilepath = toFile.getAbsolutePath(); |
| | | toFilepath=toFilepath.replaceAll("\\\\", "/"); |
| | | int lastIndexOf = filepath.lastIndexOf("/"); |
| | | toFilepath = toFilepath + filepath.substring(lastIndexOf ,filepath.length()); |
| | | File copy=new File(toFilepath); |
| | | //å¤å¶æä»¶å¤¹ |
| | | if (!copy.exists()) { |
| | | copy.mkdir(); |
| | | } |
| | | //éåæä»¶å¤¹ |
| | | for (File f : file.listFiles()) { |
| | | copy(f, copy); |
| | | } |
| | | } else { |
| | | if (toFile.isDirectory()) { |
| | | String filepath = file.getAbsolutePath(); |
| | | filepath=filepath.replaceAll("\\\\", "/"); |
| | | String toFilepath = toFile.getAbsolutePath(); |
| | | toFilepath=toFilepath.replaceAll("\\\\", "/"); |
| | | int lastIndexOf = filepath.lastIndexOf("/"); |
| | | toFilepath = toFilepath + filepath.substring(lastIndexOf ,filepath.length()); |
| | | |
| | | //åæä»¶ |
| | | File newFile = new File(toFilepath); |
| | | fis = new FileInputStream(file); |
| | | fos = new FileOutputStream(newFile); |
| | | while ((a = fis.read(b)) != -1) { |
| | | fos.write(b, 0, a); |
| | | } |
| | | } else { |
| | | //åæä»¶ |
| | | fis = new FileInputStream(file); |
| | | fos = new FileOutputStream(toFile); |
| | | while ((a = fis.read(b)) != -1) { |
| | | fos.write(b, 0, a); |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | | public static void moveTotherFolders(String startPath,String endPath){ |
| | | try { |
| | | File startFile = new File(startPath); |
| | | File tmpFile = new File(endPath);//è·åæä»¶å¤¹è·¯å¾ |
| | | if(!tmpFile.exists()){//夿æä»¶å¤¹æ¯å¦åå»ºï¼æ²¡æå建ååå»ºæ°æä»¶å¤¹ |
| | | tmpFile.mkdirs(); |
| | | } |
| | | System.out.println(endPath +"\\"+startFile.getName()); |
| | | if (startFile.renameTo(new File(endPath +"\\"+startFile.getName()))) { |
| | | System.out.println("File is moved successful!"); |
| | | |
| | | } else { |
| | | System.out.println("File is failed to move!"); |
| | | |
| | | } |
| | | } catch (Exception e) { |
| | | |
| | | |
| | | } |
| | | } |
| | | |
| | | public static long getTotalSizeOfFilesInDir(final File file) { |
| | | if (file.isFile()) |
| | | return file.length(); |
| | | final File[] children = file.listFiles(); |
| | | long total = 0; |
| | | if (children != null) |
| | | for (final File child : children) |
| | | total += getTotalSizeOfFilesInDir(child); |
| | | return total; |
| | | } |
| | | |
| | | public static String setSize(long size) { |
| | | //è·åå°çsize为ï¼1705230 |
| | | int GB = 1024 * 1024 * 1024;//å®ä¹GBç计ç®å¸¸é |
| | | int MB = 1024 * 1024;//å®ä¹MBç计ç®å¸¸é |
| | | int KB = 1024;//å®ä¹KBç计ç®å¸¸é |
| | | DecimalFormat df = new DecimalFormat("0.00");//æ ¼å¼åå°æ° |
| | | String resultSize = ""; |
| | | if (size / GB >= 1) { |
| | | //妿å½åByteçå¼å¤§äºçäº1GB |
| | | resultSize = df.format(size / (float) GB) + " GB"; |
| | | } else if (size / MB >= 1) { |
| | | //妿å½åByteçå¼å¤§äºçäº1MB |
| | | resultSize = df.format(size / (float) MB) + " MB"; |
| | | } else if (size / KB >= 1) { |
| | | //妿å½åByteçå¼å¤§äºçäº1KB |
| | | resultSize = df.format(size / (float) KB) + " KB"; |
| | | } else { |
| | | resultSize = size + " B"; |
| | | } |
| | | return resultSize; |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.landtool.lanbase.common.utils; |
| | | |
| | | import java.io.File; |
| | | import java.io.IOException; |
| | | import java.io.StringWriter; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Properties; |
| | | import java.util.zip.ZipEntry; |
| | | import java.util.zip.ZipOutputStream; |
| | | |
| | | import org.apache.commons.configuration.Configuration; |
| | | import org.apache.commons.configuration.ConfigurationException; |
| | | import org.apache.commons.configuration.PropertiesConfiguration; |
| | | import org.apache.commons.io.IOUtils; |
| | | import org.apache.commons.lang.StringUtils; |
| | | import org.apache.commons.lang.WordUtils; |
| | | import org.apache.velocity.Template; |
| | | import org.apache.velocity.VelocityContext; |
| | | import org.apache.velocity.app.Velocity; |
| | | |
| | | import com.landtool.lanbase.common.exception.LanbaseException; |
| | | import com.landtool.lanbase.modules.sys.entity.SysColumn; |
| | | import com.landtool.lanbase.modules.sys.entity.SysTable; |
| | | |
| | | /** |
| | | * @author lanbase |
| | | * @Description: TODO(代ç çæå¨å·¥å
·ç±») |
| | | * @date 2017-6-23 15:07 |
| | | */ |
| | | public class GeneratorUtils { |
| | | |
| | | public static List<String> getTemplates(){ |
| | | List<String> templates = new ArrayList<String>(); |
| | | templates.add("templates/generator/Entity.java.vm"); |
| | | templates.add("templates/generator/Dao.java.vm"); |
| | | templates.add("templates/generator/Dao.xml.vm"); |
| | | templates.add("templates/generator/Service.java.vm"); |
| | | templates.add("templates/generator/ServiceImpl.java.vm"); |
| | | templates.add("templates/generator/Controller.java.vm"); |
| | | templates.add("templates/generator/list.html.vm"); |
| | | templates.add("templates/generator/list.js.vm"); |
| | | return templates; |
| | | } |
| | | |
| | | /** |
| | | * çæä»£ç |
| | | */ |
| | | public static void generatorCode(Map<String, String> table, |
| | | List<Map<String, String>> columns, ZipOutputStream zip){ |
| | | //é
ç½®ä¿¡æ¯ |
| | | Configuration config = getConfig(); |
| | | |
| | | //è¡¨ä¿¡æ¯ |
| | | SysTable sysTable = new SysTable(); |
| | | sysTable.setTableName(table.get("tableName")); |
| | | sysTable.setComments(table.get("tableComment")); |
| | | //表åè½¬æ¢æJavaç±»å |
| | | String className = tableToJava(sysTable.getTableName(), config.getString("tablePrefix")); |
| | | sysTable.setClassName(className); ////å
¨é¨åè¯é¦åæ¯å¤§å |
| | | sysTable.setClassname(StringUtils.uncapitalize(className)); ////é¦åæ¯å°åï¼é©¼å³° |
| | | |
| | | //åä¿¡æ¯ |
| | | List<SysColumn> columsList = new ArrayList<>(); |
| | | for(Map<String, String> column : columns){ |
| | | SysColumn sysColumn = new SysColumn(); |
| | | sysColumn.setColumnName(column.get("columnName")); |
| | | sysColumn.setDataType(column.get("dataType")); |
| | | sysColumn.setComments(column.get("columnComment")); |
| | | sysColumn.setExtra(column.get("extra")); |
| | | |
| | | //ååè½¬æ¢æJava屿§å |
| | | String attrName = columnToJava(sysColumn.getColumnName()); |
| | | sysColumn.setAttrName(attrName); |
| | | sysColumn.setAttrname(StringUtils.uncapitalize(attrName)); |
| | | |
| | | //åçæ°æ®ç±»åï¼è½¬æ¢æJavaç±»å |
| | | String attrType = config.getString(sysColumn.getDataType(), "unknowType"); |
| | | sysColumn.setAttrType(attrType); |
| | | |
| | | //æ¯å¦ä¸»é® |
| | | // if("PRI".equalsIgnoreCase(column.get("columnKey")) && sysTable.getPk() == null){ |
| | | // sysTable.setPk(sysColumn); |
| | | // } |
| | | if(column.get("columnName").equalsIgnoreCase(table.get("keyColumnName")) && sysTable.getPk() == null){ |
| | | sysTable.setPk(sysColumn); |
| | | } |
| | | |
| | | columsList.add(sysColumn); |
| | | } |
| | | sysTable.setColumns(columsList); |
| | | |
| | | //没主é®ï¼å第ä¸ä¸ªåæ®µä¸ºä¸»é® |
| | | if(sysTable.getPk() == null){ |
| | | sysTable.setPk(sysTable.getColumns().get(0)); |
| | | } |
| | | |
| | | //设置velocityèµæºå è½½å¨ |
| | | Properties prop = new Properties(); |
| | | prop.put("file.resource.loader.class", "org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader"); |
| | | Velocity.init(prop); |
| | | |
| | | String entityPrefix=config.getString("entityPrefix"); |
| | | String classNameTemp=entityPrefix+sysTable.getClassName(); |
| | | String classnameTmep=sysTable.getClassname(); |
| | | String pathPrefix=config.getString("pathPrefix"); |
| | | |
| | | //å°è£
æ¨¡æ¿æ°æ® |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("tableName", sysTable.getTableName()); |
| | | map.put("comments", sysTable.getComments()); |
| | | map.put("pk", sysTable.getPk()); |
| | | map.put("className", classNameTemp); |
| | | map.put("classname", classnameTmep); |
| | | map.put("pathPrefix", pathPrefix); |
| | | map.put("pathName", "/"+ sysTable.getClassname().toLowerCase()); //RESTæå¡è·¯å¾ï¼å
¨å°åï¼ ${pathPrefix}${pathName}/list |
| | | map.put("columns", sysTable.getColumns()); |
| | | map.put("package", config.getString("package")); |
| | | map.put("author", config.getString("author")); |
| | | map.put("datetime", DateUtils.format(new Date(), DateUtils.DATE_TIME_PATTERN)); |
| | | VelocityContext context = new VelocityContext(map); |
| | | |
| | | //è·å模æ¿å表 |
| | | List<String> templates = getTemplates(); |
| | | for(String template : templates){ |
| | | //æ¸²ææ¨¡æ¿ |
| | | StringWriter sw = new StringWriter(); |
| | | Template tpl = Velocity.getTemplate(template, "UTF-8"); |
| | | tpl.merge(context, sw); |
| | | |
| | | try { |
| | | //æ·»å å°zip |
| | | zip.putNextEntry(new ZipEntry(getFileName(template, classNameTemp, classnameTmep, pathPrefix, config.getString("package")))); |
| | | IOUtils.write(sw.toString(), zip, "UTF-8"); |
| | | IOUtils.closeQuietly(sw); |
| | | zip.closeEntry(); |
| | | } catch (IOException e) { |
| | | throw new LanbaseException("æ¸²ææ¨¡æ¿å¤±è´¥ï¼è¡¨åï¼" + sysTable.getTableName(), e); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * ååè½¬æ¢æJava屿§å |
| | | */ |
| | | public static String columnToJava(String columnName) { |
| | | return WordUtils.capitalizeFully(columnName, new char[]{'_'}).replace("_", ""); |
| | | } |
| | | |
| | | /** |
| | | * 表åè½¬æ¢æJavaç±»å |
| | | */ |
| | | public static String tableToJava(String tableName, String tablePrefix) { |
| | | if(StringUtils.isNotBlank(tablePrefix)){ |
| | | tableName = tableName.replace(tablePrefix, ""); |
| | | tableName = tableName.replace(tablePrefix.toLowerCase(), ""); |
| | | tableName = tableName.replace(tablePrefix.toUpperCase(), ""); |
| | | } |
| | | return columnToJava(tableName); |
| | | } |
| | | |
| | | /** |
| | | * è·åé
ç½®ä¿¡æ¯ |
| | | */ |
| | | public static Configuration getConfig(){ |
| | | try { |
| | | return new PropertiesConfiguration("generator.properties"); |
| | | } catch (ConfigurationException e) { |
| | | throw new LanbaseException("è·åé
ç½®æä»¶å¤±è´¥ï¼", e); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * è·åæä»¶å |
| | | */ |
| | | public static String getFileName(String template, String className, String classname, String pathPrefix, String packageName){ |
| | | String packagePath = "main" + File.separator + "java" + File.separator; |
| | | if(StringUtils.isNotBlank(packageName)){ |
| | | packagePath += packageName.replace(".", File.separator) + File.separator; |
| | | } |
| | | |
| | | if(template.contains("Entity.java.vm")){ |
| | | return packagePath + "entity" + File.separator + className + ".java"; |
| | | } |
| | | |
| | | if(template.contains("Dao.java.vm")){ |
| | | return packagePath + "dao" + File.separator + className + "Dao.java"; |
| | | } |
| | | |
| | | if(template.contains("Service.java.vm")){ |
| | | return packagePath + "service" + File.separator + className + "Service.java"; |
| | | } |
| | | |
| | | if(template.contains("ServiceImpl.java.vm")){ |
| | | return packagePath + "service" + File.separator + "impl" + File.separator + className + "ServiceImpl.java"; |
| | | } |
| | | |
| | | if(template.contains("Controller.java.vm")){ |
| | | return packagePath + "controller" + File.separator + className + "Controller.java"; |
| | | } |
| | | |
| | | if(template.contains("Dao.xml.vm")){ |
| | | return "main" + File.separator + "resources" + File.separator + "mapper" + File.separator + pathPrefix + File.separator + className + "Dao.xml"; |
| | | } |
| | | |
| | | if(template.contains("list.html.vm")){ |
| | | return "main" + File.separator + "resources" + File.separator + "views" + File.separator |
| | | + "modules" + File.separator + pathPrefix + File.separator + classname + ".html"; |
| | | } |
| | | |
| | | if(template.contains("list.js.vm")){ |
| | | return "main" + File.separator + "resources" + File.separator + "static" + File.separator + "js" + File.separator |
| | | + "modules" + File.separator + pathPrefix + File.separator + classname + ".js"; |
| | | } |
| | | |
| | | return null; |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.landtool.lanbase.common.utils; |
| | | |
| | | import java.io.IOException; |
| | | import java.io.InterruptedIOException; |
| | | import java.io.UnsupportedEncodingException; |
| | | import java.net.UnknownHostException; |
| | | import java.util.*; |
| | | |
| | | import javax.net.ssl.SSLException; |
| | | import javax.net.ssl.SSLHandshakeException; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.qiniu.util.Json; |
| | | import org.apache.http.HttpEntity; |
| | | import org.apache.http.HttpEntityEnclosingRequest; |
| | | import org.apache.http.HttpHost; |
| | | import org.apache.http.HttpRequest; |
| | | import org.apache.http.NameValuePair; |
| | | import org.apache.http.NoHttpResponseException; |
| | | import org.apache.http.client.HttpRequestRetryHandler; |
| | | import org.apache.http.client.config.RequestConfig; |
| | | import org.apache.http.client.entity.UrlEncodedFormEntity; |
| | | import org.apache.http.client.methods.CloseableHttpResponse; |
| | | import org.apache.http.client.methods.HttpGet; |
| | | import org.apache.http.client.methods.HttpPost; |
| | | import org.apache.http.client.methods.HttpRequestBase; |
| | | import org.apache.http.client.protocol.HttpClientContext; |
| | | import org.apache.http.config.Registry; |
| | | import org.apache.http.config.RegistryBuilder; |
| | | import org.apache.http.conn.ConnectTimeoutException; |
| | | import org.apache.http.conn.routing.HttpRoute; |
| | | import org.apache.http.conn.socket.ConnectionSocketFactory; |
| | | import org.apache.http.conn.socket.LayeredConnectionSocketFactory; |
| | | import org.apache.http.conn.socket.PlainConnectionSocketFactory; |
| | | import org.apache.http.conn.ssl.SSLConnectionSocketFactory; |
| | | import org.apache.http.impl.client.CloseableHttpClient; |
| | | import org.apache.http.impl.client.HttpClients; |
| | | import org.apache.http.impl.conn.PoolingHttpClientConnectionManager; |
| | | import org.apache.http.message.BasicNameValuePair; |
| | | import org.apache.http.protocol.HttpContext; |
| | | import org.apache.http.util.EntityUtils; |
| | | |
| | | public class HttpClientUtils { |
| | | |
| | | static final int timeOut = 10 * 1000; |
| | | |
| | | private static CloseableHttpClient httpClient = null; |
| | | |
| | | private final static Object syncLock = new Object(); |
| | | |
| | | private static void config(HttpRequestBase httpRequestBase) { |
| | | // 设置Headerç |
| | | // httpRequestBase.setHeader("User-Agent", "Mozilla/5.0"); |
| | | // httpRequestBase |
| | | // .setHeader("Accept", |
| | | // "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"); |
| | | // httpRequestBase.setHeader("Accept-Language", |
| | | // "zh-CN,zh;q=0.8,en-US;q=0.5,en;q=0.3");// "en-US,en;q=0.5"); |
| | | // httpRequestBase.setHeader("Accept-Charset", |
| | | // "ISO-8859-1,utf-8,gbk,gb2312;q=0.7,*;q=0.7"); |
| | | |
| | | // é
置请æ±çè¶
æ¶è®¾ç½® |
| | | RequestConfig requestConfig = RequestConfig.custom() |
| | | .setConnectionRequestTimeout(timeOut) |
| | | .setConnectTimeout(timeOut).setSocketTimeout(timeOut).build(); |
| | | httpRequestBase.setConfig(requestConfig); |
| | | } |
| | | |
| | | /** |
| | | * è·åHttpClient对象 |
| | | * |
| | | * @return |
| | | * @author SHANHY |
| | | * @create 2015å¹´12æ18æ¥ |
| | | */ |
| | | public static CloseableHttpClient getHttpClient(String url) { |
| | | String hostname = url.split("/")[2]; |
| | | int port = 80; |
| | | if (hostname.contains(":")) { |
| | | String[] arr = hostname.split(":"); |
| | | hostname = arr[0]; |
| | | port = Integer.parseInt(arr[1]); |
| | | } |
| | | if (httpClient == null) { |
| | | synchronized (syncLock) { |
| | | if (httpClient == null) { |
| | | httpClient = createHttpClient(200, 40, 100, hostname, port); |
| | | } |
| | | } |
| | | } |
| | | return httpClient; |
| | | } |
| | | |
| | | /** |
| | | * å建HttpClient对象 |
| | | * |
| | | * @return |
| | | * @author SHANHY |
| | | * @create 2015å¹´12æ18æ¥ |
| | | */ |
| | | public static CloseableHttpClient createHttpClient(int maxTotal, |
| | | int maxPerRoute, int maxRoute, String hostname, int port) { |
| | | ConnectionSocketFactory plainsf = PlainConnectionSocketFactory |
| | | .getSocketFactory(); |
| | | LayeredConnectionSocketFactory sslsf = SSLConnectionSocketFactory |
| | | .getSocketFactory(); |
| | | Registry<ConnectionSocketFactory> registry = RegistryBuilder |
| | | .<ConnectionSocketFactory> create().register("http", plainsf) |
| | | .register("https", sslsf).build(); |
| | | PoolingHttpClientConnectionManager cm = new PoolingHttpClientConnectionManager( |
| | | registry); |
| | | // å°æå¤§è¿æ¥æ°æ·»å |
| | | cm.setMaxTotal(maxTotal); |
| | | // å°æ¯ä¸ä¸ªè·¯ç±åºç¡çè¿æ¥æ·»å |
| | | cm.setDefaultMaxPerRoute(maxPerRoute); |
| | | HttpHost httpHost = new HttpHost(hostname, port); |
| | | // å°ç®æ 主æºçæå¤§è¿æ¥æ°æ·»å |
| | | cm.setMaxPerRoute(new HttpRoute(httpHost), maxRoute); |
| | | |
| | | // 请æ±éè¯å¤ç |
| | | HttpRequestRetryHandler httpRequestRetryHandler = new HttpRequestRetryHandler() { |
| | | public boolean retryRequest(IOException exception, |
| | | int executionCount, HttpContext context) { |
| | | if (executionCount >= 2) {// å设已ç»éè¯äº2次ï¼å°±æ¾å¼ |
| | | return false; |
| | | } |
| | | if (exception instanceof NoHttpResponseException) {// å设server丢æäºè¿æ¥ãé£ä¹å°±éè¯ |
| | | return true; |
| | | } |
| | | if (exception instanceof SSLHandshakeException) {// ä¸è¦éè¯SSLæ¡æå¼å¸¸ |
| | | return false; |
| | | } |
| | | if (exception instanceof InterruptedIOException) {// è¶
æ¶ |
| | | return false; |
| | | } |
| | | if (exception instanceof UnknownHostException) {// ç®æ serverä¸å¯è¾¾ |
| | | return false; |
| | | } |
| | | if (exception instanceof ConnectTimeoutException) {// è¿æ¥è¢«æç» |
| | | return false; |
| | | } |
| | | if (exception instanceof SSLException) {// SSLæ¡æå¼å¸¸ |
| | | return false; |
| | | } |
| | | |
| | | HttpClientContext clientContext = HttpClientContext |
| | | .adapt(context); |
| | | HttpRequest request = clientContext.getRequest(); |
| | | // åè®¾è¯·æ±æ¯å¹ççï¼å°±å次å°è¯ |
| | | if (!(request instanceof HttpEntityEnclosingRequest)) { |
| | | return true; |
| | | } |
| | | return false; |
| | | } |
| | | }; |
| | | |
| | | CloseableHttpClient httpClient = HttpClients.custom() |
| | | .setConnectionManager(cm) |
| | | .setRetryHandler(httpRequestRetryHandler).build(); |
| | | |
| | | return httpClient; |
| | | } |
| | | |
| | | private static void setPostParams(HttpPost httpost, |
| | | Map<String, Object> params) { |
| | | List<NameValuePair> nvps = new ArrayList<NameValuePair>(); |
| | | Set<String> keySet = params.keySet(); |
| | | for (String key : keySet) { |
| | | nvps.add(new BasicNameValuePair(key, params.get(key).toString())); |
| | | } |
| | | try { |
| | | httpost.setEntity(new UrlEncodedFormEntity(nvps, "UTF-8")); |
| | | } catch (UnsupportedEncodingException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * GET请æ±URLè·åå
容 |
| | | * |
| | | * @param url |
| | | * @return |
| | | * @author SHANHY |
| | | * @throws IOException |
| | | * @create 2015å¹´12æ18æ¥ |
| | | */ |
| | | public static String post(String url, Map<String, Object> params) throws IOException { |
| | | HttpPost httppost = new HttpPost(url); |
| | | config(httppost); |
| | | setPostParams(httppost, params); |
| | | CloseableHttpResponse response = null; |
| | | try { |
| | | response = getHttpClient(url).execute(httppost, |
| | | HttpClientContext.create()); |
| | | HttpEntity entity = response.getEntity(); |
| | | String result = EntityUtils.toString(entity, "utf-8"); |
| | | EntityUtils.consume(entity); |
| | | return result; |
| | | } catch (Exception e) { |
| | | // e.printStackTrace(); |
| | | throw e; |
| | | } finally { |
| | | try { |
| | | if (response != null) |
| | | response.close(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * GET请æ±URLè·åå
容 |
| | | * |
| | | * @param url |
| | | * @return |
| | | * @author SHANHY |
| | | * @create 2015å¹´12æ18æ¥ |
| | | */ |
| | | public static String get(String url) { |
| | | HttpGet httpget = new HttpGet(url); |
| | | config(httpget); |
| | | CloseableHttpResponse response = null; |
| | | try { |
| | | response = getHttpClient(url).execute(httpget, |
| | | HttpClientContext.create()); |
| | | HttpEntity entity = response.getEntity(); |
| | | String result = EntityUtils.toString(entity, "utf-8"); |
| | | EntityUtils.consume(entity); |
| | | return result; |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } finally { |
| | | try { |
| | | if (response != null) |
| | | response.close(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public static void main(String[] args) throws Exception { |
| | | String proxyUrl="http://192.168.20.106:8066/serverRegister/addArcGisServer"; |
| | | String resourceIdStr="zyid="+12; |
| | | String serverUrlStr="serverUrl="+"http://gis.nmsmp.com/arcgis/rest/services/HYSW/haiyangshengwu/MapServer/4"; |
| | | String isPublicStr= "isPublic="+1; |
| | | String fromsys= "fromsys=HYJGPT"; |
| | | String enable="enable=1"; |
| | | String s = HttpUtils.get(proxyUrl+"?"+ |
| | | resourceIdStr+"&"+ |
| | | serverUrlStr+"&"+ |
| | | isPublicStr+"&"+ |
| | | fromsys+"&"+ |
| | | enable |
| | | ); |
| | | HashMap<String,Object> result= Json.decode(s,HashMap.class); |
| | | proxyUrl=(String)result.get("proxyurl"); |
| | | |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.landtool.lanbase.common.utils; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | |
| | | import org.springframework.web.context.request.RequestContextHolder; |
| | | import org.springframework.web.context.request.ServletRequestAttributes; |
| | | |
| | | public class HttpContextUtils { |
| | | |
| | | public static HttpServletRequest getHttpServletRequest() { |
| | | return ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.landtool.lanbase.common.utils; |
| | | |
| | | import java.io.IOException; |
| | | import java.lang.reflect.Field; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.Iterator; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Map.Entry; |
| | | |
| | | import org.apache.http.HttpEntity; |
| | | import org.apache.http.HttpResponse; |
| | | import org.apache.http.NameValuePair; |
| | | import org.apache.http.client.HttpClient; |
| | | import org.apache.http.client.entity.UrlEncodedFormEntity; |
| | | import org.apache.http.client.methods.HttpGet; |
| | | import org.apache.http.client.methods.HttpPost; |
| | | import org.apache.http.impl.client.DefaultHttpClient; |
| | | import org.apache.http.message.BasicNameValuePair; |
| | | import org.apache.http.util.EntityUtils; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | |
| | | import cn.hutool.http.HttpUtil; |
| | | |
| | | /** |
| | | * @author |
| | | * @Description: TODO(è·ååå
¸ä¿¡æ¯) |
| | | * @date 2018-3-22 15:09 |
| | | */ |
| | | public class HttpOperateUtils { |
| | | /** |
| | | * HttpGet è¯·æ± URL è¿åæ°æ® |
| | | * |
| | | * @param url |
| | | * @return |
| | | * @throws IOException |
| | | */ |
| | | public static String httpGet(String url) throws IOException { |
| | | HttpClient client = new DefaultHttpClient(); |
| | | HttpGet request = new HttpGet(url.trim()); |
| | | HttpResponse httpResponse = client.execute(request); |
| | | HttpEntity httpEntity = httpResponse.getEntity(); |
| | | return EntityUtils.toString(httpEntity, "UTF-8"); |
| | | } |
| | | |
| | | public static boolean isgzip(String url) throws IOException { |
| | | HttpClient client = new DefaultHttpClient(); |
| | | HttpGet request = new HttpGet(url.trim()); |
| | | HttpResponse httpResponse = null; |
| | | httpResponse = client.execute(request); |
| | | String Encoding = String.valueOf(httpResponse.getEntity().getContentEncoding()); |
| | | boolean flag = false; |
| | | if(Encoding != null && Encoding.indexOf("gzip") > -1) { |
| | | flag = true; |
| | | } |
| | | return flag; |
| | | } |
| | | |
| | | public static <T> T getJsonObject(String url, Class<T> clazz) throws IOException { |
| | | String resultjson = HttpOperateUtils.httpGet(url); |
| | | JSONObject jsonobject = JSONObject.parseObject(resultjson); |
| | | return JSONObject.toJavaObject(jsonobject, clazz); |
| | | } |
| | | |
| | | public static <T> List<T> getJsonObjectArray(String url, Class<T> clazz) throws IOException { |
| | | String resultjson = HttpOperateUtils.httpGet(url); |
| | | return JSONObject.parseArray(resultjson, clazz); |
| | | } |
| | | |
| | | public static <T> List<T> getJsonObjectArrayByParams(String url, Class<T> clazz,Map<String, Object> params) throws IOException { |
| | | String resultjson = HttpUtil.get(url,params); |
| | | return JSONObject.parseArray(resultjson, clazz); |
| | | } |
| | | |
| | | /** |
| | | * HttpPost |
| | | */ |
| | | public static String httpPost(String url, Object obj) throws IOException { |
| | | String charset = "utf-8"; |
| | | HttpClient httpClient = null; |
| | | HttpPost httpPost = null; |
| | | String result = null; |
| | | try { |
| | | Map<String, String> map = objectToMap(obj); |
| | | httpClient = new DefaultHttpClient(); |
| | | httpPost = new HttpPost(url); |
| | | // è®¾ç½®åæ° |
| | | List<NameValuePair> list = new ArrayList<NameValuePair>(); |
| | | Iterator iterator = map.entrySet().iterator(); |
| | | while (iterator.hasNext()) { |
| | | Entry<String, String> elem = (Entry<String, String>) iterator.next(); |
| | | if(elem.getValue() != null && !elem.getValue().equals("null")) list.add(new BasicNameValuePair(elem.getKey(), elem.getValue())); |
| | | } |
| | | if (list.size() > 0) { |
| | | UrlEncodedFormEntity entity = new UrlEncodedFormEntity(list, charset); |
| | | httpPost.setEntity(entity); |
| | | } |
| | | HttpResponse response = httpClient.execute(httpPost); |
| | | if (response != null) { |
| | | HttpEntity resEntity = response.getEntity(); |
| | | if (resEntity != null) { |
| | | result = EntityUtils.toString(resEntity, charset); |
| | | } |
| | | } |
| | | } catch (Exception ex) { |
| | | ex.printStackTrace(); |
| | | } |
| | | |
| | | return result; |
| | | } |
| | | |
| | | /** |
| | | * è·åå©ç¨åå°è·åç±»éé¢çå¼ååç§° |
| | | * |
| | | * @param obj |
| | | * @return |
| | | * @throws IllegalAccessException |
| | | */ |
| | | public static Map<String, String> objectToMap(Object obj) throws IllegalAccessException { |
| | | Map<String, String> map = new HashMap<>(); |
| | | Class<?> clazz = obj.getClass(); |
| | | System.out.println(clazz); |
| | | for (Field field : clazz.getDeclaredFields()) { |
| | | field.setAccessible(true); |
| | | String fieldName = field.getName(); |
| | | String value = field.get(obj) != null ? String.valueOf(field.get(obj)) : null; |
| | | map.put(fieldName, value); |
| | | } |
| | | return map; |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | /** |
| | | * Copyright (c) 2015-2016, Michael Yang æ¨ç¦æµ· (fuhai999@gmail.com). |
| | | * |
| | | * Licensed under the GNU Lesser General Public License (LGPL) ,Version 3.0 (the "License"); |
| | | * you may not use this file except in compliance with the License. |
| | | * You may obtain a copy of the License at |
| | | * |
| | | * http://www.gnu.org/licenses/lgpl-3.0.txt |
| | | * |
| | | * Unless required by applicable law or agreed to in writing, software |
| | | * distributed under the License is distributed on an "AS IS" BASIS, |
| | | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| | | * See the License for the specific language governing permissions and |
| | | * limitations under the License. |
| | | */ |
| | | package com.landtool.lanbase.common.utils; |
| | | |
| | | import java.io.ByteArrayOutputStream; |
| | | import java.io.DataOutputStream; |
| | | import java.io.InputStream; |
| | | import java.io.InputStreamReader; |
| | | import java.io.UnsupportedEncodingException; |
| | | import java.net.HttpURLConnection; |
| | | import java.net.URL; |
| | | import java.net.URLEncoder; |
| | | import java.security.cert.X509Certificate; |
| | | import java.util.Map; |
| | | import java.util.zip.GZIPInputStream; |
| | | |
| | | import javax.net.ssl.HostnameVerifier; |
| | | import javax.net.ssl.HttpsURLConnection; |
| | | import javax.net.ssl.SSLContext; |
| | | import javax.net.ssl.SSLSession; |
| | | import javax.net.ssl.SSLSocketFactory; |
| | | import javax.net.ssl.TrustManager; |
| | | import javax.net.ssl.X509TrustManager; |
| | | |
| | | import com.landtool.lanbase.common.Constant; |
| | | |
| | | /** |
| | | * @author lanbase |
| | | * @Description: TODO(httpå·¥å
·) |
| | | * @date 2017-6-23 15:07 |
| | | */ |
| | | public class HttpUtils { |
| | | |
| | | private static final String TAG = "HttpUtils"; |
| | | private static final int mReadTimeOut = 1000 * 10; // 10ç§ |
| | | private static final int mConnectTimeOut = 1000 * 5; // 5ç§ |
| | | private static final String CHAR_SET = Constant.ENCODING_UTF_8; |
| | | private static final int mRetry = 2; // é»è®¤å°è¯è®¿é®æ¬¡æ° |
| | | |
| | | public static String get(String url) throws Exception { |
| | | return get(url, null); |
| | | } |
| | | |
| | | public static String get(String url, Map<String, ? extends Object> params) throws Exception { |
| | | return get(url, params, null); |
| | | } |
| | | |
| | | public static String get(String url, Map<String, ? extends Object> params, Map<String, String> headers) |
| | | throws Exception { |
| | | if (url == null || url.trim().length() == 0) { |
| | | throw new Exception(TAG + ": url is null or empty!"); |
| | | } |
| | | |
| | | if (params != null && params.size() > 0) { |
| | | if (!url.contains("?")) { |
| | | url += "?"; |
| | | } |
| | | |
| | | if (url.charAt(url.length() - 1) != '?') { |
| | | url += "&"; |
| | | } |
| | | |
| | | url += buildParams(params); |
| | | } |
| | | |
| | | return tryToGet(url, headers); |
| | | } |
| | | |
| | | public static String buildParams(Map<String, ? extends Object> params) throws UnsupportedEncodingException { |
| | | if (params == null || params.isEmpty()) { |
| | | return null; |
| | | } |
| | | |
| | | StringBuilder builder = new StringBuilder(); |
| | | for (Map.Entry<String, ? extends Object> entry : params.entrySet()) { |
| | | if (entry.getKey() != null && entry.getValue() != null) |
| | | builder.append(entry.getKey().trim()).append("=") |
| | | .append(URLEncoder.encode(entry.getValue().toString(), CHAR_SET)).append("&"); |
| | | } |
| | | |
| | | if (builder.charAt(builder.length() - 1) == '&') { |
| | | builder.deleteCharAt(builder.length() - 1); |
| | | } |
| | | |
| | | return builder.toString(); |
| | | } |
| | | |
| | | private static String tryToGet(String url, Map<String, String> headers) throws Exception { |
| | | int tryTime = 0; |
| | | Exception ex = null; |
| | | while (tryTime < mRetry) { |
| | | try { |
| | | return doGet(url, headers); |
| | | } catch (Exception e) { |
| | | if (e != null) |
| | | ex = e; |
| | | tryTime++; |
| | | } |
| | | } |
| | | if (ex != null) |
| | | throw ex; |
| | | else |
| | | throw new Exception("æªç¥ç½ç»é误 "); |
| | | } |
| | | |
| | | |
| | | |
| | | private static String doGet(String strUrl, Map<String, String> headers) throws Exception { |
| | | System.out.printf("$$$$$ HTTP GET:[%s]", strUrl); |
| | | HttpURLConnection connection = null; |
| | | InputStream stream = null; |
| | | try { |
| | | |
| | | connection = getConnection(strUrl); |
| | | configConnection(connection); |
| | | if (headers != null && headers.size() > 0) { |
| | | for (Map.Entry<String, String> entry : headers.entrySet()) { |
| | | connection.setRequestProperty(entry.getKey(), entry.getValue()); |
| | | } |
| | | } |
| | | |
| | | connection.setInstanceFollowRedirects(true); |
| | | connection.connect(); |
| | | |
| | | stream = connection.getInputStream(); |
| | | ByteArrayOutputStream obs = new ByteArrayOutputStream(); |
| | | byte[] buffer = new byte[1024]; |
| | | for (int len = 0; (len = stream.read(buffer)) > 0;) { |
| | | obs.write(buffer, 0, len); |
| | | } |
| | | obs.flush(); |
| | | obs.close(); |
| | | stream.close(); |
| | | |
| | | return new String(obs.toByteArray()); |
| | | } finally { |
| | | if (stream != null) { |
| | | stream.close(); |
| | | } |
| | | if (connection != null) { |
| | | connection.disconnect(); |
| | | connection=null; |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | public static String getGZip(String url) throws Exception { |
| | | return getGZip(url, null); |
| | | } |
| | | |
| | | public static String getGZip(String url, Map<String, ? extends Object> params) throws Exception { |
| | | return getGZip(url, params, null); |
| | | } |
| | | |
| | | public static String getGZip(String url, Map<String, ? extends Object> params, Map<String, String> headers) |
| | | throws Exception { |
| | | if (url == null || url.trim().length() == 0) { |
| | | throw new Exception(TAG + ": url is null or empty!"); |
| | | } |
| | | |
| | | if (params != null && params.size() > 0) { |
| | | if (!url.contains("?")) { |
| | | url += "?"; |
| | | } |
| | | |
| | | if (url.charAt(url.length() - 1) != '?') { |
| | | url += "&"; |
| | | } |
| | | |
| | | url += buildParams(params); |
| | | } |
| | | |
| | | return tryToGetGZip(url, headers); |
| | | } |
| | | |
| | | |
| | | |
| | | private static String tryToGetGZip(String url, Map<String, String> headers) throws Exception { |
| | | int tryTime = 0; |
| | | Exception ex = null; |
| | | while (tryTime < mRetry) { |
| | | try { |
| | | return doGetGZip(url, headers); |
| | | } catch (Exception e) { |
| | | if (e != null) |
| | | ex = e; |
| | | tryTime++; |
| | | } |
| | | } |
| | | if (ex != null) |
| | | throw ex; |
| | | else |
| | | throw new Exception("æªç¥ç½ç»é误 "); |
| | | } |
| | | |
| | | |
| | | private static String doGetGZip(String strUrl, Map<String, String> headers) throws Exception { |
| | | HttpURLConnection connection = null; |
| | | InputStream stream = null; |
| | | try { |
| | | |
| | | connection = getConnection(strUrl); |
| | | configConnection(connection); |
| | | if (headers != null && headers.size() > 0) { |
| | | for (Map.Entry<String, String> entry : headers.entrySet()) { |
| | | connection.setRequestProperty(entry.getKey(), entry.getValue()); |
| | | } |
| | | } |
| | | |
| | | connection.setInstanceFollowRedirects(true); |
| | | connection.connect(); |
| | | stream = connection.getInputStream(); |
| | | GZIPInputStream gzin = new GZIPInputStream(stream); |
| | | StringBuffer sb = new StringBuffer(); |
| | | InputStreamReader isr = new InputStreamReader(gzin, "UTF-8"); |
| | | java.io.BufferedReader br = new java.io.BufferedReader(isr); |
| | | |
| | | String strtemp; |
| | | |
| | | while ((strtemp = br.readLine()) != null) { |
| | | sb.append(strtemp); |
| | | sb.append("\r\n"); |
| | | } |
| | | isr.close(); |
| | | gzin.close(); |
| | | String strJson = sb.toString(); |
| | | |
| | | return strJson; |
| | | |
| | | } finally { |
| | | if (stream != null) { |
| | | stream.close(); |
| | | } |
| | | if (connection != null) { |
| | | connection.disconnect(); |
| | | connection=null; |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | public static String post(String url) throws Exception { |
| | | return post(url, null); |
| | | } |
| | | |
| | | public static String post(String url, Map<String, ? extends Object> params) throws Exception { |
| | | return post(url, params, null); |
| | | } |
| | | |
| | | public static String post(String url, Map<String, ? extends Object> params, Map<String, String> headers) |
| | | throws Exception { |
| | | if (url == null || url.trim().length() == 0) { |
| | | throw new Exception(TAG + ":url is null or empty!"); |
| | | } |
| | | |
| | | if (params != null && params.size() > 0) { |
| | | return tryToPost(url, buildParams(params), headers); |
| | | } else { |
| | | return tryToPost(url, null, headers); |
| | | } |
| | | } |
| | | |
| | | public static String post(String url, String content, Map<String, String> headers) throws Exception { |
| | | return tryToPost(url, content, headers); |
| | | } |
| | | |
| | | private static String tryToPost(String url, String postContent, Map<String, String> headers) throws Exception { |
| | | int tryTime = 0; |
| | | Exception ex = null; |
| | | while (tryTime < mRetry) { |
| | | try { |
| | | return doPost(url, postContent, headers); |
| | | } catch (Exception e) { |
| | | if (e != null) |
| | | ex = e; |
| | | tryTime++; |
| | | } |
| | | } |
| | | if (ex != null) |
| | | throw ex; |
| | | else |
| | | throw new Exception("æªç¥ç½ç»é误 "); |
| | | } |
| | | |
| | | private static String doPost(String strUrl, String postContent, Map<String, String> headers) throws Exception { |
| | | HttpURLConnection connection = null; |
| | | InputStream stream = null; |
| | | try { |
| | | connection = getConnection(strUrl); |
| | | configConnection(connection); |
| | | if (headers != null && headers.size() > 0) { |
| | | for (Map.Entry<String, String> entry : headers.entrySet()) { |
| | | connection.setRequestProperty(entry.getKey(), entry.getValue()); |
| | | } |
| | | } |
| | | |
| | | connection.setRequestMethod("POST"); |
| | | connection.setDoOutput(true); |
| | | |
| | | if (null != postContent && !"".equals(postContent)) { |
| | | DataOutputStream dos = new DataOutputStream(connection.getOutputStream()); |
| | | dos.write(postContent.getBytes(CHAR_SET)); |
| | | dos.flush(); |
| | | dos.close(); |
| | | } |
| | | stream = connection.getInputStream(); |
| | | ByteArrayOutputStream obs = new ByteArrayOutputStream(); |
| | | |
| | | byte[] buffer = new byte[1024]; |
| | | for (int len = 0; (len = stream.read(buffer)) > 0;) { |
| | | obs.write(buffer, 0, len); |
| | | } |
| | | obs.flush(); |
| | | obs.close(); |
| | | |
| | | return new String(obs.toByteArray()); |
| | | |
| | | } finally { |
| | | if (connection != null) { |
| | | connection.disconnect(); |
| | | } |
| | | if (stream != null) { |
| | | stream.close(); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | private static void configConnection(HttpURLConnection connection) { |
| | | if (connection == null) |
| | | return; |
| | | connection.setReadTimeout(mReadTimeOut); |
| | | connection.setConnectTimeout(mConnectTimeOut); |
| | | |
| | | connection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded"); |
| | | connection.setRequestProperty("User-Agent", |
| | | "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.146 Safari/537.36"); |
| | | } |
| | | |
| | | private static HttpURLConnection getConnection(String strUrl) throws Exception { |
| | | if (strUrl == null) { |
| | | return null; |
| | | } |
| | | if (strUrl.toLowerCase().startsWith("https")) { |
| | | return getHttpsConnection(strUrl); |
| | | } else { |
| | | return getHttpConnection(strUrl); |
| | | } |
| | | } |
| | | |
| | | private static HttpURLConnection getHttpConnection(String urlStr) throws Exception { |
| | | URL url = new URL(urlStr); |
| | | HttpURLConnection conn = (HttpURLConnection) url.openConnection(); |
| | | return conn; |
| | | } |
| | | |
| | | private static HttpsURLConnection getHttpsConnection(String urlStr) throws Exception { |
| | | URL url = new URL(urlStr); |
| | | HttpsURLConnection conn = (HttpsURLConnection) url.openConnection(); |
| | | conn.setHostnameVerifier(hnv); |
| | | SSLContext sslContext = SSLContext.getInstance("SSL", "SunJSSE"); |
| | | if (sslContext != null) { |
| | | TrustManager[] tm = { xtm }; |
| | | sslContext.init(null, tm, null); |
| | | SSLSocketFactory ssf = sslContext.getSocketFactory(); |
| | | conn.setSSLSocketFactory(ssf); |
| | | } |
| | | |
| | | return conn; |
| | | } |
| | | |
| | | private static X509TrustManager xtm = new X509TrustManager() { |
| | | public void checkClientTrusted(X509Certificate[] chain, String authType) { |
| | | } |
| | | |
| | | public void checkServerTrusted(X509Certificate[] chain, String authType) { |
| | | } |
| | | |
| | | public X509Certificate[] getAcceptedIssuers() { |
| | | return null; |
| | | } |
| | | }; |
| | | |
| | | private static HostnameVerifier hnv = new HostnameVerifier() { |
| | | public boolean verify(String hostname, SSLSession session) { |
| | | return true; |
| | | } |
| | | }; |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.landtool.lanbase.common.utils; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | |
| | | import com.alibaba.druid.util.StringUtils; |
| | | |
| | | /** |
| | | * @author lanbase |
| | | * @Description: TODO(IPå°åå¤çå·¥å
·ç±») |
| | | * @date 2017-6-23 15:07 |
| | | */ |
| | | public class IPUtils { |
| | | private static Logger logger = LoggerFactory.getLogger(IPUtils.class); |
| | | |
| | | /** |
| | | * è·åIPå°å |
| | | * |
| | | * 使ç¨Nginxçåå代çè½¯ä»¶ï¼ åä¸è½éè¿request.getRemoteAddr()è·åIPå°å |
| | | * å¦æä½¿ç¨äºå¤çº§åå代ççè¯ï¼X-Forwarded-Forçå¼å¹¶ä¸æ¢ä¸ä¸ªï¼èæ¯ä¸ä¸²IPå°åï¼X-Forwarded-Forä¸ç¬¬ä¸ä¸ªéunknownçææIPå符串ï¼å为çå®IPå°å |
| | | */ |
| | | public static String getIpAddr(HttpServletRequest request) { |
| | | String ip = null; |
| | | try { |
| | | ip = request.getHeader("x-forwarded-for"); |
| | | if (StringUtils.isEmpty(ip) || "unknown".equalsIgnoreCase(ip)) { |
| | | ip = request.getHeader("Proxy-Client-IP"); |
| | | } |
| | | if (StringUtils.isEmpty(ip) || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { |
| | | ip = request.getHeader("WL-Proxy-Client-IP"); |
| | | } |
| | | if (StringUtils.isEmpty(ip) || "unknown".equalsIgnoreCase(ip)) { |
| | | ip = request.getHeader("HTTP_CLIENT_IP"); |
| | | } |
| | | if (StringUtils.isEmpty(ip) || "unknown".equalsIgnoreCase(ip)) { |
| | | ip = request.getHeader("HTTP_X_FORWARDED_FOR"); |
| | | } |
| | | if (StringUtils.isEmpty(ip) || "unknown".equalsIgnoreCase(ip)) { |
| | | ip = request.getRemoteAddr(); |
| | | } |
| | | } catch (Exception e) { |
| | | logger.error("IPUtils ERROR ", e); |
| | | } |
| | | |
| | | // //使ç¨ä»£çï¼åè·å第ä¸ä¸ªIPå°å |
| | | // if(StringUtils.isEmpty(ip) && ip.length() > 15) { |
| | | // if(ip.indexOf(",") > 0) { |
| | | // ip = ip.substring(0, ip.indexOf(",")); |
| | | // } |
| | | // } |
| | | |
| | | return ip; |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | /** |
| | | * Copyright (c) 2015-2016, Michael Yang æ¨ç¦æµ· (fuhai999@gmail.com). |
| | | * |
| | | * Licensed under the GNU Lesser General Public License (LGPL) ,Version 3.0 (the "License"); |
| | | * you may not use this file except in compliance with the License. |
| | | * You may obtain a copy of the License at |
| | | * |
| | | * http://www.gnu.org/licenses/lgpl-3.0.txt |
| | | * |
| | | * Unless required by applicable law or agreed to in writing, software |
| | | * distributed under the License is distributed on an "AS IS" BASIS, |
| | | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| | | * See the License for the specific language governing permissions and |
| | | * limitations under the License. |
| | | */ |
| | | package com.landtool.lanbase.common.utils; |
| | | |
| | | import java.awt.AlphaComposite; |
| | | import java.awt.Graphics; |
| | | import java.awt.Graphics2D; |
| | | import java.awt.Image; |
| | | import java.awt.Rectangle; |
| | | import java.awt.image.BufferedImage; |
| | | import java.io.File; |
| | | import java.io.FileInputStream; |
| | | import java.io.IOException; |
| | | import java.io.InputStream; |
| | | import java.util.Iterator; |
| | | |
| | | import javax.imageio.ImageIO; |
| | | import javax.imageio.ImageReadParam; |
| | | import javax.imageio.ImageReader; |
| | | import javax.imageio.stream.ImageInputStream; |
| | | |
| | | /** |
| | | * @author lanbase |
| | | * @Description: TODO(å¾çå¤ç) |
| | | * @date 2017-6-23 15:07 |
| | | */ |
| | | public class ImageUtils { |
| | | |
| | | public static int[] ratio(String src) throws IOException { |
| | | BufferedImage bufferedImage = ImageIO.read(new File(src)); |
| | | int width = bufferedImage.getWidth(); |
| | | int height = bufferedImage.getHeight(); |
| | | return new int[] { width, height }; |
| | | } |
| | | |
| | | public static String ratioAsString(String src) throws IOException { |
| | | File file = new File(src); |
| | | if (!file.exists()) { |
| | | return null; |
| | | } |
| | | BufferedImage bufferedImage = ImageIO.read(file); |
| | | int width = bufferedImage.getWidth(); |
| | | int height = bufferedImage.getHeight(); |
| | | return String.format("%s x %s", width, height); |
| | | } |
| | | |
| | | public static String scale(String src, int w, int h) throws IOException { |
| | | int inserTo = src.lastIndexOf("."); |
| | | String dest = src.substring(0, inserTo) + String.format("_%sx%s", w, h) + src.substring(inserTo, src.length()); |
| | | scale(src, dest, w, h); |
| | | return dest; |
| | | } |
| | | |
| | | /** |
| | | * å¾ç大å°å缩 |
| | | * |
| | | * @param src |
| | | * @throws IOException |
| | | */ |
| | | public static void scale(String src) throws IOException { |
| | | File file = new File(src); |
| | | if (!file.exists()) { |
| | | return; |
| | | } |
| | | BufferedImage bufferedImage = ImageIO.read(file); |
| | | int w = bufferedImage.getWidth(); |
| | | int h = bufferedImage.getHeight(); |
| | | String srcSuffix = src.substring(src.lastIndexOf(".") + 1); |
| | | Iterator<ImageReader> iterator = ImageIO.getImageReadersByFormatName(srcSuffix); |
| | | ImageReader reader = (ImageReader) iterator.next(); |
| | | |
| | | InputStream in = new FileInputStream(src); |
| | | ImageInputStream iis = ImageIO.createImageInputStream(in); |
| | | reader.setInput(iis); |
| | | |
| | | BufferedImage srcBuffered = readBuffereImage(reader, w, h); |
| | | BufferedImage targetBuffered = new BufferedImage(w, h, BufferedImage.TYPE_INT_RGB); |
| | | |
| | | Graphics graphics = targetBuffered.getGraphics(); |
| | | graphics.drawImage(srcBuffered.getScaledInstance(w, h, Image.SCALE_DEFAULT), 0, 0, null); // ç»å¶ç¼©å°åçå¾ |
| | | |
| | | graphics.dispose(); |
| | | srcBuffered.flush(); |
| | | in.close(); |
| | | iis.close(); |
| | | |
| | | ImageIO.write(targetBuffered, srcSuffix, file); |
| | | targetBuffered.flush(); |
| | | } |
| | | |
| | | /** |
| | | * çæ¯ç¼©æ¾ï¼å±
ä¸åªå |
| | | * |
| | | * @param src |
| | | * @param dest |
| | | * @param w |
| | | * @param h |
| | | * @throws IOException |
| | | */ |
| | | public static void scale(String src, String dest, int w, int h) throws IOException { |
| | | String srcSuffix = src.substring(src.lastIndexOf(".") + 1); |
| | | Iterator<ImageReader> iterator = ImageIO.getImageReadersByFormatName(srcSuffix); |
| | | ImageReader reader = (ImageReader) iterator.next(); |
| | | |
| | | InputStream in = new FileInputStream(src); |
| | | ImageInputStream iis = ImageIO.createImageInputStream(in); |
| | | reader.setInput(iis); |
| | | |
| | | BufferedImage srcBuffered = readBuffereImage(reader, w, h); |
| | | BufferedImage targetBuffered = new BufferedImage(w, h, BufferedImage.TYPE_INT_RGB); |
| | | |
| | | Graphics graphics = targetBuffered.getGraphics(); |
| | | graphics.drawImage(srcBuffered.getScaledInstance(w, h, Image.SCALE_DEFAULT), 0, 0, null); // ç»å¶ç¼©å°åçå¾ |
| | | |
| | | graphics.dispose(); |
| | | srcBuffered.flush(); |
| | | in.close(); |
| | | iis.close(); |
| | | |
| | | ImageIO.write(targetBuffered, srcSuffix, new File(dest)); |
| | | targetBuffered.flush(); |
| | | } |
| | | |
| | | private static BufferedImage readBuffereImage(ImageReader reader, int w, int h) throws IOException { |
| | | ImageReadParam param = reader.getDefaultReadParam(); |
| | | int srcWidth = reader.getWidth(0); |
| | | int srcHeight = reader.getHeight(0); |
| | | |
| | | Rectangle rect = null; |
| | | |
| | | if ((float) w / h > (float) srcWidth / srcHeight) { |
| | | h = h * srcWidth / w; |
| | | w = srcWidth; |
| | | rect = new Rectangle(0, (srcHeight - h) / 2, w, h); |
| | | } else { |
| | | w = w * srcHeight / h; |
| | | h = srcHeight; |
| | | rect = new Rectangle((srcWidth - w) / 2, 0, w, h); |
| | | } |
| | | param.setSourceRegion(rect); |
| | | BufferedImage srcBuffered = reader.read(0, param); |
| | | return srcBuffered; |
| | | } |
| | | |
| | | public final static void pressImage(String watermarkImg, String srcImageFile) { |
| | | pressImage(watermarkImg, srcImageFile, srcImageFile, 5, -1, -1, 0.2f, 1); |
| | | } |
| | | |
| | | public final static void pressImage(String watermarkImg, String srcImageFile, String destImageFile) { |
| | | pressImage(watermarkImg, srcImageFile, destImageFile, 5, -1, -1, 0.2f, 1); |
| | | } |
| | | |
| | | public final static void pressImage(String watermarkImg, String srcImageFile, String destImageFile, int position, |
| | | float alpha) { |
| | | pressImage(watermarkImg, srcImageFile, destImageFile, position, -1, -1, 0.2f, alpha); |
| | | } |
| | | |
| | | /** |
| | | * @param watermarkImg |
| | | * æ°´å°å¾çä½ç½® |
| | | * @param srcImageFile |
| | | * æºå¾çä½ç½® |
| | | * @param destImageFile |
| | | * çæçå¾çä½ç½® |
| | | * @param position |
| | | * æ°´å°æå°çä½ç½®ï¼ 1->å·¦ä¸è§ï¼2->å³ä¸è§ï¼1->å±
ä¸ï¼1->å·¦ä¸è§ï¼1->å³ä¸è§ |
| | | * @param xOffset |
| | | * xè½´åç§»éï¼xOffsetå°äº0ï¼èªå¨åç§» |
| | | * @param yOffset |
| | | * yè½´åç§»éï¼yOffsetå°äº0ï¼èªå¨åç§» |
| | | * @param radio |
| | | * é»è®¤ä¸ºåå¾ç 1/4 |
| | | * @param alpha |
| | | * éæåº¦ï¼0~1ï¼ï¼PNGå¾ç建议设置为1 |
| | | */ |
| | | public final static void pressImage(String watermarkImg, String srcImageFile, String destImageFile, int position, |
| | | int xOffset, int yOffset, float radio, float alpha) { |
| | | try { |
| | | File img = new File(srcImageFile); |
| | | Image src = ImageIO.read(img); |
| | | int srcWidth = src.getWidth(null); |
| | | int srcHeight = src.getHeight(null); |
| | | |
| | | BufferedImage image = new BufferedImage(srcWidth, srcHeight, BufferedImage.TYPE_INT_RGB); |
| | | Graphics2D graphics = image.createGraphics(); |
| | | graphics.drawImage(src, 0, 0, srcWidth, srcHeight, null); |
| | | |
| | | // æ°´å°æä»¶ |
| | | Image wmImage = ImageIO.read(new File(watermarkImg)); |
| | | int wmWidth = wmImage.getWidth(null); |
| | | int wmHeight = wmImage.getHeight(null); |
| | | |
| | | radio = radio <= 0 ? 0.2f : radio; |
| | | int newWidth = (int) (srcWidth * radio); |
| | | int newHeight = (int) (wmHeight * (newWidth / (float) wmWidth)); |
| | | |
| | | xOffset = (xOffset < 0) ? (int) (newWidth * 0.1f) : xOffset; |
| | | yOffset = (yOffset < 0) ? (int) (newHeight * 0.1f) : yOffset; |
| | | |
| | | int xPostion = 0; |
| | | int yPostion = 0; |
| | | |
| | | switch (position) { |
| | | case 1: |
| | | xPostion = xOffset; |
| | | yPostion = yOffset; |
| | | break; |
| | | case 2: |
| | | xPostion = (int) (srcWidth * (1 - radio) - xOffset); |
| | | yPostion = yOffset; |
| | | break; |
| | | case 3: |
| | | xPostion = (int) (srcWidth - newWidth) / 2; |
| | | yPostion = (int) (srcHeight - newHeight) / 2; |
| | | break; |
| | | case 4: |
| | | xPostion = xOffset; |
| | | yPostion = (int) (srcHeight - newHeight - yOffset); |
| | | break; |
| | | case 5: |
| | | xPostion = (int) (srcWidth * (1 - radio) - xOffset); |
| | | yPostion = (int) (srcHeight - newHeight - yOffset); |
| | | break; |
| | | default: |
| | | xPostion = xOffset; |
| | | yPostion = yOffset; |
| | | break; |
| | | } |
| | | |
| | | graphics.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_ATOP, alpha)); |
| | | graphics.drawImage(wmImage, xPostion, yPostion, newWidth, newHeight, null); |
| | | // æ°´å°æä»¶ç»æ |
| | | graphics.dispose(); |
| | | ImageIO.write((BufferedImage) image, "JPEG", new File(destImageFile)); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.landtool.lanbase.common.utils; |
| | | |
| | | import com.github.stuxuhai.jpinyin.ChineseHelper; |
| | | import com.github.stuxuhai.jpinyin.PinyinFormat; |
| | | import com.github.stuxuhai.jpinyin.PinyinHelper; |
| | | |
| | | /** |
| | | * @author lanCatalog |
| | | * @Description: TODO(ä¸æè½¬æ¼é³å·¥å
·) |
| | | * @date 2018-3-21 10:09 |
| | | */ |
| | | public class JpinyinUtils { |
| | | /** |
| | | * 转æ¢ä¸ºæå£°è°çæ¼é³å符串 |
| | | * |
| | | * @param pinYinStr æ±å |
| | | * @return æå£°è°çæ¼é³å符串 |
| | | */ |
| | | public static String changeToMarkPinYin(String pinYinStr) { |
| | | String tempStr = null; |
| | | |
| | | try { |
| | | tempStr = PinyinHelper.convertToPinyinString(pinYinStr, " ", PinyinFormat.WITH_TONE_MARK); |
| | | |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return tempStr; |
| | | } |
| | | |
| | | /** |
| | | * 转æ¢ä¸ºæ°å声è°å符串 |
| | | * |
| | | * @param pinYinStr é转æ¢çæ±å |
| | | * @return 转æ¢å®æçæ¼é³å符串 |
| | | */ |
| | | public static String changeToNumberPinYin(String pinYinStr) { |
| | | String tempStr = null; |
| | | |
| | | try { |
| | | tempStr = PinyinHelper.convertToPinyinString(pinYinStr, " ", PinyinFormat.WITH_TONE_NUMBER); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | |
| | | return tempStr; |
| | | } |
| | | |
| | | /** |
| | | * 转æ¢ä¸ºä¸å¸¦é³è°çæ¼é³å符串 |
| | | * |
| | | * @param pinYinStr é转æ¢çæ±å |
| | | * @return æ¼é³å符串 |
| | | */ |
| | | public static String changeToTonePinYin(String pinYinStr) { |
| | | String tempStr = null; |
| | | |
| | | try { |
| | | tempStr = PinyinHelper.convertToPinyinString(pinYinStr, " ", PinyinFormat.WITHOUT_TONE); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return tempStr; |
| | | } |
| | | |
| | | /** |
| | | * 转æ¢ä¸ºæ¯ä¸ªæ±åå¯¹åºæ¼é³é¦åæ¯å符串 |
| | | * |
| | | * @param pinYinStr é转æ¢çæ±å |
| | | * @return æ¼é³å符串 |
| | | */ |
| | | public static String changeToGetShortPinYin(String pinYinStr) { |
| | | String tempStr = null; |
| | | |
| | | try { |
| | | tempStr = PinyinHelper.getShortPinyin(pinYinStr); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return tempStr; |
| | | } |
| | | |
| | | /** |
| | | * æ£æ¥æ±åæ¯å¦ä¸ºå¤é³å |
| | | * |
| | | * @param pinYinStr 鿣æ¥çæ±å |
| | | * @return true å¤é³åï¼false 䏿¯å¤é³å |
| | | */ |
| | | public static boolean checkPinYin(char pinYinStr) { |
| | | boolean check = false; |
| | | try { |
| | | check = PinyinHelper.hasMultiPinyin(pinYinStr); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return check; |
| | | } |
| | | |
| | | /** |
| | | * ç®ä½è½¬æ¢ä¸ºç¹ä½ |
| | | * |
| | | * @param pinYinStr |
| | | * @return |
| | | */ |
| | | public static String changeToTraditional(String pinYinStr) { |
| | | String tempStr = null; |
| | | try { |
| | | tempStr = ChineseHelper.convertToTraditionalChinese(pinYinStr); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return tempStr; |
| | | } |
| | | |
| | | /** |
| | | * ç¹ä½è½¬æ¢ä¸ºç®ä½ |
| | | * |
| | | * @param pinYinSt |
| | | * @return |
| | | */ |
| | | public static String changeToSimplified(String pinYinSt) { |
| | | String tempStr = null; |
| | | |
| | | try { |
| | | tempStr = ChineseHelper.convertToSimplifiedChinese(pinYinSt); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | |
| | | return tempStr; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | /** |
| | | * Copyright (c) 2015-2016, Michael Yang æ¨ç¦æµ· (fuhai999@gmail.com). |
| | | * |
| | | * Licensed under the GNU Lesser General Public License (LGPL) ,Version 3.0 (the "License"); |
| | | * you may not use this file except in compliance with the License. |
| | | * You may obtain a copy of the License at |
| | | * |
| | | * http://www.gnu.org/licenses/lgpl-3.0.txt |
| | | * |
| | | * Unless required by applicable law or agreed to in writing, software |
| | | * distributed under the License is distributed on an "AS IS" BASIS, |
| | | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| | | * See the License for the specific language governing permissions and |
| | | * limitations under the License. |
| | | */ |
| | | package com.landtool.lanbase.common.utils; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | import org.apache.commons.lang.StringUtils; |
| | | import org.jsoup.Jsoup; |
| | | import org.jsoup.nodes.Attribute; |
| | | import org.jsoup.nodes.Document; |
| | | import org.jsoup.nodes.Element; |
| | | import org.jsoup.select.Elements; |
| | | |
| | | /** |
| | | * @author lanbase |
| | | * @Description: TODO(htmlå¤çå·¥å
·) |
| | | * @date 2017-6-23 15:07 |
| | | */ |
| | | public class JsoupUtils { |
| | | |
| | | public static String getFirstImageSrc(String html) { |
| | | if (html == null) |
| | | return null; |
| | | |
| | | Elements es = Jsoup.parseBodyFragment(html).select("img"); |
| | | if (es != null && es.size() > 0) |
| | | return es.first().attr("src"); |
| | | |
| | | return null; |
| | | } |
| | | |
| | | public static List<String> getImageSrcs(String html) { |
| | | if (StringUtils.isBlank(html)) { |
| | | return null; |
| | | } |
| | | |
| | | List<String> list = new ArrayList<String>(); |
| | | |
| | | Document doc = Jsoup.parseBodyFragment(html); |
| | | Elements es = doc.select("img"); |
| | | if (es != null && es.size() > 0) { |
| | | for (Element e : es) { |
| | | list.add(e.attr("src")); |
| | | } |
| | | } |
| | | return list; |
| | | } |
| | | |
| | | public static String getText(String html) { |
| | | return Jsoup.parse(html).text(); |
| | | } |
| | | |
| | | public static String getBodyHtml(String html) { |
| | | if (StringUtils.isNotBlank(html)) { |
| | | Document document = Jsoup.parse(html); |
| | | if (null != document && document.body() != null) { |
| | | return document.body().html().toString(); |
| | | } |
| | | } |
| | | return html; |
| | | } |
| | | |
| | | static MyWhitelist whitelist = new MyWhitelist(); |
| | | |
| | | public static String clear(String html) { |
| | | if (StringUtils.isNotBlank(html)) |
| | | return Jsoup.clean(html, whitelist); |
| | | |
| | | return html; |
| | | } |
| | | |
| | | /** |
| | | * åèªå·±çç½ååï¼å
许base64çå¾çéè¿ç |
| | | * |
| | | * @author michael |
| | | */ |
| | | public static class MyWhitelist extends org.jsoup.safety.Whitelist { |
| | | public MyWhitelist() { |
| | | |
| | | addTags("a", "b", "blockquote", "br", "caption", "cite", "code", "col", "colgroup", "dd", "div", "dl", "dt", |
| | | "em", "h1", "h2", "h3", "h4", "h5", "h6", "i", "img", "li", "ol", "p", "pre", "q", "small", |
| | | "strike", "strong", "sub", "sup", "table", "tbody", "td", "tfoot", "th", "thead", "tr", "u", "ul"); |
| | | |
| | | addAttributes("a", "href", "title", "target"); |
| | | addAttributes("blockquote", "cite"); |
| | | addAttributes("col", "span"); |
| | | addAttributes("colgroup", "span"); |
| | | addAttributes("img", "align", "alt", "src", "title"); |
| | | addAttributes("ol", "start"); |
| | | addAttributes("q", "cite"); |
| | | addAttributes("table", "summary"); |
| | | addAttributes("td", "abbr", "axis", "colspan", "rowspan", "width"); |
| | | addAttributes("th", "abbr", "axis", "colspan", "rowspan", "scope", "width"); |
| | | addAttributes("video", "src", "autoplay", "controls", "loop", "muted", "poster", "preload"); |
| | | |
| | | addAttributes(":all", "class"); |
| | | addAttributes(":all", "style"); |
| | | addAttributes(":all", "height"); |
| | | addAttributes(":all", "width"); |
| | | addAttributes(":all", "type"); |
| | | addAttributes(":all", "id"); |
| | | addAttributes(":all", "name"); |
| | | |
| | | addProtocols("a", "href", "ftp", "http", "https", "mailto", "tel"); |
| | | addProtocols("blockquote", "cite", "http", "https"); |
| | | addProtocols("cite", "cite", "http", "https"); |
| | | addProtocols("img", "src", "http", "https"); |
| | | addProtocols("q", "cite", "http", "https"); |
| | | } |
| | | |
| | | @Override |
| | | protected boolean isSafeAttribute(String tagName, Element el, Attribute attr) { |
| | | return ("img".equals(tagName) && "src".equals(attr.getKey()) && attr.getValue().startsWith("data:;base64")) |
| | | || super.isSafeAttribute(tagName, el, attr); |
| | | } |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.landtool.lanbase.common.utils; |
| | | |
| | | /** |
| | | * @Description: nameä¸idçç»å®ç»æ ï¼ä½ç¨ï¼ç¨äºè¿åç»æçpojoï¼ |
| | | * @Author: zimao.guo |
| | | * @Date: 11:34 2018/2/2 |
| | | */ |
| | | public class NameBindId { |
| | | |
| | | private String name; |
| | | |
| | | private Long id; |
| | | |
| | | public String getName() { |
| | | return name; |
| | | } |
| | | |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | } |
| | | |
| | | public Long getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(Long id) { |
| | | this.id = id; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.landtool.lanbase.common.utils; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author lanbase |
| | | * @Description: TODO(å页工å
·ç±») |
| | | * @date 2017-6-23 15:07 |
| | | */ |
| | | public class PageUtils implements Serializable { |
| | | private static final long serialVersionUID = 1L; |
| | | //æ»è®°å½æ° |
| | | private int totalCount; |
| | | //æ¯é¡µè®°å½æ° |
| | | private int pageSize; |
| | | //æ»é¡µæ° |
| | | private int totalPage; |
| | | //å½åé¡µæ° |
| | | private int currPage; |
| | | //åè¡¨æ°æ® |
| | | private List<?> list; |
| | | |
| | | /** |
| | | * å页 |
| | | * @param list åè¡¨æ°æ® |
| | | * @param totalCount æ»è®°å½æ° |
| | | * @param pageSize æ¯é¡µè®°å½æ° |
| | | * @param currPage å½åé¡µæ° |
| | | */ |
| | | public PageUtils(List<?> list, int totalCount, int pageSize, int currPage) { |
| | | this.list = list; |
| | | this.totalCount = totalCount; |
| | | this.pageSize = pageSize; |
| | | this.currPage = currPage; |
| | | this.totalPage = (int)Math.ceil((double)totalCount/pageSize); |
| | | } |
| | | |
| | | public int getTotalCount() { |
| | | return totalCount; |
| | | } |
| | | |
| | | public void setTotalCount(int totalCount) { |
| | | this.totalCount = totalCount; |
| | | } |
| | | |
| | | public int getPageSize() { |
| | | return pageSize; |
| | | } |
| | | |
| | | public void setPageSize(int pageSize) { |
| | | this.pageSize = pageSize; |
| | | } |
| | | |
| | | public int getTotalPage() { |
| | | return totalPage; |
| | | } |
| | | |
| | | public void setTotalPage(int totalPage) { |
| | | this.totalPage = totalPage; |
| | | } |
| | | |
| | | public int getCurrPage() { |
| | | return currPage; |
| | | } |
| | | |
| | | public void setCurrPage(int currPage) { |
| | | this.currPage = currPage; |
| | | } |
| | | |
| | | public List<?> getList() { |
| | | return list; |
| | | } |
| | | |
| | | public void setList(List<?> list) { |
| | | this.list = list; |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.landtool.lanbase.common.utils; |
| | | |
| | | import net.sourceforge.pinyin4j.PinyinHelper; |
| | | import net.sourceforge.pinyin4j.format.HanyuPinyinCaseType; |
| | | import net.sourceforge.pinyin4j.format.HanyuPinyinOutputFormat; |
| | | import net.sourceforge.pinyin4j.format.HanyuPinyinToneType; |
| | | import net.sourceforge.pinyin4j.format.HanyuPinyinVCharType; |
| | | import net.sourceforge.pinyin4j.format.exception.BadHanyuPinyinOutputFormatCombination; |
| | | |
| | | /** |
| | | * @author lanbase |
| | | * @Description: TODO(ä¸æè½¬æ¼é³å·¥å
·) |
| | | * @date 2017-9-26 10:09 |
| | | */ |
| | | public class PinyinUtils { |
| | | |
| | | /** |
| | | * å°æå转为æ±è¯æ¼é³ |
| | | * @param ChineseLanguage è¦è½¬ææ¼é³ç䏿 |
| | | */ |
| | | private static String toHanyuPinyin(String ChineseLanguage, HanyuPinyinCaseType caseType){ |
| | | char[] cl_chars = ChineseLanguage.trim().toCharArray(); |
| | | String hanyupinyin = ""; |
| | | HanyuPinyinOutputFormat defaultFormat = new HanyuPinyinOutputFormat(); |
| | | defaultFormat.setCaseType(caseType); |
| | | defaultFormat.setToneType(HanyuPinyinToneType.WITHOUT_TONE);// ä¸å¸¦å£°è° |
| | | defaultFormat.setVCharType(HanyuPinyinVCharType.WITH_V) ; |
| | | try { |
| | | for (int i=0; i<cl_chars.length; i++){ |
| | | if (String.valueOf(cl_chars[i]).matches("[\u4e00-\u9fa5]+")){// 妿å符æ¯ä¸æ,åå°ä¸æè½¬ä¸ºæ±è¯æ¼é³ |
| | | hanyupinyin += PinyinHelper.toHanyuPinyinStringArray(cl_chars[i], defaultFormat)[0]; |
| | | } else {// 妿åç¬¦ä¸æ¯ä¸æ,åä¸è½¬æ¢ |
| | | hanyupinyin += cl_chars[i]; |
| | | } |
| | | } |
| | | } catch (BadHanyuPinyinOutputFormatCombination e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return hanyupinyin; |
| | | } |
| | | |
| | | /** |
| | | * å°æåè½¬ä¸ºå¤§åæ±è¯æ¼é³ |
| | | * @param ChineseLanguage è¦è½¬ææ¼é³ç䏿 |
| | | * @return |
| | | */ |
| | | public static String toHanyuPinyinUpperCase(String ChineseLanguage){ |
| | | return toHanyuPinyin(ChineseLanguage, HanyuPinyinCaseType.UPPERCASE); |
| | | } |
| | | |
| | | /** |
| | | * å°æå转为å°åæ±è¯æ¼é³ |
| | | * @param ChineseLanguage è¦è½¬ææ¼é³ç䏿 |
| | | * @return |
| | | */ |
| | | public static String toHanyuPinyinLowerCase(String ChineseLanguage){ |
| | | return toHanyuPinyin(ChineseLanguage, HanyuPinyinCaseType.LOWERCASE); |
| | | } |
| | | |
| | | /** |
| | | * å第ä¸ä¸ªæ±åç第ä¸ä¸ªå符 |
| | | * @param ChineseLanguage è¦è½¬ææ¼é³ç䏿 |
| | | * @param caseType 大åè¿æ¯å°å |
| | | * @return |
| | | */ |
| | | private static String getFirstLetter(String ChineseLanguage, HanyuPinyinCaseType caseType){ |
| | | char[] cl_chars = ChineseLanguage.trim().toCharArray(); |
| | | String hanyupinyin = ""; |
| | | HanyuPinyinOutputFormat defaultFormat = new HanyuPinyinOutputFormat(); |
| | | defaultFormat.setCaseType(caseType); |
| | | defaultFormat.setToneType(HanyuPinyinToneType.WITHOUT_TONE);// ä¸å¸¦å£°è° |
| | | try { |
| | | String str = String.valueOf(cl_chars[0]); |
| | | if (str.matches("[\u4e00-\u9fa5]+")) {// 妿å符æ¯ä¸æ,åå°ä¸æè½¬ä¸ºæ±è¯æ¼é³,å¹¶å第ä¸ä¸ªåæ¯ |
| | | hanyupinyin = PinyinHelper.toHanyuPinyinStringArray(cl_chars[0], defaultFormat)[0].substring(0, 1); |
| | | } else {// 妿åç¬¦ä¸æ¯ä¸æ,åä¸è½¬æ¢ |
| | | hanyupinyin += cl_chars[0]; |
| | | } |
| | | } catch (BadHanyuPinyinOutputFormatCombination e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return hanyupinyin; |
| | | } |
| | | |
| | | /** |
| | | * å第ä¸ä¸ªæ±åç第ä¸ä¸ªå¤§åå符 |
| | | * @param ChineseLanguage è¦è½¬ææ¼é³ç䏿 |
| | | * @return |
| | | */ |
| | | public static String getFirstLetterUpperCase(String ChineseLanguage){ |
| | | return getFirstLetter(ChineseLanguage, HanyuPinyinCaseType.UPPERCASE); |
| | | } |
| | | |
| | | /** |
| | | * å第ä¸ä¸ªæ±åç第ä¸ä¸ªå°åå符 |
| | | * @param ChineseLanguage è¦è½¬ææ¼é³ç䏿 |
| | | * @return |
| | | */ |
| | | public static String getFirstLetterLowerCase(String ChineseLanguage){ |
| | | return getFirstLetter(ChineseLanguage, HanyuPinyinCaseType.LOWERCASE); |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.landtool.lanbase.common.utils; |
| | | |
| | | |
| | | |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import java.util.LinkedHashMap; |
| | | import java.util.Map; |
| | | |
| | | import org.apache.commons.lang.StringUtils; |
| | | |
| | | import com.landtool.lanbase.common.xss.SQLFilter; |
| | | |
| | | /** |
| | | * @author lanbase |
| | | * @Description: TODO(æ¥è¯¢åæ°) |
| | | * @date 2017-6-23 15:07 |
| | | */ |
| | | public class Query extends LinkedHashMap<String, Object> { |
| | | private static final long serialVersionUID = 1L; |
| | | //å½å页ç |
| | | private int page; |
| | | //æ¯é¡µæ¡æ° |
| | | private int limit; |
| | | |
| | | public Query(Map<String, Object> params){ |
| | | this.putAll(params); |
| | | |
| | | //å页忰 |
| | | this.page = Integer.parseInt(params.get("page").toString()); |
| | | this.limit = Integer.parseInt(params.get("limit").toString()); |
| | | this.put("page", page); |
| | | this.put("limit", limit); |
| | | this.put("lowerOffset", (page - 1) * limit); |
| | | this.put("upperOffset", page * limit ); |
| | | |
| | | //鲿¢SQL注å
¥ï¼å 为sidxãorderæ¯éè¿æ¼æ¥SQLå®ç°æåºçï¼ä¼æSQL注å
¥é£é©ï¼ |
| | | String sidx = (String)params.get("sidx"); |
| | | String order = (String)params.get("order"); |
| | | String fkey=(String)params.get("fkey"); |
| | | String cname=(String)params.get("cname"); |
| | | String appid=(String)params.get("appid"); |
| | | String UserName=(String)params.get("userName"); |
| | | String beginDate=(String)params.get("beginDate"); |
| | | String endDate=(String)params.get("endDate"); |
| | | String appfullName=(String)params.get("appfullName"); |
| | | |
| | | |
| | | if(StringUtils.isNotBlank(sidx)){ |
| | | this.put("sidx", SQLFilter.sqlInject(sidx)); |
| | | } |
| | | if(StringUtils.isNotBlank(order)){ |
| | | this.put("order", SQLFilter.sqlInject(order)); |
| | | } |
| | | if(StringUtils.isNotBlank(fkey)){ |
| | | this.put("fkey", fkey); |
| | | } |
| | | if(StringUtils.isNotBlank(appid)){ |
| | | this.put("appid", appid); |
| | | } |
| | | if(StringUtils.isNotBlank(UserName)){ |
| | | this.put("UserName", UserName); |
| | | } |
| | | if(StringUtils.isNotBlank(cname)){ |
| | | this.put("cname", cname); |
| | | } |
| | | if(StringUtils.isNotBlank(beginDate)){ |
| | | this.put("beginDate", beginDate); |
| | | } |
| | | if(StringUtils.isNotBlank(endDate)){ |
| | | SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd"); |
| | | try { |
| | | Date d=new Date(sdf.parse(endDate).getTime()+24*3600*1000); |
| | | endDate=sdf.format(d); |
| | | this.put("endDate", endDate); |
| | | } catch (ParseException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | |
| | | } |
| | | if(StringUtils.isNotBlank(appfullName)){ |
| | | this.put("appfullName", appfullName); |
| | | } |
| | | |
| | | } |
| | | public int getPage() { |
| | | return page; |
| | | } |
| | | |
| | | public void setPage(int page) { |
| | | this.page = page; |
| | | } |
| | | |
| | | public int getLimit() { |
| | | return limit; |
| | | } |
| | | |
| | | public void setLimit(int limit) { |
| | | this.limit = limit; |
| | | } |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | /** |
| | | * |
| | | */ |
| | | package com.landtool.lanbase.common.utils; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import java.util.Random; |
| | | import java.util.UUID; |
| | | |
| | | import org.apache.commons.lang.StringUtils; |
| | | |
| | | /** |
| | | * @Description: TODO(éæºæ°å·¥å
·ç±») |
| | | * @author lanbase |
| | | * @date 2016å¹´10æ10æ¥ ä¸å8:50:13 |
| | | */ |
| | | public class RandomUtils { |
| | | |
| | | private static final Random RANDOM=new Random(); |
| | | |
| | | public static Random getRandom() { |
| | | return RANDOM; |
| | | } |
| | | |
| | | private static char[] chars = { |
| | | 'a', 'b', 'c', 'd', 'e', 'f', 'g', |
| | | 'h', 'i', 'j', 'k', 'l', 'm', 'n', |
| | | 'o', 'p', 'q', 'r', 's', 't', 'u', |
| | | 'v', 'w', 'x', 'y', 'z', |
| | | '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', |
| | | 'A', 'B', 'C', 'D', 'E', 'F', 'G', |
| | | 'H', 'I', 'J', 'K', 'L', 'M', 'N', |
| | | 'O', 'P', 'Q', 'R', 'S', 'T', 'U', |
| | | 'V', 'W', 'X', 'Y', 'Z' |
| | | }; |
| | | |
| | | /** |
| | | * éæºçæç±0-9a-zA-Zç»åèæçå符串 |
| | | * |
| | | * @param len å符串é¿åº¦ |
| | | * @return çæç»æ |
| | | */ |
| | | public static String randomChar(int len) { |
| | | StringBuilder shortBuffer = new StringBuilder(); |
| | | String uuid = UUID.randomUUID().toString().replace("-", ""); |
| | | for (int i = 0; i < len; i++) { |
| | | String str = uuid.substring(i * 4, i * 4 + 4); |
| | | int x = Integer.parseInt(str, 16); |
| | | shortBuffer.append(chars[x % 0x3E]); |
| | | } |
| | | return shortBuffer.toString(); |
| | | } |
| | | |
| | | /** |
| | | * éæºæ°+æ¥æ |
| | | * @param startaKey |
| | | * @param endKey |
| | | * @return |
| | | */ |
| | | public static String randomKey(String startaKey, String endKey) { |
| | | String simpleDate = new SimpleDateFormat("yyMMddHHmmss").format(new Date()); |
| | | String result = simpleDate + randomSixNum(); |
| | | if (StringUtils.isNotBlank(startaKey)) { |
| | | result = startaKey + result; |
| | | } |
| | | if (StringUtils.isNotBlank(endKey)) { |
| | | result = result + endKey; |
| | | } |
| | | return result; |
| | | } |
| | | |
| | | public static Integer randomKey(int count) { |
| | | Integer result = getRandom().nextInt(count); |
| | | return result + 1; |
| | | } |
| | | |
| | | /** |
| | | * éæºçæå
ä½éæºæ° |
| | | * @return |
| | | */ |
| | | public static int randomSixNum() { |
| | | int randomNum = (int) ((Math.random() * 9 + 1) * 100000); |
| | | return randomNum; |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.landtool.lanbase.common.utils; |
| | | |
| | | import java.util.Set; |
| | | import java.util.concurrent.TimeUnit; |
| | | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.data.redis.core.HashOperations; |
| | | import org.springframework.data.redis.core.ListOperations; |
| | | import org.springframework.data.redis.core.RedisTemplate; |
| | | import org.springframework.data.redis.core.SetOperations; |
| | | import org.springframework.data.redis.core.ValueOperations; |
| | | import org.springframework.data.redis.core.ZSetOperations; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import com.google.gson.Gson; |
| | | |
| | | /** |
| | | * @author lanbase |
| | | * @Description: TODO(Rediså·¥å
·ç±») |
| | | * @date 2017-6-23 15:07 |
| | | */ |
| | | @Component |
| | | public class RedisUtils { |
| | | |
| | | //æ¯å¦å¼å¯redisç¼å trueå¼å¯ falseå
³é |
| | | @Value("${spring.redis.open: #{false}}") |
| | | private boolean open; |
| | | |
| | | @Autowired |
| | | private RedisTemplate<String, Object> redisTemplate; |
| | | @Autowired |
| | | private ValueOperations<String, String> valueOperations; |
| | | @Autowired |
| | | private HashOperations<String, String, Object> hashOperations; |
| | | @Autowired |
| | | private ListOperations<String, Object> listOperations; |
| | | @Autowired |
| | | private SetOperations<String, Object> setOperations; |
| | | @Autowired |
| | | private ZSetOperations<String, Object> zSetOperations; |
| | | |
| | | /** é»è®¤è¿ææ¶é¿ï¼åä½ï¼ç§ */ |
| | | public final static long DEFAULT_EXPIRE = 60 * 60 * 24; |
| | | |
| | | /** ä¸è®¾ç½®è¿ææ¶é¿ */ |
| | | public final static long NOT_EXPIRE = -1; |
| | | |
| | | private final static Gson gson = new Gson(); |
| | | |
| | | public boolean exists(String key) { |
| | | if(!open){ |
| | | return false; |
| | | } |
| | | |
| | | return redisTemplate.hasKey(key); |
| | | } |
| | | |
| | | public void set(String key, Object value, long expire){ |
| | | if(!open){ |
| | | return; |
| | | } |
| | | |
| | | valueOperations.set(key, toJson(value)); |
| | | if(expire != NOT_EXPIRE){ |
| | | redisTemplate.expire(key, expire, TimeUnit.SECONDS); |
| | | } |
| | | } |
| | | |
| | | public void set(String key, Object value){ |
| | | if(!open){ |
| | | return; |
| | | } |
| | | |
| | | set(key, value, DEFAULT_EXPIRE); |
| | | } |
| | | |
| | | public <T> T get(String key, Class<T> clazz, long expire) { |
| | | if(!open){ |
| | | return null; |
| | | } |
| | | |
| | | String value = valueOperations.get(key); |
| | | if(expire != NOT_EXPIRE){ |
| | | redisTemplate.expire(key, expire, TimeUnit.SECONDS); |
| | | } |
| | | return value == null ? null : fromJson(value, clazz); |
| | | } |
| | | |
| | | public <T> T get(String key, Class<T> clazz) { |
| | | if(!open){ |
| | | return null; |
| | | } |
| | | |
| | | return get(key, clazz, NOT_EXPIRE); |
| | | } |
| | | |
| | | public String get(String key, long expire) { |
| | | if(!open){ |
| | | return null; |
| | | } |
| | | |
| | | String value = valueOperations.get(key); |
| | | if(expire != NOT_EXPIRE){ |
| | | redisTemplate.expire(key, expire, TimeUnit.SECONDS); |
| | | } |
| | | return value; |
| | | } |
| | | |
| | | public String get(String key) { |
| | | if(!open){ |
| | | return null; |
| | | } |
| | | |
| | | return get(key, NOT_EXPIRE); |
| | | } |
| | | |
| | | public void delete(String key) { |
| | | if(!open){ |
| | | return; |
| | | } |
| | | |
| | | if(exists(key)){ |
| | | redisTemplate.delete(key); |
| | | } |
| | | } |
| | | |
| | | public void delete(String... keys) { |
| | | if(!open){ |
| | | return; |
| | | } |
| | | |
| | | for (String key : keys) { |
| | | redisTemplate.delete(key); |
| | | } |
| | | } |
| | | |
| | | public void deletePattern(String pattern) { |
| | | if(!open){ |
| | | return; |
| | | } |
| | | |
| | | Set<String> keys = redisTemplate.keys(pattern); |
| | | if (keys.size() > 0) |
| | | redisTemplate.delete(keys); |
| | | } |
| | | |
| | | /** |
| | | * Object转æJSONæ°æ® |
| | | */ |
| | | private String toJson(Object object){ |
| | | if(!open){ |
| | | return null; |
| | | } |
| | | |
| | | if(object instanceof Integer || object instanceof Long || object instanceof Float || |
| | | object instanceof Double || object instanceof Boolean || object instanceof String){ |
| | | return String.valueOf(object); |
| | | } |
| | | return gson.toJson(object); |
| | | } |
| | | |
| | | /** |
| | | * JSONæ°æ®ï¼è½¬æObject |
| | | */ |
| | | private <T> T fromJson(String json, Class<T> clazz){ |
| | | if(!open){ |
| | | return null; |
| | | } |
| | | |
| | | return gson.fromJson(json, clazz); |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.landtool.lanbase.common.utils; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | import org.apache.http.HttpStatus; |
| | | |
| | | /** |
| | | * @author lanbase |
| | | * @Description: TODO(è¿åæ°æ®) |
| | | * @date 2017-6-23 15:07 |
| | | */ |
| | | public class Result extends HashMap<String, Object> { |
| | | |
| | | private final static int CODE_SUCCESS=0; |
| | | |
| | | public static Result error() { |
| | | return error(HttpStatus.SC_INTERNAL_SERVER_ERROR, "æªç¥å¼å¸¸ï¼è¯·è系管çå"); |
| | | } |
| | | |
| | | public static Result error(String msg) { |
| | | return error(HttpStatus.SC_INTERNAL_SERVER_ERROR, msg); |
| | | } |
| | | |
| | | public static Result error(int code, String msg) { |
| | | Result r = new Result(); |
| | | r.put("code", code); |
| | | r.put("msg", msg); |
| | | return r; |
| | | } |
| | | |
| | | public static Result ok() { |
| | | return ok("æä½æå"); |
| | | } |
| | | |
| | | public static Result ok(String msg) { |
| | | Result r = new Result(); |
| | | r.put("code", CODE_SUCCESS); |
| | | r.put("msg", msg); |
| | | return r; |
| | | } |
| | | |
| | | public Result put(Map<String, Object> map) { |
| | | super.putAll(map); |
| | | return this; |
| | | } |
| | | |
| | | public Result put(String key, Object value) { |
| | | super.put(key, value); |
| | | return this; |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.landtool.lanbase.common.utils; |
| | | |
| | | import org.apache.shiro.SecurityUtils; |
| | | import org.apache.shiro.session.Session; |
| | | import org.apache.shiro.subject.Subject; |
| | | |
| | | import com.landtool.lanbase.modules.org.entity.OrgUser; |
| | | |
| | | /** |
| | | * @author lanbase |
| | | * @Description: TODO(Shiroå·¥å
·ç±») |
| | | * @date 2017-6-23 15:07 |
| | | */ |
| | | public class ShiroUtils { |
| | | |
| | | public static Session getSession() { |
| | | return SecurityUtils.getSubject().getSession(); |
| | | } |
| | | |
| | | public static Subject getSubject() { |
| | | return SecurityUtils.getSubject(); |
| | | } |
| | | |
| | | public static OrgUser getUserEntity() { |
| | | return (OrgUser)SecurityUtils.getSubject().getPrincipal(); |
| | | } |
| | | |
| | | public static Long getUserId() { |
| | | return getUserEntity().getUserid(); |
| | | } |
| | | |
| | | public static void setSessionAttribute(Object key, Object value) { |
| | | getSession().setAttribute(key, value); |
| | | } |
| | | |
| | | public static Object getSessionAttribute(Object key) { |
| | | return getSession().getAttribute(key); |
| | | } |
| | | |
| | | public static boolean isLogin() { |
| | | return SecurityUtils.getSubject().getPrincipal() != null; |
| | | } |
| | | |
| | | public static void logout() { |
| | | SecurityUtils.getSubject().logout(); |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.landtool.lanbase.common.utils; |
| | | |
| | | import org.springframework.beans.BeansException; |
| | | import org.springframework.context.ApplicationContext; |
| | | import org.springframework.context.ApplicationContextAware; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | /** |
| | | * @author lanbase |
| | | * @Description: TODO(Spring Context å·¥å
·ç±») |
| | | * @date 2017-6-23 15:07 |
| | | */ |
| | | @Component |
| | | public class SpringContextUtils implements ApplicationContextAware { |
| | | |
| | | public static ApplicationContext applicationContext; |
| | | |
| | | @Override |
| | | public void setApplicationContext(ApplicationContext applicationContext) |
| | | throws BeansException { |
| | | SpringContextUtils.applicationContext = applicationContext; |
| | | } |
| | | |
| | | public static Object getBean(String name) { |
| | | return applicationContext.getBean(name); |
| | | } |
| | | |
| | | public static <T> T getBean(String name, Class<T> requiredType) { |
| | | return applicationContext.getBean(name, requiredType); |
| | | } |
| | | |
| | | public static <T> T getBean(Class<T> requiredType) { |
| | | return applicationContext.getBean(requiredType); |
| | | } |
| | | |
| | | public static boolean containsBean(String name) { |
| | | return applicationContext.containsBean(name); |
| | | } |
| | | |
| | | public static boolean isSingleton(String name) { |
| | | return applicationContext.isSingleton(name); |
| | | } |
| | | |
| | | public static Class<? extends Object> getType(String name) { |
| | | return applicationContext.getType(name); |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.landtool.lanbase.common.utils; |
| | | |
| | | import java.text.ParsePosition; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | |
| | | public class TimeIntervalUtil { |
| | | public static String getInterval(String createtime) { //ä¼ å
¥çæ¶é´æ ¼å¼å¿
须类似äº2012-8-21 17:53:20è¿æ ·çæ ¼å¼ |
| | | String interval = null; |
| | | |
| | | SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | ParsePosition pos = new ParsePosition(0); |
| | | Date d1 = (Date) sd.parse(createtime, pos); |
| | | |
| | | //ç¨ç°å¨è·ç¦»1970å¹´çæ¶é´é´énew Date().getTime()åå»ä»¥åçæ¶é´è·ç¦»1970å¹´çæ¶é´é´éd1.getTime()å¾åºçå°±æ¯ä»¥åçæ¶é´ä¸ç°å¨æ¶é´çæ¶é´é´é |
| | | long time = new Date().getTime() - d1.getTime();// å¾åºçæ¶é´é´éæ¯æ¯«ç§ |
| | | |
| | | if(time/1000 < 10 && time/1000 >= 0) { |
| | | //妿æ¶é´é´éå°äº10ç§åæ¾ç¤ºâååâtime/10å¾åºçæ¶é´é´éçå使¯ç§ |
| | | interval ="åå"; |
| | | |
| | | } else if(time/3600000 < 24 && time/3600000 > 0) { |
| | | //妿æ¶é´é´éå°äº24å°æ¶åæ¾ç¤ºå¤å°å°æ¶å |
| | | int h = (int) (time/3600000);//å¾åºçæ¶é´é´éçå使¯å°æ¶ |
| | | interval = h + "å°æ¶å"; |
| | | |
| | | } else if(time/60000 < 60 && time/60000 > 0) { |
| | | //妿æ¶é´é´éå°äº60åéåæ¾ç¤ºå¤å°åéå |
| | | int m = (int) ((time%3600000)/60000);//å¾åºçæ¶é´é´éçå使¯åé |
| | | interval = m + "åéå"; |
| | | |
| | | } else if(time/1000 < 60 && time/1000 > 0) { |
| | | //妿æ¶é´é´éå°äº60ç§åæ¾ç¤ºå¤å°ç§å |
| | | int se = (int) ((time%60000)/1000); |
| | | interval = se + "ç§å"; |
| | | |
| | | } |
| | | else if(time/3600000/24 < 24 && time/3600000/24 >= 0 ) { |
| | | //妿æ¶é´é´é大äº24å°æ¶åæ¾ç¤ºå¤å°å¤©å |
| | | int d = (int) (time/3600000/24); |
| | | interval = d + "天å"; |
| | | } |
| | | else if(time/3600000/24/30 < 12 && time/3600000/24/30 >= 0 ) { |
| | | //妿æ¶é´é´é大äº30天ï¼åæ¾ç¤ºå¤å°ä¸ªæå |
| | | int d = (int) (time/3600000/24/30); |
| | | interval = d + "个æå"; |
| | | } |
| | | else { |
| | | //大äº12个æï¼åæ¾ç¤ºæ£å¸¸çæ¶é´ï¼ä½æ¯ä¸æ¾ç¤ºæ¶åç§ |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
| | | |
| | | ParsePosition pos2 = new ParsePosition(0); |
| | | Date d2 = (Date) sdf.parse(createtime, pos2); |
| | | |
| | | interval = sdf.format(d2); |
| | | } |
| | | return interval; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.landtool.lanbase.common.utils; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | import org.apache.commons.collections4.CollectionUtils; |
| | | import org.apache.commons.collections4.Transformer; |
| | | |
| | | /** |
| | | * @Description: æ ¼å¼è½¬æ¢å·¥å
· |
| | | * @Author: zimao.guo |
| | | * @Date: 15:15 2018/2/9 |
| | | */ |
| | | public class TransformUtils { |
| | | |
| | | /** |
| | | * @Description: String转Longlist |
| | | * @Author: zimao.guo |
| | | * @Date: 15:16 2018/2/9 |
| | | * @return: List<Long> |
| | | * @see Long |
| | | * @param inList |
| | | */ |
| | | public static List<Long> StringToLongList(List<String> inList){ |
| | | List<Long> LongList = new ArrayList<Long>(inList.size()); |
| | | CollectionUtils.collect(inList, new Transformer() { |
| | | @Override |
| | | public Object transform(Object o) { |
| | | return new Long((String)o); |
| | | } |
| | | },LongList); |
| | | return LongList; |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.landtool.lanbase.common.utils; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | import javax.xml.xpath.XPath; |
| | | import javax.xml.xpath.XPathConstants; |
| | | |
| | | import org.apache.log4j.Logger; |
| | | import org.w3c.dom.Document; |
| | | import org.w3c.dom.Node; |
| | | import org.w3c.dom.NodeList; |
| | | |
| | | import com.landtool.lanbase.modules.api.utils.DOMUtil; |
| | | import com.landtool.lanbase.modules.res.entity.WebService.ParameterInfo; |
| | | import com.landtool.lanbase.modules.res.entity.WebService.SchemaDefaultType; |
| | | |
| | | /** |
| | | * ç¬¬äºæ¥ï¼ä½¿ç¨DOMè§£æXML Schemaï¼è·åå
ç´ åç§°åç±»å |
| | | * |
| | | * @author wangleai |
| | | */ |
| | | public class WADOMUtil { |
| | | |
| | | private static Logger log = Logger.getLogger(WADOMUtil.class); |
| | | |
| | | /** |
| | | * æ¥æ¾æä¸ªæä½å«æçåæ° |
| | | * |
| | | * @param inputParamList |
| | | * @param document |
| | | * @param typeName ç±»ååç§° |
| | | * @param xPath å°elementä¸ä¸ªç»ç¹çxpath |
| | | * @param parentParam |
| | | * @param isSelfDefinition æ¯å¦èªå·±å®ä¹ |
| | | * @throws Exception |
| | | */ |
| | | public static void getInputParams(List<ParameterInfo> inputParamList, Document document, String typeName, |
| | | String xPath, ParameterInfo parentParam, boolean isSelfDefinition) throws |
| | | Exception { |
| | | // æ¯å¦æ·»å ç»ç¹ |
| | | boolean canAddParam = true; |
| | | |
| | | // åæ° |
| | | ParameterInfo param = new ParameterInfo(); |
| | | param.setName(typeName); |
| | | |
| | | // 寻æ¾elementèç¹ |
| | | String elementXPath = getElementXPath(xPath, typeName); |
| | | Node elementNode = WADOMUtil.findNode(document, elementXPath); |
| | | |
| | | // 夿elementæ¯å¦ä¸ºç©ºï¼ä¸ºç©ºè¯´æè¯¥ç±»ååç§°å¯è½æ¯ç´æ¥å®ä¹å¨simpleTypeæcomplexTypeä¸ |
| | | // 夿æ¯å¦æ¯èªå·±å®ä¹ï¼é²æ¢åå导è´çå æ 溢åºé®é¢ |
| | | if (elementNode != null && isSelfDefinition) { |
| | | // æ¯å¦å«type屿§ |
| | | if (DOMUtil.assertNodeAttributeExist(elementNode, "type")) { |
| | | String type = DOMUtil.getNodeType(elementNode); |
| | | |
| | | // æ¯å¦æ¯æ°ç»ï¼XML Schemaä¸mapä¼å®ä¹æList<Object>çå½¢å¼ |
| | | if (DOMUtil.isArray(elementNode)) { |
| | | param.setType(SchemaDefaultType.type_array.getType()); |
| | | param.setChildType(type); |
| | | |
| | | // å¤æç±»åæ°ç» |
| | | if (!DOMUtil.isDefaultType(elementNode)) { |
| | | getInputParams(inputParamList, document, type, xPath, param, false); |
| | | } else { |
| | | param.setValue(WAIXPathConstant.VALUEDEF); |
| | | } |
| | | } else { |
| | | param.setType(type); |
| | | |
| | | // å¤æç±»å |
| | | if (!DOMUtil.isDefaultType(elementNode)) { |
| | | getInputParams(inputParamList, document, type, WAIXPathConstant.SCHEMAXPATH, param, false); |
| | | } else { |
| | | param.setValue(WAIXPathConstant.VALUEDEF); |
| | | } |
| | | } |
| | | } else { |
| | | // æ¯å¦æ¯æ°ç»ï¼XML Schemaä¸mapä¼å®ä¹æList<Object>çå½¢å¼ |
| | | if (DOMUtil.isArray(elementNode)) { |
| | | param.setType(SchemaDefaultType.type_array.getType()); |
| | | } |
| | | |
| | | // 妿type屿§ä¸åå¨ï¼è¯´æè¯¥ç»ç¹çç±»åå¨å
¶åç»ç¹ä¸å®ä¹ |
| | | // 夿æ¯simpleTypeè¿æ¯complexType |
| | | Node simpleTypeNode = getSimpleTypeNode(document, typeName, elementXPath, true); |
| | | if (simpleTypeNode != null) { |
| | | String type = DOMUtil.getNodeBase(simpleTypeNode); |
| | | if (DOMUtil.isArray(elementNode)) { |
| | | param.setChildType(type); |
| | | } else { |
| | | param.setType(type); |
| | | } |
| | | param.setValue(WAIXPathConstant.VALUEDEF); |
| | | // TODO: 2018/2/24 |
| | | // 忽ç¥é宿¡ä»¶ |
| | | } else { |
| | | // 寻æ¾complexType |
| | | List<Node> nodeList = getComplexTypeSequenceElement(document, typeName, elementXPath, true); |
| | | if (nodeList.size() != 0) { |
| | | for (Node tempNode : nodeList) { |
| | | // éåelement |
| | | String elementName = DOMUtil.getNodeName(tempNode); |
| | | String sequenceXPath = getSequenceXPathByName(document, typeName, elementXPath, true, |
| | | elementName); |
| | | getInputParams(inputParamList, document, elementName, sequenceXPath, param, true); |
| | | } |
| | | } else { |
| | | log.warn("unknown type " + typeName + ",please check your document"); |
| | | } |
| | | } |
| | | } |
| | | } else { |
| | | // éèªå·±å®ä¹çTypeæ·»å å°ç¶ç»ç¹ |
| | | canAddParam = false; |
| | | |
| | | // 夿æ¯simpleTypeè¿æ¯complexType |
| | | Node simpleTypeNode = getSimpleTypeNode(document, typeName, xPath, false); |
| | | if (simpleTypeNode != null) { |
| | | String type = DOMUtil.getNodeBase(simpleTypeNode); |
| | | parentParam.setType(type); |
| | | parentParam.setValue(WAIXPathConstant.VALUEDEF); |
| | | // TODO: 2018/2/24 |
| | | // 忽ç¥é宿¡ä»¶ |
| | | } else { |
| | | // 寻æ¾complexType |
| | | List<Node> nodeList = getComplexTypeSequenceElement(document, typeName, elementXPath, false); |
| | | if (nodeList.size() != 0) { |
| | | for (Node tempNode : nodeList) { |
| | | // éåelement |
| | | String elementName = DOMUtil.getNodeName(tempNode); |
| | | String sequenceXPath = getSequenceXPathByName(document, typeName, elementXPath, false, |
| | | elementName); |
| | | getInputParams(inputParamList, document, elementName, sequenceXPath, parentParam, true); |
| | | } |
| | | } else { |
| | | log.warn("unknown type " + typeName + ",please check your document"); |
| | | } |
| | | } |
| | | } |
| | | if (canAddParam) { |
| | | if (parentParam == null) { |
| | | inputParamList.add(param); |
| | | } else { |
| | | parentParam.addChild(param); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * è·åelementçxpath |
| | | * |
| | | * @param xPath ç¶ç»ç¹xpath |
| | | * @param typeName åç§° |
| | | * @return |
| | | */ |
| | | private static String getElementXPath(String xPath, String typeName) { |
| | | String elementXPath = xPath + "/*[local-name()='element' and @name='" + typeName + "']"; |
| | | return elementXPath; |
| | | } |
| | | |
| | | /** |
| | | * è·åsimpleTypeç»ç¹ |
| | | * |
| | | * @param document |
| | | * @param simpleTypeName simpleTypeåç§°ï¼å½ä¸ºèªå·±å®ä¹æ¶å¯ä»¥ä¸ºç©º |
| | | * @param elementXPath XPathè·¯å¾ï¼å½éèªå·±å®ä¹æ¶å¯ä»¥ä¸ºç©º |
| | | * @param isSelfDefinition æ¯å¦ä¸ºèªå·±å®ä¹ |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | private static Node getSimpleTypeNode(Document document, String simpleTypeName, String elementXPath, |
| | | boolean isSelfDefinition) throws Exception { |
| | | String simpleTypeXPath = isSelfDefinition |
| | | ? elementXPath + "/*[local-name()='simpleType']/*[local-name()='restriction']" |
| | | : WAIXPathConstant.SCHEMAXPATH + "/*[local-name()='simpleType' and @name='" + simpleTypeName |
| | | + "']/*[local-name()='restriction']"; |
| | | Node node = WADOMUtil.findNode(document, simpleTypeXPath); |
| | | return node; |
| | | } |
| | | |
| | | /** |
| | | * è·åcomplexTypeä¸element |
| | | * |
| | | * @param document |
| | | * @param complexTypeName complexTypeåç§°ï¼å½ä¸ºèªå·±å®ä¹æ¶å¯ä»¥ä¸ºç©º |
| | | * @param elementXPath XPathè·¯å¾ï¼å½éèªå·±å®ä¹æ¶å¯ä»¥ä¸ºç©º |
| | | * @param isSelfDefinition æ¯å¦ä¸ºèªå·±å®ä¹ |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | private static List<Node> getComplexTypeSequenceElement(Document document, String complexTypeName, |
| | | String elementXPath, boolean isSelfDefinition) throws |
| | | Exception { |
| | | List<Node> nodeList = new ArrayList<Node>(); |
| | | // 夿æ¯å¦æç»§æ¿ |
| | | String extensionXpath = isSelfDefinition |
| | | ? elementXPath + "/*[local-name()='complexType']/*[local-name()='complexContent']/*[local-name()" |
| | | + "='extension']" |
| | | : WAIXPathConstant.SCHEMAXPATH + "/*[local-name()='complexType' and @name='" + complexTypeName |
| | | + "']/*[local-name()='complexContent']/*[local-name()='extension']"; |
| | | Node extension = WADOMUtil.findNode(document, extensionXpath); |
| | | if (extension != null) { |
| | | // åå¨ç»§æ¿ |
| | | // æ·»å ç¶ç±» |
| | | String parentTypeName = DOMUtil.getAttributeValue(extension, "base").split(":")[1]; |
| | | List<Node> parentElements = getComplexTypeSequenceElement(document, parentTypeName, elementXPath, false); |
| | | if (parentElements != null && parentElements.size() > 0) { |
| | | nodeList.addAll(parentElements); |
| | | } |
| | | // æ¥æ¾èªå·± |
| | | String selfXpath = extensionXpath + "/*[local-name()='sequence']/*[local-name()" + "='element']"; |
| | | NodeList selfList = WADOMUtil.findNodeList(document, selfXpath); |
| | | if (selfList != null && selfList.getLength() > 0) { |
| | | nodeList.addAll(DOMUtil.covertNodeListToList(selfList)); |
| | | } |
| | | } else { |
| | | // æ¥æ¾èªå·±ç屿§ |
| | | String elementsOfSequenceXpath = isSelfDefinition |
| | | ? elementXPath + "/*[local-name()='complexType']/*[local-name()='sequence']/*[local-name()" |
| | | + "='element']" |
| | | : WAIXPathConstant.SCHEMAXPATH + "/*[local-name()='complexType' and @name='" + complexTypeName |
| | | + "']/*[local-name()='sequence']/*[local-name()='element']"; |
| | | NodeList elementsOfSequence = WADOMUtil.findNodeList(document, elementsOfSequenceXpath); |
| | | nodeList = DOMUtil.covertNodeListToList(elementsOfSequence); |
| | | } |
| | | return nodeList; |
| | | } |
| | | |
| | | /** |
| | | * è·åcomplexTypeä¸elementä¸ä¸çº§sequenceçxpath |
| | | * |
| | | * @param document |
| | | * @param complexTypeName complexTypeåç§°ï¼å½ä¸ºèªå·±å®ä¹æ¶å¯ä»¥ä¸ºç©º |
| | | * @param elementXPath XPathè·¯å¾ï¼å½éèªå·±å®ä¹æ¶å¯ä»¥ä¸ºç©º |
| | | * @param isSelfDefinition æ¯å¦ä¸ºèªå·±å®ä¹ |
| | | * @param elementName ç»ç¹åç§° |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | private static String getSequenceXPathByName(Document document, String complexTypeName, String elementXPath, |
| | | boolean isSelfDefinition, String elementName) throws Exception { |
| | | String result = ""; |
| | | // 夿æ¯å¦æç»§æ¿ |
| | | String extensionXpath = isSelfDefinition |
| | | ? elementXPath + "/*[local-name()='complexType']/*[local-name()='complexContent']/*[local-name()" |
| | | + "='extension']" |
| | | : WAIXPathConstant.SCHEMAXPATH + "/*[local-name()='complexType' and @name='" + complexTypeName |
| | | + "']/*[local-name()='complexContent']/*[local-name()='extension']"; |
| | | Node extension = WADOMUtil.findNode(document, extensionXpath); |
| | | if (extension != null) { |
| | | // åå¨ç»§æ¿ |
| | | // å¨ç¶ç±»æ¥æ¾ |
| | | String parentTypeName = DOMUtil.getAttributeValue(extension, "base").split(":")[1]; |
| | | result = getSequenceXPathByName(document, parentTypeName, elementXPath, false, elementName); |
| | | |
| | | // å¨èªå·±æ¥æ¾ |
| | | String sequenceXPath = extensionXpath + "/*[local-name()='sequence']"; |
| | | String eleXPath = sequenceXPath + "/*[local-name()='element' and @name='" + elementName + "']"; |
| | | Node selfNode = WADOMUtil.findNode(document, eleXPath); |
| | | if (selfNode != null) { |
| | | result = sequenceXPath; |
| | | } |
| | | } else { |
| | | // å¨èªå·±æ¥æ¾ |
| | | String sequenceXPath = isSelfDefinition |
| | | ? elementXPath + "/*[local-name()='complexType']/*[local-name()='sequence']" |
| | | : WAIXPathConstant.SCHEMAXPATH + "/*[local-name()='complexType' and @name='" + complexTypeName |
| | | + "']/*[local-name()='sequence']"; |
| | | String eleXpath = sequenceXPath + "/*[local-name()='element' and @name='" + elementName + "']"; |
| | | Node selfNode = WADOMUtil.findNode(document, eleXpath); |
| | | if (selfNode != null) { |
| | | result = sequenceXPath; |
| | | } |
| | | } |
| | | return result; |
| | | } |
| | | |
| | | /** |
| | | * å¨document䏿¥æ¾ç»ç¹ï¼å¦ææ¥æ¾ä¸å°ï¼åè¿å
¥importç»ç¹ä¸é彿¥æ¾ |
| | | * |
| | | * @param document |
| | | * @param xpathStr |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | public static Node findNode(Document document, String xpathStr) throws Exception { |
| | | XPath xpath = WAWsdlUtil.getXPath(); |
| | | Node node = (Node) xpath.evaluate(xpathStr, document, XPathConstants.NODE); |
| | | if (node == null) { |
| | | List<Document> importDocumentList = WAWsdlUtil.getImportDocumentList(document, xpath); |
| | | for (Document importDoucment : importDocumentList) { |
| | | node = findNode(importDoucment, xpathStr); |
| | | if (node != null) { |
| | | return node; |
| | | } |
| | | } |
| | | } |
| | | return node; |
| | | } |
| | | |
| | | /** |
| | | * å¨document䏿¥æ¾ç»ç¹ï¼å¦ææ¥æ¾ä¸å°ï¼åè¿å
¥importç»ç¹ä¸é彿¥æ¾ |
| | | * |
| | | * @param document |
| | | * @param xpathStr |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | public static NodeList findNodeList(Document document, String xpathStr) throws Exception { |
| | | XPath xpath = WAWsdlUtil.getXPath(); |
| | | NodeList nodeList = (NodeList) xpath.evaluate(xpathStr, document, XPathConstants.NODESET); |
| | | if (nodeList.getLength() == 0) { |
| | | List<Document> importDocumentList = WAWsdlUtil.getImportDocumentList(document, xpath); |
| | | for (Document importDoucment : importDocumentList) { |
| | | nodeList = findNodeList(importDoucment, xpathStr); |
| | | if (nodeList.getLength() > 0) { |
| | | return nodeList; |
| | | } |
| | | } |
| | | } |
| | | return nodeList; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.landtool.lanbase.common.utils; |
| | | |
| | | import javax.xml.XMLConstants; |
| | | |
| | | /** |
| | | * æ¾ç½®å¯¹åºå
容çXPathåå
¶ä»å¸¸é æä¹æ¯éäºï¼importä¸çxsdæä»¶åªæåå
¥äºå½å空é´ï¼ä½å°±æ¯ä¸è§£æï¼å¿«è¦æ°ç¸äºï¼æä¸æç½®å½å空é´é®é¢ |
| | | * |
| | | * @author wangleai |
| | | */ |
| | | public class WAIXPathConstant { |
| | | /** |
| | | * é»è®¤çvalueå¼ï¼è¡¨ç¤ºéè¦å¡«å
¥å
容 |
| | | */ |
| | | public static String VALUEDEF = "?"; |
| | | |
| | | /*--------------------------------------------------------åéæ¶æ¯--------------------------------------------------------------*/ |
| | | /*-------------------------------------------------------å
å«å½å空é´------------------------------------------------------------*/ |
| | | /** |
| | | * é»è®¤çwsdlå½åç©ºé´ |
| | | */ |
| | | public static String DEFAULTWSDLNS = "http://schemas.xmlsoap.org/wsdl/"; |
| | | |
| | | /** |
| | | * binding对åºçä¼ è¾uriï¼soap1.1 |
| | | */ |
| | | public static String SOAPBINDING11 = "http://schemas.xmlsoap.org/wsdl/soap/"; |
| | | |
| | | /** |
| | | * binding对åºçä¼ è¾uriï¼soap1.2 |
| | | */ |
| | | public static String SOAPBINDING12 = "http://schemas.xmlsoap.org/wsdl/soap12/"; |
| | | |
| | | /** |
| | | * é»è®¤çxml schemaå½åç©ºé´ |
| | | */ |
| | | public static String DEFAULTSCHEMANS = XMLConstants.W3C_XML_SCHEMA_NS_URI; |
| | | |
| | | /** |
| | | * definitions xpath |
| | | */ |
| | | public static String DEFXPATHNS = "//*[namespace-uri()='" + DEFAULTWSDLNS + "' and local-name()='definitions']"; |
| | | |
| | | /** |
| | | * types xpath |
| | | */ |
| | | public static String TYPESXPATHNS = DEFXPATHNS + "/*[namespace-uri()='" + DEFAULTWSDLNS |
| | | + "' and local-name()='types']"; |
| | | |
| | | /** |
| | | * wsdl import xpath |
| | | */ |
| | | public static String IMPORTXPATHNS = DEFXPATHNS + "/*[namespace-uri()='" + DEFAULTWSDLNS |
| | | + "' and local-name()='import']"; |
| | | |
| | | /** |
| | | * schema xpath |
| | | */ |
| | | public static String SCHEMAXPATHNS = "//*[namespace-uri()='" + DEFAULTSCHEMANS + "' and local-name()='schema']"; |
| | | |
| | | /** |
| | | * schema import xpath |
| | | */ |
| | | public static String SCHEMAIMPORTPATHNS = SCHEMAXPATHNS + "/*[namespace-uri()='" + DEFAULTSCHEMANS |
| | | + "' and local-name()='import']"; |
| | | |
| | | /*-------------------------------------------------------ä¸å«å½å空é´------------------------------------------------------------*/ |
| | | /** |
| | | * definitions xpath |
| | | */ |
| | | public static String DEFXPATH = "//*[local-name()='definitions']"; |
| | | |
| | | /** |
| | | * types xpath |
| | | */ |
| | | public static String TYPESXPATH = DEFXPATH + "/*[local-name()='types']"; |
| | | |
| | | /** |
| | | * wsdl import xpath |
| | | */ |
| | | public static String IMPORTXPATH = DEFXPATH + "/*[local-name()='import']"; |
| | | |
| | | /** |
| | | * schema xpath |
| | | */ |
| | | public static String SCHEMAXPATH = "//*[local-name()='schema']"; |
| | | |
| | | /** |
| | | * schema import xpath |
| | | */ |
| | | public static String SCHEMAIMPORTPATH = SCHEMAXPATH + "/*[local-name()='import']"; |
| | | |
| | | /*--------------------------------------------------------æ¥æ¶æ¶æ¯--------------------------------------------------------------*/ |
| | | /*-------------------------------------------------------å
å«å½å空é´------------------------------------------------------------*/ |
| | | /** |
| | | * é»è®¤çsoap1.1å½åç©ºé´ |
| | | */ |
| | | public static String SOAP11 = "http://schemas.xmlsoap.org/soap/envelope/"; |
| | | |
| | | /** |
| | | * é»è®¤çsoap1.2å½åç©ºé´ |
| | | */ |
| | | public static String SOAP12 = "http://www.w3.org/2003/05/soap-envelope"; |
| | | |
| | | /** |
| | | * header xpath |
| | | */ |
| | | public static String HEADER11NSXPATH = "//*[namespace-uri()='" + SOAP11 |
| | | + "' and local-name()='Envelope']/*[namespace-uri()='" + SOAP11 + "' and local-name()='Header']"; |
| | | |
| | | /** |
| | | * body xpath |
| | | */ |
| | | public static String BODY11NSXPATH = "//*[namespace-uri()='" + SOAP11 |
| | | + "' and local-name()='Envelope']/*[namespace-uri()='" + SOAP11 + "' and local-name()='Body']"; |
| | | |
| | | /** |
| | | * fault xpath |
| | | */ |
| | | public static String FAULT11NSXPATH = BODY11NSXPATH + "/*[namespace-uri()='" + SOAP11 |
| | | + "' and local-name()='Fault']"; |
| | | |
| | | /** |
| | | * faultcode xpath |
| | | */ |
| | | public static String FAULTCODE11NSXPATH = FAULT11NSXPATH + "/*[namespace-uri()='" + SOAP11 |
| | | + "' and local-name()='faultcode']"; |
| | | |
| | | /** |
| | | * faultstring xpath |
| | | */ |
| | | public static String FAULTSTRING11NSXPATH = FAULT11NSXPATH + "/*[namespace-uri()='" + SOAP11 |
| | | + "' and local-name()='faultstring']"; |
| | | |
| | | /** |
| | | * header xpath |
| | | */ |
| | | public static String HEADER12NSXPATH = "//*[namespace-uri()='" + SOAP12 |
| | | + "' and local-name()='Envelope']/*[namespace-uri()='" + SOAP12 + "' and local-name()='Header']"; |
| | | |
| | | /** |
| | | * body xpath |
| | | */ |
| | | public static String BODY12NSXPATH = "//*[namespace-uri()='" + SOAP12 |
| | | + "' and local-name()='Envelope']/*[namespace-uri()='" + SOAP12 + "' and local-name()='Body']"; |
| | | |
| | | /** |
| | | * fault xpath |
| | | */ |
| | | public static String FAULT12NSXPATH = BODY12NSXPATH + "/*[namespace-uri()='" + SOAP12 |
| | | + "' and local-name()='Fault']"; |
| | | |
| | | /** |
| | | * faultcode xpath |
| | | */ |
| | | public static String FAULTCODE12NSXPATH = FAULT12NSXPATH + "/*[namespace-uri()='" + SOAP12 |
| | | + "' and local-name()='Code']/*[namespace-uri()='" + SOAP12 + "' and local-name()='Value']"; |
| | | |
| | | /** |
| | | * faultreason xpath |
| | | */ |
| | | public static String FAULTREASON12NSXPATH = FAULT12NSXPATH + "/*[namespace-uri()='" + SOAP12 |
| | | + "' and local-name()='Reason']/*[namespace-uri()='" + SOAP12 + "' and local-name()='Text']"; |
| | | |
| | | /** |
| | | * faultdetail xpath |
| | | */ |
| | | public static String FAULTDETAIL12NSXPATH = FAULT12NSXPATH + "/*[namespace-uri()='" + SOAP12 |
| | | + "' and local-name()='Detail']"; |
| | | |
| | | /*-------------------------------------------------------ä¸å«å½å空é´------------------------------------------------------------*/ |
| | | /** |
| | | * header xpath |
| | | */ |
| | | public static String HEADERXPATH = "//*[local-name()='Envelope']/*[local-name()='Header']"; |
| | | |
| | | /** |
| | | * body xpath |
| | | */ |
| | | public static String BODYXPATH = "//*[local-name()='Envelope']/*[local-name()='Body']"; |
| | | |
| | | /** |
| | | * fault xpath |
| | | */ |
| | | public static String FAULTXPATH = BODYXPATH + "/*[local-name()='Fault']"; |
| | | |
| | | /** |
| | | * faultcode xpath |
| | | */ |
| | | public static String FAULTCODE11XPATH = FAULTXPATH + "/*[local-name()='faultcode']"; |
| | | |
| | | /** |
| | | * faultstring xpath |
| | | */ |
| | | public static String FAULTSTRING11XPATH = FAULTXPATH + "/*[local-name()='faultstring']"; |
| | | |
| | | /** |
| | | * faultcode xpath |
| | | */ |
| | | public static String FAULTCODE12XPATH = FAULTXPATH + "/*[local-name()='Code']/*[local-name()='Value']"; |
| | | |
| | | /** |
| | | * faultreason xpath |
| | | */ |
| | | public static String FAULTREASON12XPATH = FAULTXPATH + "/*[local-name()='Reason']/*[local-name()='Text']"; |
| | | |
| | | /** |
| | | * faultdetail xpath |
| | | */ |
| | | public static String FAULTDETAIL12XPATH = FAULTXPATH + "/*[local-name()='Detail']"; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.landtool.lanbase.common.utils; |
| | | |
| | | import java.io.IOException; |
| | | import java.util.ArrayList; |
| | | import java.util.Iterator; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import javax.wsdl.Binding; |
| | | import javax.wsdl.Definition; |
| | | import javax.wsdl.Import; |
| | | import javax.wsdl.Operation; |
| | | import javax.wsdl.Part; |
| | | import javax.wsdl.Types; |
| | | import javax.wsdl.WSDLException; |
| | | import javax.wsdl.extensions.ExtensibilityElement; |
| | | import javax.wsdl.extensions.schema.Schema; |
| | | import javax.wsdl.factory.WSDLFactory; |
| | | import javax.wsdl.xml.WSDLReader; |
| | | import javax.wsdl.xml.WSDLWriter; |
| | | import javax.xml.parsers.DocumentBuilder; |
| | | import javax.xml.parsers.DocumentBuilderFactory; |
| | | import javax.xml.parsers.ParserConfigurationException; |
| | | import javax.xml.xpath.XPath; |
| | | import javax.xml.xpath.XPathConstants; |
| | | import javax.xml.xpath.XPathExpressionException; |
| | | import javax.xml.xpath.XPathFactory; |
| | | |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.apache.log4j.Logger; |
| | | import org.w3c.dom.Document; |
| | | import org.w3c.dom.Node; |
| | | import org.w3c.dom.NodeList; |
| | | import org.xml.sax.SAXException; |
| | | |
| | | import com.landtool.lanbase.modules.api.utils.DOMUtil; |
| | | import com.landtool.lanbase.modules.res.entity.WebService.ParameterInfo; |
| | | |
| | | |
| | | /** |
| | | * ç¬¬ä¸æ¥ï¼ä½¿ç¨wsdl4jè§£æwsdlï¼wsdlææ¡£ç»ææ¨èåèhttp://blog.csdn.net/wudouguerwxx/article/details/2036821 |
| | | * |
| | | * @author wangleai |
| | | */ |
| | | public class WAWsdlUtil { |
| | | |
| | | private static Logger log = Logger.getLogger(WAWsdlUtil.class); |
| | | |
| | | private static WSDLFactory wsdlFactory; |
| | | private static WSDLReader wsdlReader; |
| | | |
| | | private static DocumentBuilder documentBuilder; |
| | | |
| | | private static XPath xPath; |
| | | |
| | | /** |
| | | * @return |
| | | * @throws WSDLException |
| | | */ |
| | | private static WSDLFactory getWsdlFactory() throws WSDLException { |
| | | if (wsdlFactory == null) { |
| | | wsdlFactory = WSDLFactory.newInstance(); |
| | | } |
| | | return wsdlFactory; |
| | | } |
| | | |
| | | /** |
| | | * @return |
| | | * @throws WSDLException |
| | | */ |
| | | private static WSDLReader getWsdlReader() throws WSDLException { |
| | | if (wsdlReader == null) { |
| | | wsdlReader = getWsdlFactory().newWSDLReader(); |
| | | wsdlReader.setFeature("javax.wsdl.verbose", true); |
| | | wsdlReader.setFeature("javax.wsdl.importDocuments", true); |
| | | } |
| | | return wsdlReader; |
| | | } |
| | | |
| | | /** |
| | | * @return |
| | | * @throws ParserConfigurationException |
| | | */ |
| | | public static DocumentBuilder getDBBuilder() throws ParserConfigurationException { |
| | | if (documentBuilder == null) { |
| | | // å¾å°DOMè§£æå¨çå·¥åå®ä¾ |
| | | DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance(); |
| | | // ä»DOMå·¥åä¸è·å¾DOMè§£æå¨ |
| | | documentBuilder = dbFactory.newDocumentBuilder(); |
| | | } |
| | | return documentBuilder; |
| | | } |
| | | |
| | | /** |
| | | * @param wsdlUrl |
| | | * @return |
| | | * @throws WSDLException |
| | | */ |
| | | public static Document getDefinitionDocument(String wsdlUrl) throws WSDLException { |
| | | // è·åwsdlå®ä¹ |
| | | Definition def = getWsdlReader().readWSDL(wsdlUrl); |
| | | // è½¬ææ¡£æµ |
| | | WSDLWriter writer = getWsdlFactory().newWSDLWriter(); |
| | | Document document = writer.getDocument(def); |
| | | return document; |
| | | } |
| | | |
| | | /** |
| | | * å¾å°documentçæ¥æ¾å·¥å
·xpath,䏿¯æå½åç©ºé´ |
| | | * |
| | | * @return |
| | | */ |
| | | public static XPath getXPath() { |
| | | if (xPath == null) { |
| | | xPath = XPathFactory.newInstance().newXPath(); |
| | | } |
| | | return xPath; |
| | | } |
| | | |
| | | /** |
| | | * å¾å°wsdlææ¡£ä¸æ¹æ³å |
| | | * |
| | | * @param wsdlUrl wsdlå°å |
| | | * @param operationList æ¹æ³éå |
| | | * @throws WSDLException |
| | | */ |
| | | public static void getOperationList(String wsdlUrl, List<String> operationList) throws WSDLException { |
| | | // è·åwsdlå®ä¹ |
| | | Definition def = getWsdlReader().readWSDL(wsdlUrl); |
| | | |
| | | // éåbindings |
| | | Map bindings = def.getBindings(); |
| | | Iterator<Map.Entry> iterator = bindings.entrySet().iterator(); |
| | | while (iterator.hasNext()) { |
| | | Binding binding = (Binding) iterator.next().getValue(); |
| | | if (binding != null) { |
| | | List extEles = binding.getExtensibilityElements(); |
| | | if (extEles != null && extEles.size() > 0) { |
| | | ExtensibilityElement extensibilityElement = (ExtensibilityElement) extEles.get(0); |
| | | if (extensibilityElement != null) { |
| | | String namespaceUri = extensibilityElement.getElementType().getNamespaceURI(); |
| | | // é»è®¤ä½¿ç¨soap1.1çbindingï¼ä¸soapuiè°ç¨ä¸è´ |
| | | if (WAIXPathConstant.SOAPBINDING11.equals(namespaceUri) |
| | | || WAIXPathConstant.SOAPBINDING12.equals(namespaceUri)) { |
| | | List<Operation> operations = binding.getPortType().getOperations(); |
| | | for (Operation operation : operations) { |
| | | operationList.add(operation.getName()); |
| | | } |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®æä½åç§°æ¥è¯¢å
·ä½å¯¹è±¡ æç¹èç¼ï¼wsdl4jä¸åå¨ç´æ¥å¯»æ¾operationçapi |
| | | * |
| | | * @param wsdlUrl |
| | | * @param operationName |
| | | * @return |
| | | * @throws WSDLException |
| | | */ |
| | | public static Operation getOperationByName(String wsdlUrl, String operationName) throws WSDLException { |
| | | Operation targetOp = null; |
| | | // è·åwsdlå®ä¹ |
| | | Definition def = getWsdlReader().readWSDL(wsdlUrl); |
| | | |
| | | // éåbindings |
| | | Map bindings = def.getBindings(); |
| | | Iterator<Map.Entry> iterator = bindings.entrySet().iterator(); |
| | | while (iterator.hasNext()) { |
| | | Binding binding = (Binding) iterator.next().getValue(); |
| | | if (binding != null) { |
| | | List extEles = binding.getExtensibilityElements(); |
| | | if (extEles != null && extEles.size() > 0) { |
| | | ExtensibilityElement extensibilityElement = (ExtensibilityElement) extEles.get(0); |
| | | if (extensibilityElement != null) { |
| | | String namespaceUri = extensibilityElement.getElementType().getNamespaceURI(); |
| | | // é»è®¤ä½¿ç¨soap1.1çbindingï¼ä¸soapuiè°ç¨ä¸è´ |
| | | if (WAIXPathConstant.SOAPBINDING11.equals(namespaceUri)) { |
| | | List<Operation> operations = binding.getPortType().getOperations(); |
| | | for (Operation operation : operations) { |
| | | if (operation.getName().equals(operationName)) { |
| | | targetOp = operation; |
| | | break; |
| | | } |
| | | } |
| | | break; |
| | | } |
| | | if (WAIXPathConstant.SOAPBINDING12.equals(namespaceUri)) { |
| | | List<Operation> operations = binding.getPortType().getOperations(); |
| | | for (Operation operation : operations) { |
| | | if (operation.getName().equals(operationName)) { |
| | | targetOp = operation; |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return targetOp; |
| | | } |
| | | |
| | | /** |
| | | * è·åå¯¹åºæ¹æ³ç详ç»åæ°ååç±»å |
| | | * |
| | | * @param wsdlUrl |
| | | * @param operationName æä½å |
| | | * @return |
| | | * @throws WSDLException |
| | | */ |
| | | public static List<ParameterInfo> getMethodParams(String wsdlUrl, String operationName) throws WSDLException { |
| | | Operation operation = getOperationByName(wsdlUrl, operationName); |
| | | List<ParameterInfo> parameterInfoList = null; |
| | | if (operation == null) { |
| | | log.error("can not find operation " + operationName + " , please check again"); |
| | | throw new RuntimeException("can not find operation " + operationName + " , please check again"); |
| | | } else { |
| | | // è¾å
¥ |
| | | Map inputParts = operation.getInput().getMessage().getParts(); |
| | | parameterInfoList = findParamsByOperation(wsdlUrl, inputParts); |
| | | } |
| | | return parameterInfoList; |
| | | } |
| | | |
| | | /** |
| | | * è·åå¯¹åºæ¹æ³çè¿åç±»å |
| | | * |
| | | * @param wsdlUrl |
| | | * @param operationName æä½å |
| | | * @return |
| | | * @throws WSDLException |
| | | */ |
| | | public static List<ParameterInfo> getMethodReturn(String wsdlUrl, String operationName) throws WSDLException { |
| | | // ææ´å¸æè¿åå¼éå®ä¸ºjson串ï¼ä¼æ¹ä¾¿å¾å¤ |
| | | Operation operation = getOperationByName(wsdlUrl, operationName); |
| | | List<ParameterInfo> parameterInfoList = null; |
| | | if (operation == null) { |
| | | log.error("can not find operation " + operationName + " , please check again"); |
| | | throw new RuntimeException("can not find operation " + operationName + " , please check again"); |
| | | } else { |
| | | // è¾åº |
| | | Map outputParts = operation.getOutput().getMessage().getParts(); |
| | | parameterInfoList = findParamsByOperation(wsdlUrl, outputParts); |
| | | } |
| | | return parameterInfoList; |
| | | } |
| | | |
| | | /** |
| | | * è·åwsdlæ°æ®ç±»åå®ä¹å®¹å¨Typesä¸XML Schemaåç¼ï¼ç¨äºæ¼æ¥å½¢æå®æ´æ ç¾ ç®åä¸éè¦ä½¿ç¨ï¼å 为对XML Schemaå忽ç¥å½åç©ºé´ |
| | | * |
| | | * @param wsdlUrl |
| | | * @return |
| | | * @throws WSDLException |
| | | */ |
| | | @Deprecated |
| | | public static String getSchemaPrefix(String wsdlUrl) throws WSDLException { |
| | | String prefix = ""; |
| | | // è·åwsdlå®ä¹ |
| | | Definition def = getWsdlReader().readWSDL(wsdlUrl); |
| | | |
| | | // è·åTypes XML Schemaææ¡£å®ä¹ |
| | | Types types = def.getTypes(); |
| | | |
| | | // è·åæ ç¾åç¼å®ä¹ |
| | | ExtensibilityElement extensibilityElement = (ExtensibilityElement) types.getExtensibilityElements().get(0); |
| | | Schema schema = (Schema) extensibilityElement; |
| | | prefix = schema.getElement().getPrefix(); |
| | | if (!StringUtils.isBlank(prefix)) { |
| | | // åç¼é空æ¶å å
¥: |
| | | prefix += ":"; |
| | | } else { |
| | | prefix = ""; |
| | | } |
| | | return prefix; |
| | | } |
| | | |
| | | /** |
| | | * æ¥æ¾ææçimportç»ç¹ |
| | | * |
| | | * @param document |
| | | * @param xpath |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | public static List<Document> getImportDocumentList(Document document, XPath xpath) throws Exception { |
| | | List<Document> importDocumentList = new ArrayList<Document>(); |
| | | // æ¥æ¾def䏿æçimport |
| | | NodeList importNodeList = (NodeList) xpath.evaluate(WAIXPathConstant.IMPORTXPATH, document, |
| | | XPathConstants.NODESET); |
| | | if (importNodeList != null) { |
| | | for (int i = 0; i < importNodeList.getLength(); i++) { |
| | | Node importNode = importNodeList.item(i); |
| | | String location = DOMUtil.getAttributeValue(importNode, "location"); |
| | | // æè¦è§£æçxmlææ¡£è¯»å
¥DOMè§£æå¨ |
| | | if (!StringUtils.isBlank(location)) { |
| | | Document importDocument = getDefinitionDocument(location); |
| | | importDocumentList.add(importDocument); |
| | | } |
| | | } |
| | | } |
| | | |
| | | // æ¥æ¾schema䏿æçimport |
| | | NodeList importSchemaNodeList = (NodeList) xpath.evaluate(WAIXPathConstant.SCHEMAIMPORTPATH, document, |
| | | XPathConstants.NODESET); |
| | | if (importSchemaNodeList != null) { |
| | | for (int i = 0; i < importSchemaNodeList.getLength(); i++) { |
| | | Node importNode = importSchemaNodeList.item(i); |
| | | String location = DOMUtil.getAttributeValue(importNode, "schemaLocation"); |
| | | // æè¦è§£æçxmlææ¡£è¯»å
¥DOMè§£æå¨ |
| | | if (!StringUtils.isBlank(location)) { |
| | | Document importDocument = getDBBuilder().parse(location); |
| | | importDocumentList.add(importDocument); |
| | | } |
| | | } |
| | | } |
| | | return importDocumentList; |
| | | } |
| | | |
| | | /** |
| | | * éåimport ç®åä¸ä½¿ç¨ |
| | | * |
| | | * @param definition |
| | | * @param operationList |
| | | * @throws WSDLException |
| | | */ |
| | | private static void findImport(Definition definition, List<String> operationList) throws WSDLException { |
| | | Map imports = definition.getImports(); |
| | | Iterator<Map.Entry> iterator = imports.entrySet().iterator(); |
| | | while (iterator.hasNext()) { |
| | | Import anImport = (Import) iterator.next().getValue(); |
| | | log.info("import nameSpace:" + anImport.getNamespaceURI() + ",location:" + anImport.getLocationURI()); |
| | | // éå½ |
| | | getOperationList(anImport.getLocationURI(), operationList); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * éåpart寻æ¾å¯¹åºæ¹æ³åæ° |
| | | * |
| | | * @param wsdlUrl |
| | | * @param parts |
| | | * @return |
| | | * @throws WSDLException |
| | | */ |
| | | private static List<ParameterInfo> findParamsByOperation(String wsdlUrl, Map parts) throws WSDLException { |
| | | Document document = getDefinitionDocument(wsdlUrl); |
| | | // åæ°list |
| | | List<ParameterInfo> paramsList = new ArrayList<ParameterInfo>(); |
| | | String schemaXPath = WAIXPathConstant.SCHEMAXPATH; |
| | | |
| | | Iterator<Map.Entry> entryIterator = parts.entrySet().iterator(); |
| | | while (entryIterator.hasNext()) { |
| | | Part part = (Part) entryIterator.next().getValue(); |
| | | // RPCæ ·å¼ï¼åtypeï¼æ¤æ¶è¯·æ±å¹¶ésoapåè®®ï¼ä¸ä½¿ç¨ |
| | | if (part.getTypeName() != null) { |
| | | String typeName = part.getTypeName().getLocalPart(); |
| | | } |
| | | // ææ¡£æ ·å¼ï¼åelement |
| | | if (part.getElementName() != null) { |
| | | String typeName = part.getElementName().getLocalPart(); |
| | | try { |
| | | WADOMUtil.getInputParams(paramsList, document, typeName, schemaXPath, null, true); |
| | | } catch (Exception e) { |
| | | log.error(e.getMessage()); |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | } |
| | | return paramsList; |
| | | } |
| | | |
| | | /** |
| | | * æµè¯XPathæ¯å¦åå¨ç»ç¹ï¼ä¸è¬èªç¨ |
| | | * |
| | | * @param wsdlUrl |
| | | * @param path |
| | | * @throws ParserConfigurationException |
| | | * @throws XPathExpressionException |
| | | * @throws IOException |
| | | * @throws SAXException |
| | | * @throws WSDLException |
| | | */ |
| | | @Deprecated |
| | | public static void testXpath(String wsdlUrl, String path) |
| | | throws ParserConfigurationException, XPathExpressionException, IOException, SAXException, WSDLException { |
| | | Document document = getDefinitionDocument(wsdlUrl); |
| | | XPath xpath = XPathFactory.newInstance().newXPath(); |
| | | Node node = (Node) xpath.evaluate(path, document, XPathConstants.NODE); |
| | | if (node != null) { |
| | | System.out.println("ok"); |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.landtool.lanbase.common.utils; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | import javax.wsdl.WSDLException; |
| | | |
| | | import com.landtool.lanbase.modules.res.entity.WebService.ParameterInfo; |
| | | |
| | | public class WEBServiceUtils { |
| | | public static void main(String[] args) throws WSDLException { |
| | | String wsdluri = "http://127.0.0.1:8443/WebService1.asmx?wsdl"; |
| | | List<String> operations = new ArrayList<String>(); |
| | | WAWsdlUtil.getOperationList(wsdluri, operations); |
| | | for (String operationName : operations) { |
| | | System.out.println("-----------------operation----------------"); |
| | | System.out.println(operationName); |
| | | List<ParameterInfo> parameterInfos = WAWsdlUtil.getMethodParams(wsdluri, operationName); |
| | | printParams(parameterInfos, ""); |
| | | } |
| | | } |
| | | |
| | | private static void printParams(List<ParameterInfo> parameterInfos, String parentName) { |
| | | if (parameterInfos != null) { |
| | | for (ParameterInfo parameterInfo : parameterInfos) { |
| | | System.out.println("parentname : " + parentName + " ; name : " + parameterInfo.getName() + " ; type :" + |
| | | " " + parameterInfo.getType() + " ;" + |
| | | " childtype : " + parameterInfo.getChildType()); |
| | | printParams(parameterInfo.getChildren(), parameterInfo.getName()); |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.landtool.lanbase.common.utils.ppt; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author lanbase |
| | | * @Description: TODO(å¾è¡¨ç³»åæ°æ®) |
| | | * @date 2017-11-30 11:07 |
| | | */ |
| | | public class GraphData { |
| | | |
| | | // åé¥¼å¾ |
| | | public static final String GRAPH_PIE = "pie"; |
| | | // æ±ç¶å¾ |
| | | public static final String GRAPH_BAR = "bar"; |
| | | // 线æ§å¾ |
| | | public static final String GRAPH_LINE = "line"; |
| | | // é¢ç§¯å¾ |
| | | public static final String GRAPH_AREA = "area"; |
| | | // é·è¾¾å¾ |
| | | public static final String GRAPH_RADAR = "radar"; |
| | | |
| | | // å¾å½¢æ é¢ |
| | | private String title; |
| | | |
| | | // ç³»åå¼ |
| | | private List<SeriesData> serList; |
| | | |
| | | public GraphData(String title, List<SeriesData> serList) { |
| | | this.title = title; |
| | | this.serList = serList; |
| | | } |
| | | |
| | | public String getTitle() { |
| | | return title; |
| | | } |
| | | |
| | | public void setTitle(String title) { |
| | | this.title = title; |
| | | } |
| | | |
| | | public List<SeriesData> getSerList() { |
| | | return serList; |
| | | } |
| | | |
| | | public void setSerList(List<SeriesData> serList) { |
| | | this.serList = serList; |
| | | } |
| | | |
| | | } |
| | | |
| | | class SeriesData { |
| | | // ç³»ååç§° |
| | | private String serName; |
| | | |
| | | // ç³»åå¼ |
| | | private double serVal; |
| | | |
| | | public SeriesData(String serName, double serVal) { |
| | | this.serName = serName; |
| | | this.serVal = serVal; |
| | | } |
| | | |
| | | public String getSerName() { |
| | | return serName; |
| | | } |
| | | |
| | | public void setSerName(String serName) { |
| | | this.serName = serName; |
| | | } |
| | | |
| | | public double getSerVal() { |
| | | return serVal; |
| | | } |
| | | |
| | | public void setSerVal(double serVal) { |
| | | this.serVal = serVal; |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.landtool.lanbase.common.utils.ppt; |
| | | |
| | | import java.io.FileInputStream; |
| | | import java.io.FileOutputStream; |
| | | import java.io.IOException; |
| | | import java.io.OutputStream; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import org.apache.poi.POIXMLDocumentPart; |
| | | import org.apache.poi.hssf.util.CellReference; |
| | | import org.apache.poi.sl.usermodel.AutoNumberingScheme; |
| | | import org.apache.poi.ss.usermodel.Cell; |
| | | import org.apache.poi.ss.usermodel.Row; |
| | | import org.apache.poi.ss.usermodel.Sheet; |
| | | import org.apache.poi.ss.usermodel.Workbook; |
| | | import org.apache.poi.ss.util.CellRangeAddress; |
| | | import org.apache.poi.xslf.usermodel.XMLSlideShow; |
| | | import org.apache.poi.xslf.usermodel.XSLFChart; |
| | | import org.apache.poi.xslf.usermodel.XSLFShape; |
| | | import org.apache.poi.xslf.usermodel.XSLFTextBox; |
| | | import org.apache.poi.xslf.usermodel.XSLFTextParagraph; |
| | | import org.apache.poi.xslf.usermodel.XSLFTextRun; |
| | | import org.apache.poi.xssf.usermodel.XSSFWorkbook; |
| | | import org.openxmlformats.schemas.drawingml.x2006.chart.CTAreaChart; |
| | | import org.openxmlformats.schemas.drawingml.x2006.chart.CTAreaSer; |
| | | import org.openxmlformats.schemas.drawingml.x2006.chart.CTAxDataSource; |
| | | import org.openxmlformats.schemas.drawingml.x2006.chart.CTBarChart; |
| | | import org.openxmlformats.schemas.drawingml.x2006.chart.CTBarSer; |
| | | import org.openxmlformats.schemas.drawingml.x2006.chart.CTChart; |
| | | import org.openxmlformats.schemas.drawingml.x2006.chart.CTLineChart; |
| | | import org.openxmlformats.schemas.drawingml.x2006.chart.CTLineSer; |
| | | import org.openxmlformats.schemas.drawingml.x2006.chart.CTNumData; |
| | | import org.openxmlformats.schemas.drawingml.x2006.chart.CTNumDataSource; |
| | | import org.openxmlformats.schemas.drawingml.x2006.chart.CTNumVal; |
| | | import org.openxmlformats.schemas.drawingml.x2006.chart.CTPieChart; |
| | | import org.openxmlformats.schemas.drawingml.x2006.chart.CTPieSer; |
| | | import org.openxmlformats.schemas.drawingml.x2006.chart.CTPlotArea; |
| | | import org.openxmlformats.schemas.drawingml.x2006.chart.CTRadarChart; |
| | | import org.openxmlformats.schemas.drawingml.x2006.chart.CTRadarSer; |
| | | import org.openxmlformats.schemas.drawingml.x2006.chart.CTSerTx; |
| | | import org.openxmlformats.schemas.drawingml.x2006.chart.CTStrData; |
| | | import org.openxmlformats.schemas.drawingml.x2006.chart.CTStrVal; |
| | | import org.openxmlformats.schemas.drawingml.x2006.chart.CTUnsignedInt; |
| | | |
| | | /** |
| | | * @author lanbase |
| | | * @Description: TODO(PPTå
Œ
·ç±») |
| | | * @date 2017-11-30 11:09 |
| | | */ |
| | | public class PPTUtils { |
| | | |
| | | public static void main(String[] args) throws Exception { |
| | | /*List<SeriesData> dataList = new ArrayList<SeriesData>(); |
| | | SeriesData seriesData = new SeriesData("ä¼", 10); |
| | | dataList.add(seriesData); |
| | | seriesData = new SeriesData("ä¸", 150); |
| | | dataList.add(seriesData); |
| | | seriesData = new SeriesData("åæ ¼", 80); |
| | | dataList.add(seriesData); |
| | | seriesData = new SeriesData("ä¸åæ ¼", 20); |
| | | dataList.add(seriesData); |
| | | |
| | | GraphData graphData = new GraphData("æç»©æ
åµ", dataList); |
| | | |
| | | Map<Integer, GraphData> graphDatas=new HashMap<>(); |
| | | graphDatas.put(1, graphData); |
| | | |
| | | XMLSlideShow pptx = updatePPTGrapth("D:/t.pptx", graphDatas); |
| | | // ä¿åæä»¶ |
| | | OutputStream out = new FileOutputStream("D:/test.pptx"); |
| | | pptx.write(out); |
| | | out.close(); |
| | | pptx.close();*/ |
| | | |
| | | XMLSlideShow pptx = updatePPTContent("D:/t.pptx"); |
| | | // ä¿åæä»¶ |
| | | OutputStream out = new FileOutputStream("D:/test.pptx"); |
| | | pptx.write(out); |
| | | out.close(); |
| | | pptx.close(); |
| | | |
| | | /*List<SeriesData> dataList = new ArrayList<SeriesData>(); |
| | | SeriesData seriesData = new SeriesData("ä¼", 6.92); |
| | | dataList.add(seriesData); |
| | | seriesData = new SeriesData("ä¸", 5.95); |
| | | dataList.add(seriesData); |
| | | seriesData = new SeriesData("åæ ¼", 7.0); |
| | | dataList.add(seriesData); |
| | | seriesData = new SeriesData("ä¸åæ ¼", 6.1); |
| | | dataList.add(seriesData); |
| | | |
| | | GraphData graphData = new GraphData("æç»©æ
åµ", dataList); |
| | | |
| | | List<SeriesData> dataList1 = new ArrayList<SeriesData>(); |
| | | SeriesData seriesData1 = new SeriesData("ä¼", 6.53); |
| | | dataList1.add(seriesData1); |
| | | seriesData1 = new SeriesData("ä¸", 5.72); |
| | | dataList1.add(seriesData1); |
| | | seriesData1 = new SeriesData("åæ ¼", 7.56); |
| | | dataList1.add(seriesData1); |
| | | seriesData1 = new SeriesData("ä¸åæ ¼", 6.0); |
| | | dataList1.add(seriesData1); |
| | | |
| | | GraphData graphData1 = new GraphData("级æç»©æ
åµ", dataList1); |
| | | |
| | | List<GraphData> graphDataList = new ArrayList<>(); |
| | | graphDataList.add(graphData); |
| | | graphDataList.add(graphData1); |
| | | |
| | | Map<Integer, List<GraphData>> graphDatas=new HashMap<>(); |
| | | graphDatas.put(0, graphDataList); |
| | | |
| | | XMLSlideShow pptx = updatePPTGrapthOfBarAndLine("D:/t.pptx", graphDatas); |
| | | // ä¿åæä»¶ |
| | | OutputStream out = new FileOutputStream("D:/test.pptx"); |
| | | pptx.write(out); |
| | | out.close(); |
| | | pptx.close();*/ |
| | | |
| | | /*List<SeriesData> dataList = new ArrayList<SeriesData>(); |
| | | SeriesData seriesData = new SeriesData("ä¼", 6.92); |
| | | dataList.add(seriesData); |
| | | seriesData = new SeriesData("ä¸", 5.95); |
| | | dataList.add(seriesData); |
| | | seriesData = new SeriesData("åæ ¼", 7.0); |
| | | dataList.add(seriesData); |
| | | seriesData = new SeriesData("ä¸åæ ¼", 6.1); |
| | | dataList.add(seriesData); |
| | | |
| | | GraphData graphData = new GraphData("æç»©æ
åµ", dataList); |
| | | |
| | | List<SeriesData> dataList1 = new ArrayList<SeriesData>(); |
| | | SeriesData seriesData1 = new SeriesData("ä¼", 6.53); |
| | | dataList1.add(seriesData1); |
| | | seriesData1 = new SeriesData("ä¸", 5.72); |
| | | dataList1.add(seriesData1); |
| | | seriesData1 = new SeriesData("åæ ¼", 7.56); |
| | | dataList1.add(seriesData1); |
| | | seriesData1 = new SeriesData("ä¸åæ ¼", 6.0); |
| | | dataList1.add(seriesData1); |
| | | |
| | | GraphData graphData1 = new GraphData("级æç»©æ
åµ", dataList1); |
| | | |
| | | List<GraphData> graphDataList = new ArrayList<>(); |
| | | graphDataList.add(graphData); |
| | | graphDataList.add(graphData1); |
| | | graphDataList.add(graphData); |
| | | graphDataList.add(graphData1); |
| | | graphDataList.add(graphData); |
| | | |
| | | Map<Integer, List<GraphData>> graphDatas=new HashMap<>(); |
| | | graphDatas.put(0, graphDataList); |
| | | |
| | | XMLSlideShow pptx = updatePPTGrapth("D:/t.pptx", graphDatas); |
| | | // ä¿åæä»¶ |
| | | OutputStream out = new FileOutputStream("D:/test.pptx"); |
| | | pptx.write(out); |
| | | out.close(); |
| | | pptx.close();*/ |
| | | |
| | | /*List<SeriesData> dataList = new ArrayList<SeriesData>(); |
| | | SeriesData seriesData = new SeriesData("ä¼", 6.92); |
| | | dataList.add(seriesData); |
| | | seriesData = new SeriesData("ä¸", 5.95); |
| | | dataList.add(seriesData); |
| | | seriesData = new SeriesData("åæ ¼", 7.0); |
| | | dataList.add(seriesData); |
| | | seriesData = new SeriesData("ä¸åæ ¼", 6.1); |
| | | dataList.add(seriesData); |
| | | |
| | | GraphData graphData = new GraphData("æç»©æ
åµ", dataList); |
| | | |
| | | List<SeriesData> dataList1 = new ArrayList<SeriesData>(); |
| | | SeriesData seriesData1 = new SeriesData("ä¼", 6.53); |
| | | dataList1.add(seriesData1); |
| | | seriesData1 = new SeriesData("ä¸", 5.72); |
| | | dataList1.add(seriesData1); |
| | | seriesData1 = new SeriesData("åæ ¼", 7.56); |
| | | dataList1.add(seriesData1); |
| | | seriesData1 = new SeriesData("ä¸åæ ¼", 6.0); |
| | | dataList1.add(seriesData1); |
| | | |
| | | GraphData graphData1 = new GraphData("级æç»©æ
åµ", dataList1); |
| | | |
| | | List<GraphData> graphDataList = new ArrayList<>(); |
| | | graphDataList.add(graphData); |
| | | graphDataList.add(graphData1); |
| | | graphDataList.add(graphData); |
| | | |
| | | List<GraphData> graphDataList1 = new ArrayList<>(); |
| | | graphDataList1.add(graphData1); |
| | | graphDataList1.add(graphData); |
| | | |
| | | Map<Integer, List<GraphData>> graphDatas=new HashMap<>(); |
| | | graphDatas.put(0, graphDataList); |
| | | graphDatas.put(1, graphDataList1); |
| | | |
| | | Map<Integer, Map<Integer, List<GraphData>>> gds=new HashMap<>(); |
| | | gds.put(0, graphDatas); |
| | | |
| | | XMLSlideShow pptx = updatePPTGrapthOfBarAndLine("D:/t.pptx", gds); |
| | | // ä¿åæä»¶ |
| | | OutputStream out = new FileOutputStream("D:/test.pptx"); |
| | | pptx.write(out); |
| | | out.close(); |
| | | pptx.close();*/ |
| | | |
| | | } |
| | | |
| | | /** |
| | | * æ´æ°pptçå
容 |
| | | * @param templateFilePath æ¨¡æ¿æä»¶çè·¯å¾ |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | public static XMLSlideShow updatePPTContent(String templateFilePath) throws Exception { |
| | | // æå¼æ¨¡æ¿ppt |
| | | XMLSlideShow pptx = new XMLSlideShow(new FileInputStream(templateFilePath)); |
| | | if (pptx.getSlides() != null && pptx.getSlides().size() > 0) { |
| | | // é忝ä¸é¡µ |
| | | for (int i = 0;i < pptx.getSlides().size();i++) { |
| | | for (XSLFShape shape : pptx.getSlides().get(i).getShapes()) { |
| | | //System.out.println(i+": "+shape); |
| | | /*if(shape instanceof XSLFTable){ |
| | | XSLFTable xslfTable = (XSLFTable) shape; |
| | | //System.out.println(xslfTable.getShapeName()); |
| | | if("è¡¨æ ¼ 2".equals(xslfTable.getShapeName())){ |
| | | Object[][] datas = {{"éå°å§" , "15817048601", "女", "23"}, {"éå°å§" , "15817048603", "女", "24"}, {"éå
ç", "15817048602", "ç·", "28"}}; |
| | | for(int j = 0; j < datas.length; j++){ |
| | | XSLFTableRow tableRow = xslfTable.addRow(); |
| | | for(int k = 0; k < datas[j].length; k++){ |
| | | XSLFTableCell tableCell = tableRow.addCell();//åå»ºè¡¨æ ¼åå
æ ¼ |
| | | XSLFTextParagraph p = tableCell.addNewTextParagraph(); |
| | | XSLFTextRun tr = p.addNewTextRun(); |
| | | tr.setText(String.valueOf(datas[j][k])); |
| | | tr.setFontSize(12D); |
| | | tr.setFontFamily("å®ä½"); |
| | | } |
| | | } |
| | | // åå¹¶åå
æ ¼ |
| | | //xslfTable.mergeCells(1, 2, 0, 0); |
| | | } |
| | | *//*for(XSLFTableCell cell : xslfTable.getRows().get(1).getCells()){ |
| | | |
| | | }*//* |
| | | }*/ |
| | | if (shape instanceof XSLFTextBox) { |
| | | XSLFTextBox textBox= (XSLFTextBox) shape; |
| | | //System.out.println(textBox.getText()); |
| | | if (textBox.getText().contains("{title}")) { |
| | | textBox.clearText(); |
| | | //textBox.setFillColor(Color.LIGHT_GRAY); |
| | | XSLFTextParagraph paragraph=textBox.addNewTextParagraph(); |
| | | XSLFTextRun run=paragraph.addNewTextRun(); |
| | | run.setText("大è¡éçåå"); |
| | | run.setBold(true);// å ç² |
| | | run.setFontSize(14D); |
| | | run.setFontFamily("å®ä½"); |
| | | |
| | | } else if (textBox.getText().contains("{name}")) { |
| | | textBox.setText(textBox.getText().replace("{name}", "ä½å
ç")); |
| | | for (XSLFTextParagraph paragraph : textBox.getTextParagraphs()) { |
| | | for (XSLFTextRun run : paragraph.getTextRuns()) { |
| | | run.setFontSize(14D); |
| | | run.setFontFamily("å®ä½"); |
| | | } |
| | | } |
| | | } else if (textBox.getText().contains("{date}")) { |
| | | textBox.setText(textBox.getText().replace("{date}", "2017.12.01")); |
| | | for (XSLFTextParagraph paragraph : textBox.getTextParagraphs()) { |
| | | for (XSLFTextRun run : paragraph.getTextRuns()) { |
| | | run.setFontSize(12D); |
| | | run.setFontFamily("å®ä½"); |
| | | } |
| | | } |
| | | } else if (textBox.getText().contains("{test}")) { |
| | | /*String str="åå°è¡æ¯çº½çº¦å¸æ¼åé¡¿åºåé¨ä»ç¾èæ±è·¯å»¶ä¼¸å°ä¸æ²³ç䏿¡å¤§è¡éçååãå¨å²å®è·µï¼åå¥½èµæºé
ç½®ï¼åè°é¡¹ç®å¹³ç¨³è¿è¡ï¼å®æä¸é¡¹ç®æ¶åäººåæ²éï¼äºè§£å工工ä½è¿åº¦åéç¢ï¼ç¡®ä¿é¡¹ç®é«æè¿è¡ï¼å®æåé¡¾é¡¹ç®æ¨å¨æ
åµï¼ä¿è¯é¡¹ç®é«æè½å°ï¼æ¾å°æªæ¥æåæ¹åã"; |
| | | str+="\r\nâåå°è¡âä¸è¯ç°å·²è¶
è¶è¿æ¡è¡éæ¬èº«ï¼æä¸ºéè¿åºåç代称ï¼äº¦å¯æå¯¹æ´ä¸ªç¾å½ç»æµå
·æå½±ååçéèå¸åºåéèæºæã"; |
| | | str+="\r\næ¯æ¬¡åã"; |
| | | textBox.setText(textBox.getText().replace("{test}", str));*/ |
| | | //System.out.println(textBox.getTextParagraphs().size()); |
| | | /*for (XSLFTextParagraph paragraph : textBox.getTextParagraphs()) { |
| | | //System.out.println("SpaceBefore:"+paragraph.getSpaceBefore()); |
| | | //System.out.println("SpaceAfter:"+paragraph.getSpaceAfter()); |
| | | //System.out.println("LineSpacing"+paragraph.getLineSpacing()); |
| | | //paragraph.setIndentLevel(1); |
| | | //paragraph.setBullet(true); |
| | | //System.out.println(paragraph.getTextRuns().size()); |
| | | System.out.println(paragraph.getIndent()); |
| | | for (XSLFTextRun run : paragraph.getTextRuns()) { |
| | | //run.setFontSize(14.0); |
| | | //run.setFontFamily("å®ä½"); |
| | | //System.out.println("CharacterSpacing:"+run.getCharacterSpacing()); |
| | | } |
| | | }*/ |
| | | textBox.clearText(); |
| | | XSLFTextParagraph paragraph=textBox.addNewTextParagraph(); |
| | | //paragraph.setBullet(true); |
| | | paragraph.setBulletAutoNumber(AutoNumberingScheme.arabicPeriod, 1); |
| | | paragraph.setIndent(-18.0); |
| | | paragraph.setLeftMargin(18.0); |
| | | paragraph.setLineSpacing(150.0);//è¡è· |
| | | //System.out.println(paragraph.getBulletStyle().getAutoNumberingScheme()); |
| | | XSLFTextRun run=paragraph.addNewTextRun(); |
| | | run.setText("åå°è¡æ¯çº½çº¦å¸æ¼åé¡¿åºåé¨ä»ç¾èæ±è·¯å»¶ä¼¸å°ä¸æ²³ç䏿¡å¤§è¡éçååãå¨å²å®è·µï¼åå¥½èµæºé
ç½®ï¼åè°é¡¹ç®å¹³ç¨³è¿è¡ï¼å®æä¸é¡¹ç®æ¶åäººåæ²éï¼äºè§£å工工ä½è¿åº¦åéç¢ï¼ç¡®ä¿é¡¹ç®é«æè¿è¡ï¼å®æåé¡¾é¡¹ç®æ¨å¨æ
åµï¼ä¿è¯é¡¹ç®é«æè½å°ï¼æ¾å°æªæ¥æåæ¹åã"); |
| | | run.setFontSize(12D); |
| | | run.setFontFamily("å®ä½"); |
| | | paragraph=textBox.addNewTextParagraph(); |
| | | //paragraph.setBullet(true); |
| | | paragraph.setBulletAutoNumber(AutoNumberingScheme.arabicPeriod, 1); |
| | | paragraph.setIndent(-18.0); |
| | | paragraph.setLeftMargin(18.0); |
| | | paragraph.setLineSpacing(150.0);//è¡è· |
| | | run=paragraph.addNewTextRun(); |
| | | run.setText("âåå°è¡âä¸è¯ç°å·²è¶
è¶è¿æ¡è¡éæ¬èº«ï¼æä¸ºéè¿åºåç代称ï¼äº¦å¯æå¯¹æ´ä¸ªç¾å½ç»æµå
·æå½±ååçéèå¸åºåéèæºæã"); |
| | | run.setFontSize(12D); |
| | | run.setFontFamily("å®ä½"); |
| | | } |
| | | } |
| | | /*if (shape instanceof XSLFTextShape) { |
| | | XSLFTextShape txShape = (XSLFTextShape) shape; |
| | | System.out.println("XSLFTextShape: "+txShape.getText()); |
| | | if (txShape.getText().contains("{name}")) { |
| | | txShape.setText(txShape.getText().replace("{name}", "ä½å
ç")); |
| | | } else if (txShape.getText().contains("{date}")) { |
| | | //txShape.setText(txShape.getText().replace("{date}", "2017.12.01")); |
| | | for (XSLFTextParagraph paragraph : txShape.getTextParagraphs()) { |
| | | for (XSLFTextRun run : paragraph.getTextRuns()) { |
| | | System.out.println(run.getRawText()); |
| | | } |
| | | } |
| | | } else if (txShape.getText().contains("{test}")) { |
| | | //String str="åå°è¡æ¯çº½çº¦å¸æ¼åé¡¿åºåé¨ä»ç¾èæ±è·¯å»¶ä¼¸å°ä¸æ²³ç䏿¡å¤§è¡éçååãå¨å²å®è·µï¼åå¥½èµæºé
ç½®ï¼åè°é¡¹ç®å¹³ç¨³è¿è¡ï¼å®æä¸é¡¹ç®æ¶åäººåæ²éï¼äºè§£å工工ä½è¿ 度åéç¢ï¼ç¡®ä¿é¡¹ç®é«æè¿è¡ï¼å®æåé¡¾é¡¹ç®æ¨å¨æ
åµï¼ä¿è¯é¡¹ç®é«æè½å°ï¼æ¾å°æªæ¥æåæ¹åã"; |
| | | //String str1="âåå°è¡âä¸è¯ç°å·²è¶
è¶è¿æ¡è¡éæ¬èº«ï¼æä¸ºéè¿åºåç代称ï¼äº¦å¯æå¯¹æ´ä¸ªç¾å½ç»æµå
·æå½±ååçéèå¸åºåéèæºæã"; |
| | | //String str2="æ¯æ¬¡åã"; |
| | | //txShape.setText(txShape.getText().replace("{test}", str2)); |
| | | //txShape.appendText(str, false); |
| | | //txShape.appendText(str1, false); |
| | | //txShape.setText(txShape.getText().replace("{test}", "")); |
| | | txShape.clearText(); |
| | | XSLFTextParagraph paragraph=txShape.addNewTextParagraph(); |
| | | XSLFTextRun run=paragraph.addNewTextRun(); |
| | | run.setText("åå°è¡æ¯çº½çº¦å¸æ¼åé¡¿åºåé¨ä»ç¾èæ±è·¯å»¶ä¼¸å°ä¸æ²³ç䏿¡å¤§è¡éçååãå¨å²å®è·µï¼åå¥½èµæºé
ç½®ï¼åè°é¡¹ç®å¹³ç¨³è¿è¡ï¼å®æä¸é¡¹ç®æ¶åäººåæ²éï¼äºè§£å工工ä½è¿åº¦åéç¢ï¼ç¡®ä¿é¡¹ç®é«æè¿è¡ï¼å®æåé¡¾é¡¹ç®æ¨å¨æ
åµï¼ä¿è¯é¡¹ç®é«æè½å°ï¼æ¾å°æªæ¥æåæ¹åã"); |
| | | run.setFontSize(12D); |
| | | run.setFontFamily("å®ä½"); |
| | | run.setFontColor(Color.BLUE); |
| | | paragraph=txShape.addNewTextParagraph(); |
| | | run=paragraph.addNewTextRun(); |
| | | run.setText("âåå°è¡âä¸è¯ç°å·²è¶
è¶è¿æ¡è¡éæ¬èº«ï¼æä¸ºéè¿åºåç代称ï¼äº¦å¯æå¯¹æ´ä¸ªç¾å½ç»æµå
·æå½±ååçéèå¸åºåéèæºæã"); |
| | | run.setFontSize(12D); |
| | | run.setFontFamily("å®ä½"); |
| | | run.setFontColor(Color.RED); |
| | | //txShape.setAnchor(new java.awt.Rectangle(50, 150, 400, 400)); |
| | | txShape.resizeToFitText(); |
| | | } else if (txShape.getText().contains("{test1}")) { |
| | | txShape.setText(txShape.getText().replace("{test1}", "è¯ä»·æ å")); |
| | | } |
| | | }*/ |
| | | /*if (shape instanceof XSLFGroupShape) { |
| | | XSLFGroupShape grShape = (XSLFGroupShape) shape; |
| | | System.out.println("XSLFGroupShape: "+grShape.getShapes()); |
| | | for(XSLFShape s : grShape.getShapes()){ |
| | | if (s instanceof XSLFTextShape) { |
| | | XSLFTextShape txShape = (XSLFTextShape) s; |
| | | System.out.println("XSLFGroupShape XSLFTextShape: "+txShape.getText()); |
| | | } |
| | | if (s instanceof XSLFAutoShape) { |
| | | XSLFAutoShape atShape = (XSLFAutoShape) s; |
| | | System.out.println("XSLFGroupShape XSLFAutoShape: "+atShape.getText()); |
| | | } |
| | | } |
| | | }*/ |
| | | /*if (shape instanceof XSLFAutoShape) { |
| | | XSLFAutoShape atShape = (XSLFAutoShape) shape; |
| | | System.out.println("XSLFAutoShape: "+atShape.getText()); |
| | | }*/ |
| | | } |
| | | } |
| | | } |
| | | return pptx; |
| | | } |
| | | |
| | | /** |
| | | * æ´æ°pptçå¾è¡¨ |
| | | * @param templateFilePath æ¨¡æ¿æä»¶çè·¯å¾ |
| | | * @param graphDatas å¾è¡¨æ°æ®mapï¼mapçkey为pptç页ç 䏿 |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | public static XMLSlideShow updatePPTGrapth(String templateFilePath, Map<Integer, List<GraphData>> graphDatas) throws Exception { |
| | | // æå¼æ¨¡æ¿ppt |
| | | XMLSlideShow pptx = new XMLSlideShow(new FileInputStream(templateFilePath)); |
| | | if (pptx.getSlides() != null && pptx.getSlides().size() > 0) { |
| | | // é忝ä¸é¡µ |
| | | for (int i = 0;i < pptx.getSlides().size();i++) { |
| | | for (POIXMLDocumentPart part : pptx.getSlides().get(i).getRelations()) { |
| | | if (part instanceof XSLFChart) { |
| | | if (graphDatas != null && graphDatas.get(i) != null) { |
| | | updateGraph((XSLFChart) part, graphDatas.get(i)); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return pptx; |
| | | } |
| | | |
| | | /** |
| | | * æ´æ°pptçæ±ç¶å¾å线æ§å¾çç»åå¾è¡¨ |
| | | * @param templateFilePath |
| | | * @param graphDatas |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | public static XMLSlideShow updatePPTGrapthOfBarAndLine(String templateFilePath, Map<Integer, Map<Integer, List<GraphData>>> graphDatas) throws Exception { |
| | | // æå¼æ¨¡æ¿ppt |
| | | XMLSlideShow pptx = new XMLSlideShow(new FileInputStream(templateFilePath)); |
| | | if (pptx.getSlides() != null && pptx.getSlides().size() > 0) { |
| | | // é忝ä¸é¡µ |
| | | for (int i = 0;i < pptx.getSlides().size();i++) { |
| | | for (POIXMLDocumentPart part : pptx.getSlides().get(i).getRelations()) { |
| | | if (part instanceof XSLFChart) { |
| | | if (graphDatas != null && graphDatas.get(i) != null) { |
| | | updateBarAndLineGraph((XSLFChart) part, graphDatas.get(i)); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return pptx; |
| | | } |
| | | |
| | | /** |
| | | * æ´æ°æ±ç¶å¾å线æ§å¾çç»åå¾è¡¨æ°æ® |
| | | * @param chart |
| | | * @param graphDatas æ±ç¶å¾å线æ§å¾çgraphDataListçmap mapç䏿 0为æ±ç¶å¾çgraphDataListï¼1为线æ§å¾ç |
| | | * @return |
| | | */ |
| | | private static boolean updateBarAndLineGraph(XSLFChart chart, Map<Integer, List<GraphData>> graphDatas) { |
| | | boolean result = true; |
| | | |
| | | if (graphDatas.isEmpty()) { |
| | | return false; |
| | | } |
| | | |
| | | if (graphDatas.size() > 3) { |
| | | return false; |
| | | } |
| | | |
| | | // æå¾è¡¨ç»å®å°Excel workbookä¸ |
| | | try { |
| | | Workbook wb = new XSSFWorkbook(); |
| | | Sheet sheet = wb.createSheet(); |
| | | CTChart ctChart = chart.getCTChart(); |
| | | CTPlotArea plotArea = ctChart.getPlotArea(); |
| | | Row row = null; |
| | | for (Integer i : graphDatas.keySet()) { |
| | | if (graphDatas.get(i).isEmpty()) { |
| | | return false; |
| | | } |
| | | |
| | | if (0 == i) { |
| | | // æ±ç¶å¾ |
| | | CTBarChart tempChart = plotArea.getBarChartArray(0); |
| | | CTBarSer ser = null; |
| | | CTSerTx tx = null; |
| | | for (int j = 0; j < graphDatas.get(i).size(); j++) { |
| | | if (graphDatas.get(i).get(j) == null) { |
| | | return false; |
| | | } |
| | | |
| | | // è·åå¾è¡¨çç³»å |
| | | if (tempChart.getSerArray().length <= j) { |
| | | // æ°å¢ |
| | | ser = tempChart.addNewSer(); |
| | | ser.addNewIdx().setVal(j); |
| | | ser.addNewOrder().setVal(j); |
| | | ser.addNewTx().addNewStrRef().addNewStrCache().addNewPt().setIdx(0); |
| | | ser.addNewCat().addNewStrRef().addNewStrCache().addNewPtCount(); |
| | | ser.addNewVal().addNewNumRef().addNewNumCache().addNewPtCount(); |
| | | } else { |
| | | ser = tempChart.getSerArray(j); |
| | | } |
| | | |
| | | tx = ser.getTx(); |
| | | tx.getStrRef().getStrCache().getPtArray(0).setV(graphDatas.get(i).get(j).getTitle()); |
| | | row = sheet.getRow(0); |
| | | if (row == null) { |
| | | row = sheet.createRow(0); |
| | | } |
| | | row.createCell(j+1).setCellValue(graphDatas.get(i).get(j).getTitle()); |
| | | String titleRef = new CellReference(sheet.getSheetName(), 0, j+1, true, true).formatAsString(); |
| | | tx.getStrRef().setF(titleRef); |
| | | |
| | | // è·åå¾è¡¨ç³»åçåç§° |
| | | CTAxDataSource cat = ser.getCat(); |
| | | // è·åå¾è¡¨ç³»åçå¼ |
| | | CTNumDataSource val = ser.getVal(); |
| | | updateGraphContent(sheet, cat, val, graphDatas.get(i).get(j), j+1, false); |
| | | } |
| | | } else if (1==i) { |
| | | // 线æ§å¾ |
| | | CTLineChart tempChart = null; |
| | | if (plotArea.getLineChartArray().length > 0) { |
| | | tempChart = plotArea.getLineChartArray(0); |
| | | } else { |
| | | tempChart = plotArea.addNewLineChart(); |
| | | /*tempChart.addNewGrouping().setVal(STGrouping.Enum.forString("standard")); |
| | | tempChart.addNewVaryColors().setVal(false); |
| | | CTDLbls ctdLbls = tempChart.addNewDLbls(); |
| | | ctdLbls.addNewShowLegendKey().setVal(false); |
| | | ctdLbls.addNewShowVal().setVal(false); |
| | | ctdLbls.addNewShowCatName().setVal(false); |
| | | ctdLbls.addNewShowSerName().setVal(false); |
| | | ctdLbls.addNewShowPercent().setVal(false); |
| | | ctdLbls.addNewShowBubbleSize().setVal(false); |
| | | tempChart.addNewMarker().setVal(true); |
| | | tempChart.addNewSmooth().setVal(false);*/ |
| | | CTUnsignedInt[] ctUnsignedInts = plotArea.getBarChartArray(0).getAxIdArray(); |
| | | if (ctUnsignedInts != null) { |
| | | for (CTUnsignedInt ctUnsignedInt : ctUnsignedInts) { |
| | | if (ctUnsignedInt != null) { |
| | | tempChart.addNewAxId().setVal(ctUnsignedInt.getVal()); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | CTLineSer ser = null; |
| | | CTSerTx tx = null; |
| | | for (int j = 0; j < graphDatas.get(i).size(); j++) { |
| | | if (graphDatas.get(i).get(j) == null) { |
| | | return false; |
| | | } |
| | | |
| | | // è·åå¾è¡¨çç³»å |
| | | if (tempChart.getSerArray().length <= j) { |
| | | // æ°å¢ |
| | | ser = tempChart.addNewSer(); |
| | | ser.addNewIdx().setVal(graphDatas.get(0).size()+j); |
| | | ser.addNewOrder().setVal(graphDatas.get(0).size()+j); |
| | | ser.addNewTx().addNewStrRef().addNewStrCache().addNewPt().setIdx(0); |
| | | ser.addNewCat().addNewStrRef().addNewStrCache().addNewPtCount(); |
| | | ser.addNewVal().addNewNumRef().addNewNumCache().addNewPtCount(); |
| | | } else { |
| | | ser = tempChart.getSerArray(j); |
| | | } |
| | | |
| | | tx = ser.getTx(); |
| | | tx.getStrRef().getStrCache().getPtArray(0).setV(graphDatas.get(i).get(j).getTitle()); |
| | | row = sheet.getRow(0); |
| | | if (row == null) { |
| | | row = sheet.createRow(0); |
| | | } |
| | | row.createCell(graphDatas.get(0).size()+j+1).setCellValue(graphDatas.get(i).get(j).getTitle()); |
| | | String titleRef = new CellReference(sheet.getSheetName(), 0, graphDatas.get(0).size()+j+1, true, true).formatAsString(); |
| | | tx.getStrRef().setF(titleRef); |
| | | |
| | | // è·åå¾è¡¨ç³»åçåç§° |
| | | CTAxDataSource cat = ser.getCat(); |
| | | // è·åå¾è¡¨ç³»åçå¼ |
| | | CTNumDataSource val = ser.getVal(); |
| | | updateGraphContent(sheet, cat, val, graphDatas.get(i).get(j), graphDatas.get(0).size()+j+1, false); |
| | | } |
| | | } |
| | | } |
| | | |
| | | // æ´æ°åµå
¥çworkbook |
| | | POIXMLDocumentPart xlsPart = chart.getRelations().get(0); |
| | | OutputStream xlsOut = xlsPart.getPackagePart().getOutputStream(); |
| | | try { |
| | | wb.write(xlsOut); |
| | | xlsOut.close(); |
| | | } catch (IOException e) { |
| | | result = false; |
| | | } finally { |
| | | if (wb != null) { |
| | | try { |
| | | wb.close(); |
| | | } catch (IOException e) { |
| | | result = false; |
| | | } |
| | | } |
| | | } |
| | | } catch (Exception e) { |
| | | result = false; |
| | | } |
| | | return result; |
| | | } |
| | | |
| | | private static boolean updateGraph(XSLFChart chart, List<GraphData> graphDatas) { |
| | | String type = getGraphType(chart); |
| | | if (GraphData.GRAPH_PIE.equalsIgnoreCase(type)) { |
| | | return updatePieGraph(chart, graphDatas); |
| | | } else if (GraphData.GRAPH_BAR.equalsIgnoreCase(type)) { |
| | | return updateBarGraph(chart, graphDatas); |
| | | } else if (GraphData.GRAPH_LINE.equalsIgnoreCase(type)) { |
| | | return updateLineGraph(chart, graphDatas); |
| | | } else if (GraphData.GRAPH_AREA.equalsIgnoreCase(type)) { |
| | | return updateAreaGraph(chart, graphDatas); |
| | | } else if (GraphData.GRAPH_RADAR.equalsIgnoreCase(type)) { |
| | | return updateRadarGraph(chart, graphDatas); |
| | | } else { |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * è·åå¾è¡¨ç±»å |
| | | * |
| | | * @param chart |
| | | * @return |
| | | */ |
| | | private static String getGraphType(XSLFChart chart) |
| | | { |
| | | String graphTye = "noSupport"; |
| | | CTPlotArea plot = chart.getCTChart().getPlotArea(); |
| | | if (null != plot && plot.getBarChartList().size() > 0) { |
| | | graphTye = GraphData.GRAPH_BAR; |
| | | } else if (null != plot && plot.getPieChartList().size() > 0) { |
| | | graphTye = GraphData.GRAPH_PIE; |
| | | } else if (null != plot && plot.getLineChartList().size() > 0) { |
| | | graphTye = GraphData.GRAPH_LINE; |
| | | } else if (null != plot && plot.getAreaChartList().size() > 0) { |
| | | graphTye = GraphData.GRAPH_AREA; |
| | | } else if (null != plot && plot.getRadarChartList().size() > 0) { |
| | | graphTye = GraphData.GRAPH_RADAR; |
| | | } |
| | | return graphTye; |
| | | } |
| | | |
| | | /** |
| | | * æ´æ°å饼徿°æ®ï¼é¥¼å¾åªæä¸ä¸ªç³»åï¼ |
| | | * @param chart |
| | | * @param graphDatas |
| | | * @return |
| | | */ |
| | | private static boolean updatePieGraph(XSLFChart chart, List<GraphData> graphDatas) { |
| | | boolean result = true; |
| | | |
| | | if (graphDatas.isEmpty()) { |
| | | return false; |
| | | } |
| | | |
| | | // æå¾è¡¨ç»å®å°Excel workbookä¸ |
| | | try { |
| | | Workbook wb = new XSSFWorkbook(); |
| | | Sheet sheet = wb.createSheet(); |
| | | CTChart ctChart = chart.getCTChart(); |
| | | CTPlotArea plotArea = ctChart.getPlotArea(); |
| | | CTPieChart tempChart = plotArea.getPieChartArray(0); |
| | | // è·åå¾è¡¨çç³»å |
| | | CTPieSer ser = tempChart.getSerArray(0); |
| | | CTSerTx tx = ser.getTx(); |
| | | tx.getStrRef().getStrCache().getPtArray(0).setV(graphDatas.get(0).getTitle()); |
| | | sheet.createRow(0).createCell(1).setCellValue(graphDatas.get(0).getTitle()); |
| | | String titleRef = new CellReference(sheet.getSheetName(), 0, 1, true, true).formatAsString(); |
| | | tx.getStrRef().setF(titleRef); |
| | | |
| | | // è·åå¾è¡¨ç³»åçåç§° |
| | | CTAxDataSource cat = ser.getCat(); |
| | | // è·åå¾è¡¨ç³»åçå¼ |
| | | CTNumDataSource val = ser.getVal(); |
| | | updateGraphContent(sheet, cat, val, graphDatas.get(0), 1, false); |
| | | |
| | | // æ´æ°åµå
¥çworkbook |
| | | POIXMLDocumentPart xlsPart = chart.getRelations().get(0); |
| | | OutputStream xlsOut = xlsPart.getPackagePart().getOutputStream(); |
| | | try { |
| | | wb.write(xlsOut); |
| | | xlsOut.close(); |
| | | } catch (IOException e) { |
| | | result = false; |
| | | } finally { |
| | | if (wb != null) { |
| | | try { |
| | | wb.close(); |
| | | } catch (IOException e) { |
| | | result = false; |
| | | } |
| | | } |
| | | } |
| | | } catch (Exception e) { |
| | | result = false; |
| | | } |
| | | return result; |
| | | } |
| | | |
| | | /** |
| | | * æ´æ°æ±ç¶å¾æ°æ® |
| | | * @param chart |
| | | * @param graphDatas |
| | | * @return |
| | | */ |
| | | private static boolean updateBarGraph(XSLFChart chart, List<GraphData> graphDatas) { |
| | | boolean result = true; |
| | | |
| | | if (graphDatas.isEmpty()) { |
| | | return false; |
| | | } |
| | | |
| | | // æå¾è¡¨ç»å®å°Excel workbookä¸ |
| | | try { |
| | | Workbook wb = new XSSFWorkbook(); |
| | | Sheet sheet = wb.createSheet(); |
| | | CTChart ctChart = chart.getCTChart(); |
| | | CTPlotArea plotArea = ctChart.getPlotArea(); |
| | | // è·åå¾è¡¨çç³»å |
| | | CTBarChart tempChart = plotArea.getBarChartArray(0); |
| | | CTBarSer ser = null; |
| | | CTSerTx tx = null; |
| | | Row row = null; |
| | | for (int i = 0; i < graphDatas.size(); i++) { |
| | | // è·åå¾è¡¨çç³»å |
| | | if (tempChart.getSerArray().length <= i) { |
| | | // æ°å¢ |
| | | ser = tempChart.addNewSer(); |
| | | ser.addNewIdx().setVal(i); |
| | | ser.addNewOrder().setVal(i); |
| | | ser.addNewTx().addNewStrRef().addNewStrCache().addNewPt().setIdx(0); |
| | | ser.addNewCat().addNewStrRef().addNewStrCache().addNewPtCount(); |
| | | ser.addNewVal().addNewNumRef().addNewNumCache().addNewPtCount(); |
| | | } else { |
| | | ser = tempChart.getSerArray(i); |
| | | } |
| | | |
| | | tx = ser.getTx(); |
| | | tx.getStrRef().getStrCache().getPtArray(0).setV(graphDatas.get(i).getTitle()); |
| | | row = sheet.getRow(0); |
| | | if (row == null) { |
| | | row = sheet.createRow(0); |
| | | } |
| | | row.createCell(i+1).setCellValue(graphDatas.get(i).getTitle()); |
| | | String titleRef = new CellReference(sheet.getSheetName(), 0, i+1, true, true).formatAsString(); |
| | | tx.getStrRef().setF(titleRef); |
| | | |
| | | // è·åå¾è¡¨ç³»åçåç§° |
| | | CTAxDataSource cat = ser.getCat(); |
| | | // è·åå¾è¡¨ç³»åçå¼ |
| | | CTNumDataSource val = ser.getVal(); |
| | | updateGraphContent(sheet, cat, val, graphDatas.get(i), i+1, false); |
| | | } |
| | | |
| | | // æ´æ°åµå
¥çworkbook |
| | | POIXMLDocumentPart xlsPart = chart.getRelations().get(0); |
| | | OutputStream xlsOut = xlsPart.getPackagePart().getOutputStream(); |
| | | try { |
| | | wb.write(xlsOut); |
| | | xlsOut.close(); |
| | | } catch (IOException e) { |
| | | result = false; |
| | | } finally { |
| | | if (wb != null) { |
| | | try { |
| | | wb.close(); |
| | | } catch (IOException e) { |
| | | result = false; |
| | | } |
| | | } |
| | | } |
| | | } catch (Exception e) { |
| | | result = false; |
| | | } |
| | | return result; |
| | | } |
| | | |
| | | /** |
| | | * æ´æ°çº¿æ§å¾æ°æ® |
| | | * @param chart |
| | | * @param graphDatas |
| | | * @return |
| | | */ |
| | | private static boolean updateLineGraph(XSLFChart chart, List<GraphData> graphDatas) { |
| | | boolean result = true; |
| | | |
| | | if (graphDatas.isEmpty()) { |
| | | return false; |
| | | } |
| | | |
| | | // æå¾è¡¨ç»å®å°Excel workbookä¸ |
| | | try { |
| | | Workbook wb = new XSSFWorkbook(); |
| | | Sheet sheet = wb.createSheet(); |
| | | CTChart ctChart = chart.getCTChart(); |
| | | CTPlotArea plotArea = ctChart.getPlotArea(); |
| | | // è·åå¾è¡¨çç³»å |
| | | CTLineChart tempChart = plotArea.getLineChartArray(0); |
| | | CTLineSer ser = null; |
| | | CTSerTx tx = null; |
| | | Row row = null; |
| | | for (int i = 0; i < graphDatas.size(); i++) { |
| | | // è·åå¾è¡¨çç³»å |
| | | if (tempChart.getSerArray().length <= i) { |
| | | // æ°å¢ |
| | | ser = tempChart.addNewSer(); |
| | | ser.addNewIdx().setVal(i); |
| | | ser.addNewOrder().setVal(i); |
| | | ser.addNewTx().addNewStrRef().addNewStrCache().addNewPt().setIdx(0); |
| | | ser.addNewCat().addNewStrRef().addNewStrCache().addNewPtCount(); |
| | | ser.addNewVal().addNewNumRef().addNewNumCache().addNewPtCount(); |
| | | } else { |
| | | ser = tempChart.getSerArray(i); |
| | | } |
| | | |
| | | tx = ser.getTx(); |
| | | tx.getStrRef().getStrCache().getPtArray(0).setV(graphDatas.get(i).getTitle()); |
| | | row = sheet.getRow(0); |
| | | if (row == null) { |
| | | row = sheet.createRow(0); |
| | | } |
| | | row.createCell(i+1).setCellValue(graphDatas.get(i).getTitle()); |
| | | String titleRef = new CellReference(sheet.getSheetName(), 0, i+1, true, true).formatAsString(); |
| | | tx.getStrRef().setF(titleRef); |
| | | |
| | | // è·åå¾è¡¨ç³»åçåç§° |
| | | CTAxDataSource cat = ser.getCat(); |
| | | // è·åå¾è¡¨ç³»åçå¼ |
| | | CTNumDataSource val = ser.getVal(); |
| | | updateGraphContent(sheet, cat, val, graphDatas.get(i), i+1, false); |
| | | } |
| | | |
| | | // æ´æ°åµå
¥çworkbook |
| | | POIXMLDocumentPart xlsPart = chart.getRelations().get(0); |
| | | OutputStream xlsOut = xlsPart.getPackagePart().getOutputStream(); |
| | | try { |
| | | wb.write(xlsOut); |
| | | xlsOut.close(); |
| | | } catch (IOException e) { |
| | | result = false; |
| | | } finally { |
| | | if (wb != null) { |
| | | try { |
| | | wb.close(); |
| | | } catch (IOException e) { |
| | | result = false; |
| | | } |
| | | } |
| | | } |
| | | } catch (Exception e) { |
| | | result = false; |
| | | } |
| | | return result; |
| | | } |
| | | |
| | | /** |
| | | * æ´æ°é¢ç§¯å¾æ°æ® |
| | | * @param chart |
| | | * @param graphDatas |
| | | * @return |
| | | */ |
| | | private static boolean updateAreaGraph(XSLFChart chart, List<GraphData> graphDatas) { |
| | | boolean result = true; |
| | | |
| | | if (graphDatas.isEmpty()) { |
| | | return false; |
| | | } |
| | | |
| | | // æå¾è¡¨ç»å®å°Excel workbookä¸ |
| | | try { |
| | | Workbook wb = new XSSFWorkbook(); |
| | | Sheet sheet = wb.createSheet(); |
| | | CTChart ctChart = chart.getCTChart(); |
| | | CTPlotArea plotArea = ctChart.getPlotArea(); |
| | | // è·åå¾è¡¨çç³»å |
| | | CTAreaChart tempChart = plotArea.getAreaChartArray(0); |
| | | CTAreaSer ser = null; |
| | | CTSerTx tx = null; |
| | | Row row = null; |
| | | for (int i = 0; i < graphDatas.size(); i++) { |
| | | // è·åå¾è¡¨çç³»å |
| | | if (tempChart.getSerArray().length <= i) { |
| | | // æ°å¢ |
| | | ser = tempChart.addNewSer(); |
| | | ser.addNewIdx().setVal(i); |
| | | ser.addNewOrder().setVal(i); |
| | | ser.addNewTx().addNewStrRef().addNewStrCache().addNewPt().setIdx(0); |
| | | ser.addNewCat().addNewNumRef().addNewNumCache().addNewPtCount(); |
| | | ser.addNewVal().addNewNumRef().addNewNumCache().addNewPtCount(); |
| | | } else { |
| | | ser = tempChart.getSerArray(i); |
| | | } |
| | | |
| | | tx = ser.getTx(); |
| | | tx.getStrRef().getStrCache().getPtArray(0).setV(graphDatas.get(i).getTitle()); |
| | | row = sheet.getRow(0); |
| | | if (row == null) { |
| | | row = sheet.createRow(0); |
| | | } |
| | | row.createCell(i+1).setCellValue(graphDatas.get(i).getTitle()); |
| | | String titleRef = new CellReference(sheet.getSheetName(), 0, i+1, true, true).formatAsString(); |
| | | tx.getStrRef().setF(titleRef); |
| | | |
| | | // è·åå¾è¡¨ç³»åçåç§° |
| | | CTAxDataSource cat = ser.getCat(); |
| | | // è·åå¾è¡¨ç³»åçå¼ |
| | | CTNumDataSource val = ser.getVal(); |
| | | updateGraphContent(sheet, cat, val, graphDatas.get(i), i+1, true); |
| | | } |
| | | |
| | | // æ´æ°åµå
¥çworkbook |
| | | POIXMLDocumentPart xlsPart = chart.getRelations().get(0); |
| | | OutputStream xlsOut = xlsPart.getPackagePart().getOutputStream(); |
| | | try { |
| | | wb.write(xlsOut); |
| | | xlsOut.close(); |
| | | } catch (IOException e) { |
| | | result = false; |
| | | } finally { |
| | | if (wb != null) { |
| | | try |
| | | { |
| | | wb.close(); |
| | | } catch (IOException e) { |
| | | result = false; |
| | | } |
| | | } |
| | | } |
| | | } catch (Exception e) { |
| | | result = false; |
| | | } |
| | | return result; |
| | | } |
| | | |
| | | /** |
| | | * æ´æ°é·è¾¾å¾æ°æ® |
| | | * @param chart |
| | | * @param graphDatas |
| | | * @return |
| | | */ |
| | | private static boolean updateRadarGraph(XSLFChart chart, List<GraphData> graphDatas) { |
| | | boolean result = true; |
| | | |
| | | if (graphDatas.isEmpty()) { |
| | | return false; |
| | | } |
| | | |
| | | // æå¾è¡¨ç»å®å°Excel workbookä¸ |
| | | try { |
| | | Workbook wb = new XSSFWorkbook(); |
| | | Sheet sheet = wb.createSheet(); |
| | | CTChart ctChart = chart.getCTChart(); |
| | | CTPlotArea plotArea = ctChart.getPlotArea(); |
| | | // è·åå¾è¡¨çç³»å |
| | | CTRadarChart tempChart = plotArea.getRadarChartArray(0); |
| | | CTRadarSer ser = null; |
| | | CTSerTx tx = null; |
| | | Row row = null; |
| | | for (int i = 0; i < graphDatas.size(); i++) { |
| | | // è·åå¾è¡¨çç³»å |
| | | if (tempChart.getSerArray().length <= i) { |
| | | // æ°å¢ |
| | | ser = tempChart.addNewSer(); |
| | | ser.addNewIdx().setVal(i); |
| | | ser.addNewOrder().setVal(i); |
| | | ser.addNewTx().addNewStrRef().addNewStrCache().addNewPt().setIdx(0); |
| | | ser.addNewCat().addNewNumRef().addNewNumCache().addNewPtCount(); |
| | | ser.addNewVal().addNewNumRef().addNewNumCache().addNewPtCount(); |
| | | } else { |
| | | ser = tempChart.getSerArray(i); |
| | | } |
| | | |
| | | tx = ser.getTx(); |
| | | tx.getStrRef().getStrCache().getPtArray(0).setV(graphDatas.get(i).getTitle()); |
| | | row = sheet.getRow(0); |
| | | if (row == null) { |
| | | row = sheet.createRow(0); |
| | | } |
| | | row.createCell(i+1).setCellValue(graphDatas.get(i).getTitle()); |
| | | String titleRef = new CellReference(sheet.getSheetName(), 0, i+1, true, true).formatAsString(); |
| | | tx.getStrRef().setF(titleRef); |
| | | |
| | | // è·åå¾è¡¨ç³»åçåç§° |
| | | CTAxDataSource cat = ser.getCat(); |
| | | // è·åå¾è¡¨ç³»åçå¼ |
| | | CTNumDataSource val = ser.getVal(); |
| | | updateGraphContent(sheet, cat, val, graphDatas.get(i), i+1, true); |
| | | } |
| | | |
| | | // æ´æ°åµå
¥çworkbook |
| | | POIXMLDocumentPart xlsPart = chart.getRelations().get(0); |
| | | OutputStream xlsOut = xlsPart.getPackagePart().getOutputStream(); |
| | | try { |
| | | wb.write(xlsOut); |
| | | xlsOut.close(); |
| | | } catch (IOException e) { |
| | | result = false; |
| | | } finally { |
| | | if (wb != null) { |
| | | try |
| | | { |
| | | wb.close(); |
| | | } catch (IOException e) { |
| | | result = false; |
| | | } |
| | | } |
| | | } |
| | | } catch (Exception e) { |
| | | result = false; |
| | | } |
| | | return result; |
| | | } |
| | | |
| | | /** |
| | | * æ´æ°å¾è¡¨å
容 |
| | | * @param sheet |
| | | * @param cat |
| | | * @param val |
| | | * @param graphData |
| | | * @param rowNum sheetçåç䏿 |
| | | * @param catNumRef catæ¯å¦numRef |
| | | */ |
| | | private static void updateGraphContent(Sheet sheet, CTAxDataSource cat, CTNumDataSource val, GraphData graphData, int rowNum, boolean catNumRef) { |
| | | int serSize = graphData.getSerList().size(); |
| | | CTStrData catStrData = null; |
| | | CTNumData catNumData = null; |
| | | |
| | | CTNumData valNumData = val.getNumRef().getNumCache(); |
| | | valNumData.setPtArray((CTNumVal[]) null); |
| | | |
| | | if (catNumRef) { |
| | | catNumData = cat.getNumRef().getNumCache(); |
| | | catNumData.setPtArray((CTNumVal[]) null); |
| | | } else { |
| | | catStrData = cat.getStrRef().getStrCache(); |
| | | catStrData.setPtArray((CTStrVal[]) null); |
| | | } |
| | | |
| | | Row row = null; |
| | | Cell cell0 = null; |
| | | for (int i = 0; i < serSize; i++) { |
| | | CTNumVal valNumVal = valNumData.addNewPt(); |
| | | valNumVal.setIdx(i); |
| | | valNumVal.setV(graphData.getSerList().get(i).getSerVal() + ""); |
| | | |
| | | if (catNumRef) { |
| | | CTNumVal catNumVal = catNumData.addNewPt(); |
| | | catNumVal.setIdx(i); |
| | | catNumVal.setV(graphData.getSerList().get(i).getSerVal() + ""); |
| | | } else { |
| | | CTStrVal catStrVal = catStrData.addNewPt(); |
| | | catStrVal.setIdx(i); |
| | | catStrVal.setV(graphData.getSerList().get(i).getSerName()); |
| | | } |
| | | |
| | | row = sheet.getRow(i+1); |
| | | if(row == null){ |
| | | row = sheet.createRow(i+1); |
| | | } |
| | | cell0 = row.getCell(0); |
| | | if(cell0 == null){ |
| | | cell0 = row.createCell(0); |
| | | } |
| | | cell0.setCellValue(graphData.getSerList().get(i).getSerName()); |
| | | row.createCell(rowNum).setCellValue(graphData.getSerList().get(i).getSerVal()); |
| | | } |
| | | valNumData.getPtCount().setVal(serSize); |
| | | if (catNumRef) { |
| | | catNumData.getPtCount().setVal(serSize); |
| | | } else { |
| | | catStrData.getPtCount().setVal(serSize); |
| | | } |
| | | |
| | | String numDataRange = new CellRangeAddress(1, serSize, rowNum, rowNum).formatAsString(sheet.getSheetName(), true); |
| | | val.getNumRef().setF(numDataRange); |
| | | String axisDataRange = new CellRangeAddress(1, serSize, 0, 0).formatAsString(sheet.getSheetName(), true); |
| | | if (catNumRef) { |
| | | cat.getNumRef().setF(axisDataRange); |
| | | } else { |
| | | cat.getStrRef().setF(axisDataRange); |
| | | } |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.landtool.lanbase.common.validator; |
| | | |
| | | import java.util.Set; |
| | | |
| | | import javax.validation.ConstraintViolation; |
| | | import javax.validation.Validation; |
| | | import javax.validation.Validator; |
| | | |
| | | import com.landtool.lanbase.common.exception.LanbaseException; |
| | | |
| | | /** |
| | | * åèææ¡£ï¼http://docs.jboss.org/hibernate/validator/5.4/reference/en-US/html_single/ |
| | | * @author lanbase |
| | | * @Description: TODO(hibernate-validatoræ ¡éªå·¥å
·ç±») |
| | | * @date 2017-6-23 15:07 |
| | | */ |
| | | public class ValidatorUtils { |
| | | private static Validator validator; |
| | | |
| | | static { |
| | | validator = Validation.buildDefaultValidatorFactory().getValidator(); |
| | | } |
| | | |
| | | /** |
| | | * æ ¡éªå¯¹è±¡ |
| | | * @param object å¾
æ ¡éªå¯¹è±¡ |
| | | * @param groups å¾
æ ¡éªçç» |
| | | * @throws LanbaseException æ ¡éªä¸éè¿ |
| | | */ |
| | | public static void validateEntity(Object object, Class<?>... groups) |
| | | throws LanbaseException { |
| | | Set<ConstraintViolation<Object>> constraintViolations = validator.validate(object, groups); |
| | | if (!constraintViolations.isEmpty()) { |
| | | StringBuilder msg = new StringBuilder(); |
| | | for(ConstraintViolation<Object> constraint: constraintViolations){ |
| | | msg.append(constraint.getMessage()).append("<br>"); |
| | | } |
| | | throw new LanbaseException(msg.toString()); |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.landtool.lanbase.common.validator.group; |
| | | |
| | | /** |
| | | * @author lanbase |
| | | * @Description: TODO(æ°å¢æ°æ® Group) |
| | | * @date 2017-6-23 15:07 |
| | | */ |
| | | public interface AddGroup { |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.landtool.lanbase.common.validator.group; |
| | | |
| | | import javax.validation.GroupSequence; |
| | | |
| | | /** |
| | | * @author lanbase |
| | | * @Description: TODO(å®ä¹æ ¡éªé¡ºåºï¼å¦æAddGroupç»å¤±è´¥ï¼åUpdateGroupç»ä¸ä¼åæ ¡éª) |
| | | * @date 2017-6-23 15:07 |
| | | */ |
| | | @GroupSequence({AddGroup.class, UpdateGroup.class}) |
| | | public interface Group { |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.landtool.lanbase.common.validator.group; |
| | | |
| | | /** |
| | | * @author lanbase |
| | | * @Description: TODO(æ´æ°æ°æ® Group) |
| | | * @date 2017-6-23 15:07 |
| | | */ |
| | | public interface UpdateGroup { |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.landtool.lanbase.common.xss; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Collections; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.concurrent.ConcurrentHashMap; |
| | | import java.util.concurrent.ConcurrentMap; |
| | | import java.util.logging.Logger; |
| | | import java.util.regex.Matcher; |
| | | import java.util.regex.Pattern; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.alibaba.fastjson.serializer.SerializerFeature; |
| | | |
| | | /** |
| | | * |
| | | * HTML filtering utility for protecting against XSS (Cross Site Scripting). |
| | | * |
| | | * This code is licensed LGPLv3 |
| | | * |
| | | * This code is a Java port of the original work in PHP by Cal Hendersen. |
| | | * http://code.iamcal.com/php/lib_filter/ |
| | | * |
| | | * The trickiest part of the translation was handling the differences in regex handling |
| | | * between PHP and Java. These resources were helpful in the process: |
| | | * |
| | | * http://java.sun.com/j2se/1.4.2/docs/api/java/util/regex/Pattern.html |
| | | * http://us2.php.net/manual/en/reference.pcre.pattern.modifiers.php |
| | | * http://www.regular-expressions.info/modifiers.html |
| | | * |
| | | * A note on naming conventions: instance variables are prefixed with a "v"; global |
| | | * constants are in all caps. |
| | | * |
| | | * Sample use: |
| | | * String input = ... |
| | | * String clean = new HTMLFilter().filter( input ); |
| | | * |
| | | * The class is not thread safe. Create a new instance if in doubt. |
| | | * |
| | | * If you find bugs or have suggestions on improvement (especially regarding |
| | | * performance), please contact us. The latest version of this |
| | | * source, and our contact details, can be found at http://xss-html-filter.sf.net |
| | | * |
| | | * @author Joseph O'Connell |
| | | * @author Cal Hendersen |
| | | * @author Michael Semb Wever |
| | | */ |
| | | public final class HTMLFilter { |
| | | |
| | | /** regex flag union representing /si modifiers in php **/ |
| | | private static final int REGEX_FLAGS_SI = Pattern.CASE_INSENSITIVE | Pattern.DOTALL; |
| | | private static final Pattern P_COMMENTS = Pattern.compile("<!--(.*?)-->", Pattern.DOTALL); |
| | | private static final Pattern P_COMMENT = Pattern.compile("^!--(.*)--$", REGEX_FLAGS_SI); |
| | | private static final Pattern P_TAGS = Pattern.compile("<(.*?)>", Pattern.DOTALL); |
| | | private static final Pattern P_END_TAG = Pattern.compile("^/([a-z0-9]+)", REGEX_FLAGS_SI); |
| | | private static final Pattern P_START_TAG = Pattern.compile("^([a-z0-9]+)(.*?)(/?)$", REGEX_FLAGS_SI); |
| | | private static final Pattern P_QUOTED_ATTRIBUTES = Pattern.compile("([a-z0-9]+)=([\"'])(.*?)\\2", REGEX_FLAGS_SI); |
| | | private static final Pattern P_UNQUOTED_ATTRIBUTES = Pattern.compile("([a-z0-9]+)(=)([^\"\\s']+)", REGEX_FLAGS_SI); |
| | | private static final Pattern P_PROTOCOL = Pattern.compile("^([^:]+):", REGEX_FLAGS_SI); |
| | | private static final Pattern P_ENTITY = Pattern.compile("&#(\\d+);?"); |
| | | private static final Pattern P_ENTITY_UNICODE = Pattern.compile("&#x([0-9a-f]+);?"); |
| | | private static final Pattern P_ENCODE = Pattern.compile("%([0-9a-f]{2});?"); |
| | | private static final Pattern P_VALID_ENTITIES = Pattern.compile("&([^&;]*)(?=(;|&|$))"); |
| | | private static final Pattern P_VALID_QUOTES = Pattern.compile("(>|^)([^<]+?)(<|$)", Pattern.DOTALL); |
| | | private static final Pattern P_END_ARROW = Pattern.compile("^>"); |
| | | private static final Pattern P_BODY_TO_END = Pattern.compile("<([^>]*?)(?=<|$)"); |
| | | private static final Pattern P_XML_CONTENT = Pattern.compile("(^|>)([^<]*?)(?=>)"); |
| | | private static final Pattern P_STRAY_LEFT_ARROW = Pattern.compile("<([^>]*?)(?=<|$)"); |
| | | private static final Pattern P_STRAY_RIGHT_ARROW = Pattern.compile("(^|>)([^<]*?)(?=>)"); |
| | | private static final Pattern P_AMP = Pattern.compile("&"); |
| | | private static final Pattern P_QUOTE = Pattern.compile("<"); |
| | | private static final Pattern P_LEFT_ARROW = Pattern.compile("<"); |
| | | private static final Pattern P_RIGHT_ARROW = Pattern.compile(">"); |
| | | private static final Pattern P_BOTH_ARROWS = Pattern.compile("<>"); |
| | | |
| | | // @xxx could grow large... maybe use sesat's ReferenceMap |
| | | private static final ConcurrentMap<String,Pattern> P_REMOVE_PAIR_BLANKS = new ConcurrentHashMap<String, Pattern>(); |
| | | private static final ConcurrentMap<String,Pattern> P_REMOVE_SELF_BLANKS = new ConcurrentHashMap<String, Pattern>(); |
| | | |
| | | /** set of allowed html elements, along with allowed attributes for each element **/ |
| | | private final Map<String, List<String>> vAllowed; |
| | | /** counts of open tags for each (allowable) html element **/ |
| | | private final Map<String, Integer> vTagCounts = new HashMap<String, Integer>(); |
| | | |
| | | /** html elements which must always be self-closing (e.g. "<img />") **/ |
| | | private final String[] vSelfClosingTags; |
| | | /** html elements which must always have separate opening and closing tags (e.g. "<b></b>") **/ |
| | | private final String[] vNeedClosingTags; |
| | | /** set of disallowed html elements **/ |
| | | private final String[] vDisallowed; |
| | | /** attributes which should be checked for valid protocols **/ |
| | | private final String[] vProtocolAtts; |
| | | /** allowed protocols **/ |
| | | private final String[] vAllowedProtocols; |
| | | /** tags which should be removed if they contain no content (e.g. "<b></b>" or "<b />") **/ |
| | | private final String[] vRemoveBlanks; |
| | | /** entities allowed within html markup **/ |
| | | private final String[] vAllowedEntities; |
| | | /** flag determining whether comments are allowed in input String. */ |
| | | private final boolean stripComment; |
| | | private final boolean encodeQuotes; |
| | | private boolean vDebug = false; |
| | | /** |
| | | * flag determining whether to try to make tags when presented with "unbalanced" |
| | | * angle brackets (e.g. "<b text </b>" becomes "<b> text </b>"). If set to false, |
| | | * unbalanced angle brackets will be html escaped. |
| | | */ |
| | | private final boolean alwaysMakeTags; |
| | | |
| | | /** |
| | | * ç¨æ·å¤æç¨æ·è¾å
¥çå°æ¬å·æ¯å¦å¯ä»¥æ¿æ¢ä¸ºç©ºï¼è¿æ¯éè¦è¿åç©ºæ ¼ |
| | | * å¦è¾å
¥ <aaa> åéè¦æ¿æ¢ä¸ºç©ºæ ¼ aaa<aa>åå¯ä»¥æ¿æ¢ä¸ºç©º |
| | | */ |
| | | private ArrayList<Boolean> nullOrSpace = new ArrayList<Boolean>(); |
| | | |
| | | /** Default constructor. |
| | | * |
| | | */ |
| | | public HTMLFilter() { |
| | | vAllowed = new HashMap<>(); |
| | | |
| | | final ArrayList<String> a_atts = new ArrayList<String>(); |
| | | a_atts.add("href"); |
| | | a_atts.add("target"); |
| | | vAllowed.put("a", a_atts); |
| | | |
| | | final ArrayList<String> img_atts = new ArrayList<String>(); |
| | | img_atts.add("src"); |
| | | img_atts.add("width"); |
| | | img_atts.add("height"); |
| | | img_atts.add("alt"); |
| | | vAllowed.put("img", img_atts); |
| | | |
| | | final ArrayList<String> no_atts = new ArrayList<String>(); |
| | | vAllowed.put("b", no_atts); |
| | | vAllowed.put("strong", no_atts); |
| | | vAllowed.put("i", no_atts); |
| | | vAllowed.put("em", no_atts); |
| | | |
| | | vSelfClosingTags = new String[]{"img"}; |
| | | vNeedClosingTags = new String[]{"a", "b", "strong", "i", "em"}; |
| | | vDisallowed = new String[]{}; |
| | | vAllowedProtocols = new String[]{"http", "mailto", "https"}; // no ftp. |
| | | vProtocolAtts = new String[]{"src", "href"}; |
| | | vRemoveBlanks = new String[]{"a", "b", "strong", "i", "em"}; |
| | | vAllowedEntities = new String[]{"amp", "gt", "lt", "quot"}; |
| | | stripComment = true; |
| | | encodeQuotes = true; |
| | | alwaysMakeTags = true; |
| | | } |
| | | |
| | | /** Set debug flag to true. Otherwise use default settings. See the default constructor. |
| | | * |
| | | * @param debug turn debug on with a true argument |
| | | */ |
| | | public HTMLFilter(final boolean debug) { |
| | | this(); |
| | | vDebug = debug; |
| | | |
| | | } |
| | | |
| | | /** Map-parameter configurable constructor. |
| | | * |
| | | * @param conf map containing configuration. keys match field names. |
| | | */ |
| | | public HTMLFilter(final Map<String,Object> conf) { |
| | | |
| | | assert conf.containsKey("vAllowed") : "configuration requires vAllowed"; |
| | | assert conf.containsKey("vSelfClosingTags") : "configuration requires vSelfClosingTags"; |
| | | assert conf.containsKey("vNeedClosingTags") : "configuration requires vNeedClosingTags"; |
| | | assert conf.containsKey("vDisallowed") : "configuration requires vDisallowed"; |
| | | assert conf.containsKey("vAllowedProtocols") : "configuration requires vAllowedProtocols"; |
| | | assert conf.containsKey("vProtocolAtts") : "configuration requires vProtocolAtts"; |
| | | assert conf.containsKey("vRemoveBlanks") : "configuration requires vRemoveBlanks"; |
| | | assert conf.containsKey("vAllowedEntities") : "configuration requires vAllowedEntities"; |
| | | |
| | | vAllowed = Collections.unmodifiableMap((HashMap<String, List<String>>) conf.get("vAllowed")); |
| | | vSelfClosingTags = (String[]) conf.get("vSelfClosingTags"); |
| | | vNeedClosingTags = (String[]) conf.get("vNeedClosingTags"); |
| | | vDisallowed = (String[]) conf.get("vDisallowed"); |
| | | vAllowedProtocols = (String[]) conf.get("vAllowedProtocols"); |
| | | vProtocolAtts = (String[]) conf.get("vProtocolAtts"); |
| | | vRemoveBlanks = (String[]) conf.get("vRemoveBlanks"); |
| | | vAllowedEntities = (String[]) conf.get("vAllowedEntities"); |
| | | stripComment = conf.containsKey("stripComment") ? (Boolean) conf.get("stripComment") : true; |
| | | encodeQuotes = conf.containsKey("encodeQuotes") ? (Boolean) conf.get("encodeQuotes") : true; |
| | | alwaysMakeTags = conf.containsKey("alwaysMakeTags") ? (Boolean) conf.get("alwaysMakeTags") : true; |
| | | } |
| | | |
| | | private void reset() { |
| | | vTagCounts.clear(); |
| | | } |
| | | |
| | | private void debug(final String msg) { |
| | | if (vDebug) { |
| | | Logger.getAnonymousLogger().info(msg); |
| | | } |
| | | } |
| | | |
| | | //--------------------------------------------------------------- |
| | | // my versions of some PHP library functions |
| | | public static String chr(final int decimal) { |
| | | return String.valueOf((char) decimal); |
| | | } |
| | | |
| | | public static String htmlSpecialChars(final String s) { |
| | | String result = s; |
| | | result = regexReplace(P_AMP, "&", result); |
| | | result = regexReplace(P_QUOTE, """, result); |
| | | result = regexReplace(P_LEFT_ARROW, "<", result); |
| | | result = regexReplace(P_RIGHT_ARROW, ">", result); |
| | | return result; |
| | | } |
| | | |
| | | //--------------------------------------------------------------- |
| | | /** |
| | | * given a user submitted input String, filter out any invalid or restricted |
| | | * html. |
| | | * |
| | | * @param input text (i.e. submitted by a user) than may contain html |
| | | * @return "clean" version of input, with only valid, whitelisted html elements allowed |
| | | */ |
| | | public String filter(final String input) { |
| | | reset(); |
| | | String s = input; |
| | | |
| | | debug("************************************************"); |
| | | debug(" INPUT: " + input); |
| | | |
| | | s = escapeComments(s); |
| | | debug(" escapeComments: " + s); |
| | | |
| | | s = balanceHTML(s); |
| | | debug(" balanceHTML: " + s); |
| | | |
| | | s = checkTags(s); |
| | | debug(" checkTags: " + s); |
| | | |
| | | s = processRemoveBlanks(s); |
| | | debug("processRemoveBlanks: " + s); |
| | | |
| | | s = validateEntities(s); |
| | | debug(" validateEntites: " + s); |
| | | |
| | | debug("************************************************\n\n"); |
| | | return s; |
| | | } |
| | | |
| | | public boolean isAlwaysMakeTags(){ |
| | | return alwaysMakeTags; |
| | | } |
| | | |
| | | public boolean isStripComments(){ |
| | | return stripComment; |
| | | } |
| | | |
| | | private String escapeComments(final String s) { |
| | | final Matcher m = P_COMMENTS.matcher(s); |
| | | final StringBuffer buf = new StringBuffer(); |
| | | if (m.find()) { |
| | | final String match = m.group(1); //(.*?) |
| | | m.appendReplacement(buf, Matcher.quoteReplacement("<!--" + htmlSpecialChars(match) + "-->")); |
| | | } |
| | | m.appendTail(buf); |
| | | |
| | | return buf.toString(); |
| | | } |
| | | |
| | | private String balanceHTML(String s) { |
| | | nullOrSpace = new ArrayList<Boolean>(); |
| | | if (alwaysMakeTags) { |
| | | // |
| | | // try and form html |
| | | // |
| | | |
| | | //夿æ¯å¦æ¯jsonæ ¼å¼çå符串ï¼å¦ææ¯åjsonåè¡¥å
¨å°æ¬å·ï¼ä¸æ¯åèµ°åæçæ¹æ³ |
| | | //è§£å³è¾å
¥åä¸ªå°æ¬å·ä¼æ¥éçé®é¢ alert ykm 2019/01/30 |
| | | try { |
| | | boolean isArray = false; |
| | | isArray = validateJsonArray(s); |
| | | if (isArray) { |
| | | JSONArray ss = JSON.parseArray(s); |
| | | for(int t =0; t < ss.size();t++) { |
| | | Map map = blanceHtml(ss.getString(t)); |
| | | ss.remove(t); |
| | | ss.add(t,map); |
| | | } |
| | | s = JSON.toJSONString(ss, SerializerFeature.WriteMapNullValue); |
| | | } |
| | | else { |
| | | Map mapTypes = JSON.parseObject(s); |
| | | for (Object obj : mapTypes.keySet()) { |
| | | // System.out.println("key为ï¼"+obj+"å¼ä¸ºï¼"+mapTypes.get(obj)); |
| | | String str = mapTypes.get(obj) == null ? null : mapTypes.get(obj).toString(); |
| | | boolean flag = false; |
| | | if (str != null && !str.trim().equals("")) { |
| | | flag = validateJson(str); |
| | | } |
| | | if (!flag && str != null && !str.trim().equals("")) { |
| | | //åªè¾å
¥ > ä¼è¢«æ¿æ¢ä¸ºç©ºå符串 |
| | | // str = regexReplace(P_END_ARROW, "", str); |
| | | str = regexReplace(P_BODY_TO_END, "<$1>", str); |
| | | str = regexReplace(P_XML_CONTENT, "$1<$2", str); |
| | | |
| | | //夿æ¯å¦å¯ä»¥æ¿æ¢ä¸ºç©º |
| | | Matcher m = P_TAGS.matcher(str); |
| | | String tt = str; |
| | | while (m.find()) { |
| | | String space = "<" + m.group(1) + ">"; |
| | | tt = tt.replaceFirst(space, ""); |
| | | if (tt.length() > 0) { |
| | | nullOrSpace.add(true); |
| | | } else { |
| | | nullOrSpace.add(false); |
| | | } |
| | | } |
| | | mapTypes.replace(obj, str); |
| | | } else if (flag) { |
| | | Map map = blanceHtml(str); |
| | | mapTypes.replace(obj, map); |
| | | } |
| | | } |
| | | s = JSON.toJSONString(mapTypes, SerializerFeature.WriteMapNullValue); |
| | | } |
| | | } |
| | | catch (Exception e) { |
| | | // s = regexReplace(P_END_ARROW, "", s); |
| | | s = regexReplace(P_BODY_TO_END, "<$1>", s); |
| | | s = regexReplace(P_XML_CONTENT, "$1<$2", s); |
| | | |
| | | //夿æ¯å¦å¯ä»¥æ¿æ¢ä¸ºç©º |
| | | Matcher m = P_TAGS.matcher(s); |
| | | String tt = s; |
| | | while (m.find()) { |
| | | String space = "<" + m.group(1) + ">"; |
| | | tt = tt.replaceFirst(space, ""); |
| | | if (tt.length() > 0) { |
| | | nullOrSpace.add(true); |
| | | } else { |
| | | nullOrSpace.add(false); |
| | | } |
| | | } |
| | | } |
| | | |
| | | } else { |
| | | // |
| | | // escape stray brackets |
| | | // |
| | | s = regexReplace(P_STRAY_LEFT_ARROW, "<$1", s); |
| | | s = regexReplace(P_STRAY_RIGHT_ARROW, "$1$2><", s); |
| | | |
| | | // |
| | | // the last regexp causes '<>' entities to appear |
| | | // (we need to do a lookahead assertion so that the last bracket can |
| | | // be used in the next pass of the regexp) |
| | | // |
| | | s = regexReplace(P_BOTH_ARROWS, "", s); |
| | | } |
| | | |
| | | return s; |
| | | } |
| | | |
| | | private String checkTags(String s) { |
| | | //è¿æ»¤'% ! * addbydsh |
| | | // try { |
| | | // s = s.replace("'","").replace("%","").replace("!","").replace("*",""); |
| | | // }catch (Exception ex){ |
| | | // |
| | | // } |
| | | Matcher m = P_TAGS.matcher(s); |
| | | |
| | | final StringBuffer buf = new StringBuffer(); |
| | | int count = 0; |
| | | while (m.find()) { |
| | | String replaceStr = m.group(1); |
| | | replaceStr = processTag(replaceStr); |
| | | if(nullOrSpace.size() > 0 && nullOrSpace.size() > count && !nullOrSpace.get(count)) { |
| | | replaceStr =" "; |
| | | } |
| | | m.appendReplacement(buf, Matcher.quoteReplacement(replaceStr)); |
| | | |
| | | count++; |
| | | } |
| | | m.appendTail(buf); |
| | | |
| | | s = buf.toString(); |
| | | |
| | | // these get tallied in processTag |
| | | // (remember to reset before subsequent calls to filter method) |
| | | for (String key : vTagCounts.keySet()) { |
| | | for (int ii = 0; ii < vTagCounts.get(key); ii++) { |
| | | s += "</" + key + ">"; |
| | | } |
| | | } |
| | | |
| | | return s; |
| | | } |
| | | |
| | | private String processRemoveBlanks(final String s) { |
| | | String result = s; |
| | | for (String tag : vRemoveBlanks) { |
| | | if(!P_REMOVE_PAIR_BLANKS.containsKey(tag)){ |
| | | P_REMOVE_PAIR_BLANKS.putIfAbsent(tag, Pattern.compile("<" + tag + "(\\s[^>]*)?></" + tag + ">")); |
| | | } |
| | | result = regexReplace(P_REMOVE_PAIR_BLANKS.get(tag), "", result); |
| | | if(!P_REMOVE_SELF_BLANKS.containsKey(tag)){ |
| | | P_REMOVE_SELF_BLANKS.putIfAbsent(tag, Pattern.compile("<" + tag + "(\\s[^>]*)?/>")); |
| | | } |
| | | result = regexReplace(P_REMOVE_SELF_BLANKS.get(tag), "", result); |
| | | } |
| | | |
| | | return result; |
| | | } |
| | | |
| | | private static String regexReplace(final Pattern regex_pattern, final String replacement, final String s) { |
| | | Matcher m = regex_pattern.matcher(s); |
| | | return m.replaceAll(replacement); |
| | | } |
| | | |
| | | private String processTag(final String s) { |
| | | // ending tags |
| | | Matcher m = P_END_TAG.matcher(s); |
| | | if (m.find()) { |
| | | final String name = m.group(1).toLowerCase(); |
| | | if (allowed(name)) { |
| | | if (!inArray(name, vSelfClosingTags)) { |
| | | if (vTagCounts.containsKey(name)) { |
| | | vTagCounts.put(name, vTagCounts.get(name) - 1); |
| | | return "</" + name + ">"; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | // starting tags |
| | | m = P_START_TAG.matcher(s); |
| | | if (m.find()) { |
| | | final String name = m.group(1).toLowerCase(); |
| | | final String body = m.group(2); |
| | | String ending = m.group(3); |
| | | |
| | | //debug( "in a starting tag, name='" + name + "'; body='" + body + "'; ending='" + ending + "'" ); |
| | | if (allowed(name)) { |
| | | String params = ""; |
| | | |
| | | final Matcher m2 = P_QUOTED_ATTRIBUTES.matcher(body); |
| | | final Matcher m3 = P_UNQUOTED_ATTRIBUTES.matcher(body); |
| | | final List<String> paramNames = new ArrayList<String>(); |
| | | final List<String> paramValues = new ArrayList<String>(); |
| | | while (m2.find()) { |
| | | paramNames.add(m2.group(1)); //([a-z0-9]+) |
| | | paramValues.add(m2.group(3)); //(.*?) |
| | | } |
| | | while (m3.find()) { |
| | | paramNames.add(m3.group(1)); //([a-z0-9]+) |
| | | paramValues.add(m3.group(3)); //([^\"\\s']+) |
| | | } |
| | | |
| | | String paramName, paramValue; |
| | | for (int ii = 0; ii < paramNames.size(); ii++) { |
| | | paramName = paramNames.get(ii).toLowerCase(); |
| | | paramValue = paramValues.get(ii); |
| | | |
| | | // debug( "paramName='" + paramName + "'" ); |
| | | // debug( "paramValue='" + paramValue + "'" ); |
| | | // debug( "allowed? " + vAllowed.get( name ).contains( paramName ) ); |
| | | |
| | | if (allowedAttribute(name, paramName)) { |
| | | if (inArray(paramName, vProtocolAtts)) { |
| | | paramValue = processParamProtocol(paramValue); |
| | | } |
| | | params += " " + paramName + "=\"" + paramValue + "\""; |
| | | } |
| | | } |
| | | |
| | | if (inArray(name, vSelfClosingTags)) { |
| | | ending = " /"; |
| | | } |
| | | |
| | | if (inArray(name, vNeedClosingTags)) { |
| | | ending = ""; |
| | | } |
| | | |
| | | if (ending == null || ending.length() < 1) { |
| | | if (vTagCounts.containsKey(name)) { |
| | | vTagCounts.put(name, vTagCounts.get(name) + 1); |
| | | } else { |
| | | vTagCounts.put(name, 1); |
| | | } |
| | | } else { |
| | | ending = " /"; |
| | | } |
| | | return "<" + name + params + ending + ">"; |
| | | } else { |
| | | return ""; |
| | | } |
| | | } |
| | | |
| | | // comments |
| | | m = P_COMMENT.matcher(s); |
| | | if (!stripComment && m.find()) { |
| | | return "<" + m.group() + ">"; |
| | | } |
| | | |
| | | return ""; |
| | | } |
| | | |
| | | private String processParamProtocol(String s) { |
| | | s = decodeEntities(s); |
| | | final Matcher m = P_PROTOCOL.matcher(s); |
| | | if (m.find()) { |
| | | final String protocol = m.group(1); |
| | | if (!inArray(protocol, vAllowedProtocols)) { |
| | | // bad protocol, turn into local anchor link instead |
| | | s = "#" + s.substring(protocol.length() + 1, s.length()); |
| | | if (s.startsWith("#//")) { |
| | | s = "#" + s.substring(3, s.length()); |
| | | } |
| | | } |
| | | } |
| | | |
| | | return s; |
| | | } |
| | | |
| | | private String decodeEntities(String s) { |
| | | StringBuffer buf = new StringBuffer(); |
| | | |
| | | Matcher m = P_ENTITY.matcher(s); |
| | | while (m.find()) { |
| | | final String match = m.group(1); |
| | | final int decimal = Integer.decode(match).intValue(); |
| | | m.appendReplacement(buf, Matcher.quoteReplacement(chr(decimal))); |
| | | } |
| | | m.appendTail(buf); |
| | | s = buf.toString(); |
| | | |
| | | buf = new StringBuffer(); |
| | | m = P_ENTITY_UNICODE.matcher(s); |
| | | while (m.find()) { |
| | | final String match = m.group(1); |
| | | final int decimal = Integer.valueOf(match, 16).intValue(); |
| | | m.appendReplacement(buf, Matcher.quoteReplacement(chr(decimal))); |
| | | } |
| | | m.appendTail(buf); |
| | | s = buf.toString(); |
| | | |
| | | buf = new StringBuffer(); |
| | | m = P_ENCODE.matcher(s); |
| | | while (m.find()) { |
| | | final String match = m.group(1); |
| | | final int decimal = Integer.valueOf(match, 16).intValue(); |
| | | m.appendReplacement(buf, Matcher.quoteReplacement(chr(decimal))); |
| | | } |
| | | m.appendTail(buf); |
| | | s = buf.toString(); |
| | | |
| | | s = validateEntities(s); |
| | | return s; |
| | | } |
| | | |
| | | private String validateEntities(final String s) { |
| | | StringBuffer buf = new StringBuffer(); |
| | | |
| | | // validate entities throughout the string |
| | | Matcher m = P_VALID_ENTITIES.matcher(s); |
| | | while (m.find()) { |
| | | final String one = m.group(1); //([^&;]*) |
| | | final String two = m.group(2); //(?=(;|&|$)) |
| | | m.appendReplacement(buf, Matcher.quoteReplacement(checkEntity(one, two))); |
| | | } |
| | | m.appendTail(buf); |
| | | |
| | | return encodeQuotes(buf.toString()); |
| | | } |
| | | |
| | | private String encodeQuotes(final String s){ |
| | | if(encodeQuotes){ |
| | | StringBuffer buf = new StringBuffer(); |
| | | Matcher m = P_VALID_QUOTES.matcher(s); |
| | | while (m.find()) { |
| | | final String one = m.group(1); //(>|^) |
| | | final String two = m.group(2); //([^<]+?) |
| | | final String three = m.group(3); //(<|$) |
| | | m.appendReplacement(buf, Matcher.quoteReplacement(one + regexReplace(P_QUOTE, """, two) + three)); |
| | | } |
| | | m.appendTail(buf); |
| | | return buf.toString(); |
| | | }else{ |
| | | return s; |
| | | } |
| | | } |
| | | |
| | | private String checkEntity(final String preamble, final String term) { |
| | | |
| | | return ";".equals(term) && isValidEntity(preamble) |
| | | ? '&' + preamble |
| | | : "&" + preamble; |
| | | } |
| | | |
| | | private boolean isValidEntity(final String entity) { |
| | | return inArray(entity, vAllowedEntities); |
| | | } |
| | | |
| | | private static boolean inArray(final String s, final String[] array) { |
| | | for (String item : array) { |
| | | if (item != null && item.equals(s)) { |
| | | return true; |
| | | } |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | private boolean allowed(final String name) { |
| | | return (vAllowed.isEmpty() || vAllowed.containsKey(name)) && !inArray(name, vDisallowed); |
| | | } |
| | | |
| | | private boolean allowedAttribute(final String name, final String paramName) { |
| | | return allowed(name) && (vAllowed.isEmpty() || vAllowed.get(name).contains(paramName)); |
| | | } |
| | | |
| | | /** |
| | | * 夿æ¯å¦æ¯jsonæ ¼å¼å符串 |
| | | * @param s |
| | | * @return |
| | | */ |
| | | private boolean validateJson(String s) { |
| | | try { |
| | | JSONObject json = JSON.parseObject(s); |
| | | return true; |
| | | } |
| | | catch (Exception e) { |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | private boolean validateJsonArray(String s) { |
| | | try { |
| | | JSONArray json = JSON.parseArray(s); |
| | | return true; |
| | | } |
| | | catch (Exception e) { |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * å¤çäºçº§jsonï¼å¦åä½ç®¡çä¿¡æ¯ |
| | | * @param s |
| | | * @return |
| | | */ |
| | | private Map blanceHtml(String s) { |
| | | Map mapTypes = JSON.parseObject(s); |
| | | for (Object obj : mapTypes.keySet()) { |
| | | // System.out.println("key为ï¼"+obj+"å¼ä¸ºï¼"+mapTypes.get(obj)); |
| | | String str = mapTypes.get(obj) == null ? null : mapTypes.get(obj).toString(); |
| | | boolean flag = false; |
| | | if (str != null && !str.trim().equals("")) { |
| | | flag = validateJson(str); |
| | | } |
| | | if(flag) { |
| | | blanceHtml(str); |
| | | } |
| | | if (str != null && !str.trim().equals("")) { |
| | | //åªè¾å
¥ > ä¼è¢«æ¿æ¢ä¸ºç©ºå符串 |
| | | // str = regexReplace(P_END_ARROW, "", str); |
| | | str = regexReplace(P_BODY_TO_END, "<$1>", str); |
| | | str = regexReplace(P_XML_CONTENT, "$1<$2", str); |
| | | |
| | | //夿æ¯å¦å¯ä»¥æ¿æ¢ä¸ºç©º |
| | | Matcher m = P_TAGS.matcher(str); |
| | | String tt = str; |
| | | while (m.find()) { |
| | | String space = "<" + m.group(1) + ">"; |
| | | tt = tt.replaceFirst(space, ""); |
| | | if (tt.length() > 0) { |
| | | nullOrSpace.add(true); |
| | | } else { |
| | | nullOrSpace.add(false); |
| | | } |
| | | } |
| | | // if(str.indexOf("<") > -1 && str.indexOf(">") > -1) { |
| | | // String space = str.substring(str.indexOf("<") , str.indexOf(">") + 1); |
| | | // space = str.replace(space, ""); |
| | | // if (space.length() > 0) { |
| | | // nullOrSpace.add(true); |
| | | // } else { |
| | | // nullOrSpace.add(false); |
| | | // } |
| | | // } |
| | | mapTypes.replace(obj, str); |
| | | } |
| | | } |
| | | return mapTypes; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.landtool.lanbase.common.xss; |
| | | |
| | | import org.apache.commons.lang.StringUtils; |
| | | |
| | | import com.landtool.lanbase.common.exception.LanbaseException; |
| | | |
| | | /** |
| | | * @author lanbase |
| | | * @Description: TODO(SQLè¿æ»¤) |
| | | * @date 2017-6-23 15:07 |
| | | */ |
| | | public class SQLFilter { |
| | | |
| | | /** |
| | | * SQL注å
¥è¿æ»¤ |
| | | * @param str å¾
éªè¯çå符串 |
| | | */ |
| | | public static String sqlInject(String str){ |
| | | if(StringUtils.isBlank(str)){ |
| | | return null; |
| | | } |
| | | //廿'|"|;|\å符 |
| | | str = StringUtils.replace(str, "'", ""); |
| | | str = StringUtils.replace(str, "\"", ""); |
| | | str = StringUtils.replace(str, ";", ""); |
| | | str = StringUtils.replace(str, "\\", ""); |
| | | |
| | | //è½¬æ¢æå°å |
| | | str = str.toLowerCase(); |
| | | |
| | | //éæ³å符 |
| | | String[] keywords = {"master", "truncate", "insert", "select", "delete", "update", "declare", "alert", "drop"}; |
| | | |
| | | //夿æ¯å¦å
å«éæ³å符 |
| | | for(String keyword : keywords){ |
| | | if(str.indexOf(keyword) != -1){ |
| | | throw new LanbaseException("å
å«éæ³å符"); |
| | | } |
| | | } |
| | | |
| | | return str; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.landtool.lanbase.common.xss; |
| | | |
| | | import java.io.IOException; |
| | | |
| | | import javax.servlet.Filter; |
| | | import javax.servlet.FilterChain; |
| | | import javax.servlet.FilterConfig; |
| | | import javax.servlet.ServletException; |
| | | import javax.servlet.ServletRequest; |
| | | import javax.servlet.ServletResponse; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | |
| | | /** |
| | | * @author lanbase |
| | | * @Description: TODO(XSSè¿æ»¤) |
| | | * @date 2017-6-23 15:07 |
| | | */ |
| | | public class XssFilter implements Filter { |
| | | private Logger logger = LoggerFactory.getLogger(getClass()); |
| | | // æé¤çurl |
| | | private String exclude; |
| | | |
| | | public XssFilter(String exclude) { |
| | | this.exclude = exclude; |
| | | } |
| | | |
| | | @Override |
| | | public void init(FilterConfig config) throws ServletException { |
| | | } |
| | | |
| | | public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) |
| | | throws IOException, ServletException { |
| | | HttpServletRequest httpRequest = (HttpServletRequest) request; |
| | | String uri=httpRequest.getRequestURI(); |
| | | logger.debug("doFilter----uri:" + uri); |
| | | if(uri.indexOf(".") == -1 && !uri.contains(exclude)){ |
| | | XssHttpServletRequestWrapper xssRequest = new XssHttpServletRequestWrapper((HttpServletRequest) request); |
| | | chain.doFilter(xssRequest, response); |
| | | }else{ |
| | | chain.doFilter(request, response); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void destroy() { |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.landtool.lanbase.common.xss; |
| | | |
| | | import java.io.ByteArrayInputStream; |
| | | import java.io.IOException; |
| | | import java.util.LinkedHashMap; |
| | | import java.util.Map; |
| | | |
| | | import javax.servlet.ReadListener; |
| | | import javax.servlet.ServletInputStream; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletRequestWrapper; |
| | | |
| | | import org.apache.commons.io.IOUtils; |
| | | import org.apache.commons.lang.StringUtils; |
| | | import org.springframework.http.HttpHeaders; |
| | | import org.springframework.http.MediaType; |
| | | |
| | | /** |
| | | * @author lanbase |
| | | * @Description: TODO(XSSè¿æ»¤å¤ç) |
| | | * @date 2017-6-23 15:07 |
| | | */ |
| | | public class XssHttpServletRequestWrapper extends HttpServletRequestWrapper { |
| | | //没被å
è£
è¿çHttpServletRequestï¼ç¹æ®åºæ¯ï¼éè¦èªå·±è¿æ»¤ï¼ |
| | | HttpServletRequest orgRequest; |
| | | //htmlè¿æ»¤ |
| | | private final static HTMLFilter htmlFilter = new HTMLFilter(); |
| | | |
| | | public XssHttpServletRequestWrapper(HttpServletRequest request) { |
| | | super(request); |
| | | orgRequest = request; |
| | | } |
| | | |
| | | @Override |
| | | public ServletInputStream getInputStream() throws IOException { |
| | | //éjsonç±»åï¼ç´æ¥è¿å |
| | | if(!MediaType.APPLICATION_JSON_VALUE.equalsIgnoreCase(super.getHeader(HttpHeaders.CONTENT_TYPE))){ |
| | | return super.getInputStream(); |
| | | } |
| | | |
| | | //为空ï¼ç´æ¥è¿å |
| | | String json = IOUtils.toString(super.getInputStream(), "utf-8"); |
| | | if (StringUtils.isBlank(json)) { |
| | | return super.getInputStream(); |
| | | } |
| | | |
| | | //xssè¿æ»¤ |
| | | json = xssEncode(json); |
| | | final ByteArrayInputStream bis = new ByteArrayInputStream(json.getBytes("utf-8")); |
| | | return new ServletInputStream() { |
| | | @Override |
| | | public boolean isFinished() { |
| | | return true; |
| | | } |
| | | |
| | | @Override |
| | | public boolean isReady() { |
| | | return true; |
| | | } |
| | | |
| | | @Override |
| | | public void setReadListener(ReadListener readListener) { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public int read() throws IOException { |
| | | return bis.read(); |
| | | } |
| | | }; |
| | | } |
| | | |
| | | @Override |
| | | public String getParameter(String name) { |
| | | String value = super.getParameter(xssEncode(name)); |
| | | if (StringUtils.isNotBlank(value)) { |
| | | value = xssEncode(value); |
| | | } |
| | | return value; |
| | | } |
| | | |
| | | @Override |
| | | public String[] getParameterValues(String name) { |
| | | String[] parameters = super.getParameterValues(name); |
| | | if (parameters == null || parameters.length == 0) { |
| | | return null; |
| | | } |
| | | |
| | | for (int i = 0; i < parameters.length; i++) { |
| | | parameters[i] = xssEncode(parameters[i]); |
| | | } |
| | | return parameters; |
| | | } |
| | | |
| | | @Override |
| | | public Map<String,String[]> getParameterMap() { |
| | | Map<String,String[]> map = new LinkedHashMap<>(); |
| | | Map<String,String[]> parameters = super.getParameterMap(); |
| | | for (String key : parameters.keySet()) { |
| | | String[] values = parameters.get(key); |
| | | for (int i = 0; i < values.length; i++) { |
| | | values[i] = xssEncode(values[i]); |
| | | } |
| | | map.put(key, values); |
| | | } |
| | | return map; |
| | | } |
| | | |
| | | @Override |
| | | public String getHeader(String name) { |
| | | String value = super.getHeader(xssEncode(name)); |
| | | if (StringUtils.isNotBlank(value)) { |
| | | value = xssEncode(value); |
| | | } |
| | | return value; |
| | | } |
| | | |
| | | private String xssEncode(String input) { |
| | | return htmlFilter.filter(input); |
| | | } |
| | | |
| | | /** |
| | | * è·åæåå§çrequest |
| | | */ |
| | | public HttpServletRequest getOrgRequest() { |
| | | return orgRequest; |
| | | } |
| | | |
| | | /** |
| | | * è·åæåå§çrequest |
| | | */ |
| | | public static HttpServletRequest getOrgRequest(HttpServletRequest request) { |
| | | if (request instanceof XssHttpServletRequestWrapper) { |
| | | return ((XssHttpServletRequestWrapper) request).getOrgRequest(); |
| | | } |
| | | |
| | | return request; |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.landtool.lanbase.config; |
| | | |
| | | import org.springframework.context.annotation.Configuration; |
| | | import org.springframework.web.servlet.config.annotation.CorsRegistry; |
| | | import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; |
| | | |
| | | /** |
| | | * |
| | | * @author TanBin |
| | | * |
| | | */ |
| | | @Configuration |
| | | public class CORSConfiguration extends WebMvcConfigurerAdapter { |
| | | @Override |
| | | public void addCorsMappings(CorsRegistry registry){ |
| | | registry.addMapping("/**") |
| | | .allowedMethods("*") |
| | | .allowedOrigins("*") |
| | | .allowCredentials(true) |
| | | .allowedHeaders("*"); |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | //package com.landtool.lanbase.config; |
| | | // |
| | | //import javax.net.ssl.HostnameVerifier; |
| | | //import javax.net.ssl.HttpsURLConnection; |
| | | //import javax.net.ssl.SSLSession; |
| | | // |
| | | //import org.jasig.cas.client.session.SingleSignOutFilter; |
| | | //import org.jasig.cas.client.session.SingleSignOutHttpSessionListener; |
| | | //import org.jasig.cas.client.util.AssertionThreadLocalFilter; |
| | | //import org.jasig.cas.client.util.HttpServletRequestWrapperFilter; |
| | | //import org.jasig.cas.client.validation.Cas20ProxyReceivingTicketValidationFilter; |
| | | //import org.springframework.beans.factory.annotation.Autowired; |
| | | //import org.springframework.beans.factory.annotation.Value; |
| | | //import org.springframework.boot.web.servlet.FilterRegistrationBean; |
| | | //import org.springframework.boot.web.servlet.ServletListenerRegistrationBean; |
| | | //import org.springframework.context.annotation.Bean; |
| | | //import org.springframework.context.annotation.Configuration; |
| | | //import org.springframework.security.web.authentication.logout.LogoutFilter; |
| | | //import org.springframework.security.web.authentication.logout.SecurityContextLogoutHandler; |
| | | // |
| | | //import com.landtool.lanbase.common.shiro.CasAuthenticationFilter; |
| | | // |
| | | //@Configuration |
| | | //public class CasConfig { |
| | | // |
| | | // @Autowired |
| | | // CasConfigProperties config; |
| | | // |
| | | // // æ¯å¦å¼å¯CASè¿æ»¤ trueå¼å¯ falseå
³é |
| | | // @Value("${spring.cas.casEnabled: #{false}}") |
| | | // private boolean casEnabled; |
| | | // // private static boolean casEnabled = true; |
| | | // |
| | | // public CasConfig() { |
| | | // } |
| | | // |
| | | // @Bean |
| | | // public CasConfigProperties getCasConfigProperties() { |
| | | // return new CasConfigProperties(); |
| | | // } |
| | | // |
| | | // /** |
| | | // * ç¨äºå®ç°åç¹ç»åºåè½ |
| | | // */ |
| | | // @Bean |
| | | // public ServletListenerRegistrationBean<SingleSignOutHttpSessionListener> singleSignOutHttpSessionListener() { |
| | | // ServletListenerRegistrationBean<SingleSignOutHttpSessionListener> listener = new ServletListenerRegistrationBean<>(); |
| | | // listener.setEnabled(casEnabled); |
| | | // listener.setListener(new SingleSignOutHttpSessionListener()); |
| | | // listener.setOrder(1); |
| | | // return listener; |
| | | // } |
| | | // |
| | | // /** |
| | | // * è¯¥è¿æ»¤å¨ç¨äºå®ç°åç¹ç»åºåè½ï¼åç¹éåºé
ç½®ï¼ä¸å®è¦æ¾å¨å
¶ä»filterä¹å |
| | | // */ |
| | | // @Bean |
| | | // public FilterRegistrationBean logOutFilter() { |
| | | // FilterRegistrationBean filterRegistration = new FilterRegistrationBean(); |
| | | // LogoutFilter logoutFilter = new LogoutFilter( |
| | | // config.getCasServerUrlPrefix() + "/logout?service=" + config.getServerName(), |
| | | // new SecurityContextLogoutHandler()); |
| | | // filterRegistration.setFilter(logoutFilter); |
| | | // filterRegistration.setEnabled(casEnabled); |
| | | // if (config.getSignOutFilters().size() > 0) { |
| | | // filterRegistration.setUrlPatterns(config.getSignOutFilters()); |
| | | // } else { |
| | | // filterRegistration.addUrlPatterns("/logout"); |
| | | // } |
| | | // filterRegistration.addInitParameter("casServerUrlPrefix", config.getCasServerUrlPrefix()); |
| | | // filterRegistration.addInitParameter("serverName", config.getServerName()); |
| | | // filterRegistration.setOrder(2); |
| | | // return filterRegistration; |
| | | // } |
| | | // |
| | | // /** |
| | | // * è¯¥è¿æ»¤å¨ç¨äºå®ç°åç¹ç»åºåè½ï¼åç¹éåºé
ç½®ï¼ä¸å®è¦æ¾å¨å
¶ä»filterä¹å |
| | | // */ |
| | | // @Bean |
| | | // public FilterRegistrationBean singleSignOutFilter() { |
| | | // FilterRegistrationBean filterRegistration = new FilterRegistrationBean(); |
| | | // filterRegistration.setFilter(new SingleSignOutFilter()); |
| | | // filterRegistration.setEnabled(casEnabled); |
| | | // if (config.getSignOutFilters().size() > 0) { |
| | | // filterRegistration.setUrlPatterns(config.getSignOutFilters()); |
| | | // } else { |
| | | // filterRegistration.addUrlPatterns("/*"); |
| | | // } |
| | | // filterRegistration.addInitParameter("casServerUrlPrefix", config.getCasServerUrlPrefix()); |
| | | // filterRegistration.addInitParameter("serverName", config.getServerName()); |
| | | // filterRegistration.setOrder(3); |
| | | // return filterRegistration; |
| | | // } |
| | | // |
| | | // /** |
| | | // * è¯¥è¿æ»¤å¨è´è´£ç¨æ·ç认è¯å·¥ä½ |
| | | // */ |
| | | // @Bean |
| | | // public FilterRegistrationBean authenticationFilter() { |
| | | // FilterRegistrationBean filterRegistration = new FilterRegistrationBean(); |
| | | // filterRegistration.setFilter(new CasAuthenticationFilter()); |
| | | // filterRegistration.setEnabled(casEnabled); |
| | | // if (config.getAuthFilters().size() > 0) { |
| | | // filterRegistration.setUrlPatterns(config.getAuthFilters()); |
| | | // } else { |
| | | // filterRegistration.addUrlPatterns("/*"); |
| | | // } |
| | | // // casServerLoginUrl:casæå¡çç»éurl |
| | | // filterRegistration.addInitParameter("casServerLoginUrl", config.getCasServerLoginUrl()); |
| | | // // æ¬é¡¹ç®ç»å½ip+port |
| | | // filterRegistration.addInitParameter("serverName", config.getServerName()); |
| | | // filterRegistration.addInitParameter("useSession", config.isUseSession() ? "true" : "false"); |
| | | // filterRegistration.addInitParameter("redirectAfterValidation", |
| | | // config.isRedirectAfterValidation() ? "true" : "false"); |
| | | // filterRegistration.setOrder(4); |
| | | // return filterRegistration; |
| | | // } |
| | | // |
| | | // /** |
| | | // * è¯¥è¿æ»¤å¨è´è´£å¯¹Ticketçæ ¡éªå·¥ä½ |
| | | // */ |
| | | // @Bean |
| | | // public FilterRegistrationBean cas20ProxyReceivingTicketValidationFilter() { |
| | | // |
| | | // try { |
| | | // trustAllHttpsCertificates(); |
| | | // HttpsURLConnection.setDefaultHostnameVerifier(hv); |
| | | // } catch (Exception e) { |
| | | // // TODO Auto-generated catch block |
| | | // e.printStackTrace(); |
| | | // } |
| | | // |
| | | // FilterRegistrationBean filterRegistration = new FilterRegistrationBean(); |
| | | // Cas20ProxyReceivingTicketValidationFilter cas20ProxyReceivingTicketValidationFilter = new Cas20ProxyReceivingTicketValidationFilter(); |
| | | // // cas20ProxyReceivingTicketValidationFilter.setTicketValidator(cas20ServiceTicketValidator()); |
| | | // cas20ProxyReceivingTicketValidationFilter.setServerName(config.getServerName()); |
| | | // filterRegistration.setFilter(cas20ProxyReceivingTicketValidationFilter); |
| | | // filterRegistration.setEnabled(casEnabled); |
| | | // if (config.getValidateFilters().size() > 0) { |
| | | // filterRegistration.setUrlPatterns(config.getValidateFilters()); |
| | | // } else { |
| | | // filterRegistration.addUrlPatterns("/*"); |
| | | // } |
| | | // filterRegistration.addInitParameter("casServerUrlPrefix", config.getCasServerUrlPrefix()); |
| | | // filterRegistration.addInitParameter("serverName", config.getServerName()); |
| | | // filterRegistration.setOrder(5); |
| | | // return filterRegistration; |
| | | // } |
| | | // |
| | | // /** |
| | | // * è¯¥è¿æ»¤å¨å¯¹HttpServletRequest请æ±å
è£
ï¼ |
| | | // * å¯éè¿HttpServletRequestçgetRemoteUser()æ¹æ³è·å¾ç»å½ç¨æ·çç»å½å |
| | | // * |
| | | // */ |
| | | // @Bean |
| | | // public FilterRegistrationBean httpServletRequestWrapperFilter() { |
| | | // FilterRegistrationBean filterRegistration = new FilterRegistrationBean(); |
| | | // filterRegistration.setFilter(new HttpServletRequestWrapperFilter()); |
| | | // filterRegistration.setEnabled(true); |
| | | // if (config.getRequestWrapperFilters().size() > 0) { |
| | | // filterRegistration.setUrlPatterns(config.getRequestWrapperFilters()); |
| | | // } else { |
| | | // filterRegistration.addUrlPatterns("/*"); |
| | | // } |
| | | // filterRegistration.setOrder(6); |
| | | // return filterRegistration; |
| | | // } |
| | | // |
| | | // /** |
| | | // * è¯¥è¿æ»¤å¨ä½¿å¾å¯ä»¥éè¿org.jasig.cas.client.util.AssertionHolderæ¥è·åç¨æ·çç»å½åã |
| | | // * æ¯å¦AssertionHolder.getAssertion().getPrincipal().getName()ã |
| | | // * è¿ä¸ªç±»æAssertionä¿¡æ¯æ¾å¨ThreadLocalåéä¸ï¼è¿æ ·åºç¨ç¨åºä¸å¨webå±ä¹è½å¤è·åå°å½åç»å½ä¿¡æ¯ |
| | | // */ |
| | | // @Bean |
| | | // public FilterRegistrationBean assertionThreadLocalFilter() { |
| | | // FilterRegistrationBean filterRegistration = new FilterRegistrationBean(); |
| | | // filterRegistration.setFilter(new AssertionThreadLocalFilter()); |
| | | // filterRegistration.setEnabled(true); |
| | | // if (config.getAssertionFilters().size() > 0) { |
| | | // filterRegistration.setUrlPatterns(config.getAssertionFilters()); |
| | | // } else { |
| | | // filterRegistration.addUrlPatterns("/*"); |
| | | // } |
| | | // filterRegistration.setOrder(7); |
| | | // return filterRegistration; |
| | | // } |
| | | // |
| | | // HostnameVerifier hv = new HostnameVerifier() { |
| | | // public boolean verify(String urlHostName, SSLSession session) { |
| | | // System.out.println("Warning: URL Host: " + urlHostName + " vs. " + session.getPeerHost()); |
| | | // return true; |
| | | // } |
| | | // }; |
| | | // |
| | | // private static void trustAllHttpsCertificates() throws Exception { |
| | | // javax.net.ssl.TrustManager[] trustAllCerts = new javax.net.ssl.TrustManager[1]; |
| | | // javax.net.ssl.TrustManager tm = new miTM(); |
| | | // trustAllCerts[0] = tm; |
| | | // javax.net.ssl.SSLContext sc = javax.net.ssl.SSLContext.getInstance("SSL"); |
| | | // sc.init(null, trustAllCerts, null); |
| | | // javax.net.ssl.HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory()); |
| | | // } |
| | | // |
| | | // static class miTM implements javax.net.ssl.TrustManager, javax.net.ssl.X509TrustManager { |
| | | // public java.security.cert.X509Certificate[] getAcceptedIssuers() { |
| | | // return null; |
| | | // } |
| | | // |
| | | // public boolean isServerTrusted(java.security.cert.X509Certificate[] certs) { |
| | | // return true; |
| | | // } |
| | | // |
| | | // public boolean isClientTrusted(java.security.cert.X509Certificate[] certs) { |
| | | // return true; |
| | | // } |
| | | // |
| | | // public void checkServerTrusted(java.security.cert.X509Certificate[] certs, String authType) |
| | | // throws java.security.cert.CertificateException { |
| | | // return; |
| | | // } |
| | | // |
| | | // public void checkClientTrusted(java.security.cert.X509Certificate[] certs, String authType) |
| | | // throws java.security.cert.CertificateException { |
| | | // return; |
| | | // } |
| | | // } |
| | | // |
| | | //} |
¶Ô±ÈÐÂÎļþ |
| | |
| | | //package com.landtool.lanbase.config; |
| | | // |
| | | //import java.util.Arrays; |
| | | //import java.util.List; |
| | | // |
| | | //import org.springframework.boot.context.properties.ConfigurationProperties; |
| | | // |
| | | //@ConfigurationProperties(prefix = "spring.cas") |
| | | //public class CasConfigProperties { |
| | | // |
| | | // static final String separator = ","; |
| | | // |
| | | // private String validateFilters; |
| | | // private String signOutFilters; |
| | | // private String authFilters; |
| | | // private String assertionFilters; |
| | | // private String requestWrapperFilters; |
| | | // |
| | | // private String casServerUrlPrefix; |
| | | // private String casServerLoginUrl; |
| | | // private String serverName; |
| | | // private boolean useSession = true; |
| | | // private boolean redirectAfterValidation = true; |
| | | // |
| | | // public List<String> getValidateFilters() { |
| | | // return Arrays.asList(validateFilters.split(separator)); |
| | | // } |
| | | // public void setValidateFilters(String validateFilters) { |
| | | // this.validateFilters = validateFilters; |
| | | // } |
| | | // public List<String> getSignOutFilters() { |
| | | // return Arrays.asList(signOutFilters.split(separator)); |
| | | // } |
| | | // public void setSignOutFilters(String signOutFilters) { |
| | | // this.signOutFilters = signOutFilters; |
| | | // } |
| | | // public List<String> getAuthFilters() { |
| | | // return Arrays.asList(authFilters.split(separator)); |
| | | // } |
| | | // public void setAuthFilters(String authFilters) { |
| | | // this.authFilters = authFilters; |
| | | // } |
| | | // public List<String> getAssertionFilters() { |
| | | // return Arrays.asList(assertionFilters.split(separator)); |
| | | // } |
| | | // public void setAssertionFilters(String assertionFilters) { |
| | | // this.assertionFilters = assertionFilters; |
| | | // } |
| | | // public List<String> getRequestWrapperFilters() { |
| | | // return Arrays.asList(requestWrapperFilters.split(separator)); |
| | | // } |
| | | // public void setRequestWrapperFilters(String requestWrapperFilters) { |
| | | // this.requestWrapperFilters = requestWrapperFilters; |
| | | // } |
| | | // public String getCasServerUrlPrefix() { |
| | | // return casServerUrlPrefix; |
| | | // } |
| | | // public void setCasServerUrlPrefix(String casServerUrlPrefix) { |
| | | // this.casServerUrlPrefix = casServerUrlPrefix; |
| | | // } |
| | | // public String getCasServerLoginUrl() { |
| | | // return casServerLoginUrl; |
| | | // } |
| | | // public void setCasServerLoginUrl(String casServerLoginUrl) { |
| | | // this.casServerLoginUrl = casServerLoginUrl; |
| | | // } |
| | | // public String getServerName() { |
| | | // return serverName; |
| | | // } |
| | | // public void setServerName(String serverName) { |
| | | // this.serverName = serverName; |
| | | // } |
| | | // public boolean isRedirectAfterValidation() { |
| | | // return redirectAfterValidation; |
| | | // } |
| | | // public void setRedirectAfterValidation(boolean redirectAfterValidation) { |
| | | // this.redirectAfterValidation = redirectAfterValidation; |
| | | // } |
| | | // public boolean isUseSession() { |
| | | // return useSession; |
| | | // } |
| | | // public void setUseSession(boolean useSession) { |
| | | // this.useSession = useSession; |
| | | // } |
| | | // |
| | | //} |
¶Ô±ÈÐÂÎļþ |
| | |
| | | //package com.landtool.lanbase.config; |
| | | // |
| | | // |
| | | //import org.springframework.context.annotation.Bean; |
| | | //import org.springframework.context.annotation.Configuration; |
| | | //import org.springframework.web.cors.CorsConfiguration; |
| | | //import org.springframework.web.cors.UrlBasedCorsConfigurationSource; |
| | | //import org.springframework.web.filter.CorsFilter; |
| | | // |
| | | //@Configuration |
| | | //public class Corsconfig { |
| | | // |
| | | // |
| | | // private CorsConfiguration buildConfig(){ |
| | | // CorsConfiguration cors=new CorsConfiguration(); |
| | | // cors.addAllowedHeader("*"); |
| | | // cors.addAllowedMethod("*"); |
| | | // cors.addAllowedOrigin("*"); |
| | | // return cors; |
| | | // } |
| | | // |
| | | // @Bean |
| | | // public CorsFilter corsFilter(){ |
| | | // UrlBasedCorsConfigurationSource source=new UrlBasedCorsConfigurationSource(); |
| | | // source.registerCorsConfiguration("/**", buildConfig()); |
| | | // return new CorsFilter(source); |
| | | // } |
| | | //} |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.landtool.lanbase.config; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | import javax.sql.DataSource; |
| | | |
| | | import org.springframework.boot.context.properties.ConfigurationProperties; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | import org.springframework.context.annotation.Primary; |
| | | |
| | | import com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceBuilder; |
| | | import com.landtool.lanbase.common.datasource.DataSourceNames; |
| | | import com.landtool.lanbase.common.datasource.DynamicDataSource; |
| | | |
| | | /** |
| | | * @author lanbase |
| | | * @Description: TODO(é
ç½®å¤æ°æ®æº) |
| | | * @date 2017-6-23 15:07 |
| | | */ |
| | | @Configuration |
| | | public class DynamicDataSourceConfig { |
| | | |
| | | @Bean |
| | | @ConfigurationProperties("spring.datasource.druid.first") |
| | | public DataSource firstDataSource(){ |
| | | return DruidDataSourceBuilder.create().build(); |
| | | } |
| | | |
| | | @Bean |
| | | @Primary |
| | | public DynamicDataSource dataSource(DataSource firstDataSource) { |
| | | Map<String, DataSource> targetDataSources = new HashMap<>(); |
| | | targetDataSources.put(DataSourceNames.FIRST, firstDataSource); |
| | | return new DynamicDataSource(firstDataSource, targetDataSources); |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.landtool.lanbase.config; |
| | | |
| | | import java.util.Properties; |
| | | |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | |
| | | import com.google.code.kaptcha.impl.DefaultKaptcha; |
| | | import com.google.code.kaptcha.util.Config; |
| | | |
| | | /** |
| | | * @author lanbase |
| | | * @Description: TODO(çæéªè¯ç é
ç½®) |
| | | * @date 2017-6-23 15:07 |
| | | */ |
| | | @Configuration |
| | | public class KaptchaConfig { |
| | | |
| | | @Bean |
| | | public DefaultKaptcha producer() { |
| | | Properties properties = new Properties(); |
| | | properties.put("kaptcha.border", "no"); |
| | | properties.put("kaptcha.textproducer.font.color", "black"); |
| | | properties.put("kaptcha.textproducer.char.space", "5"); |
| | | properties.put("kaptcha.textproducer.char.length", "4"); |
| | | Config config = new Config(properties); |
| | | DefaultKaptcha defaultKaptcha = new DefaultKaptcha(); |
| | | defaultKaptcha.setConfig(config); |
| | | return defaultKaptcha; |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.landtool.lanbase.config; |
| | | |
| | | import org.springframework.boot.context.properties.ConfigurationProperties; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | @Component |
| | | @ConfigurationProperties(prefix = "sys") |
| | | public class LoginConfigProperties { |
| | | private long appId; |
| | | private String appFullName; |
| | | public long getAppId() { |
| | | return appId; |
| | | } |
| | | public void setAppId(long appId) { |
| | | this.appId = appId; |
| | | } |
| | | public String getAppFullName() { |
| | | return appFullName; |
| | | } |
| | | public void setAppFullName(String appFullName) { |
| | | this.appFullName = appFullName; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.landtool.lanbase.config; |
| | | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | import org.springframework.data.redis.connection.RedisConnectionFactory; |
| | | import org.springframework.data.redis.core.HashOperations; |
| | | import org.springframework.data.redis.core.ListOperations; |
| | | import org.springframework.data.redis.core.RedisTemplate; |
| | | import org.springframework.data.redis.core.SetOperations; |
| | | import org.springframework.data.redis.core.ValueOperations; |
| | | import org.springframework.data.redis.core.ZSetOperations; |
| | | import org.springframework.data.redis.serializer.StringRedisSerializer; |
| | | |
| | | /** |
| | | * @author lanbase |
| | | * @Description: TODO(Redisé
ç½®) |
| | | * @date 2017-6-23 15:07 |
| | | */ |
| | | @Configuration |
| | | public class RedisConfig { |
| | | |
| | | @Autowired |
| | | private RedisConnectionFactory factory; |
| | | |
| | | @Bean |
| | | public RedisTemplate<String, Object> redisTemplate() { |
| | | RedisTemplate<String, Object> redisTemplate = new RedisTemplate<>(); |
| | | redisTemplate.setKeySerializer(new StringRedisSerializer()); |
| | | redisTemplate.setHashKeySerializer(new StringRedisSerializer()); |
| | | redisTemplate.setHashValueSerializer(new StringRedisSerializer()); |
| | | redisTemplate.setValueSerializer(new StringRedisSerializer()); |
| | | redisTemplate.setConnectionFactory(factory); |
| | | return redisTemplate; |
| | | } |
| | | |
| | | @Bean |
| | | public HashOperations<String, String, Object> hashOperations(RedisTemplate<String, Object> redisTemplate) { |
| | | return redisTemplate.opsForHash(); |
| | | } |
| | | |
| | | @Bean |
| | | public ValueOperations<String, String> valueOperations(RedisTemplate<String, String> redisTemplate) { |
| | | return redisTemplate.opsForValue(); |
| | | } |
| | | |
| | | @Bean |
| | | public ListOperations<String, Object> listOperations(RedisTemplate<String, Object> redisTemplate) { |
| | | return redisTemplate.opsForList(); |
| | | } |
| | | |
| | | @Bean |
| | | public SetOperations<String, Object> setOperations(RedisTemplate<String, Object> redisTemplate) { |
| | | return redisTemplate.opsForSet(); |
| | | } |
| | | |
| | | @Bean |
| | | public ZSetOperations<String, Object> zSetOperations(RedisTemplate<String, Object> redisTemplate) { |
| | | return redisTemplate.opsForZSet(); |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.landtool.lanbase.config; |
| | | |
| | | import org.apache.shiro.mgt.SecurityManager; |
| | | import org.apache.shiro.session.mgt.SessionManager; |
| | | import org.apache.shiro.spring.LifecycleBeanPostProcessor; |
| | | import org.apache.shiro.spring.security.interceptor.AuthorizationAttributeSourceAdvisor; |
| | | import org.apache.shiro.spring.web.ShiroFilterFactoryBean; |
| | | import org.apache.shiro.web.mgt.DefaultWebSecurityManager; |
| | | import org.apache.shiro.web.session.mgt.DefaultWebSessionManager; |
| | | import org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | |
| | | import com.landtool.lanbase.common.shiro.ShiroAuthenticatingFilter; |
| | | import com.landtool.lanbase.common.shiro.ShiroRealm; |
| | | import org.springframework.context.support.PropertySourcesPlaceholderConfigurer; |
| | | |
| | | import javax.servlet.Filter; |
| | | import java.util.HashMap; |
| | | import java.util.LinkedHashMap; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author lanbase |
| | | * @Description: TODO(Shiroé
ç½®) |
| | | * @date 2017-6-23 15:07 |
| | | */ |
| | | @Configuration |
| | | public class ShiroConfig { |
| | | @Value("${sys.loginUrl}") private String loginUrl;// http://127.0.0.1:8082/login |
| | | @Value("${sys.casHost}") private String casHost;// https://cas.nmsmp.com/cas/ |
| | | |
| | | @Bean("sessionManager") |
| | | public SessionManager sessionManager(){ |
| | | DefaultWebSessionManager sessionManager = new DefaultWebSessionManager(); |
| | | sessionManager.setSessionValidationSchedulerEnabled(true); |
| | | sessionManager.setSessionIdUrlRewritingEnabled(true); |
| | | sessionManager.setSessionIdCookieEnabled(true); |
| | | sessionManager.setGlobalSessionTimeout(1800000L); |
| | | return sessionManager; |
| | | } |
| | | |
| | | @Bean("securityManager") |
| | | public SecurityManager securityManager(ShiroRealm shiroRealm, SessionManager sessionManager) { |
| | | DefaultWebSecurityManager securityManager = new DefaultWebSecurityManager(); |
| | | securityManager.setRealm(shiroRealm); |
| | | securityManager.setSessionManager(sessionManager); |
| | | return securityManager; |
| | | } |
| | | |
| | | @Bean("shiroFilter") |
| | | public ShiroFilterFactoryBean shirFilter(SecurityManager securityManager) { |
| | | ShiroFilterFactoryBean shiroFilter = new ShiroFilterFactoryBean(); |
| | | shiroFilter.setSecurityManager(securityManager); |
| | | |
| | | //è¿æ»¤ |
| | | Map<String, Filter> filters = new HashMap<>(); |
| | | filters.put("shiro", new ShiroAuthenticatingFilter(loginUrl,casHost)); |
| | | shiroFilter.setFilters(filters); |
| | | |
| | | Map<String, String> filterMap = new LinkedHashMap<>(); |
| | | |
| | | //filterMap.put("/geoplat/**", "anon"); |
| | | |
| | | //api |
| | | filterMap.put("/api/**", "anon"); |
| | | //swagger |
| | | filterMap.put("/swagger-resources/**", "anon"); |
| | | filterMap.put("/v2/**", "anon"); |
| | | filterMap.put("/webjars/**", "anon"); |
| | | //index |
| | | //filterMap.put("/", "anon"); |
| | | filterMap.put("/index", "anon"); |
| | | filterMap.put("/sys/error", "anon"); |
| | | //login |
| | | filterMap.put("/login", "anon"); |
| | | filterMap.put("/logout", "anon"); |
| | | filterMap.put("/captcha.jpg", "anon"); |
| | | //static |
| | | filterMap.put("/**/*.css", "anon"); |
| | | filterMap.put("/**/*.js", "anon"); |
| | | filterMap.put("/**/*.html", "anon"); |
| | | filterMap.put("/fonts/**", "anon"); |
| | | filterMap.put("/image/**", "anon"); |
| | | filterMap.put("/plugins/**", "anon"); |
| | | filterMap.put("/favicon.ico", "anon"); |
| | | //other |
| | | filterMap.put("/**/druid/**", "anon"); |
| | | filterMap.put("/ZiYuanIcon/**", "anon"); |
| | | filterMap.put("/uploadPath/**", "anon");//ä¸ä¼ æä»¶æ å°çå°å |
| | | |
| | | //shiro |
| | | //filterMap.put("/**", "authc"); |
| | | filterMap.put("/**", "shiro"); |
| | | //String url = "https://www.lt.com:8443/cas/login?service=http://127.0.0.1:8082/login"; |
| | | |
| | | //String url = loginUrl; |
| | | //shiroFilter.setLoginUrl(url); |
| | | // ç»å½æååè¦è·³è½¬ç龿¥ |
| | | shiroFilter.setSuccessUrl("/index"); |
| | | |
| | | shiroFilter.setFilterChainDefinitionMap(filterMap); |
| | | |
| | | return shiroFilter; |
| | | } |
| | | |
| | | @Bean("lifecycleBeanPostProcessor") |
| | | public static LifecycleBeanPostProcessor lifecycleBeanPostProcessor() { |
| | | return new LifecycleBeanPostProcessor(); |
| | | } |
| | | |
| | | @Bean |
| | | public DefaultAdvisorAutoProxyCreator defaultAdvisorAutoProxyCreator() { |
| | | DefaultAdvisorAutoProxyCreator proxyCreator = new DefaultAdvisorAutoProxyCreator(); |
| | | proxyCreator.setProxyTargetClass(true); |
| | | return proxyCreator; |
| | | } |
| | | |
| | | @Bean |
| | | public AuthorizationAttributeSourceAdvisor authorizationAttributeSourceAdvisor(SecurityManager securityManager) { |
| | | AuthorizationAttributeSourceAdvisor advisor = new AuthorizationAttributeSourceAdvisor(); |
| | | advisor.setSecurityManager(securityManager); |
| | | return advisor; |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.landtool.lanbase.config; |
| | | |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | |
| | | import springfox.documentation.builders.ApiInfoBuilder; |
| | | import springfox.documentation.builders.PathSelectors; |
| | | import springfox.documentation.builders.RequestHandlerSelectors; |
| | | import springfox.documentation.service.ApiInfo; |
| | | import springfox.documentation.spi.DocumentationType; |
| | | import springfox.documentation.spring.web.plugins.Docket; |
| | | import springfox.documentation.swagger2.annotations.EnableSwagger2; |
| | | |
| | | /** |
| | | * @author lanbase |
| | | * @Description: TODO(Swagger2é
ç½®) |
| | | * @date 2017-10-31 16:17 |
| | | */ |
| | | @Configuration |
| | | @EnableSwagger2 |
| | | public class Swagger2Config { |
| | | //basePackage |
| | | @Value("${sys.swagger.basePackage}") |
| | | private String basePackage; |
| | | |
| | | @Bean |
| | | public Docket createRestApi() { |
| | | return new Docket(DocumentationType.SWAGGER_2) |
| | | .apiInfo(apiInfo()) |
| | | .select() |
| | | .apis(RequestHandlerSelectors.basePackage(basePackage)) |
| | | .paths(PathSelectors.any()) |
| | | .build(); |
| | | } |
| | | |
| | | private ApiInfo apiInfo() { |
| | | return new ApiInfoBuilder() |
| | | .title("åå°ç®¡çAPIææ¡£") |
| | | // .description("æ´å¤èµè®¯è¯·ç¹å» http://www.landtool.com") |
| | | // .termsOfServiceUrl("http://www.landtool.com") |
| | | .version("1.0") |
| | | .build(); |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.landtool.lanbase.config; |
| | | |
| | | import org.springframework.boot.context.properties.ConfigurationProperties; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | /** |
| | | * Created by Administrator on 2018/3/6. |
| | | */ |
| | | @Component |
| | | @ConfigurationProperties(prefix = "sys") |
| | | public class SysTemPropertyConfig { |
| | | private String uploadPath; |
| | | private long appId; //ç³»ç»ID |
| | | private String appFullName; //ç³»ç»åç§° |
| | | private String apiServer; |
| | | private String tokenWebRoot; //tokenè·åæå¡å°å |
| | | private String apptokenWebRoot; //apptokenè·åæå¡å°å |
| | | private String pubzyWebRoot; //å
Œ
±èµæºåºå°å |
| | | private String loginUrl; //casç»å½url |
| | | private String casHost; //casç»å½åå |
| | | private String gisPortal; //å°å¾URL |
| | | private String esbHost; //Esbæ¿æ¢ |
| | | private String esbWebServiceHost; //Esbæ¿æ¢ |
| | | private String esbUrl; |
| | | private String srHost; //æ³°çæå¡ä»£çhost |
| | | private String srUrl; //æ³°çæå¡ä»£çurl |
| | | private String terraTokenWebRoot; |
| | | private String obtainExtentMapUrl; //æ¡éå°å¾åºå¾URL |
| | | private String uploadRootPath; |
| | | private String uploadTemplatesPath; //模æ¿ä¸ä¼ è·¯å¾ |
| | | private String videoUrl; |
| | | private String ipHost; |
| | | private String gisHost; |
| | | private String proxyUrl; |
| | | private String templateParamsURL;//åºå¾æ¨¡æ¿åæ°èªå¨è·åæå¡å°å |
| | | private String ncFileConfigURL;//ncæä»¶é
ç½®è·åæå¡å°å |
| | | private String readNcFileURL;//è§£æncæä»¶çæjsonæå¡å°å |
| | | private String ncStorageUrl;//ncå
¥åºæå¡å°å |
| | | private String uploadRestemplateURL;//åºå¾æ¨¡æ¿ä¸ä¼ æå¡å°å |
| | | private String deleteRestemplateURL;//åºå¾æ¨¡æ¿å 餿å¡å°å |
| | | private int sessionTimeOut=1800;// session è¶
æ¶æ¶é´ åä½ç§ |
| | | |
| | | |
| | | public String getTerraTokenWebRoot() { |
| | | return terraTokenWebRoot; |
| | | } |
| | | |
| | | public void setTerraTokenWebRoot(String terraTokenWebRoot) { |
| | | this.terraTokenWebRoot = terraTokenWebRoot; |
| | | } |
| | | |
| | | public String getSrHost() { |
| | | return srHost; |
| | | } |
| | | |
| | | public void setSrHost(String srHost) { |
| | | this.srHost = srHost; |
| | | } |
| | | |
| | | public String getSrUrl() { |
| | | return srUrl; |
| | | } |
| | | |
| | | public void setSrUrl(String srUrl) { |
| | | this.srUrl = srUrl; |
| | | } |
| | | |
| | | public int getSessionTimeOut() { |
| | | return sessionTimeOut; |
| | | } |
| | | |
| | | public void setSessionTimeOut(int sessionTimeOut) { |
| | | this.sessionTimeOut = sessionTimeOut; |
| | | } |
| | | |
| | | |
| | | public String getPubzyWebRoot() { |
| | | return pubzyWebRoot; |
| | | } |
| | | |
| | | public void setPubzyWebRoot(String pubzyWebRoot) { |
| | | this.pubzyWebRoot = pubzyWebRoot; |
| | | } |
| | | |
| | | public String getTokenWebRoot() { |
| | | return tokenWebRoot; |
| | | } |
| | | |
| | | public void setTokenWebRoot(String tokenWebRoot) { |
| | | this.tokenWebRoot = tokenWebRoot; |
| | | } |
| | | |
| | | public long getAppId() { |
| | | return appId; |
| | | } |
| | | |
| | | public void setAppId(long appId) { |
| | | this.appId = appId; |
| | | } |
| | | |
| | | public String getAppFullName() { |
| | | return appFullName; |
| | | } |
| | | |
| | | public void setAppFullName(String appFullName) { |
| | | this.appFullName = appFullName; |
| | | } |
| | | |
| | | public String getApiServer() { |
| | | return apiServer; |
| | | } |
| | | |
| | | public void setApiServer(String apiServer) { |
| | | this.apiServer = apiServer; |
| | | } |
| | | |
| | | public String getUploadPath() { |
| | | return uploadPath; |
| | | } |
| | | |
| | | public void setUploadPath(String uploadPath) { |
| | | this.uploadPath = uploadPath; |
| | | } |
| | | |
| | | public String getLoginUrl() { |
| | | return loginUrl; |
| | | } |
| | | |
| | | public void setLoginUrl(String loginUrl) { |
| | | this.loginUrl = loginUrl; |
| | | } |
| | | |
| | | public String getCasHost() { |
| | | return casHost; |
| | | } |
| | | |
| | | public void setCasHost(String casHost) { |
| | | this.casHost = casHost; |
| | | } |
| | | |
| | | public String getGisPortal() { |
| | | return gisPortal; |
| | | } |
| | | |
| | | public void setGisPortal(String gisPortal) { |
| | | this.gisPortal = gisPortal; |
| | | } |
| | | |
| | | public String getEsbHost() { |
| | | return esbHost; |
| | | } |
| | | |
| | | public void setEsbHost(String esbHost) { |
| | | this.esbHost = esbHost; |
| | | } |
| | | |
| | | public String getEsbUrl() { |
| | | return esbUrl; |
| | | } |
| | | |
| | | public void setEsbUrl(String esbUrl) { |
| | | this.esbUrl = esbUrl; |
| | | } |
| | | |
| | | public String getObtainExtentMapUrl() { |
| | | return obtainExtentMapUrl; |
| | | } |
| | | |
| | | public void setObtainExtentMapUrl(String obtainExtentMapUrl) { |
| | | this.obtainExtentMapUrl = obtainExtentMapUrl; |
| | | } |
| | | |
| | | public String getUploadTemplatesPath() { |
| | | return uploadTemplatesPath; |
| | | } |
| | | |
| | | public void setUploadTemplatesPath(String uploadTemplatesPath) { |
| | | this.uploadTemplatesPath = uploadTemplatesPath; |
| | | } |
| | | |
| | | public String getUploadRootPath(){return uploadRootPath;} |
| | | |
| | | public void setUploadRootPath(String uploadRootPath){this.uploadRootPath=uploadRootPath;} |
| | | |
| | | public String getEsbWebServiceHost(){return esbWebServiceHost;} |
| | | |
| | | public void setEsbWebServiceHost(String esbWebServiceHost){this.esbWebServiceHost=esbWebServiceHost;} |
| | | |
| | | public String getVideoUrl(){return videoUrl;} |
| | | |
| | | public void setVideoUrl(String videoUrl){this.videoUrl=videoUrl;} |
| | | |
| | | public String getIpHost(){return ipHost;} |
| | | |
| | | public void setIpHost(String ipHost){this.ipHost = ipHost;} |
| | | |
| | | public String getGisHost(){return gisHost;} |
| | | |
| | | public void setGisHost(String gisHost){this.gisHost = gisHost;} |
| | | |
| | | public String getApptokenWebRoot() { |
| | | return apptokenWebRoot; |
| | | } |
| | | |
| | | public void setApptokenWebRoot(String apptokenWebRoot) { |
| | | this.apptokenWebRoot = apptokenWebRoot; |
| | | } |
| | | |
| | | public String getTemplateParamsURL() { |
| | | return templateParamsURL; |
| | | } |
| | | |
| | | public void setTemplateParamsURL(String templateParamsURL) { |
| | | this.templateParamsURL = templateParamsURL; |
| | | } |
| | | |
| | | public String getNcFileConfigURL() { |
| | | return ncFileConfigURL; |
| | | } |
| | | |
| | | public void setNcFileConfigURL(String ncFileConfigURL) { |
| | | this.ncFileConfigURL = ncFileConfigURL; |
| | | } |
| | | |
| | | public String getReadNcFileURL() { |
| | | return readNcFileURL; |
| | | } |
| | | |
| | | public void setReadNcFileURL(String readNcFileURL) { |
| | | this.readNcFileURL = readNcFileURL; |
| | | } |
| | | |
| | | public String getNcStorageUrl() { |
| | | return ncStorageUrl; |
| | | } |
| | | |
| | | public void setNcStorageUrl(String ncStorageUrl) { |
| | | this.ncStorageUrl = ncStorageUrl; |
| | | } |
| | | |
| | | public String getUploadRestemplateURL() { |
| | | return uploadRestemplateURL; |
| | | } |
| | | |
| | | public void setUploadRestemplateURL(String uploadRestemplateURL) { |
| | | this.uploadRestemplateURL = uploadRestemplateURL; |
| | | } |
| | | |
| | | public String getDeleteRestemplateURL() { |
| | | return deleteRestemplateURL; |
| | | } |
| | | |
| | | public void setDeleteRestemplateURL(String deleteRestemplateURL) { |
| | | this.deleteRestemplateURL = deleteRestemplateURL; |
| | | } |
| | | |
| | | public String getProxyUrl() { |
| | | return proxyUrl; |
| | | } |
| | | |
| | | public void setProxyUrl(String proxyUrl) { |
| | | this.proxyUrl = proxyUrl; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.landtool.lanbase.config; |
| | | |
| | | import javax.servlet.DispatcherType; |
| | | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.boot.web.servlet.FilterRegistrationBean; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | import org.springframework.web.filter.DelegatingFilterProxy; |
| | | import org.springframework.web.servlet.config.annotation.InterceptorRegistry; |
| | | import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; |
| | | import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; |
| | | |
| | | import com.landtool.lanbase.common.xss.XssFilter; |
| | | import com.landtool.lanbase.modules.api.intercept.ApiInterceptor; |
| | | |
| | | /** |
| | | * @author lanbase |
| | | * @Description: TODO(webé
ç½®) |
| | | * @date 2017-6-23 15:07 |
| | | */ |
| | | @Configuration |
| | | public class WebConfig extends WebMvcConfigurerAdapter { |
| | | @Autowired |
| | | private ApiInterceptor apiInterceptor; |
| | | |
| | | @Value("${sys.swagger.open:#{false}}") |
| | | private boolean swaggerOpen; |
| | | |
| | | @Autowired |
| | | private SysTemPropertyConfig sysConfig; |
| | | |
| | | @Override |
| | | public void addResourceHandlers(ResourceHandlerRegistry registry) { |
| | | //æ å°ä¸ä¼ æä»¶çå°å |
| | | registry.addResourceHandler("/uploadPath/**").addResourceLocations("file:" + sysConfig.getUploadPath()); |
| | | //registry.addResourceHandler("/wenjianjia/**").addResourceLocations("file:"+env.getProperty("wenjianjia")); |
| | | //registry.addResourceHandler("/wenjian/**").addResourceLocations("file:" + sysConfig.getUploadPath()); |
| | | //æ å°swagger |
| | | if (swaggerOpen) { |
| | | registry.addResourceHandler("swagger-ui.html").addResourceLocations("classpath:/META-INF/resources/"); |
| | | registry.addResourceHandler("/webjars/**").addResourceLocations("classpath:/META-INF/resources/webjars/"); |
| | | } |
| | | super.addResourceHandlers(registry); |
| | | } |
| | | |
| | | @Bean |
| | | public FilterRegistrationBean shiroFilterRegistration() { |
| | | FilterRegistrationBean registration = new FilterRegistrationBean(); |
| | | registration.setFilter(new DelegatingFilterProxy("shiroFilter")); |
| | | //该å¼ç¼ºç为falseï¼è¡¨ç¤ºçå½å¨æç±SpringApplicationContext管çï¼è®¾ç½®ä¸ºtrueå表示ç±ServletContainer管ç |
| | | registration.addInitParameter("targetFilterLifecycle", "true"); |
| | | registration.setEnabled(true); |
| | | registration.setOrder(Integer.MAX_VALUE - 1); |
| | | registration.addUrlPatterns("/*"); |
| | | return registration; |
| | | } |
| | | |
| | | //é
ç½®xssFilter |
| | | @Bean |
| | | public FilterRegistrationBean xssFilterRegistration() { |
| | | FilterRegistrationBean registration = new FilterRegistrationBean(); |
| | | registration.setDispatcherTypes(DispatcherType.REQUEST); |
| | | registration.setFilter(new XssFilter("/sys/")); |
| | | registration.addUrlPatterns("/*"); |
| | | registration.setName("xssFilter"); |
| | | registration.setOrder(Integer.MAX_VALUE); |
| | | return registration; |
| | | } |
| | | |
| | | //æ·»å api interceptor |
| | | @Override |
| | | public void addInterceptors(InterceptorRegistry registry) { |
| | | registry.addInterceptor(apiInterceptor).addPathPatterns("/api/**"); |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.landtool.lanbase.modules.api.annotation; |
| | | |
| | | import java.lang.annotation.Documented; |
| | | import java.lang.annotation.ElementType; |
| | | import java.lang.annotation.Retention; |
| | | import java.lang.annotation.RetentionPolicy; |
| | | import java.lang.annotation.Target; |
| | | |
| | | /** |
| | | * @author lanbase |
| | | * @Description: TODO(apiç»å½æéª) |
| | | * @date 2017-9-27 14:52 |
| | | */ |
| | | @Target(ElementType.METHOD) |
| | | @Retention(RetentionPolicy.RUNTIME) |
| | | @Documented |
| | | public @interface Login { |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.landtool.lanbase.modules.api.controller; |
| | | |
| | | import java.sql.Timestamp; |
| | | import java.util.Date; |
| | | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | |
| | | import com.landtool.lanbase.modules.res.entity.Res_ActionRecord; |
| | | import com.landtool.lanbase.modules.res.service.ResActionRecordService; |
| | | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | |
| | | /** |
| | | * @author åå°æ³¢ |
| | | * @Description: èµæº(æµè§ãè°ç¨ãæ¶è)çæä½æ¥è¯¢åå
¥æ¥å£ |
| | | * @date 2018-01-30 |
| | | */ |
| | | |
| | | @Controller |
| | | @RequestMapping("/api/actionrecord/") |
| | | @Api(value = "", tags = { "èµæºæä½ç¸å
³æ¥å£" }) |
| | | public class ActionRecordController { |
| | | @Autowired |
| | | private ResActionRecordService resActionRecordService; |
| | | |
| | | /** |
| | | * èµæºè°ç¨æ¥å¿è®°å½,è®°å½ç¨æ·ESBæå¡è°ç¨æ
åµ |
| | | * @param record |
| | | * @Description: æ¥å¿æ°æ®åå
¥ {@link ResActionRecordService} |
| | | * @Author: xiaoxuan.xie |
| | | * @Date: 13:30 2018/3/28 |
| | | * @return: Model |
| | | * @see Res_ActionRecord |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping(path = "/adduseinfo") |
| | | @ApiOperation(value = "èµæºè°ç¨æ¥å¿è®°å½", notes = "") |
| | | public String adduseinfo( |
| | | @ApiParam(name="resourceid",value="èµæºId",required=true) @RequestParam(name="resourceid") Integer resourceid, |
| | | @ApiParam(name="appid",value="åºç¨Id") @RequestParam(name="appid", required = false) Integer appid, |
| | | @ApiParam(name="userid",value="ç¨æ·Id",required=true) @RequestParam(name="userid") Long userid, |
| | | @ApiParam(name="ip",value="ip") @RequestParam(name="ip",required = false) String ip) { |
| | | Res_ActionRecord record = new Res_ActionRecord(); |
| | | record.setResourceid(resourceid); |
| | | record.setUserid(userid); |
| | | if(appid != null) record.setAppid(appid); |
| | | if(ip != null) record.setIp(ip); |
| | | Timestamp audittime = new Timestamp(new Date().getTime());// è·åå½åæ¶é´ |
| | | boolean success = false;// æä½ç¶æ |
| | | String msg = "";// æä½è¿åæ¶æ¯ |
| | | record.setActiontime(audittime); |
| | | record.setActiontype("è°ç¨"); |
| | | int row = resActionRecordService.insertSelective(record); |
| | | success = row >= 1; |
| | | msg = success ? "æ¥å¿åå
¥æåï¼" : "æ¥å¿åå
¥å¤±è´¥"; |
| | | return "{success:" + success + ", msg:'" + msg + "'}"; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.landtool.lanbase.modules.api.controller; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | |
| | | import com.landtool.lanbase.common.utils.Result; |
| | | import com.landtool.lanbase.modules.res.entity.Res_MainInfo; |
| | | import com.landtool.lanbase.modules.res.service.ResApplyRecommendService; |
| | | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | |
| | | @Controller |
| | | @RequestMapping("/api/applyrecommend") |
| | | @Api(value = "", tags = { "åºç¨ç¨åºèµæºç³è¯·ç¸å
³æ¥å£" }) |
| | | public class ApplyRecommendApiController { |
| | | |
| | | @Autowired |
| | | private ResApplyRecommendService resApplyRecommendService; |
| | | |
| | | /** |
| | | * @Description: |
| | | * @author ykm |
| | | * @param sysid |
| | | * @return Result |
| | | * @date 2019/03/26 9:21 |
| | | */ |
| | | @ResponseBody |
| | | @GetMapping("/getResourceApplyList") |
| | | @ApiOperation(value = "åºç¨ç¨åºIDè·åç³è¯·èµæºå表", notes = "") |
| | | public Result GetResourceApplyList(@ApiParam(name = "sysid" , value = "ç³»ç»ID", required = true) @RequestParam(name="sysid") Integer sysid) { |
| | | Map<String, Object> params = new HashMap<>(); |
| | | params.put("sysid", sysid); |
| | | List<Res_MainInfo> list = resApplyRecommendService.getResourceList(params); |
| | | return Result.ok().put("result", list); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.landtool.lanbase.modules.api.controller; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.List; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | |
| | | import com.landtool.lanbase.modules.res.entity.Res_Catalog; |
| | | import com.landtool.lanbase.modules.res.entity.Res_ExtIntegrate; |
| | | import com.landtool.lanbase.modules.res.entity.Res_MainInfo; |
| | | import com.landtool.lanbase.modules.res.service.ResCatalogService; |
| | | import com.landtool.lanbase.modules.res.service.ResExtIntegrateService; |
| | | import com.landtool.lanbase.modules.res.service.ResMainInfoService; |
| | | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | |
| | | /** |
| | | * @author åå°æ³¢ |
| | | * @Description: èµæºç®å½ç¸å
³æ¥è¯¢æ¥å£ |
| | | * @date 2018-01-30 |
| | | */ |
| | | |
| | | @Controller |
| | | @RequestMapping("/api/catalog/") |
| | | @Api(value = "", tags = { "èµæºç®å½æ¥è¯¢æ¥å£" }) |
| | | public class CatalogController { |
| | | @Autowired |
| | | private ResCatalogService resCatalogService; |
| | | |
| | | @Autowired |
| | | private ResMainInfoService resMainInfoService; |
| | | |
| | | @Autowired |
| | | private ResExtIntegrateService resExtIntegrateService; |
| | | |
| | | /** |
| | | * @param parentCatalogId |
| | | * @Description: éå½è·åè·åç®å½æ ä¿¡æ¯ï¼ç¶èç¹ä¸º0æ¶æ¥è¯¢æ´ä¸ªç®å½æ {@link ResCatalogService} |
| | | * @Author: xiaoxuan.xie |
| | | * @Date: 17:30 2018/3/15 |
| | | * @return: String |
| | | * @see Res_Catalog |
| | | */ |
| | | @ResponseBody |
| | | @GetMapping(path = "getTree/{parentCatalogId}") |
| | | @ApiOperation(value = "éå½è·åè·åç®å½æ ä¿¡æ¯", notes = "") |
| | | public String getTreeByParentID( |
| | | @ApiParam(name = "parentCatalogId", value = "ç®å½ç¶èç¹Id", required = true) @PathVariable(name = "parentCatalogId") int parentCatalogId) { |
| | | String resCatalogTreeJson = getTreeChildrenNodeList(parentCatalogId);// éå½è·åç®å½åèç¹å表 |
| | | return "[" + resCatalogTreeJson + "]"; |
| | | } |
| | | |
| | | /** |
| | | * @param parentCatalogId |
| | | * @Description: éå½è·åç®å½åèç¹å表 {@link ResCatalogService} |
| | | * @Author: xiaoxuan.xie |
| | | * @Date: 17:30 2018/3/15 |
| | | * @return: String |
| | | */ |
| | | private String getTreeChildrenNodeList(int parentCatalogId) { |
| | | String resCatalogTreeJson = "";// å®ä¹ç®å½æ Jsonå符串åå¨å¯¹è±¡ |
| | | List<Res_Catalog> res_catalogList = resCatalogService.selectResCatalogToParentid(parentCatalogId);// æ ¹æ®ç®å½ç¶Idè·ååç®å½å表 |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");// å®ä¾åæ¶é´æ ¼å¼è½¬æ¢å¨ |
| | | // å¾ªç¯æé ç®å½æ ç»æJson |
| | | for (Res_Catalog resCatalog : res_catalogList) { |
| | | if (resCatalogTreeJson != "") |
| | | resCatalogTreeJson += ","; |
| | | resCatalogTreeJson += "{'catlogid':" + resCatalog.getCatlogid(); |
| | | resCatalogTreeJson += ",'catlogcode':'" + resCatalog.getCatlogcode() + "'"; |
| | | resCatalogTreeJson += ",'parentid':" + resCatalog.getParentid(); |
| | | resCatalogTreeJson += ",'title':'" + resCatalog.getTitle() + "'"; |
| | | resCatalogTreeJson += ",'pingyinfiirst':'" + resCatalog.getPingyinfiirst() + "'"; |
| | | resCatalogTreeJson += ",'description':'" + resCatalog.getDescription() + "'"; |
| | | resCatalogTreeJson += ",'imgurl':'" + resCatalog.getImgurl() + "'"; |
| | | resCatalogTreeJson += ",'orderid':" + resCatalog.getOrderid(); |
| | | resCatalogTreeJson += ",'createuser':'" + resCatalog.getCreateuser() + "'"; |
| | | resCatalogTreeJson += ",'createdate':'" + sdf.format(resCatalog.getCreatedate()) + "'"; |
| | | resCatalogTreeJson += ",'remark':'" + resCatalog.getRemark() + "'"; |
| | | resCatalogTreeJson += ",'childnodes':["; |
| | | String resCatalogChildNode = getTreeChildrenNodeList(resCatalog.getCatlogid());// éå½è·åç®å½åèç¹å表 |
| | | if (resCatalogChildNode != "") { |
| | | resCatalogTreeJson += resCatalogChildNode; |
| | | } |
| | | resCatalogTreeJson += "]}"; |
| | | } |
| | | |
| | | return resCatalogTreeJson; |
| | | } |
| | | |
| | | /** |
| | | * @param parentCatalogId |
| | | * @Description: è·ååç®å½ä¿¡æ¯å表{@link ResCatalogService} |
| | | * @Author: xiaoxuan.xie |
| | | * @Date: 17:30 2018/3/15 |
| | | * @return: List<Res_Catalog> |
| | | * @see Res_Catalog |
| | | */ |
| | | @ResponseBody |
| | | @GetMapping(path = "getList/{parentCatalogId}") |
| | | @ApiOperation(value = "è·ååç®å½ä¿¡æ¯å表", notes = "") |
| | | public List<Res_Catalog> getListByParentID( |
| | | @ApiParam(name = "parentCatalogId", value = "ç®å½ç¶èç¹Id", required = true) @PathVariable(name = "parentCatalogId") int parentCatalogId) { |
| | | return resCatalogService.selectResCatalogToParentid(parentCatalogId); |
| | | } |
| | | |
| | | /** |
| | | * @param catalogId |
| | | * @Description: æ¥è¯¢ç®å½ä¿¡æ¯{@link ResCatalogService} |
| | | * @Author: xiaoxuan.xie |
| | | * @Date: 09:30 2018/3/16 |
| | | * @return: Res_Catalog |
| | | * @see Res_Catalog |
| | | */ |
| | | @ResponseBody |
| | | @GetMapping(path = "info/{catalogId}") |
| | | @ApiOperation(value = "è·åç®å½ä¿¡æ¯è¯¦ç»ä¿¡æ¯", notes = "") |
| | | public Res_Catalog getById( |
| | | @ApiParam(name = "catalogId", value = "ç®å½Id", required = true) @PathVariable(name = "catalogId") int catalogId) { |
| | | return resCatalogService.getResCatalogInfoById(catalogId); |
| | | } |
| | | |
| | | //region å¹³å°é¨æ·æ¨¡å颿¿Iframeé
ç½®ç®å½æ |
| | | /** |
| | | * 妿æ¾å¼åç«¯é¢æ¿çé
ç½®æéï¼åæéè¦å®åæé |
| | | * @Description: è·åä¸å¡éæ-页é¢éæ-Iframeåºåç®å½æ |
| | | */ |
| | | @ResponseBody |
| | | @GetMapping(path = "YWJCTree/{id}") |
| | | @ApiOperation(value = "è·åä¸å¡éæ-页é¢éæ-Iframeåºåç®å½æ ", notes = "") |
| | | public String getYWJCTreeData( |
| | | @ApiParam(name = "id", value = "id", required = true) @PathVariable(name = "id") String id, |
| | | HttpServletRequest request) { |
| | | StringBuilder resCatalogJson = new StringBuilder(); |
| | | String leixiId = "YWJC"; |
| | | Res_MainInfo resMainInfoTWO = new Res_MainInfo(); |
| | | resMainInfoTWO.setResourceclass(leixiId); |
| | | resMainInfoTWO.setCParentid(Integer.parseInt(id)); |
| | | resMainInfoTWO.setCatlogid(Integer.parseInt(id)); |
| | | List<Res_Catalog> resCatalogList = resCatalogService.getYWJCMuLuTree(Integer.parseInt(id));// è·ååç®å½å表 |
| | | // å¾ªç¯æé åç®å½èç¹ |
| | | for (Res_Catalog resCatalog : resCatalogList) { |
| | | if (!"".equals(resCatalogJson.toString())) { |
| | | resCatalogJson.append(','); |
| | | } |
| | | resCatalogJson.append("{id: " + resCatalog.getCatlogid() + ",name:'" + resCatalog.getTitle() + "', isParent: true}"); |
| | | } |
| | | // è·åèµæºç±»åå表 |
| | | List<Res_MainInfo> resMainInfo = resMainInfoService.getYWJCTreeData(resMainInfoTWO); // è·åç®å½ä¸ä¸å¡éæ--页é¢éæ--Iframeåºåèµæºå表 |
| | | // å¾ªç¯æé èµæºèç¹ |
| | | for (Res_MainInfo resMainInfo1 : resMainInfo) { |
| | | Res_ExtIntegrate res_extIntegrate = resExtIntegrateService.selectByPrimaryKey(resMainInfo1.getResourceid());// è·åä¸å¡éææå±ä¿¡æ¯ |
| | | if (!"".equals(resCatalogJson.toString())) { |
| | | resCatalogJson.append(','); |
| | | } |
| | | |
| | | String title = resMainInfo1.getTitle(); |
| | | //if (resMainInfo1.getTitle().length() > 16) { |
| | | // title = resMainInfo1.getTitle().substring(0, 16) + ".."; |
| | | //} |
| | | //建议å辨ç |
| | | if(res_extIntegrate.getResolution() != null && !res_extIntegrate.getResolution().isEmpty()) { |
| | | title += "(" + res_extIntegrate.getResolution() + ")"; |
| | | } |
| | | |
| | | String serverUrl = res_extIntegrate.getServerurl(); |
| | | if (serverUrl == null) |
| | | serverUrl = ""; |
| | | |
| | | resCatalogJson.append("{id: 'ZiYuan_" + resMainInfo1.getResourceid() + "',name:'" + title + "', title: '" |
| | | + resMainInfo1.getTitle() + "',isParent:false, ServerUrl: '" + serverUrl + "'}"); |
| | | } |
| | | return "[" + resCatalogJson.toString() + "]"; |
| | | } |
| | | //endregion |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.landtool.lanbase.modules.api.controller; |
| | | |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | |
| | | import springfox.documentation.annotations.ApiIgnore; |
| | | |
| | | /** |
| | | * @author TanBin |
| | | * @Description: TODO() |
| | | * @date 2018-1-26 14:16 |
| | | */ |
| | | @Controller |
| | | @RequestMapping("/api") |
| | | @ApiIgnore() |
| | | public class DocController { |
| | | |
| | | /** |
| | | * APIææ¡£è®¿é®å
¥å£ |
| | | * @return |
| | | */ |
| | | @RequestMapping("/doc") |
| | | public String apiDoc(){ |
| | | return "redirect:/swagger-ui.html"; |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.landtool.lanbase.modules.api.controller; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.alibaba.fastjson.serializer.SerializerFeature; |
| | | import com.landtool.lanbase.config.SysTemPropertyConfig; |
| | | import com.landtool.lanbase.modules.org.redis.OrgUserDefUnitRedis; |
| | | import com.landtool.lanbase.modules.org.redis.OrgUserRedis; |
| | | import com.landtool.lanbase.modules.org.redis.SysSystemInfoRedis; |
| | | import com.landtool.lanbase.modules.org.service.OrgUnitService; |
| | | import com.landtool.lanbase.modules.org.service.OrgUserService; |
| | | import com.landtool.lanbase.modules.res.entity.Res_ActionRecord; |
| | | import com.landtool.lanbase.modules.res.entity.Res_MainInfo; |
| | | import com.landtool.lanbase.modules.res.entity.ZiYuanTongJi.GroupByMuLu; |
| | | import com.landtool.lanbase.modules.res.entity.ZiYuanTongJi.GroupByZiYuanLeiXing; |
| | | import com.landtool.lanbase.modules.res.service.*; |
| | | import com.landtool.lanbase.modules.sys.controller.AbstractController; |
| | | import com.landtool.lanbase.modules.sys.service.SysFieldvalueService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.ui.Model; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | import oshi.SystemInfo; |
| | | import oshi.hardware.CentralProcessor; |
| | | import oshi.hardware.GlobalMemory; |
| | | |
| | | import java.text.DecimalFormat; |
| | | import java.util.HashMap; |
| | | import java.util.LinkedHashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.concurrent.TimeUnit; |
| | | import java.util.stream.Collectors; |
| | | |
| | | @Controller |
| | | @RequestMapping("/api/monitor/jitmonitor") |
| | | public class JitmonitorApiController extends AbstractController { |
| | | |
| | | @Autowired |
| | | private SysTemPropertyConfig sysConfig; |
| | | |
| | | @Autowired |
| | | private OrgUserRedis orgUserRedis; |
| | | |
| | | @Autowired |
| | | SysSystemInfoRedis sysSystemInfoRedis; |
| | | |
| | | @Autowired |
| | | private OrgUserDefUnitRedis orgUserDefUnitRedis; |
| | | |
| | | @Autowired |
| | | private JitMonitorService jitMonitorService; |
| | | |
| | | @Autowired |
| | | private ResMainInfoService resMainInfoService; |
| | | |
| | | @Autowired |
| | | private ResProblemFeedbackService resProblemFeedbackService; |
| | | |
| | | @Autowired |
| | | private ResCatalogService resCatalogService; |
| | | |
| | | @Autowired |
| | | private SysFieldvalueService FieldUtils; |
| | | |
| | | @Autowired |
| | | private OrgUnitService orgUnitService; |
| | | |
| | | @Autowired |
| | | private OrgUserService orgUserService; |
| | | |
| | | @Autowired |
| | | private ResApplyRecommendService resApplyRecommendService; |
| | | |
| | | @Autowired |
| | | private ResActionRecordService resActionRecordService; |
| | | |
| | | @Autowired |
| | | public ZiYuanMuLuService ziYuanMuLuService; |
| | | |
| | | public static String strMuLu = ""; |
| | | |
| | | /** |
| | | * èµæºä¸å¿ |
| | | * @param model |
| | | * @return |
| | | */ |
| | | @RequestMapping("index") |
| | | @ResponseBody |
| | | public String newZiYuanZhongXinIndex(Model model) { |
| | | Map<String,Object> map=new HashMap<String, Object>(); |
| | | LinkedHashMap<String, String> ResourceTypeList = FieldUtils.getFieldListByKey("ResourceType");// è·åèµæºç±»åå表 |
| | | // èµæºç±»å饼ç¶ç»è®¡å¾ |
| | | List<GroupByZiYuanLeiXing> resourceclassList = resMainInfoService.selectResMainInfoGroupByLeiXing(); |
| | | |
| | | Integer resourcecount=resMainInfoService.getAllTotal(); |
| | | String AllSeries = ""; |
| | | // å¤äº4个类åçè¯æ°æ®æ¾ç¤ºå7ä¸ªèµæºæ°éæå¤çç±»åï¼åé¢çé½ä»¥å
¶å®ç»è®¡ |
| | | if (resourceclassList.size() > 4) { |
| | | int counter = 0; |
| | | for (int i = 4; i < resourceclassList.size(); i++) { |
| | | counter += resourceclassList.get(i).getCount(); |
| | | } |
| | | for (int i = 0; i < 4; i++) { |
| | | GroupByZiYuanLeiXing item = resourceclassList.get(i); |
| | | String leixing = ResourceTypeList.get(item.getResourceclass()); |
| | | AllSeries += (AllSeries == "" ? "" : ",") + "{ value: " + item.getCount() + ", name: '" + leixing + "'}"; |
| | | } |
| | | AllSeries += (AllSeries == "" ? "" : ",") + "{ value: " + counter + ", name: '" + "å
¶å®" + "'}"; |
| | | } |
| | | // å°äºçäº4个类åå°±å
¨é¨æ¾ç¤º |
| | | else { |
| | | for (int i = 0; i < resourceclassList.size(); i++) { |
| | | GroupByZiYuanLeiXing item = resourceclassList.get(i); |
| | | String leixing = ResourceTypeList.get(item.getResourceclass()); |
| | | AllSeries += (AllSeries == "" ? "" : ",") + "{ value: " + item.getCount() + ", name: '" + leixing + "'}"; |
| | | } |
| | | } |
| | | map.put("resourceclassSeries", "[" + AllSeries + "]"); |
| | | |
| | | |
| | | |
| | | // èµæºç®å½ç»è®¡å¾ |
| | | List<GroupByMuLu> catlogidList = resMainInfoService.selectResMainInfoGroupByMuLu(); |
| | | String MuLuLegends = ""; |
| | | String MuLuSeries = ""; |
| | | for (int i = 0; i < catlogidList.size(); i++) { |
| | | GroupByMuLu item = catlogidList.get(i); |
| | | // if (item.getCatlogCode().equals("0")) |
| | | // continue; |
| | | strMuLu = ""; |
| | | // String legend = GetBianMu(item.getCatlogCode() == null ? 0 : Integer.parseInt(item.getCatlogCode())); |
| | | MuLuLegends += (MuLuLegends == "" ? "" : ",") + "'" + item.getTitle() + "'"; |
| | | MuLuSeries += (MuLuSeries == "" ? "" : ",") + item.getCount(); |
| | | } |
| | | map.put("MuLuLegends", "[" + MuLuLegends + "]"); |
| | | map.put("MuLuSeries", "[" + MuLuSeries + "]"); |
| | | |
| | | // èµæºå®¡æ ¸ç¶æç»è®¡å¾ |
| | | map.put("shenhezhuangtaiSeries", "[" + ziYuanMuLuService.getZYTJ_ShenHeZhuangTai() + "]"); |
| | | |
| | | //å
±äº«åè®®ç»è®¡å¾ |
| | | map.put("sharprotocolSeries", "[" + ziYuanMuLuService.getGongXiangXieYiChart() + "]"); |
| | | map.put("resourcecount",resourcecount); |
| | | |
| | | |
| | | |
| | | |
| | | return JSONObject.toJSONStringWithDateFormat(map, "yyyy-MM-dd HH:mm:ss", SerializerFeature.PrettyFormat); |
| | | } |
| | | /** |
| | | * èµæºæ¨è |
| | | */ |
| | | private int getMainInfoRecommendCount() { |
| | | Long userid = getUserId(); |
| | | Long unitId = orgUserService.getDefaultUnit(userid).getUnitid(); |
| | | int count = 0; |
| | | //è·åå
³é®å |
| | | List<String> keyWords = resActionRecordService.selectKeyWordsByUserid(Integer.parseInt(userid.toString())); |
| | | if (keyWords != null && keyWords.size() > 0) { |
| | | Map<String, Object> paramMap = new HashMap<String, Object>(); |
| | | paramMap.put("userid", userid); |
| | | paramMap.put("isDiTuFuwu", null); |
| | | List<Res_MainInfo> resourceList = resActionRecordService.selectMainInfoRecommends(paramMap); |
| | | count = resourceList != null && resourceList.size() > 0 ? count = resourceList.size() : 0; |
| | | } |
| | | return count; |
| | | } |
| | | |
| | | @RequestMapping("/queryResActionRecordByZyId") |
| | | @ResponseBody |
| | | public String selectResActionRecordByResourceId(Integer resourceid,Integer page,Integer limit){ |
| | | Map<String,Object> param=new HashMap<>(); |
| | | param.put("page", page); |
| | | param.put("limit", limit); |
| | | param.put("resourceid", resourceid); |
| | | List<Res_ActionRecord> list=jitMonitorService.selectResActionRecordByResourceId(param); |
| | | for(Res_ActionRecord map: list){ |
| | | map.setUsername(orgUserService.getChinesename(map.getUserid())); |
| | | } |
| | | |
| | | JSONObject json=new JSONObject(); |
| | | json.put("total", list.size()); |
| | | json.put("data", list); |
| | | return JSONObject.toJSONStringWithDateFormat(json, "yyyy-MM-dd HH:mm:ss", SerializerFeature.PrettyFormat); |
| | | } |
| | | @RequestMapping("warning") |
| | | @ResponseBody |
| | | public String warnlogshow() { |
| | | List<Map> list=resProblemFeedbackService.getlatestalarm(); |
| | | JSONObject json=new JSONObject(); |
| | | json.put("total", list.size()); |
| | | json.put("data", list); |
| | | return JSONObject.toJSONStringWithDateFormat(json, "yyyy-MM-dd HH:mm:ss", SerializerFeature.PrettyFormat); |
| | | } |
| | | @RequestMapping("serverstatus") |
| | | @ResponseBody |
| | | public String serverstatus() throws InterruptedException { |
| | | JSONObject json=new JSONObject(); |
| | | json.put("cpuinfo", printlnCpuInfo()); |
| | | json.put("meminfo", MemInfo()); |
| | | return JSONObject.toJSONStringWithDateFormat(json, "yyyy-MM-dd HH:mm:ss", SerializerFeature.PrettyFormat); |
| | | |
| | | } |
| | | |
| | | @RequestMapping("getGisResNumByResStatus") |
| | | @ResponseBody |
| | | public String getGisResNumByResStatus() throws InterruptedException { |
| | | JSONObject json=new JSONObject(); |
| | | Map<String,Object> map=new HashMap<>(); |
| | | map.put("actionType", "è°ç¨"); |
| | | List<Map> activeResources=jitMonitorService.getActiveResource(map); |
| | | json.put("resStatus", jitMonitorService.getGisResNumByResStatus()); |
| | | json.put("activeResource", activeResources); |
| | | json.put("activeResourceNum", activeResources.size()); |
| | | return JSONObject.toJSONStringWithDateFormat(json, "yyyy-MM-dd HH:mm:ss", SerializerFeature.PrettyFormat); |
| | | } |
| | | |
| | | /** |
| | | * ç»è®¡è°ç¨æå¡æ¬¡æ°æå¤çå10ä¸ªç¨æ· |
| | | * @return |
| | | * @throws InterruptedException |
| | | */ |
| | | @RequestMapping("getTop10UserAndUnit") |
| | | @ResponseBody |
| | | public String calTop10UserForInvokingResource(String actionType) throws InterruptedException { |
| | | //è·åç¨æ· |
| | | Map<String,Object> map=new HashMap<>(); |
| | | map.put("actionType", actionType); |
| | | return JSONObject.toJSONStringWithDateFormat(jitMonitorService.calTop10UserForInvokingResource(map), "yyyy-MM-dd HH:mm:ss", SerializerFeature.WriteMapNullValue); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * ç»è®¡è°ç¨æå¡æ¬¡æ°æå¤çå10个åä½ |
| | | * @return |
| | | * @throws InterruptedException |
| | | */ |
| | | @RequestMapping("getTop10Sys") |
| | | @ResponseBody |
| | | public String calTop10SysForInvokingResource(String actionType) throws InterruptedException { |
| | | Map<String,Object> map=new HashMap<>(); |
| | | map.put("actionType", actionType); |
| | | return JSONObject.toJSONStringWithDateFormat(jitMonitorService.calTop10SysForInvokingResource(map), "yyyy-MM-dd HH:mm:ss", SerializerFeature.WriteMapNullValue); |
| | | } |
| | | |
| | | /** |
| | | * æ¥å¿ç»è®¡ res_action_ |
| | | */ |
| | | @RequestMapping("/assignLogChart") |
| | | public String assignLogChart() { |
| | | |
| | | |
| | | return null; |
| | | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * æ¥è¯¢çé¨èµæºå10 |
| | | * @params actionType æä½ç±»å |
| | | * @return |
| | | * @throws InterruptedException |
| | | */ |
| | | @RequestMapping("getHotZyByActionType") |
| | | @ResponseBody |
| | | public String getTop10ResourceByActionType(String actionType) throws InterruptedException { |
| | | Map<String,Object> map=new HashMap<>(); |
| | | map.put("actionType", actionType); |
| | | //List<Map<String,Object>> list=jitMonitorService.getHotZy(); |
| | | return JSONObject.toJSONStringWithDateFormat(jitMonitorService.getTop10ResourceByActionType(map), "yyyy-MM-dd HH:mm:ss", SerializerFeature.WriteMapNullValue); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @RequestMapping("getResourceAssignTimesCount") |
| | | @ResponseBody |
| | | public String getResourceAssignTimesCount(Integer resourceid) throws InterruptedException { |
| | | Map<String, Object> map=new HashMap<>(); |
| | | map.put("actionType", "è°ç¨"); |
| | | map.put("resourceid", resourceid); |
| | | List<Map> list=jitMonitorService.getResourceAssignTimesCount(map); |
| | | JSONObject json=new JSONObject(); |
| | | json.put("data", list); |
| | | return JSONObject.toJSONStringWithDateFormat(json, "yyyy-MM-dd HH:mm:ss", SerializerFeature.WriteMapNullValue); |
| | | |
| | | } |
| | | @RequestMapping("queryResourceLog") |
| | | @ResponseBody |
| | | public String queryResourceLog(Integer resourceid) throws InterruptedException { |
| | | Map<String, Object> map=new HashMap<>(); |
| | | map.put("actionType", "è°ç¨"); |
| | | map.put("resourceid", resourceid); |
| | | List<Map> list=jitMonitorService.queryResourceLog(map); |
| | | JSONObject json=new JSONObject(); |
| | | json.put("data", list); |
| | | return JSONObject.toJSONStringWithDateFormat(json, "yyyy-MM-dd HH:mm:ss", SerializerFeature.WriteMapNullValue); |
| | | |
| | | } |
| | | |
| | | |
| | | private JSONObject printlnCpuInfo() throws InterruptedException { |
| | | //map.put("----------------cpuä¿¡æ¯----------------"); |
| | | SystemInfo systemInfo = new SystemInfo(); |
| | | CentralProcessor processor = systemInfo.getHardware().getProcessor(); |
| | | long[] prevTicks = processor.getSystemCpuLoadTicks(); |
| | | // ç¡ç 1s |
| | | TimeUnit.SECONDS.sleep(1); |
| | | long[] ticks = processor.getSystemCpuLoadTicks(); |
| | | long nice = ticks[CentralProcessor.TickType.NICE.getIndex()] - prevTicks[CentralProcessor.TickType.NICE.getIndex()]; |
| | | long irq = ticks[CentralProcessor.TickType.IRQ.getIndex()] - prevTicks[CentralProcessor.TickType.IRQ.getIndex()]; |
| | | long softirq = ticks[CentralProcessor.TickType.SOFTIRQ.getIndex()] - prevTicks[CentralProcessor.TickType.SOFTIRQ.getIndex()]; |
| | | long steal = ticks[CentralProcessor.TickType.STEAL.getIndex()] - prevTicks[CentralProcessor.TickType.STEAL.getIndex()]; |
| | | long cSys = ticks[CentralProcessor.TickType.SYSTEM.getIndex()] - prevTicks[CentralProcessor.TickType.SYSTEM.getIndex()]; |
| | | long user = ticks[CentralProcessor.TickType.USER.getIndex()] - prevTicks[CentralProcessor.TickType.USER.getIndex()]; |
| | | long iowait = ticks[CentralProcessor.TickType.IOWAIT.getIndex()] - prevTicks[CentralProcessor.TickType.IOWAIT.getIndex()]; |
| | | long idle = ticks[CentralProcessor.TickType.IDLE.getIndex()] - prevTicks[CentralProcessor.TickType.IDLE.getIndex()]; |
| | | long totalCpu = user + nice + cSys + idle + iowait + irq + softirq + steal; |
| | | JSONObject map=new JSONObject(); |
| | | |
| | | |
| | | map.put("cpuæ ¸æ°", processor.getLogicalProcessorCount()); |
| | | map.put("cpuç³»ç»ä½¿ç¨ç", new DecimalFormat("#.##%").format(cSys * 1.0 / totalCpu)); |
| | | map.put("cpuç¨æ·ä½¿ç¨ç", new DecimalFormat("#.##%").format(user * 1.0 / totalCpu)); |
| | | map.put("cpuå½åçå¾
ç", new DecimalFormat("#.##%").format(iowait * 1.0 / totalCpu)); |
| | | map.put("cpuå½å使ç¨ç", new DecimalFormat("#.##%").format(1.0-(idle * 1.0 / totalCpu))); |
| | | return map; |
| | | } |
| | | |
| | | public JSONObject MemInfo(){ |
| | | JSONObject map=new JSONObject(); |
| | | SystemInfo systemInfo = new SystemInfo(); |
| | | GlobalMemory memory = systemInfo.getHardware().getMemory(); |
| | | //æ»å
å |
| | | long totalByte = memory.getTotal(); |
| | | //å©ä½ |
| | | long acaliableByte = memory.getAvailable(); |
| | | map.put("æ»å
å", formatByte(totalByte)); |
| | | map.put("使ç¨", formatByte(totalByte-acaliableByte)); |
| | | map.put("å©ä½å
å ", formatByte(acaliableByte)); |
| | | map.put("使ç¨ç", new DecimalFormat("#.##%").format((totalByte-acaliableByte)*1.0/totalByte)); |
| | | return map; |
| | | } |
| | | public static String formatByte(long byteNumber){ |
| | | //æ¢ç®åä½ |
| | | double FORMAT = 1024.0; |
| | | double kbNumber = byteNumber/FORMAT; |
| | | if(kbNumber<FORMAT){ |
| | | return new DecimalFormat("#.##KB").format(kbNumber); |
| | | } |
| | | double mbNumber = kbNumber/FORMAT; |
| | | if(mbNumber<FORMAT){ |
| | | return new DecimalFormat("#.##MB").format(mbNumber); |
| | | } |
| | | double gbNumber = mbNumber/FORMAT; |
| | | if(gbNumber<FORMAT){ |
| | | return new DecimalFormat("#.##GB").format(gbNumber); |
| | | } |
| | | double tbNumber = gbNumber/FORMAT; |
| | | return new DecimalFormat("#.##TB").format(tbNumber); |
| | | } |
| | | |
| | | @RequestMapping("warningIdList") |
| | | @ResponseBody |
| | | public String warningIdList() { |
| | | List<Map> getlatestalarm = resProblemFeedbackService.getlatestalarm(); |
| | | List<Object> resourceids = resProblemFeedbackService.getlatestalarm().stream().map(map -> map.get("RESOURCEID")).collect(Collectors.toList()); |
| | | JSONObject json=new JSONObject(); |
| | | json.put("data", resourceids); |
| | | return JSONObject.toJSONString(json); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.landtool.lanbase.modules.api.controller; |
| | | |
| | | import com.alibaba.excel.EasyExcel; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.landtool.lanbase.modules.res.entity.Res_ExtMapUrl; |
| | | import com.landtool.lanbase.modules.res.service.ResExtMapUrlService; |
| | | import com.landtool.lanbase.modules.terra.GisService; |
| | | import com.landtool.lanbase.modules.terra.GisServiceListener; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.servlet.http.Cookie; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.File; |
| | | import java.io.IOException; |
| | | import java.net.URISyntaxException; |
| | | import java.util.*; |
| | | import java.util.function.Consumer; |
| | | |
| | | @RestController |
| | | @RequestMapping("/manage") |
| | | @CrossOrigin |
| | | public class ManagerController { |
| | | |
| | | |
| | | @Autowired |
| | | ResExtMapUrlService ResExtMapUrlService; |
| | | |
| | | |
| | | // http://www.nmsmp.com:8082/res/ziYuanInsert |
| | | @RequestMapping(value="/batchRegister",method = RequestMethod.GET) |
| | | public @ResponseBody void batchRegister(HttpServletRequest request,HttpServletResponse httpresponse) throws IOException, URISyntaxException |
| | | { |
| | | |
| | | |
| | | |
| | | } |
| | | @RequestMapping(value="/test",method = RequestMethod.POST) |
| | | public @ResponseBody String batchimportUser(@RequestParam(value="file") MultipartFile uploadfile,String tgc,String jsession) throws Exception { |
| | | if(uploadfile.isEmpty()){ |
| | | return "file is empty"; |
| | | } |
| | | String filename=uploadfile.getOriginalFilename(); |
| | | String suffixname=filename.substring(filename.lastIndexOf(".")); |
| | | filename=UUID.randomUUID()+suffixname; |
| | | File file =new File("D:/upload/"+filename); |
| | | uploadfile.transferTo(file); |
| | | EasyExcel.read(file, GisService.class,new GisServiceListener(tgc,jsession)).doReadAll(); |
| | | |
| | | return "æä½æå" ; |
| | | } |
| | | @RequestMapping(value="/ok",method = RequestMethod.GET) |
| | | public @ResponseBody String ok(HttpServletResponse httpresponse,String tgc,String jsession) throws Exception { |
| | | Cookie cookie=new Cookie("TGC", tgc); |
| | | cookie.setPath("/cas/"); |
| | | cookie.setMaxAge(86400); |
| | | |
| | | httpresponse.addCookie(cookie); |
| | | Cookie cookie1=new Cookie("JSESSIONID", jsession); |
| | | |
| | | cookie.setMaxAge(86400); |
| | | |
| | | httpresponse.addCookie(cookie1); |
| | | |
| | | return "æä½æå" ; |
| | | } |
| | | |
| | | |
| | | @RequestMapping(value="/batchProxyUpdate",method = RequestMethod.GET) |
| | | public @ResponseBody String updateResource(HttpServletResponse httpresponse,String resids) throws Exception { |
| | | //è·åæ°æ®åºæ°æ® |
| | | List<Integer> list=new ArrayList<>(); |
| | | List<Map> urls=new ArrayList<>(); |
| | | String[] resarray=resids.split(","); |
| | | for (String str : resarray) { |
| | | list.add(Integer.valueOf(str)); |
| | | } |
| | | if(!list.isEmpty()){ |
| | | urls=ResExtMapUrlService.selectBatchUrl(list); |
| | | |
| | | urls.forEach(new Consumer<Map>() { |
| | | |
| | | @Override |
| | | public void accept(Map t) { |
| | | |
| | | layersProxy( t); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | |
| | | return "æä½æå" ; |
| | | } |
| | | public void layersProxy(Map t){ |
| | | Map<String,Object> map=new HashMap<>(); |
| | | map.put("zyid", Integer.valueOf(t.get("RESOURCEID").toString())); |
| | | map.put("serverUrl", t.get("SERVERURL")); |
| | | map.put("contextPath", ""); |
| | | map.put("urlid",t.get("URLID") ); |
| | | map.put("isPublic", 1); |
| | | map.put("suffix", 0); |
| | | map.put("fromsys", "HYJGPT"); |
| | | map.put("servername", t.get("TITLE")); |
| | | |
| | | JSONObject json= getProxyUrl(map); |
| | | Res_ExtMapUrl res=new Res_ExtMapUrl(); |
| | | res.setUrlid(Integer.valueOf(t.get("URLID").toString())); |
| | | res.setEsbid( json.getInteger("id")); |
| | | res.setResourceid(Integer.valueOf(t.get("RESOURCEID").toString())); |
| | | res.setServerurl(json.getString("proxyurl")); |
| | | ResExtMapUrlService.updateByPrimaryKey(res); |
| | | |
| | | } |
| | | |
| | | public JSONObject getProxyUrl(Map<String,Object> map){ |
| | | JSONObject json=new JSONObject(); |
| | | try { |
| | | String res=com.landtool.lanbase.common.utils.HttpUtils.get("http://71.3.21.232:8066"+"/serverRegister/addArcGisServer",map); |
| | | json=JSONObject.parseObject(res); |
| | | |
| | | } catch (Exception e) { |
| | | |
| | | e.printStackTrace(); |
| | | } |
| | | return json; |
| | | |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.landtool.lanbase.modules.api.controller.MapPortal; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.LinkedList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.serializer.SerializerFeature; |
| | | import com.github.pagehelper.Page; |
| | | import com.github.pagehelper.PageHelper; |
| | | import com.landtool.lanbase.modules.api.utils.PageBean; |
| | | import com.landtool.lanbase.modules.res.entity.Res_BusinessRef; |
| | | import com.landtool.lanbase.modules.res.entity.Res_ExtIntegrate; |
| | | import com.landtool.lanbase.modules.res.entity.Res_MainInfo; |
| | | import com.landtool.lanbase.modules.res.service.ResBusinessRefService; |
| | | import com.landtool.lanbase.modules.res.service.ResExtBusinessLayerService; |
| | | import com.landtool.lanbase.modules.res.service.ResExtIntegrateService; |
| | | import com.landtool.lanbase.modules.res.service.ResExtMapUrlService; |
| | | import com.landtool.lanbase.modules.res.service.ResMainInfoService; |
| | | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | |
| | | @Controller |
| | | @RequestMapping("api") |
| | | @Api(value = "", tags = {"æ°æ³¡å
³èåæ"}) |
| | | /** |
| | | * æ°æ³¡ââå
³èåæ |
| | | */ public class GuanLianFenXiController { |
| | | |
| | | @Autowired |
| | | private ResBusinessRefService resBusinessRefService; |
| | | |
| | | @Autowired |
| | | private ResMainInfoService resMainInfoService; |
| | | |
| | | @Autowired |
| | | private ResExtBusinessLayerService resExtBusinessLayerService; |
| | | |
| | | @Autowired |
| | | private ResExtMapUrlService resExtMapUrlService; |
| | | |
| | | @Autowired |
| | | private ResExtIntegrateService resExtIntegrateService; |
| | | |
| | | /** |
| | | * è·åç¸å
³å
³èå¾å±å表 |
| | | * @param resBusinessRef |
| | | * @return |
| | | */ |
| | | @GetMapping("map/getResBusinessRefList") |
| | | @ResponseBody |
| | | @ApiOperation(value = "è·åç¸å
³å
³èå¾å±å表", notes = "") |
| | | public String getResBusinessRefList(Res_BusinessRef resBusinessRef, PageBean pageBean) { |
| | | pageBean.setLimit(10); |
| | | PageHelper.startPage(pageBean.getPage(), pageBean.getLimit());//设置å½å页æ°åæ¯é¡µæ¡æ° |
| | | List<Res_BusinessRef> list = resBusinessRefService.getResBusinesssRefList(resBusinessRef); |
| | | int countNums = (int) ((Page) list).getTotal();//è·åè®°å½æ»æ° |
| | | PageBean<Res_BusinessRef> pageData = new PageBean<>(pageBean.getPage(), pageBean.getLimit(), countNums); |
| | | pageData.setItems(list); |
| | | List<Map<String, Object>> maps = new LinkedList<>(); |
| | | for (Integer i = 0; i < list.size(); i++) { |
| | | Res_MainInfo resMainInfo = resMainInfoService.selectByPrimaryKey(list.get(i).getRefresourceid()); |
| | | Res_BusinessRef resBusinessRef1 = resBusinessRefService.selectByPrimaryKey(list.get(i).getResourceid()); |
| | | Res_ExtIntegrate resExtIntegrate = resExtIntegrateService.selectByPrimaryKey(list.get(i).getRefresourceid()); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("title", resMainInfo.getTitle()); |
| | | map.put("resourceid", resMainInfo.getResourceid()); |
| | | map.put("resourceclass", resMainInfo.getResourceclass()); |
| | | map.put("createuserid", resMainInfo.getCreateuserid()); |
| | | if (resBusinessRef1 != null) { |
| | | map.put("inputparam", resBusinessRef1.getInputparam()); |
| | | map.put("outputparam", resBusinessRef1.getOutputparam()); |
| | | map.put("reftype", resBusinessRef1.getReftype()); |
| | | } else { |
| | | map.put("inputparam", ""); |
| | | map.put("outputparam", ""); |
| | | map.put("reftype", ""); |
| | | } |
| | | if (resExtIntegrate != null) { |
| | | map.put("serverurl", resExtIntegrate.getServerurl()); |
| | | map.put("showmodel", resExtIntegrate.getShowmodel()); |
| | | } else { |
| | | map.put("serverurl", ""); |
| | | map.put("showmodel", ""); |
| | | } |
| | | map.put("datasources", resMainInfo.getDatasources()); |
| | | maps.add(map); |
| | | } |
| | | Map<String, Object> result = new HashMap<>(); |
| | | result.put("Count", countNums); |
| | | result.put("Page", pageBean.getPage()); |
| | | result.put("ShuJu", maps); |
| | | |
| | | return JSON.toJSONString(result, SerializerFeature.WriteMapNullValue); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.landtool.lanbase.modules.api.controller.MapPortal; |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.landtool.lanbase.modules.res.entity.Res_DiyLayerInfo; |
| | | import com.landtool.lanbase.modules.res.entity.Res_MainInfo; |
| | | import com.landtool.lanbase.modules.res.service.ResDiyLayerInfoService; |
| | | |
| | | import com.landtool.lanbase.modules.res.service.ResMainInfoService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.sql.Timestamp; |
| | | import java.util.List; |
| | | import java.util.Date; |
| | | |
| | | @Controller |
| | | @RequestMapping("/api/layerdiy") |
| | | @Api(value = "", tags = {"èªå®ä¹å¾å±æä½ä¿¡æ¯"}) |
| | | public class LayerDiyInfo { |
| | | @Autowired |
| | | private ResDiyLayerInfoService resDiyLayerInfoService; |
| | | |
| | | @Autowired |
| | | private ResMainInfoService resMainInfoService; |
| | | |
| | | /** |
| | | * æ°å¢/ä¿®æ¹èªå®ä¹å¾å±ä¿¡æ¯ |
| | | */ |
| | | @PostMapping(path = "/add") |
| | | @ApiOperation(value = "èªå®ä¹å¾å±ä¿¡æ¯ æ°å¢/ä¿®æ¹", notes = "") |
| | | @ResponseBody |
| | | public String addDiyLayerInfo( |
| | | @ApiParam(name = "userid", value = "ç¨æ·Id", required = true) @RequestParam(name = "userid") int userid, |
| | | @ApiParam(name = "resourceid", value = "ä¿¡æ¯èµæºId", required = true) @RequestParam(name = "resourceid") int resourceid, |
| | | @ApiParam(name = "title", value = "æ é¢", required = true) @RequestParam(name = "title") String title, |
| | | @ApiParam(name = "typename", value = "ä¿¡æ¯ç±»å", required = true) @RequestParam(name = "typename") String typename, |
| | | @ApiParam(name = "content", value = "å
容", required = true) @RequestParam(name = "content") String content, |
| | | @ApiParam(name = "isshare", value = "å
񄧮", required = true) @RequestParam(name = "isshare") Integer isshare) { |
| | | // æ¯å¦åå¨è®°å½ï¼åå¨åä¿®æ¹ |
| | | Res_DiyLayerInfo info = resDiyLayerInfoService.queryObjectByUseridAndResid(userid, resourceid, title); |
| | | if (info == null) {// æ°å¢ |
| | | info = new Res_DiyLayerInfo(); |
| | | info.setResourceid(resourceid); |
| | | info.setContent(content); |
| | | info.setTitle(title); |
| | | info.setTypename(typename); |
| | | info.setDiyuserid(userid); |
| | | Timestamp audittime = new Timestamp(new Date().getTime()); |
| | | info.setDiytime(audittime); |
| | | info.setIsshare(isshare); |
| | | resDiyLayerInfoService.insert(info); |
| | | return "æ·»å æå"; |
| | | } else {// ä¿®æ¹ |
| | | info.setTitle(title); |
| | | info.setTypename(typename); |
| | | info.setContent(content); |
| | | Timestamp audittime = new Timestamp(new Date().getTime()); |
| | | info.setDiytime(audittime); |
| | | info.setIsshare(isshare); |
| | | resDiyLayerInfoService.updateByPrimaryKeySelective(info); |
| | | return "ä¿®æ¹æå"; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * ç¼è¾èªå®ä¹å¾å±ä¿¡æ¯é£æ ¼å
容 |
| | | */ |
| | | @PostMapping(path = "/update") |
| | | @ApiOperation(value = "ç¼è¾èªå®ä¹å¾å±ä¿¡æ¯é£æ ¼å
容", notes = "") |
| | | @ResponseBody |
| | | public String updateDiyLayerInfo( |
| | | @ApiParam(name = "diyid", value = "Id", required = true) @RequestParam(name = "diyid") int diyid, |
| | | @ApiParam(name = "title", value = "æ é¢") String title, |
| | | @ApiParam(name = "typename", value = "ä¿¡æ¯ç±»å") String typename, |
| | | @ApiParam(name = "content", value = "å
容", required = true) @RequestParam(name = "content") String content) { |
| | | Res_DiyLayerInfo info = new Res_DiyLayerInfo(); |
| | | if (content.length() != 0) { |
| | | info.setContent(content); |
| | | } |
| | | if (title != null && title.length() != 0) { |
| | | info.setTitle(title); |
| | | } |
| | | if (typename != null && typename.length() != 0) { |
| | | info.setTypename(typename); |
| | | } |
| | | info.setDiyid(diyid); |
| | | //info.setDiyuserid(1); // å
åæ»idï¼åç»æ¹æè¯»åå½åç»å½äººid |
| | | resDiyLayerInfoService.updateContentApi(info); |
| | | return "ç¼è¾æå"; |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢èªå®ä¹å¾å±ä¿¡æ¯å表 |
| | | */ |
| | | // @ResponseBody |
| | | // @GetMapping(path = "/info") |
| | | // @ApiOperation(value = "èªå®ä¹å¾å±ä¿¡æ¯å表", notes = "") |
| | | // public List<Res_DiyLayerInfo> queryListByUserId(@ApiParam(name = "resourceid", value = "ä¿¡æ¯èµæºId") Integer resourceid, |
| | | // @ApiParam(name = "title", value = "æ é¢") String title, |
| | | // @ApiParam(name = "typename", value = "ä¿¡æ¯ç±»å") String typename, |
| | | // @ApiParam(name = "diyid", value = "diyid") Integer diyid) { |
| | | // Res_DiyLayerInfo record = new Res_DiyLayerInfo(); |
| | | // record.setResourceid(resourceid); |
| | | // record.setTitle(title); |
| | | // record.setTypename(typename); |
| | | // record.setDiyid(diyid); |
| | | // return resDiyLayerInfoService.queryApiList(record); |
| | | // } |
| | | |
| | | /** |
| | | * å é¤èªå®ä¹å¾å±ä¿¡æ¯ |
| | | */ |
| | | @PostMapping(path = "/del") |
| | | @ApiOperation(value = "å é¤èªå®ä¹å¾å±ä¿¡æ¯", notes = "") |
| | | @ResponseBody |
| | | public String deleteDiyLayerInfo( |
| | | @ApiParam(name = "diyid", value = "diyid", required = true) @RequestParam(name = "diyid") Integer diyid) { |
| | | resDiyLayerInfoService.deleteDiyLayerInfo(diyid); |
| | | return "å 餿å"; |
| | | } |
| | | |
| | | /** |
| | | * æ£æ¥ç¨æ·æ¯å¦ä¸ºèµæºåå¸äººï¼å°å¾èªå®ä¹ä¿¡æ¯ä¿å--å
±äº«é项æ¯å¦æ¾ç¤ºå¤æï¼ |
| | | * @param userid |
| | | * @param resourceid |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @GetMapping(path = "/checkUserShare/{userid}/{resourceid}") |
| | | @ApiOperation(value = "æ£æ¥ç¨æ·æ¯å¦ä¸ºèµæºåå¸äºº", notes = "") |
| | | public String checkUserShare( |
| | | @ApiParam(name = "userid", value = "ç¨æ·ID", required = true) @RequestParam(name = "userid") Long userid, |
| | | @ApiParam(name = "resourceid", value = "èµæºID", required = true) @RequestParam(name = "resourceid") Long resourceid) { |
| | | Res_MainInfo resMainInfo = resMainInfoService.selectByPrimaryKey(resourceid.intValue());//è·åèµæºä¿¡æ¯ |
| | | if(resMainInfo.getCreateuserid() == resourceid) { |
| | | return "true"; |
| | | } else { |
| | | return "false"; |
| | | } |
| | | } |
| | | /** |
| | | * æ ¹æ®IDè·åèªå®ä¹é£æ ¼å
容 |
| | | * @param diyid |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @GetMapping(path = "layerdiycontent/{diyid}") |
| | | @ApiOperation(value = "æ ¹æ®IDè·åèªå®ä¹é£æ ¼å
容", notes = "") |
| | | public String GetLayerDiyContent(@ApiParam(name = "diyid", value = "diyid", required = true) @PathVariable(name = "diyid") Integer diyid, |
| | | HttpServletRequest request) { |
| | | String Json = ""; |
| | | Res_DiyLayerInfo resDiyLayerInfo = resDiyLayerInfoService.getById(diyid);// è·åèªå®ä¹é£æ ¼ä¿¡æ¯ |
| | | if (resDiyLayerInfo != null && resDiyLayerInfo.getContent() != null) { |
| | | JSONObject jsStr = JSONObject.parseObject(resDiyLayerInfo.getContent()); |
| | | Json = jsStr.get("text").toString(); |
| | | } |
| | | return Json; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.landtool.lanbase.modules.api.controller.MapPortal; |
| | | |
| | | import java.sql.Timestamp; |
| | | import java.util.Date; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.landtool.lanbase.modules.res.entity.Res_DiyLayerInfo; |
| | | import com.landtool.lanbase.modules.res.entity.Res_MainInfo; |
| | | import com.landtool.lanbase.modules.res.service.ResDiyLayerInfoService; |
| | | import com.landtool.lanbase.modules.res.service.ResMainInfoService; |
| | | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | |
| | | @Controller |
| | | @RequestMapping("/api/layerdiy") |
| | | @Api(value = "", tags = {"èªå®ä¹å¾å±æä½ä¿¡æ¯"}) |
| | | public class LayerDiyInfo { |
| | | @Autowired |
| | | private ResDiyLayerInfoService resDiyLayerInfoService; |
| | | |
| | | @Autowired |
| | | private ResMainInfoService resMainInfoService; |
| | | |
| | | /** |
| | | * æ°å¢/ä¿®æ¹èªå®ä¹å¾å±ä¿¡æ¯ |
| | | */ |
| | | @PostMapping(path = "/add") |
| | | @ApiOperation(value = "èªå®ä¹å¾å±ä¿¡æ¯ æ°å¢/ä¿®æ¹", notes = "") |
| | | @ResponseBody |
| | | public String addDiyLayerInfo( |
| | | @ApiParam(name = "userid", value = "ç¨æ·Id", required = true) @RequestParam(name = "userid") int userid, |
| | | @ApiParam(name = "resourceid", value = "ä¿¡æ¯èµæºId", required = true) @RequestParam(name = "resourceid") int resourceid, |
| | | @ApiParam(name = "title", value = "æ é¢", required = true) @RequestParam(name = "title") String title, |
| | | @ApiParam(name = "typename", value = "ä¿¡æ¯ç±»å", required = true) @RequestParam(name = "typename") String typename, |
| | | @ApiParam(name = "content", value = "å
容", required = true) @RequestParam(name = "content") String content, |
| | | @ApiParam(name = "isshare", value = "å
񄧮", required = true) @RequestParam(name = "isshare") Integer isshare) { |
| | | // æ¯å¦åå¨è®°å½ï¼åå¨åä¿®æ¹ |
| | | Res_DiyLayerInfo info = resDiyLayerInfoService.queryObjectByUseridAndResid(userid, resourceid, title); |
| | | if (info == null) {// æ°å¢ |
| | | info = new Res_DiyLayerInfo(); |
| | | info.setResourceid(resourceid); |
| | | info.setContent(content); |
| | | info.setTitle(title); |
| | | info.setTypename(typename); |
| | | info.setDiyuserid(userid); |
| | | Timestamp audittime = new Timestamp(new Date().getTime()); |
| | | info.setDiytime(audittime); |
| | | info.setIsshare(isshare); |
| | | resDiyLayerInfoService.insert(info); |
| | | return "æ·»å æå"; |
| | | } else {// ä¿®æ¹ |
| | | info.setTitle(title); |
| | | info.setTypename(typename); |
| | | info.setContent(content); |
| | | Timestamp audittime = new Timestamp(new Date().getTime()); |
| | | info.setDiytime(audittime); |
| | | info.setIsshare(isshare); |
| | | resDiyLayerInfoService.updateByPrimaryKeySelective(info); |
| | | return "ä¿®æ¹æå"; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * ç¼è¾èªå®ä¹å¾å±ä¿¡æ¯é£æ ¼å
容 |
| | | */ |
| | | @PostMapping(path = "/update") |
| | | @ApiOperation(value = "ç¼è¾èªå®ä¹å¾å±ä¿¡æ¯é£æ ¼å
容", notes = "") |
| | | @ResponseBody |
| | | public String updateDiyLayerInfo( |
| | | @ApiParam(name = "diyid", value = "Id", required = true) @RequestParam(name = "diyid") int diyid, |
| | | @ApiParam(name = "title", value = "æ é¢") String title, |
| | | @ApiParam(name = "typename", value = "ä¿¡æ¯ç±»å") String typename, |
| | | @ApiParam(name = "content", value = "å
容", required = true) @RequestParam(name = "content") String content) { |
| | | Res_DiyLayerInfo info = new Res_DiyLayerInfo(); |
| | | if (content.length() != 0) { |
| | | info.setContent(content); |
| | | } |
| | | if (title != null && title.length() != 0) { |
| | | info.setTitle(title); |
| | | } |
| | | if (typename != null && typename.length() != 0) { |
| | | info.setTypename(typename); |
| | | } |
| | | info.setDiyid(diyid); |
| | | //info.setDiyuserid(1); // å
åæ»idï¼åç»æ¹æè¯»åå½åç»å½äººid |
| | | resDiyLayerInfoService.updateContentApi(info); |
| | | return "ç¼è¾æå"; |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢èªå®ä¹å¾å±ä¿¡æ¯å表 |
| | | */ |
| | | // @ResponseBody |
| | | // @GetMapping(path = "/info") |
| | | // @ApiOperation(value = "èªå®ä¹å¾å±ä¿¡æ¯å表", notes = "") |
| | | // public List<Res_DiyLayerInfo> queryListByUserId(@ApiParam(name = "resourceid", value = "ä¿¡æ¯èµæºId") Integer resourceid, |
| | | // @ApiParam(name = "title", value = "æ é¢") String title, |
| | | // @ApiParam(name = "typename", value = "ä¿¡æ¯ç±»å") String typename, |
| | | // @ApiParam(name = "diyid", value = "diyid") Integer diyid) { |
| | | // Res_DiyLayerInfo record = new Res_DiyLayerInfo(); |
| | | // record.setResourceid(resourceid); |
| | | // record.setTitle(title); |
| | | // record.setTypename(typename); |
| | | // record.setDiyid(diyid); |
| | | // return resDiyLayerInfoService.queryApiList(record); |
| | | // } |
| | | |
| | | /** |
| | | * å é¤èªå®ä¹å¾å±ä¿¡æ¯ |
| | | */ |
| | | @PostMapping(path = "/del") |
| | | @ApiOperation(value = "å é¤èªå®ä¹å¾å±ä¿¡æ¯", notes = "") |
| | | @ResponseBody |
| | | public String deleteDiyLayerInfo( |
| | | @ApiParam(name = "diyid", value = "diyid", required = true) @RequestParam(name = "diyid") Integer diyid) { |
| | | resDiyLayerInfoService.deleteDiyLayerInfo(diyid); |
| | | return "å 餿å"; |
| | | } |
| | | |
| | | /** |
| | | * æ£æ¥ç¨æ·æ¯å¦ä¸ºèµæºåå¸äººï¼å°å¾èªå®ä¹ä¿¡æ¯ä¿å--å
±äº«é项æ¯å¦æ¾ç¤ºå¤æï¼ |
| | | * @param userid |
| | | * @param resourceid |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @GetMapping(path = "/checkUserShare") |
| | | @ApiOperation(value = "æ£æ¥ç¨æ·æ¯å¦ä¸ºèµæºåå¸äºº", notes = "") |
| | | public String checkUserShare( |
| | | @ApiParam(name = "userid", value = "ç¨æ·ID", required = true) @RequestParam(name = "userid") Long userid, |
| | | @ApiParam(name = "resourceid", value = "èµæºID", required = true) @RequestParam(name = "resourceid") Long resourceid) { |
| | | Res_MainInfo resMainInfo = resMainInfoService.selectByPrimaryKey(resourceid.intValue());//è·åèµæºä¿¡æ¯ |
| | | if(resMainInfo.getCreateuserid() == resourceid) { |
| | | return "true"; |
| | | } else { |
| | | return "false"; |
| | | } |
| | | } |
| | | /** |
| | | * æ ¹æ®IDè·åèªå®ä¹é£æ ¼å
容 |
| | | * @param diyid |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @GetMapping(path = "layerdiycontent/{diyid}") |
| | | @ApiOperation(value = "æ ¹æ®IDè·åèªå®ä¹é£æ ¼å
容", notes = "") |
| | | public String GetLayerDiyContent(@ApiParam(name = "diyid", value = "diyid", required = true) @PathVariable(name = "diyid") Integer diyid, |
| | | HttpServletRequest request) { |
| | | String Json = ""; |
| | | Res_DiyLayerInfo resDiyLayerInfo = resDiyLayerInfoService.getById(diyid);// è·åèªå®ä¹é£æ ¼ä¿¡æ¯ |
| | | if (resDiyLayerInfo != null && resDiyLayerInfo.getContent() != null) { |
| | | JSONObject jsStr = JSONObject.parseObject(resDiyLayerInfo.getContent()); |
| | | Json = jsStr.get("text").toString(); |
| | | } |
| | | return Json; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.landtool.lanbase.modules.api.controller.MapPortal; |
| | | |
| | | import java.io.File; |
| | | import java.io.IOException; |
| | | import java.sql.Timestamp; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.LinkedList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.google.gson.JsonObject; |
| | | import com.landtool.lanbase.common.utils.HttpUtils; |
| | | import com.qiniu.util.Json; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.serializer.SerializerFeature; |
| | | import com.landtool.lanbase.common.map.EsbToken; |
| | | import com.landtool.lanbase.common.utils.HttpOperateUtils; |
| | | import com.landtool.lanbase.config.SysTemPropertyConfig; |
| | | import com.landtool.lanbase.modules.org.entity.OrgUser; |
| | | import com.landtool.lanbase.modules.org.service.OrgUserService; |
| | | import com.landtool.lanbase.modules.res.entity.Res_BookMarks; |
| | | import com.landtool.lanbase.modules.res.entity.Res_BusinessRef; |
| | | import com.landtool.lanbase.modules.res.entity.Res_DiyLayerInfo; |
| | | import com.landtool.lanbase.modules.res.entity.Res_ExtBaseMap; |
| | | import com.landtool.lanbase.modules.res.entity.Res_ExtBusinessLayer; |
| | | import com.landtool.lanbase.modules.res.entity.Res_ExtFileSource; |
| | | import com.landtool.lanbase.modules.res.entity.Res_ExtIntegrate; |
| | | import com.landtool.lanbase.modules.res.entity.Res_ExtMapUrl; |
| | | import com.landtool.lanbase.modules.res.entity.Res_ExtSpaceServer; |
| | | import com.landtool.lanbase.modules.res.entity.Res_ExtThemeMap; |
| | | import com.landtool.lanbase.modules.res.entity.Res_MainInfo; |
| | | import com.landtool.lanbase.modules.res.entity.Res_QueryAround; |
| | | import com.landtool.lanbase.modules.res.entity.Res_SpacesParam; |
| | | import com.landtool.lanbase.modules.res.entity.Res_SymbolLibrary; |
| | | import com.landtool.lanbase.modules.res.entity.Res_User_LayerExtent; |
| | | import com.landtool.lanbase.modules.res.entity.UserDefined.UserDef_BaseMap; |
| | | import com.landtool.lanbase.modules.res.entity.UserDefined.UserDef_SpaceServer; |
| | | import com.landtool.lanbase.modules.res.entity.ViewModels.LayerObject; |
| | | import com.landtool.lanbase.modules.res.service.ResBookMarksService; |
| | | import com.landtool.lanbase.modules.res.service.ResBusinessRefService; |
| | | import com.landtool.lanbase.modules.res.service.ResDiyLayerInfoService; |
| | | import com.landtool.lanbase.modules.res.service.ResExtBaseMapService; |
| | | import com.landtool.lanbase.modules.res.service.ResExtBusinessLayerService; |
| | | import com.landtool.lanbase.modules.res.service.ResExtFileSourceService; |
| | | import com.landtool.lanbase.modules.res.service.ResExtIntegrateService; |
| | | import com.landtool.lanbase.modules.res.service.ResExtMapUrlService; |
| | | import com.landtool.lanbase.modules.res.service.ResExtSpaceServerService; |
| | | import com.landtool.lanbase.modules.res.service.ResExtThemeMapService; |
| | | import com.landtool.lanbase.modules.res.service.ResMainInfoService; |
| | | import com.landtool.lanbase.modules.res.service.ResQueryAroundService; |
| | | import com.landtool.lanbase.modules.res.service.ResSpacesParamService; |
| | | import com.landtool.lanbase.modules.res.service.ResSymbolLibraryService; |
| | | import com.landtool.lanbase.modules.res.service.ResUserLayerExtentService; |
| | | import com.landtool.lanbase.modules.res.service.ZhuanTiZhiTuService; |
| | | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | |
| | | /** |
| | | * @author åå°æ³¢ |
| | | * @Description: å端å°å¾å±ç¤ºéç¨æ¥å£ï¼è·ååºå¾ãè·åèµæºåè®®æèªå®ä¹é£æ ¼ä¿¡æ¯ |
| | | * @date 2018-05-26 |
| | | */ |
| | | |
| | | @Controller |
| | | @RequestMapping("/api/mapcommon/") |
| | | @Api(value = "", tags = {"å端å°å¾å±ç¤ºéç¨æ¥å£"}) |
| | | public class MapCommonController { |
| | | @Autowired |
| | | private ResExtBaseMapService resExtBaseMapService; |
| | | |
| | | @Autowired |
| | | private ResExtMapUrlService resExtMapUrlService; |
| | | |
| | | @Autowired |
| | | private ZhuanTiZhiTuService zhuanTiZhiTuService; |
| | | |
| | | @Autowired |
| | | private OrgUserService orgUserService; |
| | | |
| | | @Autowired |
| | | private SysTemPropertyConfig sysConfig; |
| | | |
| | | @Autowired |
| | | private ResDiyLayerInfoService resDiyLayerInfoService; |
| | | |
| | | @Autowired |
| | | private ResBusinessRefService resBusinessRefService; |
| | | |
| | | @Autowired |
| | | private ResQueryAroundService resQueryAroundService; |
| | | |
| | | @Autowired |
| | | private ResExtThemeMapService resExtThemeMapService; |
| | | |
| | | @Autowired |
| | | private ResExtIntegrateService resExtIntegrateService; |
| | | |
| | | @Autowired |
| | | private ResBookMarksService resBookMarksService; |
| | | |
| | | @Autowired |
| | | private ResExtBusinessLayerService resExtBusinessLayerService; |
| | | |
| | | @Autowired |
| | | private ResMainInfoService resMainInfoService; |
| | | |
| | | @Autowired |
| | | private ResSymbolLibraryService resSymbolLibraryService; |
| | | |
| | | @Autowired |
| | | private ResExtFileSourceService resExtFileSourceService; |
| | | |
| | | @Autowired |
| | | private ResExtSpaceServerService resExtSpaceServerService; |
| | | |
| | | @Autowired |
| | | private ResSpacesParamService resSpacesParamService; |
| | | |
| | | @Autowired |
| | | private ResUserLayerExtentService resUserLayerExtentService; |
| | | |
| | | /** |
| | | * ä¸é¢å¶å¾ - åºå¾åæ¢ -- è·ååºç¡åºå¾å表 |
| | | */ |
| | | @ResponseBody |
| | | @GetMapping("/basemaplist") |
| | | @ApiOperation(value = "æ¥è¯¢å·²å®¡æ ¸çåºç¡åºå¾ä¿¡æ¯å表", notes = "") |
| | | public List<Map<String, Object>> getBaseMapList(Long userid, String type, Boolean supportDynamic, HttpServletRequest request) { |
| | | List<UserDef_BaseMap> list = zhuanTiZhiTuService.getBaseMapList(type, supportDynamic); |
| | | StringBuilder str = new StringBuilder(); |
| | | str.append("["); |
| | | List<Map<String, Object>> maps = new LinkedList<>(); |
| | | for (int i = 0; i < list.size(); i++) { |
| | | //æ¥è¯¢æ¯å¦æ¯ä¸é¢å°å¾ï¼æ¯ä¸é¢å°å¾åè·åç¸å
³åå¾å±ID |
| | | String subzyids = ""; |
| | | boolean isPubzy = false; |
| | | if (list.get(i).getSharprotocol().equals("å®å
¨å
¬å¼")) { |
| | | isPubzy = true; |
| | | } |
| | | |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("resourceId", list.get(i).getResourceid()); |
| | | map.put("title", list.get(i).getTitle()); |
| | | map.put("imgurl", list.get(i).getImgurl()); |
| | | map.put("serverUrl", EsbToken.getEsbUrl(list.get(i).getServerurl(), userid.intValue(), request.getRemoteAddr(), list.get(i).getResourceid(), list.get(i).getEspproxy(), sysConfig, subzyids, isPubzy, list.get(i).getToken(), false)); |
| | | |
| | | if (list.get(i).getRefmarkinfid() != null) { //夿å
³èæ æ³¨å¾èµæºIDæ¯å¦ä¸ºç©º |
| | | Res_ExtBaseMap resExtBaseMap = resExtBaseMapService.selectByPrimaryKey(list.get(i).getRefmarkinfid()); |
| | | if (resExtBaseMap != null) { |
| | | Res_MainInfo resMainInfo = resMainInfoService.selectByPrimaryKey(list.get(i).getRefmarkinfid()); |
| | | |
| | | Map<String, Object> refmap = new HashMap<>(); |
| | | refmap.put("resourceId", resExtBaseMap.getResourceid()); |
| | | refmap.put("title", resMainInfo.getTitle()); |
| | | refmap.put("publishsoft", resExtBaseMap.getPublishsoft()); |
| | | |
| | | Res_ExtMapUrl resExtMapUrl = resExtMapUrlService.queryFirstOrderByResId(resExtBaseMap.getResourceid());// è·åèµæºæ¯æåè®®ä¸å°å |
| | | if (resExtMapUrl != null) { |
| | | refmap.put("serverUrl", EsbToken.getEsbUrl(resExtMapUrl.getServerurl(), userid.intValue(), request.getRemoteAddr(), resExtBaseMap.getResourceid(), resMainInfo.getEspproxy(), sysConfig, subzyids, isPubzy, list.get(i).getToken(), false)); |
| | | } else { |
| | | refmap.put("serverUrl", null); |
| | | } |
| | | map.put("AnnoLayer", refmap); |
| | | } else { |
| | | map.put("AnnoLayer", null); |
| | | } |
| | | } else { |
| | | map.put("AnnoLayer", null); |
| | | } |
| | | maps.add(map); |
| | | } |
| | | str.append("]"); |
| | | return maps; |
| | | } |
| | | |
| | | /** |
| | | * å°å¾å¯¹æ¯ -- è·ååºç¡åºå¾å表 |
| | | */ |
| | | @ResponseBody |
| | | @GetMapping("/incisionMap/basemaplist") |
| | | @ApiOperation(value = "è·åå°å¾å¯¹æ¯åºç¡åºå¾å表", notes = "") |
| | | public String getIncisionMapBaseList(Long userid, HttpServletRequest request) { |
| | | String[] typeList = new String[]{"ç¢é", "ä½ç²¾", "é«ç²¾", "å
¶å®"}; |
| | | StringBuilder sb = new StringBuilder(); |
| | | List<Map<String, Object>> maps = new LinkedList<>(); |
| | | for (int i = 0; i < typeList.length; i++) { |
| | | List<UserDef_BaseMap> list = zhuanTiZhiTuService.getBaseMapList(typeList[i], false); |
| | | |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("name", typeList[i]); |
| | | map.put("nocheck", true); |
| | | |
| | | if (i > 0) sb.append(","); |
| | | sb.append("{name: '" + typeList[i] + "', nocheck: true,children:["); |
| | | List<Map<String, Object>> child = new LinkedList<>(); |
| | | for (int j = 0; j < list.size(); j++) { |
| | | Map<String, Object> newmap = new HashMap<>(); |
| | | newmap.put("name", list.get(j).getTitle()); |
| | | newmap.put("id", list.get(j).getResourceid()); |
| | | newmap.put("checked", false); |
| | | child.add(newmap); |
| | | } |
| | | map.put("children", child); |
| | | maps.add(map); |
| | | } |
| | | |
| | | return JSON.toJSONString(maps, SerializerFeature.WriteMapNullValue); |
| | | } |
| | | |
| | | /** |
| | | * @Description: è·åèµæºæå¡å°åä¿¡æ¯ |
| | | * @Author: xiaoxuan.xie |
| | | * @Date: 09:30 2018/3/31 |
| | | * @return: String |
| | | * @see Res_MainInfo |
| | | */ |
| | | @ResponseBody |
| | | @GetMapping(path = {"layerinfo/{resourceid}/{userid}", "layerinfo/{resourceid}/{userid}/{diyid}"}) |
| | | @ApiOperation(value = "è·åèµæºæå¡å°åä¿¡æ¯", notes = "") |
| | | public String GetLayerObject(@ApiParam(name = "resourceid", value = "èµæºId", required = true) @PathVariable(name = "resourceid") int resourceid, @ApiParam(name = "userid", value = "ç¨æ·Id", required = true) @PathVariable(name = "userid") Integer userid, @ApiParam(name = "diyid", value = "èªå®ä¹é£æ ¼Id") @PathVariable(name = "diyid", required = false) Integer diyid, HttpServletRequest request) throws Exception { |
| | | Map<String, Object> maps = new HashMap<>(); |
| | | String Json = ""; |
| | | OrgUser orgUser = orgUserService.queryObject(Long.parseLong(userid.toString())); |
| | | |
| | | if (resourceid > 0) { |
| | | Res_MainInfo resMainInfo = resMainInfoService.selectByPrimaryKey(resourceid);// è·åèµæºä¸»è¡¨ä¿¡æ¯ |
| | | if (resMainInfo != null) { |
| | | String resourceType = resMainInfo.getResourceclass();// è·åèµæºç±»å |
| | | if (resourceType == null) resourceType = ""; |
| | | LayerObject layer = null; |
| | | switch (resourceType) { |
| | | case "KJ_YWTC": |
| | | case "KJ_JCDT": |
| | | String username = request.getRemoteUser(); |
| | | Boolean GuanLian = false;//ä¸å¡å
³è |
| | | Boolean ZhouBian = false;//å¨è¾¹æ¥è¯¢ |
| | | if (resourceType.equals("KJ_YWTC")) { |
| | | Res_BusinessRef res_businessRef = new Res_BusinessRef(); |
| | | res_businessRef.setResourceid(resourceid); |
| | | List<Res_BusinessRef> resBusinessRefList = resBusinessRefService.selectResBusinesssRef(res_businessRef);//è·åä¸å¡å¾å±å
³èåæä¿¡æ¯ |
| | | if (resBusinessRefList.size() > 0) GuanLian = true; |
| | | List<Res_QueryAround> resQueryAroundList = resQueryAroundService.getZhouBianList(resourceid);//è·åèµæºå¨è¾¹æ¥è¯¢å表 |
| | | if (resQueryAroundList.size() > 0) ZhouBian = true; |
| | | } |
| | | // è·åç¨æ·å®ä¹JSON |
| | | Res_DiyLayerInfo resDiyLayerInfo; |
| | | if (diyid != null && diyid > 0) { |
| | | resDiyLayerInfo = resDiyLayerInfoService.getById(diyid);//è·åèªå®ä¹é£æ ¼ä¿¡æ¯ |
| | | } else { |
| | | resDiyLayerInfo = resDiyLayerInfoService.queryUserObject(userid, resourceid, null); |
| | | } |
| | | if (resDiyLayerInfo != null) { |
| | | maps.put("diyId", resDiyLayerInfo.getDiyid()); |
| | | maps.put("resourceId", resourceid); |
| | | maps.put("title", resMainInfo.getTitle()); |
| | | maps.put("desurl", resMainInfo.getDesurl()); |
| | | maps.put("content", JSON.parseObject(resDiyLayerInfo.getContent())); |
| | | maps.put("resourceclass", resourceType); |
| | | maps.put("GuanLian", GuanLian); |
| | | maps.put("ZhouBian", ZhouBian); |
| | | } else { |
| | | // è·å管çåå®ä¹JSON |
| | | resDiyLayerInfo = resDiyLayerInfoService.queryUserObject(userid, resourceid, 1); |
| | | if (resDiyLayerInfo != null) { |
| | | maps.put("diyId", resDiyLayerInfo.getDiyid()); |
| | | maps.put("resourceId", resourceid); |
| | | maps.put("title", resMainInfo.getTitle()); |
| | | maps.put("desurl", resMainInfo.getDesurl()); |
| | | maps.put("content", JSON.parseObject(resDiyLayerInfo.getContent())); |
| | | maps.put("resourceclass", resourceType); |
| | | maps.put("GuanLian", GuanLian); |
| | | maps.put("ZhouBian", ZhouBian); |
| | | } else { |
| | | // è·åèµæºæ¯æåè®®ä¸å°å |
| | | Res_ExtMapUrl resExtMapUrl = resExtMapUrlService.queryFirstOrderByResId(resourceid); |
| | | //æ¥è¯¢æ¯å¦æ¯ä¸é¢å°å¾ï¼æ¯ä¸é¢å°å¾åè·åç¸å
³åå¾å±ID |
| | | //Res_ExtThemeMap resExtThemeMap = resExtThemeMapService.selectByPrimaryKey(resourceid); |
| | | String subzyids = ""; |
| | | boolean isPubzy = false; |
| | | Res_MainInfo resMainInfo1 = resMainInfoService.selectByPrimaryKey(resourceid); |
| | | if (resMainInfo1 != null && resMainInfo1.getSharprotocol().equals("å®å
¨å
¬å¼")) { |
| | | isPubzy = true; |
| | | } |
| | | if (resExtMapUrl != null) { |
| | | maps.put("resourceId", resourceid); |
| | | maps.put("title", resMainInfo.getTitle()); |
| | | maps.put("desurl", resMainInfo.getDesurl()); |
| | | maps.put("typeandurl", resExtMapUrl.getTypeandurl()); |
| | | maps.put("serverUrl", EsbToken.getEsbUrl(resExtMapUrl.getServerurl(), orgUser.getUserid().intValue(), request.getRemoteAddr(), resourceid, resMainInfo.getEspproxy(), sysConfig, subzyids, isPubzy, resMainInfo.getToken(), false)); |
| | | maps.put("resourceclass", resourceType); |
| | | maps.put("GuanLian", GuanLian); |
| | | maps.put("ZhouBian", ZhouBian); |
| | | } else { |
| | | maps.put("resourceId", resourceid); |
| | | maps.put("title", resMainInfo.getTitle()); |
| | | maps.put("desurl", resMainInfo.getDesurl()); |
| | | maps.put("typeandurl", ""); |
| | | maps.put("serverUrl", ""); |
| | | maps.put("resourceclass", resourceType); |
| | | maps.put("GuanLian", GuanLian); |
| | | maps.put("ZhouBian", ZhouBian); |
| | | } |
| | | } |
| | | } |
| | | if (resourceType.equals("KJ_JCDT")) { |
| | | Res_ExtBaseMap resExtBaseMap = resExtBaseMapService.selectByPrimaryKey(resourceid);//è·ååºç¡åºå¾æå±ä¿¡æ¯ |
| | | if (resExtBaseMap.getRefmarkinfid() != null) { |
| | | Res_MainInfo AnnoMainInfo = resMainInfoService.selectByPrimaryKey(resExtBaseMap.getRefmarkinfid()); |
| | | Res_ExtBaseMap AnnoLayer = resExtBaseMapService.selectByPrimaryKey(resExtBaseMap.getRefmarkinfid()); |
| | | if (AnnoLayer != null) { |
| | | Res_ExtThemeMap resExtThemeMap = resExtThemeMapService.selectByPrimaryKey(resourceid); |
| | | String subzyids = ""; |
| | | if (resExtThemeMap != null) { |
| | | subzyids = resExtThemeMap.getSublayerset(); |
| | | } |
| | | boolean isPubzy = false; |
| | | Res_MainInfo resMainInfo1 = resMainInfoService.selectByPrimaryKey(resourceid); |
| | | if (resMainInfo1 != null && resMainInfo1.getSharprotocol().equals("å®å
¨å
¬å¼")) { |
| | | isPubzy = true; |
| | | } |
| | | Map<String, Object> AnnoLayerMap = new HashMap<>(); |
| | | AnnoLayerMap.put("resourceId", AnnoLayer.getResourceid()); |
| | | AnnoLayerMap.put("title", AnnoMainInfo.getTitle()); |
| | | AnnoLayerMap.put("publishsoft", AnnoLayer.getPublishsoft()); |
| | | Res_ExtMapUrl resExtMapUrl = resExtMapUrlService.queryFirstOrderByResId(AnnoLayer.getResourceid());// è·åèµæºæ¯æåè®®ä¸å°å |
| | | if (resExtMapUrl != null) { |
| | | AnnoLayerMap.put("serverUrl", EsbToken.getEsbUrl(resExtMapUrl.getServerurl(), orgUser.getUserid().intValue(), request.getRemoteAddr(), AnnoLayer.getResourceid(), AnnoMainInfo.getEspproxy(), sysConfig, subzyids, isPubzy, AnnoMainInfo.getToken(), false)); |
| | | } else { |
| | | AnnoLayerMap.put("serverUrl", null); |
| | | } |
| | | maps.put("AnnoLayer", AnnoLayerMap); |
| | | } else { |
| | | maps.put("AnnoLayer", null); |
| | | } |
| | | } else { |
| | | maps.put("AnnoLayer", null); |
| | | } |
| | | } else { |
| | | Integer IsExistServiceConfig = 0; |
| | | Res_ExtBusinessLayer resExtBusinessLayer = resExtBusinessLayerService.selectByPrimaryKey(resourceid); |
| | | if (resExtBusinessLayer != null && resExtBusinessLayer.getServiceConfig() != null && !resExtBusinessLayer.getServiceConfig().equals("")) { |
| | | IsExistServiceConfig = 1; |
| | | } |
| | | maps.put("IsExistServiceConfig", IsExistServiceConfig); |
| | | } |
| | | break; |
| | | case "KJ_ZTDT"://ä¸é¢å°å¾ |
| | | Res_ExtThemeMap resExtThemeMap = resExtThemeMapService.selectByPrimaryKey(resourceid);// è·åä¸é¢å°å¾æå±ä¿¡æ¯ |
| | | if (resExtThemeMap != null) { |
| | | Res_ExtMapUrl resExtMapUrl = resExtMapUrlService.queryFirstOrderByResId(resourceid);// è·åèµæºæ¯æåè®®ä¸å°å |
| | | String typeandurl = null; |
| | | String serverurl = null; |
| | | if (resExtMapUrl != null) { |
| | | typeandurl = resExtMapUrl.getTypeandurl(); |
| | | serverurl = resExtMapUrl.getServerurl(); |
| | | } |
| | | maps.put("resourceId", resourceid); |
| | | maps.put("title", resMainInfo.getTitle()); |
| | | maps.put("mapjson", resExtThemeMap.getType() != null && resExtThemeMap.getType().equals("ç³»ç»å¶ä½") ? JSON.parseObject(resExtThemeMap.getMapjson()) : null); |
| | | maps.put("resourceclass", "KJ_ZTDT"); |
| | | maps.put("childclass", resExtThemeMap.getType()); |
| | | maps.put("publishsoft", resExtThemeMap.getPublishsoft()); |
| | | maps.put("typeandurl", typeandurl); |
| | | maps.put("desurl", resMainInfo.getDesurl()); |
| | | maps.put("legendUrl", resExtThemeMap.getLegendurl()); |
| | | maps.put("serverUrl", EsbToken.getEsbUrl(serverurl, orgUser.getUserid().intValue(), request.getRemoteAddr(), resourceid, resMainInfo.getEspproxy(), sysConfig, resExtThemeMap.getSublayerset(), resMainInfo != null && resMainInfo.getSharprotocol().equals("å®å
¨å
¬å¼"), resMainInfo.getToken(), false)); |
| | | if (resExtThemeMap.getType().equals("ArcMap") && resExtThemeMap.getDefaultlayerset() != null) { |
| | | Res_ExtBaseMap resExtBaseMap = resExtBaseMapService.selectByPrimaryKey(resExtThemeMap.getDefaultlayerset());//è·åå
³èåºå¾ä¿¡æ¯ |
| | | Res_ExtThemeMap resExtThemeMap1 = resExtThemeMapService.selectByPrimaryKey(resourceid); |
| | | String subzyids = ""; |
| | | if (resExtThemeMap1 != null) { |
| | | subzyids = resExtThemeMap1.getSublayerset(); |
| | | } |
| | | boolean isPubzy = false; |
| | | Res_MainInfo resMainInfo1 = resMainInfoService.selectByPrimaryKey(resourceid); |
| | | if (resMainInfo1 != null && resMainInfo1.getSharprotocol().equals("å®å
¨å
¬å¼")) { |
| | | isPubzy = true; |
| | | } |
| | | if (resExtBaseMap != null) { |
| | | Map<String, Object> BaseMapLayerObjectMap = new HashMap<>(); |
| | | Res_ExtMapUrl resExtMapUrl2 = resExtMapUrlService.queryFirstOrderByResId(resExtBaseMap.getResourceid());// è·åèµæºæ¯æåè®®ä¸å°å |
| | | |
| | | if (resExtMapUrl2 != null) { |
| | | BaseMapLayerObjectMap.put("typeandurl", resExtMapUrl2.getTypeandurl()); |
| | | BaseMapLayerObjectMap.put("serverUrl", EsbToken.getEsbUrl(resExtMapUrl2.getServerurl(), orgUser.getUserid().intValue(), request.getRemoteAddr(), resExtBaseMap.getResourceid(), resMainInfo.getEspproxy(), sysConfig, subzyids, isPubzy, resMainInfo.getToken(), false)); |
| | | } else { |
| | | BaseMapLayerObjectMap.put("typeandurl", ""); |
| | | BaseMapLayerObjectMap.put("serverUrl", ""); |
| | | } |
| | | Res_MainInfo baseMap = resMainInfoService.selectByPrimaryKey(resExtBaseMap.getResourceid()); |
| | | BaseMapLayerObjectMap.put("label", baseMap.getTitle());//åºå¾åç§° |
| | | BaseMapLayerObjectMap.put("basemaptype", resExtBaseMap.getBasemaptype());//åºå¾ç±»å |
| | | BaseMapLayerObjectMap.put("displaylev", resExtBaseMap.getDisplaylev());//åççº§å« |
| | | //å
³èæ æ³¨å¾ |
| | | if (resExtBaseMap.getRefmarkinfid() != null) { |
| | | Res_ExtBaseMap biaozhu = resExtBaseMapService.selectByPrimaryKey(resExtBaseMap.getRefmarkinfid());//è·åå
³èåºå¾æ 注å¾ä¿¡æ¯ |
| | | if (biaozhu != null) { |
| | | Map<String, Object> AnnoLayerMap = new HashMap<>(); |
| | | Res_MainInfo res_mainInfo = resMainInfoService.selectByPrimaryKey(resExtBaseMap.getRefmarkinfid()); |
| | | AnnoLayerMap.put("resourceId", res_mainInfo.getResourceid());//æ æ³¨å¾ID |
| | | AnnoLayerMap.put("label", res_mainInfo.getTitle());//æ æ³¨å¾æ é¢ |
| | | Res_ExtMapUrl resExtMapUrl1 = resExtMapUrlService.queryFirstOrderByResId(resExtBaseMap.getRefmarkinfid());// è·åèµæºæ¯æåè®®ä¸å°å |
| | | if (resExtMapUrl1 != null) { |
| | | AnnoLayerMap.put("typeandurl", resExtMapUrl1.getTypeandurl());//åè®®æå¡ç±»å--BaseMapType |
| | | AnnoLayerMap.put("serverUrl", EsbToken.getEsbUrl(resExtMapUrl1.getServerurl(), orgUser.getUserid().intValue(), request.getRemoteAddr(), biaozhu.getResourceid(), resMainInfo.getEspproxy(), sysConfig, subzyids, isPubzy, resMainInfo.getToken(), false));//åè®®æå¡å°å--layerUrl |
| | | } else { |
| | | AnnoLayerMap.put("typeandurl", "");//åè®®æå¡ç±»å--BaseMapType |
| | | AnnoLayerMap.put("serverUrl", "");//åè®®æå¡å°å--layerUrl |
| | | } |
| | | AnnoLayerMap.put("basemaptype", biaozhu.getBasemaptype());//åºå¾ç±»å--layerType |
| | | AnnoLayerMap.put("displaylev", biaozhu.getDisplaylev());//åç级å«--displayLevels |
| | | BaseMapLayerObjectMap.put("AnnoLayer", AnnoLayerMap); |
| | | } else { |
| | | BaseMapLayerObjectMap.put("AnnoLayer", null); |
| | | } |
| | | } |
| | | |
| | | maps.put("BaseMapLayerObject", BaseMapLayerObjectMap); |
| | | } else { |
| | | maps.put("BaseMapLayerObject", null); |
| | | } |
| | | } else { |
| | | maps.put("BaseMapLayerObject", null); |
| | | } |
| | | } else { |
| | | maps.put("resourceId", resourceid); |
| | | maps.put("title", resMainInfo.getTitle()); |
| | | maps.put("mapjson", null); |
| | | maps.put("resourceclass", "KJ_ZTDT"); |
| | | maps.put("childclass", null); |
| | | maps.put("publishsoft", null); |
| | | maps.put("typeandurl", null); |
| | | maps.put("desurl", resMainInfo.getDesurl()); |
| | | maps.put("legendUrl", null); |
| | | maps.put("serverUrl", null); |
| | | } |
| | | break; |
| | | case "YWJC": |
| | | Res_ExtIntegrate resExtIntegrate = resExtIntegrateService.selectByPrimaryKey(resourceid);//è·åä¸å¡éææå±ä¿¡æ¯ |
| | | maps.put("resourceId", resourceid);//ä¸å¡éææå¡å°å |
| | | if (resMainInfo != null) { |
| | | maps.put("title", resMainInfo.getTitle());//ä¸å¡éæèµæºåç§° |
| | | maps.put("desurl", resMainInfo.getDesurl()); |
| | | } else { |
| | | maps.put("title", "");//ä¸å¡éæèµæºåç§° |
| | | maps.put("desurl", null); |
| | | } |
| | | if (resExtIntegrate != null) { |
| | | maps.put("serverUrl", resExtIntegrate.getServerurl());//ä¸å¡éææå¡å°å |
| | | //è·åç»è®¡å¾è¡¨é
ç½® |
| | | try { |
| | | if (resExtIntegrate.getIntegratetype().equals("æ°æ®éæ") && resExtIntegrate.getServerurl() != null && !resExtIntegrate.getServerurl().isEmpty()) { |
| | | maps.put("jieShouContent", HttpOperateUtils.httpGet(resExtIntegrate.getServerurl())); |
| | | } else { |
| | | maps.put("jieShouContent", null); |
| | | } |
| | | } catch (IOException e) { |
| | | maps.put("jieShouContent", null); |
| | | } |
| | | maps.put("reflayerfield", resExtIntegrate.getReflayerfield());//ä¸å¡å¾å±å
³èåæ®µ |
| | | maps.put("integratetype", resExtIntegrate.getIntegratetype());//ä¸å¡éæéæç±»å |
| | | maps.put("showmodel", resExtIntegrate.getShowmodel());//ä¸å¡éæé¡µé¢å±ç¤ºæ¹å¼ |
| | | maps.put("rendermode", resExtIntegrate.getRendermode());//ä¸å¡éææ¸²ææ¹å¼ |
| | | maps.put("refbasemapid", resExtIntegrate.getRefbasemapid());//å
³èåºå¾èµæºID |
| | | |
| | | if (resExtIntegrate.getRefbasemapid() != null) { |
| | | Res_ExtBaseMap resExtBaseMap = resExtBaseMapService.selectByPrimaryKey(resExtIntegrate.getRefbasemapid());//è·åå
³èåºå¾ä¿¡æ¯ |
| | | if (resExtBaseMap != null) { |
| | | Map<String, Object> BaseMapLayerObjectMap = new HashMap<>(); |
| | | Res_ExtMapUrl resExtMapUrl = resExtMapUrlService.queryFirstOrderByResId(resExtBaseMap.getResourceid());// è·åèµæºæ¯æåè®®ä¸å°å |
| | | Res_ExtThemeMap resExtThemeMap1 = resExtThemeMapService.selectByPrimaryKey(resourceid); |
| | | String subzyids = ""; |
| | | if (resExtThemeMap1 != null) { |
| | | subzyids = resExtThemeMap1.getSublayerset(); |
| | | } |
| | | boolean isPubzy = false; |
| | | Res_MainInfo resMainInfo1 = resMainInfoService.selectByPrimaryKey(resourceid); |
| | | if (resMainInfo1 != null && resMainInfo1.getSharprotocol().equals("å®å
¨å
¬å¼")) { |
| | | isPubzy = true; |
| | | } |
| | | if (resExtMapUrl != null) { |
| | | BaseMapLayerObjectMap.put("typeandurl", resExtMapUrl.getTypeandurl());//åè®®æå¡ç±»å |
| | | BaseMapLayerObjectMap.put("serverUrl", EsbToken.getEsbUrl(resExtMapUrl.getServerurl(), orgUser.getUserid().intValue(), request.getRemoteAddr(), resExtBaseMap.getResourceid(), resMainInfo.getEspproxy(), sysConfig, subzyids, isPubzy, resMainInfo.getToken(), false));//åè®®æå¡å°å |
| | | } else { |
| | | BaseMapLayerObjectMap.put("typeandurl", "");//åè®®æå¡ç±»å |
| | | BaseMapLayerObjectMap.put("serverUrl", "");//åè®®æå¡å°å |
| | | } |
| | | Res_MainInfo baseMap = resMainInfoService.selectByPrimaryKey(resExtBaseMap.getResourceid()); |
| | | BaseMapLayerObjectMap.put("label", baseMap.getTitle());//åºå¾åç§° |
| | | BaseMapLayerObjectMap.put("basemaptype", resExtBaseMap.getBasemaptype());//åºå¾ç±»å |
| | | BaseMapLayerObjectMap.put("displaylev", resExtBaseMap.getDisplaylev());//åççº§å« |
| | | //å
³èæ æ³¨å¾ |
| | | if (resExtBaseMap.getRefmarkinfid() != null) { |
| | | Res_ExtBaseMap biaozhu = resExtBaseMapService.selectByPrimaryKey(resExtBaseMap.getRefmarkinfid());//è·åå
³èåºå¾æ 注å¾ä¿¡æ¯ |
| | | if (biaozhu != null) { |
| | | Map<String, Object> AnnoLayerMap = new HashMap<>(); |
| | | Res_MainInfo res_mainInfo = resMainInfoService.selectByPrimaryKey(resExtBaseMap.getRefmarkinfid()); |
| | | AnnoLayerMap.put("resourceId", res_mainInfo.getResourceid());//æ æ³¨å¾ID |
| | | AnnoLayerMap.put("label", res_mainInfo.getTitle());//æ æ³¨å¾æ é¢ |
| | | Res_ExtMapUrl resExtMapUrl1 = resExtMapUrlService.queryFirstOrderByResId(resExtBaseMap.getRefmarkinfid());// è·åèµæºæ¯æåè®®ä¸å°å |
| | | if (resExtMapUrl1 != null) { |
| | | AnnoLayerMap.put("typeandurl", resExtMapUrl1.getTypeandurl());//åè®®æå¡ç±»å--BaseMapType |
| | | AnnoLayerMap.put("serverUrl", EsbToken.getEsbUrl(resExtMapUrl1.getServerurl(), orgUser.getUserid().intValue(), request.getRemoteAddr(), biaozhu.getResourceid(), resMainInfo.getEspproxy(), sysConfig, subzyids, isPubzy, resMainInfo.getToken(), false));//åè®®æå¡å°å--layerUrl |
| | | } else { |
| | | AnnoLayerMap.put("typeandurl", "");//åè®®æå¡ç±»å--BaseMapType |
| | | AnnoLayerMap.put("serverUrl", "");//åè®®æå¡å°å--layerUrl |
| | | } |
| | | AnnoLayerMap.put("basemaptype", biaozhu.getBasemaptype());//åºå¾ç±»å--layerType |
| | | AnnoLayerMap.put("displaylev", biaozhu.getDisplaylev());//åç级å«--displayLevels |
| | | BaseMapLayerObjectMap.put("AnnoLayer", AnnoLayerMap); |
| | | } else { |
| | | BaseMapLayerObjectMap.put("AnnoLayer", null); |
| | | } |
| | | } |
| | | |
| | | maps.put("BaseMapLayerObject", BaseMapLayerObjectMap); |
| | | } else { |
| | | maps.put("BaseMapLayerObject", null); |
| | | } |
| | | } else { |
| | | maps.put("BaseMapLayerObject", null); |
| | | } |
| | | |
| | | if (resExtIntegrate.getReflayerid() != null) { |
| | | Res_ExtBusinessLayer resExtBusinessLayer = resExtBusinessLayerService.selectByPrimaryKey(resExtIntegrate.getReflayerid());//è·åå
³èä¸å¡å¾å±ä¿¡æ¯ |
| | | if (resExtBusinessLayer != null) { |
| | | Res_MainInfo res_mainInfo = resMainInfoService.selectByPrimaryKey(resExtBusinessLayer.getResourceid()); |
| | | Map<String, Object> YwtcLayerObjectMap = new HashMap<>(); |
| | | YwtcLayerObjectMap.put("resourceId", res_mainInfo.getResourceid());//å
³èä¸å¡å¾å±èµæºID |
| | | YwtcLayerObjectMap.put("label", res_mainInfo.getTitle());//å
³èä¸å¡å¾å±æ é¢ |
| | | YwtcLayerObjectMap.put("dataloadtype", resExtBusinessLayer.getDataloadtype());//å è½½æ¹å¼ |
| | | YwtcLayerObjectMap.put("resourceclass", res_mainInfo.getResourceclass());//èµæºç±»å |
| | | Res_ExtMapUrl resExtMapUrl = resExtMapUrlService.queryFirstOrderByResId(resExtBusinessLayer.getResourceid());// è·åèµæºæ¯æåè®®ä¸å°å |
| | | Res_ExtThemeMap resExtThemeMap1 = resExtThemeMapService.selectByPrimaryKey(resourceid); |
| | | String subzyids = ""; |
| | | if (resExtThemeMap1 != null) { |
| | | subzyids = resExtThemeMap1.getSublayerset(); |
| | | } |
| | | boolean isPubzy = false; |
| | | Res_MainInfo resMainInfo1 = resMainInfoService.selectByPrimaryKey(resourceid); |
| | | if (resMainInfo1 != null && resMainInfo1.getSharprotocol().equals("å®å
¨å
¬å¼")) { |
| | | isPubzy = true; |
| | | } |
| | | if (resExtMapUrl != null) { |
| | | YwtcLayerObjectMap.put("typeandurl", resExtMapUrl.getTypeandurl());//åºå¾ç±»å |
| | | YwtcLayerObjectMap.put("serverUrl", EsbToken.getEsbUrl(resExtMapUrl.getServerurl(), orgUser.getUserid().intValue(), request.getRemoteAddr(), resourceid, resMainInfo.getEspproxy(), sysConfig, subzyids, isPubzy, resMainInfo.getToken(), false));//æå¡å°å |
| | | } else { |
| | | YwtcLayerObjectMap.put("typeandurl", "");//åºå¾ç±»å |
| | | YwtcLayerObjectMap.put("serverUrl", "");//æå¡å°å |
| | | } |
| | | YwtcLayerObjectMap.put("layerName", resExtBusinessLayer.getLayername());//åå¾å±åç§° |
| | | maps.put("YwtcLayerObject", YwtcLayerObjectMap); |
| | | } else { |
| | | maps.put("YwtcLayerObject", null); |
| | | } |
| | | } else { |
| | | maps.put("YwtcLayerObject", null); |
| | | } |
| | | } else { |
| | | maps.put("serverUrl", null);//ä¸å¡éææå¡å°å |
| | | maps.put("jieShouContent", null); |
| | | maps.put("reflayerfield", null);//ä¸å¡å¾å±å
³èåæ®µ |
| | | maps.put("integratetype", null);//ä¸å¡éæéæç±»å |
| | | maps.put("showmodel", null);//ä¸å¡éæé¡µé¢å±ç¤ºæ¹å¼ |
| | | maps.put("rendermode", null);//ä¸å¡éææ¸²ææ¹å¼ |
| | | maps.put("refbasemapid", null);//å
³èåºå¾èµæºID |
| | | maps.put("BaseMapLayerObject", null); |
| | | maps.put("YwtcLayerObject", null); |
| | | } |
| | | maps.put("resourceclass", "YWJC"); |
| | | break; |
| | | case "SJWJ": |
| | | Res_ExtFileSource model = resExtFileSourceService.selectByPrimaryKey(resourceid); |
| | | maps.put("resourceId", resourceid); |
| | | maps.put("title", resMainInfo.getTitle()); |
| | | maps.put("resourceclass", "SJWJ"); |
| | | if (model != null) { |
| | | maps.put("flag", "nc"); |
| | | if (model.getSourcetype().equals("æä»¶")) { |
| | | maps.put("serverUrl", model.getServerurl() != null ? (model.getServerurl().substring(0, model.getServerurl().indexOf("."))) : ""); |
| | | String[] filename = {model.getFilename() != null ? model.getFilename().substring(0, model.getFilename().indexOf(".")) : ""}; |
| | | maps.put("filename", filename); |
| | | } else { |
| | | maps.put("serverUrl", model.getServerurl() != null ? model.getServerurl() : ""); |
| | | File file = new File(sysConfig.getUploadPath() + model.getServerurl()); |
| | | String[] fileLists = file.list(); |
| | | if (fileLists != null) { |
| | | String[] filename = new String[fileLists.length]; |
| | | for (int i = 0; i < fileLists.length; i++) { |
| | | File file1 = new File(fileLists[i]); |
| | | filename[i] = file1.getName().substring(0, file1.getName().indexOf(".")); |
| | | } |
| | | maps.put("filename", filename); |
| | | } else { |
| | | maps.put("filename", null); |
| | | } |
| | | } |
| | | maps.put("ncconfig", model.getNcconfig() != null ? model.getNcconfig() : ""); |
| | | maps.put("ncjsonpath", model.getNcjsonpath() != null ? model.getNcjsonpath() : ""); |
| | | maps.put("ncjsonattribute", model.getNcjsonattribute() != null ? model.getNcjsonattribute() : ""); |
| | | } |
| | | break; |
| | | case "KJ_KJFX": |
| | | maps.put("resourceId", resourceid); |
| | | if (resMainInfo != null) { |
| | | maps.put("title", resMainInfo.getTitle()); |
| | | maps.put("desurl", resMainInfo.getDesurl()); |
| | | } else { |
| | | maps.put("title", "");//ä¸å¡éæèµæºåç§° |
| | | maps.put("desurl", null); |
| | | } |
| | | maps.put("resourceclass", "KJ_KJFX"); |
| | | Res_ExtSpaceServer spaceServer = resExtSpaceServerService.selectByPrimaryKey(resourceid); |
| | | if (spaceServer != null) { |
| | | maps.put("serverUrl", spaceServer.getServerurl()); |
| | | maps.put("postType", spaceServer.getPosttype()); |
| | | maps.put("diyParamUrl", spaceServer.getDiyparamurl()); |
| | | } |
| | | //Json += ",spaceParams: ["; |
| | | List<Map<String, Object>> spaceParamsMaps = new LinkedList<>(); |
| | | List<Res_SpacesParam> resSpacesParams = resSpacesParamService.selectByResSourceId(resourceid); |
| | | if (resSpacesParams != null && resSpacesParams.size() > 0) { |
| | | for (int i = 0; i < resSpacesParams.size(); i++) { |
| | | Map<String, Object> spaceParamsMap = new HashMap<>(); |
| | | spaceParamsMap.put("paramId", resSpacesParams.get(i).getParamid()); |
| | | spaceParamsMap.put("orderIndex", resSpacesParams.get(i).getOrderindex()); |
| | | spaceParamsMap.put("paramType", resSpacesParams.get(i).getParamtype()); |
| | | spaceParamsMap.put("paramName", resSpacesParams.get(i).getParamname()); |
| | | spaceParamsMap.put("dataType", resSpacesParams.get(i).getDatatype()); |
| | | spaceParamsMap.put("paramAlias", resSpacesParams.get(i).getParamalias()); |
| | | spaceParamsMap.put("layerStyle", resSpacesParams.get(i).getLayerstyle() == null ? "" : resSpacesParams.get(i).getLayerstyle()); |
| | | spaceParamsMaps.add(spaceParamsMap); |
| | | } |
| | | } |
| | | break; |
| | | } |
| | | String serverUrl =(String) maps.get("serverUrl"); |
| | | String content =(String) maps.get("content"); |
| | | String url=null; |
| | | if(null!=content){ |
| | | url = JSONObject.parseObject(content).getString("url"); |
| | | } |
| | | serverUrl=serverUrl==null?url:serverUrl; |
| | | if(null!=serverUrl&&serverUrl.contains("104:8066")&& !StringUtils.equals("å®å
¨å
¬å¼",resMainInfo.getSharprotocol())){ |
| | | String param="resourceid="+resourceid+"&isPubzy=0&"+"appId=0&"+"applyuserid="+userid; |
| | | String data = HttpUtils.get(sysConfig.getProxyUrl()+"/genToken" + "?" + param); |
| | | JSONObject jsonObject = JSON.parseObject(data); |
| | | String token = jsonObject.get("data").toString(); |
| | | maps.put("serverUrl", serverUrl+"?token="+token); |
| | | } |
| | | } |
| | | } |
| | | |
| | | return JSON.toJSONString(maps, SerializerFeature.WriteMapNullValue); |
| | | } |
| | | |
| | | /** |
| | | * @Description: è·åèµæºæå¡åè®®ä¸å°åä¿¡æ¯ |
| | | * @Author: xiaoxuan.xie |
| | | * @Date: 09:30 2018/4/2 |
| | | * @return: String |
| | | * @see Res_MainInfo |
| | | */ |
| | | @ResponseBody |
| | | @GetMapping(path = "resurlinfo/{userid}/{resourceid}/{type}/{id}") |
| | | @ApiOperation(value = "è·åèµæºæå¡åè®®ä¸å°åä¿¡æ¯", notes = "") |
| | | public String GetMapUrlObject(@ApiParam(name = "userid", value = "ç¨æ·ID", required = true) @PathVariable(name = "userid") Long userid, @ApiParam(name = "resourceid", value = "èµæºId", required = true) @PathVariable(name = "resourceid") Integer resourceid, @ApiParam(name = "type", value = "type", required = true) @PathVariable(name = "type") String type, @ApiParam(name = "id", value = "id", required = true) @PathVariable(name = "id") Integer id, HttpServletRequest request) { |
| | | String Json = ""; |
| | | Map<String, Object> maps = new HashMap<>(); |
| | | Res_MainInfo resMainInfo = resMainInfoService.selectByPrimaryKey(resourceid);// è·åèµæºä¸»è¡¨ä¿¡æ¯ |
| | | if (type.equals("Url")) { |
| | | Res_ExtMapUrl resExtMapUrl = resExtMapUrlService.selectByPrimaryKey(id);// è·åèµæºæ¯æåè®®ä¸å°å |
| | | Res_ExtThemeMap resExtThemeMap = resExtThemeMapService.selectByPrimaryKey(resourceid); |
| | | String subzyids = ""; |
| | | if (resExtThemeMap != null) { |
| | | subzyids = resExtThemeMap.getSublayerset(); |
| | | } |
| | | boolean isPubzy = false; |
| | | Res_MainInfo resMainInfo1 = resMainInfoService.selectByPrimaryKey(resourceid); |
| | | if (resMainInfo1 != null && resMainInfo1.getSharprotocol().equals("å®å
¨å
¬å¼")) { |
| | | isPubzy = true; |
| | | } |
| | | if (resExtMapUrl != null) { |
| | | OrgUser orgUser = orgUserService.queryObject(userid); |
| | | maps.put("resourceId", resourceid); |
| | | maps.put("title", resMainInfo.getTitle()); |
| | | maps.put("desurl", resMainInfo.getDesurl()); |
| | | maps.put("typeandurl", resExtMapUrl.getTypeandurl()); |
| | | maps.put("serverUrl", EsbToken.getEsbUrl(resExtMapUrl.getServerurl(), orgUser.getUserid().intValue(), request.getRemoteAddr(), resourceid, resMainInfo.getEspproxy(), sysConfig, subzyids, isPubzy, resMainInfo.getToken(), false)); |
| | | } else { |
| | | maps.put("resourceId", resourceid); |
| | | maps.put("title", resMainInfo.getTitle()); |
| | | maps.put("desurl", resMainInfo.getDesurl()); |
| | | maps.put("typeandurl", ""); |
| | | maps.put("serverUrl", ""); |
| | | } |
| | | } else { |
| | | Res_DiyLayerInfo resDiyLayerInfo = resDiyLayerInfoService.getById(id);// è·åèªå®ä¹é£æ ¼ä¿¡æ¯ |
| | | if (resDiyLayerInfo != null) { |
| | | maps.put("diyId", resDiyLayerInfo.getDiyid()); |
| | | maps.put("resourceId", resourceid); |
| | | maps.put("title", resMainInfo.getTitle()); |
| | | maps.put("desurl", resMainInfo.getDesurl()); |
| | | maps.put("content", JSON.parseObject(resDiyLayerInfo.getContent())); |
| | | } else { |
| | | maps.put("diyId", id); |
| | | maps.put("resourceId", resourceid); |
| | | maps.put("title", ""); |
| | | maps.put("desurl", resMainInfo.getDesurl()); |
| | | maps.put("content", null); |
| | | } |
| | | } |
| | | |
| | | return JSON.toJSONString(maps, SerializerFeature.WriteMapNullValue); |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®ç¨æ·IDæ¥è¯¢ä¹¦ç¾å表 |
| | | */ |
| | | @ResponseBody |
| | | @GetMapping(path = "getBookmarksList/{userid}") |
| | | @ApiOperation(value = "æ ¹æ®ç¨æ·IDæ¥è¯¢ä¹¦ç¾å表", notes = "") |
| | | public String GetBookmarksList(@ApiParam(name = "userid", value = "ç¨æ·ID", required = true) @PathVariable(name = "userid") Integer userid) { |
| | | List<Res_BookMarks> resBookMarksList = resBookMarksService.getBookMarksByUserid(userid); |
| | | StringBuilder sb = new StringBuilder(); |
| | | List<Map<String, Object>> maps = new LinkedList<>(); |
| | | for (int i = 0; i < resBookMarksList.size(); i++) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("OBJECTID", resBookMarksList.get(i).getObjectid()); |
| | | map.put("name", resBookMarksList.get(i).getTitle()); |
| | | map.put("extent", JSON.parseObject(resBookMarksList.get(i).getExtent())); |
| | | maps.add(map); |
| | | } |
| | | |
| | | return JSON.toJSONString(maps, SerializerFeature.WriteMapNullValue); |
| | | } |
| | | |
| | | /** |
| | | * ä¹¦ç¾æ°å¢ãä¿®æ¹ |
| | | */ |
| | | @PostMapping(path = "/addBookMark") |
| | | @ApiOperation(value = "æ°å¢ãä¿®æ¹å°å¾ä¹¦ç¾", notes = "") |
| | | @ResponseBody |
| | | public int addMap(@ApiParam(name = "objectid", value = "æ ç¾ID") Integer objectid, @ApiParam(name = "userid", value = "ç¨æ·Id", required = true) Integer userid, @ApiParam(name = "title", value = "æ ç¾åç§°", required = true) String title, @ApiParam(name = "extent", value = "æ ç¾å°å¾èå´", required = true) String extent) { |
| | | if (objectid == null) objectid = -1; |
| | | int id = 0; |
| | | |
| | | Res_BookMarks resBookMarks = resBookMarksService.getById(objectid); |
| | | if (resBookMarks != null) { |
| | | resBookMarks.setTitle(title); |
| | | resBookMarksService.updateByPrimaryKey(resBookMarks); |
| | | id = resBookMarks.getObjectid(); |
| | | } else { |
| | | resBookMarks = new Res_BookMarks(); |
| | | resBookMarks.setTitle(title); |
| | | resBookMarks.setCreateuserid(userid); |
| | | resBookMarks.setExtent(extent); |
| | | Timestamp time = new Timestamp(new Date().getTime()); |
| | | resBookMarks.setAddtime(time); |
| | | resBookMarksService.insert(resBookMarks); |
| | | id = resBookMarksService.getCurrentObjectId(); |
| | | } |
| | | |
| | | return id; |
| | | } |
| | | |
| | | /** |
| | | * æ ç¾å é¤ |
| | | */ |
| | | @ResponseBody |
| | | @GetMapping(path = "delBookMark") |
| | | @ApiOperation(value = "å é¤å°å¾ä¹¦ç¾", notes = "") |
| | | public String delBookMark(@ApiParam(name = "objectid", value = "书ç¾ID", required = true) @RequestParam(name = "objectid") Integer objectid) { |
| | | resBookMarksService.deleteByPrimaryKey(objectid); |
| | | |
| | | return "å 餿å"; |
| | | } |
| | | |
| | | /** |
| | | * è·å符å·åºå¯¹åºç©ºé´ç±»å符å·é£æ ¼å表 |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @GetMapping(path = "symbolLibrary/list/{geotype}") |
| | | @ApiOperation(value = "è·å符å·åºå¯¹åºç©ºé´ç±»å符å·é£æ ¼å表", notes = "") |
| | | public String getSymbolLibraryList(@ApiParam(name = "geotype", value = "空é´ç±»å", required = true) @PathVariable(name = "geotype") String geotype) { |
| | | List<Res_SymbolLibrary> list = resSymbolLibraryService.getListByGeoType(geotype); |
| | | Map<String, Object> maps = new HashMap<>(); |
| | | maps.put("success", true); |
| | | List<Map<String, Object>> SymbolLibraryMaps = new LinkedList<>(); |
| | | for (int i = 0; i < list.size(); i++) { |
| | | Map<String, Object> SymbolLibraryMap = new HashMap<>(); |
| | | SymbolLibraryMap.put(list.get(i).getFhid(), list.get(i).getSymbol()); |
| | | SymbolLibraryMaps.add(SymbolLibraryMap); |
| | | } |
| | | maps.put("data", SymbolLibraryMaps); |
| | | return JSON.toJSONString(maps, SerializerFeature.WriteMapNullValue); |
| | | } |
| | | |
| | | /** |
| | | * è·å空é´åæå表æ¥å£ |
| | | */ |
| | | @ResponseBody |
| | | @GetMapping(path = {"spaceserverlist", "spaceserverlist/{userid}"}) |
| | | @ApiOperation(value = "æ¥è¯¢å·²å®¡æ ¸ç空é´åæä¿¡æ¯å表", notes = "") |
| | | public String getSpaceServerList(@ApiParam(name = "userid", value = "userid") @PathVariable(name = "userid", required = false) Integer userid, HttpServletRequest request) { |
| | | Map<String, Object> paramMap = new HashMap<String, Object>(); |
| | | paramMap.put("userid", userid); |
| | | List<UserDef_SpaceServer> list = zhuanTiZhiTuService.getSpaceServerList(paramMap); |
| | | List<Map<String, Object>> listMaps = new LinkedList<>(); |
| | | for (int i = 0; i < list.size(); i++) { |
| | | String subzyids = ""; |
| | | boolean isPubzy = false; |
| | | if (list.get(i).getSharprotocol().equals("å®å
¨å
¬å¼")) { |
| | | isPubzy = true; |
| | | } |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("resourceId", list.get(i).getResourceid()); |
| | | map.put("title", list.get(i).getTitle()); |
| | | map.put("imgurl", list.get(i).getImgurl()); |
| | | map.put("serverUrl", list.get(i).getServerurl()); |
| | | map.put("postType", list.get(i).getPosttype()); |
| | | map.put("diyParamUrl", list.get(i).getDiyparamurl()); |
| | | map.put("createuserid", list.get(i).getCreateuserid()); |
| | | List<Map<String, Object>> spaceParamsMaps = new LinkedList<>(); |
| | | List<Res_SpacesParam> resSpacesParams = resSpacesParamService.selectByResSourceId(list.get(i).getResourceid()); |
| | | if (resSpacesParams != null && resSpacesParams.size() > 0) { |
| | | for (int j = 0; j < resSpacesParams.size(); j++) { |
| | | Map<String, Object> spaceParams = new HashMap<>(); |
| | | spaceParams.put("paramId", resSpacesParams.get(j).getParamid()); |
| | | spaceParams.put("orderIndex", resSpacesParams.get(j).getOrderindex()); |
| | | spaceParams.put("paramType", resSpacesParams.get(j).getParamtype()); |
| | | spaceParams.put("paramName", resSpacesParams.get(j).getParamname()); |
| | | spaceParams.put("dataType", resSpacesParams.get(j).getDatatype()); |
| | | spaceParams.put("paramAlias", resSpacesParams.get(j).getParamalias()); |
| | | spaceParams.put("required", resSpacesParams.get(j).getRequired()); |
| | | spaceParams.put("defaultValue", resSpacesParams.get(j).getDefaultValue()); |
| | | spaceParams.put("layerStyle", resSpacesParams.get(j).getLayerstyle() == null ? "" : resSpacesParams.get(j).getLayerstyle()); |
| | | spaceParamsMaps.add(spaceParams); |
| | | } |
| | | } |
| | | map.put("spaceParams", spaceParamsMaps); |
| | | listMaps.add(map); |
| | | } |
| | | |
| | | return JSON.toJSONString(listMaps, SerializerFeature.WriteMapNullValue); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢/ä¿®æ¹ç¨æ·å¾å±èå´ |
| | | */ |
| | | @PostMapping(path = "/addUserLayerExtent") |
| | | @ApiOperation(value = "æ°å¢/ä¿®æ¹ç¨æ·å¾å±èå´", notes = "") |
| | | @ResponseBody |
| | | public int addUserLayerExtent(@ApiParam(name = "id", value = "ID") Integer id, @ApiParam(name = "userid", value = "ç¨æ·Id", required = true) Integer userid, @ApiParam(name = "resourceid", value = "èµæºId", required = true) Integer resourceid, @ApiParam(name = "title", value = "åç§°", required = true) String title, @ApiParam(name = "extent", value = "èå´", required = true) String extent) { |
| | | if (id == null) id = -1; |
| | | int newid = 0; |
| | | |
| | | Res_User_LayerExtent resUserLayerExtent = resUserLayerExtentService.selectByPrimaryKey(id); |
| | | if (resUserLayerExtent != null) { |
| | | resUserLayerExtent.setTitle(title); |
| | | resUserLayerExtent.setExtent(extent); |
| | | resUserLayerExtentService.updateByPrimaryKeySelective(resUserLayerExtent); |
| | | newid = resUserLayerExtent.getId(); |
| | | } else { |
| | | resUserLayerExtent = new Res_User_LayerExtent(); |
| | | resUserLayerExtent.setTitle(title); |
| | | resUserLayerExtent.setUserid(userid); |
| | | resUserLayerExtent.setExtent(extent); |
| | | resUserLayerExtent.setResourceid(resourceid); |
| | | resUserLayerExtentService.insertSelective(resUserLayerExtent); |
| | | newid = resUserLayerExtentService.getCurrentObjectId(); |
| | | } |
| | | |
| | | return newid; |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®ç¨æ·IDåèµæºIDæ¥è¯¢å¾å±èå´å表 |
| | | */ |
| | | @ResponseBody |
| | | @GetMapping(path = "getLayerExtentList/{userid}/{resourceid}") |
| | | @ApiOperation(value = "æ ¹æ®ç¨æ·IDåèµæºIDæ¥è¯¢å¾å±èå´å表", notes = "") |
| | | public String getLayerExtentList(@ApiParam(name = "userid", value = "ç¨æ·ID", required = true) @PathVariable(name = "userid") Integer userid, @ApiParam(name = "resourceid", value = "èµæºID", required = true) @PathVariable(name = "resourceid") Integer resourceid) { |
| | | Res_User_LayerExtent resUserLayerExtent = new Res_User_LayerExtent(); |
| | | resUserLayerExtent.setResourceid(resourceid); |
| | | resUserLayerExtent.setUserid(userid); |
| | | List<Res_User_LayerExtent> resUserLayerExtents = resUserLayerExtentService.selectByResidAndUserid(resUserLayerExtent); |
| | | List<Map<String, Object>> maps = new LinkedList<>(); |
| | | for (int i = 0; i < resUserLayerExtents.size(); i++) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("id", resUserLayerExtents.get(i).getId()); |
| | | map.put("title", resUserLayerExtents.get(i).getTitle()); |
| | | map.put("userid", resUserLayerExtents.get(i).getUserid()); |
| | | map.put("resourceid", resUserLayerExtents.get(i).getResourceid()); |
| | | map.put("extent", resUserLayerExtents.get(i).getExtent()); |
| | | maps.add(map); |
| | | } |
| | | |
| | | return JSON.toJSONString(maps, SerializerFeature.WriteMapNullValue); |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®IDæ¥è¯¢å¾å±èå´ |
| | | */ |
| | | @ResponseBody |
| | | @GetMapping(path = "getLayerExtentInfo/{id}") |
| | | @ApiOperation(value = "æ ¹æ®IDæ¥è¯¢å¾å±èå´", notes = "") |
| | | public String getLayerExtentInfo(@ApiParam(name = "id", value = "ID", required = true) @PathVariable(name = "id") Integer id) { |
| | | Res_User_LayerExtent resUserLayerExtent = resUserLayerExtentService.selectByPrimaryKey(id); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | if (resUserLayerExtent != null) { |
| | | map.put("id", resUserLayerExtent.getId()); |
| | | map.put("title", resUserLayerExtent.getTitle()); |
| | | map.put("userid", resUserLayerExtent.getUserid()); |
| | | map.put("resourceid", resUserLayerExtent.getResourceid()); |
| | | map.put("extent", resUserLayerExtent.getExtent()); |
| | | } |
| | | |
| | | return JSON.toJSONString(map, SerializerFeature.WriteMapNullValue); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.landtool.lanbase.modules.api.controller.MapPortal; |
| | | |
| | | import java.sql.Timestamp; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.LinkedList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.serializer.SerializerFeature; |
| | | import com.github.pagehelper.Page; |
| | | import com.github.pagehelper.PageHelper; |
| | | import com.landtool.lanbase.modules.api.utils.PageBean; |
| | | import com.landtool.lanbase.modules.org.entity.OrgUser; |
| | | import com.landtool.lanbase.modules.org.service.OrgUnitService; |
| | | import com.landtool.lanbase.modules.org.service.OrgUserService; |
| | | import com.landtool.lanbase.modules.res.entity.Res_TempPrint; |
| | | import com.landtool.lanbase.modules.res.entity.Res_Template; |
| | | import com.landtool.lanbase.modules.res.service.ResTempPrintService; |
| | | import com.landtool.lanbase.modules.res.service.ResTemplateService; |
| | | import com.landtool.lanbase.modules.sys.controller.AbstractController; |
| | | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | |
| | | @Controller |
| | | @RequestMapping("/api/maptempprint/") |
| | | @Api(value = "", tags = {"ä¸é¢å¶å¾å°å¾åºå¾æå°æ¥å£"}) |
| | | public class MapTempPrintController extends AbstractController { |
| | | @Autowired |
| | | private ResTempPrintService resTempPrintService; |
| | | |
| | | @Autowired |
| | | private OrgUserService orgUserService; |
| | | |
| | | @Autowired |
| | | private OrgUnitService orgUnitService; |
| | | |
| | | @Autowired |
| | | private ResTemplateService resTemplateService; |
| | | |
| | | /** |
| | | * æ°å¢å°å¾åºå¾æå°ä¿¡æ¯ |
| | | */ |
| | | @PostMapping(path = "/addMapTempPrint") |
| | | @ApiOperation(value = "æ°å¢å°å¾åºå¾æå°ä¿¡æ¯", notes = "") |
| | | @ResponseBody |
| | | public int addMapTempPrint( |
| | | @ApiParam(name = "userid", value = "ç¨æ·ID", required = true) @RequestParam(name = "userid") int userid, |
| | | @ApiParam(name = "rtid", value = "模æ¿ID") @RequestParam(name = "rtid") Integer rtid, |
| | | @ApiParam(name = "title", value = "æ é¢", required = true) @RequestParam(name = "title") String title, |
| | | @ApiParam(name = "mapcontent", value = "å°å¾å
容", required = true) @RequestParam(name = "mapcontent") String mapcontent, |
| | | @ApiParam(name = "chartcontent", value = "å¶å¾ä¿¡æ¯") @RequestParam(name = "chartcontent") String chartcontent, |
| | | @ApiParam(name = "isshowlegend", value = "æ¯å¦æ¾ç¤ºå¾ä¾", required = true) @RequestParam(name = "isshowlegend") int isshowlegend, |
| | | @ApiParam(name = "chartstyle", value = "åºå¾æ ¼å¼", required = true) @RequestParam(name = "chartstyle") String chartstyle, |
| | | @ApiParam(name = "chartscale", value = "åºå¾æ¯ä¾", required = true) @RequestParam(name = "chartscale") String chartscale, |
| | | @ApiParam(name = "chartextent", value = "åºå¾èå´") @RequestParam(name = "chartextent") String chartextent, |
| | | @ApiParam(name = "isscalelocked", value = "æ¯å¦é宿¯ä¾å°º") @RequestParam(name = "isscalelocked") Integer isscalelocked) { |
| | | Res_TempPrint resTempPrint = new Res_TempPrint(); |
| | | resTempPrint.setUserid(userid);//ç¨æ·ID |
| | | if(rtid != null) { |
| | | resTempPrint.setRtid(rtid);//模æ¿ID |
| | | } |
| | | |
| | | resTempPrint.setTitle(title);//æ é¢ |
| | | if(chartcontent != null && !chartcontent.isEmpty()) { |
| | | resTempPrint.setChartcontent(chartcontent);//å¶å¾ä¿¡æ¯ |
| | | } |
| | | resTempPrint.setMapcontent(mapcontent);//å°å¾å
容 |
| | | resTempPrint.setIsshowlegend(isshowlegend);//æ¯å¦æ¾ç¤ºå¾ä¾ |
| | | resTempPrint.setChartstyle(chartstyle);//åºå¾æ ¼å¼ |
| | | resTempPrint.setChartscale(chartscale);//åºå¾æ¯ä¾ |
| | | resTempPrint.setAuditstatus(3); //æ°å¢æ·»å æªæäº¤ç¶æ |
| | | if(chartextent != null && !chartextent.isEmpty()) { |
| | | resTempPrint.setChartextent(chartextent);//åºå¾èå´ |
| | | } |
| | | if(isscalelocked != null) { |
| | | resTempPrint.setIsscalelocked(isscalelocked);//æ¯å¦é宿¯ä¾å°º |
| | | } |
| | | |
| | | Timestamp time = new Timestamp(new Date().getTime()); |
| | | resTempPrint.setChartdate(time); |
| | | resTempPrintService.insertSelective(resTempPrint);//æ°å¢å°å¾åºå¾æå°ä¿¡æ¯ |
| | | int objectid = resTempPrintService.queryResTempPrintIdentCurrent();//è·åæ°å¢ä¿¡æ¯ID |
| | | |
| | | return objectid; |
| | | } |
| | | |
| | | /** |
| | | * æ´æ°å°å¾åºå¾æå°ä¿¡æ¯ |
| | | */ |
| | | @PostMapping("updateMapTemPrint") |
| | | @ApiOperation(value = "æ´æ°å°å¾åºå¾æå°ä¿¡æ¯", notes = "") |
| | | @ResponseBody |
| | | public int updateMapTemPrint(Res_TempPrint resTempPrint) { |
| | | resTempPrintService.updateByPrimaryKeySelective(resTempPrint); |
| | | return resTempPrint.getObjectid(); |
| | | } |
| | | |
| | | /** |
| | | * æäº¤å°å¾åºå¾æå°ä¿¡æ¯ |
| | | */ |
| | | @PostMapping("sumbitMapTemPrint") |
| | | @ApiOperation(value = "æäº¤å°å¾åºå¾æå°ä¿¡æ¯", notes = "") |
| | | @ResponseBody |
| | | public String sumbitMapTemPrint(int objectid) { |
| | | Res_TempPrint resTempPrint = resTempPrintService.selectByPrimaryKey(objectid); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | if (resTempPrint != null) { |
| | | resTempPrint.setAuditstatus(2); |
| | | resTempPrintService.updateByPrimaryKeySelective(resTempPrint); |
| | | map.put("success", true); |
| | | map.put("msg", "æäº¤æåï¼"); |
| | | } else { |
| | | map.put("success", false); |
| | | map.put("msg", "æäº¤å¤±è´¥ï¼æç¤ºï¼åºå¾æå°ä¿¡æ¯ä¸åå¨ï¼"); |
| | | } |
| | | |
| | | return JSON.toJSONString(map, SerializerFeature.WriteMapNullValue); |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®IDè·åå°å¾åºå¾ä¿¡æ¯ |
| | | */ |
| | | @GetMapping("getMapPrintById") |
| | | @ResponseBody |
| | | public String getMapPrintById(int objid) { |
| | | Res_TempPrint resTempPrint = resTempPrintService.selectByPrimaryKey(objid); |
| | | OrgUser user = orgUserService.queryObject(resTempPrint.getUserid().longValue()); |
| | | String name = user.getChinesename(); |
| | | String unit = orgUserService.getDefaultUnit(user.getUserid()).getUnitname(); |
| | | //è·åå®¡æ ¸äººä¸æå |
| | | String auditUserName = ""; |
| | | if(resTempPrint.getAudituserid() != null) { |
| | | OrgUser auditUser = orgUserService.queryObject(resTempPrint.getAudituserid().longValue()); |
| | | if(auditUser != null) { |
| | | auditUserName = auditUser.getChinesename(); |
| | | } |
| | | } |
| | | |
| | | Res_Template resTemplate = new Res_Template(); |
| | | if(resTempPrint.getRtid() != null) { |
| | | resTemplate = resTemplateService.selectResTemplateByRtId(resTempPrint.getRtid()); |
| | | } |
| | | String rtname = ""; |
| | | String templatetype = ""; |
| | | if (resTemplate != null) { |
| | | rtname = resTemplate.getRtname(); |
| | | templatetype = resTemplate.getTemplatetype(); |
| | | } else if(resTempPrint.getRtid() == 0) { |
| | | rtname = "MAP_ONLY"; |
| | | templatetype = "MAP_ONLY"; |
| | | } |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
| | | List<Map<String, Object>> maps = new LinkedList<>(); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("userid", resTempPrint.getUserid()); |
| | | map.put("rtid", resTempPrint.getRtid()); |
| | | map.put("rtname", rtname); |
| | | map.put("templatetype", templatetype); |
| | | map.put("title", resTempPrint.getTitle()); |
| | | map.put("auditstatus", resTempPrint.getAuditstatus()); |
| | | map.put("audituser", auditUserName); |
| | | map.put("mapcontent", JSON.parseObject(resTempPrint.getMapcontent())); |
| | | map.put("chartcontent", JSON.parseArray(resTempPrint.getChartcontent())); |
| | | map.put("chartextent", resTempPrint.getChartextent()); |
| | | map.put("isshowlegend", resTempPrint.getIsshowlegend()); |
| | | map.put("isscalelocked", resTempPrint.getIsscalelocked()); |
| | | map.put("chartstyle", resTempPrint.getChartstyle()); |
| | | map.put("chartscale", resTempPrint.getChartscale()); |
| | | map.put("chartdate", sdf.format(resTempPrint.getChartdate())); |
| | | map.put("username", name); |
| | | map.put("userunit", unit); |
| | | maps.add(map); |
| | | |
| | | return JSON.toJSONString(maps, SerializerFeature.WriteMapNullValue); |
| | | } |
| | | |
| | | /** |
| | | * å®¡æ ¸å°å¾åºå¾æå°ä¿¡æ¯ |
| | | */ |
| | | @PostMapping(path = "/auditMapTempPrint") |
| | | @ApiOperation(value = "å®¡æ ¸å°å¾åºå¾æå°ä¿¡æ¯", notes = "") |
| | | @ResponseBody |
| | | public String auditMapTempPrint( |
| | | @ApiParam(name = "objectid", value = "åºå¾æå°ä¿¡æ¯ID", required = true) @RequestParam(name = "objectid") int objectid, |
| | | @ApiParam(name = "audituserid", value = "å®¡æ ¸äººID", required = true) @RequestParam(name = "audituserid") int audituserid, |
| | | @ApiParam(name = "auditopinion", value = "å®¡æ ¸æè§") String auditopinion, |
| | | @ApiParam(name = "auditstatus", value = "å®¡æ ¸ç»æ", required = true) @RequestParam(name = "auditstatus") int auditstatus) { |
| | | Res_TempPrint resTempPrint = resTempPrintService.selectByPrimaryKey(objectid); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | if (resTempPrint != null) { |
| | | try { |
| | | resTempPrint.setAudituserid(audituserid);//å®¡æ ¸äºº |
| | | resTempPrint.setAuditopinion(auditopinion);//å®¡æ ¸æè§ |
| | | resTempPrint.setAuditstatus(auditstatus);//å®¡æ ¸ç»æ |
| | | Timestamp time = new Timestamp(new Date().getTime()); |
| | | resTempPrint.setAuditdate(time);//å®¡æ ¸æ¶é´ |
| | | resTempPrintService.updateByPrimaryKeySelective(resTempPrint); |
| | | map.put("success", true); |
| | | map.put("msg", "å®¡æ ¸æåï¼"); |
| | | } catch (Exception e) { |
| | | map.put("success", false); |
| | | map.put("msg", e.getMessage()); |
| | | } |
| | | } else { |
| | | map.put("success", false); |
| | | map.put("msg", "åºå¾æå°ä¿¡æ¯ä¸åå¨ï¼"); |
| | | } |
| | | |
| | | return JSON.toJSONString(map, SerializerFeature.WriteMapNullValue); |
| | | } |
| | | |
| | | /** |
| | | * è·ååºå¾å®¡æ ¸ä¿¡æ¯ åå¸äººå¯çèªå·±åºå¾å®¡æ ¸ç¶æï¼å®¡æ ¸äººå¯çèªå·±åå
¶ä»ç¨æ·åºå¾èµæºå¹¶å¯åå®¡æ ¸ |
| | | * @return |
| | | */ |
| | | @GetMapping("/getChuTuList") |
| | | @ResponseBody |
| | | @ApiOperation(value = "è·ååºå¾å®¡æ ¸ä¿¡æ¯", notes = "") |
| | | public String selectInfoList(HttpServletRequest request, PageBean pageBean) { |
| | | String callbackFunName = request.getParameter("callback"); |
| | | String userprintaudit = request.getParameter("userprintaudit");//ç¨æ·åºå¾å®¡æ ¸æé |
| | | String userid = request.getParameter("userid");//ç¨æ·ID |
| | | if (callbackFunName == null || callbackFunName.isEmpty()) { |
| | | callbackFunName = "callback"; |
| | | } |
| | | pageBean.setLimit(10); |
| | | PageHelper.startPage(pageBean.getPage(), pageBean.getLimit());//设置å½å页æ°åæ¯é¡µæ¡æ° |
| | | |
| | | List<Res_TempPrint> resTempPrints = null; |
| | | Res_TempPrint res_tempPrint = new Res_TempPrint(); |
| | | String admin = "true"; |
| | | // æ¥è¯¢å½åç»éç¨æ·æ¯å¦å
·å¤åºå¾å®¡æ ¸æé æ¯ï¼æ¥ææ 䏿¯ï¼æ¥èªå·±ç |
| | | if (userprintaudit == "false") { |
| | | // 妿å
·å¤åºå¾å®¡æ ¸æé,䏿·»å ç¨æ·idï¼æ¥è¯¢ææã妿䏿¯ æ·»å id æ¥è¯¢å个 |
| | | admin = "false"; |
| | | //Integer userid = getUserId().intValue();//è·åç»å½ç¨æ·ID |
| | | res_tempPrint.setUserid(Integer.parseInt(userid)); |
| | | } |
| | | resTempPrints = resTempPrintService.getList(res_tempPrint); |
| | | |
| | | int countNums = (int) ((Page) resTempPrints).getTotal();//è·åè®°å½æ»æ° |
| | | PageBean<Res_TempPrint> pageData = new PageBean<>(pageBean.getPage(), pageBean.getLimit(), countNums); |
| | | pageData.setItems(resTempPrints); |
| | | |
| | | StringBuilder rsb = new StringBuilder(); |
| | | rsb.append("["); |
| | | List<Map<String, Object>> maps = new LinkedList<>(); |
| | | for (int i = 0; i < resTempPrints.size(); i++) { |
| | | Map<String, Object> remap = new HashMap<>(); |
| | | remap.put("objectid", resTempPrints.get(i).getObjectid()); |
| | | remap.put("title", resTempPrints.get(i).getTitle()); |
| | | remap.put("auditstatus", resTempPrints.get(i).getAuditstatus()); |
| | | maps.add(remap); |
| | | } |
| | | |
| | | Map<String, Object> newmap = new HashMap<>(); |
| | | newmap.put("Count", countNums); |
| | | newmap.put("Page", pageBean.getPage()); |
| | | newmap.put("isAdmin", admin); |
| | | newmap.put("ShuJu", maps); |
| | | |
| | | return callbackFunName + "(" + JSON.toJSONString(newmap, SerializerFeature.WriteMapNullValue) + ")"; |
| | | } |
| | | |
| | | /** |
| | | * å é¤åºå¾è®°å½ |
| | | */ |
| | | @GetMapping("/delTempPrint") |
| | | @ResponseBody |
| | | @ApiOperation(value = "è·ååºå¾å®¡æ ¸ä¿¡æ¯", notes = "") |
| | | public String selectInfoList(@ApiParam(name = "objectid", value = "åºå¾æå°ä¿¡æ¯ID", required = true) @RequestParam(name = "objectid") int objectid) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | try { |
| | | resTempPrintService.deleteByPrimaryKey(objectid); |
| | | map.put("success", true); |
| | | map.put("msg", "å 餿åï¼"); |
| | | } catch (Exception e) { |
| | | map.put("success", false); |
| | | map.put("msg", "å é¤å¤±è´¥ï¼é误æç¤ºï¼" + e.getMessage()); |
| | | } |
| | | return JSON.toJSONString(map, SerializerFeature.WriteMapNullValue); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.landtool.lanbase.modules.api.controller.MapPortal; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.serializer.SerializerFeature; |
| | | import com.github.pagehelper.Page; |
| | | import com.github.pagehelper.PageHelper; |
| | | import com.landtool.lanbase.modules.api.utils.PageBean; |
| | | import com.landtool.lanbase.modules.org.entity.OrgUser; |
| | | import com.landtool.lanbase.modules.org.service.OrgUnitService; |
| | | import com.landtool.lanbase.modules.org.service.OrgUserService; |
| | | import com.landtool.lanbase.modules.res.entity.Res_TempPrint; |
| | | import com.landtool.lanbase.modules.res.entity.Res_Template; |
| | | import com.landtool.lanbase.modules.res.service.ResTempPrintService; |
| | | import com.landtool.lanbase.modules.res.service.ResTemplateService; |
| | | import com.landtool.lanbase.modules.sys.controller.AbstractController; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.sql.Timestamp; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | |
| | | @Controller |
| | | @RequestMapping("/api/maptempprint/") |
| | | @Api(value = "", tags = {"ä¸é¢å¶å¾å°å¾åºå¾æå°æ¥å£"}) |
| | | public class MapTempPrintController extends AbstractController { |
| | | @Autowired |
| | | private ResTempPrintService resTempPrintService; |
| | | |
| | | @Autowired |
| | | private OrgUserService orgUserService; |
| | | |
| | | @Autowired |
| | | private OrgUnitService orgUnitService; |
| | | |
| | | @Autowired |
| | | private ResTemplateService resTemplateService; |
| | | |
| | | /** |
| | | * æ°å¢å°å¾åºå¾æå°ä¿¡æ¯ |
| | | */ |
| | | @PostMapping(path = "/addMapTempPrint") |
| | | @ApiOperation(value = "æ°å¢å°å¾åºå¾æå°ä¿¡æ¯", notes = "") |
| | | @ResponseBody |
| | | public int addMapTempPrint(@ApiParam(name = "userid", value = "ç¨æ·ID", required = true) @RequestParam(name = "userid") int userid, @ApiParam(name = "rtid", value = "模æ¿ID") @RequestParam(name = "rtid") Integer rtid, @ApiParam(name = "title", value = "æ é¢", required = true) @RequestParam(name = "title") String title, @ApiParam(name = "mapcontent", value = "å°å¾å
容", required = true) @RequestParam(name = "mapcontent") String mapcontent, @ApiParam(name = "chartcontent", value = "å¶å¾ä¿¡æ¯") @RequestParam(name = "chartcontent") String chartcontent, @ApiParam(name = "isshowlegend", value = "æ¯å¦æ¾ç¤ºå¾ä¾", required = true) @RequestParam(name = "isshowlegend") int isshowlegend, @ApiParam(name = "chartstyle", value = "åºå¾æ ¼å¼", required = true) @RequestParam(name = "chartstyle") String chartstyle, @ApiParam(name = "chartscale", value = "åºå¾æ¯ä¾", required = true) @RequestParam(name = "chartscale") String chartscale, @ApiParam(name = "chartextent", value = "åºå¾èå´") @RequestParam(name = "chartextent") String chartextent, @ApiParam(name = "isscalelocked", value = "æ¯å¦é宿¯ä¾å°º") @RequestParam(name = "isscalelocked") Integer isscalelocked) { |
| | | title = title.replaceAll("\'","'").replaceAll("\"", """); |
| | | chartcontent = chartextent.replaceAll("\'","'").replaceAll("\"", """); |
| | | mapcontent = mapcontent.replaceAll("\'","'").replaceAll("\"", """); |
| | | Res_TempPrint resTempPrint = new Res_TempPrint(); |
| | | resTempPrint.setUserid(userid);//ç¨æ·ID |
| | | if (rtid != null) { |
| | | resTempPrint.setRtid(rtid);//模æ¿ID |
| | | } |
| | | |
| | | resTempPrint.setTitle(title);//æ é¢ |
| | | if (chartcontent != null && !chartcontent.isEmpty()) { |
| | | resTempPrint.setChartcontent(chartcontent);//å¶å¾ä¿¡æ¯ |
| | | } |
| | | resTempPrint.setMapcontent(mapcontent);//å°å¾å
容 |
| | | resTempPrint.setIsshowlegend(isshowlegend);//æ¯å¦æ¾ç¤ºå¾ä¾ |
| | | resTempPrint.setChartstyle(chartstyle);//åºå¾æ ¼å¼ |
| | | resTempPrint.setChartscale(chartscale);//åºå¾æ¯ä¾ |
| | | resTempPrint.setAuditstatus(3); //æ°å¢æ·»å æªæäº¤ç¶æ |
| | | if (chartextent != null && !chartextent.isEmpty()) { |
| | | resTempPrint.setChartextent(chartextent);//åºå¾èå´ |
| | | } |
| | | if (isscalelocked != null) { |
| | | resTempPrint.setIsscalelocked(isscalelocked);//æ¯å¦é宿¯ä¾å°º |
| | | } |
| | | |
| | | Timestamp time = new Timestamp(new Date().getTime()); |
| | | resTempPrint.setChartdate(time); |
| | | resTempPrintService.insertSelective(resTempPrint);//æ°å¢å°å¾åºå¾æå°ä¿¡æ¯ |
| | | int objectid = resTempPrintService.queryResTempPrintIdentCurrent();//è·åæ°å¢ä¿¡æ¯ID |
| | | |
| | | return objectid; |
| | | } |
| | | |
| | | /** |
| | | * æ´æ°å°å¾åºå¾æå°ä¿¡æ¯ |
| | | */ |
| | | @PostMapping("updateMapTemPrint") |
| | | @ApiOperation(value = "æ´æ°å°å¾åºå¾æå°ä¿¡æ¯", notes = "") |
| | | @ResponseBody |
| | | public int updateMapTemPrint(Res_TempPrint resTempPrint) { |
| | | resTempPrintService.updateByPrimaryKeySelective(resTempPrint); |
| | | return resTempPrint.getObjectid(); |
| | | } |
| | | |
| | | /** |
| | | * æäº¤å°å¾åºå¾æå°ä¿¡æ¯ |
| | | */ |
| | | @PostMapping("sumbitMapTemPrint") |
| | | @ApiOperation(value = "æäº¤å°å¾åºå¾æå°ä¿¡æ¯", notes = "") |
| | | @ResponseBody |
| | | public String sumbitMapTemPrint(int objectid) { |
| | | Res_TempPrint resTempPrint = resTempPrintService.selectByPrimaryKey(objectid); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | if (resTempPrint != null) { |
| | | resTempPrint.setAuditstatus(2); |
| | | resTempPrintService.updateByPrimaryKeySelective(resTempPrint); |
| | | map.put("success", true); |
| | | map.put("msg", "æäº¤æåï¼"); |
| | | } else { |
| | | map.put("success", false); |
| | | map.put("msg", "æäº¤å¤±è´¥ï¼æç¤ºï¼åºå¾æå°ä¿¡æ¯ä¸åå¨ï¼"); |
| | | } |
| | | |
| | | return JSON.toJSONString(map, SerializerFeature.WriteMapNullValue); |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®IDè·åå°å¾åºå¾ä¿¡æ¯ |
| | | */ |
| | | @GetMapping("getMapPrintById") |
| | | @ResponseBody |
| | | public String getMapPrintById(int objid) { |
| | | Res_TempPrint resTempPrint = resTempPrintService.selectByPrimaryKey(objid); |
| | | OrgUser user = orgUserService.queryObject(resTempPrint.getUserid().longValue()); |
| | | String name = user.getChinesename(); |
| | | String unit = orgUserService.getDefaultUnit(user.getUserid()).getUnitname(); |
| | | //è·åå®¡æ ¸äººä¸æå |
| | | String auditUserName = ""; |
| | | if (resTempPrint.getAudituserid() != null) { |
| | | OrgUser auditUser = orgUserService.queryObject(resTempPrint.getAudituserid().longValue()); |
| | | if (auditUser != null) { |
| | | auditUserName = auditUser.getChinesename(); |
| | | } |
| | | } |
| | | |
| | | Res_Template resTemplate = new Res_Template(); |
| | | if (resTempPrint.getRtid() != null) { |
| | | resTemplate = resTemplateService.selectResTemplateByRtId(resTempPrint.getRtid()); |
| | | } |
| | | String rtname = ""; |
| | | String templatetype = ""; |
| | | if (resTemplate != null) { |
| | | rtname = resTemplate.getRtname(); |
| | | templatetype = resTemplate.getTemplatetype(); |
| | | } else if (resTempPrint.getRtid() == 0) { |
| | | rtname = "MAP_ONLY"; |
| | | templatetype = "MAP_ONLY"; |
| | | } |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
| | | List<Map<String, Object>> maps = new LinkedList<>(); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("userid", resTempPrint.getUserid()); |
| | | map.put("rtid", resTempPrint.getRtid()); |
| | | map.put("rtname", rtname); |
| | | map.put("templatetype", templatetype); |
| | | map.put("title", resTempPrint.getTitle()); |
| | | map.put("auditstatus", resTempPrint.getAuditstatus()); |
| | | map.put("audituser", auditUserName); |
| | | map.put("mapcontent", JSON.parseObject(resTempPrint.getMapcontent())); |
| | | map.put("chartcontent", JSON.parseArray(resTempPrint.getChartcontent())); |
| | | map.put("chartextent", resTempPrint.getChartextent()); |
| | | map.put("isshowlegend", resTempPrint.getIsshowlegend()); |
| | | map.put("isscalelocked", resTempPrint.getIsscalelocked()); |
| | | map.put("chartstyle", resTempPrint.getChartstyle()); |
| | | map.put("chartscale", resTempPrint.getChartscale()); |
| | | map.put("chartdate", sdf.format(resTempPrint.getChartdate())); |
| | | map.put("username", name); |
| | | map.put("userunit", unit); |
| | | maps.add(map); |
| | | |
| | | return JSON.toJSONString(maps, SerializerFeature.WriteMapNullValue); |
| | | } |
| | | |
| | | /** |
| | | * å®¡æ ¸å°å¾åºå¾æå°ä¿¡æ¯ |
| | | */ |
| | | @PostMapping(path = "/auditMapTempPrint") |
| | | @ApiOperation(value = "å®¡æ ¸å°å¾åºå¾æå°ä¿¡æ¯", notes = "") |
| | | @ResponseBody |
| | | public String auditMapTempPrint(@ApiParam(name = "objectid", value = "åºå¾æå°ä¿¡æ¯ID", required = true) @RequestParam(name = "objectid") int objectid, @ApiParam(name = "audituserid", value = "å®¡æ ¸äººID", required = true) @RequestParam(name = "audituserid") int audituserid, @ApiParam(name = "auditopinion", value = "å®¡æ ¸æè§") String auditopinion, @ApiParam(name = "auditstatus", value = "å®¡æ ¸ç»æ", required = true) @RequestParam(name = "auditstatus") int auditstatus) { |
| | | Res_TempPrint resTempPrint = resTempPrintService.selectByPrimaryKey(objectid); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | if (resTempPrint != null) { |
| | | try { |
| | | resTempPrint.setAudituserid(audituserid);//å®¡æ ¸äºº |
| | | resTempPrint.setAuditopinion(auditopinion);//å®¡æ ¸æè§ |
| | | resTempPrint.setAuditstatus(auditstatus);//å®¡æ ¸ç»æ |
| | | Timestamp time = new Timestamp(new Date().getTime()); |
| | | resTempPrint.setAuditdate(time);//å®¡æ ¸æ¶é´ |
| | | resTempPrintService.updateByPrimaryKeySelective(resTempPrint); |
| | | map.put("success", true); |
| | | map.put("msg", "å®¡æ ¸æåï¼"); |
| | | } catch (Exception e) { |
| | | map.put("success", false); |
| | | map.put("msg", e.getMessage()); |
| | | } |
| | | } else { |
| | | map.put("success", false); |
| | | map.put("msg", "åºå¾æå°ä¿¡æ¯ä¸åå¨ï¼"); |
| | | } |
| | | |
| | | return JSON.toJSONString(map, SerializerFeature.WriteMapNullValue); |
| | | } |
| | | |
| | | /** |
| | | * è·ååºå¾å®¡æ ¸ä¿¡æ¯ åå¸äººå¯çèªå·±åºå¾å®¡æ ¸ç¶æï¼å®¡æ ¸äººå¯çèªå·±åå
¶ä»ç¨æ·åºå¾èµæºå¹¶å¯åå®¡æ ¸ |
| | | * @return |
| | | */ |
| | | @GetMapping("/getChuTuList") |
| | | @ResponseBody |
| | | @ApiOperation(value = "è·ååºå¾å®¡æ ¸ä¿¡æ¯", notes = "") |
| | | public String selectInfoList(HttpServletRequest request, PageBean pageBean) { |
| | | String callbackFunName = request.getParameter("callback"); |
| | | String userprintaudit = request.getParameter("userprintaudit");//ç¨æ·åºå¾å®¡æ ¸æé |
| | | String userid = request.getParameter("userid");//ç¨æ·ID |
| | | if (callbackFunName == null || callbackFunName.isEmpty()) { |
| | | callbackFunName = "callback"; |
| | | } |
| | | pageBean.setLimit(10); |
| | | PageHelper.startPage(pageBean.getPage(), pageBean.getLimit());//设置å½å页æ°åæ¯é¡µæ¡æ° |
| | | |
| | | List<Res_TempPrint> resTempPrints = null; |
| | | Res_TempPrint res_tempPrint = new Res_TempPrint(); |
| | | String admin = "true"; |
| | | // æ¥è¯¢å½åç»éç¨æ·æ¯å¦å
·å¤åºå¾å®¡æ ¸æé æ¯ï¼æ¥ææ 䏿¯ï¼æ¥èªå·±ç |
| | | if (userprintaudit == "false") { |
| | | // 妿å
·å¤åºå¾å®¡æ ¸æé,䏿·»å ç¨æ·idï¼æ¥è¯¢ææã妿䏿¯ æ·»å id æ¥è¯¢å个 |
| | | admin = "false"; |
| | | res_tempPrint.setUserid(Integer.parseInt(userid)); |
| | | } |
| | | resTempPrints = resTempPrintService.getList(res_tempPrint); |
| | | |
| | | int countNums = (int) ((Page) resTempPrints).getTotal();//è·åè®°å½æ»æ° |
| | | PageBean<Res_TempPrint> pageData = new PageBean<>(pageBean.getPage(), pageBean.getLimit(), countNums); |
| | | pageData.setItems(resTempPrints); |
| | | |
| | | StringBuilder rsb = new StringBuilder(); |
| | | rsb.append("["); |
| | | List<Map<String, Object>> maps = new LinkedList<>(); |
| | | for (int i = 0; i < resTempPrints.size(); i++) { |
| | | Map<String, Object> remap = new HashMap<>(); |
| | | remap.put("objectid", resTempPrints.get(i).getObjectid()); |
| | | remap.put("title", resTempPrints.get(i).getTitle()); |
| | | remap.put("auditstatus", resTempPrints.get(i).getAuditstatus()); |
| | | maps.add(remap); |
| | | } |
| | | |
| | | Map<String, Object> newmap = new HashMap<>(); |
| | | newmap.put("Count", countNums); |
| | | newmap.put("Page", pageBean.getPage()); |
| | | newmap.put("isAdmin", admin); |
| | | newmap.put("ShuJu", maps); |
| | | |
| | | return callbackFunName + "(" + JSON.toJSONString(newmap, SerializerFeature.WriteMapNullValue) + ")"; |
| | | } |
| | | |
| | | /** |
| | | * å é¤åºå¾è®°å½ |
| | | */ |
| | | @GetMapping("/delTempPrint") |
| | | @ResponseBody |
| | | @ApiOperation(value = "è·ååºå¾å®¡æ ¸ä¿¡æ¯", notes = "") |
| | | public String selectInfoList(@ApiParam(name = "objectid", value = "åºå¾æå°ä¿¡æ¯ID", required = true) @RequestParam(name = "objectid") int objectid) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | try { |
| | | resTempPrintService.deleteByPrimaryKey(objectid); |
| | | map.put("success", true); |
| | | map.put("msg", "å 餿åï¼"); |
| | | } catch (Exception e) { |
| | | map.put("success", false); |
| | | map.put("msg", "å é¤å¤±è´¥ï¼é误æç¤ºï¼" + e.getMessage()); |
| | | } |
| | | return JSON.toJSONString(map, SerializerFeature.WriteMapNullValue); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.landtool.lanbase.modules.api.controller.MapPortal; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.LinkedList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.serializer.SerializerFeature; |
| | | import com.github.pagehelper.Page; |
| | | import com.github.pagehelper.PageHelper; |
| | | import com.landtool.lanbase.modules.api.utils.PageBean; |
| | | import com.landtool.lanbase.modules.res.entity.Res_Template; |
| | | import com.landtool.lanbase.modules.res.service.ResTemplateService; |
| | | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | |
| | | @Controller |
| | | @RequestMapping("api/maptemplate") |
| | | @Api(value = "", tags = {"ä¸é¢å¶å¾å°å¾åºå¾æå°æ¨¡æ¿æ¥å£"}) |
| | | public class MapTemplateController { |
| | | @Autowired |
| | | private ResTemplateService resTemplateService; |
| | | |
| | | @ResponseBody |
| | | @GetMapping("getTemplateList") |
| | | @ApiOperation(value = "è·ååºå¾æ¨¡æ¿ä¿¡æ¯", notes = "") |
| | | public String getTemplateList(HttpServletRequest request, PageBean pageBean, Res_Template resTemplate, String scal) { |
| | | if (scal != null && !"".equals(scal)) { |
| | | String[] scale = scal.split("-"); |
| | | Integer scalemin = Integer.valueOf(scale[0]); |
| | | Integer scalemax = Integer.valueOf(scale[1]); |
| | | resTemplate.setScalemin(scalemin); |
| | | resTemplate.setScalemax(scalemax); |
| | | } |
| | | String callbackFunName = request.getParameter("callback"); |
| | | if (callbackFunName == null || callbackFunName.isEmpty()) { |
| | | callbackFunName = "callback"; |
| | | } |
| | | pageBean.setLimit(10); |
| | | PageHelper.startPage(pageBean.getPage(), pageBean.getLimit());//设置å½å页æ°åæ¯é¡µæ¡æ° |
| | | List<Res_Template> resTemplateList = resTemplateService.selectResTemplate(resTemplate); |
| | | int countNums = (int) ((Page) resTemplateList).getTotal();//è·åè®°å½æ»æ° |
| | | PageBean<Res_Template> pageData = new PageBean<>(pageBean.getPage(), pageBean.getLimit(), countNums); |
| | | pageData.setItems(resTemplateList); |
| | | |
| | | List<Map<String, Object>> templateList = new LinkedList<>(); |
| | | List list = new ArrayList(); |
| | | //rsb.append("["); |
| | | for (int i = 0; i < resTemplateList.size(); i++) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("rtid", resTemplateList.get(i).getRtid()); |
| | | map.put("rtname", resTemplateList.get(i).getRtname()); |
| | | map.put("businesstype", resTemplateList.get(i).getBusinesstype()); |
| | | map.put("scalemin", resTemplateList.get(i).getScalemin()); |
| | | map.put("scalemax", resTemplateList.get(i).getScalemax()); |
| | | map.put("paperstyle", resTemplateList.get(i).getPaperstyle()); |
| | | map.put("paperdirection", resTemplateList.get(i).getPaperdirection()); |
| | | map.put("chartcontent", resTemplateList.get(i).getChartcontent()); |
| | | map.put("mapsize", resTemplateList.get(i).getMapsize()); |
| | | map.put("templatetype", resTemplateList.get(i).getTemplatetype()); |
| | | templateList.add(map); |
| | | boolean flag = true; |
| | | for (int j = 0; j < list.size(); j++) { |
| | | if (list.get(j).toString().equals(resTemplateList.get(i).getScalemin() + "-" + resTemplateList.get(i).getScalemax())) { |
| | | flag = false; |
| | | } |
| | | } |
| | | if (flag || list.size() == 0) { |
| | | list.add(resTemplateList.get(i).getScalemin() + "-" + resTemplateList.get(i).getScalemax()); |
| | | } |
| | | } |
| | | Map<String, Object> result = new HashMap<>(); |
| | | result.put("Count", countNums); |
| | | result.put("Page", pageBean.getPage()); |
| | | result.put("ShuJu", templateList); |
| | | result.put("Scal", list); |
| | | |
| | | return callbackFunName + "(" + JSON.toJSONString(result, SerializerFeature.WriteMapNullValue) + ")"; |
| | | } |
| | | |
| | | @ResponseBody |
| | | @GetMapping("getTemplateById") |
| | | @ApiOperation(value = "è·ååºå¾æ¨¡æ¿ä¿¡æ¯", notes = "") |
| | | public String getTemplateById(Integer rtid) { |
| | | Res_Template resTemplate = resTemplateService.selectResTemplateByRtId(rtid); |
| | | List<Map<String, Object>> maps = new LinkedList<>(); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("paperdirection", resTemplate.getPaperdirection()); |
| | | map.put("rtname", resTemplate.getRtname()); |
| | | map.put("scale", resTemplate.getScalemin() + "-" + resTemplate.getScalemax()); |
| | | map.put("paperstyle", resTemplate.getPaperstyle()); |
| | | map.put("chartcontent", resTemplate.getChartcontent()); |
| | | map.put("templatetype", resTemplate.getTemplatetype()); |
| | | maps.add(map); |
| | | |
| | | return JSON.toJSONString(maps, SerializerFeature.WriteMapNullValue); |
| | | } |
| | | |
| | | @ResponseBody |
| | | @GetMapping("selectTemplate") |
| | | public String selectTemplate(Res_Template resTemplate) { |
| | | List<Res_Template> resTemplates = resTemplateService.selectResTemplate(resTemplate); |
| | | List<Map<String, Object>> list = new LinkedList<>(); |
| | | for (int i = 0; i < resTemplates.size(); i++) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("rtid", resTemplates.get(i).getRtid()); |
| | | map.put("rtname", resTemplates.get(i).getRtname()); |
| | | map.put("businesstype", resTemplates.get(i).getBusinesstype()); |
| | | map.put("scalemin", resTemplates.get(i).getScalemin()); |
| | | map.put("scalemax", resTemplates.get(i).getScalemax()); |
| | | map.put("paperstyle", resTemplates.get(i).getPaperstyle()); |
| | | map.put("paperdirection", resTemplates.get(i).getPaperdirection()); |
| | | map.put("chartcontent", resTemplates.get(i).getChartcontent()); |
| | | list.add(map); |
| | | } |
| | | |
| | | return JSON.toJSONString(list, SerializerFeature.WriteMapNullValue); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.landtool.lanbase.modules.api.controller.MapPortal; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.LinkedList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.alibaba.fastjson.serializer.SerializerFeature; |
| | | import com.github.pagehelper.Page; |
| | | import com.github.pagehelper.PageHelper; |
| | | import com.landtool.lanbase.common.utils.CommonUtils; |
| | | import com.landtool.lanbase.modules.api.utils.PageBean; |
| | | import com.landtool.lanbase.modules.res.entity.Res_ExtBusinessLayer; |
| | | import com.landtool.lanbase.modules.res.entity.Res_ExtIntegrate; |
| | | import com.landtool.lanbase.modules.res.entity.Res_Theme; |
| | | import com.landtool.lanbase.modules.res.entity.Res_Theme_Module; |
| | | import com.landtool.lanbase.modules.res.service.ResExtBusinessLayerService; |
| | | import com.landtool.lanbase.modules.res.service.ResExtIntegrateService; |
| | | import com.landtool.lanbase.modules.res.service.ResThemeModuleService; |
| | | import com.landtool.lanbase.modules.res.service.ResThemeService; |
| | | |
| | | import io.swagger.annotations.Api; |
| | | |
| | | /** |
| | | * @author åå°æ³¢ |
| | | * @Description: å°å¾æå¡å¯è§åæ¥å£ |
| | | * @date 2018-05-26 |
| | | */ |
| | | |
| | | @Controller |
| | | @RequestMapping("/api/thememaping/") |
| | | @Api(value = "", tags = {"å°å¾æå¡å¯è§åæ¥å£"}) |
| | | public class MapViewController { |
| | | @Autowired |
| | | private ResExtIntegrateService resExtIntegrateService; |
| | | |
| | | @Autowired |
| | | private ResThemeService resThemeService; |
| | | |
| | | @Autowired |
| | | private ResThemeModuleService resThemeModuleService; |
| | | |
| | | @Autowired |
| | | private ResExtBusinessLayerService resExtBusinessLayerService; |
| | | |
| | | /** |
| | | * è·å模åå表(æé¤ä¸å¡ä¸é¢å·²éæ©æ¨¡å) |
| | | * @param themeid ä¸å¡ä¸é¢Id |
| | | * @param title 模ååç§° |
| | | * @param moduleIdList ä¸å¡ä¸é¢å·²å±ç¤ºæ¨¡åID |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @GetMapping("getModuleList") |
| | | public String getModuleList(Integer themeid, String title, String moduleIdList, PageBean pageBean) { |
| | | Page<Res_Theme_Module> page = PageHelper.startPage(pageBean.getPage(), pageBean.getLimit()); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("themeid", themeid); |
| | | map.put("title", title); |
| | | map.put("moduleIdList", moduleIdList); |
| | | List<Res_Theme_Module> resThemeModuleList1 = resThemeModuleService.getIgnoreThemeModuleList(map); |
| | | int countNums = (int) ((Page) resThemeModuleList1).getTotal(); |
| | | PageBean<Res_Theme_Module> pageData = new PageBean<>(pageBean.getPage(), pageBean.getLimit(), countNums); |
| | | pageData.setItems(resThemeModuleList1); |
| | | |
| | | List<Map<String, Object>> maps = new LinkedList<>(); |
| | | for (int i = 0; i < resThemeModuleList1.size(); i++) { |
| | | Map<String, Object> ThemeModule = new HashMap<>(); |
| | | ThemeModule.put("moduleid", resThemeModuleList1.get(i).getModuleid());// 模åID |
| | | ThemeModule.put("title", resThemeModuleList1.get(i).getTitle());// 模ååç§° |
| | | maps.add(ThemeModule); |
| | | } |
| | | |
| | | return JSON.toJSONString(maps, SerializerFeature.WriteMapNullValue); |
| | | } |
| | | |
| | | /** |
| | | * è·åä¸é¢å表ï¼ä¸å¡ä¸é¢ï¼ |
| | | */ |
| | | @ResponseBody |
| | | @GetMapping("getAllThemeList") |
| | | public String getAllThemeList(Integer userId, PageBean pageBean) { |
| | | if (pageBean.getPage() == -1) { // -1 表示ä¸å页ï¼ä¸å¼ å¾ï¼ |
| | | pageBean.setLimit(999); |
| | | } else { |
| | | pageBean.setLimit(10); |
| | | } |
| | | PageHelper.startPage(pageBean.getPage(), pageBean.getLimit());//设置å½å页æ°åæ¯é¡µæ¡æ° |
| | | List<Res_Theme> resThemeList = resThemeService.getAllThemeList(userId);// è·åä¸å¡ä¸é¢é»è®¤ä¸é¢å表 |
| | | int countNums = (int) ((Page) resThemeList).getTotal();//è·åè®°å½æ»æ° |
| | | PageBean<Res_Theme> pageData = new PageBean<>(pageBean.getPage(), pageBean.getLimit(), countNums); |
| | | pageData.setItems(resThemeList); |
| | | List<Map<String, Object>> maps = new LinkedList<>(); |
| | | for (Res_Theme resTheme : resThemeList) { |
| | | String title = resTheme.getTitle(); |
| | | if (title.length() > 15) { |
| | | title = CommonUtils.subStringUtils(title, 30); |
| | | } |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("id", resTheme.getThemeid()); |
| | | map.put("title", title); |
| | | map.put("resourceid", resTheme.getResourceid() != null ? resTheme.getResourceid() : ""); |
| | | map.put("fulltitle", resTheme.getTitle()); |
| | | map.put("type", "theme"); |
| | | maps.add(map); |
| | | } |
| | | Map<String, Object> result = new HashMap<>(); |
| | | result.put("Count", countNums); |
| | | result.put("Page", pageBean.getPage()); |
| | | result.put("ShuJu", maps); |
| | | |
| | | return JSON.toJSONString(result, SerializerFeature.WriteMapNullValue); |
| | | } |
| | | |
| | | /** |
| | | * è·åä¸å¡ä¸é¢æé模åå表ï¼å4ä¸ªï¼ |
| | | * @param themeId ä¸å¡ä¸é¢Id |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @GetMapping("getThemeModuleList") |
| | | public String getThemeModuleList(Integer themeId, Integer isOneMap, HttpServletRequest request) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("themeid", themeId); |
| | | map.put("isOneMap", isOneMap); |
| | | List<Res_Theme_Module> resThemeModuleList = resThemeModuleService.getThemeModuleList(map); |
| | | List<Map<String, Object>> maps = new LinkedList<>(); |
| | | |
| | | String agent = request.getHeader("User-Agent"); |
| | | //夿æé©çï¼å¦æä¸ç¬¦åï¼å°±ä¸æ¾ç¤ºã |
| | | String Browser = getBrowserName(agent); |
| | | Boolean panduan = false; |
| | | for (int i = 0; i < resThemeModuleList.size(); i++) { |
| | | if (resThemeModuleList.get(i).getFitbrowser() == null) { |
| | | resThemeModuleList.get(i).setFitbrowser(""); |
| | | } |
| | | if (!resThemeModuleList.get(i).getFitbrowser().equals("")) { |
| | | if (Browser.indexOf(resThemeModuleList.get(i).getFitbrowser()) == -1) { |
| | | continue; |
| | | } else { |
| | | panduan = getaBoolean(resThemeModuleList, maps, panduan, i); |
| | | } |
| | | } else { |
| | | panduan = getaBoolean(resThemeModuleList, maps, panduan, i); |
| | | } |
| | | } |
| | | |
| | | return JSON.toJSONString(maps, SerializerFeature.WriteMapNullValue); |
| | | } |
| | | |
| | | private Boolean getaBoolean(List<Res_Theme_Module> resThemeModuleList, List<Map<String, Object>> maps, Boolean panduan, int i) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("moduleid", resThemeModuleList.get(i).getModuleid());//模åID |
| | | map.put("title", resThemeModuleList.get(i).getTitle());//模ååç§° |
| | | map.put("mapresid", resThemeModuleList.get(i).getMapresid());//å°å¾èµæºID |
| | | map.put("panelresid", resThemeModuleList.get(i).getPanelresid());//颿¿ID |
| | | map.put("panelurl", resThemeModuleList.get(i).getPanelurl());//颿¿å°å |
| | | map.put("clusterstyle", resThemeModuleList.get(i).getClusterstyle());//èªå®ä¹é£æ ¼ID |
| | | Res_ExtIntegrate resExtIntegrate = new Res_ExtIntegrate(); |
| | | if (resThemeModuleList.get(i).getPanelresid() != null) { |
| | | resExtIntegrate = resExtIntegrateService.selectByPrimaryKey(resThemeModuleList.get(i).getPanelresid()); |
| | | } |
| | | if (resExtIntegrate != null) { |
| | | map.put("serverurl", resExtIntegrate.getServerurl());// åå¸åä½id |
| | | } else { |
| | | map.put("serverurl", "");// åå¸åä½id |
| | | } |
| | | JSONObject serviceconfig = JSONObject.parseObject(resThemeModuleList.get(i).getServiceconfig()); |
| | | map.put("serviceconfig", (resThemeModuleList.get(i).getServiceconfig() != null && !resThemeModuleList.get(i).getServiceconfig().isEmpty()) ? serviceconfig : "''"); |
| | | String configurl = ""; |
| | | if (resThemeModuleList.get(i).getAssociationlayer() == null) { |
| | | configurl = ""; |
| | | } else { |
| | | configurl = resThemeModuleList.get(i).getAssociationlayer().replace("?token=", ""); |
| | | } |
| | | |
| | | map.put("configurl", configurl); |
| | | map.put("isclickchartfilter", resThemeModuleList.get(i).getIsclickchartfilter()); |
| | | map.put("ismaplinkage", resThemeModuleList.get(i).getIsmaplinkage()); |
| | | map.put("echartsheight", (resThemeModuleList.get(i).getEchartsheight() != null && resThemeModuleList.get(i).getEchartsheight() % 1 == 0) ? resThemeModuleList.get(i).getEchartsheight().intValue() : (resThemeModuleList.get(i).getEchartsheight() == null ? "" : resThemeModuleList.get(i).getEchartsheight())); |
| | | maps.add(map); |
| | | panduan = true; |
| | | |
| | | return panduan; |
| | | } |
| | | |
| | | /** |
| | | * 夿æ¯å¦æé
ç½®çå¾è¡¨ |
| | | * @param |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @GetMapping("getserviceconfig") |
| | | public Res_ExtBusinessLayer getserviceconfig(Integer resourceid) { |
| | | Res_ExtBusinessLayer res_extBusinessLayer = resExtBusinessLayerService.selectByPrimaryKey(resourceid); |
| | | return res_extBusinessLayer; |
| | | } |
| | | |
| | | /** |
| | | * å®å¶ä¸å¡ä¸é¢æ¨¡å |
| | | * @param new_moduleId æ°æ¨¡åID |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @GetMapping("ThemeModuleEdit") |
| | | public String ThemeModuleEdit(Integer new_moduleId) { |
| | | // æ¥è¯¢æ°æ¨¡åä¿¡æ¯ |
| | | Res_Theme_Module resThemeModule = resThemeModuleService.selectByid(new_moduleId); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | if (resThemeModule != null) { |
| | | map.put("moduleid", resThemeModule.getModuleid());// 模åID |
| | | map.put("title", resThemeModule.getTitle());// 模ååç§° |
| | | map.put("mapresid", resThemeModule.getMapresid());// å°å¾èµæºID |
| | | map.put("panelresid", resThemeModule.getPanelresid());// 颿¿ID |
| | | Res_ExtIntegrate resExtIntegrate = resExtIntegrateService.selectByPrimaryKey(resThemeModule.getPanelresid()); |
| | | |
| | | if (resExtIntegrate != null) { |
| | | map.put("serverurl", resExtIntegrate.getServerurl());// åå¸åä½id |
| | | } else { |
| | | map.put("serverurl", "");// åå¸åä½id |
| | | } |
| | | } |
| | | |
| | | return JSON.toJSONString(map, SerializerFeature.WriteMapNullValue); |
| | | } |
| | | |
| | | /** |
| | | * è·å第ä¸ä¸ªé»è®¤ä¸é¢ï¼ä¸å¡ä¸é¢ï¼ |
| | | */ |
| | | @ResponseBody |
| | | @GetMapping("getFirstDefaultTheme") |
| | | public String getFirstDefaultTheme(Integer userId) { |
| | | List<Res_Theme> resThemeList = resThemeService.getDefaultThemeList(userId);// è·åä¸å¡ä¸é¢é»è®¤ä¸é¢ï¼ä¸´æ¶å»é¤ç¨æ·è¿æ»¤ |
| | | Map<String, Object> map = new HashMap<>(); |
| | | int i = 0; |
| | | for (Res_Theme resTheme : resThemeList) { |
| | | if (i == 0) { |
| | | map.put("id", resTheme.getThemeid()); |
| | | map.put("resourceid", resTheme.getResourceid()); |
| | | map.put("title", resTheme.getTitle()); |
| | | i += 1; |
| | | } |
| | | } |
| | | |
| | | return JSON.toJSONString(map, SerializerFeature.WriteMapNullValue); |
| | | } |
| | | |
| | | /** |
| | | * è·åä¸å¼ å¾ä¸é¢å表ï¼ä¸å¡ä¸é¢ï¼ |
| | | */ |
| | | @ResponseBody |
| | | @GetMapping("getOneMapThemeList") |
| | | public String getOneMapThemeList(Integer userId, PageBean pageBean) { |
| | | if (pageBean.getPage() == -1) { // -1 表示ä¸å页ï¼ä¸å¼ å¾ï¼ |
| | | pageBean.setLimit(999); |
| | | } else { |
| | | pageBean.setLimit(10); |
| | | } |
| | | PageHelper.startPage(pageBean.getPage(), pageBean.getLimit());//设置å½å页æ°åæ¯é¡µæ¡æ° |
| | | List<Res_Theme> resThemeList = resThemeService.getOneMapThemeList(userId);// è·åä¸å¡ä¸é¢é»è®¤ä¸é¢å表 |
| | | int countNums = (int) ((Page) resThemeList).getTotal();//è·åè®°å½æ»æ° |
| | | PageBean<Res_Theme> pageData = new PageBean<>(pageBean.getPage(), pageBean.getLimit(), countNums); |
| | | pageData.setItems(resThemeList); |
| | | List<Map<String, Object>> maps = new LinkedList<>(); |
| | | for (Res_Theme resTheme : resThemeList) { |
| | | String title = resTheme.getTitle(); |
| | | if (title.length() > 15) { |
| | | title = CommonUtils.subStringUtils(title, 30); |
| | | } |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("id", resTheme.getThemeid()); |
| | | map.put("title", title); |
| | | map.put("fulltitle", resTheme.getTitle()); |
| | | map.put("type", "theme"); |
| | | map.put("resourceid", resTheme.getResourceid() != null ? resTheme.getResourceid() : ""); |
| | | maps.add(map); |
| | | } |
| | | Map<String, Object> result = new HashMap<>(); |
| | | result.put("Count", countNums); |
| | | result.put("Page", pageBean.getPage()); |
| | | result.put("ShuJu", maps); |
| | | |
| | | return JSON.toJSONString(result, SerializerFeature.WriteMapNullValue); |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®idè·åä¸é¢æè¿° |
| | | */ |
| | | @ResponseBody |
| | | @GetMapping("getThemeInfo") |
| | | public String getThemeInfo(Integer themeid) { |
| | | Res_Theme resTheme = resThemeService.selectByThemeId(themeid); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | if (resTheme != null) { |
| | | map.put("fulltitle", resTheme.getTitle()); |
| | | map.put("content", resTheme.getContent()); |
| | | } |
| | | |
| | | return JSON.toJSONString(map, SerializerFeature.WriteMapNullValue); |
| | | } |
| | | |
| | | /** |
| | | * è·åä¸å¼ å¾ç¬¬ä¸ä¸ªé»è®¤ä¸é¢ï¼ä¸å¡ä¸é¢ï¼ |
| | | */ |
| | | @ResponseBody |
| | | @GetMapping("getFirstDefaultThemeByOneMap") |
| | | public String getFirstDefaultThemeByOneMap(Integer userId) { |
| | | Res_Theme resTheme = resThemeService.getFirstDefaultThemeByOneMap(userId);// è·åä¸å¡ä¸é¢é»è®¤ä¸é¢ï¼ä¸´æ¶å»é¤ç¨æ·è¿æ»¤ |
| | | Map<String, Object> map = new HashMap<>(); |
| | | if (resTheme != null) { |
| | | map.put("id", resTheme.getThemeid()); |
| | | map.put("title", resTheme.getTitle()); |
| | | } |
| | | |
| | | return JSON.toJSONString(map, SerializerFeature.WriteMapNullValue); |
| | | } |
| | | |
| | | /** |
| | | * è·åä¸å¼ å¾ä¸å¡ä¸»é¢èåå表ï¼ä¸éè¦è¿æ»¤ç¨æ·ï¼ä¸é¢çuserIdå¨Mapper䏿²¡æç¨å°ï¼ |
| | | */ |
| | | @ResponseBody |
| | | @GetMapping("getTopOneMapMenuList") |
| | | public String getTopOneMapMenuList(Integer userId) { |
| | | List<Res_Theme> resThemeList = resThemeService.getOneMapThemeList(userId);// è·åä¸å¡ä¸é¢é»è®¤ä¸é¢å表 |
| | | List<Map<String, Object>> maps = new LinkedList<>(); |
| | | for (Res_Theme resTheme : resThemeList) { |
| | | String title = resTheme.getTitle(); |
| | | if (title.length() > 15) { |
| | | title = CommonUtils.subStringUtils(title, 30); |
| | | } |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("id", resTheme.getThemeid()); |
| | | map.put("title", title); |
| | | map.put("fulltitle", resTheme.getTitle()); |
| | | map.put("resourceid", resTheme.getResourceid() != null ? resTheme.getResourceid() : ""); |
| | | map.put("content", resTheme.getContent()); |
| | | maps.add(map); |
| | | } |
| | | |
| | | return JSON.toJSONString(maps, SerializerFeature.WriteMapNullValue); |
| | | } |
| | | |
| | | public String getBrowserName(String agent) { |
| | | if (agent.indexOf("msie 7") > 0) { |
| | | return "IE"; |
| | | } else if (agent.indexOf("msie") > 0) { |
| | | return "IE"; |
| | | } else if (agent.indexOf("Firefox") > 0) { |
| | | return "Firefox"; |
| | | } else if (agent.indexOf("Gecko") > 0 && agent.indexOf("rv:11") > 0) { |
| | | return "IE11"; |
| | | } else if (agent.indexOf("Chrome") > 0) { |
| | | return "Google"; |
| | | } else { |
| | | return "Others"; |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.landtool.lanbase.modules.api.controller.MapPortal; |
| | | |
| | | import java.io.File; |
| | | import java.sql.Timestamp; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | |
| | | import com.landtool.lanbase.common.utils.JpinyinUtils; |
| | | import com.landtool.lanbase.config.SysTemPropertyConfig; |
| | | import com.landtool.lanbase.modules.org.entity.OrgUnit; |
| | | import com.landtool.lanbase.modules.org.service.OrgUserService; |
| | | import com.landtool.lanbase.modules.res.entity.Res_ExtBusinessLayer; |
| | | import com.landtool.lanbase.modules.res.entity.Res_ExtMapUrl; |
| | | import com.landtool.lanbase.modules.res.entity.Res_ExtThemeMap; |
| | | import com.landtool.lanbase.modules.res.entity.Res_MainInfo; |
| | | import com.landtool.lanbase.modules.res.service.ResActionRecordService; |
| | | import com.landtool.lanbase.modules.res.service.ResApplyRecommendService; |
| | | import com.landtool.lanbase.modules.res.service.ResAuditService; |
| | | import com.landtool.lanbase.modules.res.service.ResBusinessRefService; |
| | | import com.landtool.lanbase.modules.res.service.ResEvaluationService; |
| | | import com.landtool.lanbase.modules.res.service.ResExtBusinessLayerService; |
| | | import com.landtool.lanbase.modules.res.service.ResExtMapUrlService; |
| | | import com.landtool.lanbase.modules.res.service.ResExtThemeMapService; |
| | | import com.landtool.lanbase.modules.res.service.ResMainInfoService; |
| | | import com.landtool.lanbase.modules.res.service.ResQueryAroundService; |
| | | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | |
| | | /** |
| | | * @author åå°æ³¢ |
| | | * @Description: ä¸é¢å¶å¾ç¸å
³æ¥å£ |
| | | * @date 2018-05-26 |
| | | */ |
| | | |
| | | @Controller |
| | | @RequestMapping("/api/thememaping/") |
| | | @Api(value = "", tags = { "ä¸é¢å¶å¾ç¸å
³æ¥å£" }) |
| | | public class ThemeMappingController { |
| | | @Autowired |
| | | private ResExtThemeMapService resExtThemeMapService; |
| | | @Autowired |
| | | private ResMainInfoService resMainInfoService; |
| | | @Autowired |
| | | private OrgUserService orgUserService; |
| | | |
| | | @Autowired |
| | | private ResExtBusinessLayerService resExtBusinessLayerService; |
| | | |
| | | @Autowired |
| | | private ResExtMapUrlService resExtMapUrlService; |
| | | |
| | | @Autowired |
| | | private ResActionRecordService resActionRecordService; |
| | | |
| | | @Autowired |
| | | private ResApplyRecommendService resApplyRecommendService; |
| | | |
| | | @Autowired |
| | | private ResAuditService resAuditService; |
| | | |
| | | @Autowired |
| | | private ResBusinessRefService resBusinessRefService; |
| | | |
| | | @Autowired |
| | | private ResQueryAroundService resQueryAroundService; |
| | | |
| | | @Autowired |
| | | private ResEvaluationService resEvaluationService; |
| | | |
| | | @Autowired |
| | | private SysTemPropertyConfig sysConfig; |
| | | |
| | | /** |
| | | * æ°å¢ç³»ç»èµæºæ©å±(ä¸é¢å°å¾) |
| | | */ |
| | | @PostMapping(path = "/addMap") |
| | | @ApiOperation(value = "æ°å¢ç³»ç»èµæºæ©å±(ä¸é¢å°å¾)", notes = "") |
| | | @ResponseBody |
| | | public int addMap( |
| | | // @ApiParam(name="catlogid",value="èµæºç®å½Id",required=true) |
| | | // @RequestParam(name="catlogid")int catlogid, |
| | | @ApiParam(name = "resourceid", value = "èµæºId") Integer resourceid, |
| | | @ApiParam(name = "title", value = "èµæºåç§°", required = true) @RequestParam(name = "title") String title, |
| | | @ApiParam(name = "resourceclass", value = "èµæºç±»å代ç ") String resourceclass, |
| | | @ApiParam(name = "catlogcode", value = "æå±ç®å½ç¼ç ") String catlogcode, |
| | | @ApiParam(name = "publishsoft", value = "åå¸å¹³å°") String publishsoft, |
| | | @ApiParam(name = "layername", value = "åå¾å±åç§°") String layername, |
| | | @ApiParam(name = "portalguid", value = "PortalèµæºGUID") String portalguid, |
| | | @ApiParam(name = "legeendurl", value = "èªå®ä¹å¾ä¾") String legeendurl, |
| | | @ApiParam(name = "sublayerset", value = "åå¾å±è®¾ç½®") String sublayerset, |
| | | @ApiParam(name = "defaultlayerset", value = "é»è®¤åºå¾è®¾ç½®") Integer defaultlayerset, |
| | | @ApiParam(name = "initxmin", value = "åå§åå°å¾èå´æå°çXåæ å¼") Double initxmin, |
| | | @ApiParam(name = "initxmax", value = "åå§åå°å¾è崿大çXåæ å¼") Double initxmax, |
| | | @ApiParam(name = "initymin", value = "åå§åå°å¾èå´æå°çYåæ å¼") Double initymin, |
| | | @ApiParam(name = "initymax", value = "åå§åå°å¾è崿大çYåæ å¼") Double initymax, |
| | | @ApiParam(name = "fullxmin", value = "å°å¾è¦çèå´æå°çXåæ å¼") Double fullxmin, |
| | | @ApiParam(name = "fullxmax", value = "å°å¾è¦çè崿大çXåæ å¼") Double fullxmax, |
| | | @ApiParam(name = "fullymin", value = "å°å¾è¦çèå´æå°çYåæ å¼") Double fullymin, |
| | | @ApiParam(name = "fullymax", value = "å°å¾è¦çè崿大çYåæ å¼") Double fullymax, |
| | | @ApiParam(name = "type", value = "ä¸é¢ç±»å") String type, |
| | | @ApiParam(name = "mapjson", value = "å°å¾JSON", required = true) String mapjson, |
| | | @ApiParam(name = "userid", value = "åå»ºç¨æ·ID", required = true) Long userid) { |
| | | if (resourceid == null) |
| | | resourceid = -1; |
| | | |
| | | Res_MainInfo main = resMainInfoService.selectByPrimaryKey(resourceid); |
| | | if (main != null) { |
| | | main.setTitle(title); |
| | | main.setAbbreviation(title); |
| | | main.setResourceclass("KJ_ZTDT");// ææ¶å
èµå¼0 |
| | | main.setCatlogcode("0");// ææ¶å
èµå¼0 |
| | | main.setPingyinfiirst(JpinyinUtils.changeToGetShortPinYin(title).toUpperCase()); |
| | | Timestamp time = new Timestamp(new Date().getTime()); |
| | | main.setLasteditdate(time); |
| | | resMainInfoService.updateByPrimaryKeySelective(main); |
| | | Res_ExtThemeMap info = resExtThemeMapService.selectByPrimaryKey(resourceid); |
| | | if (info != null) { |
| | | info.setPublishsoft(publishsoft); |
| | | info.setLayername(layername); |
| | | info.setSublayerset(sublayerset); |
| | | info.setDefaultlayerset(defaultlayerset); |
| | | info.setInitxmin(initxmin == null ? 0 : initxmin); |
| | | info.setInitxmax(initxmax == null ? 0 : initxmax); |
| | | info.setInitymin(initymin == null ? 0 : initymin); |
| | | info.setInitymax(initymax == null ? 0 : initymax); |
| | | info.setType(type == null ? "ç³»ç»å¶ä½" : type); |
| | | info.setMapjson(mapjson); |
| | | resExtThemeMapService.updateByPrimaryKeySelective(info); |
| | | } |
| | | } else { |
| | | main = new Res_MainInfo(); |
| | | main.setTitle(title); |
| | | main.setAbbreviation(title); |
| | | main.setCatlogid(0);// é»è®¤è®¾ç½®0 |
| | | main.setResourceclass("KJ_ZTDT");// ææ¶å
èµå¼0 |
| | | main.setCatlogcode("0");// ææ¶å
èµå¼0 |
| | | main.setPingyinfiirst(JpinyinUtils.changeToGetShortPinYin(title).toUpperCase()); |
| | | Timestamp time = new Timestamp(new Date().getTime()); |
| | | main.setPubdate(time); |
| | | |
| | | // æ¥è¯¢åå¸äººå¯¹åºçåä½ID |
| | | OrgUnit orgUnit = orgUserService.getDefaultUnit(userid); |
| | | if(orgUnit != null) { |
| | | main.setPubunitid(orgUnit.getUnitid().intValue()); |
| | | } else { |
| | | main.setPubunitid(0); |
| | | } |
| | | main.setCreateuserid(userid); |
| | | main.setCreatedate(time); |
| | | main.setLasteditdate(time); |
| | | |
| | | main.setSharprotocol("å®å
¨å
¬å¼"); |
| | | main.setEspproxy(0); |
| | | main.setResourcestatus(0); |
| | | main.setAuditstatus(0); |
| | | main.setDisplayby2d(0); |
| | | main.setDisplayby3d(0); |
| | | |
| | | resMainInfoService.insertSelective(main); |
| | | resourceid = resMainInfoService.queryResMainInfoIdentCurrent(); |
| | | Res_ExtThemeMap info = new Res_ExtThemeMap(); |
| | | info.setResourceid(resourceid); |
| | | info.setPublishsoft(publishsoft); |
| | | info.setLayername(layername); |
| | | info.setPortalguid(portalguid); |
| | | info.setSublayerset(sublayerset); |
| | | info.setDefaultlayerset(defaultlayerset); |
| | | info.setInitxmin(initxmin == null ? 0 : initxmin); |
| | | info.setInitxmax(initxmax == null ? 0 : initxmax); |
| | | info.setInitymin(initymin == null ? 0 : initymin); |
| | | info.setInitymax(initymax == null ? 0 : initymax); |
| | | info.setType(type == null ? "ç³»ç»å¶ä½" : type); |
| | | info.setMapjson(mapjson); |
| | | resExtThemeMapService.insert(info); |
| | | } |
| | | return resourceid; |
| | | } |
| | | |
| | | /** |
| | | * ç¼è¾ç³»ç»èµæºæ©å±(ä¸é¢å°å¾)å°å¾JSON |
| | | */ |
| | | @PostMapping(path = "/updateMap") |
| | | @ApiOperation(value = "ç¼è¾ç³»ç»èµæºæ©å±(ä¸é¢å°å¾)å°å¾JSON", notes = "") |
| | | @ResponseBody |
| | | public int updateExtThemeMap( |
| | | @ApiParam(name = "resourceid", value = "ä¿¡æ¯èµæºId", required = true) @RequestParam(name = "resourceid") int resourceid, |
| | | @ApiParam(name = "title", value = "èµæºåç§°") @RequestParam(name = "title") String title, |
| | | @ApiParam(name = "mapjson", value = "å°å¾JSON") @RequestParam(name = "mapjson") String mapjson) { |
| | | Res_MainInfo resMainInfo = new Res_MainInfo(); |
| | | resMainInfo.setResourceid(resourceid); |
| | | resMainInfo.setTitle(title); |
| | | resMainInfoService.updateByPrimaryKeySelective(resMainInfo); |
| | | |
| | | Res_ExtThemeMap info = new Res_ExtThemeMap(); |
| | | info.setResourceid(resourceid); |
| | | info.setMapjson(mapjson); |
| | | |
| | | resExtThemeMapService.updateByPrimaryKeySelective(info); |
| | | return resourceid; |
| | | } |
| | | |
| | | @ResponseBody |
| | | @GetMapping("/info/{resourceid}") |
| | | @ApiOperation(value = "è·åç³»ç»èµæºæ©å±(ä¸é¢å°å¾)", notes = "") |
| | | public Res_ExtThemeMap queryExtThemeMap( |
| | | @ApiParam(name = "resourceid", value = "ä¿¡æ¯èµæºId") @PathVariable("resourceid") int resourceid) { |
| | | return resExtThemeMapService.selectByPrimaryKey(resourceid); |
| | | } |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/del") |
| | | @ApiOperation(value = "å 餿çå¶å¾ç¸å
³ä¿¡æ¯", notes = "") |
| | | public String delExtThemeMap( |
| | | @ApiParam(name = "resourceid", value = "ä¿¡æ¯èµæºId") @RequestParam(name ="resourceid") int resourceid) { |
| | | Res_ExtThemeMap resExtThemeMap = resExtThemeMapService.selectByPrimaryKey(resourceid); |
| | | if (resExtThemeMap != null) { |
| | | if(resExtThemeMap.getLegendurl() != null) { |
| | | String path = sysConfig.getUploadPath() + "ResExtThemMapServer/" + resExtThemeMap.getLegendurl(); |
| | | File file = new File(path); |
| | | if(file.exists()) { |
| | | file.delete(); |
| | | } |
| | | } |
| | | resExtThemeMapService.deleteByPrimaryKey(resourceid); |
| | | } |
| | | //èµæºåè®®ä¸å°å |
| | | List<Res_ExtMapUrl> resExtMapUrlList = resExtMapUrlService.selectByCondition(resourceid); |
| | | if(resExtMapUrlList != null && resExtMapUrlList.size() > 0){ |
| | | resExtMapUrlService.deleteByResourceId(resourceid); |
| | | } |
| | | //èµæºæä½è®°å½ |
| | | int resActionRecordCount = resActionRecordService.selectCountByResourceid(resourceid); |
| | | if(resActionRecordCount > 0){ |
| | | resActionRecordService.deleteByResourceid(resourceid); |
| | | } |
| | | //èµæºç³è¯·/æ¨è |
| | | int resApplyRecommendCount = resApplyRecommendService.selectCountByResourceid(resourceid); |
| | | if(resApplyRecommendCount > 0){ |
| | | resApplyRecommendService.deleteByResourceid(resourceid); |
| | | } |
| | | //èµæºå叿³¨éåæ´å®¡æ ¸ |
| | | int resAuditCount = resAuditService.selectCountByResourceid(resourceid); |
| | | if(resAuditCount > 0){ |
| | | resAuditService.deleteByResourceid(resourceid); |
| | | } |
| | | //ä¸å¡å
³èåæ |
| | | int resBusinessrefCount = resBusinessRefService.selectCountByResourceid(resourceid); |
| | | if(resBusinessrefCount > 0){ |
| | | resBusinessRefService.deleteByResourceid(resourceid); |
| | | } |
| | | //ä¸å¡å
³èå¨è¾¹æ¥è¯¢ |
| | | int resQueryAroundCount = resQueryAroundService.selectCountByResourceid(resourceid); |
| | | if(resQueryAroundCount > 0 ){ |
| | | resQueryAroundService.deleteByResourceid(resourceid); |
| | | } |
| | | //èµæºè¯ä»· |
| | | int resEvaluationCount = resEvaluationService.selectCountByResourceid(resourceid); |
| | | if(resEvaluationCount > 0){ |
| | | resEvaluationService.deleteByResourceid(resourceid); |
| | | } |
| | | resMainInfoService.deleteByPrimaryKey(resourceid); |
| | | return "å 餿å"; |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢ç³»ç»èµæºæ©å±(ä¸å¡å¾å±) |
| | | */ |
| | | @PostMapping(path = "/addBusinessLayer") |
| | | @ApiOperation(value = "æ°å¢ç³»ç»èµæºæ©å±(ä¸å¡å¾å±)", notes = "") |
| | | @ResponseBody |
| | | public int addBusinessLayer( |
| | | // @ApiParam(name="catlogid",value="èµæºç®å½Id",required=true) |
| | | // @RequestParam(name="catlogid")int catlogid, |
| | | @ApiParam(name = "resourceid", value = "èµæºId") Integer resourceid, |
| | | @ApiParam(name = "title", value = "èµæºåç§°", required = true) @RequestParam(name = "title") String title, |
| | | @ApiParam(name = "resourceclass", value = "èµæºç±»å代ç ") String resourceclass, |
| | | @ApiParam(name = "catlogcode", value = "æå±ç®å½ç¼ç ") String catlogcode, |
| | | @ApiParam(name = "publishsoft", value = "åå¸å¹³å°", required = true) @RequestParam(name = "publishsoft") String publishsoft, |
| | | @ApiParam(name = "layername", value = "åå¾å±åç§°") String layername, |
| | | @ApiParam(name = "dataloadtype", value = "å è½½æ¹å¼ï¼æé(MODE_ONDEMAND)ãå¿«ç
§(MODE_SNAPSHOT)ï¼") String dataloadtype, |
| | | @ApiParam(name = "advancequeryurl", value = "èªå®ä¹é«çº§æ¥è¯¢å°å") String advancequeryurl, |
| | | @ApiParam(name = "diyqueryurl", value = "èªå®ä¹æ¥è¯¢å表") String diyqueryurl, |
| | | @ApiParam(name = "diybubbleurl", value = "èªå®ä¹æ°æ³¡è·¯å¾") String diybubbleurl, |
| | | @ApiParam(name = "typeandurl", value = "å°çåèä¿¡æ¯", required = true) @RequestParam(name = "typeandurl") String typeandurl, |
| | | @ApiParam(name = "serverurl", value = "æå¡å°å", required = true) @RequestParam(name = "serverurl") String serverurl, |
| | | @ApiParam(name = "userid", value = "åå»ºç¨æ·ID", required = true) @RequestParam(name = "userid") Long userid) { |
| | | if (resourceid == null) |
| | | resourceid = -1; |
| | | |
| | | Res_MainInfo main = resMainInfoService.selectByPrimaryKey(resourceid); |
| | | if (main != null) { |
| | | main.setTitle(title); |
| | | main.setAbbreviation(title); |
| | | main.setResourceclass("KJ_YWTC");// ææ¶å
èµå¼0 |
| | | main.setCatlogcode("0");// ææ¶å
èµå¼0 |
| | | main.setPingyinfiirst(JpinyinUtils.changeToGetShortPinYin(title).toUpperCase()); |
| | | Timestamp time = new Timestamp(new Date().getTime()); |
| | | main.setLasteditdate(time); |
| | | resMainInfoService.updateByPrimaryKeySelective(main); |
| | | Res_ExtBusinessLayer info = resExtBusinessLayerService.selectByPrimaryKey(resourceid); |
| | | if (info != null) { |
| | | info.setPublishsoft(publishsoft); |
| | | info.setLayername(layername); |
| | | info.setAdvancequeryurl(advancequeryurl); |
| | | info.setDataloadtype(dataloadtype); |
| | | info.setDiybubbleurl(diybubbleurl); |
| | | info.setDiyqueryurl(diyqueryurl); |
| | | resExtBusinessLayerService.updateByPrimaryKeySelective(info); |
| | | } |
| | | |
| | | Res_ExtMapUrl res_extMapUrl = new Res_ExtMapUrl(); |
| | | res_extMapUrl.setResourceid(resourceid); |
| | | res_extMapUrl.setServerurl(serverurl); |
| | | res_extMapUrl.setTypeandurl(typeandurl); |
| | | resExtMapUrlService.insertSelective(res_extMapUrl); |
| | | } else { |
| | | main = new Res_MainInfo(); |
| | | main.setTitle(title); |
| | | main.setAbbreviation(title); |
| | | main.setCatlogid(0);// é»è®¤è®¾ç½®0 |
| | | main.setResourceclass("KJ_YWTC");// ææ¶å
èµå¼0 |
| | | main.setCatlogcode("0");// ææ¶å
èµå¼0 |
| | | main.setPingyinfiirst(JpinyinUtils.changeToGetShortPinYin(title).toUpperCase()); |
| | | Timestamp time = new Timestamp(new Date().getTime()); |
| | | main.setPubdate(time); |
| | | |
| | | // æ¥è¯¢åå¸äººå¯¹åºçåä½ID |
| | | OrgUnit orgUnit = orgUserService.getDefaultUnit(userid); |
| | | if(orgUnit != null) { |
| | | main.setPubunitid(orgUnit.getUnitid().intValue()); |
| | | } else { |
| | | main.setPubunitid(0); |
| | | } |
| | | |
| | | main.setCreateuserid(userid); |
| | | main.setCreatedate(time); |
| | | main.setLasteditdate(time); |
| | | |
| | | main.setSharprotocol("å®å
¨å
¬å¼"); |
| | | main.setEspproxy(0); |
| | | main.setResourcestatus(0); |
| | | main.setAuditstatus(0); |
| | | main.setDisplayby2d(0); |
| | | main.setDisplayby3d(0); |
| | | |
| | | resMainInfoService.insertSelective(main); |
| | | resourceid = resMainInfoService.queryResMainInfoIdentCurrent(); |
| | | Res_ExtBusinessLayer info = new Res_ExtBusinessLayer(); |
| | | info.setResourceid(resourceid); |
| | | info.setPublishsoft(publishsoft); |
| | | info.setLayername(layername); |
| | | info.setAdvancequeryurl(advancequeryurl); |
| | | info.setDataloadtype(dataloadtype); |
| | | info.setDiyqueryurl(diyqueryurl); |
| | | info.setDiybubbleurl(diybubbleurl); |
| | | resExtBusinessLayerService.insert(info); |
| | | |
| | | Res_ExtMapUrl res_extMapUrl = new Res_ExtMapUrl(); |
| | | res_extMapUrl.setResourceid(resourceid); |
| | | res_extMapUrl.setServerurl(serverurl); |
| | | res_extMapUrl.setTypeandurl(typeandurl); |
| | | resExtMapUrlService.insertSelective(res_extMapUrl); |
| | | } |
| | | return resourceid; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.landtool.lanbase.modules.api.controller.MapPortal; |
| | | |
| | | import java.io.IOException; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | |
| | | import com.landtool.lanbase.common.map.EsbToken; |
| | | import com.landtool.lanbase.common.utils.HttpOperateUtils; |
| | | import com.landtool.lanbase.config.SysTemPropertyConfig; |
| | | import com.landtool.lanbase.modules.org.entity.OrgUser; |
| | | import com.landtool.lanbase.modules.org.service.OrgUserService; |
| | | import com.landtool.lanbase.modules.res.entity.Res_Ext3D; |
| | | import com.landtool.lanbase.modules.res.entity.Res_ExtFileSource; |
| | | import com.landtool.lanbase.modules.res.entity.Res_ExtIntegrate; |
| | | import com.landtool.lanbase.modules.res.entity.Res_ExtInterFaceService; |
| | | import com.landtool.lanbase.modules.res.entity.Res_ExtMapUrl; |
| | | import com.landtool.lanbase.modules.res.entity.Res_ExtSpaceServer; |
| | | import com.landtool.lanbase.modules.res.entity.Res_ExtThemeMap; |
| | | import com.landtool.lanbase.modules.res.entity.Res_MainInfo; |
| | | import com.landtool.lanbase.modules.res.service.ResApplyRecommendService; |
| | | import com.landtool.lanbase.modules.res.service.ResExt3DService; |
| | | import com.landtool.lanbase.modules.res.service.ResExtFileSourceService; |
| | | import com.landtool.lanbase.modules.res.service.ResExtIntegrateService; |
| | | import com.landtool.lanbase.modules.res.service.ResExtInterFaceService; |
| | | import com.landtool.lanbase.modules.res.service.ResExtMapUrlService; |
| | | import com.landtool.lanbase.modules.res.service.ResExtSpaceServerService; |
| | | import com.landtool.lanbase.modules.res.service.ResExtThemeMapService; |
| | | import com.landtool.lanbase.modules.res.service.ResMainInfoService; |
| | | import com.landtool.lanbase.modules.sys.entity.SysSysteminfo; |
| | | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | |
| | | @Controller |
| | | @RequestMapping("/api/token/") |
| | | @Api(value = "", tags = {"Tokenæ¥å£"}) |
| | | public class TokenController { |
| | | @Autowired |
| | | private ResExtMapUrlService resExtMapUrlService; |
| | | |
| | | @Autowired |
| | | private SysTemPropertyConfig sysConfig; |
| | | |
| | | @Autowired |
| | | private ResExtThemeMapService resExtThemeMapService; |
| | | |
| | | @Autowired |
| | | private ResMainInfoService resMainInfoService; |
| | | |
| | | @Autowired |
| | | private ResApplyRecommendService resApplyRecommendService; |
| | | |
| | | @Autowired |
| | | private OrgUserService orgUserService; |
| | | |
| | | @Autowired |
| | | private ResExtInterFaceService resExtInterFaceService; |
| | | |
| | | @Autowired |
| | | private ResExtFileSourceService resExtFileSourceService; |
| | | |
| | | @Autowired |
| | | private ResExtIntegrateService resExtIntegrateService; |
| | | |
| | | @Autowired |
| | | private ResExtSpaceServerService resExtSpaceServerService; |
| | | |
| | | @Autowired |
| | | private ResExt3DService resExt3DService; |
| | | |
| | | /** |
| | | * åºç¨ç¨åºè·åToken |
| | | */ |
| | | @ResponseBody |
| | | @GetMapping(path = "appgenerate") |
| | | @ApiOperation(value = "åºç¨ç¨åºè·åèµæºToken", notes = "") |
| | | public String getAppToken(@ApiParam(name = "loginname", value = "ç»å½ç¨æ·å", required = true) @RequestParam(name = "loginname") String loginname, @ApiParam(name = "appid", value = "åºç¨ç¨åºID", required = true) @RequestParam(name = "appid") Integer appid, @ApiParam(name = "resourceid", value = "èµæºID", required = true) @RequestParam(name = "resourceid") Integer resourceid) { |
| | | String result = ""; |
| | | try { |
| | | OrgUser orgUser = orgUserService.queryByUserName(loginname);//è·åç¨æ·ä¿¡æ¯ |
| | | if (orgUser != null) { |
| | | Integer userid = orgUser.getUserid().intValue();//ç¨æ·ID |
| | | String checkAppUrl = sysConfig.getApiServer() + "/api/sys/systeminfo/getSysListByUserId/" + userid;//è·åç¨æ·æå±åºç¨ç¨åºå表å°å |
| | | List<SysSysteminfo> permsList = HttpOperateUtils.getJsonObjectArray(checkAppUrl, SysSysteminfo.class); |
| | | boolean isApp = false;//ç¨æ·æ¯å¦ä¸ºåºç¨ç¨åºè´è´£äºº |
| | | String referenceurl = "";//èµæºè°ç¨å°å |
| | | if (permsList != null && permsList.size() > 0) { |
| | | for (int i = 0; i < permsList.size(); i++) { |
| | | if (permsList.get(i).getAppid().intValue() == appid) { |
| | | isApp = true; |
| | | referenceurl = permsList.get(i).getReferenceurl(); |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | if (isApp) { |
| | | Map<String, Object> map = new HashMap<String, Object>(); |
| | | map.put("sysid", appid); |
| | | map.put("resourceid", resourceid); |
| | | Res_MainInfo resMainInfo = resMainInfoService.selectByPrimaryKey(resourceid);//è·åèµæºä¸»è¡¨ä¿¡æ¯ |
| | | if (resMainInfo != null) { |
| | | int num = resApplyRecommendService.checkAppZiYuan(map);//è·ååºç¨ç¨åºç³è¯·å®¡æ ¸éè¿èµæºæ°é |
| | | if (num > 0 || resMainInfo.getSharprotocol().equals("å®å
¨å
¬å¼")) { |
| | | if (referenceurl != null && !referenceurl.isEmpty()) { |
| | | String subzyids = ""; |
| | | String serverUrl = "null"; |
| | | //æ¥è¯¢æ¯å¦æ¯ä¸é¢å°å¾ï¼æ¯ä¸é¢å°å¾åè·åç¸å
³åå¾å±ID |
| | | if (resMainInfo.getResourceclass().equals("KJ_ZTDT")) { |
| | | Res_ExtThemeMap resExtThemeMap = resExtThemeMapService.selectByPrimaryKey(resourceid); |
| | | if (resExtThemeMap != null) { |
| | | subzyids = resExtThemeMap.getSublayerset(); |
| | | } |
| | | } |
| | | Res_ExtMapUrl resExtMapUrl = resExtMapUrlService.queryFirstOrderByResId(resourceid); |
| | | if (resExtMapUrl != null) { |
| | | serverUrl = (resExtMapUrl.getServerurl() == null || resExtMapUrl.getServerurl().isEmpty()) ? "null" : "\"" + resExtMapUrl.getServerurl() + "\""; |
| | | } else { |
| | | if (resMainInfo.getResourceclass().equals("JKFW")) { |
| | | Res_ExtInterFaceService res_extInterFaceService = resExtInterFaceService.selectByPrimaryKey(resourceid); |
| | | if (res_extInterFaceService != null) { |
| | | serverUrl = res_extInterFaceService.getServerurl() == null ? "null" : "\"" + res_extInterFaceService.getServerurl() + "\""; |
| | | } |
| | | } |
| | | if (resMainInfo.getResourceclass().equals("SJWJ")) { |
| | | Res_ExtFileSource resExtFileSource = resExtFileSourceService.selectByPrimaryKey(resourceid); |
| | | if (resExtFileSource != null) { |
| | | serverUrl = resExtFileSource.getServerurl() == null ? "null" : "\"" + resExtFileSource.getServerurl() + "\""; |
| | | } |
| | | } |
| | | if (resMainInfo.getResourceclass().equals("YWJC")) { |
| | | Res_ExtIntegrate resExtIntegrate = resExtIntegrateService.selectByPrimaryKey(resourceid); |
| | | if (resExtIntegrate != null) { |
| | | serverUrl = resExtIntegrate.getServerurl() == null ? "null" : "\"" + resExtIntegrate.getServerurl() + "\""; |
| | | } |
| | | } |
| | | if (resMainInfo.getResourceclass().equals("KJ_KJFX")) { |
| | | Res_ExtSpaceServer resExtSpaceServer = resExtSpaceServerService.selectByPrimaryKey(resourceid); |
| | | if (resExtSpaceServer != null) { |
| | | serverUrl = resExtSpaceServer.getServerurl() == null ? "null" : "\"" + resExtSpaceServer.getServerurl() + "\""; |
| | | } |
| | | } |
| | | // æ·»å ä¸ç»´å°å½¢åä¸ç»´å½±å add 2019/08/01 |
| | | if (resMainInfo.getResourceclass().equals("KJ_SWMX") || resMainInfo.getResourceclass().equals("KJ_SWDX") || resMainInfo.getResourceclass().equals("KJ_SWYX")) { |
| | | Res_Ext3D resExt3D = resExt3DService.selectByPrimaryKey(resourceid); |
| | | if (resExt3D != null) { |
| | | serverUrl = resExt3D.getServerurl() == null ? "null" : "\"" + resExt3D.getServerurl() + "\""; |
| | | } |
| | | } |
| | | } |
| | | String token = EsbToken.getAppEsbToken(userid, appid, referenceurl, resourceid, resMainInfo.getEspproxy(), sysConfig, subzyids, resMainInfo.getToken()); |
| | | result = "{ \"success\": true, \"serverUrl\": " + serverUrl + ", \"token\": " + (token.isEmpty() ? "null" : "\"" + token + "\"") + "}"; |
| | | |
| | | } else { |
| | | result = "{ \"success\": false, \"msg\": \"åºç¨ç¨åºèµæºå¼ç¨å°åæªé
ç½®ï¼\" }"; |
| | | } |
| | | } else { |
| | | result = "{ \"success\": false, \"msg\": \"åºç¨ç¨åºæ²¡æèµæºæéï¼\" }"; |
| | | } |
| | | } else { |
| | | result = "{ \"success\": false, \"msg\": \"èµæºä¸åå¨ï¼\" }"; |
| | | } |
| | | } else { |
| | | result = "{ \"success\": false, \"msg\": \"ç¨æ·ä¸æ¯åºç¨ç¨åºç³»ç»è´è´£äººï¼\" }"; |
| | | } |
| | | } else { |
| | | result = "{ \"success\": false, \"msg\": \"ç¨æ·ä¸åå¨ï¼\" }"; |
| | | } |
| | | } catch (IOException e) { |
| | | result = "{ \"success\": false, \"msg\": \"" + e.getMessage() + "\" }"; |
| | | } |
| | | |
| | | return result; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.landtool.lanbase.modules.api.controller.MapPortal; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.HashMap; |
| | | import java.util.LinkedList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.serializer.SerializerFeature; |
| | | import com.github.pagehelper.Page; |
| | | import com.github.pagehelper.PageHelper; |
| | | import com.landtool.lanbase.modules.api.utils.PageBean; |
| | | import com.landtool.lanbase.modules.res.entity.Res_MainInfo; |
| | | import com.landtool.lanbase.modules.res.entity.Res_QueryAround; |
| | | import com.landtool.lanbase.modules.res.service.ResMainInfoService; |
| | | import com.landtool.lanbase.modules.res.service.ResQueryAroundService; |
| | | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | |
| | | @Controller |
| | | @RequestMapping("api") |
| | | @Api(value = "", tags = {"æ°æ³¡å¨è¾¹æ¥è¯¢"}) |
| | | /** |
| | | * æ°æ³¡ââå¨è¾¹æ¥è¯¢ |
| | | */ |
| | | public class ZhouBianChaXunController { |
| | | @Autowired |
| | | private ResQueryAroundService resQueryAroundService; |
| | | |
| | | @Autowired |
| | | private ResMainInfoService resMainInfoService; |
| | | |
| | | /** |
| | | * å½åç¨æ·èªå®ä¹å¨è¾¹æ¥è¯¢çå
³èèµæºå表 |
| | | * @param res_queryAround |
| | | * @param pageBean |
| | | * @return |
| | | */ |
| | | @GetMapping("map/zhoubianchaxun") |
| | | @ResponseBody |
| | | @ApiOperation(value = "å½åç¨æ·èªå®ä¹å¨è¾¹æ¥è¯¢çå
³èèµæºå表", notes = "") |
| | | public String getZhouBianChaXun(Res_QueryAround res_queryAround, PageBean pageBean) { |
| | | Page<Res_MainInfo> page = PageHelper.startPage(pageBean.getPage(), pageBean.getLimit()); |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
| | | List<Res_QueryAround> list = resQueryAroundService.getZhouBianChaXunList(res_queryAround); |
| | | int countNums = (int) ((Page) list).getTotal(); |
| | | PageBean<Res_QueryAround> pageData = new PageBean<>(pageBean.getPage(), pageBean.getLimit(), countNums); |
| | | pageData.setItems(list); |
| | | if (list.size() == 0) { |
| | | res_queryAround.setAdduserid(0); |
| | | list = resQueryAroundService.getZhouBianChaXunList(res_queryAround); |
| | | } |
| | | Map<String, Object> result = new HashMap<>(); |
| | | result.put("totalCount", countNums); |
| | | List<Map<String, Object>> maps = new LinkedList<>(); |
| | | for (Integer i = 0; i < list.size(); i++) { |
| | | Res_MainInfo resMainInfo = resMainInfoService.selectByPrimaryKey(list.get(i).getAroundresid()); |
| | | |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("queryid", list.get(i).getQueryid()); |
| | | map.put("resourceid", resMainInfo.getResourceid()); |
| | | map.put("title", resMainInfo.getTitle()); |
| | | map.put("resourceclass", resMainInfo.getResourceclass()); |
| | | map.put("pubdate", sdf.format(resMainInfo.getPubdate())); |
| | | map.put("datasources", resMainInfo.getDatasources()); |
| | | maps.add(map); |
| | | } |
| | | result.put("topics", maps); |
| | | |
| | | return JSON.toJSONString(result, SerializerFeature.WriteMapNullValue); |
| | | } |
| | | |
| | | /** |
| | | * ç¨æ·æ·»å å¨è¾¹æ¥è¯¢çå
³èéæ©å表 |
| | | * @param resMainInfo |
| | | * @param pageBean |
| | | * @return |
| | | */ |
| | | @GetMapping("map/maininfoList") |
| | | @ResponseBody |
| | | @ApiOperation(value = "ç¨æ·æ·»å å¨è¾¹æ¥è¯¢çå
³èéæ©å表", notes = "") |
| | | public String getMainInfoList(Res_MainInfo resMainInfo, PageBean pageBean) { |
| | | Page<Res_MainInfo> page = PageHelper.startPage(pageBean.getPage(), pageBean.getLimit()); |
| | | resMainInfo.setResourceclass("KJ_YWTC"); |
| | | List<Res_MainInfo> list = resMainInfoService.selectTiTle(resMainInfo); |
| | | int countNums = (int) ((Page) list).getTotal(); |
| | | PageBean<Res_MainInfo> pageData = new PageBean<>(pageBean.getPage(), pageBean.getLimit(), countNums); |
| | | pageData.setItems(list); |
| | | Map<String, Object> result = new HashMap<>(); |
| | | result.put("totalCount", countNums); |
| | | List<Map<String, Object>> maps = new LinkedList<>(); |
| | | for (Integer i = 0; i < list.size(); i++) { |
| | | String title = list.get(i).getTitle(); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("resourceid", list.get(i).getResourceid()); |
| | | map.put("title", title); |
| | | map.put("resourceclass", list.get(i).getResourceclass()); |
| | | map.put("pubdate", list.get(i).getPubdate()); |
| | | map.put("datasources", list.get(i).getDatasources()); |
| | | maps.add(map); |
| | | } |
| | | result.put("topics", maps); |
| | | |
| | | return JSON.toJSONString(result, SerializerFeature.WriteMapNullValue); |
| | | } |
| | | |
| | | /** |
| | | * å é¤å½åç¨æ·å
³èçå¨è¾¹æ¥è¯¢èµæºä¿¡æ¯ |
| | | * @param queryid |
| | | * @return |
| | | */ |
| | | @GetMapping("map/zhoubianGuanlianDel") |
| | | @ResponseBody |
| | | @ApiOperation(value = "å é¤å½åç¨æ·å
³èçå¨è¾¹æ¥è¯¢èµæºä¿¡æ¯", notes = "") |
| | | public String delGuanlian(Integer queryid) { |
| | | Integer t = resQueryAroundService.deleteByPrimaryKey(queryid); |
| | | return t.toString(); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.landtool.lanbase.modules.api.controller.MapPortal; |
| | | |
| | | import java.net.URLDecoder; |
| | | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | |
| | | import com.landtool.lanbase.modules.log.service.LogActionService; |
| | | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | |
| | | @RequestMapping("api/logAction") |
| | | @Controller |
| | | @Api(value = "", tags = {"æ¥å¿æä½"}) |
| | | public class logActionController { |
| | | @Autowired |
| | | private LogActionService logActionService; |
| | | |
| | | // å·²ä½åº |
| | | @ResponseBody |
| | | @PostMapping("addLog") |
| | | @ApiOperation(value = "æ·»å æä½æ¥å¿", notes = "") |
| | | public void logAction(String log,String userid) { |
| | | log = URLDecoder.decode(log); |
| | | String logMessage = log + "," + userid; |
| | | logActionService.saveLogAction(logMessage); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.landtool.lanbase.modules.api.controller; |
| | | |
| | | import java.io.BufferedWriter; |
| | | import java.io.File; |
| | | import java.io.FileWriter; |
| | | import java.net.URLDecoder; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.landtool.lanbase.common.utils.HttpUtils; |
| | | import com.landtool.lanbase.modules.res.service.impl.ResApplyRecommendServiceImpl; |
| | | import com.landtool.lanbase.modules.sys.controller.AbstractController; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.landtool.lanbase.common.utils.HttpOperateUtils; |
| | | import com.landtool.lanbase.common.utils.Result; |
| | | import com.landtool.lanbase.config.SysTemPropertyConfig; |
| | | import com.landtool.lanbase.modules.org.service.OrgUserService; |
| | | import com.landtool.lanbase.modules.res.entity.Res_Ext3D; |
| | | import com.landtool.lanbase.modules.res.entity.Res_ExtBaseMap; |
| | | import com.landtool.lanbase.modules.res.entity.Res_ExtBusinessLayer; |
| | | import com.landtool.lanbase.modules.res.entity.Res_ExtDataBase; |
| | | import com.landtool.lanbase.modules.res.entity.Res_ExtDataSource; |
| | | import com.landtool.lanbase.modules.res.entity.Res_ExtFileSource; |
| | | import com.landtool.lanbase.modules.res.entity.Res_ExtIntegrate; |
| | | import com.landtool.lanbase.modules.res.entity.Res_ExtInterFaceService; |
| | | import com.landtool.lanbase.modules.res.entity.Res_ExtSpaceServerWithBLOBs; |
| | | import com.landtool.lanbase.modules.res.entity.Res_ExtThemeMap; |
| | | import com.landtool.lanbase.modules.res.entity.Res_MainInfo; |
| | | import com.landtool.lanbase.modules.res.service.ResActionRecordService; |
| | | import com.landtool.lanbase.modules.res.service.ResBusinessRefService; |
| | | import com.landtool.lanbase.modules.res.service.ResCatalogService; |
| | | import com.landtool.lanbase.modules.res.service.ResDiyLayerInfoService; |
| | | import com.landtool.lanbase.modules.res.service.ResExt3DService; |
| | | import com.landtool.lanbase.modules.res.service.ResExtAppService; |
| | | import com.landtool.lanbase.modules.res.service.ResExtBaseMapService; |
| | | import com.landtool.lanbase.modules.res.service.ResExtBusinessLayerService; |
| | | import com.landtool.lanbase.modules.res.service.ResExtDataBaseService; |
| | | import com.landtool.lanbase.modules.res.service.ResExtDataSourceService; |
| | | import com.landtool.lanbase.modules.res.service.ResExtFileSourceService; |
| | | import com.landtool.lanbase.modules.res.service.ResExtIntegrateService; |
| | | import com.landtool.lanbase.modules.res.service.ResExtInterFaceService; |
| | | import com.landtool.lanbase.modules.res.service.ResExtMapUrlService; |
| | | import com.landtool.lanbase.modules.res.service.ResExtSpaceServerService; |
| | | import com.landtool.lanbase.modules.res.service.ResExtThemeMapService; |
| | | import com.landtool.lanbase.modules.res.service.ResMainInfoService; |
| | | import com.landtool.lanbase.modules.res.service.ResQueryAroundService; |
| | | |
| | | import cn.hutool.core.date.DateTime; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | |
| | | import javax.security.auth.Subject; |
| | | |
| | | @Controller |
| | | @RequestMapping("/api/") |
| | | @Api(value = "", tags = { "èµæºç¸å
³æ¥å£" }) |
| | | public class ResApiController extends AbstractController { |
| | | @Autowired |
| | | private ResCatalogService resCatalogService; |
| | | @Autowired |
| | | private ResMainInfoService resMainInfoService; |
| | | @Autowired |
| | | private ResActionRecordService resActionRecordService; |
| | | @Autowired |
| | | private ResExtBaseMapService resExtBaseMapService; |
| | | @Autowired |
| | | private ResExtBusinessLayerService resExtBusinessLayerService; |
| | | @Autowired |
| | | private ResExtSpaceServerService resExtSpaceServerService; |
| | | @Autowired |
| | | private ResExtThemeMapService resExtThemeMapService; |
| | | @Autowired |
| | | private ResExtAppService resExtAppService; |
| | | @Autowired |
| | | private ResExtIntegrateService resExtIntegrateService; |
| | | @Autowired |
| | | private ResExtFileSourceService resExtFileSourceService; |
| | | @Autowired |
| | | private ResExtDataBaseService resExtDataBaseService; |
| | | @Autowired |
| | | private ResExtInterFaceService resExtInterFaceService; |
| | | @Autowired |
| | | private ResExt3DService resExt3DService; |
| | | @Autowired |
| | | private ResDiyLayerInfoService resDiyLayerInfoService; |
| | | @Autowired |
| | | private ResExtMapUrlService resExtMapUrlService; |
| | | @Autowired |
| | | private ResBusinessRefService resBusinessRefService; |
| | | @Autowired |
| | | private ResQueryAroundService resQueryAroundService; |
| | | @Autowired |
| | | private OrgUserService orgUserService; |
| | | @Autowired |
| | | private SysTemPropertyConfig sysConfig; |
| | | |
| | | @Autowired |
| | | private ResExtDataSourceService resExtDataSourceService; |
| | | |
| | | @Autowired |
| | | private ResApplyRecommendServiceImpl resApplyRecommendService; |
| | | |
| | | // /** |
| | | // * @param parentCatalogId |
| | | // * @Description: è·åç®å½æ ä¿¡æ¯ {@link ResCatalogService} |
| | | // * @Author: xiaoxuan.xie |
| | | // * @Date: 17:30 2018/3/15 |
| | | // * @return: String |
| | | // * @see Res_Catalog |
| | | // */ |
| | | // @ResponseBody |
| | | // @GetMapping(path = "catalog/getTreeByParentID/{parentCatalogId}") |
| | | // @ApiOperation(value = "è·åç®å½æ ä¿¡æ¯", notes = "") |
| | | // public String getTreeByParentID( |
| | | // @ApiParam(name = "parentCatalogId", value = "ç®å½ç¶èç¹Id", required = true) @PathVariable(name = "parentCatalogId") int parentCatalogId) { |
| | | // String resCatalogTreeJson = getTreeChildrenNodeList(parentCatalogId);// éå½è·åç®å½åèç¹å表 |
| | | // return "[" + resCatalogTreeJson + "]"; |
| | | // } |
| | | // |
| | | // /** |
| | | // * @param parentCatalogId |
| | | // * @Description: éå½è·åç®å½åèç¹å表 {@link ResCatalogService} |
| | | // * @Author: xiaoxuan.xie |
| | | // * @Date: 17:30 2018/3/15 |
| | | // * @return: String |
| | | // */ |
| | | // private String getTreeChildrenNodeList(int parentCatalogId) { |
| | | // String resCatalogTreeJson = "";// å®ä¹ç®å½æ Jsonå符串åå¨å¯¹è±¡ |
| | | // List<Res_Catalog> res_catalogList = resCatalogService.selectResCatalogToParentid(parentCatalogId);// æ ¹æ®ç®å½ç¶Idè·ååç®å½å表 |
| | | // SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");// å®ä¾åæ¶é´æ ¼å¼è½¬æ¢å¨ |
| | | // // å¾ªç¯æé ç®å½æ ç»æJson |
| | | // for (Res_Catalog resCatalog : res_catalogList) { |
| | | // if (resCatalogTreeJson != "") |
| | | // resCatalogTreeJson += ","; |
| | | // resCatalogTreeJson += "{'catlogid':" + resCatalog.getCatlogid(); |
| | | // resCatalogTreeJson += ",'catlogcode':'" + resCatalog.getCatlogcode() + "'"; |
| | | // resCatalogTreeJson += ",'parentid':" + resCatalog.getParentid(); |
| | | // resCatalogTreeJson += ",'title':'" + resCatalog.getTitle() + "'"; |
| | | // resCatalogTreeJson += ",'pingyinfiirst':'" + resCatalog.getPingyinfiirst() + "'"; |
| | | // resCatalogTreeJson += ",'description':'" + resCatalog.getDescription() + "'"; |
| | | // resCatalogTreeJson += ",'imgurl':'" + resCatalog.getImgurl() + "'"; |
| | | // resCatalogTreeJson += ",'orderid':" + resCatalog.getOrderid(); |
| | | // resCatalogTreeJson += ",'createuser':'" + resCatalog.getCreateuser() + "'"; |
| | | // resCatalogTreeJson += ",'createdate':'" + sdf.format(resCatalog.getCreatedate()) + "'"; |
| | | // resCatalogTreeJson += ",'remark':'" + resCatalog.getRemark() + "'"; |
| | | // resCatalogTreeJson += ",'childnodes':["; |
| | | // String resCatalogChildNode = getTreeChildrenNodeList(resCatalog.getCatlogid());// éå½è·åç®å½åèç¹å表 |
| | | // if (resCatalogChildNode != "") { |
| | | // resCatalogTreeJson += resCatalogChildNode; |
| | | // } |
| | | // resCatalogTreeJson += "]}"; |
| | | // } |
| | | // |
| | | // return resCatalogTreeJson; |
| | | // } |
| | | // |
| | | // /** |
| | | // * @param parentCatalogId |
| | | // * @Description: è·ååç®å½ä¿¡æ¯å表{@link ResCatalogService} |
| | | // * @Author: xiaoxuan.xie |
| | | // * @Date: 17:30 2018/3/15 |
| | | // * @return: List<Res_Catalog> |
| | | // * @see Res_Catalog |
| | | // */ |
| | | // @ResponseBody |
| | | // @GetMapping(path = "catalog/getListByParentID/{parentCatalogId}") |
| | | // @ApiOperation(value = "è·ååç®å½ä¿¡æ¯å表", notes = "") |
| | | // public List<Res_Catalog> getListByParentID( |
| | | // @ApiParam(name = "parentCatalogId", value = "ç®å½ç¶èç¹Id", required = true) @PathVariable(name = "parentCatalogId") int parentCatalogId) { |
| | | // return resCatalogService.selectResCatalogToParentid(parentCatalogId); |
| | | // } |
| | | // |
| | | // /** |
| | | // * @param catalogId |
| | | // * @Description: æ¥è¯¢ç®å½ä¿¡æ¯{@link ResCatalogService} |
| | | // * @Author: xiaoxuan.xie |
| | | // * @Date: 09:30 2018/3/16 |
| | | // * @return: Res_Catalog |
| | | // * @see Res_Catalog |
| | | // */ |
| | | // @ResponseBody |
| | | // @GetMapping(path = "catalog/getById/{catalogId}") |
| | | // @ApiOperation(value = "æ¥è¯¢ç®å½ä¿¡æ¯", notes = "") |
| | | // public Res_Catalog getById( |
| | | // @ApiParam(name = "catalogId", value = "ç®å½Id", required = true) @PathVariable(name = "catalogId") int catalogId) { |
| | | // return resCatalogService.getResCatalogInfoById(catalogId); |
| | | // } |
| | | // |
| | | // /** |
| | | // * @param serverId |
| | | // * @Description: æ¥è¯¢æå¡åºæ¬ä¿¡æ¯{@link ResMainInfoService} |
| | | // * @Author: xiaoxuan.xie |
| | | // * @Date: 09:30 2018/3/16 |
| | | // * @return: String |
| | | // * @see Res_MainInfo |
| | | // */ |
| | | // @ResponseBody |
| | | // @GetMapping(path = "Server/getBaseInfoById/{serverId}") |
| | | // @ApiOperation(value = "æ¥è¯¢æå¡åºæ¬ä¿¡æ¯", notes = "") |
| | | // public String getBaseInfoById( |
| | | // @ApiParam(name = "serverId", value = "æå¡Id", required = true) @PathVariable(name = "serverId") int serverId) { |
| | | // String BaseInfoJson = "";// å®ä¹è¿åJsonåå¨å¯¹è±¡ |
| | | // Res_MainInfo resMainInfo = resMainInfoService.selectByPrimaryKey(serverId);// è·åèµæºåºæ¬ä¿¡æ¯ |
| | | // BaseInfoJson = JSONObject.toJSONStringWithDateFormat(resMainInfo, "YYYY-MM-dd HH:mm:ss"); |
| | | // BaseInfoJson = BaseInfoJson.substring(0, BaseInfoJson.length() - 1); |
| | | // BaseInfoJson += ",resExtInfo:" + getResExtInfo(serverId, resMainInfo.getResourceclass()) + "}"; |
| | | // |
| | | // return BaseInfoJson; |
| | | // } |
| | | // |
| | | // /** |
| | | // * @param resourceid |
| | | // * @param userid |
| | | // * @param actiontype |
| | | // * @param appid |
| | | // * @Description: æ¥å¿æ°æ®åå
¥ {@link ResActionRecordService} |
| | | // * @Author: xiaoxuan.xie |
| | | // * @Date: 13:30 2018/3/28 |
| | | // * @return: Model |
| | | // * @see Res_ActionRecord |
| | | // */ |
| | | // @ResponseBody |
| | | // @GetMapping(path = "/setActionRecordInfo") |
| | | // @ApiOperation(value = "æ¥å¿ä¿¡æ¯åå
¥", notes = "") |
| | | // public String setActionRecordInfo(Integer resourceid, Long userid, String actiontype, Integer appid) { |
| | | // Timestamp audittime = new Timestamp(new Date().getTime());// è·åå½åæ¶é´ |
| | | // int row = 0;// æä½æ°æ®åºè®°å½æ° |
| | | // |
| | | // boolean success = false;// æä½ç¶æ |
| | | // String msg = "";// æä½è¿åæ¶æ¯ |
| | | // Res_ActionRecord resRecord = new Res_ActionRecord(); |
| | | // resRecord.setResourceid(resourceid); |
| | | // resRecord.setUserid(userid); |
| | | // resRecord.setActiontype(actiontype); |
| | | // Res_ActionRecord res_actionRecord = resActionRecordService.getUserActionRecord(resRecord); |
| | | // if (res_actionRecord == null) { |
| | | // resRecord.setActiontype(actiontype); |
| | | // resRecord.setActiontime(audittime); |
| | | // resRecord.setAppid(appid); |
| | | // row = resActionRecordService.insertSelective(resRecord); |
| | | // success = true; |
| | | // msg = "åå
¥æåï¼"; |
| | | // } else { |
| | | // res_actionRecord.setAppid(appid); |
| | | // res_actionRecord.setActiontime(audittime); |
| | | // row = resActionRecordService.updateByPrimaryKeySelective(res_actionRecord); |
| | | // success = true; |
| | | // msg = "æ´æ°æ¶èï¼"; |
| | | // } |
| | | // return "{success:" + success + ", msg:'" + msg + "'}"; |
| | | // } |
| | | |
| | | /** |
| | | * @Description: æ¥è¯¢æå¡å表{@link ResMainInfoService} //change ykm |
| | | * @Author: xiaoxuan.xie |
| | | * @Date: 09:30 2018/3/16 |
| | | * @return: String |
| | | * @see Res_MainInfo |
| | | */ |
| | | @ResponseBody |
| | | @GetMapping(path = "Server/getServerList") |
| | | @ApiOperation(value = "æ¥è¯¢æå¡å表", notes = "") |
| | | public String getServerList(@ApiParam(name = "catalogid", value = "ç®å½ID") @RequestParam(name = "catalogid", required = false) Integer catalogid, |
| | | @ApiParam(name = "resourceclass", value = "èµæºç±»å") @RequestParam(name = "resourceclass", required = false) String resourceclass, |
| | | @ApiParam(name = "resourceid", value = "èµæºID") @RequestParam(name = "resourceid", required = false) Integer resourceid ) { |
| | | String BaseInfoListJson = "";// å®ä¹è¿åJsonåå¨å¯¹è±¡ |
| | | Map<String,Object> map = new HashMap<String,Object>(); |
| | | map.put("catalogid",catalogid); |
| | | map.put("resourceclass",resourceclass); |
| | | map.put("resourceid",resourceid); |
| | | |
| | | // List<Res_MainInfo> resMainInfoList = resMainInfoService.getAll();// è·åææèµæºä¿¡æ¯ |
| | | List<Res_MainInfo> resMainInfoList = resMainInfoService.getListByMap(map);// è·åææèµæºä¿¡æ¯ |
| | | |
| | | |
| | | for (Res_MainInfo resMainInfo : resMainInfoList) { |
| | | String BaseInfoJson = ""; |
| | | BaseInfoJson = JSONObject.toJSONStringWithDateFormat(resMainInfo, "YYYY-MM-dd HH:mm:ss"); |
| | | JSONObject obj = JSONObject.parseObject(BaseInfoJson); |
| | | Map m = obj; |
| | | m.remove("remark"); |
| | | BaseInfoJson = m.toString(); |
| | | BaseInfoJson = BaseInfoJson.substring(0, BaseInfoJson.length() - 1); |
| | | BaseInfoJson += ",resExtInfo:" + getResExtInfo(resMainInfo.getResourceid(), resMainInfo.getResourceclass()) |
| | | + "}"; |
| | | if (!BaseInfoListJson.isEmpty()) |
| | | BaseInfoListJson += ","; |
| | | BaseInfoListJson += BaseInfoJson; |
| | | } |
| | | BaseInfoListJson = htmlDecodeByRegExp(BaseInfoListJson); |
| | | BaseInfoListJson = URLDecoder.decode(BaseInfoListJson.replaceAll("%","%25")); |
| | | // } |
| | | return "[" + BaseInfoListJson + "]"; |
| | | } |
| | | |
| | | /** |
| | | * @param Resourceid |
| | | * @param leixing |
| | | * @return String |
| | | * @Description: è·åèµæºæå±ä¿¡æ¯ |
| | | */ |
| | | private String getResExtInfo(int Resourceid, String leixing) { |
| | | String ResExtInfo = ""; |
| | | String ResourceType = leixing; |
| | | if (ResourceType == null) |
| | | ResourceType = ""; |
| | | // æ ¹æ®èµæºç±»åè·åèµæºæå±ä¿¡æ¯ |
| | | //alert ykm 2019/02/26 |
| | | if(ResourceType.equals("KJ_SWMX") || ResourceType.equals("KJ_SWDX") || ResourceType.equals("KJ_SWYX")) ResourceType = "KJ_SW"; |
| | | switch (ResourceType) { |
| | | case "KJ_JCDT":// åºç¡åºå¾ |
| | | Res_ExtBaseMap resExtBaseMap = resExtBaseMapService.selectByPrimaryKey(Resourceid);// è·ååºç¡åºå¾ä¿¡æ¯ |
| | | ResExtInfo = JSONObject.toJSONString(resExtBaseMap); |
| | | break; |
| | | case "KJ_YWTC":// ä¸å¡å¾å± |
| | | Res_ExtBusinessLayer resExtBusinessLayer = resExtBusinessLayerService.selectByPrimaryKey(Resourceid);// è·åä¸å¡å¾å±ä¿¡æ¯ |
| | | if(resExtBusinessLayer != null && resExtBusinessLayer.getServiceHTML() != null) { |
| | | resExtBusinessLayer.setServiceHTML(htmlDecodeByRegExp(resExtBusinessLayer.getServiceHTML())); |
| | | } |
| | | ResExtInfo = JSONObject.toJSONString(resExtBusinessLayer); |
| | | break; |
| | | case "KJ_KJFX":// 空é´åæ |
| | | Res_ExtSpaceServerWithBLOBs resExtSpaceServerWithBLOBs = resExtSpaceServerService |
| | | .selectByPrimaryKey(Resourceid);// è·åç©ºé´æå¡ä¿¡æ¯ |
| | | if(resExtSpaceServerWithBLOBs != null && resExtSpaceServerWithBLOBs.getHelpurl() != null){ |
| | | resExtSpaceServerWithBLOBs.setHelpurl(htmlDecodeByRegExp(resExtSpaceServerWithBLOBs.getHelpurl())); |
| | | } |
| | | ResExtInfo += JSONObject.toJSONString(resExtSpaceServerWithBLOBs); |
| | | break; |
| | | case "KJ_ZTDT":// ä¸é¢å°å¾ |
| | | Res_ExtThemeMap resExtThemeMap = resExtThemeMapService.selectByPrimaryKey(Resourceid);// è·åä¸é¢å°å¾ä¿¡æ¯ |
| | | ResExtInfo += JSONObject.toJSONString(resExtThemeMap); |
| | | break; |
| | | case "YWJC":// ä¸å¡éæ |
| | | Res_ExtIntegrate resExtIntegrate = resExtIntegrateService.selectByPrimaryKey(Resourceid);// è·åä¸å¡éæä¿¡æ¯ |
| | | ResExtInfo += JSONObject.toJSONString(resExtIntegrate); |
| | | break; |
| | | case "SJWJ":// ææ¡£æ°æ® |
| | | Res_ExtFileSource resExtFileSource = resExtFileSourceService.selectByPrimaryKey(Resourceid);// è·åææ¡£æ°æ®ä¿¡æ¯ |
| | | ResExtInfo += JSONObject.toJSONString(resExtFileSource); |
| | | break; |
| | | case "SJKB":// æ°æ®åºè¡¨ |
| | | Res_ExtDataBase res_extDataBase = resExtDataBaseService.selectByMainInfoId(Resourceid); |
| | | if(res_extDataBase!=null && res_extDataBase.getDatasourceid() != null) { |
| | | Res_ExtDataSource resExtDataSource = resExtDataSourceService.selectByPrimaryKey(res_extDataBase.getDatasourceid()); //add ykm |
| | | JSONObject obj = JSONObject.parseObject(JSONObject.toJSONStringWithDateFormat(res_extDataBase,"YYYY-MM-dd HH:mm:ss")); |
| | | obj.put("DataSourceInfo", JSONObject.parseObject(JSONObject.toJSONStringWithDateFormat(resExtDataSource,"YYYY-MM-dd HH:mm:ss"))); |
| | | ResExtInfo += obj.toJSONString(); |
| | | } |
| | | else { |
| | | ResExtInfo += JSONObject.toJSONString(res_extDataBase); |
| | | } |
| | | break; |
| | | case "JKFW":// æ¥å£æå¡ |
| | | Res_ExtInterFaceService res_extInterFaceService = resExtInterFaceService.selectByPrimaryKey(Resourceid); |
| | | if(res_extInterFaceService != null && res_extInterFaceService.getHelpurl() != null) { |
| | | res_extInterFaceService.setHelpurl(htmlDecodeByRegExp(res_extInterFaceService.getHelpurl())); |
| | | } |
| | | ResExtInfo += JSONObject.toJSONString(res_extInterFaceService); |
| | | break; |
| | | // case "KJ_SWMX":// ä¸ç»´æ¨¡å |
| | | case "KJ_SW":// ä¸ç»´ç±»åï¼ä¸ç»´æ¨¡åï¼ä¸ç»´å°å½¢ï¼ä¸ç»´å½±å |
| | | Res_Ext3D res_ext3D = resExt3DService.selectByPrimaryKey(Resourceid); |
| | | ResExtInfo += JSONObject.toJSONString(res_ext3D); |
| | | break; |
| | | default: |
| | | ResExtInfo += "{}"; |
| | | break; |
| | | } |
| | | |
| | | return ResExtInfo; |
| | | } |
| | | |
| | | public String htmlDecodeByRegExp(String str){ |
| | | String s = ""; |
| | | if(str.equals("")) return ""; |
| | | s = str.replace("&","&"); |
| | | s = s.replace("<","<"); |
| | | s = s.replace(">",">"); |
| | | s = s.replace(" "," "); |
| | | s = s.replace("'","\'"); |
| | | s = s.replace(""","\""); |
| | | s = s.replace("\\",""); |
| | | return s; |
| | | } |
| | | |
| | | // /** |
| | | // * @Description: è·åèµæºæå¡å°åä¿¡æ¯ |
| | | // * @Author: xiaoxuan.xie |
| | | // * @Date: 09:30 2018/3/31 |
| | | // * @return: String |
| | | // * @see Res_MainInfo |
| | | // */ |
| | | // @ResponseBody |
| | | // @GetMapping(path = "Server/getLayerObject/{resourceid}/{userid}") |
| | | // @ApiOperation(value = "è·åèµæºæå¡å°åä¿¡æ¯", notes = "") |
| | | // public String GetLayerObject( |
| | | // @ApiParam(name = "resourceid", value = "èµæºId", required = true) @PathVariable(name = "resourceid") int resourceid, |
| | | // @ApiParam(name = "userid", value = "ç¨æ·Id", required = true) @PathVariable(name = "userid") Integer userid, |
| | | // HttpServletRequest request) { |
| | | // String Json = ""; |
| | | // if (resourceid > 0) { |
| | | // Res_MainInfo resMainInfo = resMainInfoService.selectByPrimaryKey(resourceid);// è·åèµæºä¸»è¡¨ä¿¡æ¯ |
| | | // if (resMainInfo != null) { |
| | | // String resourceType = resMainInfo.getResourceclass();// è·åèµæºç±»å |
| | | // if (resourceType == null) |
| | | // resourceType = ""; |
| | | // LayerObject layer = null; |
| | | // switch (resourceType) { |
| | | // case "KJ_YWTC": |
| | | // case "KJ_JCDT": |
| | | // String username = request.getRemoteUser(); |
| | | // Boolean GuanLian = false;//ä¸å¡å
³è |
| | | // Boolean ZhouBian = false;//å¨è¾¹æ¥è¯¢ |
| | | // if(resourceType.equals("KJ_YWTC")) { |
| | | // Res_BusinessRef res_businessRef = new Res_BusinessRef(); |
| | | // res_businessRef.setResourceid(resourceid); |
| | | // List<Res_BusinessRef> resBusinessRefList = resBusinessRefService.selectResBusinesssRef(res_businessRef);//è·åä¸å¡å¾å±å
³èåæä¿¡æ¯ |
| | | // if(resBusinessRefList.size() > 0) GuanLian = true; |
| | | // List<Res_QueryAround> resQueryAroundList = resQueryAroundService.getZhouBianList(resourceid);//è·åèµæºå¨è¾¹æ¥è¯¢å表 |
| | | // if(resQueryAroundList.size() > 0) ZhouBian = true; |
| | | // } |
| | | // // è·åç¨æ·å®ä¹JSON |
| | | // Res_DiyLayerInfo resDiyLayerInfo = resDiyLayerInfoService.queryUserObject(userid, resourceid); |
| | | // if (resDiyLayerInfo != null) { |
| | | // Json = "{ diyId: " + resDiyLayerInfo.getDiyid() + ", resourceId: " + resourceid + ", title: '" |
| | | // + resDiyLayerInfo.getTitle() + "', content: " + resDiyLayerInfo.getContent() + ", GuanLian: " + GuanLian + ", ZhouBian: " + ZhouBian + "}"; |
| | | // } else { |
| | | // // è·å管çåå®ä¹JSON |
| | | // resDiyLayerInfo = resDiyLayerInfoService.queryUserObject(0, resourceid); |
| | | // if (resDiyLayerInfo != null) { |
| | | // Json = "{ diyId: " + resDiyLayerInfo.getDiyid() + ", resourceId: " + resourceid |
| | | // + ", title: '" + resDiyLayerInfo.getTitle() + "', content: " |
| | | // + resDiyLayerInfo.getContent() + ", GuanLian: " + GuanLian + ", ZhouBian: " + ZhouBian + " }"; |
| | | // } else { |
| | | // // è·åèµæºæ¯æåè®®ä¸å°å |
| | | // Res_ExtMapUrl resExtMapUrl = resExtMapUrlService.queryFirstOrderByResId(resourceid); |
| | | // if (resExtMapUrl != null) { |
| | | // // è·åtoken |
| | | // //String token = "";// token |
| | | // //String urlEncode = ""; |
| | | // //if (resMainInfo.getEspproxy() == 1) { |
| | | // // try { |
| | | // // urlEncode = java.net.URLEncoder.encode(resExtMapUrl.getServerurl(), "UTF-8"); |
| | | // // String getTokenUrl = sysConfig.getTokenWebRoot() + "?loginName=" + username |
| | | // // + "&resourceId=" + resourceid + "&resourceUrl=" + urlEncode |
| | | // // + "&expireSeconds=360000&clientIp=" + request.getRemoteAddr();// tokenè·åå°å |
| | | // // String TokenResponse = HttpOperateUtils.httpGet(getTokenUrl);// 请æ±token |
| | | // // if (!TokenResponse.isEmpty()) { |
| | | // // JSONObject object = JSONObject.parseObject(TokenResponse);// 转æ¢è¿åJSONå符串 |
| | | // // token = object.getString("token");// è·åè¿åtoken |
| | | // // } |
| | | // // Json = "{ resourceId: " + resourceid + ", title: '" + resMainInfo.getTitle() |
| | | // // + "', typeandurl: '" + resExtMapUrl.getTypeandurl() + "', serverUrl: '" |
| | | // // + resExtMapUrl.getServerurl() + "?token=" + token + "' }"; |
| | | // // } catch (java.io.IOException e) { |
| | | // // Json = "{ resourceId: " + resourceid + ", title: '" + resMainInfo.getTitle() |
| | | // // + "', typeandurl: '" + resExtMapUrl.getTypeandurl() + "', serverUrl: '" |
| | | // // + resExtMapUrl.getServerurl() + "?token=" + token + "' }"; |
| | | // // } |
| | | // //} else { |
| | | // // Json = "{ resourceId: " + resourceid + ", title: '" + resMainInfo.getTitle() |
| | | // // + "', typeandurl: '" + resExtMapUrl.getTypeandurl() + "', serverUrl: '" |
| | | // // + resExtMapUrl.getServerurl() + "' }"; |
| | | // //} |
| | | // OrgUser orgUser = orgUserService.queryObject(Long.parseLong(userid.toString())); |
| | | // Json = "{ resourceId: " + resourceid + ", title: '" + resMainInfo.getTitle() |
| | | // + "', typeandurl: '" + resExtMapUrl.getTypeandurl() + "', serverUrl: '" |
| | | // + EsbToken.getEsbUrl(resExtMapUrl.getServerurl(), orgUser.getLoginname(), request.getRemoteAddr(), resourceid, resMainInfo.getEspproxy(), sysConfig) |
| | | // + "', GuanLian: " + GuanLian + ", ZhouBian: " + ZhouBian + " }"; |
| | | // } else { |
| | | // Json = "{ resourceId: " + resourceid + ", title: '" + resMainInfo.getTitle() |
| | | // + "', typeandurl: '', serverUrl: '' , GuanLian: " + GuanLian + ", ZhouBian: " + ZhouBian + "}"; |
| | | // } |
| | | // } |
| | | // } |
| | | // break; |
| | | // case "KJ_ZTDT": |
| | | // Res_ExtThemeMap resExtThemeMap = resExtThemeMapService.selectByPrimaryKey(resourceid);// è·åä¸é¢å°å¾æå±ä¿¡æ¯ |
| | | // if (resExtThemeMap != null && resExtThemeMap.getMapjson() != null |
| | | // && !resExtThemeMap.getMapjson().isEmpty()) { |
| | | // Json = "{resourceId: " + resourceid + ", title: '" + resMainInfo.getTitle() + "', mapjson: " |
| | | // + resExtThemeMap.getMapjson() + "}"; |
| | | // } else { |
| | | // Json = "{resourceId: " + resourceid + ", title: '" + resMainInfo.getTitle() |
| | | // + "', mapjson: null}"; |
| | | // } |
| | | // break; |
| | | // } |
| | | // } |
| | | // } |
| | | // |
| | | // return Json; |
| | | // } |
| | | // |
| | | // /** |
| | | // * @Description: è·åèµæºæå¡åè®®ä¸å°åä¿¡æ¯ |
| | | // * @Author: xiaoxuan.xie |
| | | // * @Date: 09:30 2018/4/2 |
| | | // * @return: String |
| | | // * @see Res_MainInfo |
| | | // */ |
| | | // @ResponseBody |
| | | // @GetMapping(path = "Server/getMapUrlObject/{userid}/{resourceid}/{type}/{id}") |
| | | // @ApiOperation(value = "è·åèµæºæå¡åè®®ä¸å°åä¿¡æ¯", notes = "") |
| | | // public String GetMapUrlObject( |
| | | // @ApiParam(name = "userid", value = "ç¨æ·ID", required = true) @PathVariable(name = "userid") Long userid, |
| | | // @ApiParam(name = "resourceid", value = "èµæºId", required = true) @PathVariable(name = "resourceid") Integer resourceid, |
| | | // @ApiParam(name = "type", value = "type", required = true) @PathVariable(name = "type") String type, |
| | | // @ApiParam(name = "id", value = "id", required = true) @PathVariable(name = "id") Integer id, |
| | | // HttpServletRequest request) { |
| | | // String Json = ""; |
| | | // if (type.equals("Url")) { |
| | | // Res_ExtMapUrl resExtMapUrl = resExtMapUrlService.selectByPrimaryKey(id);// è·åèµæºæ¯æåè®®ä¸å°å |
| | | // Res_MainInfo resMainInfo = resMainInfoService.selectByPrimaryKey(resourceid);// è·åèµæºä¸»è¡¨ä¿¡æ¯ |
| | | // if (resExtMapUrl != null) { |
| | | // // è·åtoken |
| | | // //String token = "";// token |
| | | // //String urlEncode = ""; |
| | | // //if (resMainInfo.getEspproxy() == 1) { |
| | | // // try { |
| | | // // urlEncode = java.net.URLEncoder.encode(resExtMapUrl.getServerurl(), "UTF-8"); |
| | | // // String getTokenUrl = sysConfig.getTokenWebRoot() + "?resourceId=" + resourceid |
| | | // // + "&resourceUrl=" + urlEncode + "&expireSeconds=360000&clientIp=" |
| | | // // + request.getRemoteAddr();// tokenè·åå°å |
| | | // // String TokenResponse = HttpOperateUtils.httpGet(getTokenUrl);// 请æ±token |
| | | // // JSONObject object = JSONObject.parseObject(TokenResponse);// 转æ¢è¿åJSONå符串 |
| | | // // token = object.getString("token");// è·åè¿åtoken |
| | | // // Json = "{ resourceId: " + resourceid + ", title: '" + resMainInfo.getTitle() |
| | | // // + "', typeandurl: '" + resExtMapUrl.getTypeandurl() + "', serverUrl: '" |
| | | // // + resExtMapUrl.getServerurl() + "?token=" + token + "' }"; |
| | | // // } catch (UnsupportedEncodingException e) { |
| | | // // Json = "{ resourceId: " + resourceid + ", title: '" + resMainInfo.getTitle() |
| | | // // + "', typeandurl: '" + resExtMapUrl.getTypeandurl() + "', serverUrl: '" |
| | | // // + resExtMapUrl.getServerurl() + "?token=" + token + "' }"; |
| | | // // } catch (Exception e) { |
| | | // // Json = "{ resourceId: " + resourceid + ", title: '" + resMainInfo.getTitle() |
| | | // // + "', typeandurl: '" + resExtMapUrl.getTypeandurl() + "', serverUrl: '" |
| | | // // + resExtMapUrl.getServerurl() + "?token=" + token + "' }"; |
| | | // // } |
| | | // //} else { |
| | | // // Json = "{ resourceId: " + resourceid + ", title: '" + resMainInfo.getTitle() + "', typeandurl: '" |
| | | // // + resExtMapUrl.getTypeandurl() + "', serverUrl: '" + resExtMapUrl.getServerurl() + "' }"; |
| | | // //} |
| | | // OrgUser orgUser = orgUserService.queryObject(userid); |
| | | // Json = "{ resourceId: " + resourceid + ", title: '" + resMainInfo.getTitle() |
| | | // + "', typeandurl: '" + resExtMapUrl.getTypeandurl() + "', serverUrl: '" |
| | | // + EsbToken.getEsbUrl(resExtMapUrl.getServerurl(), orgUser.getLoginname(), request.getRemoteAddr(), resourceid, resMainInfo.getEspproxy(), sysConfig) + "' }"; |
| | | // } else { |
| | | // Json = "{ resourceId: " + resourceid + ", title: '" + resMainInfo.getTitle() |
| | | // + "', typeandurl: '', serverUrl: '' }"; |
| | | // } |
| | | // } else { |
| | | // Res_DiyLayerInfo resDiyLayerInfo = resDiyLayerInfoService.getById(id);// è·åèªå®ä¹é£æ ¼ä¿¡æ¯ |
| | | // if (resDiyLayerInfo != null) { |
| | | // Json = "{ diyId: " + resDiyLayerInfo.getDiyid() + ", resourceId: " + resourceid + ", title: '" |
| | | // + resDiyLayerInfo.getTitle() + "', content: " + resDiyLayerInfo.getContent() + " }"; |
| | | // } else { |
| | | // Json = "{ diyId: " + id + ", resourceId: " + resourceid + ", title: '', content: null }"; |
| | | // } |
| | | // } |
| | | // |
| | | // return Json; |
| | | // } |
| | | // |
| | | // /** |
| | | // * @Description: è·åä¸å¡éæ-页é¢éæ-Iframeåºåç®å½æ |
| | | // */ |
| | | // @ResponseBody |
| | | // @GetMapping(path = "Server/getYWJCTreeData/{id}") |
| | | // @ApiOperation(value = "è·åä¸å¡éæ-页é¢éæ-Iframeåºåç®å½æ ", notes = "") |
| | | // public String getYWJCTreeData( |
| | | // @ApiParam(name = "id", value = "id", required = true) @PathVariable(name = "id") String id, |
| | | // HttpServletRequest request) { |
| | | // StringBuilder resCatalogJson = new StringBuilder(); |
| | | // String leixiId = "YWJC"; |
| | | // Res_MainInfo resMainInfoTWO = new Res_MainInfo(); |
| | | // resMainInfoTWO.setResourceclass(leixiId); |
| | | // resMainInfoTWO.setCParentid(Integer.parseInt(id)); |
| | | // resMainInfoTWO.setCatlogid(Integer.parseInt(id)); |
| | | // List<Res_Catalog> resCatalogList = resCatalogService.getYWJCMuLuTree(Integer.parseInt(id));// è·ååç®å½å表 |
| | | // // å¾ªç¯æé åç®å½èç¹ |
| | | // for (Res_Catalog resCatalog : resCatalogList) { |
| | | // if (!"".equals(resCatalogJson.toString())) { |
| | | // resCatalogJson.append(','); |
| | | // } |
| | | // resCatalogJson.append( |
| | | // "{id: " + resCatalog.getCatlogid() + ",name:'" + resCatalog.getTitle() + "', isParent: true}"); |
| | | // } |
| | | // // è·åèµæºç±»åå表 |
| | | // List<Res_MainInfo> resMainInfo = resMainInfoService.getYWJCTreeData(resMainInfoTWO); // è·åç®å½ä¸ä¸å¡éæ--页é¢éæ--Iframeåºåèµæºå表 |
| | | // // å¾ªç¯æé èµæºèç¹ |
| | | // for (Res_MainInfo resMainInfo1 : resMainInfo) { |
| | | // Res_ExtIntegrate res_extIntegrate = resExtIntegrateService.selectByPrimaryKey(resMainInfo1.getResourceid());// è·åä¸å¡éææå±ä¿¡æ¯ |
| | | // if (!"".equals(resCatalogJson.toString())) { |
| | | // resCatalogJson.append(','); |
| | | // } |
| | | // |
| | | // String title = resMainInfo1.getTitle(); |
| | | // if (resMainInfo1.getTitle().length() > 16) { |
| | | // title = resMainInfo1.getTitle().substring(0, 16) + ".."; |
| | | // } |
| | | // |
| | | // String serverUrl = res_extIntegrate.getServerurl(); |
| | | // if (serverUrl == null) |
| | | // serverUrl = ""; |
| | | // |
| | | // resCatalogJson.append("{id: 'ZiYuan_" + resMainInfo1.getResourceid() + "',name:'" + title + "', title: '" |
| | | // + resMainInfo1.getTitle() + "',isParent:false, ServerUrl: '" + serverUrl + "'}"); |
| | | // } |
| | | // return "[" + resCatalogJson.toString() + "]"; |
| | | // } |
| | | |
| | | /** |
| | | * @Description: æ¥è¯¢èµæºæ¯å¦åå¨ |
| | | * @Author: dengshuhua |
| | | * @return: Boolean |
| | | */ |
| | | @ResponseBody |
| | | @GetMapping(path = "/cheackZYIsExist") |
| | | @ApiOperation(value = "æ¥è¯¢æå¡å表", notes = "") |
| | | public Boolean getServerList(@ApiParam(name = "resourceid", value = "èµæºID") @RequestParam(name = "resourceid", required = true) Integer resourceid) { |
| | | Boolean result = false; |
| | | Res_MainInfo mainInfo = resMainInfoService.selectByPrimaryKey(resourceid); |
| | | if(mainInfo != null) result = true; |
| | | return result; |
| | | } |
| | | |
| | | @ResponseBody |
| | | @GetMapping(path = "/GetStationDataSearch") |
| | | @ApiOperation(value = "æµ·æ´ç«çæµæ°æ®æ°æ®ä¿¡æ¯æ£ç´¢", notes = "") |
| | | public Result GetStationDataSearch(Integer stationCode,String startDate,String endDate,String factorCode) { |
| | | String data = ""; |
| | | String path = sysConfig.getUploadPath() + "cache\\"+"Search.txt"; |
| | | try { |
| | | String url = "http://192.168.4.124:8100/stations/data/search?stationCode=" + stationCode + "&startDate=" + startDate + "&endDate=" + endDate + "&factorCode=" + factorCode; |
| | | data = HttpOperateUtils.httpGet(url); |
| | | File file = new File(path); |
| | | file.createNewFile(); |
| | | FileWriter writer = new FileWriter(file); |
| | | BufferedWriter out = new BufferedWriter(writer); |
| | | out.write(data); |
| | | out.flush(); |
| | | } catch (Exception ex) { |
| | | |
| | | } |
| | | return Result.ok().put("path",sysConfig.getUploadRootPath()+"cache/"+"Search.txt"); |
| | | } |
| | | |
| | | @ResponseBody |
| | | @GetMapping(path = "/GetCXDataByTaiZhanNameAndTime") |
| | | @ApiOperation(value = "è·åå°ç«é¢æ¥æ°æ®", notes = "") |
| | | public Result GetCXDataByTaiZhanNameAndTime(String name,String timeStr) { |
| | | String ycdata = ""; |
| | | String parpath = sysConfig.getUploadPath() + "cache\\yc"; |
| | | String date = DateTime.now().toString().substring(0,10); |
| | | String todayData = parpath +"\\"+date+".txt"; |
| | | try { |
| | | File parentDir = new File(parpath); |
| | | if(parentDir.isDirectory()){ |
| | | File[] files = parentDir.listFiles(); |
| | | //æ¯å¦åå¨å½å¤©ç颿µæ°æ® |
| | | boolean isExits = false; |
| | | for(File f : files){ |
| | | String n = f.getName(); |
| | | if(f.getName().equals(date+".txt")){ |
| | | isExits = true; |
| | | break; |
| | | } |
| | | } |
| | | //ä¸åå¨å仿¥å£è·åæ°æ®åå
¥å½å¤©ç¼å |
| | | if(!isExits){ |
| | | //å 餿件夹ä¸çæä»¶ |
| | | for(File f : files){ |
| | | f.delete(); |
| | | } |
| | | String url = "http://192.168.20.106/Ocean/WebServices/ElecTable/X_CWYG_Server.asmx/GetCXDataByTaiZhanNameAndTime"; |
| | | SearchZscg searchZscg = new SearchZscg(); |
| | | searchZscg.setName(URLDecoder.decode(name)); |
| | | searchZscg.setTimeStr(timeStr); |
| | | ycdata = HttpOperateUtils.httpPost(url,searchZscg); |
| | | File newfile = new File(todayData); |
| | | newfile.createNewFile(); |
| | | FileWriter writer = new FileWriter(newfile); |
| | | BufferedWriter out = new BufferedWriter(writer); |
| | | out.write(ycdata); |
| | | out.flush(); |
| | | } |
| | | } |
| | | } catch (Exception ex) { |
| | | |
| | | } |
| | | return Result.ok().put("path",sysConfig.getUploadRootPath()+"cache/yc/"+date+".txt"); |
| | | } |
| | | |
| | | public class SearchZscg{ |
| | | private String name; |
| | | private String timeStr; |
| | | |
| | | public String getName() { |
| | | return name; |
| | | } |
| | | |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | } |
| | | |
| | | public String getTimeStr() { |
| | | return timeStr; |
| | | } |
| | | |
| | | public void setTimeStr(String timeStr) { |
| | | this.timeStr = timeStr; |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | //package com.landtool.lanbase.modules.api.controller; |
| | | // |
| | | //import com.landtool.lanbase.modules.res.entity.Res_DiyLayerInfo; |
| | | //import com.landtool.lanbase.modules.res.service.ResDiyLayerInfoService; |
| | | // |
| | | //import io.swagger.annotations.Api; |
| | | //import io.swagger.annotations.ApiOperation; |
| | | //import io.swagger.annotations.ApiParam; |
| | | // |
| | | //import org.springframework.beans.factory.annotation.Autowired; |
| | | //import org.springframework.stereotype.Controller; |
| | | //import org.springframework.web.bind.annotation.GetMapping; |
| | | //import org.springframework.web.bind.annotation.PostMapping; |
| | | //import org.springframework.web.bind.annotation.RequestMapping; |
| | | //import org.springframework.web.bind.annotation.RequestParam; |
| | | //import org.springframework.web.bind.annotation.ResponseBody; |
| | | // |
| | | //import java.sql.Timestamp; |
| | | //import java.util.List; |
| | | //import java.util.Date; |
| | | // |
| | | //@Controller |
| | | //@RequestMapping("/api/res/diylayerinfo") |
| | | //@Api(value = "", tags = {"èªå®ä¹å¾å±ä¿¡æ¯"}) |
| | | //public class ResDiyLayerInfoApiController { |
| | | // @Autowired |
| | | // private ResDiyLayerInfoService resDiyLayerInfoService; |
| | | // |
| | | // /** |
| | | // * æ°å¢/ä¿®æ¹èªå®ä¹å¾å±ä¿¡æ¯ |
| | | // */ |
| | | // @PostMapping(path = "/addDiyLayerInfo") |
| | | // @ApiOperation(value = "èªå®ä¹å¾å±ä¿¡æ¯ æ°å¢/ä¿®æ¹", notes = "") |
| | | // @ResponseBody |
| | | // public String addDiyLayerInfo( |
| | | // @ApiParam(name = "userid", value = "ç¨æ·Id", required = true) @RequestParam(name = "userid") int userid, |
| | | // @ApiParam(name = "resourceid", value = "ä¿¡æ¯èµæºId", required = true) @RequestParam(name = "resourceid") int resourceid, |
| | | // @ApiParam(name = "title", value = "æ é¢", required = true) @RequestParam(name = "title") String title, |
| | | // @ApiParam(name = "typename", value = "ä¿¡æ¯ç±»å", required = true) @RequestParam(name = "typename") String typename, |
| | | // @ApiParam(name = "content", value = "å
容", required = true) @RequestParam(name = "content") String content) { |
| | | // // æ¯å¦åå¨è®°å½ï¼åå¨åä¿®æ¹ |
| | | // Res_DiyLayerInfo info = resDiyLayerInfoService.queryObjectByUseridAndResid(userid, resourceid, title); |
| | | // if (info == null) {// æ°å¢ |
| | | // info = new Res_DiyLayerInfo(); |
| | | // info.setResourceid(resourceid); |
| | | // info.setContent(content); |
| | | // info.setTitle(title); |
| | | // info.setTypename(typename); |
| | | // info.setDiyuserid(userid); |
| | | // Timestamp audittime = new Timestamp(new Date().getTime()); |
| | | // info.setDiytime(audittime); |
| | | // resDiyLayerInfoService.insert(info); |
| | | // return "æ·»å æå"; |
| | | // } else {// ä¿®æ¹ |
| | | // info.setTitle(title); |
| | | // info.setTypename(typename); |
| | | // info.setContent(content); |
| | | // Timestamp audittime = new Timestamp(new Date().getTime()); |
| | | // info.setDiytime(audittime); |
| | | // resDiyLayerInfoService.updateByPrimaryKeySelective(info); |
| | | // return "ä¿®æ¹æå"; |
| | | // } |
| | | // } |
| | | // |
| | | // /** |
| | | // * ç¼è¾èªå®ä¹å¾å±ä¿¡æ¯é£æ ¼å
容 |
| | | // */ |
| | | // @PostMapping(path = "/updateDiyLayerInfo") |
| | | // @ApiOperation(value = "ç¼è¾èªå®ä¹å¾å±ä¿¡æ¯é£æ ¼å
容", notes = "") |
| | | // @ResponseBody |
| | | // public String updateDiyLayerInfo( |
| | | // @ApiParam(name = "diyid", value = "Id", required = true) @RequestParam(name = "diyid") int diyid, |
| | | // @ApiParam(name = "title", value = "æ é¢") String title, |
| | | // @ApiParam(name = "typename", value = "ä¿¡æ¯ç±»å") String typename, |
| | | // @ApiParam(name = "content", value = "å
容", required = true) @RequestParam(name = "content") String content) { |
| | | // Res_DiyLayerInfo info = new Res_DiyLayerInfo(); |
| | | // if (content.length() != 0) { |
| | | // info.setContent(content); |
| | | // } |
| | | // if (title != null && title.length() != 0) { |
| | | // info.setTitle(title); |
| | | // } |
| | | // if (typename != null && typename.length() != 0) { |
| | | // info.setTypename(typename); |
| | | // } |
| | | // info.setDiyid(diyid); |
| | | // info.setDiyuserid(1); // å
åæ»idï¼åç»æ¹æè¯»åå½åç»å½äººid |
| | | // resDiyLayerInfoService.updateContentApi(info); |
| | | // return "ç¼è¾æå"; |
| | | // } |
| | | // |
| | | // /** |
| | | // * æ¥è¯¢èªå®ä¹å¾å±ä¿¡æ¯å表 |
| | | // */ |
| | | // @ResponseBody |
| | | // @GetMapping("/queryDiyLayerInfo") |
| | | // @ApiOperation(value = "èªå®ä¹å¾å±ä¿¡æ¯å表", notes = "") |
| | | // public List<Res_DiyLayerInfo> queryListByUserId(@ApiParam(name = "resourceid", value = "ä¿¡æ¯èµæºId") Integer resourceid, |
| | | // @ApiParam(name = "title", value = "æ é¢") String title, |
| | | // @ApiParam(name = "typename", value = "ä¿¡æ¯ç±»å") String typename, |
| | | // @ApiParam(name = "diyid", value = "diyid") Integer diyid) { |
| | | // Res_DiyLayerInfo record = new Res_DiyLayerInfo(); |
| | | // record.setResourceid(resourceid); |
| | | // record.setTitle(title); |
| | | // record.setTypename(typename); |
| | | // record.setDiyid(diyid); |
| | | // ; |
| | | // return resDiyLayerInfoService.queryApiList(record); |
| | | // } |
| | | // |
| | | // /** |
| | | // * å é¤èªå®ä¹å¾å±ä¿¡æ¯ |
| | | // */ |
| | | // @PostMapping(path = "/deleteDiyLayerInfo") |
| | | // @ApiOperation(value = "å é¤èªå®ä¹å¾å±ä¿¡æ¯", notes = "") |
| | | // @ResponseBody |
| | | // public String deleteDiyLayerInfo( |
| | | // @ApiParam(name = "diyid", value = "diyid", required = true) @RequestParam(name = "diyid") Long diyid) { |
| | | // resDiyLayerInfoService.deleteDiyLayerInfo(diyid); |
| | | // return "å 餿å"; |
| | | // } |
| | | //} |
¶Ô±ÈÐÂÎļþ |
| | |
| | | /*package com.landtool.lanbase.modules.api.controller; |
| | | |
| | | import com.landtool.lanbase.common.map.EsbToken; |
| | | import com.landtool.lanbase.config.SysTemPropertyConfig; |
| | | import com.landtool.lanbase.modules.org.entity.OrgUser; |
| | | import com.landtool.lanbase.modules.org.service.OrgUserService; |
| | | import com.landtool.lanbase.modules.res.service.ResExtBaseMapService; |
| | | import com.landtool.lanbase.modules.res.service.ResExtMapUrlService; |
| | | import com.landtool.lanbase.modules.res.service.ZhuanTiZhiTuService; |
| | | import com.landtool.lanbase.modules.sys.entity.*; |
| | | import com.landtool.lanbase.modules.res.entity.Res_ExtBaseMap; |
| | | import com.landtool.lanbase.modules.res.entity.Res_ExtMapUrl; |
| | | import com.landtool.lanbase.modules.res.entity.UserDefined.UserDef_BaseMap; |
| | | import com.landtool.lanbase.modules.sys.service.*; |
| | | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.List; |
| | | |
| | | @Controller |
| | | @RequestMapping("/api/res/extbasemap") |
| | | @Api(value = "", tags = { "ç³»ç»èµæºæ©å±(åºç¡å°å¾)" }) |
| | | public class ResExtBaseMapApiController { |
| | | |
| | | *//** |
| | | * æ¥è¯¢åºç¡åºå¾å表 |
| | | *//* |
| | | @ResponseBody |
| | | @GetMapping("/queryExtBaseMapList") |
| | | @ApiOperation(value = "åºç¡å°å¾å表", notes = "") |
| | | public List<Res_ExtBaseMap> queryExtBaseMapList( |
| | | @ApiParam(name = "resourceid", value = "ä¿¡æ¯èµæºId") Integer resourceid, |
| | | @ApiParam(name = "publishsoft", value = "åå¸å¹³å°") String publishsoft, |
| | | @ApiParam(name = "basemaptype", value = "åºå¾ç±»å") String basemaptype, |
| | | @ApiParam(name = "imageaccuracy", value = "å½±å精度") String imageaccuracy, |
| | | @ApiParam(name = "displaylev", value = "æ¾ç¤ºæ¯ä¾") String displaylev, |
| | | @ApiParam(name = "refmarkinfid", value = "å
³èæ æ³¨å¾èµæºID") Integer refmarkinfid, |
| | | @ApiParam(name = "extproperty", value = "æ©å±å±æ§") String extproperty) { |
| | | Res_ExtBaseMap record = new Res_ExtBaseMap(); |
| | | record.setResourceid(resourceid); |
| | | record.setPublishsoft(publishsoft); |
| | | record.setBasemaptype(basemaptype); |
| | | record.setImageaccuracy(imageaccuracy); |
| | | record.setDisplaylev(displaylev); |
| | | record.setRefmarkinfid(refmarkinfid); |
| | | record.setExtproperty(extproperty); |
| | | List<Res_ExtBaseMap> mapList = resExtBaseMapService.queryApiList(record); |
| | | for (Res_ExtBaseMap item : mapList) { |
| | | List<Res_ExtMapUrl> urlList = resExtMapUrlService.selectByCondition(item.getResourceid()); |
| | | item.setUrllist(urlList); |
| | | } |
| | | return mapList; |
| | | } |
| | | |
| | | }*/ |
¶Ô±ÈÐÂÎļþ |
| | |
| | | //package com.landtool.lanbase.modules.api.controller; |
| | | // |
| | | //import com.alibaba.fastjson.JSON; |
| | | //import com.alibaba.fastjson.JSONObject; |
| | | //import com.landtool.lanbase.common.utils.JpinyinUtils; |
| | | //import com.landtool.lanbase.config.SysTemPropertyConfig; |
| | | //import com.landtool.lanbase.modules.res.entity.Res_ExtThemeMap; |
| | | //import com.landtool.lanbase.modules.res.entity.Res_MainInfo; |
| | | //import com.landtool.lanbase.modules.res.service.ResExtThemeMapService; |
| | | //import com.landtool.lanbase.modules.res.service.ResMainInfoService; |
| | | //import com.landtool.lanbase.modules.sys.entity.*; |
| | | //import com.landtool.lanbase.modules.sys.service.*; |
| | | // |
| | | //import io.swagger.annotations.Api; |
| | | //import io.swagger.annotations.ApiOperation; |
| | | //import io.swagger.annotations.ApiParam; |
| | | // |
| | | //import org.springframework.beans.factory.annotation.Autowired; |
| | | //import org.springframework.stereotype.Controller; |
| | | //import org.springframework.web.bind.annotation.GetMapping; |
| | | //import org.springframework.web.bind.annotation.PathVariable; |
| | | //import org.springframework.web.bind.annotation.PostMapping; |
| | | //import org.springframework.web.bind.annotation.RequestMapping; |
| | | //import org.springframework.web.bind.annotation.RequestParam; |
| | | //import org.springframework.web.bind.annotation.ResponseBody; |
| | | // |
| | | //import java.util.List; |
| | | //import java.util.Date; |
| | | //import java.math.BigDecimal; |
| | | //import java.sql.Timestamp; |
| | | // |
| | | //@Controller |
| | | //@RequestMapping("/api/res/extthememap") |
| | | //@Api(value = "", tags = { "ç³»ç»èµæºæ©å±(ä¸é¢å°å¾)" }) |
| | | //public class ResExtThemeMapApiController { |
| | | // |
| | | // |
| | | //} |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.landtool.lanbase.modules.api.controller; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.LinkedHashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | |
| | | import com.github.pagehelper.Page; |
| | | import com.github.pagehelper.PageHelper; |
| | | import com.landtool.lanbase.config.SysTemPropertyConfig; |
| | | import com.landtool.lanbase.modules.api.utils.PageBean; |
| | | import com.landtool.lanbase.modules.res.entity.Res_Catalog; |
| | | import com.landtool.lanbase.modules.res.entity.Res_DiyLayerInfo; |
| | | import com.landtool.lanbase.modules.res.entity.Res_ExtIntegrate; |
| | | import com.landtool.lanbase.modules.res.entity.Res_ExtMapUrl; |
| | | import com.landtool.lanbase.modules.res.entity.Res_MainInfo; |
| | | import com.landtool.lanbase.modules.res.entity.Res_Theme; |
| | | import com.landtool.lanbase.modules.res.entity.Res_Theme_Module; |
| | | import com.landtool.lanbase.modules.res.service.ResCatalogService; |
| | | import com.landtool.lanbase.modules.res.service.ResDiyLayerInfoService; |
| | | import com.landtool.lanbase.modules.res.service.ResExtIntegrateService; |
| | | import com.landtool.lanbase.modules.res.service.ResExtMapUrlService; |
| | | import com.landtool.lanbase.modules.res.service.ResMainInfoService; |
| | | import com.landtool.lanbase.modules.res.service.ResThemeModuleService; |
| | | import com.landtool.lanbase.modules.res.service.ResThemeRelationService; |
| | | import com.landtool.lanbase.modules.res.service.ResThemeService; |
| | | import com.landtool.lanbase.modules.sys.service.SysFieldvalueService; |
| | | |
| | | import io.swagger.annotations.Api; |
| | | |
| | | @Controller |
| | | @RequestMapping("/api/res") |
| | | @Api(value = "", tags = { "å°å¾ç¸å
³æ¥å£" }) |
| | | public class ResMapApiController { |
| | | @Autowired |
| | | private ResMainInfoService resMainInfoService; |
| | | |
| | | @Autowired |
| | | private ResCatalogService resCatalogService; |
| | | |
| | | @Autowired |
| | | private ResExtMapUrlService resExtMapUrlService; |
| | | |
| | | @Autowired |
| | | private ResDiyLayerInfoService resDiyLayerInfoService; |
| | | |
| | | @Autowired |
| | | private ResExtIntegrateService resExtIntegrateService; |
| | | |
| | | @Autowired |
| | | private ResThemeService resThemeService; |
| | | |
| | | @Autowired |
| | | private ResThemeModuleService resThemeModuleService; |
| | | |
| | | @Autowired |
| | | private ResThemeRelationService resThemeRelationService; |
| | | |
| | | @Autowired |
| | | private SysFieldvalueService FieldUtils; |
| | | |
| | | @Autowired |
| | | private SysTemPropertyConfig sysConfig; |
| | | |
| | | // æ¥è¯¢ä¸é¢å°å¾å¯¹åºçtitle |
| | | @ResponseBody |
| | | @GetMapping("selectZTDTList") |
| | | public List<Res_MainInfo> selectZTDTList(Integer userid, PageBean pageBean) { |
| | | PageHelper.startPage(pageBean.getPage(), pageBean.getLimit()); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("leixiId", "KJ_ZTDT"); |
| | | map.put("userid", userid); |
| | | List<Res_MainInfo> res_mainInfos = resMainInfoService.selectZTDTList(map); |
| | | int countNums = (int) ((Page) res_mainInfos).getTotal(); |
| | | PageBean<Res_MainInfo> pageData = new PageBean<>(pageBean.getPage(), pageBean.getLimit(), countNums); |
| | | pageData.setItems(res_mainInfos); |
| | | // æ¥è¯¢åºç¡åºå¾ |
| | | return res_mainInfos; |
| | | } |
| | | |
| | | // æ¥è¯¢èµæºç®å½å¯¹åºçèµæº |
| | | @ResponseBody |
| | | @GetMapping("selectTitlefromZiYuan") |
| | | public String selectTitlefromZiYuan(String parentid, Res_MainInfo info) { |
| | | StringBuilder resCatalogJson = new StringBuilder(); |
| | | if (parentid.indexOf("ZiYuan_") == -1) { |
| | | String leixiId = "KJ_YWTC"; |
| | | Res_MainInfo resMainInfoTWO = new Res_MainInfo(); |
| | | resMainInfoTWO.setResourceclass(leixiId); |
| | | resMainInfoTWO.setCParentid(Integer.parseInt(parentid)); |
| | | resMainInfoTWO.setCatlogid(Integer.parseInt(parentid)); |
| | | resMainInfoTWO.setTitle(info.getTitle()); |
| | | resMainInfoTWO.setCreateuserid(info.getCreateuserid()); |
| | | resMainInfoTWO.setPubdateBegin(info.getPubdateBegin()); |
| | | resMainInfoTWO.setPubdatefinish(info.getPubdatefinish()); |
| | | resMainInfoTWO.setIscollect(info.getIscollect()); |
| | | List<Res_Catalog> resCatalogList = resCatalogService.selectFilterResCatalogToParentid(resMainInfoTWO);// è·ååç®å½å表 |
| | | // å¾ªç¯æé åç®å½èç¹ |
| | | for (Res_Catalog resCatalog : resCatalogList) { |
| | | if (!"".equals(resCatalogJson.toString())) { |
| | | resCatalogJson.append(','); |
| | | } |
| | | resCatalogJson.append( |
| | | "{id: " + resCatalog.getCatlogid() + ",name:'" + resCatalog.getTitle() + "', isParent: true}"); |
| | | } |
| | | // è·åèµæºç±»åå表 |
| | | List<Res_MainInfo> resMainInfo = resMainInfoService.selectTwtcForZiYuan(resMainInfoTWO); // è·åç®å½ä¸ä¸å¡å¾å±èµæºå表 |
| | | // å¾ªç¯æé èµæºèç¹ |
| | | for (Res_MainInfo resMainInfo1 : resMainInfo) { |
| | | if (!"".equals(resCatalogJson.toString())) { |
| | | resCatalogJson.append(','); |
| | | } |
| | | List<Res_ExtMapUrl> urlList = resExtMapUrlService.selectByCondition(resMainInfo1.getResourceid()); |
| | | boolean isMapUrl = urlList.size() == 0 ? false : true; |
| | | String title = resMainInfo1.getTitle(); |
| | | if (resMainInfo1.getTitle().length() > 16) { |
| | | title = resMainInfo1.getTitle().substring(0, 16) + ".."; |
| | | } |
| | | resCatalogJson.append("{icon:'./images/classicons/" + resMainInfo1.getResourceclass() |
| | | + ".png',id: 'ZiYuan_" + resMainInfo1.getResourceid() + "',name:'" + title + "', title: '" |
| | | + resMainInfo1.getTitle() + "',isParent:false, hidtxt: '', isMapUrl: " + isMapUrl + "}"); |
| | | } |
| | | } else { |
| | | String idstr = parentid.substring(parentid.indexOf("_") + 1, parentid.length()); |
| | | List<Res_ExtMapUrl> urlList = resExtMapUrlService.selectByCondition(Integer.parseInt(idstr)); |
| | | if (urlList.size() != 0) { |
| | | LinkedHashMap<String, String> TypeAndURLList = FieldUtils.getFieldListByKey("TypeAndURL"); |
| | | for (Res_ExtMapUrl urlitem : urlList) { |
| | | if (!"".equals(resCatalogJson.toString())) { |
| | | resCatalogJson.append(','); |
| | | } |
| | | String name = TypeAndURLList.get(urlitem.getTypeandurl()); |
| | | resCatalogJson.append("{id: 'Url_" + urlitem.getUrlid() + "', resourceId: " + idstr + ",name:'" |
| | | + name + "', hidtxt: ''}"); |
| | | } |
| | | } |
| | | Res_DiyLayerInfo resDiyLayerInfo = new Res_DiyLayerInfo(); |
| | | resDiyLayerInfo.setResourceid(Integer.parseInt(idstr)); |
| | | resDiyLayerInfo.setIsshare(1); |
| | | resDiyLayerInfo.setResourceid(Integer.parseInt(idstr)); |
| | | List<Res_DiyLayerInfo> resDiyLayerInfoList = resDiyLayerInfoService.queryApiList(resDiyLayerInfo);// è·åå¶å¾ä¿¡æ¯å表 |
| | | if (resDiyLayerInfoList.size() > 0) { |
| | | for (Res_DiyLayerInfo item : resDiyLayerInfoList) { |
| | | if (!"".equals(resCatalogJson.toString())) { |
| | | resCatalogJson.append(','); |
| | | } |
| | | resCatalogJson.append("{id: 'Diy_" + item.getDiyid() + "', resourceId: " + idstr + ",name:'" |
| | | + item.getTitle() + "', hidtxt: " + item.getContent() + "}"); |
| | | } |
| | | } |
| | | } |
| | | return "[" + resCatalogJson.toString() + "]"; |
| | | } |
| | | |
| | | /** |
| | | * è·åä¸å¡éæå®å¶ç®å½æ |
| | | * @param id ç®å½ID |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @GetMapping("getYWJCCustomTreeData") |
| | | public String getYWJCCustomTreeData(String id) { |
| | | StringBuilder resCatalogJson = new StringBuilder(); |
| | | Res_MainInfo resMainInfoTWO = new Res_MainInfo(); |
| | | resMainInfoTWO.setResourceclass("YWJC"); |
| | | resMainInfoTWO.setCParentid(Integer.parseInt(id)); |
| | | resMainInfoTWO.setCatlogid(Integer.parseInt(id)); |
| | | List<Res_Catalog> resCatalogList = resCatalogService.getYWJCMuLuTree(Integer.parseInt(id));// è·ååç®å½å表 |
| | | // å¾ªç¯æé åç®å½èç¹ |
| | | for (Res_Catalog resCatalog : resCatalogList) { |
| | | if (!"".equals(resCatalogJson.toString())) { |
| | | resCatalogJson.append(','); |
| | | } |
| | | resCatalogJson.append( |
| | | "{id: " + resCatalog.getCatlogid() + ",name:'" + resCatalog.getTitle() + "', isParent: true}"); |
| | | } |
| | | // è·åèµæºç±»åå表 |
| | | List<Res_MainInfo> resMainInfo = resMainInfoService.getYWJCTreeData(resMainInfoTWO); // è·åç®å½ä¸ä¸å¡éæ--页é¢éæ--Iframeåºåèµæºå表 |
| | | // å¾ªç¯æé èµæºèç¹ |
| | | for (Res_MainInfo resMainInfo1 : resMainInfo) { |
| | | Res_ExtIntegrate res_extIntegrate = resExtIntegrateService.selectByPrimaryKey(resMainInfo1.getResourceid());// è·åä¸å¡éææå±ä¿¡æ¯ |
| | | if (!"".equals(resCatalogJson.toString())) { |
| | | resCatalogJson.append(','); |
| | | } |
| | | |
| | | String title = resMainInfo1.getTitle(); |
| | | if (resMainInfo1.getTitle().length() > 16) { |
| | | title = resMainInfo1.getTitle().substring(0, 16) + ".."; |
| | | } |
| | | |
| | | String serverUrl = res_extIntegrate.getServerurl(); |
| | | if (serverUrl == null) |
| | | serverUrl = ""; |
| | | |
| | | resCatalogJson.append("{id: 'ZiYuan_" + resMainInfo1.getResourceid() + "',name:'" + title + "', title: '" |
| | | + resMainInfo1.getTitle() + "',isParent:false, ServerUrl: '" + serverUrl + "'}"); |
| | | } |
| | | return "[" + resCatalogJson.toString() + "]"; |
| | | } |
| | | |
| | | /** |
| | | * è·åä¸é¢å表ï¼ä¸å¡ä¸é¢ï¼ |
| | | */ |
| | | @ResponseBody |
| | | @GetMapping("getAllThemeList") |
| | | public String getAllThemeList(Integer userId,PageBean pageBean) { |
| | | |
| | | pageBean.setLimit(10); |
| | | PageHelper.startPage(pageBean.getPage(), pageBean.getLimit());//设置å½å页æ°åæ¯é¡µæ¡æ° |
| | | List<Res_Theme> resThemeList = resThemeService.getAllThemeList(userId);// è·åä¸å¡ä¸é¢é»è®¤ä¸é¢å表ï¼ä¸´æ¶å»é¤ç¨æ·è¿æ»¤ |
| | | int countNums = (int) ((Page) resThemeList).getTotal();//è·åè®°å½æ»æ° |
| | | PageBean<Res_Theme> pageData = new PageBean<>(pageBean.getPage(), pageBean.getLimit(), countNums); |
| | | |
| | | pageData.setItems(resThemeList); |
| | | StringBuilder sb = new StringBuilder(); |
| | | sb.append("["); |
| | | for (Res_Theme resTheme : resThemeList) { |
| | | if (sb.toString().length() > 0) |
| | | sb.append(","); |
| | | sb.append("{"); |
| | | sb.append("id: " + resTheme.getThemeid()); |
| | | sb.append(", title: '" + resTheme.getTitle() + "'"); |
| | | sb.append("}"); |
| | | } |
| | | sb.append("]"); |
| | | StringBuilder rsb1 = new StringBuilder(); |
| | | rsb1.append("{"); |
| | | rsb1.append("Count:"+countNums); |
| | | rsb1.append(",Page:"+pageBean.getPage()); |
| | | rsb1.append(",ShuJu:"+sb.toString()); |
| | | rsb1.append("}"); |
| | | |
| | | return "(" + rsb1.toString() + ")"; |
| | | } |
| | | |
| | | /** |
| | | * è·åä¸å¡ä¸é¢æé模åå表ï¼å4ä¸ªï¼ |
| | | * @param themeId |
| | | * ä¸å¡ä¸é¢Id |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @GetMapping("getThemeModuleList") |
| | | public String getThemeModuleList(Integer themeId) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("themeid", themeId); |
| | | List<Res_Theme_Module> resThemeModuleList = resThemeModuleService.getThemeModuleList(map); |
| | | StringBuilder rsb = new StringBuilder(); |
| | | |
| | | for (int i = 0; i < resThemeModuleList.size(); i++) { |
| | | if (i != 0) { |
| | | rsb.append(","); |
| | | } |
| | | |
| | | rsb.append("{'moduleid':'" + resThemeModuleList.get(i).getModuleid() + "'"); // 模åID |
| | | rsb.append(",'title':'" + resThemeModuleList.get(i).getTitle() + "'"); // 模ååç§° |
| | | rsb.append(",'mapresid':'" + resThemeModuleList.get(i).getMapresid() + "'"); // å°å¾èµæºID |
| | | rsb.append(",'panelresid':'" + resThemeModuleList.get(i).getPanelresid() + "'"); // 颿¿ID |
| | | Res_ExtIntegrate resExtIntegrate = resExtIntegrateService.selectByPrimaryKey(resThemeModuleList.get(i).getPanelresid()); |
| | | |
| | | if (resExtIntegrate != null) { |
| | | rsb.append(",'serverurl':'" + resExtIntegrate.getServerurl() + "'"); // åå¸åä½id |
| | | } else { |
| | | rsb.append(",'serverurl':''"); // åå¸åä½id |
| | | } |
| | | rsb.append("}"); |
| | | } |
| | | |
| | | return "[" + rsb.toString() + "]"; |
| | | } |
| | | |
| | | /** |
| | | * è·å模åå表(æé¤ä¸å¡ä¸é¢å·²éæ©æ¨¡å) |
| | | * @param themeid ä¸å¡ä¸é¢Id |
| | | * @param title 模ååç§° |
| | | * @param moduleIdList ä¸å¡ä¸é¢å·²å±ç¤ºæ¨¡åID |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @GetMapping("getModuleList") |
| | | public String getModuleList(Integer themeid, String title, String moduleIdList, PageBean pageBean) { |
| | | Page<Res_Theme_Module> page = PageHelper.startPage(pageBean.getPage(), pageBean.getLimit()); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("themeid", themeid); |
| | | map.put("title", title); |
| | | map.put("moduleIdList", moduleIdList); |
| | | List<Res_Theme_Module> resThemeModuleList1 = resThemeModuleService.getIgnoreThemeModuleList(map); |
| | | int countNums = (int) ((Page) resThemeModuleList1).getTotal(); |
| | | PageBean<Res_Theme_Module> pageData = new PageBean<>(pageBean.getPage(), pageBean.getLimit(), countNums); |
| | | pageData.setItems(resThemeModuleList1); |
| | | |
| | | StringBuilder rsb = new StringBuilder(); |
| | | rsb.append("{'totalCount':'" + countNums); |
| | | rsb.append("','topics':["); |
| | | for (int i = 0; i < resThemeModuleList1.size(); i++) { |
| | | if (i != 0) { |
| | | rsb.append(","); |
| | | } |
| | | |
| | | rsb.append("{'moduleid':'" + resThemeModuleList1.get(i).getModuleid() + "'"); // 模åID |
| | | rsb.append(",'title':'" + resThemeModuleList1.get(i).getTitle() + "'"); // 模ååç§° |
| | | rsb.append("}"); |
| | | } |
| | | rsb.append("]}"); |
| | | return rsb.toString(); |
| | | } |
| | | |
| | | /** |
| | | * å®å¶ä¸å¡ä¸é¢æ¨¡å |
| | | * @param new_moduleId æ°æ¨¡åID |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @GetMapping("ThemeModuleEdit") |
| | | public String ThemeModuleEdit(Integer new_moduleId) { |
| | | //resThemeRelationService.deleteByThemeIdAndModuleId(resThemeRelation); // å 餿§æ¨¡åå
³èè®°å½ |
| | | // æ°å¢æ°æ¨¡åå
³èè®°å½ |
| | | //Res_Theme_Relation resThemeRelation1 = new Res_Theme_Relation(); |
| | | //resThemeRelation1.setThemeid(resThemeRelation.getThemeid()); |
| | | //resThemeRelation1.setModuleid(new_moduleId); |
| | | //resThemeRelationService.insert(resThemeRelation1); |
| | | // æ¥è¯¢æ°æ¨¡åä¿¡æ¯ |
| | | Res_Theme_Module resThemeModule = resThemeModuleService.selectByid(new_moduleId); |
| | | StringBuilder rsb = new StringBuilder(); |
| | | |
| | | if(resThemeModule != null) { |
| | | rsb.append("{'moduleid':'" + resThemeModule.getModuleid() + "'"); // 模åID |
| | | rsb.append(",'title':'" + resThemeModule.getTitle() + "'"); // 模ååç§° |
| | | rsb.append(",'mapresid':'" + resThemeModule.getMapresid() + "'"); // å°å¾èµæºID |
| | | rsb.append(",'panelresid':'" + resThemeModule.getPanelresid() + "'"); // 颿¿ID |
| | | Res_ExtIntegrate resExtIntegrate = resExtIntegrateService.selectByPrimaryKey(resThemeModule.getPanelresid()); |
| | | |
| | | if (resExtIntegrate != null) { |
| | | rsb.append(",'serverurl':'" + resExtIntegrate.getServerurl() + "'"); // åå¸åä½id |
| | | } else { |
| | | rsb.append(",'serverurl':''"); // åå¸åä½id |
| | | } |
| | | rsb.append("}"); |
| | | } |
| | | |
| | | return rsb.toString(); |
| | | } |
| | | |
| | | /** |
| | | * è·å第ä¸ä¸ªé»è®¤ä¸é¢ï¼ä¸å¡ä¸é¢ï¼ |
| | | */ |
| | | @ResponseBody |
| | | @GetMapping("getFirstDefaultTheme") |
| | | public String getFirstDefaultTheme(Integer userId) { |
| | | List<Res_Theme> resThemeList = resThemeService.getDefaultThemeList(userId);// è·åä¸å¡ä¸é¢é»è®¤ä¸é¢ï¼ä¸´æ¶å»é¤ç¨æ·è¿æ»¤ |
| | | StringBuilder sb = new StringBuilder(); |
| | | int i = 0; |
| | | for (Res_Theme resTheme : resThemeList) { |
| | | if(i == 0) { |
| | | sb.append("{"); |
| | | sb.append("id: " + resTheme.getThemeid()); |
| | | sb.append(", title: '" + resTheme.getTitle() + "'"); |
| | | sb.append("}"); |
| | | i += 1; |
| | | } |
| | | } |
| | | return "(" + sb.toString() + ")"; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.landtool.lanbase.modules.api.controller; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import org.apache.shiro.authz.annotation.RequiresPermissions; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.alibaba.fastjson.serializer.SerializerFeature; |
| | | import com.github.pagehelper.Page; |
| | | import com.github.pagehelper.PageHelper; |
| | | import com.landtool.lanbase.modules.api.utils.PageBean; |
| | | import com.landtool.lanbase.modules.res.entity.Res_Catalog; |
| | | import com.landtool.lanbase.modules.res.entity.Res_MainInfo; |
| | | import com.landtool.lanbase.modules.res.entity.Role_ResCatalog; |
| | | import com.landtool.lanbase.modules.res.service.ResCatalogService; |
| | | import com.landtool.lanbase.modules.res.service.RoleResCatalogService; |
| | | import com.landtool.lanbase.modules.sys.controller.AbstractController; |
| | | @Controller |
| | | @RequestMapping("/api/res") |
| | | public class RoleResController extends AbstractController { |
| | | |
| | | |
| | | @Autowired |
| | | RoleResCatalogService roleResCatalogService; |
| | | |
| | | @Autowired |
| | | ResCatalogService resCatalogService; |
| | | |
| | | //æå
¥è§è²-èµæº 管ç |
| | | @ResponseBody |
| | | @GetMapping("insert") |
| | | public String insertRoleResCatalogRel(Role_ResCatalog bean) { |
| | | boolean result=roleResCatalogService.insertRoleResCatalogRel(bean); |
| | | return result?"æå
¥æå":"æå
¥å¤±è´¥"; |
| | | |
| | | |
| | | } |
| | | |
| | | @ResponseBody |
| | | @GetMapping("query") |
| | | public String queryRoleResCatalogRel(Role_ResCatalog bean) { |
| | | List<Role_ResCatalog> list=roleResCatalogService.queryRoleResCatalogRel(bean); |
| | | return JSONObject.toJSONStringWithDateFormat(list, "yyyy-MM-dd HH:mm:ss", SerializerFeature.PrettyFormat); |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @GetMapping("update") |
| | | public String updateRoleResCatalogRel(Role_ResCatalog bean) { |
| | | boolean result=roleResCatalogService.updateRoleResCatalogRel(bean); |
| | | return result?"æ´æ°æå":"æ´æ°å¤±è´¥"; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | //package com.landtool.lanbase.modules.api.controller; |
| | | // |
| | | //import org.slf4j.Logger; |
| | | //import org.slf4j.LoggerFactory; |
| | | //import org.springframework.stereotype.Controller; |
| | | //import org.springframework.ui.Model; |
| | | //import org.springframework.web.bind.annotation.GetMapping; |
| | | //import org.springframework.web.bind.annotation.RequestMapping; |
| | | //import org.springframework.web.bind.annotation.RequestMethod; |
| | | // |
| | | //@Controller |
| | | //public class ThymeleafDemoController { |
| | | // |
| | | // private Logger logger = LoggerFactory.getLogger(getClass()); |
| | | // /** |
| | | // * ä½¿ç¨æ¨¡æ¿å¼æçç¤ºä¾ |
| | | // * @return |
| | | // */ |
| | | // @RequestMapping(value = "/api/demo",method = RequestMethod.GET) |
| | | // public String demo(Model model) { |
| | | // model.addAttribute("name", "模æ¿å¼ææµè¯"); |
| | | // return "demo"; //è¥htmlæä»¶æ¾å¨exampleæä»¶å¤¹ä¸ï¼ return "example/demo"; |
| | | // } |
| | | // |
| | | // /** |
| | | // * |
| | | // * å¼ç¨æ¨¡æ¿é¡µç¤ºä¾ |
| | | // * @return |
| | | // */ |
| | | // @RequestMapping(value = "/api/MasterDemo", method = RequestMethod.GET) |
| | | // public String MasterDemo(Model model){ |
| | | // return "MasterDemo"; |
| | | // } |
| | | //} |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.landtool.lanbase.modules.api.intercept; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | import org.apache.commons.lang.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.HttpStatus; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.web.method.HandlerMethod; |
| | | import org.springframework.web.servlet.handler.HandlerInterceptorAdapter; |
| | | |
| | | import com.landtool.lanbase.common.exception.LanbaseException; |
| | | import com.landtool.lanbase.modules.api.annotation.Login; |
| | | import com.landtool.lanbase.modules.api.utils.JwtUtils; |
| | | |
| | | import io.jsonwebtoken.Claims; |
| | | |
| | | /** |
| | | * @author lanbase |
| | | * @Description: TODO(api interceptor) |
| | | * @date 2017-9-27 14:41 |
| | | */ |
| | | @Component |
| | | public class ApiInterceptor extends HandlerInterceptorAdapter { |
| | | |
| | | @Autowired |
| | | private JwtUtils jwtUtils; |
| | | |
| | | @Override |
| | | public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { |
| | | //æ¥å£æ¹æ³å¦ææ²¡æLogin注解ï¼åä¸éè¦æ ¡éªtoken |
| | | Login annotation; |
| | | if(handler instanceof HandlerMethod) { |
| | | annotation = ((HandlerMethod) handler).getMethodAnnotation(Login.class); |
| | | }else{ |
| | | return true; |
| | | } |
| | | |
| | | if(annotation == null){ |
| | | return true; |
| | | } |
| | | |
| | | //è·åtoken |
| | | String token = request.getHeader(jwtUtils.getHeader()); |
| | | if(StringUtils.isBlank(token)){ |
| | | token = request.getParameter(jwtUtils.getHeader()); |
| | | } |
| | | |
| | | //æ ¡éªtoken |
| | | if(StringUtils.isBlank(token)){ |
| | | throw new LanbaseException(jwtUtils.getHeader() + "ä¸è½ä¸ºç©º", HttpStatus.UNAUTHORIZED.value()); |
| | | } |
| | | Claims claims = jwtUtils.getClaimByToken(token); |
| | | if(claims == null || jwtUtils.isTokenExpired(claims.getExpiration())){ |
| | | throw new LanbaseException(jwtUtils.getHeader() + "å·²ç»å¤±æ", HttpStatus.UNAUTHORIZED.value()); |
| | | } |
| | | |
| | | return true; |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.landtool.lanbase.modules.api.utils; |
| | | |
| | | |
| | | import java.security.MessageDigest; |
| | | import java.util.Base64; |
| | | |
| | | import javax.crypto.KeyGenerator; |
| | | import javax.crypto.Mac; |
| | | import javax.crypto.SecretKey; |
| | | import javax.crypto.spec.SecretKeySpec; |
| | | |
| | | |
| | | //import sun.misc.BASE64Decoder; |
| | | //import sun.misc.BASE64Encoder; |
| | | |
| | | /** |
| | | * åºç¡å å¯ç»ä»¶ |
| | | * @author TanBin |
| | | */ |
| | | public abstract class CoderUtils { |
| | | public static final String KEY_SHA = "SHA"; |
| | | public static final String KEY_MD5 = "MD5"; |
| | | |
| | | /** |
| | | * MACç®æ³å¯é以ä¸å¤ç§ç®æ³ |
| | | * <pre> |
| | | * HmacMD5 |
| | | * HmacSHA1 |
| | | * HmacSHA256 |
| | | * HmacSHA384 |
| | | * HmacSHA512 |
| | | * </pre> |
| | | */ |
| | | public static final String KEY_MAC = "HmacMD5"; |
| | | |
| | | /** |
| | | * BASE64å å¯ |
| | | * @param key |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | public static String encryptBASE64(byte[] data) { |
| | | //text.getBytes("UTF-8"); new String(decoder.decode(encodedText), "UTF-8") |
| | | //æ³1ï¼ä½¿ç¨sun.miscå¥ä»¶ã1.6ä¹åï¼ æçä¸å¥½ï¼æ°JDK䏿¯æ |
| | | // return (new BASE64Encoder()).encodeBuffer(data); |
| | | |
| | | //æ³2ï¼ä½¿ç¨Apache Commons Codecã |
| | | // return (new Base64()).encodeToString(data); |
| | | |
| | | //æ³3ï¼ä½¿ç¨Java 8çjava.utilå¥ä»¶ã æçæ¯1ç11åï¼æ¯2ç3å以ä¸ã |
| | | return Base64.getEncoder().encodeToString(data); |
| | | } |
| | | |
| | | /** |
| | | * BASE64è§£å¯ |
| | | * @param key |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | public static byte[] decryptBASE64(String key) { |
| | | //æ³1ï¼ä½¿ç¨sun.miscå¥ä»¶ã æçä¸å¥½ï¼æ°JDK䏿¯æ |
| | | // return (new BASE64Decoder()).decodeBuffer(key); |
| | | |
| | | //æ³2ï¼ä½¿ç¨Apache Commons Codecã |
| | | // return (new Base64()).decode(key); |
| | | |
| | | //æ³3ï¼ä½¿ç¨Java 8çjava.utilå¥ä»¶ã æçæ¯1ç11åï¼æ¯2ç3å以ä¸ã |
| | | return Base64.getDecoder().decode(key); |
| | | } |
| | | |
| | | /** |
| | | * MD5å å¯ |
| | | * @param data |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | public static byte[] encryptMD5(byte[] data) throws Exception{ |
| | | MessageDigest md5 = MessageDigest.getInstance(KEY_MD5); |
| | | md5.update(data); |
| | | return md5.digest(); |
| | | } |
| | | |
| | | /** |
| | | * èå¾çMD5å å¯ç®æ³ |
| | | * @param text |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | public static String lantuEncryptMD5(String text) throws Exception{ |
| | | byte[] b = encryptMD5(text.getBytes("UTF-8")); |
| | | String key = convertToHexString(b); |
| | | //转为大å |
| | | key = key.toUpperCase(); |
| | | //ååº |
| | | char[] array = key.toCharArray(); |
| | | String reverseKey = ""; |
| | | for (int i = array.length-1; i >= 0; i--) { |
| | | reverseKey += array[i]; |
| | | } |
| | | return reverseKey; |
| | | } |
| | | |
| | | /** |
| | | * åèæ°ç»è½¬ä¸º32ä½å符串 |
| | | * @param data |
| | | * @return |
| | | */ |
| | | private static String convertToHexString(byte data[]) { |
| | | StringBuffer strBuffer = new StringBuffer(); |
| | | for (int i = 0; i < data.length; i++) { |
| | | //strBuffer.append(Integer.toHexString(0xff & data[i])); //30bit |
| | | String haxHex = Integer.toHexString(data[i] & 0xFF); |
| | | if(haxHex.length() < 2){ |
| | | strBuffer.append("0"); |
| | | } |
| | | strBuffer.append(haxHex); |
| | | } |
| | | return strBuffer.toString(); |
| | | } |
| | | |
| | | /** |
| | | * SHAå å¯ |
| | | * @param data |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | public static byte[] encryptSHA(byte[] data) throws Exception{ |
| | | MessageDigest sha = MessageDigest.getInstance(KEY_SHA); |
| | | sha.update(data); |
| | | return sha.digest(); |
| | | } |
| | | |
| | | /** |
| | | * åå§åHMACå¯é¥ |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | public static String initMacKey() throws Exception{ |
| | | KeyGenerator keyGenerator = KeyGenerator.getInstance(KEY_MAC); |
| | | SecretKey secretKey = keyGenerator.generateKey(); |
| | | return encryptBASE64(secretKey.getEncoded()); |
| | | } |
| | | |
| | | /** |
| | | * HMACå å¯ |
| | | * @param data |
| | | * @param key |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | public static byte[] encryptHMAC(byte[] data, String key) throws Exception{ |
| | | SecretKey secretKey = new SecretKeySpec(decryptBASE64(key), KEY_MAC); |
| | | Mac mac = Mac.getInstance(secretKey.getAlgorithm()); |
| | | mac.init(secretKey); |
| | | return mac.doFinal(data); |
| | | } |
| | | |
| | | public static void main(String[] args) { |
| | | String inputStr = "123456"; |
| | | System.err.println("åæ:" + inputStr); |
| | | try { |
| | | String codeBASE64 = encryptBASE64(inputStr.getBytes("UTF-8")); |
| | | String codeMD5 = lantuEncryptMD5(inputStr); |
| | | byte[] codeSHA = encryptSHA(inputStr.getBytes("UTF-8")); |
| | | |
| | | String key = initMacKey(); |
| | | System.err.println("Macå¯é¥:" + key); |
| | | byte[] codeHMAC = encryptHMAC(inputStr.getBytes("UTF-8"), key); |
| | | |
| | | System.err.println("\nBASE64:" + codeBASE64); |
| | | System.err.println("BASE64è§£å¯:" + new String(decryptBASE64(codeBASE64),"UTF-8")); |
| | | System.err.println("MD5:" + codeMD5); |
| | | System.err.println("SHA:" + codeSHA); |
| | | System.err.println("HMAC:" + codeHMAC); |
| | | |
| | | } catch (Exception e) { |
| | | // TODO Auto-generated catch block |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.landtool.lanbase.modules.api.utils; |
| | | |
| | | import java.sql.Connection; |
| | | import java.sql.DriverManager; |
| | | |
| | | /** |
| | | * æµè¯æ°æ®åºè¿æ¥ |
| | | * @author Administrator |
| | | */ |
| | | public class DBConnection { |
| | | public static boolean TestOracleConnection(String serveraddress, String databasename, String username, String password, String port){ |
| | | String url = "jdbc:oracle:thin:@"+serveraddress+":"+port+"/"+databasename+""; |
| | | try { |
| | | Class.forName("oracle.jdbc.driver.OracleDriver"); |
| | | Connection conn = DriverManager.getConnection(url,username,password); |
| | | if(conn!=null){ |
| | | return true; |
| | | } |
| | | } catch (Exception e) { |
| | | return false; |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | public static boolean TestSQLServerConnection(String serveraddress, String databasename, String username,String password, String port) { |
| | | String url = "jdbc:sqlserver://"+serveraddress+";database="+databasename+""; |
| | | try { |
| | | Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver"); |
| | | Connection conn = DriverManager.getConnection(url,username,password); |
| | | if(conn!=null){ |
| | | return true; |
| | | } |
| | | } catch (Exception e) { |
| | | return false; |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | public static boolean TestMySQLConnection(String serveraddress, String databasename, String username,String password, String port) { |
| | | String url = "jdbc:mysql://"+serveraddress+":"+port+"/"+databasename; |
| | | try { |
| | | Class.forName("com.mysql.jdbc.Driver"); |
| | | Connection conn = DriverManager.getConnection(url,username,password); |
| | | if(conn!=null){ |
| | | return true; |
| | | } |
| | | } catch (Exception e) { |
| | | return false; |
| | | } |
| | | return false; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.landtool.lanbase.modules.api.utils; |
| | | |
| | | import java.io.StringWriter; |
| | | import java.io.Writer; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | import javax.xml.transform.OutputKeys; |
| | | import javax.xml.transform.Transformer; |
| | | import javax.xml.transform.TransformerFactory; |
| | | import javax.xml.transform.dom.DOMSource; |
| | | import javax.xml.transform.stream.StreamResult; |
| | | |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.w3c.dom.Attr; |
| | | import org.w3c.dom.DOMException; |
| | | import org.w3c.dom.NamedNodeMap; |
| | | import org.w3c.dom.Node; |
| | | import org.w3c.dom.NodeList; |
| | | |
| | | import com.landtool.lanbase.modules.res.entity.WebService.SchemaDefaultType; |
| | | |
| | | /** |
| | | * DOMè§£æå·¥å
·ç±» |
| | | * |
| | | * @author sjw |
| | | * @version [çæ¬å·, 2017å¹´12æ17æ¥] |
| | | * @see [ç¸å
³ç±»/æ¹æ³] |
| | | * @since [产å/模åçæ¬] |
| | | */ |
| | | public class DOMUtil { |
| | | /** |
| | | * Serialise the supplied W3C DOM subtree. |
| | | * <p/> |
| | | * The output is unformatted. |
| | | * |
| | | * @param nodeList The DOM subtree as a NodeList. |
| | | * @return The subtree in serailised form. |
| | | * @throws DOMException Unable to serialise the DOM. |
| | | */ |
| | | public static String serialize(NodeList nodeList) throws DOMException { |
| | | return serialize(nodeList, false); |
| | | } |
| | | |
| | | /** |
| | | * Serialise the supplied W3C DOM subtree. |
| | | * |
| | | * @param node The DOM node to be serialized. |
| | | * @param format Format the output. |
| | | * @return The subtree in serailised form. |
| | | * @throws DOMException Unable to serialise the DOM. |
| | | */ |
| | | public static String serialize(final Node node, boolean format) throws DOMException { |
| | | StringWriter writer = new StringWriter(); |
| | | serialize(node, format, writer); |
| | | return writer.toString(); |
| | | } |
| | | |
| | | /** |
| | | * the supplied W3C DOM subtree. |
| | | * |
| | | * @param node The DOM node to be serialized. |
| | | * @param format Format the output. |
| | | * @param writer The target writer for serialization. |
| | | * @throws DOMException Unable to serialise the DOM. |
| | | */ |
| | | public static void serialize(final Node node, boolean format, Writer writer) throws DOMException { |
| | | if (node.getNodeType() == Node.DOCUMENT_NODE) { |
| | | serialize(node.getChildNodes(), format, writer); |
| | | } else { |
| | | serialize(new NodeList() { |
| | | @Override |
| | | public Node item(int index) { |
| | | return node; |
| | | } |
| | | |
| | | @Override |
| | | public int getLength() { |
| | | return 1; |
| | | } |
| | | }, format, writer); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * Serialise the supplied W3C DOM subtree. |
| | | * |
| | | * @param nodeList The DOM subtree as a NodeList. |
| | | * @param format Format the output. |
| | | * @return The subtree in serailised form. |
| | | * @throws DOMException Unable to serialise the DOM. |
| | | */ |
| | | public static String serialize(NodeList nodeList, boolean format) throws DOMException { |
| | | StringWriter writer = new StringWriter(); |
| | | serialize(nodeList, format, writer); |
| | | return writer.toString(); |
| | | } |
| | | |
| | | /** |
| | | * Serialise the supplied W3C DOM subtree. |
| | | * |
| | | * @param nodeList The DOM subtree as a NodeList. |
| | | * @param format Format the output. |
| | | * @param writer The target writer for serialization. |
| | | * @throws DOMException Unable to serialise the DOM. |
| | | */ |
| | | public static void serialize(NodeList nodeList, boolean format, Writer writer) throws DOMException { |
| | | try { |
| | | // nodeList为空 |
| | | if (nodeList == null) { |
| | | throw new IllegalArgumentException( |
| | | "XmlUtil.serialize(NodeList nodeList, boolean format, Writer writer)ä¸åæ°nodeList为"); |
| | | } |
| | | TransformerFactory factory = TransformerFactory.newInstance(); |
| | | // è®¾ç½®æ ¼å¼å |
| | | if (format) { |
| | | try { |
| | | // (ç¨äºjdk1.5)设置缩è¿ï¼å¦æè¿è¡å¨1.4ä¸ä¼æåºå¼å¸¸ |
| | | factory.setAttribute("indent-number", new Integer(4)); |
| | | } catch (Exception e) { |
| | | throw new RuntimeException("设置TransformerFactoryç缩è¿é为4失败:" + e.getMessage()); |
| | | } |
| | | } |
| | | // åå¾transformer |
| | | Transformer transformer = factory.newTransformer(); |
| | | // 设置ç¼ç æ ¼å¼ |
| | | transformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8"); |
| | | // 设置æ¯å¦å¿½ç¥xml声æç段 |
| | | transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes"); |
| | | if (format) { |
| | | // 设置xmlæ¯å¦è¿è¡ç¼©è¿å¤ç |
| | | transformer.setOutputProperty(OutputKeys.INDENT, "yes"); |
| | | // (ç¨äºjdk1.4)ä¹å¯ä»¥è¿æ ·åhttp://xml.apache.org/xslt}indent-amountï¼åºå«åªæ¯å½å空é´ä¸ä¸æ · |
| | | transformer.setOutputProperty("{http://xml.apache.org/xalan}indent-amount", "4"); |
| | | } |
| | | // å¤çææçç»ç¹ |
| | | for (int i = 0; i < nodeList.getLength(); i++) { |
| | | Node node = nodeList.item(i); |
| | | if (isTextNode(node)) { |
| | | // å¦ææ¯ææ¬ç»ç¹ï¼åç´æ¥è¾åº |
| | | writer.write(node.getNodeValue()); |
| | | } else if (node.getNodeType() == Node.ATTRIBUTE_NODE) { |
| | | writer.write(((Attr) node).getValue()); |
| | | } else if (node.getNodeType() == Node.ELEMENT_NODE) { |
| | | transformer.transform(new DOMSource(node), new StreamResult(writer)); |
| | | } |
| | | } |
| | | } catch (Exception e) { |
| | | DOMException domExcep = new DOMException(DOMException.INVALID_ACCESS_ERR, |
| | | "Unable to serailise DOM subtree."); |
| | | domExcep.initCause(e); |
| | | throw domExcep; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 夿nodeæ¯å¦ä¸ºææ¬ç»ç¹ |
| | | * |
| | | * @param node |
| | | * @return |
| | | */ |
| | | public static boolean isTextNode(Node node) { |
| | | short nodeType; |
| | | |
| | | if (node == null) { |
| | | return false; |
| | | } |
| | | nodeType = node.getNodeType(); |
| | | |
| | | return nodeType == Node.CDATA_SECTION_NODE || nodeType == Node.TEXT_NODE; |
| | | } |
| | | |
| | | /** |
| | | * 夿ç»ç¹ç屿§æ¯å¦åå¨ |
| | | * |
| | | * @param node |
| | | * @param attributeName |
| | | * @return |
| | | */ |
| | | public static boolean assertNodeAttributeExist(Node node, String attributeName) { |
| | | boolean result = false; |
| | | if (node != null) { |
| | | NamedNodeMap attributeMap = node.getAttributes(); |
| | | Node attributeNode = attributeMap.getNamedItem(attributeName); |
| | | if (attributeNode != null) { |
| | | if (StringUtils.isNotEmpty(attributeNode.getNodeValue())) { |
| | | result = true; |
| | | } |
| | | } |
| | | } |
| | | return result; |
| | | } |
| | | |
| | | /** |
| | | * å°NodeList转æ¢ä¸ºList<Node> |
| | | * |
| | | * @param nodeList |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | public static List<Node> covertNodeListToList(NodeList nodeList) throws Exception { |
| | | List<Node> list = new ArrayList<Node>(); |
| | | if (nodeList != null) { |
| | | for (int i = 0; i < nodeList.getLength(); i++) { |
| | | list.add(nodeList.item(i)); |
| | | } |
| | | } |
| | | return list; |
| | | } |
| | | |
| | | /** |
| | | * å¾å°ç»ç¹ç屿§å¼ |
| | | * |
| | | * @param node |
| | | * @param attributeName |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | public static String getAttributeValue(Node node, String attributeName) throws Exception { |
| | | String attributeValue = ""; |
| | | if (node != null) { |
| | | NamedNodeMap attributeMap = node.getAttributes(); |
| | | Node attributeNode = attributeMap.getNamedItem(attributeName); |
| | | if (attributeNode != null) { |
| | | attributeValue = attributeNode.getNodeValue(); |
| | | } |
| | | } |
| | | return attributeValue; |
| | | } |
| | | |
| | | /** |
| | | * å¾å°ç»ç¹çname屿§å¼ |
| | | * |
| | | * @param node |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | public static String getNodeName(Node node) throws Exception { |
| | | return getAttributeValue(node, "name"); |
| | | } |
| | | |
| | | /** |
| | | * å¾å°ç»ç¹çtype屿§å¼ |
| | | * |
| | | * @param node |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | public static String getNodeType(Node node) throws Exception { |
| | | String type = getAttributeValue(node, "type"); |
| | | if (StringUtils.isNotEmpty(type)) { |
| | | if (type.indexOf(":") >= 0) { |
| | | return type.split(":")[1]; |
| | | } else { |
| | | return type; |
| | | } |
| | | } |
| | | return ""; |
| | | } |
| | | |
| | | /** |
| | | * å¾å°ç»ç¹çbase屿§å¼ï¼ç®åä»
ç¨äºsimpletypeç»ç¹ä¸restrictionç»ç¹ |
| | | * |
| | | * @param node |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | public static String getNodeBase(Node node) throws Exception { |
| | | String type = getAttributeValue(node, "base"); |
| | | if (StringUtils.isNotEmpty(type)) { |
| | | if (type.indexOf(":") >= 0) { |
| | | return type.split(":")[1]; |
| | | } else { |
| | | return type; |
| | | } |
| | | } |
| | | return ""; |
| | | } |
| | | |
| | | /** |
| | | * å¾å°ç»ç¹çmaxOccurs屿§å¼ |
| | | * |
| | | * @param node |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | public static String getNodeMaxOccurs(Node node) throws Exception { |
| | | return getAttributeValue(node, "maxOccurs"); |
| | | } |
| | | |
| | | /** |
| | | * å¾å°ç»ç¹çminOccurs屿§å¼ |
| | | * |
| | | * @param node |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | public static String getNodeMinOccurs(Node node) throws Exception { |
| | | return getAttributeValue(node, "minOccurs"); |
| | | } |
| | | |
| | | /** |
| | | * 夿typeæ¯å¦ä¸ºschemaé»è®¤çç±»å |
| | | * |
| | | * @param node |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | public static boolean isDefaultType(Node node) throws Exception { |
| | | boolean result = false; |
| | | if (node != null) { |
| | | String type = DOMUtil.getNodeType(node); |
| | | SchemaDefaultType[] defaultTypes = SchemaDefaultType.values(); |
| | | for (int i = 0; i < defaultTypes.length; i++) { |
| | | SchemaDefaultType defaultType = defaultTypes[i]; |
| | | if (type.equals(defaultType.getType())) { |
| | | result = true; |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | return result; |
| | | } |
| | | |
| | | /** |
| | | * 夿elementæ¯å¦ä¸ºæ°ç»ç±»å |
| | | * |
| | | * @param node |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | public static boolean isArray(Node node) throws Exception { |
| | | boolean result = false; |
| | | if (node != null) { |
| | | String minOccurs = DOMUtil.getNodeMinOccurs(node); |
| | | String maxOccurs = DOMUtil.getNodeMaxOccurs(node); |
| | | boolean marker = maxOccurs != null && !"".equals(maxOccurs) |
| | | && ("unbounded".equals(maxOccurs) || Integer.valueOf(maxOccurs) > 1); |
| | | if (marker) { |
| | | result = true; |
| | | } |
| | | } |
| | | return result; |
| | | } |
| | | |
| | | public static void removeTextNode(Node root) { |
| | | if (root.hasChildNodes()) { |
| | | NodeList children = root.getChildNodes(); |
| | | int count = children.getLength(); |
| | | for (int i = count - 1; i >= 0; i--) { |
| | | // éè¦ä»åå¾åå é¤ï¼é²æ¢åºç°æ²æ¼æåº |
| | | Node child = children.item(i); |
| | | if (child.getNodeType() == Node.TEXT_NODE || child.getNodeType() == Node.COMMENT_NODE) { |
| | | child.getParentNode().removeChild(child); |
| | | } else { |
| | | removeTextNode(child); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.landtool.lanbase.modules.api.utils; |
| | | |
| | | |
| | | import java.io.File; |
| | | |
| | | /** |
| | | * @Description: å 餿件 |
| | | * @author ykm |
| | | * @param |
| | | * @return |
| | | * @date 2018/4/19 16:42 |
| | | */ |
| | | public class DeleteFileUtils { |
| | | |
| | | public static boolean deletefile(String filePath) { |
| | | File file = new File(filePath); |
| | | if(file.exists() && file.isFile()) { |
| | | if(file.delete()) { |
| | | System.out.println("å 餿件æå"); |
| | | return true; |
| | | } |
| | | else { |
| | | System.out.println("å é¤æä»¶å¤±è´¥"); |
| | | return false; |
| | | } |
| | | } |
| | | else { |
| | | System.out.println(filePath + "æ¤è·¯å¾ä¸å卿件"); |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | public static boolean deleteDiretory(String dirPath) { |
| | | if(!dirPath.endsWith(File.separator)) { |
| | | dirPath = dirPath + File.separator; |
| | | File file = new File(dirPath); |
| | | boolean flag = false; |
| | | if(file.exists() && file.isDirectory()) { |
| | | File[] files = file.listFiles(); |
| | | for (int i=0;i<files.length;i++) { |
| | | if(files[i].isFile()) { |
| | | flag = DeleteFileUtils.deletefile(files[i].getAbsolutePath()); |
| | | if(!flag) break; |
| | | } |
| | | else if(files[i].isDirectory()) { |
| | | flag = DeleteFileUtils.deleteDiretory(files[i].getAbsolutePath()); |
| | | if(!flag) break; |
| | | } |
| | | } |
| | | } |
| | | if(!flag) { |
| | | System.out.println("å é¤æä»¶å¤¹å¤±è´¥"); |
| | | return false; |
| | | } |
| | | if(file.delete()) { |
| | | System.out.println("å 餿件夹æå"); |
| | | return true; |
| | | } |
| | | else { |
| | | System.out.println("å 餿件å失败"); |
| | | return false; |
| | | } |
| | | } |
| | | else { |
| | | System.out.println("æä»¶å¤¹ä¸åå¨"); |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | public static boolean deletefileUtils(String filepath) { |
| | | File file = new File(filepath); |
| | | if(file.exists()) { |
| | | if(file.isFile()) { |
| | | return DeleteFileUtils.deletefile(filepath); |
| | | } |
| | | else if (file.isDirectory()) { |
| | | return DeleteFileUtils.deleteDiretory(filepath); |
| | | } |
| | | else { |
| | | System.out.println("æ æ³å¤æç±»å"); |
| | | return false; |
| | | } |
| | | } |
| | | else { |
| | | System.out.println("æä»¶ä¸åå¨"); |
| | | return false; |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.landtool.lanbase.modules.api.utils; |
| | | |
| | | |
| | | import java.io.File; |
| | | import java.io.FileOutputStream; |
| | | import java.io.IOException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Calendar; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | import org.apache.poi.hssf.usermodel.HSSFRow; |
| | | import org.apache.poi.hssf.usermodel.HSSFSheet; |
| | | import org.apache.poi.hssf.usermodel.HSSFWorkbook; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | |
| | | |
| | | public class Excel { |
| | | |
| | | |
| | | //Route:读åé
ç½®æä»¶çä¸ä¼ è·¯å¾ |
| | | public static String going(HttpServletResponse response,String[] biaoti,String json,String Route) throws IOException { |
| | | //å建HSSFWorkbook对象(excelçææ¡£å¯¹è±¡) |
| | | HSSFWorkbook wb = new HSSFWorkbook(); |
| | | //å»ºç«æ°çsheet对象ï¼excelç表åï¼ |
| | | HSSFSheet sheet = wb.createSheet("èµæºè¡¨"); |
| | | sheet.setDefaultColumnWidth(30); |
| | | //å¨sheetéå建第ä¸è¡ï¼åæ°ä¸ºè¡ç´¢å¼(excelçè¡)ï¼å¯ä»¥æ¯0ï½65535ä¹é´çä»»ä½ä¸ä¸ª |
| | | HSSFRow row1 = sheet.createRow(0); |
| | | //å建åå
æ ¼ï¼excelçåå
æ ¼ï¼åæ°ä¸ºåç´¢å¼ï¼å¯ä»¥æ¯0ï½255ä¹é´çä»»ä½ä¸ä¸ª |
| | | // HSSFCell cell = row1.createCell(0); |
| | | //设置åå
æ ¼å
容 |
| | | // cell.setCellValue("å¦åèè¯æç»©ä¸è§è¡¨"); |
| | | //åå¹¶åå
æ ¼CellRangeAddressæé 忰便¬¡è¡¨ç¤ºèµ·å§è¡ï¼æªè³è¡ï¼èµ·å§åï¼ æªè³å |
| | | // sheet.addMergedRegion(new CellRangeAddress(0,0, 0,3)); |
| | | //å¨sheetéå建第äºè¡ |
| | | HSSFRow row2 = sheet.createRow(0); |
| | | //å建åå
æ ¼å¹¶è®¾ç½®åå
æ ¼å
容 |
| | | //è·åæ é¢çé¿åº¦ |
| | | for (int i = 0; i < biaoti.length; i++) { |
| | | row2.createCell(i).setCellValue(biaoti[i]); |
| | | } |
| | | //å°ä¼ å
¥çstring转æ¢ä¸ºjson |
| | | JSONArray topics = JSON.parseArray(json); |
| | | // JSONArray topics = obj.getJSONArray("topics"); |
| | | |
| | | //å¨sheetéå建第Nè¡ |
| | | for (int i = 0; i < topics.size(); i++) { |
| | | JSONObject obj1 = JSON.parseObject(topics.getString(i)); |
| | | HSSFRow row = sheet.createRow((int) i + 1); |
| | | row.createCell(0).setCellValue(obj1.getString("resourceid")); |
| | | row.createCell(1).setCellValue(obj1.getString("title")); |
| | | row.createCell(2).setCellValue(obj1.getString("mulu")); |
| | | row.createCell(3).setCellValue(obj1.getString("resourceclass")); |
| | | |
| | | row.createCell(4).setCellValue(obj1.getString("sharprotocol")); |
| | | row.createCell(5).setCellValue(obj1.getString("serverurl")); |
| | | |
| | | row.createCell(6).setCellValue(obj1.getString("pubdate")); |
| | | row.createCell(7).setCellValue(obj1.getString("pubunitid")); |
| | | row.createCell(8).setCellValue(obj1.getString("createuserid")); |
| | | } |
| | | |
| | | //è¾åºExcelæä»¶ |
| | | |
| | | SimpleDateFormat sFormat=new SimpleDateFormat("yyyyMMddHHmmss"); |
| | | Calendar calendar=Calendar.getInstance(); |
| | | //è·åç³»ç»å½åæ¶é´å¹¶å°å
¶è½¬æ¢ä¸ºstringç±»å |
| | | String name=sFormat.format(calendar.getTime()); |
| | | // alert ykm 2019/03/04 |
| | | name = name + "-" + topics.size(); |
| | | File fileDir = new File(Route); |
| | | if(!fileDir.exists()){ |
| | | fileDir.mkdirs(); |
| | | } |
| | | FileOutputStream output=new FileOutputStream(Route+name+".xls"); |
| | | wb.write(output); |
| | | output.flush(); |
| | | return name +".xls"; |
| | | } |
| | | |
| | | public static String FWPHgoing(HttpServletResponse response,String[] biaoti,String json,String Route) throws IOException { |
| | | //å建HSSFWorkbook对象(excelçææ¡£å¯¹è±¡) |
| | | HSSFWorkbook wb = new HSSFWorkbook(); |
| | | //å»ºç«æ°çsheet对象ï¼excelç表åï¼ |
| | | HSSFSheet sheet = wb.createSheet("è®¿é®æè¡è¡¨"); |
| | | sheet.setDefaultColumnWidth(30); |
| | | //å¨sheetéå建第ä¸è¡ï¼åæ°ä¸ºè¡ç´¢å¼(excelçè¡)ï¼å¯ä»¥æ¯0ï½65535ä¹é´çä»»ä½ä¸ä¸ª |
| | | HSSFRow row1 = sheet.createRow(0); |
| | | //å建åå
æ ¼ï¼excelçåå
æ ¼ï¼åæ°ä¸ºåç´¢å¼ï¼å¯ä»¥æ¯0ï½255ä¹é´çä»»ä½ä¸ä¸ª |
| | | // HSSFCell cell = row1.createCell(0); |
| | | //设置åå
æ ¼å
容 |
| | | // cell.setCellValue("å¦åèè¯æç»©ä¸è§è¡¨"); |
| | | //åå¹¶åå
æ ¼CellRangeAddressæé 忰便¬¡è¡¨ç¤ºèµ·å§è¡ï¼æªè³è¡ï¼èµ·å§åï¼ æªè³å |
| | | // sheet.addMergedRegion(new CellRangeAddress(0,0, 0,3)); |
| | | //å¨sheetéå建第äºè¡ |
| | | HSSFRow row2 = sheet.createRow(0); |
| | | //å建åå
æ ¼å¹¶è®¾ç½®åå
æ ¼å
容 |
| | | //è·åæ é¢çé¿åº¦ |
| | | for (int i = 0; i < biaoti.length; i++) { |
| | | row2.createCell(i).setCellValue(biaoti[i]); |
| | | } |
| | | //å°ä¼ å
¥çstring转æ¢ä¸ºjson |
| | | // JSONObject obj = JSON.parseObject(json); |
| | | JSONArray topics = JSON.parseArray(json); |
| | | |
| | | //å¨sheetéå建第Nè¡ |
| | | for (int i = 0; i < topics.size(); i++) { |
| | | JSONObject obj1 = JSON.parseObject(topics.getString(i)); |
| | | HSSFRow row = sheet.createRow((int) i + 1); |
| | | row.createCell(0).setCellValue(obj1.getString("resourceid")); |
| | | row.createCell(1).setCellValue(obj1.getString("title")); |
| | | row.createCell(2).setCellValue(obj1.getString("resourceclass")); |
| | | row.createCell(3).setCellValue(obj1.getString("pubunitid")); |
| | | row.createCell(4).setCellValue(obj1.getString("pubdate")); |
| | | row.createCell(5).setCellValue(obj1.getString("fangwenpaihang")); |
| | | } |
| | | |
| | | //.....çç¥é¨å代ç |
| | | |
| | | |
| | | //è¾åºExcelæä»¶ |
| | | |
| | | SimpleDateFormat sFormat=new SimpleDateFormat("yyyyMMddHHmmss"); |
| | | Calendar calendar=Calendar.getInstance(); |
| | | //è·åç³»ç»å½åæ¶é´å¹¶å°å
¶è½¬æ¢ä¸ºstringç±»å |
| | | String name=sFormat.format(calendar.getTime()); |
| | | |
| | | FileOutputStream output=new FileOutputStream(Route+name+".xls"); |
| | | wb.write(output); |
| | | output.flush(); |
| | | System.out.println( name+".xls"); |
| | | return name+".xls"; |
| | | } |
| | | |
| | | public static String SCgoing(HttpServletResponse response,String[] biaoti,String json,String Route) throws IOException { |
| | | //å建HSSFWorkbook对象(excelçææ¡£å¯¹è±¡) |
| | | HSSFWorkbook wb = new HSSFWorkbook(); |
| | | //å»ºç«æ°çsheet对象ï¼excelç表åï¼ |
| | | HSSFSheet sheet = wb.createSheet("æ¶è表"); |
| | | sheet.setDefaultColumnWidth(30); |
| | | //å¨sheetéå建第ä¸è¡ï¼åæ°ä¸ºè¡ç´¢å¼(excelçè¡)ï¼å¯ä»¥æ¯0ï½65535ä¹é´çä»»ä½ä¸ä¸ª |
| | | HSSFRow row1 = sheet.createRow(0); |
| | | //å建åå
æ ¼ï¼excelçåå
æ ¼ï¼åæ°ä¸ºåç´¢å¼ï¼å¯ä»¥æ¯0ï½255ä¹é´çä»»ä½ä¸ä¸ª |
| | | // HSSFCell cell = row1.createCell(0); |
| | | //设置åå
æ ¼å
容 |
| | | // cell.setCellValue("å¦åèè¯æç»©ä¸è§è¡¨"); |
| | | //åå¹¶åå
æ ¼CellRangeAddressæé 忰便¬¡è¡¨ç¤ºèµ·å§è¡ï¼æªè³è¡ï¼èµ·å§åï¼ æªè³å |
| | | // sheet.addMergedRegion(new CellRangeAddress(0,0, 0,3)); |
| | | //å¨sheetéå建第äºè¡ |
| | | HSSFRow row2 = sheet.createRow(0); |
| | | //å建åå
æ ¼å¹¶è®¾ç½®åå
æ ¼å
容 |
| | | //è·åæ é¢çé¿åº¦ |
| | | for (int i = 0; i < biaoti.length; i++) { |
| | | row2.createCell(i).setCellValue(biaoti[i]); |
| | | } |
| | | //å°ä¼ å
¥çstring转æ¢ä¸ºjson |
| | | JSONArray topics = JSON.parseArray(json); |
| | | // JSONArray topics = obj.getJSONArray("topics"); |
| | | |
| | | //å¨sheetéå建第Nè¡ |
| | | for (int i = 0; i < topics.size(); i++) { |
| | | JSONObject obj1 = JSON.parseObject(topics.getString(i)); |
| | | HSSFRow row = sheet.createRow((int) i + 1); |
| | | row.createCell(0).setCellValue(obj1.getString("resourceid")); |
| | | row.createCell(1).setCellValue(obj1.getString("title")); |
| | | row.createCell(2).setCellValue(obj1.getString("resourceclass")); |
| | | row.createCell(3).setCellValue(obj1.getString("pubunitname")); |
| | | row.createCell(4).setCellValue(obj1.getString("shoucangdate")); |
| | | } |
| | | |
| | | //.....çç¥é¨å代ç |
| | | |
| | | |
| | | //è¾åºExcelæä»¶ |
| | | |
| | | SimpleDateFormat sFormat=new SimpleDateFormat("yyyyMMddHHmmss"); |
| | | Calendar calendar=Calendar.getInstance(); |
| | | //è·åç³»ç»å½åæ¶é´å¹¶å°å
¶è½¬æ¢ä¸ºstringç±»å |
| | | String name=sFormat.format(calendar.getTime()); |
| | | |
| | | FileOutputStream output=new FileOutputStream(Route+name+".xls"); |
| | | wb.write(output); |
| | | output.flush(); |
| | | System.out.println( name+".xls"); |
| | | return name+".xls"; |
| | | } |
| | | |
| | | public static String ZXgoing(HttpServletResponse response,String[] biaoti,String json,String Route) throws IOException { |
| | | //å建HSSFWorkbook对象(excelçææ¡£å¯¹è±¡) |
| | | HSSFWorkbook wb = new HSSFWorkbook(); |
| | | //å»ºç«æ°çsheet对象ï¼excelç表åï¼ |
| | | HSSFSheet sheet = wb.createSheet("ææ°èµæº"); |
| | | sheet.setDefaultColumnWidth(30); |
| | | //å¨sheetéå建第ä¸è¡ï¼åæ°ä¸ºè¡ç´¢å¼(excelçè¡)ï¼å¯ä»¥æ¯0ï½65535ä¹é´çä»»ä½ä¸ä¸ª |
| | | HSSFRow row1 = sheet.createRow(0); |
| | | //å建åå
æ ¼ï¼excelçåå
æ ¼ï¼åæ°ä¸ºåç´¢å¼ï¼å¯ä»¥æ¯0ï½255ä¹é´çä»»ä½ä¸ä¸ª |
| | | // HSSFCell cell = row1.createCell(0); |
| | | //设置åå
æ ¼å
容 |
| | | // cell.setCellValue("å¦åèè¯æç»©ä¸è§è¡¨"); |
| | | //åå¹¶åå
æ ¼CellRangeAddressæé 忰便¬¡è¡¨ç¤ºèµ·å§è¡ï¼æªè³è¡ï¼èµ·å§åï¼ æªè³å |
| | | // sheet.addMergedRegion(new CellRangeAddress(0,0, 0,3)); |
| | | //å¨sheetéå建第äºè¡ |
| | | HSSFRow row2 = sheet.createRow(0); |
| | | //å建åå
æ ¼å¹¶è®¾ç½®åå
æ ¼å
容 |
| | | //è·åæ é¢çé¿åº¦ |
| | | for (int i = 0; i < biaoti.length; i++) { |
| | | row2.createCell(i).setCellValue(biaoti[i]); |
| | | } |
| | | //å°ä¼ å
¥çstring转æ¢ä¸ºjson |
| | | // JSONObject obj = JSON.parseObject(json); |
| | | JSONArray topics = JSON.parseArray(json); |
| | | |
| | | //å¨sheetéå建第Nè¡ |
| | | for (int i = 0; i < topics.size(); i++) { |
| | | JSONObject obj1 = JSON.parseObject(topics.getString(i)); |
| | | HSSFRow row = sheet.createRow((int) i + 1); |
| | | row.createCell(0).setCellValue(obj1.getString("resourceid")); |
| | | row.createCell(1).setCellValue(obj1.getString("title")); |
| | | row.createCell(2).setCellValue(obj1.getString("resourceclass")); |
| | | row.createCell(3).setCellValue(obj1.getString("pubunitid")); |
| | | row.createCell(4).setCellValue(obj1.getString("pubdate")); |
| | | } |
| | | |
| | | //.....çç¥é¨å代ç |
| | | |
| | | |
| | | //è¾åºExcelæä»¶ |
| | | |
| | | SimpleDateFormat sFormat=new SimpleDateFormat("yyyyMMddHHmmss"); |
| | | Calendar calendar=Calendar.getInstance(); |
| | | //è·åç³»ç»å½åæ¶é´å¹¶å°å
¶è½¬æ¢ä¸ºstringç±»å |
| | | String name=sFormat.format(calendar.getTime()); |
| | | |
| | | FileOutputStream output=new FileOutputStream(Route+name+".xls"); |
| | | wb.write(output); |
| | | output.flush(); |
| | | System.out.println( name+".xls"); |
| | | return name+".xls"; |
| | | } |
| | | |
| | | public static String SQgoing(HttpServletResponse response,String[] biaoti,String json,String Route) throws IOException { |
| | | //å建HSSFWorkbook对象(excelçææ¡£å¯¹è±¡) |
| | | HSSFWorkbook wb = new HSSFWorkbook(); |
| | | //å»ºç«æ°çsheet对象ï¼excelç表åï¼ |
| | | HSSFSheet sheet = wb.createSheet("ç³è¯·èµæºè¡¨"); |
| | | sheet.setDefaultColumnWidth(30); |
| | | //å¨sheetéå建第ä¸è¡ï¼åæ°ä¸ºè¡ç´¢å¼(excelçè¡)ï¼å¯ä»¥æ¯0ï½65535ä¹é´çä»»ä½ä¸ä¸ª |
| | | HSSFRow row1 = sheet.createRow(0); |
| | | //å建åå
æ ¼ï¼excelçåå
æ ¼ï¼åæ°ä¸ºåç´¢å¼ï¼å¯ä»¥æ¯0ï½255ä¹é´çä»»ä½ä¸ä¸ª |
| | | // HSSFCell cell = row1.createCell(0); |
| | | //设置åå
æ ¼å
容 |
| | | // cell.setCellValue("å¦åèè¯æç»©ä¸è§è¡¨"); |
| | | //åå¹¶åå
æ ¼CellRangeAddressæé 忰便¬¡è¡¨ç¤ºèµ·å§è¡ï¼æªè³è¡ï¼èµ·å§åï¼ æªè³å |
| | | // sheet.addMergedRegion(new CellRangeAddress(0,0, 0,3)); |
| | | //å¨sheetéå建第äºè¡ |
| | | HSSFRow row2 = sheet.createRow(0); |
| | | //å建åå
æ ¼å¹¶è®¾ç½®åå
æ ¼å
容 |
| | | //è·åæ é¢çé¿åº¦ |
| | | for (int i = 0; i < biaoti.length; i++) { |
| | | row2.createCell(i).setCellValue(biaoti[i]); |
| | | } |
| | | //å°ä¼ å
¥çstring转æ¢ä¸ºjson |
| | | // JSONObject obj = JSON.parseObject(json); |
| | | // JSONArray topics = obj.getJSONArray("topics"); |
| | | JSONArray topics = JSON.parseArray(json); |
| | | |
| | | //å¨sheetéå建第Nè¡ |
| | | for (int i = 0; i < topics.size(); i++) { |
| | | JSONObject obj1 = JSON.parseObject(topics.getString(i)); |
| | | HSSFRow row = sheet.createRow((int) i + 1); |
| | | row.createCell(0).setCellValue(obj1.getString("resourceid")); |
| | | row.createCell(1).setCellValue(obj1.getString("title")); |
| | | row.createCell(2).setCellValue(obj1.getString("resourceclass")); |
| | | row.createCell(3).setCellValue(obj1.getString("pubunitid")); |
| | | row.createCell(4).setCellValue(obj1.getString("shenqingdate")); |
| | | row.createCell(5).setCellValue(obj1.getString("shenqingstatus")); |
| | | } |
| | | |
| | | //.....çç¥é¨å代ç |
| | | |
| | | |
| | | //è¾åºExcelæä»¶ |
| | | |
| | | SimpleDateFormat sFormat=new SimpleDateFormat("yyyyMMddHHmmss"); |
| | | Calendar calendar=Calendar.getInstance(); |
| | | //è·åç³»ç»å½åæ¶é´å¹¶å°å
¶è½¬æ¢ä¸ºstringç±»å |
| | | String name=sFormat.format(calendar.getTime()); |
| | | |
| | | FileOutputStream output=new FileOutputStream(Route+name+".xls"); |
| | | wb.write(output); |
| | | output.flush(); |
| | | System.out.println( name+".xls"); |
| | | return name+".xls"; |
| | | } |
| | | |
| | | public static String TJgoing(HttpServletResponse response,String[] biaoti,String json,String Route) throws IOException { |
| | | //å建HSSFWorkbook对象(excelçææ¡£å¯¹è±¡) |
| | | HSSFWorkbook wb = new HSSFWorkbook(); |
| | | //å»ºç«æ°çsheet对象ï¼excelç表åï¼ |
| | | HSSFSheet sheet = wb.createSheet("èµæºç»è®¡"); |
| | | sheet.setDefaultColumnWidth(30); |
| | | //å¨sheetéå建第ä¸è¡ï¼åæ°ä¸ºè¡ç´¢å¼(excelçè¡)ï¼å¯ä»¥æ¯0ï½65535ä¹é´çä»»ä½ä¸ä¸ª |
| | | HSSFRow row1 = sheet.createRow(0); |
| | | //å建åå
æ ¼ï¼excelçåå
æ ¼ï¼åæ°ä¸ºåç´¢å¼ï¼å¯ä»¥æ¯0ï½255ä¹é´çä»»ä½ä¸ä¸ª |
| | | // HSSFCell cell = row1.createCell(0); |
| | | //设置åå
æ ¼å
容 |
| | | // cell.setCellValue("å¦åèè¯æç»©ä¸è§è¡¨"); |
| | | //åå¹¶åå
æ ¼CellRangeAddressæé 忰便¬¡è¡¨ç¤ºèµ·å§è¡ï¼æªè³è¡ï¼èµ·å§åï¼ æªè³å |
| | | // sheet.addMergedRegion(new CellRangeAddress(0,0, 0,3)); |
| | | //å¨sheetéå建第äºè¡ |
| | | HSSFRow row2 = sheet.createRow(0); |
| | | //å建åå
æ ¼å¹¶è®¾ç½®åå
æ ¼å
容 |
| | | //è·åæ é¢çé¿åº¦ |
| | | for (int i = 0; i < biaoti.length; i++) { |
| | | row2.createCell(i).setCellValue(biaoti[i]); |
| | | } |
| | | //å°ä¼ å
¥çstring转æ¢ä¸ºjson |
| | | JSONObject obj = JSON.parseObject(json); |
| | | JSONArray topics = obj.getJSONArray("topics"); |
| | | |
| | | //å¨sheetéå建第Nè¡ |
| | | for (int i = 0; i < topics.size(); i++) { |
| | | JSONObject obj1 = JSON.parseObject(topics.getString(i)); |
| | | HSSFRow row = sheet.createRow((int) i + 1); |
| | | row.createCell(0).setCellValue(obj1.getString("resourceid")); |
| | | row.createCell(1).setCellValue(obj1.getString("title")); |
| | | row.createCell(2).setCellValue(obj1.getString("mulu")); |
| | | row.createCell(3).setCellValue(obj1.getString("resourceclass")); |
| | | row.createCell(4).setCellValue(obj1.getString("pubdate")); |
| | | row.createCell(5).setCellValue(obj1.getString("pubunitid")); |
| | | row.createCell(6).setCellValue(obj1.getString("datasources")); |
| | | } |
| | | |
| | | //.....çç¥é¨å代ç |
| | | |
| | | |
| | | //è¾åºExcelæä»¶ |
| | | |
| | | SimpleDateFormat sFormat=new SimpleDateFormat("yyyyMMddHHmmss"); |
| | | Calendar calendar=Calendar.getInstance(); |
| | | //è·åç³»ç»å½åæ¶é´å¹¶å°å
¶è½¬æ¢ä¸ºstringç±»å |
| | | String name=sFormat.format(calendar.getTime()); |
| | | |
| | | FileOutputStream output=new FileOutputStream(Route+name+".xls"); |
| | | wb.write(output); |
| | | output.flush(); |
| | | System.out.println( name+".xls"); |
| | | return name+".xls"; |
| | | } |
| | | |
| | | public static String ShuJuKugoing(HttpServletResponse response,String[] biaoti,String json,String Route) throws IOException { |
| | | //å建HSSFWorkbook对象(excelçææ¡£å¯¹è±¡) |
| | | HSSFWorkbook wb = new HSSFWorkbook(); |
| | | //å»ºç«æ°çsheet对象ï¼excelç表åï¼ |
| | | HSSFSheet sheet = wb.createSheet("æ°æ®åºè¡¨"); |
| | | sheet.setDefaultColumnWidth(30); |
| | | //å¨sheetéå建第ä¸è¡ï¼åæ°ä¸ºè¡ç´¢å¼(excelçè¡)ï¼å¯ä»¥æ¯0ï½65535ä¹é´çä»»ä½ä¸ä¸ª |
| | | HSSFRow row1 = sheet.createRow(0); |
| | | //å建åå
æ ¼ï¼excelçåå
æ ¼ï¼åæ°ä¸ºåç´¢å¼ï¼å¯ä»¥æ¯0ï½255ä¹é´çä»»ä½ä¸ä¸ª |
| | | // HSSFCell cell = row1.createCell(0); |
| | | //设置åå
æ ¼å
容 |
| | | // cell.setCellValue("å¦åèè¯æç»©ä¸è§è¡¨"); |
| | | //åå¹¶åå
æ ¼CellRangeAddressæé 忰便¬¡è¡¨ç¤ºèµ·å§è¡ï¼æªè³è¡ï¼èµ·å§åï¼ æªè³å |
| | | // sheet.addMergedRegion(new CellRangeAddress(0,0, 0,3)); |
| | | //å¨sheetéå建第äºè¡ |
| | | HSSFRow row2 = sheet.createRow(0); |
| | | //å建åå
æ ¼å¹¶è®¾ç½®åå
æ ¼å
容 |
| | | //è·åæ é¢çé¿åº¦ |
| | | for (int i = 0; i < biaoti.length; i++) { |
| | | row2.createCell(i).setCellValue(biaoti[i]); |
| | | } |
| | | //å°ä¼ å
¥çstring转æ¢ä¸ºjson |
| | | JSONObject obj = JSON.parseObject(json); |
| | | JSONArray topics = obj.getJSONArray("topics"); |
| | | |
| | | //å¨sheetéå建第Nè¡ |
| | | for (int i = 0; i < topics.size(); i++) { |
| | | JSONObject obj1 = JSON.parseObject(topics.getString(i)); |
| | | HSSFRow row = sheet.createRow((int) i + 1); |
| | | for (int j = 0; j < biaoti.length; j++) { |
| | | row.createCell(j).setCellValue(obj1.getString(biaoti[j])); |
| | | } |
| | | } |
| | | |
| | | //.....çç¥é¨å代ç |
| | | |
| | | |
| | | //è¾åºExcelæä»¶ |
| | | |
| | | SimpleDateFormat sFormat=new SimpleDateFormat("yyyyMMddHHmmss"); |
| | | Calendar calendar=Calendar.getInstance(); |
| | | //è·åç³»ç»å½åæ¶é´å¹¶å°å
¶è½¬æ¢ä¸ºstringç±»å |
| | | String name=sFormat.format(calendar.getTime()); |
| | | |
| | | FileOutputStream output=new FileOutputStream(Route+name+".xls"); |
| | | wb.write(output); |
| | | output.flush(); |
| | | System.out.println( name+".xls"); |
| | | return name+".xls"; |
| | | } |
| | | |
| | | public static String SystemUrlgoing(HttpServletResponse response,String[] biaoti,String json,String Route) throws IOException { |
| | | //å建HSSFWorkbook对象(excelçææ¡£å¯¹è±¡) |
| | | HSSFWorkbook wb = new HSSFWorkbook(); |
| | | //å»ºç«æ°çsheet对象ï¼excelç表åï¼ |
| | | HSSFSheet sheet = wb.createSheet("èµæºå°å"); |
| | | sheet.setDefaultColumnWidth(30); |
| | | //å¨sheetéå建第ä¸è¡ï¼åæ°ä¸ºè¡ç´¢å¼(excelçè¡)ï¼å¯ä»¥æ¯0ï½65535ä¹é´çä»»ä½ä¸ä¸ª |
| | | HSSFRow row1 = sheet.createRow(0); |
| | | //å建åå
æ ¼ï¼excelçåå
æ ¼ï¼åæ°ä¸ºåç´¢å¼ï¼å¯ä»¥æ¯0ï½255ä¹é´çä»»ä½ä¸ä¸ª |
| | | // HSSFCell cell = row1.createCell(0); |
| | | //设置åå
æ ¼å
容 |
| | | // cell.setCellValue("å¦åèè¯æç»©ä¸è§è¡¨"); |
| | | //åå¹¶åå
æ ¼CellRangeAddressæé 忰便¬¡è¡¨ç¤ºèµ·å§è¡ï¼æªè³è¡ï¼èµ·å§åï¼ æªè³å |
| | | // sheet.addMergedRegion(new CellRangeAddress(0,0, 0,3)); |
| | | //å¨sheetéå建第äºè¡ |
| | | HSSFRow row2 = sheet.createRow(0); |
| | | //å建åå
æ ¼å¹¶è®¾ç½®åå
æ ¼å
容 |
| | | //è·åæ é¢çé¿åº¦ |
| | | for (int i = 0; i < biaoti.length; i++) { |
| | | row2.createCell(i).setCellValue(biaoti[i]); |
| | | } |
| | | //å°ä¼ å
¥çstring转æ¢ä¸ºjson |
| | | // JSONObject obj = JSON.parseObject(json); |
| | | // JSONArray topics = obj.getJSONArray("topics"); |
| | | JSONArray topics = JSON.parseArray(json); |
| | | |
| | | //å¨sheetéå建第Nè¡ |
| | | for (int i = 0; i < topics.size(); i++) { |
| | | JSONObject obj1 = JSON.parseObject(topics.getString(i)); |
| | | HSSFRow row = sheet.createRow((int) i + 1); |
| | | row.createCell(0).setCellValue(obj1.getString("resourceid")); |
| | | row.createCell(1).setCellValue(obj1.getString("title")); |
| | | row.createCell(2).setCellValue(obj1.getString("firstMapUrl")); |
| | | row.createCell(3).setCellValue(obj1.getString("token")); |
| | | } |
| | | |
| | | //.....çç¥é¨å代ç |
| | | |
| | | |
| | | //è¾åºExcelæä»¶ |
| | | |
| | | SimpleDateFormat sFormat=new SimpleDateFormat("yyyyMMddHHmmss"); |
| | | Calendar calendar=Calendar.getInstance(); |
| | | //è·åç³»ç»å½åæ¶é´å¹¶å°å
¶è½¬æ¢ä¸ºstringç±»å |
| | | String name=sFormat.format(calendar.getTime()); |
| | | |
| | | FileOutputStream output=new FileOutputStream(Route+name+".xls"); |
| | | wb.write(output); |
| | | output.flush(); |
| | | System.out.println( name+".xls"); |
| | | return name+".xls"; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | //package com.landtool.lanbase.modules.api.utils; |
| | | // |
| | | //import com.alibaba.fastjson.JSON; |
| | | //import com.alibaba.fastjson.JSONArray; |
| | | //import com.alibaba.fastjson.JSONObject; |
| | | // |
| | | //import com.landtool.lanbase.common.utils.HttpContextUtils; |
| | | //import com.landtool.lanbase.common.utils.HttpOperateUtils; |
| | | //import com.landtool.lanbase.config.SysTemPropertyConfig; |
| | | //import com.landtool.lanbase.modules.org.entity.OrgUnitJoinRegion; |
| | | //import com.landtool.lanbase.modules.org.entity.OrgUserJoinUnit; |
| | | //import com.landtool.lanbase.modules.sys.entity.SysFieldvalue; |
| | | // |
| | | //import javax.servlet.http.HttpServletRequest; |
| | | //import java.io.IOException; |
| | | // |
| | | // |
| | | ///** |
| | | // * è·åç»å½ç¨æ·ä¿¡æ¯ |
| | | // * @return Json å符串 |
| | | // */ |
| | | // |
| | | //public class GetUserInfo { |
| | | // |
| | | // //æ¥è¯¢ç¨æ·ä¿¡æ¯ |
| | | // public static OrgUserJoinUnit getUser(SysTemPropertyConfig sysConfig, String username) { |
| | | // String url = sysConfig.getApiServer() + "/api/org/user/getInfoByName/" + username; |
| | | // return getOrgUserJoinUnit(url); |
| | | // } |
| | | // |
| | | // //åå°æ¥è¯¢ç¨æ·ä¿¡æ¯ |
| | | // private static OrgUserJoinUnit getOrgUserJoinUnit(String url) { |
| | | // OrgUserJoinUnit user = null; |
| | | // try { |
| | | // user = HttpOperateUtils.getJsonObject(url, OrgUserJoinUnit.class); |
| | | // } catch (IOException e) { |
| | | // e.printStackTrace(); |
| | | // } |
| | | // return user; |
| | | // } |
| | | // |
| | | // //æ ¹æ®ç¨æ·idæ¥æ¥è¯¢ |
| | | // public static OrgUserJoinUnit getUserId(SysTemPropertyConfig sysConfig, String id) { |
| | | // String url = sysConfig.getApiServer() + "/api/org/user/getInfoById/" + id; |
| | | // return getOrgUserJoinUnit(url); |
| | | // } |
| | | // |
| | | // //åå°æ¥è¯¢ç¨æ·ä¿¡æ¯ |
| | | // private static OrgUnitJoinRegion getOrgUnitJoinRegion(String url) { |
| | | // OrgUnitJoinRegion unit = null; |
| | | // try { |
| | | // unit = HttpOperateUtils.getJsonObject(url, OrgUnitJoinRegion.class); |
| | | // } catch (IOException e) { |
| | | // e.printStackTrace(); |
| | | // } |
| | | // return unit; |
| | | // } |
| | | // |
| | | // //æ¥è¯¢åä½id对åºçåä½ |
| | | // public static OrgUnitJoinRegion getUnitname(SysTemPropertyConfig sysConfig, int unitid) { |
| | | // String url = sysConfig.getApiServer() + "/api/org/unit/getInfoById/" + unitid; |
| | | // return getOrgUnitJoinRegion(url); |
| | | // } |
| | | // |
| | | // |
| | | // //è·åå½åç»å½äººid name è¿æå¯¹åºçåä½id name |
| | | // |
| | | // public static String getUserAndUnid(SysTemPropertyConfig sysConfig) { |
| | | // OrgUserJoinUnit user = getUser(sysConfig); |
| | | // String unid = user.getOrguserunits().get(0).getUnitid().toString(); //((JSONObject) jsarr.get(0)).get("unitid").toString(); |
| | | // String unitname = user.getOrguserunits().get(0).getUnitname(); //obj1.getString("unitname"); |
| | | // return "{'userid': '" + user.getUserid() + "','loginname': '" + user.getChinesename() + "','unid': '" + unid + "','unitname': '" + unitname + "'}"; |
| | | // |
| | | // } |
| | | // |
| | | // public static String findUserByWord(String RootUrl, String keyWord) { |
| | | // |
| | | // |
| | | // FieldUtils fieldUtils = new FieldUtils(); |
| | | // String url = RootUrl + "api/org/user/findUserByWord/" + keyWord; |
| | | // String username = null; |
| | | // try { |
| | | // username = HttpOperateUtils.httpGet(url); |
| | | // } catch (IOException e) { |
| | | // e.printStackTrace(); |
| | | // } |
| | | // StringBuilder Json = new StringBuilder(); |
| | | // Json.append(username); |
| | | // System.out.print("test:==============" + Json.toString()); |
| | | // |
| | | // return Json.toString(); |
| | | // } |
| | | //} |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.landtool.lanbase.modules.api.utils; |
| | | |
| | | import java.net.Inet4Address; |
| | | import java.net.InetAddress; |
| | | |
| | | public class GetWebProUrl { |
| | | public static String getLocalHostIP(){ |
| | | String result = null; |
| | | |
| | | try { |
| | | |
| | | InetAddress IP = Inet4Address.getLocalHost(); |
| | | String ip = IP.toString(); |
| | | |
| | | int index = ip.indexOf('/'); |
| | | |
| | | result = ip.substring(index+1, ip.length()); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | |
| | | return result; |
| | | } |
| | | |
| | | public static String getProjectURL(String IP){ |
| | | String result = "http://"; |
| | | |
| | | result += IP; |
| | | result += ":8080/"; |
| | | |
| | | String proPath = System.getProperty("user.dir"); |
| | | String proName = proPath.substring(proPath.lastIndexOf("\\")+1, proPath.length()); |
| | | |
| | | result += proName; |
| | | |
| | | return result; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.landtool.lanbase.modules.api.utils; |
| | | |
| | | |
| | | |
| | | import java.sql.Connection; |
| | | import java.sql.DriverManager; |
| | | import java.sql.ResultSet; |
| | | import java.sql.ResultSetMetaData; |
| | | import java.sql.SQLException; |
| | | import java.sql.Statement; |
| | | import java.sql.Types; |
| | | import java.util.LinkedHashMap; |
| | | import java.util.Map; |
| | | |
| | | import org.json.JSONArray; |
| | | import org.json.JSONException; |
| | | import org.json.JSONObject; |
| | | |
| | | |
| | | /** |
| | | * @Author: lizhao |
| | | * @Date: 2018-04-17 17:17 |
| | | * @paramï¼è¿æ¥å¤ä¸ªæ°æ®åºçå·¥å
·ç±»ï¼Oracle,sqlserverï¼ |
| | | * @Description: |
| | | * |
| | | */ |
| | | public class JDBCUtils { |
| | | |
| | | |
| | | public static void main(String[] args) { |
| | | |
| | | |
| | | |
| | | } |
| | | /** |
| | | * @Author: lizhao |
| | | * @Date: 2018-04-17 15:58 |
| | | * @param hostName :æå¡å¨å°å;sid:æ°æ®åºåç§°;user:ç¨æ·å;password:å¯ç ;port:ç«¯å£ |
| | | * @Description: |
| | | * |
| | | */ |
| | | public static String OracleConnUtils(String hostName, String sid, String user, String password, String port, String sql){ |
| | | //声æConnection对象 |
| | | Connection con; |
| | | //驱å¨ç¨åºå |
| | | String driver = "oracle.jdbc.driver.OracleDriver"; |
| | | //URLæåè¦è®¿é®çæ°æ®åºå |
| | | String url = "jdbc:oracle:thin:@"+hostName+":"+port+"/"+sid+""; |
| | | System.out.println(url); |
| | | //éåæ¥è¯¢ç»æé |
| | | return getString(user, password, sql, driver, url); |
| | | |
| | | |
| | | } |
| | | public static String SqlServerConnUtils(String hostName, String sid, String user, String password, String sql){ |
| | | //声æConnection对象 |
| | | Connection con; |
| | | //驱å¨ç¨åºå |
| | | String driver = "com.microsoft.sqlserver.jdbc.SQLServerDriver"; |
| | | //URLæåè¦è®¿é®çæ°æ®åºå |
| | | String url = "jdbc:sqlserver://"+hostName+";database="+sid+""; |
| | | //éåæ¥è¯¢ç»æé |
| | | return getString(user, password, sql, driver, url); |
| | | |
| | | } |
| | | |
| | | public static String MysqlConnUtils(String hostName, String sid, String user, String password, String port,String sql){ |
| | | String driver = "com.mysql.jdbc.Driver"; |
| | | String url = "jdbc:mysql://"+hostName+":"+port+"/"+sid; |
| | | //éåæ¥è¯¢ç»æé |
| | | return getString(user, password, sql, driver, url); |
| | | } |
| | | |
| | | private static String getString(String user, String password, String sql, String driver, String url) { |
| | | Connection con; |
| | | try { |
| | | //å 载驱å¨ç¨åº |
| | | Class.forName(driver); |
| | | //1.getConnection()æ¹æ³ï¼è¿æ¥æ°æ®åºï¼ï¼ |
| | | con = DriverManager.getConnection(url,user,password); |
| | | if(!con.isClosed()) |
| | | System.out.println("Succeeded connecting to the Database!"); |
| | | //2.å建statement类对象ï¼ç¨æ¥æ§è¡SQLè¯å¥ï¼ï¼ |
| | | Statement statement = con.createStatement(); |
| | | //è¦æ§è¡çSQLè¯å¥ |
| | | //3.ResultSetç±»ï¼ç¨æ¥åæ¾è·åçç»æéï¼ï¼ |
| | | try { |
| | | ResultSet rs = statement.executeQuery(sql); |
| | | String res=resultSetToJson(rs); |
| | | rs.close(); |
| | | con.close(); |
| | | return "[{success: true, data: '" + res + "'}]"; |
| | | }catch (Exception e){ |
| | | return "[{success: false, msg: '" + e.getMessage().replace("'","") + "'}]"; |
| | | } |
| | | // return res; |
| | | } catch(ClassNotFoundException e) { |
| | | //æ°æ®åºé©±å¨ç±»å¼å¸¸å¤ç |
| | | System.out.println("Sorry,can`t find the Driver!"); |
| | | return "[{success: false, msg: '" + e.getMessage() + "'}]"; |
| | | } catch(SQLException e) { |
| | | //æ°æ®åºè¿æ¥å¤±è´¥å¼å¸¸å¤ç |
| | | e.printStackTrace(); |
| | | return "[{success: false, msg: '" + e.getMessage() + "'}]"; |
| | | }catch (Exception e) { |
| | | // TODO: handle exception |
| | | e.printStackTrace(); |
| | | return "[{success: false, msg: '" + e.getMessage() + "'}]"; |
| | | } |
| | | } |
| | | |
| | | public static String htmlEncodeByRegExp(String str){ |
| | | String s = ""; |
| | | if(str.equals("")) return ""; |
| | | s = str.replace("&", "&"); |
| | | s = s.replace("<", "<"); |
| | | s = s.replace(">", ">"); |
| | | s = s.replace("\'", "'"); |
| | | s = s.replace("\"", """); |
| | | return s; |
| | | } |
| | | |
| | | |
| | | |
| | | public static String resultSetToJson(ResultSet rs) throws SQLException,JSONException |
| | | { |
| | | // jsonæ°ç» |
| | | JSONArray array = new JSONArray(); |
| | | // è·ååæ° |
| | | ResultSetMetaData metaData = rs.getMetaData(); |
| | | Map result = new LinkedHashMap(); |
| | | int columnCount = metaData.getColumnCount(); |
| | | // éåResultSetä¸çæ¯æ¡æ°æ® |
| | | while (rs.next()) { |
| | | JSONObject jsonObj = new JSONObject(); |
| | | // é忝ä¸å |
| | | for (int i = 1; i <= columnCount; i++) { |
| | | String columnName =metaData.getColumnLabel(i); |
| | | if(rs.getObject(columnName) == null) { |
| | | jsonObj.put(columnName, rs.getObject(columnName)); |
| | | } |
| | | else { |
| | | jsonObj.put(columnName, htmlEncodeByRegExp(rs.getObject(columnName).toString())); |
| | | } |
| | | int type = metaData.getColumnType(i); // è·ååçç±»å |
| | | if(type == Types.INTEGER) { // 妿æ¯rs.getInt |
| | | jsonObj.put(columnName,rs.getInt(columnName)); |
| | | } |
| | | if(type == Types.ARRAY) { // 妿æ¯rs.getArray |
| | | jsonObj.put(columnName, rs.getArray(columnName)); |
| | | } |
| | | if(type == Types.BIGINT) { |
| | | jsonObj.put(columnName, rs.getInt(columnName)); |
| | | } |
| | | if(type == Types.BOOLEAN) { // 妿æ¯rs.getInt |
| | | jsonObj.put(columnName, rs.getBoolean(columnName)); |
| | | } |
| | | if(type == Types.BLOB) { // 妿æ¯rs.getInt |
| | | jsonObj.put(columnName, htmlEncodeByRegExp(rs.getBlob(columnName).toString())); |
| | | } |
| | | if(type == Types.DOUBLE) { // 妿æ¯rs.getInt |
| | | jsonObj.put(columnName, rs.getDouble(columnName)); |
| | | } |
| | | if(type == Types.FLOAT) { // 妿æ¯rs.getInt |
| | | jsonObj.put(columnName, rs.getFloat(columnName)); |
| | | } |
| | | if(type == Types.NVARCHAR) { // 妿æ¯rs.getInt |
| | | if(rs.getNString(columnName)==null){ |
| | | jsonObj.put(columnName, ""); |
| | | //å
å«ç¹æ®åç¬¦æ æ³è½¬æ¢json |
| | | }else if(rs.getNString(columnName).contains("\\") || rs.getNString(columnName).contains("\"") || rs.getNString(columnName).contains("'")){ |
| | | jsonObj.put(columnName, htmlEncodeByRegExp(rs.getNString(columnName))); |
| | | }else { |
| | | jsonObj.put(columnName, rs.getNString(columnName)); |
| | | } |
| | | } |
| | | if(type == Types.VARCHAR) {// 妿æ¯rs.getInt |
| | | if(rs.getString(columnName)==null){ |
| | | jsonObj.put(columnName, ""); |
| | | //å
å«ç¹æ®åç¬¦æ æ³è½¬æ¢json |
| | | }else if(rs.getString(columnName).contains("\\") || rs.getString(columnName).contains("\"") || rs.getString(columnName).contains("'")){ |
| | | jsonObj.put(columnName, htmlEncodeByRegExp(rs.getString(columnName))); |
| | | }else { |
| | | jsonObj.put(columnName, rs.getString(columnName)); |
| | | } |
| | | |
| | | } |
| | | if(type == Types.TINYINT) { // 妿æ¯rs.getInt |
| | | jsonObj.put(columnName, rs.getInt(columnName)); |
| | | } |
| | | if(type == Types.SMALLINT) { // 妿æ¯rs.getInt |
| | | jsonObj.put(columnName, rs.getInt(columnName)); |
| | | } |
| | | if(type == Types.DATE) { // 妿æ¯rs.getInt |
| | | jsonObj.put(columnName, rs.getDate(columnName)); |
| | | } |
| | | if(type == Types.TIMESTAMP) { // 妿æ¯rs.getInt |
| | | jsonObj.put(columnName, rs.getTimestamp(columnName)); |
| | | } |
| | | |
| | | |
| | | } |
| | | array.put(jsonObj); |
| | | } |
| | | |
| | | return array.toString(); |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.landtool.lanbase.modules.api.utils; |
| | | |
| | | import java.util.Date; |
| | | |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.boot.context.properties.ConfigurationProperties; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import io.jsonwebtoken.Claims; |
| | | import io.jsonwebtoken.Jwts; |
| | | import io.jsonwebtoken.SignatureAlgorithm; |
| | | |
| | | /** |
| | | * @author lanbase |
| | | * @Description: TODO(jwtå·¥å
·ç±») |
| | | * @date 2017-9-27 14:33 |
| | | */ |
| | | @ConfigurationProperties(prefix = "sys.jwt") |
| | | @Component |
| | | public class JwtUtils { |
| | | |
| | | private Logger logger = LoggerFactory.getLogger(getClass()); |
| | | |
| | | private String secret; |
| | | private int expire; |
| | | private String header; |
| | | |
| | | /** |
| | | * çæjwt token |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | public String generateToken(long userId) { |
| | | Date nowDate = new Date(); |
| | | //è¿ææ¶é´ |
| | | Date expireDate = new Date(nowDate.getTime() + expire * 1000); |
| | | |
| | | return Jwts.builder() |
| | | .setHeaderParam("typ", "JWT") |
| | | .setSubject(userId+"") |
| | | .setIssuedAt(nowDate) |
| | | .setExpiration(expireDate) |
| | | .signWith(SignatureAlgorithm.HS512, secret) |
| | | .compact(); |
| | | } |
| | | |
| | | public Claims getClaimByToken(String token) { |
| | | try { |
| | | return Jwts.parser() |
| | | .setSigningKey(secret) |
| | | .parseClaimsJws(token) |
| | | .getBody(); |
| | | }catch (Exception e){ |
| | | //logger.error("validate is token error", e.toString()); |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * tokenæ¯å¦è¿æ |
| | | * @param expiration |
| | | * @return |
| | | */ |
| | | public boolean isTokenExpired(Date expiration) { |
| | | return expiration.before(new Date()); |
| | | } |
| | | |
| | | public String getSecret() { |
| | | return secret; |
| | | } |
| | | |
| | | public void setSecret(String secret) { |
| | | this.secret = secret; |
| | | } |
| | | |
| | | public int getExpire() { |
| | | return expire; |
| | | } |
| | | |
| | | public void setExpire(int expire) { |
| | | this.expire = expire; |
| | | } |
| | | |
| | | public String getHeader() { |
| | | return header; |
| | | } |
| | | |
| | | public void setHeader(String header) { |
| | | this.header = header; |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.landtool.lanbase.modules.api.utils; |
| | | |
| | | import java.util.List; |
| | | |
| | | public class PageBean<T> { |
| | | // å½å页 |
| | | private Integer currentPage = 1; |
| | | // æ¯é¡µæ¾ç¤ºçæ»æ¡æ° |
| | | private Integer pageSize = 10; |
| | | // æ»æ¡æ° |
| | | private Integer totalNum; |
| | | // æ¯å¦æä¸ä¸é¡µ |
| | | private Integer isMore; |
| | | // æ»é¡µæ° |
| | | private Integer totalPage; |
| | | // å¼å§ç´¢å¼ |
| | | private Integer startIndex; |
| | | // åé¡µç»æ |
| | | private List<T> items; |
| | | //Extæä»¶ä¼ éé¡µæ° |
| | | private Integer page = 1; |
| | | //Extæä»¶ä¼ éå½å页起å§åºå· |
| | | private Integer start = 0; |
| | | //Extæä»¶ä¼ éæ¯é¡µè®°å½æ° |
| | | private Integer limit = 10; |
| | | |
| | | |
| | | public PageBean() { |
| | | super(); |
| | | } |
| | | |
| | | public PageBean(Integer currentPage, Integer pageSize, Integer totalNum) { |
| | | super(); |
| | | this.currentPage = currentPage; |
| | | this.pageSize = pageSize; |
| | | this.totalNum = totalNum; |
| | | this.totalPage = (this.totalNum + this.pageSize-1) / this.pageSize; |
| | | this.startIndex = (this.currentPage - 1) * this.pageSize; |
| | | this.isMore = this.currentPage >= this.totalPage ? 0 : 1; |
| | | } |
| | | |
| | | public Integer getCurrentPage() { |
| | | return currentPage; |
| | | } |
| | | |
| | | public void setCurrentPage(Integer currentPage) { |
| | | this.currentPage = currentPage; |
| | | } |
| | | |
| | | public Integer getPageSize() { |
| | | return pageSize; |
| | | } |
| | | |
| | | public void setPageSize(Integer pageSize) { |
| | | this.pageSize = pageSize; |
| | | } |
| | | |
| | | public Integer getTotalNum() { |
| | | return totalNum; |
| | | } |
| | | |
| | | public void setTotalNum(Integer totalNum) { |
| | | this.totalNum = totalNum; |
| | | } |
| | | |
| | | public Integer getIsMore() { |
| | | return isMore; |
| | | } |
| | | |
| | | public void setIsMore(Integer isMore) { |
| | | this.isMore = isMore; |
| | | } |
| | | |
| | | public Integer getTotalPage() { |
| | | return totalPage; |
| | | } |
| | | |
| | | public void setTotalPage(Integer totalPage) { |
| | | this.totalPage = totalPage; |
| | | } |
| | | |
| | | public Integer getStartIndex() { |
| | | return startIndex; |
| | | } |
| | | |
| | | public void setStartIndex(Integer startIndex) { |
| | | this.startIndex = startIndex; |
| | | } |
| | | |
| | | public Integer getPage() { |
| | | return page; |
| | | } |
| | | |
| | | public void setPage(Integer page) { |
| | | this.page = page; |
| | | } |
| | | |
| | | public Integer getStart() { |
| | | return start; |
| | | } |
| | | |
| | | public void setStart(Integer start) { |
| | | this.start = start; |
| | | } |
| | | |
| | | public Integer getLimit() { |
| | | return limit; |
| | | } |
| | | |
| | | public void setLimit(Integer limit) { |
| | | this.limit = limit; |
| | | } |
| | | |
| | | public List<T> getItems() { |
| | | return items; |
| | | } |
| | | |
| | | public void setItems(List<T> items) { |
| | | this.items = items; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.landtool.lanbase.modules.api.utils; |
| | | |
| | | import java.sql.Timestamp; |
| | | import java.util.Date; |
| | | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | |
| | | import com.landtool.lanbase.modules.res.entity.Res_MainInfo; |
| | | import com.landtool.lanbase.modules.res.service.ResMainInfoService; |
| | | |
| | | /** |
| | | * @Author: lizhao |
| | | * @Date: 2018-04-12 16:34 |
| | | * @param |
| | | * @Description:æ´æ° |
| | | * |
| | | */ |
| | | public class UpDate { |
| | | |
| | | @Autowired |
| | | private ResMainInfoService resMainInfoService; |
| | | |
| | | |
| | | public void lasteditdate(int id){ |
| | | |
| | | Res_MainInfo resMainInfo=new Res_MainInfo(); |
| | | Timestamp audittime = new Timestamp(new Date().getTime());//è·åå½åæ¶é´ |
| | | resMainInfo.setLasteditdate(audittime); |
| | | resMainInfo.setResourceid(id); |
| | | resMainInfoService.updateByPrimaryKeySelective(resMainInfo); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.landtool.lanbase.modules.api.utils; |
| | | |
| | | public class fileSizeTest { |
| | | public static String getPrintSize(long size) { |
| | | //妿åèæ°å°äº1024ï¼åç´æ¥ä»¥B为åä½ï¼å¦åå
é¤äº1024ï¼å3ä½å å¤ªå°æ æä¹ |
| | | if (size < 1024) { |
| | | return String.valueOf(size) + "B"; |
| | | } else { |
| | | size = size / 1024; |
| | | } |
| | | //妿ååèæ°é¤äº1024ä¹åï¼å°äº1024ï¼åå¯ä»¥ç´æ¥ä»¥KBä½ä¸ºåä½ |
| | | //å ä¸ºè¿æ²¡æå°è¾¾è¦ä½¿ç¨å¦ä¸ä¸ªåä½çæ¶å |
| | | //æ¥ä¸å»ä»¥æ¤ç±»æ¨ |
| | | if (size < 1024) { |
| | | return String.valueOf(size) + "KB"; |
| | | } else { |
| | | size = size / 1024; |
| | | } |
| | | if (size < 1024) { |
| | | //å ä¸ºå¦æä»¥MB为åä½çè¯ï¼è¦ä¿çæå1ä½å°æ°ï¼ |
| | | //å æ¤ï¼ææ¤æ°ä¹ä»¥100ä¹åååä½ |
| | | size = size * 100; |
| | | return String.valueOf((size / 100)) + "." |
| | | + String.valueOf((size % 100)) + "MB"; |
| | | } else { |
| | | //å¦å妿è¦ä»¥GB为åä½çï¼å
é¤äº1024åä½åæ ·çå¤ç |
| | | size = size * 100 / 1024; |
| | | return String.valueOf((size / 100)) + "." |
| | | + String.valueOf((size % 100)) + "GB"; |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.landtool.lanbase.modules.log.entity; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author lanbase |
| | | * @Description: TODO(ç³»ç»æ¨¡åæä½æ¥å¿è¡¨) |
| | | * @date 2018-01-16 09:18:41 |
| | | */ |
| | | public class LogAction implements Serializable { |
| | | |
| | | // æä½ID |
| | | private Long actionid; |
| | | // ç³»ç»ç¨æ·ID |
| | | private Long userid; |
| | | // åºç¨ç¨åºID |
| | | private Long appid; |
| | | // æä½æ¶é´ |
| | | private Date dodate; |
| | | // æå±å¤§æ¨¡ååç§° |
| | | private String largemodel; |
| | | // å
·ä½æ¨¡ååç§° |
| | | private String smallmodel; |
| | | // 请æ±ç½å |
| | | private String requesturl; |
| | | // 请æ±å®¢æ·ç«¯IPå°å |
| | | private String requestip; |
| | | // æä½è¯´æ |
| | | private String remark; |
| | | // æä½ç±»å |
| | | private String actiontype; |
| | | |
| | | private String appfullname; |
| | | |
| | | private String loginname; |
| | | |
| | | private String chinesename; |
| | | |
| | | private Integer resourceid; |
| | | |
| | | private String title; |
| | | |
| | | public String getAppfullname() { |
| | | return appfullname; |
| | | } |
| | | |
| | | public void setAppfullname(String appfullname) { |
| | | this.appfullname = appfullname; |
| | | } |
| | | |
| | | public String getLoginname() { |
| | | return loginname; |
| | | } |
| | | |
| | | public void setLoginname(String loginname) { |
| | | this.loginname = loginname; |
| | | } |
| | | |
| | | /** |
| | | * è®¾ç½®ï¼æä½ID |
| | | */ |
| | | public void setActionid(Long actionid) { |
| | | this.actionid = actionid; |
| | | } |
| | | |
| | | /** |
| | | * è·åï¼æä½ID |
| | | */ |
| | | public Long getActionid() { |
| | | return actionid; |
| | | } |
| | | |
| | | /** |
| | | * 设置ï¼ç³»ç»ç¨æ·ID |
| | | */ |
| | | public void setUserid(Long userid) { |
| | | this.userid = userid; |
| | | } |
| | | |
| | | /** |
| | | * è·åï¼ç³»ç»ç¨æ·ID |
| | | */ |
| | | public Long getUserid() { |
| | | return userid; |
| | | } |
| | | |
| | | /** |
| | | * 设置ï¼åºç¨ç¨åºID |
| | | */ |
| | | public void setAppid(Long appid) { |
| | | this.appid = appid; |
| | | } |
| | | |
| | | /** |
| | | * è·åï¼åºç¨ç¨åºID |
| | | */ |
| | | public Long getAppid() { |
| | | return appid; |
| | | } |
| | | |
| | | /** |
| | | * è®¾ç½®ï¼æä½æ¶é´ |
| | | */ |
| | | public void setDodate(Date dodate) { |
| | | this.dodate = dodate; |
| | | } |
| | | |
| | | /** |
| | | * è·åï¼æä½æ¶é´ |
| | | */ |
| | | public Date getDodate() { |
| | | return dodate; |
| | | } |
| | | |
| | | /** |
| | | * è®¾ç½®ï¼æå±å¤§æ¨¡ååç§° |
| | | */ |
| | | public void setLargemodel(String largemodel) { |
| | | this.largemodel = largemodel; |
| | | } |
| | | |
| | | /** |
| | | * è·åï¼æå±å¤§æ¨¡ååç§° |
| | | */ |
| | | public String getLargemodel() { |
| | | return largemodel; |
| | | } |
| | | |
| | | /** |
| | | * 设置ï¼å
·ä½æ¨¡ååç§° |
| | | */ |
| | | public void setSmallmodel(String smallmodel) { |
| | | this.smallmodel = smallmodel; |
| | | } |
| | | |
| | | /** |
| | | * è·åï¼å
·ä½æ¨¡ååç§° |
| | | */ |
| | | public String getSmallmodel() { |
| | | return smallmodel; |
| | | } |
| | | |
| | | /** |
| | | * 设置ï¼è¯·æ±ç½å |
| | | */ |
| | | public void setRequesturl(String requesturl) { |
| | | this.requesturl = requesturl; |
| | | } |
| | | |
| | | /** |
| | | * è·åï¼è¯·æ±ç½å |
| | | */ |
| | | public String getRequesturl() { |
| | | return requesturl; |
| | | } |
| | | |
| | | /** |
| | | * 设置ï¼è¯·æ±å®¢æ·ç«¯IPå°å |
| | | */ |
| | | public void setRequestip(String requestip) { |
| | | this.requestip = requestip; |
| | | } |
| | | |
| | | /** |
| | | * è·åï¼è¯·æ±å®¢æ·ç«¯IPå°å |
| | | */ |
| | | public String getRequestip() { |
| | | return requestip; |
| | | } |
| | | |
| | | /** |
| | | * è®¾ç½®ï¼æä½è¯´æ |
| | | */ |
| | | public void setRemark(String remark) { |
| | | this.remark = remark; |
| | | } |
| | | |
| | | /** |
| | | * è·åï¼æä½è¯´æ |
| | | */ |
| | | public String getRemark() { |
| | | return remark; |
| | | } |
| | | |
| | | public String getChinesename() { |
| | | return chinesename; |
| | | } |
| | | |
| | | public void setChinesename(String chinesename) { |
| | | this.chinesename = chinesename; |
| | | } |
| | | |
| | | /** |
| | | * è·åï¼æä½ç±»å |
| | | */ |
| | | public String getActiontype() { |
| | | return actiontype; |
| | | } |
| | | |
| | | /** |
| | | * è®¾ç½®ï¼æä½ç±»å |
| | | */ |
| | | public void setActiontype(String actiontype) { |
| | | this.actiontype = actiontype; |
| | | } |
| | | |
| | | public Integer getResourceid() { |
| | | return resourceid; |
| | | } |
| | | |
| | | public void setResourceid(Integer resourceid) { |
| | | this.resourceid = resourceid; |
| | | } |
| | | |
| | | public String getTitle() { |
| | | return title; |
| | | } |
| | | |
| | | public void setTitle(String title) { |
| | | this.title = title; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.landtool.lanbase.modules.log.entity; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author lanbase |
| | | * @Description: TODO(ç»å½åèº«ä»½æ ¡éªæ¥å¿) |
| | | * @date 2018-01-16 09:18:41 |
| | | */ |
| | | public class LogLogininfo implements Serializable { |
| | | |
| | | //ç»å½ID |
| | | private Long loginid; |
| | | //ç³»ç»ç¨æ·ID |
| | | private Long userid; |
| | | //åºç¨ç¨åºID |
| | | private Long appid; |
| | | //ç»å½å |
| | | private String loginname; |
| | | //请æ±IPå°å |
| | | private String loginip; |
| | | //æä½æ¶é´ |
| | | private Date logindate; |
| | | //æä½ç±»å1ï¼ç»å
¥/2ï¼ç»åº/3ï¼Tokenæ ¡éª |
| | | private Long logintype; |
| | | //æä½ç¶æ0:æå/1ï¼å¤±è´¥ |
| | | private Long rstatus; |
| | | //ç¨æ·è®¿é®æµè§å¨çæ¬ |
| | | private String broserversion; |
| | | |
| | | private String appfullname; |
| | | |
| | | private String chinesename; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 设置ï¼ç»å½ID |
| | | */ |
| | | public void setLoginid(Long loginid) { |
| | | this.loginid = loginid; |
| | | } |
| | | /** |
| | | * è·åï¼ç»å½ID |
| | | */ |
| | | public Long getLoginid() { |
| | | return loginid; |
| | | } |
| | | /** |
| | | * 设置ï¼ç³»ç»ç¨æ·ID |
| | | */ |
| | | public void setUserid(Long userid) { |
| | | this.userid = userid; |
| | | } |
| | | /** |
| | | * è·åï¼ç³»ç»ç¨æ·ID |
| | | */ |
| | | public Long getUserid() { |
| | | return userid; |
| | | } |
| | | /** |
| | | * 设置ï¼åºç¨ç¨åºID |
| | | */ |
| | | public void setAppid(Long appid) { |
| | | this.appid = appid; |
| | | } |
| | | /** |
| | | * è·åï¼åºç¨ç¨åºID |
| | | */ |
| | | public Long getAppid() { |
| | | return appid; |
| | | } |
| | | /** |
| | | * 设置ï¼ç»å½å |
| | | */ |
| | | public void setLoginname(String loginname) { |
| | | this.loginname = loginname; |
| | | } |
| | | /** |
| | | * è·åï¼ç»å½å |
| | | */ |
| | | public String getLoginname() { |
| | | return loginname; |
| | | } |
| | | /** |
| | | * 设置ï¼è¯·æ±IPå°å |
| | | */ |
| | | public void setLoginip(String loginip) { |
| | | this.loginip = loginip; |
| | | } |
| | | /** |
| | | * è·åï¼è¯·æ±IPå°å |
| | | */ |
| | | public String getLoginip() { |
| | | return loginip; |
| | | } |
| | | /** |
| | | * è®¾ç½®ï¼æä½æ¶é´ |
| | | */ |
| | | public void setLogindate(Date logindate) { |
| | | this.logindate = logindate; |
| | | } |
| | | /** |
| | | * è·åï¼æä½æ¶é´ |
| | | */ |
| | | public Date getLogindate() { |
| | | return logindate; |
| | | } |
| | | /** |
| | | * è®¾ç½®ï¼æä½ç±»å1ï¼ç»å
¥/2ï¼ç»åº/3ï¼Tokenæ ¡éª |
| | | */ |
| | | public void setLogintype(Long logintype) { |
| | | this.logintype = logintype; |
| | | } |
| | | /** |
| | | * è·åï¼æä½ç±»å1ï¼ç»å
¥/2ï¼ç»åº/3ï¼Tokenæ ¡éª |
| | | */ |
| | | public Long getLogintype() { |
| | | return logintype; |
| | | } |
| | | /** |
| | | * è®¾ç½®ï¼æä½ç¶æ0:æå/1ï¼å¤±è´¥ |
| | | */ |
| | | public void setRstatus(Long rstatus) { |
| | | this.rstatus = rstatus; |
| | | } |
| | | /** |
| | | * è·åï¼æä½ç¶æ0:æå/1ï¼å¤±è´¥ |
| | | */ |
| | | public Long getRstatus() { |
| | | return rstatus; |
| | | } |
| | | /** |
| | | * 设置ï¼ç¨æ·è®¿é®æµè§å¨çæ¬ |
| | | */ |
| | | public void setBroserversion(String broserversion) { |
| | | this.broserversion = broserversion; |
| | | } |
| | | /** |
| | | * è·åï¼ç¨æ·è®¿é®æµè§å¨çæ¬ |
| | | */ |
| | | public String getBroserversion() { |
| | | return broserversion; |
| | | } |
| | | public String getAppfullname() { |
| | | return appfullname; |
| | | } |
| | | public void setAppfullname(String appfullname) { |
| | | this.appfullname = appfullname; |
| | | } |
| | | public String getChinesename() { |
| | | return chinesename; |
| | | } |
| | | public void setChinesename(String chinesename) { |
| | | this.chinesename = chinesename; |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.landtool.lanbase.modules.log.service; |
| | | |
| | | import com.landtool.lanbase.modules.log.entity.LogAction; |
| | | |
| | | /** |
| | | * @author lanbase |
| | | * @Description: TODO(ç³»ç»æ¨¡åæä½æ¥å¿è¡¨) |
| | | * @date 2018-01-16 09:18:41 |
| | | */ |
| | | public interface LogActionService { |
| | | |
| | | |
| | | void save(LogAction action); |
| | | |
| | | void saveLogAction(String action); |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.landtool.lanbase.modules.log.service; |
| | | |
| | | import com.landtool.lanbase.modules.log.entity.LogLogininfo; |
| | | |
| | | /** |
| | | * @author lanbase |
| | | * @Description: TODO(ç»å½åèº«ä»½æ ¡éªæ¥å¿) |
| | | * @date 2018-01-16 09:18:41 |
| | | */ |
| | | public interface LogLogininfoService { |
| | | void save(LogLogininfo logininfo); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.landtool.lanbase.modules.log.service.impl; |
| | | |
| | | import java.io.IOException; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | |
| | | import org.apache.shiro.SecurityUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import com.landtool.lanbase.common.utils.HttpContextUtils; |
| | | import com.landtool.lanbase.common.utils.HttpOperateUtils; |
| | | import com.landtool.lanbase.common.utils.IPUtils; |
| | | import com.landtool.lanbase.config.LoginConfigProperties; |
| | | import com.landtool.lanbase.config.SysTemPropertyConfig; |
| | | import com.landtool.lanbase.modules.log.entity.LogAction; |
| | | import com.landtool.lanbase.modules.log.service.LogActionService; |
| | | import com.landtool.lanbase.modules.org.entity.OrgUser; |
| | | |
| | | @Service("actionService") |
| | | public class LogActionServiceImpl implements LogActionService { |
| | | |
| | | @Autowired |
| | | private SysTemPropertyConfig tokenConfig; |
| | | |
| | | @Autowired |
| | | private LoginConfigProperties loginConfig; |
| | | |
| | | @Override |
| | | public void save(LogAction action){ |
| | | String url = tokenConfig.getApiServer()+"/api/log/action/addAction"; |
| | | try{ |
| | | HttpOperateUtils.httpPost(url,action); |
| | | }catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void saveLogAction(String action) { |
| | | String url = tokenConfig.getApiServer()+"/api/log/action/addAction"; |
| | | LogAction logAction = new LogAction(); |
| | | String[] list = action.split(","); |
| | | logAction.setLargemodel(list[0]); //大模å |
| | | logAction.setSmallmodel(list[1]);//å°æ¨¡å |
| | | logAction.setRemark(list[2]); //夿³¨ |
| | | logAction.setActiontype(list[3]);//æä½ç±»å |
| | | |
| | | if(list.length == 5) { |
| | | logAction.setUserid(Long.parseLong(list[4])); |
| | | } |
| | | else if(list.length == 4) { |
| | | Long userid = ((OrgUser) SecurityUtils.getSubject().getPrincipal()).getUserid(); |
| | | logAction.setUserid(userid); |
| | | } |
| | | if(list.length == 6){ |
| | | logAction.setResourceid(Integer.valueOf(list[4])); |
| | | logAction.setTitle(list[5]); |
| | | } |
| | | //è·årequest |
| | | HttpServletRequest request = HttpContextUtils.getHttpServletRequest(); |
| | | String ipurl = request.getServletPath(); |
| | | logAction.setRequesturl(ipurl); |
| | | //设置IPå°å |
| | | logAction.setRequestip(IPUtils.getIpAddr(request)); |
| | | |
| | | logAction.setAppid(loginConfig.getAppId()); |
| | | try{ |
| | | HttpOperateUtils.httpPost(url,logAction); |
| | | }catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.landtool.lanbase.modules.log.service.impl; |
| | | |
| | | import java.io.IOException; |
| | | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import com.landtool.lanbase.common.utils.HttpOperateUtils; |
| | | import com.landtool.lanbase.config.SysTemPropertyConfig; |
| | | import com.landtool.lanbase.modules.log.entity.LogLogininfo; |
| | | import com.landtool.lanbase.modules.log.service.LogLogininfoService; |
| | | |
| | | @Service("logininfoService") |
| | | public class LogLogininfoServiceImpl implements LogLogininfoService { |
| | | |
| | | @Autowired |
| | | private SysTemPropertyConfig tokenConfig; |
| | | |
| | | @Override |
| | | public void save(LogLogininfo logininfo){ |
| | | String url = tokenConfig.getApiServer()+"/api/log/logininfo/addLoginInfo"; |
| | | try{ |
| | | HttpOperateUtils.httpPost(url,logininfo); |
| | | }catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.landtool.lanbase.modules.org.entity; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author lanbase |
| | | * @Description: TODO(åä½ç®¡ç表) |
| | | * @date 2018-01-16 08:47:23 |
| | | */ |
| | | public class OrgUnit implements Serializable { |
| | | |
| | | //å使é¨é¨ID |
| | | private Long unitid; |
| | | //åä½ç¶IDï¼é¡¶çº§ä¸º0ï¼ |
| | | private Long parentid; |
| | | //åä½åç§° |
| | | private String unitname; |
| | | //åä½ç¼ç |
| | | private String unidcode; |
| | | //åä½ç»ç»æºæä»£ç |
| | | private String unidorgcode; |
| | | //åä½åç§°æ¼é³é¦åæ¯ |
| | | private String spellfirst; |
| | | //åä½ç®ç§° |
| | | private String unitshort; |
| | | //åä½ç±»å(A:è¡æ¿åä½ãB:çæµåä½ãCä¿¡æ¯ä¸å¿)åå
¸ |
| | | private String unittype; |
| | | //è®°å½æåº |
| | | private Long rorder; |
| | | //èç³»çµè¯ |
| | | private String contactnumber; |
| | | //ä¼ ç |
| | | private String faxnumber; |
| | | //E-Mailå°å |
| | | private String email; |
| | | //åä½å°å |
| | | private String address; |
| | | //鮿¿ç¼ç |
| | | private String postalcode; |
| | | //å¾çè·¯å¾ |
| | | private String photourl; |
| | | //ç½ç«å°å |
| | | private String websiteurl; |
| | | //æºæç¶æ1 表示æ£å¸¸ã2 å é¤ã9 表示注é |
| | | private Long status; |
| | | //å°å¾æ¯ä¾å°º |
| | | private String mapscales; |
| | | //Xåæ |
| | | private String mapcenterpointx; |
| | | //Yåæ |
| | | private String mapcenterpointy; |
| | | //è®°å½æ·»å æ¶é´ |
| | | private Date rcreatedate; |
| | | //è®°å½æ·»å 人id |
| | | private Long rcreateuser; |
| | | //è®°å½ä¿®æ¹æ¶é´æ³ |
| | | private Date rlasteditdate; |
| | | //夿³¨ |
| | | private String remark; |
| | | //æ¯å¦ä¸ºé¨é¨ 0åä½ 1é¨é¨ |
| | | private Long isdept; |
| | | |
| | | //é表ä¸å段ï¼å表å±ç¤ºç¨ |
| | | private String unittypetext; |
| | | //åºåid |
| | | private String regionid; |
| | | //åºååç§° |
| | | private String regionname; |
| | | //åä½ç®¡çåids |
| | | private String managerids; |
| | | //åä½ç®¡çånames |
| | | private String managernames; |
| | | // ztree屿§ |
| | | private Boolean open; |
| | | public OrgUnit(){ |
| | | |
| | | } |
| | | |
| | | public OrgUnit(Long unitid){ |
| | | this.unitid = unitid; |
| | | } |
| | | /** |
| | | * 设置ï¼å使é¨é¨ID |
| | | */ |
| | | public void setUnitid(Long unitid) { |
| | | this.unitid = unitid; |
| | | } |
| | | /** |
| | | * è·åï¼å使é¨é¨ID |
| | | */ |
| | | public Long getUnitid() { |
| | | return unitid; |
| | | } |
| | | /** |
| | | * 设置ï¼åä½ç¶IDï¼é¡¶çº§ä¸º0ï¼ |
| | | */ |
| | | public void setParentid(Long parentid) { |
| | | this.parentid = parentid; |
| | | } |
| | | /** |
| | | * è·åï¼åä½ç¶IDï¼é¡¶çº§ä¸º0ï¼ |
| | | */ |
| | | public Long getParentid() { |
| | | return parentid; |
| | | } |
| | | /** |
| | | * 设置ï¼åä½åç§° |
| | | */ |
| | | public void setUnitname(String unitname) { |
| | | this.unitname = unitname; |
| | | } |
| | | /** |
| | | * è·åï¼åä½åç§° |
| | | */ |
| | | public String getUnitname() { |
| | | return unitname; |
| | | } |
| | | /** |
| | | * 设置ï¼åä½ç¼ç |
| | | */ |
| | | public void setUnidcode(String unidcode) { |
| | | this.unidcode = unidcode; |
| | | } |
| | | /** |
| | | * è·åï¼åä½ç¼ç |
| | | */ |
| | | public String getUnidcode() { |
| | | return unidcode; |
| | | } |
| | | /** |
| | | * 设置ï¼åä½ç»ç»æºæä»£ç |
| | | */ |
| | | public void setUnidorgcode(String unidorgcode) { |
| | | this.unidorgcode = unidorgcode; |
| | | } |
| | | /** |
| | | * è·åï¼åä½ç»ç»æºæä»£ç |
| | | */ |
| | | public String getUnidorgcode() { |
| | | return unidorgcode; |
| | | } |
| | | /** |
| | | * 设置ï¼ä¸ææ¼é³é¦åæ¯ |
| | | */ |
| | | public void setSpellfirst(String spellfirst) { |
| | | this.spellfirst = spellfirst; |
| | | } |
| | | /** |
| | | * è·åï¼ä¸ææ¼é³é¦åæ¯ |
| | | */ |
| | | public String getSpellfirst() { |
| | | return spellfirst; |
| | | } |
| | | /** |
| | | * 设置ï¼åä½ç®ç§° |
| | | */ |
| | | public void setUnitshort(String unitshort) { |
| | | this.unitshort = unitshort; |
| | | } |
| | | /** |
| | | * è·åï¼åä½ç®ç§° |
| | | */ |
| | | public String getUnitshort() { |
| | | return unitshort; |
| | | } |
| | | /** |
| | | * 设置ï¼åä½ç±»å(A:è¡æ¿åä½ãB:çæµåä½ãCä¿¡æ¯ä¸å¿)åå
¸ |
| | | */ |
| | | public void setUnittype(String unittype) { |
| | | this.unittype = unittype; |
| | | } |
| | | /** |
| | | * è·åï¼åä½ç±»å(A:è¡æ¿åä½ãB:çæµåä½ãCä¿¡æ¯ä¸å¿)åå
¸ |
| | | */ |
| | | public String getUnittype() { |
| | | return unittype; |
| | | } |
| | | /** |
| | | * 设置ï¼è®°å½æåº |
| | | */ |
| | | public void setRorder(Long rorder) { |
| | | this.rorder = rorder; |
| | | } |
| | | /** |
| | | * è·åï¼è®°å½æåº |
| | | */ |
| | | public Long getRorder() { |
| | | return rorder; |
| | | } |
| | | /** |
| | | * 设置ï¼èç³»çµè¯ |
| | | */ |
| | | public void setContactnumber(String contactnumber) { |
| | | this.contactnumber = contactnumber; |
| | | } |
| | | /** |
| | | * è·åï¼èç³»çµè¯ |
| | | */ |
| | | public String getContactnumber() { |
| | | return contactnumber; |
| | | } |
| | | /** |
| | | * 设置ï¼ä¼ ç |
| | | */ |
| | | public void setFaxnumber(String faxnumber) { |
| | | this.faxnumber = faxnumber; |
| | | } |
| | | /** |
| | | * è·åï¼ä¼ ç |
| | | */ |
| | | public String getFaxnumber() { |
| | | return faxnumber; |
| | | } |
| | | /** |
| | | * 设置ï¼E-Mailå°å |
| | | */ |
| | | public void setEmail(String email) { |
| | | this.email = email; |
| | | } |
| | | /** |
| | | * è·åï¼E-Mailå°å |
| | | */ |
| | | public String getEmail() { |
| | | return email; |
| | | } |
| | | /** |
| | | * 设置ï¼åä½å°å |
| | | */ |
| | | public void setAddress(String address) { |
| | | this.address = address; |
| | | } |
| | | /** |
| | | * è·åï¼åä½å°å |
| | | */ |
| | | public String getAddress() { |
| | | return address; |
| | | } |
| | | /** |
| | | * 设置ï¼é®æ¿ç¼ç |
| | | */ |
| | | public void setPostalcode(String postalcode) { |
| | | this.postalcode = postalcode; |
| | | } |
| | | /** |
| | | * è·åï¼é®æ¿ç¼ç |
| | | */ |
| | | public String getPostalcode() { |
| | | return postalcode; |
| | | } |
| | | /** |
| | | * 设置ï¼å¾çè·¯å¾ |
| | | */ |
| | | public void setPhotourl(String photourl) { |
| | | this.photourl = photourl; |
| | | } |
| | | /** |
| | | * è·åï¼å¾çè·¯å¾ |
| | | */ |
| | | public String getPhotourl() { |
| | | return photourl; |
| | | } |
| | | /** |
| | | * 设置ï¼ç½ç«å°å |
| | | */ |
| | | public void setWebsiteurl(String websiteurl) { |
| | | this.websiteurl = websiteurl; |
| | | } |
| | | /** |
| | | * è·åï¼ç½ç«å°å |
| | | */ |
| | | public String getWebsiteurl() { |
| | | return websiteurl; |
| | | } |
| | | /** |
| | | * è®¾ç½®ï¼æºæç¶æ1 表示æ£å¸¸ã2 å é¤ã9 表示注é |
| | | */ |
| | | public void setStatus(Long status) { |
| | | this.status = status; |
| | | } |
| | | /** |
| | | * è·åï¼æºæç¶æ1 表示æ£å¸¸ã2 å é¤ã9 表示注é |
| | | */ |
| | | public Long getStatus() { |
| | | return status; |
| | | } |
| | | /** |
| | | * 设置ï¼å°å¾æ¯ä¾å°º |
| | | */ |
| | | public void setMapscales(String mapscales) { |
| | | this.mapscales = mapscales; |
| | | } |
| | | /** |
| | | * è·åï¼å°å¾æ¯ä¾å°º |
| | | */ |
| | | public String getMapscales() { |
| | | return mapscales; |
| | | } |
| | | /** |
| | | * 设置ï¼Xåæ |
| | | */ |
| | | public void setMapcenterpointx(String mapcenterpointx) { |
| | | this.mapcenterpointx = mapcenterpointx; |
| | | } |
| | | /** |
| | | * è·åï¼Xåæ |
| | | */ |
| | | public String getMapcenterpointx() { |
| | | return mapcenterpointx; |
| | | } |
| | | /** |
| | | * 设置ï¼Yåæ |
| | | */ |
| | | public void setMapcenterpointy(String mapcenterpointy) { |
| | | this.mapcenterpointy = mapcenterpointy; |
| | | } |
| | | /** |
| | | * è·åï¼Yåæ |
| | | */ |
| | | public String getMapcenterpointy() { |
| | | return mapcenterpointy; |
| | | } |
| | | /** |
| | | * 设置ï¼è®°å½æ·»å æ¶é´ |
| | | */ |
| | | public void setRcreatedate(Date rcreatedate) { |
| | | this.rcreatedate = rcreatedate; |
| | | } |
| | | /** |
| | | * è·åï¼è®°å½æ·»å æ¶é´ |
| | | */ |
| | | public Date getRcreatedate() { |
| | | return rcreatedate; |
| | | } |
| | | /** |
| | | * 设置ï¼è®°å½æ·»å 人id |
| | | */ |
| | | public void setRcreateuser(Long rcreateuser) { |
| | | this.rcreateuser = rcreateuser; |
| | | } |
| | | /** |
| | | * è·åï¼è®°å½æ·»å 人id |
| | | */ |
| | | public Long getRcreateuser() { |
| | | return rcreateuser; |
| | | } |
| | | /** |
| | | * 设置ï¼è®°å½ä¿®æ¹æ¶é´æ³ |
| | | */ |
| | | public void setRlasteditdate(Date rlasteditdate) { |
| | | this.rlasteditdate = rlasteditdate; |
| | | } |
| | | /** |
| | | * è·åï¼è®°å½ä¿®æ¹æ¶é´æ³ |
| | | */ |
| | | public Date getRlasteditdate() { |
| | | return rlasteditdate; |
| | | } |
| | | /** |
| | | * 设置ï¼å¤æ³¨ |
| | | */ |
| | | public void setRemark(String remark) { |
| | | this.remark = remark; |
| | | } |
| | | /** |
| | | * è·åï¼å¤æ³¨ |
| | | */ |
| | | public String getRemark() { |
| | | return remark; |
| | | } |
| | | /** |
| | | * è®¾ç½®ï¼æ¯å¦ä¸ºé¨é¨ 0åä½ 1é¨é¨ |
| | | */ |
| | | public void setIsdept(Long isdept) { |
| | | this.isdept = isdept; |
| | | } |
| | | /** |
| | | * è·åï¼æ¯å¦ä¸ºé¨é¨ 0åä½ 1é¨é¨ |
| | | */ |
| | | public Long getIsdept() { |
| | | return isdept; |
| | | } |
| | | |
| | | /** |
| | | * è®¾ç½®ï¼æ¯å¦ä¸ºé¨é¨ 0åä½ 1é¨é¨ |
| | | */ |
| | | public void setunittypetext(String unittypetext) { |
| | | this.unittypetext = unittypetext; |
| | | } |
| | | |
| | | /** |
| | | * è·åï¼æ¯å¦ä¸ºé¨é¨ 0åä½ 1é¨é¨ |
| | | */ |
| | | public String getunittypetext() { |
| | | return unittypetext; |
| | | } |
| | | /** |
| | | * 设置ï¼åºåid |
| | | */ |
| | | public void setRegionid(String regionid) { |
| | | this.regionid = regionid; |
| | | } |
| | | /** |
| | | * è·åï¼åºåid |
| | | */ |
| | | public String getRegionid() { |
| | | return regionid; |
| | | } |
| | | /** |
| | | * 设置ï¼åä½ç®¡çåids |
| | | */ |
| | | public void setmanagerids(String managerids) { |
| | | this.managerids = managerids; |
| | | } |
| | | /** |
| | | * è·åï¼åä½ç®¡çåids |
| | | */ |
| | | public String getmanagerids() { |
| | | return managerids; |
| | | } |
| | | /** |
| | | * 设置ï¼åä½ç®¡çånames |
| | | */ |
| | | public void setmanagernames(String managernames) { |
| | | this.managernames = managernames; |
| | | } |
| | | /** |
| | | * è·åï¼åä½ç®¡çånames |
| | | */ |
| | | public String getmanagernames() { |
| | | return managernames; |
| | | } |
| | | /** |
| | | * 设置ï¼åºååç§° |
| | | */ |
| | | public void setRegionname(String regionname) { |
| | | this.regionname = regionname; |
| | | } |
| | | /** |
| | | * è·åï¼åºååç§° |
| | | */ |
| | | public String getRegionname() { |
| | | return regionname; |
| | | } |
| | | /** |
| | | * 设置ï¼ztree屿§ |
| | | */ |
| | | public void setOpen(Boolean open) { |
| | | this.open = open; |
| | | } |
| | | /** |
| | | * è·åï¼ztree屿§ |
| | | */ |
| | | public Boolean getOpen() { |
| | | return open; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.landtool.lanbase.modules.org.entity; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Description: åä½å
³èè¡æ¿çPOJO{@link OrgUnit}{@link OrgRegion} |
| | | * @Author: bing.guo |
| | | * @Date: 15:46 2018/1/31 |
| | | * |
| | | */ |
| | | public class OrgUnitJoinRegion { |
| | | |
| | | //å使é¨é¨ID |
| | | private Long unitid; |
| | | //åä½ç¶IDï¼é¡¶çº§ä¸º0ï¼ |
| | | private Long parentid; |
| | | //åä½åç§° |
| | | private String unitname; |
| | | //åä½ç¼ç |
| | | private String unidcode; |
| | | //åä½ç»ç»æºæä»£ç |
| | | private String unidorgcode; |
| | | //åä½åç§°æ¼é³é¦åæ¯ |
| | | private String spellfirst; |
| | | //åä½ç®ç§° |
| | | private String unitshort; |
| | | //åä½ç±»å(A:è¡æ¿åä½ãB:çæµåä½ãCä¿¡æ¯ä¸å¿)åå
¸ |
| | | private String unittype; |
| | | //è®°å½æåº |
| | | private String rorder; |
| | | //èç³»çµè¯ |
| | | private String contactnumber; |
| | | //ä¼ ç |
| | | private String faxnumber; |
| | | //E-Mailå°å |
| | | private String email; |
| | | //åä½å°å |
| | | private String address; |
| | | //鮿¿ç¼ç |
| | | private String postalcode; |
| | | //å¾çè·¯å¾ |
| | | private String photourl; |
| | | //ç½ç«å°å |
| | | private String websiteurl; |
| | | //æºæç¶æ1 表示æ£å¸¸ã2 å é¤ã9 表示注é |
| | | private Long status; |
| | | //å°å¾æ¯ä¾å°º |
| | | private String mapscales; |
| | | //Xåæ |
| | | private String mapcenterpointx; |
| | | //Yåæ |
| | | private String mapcenterpointy; |
| | | //è®°å½æ·»å æ¶é´ |
| | | private Date rcreatedate; |
| | | //è®°å½æ·»å äººä¸æå |
| | | private Long rcreateuser; |
| | | //è®°å½ä¿®æ¹æ¶é´æ³ |
| | | private Date rlasteditdate; |
| | | //夿³¨ |
| | | private String remark; |
| | | //æ¯å¦ä¸ºé¨é¨ 0åä½ 1é¨é¨ |
| | | private Long isdept; |
| | | //æå±è¡æ¿å¯¹è±¡ |
| | | private List<OrgUnitRegion> orgunitregion; |
| | | |
| | | /** |
| | | * 设置ï¼å使é¨é¨ID |
| | | */ |
| | | public void setUnitid(Long unitid) { |
| | | this.unitid = unitid; |
| | | } |
| | | /** |
| | | * è·åï¼å使é¨é¨ID |
| | | */ |
| | | public Long getUnitid() { |
| | | return unitid; |
| | | } |
| | | /** |
| | | * 设置ï¼åä½ç¶IDï¼é¡¶çº§ä¸º0ï¼ |
| | | */ |
| | | public void setParentid(Long parentid) { |
| | | this.parentid = parentid; |
| | | } |
| | | /** |
| | | * è·åï¼åä½ç¶IDï¼é¡¶çº§ä¸º0ï¼ |
| | | */ |
| | | public Long getParentid() { |
| | | return parentid; |
| | | } |
| | | /** |
| | | * 设置ï¼åä½åç§° |
| | | */ |
| | | public void setUnitname(String unitname) { |
| | | this.unitname = unitname; |
| | | } |
| | | /** |
| | | * è·åï¼åä½åç§° |
| | | */ |
| | | public String getUnitname() { |
| | | return unitname; |
| | | } |
| | | /** |
| | | * 设置ï¼åä½ç¼ç |
| | | */ |
| | | public void setUnidcode(String unidcode) { |
| | | this.unidcode = unidcode; |
| | | } |
| | | /** |
| | | * è·åï¼åä½ç¼ç |
| | | */ |
| | | public String getUnidcode() { |
| | | return unidcode; |
| | | } |
| | | /** |
| | | * 设置ï¼åä½ç»ç»æºæä»£ç |
| | | */ |
| | | public void setUnidorgcode(String unidorgcode) { |
| | | this.unidorgcode = unidorgcode; |
| | | } |
| | | /** |
| | | * è·åï¼åä½ç»ç»æºæä»£ç |
| | | */ |
| | | public String getUnidorgcode() { |
| | | return unidorgcode; |
| | | } |
| | | /** |
| | | * 设置ï¼åä½åç§°æ¼é³é¦åæ¯ |
| | | */ |
| | | public void setSpellfirst(String spellfirst) { |
| | | this.spellfirst = spellfirst; |
| | | } |
| | | /** |
| | | * è·åï¼åä½åç§°æ¼é³é¦åæ¯ |
| | | */ |
| | | public String getSpellfirst() { |
| | | return spellfirst; |
| | | } |
| | | /** |
| | | * 设置ï¼åä½ç®ç§° |
| | | */ |
| | | public void setUnitshort(String unitshort) { |
| | | this.unitshort = unitshort; |
| | | } |
| | | /** |
| | | * è·åï¼åä½ç®ç§° |
| | | */ |
| | | public String getUnitshort() { |
| | | return unitshort; |
| | | } |
| | | /** |
| | | * 设置ï¼åä½ç±»å(A:è¡æ¿åä½ãB:çæµåä½ãCä¿¡æ¯ä¸å¿)åå
¸ |
| | | */ |
| | | public void setUnittype(String unittype) { |
| | | this.unittype = unittype; |
| | | } |
| | | /** |
| | | * è·åï¼åä½ç±»å(A:è¡æ¿åä½ãB:çæµåä½ãCä¿¡æ¯ä¸å¿)åå
¸ |
| | | */ |
| | | public String getUnittype() { |
| | | return unittype; |
| | | } |
| | | /** |
| | | * 设置ï¼è®°å½æåº |
| | | */ |
| | | public void setRorder(String rorder) { |
| | | this.rorder = rorder; |
| | | } |
| | | /** |
| | | * è·åï¼è®°å½æåº |
| | | */ |
| | | public String getRorder() { |
| | | return rorder; |
| | | } |
| | | /** |
| | | * 设置ï¼èç³»çµè¯ |
| | | */ |
| | | public void setContactnumber(String contactnumber) { |
| | | this.contactnumber = contactnumber; |
| | | } |
| | | /** |
| | | * è·åï¼èç³»çµè¯ |
| | | */ |
| | | public String getContactnumber() { |
| | | return contactnumber; |
| | | } |
| | | /** |
| | | * 设置ï¼ä¼ ç |
| | | */ |
| | | public void setFaxnumber(String faxnumber) { |
| | | this.faxnumber = faxnumber; |
| | | } |
| | | /** |
| | | * è·åï¼ä¼ ç |
| | | */ |
| | | public String getFaxnumber() { |
| | | return faxnumber; |
| | | } |
| | | /** |
| | | * 设置ï¼E-Mailå°å |
| | | */ |
| | | public void setEmail(String email) { |
| | | this.email = email; |
| | | } |
| | | /** |
| | | * è·åï¼E-Mailå°å |
| | | */ |
| | | public String getEmail() { |
| | | return email; |
| | | } |
| | | /** |
| | | * 设置ï¼åä½å°å |
| | | */ |
| | | public void setAddress(String address) { |
| | | this.address = address; |
| | | } |
| | | /** |
| | | * è·åï¼åä½å°å |
| | | */ |
| | | public String getAddress() { |
| | | return address; |
| | | } |
| | | /** |
| | | * 设置ï¼é®æ¿ç¼ç |
| | | */ |
| | | public void setPostalcode(String postalcode) { |
| | | this.postalcode = postalcode; |
| | | } |
| | | /** |
| | | * è·åï¼é®æ¿ç¼ç |
| | | */ |
| | | public String getPostalcode() { |
| | | return postalcode; |
| | | } |
| | | /** |
| | | * 设置ï¼å¾çè·¯å¾ |
| | | */ |
| | | public void setPhotourl(String photourl) { |
| | | this.photourl = photourl; |
| | | } |
| | | /** |
| | | * è·åï¼å¾çè·¯å¾ |
| | | */ |
| | | public String getPhotourl() { |
| | | return photourl; |
| | | } |
| | | /** |
| | | * 设置ï¼ç½ç«å°å |
| | | */ |
| | | public void setWebsiteurl(String websiteurl) { |
| | | this.websiteurl = websiteurl; |
| | | } |
| | | /** |
| | | * è·åï¼ç½ç«å°å |
| | | */ |
| | | public String getWebsiteurl() { |
| | | return websiteurl; |
| | | } |
| | | /** |
| | | * è®¾ç½®ï¼æºæç¶æ1 表示æ£å¸¸ã2 å é¤ã9 表示注é |
| | | */ |
| | | public void setStatus(Long status) { |
| | | this.status = status; |
| | | } |
| | | /** |
| | | * è·åï¼æºæç¶æ1 表示æ£å¸¸ã2 å é¤ã9 表示注é |
| | | */ |
| | | public Long getStatus() { |
| | | return status; |
| | | } |
| | | /** |
| | | * 设置ï¼å°å¾æ¯ä¾å°º |
| | | */ |
| | | public void setMapscales(String mapscales) { |
| | | this.mapscales = mapscales; |
| | | } |
| | | /** |
| | | * è·åï¼å°å¾æ¯ä¾å°º |
| | | */ |
| | | public String getMapscales() { |
| | | return mapscales; |
| | | } |
| | | /** |
| | | * 设置ï¼Xåæ |
| | | */ |
| | | public void setMapcenterpointx(String mapcenterpointx) { |
| | | this.mapcenterpointx = mapcenterpointx; |
| | | } |
| | | /** |
| | | * è·åï¼Xåæ |
| | | */ |
| | | public String getMapcenterpointx() { |
| | | return mapcenterpointx; |
| | | } |
| | | /** |
| | | * 设置ï¼Yåæ |
| | | */ |
| | | public void setMapcenterpointy(String mapcenterpointy) { |
| | | this.mapcenterpointy = mapcenterpointy; |
| | | } |
| | | /** |
| | | * è·åï¼Yåæ |
| | | */ |
| | | public String getMapcenterpointy() { |
| | | return mapcenterpointy; |
| | | } |
| | | /** |
| | | * 设置ï¼è®°å½æ·»å æ¶é´ |
| | | */ |
| | | public void setRcreatedate(Date rcreatedate) { |
| | | this.rcreatedate = rcreatedate; |
| | | } |
| | | /** |
| | | * è·åï¼è®°å½æ·»å æ¶é´ |
| | | */ |
| | | public Date getRcreatedate() { |
| | | return rcreatedate; |
| | | } |
| | | /** |
| | | * 设置ï¼è®°å½æ·»å äººä¸æå |
| | | */ |
| | | public void setRcreateuser(Long rcreateuser) { |
| | | this.rcreateuser = rcreateuser; |
| | | } |
| | | /** |
| | | * è·åï¼è®°å½æ·»å äººä¸æå |
| | | */ |
| | | public Long getRcreateuser() { |
| | | return rcreateuser; |
| | | } |
| | | /** |
| | | * 设置ï¼è®°å½ä¿®æ¹æ¶é´æ³ |
| | | */ |
| | | public void setRlasteditdate(Date rlasteditdate) { |
| | | this.rlasteditdate = rlasteditdate; |
| | | } |
| | | /** |
| | | * è·åï¼è®°å½ä¿®æ¹æ¶é´æ³ |
| | | */ |
| | | public Date getRlasteditdate() { |
| | | return rlasteditdate; |
| | | } |
| | | /** |
| | | * 设置ï¼å¤æ³¨ |
| | | */ |
| | | public void setRemark(String remark) { |
| | | this.remark = remark; |
| | | } |
| | | /** |
| | | * è·åï¼å¤æ³¨ |
| | | */ |
| | | public String getRemark() { |
| | | return remark; |
| | | } |
| | | /** |
| | | * è®¾ç½®ï¼æ¯å¦ä¸ºé¨é¨ 0åä½ 1é¨é¨ |
| | | */ |
| | | public void setIsdept(Long isdept) { |
| | | this.isdept = isdept; |
| | | } |
| | | /** |
| | | * è·åï¼æ¯å¦ä¸ºé¨é¨ 0åä½ 1é¨é¨ |
| | | */ |
| | | public Long getIsdept() { |
| | | return isdept; |
| | | } |
| | | public List<OrgUnitRegion> getOrgunitregion() { |
| | | return orgunitregion; |
| | | } |
| | | public void setOrgunitregion(List<OrgUnitRegion> orgunitregion) { |
| | | this.orgunitregion = orgunitregion; |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.landtool.lanbase.modules.org.entity; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author lanbase |
| | | * @Description: TODO(åä½ç®¡è¾èå´,对åºè¡æ¿åºå表,åä½ç®¡è¾èå´ååæ¶ï¼ä¿®æ¹å使¶é´æ³ä¿¡æ¯) |
| | | * @date 2018-01-16 09:26:18 |
| | | */ |
| | | public class OrgUnitRegion implements Serializable { |
| | | |
| | | //åºåèªç¼ç |
| | | private String regionid; |
| | | //åä½ID |
| | | private Long unitid; |
| | | //è®°å½æ·»å äººä¸æå |
| | | private Date rcreatedate; |
| | | //è®°å½æ·»å æ¶é´ |
| | | private Long rcreateuser; |
| | | //è®°å½ä¿®æ¹æ¶é´æ³ |
| | | private Date rlasteditdate; |
| | | |
| | | /** |
| | | * 设置ï¼åºåèªç¼ç |
| | | */ |
| | | public void setRegionid(String regionid) { |
| | | this.regionid = regionid; |
| | | } |
| | | /** |
| | | * è·åï¼åºåèªç¼ç |
| | | */ |
| | | public String getRegionid() { |
| | | return regionid; |
| | | } |
| | | /** |
| | | * 设置ï¼åä½ID |
| | | */ |
| | | public void setUnitid(Long unitid) { |
| | | this.unitid = unitid; |
| | | } |
| | | /** |
| | | * è·åï¼åä½ID |
| | | */ |
| | | public Long getUnitid() { |
| | | return unitid; |
| | | } |
| | | /** |
| | | * 设置ï¼è®°å½æ·»å äººä¸æå |
| | | */ |
| | | public void setRcreatedate(Date rcreatedate) { |
| | | this.rcreatedate = rcreatedate; |
| | | } |
| | | /** |
| | | * è·åï¼è®°å½æ·»å äººä¸æå |
| | | */ |
| | | public Date getRcreatedate() { |
| | | return rcreatedate; |
| | | } |
| | | /** |
| | | * 设置ï¼è®°å½æ·»å æ¶é´ |
| | | */ |
| | | public void setRcreateuser(Long rcreateuser) { |
| | | this.rcreateuser = rcreateuser; |
| | | } |
| | | /** |
| | | * è·åï¼è®°å½æ·»å æ¶é´ |
| | | */ |
| | | public Long getRcreateuser() { |
| | | return rcreateuser; |
| | | } |
| | | /** |
| | | * 设置ï¼è®°å½ä¿®æ¹æ¶é´æ³ |
| | | */ |
| | | public void setRlasteditdate(Date rlasteditdate) { |
| | | this.rlasteditdate = rlasteditdate; |
| | | } |
| | | /** |
| | | * è·åï¼è®°å½ä¿®æ¹æ¶é´æ³ |
| | | */ |
| | | public Date getRlasteditdate() { |
| | | return rlasteditdate; |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.landtool.lanbase.modules.org.entity; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author lanbase |
| | | * @Description: TODO(ç¨æ·ç®¡ç表) |
| | | * @date 2018-01-17 09:37:59 |
| | | */ |
| | | public class OrgUser implements Serializable { |
| | | |
| | | //ç³»ç»ç¨æ·ID |
| | | private Long userid; |
| | | //ç³»ç»ç»å½å |
| | | private String loginname; |
| | | //å¯ç MD5å å¯å¹¶å转 |
| | | private String password; |
| | | //䏿å |
| | | private String chinesename; |
| | | //䏿æ¼é³é¦åæ¯ |
| | | private String spellfirst; |
| | | //ç¶æ 0 æ£å¸¸ 1 ç¦ç¨ 2 å é¤ 3ç³è¯· 4ææ¹ |
| | | private Long userstatus; |
| | | //ææºå· |
| | | private String mobileno; |
| | | //æ¯å¦æ¥æ¶çä¿¡ |
| | | private Long isreceivemsg; |
| | | //åå
¬å®¤çµè¯ |
| | | private String officetel; |
| | | //EMAILå°å |
| | | private String email; |
| | | //é讯å°å |
| | | private String address; |
| | | //身份è¯å· |
| | | private String idcard; |
| | | //ç±è´¯ |
| | | private String nativeplace; |
| | | //æ§å« |
| | | private Long sex; |
| | | //ç
§çè·¯å¾ |
| | | private String photourl; |
| | | //å¦å |
| | | private String education; |
| | | //æå¦ä¸ä¸ |
| | | private String speciality; |
| | | //èç§°åç§°(é«çº§ãä¸çº§ãå©çï¼åå
¸ |
| | | private Long jobtitle; |
| | | //èå¡çº§å«ï¼é¨é¿/å
é¿/å¤é¿/ç§é¿/ç§åï¼åå
¸ |
| | | private String joblevel; |
| | | //è®°å½æ·»å 人id |
| | | private Long rcreateuser; |
| | | //è®°å½æ·»å æ¶é´ |
| | | private Date rcreatedate; |
| | | //è®°å½ä¿®æ¹æ¶é´æ³ |
| | | private Date rlasteditdate; |
| | | //夿³¨ |
| | | private String remark; |
| | | //éä»¶ |
| | | private String certificateurl; |
| | | |
| | | public OrgUser(){} |
| | | /** |
| | | * 设置ï¼ç³»ç»ç¨æ·ID |
| | | */ |
| | | public void setUserid(Long userid) { |
| | | this.userid = userid; |
| | | } |
| | | /** |
| | | * è·åï¼ç³»ç»ç¨æ·ID |
| | | */ |
| | | public Long getUserid() { |
| | | return userid; |
| | | } |
| | | /** |
| | | * 设置ï¼ç³»ç»ç»å½å |
| | | */ |
| | | public void setLoginname(String loginname) { |
| | | this.loginname = loginname; |
| | | } |
| | | /** |
| | | * è·åï¼ç³»ç»ç»å½å |
| | | */ |
| | | public String getLoginname() { |
| | | return loginname; |
| | | } |
| | | /** |
| | | * 设置ï¼å¯ç MD5å å¯å¹¶å转 |
| | | */ |
| | | public void setPassword(String password) { |
| | | this.password = password; |
| | | } |
| | | /** |
| | | * è·åï¼å¯ç MD5å å¯å¹¶å转 |
| | | */ |
| | | public String getPassword() { |
| | | return password; |
| | | } |
| | | /** |
| | | * 设置ï¼ä¸æå |
| | | */ |
| | | public void setChinesename(String chinesename) { |
| | | this.chinesename = chinesename; |
| | | } |
| | | /** |
| | | * è·åï¼ä¸æå |
| | | */ |
| | | public String getChinesename() { |
| | | return chinesename; |
| | | } |
| | | /** |
| | | * 设置ï¼ä¸ææ¼é³é¦åæ¯ |
| | | */ |
| | | public void setSpellfirst(String spellfirst) { |
| | | this.spellfirst = spellfirst; |
| | | } |
| | | /** |
| | | * è·åï¼ä¸ææ¼é³é¦åæ¯ |
| | | */ |
| | | public String getSpellfirst() { |
| | | return spellfirst; |
| | | } |
| | | /** |
| | | * 设置ï¼ç¶æ 0 æ£å¸¸ 1 ç¦ç¨ 2 å é¤ 3ç³è¯· 4ææ¹ |
| | | */ |
| | | public void setUserstatus(Long userstatus) { |
| | | this.userstatus = userstatus; |
| | | } |
| | | /** |
| | | * è·åï¼ç¶æ 0 æ£å¸¸ 1 ç¦ç¨ 2 å é¤ 3ç³è¯· 4ææ¹ |
| | | */ |
| | | public Long getUserstatus() { |
| | | return userstatus; |
| | | } |
| | | /** |
| | | * è®¾ç½®ï¼ææºå· |
| | | */ |
| | | public void setMobileno(String mobileno) { |
| | | this.mobileno = mobileno; |
| | | } |
| | | /** |
| | | * è·åï¼ææºå· |
| | | */ |
| | | public String getMobileno() { |
| | | return mobileno; |
| | | } |
| | | /** |
| | | * è®¾ç½®ï¼æ¯å¦æ¥æ¶çä¿¡ |
| | | */ |
| | | public void setIsreceivemsg(Long isreceivemsg) { |
| | | this.isreceivemsg = isreceivemsg; |
| | | } |
| | | /** |
| | | * è·åï¼æ¯å¦æ¥æ¶çä¿¡ |
| | | */ |
| | | public Long getIsreceivemsg() { |
| | | return isreceivemsg; |
| | | } |
| | | /** |
| | | * 设置ï¼åå
¬å®¤çµè¯ |
| | | */ |
| | | public void setOfficetel(String officetel) { |
| | | this.officetel = officetel; |
| | | } |
| | | /** |
| | | * è·åï¼åå
¬å®¤çµè¯ |
| | | */ |
| | | public String getOfficetel() { |
| | | return officetel; |
| | | } |
| | | /** |
| | | * 设置ï¼EMAILå°å |
| | | */ |
| | | public void setEmail(String email) { |
| | | this.email = email; |
| | | } |
| | | /** |
| | | * è·åï¼EMAILå°å |
| | | */ |
| | | public String getEmail() { |
| | | return email; |
| | | } |
| | | /** |
| | | * 设置ï¼é讯å°å |
| | | */ |
| | | public void setAddress(String address) { |
| | | this.address = address; |
| | | } |
| | | /** |
| | | * è·åï¼é讯å°å |
| | | */ |
| | | public String getAddress() { |
| | | return address; |
| | | } |
| | | /** |
| | | * 设置ï¼èº«ä»½è¯å· |
| | | */ |
| | | public void setIdcard(String idcard) { |
| | | this.idcard = idcard; |
| | | } |
| | | /** |
| | | * è·åï¼èº«ä»½è¯å· |
| | | */ |
| | | public String getIdcard() { |
| | | return idcard; |
| | | } |
| | | /** |
| | | * 设置ï¼ç±è´¯ |
| | | */ |
| | | public void setNativeplace(String nativeplace) { |
| | | this.nativeplace = nativeplace; |
| | | } |
| | | /** |
| | | * è·åï¼ç±è´¯ |
| | | */ |
| | | public String getNativeplace() { |
| | | return nativeplace; |
| | | } |
| | | /** |
| | | * è®¾ç½®ï¼æ§å« |
| | | */ |
| | | public void setSex(Long sex) { |
| | | this.sex = sex; |
| | | } |
| | | /** |
| | | * è·åï¼æ§å« |
| | | */ |
| | | public Long getSex() { |
| | | return sex; |
| | | } |
| | | /** |
| | | * 设置ï¼ç
§çè·¯å¾ |
| | | */ |
| | | public void setPhotourl(String photourl) { |
| | | this.photourl = photourl; |
| | | } |
| | | /** |
| | | * è·åï¼ç
§çè·¯å¾ |
| | | */ |
| | | public String getPhotourl() { |
| | | return photourl; |
| | | } |
| | | /** |
| | | * 设置ï¼å¦å |
| | | */ |
| | | public void setEducation(String education) { |
| | | this.education = education; |
| | | } |
| | | /** |
| | | * è·åï¼å¦å |
| | | */ |
| | | public String getEducation() { |
| | | return education; |
| | | } |
| | | /** |
| | | * è®¾ç½®ï¼æå¦ä¸ä¸ |
| | | */ |
| | | public void setSpeciality(String speciality) { |
| | | this.speciality = speciality; |
| | | } |
| | | /** |
| | | * è·åï¼æå¦ä¸ä¸ |
| | | */ |
| | | public String getSpeciality() { |
| | | return speciality; |
| | | } |
| | | /** |
| | | * 设置ï¼èç§°åç§°(é«çº§ãä¸çº§ãå©çï¼åå
¸ |
| | | */ |
| | | public void setJobtitle(Long jobtitle) { |
| | | this.jobtitle = jobtitle; |
| | | } |
| | | /** |
| | | * è·åï¼èç§°åç§°(é«çº§ãä¸çº§ãå©çï¼åå
¸ |
| | | */ |
| | | public Long getJobtitle() { |
| | | return jobtitle; |
| | | } |
| | | /** |
| | | * 设置ï¼èå¡çº§å«ï¼é¨é¿/å
é¿/å¤é¿/ç§é¿/ç§åï¼åå
¸ |
| | | */ |
| | | public void setJoblevel(String joblevel) { |
| | | this.joblevel = joblevel; |
| | | } |
| | | /** |
| | | * è·åï¼èå¡çº§å«ï¼é¨é¿/å
é¿/å¤é¿/ç§é¿/ç§åï¼åå
¸ |
| | | */ |
| | | public String getJoblevel() { |
| | | return joblevel; |
| | | } |
| | | /** |
| | | * 设置ï¼è®°å½æ·»å 人id |
| | | */ |
| | | public void setRcreateuser(Long rcreateuser) { |
| | | this.rcreateuser = rcreateuser; |
| | | } |
| | | /** |
| | | * è·åï¼è®°å½æ·»å 人id |
| | | */ |
| | | public Long getRcreateuser() { |
| | | return rcreateuser; |
| | | } |
| | | /** |
| | | * 设置ï¼è®°å½æ·»å æ¶é´ |
| | | */ |
| | | public void setRcreatedate(Date rcreatedate) { |
| | | this.rcreatedate = rcreatedate; |
| | | } |
| | | /** |
| | | * è·åï¼è®°å½æ·»å æ¶é´ |
| | | */ |
| | | public Date getRcreatedate() { |
| | | return rcreatedate; |
| | | } |
| | | /** |
| | | * 设置ï¼è®°å½ä¿®æ¹æ¶é´æ³ |
| | | */ |
| | | public void setRlasteditdate(Date rlasteditdate) { |
| | | this.rlasteditdate = rlasteditdate; |
| | | } |
| | | /** |
| | | * è·åï¼è®°å½ä¿®æ¹æ¶é´æ³ |
| | | */ |
| | | public Date getRlasteditdate() { |
| | | return rlasteditdate; |
| | | } |
| | | /** |
| | | * 设置ï¼å¤æ³¨ |
| | | */ |
| | | public void setRemark(String remark) { |
| | | this.remark = remark; |
| | | } |
| | | /** |
| | | * è·åï¼å¤æ³¨ |
| | | */ |
| | | public String getRemark() { |
| | | return remark; |
| | | } |
| | | |
| | | /** |
| | | * 设置ï¼éä»¶ |
| | | */ |
| | | public void setCertificateurl(String certificateurl) { |
| | | this.certificateurl = certificateurl; |
| | | } |
| | | /** |
| | | * è·åï¼éä»¶ |
| | | */ |
| | | public String getCertificateurl() { |
| | | return certificateurl; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return getLoginname(); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.landtool.lanbase.modules.org.entity; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author zimao.guo |
| | | * @Description: TODO(ç¨æ·ä¸ç¾¤ç»å
³è表) |
| | | * @date 2018-03-14 16:35:05 |
| | | */ |
| | | public class OrgUserGroup implements Serializable { |
| | | |
| | | //ç¨æ·id |
| | | private Long userId; |
| | | //群ç»ID |
| | | private Long groupId; |
| | | //è§è²åé
åä½ID |
| | | private Long createUnitId; |
| | | //è®°å½æ·»å æ¶é´ |
| | | private Date rCreateDate; |
| | | //è®°å½æ·»å äººä¸æå |
| | | private Long rCreateUser; |
| | | |
| | | /** |
| | | * 设置ï¼ç¨æ·id |
| | | */ |
| | | public void setUserId(Long userId) { |
| | | this.userId = userId; |
| | | } |
| | | /** |
| | | * è·åï¼ç¨æ·id |
| | | */ |
| | | public Long getUserId() { |
| | | return userId; |
| | | } |
| | | /** |
| | | * 设置ï¼ç¾¤ç»ID |
| | | */ |
| | | public void setGroupId(Long groupId) { |
| | | this.groupId = groupId; |
| | | } |
| | | /** |
| | | * è·åï¼ç¾¤ç»ID |
| | | */ |
| | | public Long getGroupId() { |
| | | return groupId; |
| | | } |
| | | /** |
| | | * 设置ï¼è§è²åé
åä½ID |
| | | */ |
| | | public void setCreateUnitId(Long createUnitId) { |
| | | this.createUnitId = createUnitId; |
| | | } |
| | | /** |
| | | * è·åï¼è§è²åé
åä½ID |
| | | */ |
| | | public Long getCreateUnitId() { |
| | | return createUnitId; |
| | | } |
| | | /** |
| | | * 设置ï¼è®°å½æ·»å æ¶é´ |
| | | */ |
| | | public void setrCreateDate(Date rCreateDate) { |
| | | this.rCreateDate = rCreateDate; |
| | | } |
| | | /** |
| | | * è·åï¼è®°å½æ·»å æ¶é´ |
| | | */ |
| | | public Date getrCreateDate() { |
| | | return rCreateDate; |
| | | } |
| | | /** |
| | | * 设置ï¼è®°å½æ·»å äººä¸æå |
| | | */ |
| | | public void setrCreateUser(Long rCreateUser) { |
| | | this.rCreateUser = rCreateUser; |
| | | } |
| | | /** |
| | | * è·åï¼è®°å½æ·»å äººä¸æå |
| | | */ |
| | | public Long getrCreateUser() { |
| | | return rCreateUser; |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.landtool.lanbase.modules.org.entity; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Description: ç¨æ·å
³èåä½çPOJO {@link OrgUser}{@link OrgUnit} |
| | | * @Author: zimao.guo |
| | | * @Date: 15:46 2018/1/31 |
| | | * |
| | | */ |
| | | public class OrgUserJoinUnit { |
| | | |
| | | //ç³»ç»ç¨æ·ID |
| | | private int userid; |
| | | //ç³»ç»ç»å½å |
| | | private String loginname; |
| | | //å¯ç MD5å å¯å¹¶å转 |
| | | private String password; |
| | | //䏿å |
| | | private String chinesename; |
| | | //䏿æ¼é³é¦åæ¯ |
| | | private String spellfirst; |
| | | //ç¶æ 0 æ£å¸¸ 1 ç¦ç¨ 2 å é¤ 3ç³è¯· 4ææ¹ |
| | | private Long userstatus; |
| | | //ææºå· |
| | | private String mobileno; |
| | | //æ¯å¦æ¥æ¶çä¿¡ |
| | | private Long isreceivemsg; |
| | | //åå
¬å®¤çµè¯ |
| | | private String officetel; |
| | | //EMAILå°å |
| | | private String email; |
| | | //é讯å°å |
| | | private String address; |
| | | //身份è¯å· |
| | | private String idcard; |
| | | //ç±è´¯ |
| | | private String nativeplace; |
| | | //æ§å« |
| | | private Long sex; |
| | | //ç
§çè·¯å¾ |
| | | private String photourl; |
| | | //å¦å |
| | | private String education; |
| | | //æå¦ä¸ä¸ |
| | | private String speciality; |
| | | //èç§°åç§°(é«çº§ãä¸çº§ãå©çï¼åå
¸ |
| | | private Long jobtitle; |
| | | //èå¡çº§å«ï¼é¨é¿/å
é¿/å¤é¿/ç§é¿/ç§åï¼åå
¸ |
| | | private String joblevel; |
| | | //è®°å½æ·»å äººä¸æå |
| | | private String rcreateuser; |
| | | //è®°å½æ·»å æ¶é´ |
| | | private Date rcreatedate; |
| | | //è®°å½ä¿®æ¹æ¶é´æ³ |
| | | private Date rlasteditdate; |
| | | //夿³¨ |
| | | private String remark; |
| | | //éä»¶ |
| | | private String certificateurl; |
| | | //ç ç¨äºå 坿¶å¢å ç ´è§£é¾åº¦ |
| | | // private String salt; |
| | | //æå±åä½å¯¹è±¡å表 |
| | | private List<OrgUserunit> orguserunits; |
| | | //æå±ç¾¤ç»å¯¹è±¡å表 |
| | | private List<OrgUserGroup> orgusergroup; |
| | | |
| | | public int getUserid() { |
| | | return userid; |
| | | } |
| | | |
| | | public void setUserid(int userid) { |
| | | this.userid = userid; |
| | | } |
| | | |
| | | public String getLoginname() { |
| | | return loginname; |
| | | } |
| | | |
| | | public void setLoginname(String loginname) { |
| | | this.loginname = loginname; |
| | | } |
| | | |
| | | public String getPassword() { |
| | | return password; |
| | | } |
| | | |
| | | public void setPassword(String password) { |
| | | this.password = password; |
| | | } |
| | | |
| | | public String getChinesename() { |
| | | return chinesename; |
| | | } |
| | | |
| | | public void setChinesename(String chinesename) { |
| | | this.chinesename = chinesename; |
| | | } |
| | | |
| | | public String getPinyinfirst() { |
| | | return spellfirst; |
| | | } |
| | | |
| | | public void setPinyinfirst(String spellfirst) { |
| | | this.spellfirst = spellfirst; |
| | | } |
| | | |
| | | public Long getUserstatus() { |
| | | return userstatus; |
| | | } |
| | | |
| | | public void setUserstatus(Long userstatus) { |
| | | this.userstatus = userstatus; |
| | | } |
| | | |
| | | public String getMobileno() { |
| | | return mobileno; |
| | | } |
| | | |
| | | public void setMobileno(String mobileno) { |
| | | this.mobileno = mobileno; |
| | | } |
| | | |
| | | public Long getIsreceivemsg() { |
| | | return isreceivemsg; |
| | | } |
| | | |
| | | public void setIsreceivemsg(Long isreceivemsg) { |
| | | this.isreceivemsg = isreceivemsg; |
| | | } |
| | | |
| | | public String getOfficetel() { |
| | | return officetel; |
| | | } |
| | | |
| | | public void setOfficetel(String officetel) { |
| | | this.officetel = officetel; |
| | | } |
| | | |
| | | public String getEmail() { |
| | | return email; |
| | | } |
| | | |
| | | public void setEmail(String email) { |
| | | this.email = email; |
| | | } |
| | | |
| | | public String getAddress() { |
| | | return address; |
| | | } |
| | | |
| | | public void setAddress(String address) { |
| | | this.address = address; |
| | | } |
| | | |
| | | public String getIdcard() { |
| | | return idcard; |
| | | } |
| | | |
| | | public void setIdcard(String idcard) { |
| | | this.idcard = idcard; |
| | | } |
| | | |
| | | public String getNativeplace() { |
| | | return nativeplace; |
| | | } |
| | | |
| | | public void setNativeplace(String nativeplace) { |
| | | this.nativeplace = nativeplace; |
| | | } |
| | | |
| | | public Long getSex() { |
| | | return sex; |
| | | } |
| | | |
| | | public void setSex(Long sex) { |
| | | this.sex = sex; |
| | | } |
| | | |
| | | public String getPhotourl() { |
| | | return photourl; |
| | | } |
| | | |
| | | public void setPhotourl(String photourl) { |
| | | this.photourl = photourl; |
| | | } |
| | | |
| | | public String getEducation() { |
| | | return education; |
| | | } |
| | | |
| | | public void setEducation(String education) { |
| | | this.education = education; |
| | | } |
| | | |
| | | public String getSpeciality() { |
| | | return speciality; |
| | | } |
| | | |
| | | public void setSpeciality(String speciality) { |
| | | this.speciality = speciality; |
| | | } |
| | | |
| | | public Long getJobtitle() { |
| | | return jobtitle; |
| | | } |
| | | |
| | | public void setJobtitle(Long jobtitle) { |
| | | this.jobtitle = jobtitle; |
| | | } |
| | | |
| | | public String getJoblevel() { |
| | | return joblevel; |
| | | } |
| | | |
| | | public void setJoblevel(String joblevel) { |
| | | this.joblevel = joblevel; |
| | | } |
| | | |
| | | public String getRcreateuser() { |
| | | return rcreateuser; |
| | | } |
| | | |
| | | public void setRcreateuser(String rcreateuser) { |
| | | this.rcreateuser = rcreateuser; |
| | | } |
| | | |
| | | public Date getRcreatedate() { |
| | | return rcreatedate; |
| | | } |
| | | |
| | | public void setRcreatedate(Date rcreatedate) { |
| | | this.rcreatedate = rcreatedate; |
| | | } |
| | | |
| | | public Date getRlasteditdate() { |
| | | return rlasteditdate; |
| | | } |
| | | |
| | | public void setRlasteditdate(Date rlasteditdate) { |
| | | this.rlasteditdate = rlasteditdate; |
| | | } |
| | | |
| | | public String getRemark() { |
| | | return remark; |
| | | } |
| | | |
| | | public void setRemark(String remark) { |
| | | this.remark = remark; |
| | | } |
| | | |
| | | // public String getSalt() { |
| | | // return salt; |
| | | // } |
| | | // |
| | | // public void setSalt(String salt) { |
| | | // this.salt = salt; |
| | | // } |
| | | |
| | | public List<OrgUserunit> getOrguserunits() { |
| | | return orguserunits; |
| | | } |
| | | |
| | | public void setOrguserunits(List<OrgUserunit> orguserunits) { |
| | | this.orguserunits = orguserunits; |
| | | } |
| | | |
| | | public List<OrgUserGroup> getOrgusergroup() { |
| | | return orgusergroup; |
| | | } |
| | | |
| | | public void setOrgusergroup(List<OrgUserGroup> orgusergroup) { |
| | | this.orgusergroup = orgusergroup; |
| | | } |
| | | /** |
| | | * 设置ï¼éä»¶ |
| | | */ |
| | | public void setCertificateurl(String certificateurl) { |
| | | this.certificateurl = certificateurl; |
| | | } |
| | | /** |
| | | * è·åï¼éä»¶ |
| | | */ |
| | | public String getCertificateurl() { |
| | | return certificateurl; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.landtool.lanbase.modules.org.entity; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author lanbase |
| | | * @Description: TODO(ç¨æ·åä½å
³è表,ç¨æ·ä¸åä½å
³èä¿¡æ¯ä¿®æ¹æ¶ï¼åæ¥ä¿®æ¹ç¨æ·æ¶é´æ³ä¿¡æ¯ã) |
| | | * @date 2018-01-16 09:43:06 |
| | | */ |
| | | public class OrgUserunit implements Serializable { |
| | | |
| | | //ç³»ç»ç¨æ·ID |
| | | private Long userid; |
| | | //åä½ID |
| | | private Long unitid; |
| | | //è®°å½æåº |
| | | private String rorder; |
| | | //èå¡åç§° |
| | | private String posname; |
| | | //ä»äºæ¬è工使¶é´ |
| | | private Date workseasdate; |
| | | //å¨èæ
åµ1 表示å¨èã3 表示åè°ã5 表示离è |
| | | private String worktype; |
| | | //å°èæ¥æ |
| | | private Date workstartdate; |
| | | //ç¦»èæ¥æ |
| | | private Date workenddate; |
| | | //è®°å½æ·»å 人ID |
| | | private Long rcreateuser; |
| | | //è®°å½æ·»å æ¶é´ |
| | | private Date rcreatedate; |
| | | //è®°å½ä¿®æ¹æ¶é´æ³ |
| | | private Date rlasteditdate; |
| | | //åä½åç§° |
| | | private String unitname; |
| | | //ç¨æ·ä¸æå |
| | | private String username; |
| | | //ç¼å· |
| | | private Long rn; |
| | | //ä»äºæ¬è工使¶é´ |
| | | private String workseasdatestr; |
| | | //å°èæ¥æ |
| | | private String workstartdatestr; |
| | | //ç¦»èæ¥æ |
| | | private String workenddatestr; |
| | | //æ§åä½id |
| | | private Long oldunitid; |
| | | /** |
| | | * 设置ï¼ç³»ç»ç¨æ·ID |
| | | */ |
| | | public Long getUserid() { |
| | | return userid; |
| | | } |
| | | /** |
| | | * 设置ï¼ç³»ç»ç¨æ·ID |
| | | */ |
| | | public void setUserid(Long userid) { |
| | | this.userid = userid; |
| | | } |
| | | |
| | | /** |
| | | * 设置ï¼åä½ID |
| | | */ |
| | | public void setUnitid(Long unitid) { |
| | | this.unitid = unitid; |
| | | } |
| | | /** |
| | | * è·åï¼åä½ID |
| | | */ |
| | | public Long getUnitid() { |
| | | return unitid; |
| | | } |
| | | /** |
| | | * 设置ï¼è®°å½æåº |
| | | */ |
| | | public void setRorder(String rorder) { |
| | | this.rorder = rorder; |
| | | } |
| | | /** |
| | | * è·åï¼è®°å½æåº |
| | | */ |
| | | public String getRorder() { |
| | | return rorder; |
| | | } |
| | | /** |
| | | * 设置ï¼èå¡åç§° |
| | | */ |
| | | public void setPosname(String posname) { |
| | | this.posname = posname; |
| | | } |
| | | /** |
| | | * è·åï¼èå¡åç§° |
| | | */ |
| | | public String getPosname() { |
| | | return posname; |
| | | } |
| | | /** |
| | | * 设置ï¼ä»äºæ¬è工使¶é´ |
| | | */ |
| | | public void setWorkseasdate(Date workseasdate) { |
| | | this.workseasdate = workseasdate; |
| | | } |
| | | /** |
| | | * è·åï¼ä»äºæ¬è工使¶é´ |
| | | */ |
| | | public Date getWorkseasdate() { |
| | | return workseasdate; |
| | | } |
| | | /** |
| | | * 设置ï¼å¨èæ
åµ1 表示å¨èã3 表示åè°ã5 表示离è |
| | | */ |
| | | public void setWorktype(String worktype) { |
| | | this.worktype = worktype; |
| | | } |
| | | /** |
| | | * è·åï¼å¨èæ
åµ1 表示å¨èã3 表示åè°ã5 表示离è |
| | | */ |
| | | public String getWorktype() { |
| | | return worktype; |
| | | } |
| | | /** |
| | | * 设置ï¼å°èæ¥æ |
| | | */ |
| | | public void setWorkstartdate(Date workstartdate) { |
| | | this.workstartdate = workstartdate; |
| | | } |
| | | /** |
| | | * è·åï¼å°èæ¥æ |
| | | */ |
| | | public Date getWorkstartdate() { |
| | | return workstartdate; |
| | | } |
| | | /** |
| | | * 设置ï¼ç¦»èæ¥æ |
| | | */ |
| | | public void setWorkenddate(Date workenddate) { |
| | | this.workenddate = workenddate; |
| | | } |
| | | /** |
| | | * è·åï¼ç¦»èæ¥æ |
| | | */ |
| | | public Date getWorkenddate() { |
| | | return workenddate; |
| | | } |
| | | /** |
| | | * 设置ï¼è®°å½æ·»å 人ID |
| | | */ |
| | | public void setRcreateuser(Long rcreateuser) { |
| | | this.rcreateuser = rcreateuser; |
| | | } |
| | | /** |
| | | * è·åï¼è®°å½æ·»å 人ID |
| | | */ |
| | | public Long getRcreateuser() { |
| | | return rcreateuser; |
| | | } |
| | | /** |
| | | * 设置ï¼è®°å½æ·»å æ¶é´ |
| | | */ |
| | | public void setRcreatedate(Date rcreatedate) { |
| | | this.rcreatedate = rcreatedate; |
| | | } |
| | | /** |
| | | * è·åï¼è®°å½æ·»å æ¶é´ |
| | | */ |
| | | public Date getRcreatedate() { |
| | | return rcreatedate; |
| | | } |
| | | /** |
| | | * 设置ï¼è®°å½ä¿®æ¹æ¶é´æ³ |
| | | */ |
| | | public void setRlasteditdate(Date rlasteditdate) { |
| | | this.rlasteditdate = rlasteditdate; |
| | | } |
| | | /** |
| | | * è·åï¼è®°å½ä¿®æ¹æ¶é´æ³ |
| | | */ |
| | | public Date getRlasteditdate() { |
| | | return rlasteditdate; |
| | | } |
| | | /** |
| | | * 设置ï¼åä½åç§° |
| | | */ |
| | | public void setUnitname(String unitname) { |
| | | this.unitname = unitname; |
| | | } |
| | | /** |
| | | * è·åï¼åä½åç§° |
| | | */ |
| | | public String getUnitname() { |
| | | return unitname; |
| | | } |
| | | /** |
| | | * 设置ï¼ä¸æå |
| | | */ |
| | | public void setUsername(String username) { |
| | | this.username = username; |
| | | } |
| | | /** |
| | | * è·åï¼ä¸æå |
| | | */ |
| | | public String getUsername() { |
| | | return username; |
| | | } |
| | | /** |
| | | * 设置ï¼ç¼å· |
| | | */ |
| | | public void setRn(Long rn) { |
| | | this.rn = rn; |
| | | } |
| | | /** |
| | | * è·åï¼ç¼å· |
| | | */ |
| | | public Long getRn() { |
| | | return rn; |
| | | } |
| | | /** |
| | | * 设置ï¼ä»äºæ¬è工使¶é´ |
| | | */ |
| | | public void setWorkseasdatestr(String workseasdatestr) { |
| | | this.workseasdatestr = workseasdatestr; |
| | | } |
| | | /** |
| | | * è·åï¼ä»äºæ¬è工使¶é´ |
| | | */ |
| | | public String getWorkseasdatestr() { |
| | | return workseasdatestr; |
| | | } |
| | | /** |
| | | * 设置ï¼å°èæ¥æ |
| | | */ |
| | | public void setWorkstartdatestr(String workstartdatestr) { |
| | | this.workstartdatestr = workstartdatestr; |
| | | } |
| | | /** |
| | | * è·åï¼å°èæ¥æ |
| | | */ |
| | | public String getWorkstartdatestr() { |
| | | return workstartdatestr; |
| | | } |
| | | /** |
| | | * 设置ï¼ç¦»èæ¥æ |
| | | */ |
| | | public void setWorkenddatestr(String workenddatestr) { |
| | | this.workenddatestr = workenddatestr; |
| | | } |
| | | /** |
| | | * è·åï¼ç¦»èæ¥æ |
| | | */ |
| | | public String getWorkenddatestr() { |
| | | return workenddatestr; |
| | | } |
| | | /** |
| | | * è®¾ç½®ï¼æ§åä½id |
| | | */ |
| | | public void setoldUnitid(Long oldunitid) { |
| | | this.oldunitid = oldunitid; |
| | | } |
| | | /** |
| | | * è·åï¼æ§åä½id |
| | | */ |
| | | public Long getoldUnitid() { |
| | | return oldunitid; |
| | | } |
| | | } |
src/main/java/com/landtool/lanbase/modules/org/entity/SysSysteminfo.java
src/main/java/com/landtool/lanbase/modules/org/redis/OrgUnitRedis.java
src/main/java/com/landtool/lanbase/modules/org/redis/OrgUserDefUnitRedis.java
src/main/java/com/landtool/lanbase/modules/org/redis/OrgUserRedis.java
src/main/java/com/landtool/lanbase/modules/org/redis/SysSystemInfoRedis.java
src/main/java/com/landtool/lanbase/modules/org/service/OrgUnitService.java
src/main/java/com/landtool/lanbase/modules/org/service/OrgUserService.java
src/main/java/com/landtool/lanbase/modules/org/service/impl/OrgUnitServiceImpl.java
src/main/java/com/landtool/lanbase/modules/org/service/impl/OrgUserServiceImpl.java
src/main/java/com/landtool/lanbase/modules/portlet/controller/IsLandTypeController.java
src/main/java/com/landtool/lanbase/modules/portlet/controller/ShuJuZhanShiController.java
src/main/java/com/landtool/lanbase/modules/res/controller/CommonController.java
src/main/java/com/landtool/lanbase/modules/res/controller/DiTuFuWuController.java
src/main/java/com/landtool/lanbase/modules/res/controller/JiChuDiTuController.java
src/main/java/com/landtool/lanbase/modules/res/controller/JitmonitorController.java
src/main/java/com/landtool/lanbase/modules/res/controller/KeShiHuaFuWuController.java
src/main/java/com/landtool/lanbase/modules/res/controller/NewResRegisterController.java
src/main/java/com/landtool/lanbase/modules/res/controller/OneMapController.java
src/main/java/com/landtool/lanbase/modules/res/controller/PingTaiMenHuController.java
src/main/java/com/landtool/lanbase/modules/res/controller/ResActionRecordController.java
src/main/java/com/landtool/lanbase/modules/res/controller/ResApplyRecommendController.java
src/main/java/com/landtool/lanbase/modules/res/controller/ResAuditController.java
src/main/java/com/landtool/lanbase/modules/res/controller/ResBusinessRefController.java
src/main/java/com/landtool/lanbase/modules/res/controller/ResCatalogController.java
src/main/java/com/landtool/lanbase/modules/res/controller/ResEchartsCofingController.java
src/main/java/com/landtool/lanbase/modules/res/controller/ResEvaluationController.java
src/main/java/com/landtool/lanbase/modules/res/controller/ResExt3DController.java
src/main/java/com/landtool/lanbase/modules/res/controller/ResExtAppController.java
src/main/java/com/landtool/lanbase/modules/res/controller/ResExtBaseMapController.java
src/main/java/com/landtool/lanbase/modules/res/controller/ResExtBusinessLayerController.java
src/main/java/com/landtool/lanbase/modules/res/controller/ResExtDataBaseController.java
src/main/java/com/landtool/lanbase/modules/res/controller/ResExtDataSourceController.java
src/main/java/com/landtool/lanbase/modules/res/controller/ResExtFileSourceController.java
src/main/java/com/landtool/lanbase/modules/res/controller/ResExtIntegrateController.java
src/main/java/com/landtool/lanbase/modules/res/controller/ResExtInterFaceServiceController.java
src/main/java/com/landtool/lanbase/modules/res/controller/ResExtMapUrlController.java
src/main/java/com/landtool/lanbase/modules/res/controller/ResExtSpaceServerController.java
src/main/java/com/landtool/lanbase/modules/res/controller/ResExtThemeMapController.java
src/main/java/com/landtool/lanbase/modules/res/controller/ResFilesController.java
src/main/java/com/landtool/lanbase/modules/res/controller/ResMainInfoController.java
src/main/java/com/landtool/lanbase/modules/res/controller/ResMainInfoController_bak20190109.java
src/main/java/com/landtool/lanbase/modules/res/controller/ResOnemapCatalogController.java
src/main/java/com/landtool/lanbase/modules/res/controller/ResProblemFeedbackController.java
src/main/java/com/landtool/lanbase/modules/res/controller/ResQueryAroundController.java
src/main/java/com/landtool/lanbase/modules/res/controller/ResRegisterController.java
src/main/java/com/landtool/lanbase/modules/res/controller/ResSubscriptionsController.java
src/main/java/com/landtool/lanbase/modules/res/controller/ResTemplateController.java
src/main/java/com/landtool/lanbase/modules/res/controller/ResThemeController.java
src/main/java/com/landtool/lanbase/modules/res/controller/ResThemeModuleController.java
src/main/java/com/landtool/lanbase/modules/res/controller/ResThemeRelationController.java
src/main/java/com/landtool/lanbase/modules/res/controller/SysteminfoController.java
src/main/java/com/landtool/lanbase/modules/res/controller/TestController.java
src/main/java/com/landtool/lanbase/modules/res/controller/UploadTemplateController.java
src/main/java/com/landtool/lanbase/modules/res/controller/WebServiceController.java
src/main/java/com/landtool/lanbase/modules/res/controller/ZhuanTiZhiTuController.java
src/main/java/com/landtool/lanbase/modules/res/controller/ZiYuanFaBuController.java
src/main/java/com/landtool/lanbase/modules/res/controller/ZiYuanMuLuController.java
src/main/java/com/landtool/lanbase/modules/res/controller/ZiYuanZhongXinController.java
src/main/java/com/landtool/lanbase/modules/res/dao/DiTuFuWuMapper.java
src/main/java/com/landtool/lanbase/modules/res/dao/JiChuDiTuMapper.java
src/main/java/com/landtool/lanbase/modules/res/dao/JitMonitorMapper.java
src/main/java/com/landtool/lanbase/modules/res/dao/KeShiHuaFuWuMapper.java
src/main/java/com/landtool/lanbase/modules/res/dao/PingTaiMenHuMapper.java
src/main/java/com/landtool/lanbase/modules/res/dao/ResStorageRelaTionMapper.java
src/main/java/com/landtool/lanbase/modules/res/dao/Res_ActionRecordMapper.java
src/main/java/com/landtool/lanbase/modules/res/dao/Res_ApplyRecommendMapper.java
src/main/java/com/landtool/lanbase/modules/res/dao/Res_AuditMapper.java
src/main/java/com/landtool/lanbase/modules/res/dao/Res_BookMarksMapper.java
src/main/java/com/landtool/lanbase/modules/res/dao/Res_BusinessRefMapper.java
src/main/java/com/landtool/lanbase/modules/res/dao/Res_BusinessThemeMapper.java
src/main/java/com/landtool/lanbase/modules/res/dao/Res_CatalogMapper.java
src/main/java/com/landtool/lanbase/modules/res/dao/Res_DiyLayerInfoMapper.java
src/main/java/com/landtool/lanbase/modules/res/dao/Res_EchartsCofingMapper.java
src/main/java/com/landtool/lanbase/modules/res/dao/Res_EvaluationMapper.java
src/main/java/com/landtool/lanbase/modules/res/dao/Res_Ext3DMapper.java
src/main/java/com/landtool/lanbase/modules/res/dao/Res_ExtAppMapper.java
src/main/java/com/landtool/lanbase/modules/res/dao/Res_ExtBaseMapMapper.java
src/main/java/com/landtool/lanbase/modules/res/dao/Res_ExtBusinessLayerMapper.java
src/main/java/com/landtool/lanbase/modules/res/dao/Res_ExtDataBaseMapper.java
src/main/java/com/landtool/lanbase/modules/res/dao/Res_ExtDataSourceMapper.java
src/main/java/com/landtool/lanbase/modules/res/dao/Res_ExtFileSourceMapper.java
src/main/java/com/landtool/lanbase/modules/res/dao/Res_ExtIntegrateMapper.java
src/main/java/com/landtool/lanbase/modules/res/dao/Res_ExtInterFaceServiceMapper.java
src/main/java/com/landtool/lanbase/modules/res/dao/Res_ExtMapUrlMapper.java
src/main/java/com/landtool/lanbase/modules/res/dao/Res_ExtMiddleWareMapper.java
src/main/java/com/landtool/lanbase/modules/res/dao/Res_ExtSpaceServerMapper.java
src/main/java/com/landtool/lanbase/modules/res/dao/Res_ExtThemeMapMapper.java
src/main/java/com/landtool/lanbase/modules/res/dao/Res_FileSource_WayMapper.java
src/main/java/com/landtool/lanbase/modules/res/dao/Res_FilesMapper.java
src/main/java/com/landtool/lanbase/modules/res/dao/Res_MainInfoMapper.java
src/main/java/com/landtool/lanbase/modules/res/dao/Res_OneMap_CatalogMapper.java
src/main/java/com/landtool/lanbase/modules/res/dao/Res_OneMap_CatalogResourceMapper.java
src/main/java/com/landtool/lanbase/modules/res/dao/Res_ProblemFeedbackMapper.java
src/main/java/com/landtool/lanbase/modules/res/dao/Res_QueryAroundMapper.java
src/main/java/com/landtool/lanbase/modules/res/dao/Res_SpacesParamMapper.java
src/main/java/com/landtool/lanbase/modules/res/dao/Res_StorageConfigMapper.java
src/main/java/com/landtool/lanbase/modules/res/dao/Res_SubscriptionsMapper.java
src/main/java/com/landtool/lanbase/modules/res/dao/Res_SymbolLibraryMapper.java
src/main/java/com/landtool/lanbase/modules/res/dao/Res_TempPrintMapper.java
src/main/java/com/landtool/lanbase/modules/res/dao/Res_TemplateDao.java
src/main/java/com/landtool/lanbase/modules/res/dao/Res_ThemeMapper.java
src/main/java/com/landtool/lanbase/modules/res/dao/Res_ThemeTypeMapper.java
src/main/java/com/landtool/lanbase/modules/res/dao/Res_Theme_ModuleMapper.java
src/main/java/com/landtool/lanbase/modules/res/dao/Res_Theme_RelationMapper.java
src/main/java/com/landtool/lanbase/modules/res/dao/Res_User_LayerExtentMapper.java
src/main/java/com/landtool/lanbase/modules/res/dao/RoleResCatalogMapper.java
src/main/java/com/landtool/lanbase/modules/res/dao/ZhuanTiZhiTuMapper.java
src/main/java/com/landtool/lanbase/modules/res/dao/ZiYuanFaBuMapper.java
src/main/java/com/landtool/lanbase/modules/res/dao/ZiYuanMuLuMapper.java
src/main/java/com/landtool/lanbase/modules/res/entity/DataBaseLeftDataSource/DataBaseLeftDataSource.java
src/main/java/com/landtool/lanbase/modules/res/entity/GraphicStyle.java
src/main/java/com/landtool/lanbase/modules/res/entity/JSONModels/BiaoJieGou.java
src/main/java/com/landtool/lanbase/modules/res/entity/JSONModels/DateType.java
src/main/java/com/landtool/lanbase/modules/res/entity/JSONModels/FieldMapping.java
src/main/java/com/landtool/lanbase/modules/res/entity/JSONModels/NcConfig.java
src/main/java/com/landtool/lanbase/modules/res/entity/JSONModels/NcMessage.java
src/main/java/com/landtool/lanbase/modules/res/entity/JSONModels/ServiceConfig.java
src/main/java/com/landtool/lanbase/modules/res/entity/JSONModels/SqlMapJson.java
src/main/java/com/landtool/lanbase/modules/res/entity/JSONModels/ZiDuanPeiZi.java
src/main/java/com/landtool/lanbase/modules/res/entity/Res_ActionRecord.java
src/main/java/com/landtool/lanbase/modules/res/entity/Res_ApplyRecommend.java
src/main/java/com/landtool/lanbase/modules/res/entity/Res_Audit.java
src/main/java/com/landtool/lanbase/modules/res/entity/Res_BookMarks.java
src/main/java/com/landtool/lanbase/modules/res/entity/Res_BusinessRef.java
src/main/java/com/landtool/lanbase/modules/res/entity/Res_BusinessTheme.java
src/main/java/com/landtool/lanbase/modules/res/entity/Res_Catalog.java
src/main/java/com/landtool/lanbase/modules/res/entity/Res_DiyLayerInfo.java
src/main/java/com/landtool/lanbase/modules/res/entity/Res_EchartsConfing.java
src/main/java/com/landtool/lanbase/modules/res/entity/Res_Evaluation.java
src/main/java/com/landtool/lanbase/modules/res/entity/Res_Ext3D.java
src/main/java/com/landtool/lanbase/modules/res/entity/Res_ExtApp.java
src/main/java/com/landtool/lanbase/modules/res/entity/Res_ExtBaseMap.java
src/main/java/com/landtool/lanbase/modules/res/entity/Res_ExtBusinessLayer.java
src/main/java/com/landtool/lanbase/modules/res/entity/Res_ExtDataBase.java
src/main/java/com/landtool/lanbase/modules/res/entity/Res_ExtDataSource.java
src/main/java/com/landtool/lanbase/modules/res/entity/Res_ExtFileSource.java
src/main/java/com/landtool/lanbase/modules/res/entity/Res_ExtIntegrate.java
src/main/java/com/landtool/lanbase/modules/res/entity/Res_ExtInterFaceService.java
src/main/java/com/landtool/lanbase/modules/res/entity/Res_ExtMapUrl.java
src/main/java/com/landtool/lanbase/modules/res/entity/Res_ExtMiddleWare.java
src/main/java/com/landtool/lanbase/modules/res/entity/Res_ExtSpaceServer.java
src/main/java/com/landtool/lanbase/modules/res/entity/Res_ExtSpaceServerWithBLOBs.java
src/main/java/com/landtool/lanbase/modules/res/entity/Res_ExtThemeMap.java
src/main/java/com/landtool/lanbase/modules/res/entity/Res_FileSource_Way.java
src/main/java/com/landtool/lanbase/modules/res/entity/Res_Files.java
src/main/java/com/landtool/lanbase/modules/res/entity/Res_MainInfo.java
src/main/java/com/landtool/lanbase/modules/res/entity/Res_OneMap_Catalog.java
src/main/java/com/landtool/lanbase/modules/res/entity/Res_OneMap_CatalogResource.java
src/main/java/com/landtool/lanbase/modules/res/entity/Res_ProblemFeedback.java
src/main/java/com/landtool/lanbase/modules/res/entity/Res_QueryAround.java
src/main/java/com/landtool/lanbase/modules/res/entity/Res_SpacesParam.java
src/main/java/com/landtool/lanbase/modules/res/entity/Res_SpacesParamWithBLOBs.java
src/main/java/com/landtool/lanbase/modules/res/entity/Res_StorageConfig.java
src/main/java/com/landtool/lanbase/modules/res/entity/Res_Storage_Relation.java
src/main/java/com/landtool/lanbase/modules/res/entity/Res_Subscriptions.java
src/main/java/com/landtool/lanbase/modules/res/entity/Res_SymbolLibrary.java
src/main/java/com/landtool/lanbase/modules/res/entity/Res_TempPrint.java
src/main/java/com/landtool/lanbase/modules/res/entity/Res_Template.java
src/main/java/com/landtool/lanbase/modules/res/entity/Res_Theme.java
src/main/java/com/landtool/lanbase/modules/res/entity/Res_ThemeRelation.java
src/main/java/com/landtool/lanbase/modules/res/entity/Res_ThemeType.java
src/main/java/com/landtool/lanbase/modules/res/entity/Res_Theme_Module.java
src/main/java/com/landtool/lanbase/modules/res/entity/Res_Theme_Relation.java
src/main/java/com/landtool/lanbase/modules/res/entity/Res_User_LayerExtent.java
src/main/java/com/landtool/lanbase/modules/res/entity/Role_ResCatalog.java
src/main/java/com/landtool/lanbase/modules/res/entity/SelectShuJuKu.java
src/main/java/com/landtool/lanbase/modules/res/entity/SimpleZiYuan.java
src/main/java/com/landtool/lanbase/modules/res/entity/TreeDataByResourceType.java
src/main/java/com/landtool/lanbase/modules/res/entity/UserDefined/CatlogJoinActionrecord.java
src/main/java/com/landtool/lanbase/modules/res/entity/UserDefined/DingYue.java
src/main/java/com/landtool/lanbase/modules/res/entity/UserDefined/MainInfoJoinActionRecord.java
src/main/java/com/landtool/lanbase/modules/res/entity/UserDefined/MainInfoJoinApplyRecommend.java
src/main/java/com/landtool/lanbase/modules/res/entity/UserDefined/MainInfoJoinApplyRecommendInfo.java
src/main/java/com/landtool/lanbase/modules/res/entity/UserDefined/MainInfoJoinAudit.java
src/main/java/com/landtool/lanbase/modules/res/entity/UserDefined/MainInfoJoinCatalog.java
src/main/java/com/landtool/lanbase/modules/res/entity/UserDefined/MainInfoJoinEvaluation.java
src/main/java/com/landtool/lanbase/modules/res/entity/UserDefined/MainInfoJoinJcdt.java
src/main/java/com/landtool/lanbase/modules/res/entity/UserDefined/MainInfoJoinRegister.java
src/main/java/com/landtool/lanbase/modules/res/entity/UserDefined/MainInfoJoinSubscriptions.java
src/main/java/com/landtool/lanbase/modules/res/entity/UserDefined/ResThemeModuleRequest.java
src/main/java/com/landtool/lanbase/modules/res/entity/UserDefined/UserDef_BaseMap.java
src/main/java/com/landtool/lanbase/modules/res/entity/UserDefined/UserDef_SpaceServer.java
src/main/java/com/landtool/lanbase/modules/res/entity/UserDefined/UserDef_ZYML_ChaXunQu.java
src/main/java/com/landtool/lanbase/modules/res/entity/UserDefined/ZiYuanMuLu/UserDef_DanWeiTongJi.java
src/main/java/com/landtool/lanbase/modules/res/entity/UserDefined/ZiYuanMuLu/UserDef_GongXiangXieYi.java
src/main/java/com/landtool/lanbase/modules/res/entity/UserDefined/ZiYuanMuLu/UserDef_ShiJianTongJi.java
src/main/java/com/landtool/lanbase/modules/res/entity/UserDefined/ZiYuanMuLu/UserDef_XingZhengQuHua.java
src/main/java/com/landtool/lanbase/modules/res/entity/UserDefined/ZiYuanMuLu/UserDef_ZYTJ_ShenHeZhuangTai.java
src/main/java/com/landtool/lanbase/modules/res/entity/UserDefined/ZiYuanMuLu/UserDef_ZYTJ_XingZhengQuHua.java
src/main/java/com/landtool/lanbase/modules/res/entity/UserDefined/ZiYuanMuLu/UserDef_ZYTJ_ZiYuanLeiXing.java
src/main/java/com/landtool/lanbase/modules/res/entity/UserDefined/ZiYuanMuLu/UserDef_ZiYuanLeiXing.java
src/main/java/com/landtool/lanbase/modules/res/entity/ViewModels/FileSourceList.java
src/main/java/com/landtool/lanbase/modules/res/entity/ViewModels/LayerObject.java
src/main/java/com/landtool/lanbase/modules/res/entity/ViewModels/LayerObject_Jcdt.java
src/main/java/com/landtool/lanbase/modules/res/entity/ViewModels/LayerObject_MapUrl.java
src/main/java/com/landtool/lanbase/modules/res/entity/ViewModels/LayerObject_Ywtc.java
src/main/java/com/landtool/lanbase/modules/res/entity/ViewModels/LayerObject_Ztdt.java
src/main/java/com/landtool/lanbase/modules/res/entity/ViewModels/TuChengView.java
src/main/java/com/landtool/lanbase/modules/res/entity/WebService/ParameterInfo.java
src/main/java/com/landtool/lanbase/modules/res/entity/WebService/SchemaDefaultType.java
src/main/java/com/landtool/lanbase/modules/res/entity/ZiYuanTongJi/GroupByDanWei.java
src/main/java/com/landtool/lanbase/modules/res/entity/ZiYuanTongJi/GroupByDataSources.java
src/main/java/com/landtool/lanbase/modules/res/entity/ZiYuanTongJi/GroupByGongXiangXieYi.java
src/main/java/com/landtool/lanbase/modules/res/entity/ZiYuanTongJi/GroupByMuLu.java
src/main/java/com/landtool/lanbase/modules/res/entity/ZiYuanTongJi/GroupByPubDate.java
src/main/java/com/landtool/lanbase/modules/res/entity/ZiYuanTongJi/GroupByXingZhengQuHua.java
src/main/java/com/landtool/lanbase/modules/res/entity/ZiYuanTongJi/GroupByZiYuanLeiXing.java
src/main/java/com/landtool/lanbase/modules/res/redis/ResCatalogRedis.java
src/main/java/com/landtool/lanbase/modules/res/service/DiTuFuWuService.java
src/main/java/com/landtool/lanbase/modules/res/service/JiChuDiTuService.java
src/main/java/com/landtool/lanbase/modules/res/service/JitMonitorService.java
src/main/java/com/landtool/lanbase/modules/res/service/KeShiHuaFuWuService.java
src/main/java/com/landtool/lanbase/modules/res/service/PingTaiMenHuService.java
src/main/java/com/landtool/lanbase/modules/res/service/ResActionRecordService.java
src/main/java/com/landtool/lanbase/modules/res/service/ResApplyRecommendService.java
src/main/java/com/landtool/lanbase/modules/res/service/ResAuditService.java
src/main/java/com/landtool/lanbase/modules/res/service/ResBookMarksService.java
src/main/java/com/landtool/lanbase/modules/res/service/ResBusinessRefService.java
src/main/java/com/landtool/lanbase/modules/res/service/ResCatalogService.java
src/main/java/com/landtool/lanbase/modules/res/service/ResDiyLayerInfoService.java
src/main/java/com/landtool/lanbase/modules/res/service/ResEchartsCofingService.java
src/main/java/com/landtool/lanbase/modules/res/service/ResEvaluationService.java
src/main/java/com/landtool/lanbase/modules/res/service/ResExt3DService.java
src/main/java/com/landtool/lanbase/modules/res/service/ResExtAppService.java
src/main/java/com/landtool/lanbase/modules/res/service/ResExtBaseMapService.java
src/main/java/com/landtool/lanbase/modules/res/service/ResExtBusinessLayerService.java
src/main/java/com/landtool/lanbase/modules/res/service/ResExtDataBaseService.java
src/main/java/com/landtool/lanbase/modules/res/service/ResExtDataSourceService.java
src/main/java/com/landtool/lanbase/modules/res/service/ResExtFileSourceService.java
src/main/java/com/landtool/lanbase/modules/res/service/ResExtIntegrateService.java
src/main/java/com/landtool/lanbase/modules/res/service/ResExtInterFaceService.java
src/main/java/com/landtool/lanbase/modules/res/service/ResExtMapUrlService.java
src/main/java/com/landtool/lanbase/modules/res/service/ResExtMiddleWareService.java
src/main/java/com/landtool/lanbase/modules/res/service/ResExtSpaceServerService.java
src/main/java/com/landtool/lanbase/modules/res/service/ResExtThemeMapService.java
src/main/java/com/landtool/lanbase/modules/res/service/ResFileSourceWayService.java
src/main/java/com/landtool/lanbase/modules/res/service/ResFilesService.java
src/main/java/com/landtool/lanbase/modules/res/service/ResMainInfoService.java
src/main/java/com/landtool/lanbase/modules/res/service/ResOnemapCatalogResourceService.java
src/main/java/com/landtool/lanbase/modules/res/service/ResOnemapCatalogService.java
src/main/java/com/landtool/lanbase/modules/res/service/ResProblemFeedbackService.java
src/main/java/com/landtool/lanbase/modules/res/service/ResQueryAroundService.java
src/main/java/com/landtool/lanbase/modules/res/service/ResSpacesParamService.java
src/main/java/com/landtool/lanbase/modules/res/service/ResStorageConfigService.java
src/main/java/com/landtool/lanbase/modules/res/service/ResStorageRelaTionService.java
src/main/java/com/landtool/lanbase/modules/res/service/ResSubscriptionsService.java
src/main/java/com/landtool/lanbase/modules/res/service/ResSymbolLibraryService.java
src/main/java/com/landtool/lanbase/modules/res/service/ResTempPrintService.java
src/main/java/com/landtool/lanbase/modules/res/service/ResTemplateService.java
src/main/java/com/landtool/lanbase/modules/res/service/ResThemeModuleService.java
src/main/java/com/landtool/lanbase/modules/res/service/ResThemeRelationService.java
src/main/java/com/landtool/lanbase/modules/res/service/ResThemeService.java
src/main/java/com/landtool/lanbase/modules/res/service/ResThemeTypeService.java
src/main/java/com/landtool/lanbase/modules/res/service/ResUserLayerExtentService.java
src/main/java/com/landtool/lanbase/modules/res/service/RoleResCatalogService.java
src/main/java/com/landtool/lanbase/modules/res/service/ZhuanTiZhiTuService.java
src/main/java/com/landtool/lanbase/modules/res/service/ZiYuanFaBuService.java
src/main/java/com/landtool/lanbase/modules/res/service/ZiYuanMuLuService.java
src/main/java/com/landtool/lanbase/modules/res/service/impl/DiTuFuWuServiceImpl.java
src/main/java/com/landtool/lanbase/modules/res/service/impl/JiChuDiTuServiceImpl.java
src/main/java/com/landtool/lanbase/modules/res/service/impl/JitMonitorServiceImpl.java
src/main/java/com/landtool/lanbase/modules/res/service/impl/KeShiHuaFuWuServiceImpl.java
src/main/java/com/landtool/lanbase/modules/res/service/impl/PingTaiMenHuServiceImpl.java
src/main/java/com/landtool/lanbase/modules/res/service/impl/ResActionRecordServiceImpl.java
src/main/java/com/landtool/lanbase/modules/res/service/impl/ResApplyRecommendServiceImpl.java
src/main/java/com/landtool/lanbase/modules/res/service/impl/ResAuditServiceImpl.java
src/main/java/com/landtool/lanbase/modules/res/service/impl/ResBookMarksServiceImpl.java
src/main/java/com/landtool/lanbase/modules/res/service/impl/ResBusinessRefServiceImpl.java
src/main/java/com/landtool/lanbase/modules/res/service/impl/ResCatalogServiceImpl.java
src/main/java/com/landtool/lanbase/modules/res/service/impl/ResDiyLayerInfoServiceImpl.java
src/main/java/com/landtool/lanbase/modules/res/service/impl/ResEchartsCofingServiceImpl.java
src/main/java/com/landtool/lanbase/modules/res/service/impl/ResEvaluationServiceImpl.java
src/main/java/com/landtool/lanbase/modules/res/service/impl/ResExt3DServiceImpl.java
src/main/java/com/landtool/lanbase/modules/res/service/impl/ResExtAppServiceImpl.java
src/main/java/com/landtool/lanbase/modules/res/service/impl/ResExtBaseMapServiceImpl.java
src/main/java/com/landtool/lanbase/modules/res/service/impl/ResExtBusinessLayerServiceImpl.java
src/main/java/com/landtool/lanbase/modules/res/service/impl/ResExtDataBaseServiceImpl.java
src/main/java/com/landtool/lanbase/modules/res/service/impl/ResExtDataSourceServiceImpl.java
src/main/java/com/landtool/lanbase/modules/res/service/impl/ResExtFileSourceServiceImpl.java
src/main/java/com/landtool/lanbase/modules/res/service/impl/ResExtIntegrateServiceImpl.java
src/main/java/com/landtool/lanbase/modules/res/service/impl/ResExtInterFaceServiceImpl.java
src/main/java/com/landtool/lanbase/modules/res/service/impl/ResExtMapUrlServiceImpl.java
src/main/java/com/landtool/lanbase/modules/res/service/impl/ResExtMiddleWareServiceImpl.java
src/main/java/com/landtool/lanbase/modules/res/service/impl/ResExtSpaceServerServiceImpl.java
src/main/java/com/landtool/lanbase/modules/res/service/impl/ResExtThemeMapServiceImpl.java
src/main/java/com/landtool/lanbase/modules/res/service/impl/ResFileSourceWayServiceImpl.java
src/main/java/com/landtool/lanbase/modules/res/service/impl/ResFilesServiceImpl.java
src/main/java/com/landtool/lanbase/modules/res/service/impl/ResMainInfoServiceImpl.java
src/main/java/com/landtool/lanbase/modules/res/service/impl/ResOnemapCatalogResourceServiceImpl.java
src/main/java/com/landtool/lanbase/modules/res/service/impl/ResOnemapCatalogServiceImpl.java
src/main/java/com/landtool/lanbase/modules/res/service/impl/ResProblemFeedbackServiceImpl.java
src/main/java/com/landtool/lanbase/modules/res/service/impl/ResQueryAroundServiceImpl.java
src/main/java/com/landtool/lanbase/modules/res/service/impl/ResSpacesParamServiceImpl.java
src/main/java/com/landtool/lanbase/modules/res/service/impl/ResStorageConfigServiceImpl.java
src/main/java/com/landtool/lanbase/modules/res/service/impl/ResStorageRelaTionServiceImpl.java
src/main/java/com/landtool/lanbase/modules/res/service/impl/ResSubscriptionsServiceImpl.java
src/main/java/com/landtool/lanbase/modules/res/service/impl/ResSymbolLibraryServiceImpl.java
src/main/java/com/landtool/lanbase/modules/res/service/impl/ResTempPrintServiceImpl.java
src/main/java/com/landtool/lanbase/modules/res/service/impl/ResTemplateServiceImpl.java
src/main/java/com/landtool/lanbase/modules/res/service/impl/ResThemeModuleServiceImpl.java
src/main/java/com/landtool/lanbase/modules/res/service/impl/ResThemeRelationServiceImpl.java
src/main/java/com/landtool/lanbase/modules/res/service/impl/ResThemeServiceImpl.java
src/main/java/com/landtool/lanbase/modules/res/service/impl/ResThemeTypeServiceImpl.java
src/main/java/com/landtool/lanbase/modules/res/service/impl/ResUserLayerExtentServiceImpl.java
src/main/java/com/landtool/lanbase/modules/res/service/impl/RoleResCatalogServiceImpl.java
src/main/java/com/landtool/lanbase/modules/res/service/impl/ZhuanTiZhiTuServiceImpl.java
src/main/java/com/landtool/lanbase/modules/res/service/impl/ZiYuanFaBuServiceImpl.java
src/main/java/com/landtool/lanbase/modules/res/service/impl/ZiYuanMuLuServiceImpl.java
src/main/java/com/landtool/lanbase/modules/sys/controller/AbstractController.java
src/main/java/com/landtool/lanbase/modules/sys/controller/SysLoginController.java
src/main/java/com/landtool/lanbase/modules/sys/controller/SysMenuController.java
src/main/java/com/landtool/lanbase/modules/sys/controller/SysUserController.java
src/main/java/com/landtool/lanbase/modules/sys/dao/BaseDao.java
src/main/java/com/landtool/lanbase/modules/sys/dao/SysUserTokenDao.java
src/main/java/com/landtool/lanbase/modules/sys/entity/PubNews.java
src/main/java/com/landtool/lanbase/modules/sys/entity/SysColumn.java
src/main/java/com/landtool/lanbase/modules/sys/entity/SysField.java
src/main/java/com/landtool/lanbase/modules/sys/entity/SysFieldvalue.java
src/main/java/com/landtool/lanbase/modules/sys/entity/SysMenu.java
src/main/java/com/landtool/lanbase/modules/sys/entity/SysResource.java
src/main/java/com/landtool/lanbase/modules/sys/entity/SysRole.java
src/main/java/com/landtool/lanbase/modules/sys/entity/SysRoleResource.java
src/main/java/com/landtool/lanbase/modules/sys/entity/SysSysteminfo.java
src/main/java/com/landtool/lanbase/modules/sys/entity/SysTable.java
src/main/java/com/landtool/lanbase/modules/sys/entity/SysUser.java
src/main/java/com/landtool/lanbase/modules/sys/entity/SysUserApplist.java
src/main/java/com/landtool/lanbase/modules/sys/entity/SysUserRole.java
src/main/java/com/landtool/lanbase/modules/sys/entity/SysUserToken.java
src/main/java/com/landtool/lanbase/modules/sys/redis/OnlineUserRedis.java
src/main/java/com/landtool/lanbase/modules/sys/redis/SysFieldvalueRedis.java
src/main/java/com/landtool/lanbase/modules/sys/redis/SysUserTokenRedis.java
src/main/java/com/landtool/lanbase/modules/sys/service/SysFieldvalueService.java
src/main/java/com/landtool/lanbase/modules/sys/service/SysUserTokenService.java
src/main/java/com/landtool/lanbase/modules/sys/service/impl/SysFieldvalueServiceImpl.java
src/main/java/com/landtool/lanbase/modules/sys/service/impl/SysUserTokenServiceImpl.java
src/main/java/com/landtool/lanbase/modules/terra/GisService.java
src/main/java/com/landtool/lanbase/modules/terra/GisServiceListener.java
src/main/java/com/landtool/lanbase/test/NcService.java
src/main/resources/application-dev.yml
src/main/resources/application-pro.yml
src/main/resources/application.yml
src/main/resources/banner.txt
src/main/resources/cas.keystore
src/main/resources/generator.properties
src/main/resources/logback-spring.xml
src/main/resources/mapper/res/DiTuFuWuMapper.xml
src/main/resources/mapper/res/JiChuDiTuMapper.xml
src/main/resources/mapper/res/JitMonitorMapper.xml
src/main/resources/mapper/res/KeShiHuaFuWuMapper.xml
src/main/resources/mapper/res/PingTaiMenHuMapper.xml
src/main/resources/mapper/res/Res_ActionRecordMapper.xml
src/main/resources/mapper/res/Res_ApplyRecommendMapper.xml
src/main/resources/mapper/res/Res_AuditMapper.xml
src/main/resources/mapper/res/Res_BookMarksMapper.xml
src/main/resources/mapper/res/Res_BusinessRefMapper.xml
src/main/resources/mapper/res/Res_BusinessThemeMapper.xml
src/main/resources/mapper/res/Res_CatalogMapper.xml
src/main/resources/mapper/res/Res_DiyLayerInfoMapper.xml
src/main/resources/mapper/res/Res_EchartsConfingMapper.xml
src/main/resources/mapper/res/Res_EvaluationMapper.xml
src/main/resources/mapper/res/Res_Ext3DMapper.xml
src/main/resources/mapper/res/Res_ExtAppMapper.xml
src/main/resources/mapper/res/Res_ExtBaseMapMapper.xml
src/main/resources/mapper/res/Res_ExtBusinessLayerMapper.xml
src/main/resources/mapper/res/Res_ExtDataBaseMapper.xml
src/main/resources/mapper/res/Res_ExtDataSourceMapper.xml
src/main/resources/mapper/res/Res_ExtFileSourceMapper.xml
src/main/resources/mapper/res/Res_ExtIntegrateMapper.xml
src/main/resources/mapper/res/Res_ExtInterFaceServiceMapper.xml
src/main/resources/mapper/res/Res_ExtMapUrlMapper.xml
src/main/resources/mapper/res/Res_ExtMiddleWareMapper.xml
src/main/resources/mapper/res/Res_ExtSpaceServerMapper.xml
src/main/resources/mapper/res/Res_ExtThemeMapMapper.xml
src/main/resources/mapper/res/Res_FileSource_WayMapper.xml
src/main/resources/mapper/res/Res_FilesMapper.xml
src/main/resources/mapper/res/Res_MainInfoMapper.xml
src/main/resources/mapper/res/Res_OneMap_CatalogMapper.xml
src/main/resources/mapper/res/Res_OneMap_CatalogResourceMapper.xml
src/main/resources/mapper/res/Res_ProblemFeedbackMapper.xml
src/main/resources/mapper/res/Res_QueryAroundMapper.xml
src/main/resources/mapper/res/Res_SpacesParamMapper.xml
src/main/resources/mapper/res/Res_StorageConfigMapper.xml
src/main/resources/mapper/res/Res_Storage_RelationMapper.xml
src/main/resources/mapper/res/Res_SubscriptionsMapper.xml
src/main/resources/mapper/res/Res_SymbolLibraryMapper.xml
src/main/resources/mapper/res/Res_TempPrintMapper.xml
src/main/resources/mapper/res/Res_TemplateMapper.xml
src/main/resources/mapper/res/Res_ThemeMapper.xml
src/main/resources/mapper/res/Res_ThemeTypeMapper.xml
src/main/resources/mapper/res/Res_Theme_ModuleMapper.xml
src/main/resources/mapper/res/Res_Theme_RelationMapper.xml
src/main/resources/mapper/res/Res_User_LayerExtentMapper.xml
src/main/resources/mapper/res/RoleResCatalogMapper.xml
src/main/resources/mapper/res/ZhuanTiZhiTuMapper.xml
src/main/resources/mapper/res/ZiYuanFaBuMapper.xml
src/main/resources/mapper/res/ZiYuanMuLuMapper.xml
src/main/resources/static/ZiYuanIcon/right.gif
src/main/resources/static/config/ResourceFlowConfig.json
src/main/resources/static/css/AdminLTE.min.css
src/main/resources/static/css/Query.css
src/main/resources/static/css/TuXinCongif.css
src/main/resources/static/css/TuXingConfig.css
src/main/resources/static/css/ZiYuanZhongXin/Index.css
src/main/resources/static/css/ZiYuanZhongXin/Indexnew.css
src/main/resources/static/css/all-skins.min.css
src/main/resources/static/css/bootstrap-extract.css
src/main/resources/static/css/bootstrap-table.min.css
src/main/resources/static/css/bootstrap.css
src/main/resources/static/css/bootstrap.min.css
src/main/resources/static/css/components.css
src/main/resources/static/css/ditufuwu/index.css
src/main/resources/static/css/ditufuwu/indexnew.css
src/main/resources/static/css/firstebox.css
src/main/resources/static/css/font-awesome.min.css
src/main/resources/static/css/grid-selfAdaptH.css
src/main/resources/static/css/jquery-ui.min.css
src/main/resources/static/css/main.css
src/main/resources/static/css/mtree.css
src/main/resources/static/css/plugins.css
src/main/resources/static/css/tagsinput.css
src/main/resources/static/css/zTreeCover.css
src/main/resources/static/favicon.ico
src/main/resources/static/fonts/FontAwesome.otf
src/main/resources/static/fonts/fontawesome-webfont.eot
src/main/resources/static/fonts/fontawesome-webfont.svg
src/main/resources/static/fonts/fontawesome-webfont.ttf
src/main/resources/static/fonts/fontawesome-webfont.woff
src/main/resources/static/fonts/fontawesome-webfont.woff2
src/main/resources/static/fonts/glyphicons-halflings-regular.eot
src/main/resources/static/fonts/glyphicons-halflings-regular.svg
src/main/resources/static/fonts/glyphicons-halflings-regular.ttf
src/main/resources/static/fonts/glyphicons-halflings-regular.woff
src/main/resources/static/fonts/glyphicons-halflings-regular.woff2
src/main/resources/static/image/AnXianChangDuTuLi.jpg
src/main/resources/static/image/Atkas/Atkasbak/JKFW/JKFW.gif
src/main/resources/static/image/Atkas/Atkasbak/JKFW/JKFW2.gif
src/main/resources/static/image/Atkas/Atkasbak/JKFW/JKFW3.gif
src/main/resources/static/image/Atkas/Atkasbak/KJ_JCDT/KJ_JCDT.gif
src/main/resources/static/image/Atkas/Atkasbak/KJ_JCDT/KJ_JCDT2.gif
src/main/resources/static/image/Atkas/Atkasbak/KJ_JCDT/KJ_JCDT3.gif
src/main/resources/static/image/Atkas/Atkasbak/KJ_JCDT/KJ_JCDT4.gif
src/main/resources/static/image/Atkas/Atkasbak/KJ_KJFX/KJ_KJFX.gif
src/main/resources/static/image/Atkas/Atkasbak/KJ_KJFX/KJ_KJFX2.gif
src/main/resources/static/image/Atkas/Atkasbak/KJ_SWMX/KJ_SWMX.gif
src/main/resources/static/image/Atkas/Atkasbak/KJ_SWMX/KJ_SWMX2.gif
src/main/resources/static/image/Atkas/Atkasbak/KJ_YWTC/KJ_YWTC2.gif
src/main/resources/static/image/Atkas/Atkasbak/KJ_YWTC/KJ_YWTC3.gif
src/main/resources/static/image/Atkas/Atkasbak/KJ_YWTC/KJ_YWTC4.gif
src/main/resources/static/image/Atkas/Atkasbak/KJ_YWTC/KJ_YWTC5.gif
src/main/resources/static/image/Atkas/Atkasbak/KJ_YWTC/KJ_YWTC6.gif
src/main/resources/static/image/Atkas/Atkasbak/KJ_YWTC/KJ_YWTC7.gif
src/main/resources/static/image/Atkas/Atkasbak/KJ_YWTC/KJ_YWTC8.gif
src/main/resources/static/image/Atkas/Atkasbak/KJ_ZTDT/KJ_ZTDT.gif
src/main/resources/static/image/Atkas/Atkasbak/KJ_ZTDT/KJ_ZTDT2.gif
src/main/resources/static/image/Atkas/Atkasbak/KJ_ZTDT/KJ_ZTDT3.gif
src/main/resources/static/image/Atkas/Atkasbak/KJ_ZTDT/KJ_ZTDT4.gif
src/main/resources/static/image/Atkas/Atkasbak/KJ_ZTDT/KJ_ZTDT5.gif
src/main/resources/static/image/Atkas/Atkasbak/SJKB/SJKB.gif
src/main/resources/static/image/Atkas/Atkasbak/SJKB/SJKB2.gif
src/main/resources/static/image/Atkas/Atkasbak/SJKB/SJKB3.gif
src/main/resources/static/image/Atkas/Atkasbak/SJKB/SJKB4.gif
src/main/resources/static/image/Atkas/Atkasbak/SJKB/SJKB5.gif
src/main/resources/static/image/Atkas/Atkasbak/SJWJ/SJWJ.gif
src/main/resources/static/image/Atkas/Atkasbak/SJWJ/SJWJ2.gif
src/main/resources/static/image/Atkas/Atkasbak/SJWJ/SJWJ3.gif
src/main/resources/static/image/Atkas/Atkasbak/SJWJ/SJWJ4.gif
src/main/resources/static/image/Atkas/Atkasbak/SJWJ/SJWJ5.gif
src/main/resources/static/image/Atkas/Atkasbak/SJWJ/SJWJ6.gif
src/main/resources/static/image/Atkas/Atkasbak/YWJC/YWJC.gif
src/main/resources/static/image/Atkas/Atkasbak/YWJC/YWJC2.gif
src/main/resources/static/image/Atkas/Atkasbak/YWJC/YWJC3.gif
src/main/resources/static/image/Atkas/Atkasbak/YWJC/YWJC4.gif
src/main/resources/static/image/Atkas/Atkasbak/YWJC/YWJC5.gif
src/main/resources/static/image/Atkas/NewAtkas/JKFW/JKFW.gif
src/main/resources/static/image/Atkas/NewAtkas/JKFW/JKFW2.gif
src/main/resources/static/image/Atkas/NewAtkas/JKFW/JKFW3.png
src/main/resources/static/image/Atkas/NewAtkas/KJ_JCDT/KJ_JCDT.gif
src/main/resources/static/image/Atkas/NewAtkas/KJ_JCDT/KJ_JCDT2.gif
src/main/resources/static/image/Atkas/NewAtkas/KJ_JCDT/KJ_JCDT3.gif
src/main/resources/static/image/Atkas/NewAtkas/KJ_JCDT/KJ_JCDT4.gif
src/main/resources/static/image/Atkas/NewAtkas/KJ_KJFX/KJ_KJFX.gif
src/main/resources/static/image/Atkas/NewAtkas/KJ_KJFX/KJ_KJFX2.gif
src/main/resources/static/image/Atkas/NewAtkas/KJ_SWDX/KJ_SWDX.gif
src/main/resources/static/image/Atkas/NewAtkas/KJ_SWMX/KJ_SWMX.gif
src/main/resources/static/image/Atkas/NewAtkas/KJ_SWYX/KJ_SWYX.gif
src/main/resources/static/image/Atkas/NewAtkas/KJ_YWTC/KJ_YWTC.gif
src/main/resources/static/image/Atkas/NewAtkas/KJ_YWTC/KJ_YWTC2.gif
src/main/resources/static/image/Atkas/NewAtkas/KJ_YWTC/KJ_YWTC3.gif
src/main/resources/static/image/Atkas/NewAtkas/KJ_YWTC/KJ_YWTC4.gif
src/main/resources/static/image/Atkas/NewAtkas/KJ_YWTC/KJ_YWTC5.gif
src/main/resources/static/image/Atkas/NewAtkas/KJ_YWTC/KJ_YWTC6.gif
src/main/resources/static/image/Atkas/NewAtkas/KJ_YWTC/KJ_YWTC7.gif
src/main/resources/static/image/Atkas/NewAtkas/KJ_ZTDT/KJ_ZTDT.gif
src/main/resources/static/image/Atkas/NewAtkas/KJ_ZTDT/KJ_ZTDT2.gif
src/main/resources/static/image/Atkas/NewAtkas/KJ_ZTDT/KJ_ZTDT3.gif
src/main/resources/static/image/Atkas/NewAtkas/KJ_ZTDT/KJ_ZTDT4.gif
src/main/resources/static/image/Atkas/NewAtkas/KJ_ZTDT/KJ_ZTDT5.gif
src/main/resources/static/image/Atkas/NewAtkas/SJKB/SJKB.gif
src/main/resources/static/image/Atkas/NewAtkas/SJKB/SJKB2.gif
src/main/resources/static/image/Atkas/NewAtkas/SJKB/SJKB3.gif
src/main/resources/static/image/Atkas/NewAtkas/SJKB/SJKB4.gif
src/main/resources/static/image/Atkas/NewAtkas/SJKB/SJKB5.gif
src/main/resources/static/image/Atkas/NewAtkas/SJWJ/SJWJ.gif
src/main/resources/static/image/Atkas/NewAtkas/SJWJ/SJWJ2.gif
src/main/resources/static/image/Atkas/NewAtkas/SJWJ/SJWJ3.gif
src/main/resources/static/image/Atkas/NewAtkas/SJWJ/SJWJ4.gif
src/main/resources/static/image/Atkas/NewAtkas/SJWJ/SJWJ5.gif
src/main/resources/static/image/Atkas/NewAtkas/SJWJ/SJWJ6.gif
src/main/resources/static/image/Atkas/NewAtkas/YWJC/YWJC.gif
src/main/resources/static/image/Atkas/NewAtkas/YWJC/YWJC2.gif
src/main/resources/static/image/Atkas/NewAtkas/YWJC/YWJC3.gif
src/main/resources/static/image/Atkas/NewAtkas/YWJC/YWJC4.gif
src/main/resources/static/image/Atkas/NewAtkas/YWJC/YWJC5.gif
src/main/resources/static/image/Draw.png
src/main/resources/static/image/HYTongJi/right.gif
src/main/resources/static/image/HYTongJi/wrong.gif
src/main/resources/static/image/MenHuIndex/addPic.gif
src/main/resources/static/image/MenHuIndex/fubiaobig.png
src/main/resources/static/image/MenHuIndex/fubiaosmall.png
src/main/resources/static/image/MenHuIndex/new.gif
src/main/resources/static/image/MenHuIndex/shipinbig.png
src/main/resources/static/image/MenHuIndex/shipinsmall.png
src/main/resources/static/image/NewMenHu/FaBuShenHe.png
src/main/resources/static/image/NewMenHu/JiChuDiTu.png
src/main/resources/static/image/NewMenHu/KeShiHua.png
src/main/resources/static/image/NewMenHu/ShenQingPiFu.png
src/main/resources/static/image/NewMenHu/WoDeDingYue.png
src/main/resources/static/image/NewMenHu/WoDeFaBu.png
src/main/resources/static/image/NewMenHu/WoDeShenQing.png
src/main/resources/static/image/NewMenHu/WoDeShouCang.png
src/main/resources/static/image/NewMenHu/ZhuanTiZhiTu.png
src/main/resources/static/image/NewMenHu/ZiYuanFaBu.png
src/main/resources/static/image/NewMenHu/ZiYuanMuLu.png
src/main/resources/static/image/NewMenHu/fb_GuZhang.png
src/main/resources/static/image/NewMenHu/fb_ZhengChang.png
src/main/resources/static/image/NewMenHu/more.png
src/main/resources/static/image/NewMenHu/sp_GuZhang.png
src/main/resources/static/image/NewMenHu/sp_ZhengChang.png
src/main/resources/static/image/NewMenHu/sys.png
src/main/resources/static/image/NewMenHu/user.png
src/main/resources/static/image/NewMenHu/user_bg.png
src/main/resources/static/image/Plus.gif
src/main/resources/static/image/PubNews/资讯动态.png
src/main/resources/static/image/PubNews/通知公告.png
src/main/resources/static/image/QuYuBianHuaTuLi.png
src/main/resources/static/image/Systeminfo/First_icon.png
src/main/resources/static/image/Systeminfo/IEicon.png
src/main/resources/static/image/Systeminfo/haidao.png
src/main/resources/static/image/Systeminfo/haiyu.png
src/main/resources/static/image/Systeminfo/huangjing.png
src/main/resources/static/image/Systeminfo/huanjinganquan.png
src/main/resources/static/image/Systeminfo/jingji.png
src/main/resources/static/image/Systeminfo/search.png
src/main/resources/static/image/Systeminfo/yubaojianzai.png
src/main/resources/static/image/Systeminfo/zhifa.png
src/main/resources/static/image/Systeminfo/zonghe.png
src/main/resources/static/image/TEXT1.png
src/main/resources/static/image/TopMenu/10haididianlanguandao.png
src/main/resources/static/image/TopMenu/10haididianlanguandao_active.png
src/main/resources/static/image/TopMenu/11ditudingweifenxi.png
src/main/resources/static/image/TopMenu/11ditudingweifenxi_active.png
src/main/resources/static/image/TopMenu/12haiyushiyonglunzheng.png
src/main/resources/static/image/TopMenu/12haiyushiyonglunzheng_active.png
src/main/resources/static/image/TopMenu/13shujujiaodui.png
src/main/resources/static/image/TopMenu/13shujujiaodui_active.png
src/main/resources/static/image/TopMenu/1gerenmenhu.png
src/main/resources/static/image/TopMenu/1zhzs.png
src/main/resources/static/image/TopMenu/1zhzs_active.png
src/main/resources/static/image/TopMenu/2shouye.png
src/main/resources/static/image/TopMenu/2shouye_active.png
src/main/resources/static/image/TopMenu/2zonghezhanshi.png
src/main/resources/static/image/TopMenu/3ziyuanmulu.png
src/main/resources/static/image/TopMenu/4daohangxitong.png
src/main/resources/static/image/TopMenu/4quyuyonghaiguihua.png
src/main/resources/static/image/TopMenu/4quyuyonghaiguihua_active.png
src/main/resources/static/image/TopMenu/5weitianhaoguihua.png
src/main/resources/static/image/TopMenu/5weitianhaoguihua_active.png
src/main/resources/static/image/TopMenu/5xitongshezhi.png
src/main/resources/static/image/TopMenu/6haiyuquanshuguanli.png
src/main/resources/static/image/TopMenu/6haiyuquanshuguanli_active.png
src/main/resources/static/image/TopMenu/6yingxiangguanli.png
src/main/resources/static/image/TopMenu/7haiyushiyongjinguanli.png
src/main/resources/static/image/TopMenu/7haiyushiyongjinguanli_active.png
src/main/resources/static/image/TopMenu/8haiyushiyongzhifa.png
src/main/resources/static/image/TopMenu/8haiyushiyongzhifa_active.png
src/main/resources/static/image/TopMenu/CommonMenu/banner_bg_04.png
src/main/resources/static/image/TopMenu/CommonMenu/banner_right.png
src/main/resources/static/image/TopMenu/CommonMenu/commontitle.png
src/main/resources/static/image/TopMenu/CommonMenu/ditufuwutitle.png
src/main/resources/static/image/TopMenu/CommonMenu/jichuditutitle.png
src/main/resources/static/image/TopMenu/CommonMenu/mapicon_01.png
src/main/resources/static/image/TopMenu/CommonMenu/mapicon_02.png
src/main/resources/static/image/TopMenu/CommonMenu/mapicon_03.png
src/main/resources/static/image/TopMenu/CommonMenu/mapicon_04.png
src/main/resources/static/image/TopMenu/CommonMenu/mapicon_06.png
src/main/resources/static/image/TopMenu/CommonMenu/ziyuanfabu.png
src/main/resources/static/image/TopMenu/CommonMenu/ziyuanfabutitle-old.png
src/main/resources/static/image/TopMenu/CommonMenu/ziyuanfabutitle.png
src/main/resources/static/image/TopMenu/CommonMenu/ziyuanmulu.png
src/main/resources/static/image/TopMenu/CommonMenu/ziyuanmulutitle-old.png
src/main/resources/static/image/TopMenu/CommonMenu/ziyuanmulutitle.png
src/main/resources/static/image/TopMenu/CommonMenu/ziyuanzhongxin.png
src/main/resources/static/image/TopMenu/CommonMenu/ziyuanzhongxintitle-old.png
src/main/resources/static/image/TopMenu/CommonMenu/ziyuanzhongxintitle.png
src/main/resources/static/image/TopMenu/NewMenu/admin.png
src/main/resources/static/image/TopMenu/NewMenu/btn_01.png
src/main/resources/static/image/TopMenu/NewMenu/btn_01_on.png
src/main/resources/static/image/TopMenu/NewMenu/btn_02.png
src/main/resources/static/image/TopMenu/NewMenu/btn_02_on.png
src/main/resources/static/image/TopMenu/NewMenu/btn_03.png
src/main/resources/static/image/TopMenu/NewMenu/btn_03_on.png
src/main/resources/static/image/TopMenu/NewMenu/btn_04.png
src/main/resources/static/image/TopMenu/NewMenu/btn_04_on.png
src/main/resources/static/image/TopMenu/NewMenu/btn_05.png
src/main/resources/static/image/TopMenu/NewMenu/btn_05_on.png
src/main/resources/static/image/TopMenu/NewMenu/top_bg.bak.jpg
src/main/resources/static/image/TopMenu/NewMenu/top_bg.jpg
src/main/resources/static/image/TopMenu/NewMenu/top_tit.png
src/main/resources/static/image/TopMenu/NewMenu/user_bg.png
src/main/resources/static/image/TopMenu/ResourceSearch.png
src/main/resources/static/image/TopMenu/back.png
src/main/resources/static/image/TopMenu/back_btn.png
src/main/resources/static/image/TopMenu/back_btn_on.png
src/main/resources/static/image/TopMenu/btn_bg.gif
src/main/resources/static/image/TopMenu/bz.png
src/main/resources/static/image/TopMenu/ditufuwu_Logo.jpg
src/main/resources/static/image/TopMenu/ditusearch.bmp
src/main/resources/static/image/TopMenu/exit.png
src/main/resources/static/image/TopMenu/feature_data.png
src/main/resources/static/image/TopMenu/feature_data_active.png
src/main/resources/static/image/TopMenu/guangdong_tit_01.jpg
src/main/resources/static/image/TopMenu/guangdongxianji_tit.png
src/main/resources/static/image/TopMenu/hyqs_main.png
src/main/resources/static/image/TopMenu/hyqs_main_active.png
src/main/resources/static/image/TopMenu/hyqs_qsdj.png
src/main/resources/static/image/TopMenu/hyqs_qsdj_active.png
src/main/resources/static/image/TopMenu/hyqs_sjll.png
src/main/resources/static/image/TopMenu/hyqs_sjll_active.png
src/main/resources/static/image/TopMenu/hyqs_sqsp.png
src/main/resources/static/image/TopMenu/hyqs_sqsp_active.png
src/main/resources/static/image/TopMenu/hysyj_main.png
src/main/resources/static/image/TopMenu/hysyj_main_active.png
src/main/resources/static/image/TopMenu/hysytj_main.png
src/main/resources/static/image/TopMenu/hysytj_main_active.png
src/main/resources/static/image/TopMenu/icon1.png
src/main/resources/static/image/TopMenu/jigouzhuangkuang.png
src/main/resources/static/image/TopMenu/logo.png
src/main/resources/static/image/TopMenu/logo_tit.png
src/main/resources/static/image/TopMenu/mapSearch.png
src/main/resources/static/image/TopMenu/map_dixing.gif
src/main/resources/static/image/TopMenu/map_shiliang.gif
src/main/resources/static/image/TopMenu/map_yaogan.gif
src/main/resources/static/image/TopMenu/mapicon_01.png
src/main/resources/static/image/TopMenu/mapicon_01_on.png
src/main/resources/static/image/TopMenu/mapicon_02.png
src/main/resources/static/image/TopMenu/mapicon_02_on.png
src/main/resources/static/image/TopMenu/mapicon_03.png
src/main/resources/static/image/TopMenu/mapicon_03_on.png
src/main/resources/static/image/TopMenu/mapicon_04.png
src/main/resources/static/image/TopMenu/mapicon_04_on.png
src/main/resources/static/image/TopMenu/mapicon_05.png
src/main/resources/static/image/TopMenu/mapicon_05_on.png
src/main/resources/static/image/TopMenu/mapicon_06.png
src/main/resources/static/image/TopMenu/mapicon_06_on.png
src/main/resources/static/image/TopMenu/oceanplan.png
src/main/resources/static/image/TopMenu/oceanplan_active.png
src/main/resources/static/image/TopMenu/peihaoluru.png
src/main/resources/static/image/TopMenu/search_02bg.jpg
src/main/resources/static/image/TopMenu/search_bg.jpg
src/main/resources/static/image/TopMenu/search_btn.png
src/main/resources/static/image/TopMenu/shoucang_btn.png
src/main/resources/static/image/TopMenu/shujuzhengli.png
src/main/resources/static/image/TopMenu/shujuzhengli_active.png
src/main/resources/static/image/TopMenu/sjff.png
src/main/resources/static/image/TopMenu/small/10haididianlanguandao_active_small.png
src/main/resources/static/image/TopMenu/small/10haididianlanguandao_small.png
src/main/resources/static/image/TopMenu/small/11ditudingweifenxi_active_small.png
src/main/resources/static/image/TopMenu/small/11ditudingweifenxi_small.png
src/main/resources/static/image/TopMenu/small/12haiyushiyonglunzheng_active_small.png
src/main/resources/static/image/TopMenu/small/12haiyushiyonglunzheng_small.png
src/main/resources/static/image/TopMenu/small/13shujujiaodui_active_small.png
src/main/resources/static/image/TopMenu/small/13shujujiaodui_small.png
src/main/resources/static/image/TopMenu/small/1zhzs_active_small.png
src/main/resources/static/image/TopMenu/small/1zhzs_small.png
src/main/resources/static/image/TopMenu/small/2shouye_active_small.png
src/main/resources/static/image/TopMenu/small/2shouye_small.png
src/main/resources/static/image/TopMenu/small/4quyuyonghaiguihua_active_small.png
src/main/resources/static/image/TopMenu/small/4quyuyonghaiguihua_small.png
src/main/resources/static/image/TopMenu/small/5weitianhaoguihua_active_small.png
src/main/resources/static/image/TopMenu/small/5weitianhaoguihua_small.png
src/main/resources/static/image/TopMenu/small/6haiyuquanshuguanli_active_small.png
src/main/resources/static/image/TopMenu/small/6haiyuquanshuguanli_small.png
src/main/resources/static/image/TopMenu/small/7haiyushiyongjinguanli_active_small.png
src/main/resources/static/image/TopMenu/small/7haiyushiyongjinguanli_small.png
src/main/resources/static/image/TopMenu/small/8haiyushiyongzhifa_active_small.png
src/main/resources/static/image/TopMenu/small/8haiyushiyongzhifa_small.png
src/main/resources/static/image/TopMenu/small/back_small.png
src/main/resources/static/image/TopMenu/small/btn_bg_small.gif
src/main/resources/static/image/TopMenu/small/feature_data_active_small.png
src/main/resources/static/image/TopMenu/small/feature_data_small.png
src/main/resources/static/image/TopMenu/small/hyqs_main_active_small.png
src/main/resources/static/image/TopMenu/small/hyqs_main_small.png
src/main/resources/static/image/TopMenu/small/hyqs_qsdj_active_small.png
src/main/resources/static/image/TopMenu/small/hyqs_qsdj_small.png
src/main/resources/static/image/TopMenu/small/hyqs_sjll_active_small.png
src/main/resources/static/image/TopMenu/small/hyqs_sjll_small.png
src/main/resources/static/image/TopMenu/small/hyqs_sqsp_active_small.png
src/main/resources/static/image/TopMenu/small/hyqs_sqsp_small.png
src/main/resources/static/image/TopMenu/small/hysyj_main_active_small.png
src/main/resources/static/image/TopMenu/small/hysyj_main_small.png
src/main/resources/static/image/TopMenu/small/hysytj_main_active_small.png
src/main/resources/static/image/TopMenu/small/hysytj_main_small.png
src/main/resources/static/image/TopMenu/small/logo_small.png
src/main/resources/static/image/TopMenu/small/oceanplan_active_small.png
src/main/resources/static/image/TopMenu/small/oceanplan_small.png
src/main/resources/static/image/TopMenu/small/shujuzhengli_active_small.png
src/main/resources/static/image/TopMenu/small/shujuzhengli_small.png
src/main/resources/static/image/TopMenu/small/tongyipeihao_active_small.png
src/main/resources/static/image/TopMenu/small/tongyipeihao_small.png
src/main/resources/static/image/TopMenu/small/watch_survey_active_small.png
src/main/resources/static/image/TopMenu/small/watch_survey_small.png
src/main/resources/static/image/TopMenu/small/zhzs_active_small.png
src/main/resources/static/image/TopMenu/small/zhzs_small.png
src/main/resources/static/image/TopMenu/tongyipeihao.png
src/main/resources/static/image/TopMenu/tongyipeihao_active.png
src/main/resources/static/image/TopMenu/top_bg_repeat.gif
src/main/resources/static/image/TopMenu/top_exit_icon.png
src/main/resources/static/image/TopMenu/top_time_icon.png
src/main/resources/static/image/TopMenu/top_user_icon.png
src/main/resources/static/image/TopMenu/watch_survey.png
src/main/resources/static/image/TopMenu/watch_survey_active.png
src/main/resources/static/image/TopMenu/xtdh.png
src/main/resources/static/image/TopMenu/yidongdanbing.png
src/main/resources/static/image/TopMenu/yonghaishenqing.png
src/main/resources/static/image/TopMenu/zhzs.png
src/main/resources/static/image/TopMenu/zhzs1.png
src/main/resources/static/image/TopMenu/zhzs_active.png
src/main/resources/static/image/TopMenu/ziyuanicon_01.png
src/main/resources/static/image/TopMenu/ziyuanicon_01_on.png
src/main/resources/static/image/TopMenu/ziyuanicon_02.png
src/main/resources/static/image/TopMenu/ziyuanicon_02_on.png
src/main/resources/static/image/TopMenu/ziyuanicon_03.png
src/main/resources/static/image/TopMenu/ziyuanicon_03_on.png
src/main/resources/static/image/TopMenu/ziyuansearch.bmp
src/main/resources/static/image/TopMenu/ziyuanzhongxin_logo.jpg
src/main/resources/static/image/TopMenu/zonghezhanshi.png
src/main/resources/static/image/TopMenu/zyml.png
src/main/resources/static/image/YeWuXiTong/南海电子沙盘.jpg
src/main/resources/static/image/YeWuXiTong/地图服务平台.jpg
src/main/resources/static/image/YeWuXiTong/数字海洋应用.jpg
src/main/resources/static/image/YeWuXiTong/海域动态监管.jpg
src/main/resources/static/image/YeWuXiTong/海岛监视监测.jpg
src/main/resources/static/image/YeWuXiTong/海洋政务信息.jpg
src/main/resources/static/image/YeWuXiTong/海洋数据共享.jpg
src/main/resources/static/image/YeWuXiTong/海洋空间规划.jpg
src/main/resources/static/image/YeWuXiTong/海洋经济监测.jpg
src/main/resources/static/image/YeWuXiTong/海洋预报减灾.jpg
src/main/resources/static/image/ZhuanTiZhiTu/navicon.png
src/main/resources/static/image/ZhuanTiZhiTu/navicon_new.png
src/main/resources/static/image/ZhuanTiZhiTu/search.png
src/main/resources/static/image/ZhuanTiZhiTu/search_new.png
src/main/resources/static/image/ZhuanTiZhiTu/star.png
src/main/resources/static/image/ZhuanTiZhiTu/star_new.png
src/main/resources/static/image/ZhuanTiZhiTu/user.png
src/main/resources/static/image/ZhuanTiZhiTu/user_new.png
src/main/resources/static/image/ZiYuan/btn1.png
src/main/resources/static/image/ZiYuan/btn2.png
src/main/resources/static/image/ZiYuan/diaoyon.gif
src/main/resources/static/image/ZiYuan/diaoyoncishu.png
src/main/resources/static/image/ZiYuan/ersanwei-erwei.gif
src/main/resources/static/image/ZiYuan/ersanwei-sanwei.gif
src/main/resources/static/image/ZiYuan/erweichakan.png
src/main/resources/static/image/ZiYuan/liulan_icon.gif
src/main/resources/static/image/ZiYuan/liulancishu.png
src/main/resources/static/image/ZiYuan/safety.png
src/main/resources/static/image/ZiYuan/safetyoff.png
src/main/resources/static/image/ZiYuan/sanweichakan.png
src/main/resources/static/image/ZiYuan/shenqingcishu.png
src/main/resources/static/image/ZiYuan/shoucang.png
src/main/resources/static/image/ZiYuan/shoucang_icon.gif
src/main/resources/static/image/ZiYuan/shujukubiao.gif
src/main/resources/static/image/ZiYuan/star.png
src/main/resources/static/image/ZiYuan/staroff.png
src/main/resources/static/image/ZiYuan/yisc.png
src/main/resources/static/image/ZiYuan/yish.png
src/main/resources/static/image/ZiYuan/ywtc.gif
src/main/resources/static/image/ZiYuan/ziyuanpingjia.gif
src/main/resources/static/image/ZiYuan/ziyuanshoucang.png
src/main/resources/static/image/ZiYuanZhongXin/1px.png
src/main/resources/static/image/ZiYuanZhongXin/New/jichuditu.png
src/main/resources/static/image/ZiYuanZhongXin/New/jiekoufuwu.png
src/main/resources/static/image/ZiYuanZhongXin/New/list.png
src/main/resources/static/image/ZiYuanZhongXin/New/num1.png
src/main/resources/static/image/ZiYuanZhongXin/New/num2.png
src/main/resources/static/image/ZiYuanZhongXin/New/num3.png
src/main/resources/static/image/ZiYuanZhongXin/New/search.png
src/main/resources/static/image/ZiYuanZhongXin/New/search2.png
src/main/resources/static/image/ZiYuanZhongXin/New/shoucangicon.png
src/main/resources/static/image/ZiYuanZhongXin/New/shujuwenjian.png
src/main/resources/static/image/ZiYuanZhongXin/New/weipifu.png
src/main/resources/static/image/ZiYuanZhongXin/New/weitongguo.png
src/main/resources/static/image/ZiYuanZhongXin/New/wodeshenqing_icon.png
src/main/resources/static/image/ZiYuanZhongXin/New/yewutuceng.png
src/main/resources/static/image/ZiYuanZhongXin/New/yitongguo.png
src/main/resources/static/image/ZiYuanZhongXin/New/zytj_icon.png
src/main/resources/static/image/ZiYuanZhongXin/dingxiangtuisong_icon.png
src/main/resources/static/image/ZiYuanZhongXin/f_post_pic1.gif
src/main/resources/static/image/ZiYuanZhongXin/fangwenpaihang_icon.png
src/main/resources/static/image/ZiYuanZhongXin/new.gif
src/main/resources/static/image/ZiYuanZhongXin/paihang_icon.png
src/main/resources/static/image/ZiYuanZhongXin/shenqing.png
src/main/resources/static/image/ZiYuanZhongXin/shenqing_icon.png
src/main/resources/static/image/ZiYuanZhongXin/shiyongqingkuang_icon.png
src/main/resources/static/image/ZiYuanZhongXin/shoucang_icon.png
src/main/resources/static/image/ZiYuanZhongXin/shoucangicon.png
src/main/resources/static/image/ZiYuanZhongXin/tongji_icon.png
src/main/resources/static/image/ZiYuanZhongXin/top1.png
src/main/resources/static/image/ZiYuanZhongXin/top2.png
src/main/resources/static/image/ZiYuanZhongXin/top3.png
src/main/resources/static/image/ZiYuanZhongXin/top4.png
src/main/resources/static/image/ZiYuanZhongXin/top5.png
src/main/resources/static/image/ZiYuanZhongXin/top6.png
src/main/resources/static/image/ZiYuanZhongXin/tuijian_icon.png
src/main/resources/static/image/ZiYuanZhongXin/tuijian_icon2.png
src/main/resources/static/image/ZiYuanZhongXin/tuijian_icon3.png
src/main/resources/static/image/ZiYuanZhongXin/weipifu.gif
src/main/resources/static/image/ZiYuanZhongXin/weitongguo.gif
src/main/resources/static/image/ZiYuanZhongXin/wodeshenqing.png
src/main/resources/static/image/ZiYuanZhongXin/wodeshenqing_icon.png
src/main/resources/static/image/ZiYuanZhongXin/wodeshoucang_icon.png
src/main/resources/static/image/ZiYuanZhongXin/wodezuji_icon.png
src/main/resources/static/image/ZiYuanZhongXin/yewujicheng_icon.png
src/main/resources/static/image/ZiYuanZhongXin/yitongguo.gif
src/main/resources/static/image/ZiYuanZhongXin/ywjc.gif
src/main/resources/static/image/ZiYuanZhongXin/ywtc.gif
src/main/resources/static/image/ZiYuanZhongXin/ziyuan.png
src/main/resources/static/image/ZiYuanZhongXin/ziyuantuijian_icon.png
src/main/resources/static/image/ZiYuanZhongXin/zuixin_icon.png
src/main/resources/static/image/arrow.png
src/main/resources/static/image/audio.jpg
src/main/resources/static/image/avatar.gif
src/main/resources/static/image/chart-icon.png
src/main/resources/static/image/chart.png
src/main/resources/static/image/classicons/JKFW.png
src/main/resources/static/image/classicons/KJ_JCDT.png
src/main/resources/static/image/classicons/KJ_KJFX.png
src/main/resources/static/image/classicons/KJ_SWMX.png
src/main/resources/static/image/classicons/KJ_YWTC.png
src/main/resources/static/image/classicons/KJ_ZTDT.png
src/main/resources/static/image/classicons/SJKB.png
src/main/resources/static/image/classicons/SJWJ.png
src/main/resources/static/image/classicons/YWJC.png
src/main/resources/static/image/classicons/defaulticon.png
src/main/resources/static/image/classicons/folder.png
src/main/resources/static/image/classicons/folderOpen.png
src/main/resources/static/image/classimg/JKFW.gif
src/main/resources/static/image/classimg/KJ_JCDT.gif
src/main/resources/static/image/classimg/KJ_KJFX.gif
src/main/resources/static/image/classimg/KJ_SWDX.gif
src/main/resources/static/image/classimg/KJ_SWMX.gif
src/main/resources/static/image/classimg/KJ_SWYX.gif
src/main/resources/static/image/classimg/KJ_SWYX.gif.BAK
src/main/resources/static/image/classimg/KJ_YWTC.gif
src/main/resources/static/image/classimg/KJ_ZTDT.gif
src/main/resources/static/image/classimg/SJKB.gif
src/main/resources/static/image/classimg/SJWJ.gif
src/main/resources/static/image/classimg/YWJC.gif
src/main/resources/static/image/classimg/bak/JKFW.gif
src/main/resources/static/image/classimg/bak/KJ_JCDT.gif
src/main/resources/static/image/classimg/bak/KJ_YWTC.gif
src/main/resources/static/image/classimg/bak/SJWJ.gif
src/main/resources/static/image/down.gif
src/main/resources/static/image/echarts/line-simple.png
src/main/resources/static/image/echarts/more.bmp
src/main/resources/static/image/edit.gif
src/main/resources/static/image/file.jpg
src/main/resources/static/image/gongzuotai/01.png
src/main/resources/static/image/gongzuotai/02.png
src/main/resources/static/image/gongzuotai/03.png
src/main/resources/static/image/gongzuotai/04.png
src/main/resources/static/image/gongzuotai/05.png
src/main/resources/static/image/gongzuotai/06.png
src/main/resources/static/image/gongzuotai/07.png
src/main/resources/static/image/gongzuotai/08.png
src/main/resources/static/image/gongzuotai/09.png
src/main/resources/static/image/gongzuotai/FaBuShenHe.png
src/main/resources/static/image/gongzuotai/ShenQingPiFu.png
src/main/resources/static/image/gongzuotai/WoDeDingYue.png
src/main/resources/static/image/gongzuotai/WoDeFaBu.png
src/main/resources/static/image/gongzuotai/WoDeShenQing.png
src/main/resources/static/image/gongzuotai/WoDeShouCang.png
src/main/resources/static/image/gongzuotai/wodedingyue_old.png
src/main/resources/static/image/gongzuotai/wodeshenqin_old.png
src/main/resources/static/image/gray_down.gif
src/main/resources/static/image/left_bg.jpg
src/main/resources/static/image/liferay_userinfo/admin.png
src/main/resources/static/image/liferay_userinfo/exit.png
src/main/resources/static/image/liferay_userinfo/modifypassword.png
src/main/resources/static/image/liferay_userinfo/modifyuserinfo.png
src/main/resources/static/image/liferay_userinfo/user.png
src/main/resources/static/image/linetext1.png
src/main/resources/static/image/list.png
src/main/resources/static/image/loading.gif
src/main/resources/static/image/logo_bg.jpg
src/main/resources/static/image/logo_tit.png
src/main/resources/static/image/map.png
src/main/resources/static/image/primarykey.png
src/main/resources/static/image/recource_steps_top_bg.jpg
src/main/resources/static/image/right.gif
src/main/resources/static/image/sxsj.gif
src/main/resources/static/image/text.png
src/main/resources/static/image/toc_icons2.png
src/main/resources/static/image/translation.png
src/main/resources/static/image/txt.png
src/main/resources/static/image/up.gif
src/main/resources/static/image/video.jpg
src/main/resources/static/image/wpf.png
src/main/resources/static/image/wrong.gif
src/main/resources/static/image/wtg.png
src/main/resources/static/image/yellow_down.gif
src/main/resources/static/image/ytg.png
src/main/resources/static/image/ziyuanfabu/ziyuanfabu_liulang.png
src/main/resources/static/image/ziyuanfabu/ziyuanfabu_shenqing.png
src/main/resources/static/image/ztree/-second_menu.png
src/main/resources/static/image/ztree/first_muen.png
src/main/resources/static/image/ztree/firstopen_muen.png
src/main/resources/static/image/ztree/tree_hide.png
src/main/resources/static/image/ztree/tree_open.png
src/main/resources/static/js/Extjs/PingTaiMenHu/SystemInfoList.js
src/main/resources/static/js/Extjs/ResTheme/MainInfoSelect.js
src/main/resources/static/js/Extjs/ResTheme/ModuleList.js
src/main/resources/static/js/Extjs/ResTheme/ResThemeModule.js
src/main/resources/static/js/Extjs/ResTheme/restheme.js
src/main/resources/static/js/Extjs/ResTheme/selectPanel.js
src/main/resources/static/js/Extjs/ZYML/BaseMapSelect.js
src/main/resources/static/js/Extjs/ZYML/BiaoZhuTu.js
src/main/resources/static/js/Extjs/ZYML/BusinessLayerSelect.js
src/main/resources/static/js/Extjs/ZYML/BusinessRefList.js
src/main/resources/static/js/Extjs/ZYML/DataSource.js
src/main/resources/static/js/Extjs/ZYML/JcdtList.js
src/main/resources/static/js/Extjs/ZYML/ProblemFeedback.js
src/main/resources/static/js/Extjs/ZYML/ShuJuYuan.js
src/main/resources/static/js/Extjs/ZYML/ZYMLZiYuan.js
src/main/resources/static/js/Extjs/ZYML/ZiYuanSelect.js
src/main/resources/static/js/Extjs/ZYML/resourceList.js
src/main/resources/static/js/Extjs/ZYZX/FangWenPaiHangGD.js
src/main/resources/static/js/Extjs/ZYZX/SelectZhouBianTCSetBasic.js
src/main/resources/static/js/Extjs/ZYZX/ShenQingZiYuanGD.js
src/main/resources/static/js/Extjs/ZYZX/WoDeShouCangJiaGD.js
src/main/resources/static/js/Extjs/ZYZX/ZiYuanKZ.js
src/main/resources/static/js/Extjs/ZYZX/ZiYuanTongJiGD.js
src/main/resources/static/js/Extjs/ZYZX/ZuiXinZiYuanGD.js
src/main/resources/static/js/Extjs/ZiTuCengSheZHi.js
src/main/resources/static/js/Extjs/restemplate/restemplate.js
src/main/resources/static/js/FuWuZhiYuan/Index.js
src/main/resources/static/js/GrayPhoto.js
src/main/resources/static/js/MenHuMore.js
src/main/resources/static/js/OperateLogUtil.js
src/main/resources/static/js/PingTaiMenHuFile/GongNengQuHua/app.js
src/main/resources/static/js/PingTaiMenHuFile/GongNengQuHua/bootstrap-responsive.min.css
src/main/resources/static/js/PingTaiMenHuFile/GongNengQuHua/bootstrap.min.css
src/main/resources/static/js/PingTaiMenHuFile/GongNengQuHua/jquery-1.8.3.min.js
src/main/resources/static/js/PingTaiMenHuFile/GongNengQuHua/jquery.easy-pie-chart.css
src/main/resources/static/js/PingTaiMenHuFile/GongNengQuHua/jquery.easy-pie-chart.js
src/main/resources/static/js/PingTaiMenHuFile/GongNengQuHua/style.css
src/main/resources/static/js/PingTaiMenHuFile/HaiYangJingJi/data-set.min.js
src/main/resources/static/js/PingTaiMenHuFile/HaiYangJingJi/g2.min.js
src/main/resources/static/js/PingTaiMenHuFile/HaiYuShiYong/admin.main.css
src/main/resources/static/js/PingTaiMenHuFile/HaiYuShiYong/app.js
src/main/resources/static/js/PingTaiMenHuFile/HaiYuShiYong/bootstrap-responsive.min.css
src/main/resources/static/js/PingTaiMenHuFile/HaiYuShiYong/bootstrap.min.css
src/main/resources/static/js/PingTaiMenHuFile/HaiYuShiYong/bootstrap.min.js
src/main/resources/static/js/PingTaiMenHuFile/HaiYuShiYong/echarts.min.js
src/main/resources/static/js/PingTaiMenHuFile/HaiYuShiYong/font-awesome.min.css
src/main/resources/static/js/PingTaiMenHuFile/HaiYuShiYong/form-components.js
src/main/resources/static/js/PingTaiMenHuFile/HaiYuShiYong/jquery-1.8.3.min.js
src/main/resources/static/js/PingTaiMenHuFile/HaiYuShiYong/jquery-ui-1.10.1.custom.min.js
src/main/resources/static/js/PingTaiMenHuFile/HaiYuShiYong/jquery.divresize.js
src/main/resources/static/js/PingTaiMenHuFile/HaiYuShiYong/style-metro.css
src/main/resources/static/js/PingTaiMenHuFile/HaiYuShiYong/style-responsive.css
src/main/resources/static/js/PingTaiMenHuFile/HaiYuShiYong/style.css
src/main/resources/static/js/PingTaiMenHuFile/HaiYuShiYong/uniform.default.css
src/main/resources/static/js/ResManage/NewResRegister/EditInit.js
src/main/resources/static/js/ResManage/NewResRegister/EsbManage.js
src/main/resources/static/js/ZiYuanZhongXin/BaseLeftSource.js
src/main/resources/static/js/ZiYuanZhongXin/FJGL_Ext.js
src/main/resources/static/js/ZiYuanZhongXin/Index.js
src/main/resources/static/js/ZiYuanZhongXin/Indexnew.js
src/main/resources/static/js/ZiYuanZhongXin/ShenQingZiYuanGD.js
src/main/resources/static/js/ZiYuanZhongXin/ziyuantuijian.js
src/main/resources/static/js/base.js
src/main/resources/static/js/bootstrap-colorpicker.js
src/main/resources/static/js/common.js
src/main/resources/static/js/common/resource_select.js
src/main/resources/static/js/common/resource_set_ChartTemplat.js
src/main/resources/static/js/common/resource_set_TuXin.js
src/main/resources/static/js/common/resource_set_gltc.js
src/main/resources/static/js/common/resource_set_zbcx.js
src/main/resources/static/js/copyJs/clipboard.js
src/main/resources/static/js/copyJs/clipboard.min.js
src/main/resources/static/js/ditufuwu/ShenQingZiYuanGD.js
src/main/resources/static/js/ditufuwu/fangwenpaihanggd.js
src/main/resources/static/js/ditufuwu/index.js
src/main/resources/static/js/ditufuwu/indexnew.js
src/main/resources/static/js/ditufuwu/wodeshoucanggd.js
src/main/resources/static/js/ditufuwu/ziyuantuijian.js
src/main/resources/static/js/ditufuwu/zuixinziyuangd.js
src/main/resources/static/js/echarts.min.4.1.js
src/main/resources/static/js/esbmanage.js
src/main/resources/static/js/esbmanagebak20200810.js
src/main/resources/static/js/findPinyinByKeyWord.js
src/main/resources/static/js/form-wizard_test.js
src/main/resources/static/js/htmlformat.js
src/main/resources/static/js/index.js
src/main/resources/static/js/jqUI/jquery-ui.min.css
src/main/resources/static/js/jqUI/jquery-ui.min.js
src/main/resources/static/js/jquery-override.js
src/main/resources/static/js/jquery.bootstrap.wizard.min.js
src/main/resources/static/js/jsformat.js
src/main/resources/static/js/manage/actionrecord.js
src/main/resources/static/js/manage/appcount.js
src/main/resources/static/js/manage/applyrecommend.js
src/main/resources/static/js/manage/applyrecommendbysystem.js
src/main/resources/static/js/manage/appreource.js
src/main/resources/static/js/manage/apptotalcount.js
src/main/resources/static/js/manage/audit.js
src/main/resources/static/js/manage/catalog.js
src/main/resources/static/js/manage/databasetable.js
src/main/resources/static/js/manage/datasource/index.js
src/main/resources/static/js/manage/datasource/panel_select.js
src/main/resources/static/js/manage/evaluation.js
src/main/resources/static/js/manage/onemapcatalog.js
src/main/resources/static/js/manage/problemfeedback.js
src/main/resources/static/js/manage/subscriptions.js
src/main/resources/static/js/manage/subscriptionsaudit.js
src/main/resources/static/js/manage/subscriptionslist.js
src/main/resources/static/js/manage/symbollibrary.js
src/main/resources/static/js/modules/sys/generator.js
src/main/resources/static/js/modules/sys/menu.js
src/main/resources/static/js/modules/sys/user.js
src/main/resources/static/js/openresource.js
src/main/resources/static/js/previewCtrl.js
src/main/resources/static/js/selectChosen/chosen.jquery.js
src/main/resources/static/js/selectChosen/chosen.jquery.min.js
src/main/resources/static/js/selectChosen/component-chosen.min.css
src/main/resources/static/js/theme/dark.js
src/main/resources/static/js/theme/infographic.js
src/main/resources/static/js/theme/lt_blue.js
src/main/resources/static/js/theme/lt_mapChart.js
src/main/resources/static/js/theme/macarons.js
src/main/resources/static/js/theme/roma.js
src/main/resources/static/js/theme/shine.js
src/main/resources/static/js/theme/vintage.js
src/main/resources/static/js/validator.js
src/main/resources/static/js/ziyuanmulu/index.js
src/main/resources/static/libs/ajaxupload.js
src/main/resources/static/libs/app.js
src/main/resources/static/libs/bootstrap-table.min.js
src/main/resources/static/libs/bootstrap.min.js
src/main/resources/static/libs/html5shiv.min.js
src/main/resources/static/libs/jquery.min.js
src/main/resources/static/libs/respond.min.js
src/main/resources/static/libs/router.js
src/main/resources/static/libs/vue.min.js
src/main/resources/static/plugins/jqgrid/grid.locale-cn.js
src/main/resources/static/plugins/jqgrid/jquery.jqGrid.min.js
src/main/resources/static/plugins/jqgrid/ui.jqgrid-bootstrap-ui.css
src/main/resources/static/plugins/jqgrid/ui.jqgrid-bootstrap.css
src/main/resources/static/plugins/jqgrid/ui.jqgrid.css
src/main/resources/static/plugins/layer/layer.js
src/main/resources/static/plugins/layer/mobile/layer.js
src/main/resources/static/plugins/layer/mobile/need/layer.css
src/main/resources/static/plugins/layer/skin/default/icon-ext.png
src/main/resources/static/plugins/layer/skin/default/icon.png
src/main/resources/static/plugins/layer/skin/default/layer.css
src/main/resources/static/plugins/layer/skin/default/loading-0.gif
src/main/resources/static/plugins/layer/skin/default/loading-1.gif
src/main/resources/static/plugins/layer/skin/default/loading-2.gif
src/main/resources/static/plugins/layer/skin/moon/default.png
src/main/resources/static/plugins/layer/skin/moon/style.css
src/main/resources/static/plugins/tag/bower.json
src/main/resources/static/plugins/tag/demo.html
src/main/resources/static/plugins/tag/jquery.caret.min.js
src/main/resources/static/plugins/tag/jquery.tag-editor.css
src/main/resources/static/plugins/tag/jquery.tag-editor.js
src/main/resources/static/plugins/tag/jquery.tag-editor.min.js
src/main/resources/static/plugins/tag/readme.md
src/main/resources/static/plugins/tag/tag-editor.jquery.json
src/main/resources/static/plugins/tinymce/jquery.tinymce.min.js
src/main/resources/static/plugins/tinymce/langs/readme.md
src/main/resources/static/plugins/tinymce/langs/zh_CN.js
src/main/resources/static/plugins/tinymce/license.txt
src/main/resources/static/plugins/tinymce/plugins/advlist/plugin.min.js
src/main/resources/static/plugins/tinymce/plugins/anchor/plugin.min.js
src/main/resources/static/plugins/tinymce/plugins/autolink/plugin.min.js
src/main/resources/static/plugins/tinymce/plugins/autoresize/plugin.min.js
src/main/resources/static/plugins/tinymce/plugins/autosave/plugin.min.js
src/main/resources/static/plugins/tinymce/plugins/bbcode/plugin.min.js
src/main/resources/static/plugins/tinymce/plugins/charmap/plugin.min.js
src/main/resources/static/plugins/tinymce/plugins/code/plugin.min.js
src/main/resources/static/plugins/tinymce/plugins/codesample/css/prism.css
src/main/resources/static/plugins/tinymce/plugins/codesample/plugin.min.js
src/main/resources/static/plugins/tinymce/plugins/colorpicker/plugin.min.js
src/main/resources/static/plugins/tinymce/plugins/contextmenu/plugin.min.js
src/main/resources/static/plugins/tinymce/plugins/directionality/plugin.min.js
src/main/resources/static/plugins/tinymce/plugins/emoticons/img/smiley-cool.gif
src/main/resources/static/plugins/tinymce/plugins/emoticons/img/smiley-cry.gif
src/main/resources/static/plugins/tinymce/plugins/emoticons/img/smiley-embarassed.gif
src/main/resources/static/plugins/tinymce/plugins/emoticons/img/smiley-foot-in-mouth.gif
src/main/resources/static/plugins/tinymce/plugins/emoticons/img/smiley-frown.gif
src/main/resources/static/plugins/tinymce/plugins/emoticons/img/smiley-innocent.gif
src/main/resources/static/plugins/tinymce/plugins/emoticons/img/smiley-kiss.gif
src/main/resources/static/plugins/tinymce/plugins/emoticons/img/smiley-laughing.gif
src/main/resources/static/plugins/tinymce/plugins/emoticons/img/smiley-money-mouth.gif
src/main/resources/static/plugins/tinymce/plugins/emoticons/img/smiley-sealed.gif
src/main/resources/static/plugins/tinymce/plugins/emoticons/img/smiley-smile.gif
src/main/resources/static/plugins/tinymce/plugins/emoticons/img/smiley-surprised.gif
src/main/resources/static/plugins/tinymce/plugins/emoticons/img/smiley-tongue-out.gif
src/main/resources/static/plugins/tinymce/plugins/emoticons/img/smiley-undecided.gif
src/main/resources/static/plugins/tinymce/plugins/emoticons/img/smiley-wink.gif
src/main/resources/static/plugins/tinymce/plugins/emoticons/img/smiley-yell.gif
src/main/resources/static/plugins/tinymce/plugins/emoticons/plugin.min.js
src/main/resources/static/plugins/tinymce/plugins/fullpage/plugin.min.js
src/main/resources/static/plugins/tinymce/plugins/fullscreen/plugin.min.js
src/main/resources/static/plugins/tinymce/plugins/help/img/logo.png
src/main/resources/static/plugins/tinymce/plugins/help/plugin.min.js
src/main/resources/static/plugins/tinymce/plugins/hr/plugin.min.js
src/main/resources/static/plugins/tinymce/plugins/image/plugin.min.js
src/main/resources/static/plugins/tinymce/plugins/imagetools/plugin.min.js
src/main/resources/static/plugins/tinymce/plugins/importcss/plugin.min.js
src/main/resources/static/plugins/tinymce/plugins/insertdatetime/plugin.min.js
src/main/resources/static/plugins/tinymce/plugins/legacyoutput/plugin.min.js
src/main/resources/static/plugins/tinymce/plugins/link/plugin.min.js
src/main/resources/static/plugins/tinymce/plugins/lists/plugin.min.js
src/main/resources/static/plugins/tinymce/plugins/media/plugin.min.js
src/main/resources/static/plugins/tinymce/plugins/nonbreaking/plugin.min.js
src/main/resources/static/plugins/tinymce/plugins/noneditable/plugin.min.js
src/main/resources/static/plugins/tinymce/plugins/pagebreak/plugin.min.js
src/main/resources/static/plugins/tinymce/plugins/paste/plugin.min.js
src/main/resources/static/plugins/tinymce/plugins/preview/plugin.min.js
src/main/resources/static/plugins/tinymce/plugins/print/plugin.min.js
src/main/resources/static/plugins/tinymce/plugins/save/plugin.min.js
src/main/resources/static/plugins/tinymce/plugins/searchreplace/plugin.min.js
src/main/resources/static/plugins/tinymce/plugins/spellchecker/plugin.min.js
src/main/resources/static/plugins/tinymce/plugins/tabfocus/plugin.min.js
src/main/resources/static/plugins/tinymce/plugins/table/plugin.min.js
src/main/resources/static/plugins/tinymce/plugins/template/plugin.min.js
src/main/resources/static/plugins/tinymce/plugins/textcolor/plugin.min.js
src/main/resources/static/plugins/tinymce/plugins/textpattern/plugin.min.js
src/main/resources/static/plugins/tinymce/plugins/toc/plugin.min.js
src/main/resources/static/plugins/tinymce/plugins/visualblocks/css/visualblocks.css
src/main/resources/static/plugins/tinymce/plugins/visualblocks/plugin.min.js
src/main/resources/static/plugins/tinymce/plugins/visualchars/plugin.min.js
src/main/resources/static/plugins/tinymce/plugins/wordcount/plugin.min.js
src/main/resources/static/plugins/tinymce/skins/lightgray/content.inline.min.css
src/main/resources/static/plugins/tinymce/skins/lightgray/content.min.css
src/main/resources/static/plugins/tinymce/skins/lightgray/fonts/tinymce-small.eot
src/main/resources/static/plugins/tinymce/skins/lightgray/fonts/tinymce-small.svg
src/main/resources/static/plugins/tinymce/skins/lightgray/fonts/tinymce-small.ttf
src/main/resources/static/plugins/tinymce/skins/lightgray/fonts/tinymce-small.woff
src/main/resources/static/plugins/tinymce/skins/lightgray/fonts/tinymce.eot
src/main/resources/static/plugins/tinymce/skins/lightgray/fonts/tinymce.svg
src/main/resources/static/plugins/tinymce/skins/lightgray/fonts/tinymce.ttf
src/main/resources/static/plugins/tinymce/skins/lightgray/fonts/tinymce.woff
src/main/resources/static/plugins/tinymce/skins/lightgray/img/anchor.gif
src/main/resources/static/plugins/tinymce/skins/lightgray/img/loader.gif
src/main/resources/static/plugins/tinymce/skins/lightgray/img/object.gif
src/main/resources/static/plugins/tinymce/skins/lightgray/img/trans.gif
src/main/resources/static/plugins/tinymce/skins/lightgray/skin.min.css
src/main/resources/static/plugins/tinymce/themes/inlite/theme.min.js
src/main/resources/static/plugins/tinymce/themes/modern/theme.min.js
src/main/resources/static/plugins/tinymce/tinymce.min.js
src/main/resources/static/plugins/treegrid/img/collapse.png
src/main/resources/static/plugins/treegrid/img/expand.png
src/main/resources/static/plugins/treegrid/img/file.png
src/main/resources/static/plugins/treegrid/img/folder.png
src/main/resources/static/plugins/treegrid/jquery.treegrid.bootstrap3.js
src/main/resources/static/plugins/treegrid/jquery.treegrid.css
src/main/resources/static/plugins/treegrid/jquery.treegrid.extension.js
src/main/resources/static/plugins/treegrid/jquery.treegrid.min.js
src/main/resources/static/plugins/treegrid/tree.table.js
src/main/resources/static/plugins/ztree/css/awesomeStyle/awesome.css
src/main/resources/static/plugins/ztree/css/awesomeStyle/awesome.less
src/main/resources/static/plugins/ztree/css/awesomeStyle/fa.less
src/main/resources/static/plugins/ztree/css/awesomeStyle/img/loading.gif
src/main/resources/static/plugins/ztree/css/metroStyle/img/line_conn.png
src/main/resources/static/plugins/ztree/css/metroStyle/img/loading.gif
src/main/resources/static/plugins/ztree/css/metroStyle/img/metro.gif
src/main/resources/static/plugins/ztree/css/metroStyle/img/metro.png
src/main/resources/static/plugins/ztree/css/metroStyle/metroStyle.css
src/main/resources/static/plugins/ztree/css/zTreeStyle/img/diy/1_close.png
src/main/resources/static/plugins/ztree/css/zTreeStyle/img/diy/1_open.png
src/main/resources/static/plugins/ztree/css/zTreeStyle/img/diy/2.png
src/main/resources/static/plugins/ztree/css/zTreeStyle/img/diy/3.png
src/main/resources/static/plugins/ztree/css/zTreeStyle/img/diy/4.png
src/main/resources/static/plugins/ztree/css/zTreeStyle/img/diy/5.png
src/main/resources/static/plugins/ztree/css/zTreeStyle/img/diy/6.png
src/main/resources/static/plugins/ztree/css/zTreeStyle/img/diy/7.png
src/main/resources/static/plugins/ztree/css/zTreeStyle/img/diy/8.png
src/main/resources/static/plugins/ztree/css/zTreeStyle/img/diy/9.png
src/main/resources/static/plugins/ztree/css/zTreeStyle/img/line_conn.gif
src/main/resources/static/plugins/ztree/css/zTreeStyle/img/loading.gif
src/main/resources/static/plugins/ztree/css/zTreeStyle/img/zTreeStandard.gif
src/main/resources/static/plugins/ztree/css/zTreeStyle/img/zTreeStandard.png
src/main/resources/static/plugins/ztree/css/zTreeStyle/zTreeStyle.css
src/main/resources/static/plugins/ztree/jquery.ztree.all.min.js
src/main/resources/templates/FuWuZiYuan/Index.html
src/main/resources/templates/FuWuZiYuan/JcdtDataList.html
src/main/resources/templates/FuWuZiYuan/JcdtList.html
src/main/resources/templates/FuWuZiYuan/Left.html
src/main/resources/templates/FuWuZiYuan/ZiYuanDataList.html
src/main/resources/templates/FuWuZiYuan/ZiYuanList.html
src/main/resources/templates/FuWuZiYuan/ZiYuanSelect.html
src/main/resources/templates/FuWuZiYuan/ZiYuanSelect_Edit.html
src/main/resources/templates/IsLandType/BaoHuIndex.html
src/main/resources/templates/IsLandType/JianCeIndex.html
src/main/resources/templates/IsLandType/JuMinIndex.html
src/main/resources/templates/IsLandType/QuanYiIndex.html
src/main/resources/templates/IsLandType/XinXiIndex.html
src/main/resources/templates/IsLandTypeTemp/BaoHuIndex.html
src/main/resources/templates/IsLandTypeTemp/JianCeIndex.html
src/main/resources/templates/IsLandTypeTemp/QuanYiIndex.html
src/main/resources/templates/IsLandTypeTemp/XinXiIndex.html
src/main/resources/templates/KeShiHuaFuWu/Index.html
src/main/resources/templates/MasterDemo.html
src/main/resources/templates/MasterPage/CommonPage/Header.html
src/main/resources/templates/MasterPage/CommonPage/Layout.html
src/main/resources/templates/MasterPage/Header.html
src/main/resources/templates/MasterPage/Layout.Empty.html
src/main/resources/templates/MasterPage/Layout.html
src/main/resources/templates/MasterPage/New/Header.html
src/main/resources/templates/MasterPage/New/Layout.html
src/main/resources/templates/MasterPage/New/footer.html
src/main/resources/templates/MasterPage/footer.html
src/main/resources/templates/PingTaiMenHu/ChaoXiGuanCe_New.html
src/main/resources/templates/PingTaiMenHu/ChaoXiGuanCe_NewThree.html
src/main/resources/templates/PingTaiMenHu/ChaoXiGuanCe_NewThree_bak.html
src/main/resources/templates/PingTaiMenHu/ChaoXiGuanCe_NewTwo.html
src/main/resources/templates/PingTaiMenHu/GongNengQuHua_New.html
src/main/resources/templates/PingTaiMenHu/GongNengQuHua_NewTwo.html
src/main/resources/templates/PingTaiMenHu/GongZuoTai.html
src/main/resources/templates/PingTaiMenHu/GongZuoTai_New.html
src/main/resources/templates/PingTaiMenHu/HaiDaoShuLiang_New.html
src/main/resources/templates/PingTaiMenHu/HaiDaoTongJi.html
src/main/resources/templates/PingTaiMenHu/HaiYangJingJi_New.html
src/main/resources/templates/PingTaiMenHu/HaiYangJingJi_NewTwo.html
src/main/resources/templates/PingTaiMenHu/HaiYuShiYong_New.html
src/main/resources/templates/PingTaiMenHu/HuanJingJianCeFuBiao.html
src/main/resources/templates/PingTaiMenHu/JianCeZhanDian.html
src/main/resources/templates/PingTaiMenHu/JianCeZhanDian_New.html
src/main/resources/templates/PingTaiMenHu/LianJie.html
src/main/resources/templates/PingTaiMenHu/LianJie_New.html
src/main/resources/templates/PingTaiMenHu/NewPingTaiMenHu/ChaoXiGuanCe.html
src/main/resources/templates/PingTaiMenHu/NewPingTaiMenHu/ChaoXiGuanCe_bak.html
src/main/resources/templates/PingTaiMenHu/NewPingTaiMenHu/GongZuoTai.html
src/main/resources/templates/PingTaiMenHu/NewPingTaiMenHu/PubNews.html
src/main/resources/templates/PingTaiMenHu/NewPingTaiMenHu/ShiPinJianKong.html
src/main/resources/templates/PingTaiMenHu/NewPingTaiMenHu/SystemList.html
src/main/resources/templates/PingTaiMenHu/NewPubNews/ZiXunDataList.html
src/main/resources/templates/PingTaiMenHu/NewPubNews/ZiXunIndex.html
src/main/resources/templates/PingTaiMenHu/ShiPinJianKong.html
src/main/resources/templates/PingTaiMenHu/ShiPinJianKong_New.html
src/main/resources/templates/PingTaiMenHu/ShowShiPin.html
src/main/resources/templates/PingTaiMenHu/SystemInfoList.html
src/main/resources/templates/PingTaiMenHu/YonHaiXiangMu.html
src/main/resources/templates/PingTaiMenHu/ZiXunDataList.html
src/main/resources/templates/PingTaiMenHu/ZiXunDongTai.html
src/main/resources/templates/PingTaiMenHu/ZiXunDongTai_New.html
src/main/resources/templates/PingTaiMenHu/ZiXunIndex.html
src/main/resources/templates/PingTaiMenHu/ZiXunInfo.html
src/main/resources/templates/ResActionRecord/ShenQingZiYuanGD.html
src/main/resources/templates/ResActionRecord/ZuiXinZiYuanGD.html
src/main/resources/templates/ResManage/NewResRegister/Edit.html
src/main/resources/templates/ResManage/NewResRegister/Ext3D.html
src/main/resources/templates/ResManage/NewResRegister/ExtBaseMap.html
src/main/resources/templates/ResManage/NewResRegister/ExtBusinessLayer.html
src/main/resources/templates/ResManage/NewResRegister/ExtDataBase.html
src/main/resources/templates/ResManage/NewResRegister/ExtFileSource.html
src/main/resources/templates/ResManage/NewResRegister/ExtIntegrate.html
src/main/resources/templates/ResManage/NewResRegister/ExtInterFaceService.html
src/main/resources/templates/ResManage/NewResRegister/ExtMapUrl.html
src/main/resources/templates/ResManage/NewResRegister/ExtPresentationMode.html
src/main/resources/templates/ResManage/NewResRegister/ExtSpaceServer.html
src/main/resources/templates/ResManage/NewResRegister/ExtSpaceServerParams.html
src/main/resources/templates/ResManage/NewResRegister/ExtThemeMap.html
src/main/resources/templates/ResManage/NewResRegister/MainInfo.html
src/main/resources/templates/ResManage/NewResRegister/ResFiles.html
src/main/resources/templates/ResManage/NewResRegister/ResResourceClass.html
src/main/resources/templates/ResManage/NewResRegister/SpaceParameters.html
src/main/resources/templates/ResManage/NewResRegister/SpaceParameters_Edit.html
src/main/resources/templates/ResManage/NewResRegister/obtainExtentMapViewer.html
src/main/resources/templates/ResManage/ResApplyRecommend/AddDataSource.html
src/main/resources/templates/ResManage/ResApplyRecommend/ApplyRecommendInfo.html
src/main/resources/templates/ResManage/ResApplyRecommend/GuanLianBiaoZhuTu.html
src/main/resources/templates/ResManage/ResApplyRecommend/MainInfoByYWTC.html
src/main/resources/templates/ResManage/ResApplyRecommend/ZiYuanDingYue.html
src/main/resources/templates/ResManage/ResApplyRecommend/ZiYuanShenQing.html
src/main/resources/templates/ResManage/ResRegister/AreaTree.html
src/main/resources/templates/ResManage/ResRegister/AtkasList.html
src/main/resources/templates/ResManage/ResRegister/BaseInfoEextInterFace.html
src/main/resources/templates/ResManage/ResRegister/BaseInfoExt3D.html
src/main/resources/templates/ResManage/ResRegister/BaseInfoExtBaseMap.html
src/main/resources/templates/ResManage/ResRegister/BaseInfoExtBusinessLayer.html
src/main/resources/templates/ResManage/ResRegister/BaseInfoExtDataBase.html
src/main/resources/templates/ResManage/ResRegister/BaseInfoExtFileSource.html
src/main/resources/templates/ResManage/ResRegister/BaseInfoExtIntegrate.html
src/main/resources/templates/ResManage/ResRegister/BaseInfoExtSpaceServer.html
src/main/resources/templates/ResManage/ResRegister/BaseInfoExtThemeMap.html
src/main/resources/templates/ResManage/ResRegister/BaseMapSelect.html
src/main/resources/templates/ResManage/ResRegister/BusinessLayerSelect.html
src/main/resources/templates/ResManage/ResRegister/BusinessRef.html
src/main/resources/templates/ResManage/ResRegister/DataSource.html
src/main/resources/templates/ResManage/ResRegister/DataSourceBase.html
src/main/resources/templates/ResManage/ResRegister/DataSourceBase_Edit.html
src/main/resources/templates/ResManage/ResRegister/DisplayType.html
src/main/resources/templates/ResManage/ResRegister/Edit.html
src/main/resources/templates/ResManage/ResRegister/Ext3D.html
src/main/resources/templates/ResManage/ResRegister/ExtApp.html
src/main/resources/templates/ResManage/ResRegister/ExtBaseMap.html
src/main/resources/templates/ResManage/ResRegister/ExtBusinessLayer.html
src/main/resources/templates/ResManage/ResRegister/ExtDataBase.html
src/main/resources/templates/ResManage/ResRegister/ExtFileSource.html
src/main/resources/templates/ResManage/ResRegister/ExtIntegrate.html
src/main/resources/templates/ResManage/ResRegister/ExtInterFaceService.html
src/main/resources/templates/ResManage/ResRegister/ExtPresentationMode.html
src/main/resources/templates/ResManage/ResRegister/ExtSpaceServer.html
src/main/resources/templates/ResManage/ResRegister/ExtThemeMap.html
src/main/resources/templates/ResManage/ResRegister/GuanLianBiaoZhuTu.html
src/main/resources/templates/ResManage/ResRegister/List.html
src/main/resources/templates/ResManage/ResRegister/MainInfo.html
src/main/resources/templates/ResManage/ResRegister/MainInfoByYWTC.html
src/main/resources/templates/ResManage/ResRegister/MuLuShu.html
src/main/resources/templates/ResManage/ResRegister/NcFileConfig.html
src/main/resources/templates/ResManage/ResRegister/ProblemFeedback.html
src/main/resources/templates/ResManage/ResRegister/ResFiles.html
src/main/resources/templates/ResManage/ResRegister/SelectZhouBianTCSetBasic.html
src/main/resources/templates/ResManage/ResRegister/ShuJuYuan.html
src/main/resources/templates/ResManage/ResRegister/ShuJuYuanInsert.html
src/main/resources/templates/ResManage/ResRegister/SpaceParameters.html
src/main/resources/templates/ResManage/ResRegister/SpaceParameters_Edit.html
src/main/resources/templates/ResManage/ResRegister/StorageConfig.html
src/main/resources/templates/ResManage/ResRegister/WSDL.html
src/main/resources/templates/ResManage/ResRegister/ZiTuCengSheZhi.html
src/main/resources/templates/ResManage/ResRegister/ZiYuanBaseInfo.html
src/main/resources/templates/ResManage/ResRegister/ZiYuanBaseInfo_bak20190109.html
src/main/resources/templates/ResManage/ResRegister/ZiYuanErrorPage.html
src/main/resources/templates/ResManage/ResRegister/ZiYuanKZ.html
src/main/resources/templates/ResManage/ResRegister/ZiYuanRecommend.html
src/main/resources/templates/ResManage/ResRegister/bak20190109/BaseInfoEextInterFace.html
src/main/resources/templates/ResManage/ResRegister/bak20190109/BaseInfoExt3D.html
src/main/resources/templates/ResManage/ResRegister/bak20190109/BaseInfoExtBaseMap.html
src/main/resources/templates/ResManage/ResRegister/bak20190109/BaseInfoExtBusinessLayer.html
src/main/resources/templates/ResManage/ResRegister/bak20190109/BaseInfoExtDataBase.html
src/main/resources/templates/ResManage/ResRegister/bak20190109/BaseInfoExtFileSource.html
src/main/resources/templates/ResManage/ResRegister/bak20190109/BaseInfoExtIntegrate.html
src/main/resources/templates/ResManage/ResRegister/bak20190109/BaseInfoExtSpaceServer.html
src/main/resources/templates/ResManage/ResRegister/bak20190109/BaseInfoExtThemeMap.html
src/main/resources/templates/ResManage/ResTheme/AddResTheme.html
src/main/resources/templates/ResManage/ResTheme/AddResThemeModule.html
src/main/resources/templates/ResManage/ResTheme/KongJianFuWuTree.html
src/main/resources/templates/ResManage/ResTheme/MapSelect.html
src/main/resources/templates/ResManage/ResTheme/ModuleList.html
src/main/resources/templates/ResManage/ResTheme/PanelSelect.html
src/main/resources/templates/ResManage/ResTheme/ResThemeModule.html
src/main/resources/templates/ResManage/ResTheme/ZhuangTiDiTuTree.html
src/main/resources/templates/ResManage/ResTheme/catalog/catalog_add.html
src/main/resources/templates/ResManage/ResTheme/catalog/catalog_basicinfo.html
src/main/resources/templates/ResManage/ResTheme/catalog/catalog_sort.html
src/main/resources/templates/ResManage/ResTheme/catalog/index.html
src/main/resources/templates/ResManage/ResTheme/catalog/left.html
src/main/resources/templates/ResManage/ResTheme/catalog/onemapindex.html
src/main/resources/templates/ResManage/ResTheme/catalog/resource_sort.html
src/main/resources/templates/ResManage/ResTheme/catalog/text.html
src/main/resources/templates/ResManage/ResTheme/index.html
src/main/resources/templates/ShuJuZhanShi/AXCDTJ.html
src/main/resources/templates/ShuJuZhanShi/AnXianTJ.html
src/main/resources/templates/ShuJuZhanShi/DQHYSCIndex.html
src/main/resources/templates/ShuJuZhanShi/DaiDingTongJi.html
src/main/resources/templates/ShuJuZhanShi/GKHWIndex.html
src/main/resources/templates/ShuJuZhanShi/GKJZXIndex.html
src/main/resources/templates/ShuJuZhanShi/GKLKIndex.html
src/main/resources/templates/ShuJuZhanShi/HYCYIndex.html
src/main/resources/templates/ShuJuZhanShi/HYFZIndex.html
src/main/resources/templates/ShuJuZhanShi/HYJJFZIndex.html
src/main/resources/templates/ShuJuZhanShi/HYSYQQZSZHMJindex.html
src/main/resources/templates/ShuJuZhanShi/HaiYangJingJi.html
src/main/resources/templates/ShuJuZhanShi/Index.html
src/main/resources/templates/ShuJuZhanShi/JJSSIndex.html
src/main/resources/templates/ShuJuZhanShi/QGHYSCIndex.html
src/main/resources/templates/ShuJuZhanShi/SHJYRYIndex.html
src/main/resources/templates/ShuJuZhanShi/Test1.html
src/main/resources/templates/ShuJuZhanShi/Test2.html
src/main/resources/templates/ShuJuZhanShi/Test3.html
src/main/resources/templates/ShuJuZhanShi/Test4.html
src/main/resources/templates/ShuJuZhanShi/Test5.html
src/main/resources/templates/ShuJuZhanShi/Test5_bak.html
src/main/resources/templates/ShuJuZhanShi/Test6.html
src/main/resources/templates/ShuJuZhanShi/Test6_bak.html
src/main/resources/templates/ShuJuZhanShi/Test6_bak20190122.html
src/main/resources/templates/ShuJuZhanShi/Test7.html
src/main/resources/templates/ShuJuZhanShi/Test7_bak.html
src/main/resources/templates/ShuJuZhanShi/XZQHIndex.html
src/main/resources/templates/ShuJuZhanShi/XZQHIndex1.html
src/main/resources/templates/ShuJuZhanShi/YHFSMJTJindex.html
src/main/resources/templates/ZiYuanZhongXin/BaseLeftSource.html
src/main/resources/templates/ZiYuanZhongXin/FangWenPaiHangGD.html
src/main/resources/templates/ZiYuanZhongXin/Index.html
src/main/resources/templates/ZiYuanZhongXin/New/Index.html
src/main/resources/templates/ZiYuanZhongXin/WoDeShouCangJiaGD.html
src/main/resources/templates/ZiYuanZhongXin/ZiDuanBieMingBasic.html
src/main/resources/templates/ZiYuanZhongXin/ZiDuanBieMingBasic_Edit.html
src/main/resources/templates/ZiYuanZhongXin/ZiDuanYingShe.html
src/main/resources/templates/ZiYuanZhongXin/ZiDuanYingSheBasic.html
src/main/resources/templates/ZiYuanZhongXin/ZiYuanTongJiGD.html
src/main/resources/templates/ZiYuanZhongXin/ZiYuanTuiJianGD.html
src/main/resources/templates/bak/FuWuZiYuan/JcdtList_bak.html
src/main/resources/templates/common/SelectOfChart.html
src/main/resources/templates/common/ServiceConfig.html
src/main/resources/templates/common/TuXinCongif.html
src/main/resources/templates/common/TuXingConfig.html
src/main/resources/templates/common/add_ServiceConfig.html
src/main/resources/templates/common/jitmonitor.html
src/main/resources/templates/common/obtainExtentMapViewer.html
src/main/resources/templates/common/resource_add_ChartTemplat.html
src/main/resources/templates/common/resource_add_TuXin.html
src/main/resources/templates/common/resource_select.html
src/main/resources/templates/common/resource_set_ChartTemplat.html
src/main/resources/templates/common/resource_set_TuXin.html
src/main/resources/templates/common/resource_set_gltc.html
src/main/resources/templates/common/resource_set_zbcx.html
src/main/resources/templates/demo.html
src/main/resources/templates/ditufuwu/New/index.html
src/main/resources/templates/ditufuwu/ShenQingZiYuanGD.html
src/main/resources/templates/ditufuwu/ZiYuanTuiJianGD.html
src/main/resources/templates/ditufuwu/fangwenpaihanggd.html
src/main/resources/templates/ditufuwu/index.html
src/main/resources/templates/ditufuwu/wodeshoucanggd.html
src/main/resources/templates/ditufuwu/ziyuantuijian.html
src/main/resources/templates/ditufuwu/zuixinziyuangd.html
src/main/resources/templates/generator/Controller.java.vm
src/main/resources/templates/generator/Dao.java.vm
src/main/resources/templates/generator/Dao.xml.vm
src/main/resources/templates/generator/Entity.java.vm
src/main/resources/templates/generator/Service.java.vm
src/main/resources/templates/generator/ServiceImpl.java.vm
src/main/resources/templates/generator/generatorConfig.xml
src/main/resources/templates/generator/list.html.vm
src/main/resources/templates/generator/list.js.vm
src/main/resources/templates/jichuditu/dataList.html
src/main/resources/templates/jichuditu/dataList_New.html
src/main/resources/templates/jichuditu/index.html
src/main/resources/templates/jichuditu/index_New.html
src/main/resources/templates/liferay_userinfo.html
src/main/resources/templates/liferay_userinfoNew.html
src/main/resources/templates/manage/actionrecord/AppResource.html
src/main/resources/templates/manage/actionrecord/AppTotalCount.html
src/main/resources/templates/manage/actionrecord/index.html
src/main/resources/templates/manage/applyrecommend/AppCount.html
src/main/resources/templates/manage/applyrecommend/content.html
src/main/resources/templates/manage/applyrecommend/index.html
src/main/resources/templates/manage/applyrecommend/indexbysystem.html
src/main/resources/templates/manage/applyrecommend/ziyuanapply.html
src/main/resources/templates/manage/audit/index.html
src/main/resources/templates/manage/catalog/catalog_add.html
src/main/resources/templates/manage/catalog/catalog_basicinfo.html
src/main/resources/templates/manage/catalog/catalog_sort.html
src/main/resources/templates/manage/catalog/index.html
src/main/resources/templates/manage/catalog/left.html
src/main/resources/templates/manage/catalog/resource_sort.html
src/main/resources/templates/manage/catalog/text.html
src/main/resources/templates/manage/datasource/baseinfo.html
src/main/resources/templates/manage/datasource/edit.html
src/main/resources/templates/manage/datasource/index.html
src/main/resources/templates/manage/datasource/panel_add.html
src/main/resources/templates/manage/datasource/panel_select.html
src/main/resources/templates/manage/evaluation/content.html
src/main/resources/templates/manage/evaluation/index.html
src/main/resources/templates/manage/problemfeedback/index.html
src/main/resources/templates/manage/subscriptions/audit.html
src/main/resources/templates/manage/subscriptions/content.html
src/main/resources/templates/manage/subscriptions/index.html
src/main/resources/templates/manage/subscriptions/opinion.html
src/main/resources/templates/manage/subscriptions/subscriptions_list.html
src/main/resources/templates/manage/symbolLibrary/edit.html
src/main/resources/templates/manage/symbolLibrary/index.html
src/main/resources/templates/manage/symbolLibrary/symbolmap.html
src/main/resources/templates/restemplate/editchartcontent.html
src/main/resources/templates/restemplate/restemplate_edit.html
src/main/resources/templates/restemplate/restemplate_list.html
src/main/resources/templates/servermoniter/.vscode/settings.json
src/main/resources/templates/servermoniter/citystore.js
src/main/resources/templates/servermoniter/data.js
src/main/resources/templates/servermoniter/demo.html
src/main/resources/templates/servermoniter/echarts_4.1.0.rc2_echarts.min.js
src/main/resources/templates/servermoniter/images/bj.png
src/main/resources/templates/servermoniter/images/cc.png
src/main/resources/templates/servermoniter/images/cdian.png
src/main/resources/templates/servermoniter/images/gy-bj.png
src/main/resources/templates/servermoniter/images/gy-kgx.png
src/main/resources/templates/servermoniter/images/gy-lk.png
src/main/resources/templates/servermoniter/images/gy-lk1.png
src/main/resources/templates/servermoniter/images/gy-rt.png
src/main/resources/templates/servermoniter/images/gy-rt1.png
src/main/resources/templates/servermoniter/images/gy-scx.png
src/main/resources/templates/servermoniter/images/gy-taix.png
src/main/resources/templates/servermoniter/images/gy-tt.png
src/main/resources/templates/servermoniter/images/jdian.png
src/main/resources/templates/servermoniter/images/jh.png
src/main/resources/templates/servermoniter/images/jk.png
src/main/resources/templates/servermoniter/images/jx1.png
src/main/resources/templates/servermoniter/images/jx2.png
src/main/resources/templates/servermoniter/images/jx3.png
src/main/resources/templates/servermoniter/images/jx4.png
src/main/resources/templates/servermoniter/images/jx5.png
src/main/resources/templates/servermoniter/images/jx6.png
src/main/resources/templates/servermoniter/images/jx7.png
src/main/resources/templates/servermoniter/images/lx.png
src/main/resources/templates/servermoniter/images/nybj.png
src/main/resources/templates/servermoniter/images/ss.png
src/main/resources/templates/servermoniter/images/w-lx.png
src/main/resources/templates/servermoniter/images/wg.png
src/main/resources/templates/servermoniter/images/wl-tt.png
src/main/resources/templates/servermoniter/images/xx.png
src/main/resources/templates/servermoniter/images/yw-tt.png
src/main/resources/templates/servermoniter/images/yw-x.png
src/main/resources/templates/servermoniter/images/zj.png
src/main/resources/templates/servermoniter/index.html
src/main/resources/templates/servermoniter/jquery-3.1.0.min.js
src/main/resources/templates/servermoniter/monitor.js
src/main/resources/templates/servermoniter/大数据运维总览图.png
src/main/resources/templates/systeminfo/dataList.html
src/main/resources/templates/systeminfo/dataList_New.html
src/main/resources/templates/systeminfo/index.html
src/main/resources/templates/systeminfo/index_New.html
src/main/resources/templates/test/BaseInfo.html
src/main/resources/templates/test/DataBase.html
src/main/resources/templates/test/Edit.html
src/main/resources/templates/test/EsbProxy.html
src/main/resources/templates/test/Ext3D.html
src/main/resources/templates/test/ExtBaseMap.html
src/main/resources/templates/test/ExtBusinessLayer.html
src/main/resources/templates/test/ExtDataBase.html
src/main/resources/templates/test/ExtFileSource.html
src/main/resources/templates/test/ExtIntegrate.html
src/main/resources/templates/test/ExtInterFaceService.html
src/main/resources/templates/test/ExtSpaceServer.html
src/main/resources/templates/test/ExtThemeMap.html
src/main/resources/templates/test/MainInfo.html
src/main/resources/templates/test/first.html
src/main/resources/templates/test/form_wizard.html
src/main/resources/templates/test/third.html
src/main/resources/templates/zhuantizhitu/index.html
src/main/resources/templates/ziyuanfabu/dataList.html
src/main/resources/templates/ziyuanfabu/dataList_New.html
src/main/resources/templates/ziyuanfabu/index.html
src/main/resources/templates/ziyuanfabu/index_New.html
src/main/resources/templates/ziyuanmulu/index.html
src/main/resources/templates/ziyuanmulu/index_New.html
src/main/resources/templates/大数据运维总览图/citystore.js
src/main/resources/templates/大数据运维总览图/echarts_4.1.0.rc2_echarts.min.js
src/main/resources/templates/大数据运维总览图/images/bj.png
src/main/resources/templates/大数据运维总览图/images/cc.png
src/main/resources/templates/大数据运维总览图/images/cdian.png
src/main/resources/templates/大数据运维总览图/images/gy-bj.png
src/main/resources/templates/大数据运维总览图/images/gy-kgx.png
src/main/resources/templates/大数据运维总览图/images/gy-lk.png
src/main/resources/templates/大数据运维总览图/images/gy-lk1.png
src/main/resources/templates/大数据运维总览图/images/gy-rt.png
src/main/resources/templates/大数据运维总览图/images/gy-rt1.png
src/main/resources/templates/大数据运维总览图/images/gy-scx.png
src/main/resources/templates/大数据运维总览图/images/gy-taix.png
src/main/resources/templates/大数据运维总览图/images/gy-tt.png
src/main/resources/templates/大数据运维总览图/images/jdian.png
src/main/resources/templates/大数据运维总览图/images/jh.png
src/main/resources/templates/大数据运维总览图/images/jk.png
src/main/resources/templates/大数据运维总览图/images/jx1.png
src/main/resources/templates/大数据运维总览图/images/jx2.png
src/main/resources/templates/大数据运维总览图/images/jx3.png
src/main/resources/templates/大数据运维总览图/images/jx4.png
src/main/resources/templates/大数据运维总览图/images/jx5.png
src/main/resources/templates/大数据运维总览图/images/jx6.png
src/main/resources/templates/大数据运维总览图/images/jx7.png
src/main/resources/templates/大数据运维总览图/images/lx.png
src/main/resources/templates/大数据运维总览图/images/nybj.png
src/main/resources/templates/大数据运维总览图/images/ss.png
src/main/resources/templates/大数据运维总览图/images/w-lx.png
src/main/resources/templates/大数据运维总览图/images/wg.png
src/main/resources/templates/大数据运维总览图/images/wl-tt.png
src/main/resources/templates/大数据运维总览图/images/xx.png
src/main/resources/templates/大数据运维总览图/images/yw-tt.png
src/main/resources/templates/大数据运维总览图/images/yw-x.png
src/main/resources/templates/大数据运维总览图/images/zj.png
src/main/resources/templates/大数据运维总览图/index.html
src/main/resources/templates/大数据运维总览图/jquery-3.1.0.min.js
src/main/resources/templates/大数据运维总览图/monitor.js
src/main/resources/templates/大数据运维总览图/大数据运维总览图.png
src/main/resources/views/admin/index.html
src/main/resources/views/admin/login.html
src/main/resources/views/admin/modules/sys/generator.html
src/main/resources/views/admin/modules/sys/main.html
src/main/resources/views/admin/modules/sys/menu.html
src/main/resources/views/admin/modules/sys/user.html
src/main/resources/views/servermonitor/.vscode/settings.json
src/main/resources/views/servermonitor/citystore.js
src/main/resources/views/servermonitor/data.js
src/main/resources/views/servermonitor/demo.html
src/main/resources/views/servermonitor/echarts_4.1.0.rc2_echarts.min.js
src/main/resources/views/servermonitor/images/bj.png
src/main/resources/views/servermonitor/images/cc.png
src/main/resources/views/servermonitor/images/cdian.png
src/main/resources/views/servermonitor/images/gy-bj.png
src/main/resources/views/servermonitor/images/gy-kgx.png
src/main/resources/views/servermonitor/images/gy-lk.png
src/main/resources/views/servermonitor/images/gy-lk1.png
src/main/resources/views/servermonitor/images/gy-rt.png
src/main/resources/views/servermonitor/images/gy-rt1.png
src/main/resources/views/servermonitor/images/gy-scx.png
src/main/resources/views/servermonitor/images/gy-taix.png
src/main/resources/views/servermonitor/images/gy-tt.png
src/main/resources/views/servermonitor/images/jdian.png
src/main/resources/views/servermonitor/images/jh.png
src/main/resources/views/servermonitor/images/jk.png
src/main/resources/views/servermonitor/images/jx1.png
src/main/resources/views/servermonitor/images/jx2.png
src/main/resources/views/servermonitor/images/jx3.png
src/main/resources/views/servermonitor/images/jx4.png
src/main/resources/views/servermonitor/images/jx5.png
src/main/resources/views/servermonitor/images/jx6.png
src/main/resources/views/servermonitor/images/jx7.png
src/main/resources/views/servermonitor/images/lx.png
src/main/resources/views/servermonitor/images/nybj.png
src/main/resources/views/servermonitor/images/ss.png
src/main/resources/views/servermonitor/images/w-lx.png
src/main/resources/views/servermonitor/images/wg.png
src/main/resources/views/servermonitor/images/wl-tt.png
src/main/resources/views/servermonitor/images/xx.png
src/main/resources/views/servermonitor/images/yw-tt.png
src/main/resources/views/servermonitor/images/yw-x.png
src/main/resources/views/servermonitor/images/zj.png
src/main/resources/views/servermonitor/index.html
src/main/resources/views/servermonitor/jquery-3.1.0.min.js
src/main/resources/views/servermonitor/monitor.js
src/main/resources/views/servermonitor/大数据运维总览图.png
temp/ResExtThemMapServer/i_expand.png
temp/ResExtThemMapServer/i_expand2.png
脚本/2021-11-30_RES_MAININFO新增字段SPC_STATUS 专题数据标识
脚本/20211230_001_更新资源状态.sql
说明.txt |