Browse Source

修复漏洞

xieshengjie 5 years ago
parent
commit
05503e97af
39 changed files with 779 additions and 592 deletions
  1. 3 0
      WebRoot/WEB-INF/classes/.gitignore
  2. 18 18
      WebRoot/WEB-INF/classes/applicationContext.xml
  3. BIN
      WebRoot/WEB-INF/classes/com/hcks/cmfds/service/MathsService$1.class
  4. BIN
      WebRoot/WEB-INF/classes/com/hcks/cmfds/service/MathsService.class
  5. 105 83
      WebRoot/WEB-INF/classes/struts.xml
  6. BIN
      WebRoot/WEB-INF/lib/asm-3.3.jar
  7. BIN
      WebRoot/WEB-INF/lib/asm-attrs.jar
  8. BIN
      WebRoot/WEB-INF/lib/asm-commons-3.3.jar
  9. BIN
      WebRoot/WEB-INF/lib/asm-tree-3.3.jar
  10. BIN
      WebRoot/WEB-INF/lib/asm.jar
  11. BIN
      WebRoot/WEB-INF/lib/cglib-2.1.3.jar
  12. BIN
      WebRoot/WEB-INF/lib/cglib-2.2.2.jar
  13. BIN
      WebRoot/WEB-INF/lib/commons-fileupload-1.2.1.jar
  14. BIN
      WebRoot/WEB-INF/lib/commons-fileupload-1.4.jar
  15. BIN
      WebRoot/WEB-INF/lib/commons-io-1.4.jar
  16. BIN
      WebRoot/WEB-INF/lib/commons-io-2.2.jar
  17. BIN
      WebRoot/WEB-INF/lib/commons-lang-2.4.jar
  18. BIN
      WebRoot/WEB-INF/lib/commons-lang3-3.2.jar
  19. BIN
      WebRoot/WEB-INF/lib/freemarker-2.3.13.jar
  20. BIN
      WebRoot/WEB-INF/lib/freemarker-2.3.28.jar
  21. BIN
      WebRoot/WEB-INF/lib/javassist-3.11.0.GA.jar
  22. BIN
      WebRoot/WEB-INF/lib/javassist.jar
  23. BIN
      WebRoot/WEB-INF/lib/ognl-2.6.11.jar
  24. BIN
      WebRoot/WEB-INF/lib/ognl-3.0.21.jar
  25. BIN
      WebRoot/WEB-INF/lib/struts2-config-browser-plugin-2.1.8.1.jar
  26. BIN
      WebRoot/WEB-INF/lib/struts2-config-browser-plugin-2.3.37.jar
  27. BIN
      WebRoot/WEB-INF/lib/struts2-convention-plugin-2.1.8.1.jar
  28. BIN
      WebRoot/WEB-INF/lib/struts2-convention-plugin-2.3.37.jar
  29. BIN
      WebRoot/WEB-INF/lib/struts2-core-2.1.8.1.jar
  30. BIN
      WebRoot/WEB-INF/lib/struts2-core-2.3.37.jar
  31. BIN
      WebRoot/WEB-INF/lib/struts2-sitemesh-plugin-2.1.8.1.jar
  32. BIN
      WebRoot/WEB-INF/lib/struts2-sitemesh-plugin-2.3.37.jar
  33. BIN
      WebRoot/WEB-INF/lib/struts2-spring-plugin-2.1.8.1.jar
  34. BIN
      WebRoot/WEB-INF/lib/struts2-spring-plugin-2.3.37.jar
  35. BIN
      WebRoot/WEB-INF/lib/xwork-core-2.1.6.jar
  36. BIN
      WebRoot/WEB-INF/lib/xwork-core-2.3.37.jar
  37. 119 80
      WebRoot/WEB-INF/web.xml
  38. 105 83
      configuration-src/struts.xml
  39. 429 328
      src/com/hcks/cmfds/service/MathsService.java

+ 3 - 0
WebRoot/WEB-INF/classes/.gitignore

@@ -0,0 +1,3 @@
+/applicationContext.xml
+/bean-config/
+/com/

+ 18 - 18
WebRoot/WEB-INF/classes/applicationContext.xml

@@ -1,18 +1,18 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<beans xmlns="http://www.springframework.org/schema/beans"
-	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
-	xmlns:p="http://www.springframework.org/schema/p"
-	xmlns:context="http://www.springframework.org/schema/context"
-	xsi:schemaLocation="http://www.springframework.org/schema/beans
-	http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
-    http://www.springframework.org/schema/context
-    http://www.springframework.org/schema/context/spring-context-3.0.xsd"
-	default-lazy-init="false" default-autowire="byName">
-	<bean class="com.hcks.cmfds.commons.util.BeanFactoryUtils" lazy-init="false" autowire="no"/>
-	<import resource="bean-config/context.xml"/>
-	<!-- <import resource="bean-config/job.xml"/> -->
-	<import resource="redis.xml"/>
-	<import resource="redis2.xml"/>
-	<context:component-scan base-package="com.hcks.cmfds"/>
-		 
-</beans>
+<?xml version="1.0" encoding="UTF-8" ?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+	xmlns:p="http://www.springframework.org/schema/p"
+	xmlns:context="http://www.springframework.org/schema/context"
+	xsi:schemaLocation="http://www.springframework.org/schema/beans
+	http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+    http://www.springframework.org/schema/context
+    http://www.springframework.org/schema/context/spring-context-3.0.xsd"
+	default-lazy-init="false" default-autowire="byName">
+	<bean class="com.hcks.cmfds.commons.util.BeanFactoryUtils" lazy-init="false" autowire="no"/>
+	<import resource="bean-config/context.xml"/>
+	<import resource="bean-config/job.xml"/>
+	<import resource="redis.xml"/>
+	<import resource="redis2.xml"/>
+	<context:component-scan base-package="com.hcks.cmfds"/>
+		 
+</beans>

BIN
WebRoot/WEB-INF/classes/com/hcks/cmfds/service/MathsService$1.class


BIN
WebRoot/WEB-INF/classes/com/hcks/cmfds/service/MathsService.class


+ 105 - 83
WebRoot/WEB-INF/classes/struts.xml

