Browse Source

copy from persagy git

cuixubin 4 years ago
commit
069e6c264c
100 changed files with 39153 additions and 0 deletions
  1. 4 0
      .gitignore
  2. 36 0
      .project
  3. 27 0
      EMS_Weather.iml
  4. 3 0
      WebContent/META-INF/MANIFEST.MF
  5. 73 0
      WebContent/WEB-INF/web.xml
  6. 10 0
      WebContent/index.html
  7. BIN
      lib/alibaba-dingtalk-service-sdk-1.0.1.jar
  8. BIN
      lib/aopalliance-1.0.jar
  9. BIN
      lib/aspectjrt.jar
  10. BIN
      lib/aspectjweaver.jar
  11. BIN
      lib/c3p0-0.9.2.1.jar
  12. BIN
      lib/commons-codec-1.9.jar
  13. BIN
      lib/commons-fileupload-1.2.jar
  14. BIN
      lib/commons-logging-1.2.jar
  15. BIN
      lib/ehcache-core-2.4.3.jar
  16. BIN
      lib/ems_data.jar
  17. BIN
      lib/fastjson-1.2.47.jar
  18. BIN
      lib/fluent-hc-4.5.jar
  19. BIN
      lib/freemarker-2.3.21.jar
  20. BIN
      lib/hibernate-c3p0-4.2.12.Final.jar
  21. BIN
      lib/hibernate-ehcache-4.2.12.Final.jar
  22. BIN
      lib/httpclient-4.5.jar
  23. BIN
      lib/httpclient-cache-4.5.jar
  24. BIN
      lib/httpclient-win-4.5.jar
  25. BIN
      lib/httpcore-4.4.1.jar
  26. BIN
      lib/httpmime-4.5.jar
  27. BIN
      lib/jackson-annotations-2.2.0.jar
  28. BIN
      lib/jackson-core-2.2.0.jar
  29. BIN
      lib/jackson-databind-2.2.0.jar
  30. BIN
      lib/jackson-dataformat-xml-2.2.0.jar
  31. BIN
      lib/javacsv-2.0.jar
  32. BIN
      lib/jna-4.1.0.jar
  33. BIN
      lib/jna-platform-4.1.0.jar
  34. BIN
      lib/jsr311-api-1.1.1.jar
  35. BIN
      lib/log4j-1.2.16.jar
  36. BIN
      lib/mchange-commons-java-0.2.3.4.jar
  37. BIN
      lib/mysql-connector-java-5.1.13-bin.jar
  38. BIN
      lib/poi-3.11-20141221.jar
  39. BIN
      lib/poi-examples-3.11-20141221.jar
  40. BIN
      lib/poi-excelant-3.11-20141221.jar
  41. BIN
      lib/poi-ooxml-3.11-20141221.jar
  42. BIN
      lib/poi-ooxml-schemas-3.11-20141221.jar
  43. BIN
      lib/poi-scratchpad-3.11-20141221.jar
  44. BIN
      lib/slf4j-api-1.6.1.jar
  45. BIN
      lib/spring-aop-3.2.8.RELEASE.jar
  46. BIN
      lib/spring-aspects-3.2.8.RELEASE.jar
  47. BIN
      lib/spring-beans-3.2.8.RELEASE.jar
  48. BIN
      lib/spring-context-3.2.8.RELEASE.jar
  49. BIN
      lib/spring-context-support-3.2.8.RELEASE.jar
  50. BIN
      lib/spring-core-3.2.8.RELEASE.jar
  51. BIN
      lib/spring-expression-3.2.8.RELEASE.jar
  52. BIN
      lib/spring-framework-bom-3.2.8.RELEASE.jar
  53. BIN
      lib/spring-instrument-3.2.8.RELEASE.jar
  54. BIN
      lib/spring-instrument-tomcat-3.2.8.RELEASE.jar
  55. BIN
      lib/spring-jdbc-3.2.8.RELEASE.jar
  56. BIN
      lib/spring-jms-3.2.8.RELEASE.jar
  57. BIN
      lib/spring-orm-3.2.8.RELEASE.jar
  58. BIN
      lib/spring-oxm-3.2.8.RELEASE.jar
  59. BIN
      lib/spring-struts-3.2.8.RELEASE.jar
  60. BIN
      lib/spring-test-3.2.8.RELEASE.jar
  61. BIN
      lib/spring-tx-3.2.8.RELEASE.jar
  62. BIN
      lib/spring-web-3.2.8.RELEASE.jar
  63. BIN
      lib/spring-webmvc-3.2.8.RELEASE.jar
  64. BIN
      lib/spring-webmvc-portlet-3.2.8.RELEASE.jar
  65. BIN
      lib/xmlbeans-2.6.0.jar
  66. 38588 0
      resource/config/business/Geography.json
  67. BIN
      resource/config/business/WandaCityCodeName.xlsx
  68. BIN
      resource/config/business/cityList.xlsx
  69. BIN
      resource/config/business/cityListData.xlsx
  70. 14 0
      resource/config/business/longhuConfig.json
  71. 5 0
      resource/config/domain.json
  72. 23 0
      resource/config/log4j/log4j.properties
  73. 13 0
      resource/config/schema.json
  74. 78 0
      resource/config/spring/spring-base.xml
  75. 72 0
      resource/config/spring/spring-mvc.xml
  76. 27 0
      resource/config/system.properties
  77. 101 0
      resource/documentation.md
  78. 79 0
      resource/maintain.md
  79. BIN
      resource/static/icon/classic/0@1x.png
  80. BIN
      resource/static/icon/classic/0@2x.png
  81. BIN
      resource/static/icon/classic/10@1x.png
  82. BIN
      resource/static/icon/classic/10@2x.png
  83. BIN
      resource/static/icon/classic/11@1x.png
  84. BIN
      resource/static/icon/classic/11@2x.png
  85. BIN
      resource/static/icon/classic/12@1x.png
  86. BIN
      resource/static/icon/classic/12@2x.png
  87. BIN
      resource/static/icon/classic/13@1x.png
  88. BIN
      resource/static/icon/classic/13@2x.png
  89. BIN
      resource/static/icon/classic/14@1x.png
  90. BIN
      resource/static/icon/classic/14@2x.png
  91. BIN
      resource/static/icon/classic/15@1x.png
  92. BIN
      resource/static/icon/classic/15@2x.png
  93. BIN
      resource/static/icon/classic/16@1x.png
  94. BIN
      resource/static/icon/classic/16@2x.png
  95. BIN
      resource/static/icon/classic/17@1x.png
  96. BIN
      resource/static/icon/classic/17@2x.png
  97. BIN
      resource/static/icon/classic/18@1x.png
  98. BIN
      resource/static/icon/classic/18@2x.png
  99. BIN
      resource/static/icon/classic/19@1x.png
  100. 0 0
      resource/static/icon/classic/19@2x.png