@@ -1,83 +1,105 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
-    "http://struts.apache.org/dtds/struts-2.1.7.dtd">
-
-<struts>
-
-<constant name="struts.devMode" value="false"></constant>
-<constant name="struts.objectFactory" value="spring"></constant>
-<constant name="struts.locale" value="zh_CN"></constant>
-<constant name="struts.i18n.encoding" value="utf-8"></constant>
-<constant name="struts.ui.theme" value="simple"></constant>
-<constant name="struts.custom.i18n.resources" value="globalMessages"></constant>
-<constant name="struts.multipart.maxSize" value="20971520"/>
-
-<constant name="struts.convention.result.path" value="/pages/"/>
-<constant name="struts.convention.classes.reload" value="true" /> 
-<constant name="struts.convention.default.parent.package" value="jeeweb-default"/>
-
-
-<package name="jeeweb-default" extends="convention-default">
-	<result-types> 
-        <result-type name="json" class="com.hcks.cmfds.core.web.PlainStringResult"></result-type> 
-    </result-types>
-        
- 	<interceptors>
- 	
- 		<interceptor class="com.hcks.cmfds.core.security.AuthenticationInterceptor" name="authenticate"/>
-   		
-		<interceptor-stack name="defaultStack">
-			<interceptor-ref name="exception"/> <!-- 引用异常映射拦截器 -->
-			<interceptor-ref name="servletConfig"/>
-			<interceptor-ref name="authenticate"/>  <!-- 引用自定义安全验证用户拦截器 -->
-			<interceptor-ref name="checkbox"/>
-			<interceptor-ref name="params">
-				<param name="excludeParams">.*\\u0023.*</param>  
-			</interceptor-ref>
-			<interceptor-ref name="conversionError"/> <!-- 引用类型转换拦截器 -->
-			<interceptor-ref name="chain" />
-			<interceptor-ref name="validation">
-			    <param name="excludeMethods">input,back,cancel,browse,load,list</param>
-			</interceptor-ref>
-			<interceptor-ref name="workflow">
-			    <param name="excludeMethods">input,back,cancel,browse,load,list</param>
-			</interceptor-ref>
-		</interceptor-stack>
-            
-            
-		<interceptor-stack name="fileUploadStack">
-		    <interceptor-ref name="fileUpload"/>
-		    <interceptor-ref name="defaultStack"/>
-		</interceptor-stack>
-            
-         <interceptor-stack name="tokenStack">
-         	<interceptor-ref name="token"/>
-            <interceptor-ref name="defaultStack"/>
-         </interceptor-stack>
-            
-         <interceptor-stack name="uploadStack">  
-             <interceptor-ref name="fileUpload">  
-                 <param name="maximumSize">20971520</param>  <!-- 20M=20*1024*1024 byte-->  
-             </interceptor-ref>  
-         </interceptor-stack>  
-         
-	</interceptors>
-
- 	<global-results>
- 		<result name="errorHandler" type="chain">
- 			<param name="actionName">error</param>
- 			<param name="namespace">/</param>
- 		</result>
- 		<result name="login" type="redirect">/index.action${#request.returnURL}</result>
- 	</global-results>
-
-
-	<global-exception-mappings>
-		<exception-mapping
-			exception="com.hcks.cmfds.core.security.AuthenticationException" result="invalid.permission" />
-		<exception-mapping exception="java.lang.Throwable" result="errorHandler" />
-	</global-exception-mappings>
- 
-</package>
-
- </struts>
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
+    "http://struts.apache.org/dtds/struts-2.1.7.dtd">
+
+<struts>
+
+	<constant name="struts.devMode" value="false"></constant>
+	<constant name="struts.objectFactory" value="spring"></constant>
+	<constant name="struts.locale" value="zh_CN"></constant>
+	<constant name="struts.i18n.encoding" value="utf-8"></constant>
+	<constant name="struts.ui.theme" value="simple"></constant>
+	<constant name="struts.custom.i18n.resources" value="globalMessages"></constant>
+	<constant name="struts.multipart.maxSize" value="20971520" />
+
+	<constant name="struts.convention.result.path" value="/pages/" />
+	<constant name="struts.convention.classes.reload" value="true" />
+	<constant name="struts.convention.default.parent.package"
+		value="jeeweb-default" />
+
+
+	<package name="jeeweb-default" extends="convention-default">
+		<result-types>
+			<result-type name="json"
+				class="com.hcks.cmfds.core.web.PlainStringResult"></result-type>
+		</result-types>
+
+		<interceptors>
+
+			<interceptor class="com.hcks.cmfds.core.security.AuthenticationInterceptor"
+				name="authenticate" />
+
+			 <interceptor-stack name="defaultStack">
+			<!--	<interceptor-ref name="exception" />  
+				<interceptor-ref name="servletConfig" />
+				<interceptor-ref name="authenticate" />   
+				<interceptor-ref name="checkbox" />
+				<interceptor-ref name="params">
+					<param name="excludeParams">.*\\u0023.*</param>
+				</interceptor-ref>
+				<interceptor-ref name="conversionError" />  
+				<interceptor-ref name="chain" />
+				<interceptor-ref name="validation">
+					<param name="excludeMethods">input,back,cancel,browse,load,list</param>
+				</interceptor-ref>
+				<interceptor-ref name="workflow">
+					<param name="excludeMethods">input,back,cancel,browse,load,list</param>
+				</interceptor-ref>
+ 		-->
+				<interceptor-ref name="exception" />
+				<interceptor-ref name="alias" />
+				<interceptor-ref name="servletConfig" />
+				<interceptor-ref name="prepare" />
+				<interceptor-ref name="i18n" />
+				<interceptor-ref name="chain" />
+				<interceptor-ref name="debugging" />
+				<interceptor-ref name="profiling" />
+				<interceptor-ref name="scopedModelDriven" />
+				<interceptor-ref name="modelDriven" />
+				<interceptor-ref name="fileUpload" />
+				<interceptor-ref name="checkbox" />
+				<interceptor-ref name="staticParams" />
+				<interceptor-ref name="params"/>
+				
+			</interceptor-stack>
+
+
+			<interceptor-stack name="fileUploadStack">
+				<interceptor-ref name="fileUpload" />
+				<interceptor-ref name="defaultStack" />
+			</interceptor-stack>
+
+			<interceptor-stack name="tokenStack">
+				<interceptor-ref name="token" />
+				<interceptor-ref name="defaultStack" />
+			</interceptor-stack>
+
+			<interceptor-stack name="uploadStack">
+				<interceptor-ref name="fileUpload">
+					<param name="maximumSize">20971520</param>  <!-- 20M=20*1024*1024 byte -->
+				</interceptor-ref>
+			</interceptor-stack>
+
+		</interceptors>
+
+		<global-results>
+			<result name="errorHandler" type="chain">
+				<param name="actionName">error</param>
+				<param name="namespace">/</param>
+			</result>
+			<result name="loginpage" type="redirect">/loginpage.action${#request.returnURL}
+			</result>
+		</global-results>
+
+
+		<global-exception-mappings>
+			<exception-mapping
+				exception="com.hcks.cmfds.core.security.AuthenticationException"
+				result="invalid.permission" />
+			<exception-mapping exception="java.lang.Throwable"
+				result="errorHandler" />
+		</global-exception-mappings>
+
+	</package>
+
+</struts>

BIN
WebRoot/WEB-INF/lib/asm-3.3.jar


BIN
WebRoot/WEB-INF/lib/asm-attrs.jar


BIN
WebRoot/WEB-INF/lib/asm-commons-3.3.jar


BIN
WebRoot/WEB-INF/lib/asm-tree-3.3.jar


BIN
WebRoot/WEB-INF/lib/asm.jar


BIN
WebRoot/WEB-INF/lib/cglib-2.1.3.jar


BIN
WebRoot/WEB-INF/lib/cglib-2.2.2.jar


BIN
WebRoot/WEB-INF/lib/commons-fileupload-1.2.1.jar


BIN
WebRoot/WEB-INF/lib/commons-fileupload-1.4.jar


BIN
WebRoot/WEB-INF/lib/commons-io-1.4.jar


BIN
WebRoot/WEB-INF/lib/commons-io-2.2.jar


BIN
WebRoot/WEB-INF/lib/commons-lang-2.4.jar


BIN
WebRoot/WEB-INF/lib/commons-lang3-3.2.jar


BIN
WebRoot/WEB-INF/lib/freemarker-2.3.13.jar


BIN
WebRoot/WEB-INF/lib/freemarker-2.3.28.jar


BIN
WebRoot/WEB-INF/lib/javassist-3.11.0.GA.jar


BIN
WebRoot/WEB-INF/lib/javassist.jar


BIN
WebRoot/WEB-INF/lib/ognl-2.6.11.jar


BIN
WebRoot/WEB-INF/lib/ognl-3.0.21.jar


BIN
WebRoot/WEB-INF/lib/struts2-config-browser-plugin-2.1.8.1.jar


BIN
WebRoot/WEB-INF/lib/struts2-config-browser-plugin-2.3.37.jar


BIN
WebRoot/WEB-INF/lib/struts2-convention-plugin-2.1.8.1.jar


BIN
WebRoot/WEB-INF/lib/struts2-convention-plugin-2.3.37.jar


BIN
WebRoot/WEB-INF/lib/struts2-core-2.1.8.1.jar


BIN
WebRoot/WEB-INF/lib/struts2-core-2.3.37.jar


BIN
WebRoot/WEB-INF/lib/struts2-sitemesh-plugin-2.1.8.1.jar


BIN
WebRoot/WEB-INF/lib/struts2-sitemesh-plugin-2.3.37.jar


BIN
WebRoot/WEB-INF/lib/struts2-spring-plugin-2.1.8.1.jar


BIN
WebRoot/WEB-INF/lib/struts2-spring-plugin-2.3.37.jar


BIN
WebRoot/WEB-INF/lib/xwork-core-2.1.6.jar


BIN
WebRoot/WEB-INF/lib/xwork-core-2.3.37.jar


+ 119 - 80
WebRoot/WEB-INF/web.xml

@@ -1,80 +1,119 @@
-<?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" version="2.5">
-  <description> system </description>
-  <context-param>
-    <param-name>contextConfigLocation</param-name>
-    <param-value>classpath*:applicationContext.xml</param-value>
-  </context-param>
-  <filter>
-    <filter-name>struts-cleanup</filter-name>
-    <filter-class>
-			org.apache.struts2.dispatcher.ActionContextCleanUp
-		</filter-class>
-  </filter>
-  <filter>
-    <filter-name>sitemesh</filter-name>
-    <filter-class>
-			com.opensymphony.module.sitemesh.filter.PageFilter
-		</filter-class>
-  </filter>
-  <filter-mapping>
-    <filter-name>sitemesh</filter-name>
-    <url-pattern>/*</url-pattern>
-  </filter-mapping>
-  <filter>
-    <filter-name>struts</filter-name>
-    <filter-class>
-			org.apache.struts2.dispatcher.FilterDispatcher
-		</filter-class>
-  </filter>
-  <filter-mapping>
-    <filter-name>struts-cleanup</filter-name>
-    <url-pattern>/*</url-pattern>
-  </filter-mapping>
-  <filter-mapping>
-    <filter-name>struts</filter-name>
-    <url-pattern>*.action</url-pattern>
-  </filter-mapping>
-  <context-param>
-    <param-name>log4jConfigLocation</param-name>
-    <param-value>/WEB-INF/classes/log4j.properties</param-value>
-  </context-param>
-  <listener>
-    <listener-class>
-	org.springframework.web.util.Log4jConfigListener
-	   </listener-class>
-  </listener>
-  <listener>
-    <listener-class>
-			org.springframework.web.context.ContextLoaderListener
-		</listener-class>
-  </listener>
-  <listener>
-    <listener-class>
-			org.springframework.web.context.request.RequestContextListener
-		</listener-class>
-  </listener>
-  <listener>
-    <listener-class>
-			org.springframework.web.util.IntrospectorCleanupListener
-		</listener-class>
-  </listener>
-  <session-config>
-    <session-timeout>60</session-timeout>
-  </session-config>
-  <error-page>
-    <error-code>404</error-code>
-    <location>/pages/error/404.jsp</location>
-  </error-page>
-  <error-page>
-    <error-code>403</error-code>
-    <location>/pages/error/403.jsp</location>
-  </error-page>
-  <error-page>
-    <error-code>500</error-code>
-    <location>/pages/error/500.jsp</location>
-  </error-page>
-  <welcome-file-list>
-    <welcome-file>index.jsp</welcome-file>
-  </welcome-file-list>
-</web-app>
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app version="2.5" 
+	xmlns="http://java.sun.com/xml/ns/javaee" 
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+	xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 
+	http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
+
+  	 <description> system </description>
+  <context-param>
+    <param-name>contextConfigLocation</param-name>
+    <param-value>classpath*:applicationContext.xml</param-value>
+  </context-param>
+  <!--  去除
+  <filter>
+    <filter-name>struts-cleanup</filter-name>
+    <filter-class>
+			org.apache.struts2.dispatcher.ActionContextCleanUp
+		</filter-class>
+  </filter>
+  
+  <filter>
+    <filter-name>struts</filter-name>
+    <filter-class>
+			org.apache.struts2.dispatcher.FilterDispatcher
+		</filter-class>
+  </filter>
+  <filter-mapping>
+    <filter-name>struts-cleanup</filter-name>
+    <url-pattern>/*</url-pattern>
+  </filter-mapping>
+  <filter-mapping>
+    <filter-name>struts</filter-name>
+    <url-pattern>*.action</url-pattern>
+  </filter-mapping>
+  -->
+  <filter>
+    <filter-name>sitemesh</filter-name>
+    <filter-class>
+			com.opensymphony.module.sitemesh.filter.PageFilter
+		</filter-class>
+  </filter>
+  <filter-mapping>
+    <filter-name>sitemesh</filter-name>
+    <url-pattern>/*</url-pattern>
+  </filter-mapping>
+   <filter>
+         <filter-name>struts-prepare</filter-name>
+         <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareFilter</filter-class>
+    </filter>
+    <filter-mapping>
+         <filter-name>struts-prepare</filter-name>
+         <url-pattern>/*</url-pattern>
+    </filter-mapping>
+     
+    <filter>
+        <filter-name>struts-execute</filter-name>
+        <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsExecuteFilter</filter-class>
+    </filter>
+    <filter-mapping>
+        <filter-name>struts-execute</filter-name>
+        <url-pattern>/*</url-pattern>
+    </filter-mapping>
+
+    <filter>
+        <filter-name>struts</filter-name>
+        <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
+    </filter>
+    
+    <filter-mapping>
+        <filter-name>struts</filter-name>
+        <url-pattern>/*</url-pattern>
+        <dispatcher>REQUEST</dispatcher>
+        <dispatcher>FORWARD</dispatcher>
+    </filter-mapping>
+  <listener>
+    <listener-class>
+			org.springframework.web.context.ContextLoaderListener
+		</listener-class>
+  </listener>
+  <listener>
+    <listener-class>
+			org.springframework.web.context.request.RequestContextListener
+		</listener-class>
+  </listener>
+  <listener>
+    <listener-class>
+			org.springframework.web.util.IntrospectorCleanupListener
+		</listener-class>
+  </listener>
+  <session-config>
+    <session-timeout>60</session-timeout>
+  </session-config>
+  <error-page>
+    <error-code>404</error-code>
+    <location>/pages/error/404.jsp</location>
+  </error-page>
+  <error-page>
+    <error-code>403</error-code>
+    <location>/pages/error/403.jsp</location>
+  </error-page>
+  <error-page>
+    <error-code>500</error-code>
+    <location>/pages/error/500.jsp</location>
+  </error-page>
+
+  <welcome-file-list>
+    <welcome-file>index.jsp</welcome-file>
+  </welcome-file-list>
+ <!-- <servlet>
+    <servlet-name>ReportServer</servlet-name>
+    <servlet-class>com.fr.web.ReportServlet</servlet-class>
+    <load-on-startup>0</load-on-startup>
+  </servlet>
+  <servlet-mapping>
+    <servlet-name>ReportServer</servlet-name>
+    <url-pattern>/ReportServer</url-pattern>
+  </servlet-mapping>-->
+
+</web-app>

+ 105 - 83
configuration-src/struts.xml

@@ -1,83 +1,105 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
-    "http://struts.apache.org/dtds/struts-2.1.7.dtd">
-
-<struts>
-
-<constant name="struts.devMode" value="false"></constant>
-<constant name="struts.objectFactory" value="spring"></constant>
-<constant name="struts.locale" value="zh_CN"></constant>
-<constant name="struts.i18n.encoding" value="utf-8"></constant>
-<constant name="struts.ui.theme" value="simple"></constant>
-<constant name="struts.custom.i18n.resources" value="globalMessages"></constant>
-<constant name="struts.multipart.maxSize" value="20971520"/>
-
-<constant name="struts.convention.result.path" value="/pages/"/>
-<constant name="struts.convention.classes.reload" value="true" /> 
-<constant name="struts.convention.default.parent.package" value="jeeweb-default"/>
-
-
-<package name="jeeweb-default" extends="convention-default">
-	<result-types> 
-        <result-type name="json" class="com.hcks.cmfds.core.web.PlainStringResult"></result-type> 
-    </result-types>
-        
- 	<interceptors>
- 	
- 		<interceptor class="com.hcks.cmfds.core.security.AuthenticationInterceptor" name="authenticate"/>
-   		
-		<interceptor-stack name="defaultStack">
-			<interceptor-ref name="exception"/> <!-- 引用异常映射拦截器 -->
-			<interceptor-ref name="servletConfig"/>
-			<interceptor-ref name="authenticate"/>  <!-- 引用自定义安全验证用户拦截器 -->
-			<interceptor-ref name="checkbox"/>
-			<interceptor-ref name="params">
-				<param name="excludeParams">.*\\u0023.*</param>  
-			</interceptor-ref>
-			<interceptor-ref name="conversionError"/> <!-- 引用类型转换拦截器 -->
-			<interceptor-ref name="chain" />
-			<interceptor-ref name="validation">
-			    <param name="excludeMethods">input,back,cancel,browse,load,list</param>
-			</interceptor-ref>
-			<interceptor-ref name="workflow">
-			    <param name="excludeMethods">input,back,cancel,browse,load,list</param>
-			</interceptor-ref>
-		</interceptor-stack>
-            
-            
-		<interceptor-stack name="fileUploadStack">
-		    <interceptor-ref name="fileUpload"/>
-		    <interceptor-ref name="defaultStack"/>
-		</interceptor-stack>
-            
-         <interceptor-stack name="tokenStack">
-         	<interceptor-ref name="token"/>
-            <interceptor-ref name="defaultStack"/>
-         </interceptor-stack>
-            
-         <interceptor-stack name="uploadStack">  
-             <interceptor-ref name="fileUpload">  
-                 <param name="maximumSize">20971520</param>  <!-- 20M=20*1024*1024 byte-->  
-             </interceptor-ref>  
-         </interceptor-stack>  
-         
-	</interceptors>
-
- 	<global-results>
- 		<result name="errorHandler" type="chain">
- 			<param name="actionName">error</param>
- 			<param name="namespace">/</param>
- 		</result>
- 		<result name="login" type="redirect">/index.action${#request.returnURL}</result>
- 	</global-results>
-
-
-	<global-exception-mappings>
-		<exception-mapping
-			exception="com.hcks.cmfds.core.security.AuthenticationException" result="invalid.permission" />
-		<exception-mapping exception="java.lang.Throwable" result="errorHandler" />
-	</global-exception-mappings>
- 
-</package>
-
- </struts>
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
+    "http://struts.apache.org/dtds/struts-2.1.7.dtd">
+
+<struts>
+
+	<constant name="struts.devMode" value="false"></constant>
+	<constant name="struts.objectFactory" value="spring"></constant>
+	<constant name="struts.locale" value="zh_CN"></constant>
+	<constant name="struts.i18n.encoding" value="utf-8"></constant>
+	<constant name="struts.ui.theme" value="simple"></constant>
+	<constant name="struts.custom.i18n.resources" value="globalMessages"></constant>
+	<constant name="struts.multipart.maxSize" value="20971520" />
+
+	<constant name="struts.convention.result.path" value="/pages/" />
+	<constant name="struts.convention.classes.reload" value="true" />
+	<constant name="struts.convention.default.parent.package"
+		value="jeeweb-default" />
+
+
+	<package name="jeeweb-default" extends="convention-default">
+		<result-types>
+			<result-type name="json"
+				class="com.hcks.cmfds.core.web.PlainStringResult"></result-type>
+		</result-types>
+
+		<interceptors>
+
+			<interceptor class="com.hcks.cmfds.core.security.AuthenticationInterceptor"
+				name="authenticate" />
+
+			 <interceptor-stack name="defaultStack">
+			<!--	<interceptor-ref name="exception" />  
+				<interceptor-ref name="servletConfig" />
+				<interceptor-ref name="authenticate" />   
+				<interceptor-ref name="checkbox" />
+				<interceptor-ref name="params">
+					<param name="excludeParams">.*\\u0023.*</param>
+				</interceptor-ref>
+				<interceptor-ref name="conversionError" />  
+				<interceptor-ref name="chain" />
+				<interceptor-ref name="validation">
+					<param name="excludeMethods">input,back,cancel,browse,load,list</param>
+				</interceptor-ref>
+				<interceptor-ref name="workflow">
+					<param name="excludeMethods">input,back,cancel,browse,load,list</param>
+				</interceptor-ref>
+ 		-->
+				<interceptor-ref name="exception" />
+				<interceptor-ref name="alias" />
+				<interceptor-ref name="servletConfig" />
+				<interceptor-ref name="prepare" />
+				<interceptor-ref name="i18n" />
+				<interceptor-ref name="chain" />
+				<interceptor-ref name="debugging" />
+				<interceptor-ref name="profiling" />
+				<interceptor-ref name="scopedModelDriven" />
+				<interceptor-ref name="modelDriven" />
+				<interceptor-ref name="fileUpload" />
+				<interceptor-ref name="checkbox" />
+				<interceptor-ref name="staticParams" />
+				<interceptor-ref name="params"/>
+				
+			</interceptor-stack>
+
+
+			<interceptor-stack name="fileUploadStack">
+				<interceptor-ref name="fileUpload" />
+				<interceptor-ref name="defaultStack" />
+			</interceptor-stack>
+
+			<interceptor-stack name="tokenStack">
+				<interceptor-ref name="token" />
+				<interceptor-ref name="defaultStack" />
+			</interceptor-stack>
+
+			<interceptor-stack name="uploadStack">
+				<interceptor-ref name="fileUpload">
+					<param name="maximumSize">20971520</param>  <!-- 20M=20*1024*1024 byte -->
+				</interceptor-ref>
+			</interceptor-stack>
+
+		</interceptors>
+
+		<global-results>
+			<result name="errorHandler" type="chain">
+				<param name="actionName">error</param>
+				<param name="namespace">/</param>
+			</result>
+			<result name="loginpage" type="redirect">/loginpage.action${#request.returnURL}
+			</result>
+		</global-results>
+
+
+		<global-exception-mappings>
+			<exception-mapping
+				exception="com.hcks.cmfds.core.security.AuthenticationException"
+				result="invalid.permission" />
+			<exception-mapping exception="java.lang.Throwable"
+				result="errorHandler" />
+		</global-exception-mappings>
+
+	</package>
+
+</struts>

+ 429 - 328
src/com/hcks/cmfds/service/MathsService.java

@@ -1,328 +1,429 @@
-/** 
- * Project Name:nxfd2 
- * File Name:MathsService.java 
- * Package Name:com.hcks.cmfds.service 
- * Date:2016-7-22上午08:43:26 
- * Copyright (c) 2016, chenzhou1025@126.com All Rights Reserved. 
- * 
- */
-
-package com.hcks.cmfds.service;
-
-import java.math.BigDecimal;
-import java.math.RoundingMode;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.util.ArrayList;
-import java.util.Calendar;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.struts2.components.Else;
-import org.springframework.jdbc.core.RowMapper;
-import org.springframework.stereotype.Service;
-import com.hcks.cmfds.Constant;
-import com.hcks.cmfds.commons.util.StringUtils;
-import com.hcks.cmfds.core.persistence.GenericJdbcDao;
-import com.hcks.cmfds.model.Activepowerdata;
-import com.hcks.cmfds.model.WindPowerStationTestingPoint;
-import com.hcks.cmfds.util.EdosUtil;
-import com.hcks.cmfds.util.IEdosUtil;
-import com.hcks.cmfds.util.edos.PointData;
-import com.hcks.cmfds.vo.DataVo;
-import com.hcks.cmfds.vo.StatisticalAnalysisTopVo;
-
-/**
- * ClassName:MathsService <br/>
- * Function: TODO ADD FUNCTION. <br/>
- * Reason: TODO ADD REASON. <br/>
- * Date: 2016-7-22 上午08:43:26 <br/>
- * 
- * @author 石林
- * @version
- * @since JDK 1.6
- * @see
- */
-@Service
-public class MathsService extends GenericJdbcDao<Activepowerdata> {
-    private IEdosUtil ednaApiUtil = new EdosUtil();
-
-  public Map<String,String> getResultValue(String wpid, Date begin, Date end) throws Exception
-  {
-	  Map<String,String> resultmap=new HashMap<String, String>();
-	  Map<String, Map<String, WindPowerStationTestingPoint>> map=CacheContext.stationPointmap;
-	  double sfdl=0.0;
-	  double yffdl=0.0;
-	  double xddl=0.0;
-	  double dwsl=0.0;
-	  double tqsl=0.0;
-	  
-	  double sfdlxs=0.0;
-	  double yffdlxs=0.0;
-	  double xddlxs=0.0;
-	  double dwslxs=0.0;
-	  double tqslxs=0.0;
-	  double zjrl=0.0;
-	  double result=0.0;
-	  
-	  
-	 
-	  
-      if(map.containsKey(wpid))
-      {
-		if(CacheContext.wpmap.containsKey(wpid))
-      	{
-      		zjrl=CacheContext.wpmap.get(wpid).getCapacity();
-      	}
-      	Map<String, WindPowerStationTestingPoint> wpmap=map.get(wpid);
-      	
-//      	Calendar c = Calendar.getInstance();
-//      	int year= c.get(Calendar.YEAR);
-//      	int month= c.get(Calendar.MONTH);
-//      	c.setTime(begin);
-      	String b =StringUtils.formatDate(begin).substring(6, 7);
-      	String y =StringUtils.formatDate(end).substring(0, 4);
-      	String bnow = StringUtils.formatDate(new Date()).substring(6, 7);
-      	String ynow = StringUtils.formatDate(new Date()).substring(0, 4);
-      	 if(Integer.parseInt(b)==Integer.parseInt(bnow) && Integer.parseInt(y)==Integer.parseInt(ynow))
-      	 {
-      		getRealInfo(resultmap, sfdlxs, yffdlxs, xddlxs, dwslxs, tqslxs, zjrl,
-    				result, wpmap);
-      	 }else
-      	 {
-      		getHistInfo(begin, end, resultmap, sfdl, yffdl, xddl, dwsl, tqsl,
-					sfdlxs, yffdlxs, xddlxs, dwslxs, tqslxs, zjrl, result,
-					wpmap);
-      	 }
-      
-      }
-	  return resultmap;
-  }
-
-private void getHistInfo(Date begin, Date end, Map<String, String> resultmap,
-		double sfdl, double yffdl, double xddl, double dwsl, double tqsl,
-		double sfdlxs, double yffdlxs, double xddlxs, double dwslxs,
-		double tqslxs, double zjrl, double result,
-		Map<String, WindPowerStationTestingPoint> wpmap) throws Exception {
-	List<PointData>  ls = ednaApiUtil.getHistoryDatasSnap(wpmap.get(
-			Constant.TPOINT_WP_YFDL),
-			begin.getTime() / 1000,
-			end.getTime() / 1000, 1L, 1L);
-	 if(!ls.isEmpty())
-	 {
-		sfdl=ls.get(0).getPointValueInDouble();
-	 }
-	 
-	ls = ednaApiUtil.getHistoryDatasSnap(wpmap.get(
-			Constant.TPOINT_WP_YFDLD),
-			begin.getTime() / 1000,
-			end.getTime() / 1000, 1L, 1L);
-	 if(!ls.isEmpty())
-	 {
-		sfdl=ls.get(0).getPointValueInDouble();
-	 }
-	 
-	ls = ednaApiUtil.getHistoryDatasSnap(wpmap.get(
-			Constant.YXDSSDL),
-			begin.getTime() / 1000,
-			end.getTime() / 1000, 1L, 1L);
-	 if(!ls.isEmpty())
-	 {
-		yffdl=ls.get(0).getPointValueInDouble();
-	 }
-	ls = ednaApiUtil.getHistoryDatasSnap(wpmap.get(
-			Constant.YWZSSDL),
-			begin.getTime() / 1000,
-			end.getTime() / 1000, 1L, 1L);
-	 if(!ls.isEmpty())
-	 {
-		dwsl=ls.get(0).getPointValueInDouble();
-	 }
-	ls = ednaApiUtil.getHistoryDatasSnap(wpmap.get(
-			Constant.YTZSSDL),
-			begin.getTime() / 1000,
-			end.getTime() / 1000, 1L, 1L);
-	 if(!ls.isEmpty())
-	 {
-		tqsl=ls.get(0).getPointValueInDouble();
-	 }
-	sfdl = new BigDecimal(sfdl).divide(new BigDecimal(10000), 2,RoundingMode.HALF_EVEN).doubleValue(); 
-	yffdl = new BigDecimal(yffdl).divide(new BigDecimal(10000), 2,RoundingMode.HALF_EVEN).doubleValue();
-	xddl = new BigDecimal(xddl).divide(new BigDecimal(10000), 2,RoundingMode.HALF_EVEN).doubleValue();
-	dwsl = new BigDecimal(dwsl).divide(new BigDecimal(10000), 2,RoundingMode.HALF_EVEN).doubleValue();
-	tqsl = new BigDecimal(tqsl).divide(new BigDecimal(10000), 2,RoundingMode.HALF_EVEN).doubleValue();
-	zjrl = new BigDecimal(zjrl).divide(new BigDecimal(10), 2,RoundingMode.HALF_EVEN).doubleValue();
-
-	 
-	if(zjrl!=0.0)
-	{
-		sfdlxs = new BigDecimal(sfdl).divide(new BigDecimal(zjrl), 2,RoundingMode.HALF_EVEN).doubleValue();
-				
-		yffdlxs = new BigDecimal(yffdl).divide(new BigDecimal(zjrl), 2,RoundingMode.HALF_EVEN).doubleValue();
-	    	
-		xddlxs = new BigDecimal(xddl).divide(new BigDecimal(zjrl), 2,RoundingMode.HALF_EVEN).doubleValue();
-	    		
-		dwslxs = new BigDecimal(dwsl).divide(new BigDecimal(zjrl), 2,RoundingMode.HALF_EVEN).doubleValue();
-	    	
-		tqslxs = new BigDecimal(tqsl).divide(new BigDecimal(zjrl), 2,RoundingMode.HALF_EVEN).doubleValue();
-	   
-	}
-	
-
-	if((yffdlxs-xddlxs-dwslxs-tqslxs)>0)
-	{
-		result=new BigDecimal(yffdlxs-sfdlxs-xddlxs-dwslxs-tqslxs).divide(new BigDecimal(yffdlxs-xddlxs-dwslxs-tqslxs), 2,RoundingMode.HALF_EVEN)
-			.multiply(new BigDecimal(100)).doubleValue();
-	}
-	
-	resultmap.put("sfdl", String.valueOf(sfdl));
-	resultmap.put("yffdl", String.valueOf(yffdl));
-	resultmap.put("xddl", String.valueOf(xddl));
-	resultmap.put("dwsl", String.valueOf(dwsl));
-	resultmap.put("tqsl", String.valueOf(tqsl));
-	resultmap.put("zjrl", String.valueOf(zjrl));
-	resultmap.put("result", String.valueOf(result));
-}
-
-private void getRealInfo(Map<String, String> resultmap, double sfdlxs,
-		double yffdlxs, double xddlxs, double dwslxs, double tqslxs,
-		double zjrl, double result,
-		Map<String, WindPowerStationTestingPoint> wpmap) throws Exception {
-	double sfdl;
-	double yffdl;
-	double xddl;
-	double dwsl;
-	double tqsl;
-	sfdl = ednaApiUtil.getRealData(wpmap.get(
-						Constant.TPOINT_WP_YFDL))
-				.getPointValueInDouble();//获得月发电量
-	yffdl = ednaApiUtil.getRealData(wpmap.get(
-						Constant.TPOINT_WP_YFDLD))
-				.getPointValueInDouble();//获得月应发发电量
-	xddl = ednaApiUtil.getRealData(wpmap.get(
-						Constant.YXDSSDL))
-				.getPointValueInDouble();//获得月限电发电量
-	dwsl = ednaApiUtil.getRealData(wpmap.get(
-						Constant.YWZSSDL))
-				.getPointValueInDouble();//获得月电网受累电量
-	tqsl = ednaApiUtil.getRealData(wpmap.get(
-						Constant.YTZSSDL))
-				.getPointValueInDouble();//获得月天气受累电量
-	yffdl = new BigDecimal(yffdl).divide(new BigDecimal(10000), 2,RoundingMode.HALF_EVEN).doubleValue();
-	xddl = new BigDecimal(xddl).divide(new BigDecimal(10000), 2,RoundingMode.HALF_EVEN).doubleValue();
-	dwsl = new BigDecimal(dwsl).divide(new BigDecimal(10000), 2,RoundingMode.HALF_EVEN).doubleValue();
-	tqsl = new BigDecimal(tqsl).divide(new BigDecimal(10000), 2,RoundingMode.HALF_EVEN).doubleValue();
-	zjrl = new BigDecimal(zjrl).divide(new BigDecimal(10), 2,RoundingMode.HALF_EVEN).doubleValue();
-
-     
-	if(zjrl!=0.0)
-	{
-		sfdlxs = new BigDecimal(sfdl).divide(new BigDecimal(zjrl), 2,RoundingMode.HALF_EVEN).doubleValue();
-				
-		yffdlxs = new BigDecimal(yffdl).divide(new BigDecimal(zjrl), 2,RoundingMode.HALF_EVEN).doubleValue();
-	    	
-		xddlxs = new BigDecimal(xddl).divide(new BigDecimal(zjrl), 2,RoundingMode.HALF_EVEN).doubleValue();
-	    		
-		dwslxs = new BigDecimal(dwsl).divide(new BigDecimal(zjrl), 2,RoundingMode.HALF_EVEN).doubleValue();
-	    	
-		tqslxs = new BigDecimal(tqsl).divide(new BigDecimal(zjrl), 2,RoundingMode.HALF_EVEN).doubleValue();
-	   
-	}
-	
-
-	if((yffdlxs-xddlxs-dwslxs-tqslxs)>0)
-	{
-		result=new BigDecimal(yffdlxs-sfdlxs-xddlxs-dwslxs-tqslxs).divide(new BigDecimal(yffdlxs-xddlxs-dwslxs-tqslxs), 2,RoundingMode.HALF_EVEN)
-			.multiply(new BigDecimal(100)).doubleValue();
-	}
-	
-	resultmap.put("sfdl", String.valueOf(sfdl));
-	resultmap.put("yffdl", String.valueOf(yffdl));
-	resultmap.put("xddl", String.valueOf(xddl));
-	resultmap.put("dwsl", String.valueOf(dwsl));
-	resultmap.put("tqsl", String.valueOf(tqsl));
-	resultmap.put("zjrl", String.valueOf(zjrl));
-	resultmap.put("result", String.valueOf(result));
-}
-public Map<String, String> getResultValue1(String wpid, String year,String month) throws Exception {
-	double sfdl=0.0;
-	 double yffdl=0.0;
-	 double xddl=0.0;
-	 double dwsl=0.0;
-	 double tqsl=0.0;
-	double zjrl=0.0;
-	/*if (month != "10" && month!="11" && month!="12") {
-		month="0"+month;
-	}*/
-	Map<String,String> resultmap=new HashMap<String, String>();
-	if(CacheContext.wpmap.containsKey(wpid))
-  	{
-  		zjrl=CacheContext.wpmap.get(wpid).getCapacity();
-  	}
-	List<Object> objs = new ArrayList<Object>();
-	String sql = "select SUM(t.generatingCapacity2) yfdl,SUM(t.theoryGeneration) llfdl,SUM(t.dayNHXDSSDL) xdssdl from rp_wtday t where substr(t.RQ,0,6)='"+year+month+"' ";
-	if (null != wpid) {
-		sql += " and t.windpowerstationid='"+wpid+"'";
-	}
-	
-	
-	@SuppressWarnings("unchecked")
-	List<DataVo> retValue = operate.query(sql, objs.toArray(new Object[0]), new RowMapper() {
-		@Override
-		public Object mapRow(ResultSet rs, int rowNum) throws SQLException {
-			DataVo vo = new DataVo();
-			vo.setValue1(rs.getDouble("yfdl"));
-			vo.setValue2(rs.getDouble("llfdl"));
-			vo.setValue3(rs.getDouble("xdssdl"));
-			vo.setValue4(0.0);
-			vo.setValue5(0.0);
-			return vo;
-		}
-	});
-	sfdl =  retValue.get(0).getValue1();
-	yffdl = retValue.get(0).getValue2();
-	xddl = retValue.get(0).getValue3();
-	dwsl =0.0;
-	tqsl =0.0;
-	
-	
-	zjrl = new BigDecimal(zjrl).divide(new BigDecimal(10), 2,RoundingMode.HALF_EVEN).doubleValue();
-	double sfdlxs;
-	double yffdlxs;
-	double xddlxs;
-	double dwslxs;
-	double tqslxs;
-	double result = 0;
-     
-	
-		sfdlxs = new BigDecimal(sfdl).divide(new BigDecimal(zjrl), 2,RoundingMode.HALF_EVEN).doubleValue();
-				
-		yffdlxs = new BigDecimal(yffdl).divide(new BigDecimal(zjrl), 2,RoundingMode.HALF_EVEN).doubleValue();
-	    	
-		xddlxs = new BigDecimal(xddl).divide(new BigDecimal(zjrl), 2,RoundingMode.HALF_EVEN).doubleValue();
-	    		
-		dwslxs = new BigDecimal(dwsl).divide(new BigDecimal(zjrl), 2,RoundingMode.HALF_EVEN).doubleValue();
-	    	
-		tqslxs = new BigDecimal(tqsl).divide(new BigDecimal(zjrl), 2,RoundingMode.HALF_EVEN).doubleValue();
-	   
-	
-	
-
-	if((yffdlxs-xddlxs-dwslxs-tqslxs)>0)
-	{
-		result=Math.round((yffdlxs-sfdlxs-xddlxs-dwslxs-tqslxs)/(yffdlxs-xddlxs-dwslxs-tqslxs)*100);
-			
-	}
-	
-	resultmap.put("sfdl", String.valueOf(sfdl));
-	resultmap.put("yffdl", String.valueOf(yffdl));
-	resultmap.put("xddl", String.valueOf(xddl));
-	resultmap.put("dwsl", String.valueOf(dwsl));
-	resultmap.put("tqsl", String.valueOf(tqsl));
-	resultmap.put("zjrl", String.valueOf(zjrl));
-	resultmap.put("result", String.valueOf(result));
-	return resultmap;
-}
-}
+/** 
+ * Project Name:nxfd2 
+ * File Name:MathsService.java 
+ * Package Name:com.hcks.cmfds.service 
+ * Date:2016-7-22上午08:43:26 
+ * Copyright (c) 2016, chenzhou1025@126.com All Rights Reserved. 
+ * 
+ */
+
+package com.hcks.cmfds.service;
+
+import java.math.BigDecimal;
+import java.math.RoundingMode;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.springframework.jdbc.core.RowMapper;
+import org.springframework.stereotype.Service;
+
+import com.hcks.cmfds.Constant;
+import com.hcks.cmfds.commons.util.StringUtils;
+import com.hcks.cmfds.core.persistence.GenericJdbcDao;
+import com.hcks.cmfds.model.Activepowerdata;
+import com.hcks.cmfds.model.WindPowerStationTestingPoint;
+import com.hcks.cmfds.util.EdosUtil;
+import com.hcks.cmfds.util.IEdosUtil;
+import com.hcks.cmfds.util.edos.PointData;
+import com.hcks.cmfds.vo.DataVo;
+
+/**
+ * ClassName:MathsService <br/>
+ * Function: TODO ADD FUNCTION. <br/>
+ * Reason: TODO ADD REASON. <br/>
+ * Date: 2016-7-22 上午08:43:26 <br/>
+ * 
+ * @author 石林
+ * @version
+ * @since JDK 1.6
+ * @see
+ */
+@Service
+public class MathsService extends GenericJdbcDao<Activepowerdata> {
+    private IEdosUtil ednaApiUtil = new EdosUtil();
+
+  public Map<String,String> getResultValue(String wpid, Date begin, Date end) throws Exception
+  {
+	  Map<String,String> resultmap=new HashMap<String, String>();
+	  Map<String, Map<String, WindPowerStationTestingPoint>> map=CacheContext.stationPointmap;
+	  double sfdl=0.0;
+	  double yffdl=0.0;
+	  double xddl=0.0;
+	  double dwsl=0.0;
+	  double tqsl=0.0;
+	  
+	  double sfdlxs=0.0;
+	  double yffdlxs=0.0;
+	  double xddlxs=0.0;
+	  double dwslxs=0.0;
+	  double tqslxs=0.0;
+	  double zjrl=0.0;
+	  double result=0.0;
+	  
+	  
+	 
+	  
+      if(map.containsKey(wpid))
+      {
+		if(CacheContext.wpmap.containsKey(wpid))
+      	{
+      		zjrl=CacheContext.wpmap.get(wpid).getCapacity();
+      	}
+      	Map<String, WindPowerStationTestingPoint> wpmap=map.get(wpid);
+      	
+//      	Calendar c = Calendar.getInstance();
+//      	int year= c.get(Calendar.YEAR);
+//      	int month= c.get(Calendar.MONTH);
+//      	c.setTime(begin);
+      	String b =StringUtils.formatDate(begin).substring(6, 7);
+      	String y =StringUtils.formatDate(end).substring(0, 4);
+      	String bnow = StringUtils.formatDate(new Date()).substring(6, 7);
+      	String ynow = StringUtils.formatDate(new Date()).substring(0, 4);
+      	 if(Integer.parseInt(b)==Integer.parseInt(bnow) && Integer.parseInt(y)==Integer.parseInt(ynow))
+      	 {
+      		getRealInfo(resultmap, sfdlxs, yffdlxs, xddlxs, dwslxs, tqslxs, zjrl,
+    				result, wpmap);
+      	 }else
+      	 {
+      		getHistInfo(begin, end, resultmap, sfdl, yffdl, xddl, dwsl, tqsl,
+					sfdlxs, yffdlxs, xddlxs, dwslxs, tqslxs, zjrl, result,
+					wpmap);
+      	 }
+      
+      }
+	  return resultmap;
+  }
+
+private void getHistInfo(Date begin, Date end, Map<String, String> resultmap,
+		double sfdl, double yffdl, double xddl, double dwsl, double tqsl,
+		double sfdlxs, double yffdlxs, double xddlxs, double dwslxs,
+		double tqslxs, double zjrl, double result,
+		Map<String, WindPowerStationTestingPoint> wpmap) throws Exception {
+	List<PointData>  ls = ednaApiUtil.getHistoryDatasSnap(wpmap.get(
+			Constant.TPOINT_WP_YFDL),
+			begin.getTime() / 1000,
+			end.getTime() / 1000, 1L, 1L);
+		List<PointData> ls1;
+		List<PointData> ls2;
+		List<PointData> ls3;
+	 if(!ls.isEmpty())
+	 {
+		sfdl=ls.get(0).getPointValueInDouble();
+	 }
+	 
+		/*
+		 * ls = ednaApiUtil.getHistoryDatasSnap(wpmap.get(
+		 * Constant.TPOINT_WP_YFDLD), begin.getTime() / 1000, end.getTime() /
+		 * 1000, 1L, 1L); if(!ls.isEmpty()) {
+		 * sfdl=ls.get(0).getPointValueInDouble(); }
+		 */
+		/*
+		 * public static final String YSDJZSDL = "YSDJZSDL"; public static final
+		 * String YSSTZSDL = "YSSTZSDL"; public static final String YXNZSDL =
+		 * "YXNZSDL"; public static final String YSQXZSDL = "YSQXZSDL"; public
+		 * static final String YGZZSDL = "YGZZSDL"; public static final String
+		 * YSZZSDL = "YSZZSDL"; public static final String YJXZSDL = "YJXZSDL";
+		 * public static final String YLZZSDL = "YLZZSDL"; public static final
+		 * String YQFZSDL = "YQFZSDL"; public static final String YXDZSDL =
+		 * "YXDZSDL"; public static final String YWZZSDL = "YWZZSDL"; public
+		 * static final String YTZZSDL = "YTZZSDL";
+		 */
+		double temp;
+		double gzdl = 0;
+		double whdl = 0;
+		double xndl = 0;
+	ls = ednaApiUtil.getHistoryDatasSnap(wpmap.get(
+Constant.YXDZSDL),
+				begin.getTime() / 1000, end.getTime() / 1000, 1L, 1L);
+		ls1 = ednaApiUtil.getHistoryDatasSnap(wpmap.get(Constant.YXDZSDL),
+			begin.getTime() / 1000,
+			end.getTime() / 1000, 1L, 1L);
+	 if(!ls.isEmpty())
+	 {
+			xddl = ls.get(0).getPointValueInDouble();
+	 }
+		if (!ls1.isEmpty()) {
+			temp = ls1.get(0).getPointValueInDouble();
+			xddl = xddl + temp;
+		}
+
+		ls = ednaApiUtil.getHistoryDatasSnap(wpmap.get(Constant.YGZZSDL),
+				begin.getTime() / 1000, end.getTime() / 1000, 1L, 1L);
+		ls1 = ednaApiUtil.getHistoryDatasSnap(wpmap.get(Constant.YSZZSDL),
+				begin.getTime() / 1000, end.getTime() / 1000, 1L, 1L);
+		if (!ls.isEmpty()) {
+			gzdl = ls.get(0).getPointValueInDouble();
+		}
+		if (!ls1.isEmpty()) {
+			temp = ls1.get(0).getPointValueInDouble();
+			gzdl = gzdl + temp;
+		}
+
+		ls = ednaApiUtil.getHistoryDatasSnap(wpmap.get(Constant.YJXZSDL),
+				begin.getTime() / 1000, end.getTime() / 1000, 1L, 1L);
+		ls1 = ednaApiUtil.getHistoryDatasSnap(wpmap.get(Constant.YLZZSDL),
+				begin.getTime() / 1000, end.getTime() / 1000, 1L, 1L);
+		if (!ls.isEmpty()) {
+			whdl = ls.get(0).getPointValueInDouble();
+		}
+		if (!ls1.isEmpty()) {
+			temp = ls1.get(0).getPointValueInDouble();
+			whdl = whdl + temp;
+		}
+
+		ls = ednaApiUtil.getHistoryDatasSnap(wpmap.get(Constant.YSDJZSDL),
+				begin.getTime() / 1000, end.getTime() / 1000, 1L, 1L);
+		ls1 = ednaApiUtil.getHistoryDatasSnap(wpmap.get(Constant.YSSTZSDL),
+				begin.getTime() / 1000, end.getTime() / 1000, 1L, 1L);
+		ls2 = ednaApiUtil.getHistoryDatasSnap(wpmap.get(Constant.YXNZSDL),
+				begin.getTime() / 1000, end.getTime() / 1000, 1L, 1L);
+		ls3 = ednaApiUtil.getHistoryDatasSnap(wpmap.get(Constant.YSQXZSDL),
+				begin.getTime() / 1000, end.getTime() / 1000, 1L, 1L);
+		if (!ls.isEmpty()) {
+			xndl = ls.get(0).getPointValueInDouble();
+		}
+		if (!ls1.isEmpty()) {
+			temp = ls1.get(0).getPointValueInDouble();
+			xndl = xndl + temp;
+		}
+		if (!ls2.isEmpty()) {
+			temp = ls2.get(0).getPointValueInDouble();
+			xndl = xndl + temp;
+		}
+		if (!ls3.isEmpty()) {
+			temp = ls3.get(0).getPointValueInDouble();
+			xndl = xndl + temp;
+		}
+
+	ls = ednaApiUtil.getHistoryDatasSnap(wpmap.get(
+Constant.YWZZSDL),
+			begin.getTime() / 1000,
+			end.getTime() / 1000, 1L, 1L);
+	 if(!ls.isEmpty())
+	 {
+		dwsl=ls.get(0).getPointValueInDouble();
+	 }
+	ls = ednaApiUtil.getHistoryDatasSnap(wpmap.get(
+Constant.YTZZSDL),
+			begin.getTime() / 1000,
+			end.getTime() / 1000, 1L, 1L);
+	 if(!ls.isEmpty())
+	 {
+		tqsl=ls.get(0).getPointValueInDouble();
+	 }
+		yffdl = sfdl + gzdl + whdl + xndl + xddl + dwsl + tqsl;
+	sfdl = new BigDecimal(sfdl).divide(new BigDecimal(10000), 2,RoundingMode.HALF_EVEN).doubleValue(); 
+	yffdl = new BigDecimal(yffdl).divide(new BigDecimal(10000), 2,RoundingMode.HALF_EVEN).doubleValue();
+	xddl = new BigDecimal(xddl).divide(new BigDecimal(10000), 2,RoundingMode.HALF_EVEN).doubleValue();
+	dwsl = new BigDecimal(dwsl).divide(new BigDecimal(10000), 2,RoundingMode.HALF_EVEN).doubleValue();
+	tqsl = new BigDecimal(tqsl).divide(new BigDecimal(10000), 2,RoundingMode.HALF_EVEN).doubleValue();
+	zjrl = new BigDecimal(zjrl).divide(new BigDecimal(10), 2,RoundingMode.HALF_EVEN).doubleValue();
+
+	 
+	if(zjrl!=0.0)
+	{
+		sfdlxs = new BigDecimal(sfdl).divide(new BigDecimal(zjrl), 2,RoundingMode.HALF_EVEN).doubleValue();
+				
+		yffdlxs = new BigDecimal(yffdl).divide(new BigDecimal(zjrl), 2,RoundingMode.HALF_EVEN).doubleValue();
+	    	
+		xddlxs = new BigDecimal(xddl).divide(new BigDecimal(zjrl), 2,RoundingMode.HALF_EVEN).doubleValue();
+	    		
+		dwslxs = new BigDecimal(dwsl).divide(new BigDecimal(zjrl), 2,RoundingMode.HALF_EVEN).doubleValue();
+	    	
+		tqslxs = new BigDecimal(tqsl).divide(new BigDecimal(zjrl), 2,RoundingMode.HALF_EVEN).doubleValue();
+	   
+	}
+	
+
+	if((yffdlxs-xddlxs-dwslxs-tqslxs)>0)
+	{
+		result=new BigDecimal(yffdlxs-sfdlxs-xddlxs-dwslxs-tqslxs).divide(new BigDecimal(yffdlxs-xddlxs-dwslxs-tqslxs), 2,RoundingMode.HALF_EVEN)
+			.multiply(new BigDecimal(100)).doubleValue();
+	}
+	
+	resultmap.put("sfdl", String.valueOf(sfdl));
+	resultmap.put("yffdl", String.valueOf(yffdl));
+	resultmap.put("xddl", String.valueOf(xddl));
+	resultmap.put("dwsl", String.valueOf(dwsl));
+	resultmap.put("tqsl", String.valueOf(tqsl));
+	resultmap.put("zjrl", String.valueOf(zjrl));
+	resultmap.put("result", String.valueOf(result));
+}
+
+private void getRealInfo(Map<String, String> resultmap, double sfdlxs,
+		double yffdlxs, double xddlxs, double dwslxs, double tqslxs,
+		double zjrl, double result,
+		Map<String, WindPowerStationTestingPoint> wpmap) throws Exception {
+	double sfdl;
+	double yffdl;
+	double xddl;
+	double dwsl;
+	double tqsl;
+		double gzdl;
+		double whdl;
+		double xndl;
+
+	double temp;
+		double temp1;
+		double temp2;
+
+	sfdl = ednaApiUtil.getRealData(wpmap.get(
+						Constant.TPOINT_WP_YFDL))
+				.getPointValueInDouble();//获得月发电量
+
+	xddl = ednaApiUtil.getRealData(wpmap.get(
+Constant.YQFZSDL))
+				.getPointValueInDouble();//获得月限电发电量
+	temp = ednaApiUtil.getRealData(wpmap.get(
+Constant.YXDZSDL))
+				.getPointValueInDouble();
+		xddl = xddl + temp;
+	dwsl = ednaApiUtil.getRealData(wpmap.get(
+Constant.YWZZSDL))
+				.getPointValueInDouble();//获得月电网受累电量
+	tqsl = ednaApiUtil.getRealData(wpmap.get(
+Constant.YTZZSDL))
+				.getPointValueInDouble();//获得月天气受累电量
+		gzdl = ednaApiUtil.getRealData(wpmap.get(Constant.YGZZSDL))
+				.getPointValueInDouble();
+		temp = ednaApiUtil.getRealData(wpmap.get(Constant.YSZZSDL))
+				.getPointValueInDouble();
+		gzdl = gzdl + temp;
+		whdl = ednaApiUtil.getRealData(wpmap.get(Constant.YJXZSDL))
+				.getPointValueInDouble();
+		temp = ednaApiUtil.getRealData(wpmap.get(Constant.YLZZSDL))
+				.getPointValueInDouble();
+		whdl = whdl + temp;
+		xndl = ednaApiUtil.getRealData(wpmap.get(Constant.YSDJZSDL))
+				.getPointValueInDouble();
+		temp = ednaApiUtil.getRealData(wpmap.get(Constant.YSSTZSDL))
+				.getPointValueInDouble();
+		temp1 = ednaApiUtil.getRealData(wpmap.get(Constant.YXNZSDL))
+				.getPointValueInDouble();
+		temp2 = ednaApiUtil.getRealData(wpmap.get(Constant.YSQXZSDL))
+				.getPointValueInDouble();
+		xndl = xndl + temp + temp1 + temp2;
+
+		yffdl = sfdl + gzdl + whdl + xddl + xndl + dwsl + tqsl;
+
+	yffdl = new BigDecimal(yffdl).divide(new BigDecimal(10000), 2,RoundingMode.HALF_EVEN).doubleValue();
+	xddl = new BigDecimal(xddl).divide(new BigDecimal(10000), 2,RoundingMode.HALF_EVEN).doubleValue();
+	dwsl = new BigDecimal(dwsl).divide(new BigDecimal(10000), 2,RoundingMode.HALF_EVEN).doubleValue();
+	tqsl = new BigDecimal(tqsl).divide(new BigDecimal(10000), 2,RoundingMode.HALF_EVEN).doubleValue();
+	zjrl = new BigDecimal(zjrl).divide(new BigDecimal(10), 2,RoundingMode.HALF_EVEN).doubleValue();
+
+     
+	if(zjrl!=0.0)
+	{
+		sfdlxs = new BigDecimal(sfdl).divide(new BigDecimal(zjrl), 2,RoundingMode.HALF_EVEN).doubleValue();
+				
+		yffdlxs = new BigDecimal(yffdl).divide(new BigDecimal(zjrl), 2,RoundingMode.HALF_EVEN).doubleValue();
+	    	
+		xddlxs = new BigDecimal(xddl).divide(new BigDecimal(zjrl), 2,RoundingMode.HALF_EVEN).doubleValue();
+	    		
+		dwslxs = new BigDecimal(dwsl).divide(new BigDecimal(zjrl), 2,RoundingMode.HALF_EVEN).doubleValue();
+	    	
+		tqslxs = new BigDecimal(tqsl).divide(new BigDecimal(zjrl), 2,RoundingMode.HALF_EVEN).doubleValue();
+	   
+	}
+	
+
+	if((yffdlxs-xddlxs-dwslxs-tqslxs)>0)
+	{
+		result=new BigDecimal(yffdlxs-sfdlxs-xddlxs-dwslxs-tqslxs).divide(new BigDecimal(yffdlxs-xddlxs-dwslxs-tqslxs), 2,RoundingMode.HALF_EVEN)
+			.multiply(new BigDecimal(100)).doubleValue();
+	}
+	
+	resultmap.put("sfdl", String.valueOf(sfdl));
+	resultmap.put("yffdl", String.valueOf(yffdl));
+	resultmap.put("xddl", String.valueOf(xddl));
+	resultmap.put("dwsl", String.valueOf(dwsl));
+	resultmap.put("tqsl", String.valueOf(tqsl));
+	resultmap.put("zjrl", String.valueOf(zjrl));
+	resultmap.put("result", String.valueOf(result));
+}
+public Map<String, String> getResultValue1(String wpid, String year,String month) throws Exception {
+	double sfdl=0.0;
+	 double yffdl=0.0;
+	 double xddl=0.0;
+	 double dwsl=0.0;
+	 double tqsl=0.0;
+	double zjrl=0.0;
+	/*if (month != "10" && month!="11" && month!="12") {
+		month="0"+month;
+	}*/
+	Map<String,String> resultmap=new HashMap<String, String>();
+	if(CacheContext.wpmap.containsKey(wpid))
+  	{
+  		zjrl=CacheContext.wpmap.get(wpid).getCapacity();
+  	}
+	List<Object> objs = new ArrayList<Object>();
+	String sql = "select SUM(t.generatingCapacity2) yfdl,SUM(t.theoryGeneration) llfdl,SUM(t.dayNHXDSSDL) xdssdl from rp_wtday t where substr(t.RQ,0,6)='"+year+month+"' ";
+	if (null != wpid) {
+		sql += " and t.windpowerstationid='"+wpid+"'";
+	}
+	
+	
+	@SuppressWarnings("unchecked")
+	List<DataVo> retValue = operate.query(sql, objs.toArray(new Object[0]), new RowMapper() {
+		@Override
+		public Object mapRow(ResultSet rs, int rowNum) throws SQLException {
+			DataVo vo = new DataVo();
+			vo.setValue1(rs.getDouble("yfdl"));
+			vo.setValue2(rs.getDouble("llfdl"));
+			vo.setValue3(rs.getDouble("xdssdl"));
+			vo.setValue4(0.0);
+			vo.setValue5(0.0);
+			return vo;
+		}
+	});
+	sfdl =  retValue.get(0).getValue1();
+	yffdl = retValue.get(0).getValue2();
+	xddl = retValue.get(0).getValue3();
+	dwsl =0.0;
+	tqsl =0.0;
+	
+	
+	zjrl = new BigDecimal(zjrl).divide(new BigDecimal(10), 2,RoundingMode.HALF_EVEN).doubleValue();
+	double sfdlxs;
+	double yffdlxs;
+	double xddlxs;
+	double dwslxs;
+	double tqslxs;
+	double result = 0;
+     
+	
+		sfdlxs = new BigDecimal(sfdl).divide(new BigDecimal(zjrl), 2,RoundingMode.HALF_EVEN).doubleValue();
+				
+		yffdlxs = new BigDecimal(yffdl).divide(new BigDecimal(zjrl), 2,RoundingMode.HALF_EVEN).doubleValue();
+	    	
+		xddlxs = new BigDecimal(xddl).divide(new BigDecimal(zjrl), 2,RoundingMode.HALF_EVEN).doubleValue();
+	    		
+		dwslxs = new BigDecimal(dwsl).divide(new BigDecimal(zjrl), 2,RoundingMode.HALF_EVEN).doubleValue();
+	    	
+		tqslxs = new BigDecimal(tqsl).divide(new BigDecimal(zjrl), 2,RoundingMode.HALF_EVEN).doubleValue();
+	   
+	
+	
+
+	if((yffdlxs-xddlxs-dwslxs-tqslxs)>0)
+	{
+		result=Math.round((yffdlxs-sfdlxs-xddlxs-dwslxs-tqslxs)/(yffdlxs-xddlxs-dwslxs-tqslxs)*100);
+			
+	}
+	
+	resultmap.put("sfdl", String.valueOf(sfdl));
+	resultmap.put("yffdl", String.valueOf(yffdl));
+	resultmap.put("xddl", String.valueOf(xddl));
+	resultmap.put("dwsl", String.valueOf(dwsl));
+	resultmap.put("tqsl", String.valueOf(tqsl));
+	resultmap.put("zjrl", String.valueOf(zjrl));
+	resultmap.put("result", String.valueOf(result));
+	return resultmap;
+}
+}