+ 4 - 0
.gitignore

@@ -0,0 +1,4 @@
+/WebContent/WEB-INF/classes/
+/.settings/
+/bin/
+/.classpath

+ 36 - 0
.project

@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>EMS_Weather</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.wst.jsdt.core.javascriptValidator</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.wst.common.project.facet.core.builder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.wst.validation.validationbuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
+		<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
+		<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+		<nature>org.eclipse.wst.jsdt.core.jsNature</nature>
+	</natures>
+</projectDescription>

+ 27 - 0
EMS_Weather.iml

@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module type="JAVA_MODULE" version="4">
+  <component name="FacetManager">
+    <facet type="web" name="Web">
+      <configuration>
+        <descriptors>
+          <deploymentDescriptor name="web.xml" url="file://$MODULE_DIR$/WebContent/WEB-INF/web.xml" />
+        </descriptors>
+        <webroots>
+          <root url="file://$MODULE_DIR$/WebContent" relative="/" />
+        </webroots>
+      </configuration>
+    </facet>
+  </component>
+  <component name="NewModuleRootManager">
+    <output url="file://$MODULE_DIR$/WebContent/WEB-INF/classes" />
+    <exclude-output />
+    <content url="file://$MODULE_DIR$">
+      <sourceFolder url="file://$MODULE_DIR$/resource" isTestSource="false" />
+      <sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
+    </content>
+    <orderEntry type="jdk" jdkName="1.7" jdkType="JavaSDK" />
+    <orderEntry type="sourceFolder" forTests="false" />
+    <orderEntry type="library" name="jsp-api" level="project" />
+    <orderEntry type="library" name="lib" level="project" />
+  </component>
+</module>

+ 3 - 0
WebContent/META-INF/MANIFEST.MF

@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+Class-Path: 
+

+ 73 - 0
WebContent/WEB-INF/web.xml

@@ -0,0 +1,73 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
+  <display-name>EMS_Weather</display-name>
+  <!-- 加载Spring配置 -->
+	<context-param>
+		<param-name>contextConfigLocation</param-name>
+		<param-value>classpath:config/spring/spring-base.xml</param-value>
+	</context-param>
+
+	<!-- 加载Log4j配置 -->
+	<context-param>
+		<param-name>log4jConfigLocation</param-name>
+		<param-value>classpath:config/log4j/log4j.properties</param-value>
+	</context-param>
+
+	<!-- 启动Log4j -->
+	<listener>
+		<listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
+	</listener>
+
+	<!-- 启动Spring -->
+	<listener>
+		<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
+	</listener>
+	
+	<!-- 系统初始化 -->
+	<servlet>
+		<servlet-name>SystemInitServlet</servlet-name>
+		<servlet-class>com.persagy.init.SystemInitServlet</servlet-class>
+		<load-on-startup>0</load-on-startup>
+	</servlet>
+
+	<!-- 解决乱码 -->
+	<filter>
+		<filter-name>CharacterEncodingFilter</filter-name>
+		<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
+		<init-param>
+			<param-name>encoding</param-name>
+			<param-value>utf-8</param-value>
+		</init-param>
+	</filter>
+	<filter-mapping>
+		<filter-name>CharacterEncodingFilter</filter-name>
+		<url-pattern>/*</url-pattern>
+	</filter-mapping>
+	
+	<!-- CORS过滤器start -->
+    <filter>
+        <filter-name>corsFilter</filter-name>
+        <filter-class>com.persagy.filter.CorsFilter</filter-class>
+    </filter>
+    <filter-mapping>
+        <filter-name>corsFilter</filter-name>
+        <url-pattern>/*</url-pattern>
+    </filter-mapping>
+	<!-- CORS过滤器end -->
+	
+	<!-- Spring MVC -->
+	<servlet>
+		<servlet-name>SpringMVC</servlet-name>
+		<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
+		<init-param>
+			<param-name>contextConfigLocation</param-name>
+			<param-value>classpath:config/spring/spring-mvc.xml</param-value>
+		</init-param>
+		<load-on-startup>1</load-on-startup>
+	</servlet>
+
+	<servlet-mapping>
+		<servlet-name>SpringMVC</servlet-name>
+		<url-pattern>/Spring/MVC/*</url-pattern>
+	</servlet-mapping>
+</web-app>

+ 10 - 0
WebContent/index.html

@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="UTF-8">
+<title>hello</title>
+</head>
+<body style="background-color: black;">
+<img alt="天气图片" src="http://114.215.64.204:9092/EMS_Weather/Spring/MVC/entrance/download/icon/1-light-big">
+</body>
+</html>

BIN
lib/alibaba-dingtalk-service-sdk-1.0.1.jar


BIN
lib/aopalliance-1.0.jar


BIN
lib/aspectjrt.jar


BIN
lib/aspectjweaver.jar


BIN
lib/c3p0-0.9.2.1.jar


BIN
lib/commons-codec-1.9.jar


BIN
lib/commons-fileupload-1.2.jar


BIN
lib/commons-logging-1.2.jar


BIN
lib/ehcache-core-2.4.3.jar


BIN
lib/ems_data.jar


BIN
lib/fastjson-1.2.47.jar


BIN
lib/fluent-hc-4.5.jar


BIN
lib/freemarker-2.3.21.jar


BIN
lib/hibernate-c3p0-4.2.12.Final.jar


BIN
lib/hibernate-ehcache-4.2.12.Final.jar


BIN
lib/httpclient-4.5.jar


BIN
lib/httpclient-cache-4.5.jar


BIN
lib/httpclient-win-4.5.jar


BIN
lib/httpcore-4.4.1.jar


BIN
lib/httpmime-4.5.jar


BIN
lib/jackson-annotations-2.2.0.jar


BIN
lib/jackson-core-2.2.0.jar


BIN
lib/jackson-databind-2.2.0.jar


BIN
lib/jackson-dataformat-xml-2.2.0.jar


BIN
lib/javacsv-2.0.jar


BIN
lib/jna-4.1.0.jar


BIN
lib/jna-platform-4.1.0.jar


BIN
lib/jsr311-api-1.1.1.jar


BIN
lib/log4j-1.2.16.jar


BIN
lib/mchange-commons-java-0.2.3.4.jar


BIN
lib/mysql-connector-java-5.1.13-bin.jar


BIN
lib/poi-3.11-20141221.jar


BIN
lib/poi-examples-3.11-20141221.jar


BIN
lib/poi-excelant-3.11-20141221.jar


BIN
lib/poi-ooxml-3.11-20141221.jar


BIN
lib/poi-ooxml-schemas-3.11-20141221.jar


BIN
lib/poi-scratchpad-3.11-20141221.jar


BIN
lib/slf4j-api-1.6.1.jar


BIN
lib/spring-aop-3.2.8.RELEASE.jar


BIN
lib/spring-aspects-3.2.8.RELEASE.jar


BIN
lib/spring-beans-3.2.8.RELEASE.jar


BIN
lib/spring-context-3.2.8.RELEASE.jar


BIN
lib/spring-context-support-3.2.8.RELEASE.jar


BIN
lib/spring-core-3.2.8.RELEASE.jar


BIN
lib/spring-expression-3.2.8.RELEASE.jar


BIN
lib/spring-framework-bom-3.2.8.RELEASE.jar


BIN
lib/spring-instrument-3.2.8.RELEASE.jar


BIN
lib/spring-instrument-tomcat-3.2.8.RELEASE.jar


BIN
lib/spring-jdbc-3.2.8.RELEASE.jar


BIN
lib/spring-jms-3.2.8.RELEASE.jar


BIN
lib/spring-orm-3.2.8.RELEASE.jar


BIN
lib/spring-oxm-3.2.8.RELEASE.jar


BIN
lib/spring-struts-3.2.8.RELEASE.jar


BIN
lib/spring-test-3.2.8.RELEASE.jar


BIN
lib/spring-tx-3.2.8.RELEASE.jar


BIN
lib/spring-web-3.2.8.RELEASE.jar


BIN
lib/spring-webmvc-3.2.8.RELEASE.jar


BIN
lib/spring-webmvc-portlet-3.2.8.RELEASE.jar


BIN
lib/xmlbeans-2.6.0.jar


File diff suppressed because it is too large
+ 38588 - 0
resource/config/business/Geography.json


BIN
resource/config/business/WandaCityCodeName.xlsx


BIN
resource/config/business/cityList.xlsx


BIN
resource/config/business/cityListData.xlsx


+ 14 - 0
resource/config/business/longhuConfig.json

@@ -0,0 +1,14 @@
+{
+	"北京":"WX4FBXXFKE4F",
+	"北京朝阳":"WX4G17JWZEK7",
+	"佛山":"WS06YNEMPP18",
+	"成都":"WM6N2PM3WY2K",
+	"上海":"WTW3SJ5ZBJUY",
+	"青岛":"WWMT5Q64CR3G",
+	"沈阳":"WXRVB9QYXKY8",
+	"西安":"WQJ6YY8MHZP0",
+	"长沙":"WT027GXDDZVH",
+	"济南":"WWE0TGW4PX6N",
+	"南京":"WTSQQYHVQ973",
+	"武汉":"WT3Q0FW9ZJ3Q"
+}

+ 5 - 0
resource/config/domain.json

@@ -0,0 +1,5 @@
+{
+	"symbol": "PersagyCloud",
+	"domain": "192.168.100.3:55555",
+	"context": "EMS_Cloud"
+}

+ 23 - 0
resource/config/log4j/log4j.properties

@@ -0,0 +1,23 @@
+log4j.rootLogger=INFO,ConsoleAppender,RollingLogFileAppender
+
+## class setting
+log4j.logger.org.springframework=INFO
+log4j.logger.org.apache.axis=INFO
+log4j.logger.org.apache.cxf=INFO
+log4j.logger.com.mchange.v2=INFO
+
+log4j.appender.RollingLogFileAppender=org.apache.log4j.DailyRollingFileAppender
+log4j.appender.RollingLogFileAppender.Threshold=INFO
+log4j.appender.RollingLogFileAppender.ImmediateFlush=true
+log4j.appender.RollingLogFileAppender.File=../logs/EMS_Weather_2020/log.log
+log4j.appender.RollingLogFileAppender.DatePattern=yyyy-MM-dd HH'.log'
+log4j.appender.RollingLogFileAppender.Append=true
+log4j.appender.RollingLogFileAppender.layout=org.apache.log4j.PatternLayout
+log4j.appender.RollingLogFileAppender.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %m%n
+
+log4j.appender.ConsoleAppender=org.apache.log4j.ConsoleAppender
+log4j.appender.ConsoleAppender.Threshold=INFO
+log4j.appender.ConsoleAppender.ImmediateFlush=true
+log4j.appender.ConsoleAppender.Target=System.out
+log4j.appender.ConsoleAppender.layout=org.apache.log4j.PatternLayout
+log4j.appender.ConsoleAppender.layout.ConversionPattern=%d{yyyy-MM-dd HH\:mm\:ss} %m%n

+ 13 - 0
resource/config/schema.json

@@ -0,0 +1,13 @@
+{
+    "ems": "persagy_weather",
+    "udm": "weather_ems",
+    "emsvdata": "yun_emsvdata",
+    "objectdata": "yun_objectdata",
+    "meterdata": "yun_meterdata",
+    "originaldata": "yun_originaldata",
+    "servicedata": "yun_servicedata",
+    "energyundata": "yun_energyundata",
+    "tenementdata": "yun_tenementdata",
+    "tenant": "yun_tenant",
+    "workflow": "yun_workflow"
+}

+ 78 - 0
resource/config/spring/spring-base.xml

@@ -0,0 +1,78 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+	xmlns:context="http://www.springframework.org/schema/context"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tx="http://www.springframework.org/schema/tx"
+	xmlns:cache="http://www.springframework.org/schema/cache" xmlns:aop="http://www.springframework.org/schema/aop"
+	xsi:schemaLocation="http://www.springframework.org/schema/beans     
+	http://www.springframework.org/schema/beans/spring-beans-3.2.xsd    
+	http://www.springframework.org/schema/context    
+	http://www.springframework.org/schema/context/spring-context-3.2.xsd    
+	http://www.springframework.org/schema/tx
+    http://www.springframework.org/schema/tx/spring-tx-3.2.xsd
+    http://www.springframework.org/schema/cache
+    http://www.springframework.org/schema/cache/spring-cache.xsd
+    http://www.springframework.org/schema/aop
+    http://www.springframework.org/schema/aop/spring-aop-3.2.xsd
+    ">
+
+	<!-- spring3 @value 特性加载属性文件内容 -->
+	<context:property-placeholder location="classpath:config/system.properties" />
+	<!-- 使用spring注解 -->
+	<context:annotation-config />
+	<!-- spring扫描目录 -->
+	<context:component-scan base-package="com.persagy">
+		<!-- 不包括@Controller -->
+		<context:exclude-filter type="annotation"
+			expression="org.springframework.stereotype.Controller" />
+	</context:component-scan>
+	<!-- 切面编程 -->
+	<aop:aspectj-autoproxy />
+
+	<!-- 数据库连接池 -->
+	<bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource"
+		destroy-method="close">
+		<!-- 数据库驱动 -->
+		<property name="driverClass" value="${jdbc.driverClass}" />
+		<!-- 数据库连接串 -->
+		<property name="jdbcUrl" value="${jdbc.jdbcUrl}" />
+		<!-- 用户名 -->
+		<property name="user" value="${jdbc.user}" />
+		<!-- 密码 -->
+		<property name="password" value="${jdbc.password}" />
+		<!-- 连接池维持连接数最小值 -->
+		<property name="minPoolSize" value="${jdbc.miniPoolSize}" />
+		<!-- 连接池维持链接数最大值 -->
+		<property name="maxPoolSize" value="${jdbc.maxPoolSize}" />
+		<!-- 连接池初始化链接数 -->
+		<property name="initialPoolSize" value="${jdbc.initialPoolSize}" />
+		<!-- 最大空闲时间,设置秒内未使用则连接被丢弃。若为0则永不丢弃。Default: 0 -->
+		<property name="maxIdleTime" value="${jdbc.maxIdleTime}" />
+		<!-- 当连接池中的连接耗尽的时候c3p0一次同时获取的连接数。Default: 3 -->
+		<property name="acquireIncrement" value="${jdbc.acquireIncrement}" />
+		<!-- 定义在从数据库获取新连接失败后重复尝试的次数。Default: 30 -->
+		<property name="acquireRetryAttempts" value="${jdbc.acquireRetryAttempts}" />
+		<!-- 两次连接中间隔时间,单位毫秒。Default: 1000 -->
+		<property name="acquireRetryDelay" value="${jdbc.acquireRetryDelay}" />
+		<!-- 如果设为true那么在取得连接的同时将校验连接的有效性。Default: false -->
+		<property name="testConnectionOnCheckin" value="${jdbc.testConnectionOnCheckin}" />
+		<!-- c3p0将建一张名为设置表名的空表,并使用其自带的查询语句进行测试。Default: null -->
+		<property name="automaticTestTable" value="${jdbc.automaticTestTable}" />
+		<!--每设置秒检查所有连接池中的空闲连接。Default: 0 -->
+		<property name="idleConnectionTestPeriod" value="${jdbc.idleConnectionTestPeriod}" />
+		<!--当连接池用完时客户端调用getConnection()后等待获取新连接的时间,超时后将抛出SQLException,如设为0则无限期等待。单位毫秒。Default: 
+			0 -->
+		<property name="checkoutTimeout" value="${jdbc.checkoutTimeout}" />
+	</bean>
+
+	<bean id="jdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate">
+		<property name="dataSource" ref="dataSource" />
+	</bean>
+
+	<bean id="transactionManager"
+		class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
+		<property name="dataSource" ref="dataSource" />
+	</bean>
+
+	<tx:annotation-driven transaction-manager="transactionManager" />
+
+</beans>	

+ 72 - 0
resource/config/spring/spring-mvc.xml

@@ -0,0 +1,72 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+	xmlns:context="http://www.springframework.org/schema/context"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:mvc="http://www.springframework.org/schema/mvc"
+	xsi:schemaLocation="http://www.springframework.org/schema/beans     
+	http://www.springframework.org/schema/beans/spring-beans-3.2.xsd    
+	http://www.springframework.org/schema/context    
+	http://www.springframework.org/schema/context/spring-context-3.2.xsd    
+	http://www.springframework.org/schema/mvc  
+    http://www.springframework.org/schema/mvc/spring-mvc-3.2.xsd 
+    ">
+
+	<!-- Spring MVC 扫描目录 -->
+	<context:component-scan base-package="com.persagy.web.controller">
+		<!-- 只包括@Controller -->
+		<context:include-filter type="annotation" expression="org.springframework.stereotype.Controller" />
+	</context:component-scan>
+
+	<!-- 文件上传解析器 -->
+	<bean id="multipartResolver"
+		class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
+		<!-- 表示用来解析request请求的默认编码格式,当没有指定的时候根据Servlet规范会使用默认值ISO-8859-1。当request自己指明了它的编码格式的时候就会忽略这里指定的defaultEncoding -->
+		<property name="defaultEncoding" value="UTF-8" />
+		<!-- 设置上传文件时的临时目录,默认是Servlet容器的临时目录。 -->
+		<!--<property name="uploadTempDir" value=""/> -->
+		<!-- 设置允许上传的最大文件大小,以字节为单位计算。当设为-1时表示无限制,默认是-1。 -->
+		<property name="maxUploadSize" value="-1" />
+		<!-- 设置在文件上传时允许写到内存中的最大值,以字节为单位计算,默认是10240。 -->
+		<!--<property name="maxInMemorySize" value="200000"/> -->
+	</bean>
+
+	<bean id="mappingJackson2HttpMessageConverter" class="org.springframework.http.converter.json.MappingJackson2HttpMessageConverter">
+		<property name="objectMapper" ref="objectMapper"></property>
+		<property name="supportedMediaTypes">
+			<list>
+				<value>application/json;charset=UTF-8</value>
+				<value>text/html;charset=UTF-8</value><!-- 避免IE出现下载JSON文件的情况 -->
+			</list>
+		</property>
+	</bean>
+
+	<!-- 二进制数据 -->
+	<bean id="byteArrayHttpMessageConverter" class="org.springframework.http.converter.ByteArrayHttpMessageConverter">
+	</bean>
+
+	<!-- 文本数据 -->
+	<bean id="stringHttpMessageConverter" class="org.springframework.http.converter.StringHttpMessageConverter">
+		<!--避免出现乱码 -->
+		<constructor-arg value="UTF-8" index="0"></constructor-arg>
+		<property name="supportedMediaTypes">
+			<list>
+				<value>text/plain;charset=UTF-8</value>
+				<value>text/html;charset=UTF-8</value>
+			</list>
+		</property>
+	</bean>
+
+	<mvc:annotation-driven>
+		<mvc:message-converters>
+			<ref bean="stringHttpMessageConverter" />
+			<ref bean="byteArrayHttpMessageConverter" />
+			<ref bean="mappingJackson2HttpMessageConverter" />
+		</mvc:message-converters>
+	</mvc:annotation-driven>
+
+	<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
+		<property name="viewClass" value="org.springframework.web.servlet.view.JstlView" />
+		<property name="prefix" value="/WEB-INF/jsp/" />
+		<property name="suffix" value=".jsp" />
+	</bean>
+
+</beans>

+ 27 - 0
resource/config/system.properties

@@ -0,0 +1,27 @@
+######################### database setting ########################
+jdbc.driverClass=com.mysql.jdbc.Driver
+#jdbc.jdbcUrl=jdbc\:mysql\://127.0.0.1\:3306/test?useUnicode=true&characterEncoding=utf-8
+jdbc.jdbcUrl=jdbc\:mysql\://114.215.64.204\:3306/test?useUnicode=true&characterEncoding=utf-8
+#jdbc.user=root
+#jdbc.password=root
+jdbc.user=pbsage
+jdbc.password=Persagy_!@#2019
+jdbc.miniPoolSize=50
+jdbc.maxPoolSize=300
+jdbc.initialPoolSize=50
+jdbc.maxIdleTime=7200
+jdbc.acquireIncrement=10
+jdbc.acquireRetryAttempts=10
+jdbc.acquireRetryDelay=1000
+jdbc.testConnectionOnCheckin=true
+jdbc.automaticTestTable=c3p0TestTable
+jdbc.idleConnectionTestPeriod=3600
+jdbc.checkoutTimeout=10000
+######################### system parameter #########################
+system.printSql=false
+system.repairTable=false
+system.cacheInMemory=100
+######################## file parameter ############################
+file.storage.directory=D:/develop/file
+######################## thread run set ############################
+thread.model=false

+ 101 - 0
resource/documentation.md

@@ -0,0 +1,101 @@
+# 说明
+本天气服务(EMS_Weather),以购买的第三方天气数据服务商(心知天气,https://www.seniverse.com/)的接口为数据源,通过a转发请求,b定时任务将数据存库两种方式来获取天气数据,并提供相关查询接口;
+## 天气数据说明
+### 单位
+接口返回数据默认单位说明:
+
+- 温度(体感温度),c,摄氏度
+- 相对湿度,数值在0~100之间,是百分比数值
+- 气压,mbar,百帕
+- 能见度,km,千米
+- 风向角度,数值在0~360,0为正北,90为正东,180为正南
+- 风速,km/h,千米每小时
+- 风力等级,数值>=0,无单位,数值越大风力越大
+- 降水量,mm,毫米
+- aqi,数值,无单位
+- pm25,1小时平均值。单位:μg/m³
+- pm10,1小时平均值。单位:μg/m³
+- so2,1小时平均值。单位:μg/m³
+- no2,1小时平均值。单位:μg/m³
+- co,1小时平均值。单位:mg/m³
+- o3,1小时平均值。单位:mg/m³
+
+### 空气质量枚举值
+"优"、"良"、"轻度污染"、"中度污染"、"重度污染"、"严重污染"
+
+### 天气现象编码与天气气象文字枚举值
+    {
+    	"0": "晴",
+    	"1": "晴",
+    	"2": "晴",
+    	"3": "晴",
+    	"4": "多云",
+    	"5": "晴间多云",
+    	"6": "晴间多云",
+    	"7": "大部多云",
+    	"8": "大部多云",
+    	"9": "阴",
+    	"10": "阵雨",
+    	"11": "雷阵雨",
+    	"12": "雷阵雨伴有冰雹",
+    	"13": "小雨",
+    	"14": "中雨",
+    	"15": "大雨",
+    	"16": "暴雨",
+    	"17": "大暴雨",
+    	"18": "特大暴雨",
+    	"19": "冻雨",
+    	"20": "雨夹雪",
+    	"21": "阵雪",
+    	"22": "小雪",
+    	"23": "中雪",
+    	"24": "大雪",
+    	"25": "暴雪",
+    	"26": "浮尘",
+    	"27": "扬沙",
+    	"28": "沙尘暴",
+    	"29": "强沙尘暴",
+    	"30": "雾",
+    	"31": "霾",
+    	"32": "风",
+    	"33": "大风",
+    	"34": "飓风",
+    	"35": "热带风暴",
+    	"36": "龙卷风",
+    	"37": "冷",
+    	"38": "热",
+    	"99": "未知"
+    }
+
+### 灾害预警
+- 类型:["台风", "暴雨", "暴雪", "寒潮", "大风", "沙尘暴", "高温", "干旱", "雷电", "冰雹", "霜冻", "大雾", "道路结冰", "雷雨大风"]
+- 灾害级别:["白色", "蓝色", "黄色", "橙色", "红色"]
+
+## 支持的气象指标
+
+### 小时级别数据
+温度、体感温度、相对湿度、气压、能见度、气象文字、风向、风向角风速、风力等级、空气质量、云量、pm25、pm10、so2、no2、co、o3
+
+### 日级别数据
+- 日概况数据:最高温、最低温、白天气象文字、夜晚气象文字、风力等级、风向、风速、降水量
+- 统计数据:以下指标的最大最小值以及均值,[温度, 相对湿度, 风速, 气压, 能见度]
+
+### 灾害预警数据
+16种灾害类型:台风, 暴雨, 暴雪, 寒潮, 大风, 沙尘暴, 高温, 干旱, 雷电, 冰雹, 霜冻, 大雾, 道路结冰, 雷雨  大风
+
+## 数据类型(按时间划分)
+### 24小时预报
+温度、相对湿度、能见度、气象文字、气象代码、风向、风速
+
+### 14日预报
+最高/低温、相对湿度、白天气象文字/代码、夜晚气象文字/代码、风向文字、风向角、风速、风力等级、降水量
+
+### 小时数据历史记录(最早2017.01.01开始)
+温度、相对湿度、气象文字、气压、能见度、风向文字、风速、风向角风速、风力等级、(2020.07.01之前不包含以下指标)体感温度、空气质量、云量、pm25、pm10、so2、no2、co、o3
+
+### 日历史数据(最早2017.01.01开始)
+[温度, 相对湿度, 风速, 气压, 能见度]的最大(最小,平均)值、白天\夜晚气象文字、风向文字、风速、风向角风速、风力等级、(2020.07.01之前不包含以下指标)白天夜晚\气象代码、降雨量
+
+## 支持城市
+- 小时级数据和日统计数据支持1189个城市地区(涵盖全国所有一、二、三、四、五线城市的市级,市属区级)
+- 日天气数据和灾害预警数据支持3000+个城市地区(几乎涵盖全国所有地区)

+ 79 - 0
resource/maintain.md

@@ -0,0 +1,79 @@
+# 常用维护项说明
+
+## 历史数据由cvs文件导入数据库
+注意:该操作不要直接连接生产环境数据库,在自己本地数据库生成相应数据之后,再导出sql文件,上传到生产环境。
+
+**操作流程如下**
+
+1. 确定本地数据库已创建 
+
+天气服务,所使用的数据配置在schema.json配置文件中,配置项ems。 无需管数据表,表自动创建。
+
+2. 修改配置文件system.properties配置 
+
+修改数据库配置为本地;配置项thread.model值改为false
+
+3. 启动天气服务 
+
+4. 调用读取cvs文件转存数据库接口 
+
+```
+接口名:EMS_Weather/Spring/MVC/entrance/unifier/FileData2DB 
+
+参数:
+jsonString={
+    "dirPath":"D:/wz/cma_2020", 
+    "cityList":["WEBY8Q5HHUCU"], 
+    "timeFrom":"yyyy-MM-dd HH:mm:ss", 
+    "timeTo":"yyyy-MM-dd HH:mm:ss"
+} 
+
+说明:
+  dirPath为天气历史数据cvs文件所在文件夹目录,必须;
+  cityList为需要导入城市的ID,必须,ID可在系统配置文件config/business/cityListData.xlsx中查到;
+  timeFrom开始时间数据,非必须,>= 判断
+  timeTo结束时间,非必须,< 判断
+
+```
+
+5. 小时数据到日数据(以及日统计数据)计算
+
+```
+接口名:EMS_Weather/Spring/MVC/entrance/unifier/HourToDayData 
+
+参数:
+jsonString={
+    "cityIds":["WW5R9F45BCGR"],
+    "startDay":"2017-01-01",
+    "endDay":"2020-07-01",
+    "type":"All"
+}
+
+说明:
+  cityIds需要进行由小时数据生成日数据日统计数据的城市id,必须;
+  type,除了计算日数据之外,还需要计算的统计值类型,非必须,枚举值:Max,计算最值;Avg计算均值;All最值和均值都计算
+
+```
+
+6. 数据转移
+
+将入库的小时数据,以及计算出的日数据和统计数据,由本地数据库导入到生产环境数据库,**注意,sql文件中不要包含建表、删表语句**
+
+7. 天气数据采集服务记录小时数据
+
+若某一城市需要天气服务今后一直记录小时数据,则需要: 
+
+1)在配置文件config/business/cityListData.xlsx中查到该城市,
+将**记录小时天气**列的值改为yes,将**数据字典编码**列填写为对应城市数据字典编码。
+修改后将文件改动提交到版本库,提交注释写清改动城市信息。
+
+2)把修改后的cityListData.xlsx文件放到成产环境,天气数据采集服务的相应目录下,然后调用该服务的如下接口
+
+```
+接口名:EMS_Weather/Spring/MVC/entrance/unifier/ConfigShow
+
+参数:
+jsonString={
+    "method":"cache_refresh_all"
+}
+```

BIN
resource/static/icon/classic/0@1x.png


BIN
resource/static/icon/classic/0@2x.png


BIN
resource/static/icon/classic/10@1x.png


BIN
resource/static/icon/classic/10@2x.png


BIN
resource/static/icon/classic/11@1x.png


BIN
resource/static/icon/classic/11@2x.png


BIN
resource/static/icon/classic/12@1x.png


BIN
resource/static/icon/classic/12@2x.png


BIN
resource/static/icon/classic/13@1x.png


BIN
resource/static/icon/classic/13@2x.png


BIN
resource/static/icon/classic/14@1x.png


BIN
resource/static/icon/classic/14@2x.png


BIN
resource/static/icon/classic/15@1x.png


BIN
resource/static/icon/classic/15@2x.png


BIN
resource/static/icon/classic/16@1x.png


BIN
resource/static/icon/classic/16@2x.png


BIN
resource/static/icon/classic/17@1x.png


BIN
resource/static/icon/classic/17@2x.png


BIN
resource/static/icon/classic/18@1x.png


BIN
resource/static/icon/classic/18@2x.png


BIN
resource/static/icon/classic/19@1x.png


+ 0 - 0
resource/static/icon/classic/19@2x.png


Some files were not shown because too many files changed in this diff