Bläddra i källkod

四平短信接口定时任务

tchao 3 år sedan
förälder
incheckning
497aa9115d
100 ändrade filer med 13295 tillägg och 0 borttagningar
  1. 81 0
      .idea/libraries/ant.xml
  2. 6 0
      .idea/vcs.xml
  3. 3 0
      .metadata/.plugins/org.eclipse.core.runtime/.settings/com.genuitec.eclipse.derby.prefs
  4. 3 0
      .metadata/.plugins/org.eclipse.core.runtime/.settings/com.genuitec.eclipse.examples.prefs
  5. 19 0
      .metadata/.plugins/org.eclipse.core.runtime/.settings/com.genuitec.eclipse.wizards.prefs
  6. 4 0
      .metadata/.plugins/org.eclipse.core.runtime/.settings/com.genuitec.myeclipse.compatibility.prefs
  7. 3 0
      .metadata/.plugins/org.eclipse.core.runtime/.settings/com.genuitec.pulse2.common.ui.prefs
  8. 4 0
      .metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.core.resources.prefs
  9. 11 0
      .metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.core.prefs
  10. 3 0
      .metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.launching.prefs
  11. 14 0
      .metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.ui.prefs
  12. 3 0
      .metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.team.cvs.core.prefs
  13. 3 0
      .metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.team.cvs.ui.prefs
  14. 3 0
      .metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.team.ui.prefs
  15. 4 0
      .metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.ide.prefs
  16. 3 0
      .metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.workbench.prefs
  17. BIN
      .metadata/.plugins/org.eclipse.dltk.core/Containers.dat
  18. BIN
      .metadata/.plugins/org.eclipse.jdt.core/nonChainingJarsCache
  19. BIN
      .metadata/.plugins/org.eclipse.jdt.core/variablesAndContainers.dat
  20. 2 0
      .metadata/.plugins/org.eclipse.jdt.ui/OpenTypeHistory.xml
  21. 2 0
      .metadata/.plugins/org.eclipse.jdt.ui/QualifiedTypeNameHistory.xml
  22. 12 0
      .metadata/.plugins/org.eclipse.jdt.ui/dialog_settings.xml
  23. 2 0
      .metadata/.plugins/org.eclipse.team.cvs.ui/commentTemplates.xml
  24. 2 0
      .metadata/.plugins/org.eclipse.team.cvs.ui/commitCommentHistory.xml
  25. 5 0
      .metadata/.plugins/org.eclipse.team.cvs.ui/repositoriesView.xml
  26. 72 0
      src/com/acc/GlobalsParameter.java
  27. 727 0
      src/com/acc/common/jdbc/JdbcTemplateEx.java
  28. 53 0
      src/com/acc/framework/FrameworkFactory.java
  29. 134 0
      src/com/acc/framework/dictionary/action/DictionaryAction.java
  30. 146 0
      src/com/acc/framework/dictionary/dao/DataDictInfoDAO.java
  31. 38 0
      src/com/acc/framework/dictionary/dao/DictionaryDAO.java
  32. 33 0
      src/com/acc/framework/dictionary/sql/DictionarySQL.java
  33. 48 0
      src/com/acc/framework/resources/PropertiesUtils.java
  34. 4 0
      src/com/acc/framework/resources/SystemResources.properties
  35. 4 0
      src/com/acc/framework/resources/SystemResources_src.properties
  36. 2 0
      src/com/acc/framework/resources/run.bat
  37. 31 0
      src/com/acc/framework/session/service/SessionListener.java
  38. 16 0
      src/com/acc/framework/session/service/SessionService.java
  39. 56 0
      src/com/acc/framework/session/service/SessionServiceImpl.java
  40. 40 0
      src/com/acc/framework/session/util/SessionUtil.java
  41. 272 0
      src/com/acc/framework/tht/action/LoginAction.java
  42. 131 0
      src/com/acc/framework/tht/dao/LoginDAO.java
  43. 22 0
      src/com/acc/framework/tht/service/LoginService.java
  44. 155 0
      src/com/acc/framework/tht/service/impl/LoginServiceImpl.java
  45. 501 0
      src/com/acc/framework/thtkehu/action/CustomerAction.java
  46. 135 0
      src/com/acc/framework/thtkehu/dao/CustomerDAO.java
  47. 61 0
      src/com/acc/framework/thtkehu/service/CustomerService.java
  48. 600 0
      src/com/acc/framework/thtkehu/service/impl/CustomerServiceImpl.java
  49. 610 0
      src/com/acc/framework/thtopera/action/OperaAction.java
  50. 552 0
      src/com/acc/framework/thtopera/dao/OperaDAO.java
  51. 145 0
      src/com/acc/framework/thtopera/service/OperaService.java
  52. 1366 0
      src/com/acc/framework/thtopera/service/impl/OperaServiceImpl.java
  53. 133 0
      src/com/acc/framework/thtquote/action/QuoteAction.java
  54. 102 0
      src/com/acc/framework/thtquote/dao/QuoteDAO.java
  55. 13 0
      src/com/acc/framework/thtquote/service/QuoteService.java
  56. 206 0
      src/com/acc/framework/thtquote/service/impl/QuoteServiceImpl.java
  57. 146 0
      src/com/acc/taglib/html/CheckBoxTag.java
  58. 57 0
      src/com/acc/taglib/html/FieldOrderTag.java
  59. 55 0
      src/com/acc/taglib/html/FormLabel.java
  60. 149 0
      src/com/acc/taglib/html/OptionTag.java
  61. 132 0
      src/com/acc/taglib/html/OptionsTag.java
  62. 61 0
      src/com/acc/taglib/html/ParameterTag.java
  63. 162 0
      src/com/acc/taglib/html/RadioTag.java
  64. 46 0
      src/com/acc/taglib/page/IPageResult.java
  65. 137 0
      src/com/acc/taglib/page/ListPageResultTag.java
  66. 4 0
      src/com/acc/taglib/page/LocalStrings.properties
  67. 29 0
      src/com/acc/taglib/page/PageResultTei.java
  68. 200 0
      src/com/acc/taglib/page/PageViewContext.java
  69. 310 0
      src/com/acc/taglib/page/PageViewTag.java
  70. 29 0
      src/com/acc/taglib/page/PageViewTei.java
  71. 148 0
      src/com/acc/taglib/page/PageViewUtil.java
  72. 185 0
      src/com/acc/taglib/page/PreSQLPageResultTag.java
  73. 281 0
      src/com/acc/taglib/page/SQLPageResultTag.java
  74. 207 0
      src/com/acc/taglib/page/SQLResultTag.java
  75. 29 0
      src/com/acc/taglib/page/SQLResultTei.java
  76. 77 0
      src/com/acc/taglib/util/EncodingMessageTag.java
  77. 69 0
      src/com/acc/taglib/util/FieldOrder.java
  78. 55 0
      src/com/acc/taglib/util/LabelValueDisplay.java
  79. 3 0
      src/com/acc/taglib/util/LocalStrings.properties
  80. 138 0
      src/com/acc/taglib/util/OptionsArrayTag.java
  81. 89 0
      src/com/acc/taglib/util/OptionsCheckboxTag.java
  82. 65 0
      src/com/acc/taglib/util/OptionsRadioTag.java
  83. 56 0
      src/com/acc/taglib/util/ParameterTag.java
  84. 291 0
      src/com/acc/taglib/util/ResourceDataTag.java
  85. 29 0
      src/com/acc/taglib/util/ResourceDataTei.java
  86. 104 0
      src/com/acc/taglib/util/ResourceTableTag.java
  87. 139 0
      src/com/acc/taglib/util/ResourceTag.java
  88. 165 0
      src/com/acc/taglib/util/TableDataDisplay.java
  89. 137 0
      src/com/acc/taglib/util/TableDataTag.java
  90. 14 0
      src/com/acc/taglib/util/TableDataTei.java
  91. 80 0
      src/com/acc/taglib/util/TableValueDisplay.java
  92. 86 0
      src/com/acc/taglib/util/URLEncodingTag.java
  93. 14 0
      src/com/acc/taglib/util/URLEncodingTei.java
  94. 60 0
      src/com/acc/util/common/AutnQueryUtil.java
  95. 51 0
      src/com/acc/util/common/Base64Encode.java
  96. 176 0
      src/com/acc/util/common/ChineseSpelling.java
  97. 539 0
      src/com/acc/util/common/CnToSpell.java
  98. 104 0
      src/com/acc/util/common/DESEncryptUtil.java
  99. 1787 0
      src/com/acc/util/common/DateUtil.java
  100. 0 0
      src/com/acc/util/common/ExceptionUtil.java

+ 81 - 0
.idea/libraries/ant.xml

@@ -0,0 +1,81 @@
+<component name="libraryTable">
+  <library name="ant">
+    <CLASSES>
+      <root url="jar://$PROJECT_DIR$/web/WEB-INF/lib/ant.jar!/" />
+      <root url="jar://$PROJECT_DIR$/web/WEB-INF/lib/aopalliance-1.0.jar!/" />
+      <root url="jar://$PROJECT_DIR$/web/WEB-INF/lib/aspectjrt.jar!/" />
+      <root url="jar://$PROJECT_DIR$/web/WEB-INF/lib/aspectjweaver.jar!/" />
+      <root url="jar://$PROJECT_DIR$/web/WEB-INF/lib/c3p0-0.9.1.jar!/" />
+      <root url="jar://$PROJECT_DIR$/web/WEB-INF/lib/cglib-nodep-2.2.jar!/" />
+      <root url="jar://$PROJECT_DIR$/web/WEB-INF/lib/com.springsource.org.apache.commons.logging-1.1.1.jar!/" />
+      <root url="jar://$PROJECT_DIR$/web/WEB-INF/lib/commons-beanutils.jar!/" />
+      <root url="jar://$PROJECT_DIR$/web/WEB-INF/lib/commons-cli-1.0.jar!/" />
+      <root url="jar://$PROJECT_DIR$/web/WEB-INF/lib/commons-codec-1.2.jar!/" />
+      <root url="jar://$PROJECT_DIR$/web/WEB-INF/lib/commons-collections.jar!/" />
+      <root url="jar://$PROJECT_DIR$/web/WEB-INF/lib/commons-dbcp-1.2.1.jar!/" />
+      <root url="jar://$PROJECT_DIR$/web/WEB-INF/lib/commons-digester.jar!/" />
+      <root url="jar://$PROJECT_DIR$/web/WEB-INF/lib/commons-discovery-0.2.jar!/" />
+      <root url="jar://$PROJECT_DIR$/web/WEB-INF/lib/commons-email.jar!/" />
+      <root url="jar://$PROJECT_DIR$/web/WEB-INF/lib/commons-fileupload-1.2.1.jar!/" />
+      <root url="jar://$PROJECT_DIR$/web/WEB-INF/lib/commons-httpclient-2.0.jar!/" />
+      <root url="jar://$PROJECT_DIR$/web/WEB-INF/lib/commons-io-1.4.jar!/" />
+      <root url="jar://$PROJECT_DIR$/web/WEB-INF/lib/commons-lang-2.1.jar!/" />
+      <root url="jar://$PROJECT_DIR$/web/WEB-INF/lib/commons-logging.jar!/" />
+      <root url="jar://$PROJECT_DIR$/web/WEB-INF/lib/commons-net-1.3.0.jar!/" />
+      <root url="jar://$PROJECT_DIR$/web/WEB-INF/lib/commons-pool-1.2.jar!/" />
+      <root url="jar://$PROJECT_DIR$/web/WEB-INF/lib/commons-validator.jar!/" />
+      <root url="jar://$PROJECT_DIR$/web/WEB-INF/lib/dom4j-1.6.1.jar!/" />
+      <root url="jar://$PROJECT_DIR$/web/WEB-INF/lib/ezmorph-1.0.5.jar!/" />
+      <root url="jar://$PROJECT_DIR$/web/WEB-INF/lib/freemarker-2.3.16.jar!/" />
+      <root url="jar://$PROJECT_DIR$/web/WEB-INF/lib/httpclient-4.1.2.jar!/" />
+      <root url="jar://$PROJECT_DIR$/web/WEB-INF/lib/httpcore-4.1.2.jar!/" />
+      <root url="jar://$PROJECT_DIR$/web/WEB-INF/lib/jakarta-oro.jar!/" />
+      <root url="jar://$PROJECT_DIR$/web/WEB-INF/lib/javassist-3.7.ga.jar!/" />
+      <root url="jar://$PROJECT_DIR$/web/WEB-INF/lib/jdom.jar!/" />
+      <root url="jar://$PROJECT_DIR$/web/WEB-INF/lib/json-lib-2.1-jdk15.jar!/" />
+      <root url="jar://$PROJECT_DIR$/web/WEB-INF/lib/json-lib-2.2.3-jdk15.jar!/" />
+      <root url="jar://$PROJECT_DIR$/web/WEB-INF/lib/jstl.jar!/" />
+      <root url="jar://$PROJECT_DIR$/web/WEB-INF/lib/log4j-1.2.14.jar!/" />
+      <root url="jar://$PROJECT_DIR$/web/WEB-INF/lib/mysql-connector-java-5.1.5-bin.jar!/" />
+      <root url="jar://$PROJECT_DIR$/web/WEB-INF/lib/ognl-3.0.jar!/" />
+      <root url="jar://$PROJECT_DIR$/web/WEB-INF/lib/ojdbc14.jar!/" />
+      <root url="jar://$PROJECT_DIR$/web/WEB-INF/lib/org.springframework.aop-3.1.1.RELEASE.jar!/" />
+      <root url="jar://$PROJECT_DIR$/web/WEB-INF/lib/org.springframework.asm-3.1.1.RELEASE.jar!/" />
+      <root url="jar://$PROJECT_DIR$/web/WEB-INF/lib/org.springframework.aspects-3.1.1.RELEASE.jar!/" />
+      <root url="jar://$PROJECT_DIR$/web/WEB-INF/lib/org.springframework.beans-3.1.1.RELEASE.jar!/" />
+      <root url="jar://$PROJECT_DIR$/web/WEB-INF/lib/org.springframework.context-3.1.1.RELEASE.jar!/" />
+      <root url="jar://$PROJECT_DIR$/web/WEB-INF/lib/org.springframework.context.support-3.1.1.RELEASE.jar!/" />
+      <root url="jar://$PROJECT_DIR$/web/WEB-INF/lib/org.springframework.core-3.1.1.RELEASE.jar!/" />
+      <root url="jar://$PROJECT_DIR$/web/WEB-INF/lib/org.springframework.expression-3.1.1.RELEASE.jar!/" />
+      <root url="jar://$PROJECT_DIR$/web/WEB-INF/lib/org.springframework.instrument-3.1.1.RELEASE.jar!/" />
+      <root url="jar://$PROJECT_DIR$/web/WEB-INF/lib/org.springframework.instrument.tomcat-3.1.1.RELEASE.jar!/" />
+      <root url="jar://$PROJECT_DIR$/web/WEB-INF/lib/org.springframework.jdbc-3.1.1.RELEASE.jar!/" />
+      <root url="jar://$PROJECT_DIR$/web/WEB-INF/lib/org.springframework.jms-3.1.1.RELEASE.jar!/" />
+      <root url="jar://$PROJECT_DIR$/web/WEB-INF/lib/org.springframework.orm-3.1.1.RELEASE.jar!/" />
+      <root url="jar://$PROJECT_DIR$/web/WEB-INF/lib/org.springframework.oxm-3.1.1.RELEASE.jar!/" />
+      <root url="jar://$PROJECT_DIR$/web/WEB-INF/lib/org.springframework.test-3.1.1.RELEASE.jar!/" />
+      <root url="jar://$PROJECT_DIR$/web/WEB-INF/lib/org.springframework.transaction-3.1.1.RELEASE.jar!/" />
+      <root url="jar://$PROJECT_DIR$/web/WEB-INF/lib/org.springframework.web-3.1.1.RELEASE.jar!/" />
+      <root url="jar://$PROJECT_DIR$/web/WEB-INF/lib/org.springframework.web.portlet-3.1.1.RELEASE.jar!/" />
+      <root url="jar://$PROJECT_DIR$/web/WEB-INF/lib/org.springframework.web.servlet-3.1.1.RELEASE.jar!/" />
+      <root url="jar://$PROJECT_DIR$/web/WEB-INF/lib/org.springframework.web.struts-3.1.1.RELEASE.jar!/" />
+      <root url="jar://$PROJECT_DIR$/web/WEB-INF/lib/poi-3.7-20101029.jar!/" />
+      <root url="jar://$PROJECT_DIR$/web/WEB-INF/lib/poi-examples-3.7-20101029.jar!/" />
+      <root url="jar://$PROJECT_DIR$/web/WEB-INF/lib/poi-ooxml-3.7-20101029.jar!/" />
+      <root url="jar://$PROJECT_DIR$/web/WEB-INF/lib/poi-ooxml-schemas-3.7-20101029.jar!/" />
+      <root url="jar://$PROJECT_DIR$/web/WEB-INF/lib/poi-scratchpad-3.7-20101029.jar!/" />
+      <root url="jar://$PROJECT_DIR$/web/WEB-INF/lib/quartz-1.8.4.jar!/" />
+      <root url="jar://$PROJECT_DIR$/web/WEB-INF/lib/slf4j-api-1.6.1.jar!/" />
+      <root url="jar://$PROJECT_DIR$/web/WEB-INF/lib/slf4j-log4j12-1.6.1.jar!/" />
+      <root url="jar://$PROJECT_DIR$/web/WEB-INF/lib/standard.jar!/" />
+      <root url="jar://$PROJECT_DIR$/web/WEB-INF/lib/struts.jar!/" />
+      <root url="jar://$PROJECT_DIR$/web/WEB-INF/lib/struts2-core-2.2.1.jar!/" />
+      <root url="jar://$PROJECT_DIR$/web/WEB-INF/lib/struts2-spring-plugin-2.2.1.jar!/" />
+      <root url="jar://$PROJECT_DIR$/web/WEB-INF/lib/xwork-core-2.2.1.jar!/" />
+    </CLASSES>
+    <JAVADOC />
+    <SOURCES>
+      <root url="jar://$PROJECT_DIR$/web/WEB-INF/lib/org.springframework.jdbc-sources-3.0.4.RELEASE.jar!/" />
+    </SOURCES>
+  </library>
+</component>

+ 6 - 0
.idea/vcs.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="VcsDirectoryMappings">
+    <mapping directory="$PROJECT_DIR$" vcs="Git" />
+  </component>
+</project>

+ 3 - 0
.metadata/.plugins/org.eclipse.core.runtime/.settings/com.genuitec.eclipse.derby.prefs

@@ -0,0 +1,3 @@
+#Mon Oct 27 10:11:04 GMT+08:00 2014
+eclipse.preferences.version=1
+DRIVER_CREATED=true

+ 3 - 0
.metadata/.plugins/org.eclipse.core.runtime/.settings/com.genuitec.eclipse.examples.prefs

@@ -0,0 +1,3 @@
+#Mon Oct 27 10:11:04 GMT+08:00 2014
+eclipse.preferences.version=1
+repository_added=true

+ 19 - 0
.metadata/.plugins/org.eclipse.core.runtime/.settings/com.genuitec.eclipse.wizards.prefs

@@ -0,0 +1,19 @@
+#Mon Oct 27 10:11:04 GMT+08:00 2014
+applet.template.2.label=Template for Applet with JDK1.4
+applet.template.1.label=Template for Applet with JDK1.3
+snippetLibIntalled_v5=true
+eclipse.preferences.version=1
+applethtml.template.1.label=Default Applet HTML template
+servlet.template.1=templates/Servlet.java
+applethtml.template.1=templates/Applet.html
+applet.template.2=templates/Applet14.java
+applet.template.1=templates/Applet.java
+servlet.template.1.label=Default template for Servlet
+doctype.html.8=<\!DOCTYPE HTML PUBLIC "-//IETF//DTD LEVEL1//EN">
+doctype.html.7=<\!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+doctype.html.6=<\!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 3.0//EN">
+doctype.html.5=<\!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+doctype.html.4=<\!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
+doctype.html.3=<\!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
+doctype.html.2=<\!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN">
+doctype.html.1=<\!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

+ 4 - 0
.metadata/.plugins/org.eclipse.core.runtime/.settings/com.genuitec.myeclipse.compatibility.prefs

@@ -0,0 +1,4 @@
+#Mon Oct 27 10:11:04 GMT+08:00 2014
+eclipse.preferences.version=1
+preferencesMigrated=true
+preferencesMigrated60=true

+ 3 - 0
.metadata/.plugins/org.eclipse.core.runtime/.settings/com.genuitec.pulse2.common.ui.prefs

@@ -0,0 +1,3 @@
+#Mon Oct 27 10:09:31 GMT+08:00 2014
+eclipse.preferences.version=1
+com.genuitec.pulse.client.targetcfg.synced.proxy.settings=true

+ 4 - 0
.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.core.resources.prefs

@@ -0,0 +1,4 @@
+#Mon Oct 27 10:10:44 GMT+08:00 2014
+org.eclipse.jdt.core.classFormatVersion=TN|6969778851444|6961360851444|snyfr|3|0|5
+version=1
+eclipse.preferences.version=1

+ 11 - 0
.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.core.prefs

@@ -0,0 +1,11 @@
+#Mon Oct 27 10:10:44 GMT+08:00 2014
+org.eclipse.jdt.core.classpathVariable.JRE_SRCROOT=
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.classpathVariable.JRE_LIB=D\:/Myeclipse/Common/binary/com.sun.java.jdk.win32.x86_1.6.0.013/jre/lib/rt.jar
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.source=1.6
+org.eclipse.jdt.core.classpathVariable.JRE_SRC=D\:/Myeclipse/Common/binary/com.sun.java.jdk.win32.x86_1.6.0.013/src.zip
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 3 - 0
.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.launching.prefs


+ 14 - 0
.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.ui.prefs

@@ -0,0 +1,14 @@
+#Mon Oct 27 10:11:04 GMT+08:00 2014
+useQuickDiffPrefPage=true
+proposalOrderMigrated=true
+tabWidthPropagated=true
+content_assist_proposals_background=255,255,255
+org.eclipse.jdt.ui.javadoclocations.migrated=true
+useAnnotationsPrefPage=true
+org.eclipse.jface.textfont=1|Courier New|10.0|0|WINDOWS|1|0|0|0|0|0|0|0|0|1|0|0|0|0|Courier New;
+org.eclipse.jdt.ui.editor.tab.width=
+org.eclipse.jdt.ui.formatterprofiles.version=11
+spelling_locale_initialized=true
+eclipse.preferences.version=1
+content_assist_proposals_foreground=0,0,0
+fontPropagated=true

+ 3 - 0
.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.team.cvs.core.prefs

@@ -0,0 +1,3 @@
+#Mon Oct 27 10:09:35 GMT+08:00 2014
+repositories/%pserver%anonymous@examples.myeclipseide.com%%home%cvs%public%myeclipse%examples/location=\:pserver\:anonymous@examples.myeclipseide.com\:/home/cvs/public/myeclipse/examples
+eclipse.preferences.version=1

+ 3 - 0
.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.team.cvs.ui.prefs

@@ -0,0 +1,3 @@
+#Mon Oct 27 10:11:05 GMT+08:00 2014
+pref_first_startup=false
+eclipse.preferences.version=1

+ 3 - 0
.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.team.ui.prefs

@@ -0,0 +1,3 @@
+#Mon Oct 27 10:11:05 GMT+08:00 2014
+eclipse.preferences.version=1
+org.eclipse.team.ui.first_time=false

+ 4 - 0
.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.ide.prefs

@@ -0,0 +1,4 @@
+#Mon Oct 27 10:11:05 GMT+08:00 2014
+eclipse.preferences.version=1
+platformState=1414222988660
+PROBLEMS_FILTERS_MIGRATE=true

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 3 - 0
.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.workbench.prefs


BIN
.metadata/.plugins/org.eclipse.dltk.core/Containers.dat


BIN
.metadata/.plugins/org.eclipse.jdt.core/nonChainingJarsCache


BIN
.metadata/.plugins/org.eclipse.jdt.core/variablesAndContainers.dat


+ 2 - 0
.metadata/.plugins/org.eclipse.jdt.ui/OpenTypeHistory.xml

@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<typeInfoHistroy/>

+ 2 - 0
.metadata/.plugins/org.eclipse.jdt.ui/QualifiedTypeNameHistory.xml

@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<qualifiedTypeNameHistroy/>

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 12 - 0
.metadata/.plugins/org.eclipse.jdt.ui/dialog_settings.xml


+ 2 - 0
.metadata/.plugins/org.eclipse.team.cvs.ui/commentTemplates.xml

@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<CommitCommentTemplates></CommitCommentTemplates>

+ 2 - 0
.metadata/.plugins/org.eclipse.team.cvs.ui/commitCommentHistory.xml

@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<CommitComments></CommitComments>

+ 5 - 0
.metadata/.plugins/org.eclipse.team.cvs.ui/repositoriesView.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<repositories-view>
+	<repository id=":pserver:anonymous@examples.myeclipseide.com:/home/cvs/public/myeclipse/examples" name="MyEclipse Examples">
+	</repository>
+</repositories-view>

+ 72 - 0
src/com/acc/GlobalsParameter.java

@@ -0,0 +1,72 @@
+package com.acc;
+
+import java.io.Serializable;
+
+public class GlobalsParameter implements Serializable
+{
+	public static String SYSTEM_ENCODING = "com.cyberrender.system.encoding";
+
+	public static String SYSTEM_USER_ID = "com.cyberrender.system.user.id";
+
+	public static String SYSTEM_USER_NAME = "com.cyberrender.system.user.name";
+
+	public static String SYSTEM_USER_PERMISSIONS = "com.cyberrender.SYSTEM_USER_PERMISSIONS";
+
+	public static String SYSTEM_USER_JOBTITLEORG_LIST = "com.cyberrender.system.user.organization.list";
+
+	public static String SYSTEM_USER_JOBTITLENAME_LIST = "com.cyberrender.system.user.jobtitlename.list";
+
+	public static String SYSTEM_USER_Role_LIST = "com.cyberrender.system.user.role.list";
+
+	public static String SYSTEM_USER_SUPERUSER = "com.cyberrender.system.user.superuser";
+
+	public static String SYSTEM_USER_MENUBAR_LIST = "com.cyberrender.system.user.menubars";
+
+	public static String SYSTEM_USER_SCHEMA_DESKTOP_ID = "com.cyberrender.system.user.schema.desktop.id";
+
+	public static String SYSTEM_USER_SCHEMA_DESKTOP_TYPE = "com.cyberrender.system.user.schema.desktop.type";
+
+	public static String SYSTEM_USER_SCHEMA_DESKTOP_LIST = "com.cyberrender.system.user.schema.desktop.list";
+
+	public static String SYSTEM_USER_DESKTOP_TYPE = "com.cyberrender.system.user.desktop.type";
+
+	public static String SYSTEM_USER_DESKTOP_LIST = "com.cyberrender.system.user.desktop.list";
+
+	public static String REQUEST_REFERENCE_LIST = "com.cyberrender.request.reference.list";
+
+	public static final String APPLICATION_ORGANIZATION_TREE = "com.cyberrender.application.organization.tree";
+
+	public static final String SYSTEM_USER_PAGESIZE = "com.cyberrender.system.user.pagesize";
+
+	public static final String SYSTEM_LOGINTIME = "com.cyberrender.system.logintime";
+
+	public static final String SYSTEM_LOGIN_REMOTEADDRESS = "com.cyberrender.system.login.remoteaddress";
+
+	public static final String SYSTEM_LOGIN = "com.cyberrender.system.login";
+
+	public static final String SYSTEM_EMPLOYEEE_NAME = "com.cyberrender.system.employee.name";
+
+	public static final String APPLICATION_LOGINPATH = "com.cyberrender.application.LOGINPATH";
+
+	public static final String APPLICATION_MESSAGEPAGE = "com.cyberrender.application.MESSAGEPAGE";
+
+	public static final String SYSTEM_USER_INFO = "com.cyberrender.system.userinfo";
+
+	public static final String PROCESS_SUCCESS = "com.cyberrender.system.PROCESS_SUCCESS";
+
+	public static final int UM_ORGANIZATION_SECTION_LENGTH = 5;
+
+	public static final String LIST_PAGE_SIZE = "20";
+
+	public static final long SEARCH_JOB_INTERVAL = 3 * 60 * 1000;
+
+	public static final long BBS_JOB_INTERVAL = 3 * 60 * 1000;
+	
+	public static final String LIST = "list";
+	
+	public static final String FORM_VIEW = "form_view";
+	
+	public static final String UPDATE_VIEW = "update_view";
+	
+	public static final String REDIRECT_LIST = "redirect_list";
+}

+ 727 - 0
src/com/acc/common/jdbc/JdbcTemplateEx.java

@@ -0,0 +1,727 @@
+package com.acc.common.jdbc;
+
+import java.sql.Connection;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.Types;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import javax.sql.DataSource;
+
+import org.springframework.context.ApplicationContext;
+import org.springframework.dao.DataAccessException;
+import org.springframework.dao.IncorrectResultSizeDataAccessException;
+import org.springframework.dao.InvalidDataAccessApiUsageException;
+import org.springframework.jdbc.core.BatchPreparedStatementSetter;
+import org.springframework.jdbc.core.ColumnMapRowMapper;
+import org.springframework.jdbc.core.JdbcTemplate;
+import org.springframework.jdbc.core.ParameterDisposer;
+import org.springframework.jdbc.core.PreparedStatementCallback;
+import org.springframework.jdbc.core.PreparedStatementCreator;
+import org.springframework.jdbc.core.PreparedStatementSetter;
+import org.springframework.jdbc.core.ResultSetExtractor;
+import org.springframework.jdbc.core.RowMapper;
+import org.springframework.jdbc.core.RowMapperResultSetExtractor;
+import org.springframework.jdbc.core.SingleColumnRowMapper;
+import org.springframework.jdbc.core.SqlProvider;
+import org.springframework.jdbc.core.SqlTypeValue;
+import org.springframework.jdbc.core.StatementCreatorUtils;
+import org.springframework.jdbc.core.support.SqlLobValue;
+import org.springframework.jdbc.support.JdbcUtils;
+import org.springframework.jdbc.support.incrementer.AbstractSequenceMaxValueIncrementer;
+import org.springframework.util.Assert;
+
+import com.acc.common.jdbc.oracle.OracleTypes;
+import com.acc.common.spring.ApplicationFactory;
+
+public class JdbcTemplateEx extends JdbcTemplate
+{
+	// 1
+	private int firstResult;
+
+	// 2
+	private int lastResult;
+
+	// 3
+	public int getFirstResult()
+	{
+		return firstResult;
+	}
+
+	// 4
+	public void setLastResult(int lastResult)
+	{
+		if (lastResult < 1)
+			throw new InvalidDataAccessApiUsageException("lastResult cannot less 1 ");
+		this.lastResult = lastResult;
+	}
+
+	// 5
+	public void setFirstResult(int firstResult)
+	{
+		if (firstResult < 1)
+			throw new InvalidDataAccessApiUsageException("firstResult cannot less 1 ");
+		this.firstResult = firstResult;
+	}
+
+	// 6
+	public int getLastResult()
+	{
+		return lastResult;
+	}
+
+	// 7
+	public JdbcTemplateEx()
+	{
+		super();
+		firstResult = 1;
+		lastResult = Integer.MAX_VALUE;
+	}
+
+	// 8
+	public JdbcTemplateEx(DataSource dataSource)
+	{
+
+		super(dataSource);
+		firstResult = 1;
+		lastResult = Integer.MAX_VALUE;
+	}
+
+	// 9
+	public void insertMap(Map map, String tableName) throws DataAccessException
+	{
+		String keyStr = "( ";
+		String valueStr = "( ";
+		Object[] args = new Object[map.size()];
+		Iterator it = map.keySet().iterator();
+		for (int j = 0; it.hasNext(); j++)
+		{
+			String key = (String) it.next();
+			keyStr = keyStr + key + ",";
+			valueStr = valueStr + "?,";
+			args[j] = map.get(key);
+		}
+		keyStr = keyStr.substring(0, keyStr.length() - 1) + " ) ";
+		valueStr = valueStr.substring(0, valueStr.length() - 1) + " ) ";
+		String insertSql = "insert into " + tableName + " " + keyStr + " values " + valueStr;
+		update(insertSql, args);
+	}
+
+	// 10
+
+	private void setPrimaryKey(Map map, String tableName, String primaryKeyName)
+	{
+		Object pkvalue = map.get(primaryKeyName);
+		if (pkvalue == null)
+			throw new InvalidDataAccessApiUsageException("PrimaryKey '" + primaryKeyName
+					+ "' cannot find in map");
+
+		if (pkvalue.toString().equals("-1"))
+		{
+			IDTableMaxValueIncrementer increamenter = new IDTableMaxValueIncrementer(this
+					.getDataSource(), tableName);
+			if (pkvalue instanceof Long)
+			{
+				map.put(primaryKeyName, new Long(increamenter.nextLongValue()));
+			}
+			else if (pkvalue instanceof Integer)
+			{
+				map.put(primaryKeyName, new Integer(increamenter.nextIntValue()));
+			}
+			else if (pkvalue instanceof String)
+			{
+				map.put(primaryKeyName, increamenter.nextStringValue());
+			}
+			else
+			{
+				throw new InvalidDataAccessApiUsageException("PrimaryKey '" + primaryKeyName
+						+ "' value can't cast  Long/Integer/String");
+			}
+		}
+		if (pkvalue.toString().equals("-2"))
+		{
+			AbstractSequenceMaxValueIncrementer incrementer = getSequenceIncrementer(tableName);
+			if (incrementer == null) return;
+			incrementer.setIncrementerName(incrementer.getIncrementerName() + tableName);
+			if (pkvalue instanceof Long)
+			{
+				map.put(primaryKeyName, new Long(incrementer.nextLongValue()));
+			}
+			else if (pkvalue instanceof Integer)
+			{
+				map.put(primaryKeyName, new Integer(incrementer.nextIntValue()));
+			}
+			else if (pkvalue instanceof String)
+			{
+				map.put(primaryKeyName, incrementer.nextStringValue());
+			}
+			else
+			{
+				throw new InvalidDataAccessApiUsageException("PrimaryKey '" + primaryKeyName
+						+ "' value can't cast  Long/Integer/String");
+			}
+		}
+	}
+
+	// 11
+	public Object insertMap(Map map, String tableName, String primaryKeyName)
+			throws DataAccessException
+	{
+		LobHelper lobhelper = getLobHelper();
+		this.setPrimaryKey(map, tableName, primaryKeyName);
+		String keyStr = "( ";
+		String valueStr = "( ";
+		Object[] args = new Object[map.size()];
+		int[] types = new int[map.size()];
+		Iterator it = map.keySet().iterator();
+		int j = 0;
+		while (it.hasNext())
+		{
+			String key = (String) it.next();
+			Object val = map.get(key);
+			if (val != null)
+			{
+				keyStr = keyStr + key + ",";
+				valueStr = valueStr + "?,";
+				args[j] = lobhelper.getObjectTransLob(val);
+				types[j] = OracleTypes.getTypeByObject(args[j]);
+				j++;
+			}
+		}
+		keyStr = keyStr.substring(0, keyStr.length() - 1) + " ) ";
+		valueStr = valueStr.substring(0, valueStr.length() - 1) + " ) ";
+		String insertSql = "insert into " + tableName + " " + keyStr + " values " + valueStr;
+		update(insertSql, args, types);
+		return map.get(primaryKeyName);
+	}
+
+	// 12
+	public void updateMap(Map map, String tableName, String primaryKeyName)
+			throws DataAccessException
+	{
+		LobHelper lobhelper = getLobHelper();
+		Object pkvalue = map.get(primaryKeyName);
+		if (pkvalue == null)
+			throw new InvalidDataAccessApiUsageException("Primary Key doesn't exist in Map");
+		Object[] args = new Object[map.size()];
+		int[] types = new int[map.size()];
+		Iterator it = map.keySet().iterator();
+		String updateSql = "update " + tableName + " set ";
+		int j = 0;
+		while (it.hasNext())
+		{
+			String keyName = (String) it.next();
+			if (primaryKeyName.equalsIgnoreCase(keyName)) continue;
+
+			updateSql = updateSql + keyName + " = ?,";
+			args[j] = lobhelper.getObjectTransLob(map.get(keyName));
+			types[j] = OracleTypes.getTypeByObject(args[j]);
+			j++;
+		}
+		args[map.size() - 1] = pkvalue;
+		types[map.size() - 1] = OracleTypes.getTypeByObject(args[map.size() - 1]);
+		updateSql = updateSql.substring(0, updateSql.length() - 1) + "  where ";
+		updateSql = updateSql + primaryKeyName + " = ? ";
+		update(updateSql, args, types);
+
+	}
+
+	// 13
+	public long getQueryCount(String sql) throws DataAccessException
+	{
+		if (sql == null || sql.equals(""))
+		{
+			return 0;
+		}
+		String lowercaseSql = sql.toLowerCase();
+		int fromLocation = lowercaseSql.indexOf(" from ");
+		sql = "select count(*) as count " + sql.substring(fromLocation, sql.length());
+		if (lowercaseSql.indexOf("/*not-order*/") == -1)
+		{
+			lowercaseSql = sql.toLowerCase();
+			int orderbyLocation = lowercaseSql.indexOf(" order by");
+			if (lowercaseSql.indexOf("order by") != -1)
+			{
+				sql = sql.substring(0, orderbyLocation);
+			}
+		}
+		return this.queryForLong(sql);
+	}
+
+	// 14
+	public long getQueryCount(String sql, Object args[]) throws DataAccessException
+	{
+		if (sql == null || sql.equals(""))
+		{
+			return 0;
+		}
+		String lowercaseSql = sql.toLowerCase();
+		int fromLocation = lowercaseSql.indexOf(" from ");
+		sql = "select count(*) as count " + sql.substring(fromLocation, sql.length());
+		lowercaseSql = sql.toLowerCase();
+		int orderbyLocation = lowercaseSql.indexOf(" order by");
+		if (lowercaseSql.indexOf("order by") != -1)
+		{
+			sql = sql.substring(0, orderbyLocation);
+		}
+		return this.queryForLong(sql, args);
+	}
+
+	// 16
+	public List queryEx(String sql, RowMapper rowMapper) throws DataAccessException
+	{
+		return (List) this.query(sql, new RowCallbackHandlerResultSetExtractor(rowMapper));
+
+	}
+
+	// 17
+	protected Object queryEx(PreparedStatementCreator psc, final PreparedStatementSetter pss,
+			final ResultSetExtractor rse) throws DataAccessException
+	{
+		return super.query(psc, pss, rse);
+	}
+
+	// 18
+	public Object queryEx(PreparedStatementCreator psc, ResultSetExtractor rse)
+			throws DataAccessException
+	{
+		return queryEx(psc, null, rse);
+	}
+
+	// 19
+	public Object queryEx(String sql, PreparedStatementSetter pss, final ResultSetExtractor rse)
+			throws DataAccessException
+	{
+		if (sql == null)
+		{
+			throw new InvalidDataAccessApiUsageException("SQL may not be null");
+		}
+		return queryEx(new SimplePreparedStatementCreator(sql), pss, rse);
+	}
+
+	// 20
+	public Object query(String sql, Object[] args, int[] argTypes, ResultSetExtractor rse)
+			throws DataAccessException
+	{
+		return query(sql, new ArgTypePreparedStatementSetter(args, argTypes), rse);
+	}
+
+	// 21
+	public Object query(String sql, Object[] args, ResultSetExtractor rse)
+			throws DataAccessException
+	{
+		return query(sql, new ArgPreparedStatementSetter(args), rse);
+	}
+
+	// 25
+	public List queryEx(String sql, Object[] args, ResultSetExtractor rch)
+			throws DataAccessException
+	{
+		return (List) queryEx(sql, new ArgPreparedStatementSetter(args), rch);
+	}
+
+	// 26
+	public List query(PreparedStatementCreator psc, RowMapper rowMapper) throws DataAccessException
+	{
+		return (List) queryEx(psc, new RowMapperResultSetExtractor(rowMapper));
+	}
+
+	// 29
+	public List queryEx(String sql, Object[] args, RowMapper rowMapper) throws DataAccessException
+	{
+		return queryEx(sql, args, new RowCallbackHandlerResultSetExtractor(rowMapper));
+	}
+
+	// 30
+	private static class SimplePreparedStatementCreator implements PreparedStatementCreator,
+			SqlProvider
+	{
+
+		private final String sql;
+
+		public SimplePreparedStatementCreator(String sql)
+		{
+			this.sql = sql;
+		}
+
+		public PreparedStatement createPreparedStatement(Connection con) throws SQLException
+		{
+			return con.prepareStatement(this.sql);
+		}
+
+		public String getSql()
+		{
+			return sql;
+		}
+	}
+
+	// 31
+	private static class ArgPreparedStatementSetter implements PreparedStatementSetter,
+			ParameterDisposer
+	{
+
+		private final Object[] args;
+
+		public ArgPreparedStatementSetter(Object[] args)
+		{
+			this.args = args;
+		}
+
+		public void setValues(PreparedStatement ps) throws SQLException
+		{
+			if (this.args == null) return;
+			for (int i = 0; i < this.args.length; i++)
+			{
+				if (args[i] instanceof SqlLobValue)
+				{
+					StatementCreatorUtils.setParameterValue(ps, i + 1, Types.CLOB, null,
+							this.args[i]);
+				}
+				else
+				{
+					StatementCreatorUtils.setParameterValue(ps, i + 1, SqlTypeValue.TYPE_UNKNOWN,
+							null, this.args[i]);
+				}
+			}
+
+		}
+
+		public void cleanupParameters()
+		{
+			StatementCreatorUtils.cleanupParameters(this.args);
+		}
+	}
+
+	// 32
+	private static class ArgTypePreparedStatementSetter implements PreparedStatementSetter,
+			ParameterDisposer
+	{
+
+		private final Object[] args;
+
+		private final int[] argTypes;
+
+		public ArgTypePreparedStatementSetter(Object[] args, int[] argTypes)
+		{
+			if ((args != null && argTypes == null) || (args == null && argTypes != null)
+					|| (args != null && args.length != argTypes.length))
+			{
+				throw new InvalidDataAccessApiUsageException(
+						"args and argTypes parameters must match");
+			}
+			this.args = args;
+			this.argTypes = argTypes;
+		}
+
+		public void setValues(PreparedStatement ps) throws SQLException
+		{
+			if (this.args == null) return;
+			for (int i = 0; i < this.args.length; i++)
+			{
+				StatementCreatorUtils.setParameterValue(ps, i + 1, this.argTypes[i], null,
+						this.args[i]);
+			}
+
+		}
+
+		public void cleanupParameters()
+		{
+			StatementCreatorUtils.cleanupParameters(this.args);
+		}
+	}
+
+	// 33
+	private class RowCallbackHandlerResultSetExtractor<T> implements ResultSetExtractor<List<T>>
+	{
+
+		private final RowMapper<T> rowMapper;
+
+		private final int rowsExpected;
+
+		/**
+		 * Create a new RowMapperResultSetExtractor.
+		 * 
+		 * @param rowMapper the RowMapper which creates an object for each row
+		 */
+		public RowCallbackHandlerResultSetExtractor(RowMapper<T> rowMapper)
+		{
+			this(rowMapper, 0);
+		}
+
+		/**
+		 * Create a new RowMapperResultSetExtractor.
+		 * 
+		 * @param rowMapper the RowMapper which creates an object for each row
+		 * @param rowsExpected the number of expected rows (just used for optimized collection
+		 *            handling)
+		 */
+		public RowCallbackHandlerResultSetExtractor(RowMapper<T> rowMapper, int rowsExpected)
+		{
+			Assert.notNull(rowMapper, "RowMapper is required");
+			this.rowMapper = rowMapper;
+			this.rowsExpected = rowsExpected;
+		}
+
+		public List<T> extractData(ResultSet rs) throws SQLException
+		{
+			List<T> results = (this.rowsExpected > 0 ? new ArrayList<T>(this.rowsExpected)
+					: new ArrayList<T>());
+			int rowNum = 0;
+			boolean isnext = true;
+
+			int start = JdbcTemplateEx.this.getFirstResult();
+			int end = JdbcTemplateEx.this.getLastResult();
+
+			if (start > end)
+				throw new SQLException(
+						"JdbcTemplateEx Start postion greator than JdbcTemplateEx end");
+			for (int i = 1; i <= start; i++)
+			{
+				isnext = rs.next();
+			}
+			for (int i = start; i <= end && isnext; i++)
+			{
+				int x = 1;
+				results.add(this.rowMapper.mapRow(rs, x++));
+				isnext = rs.next();
+			}
+			return results;
+		}
+
+	}
+
+	// 34
+	public List queryForList(String sql, Class elementType) throws DataAccessException
+	{
+		return queryEx(sql, new SingleColumnRowMapper(elementType));
+	}
+
+	// 35
+	public List queryForList(String sql) throws DataAccessException
+	{
+		return queryEx(sql, this.getColumnMapRowMapperEx());
+	}
+
+	// 37
+	public List queryForList(String sql, final Object[] args, Class elementType)
+			throws DataAccessException
+	{
+		return queryEx(sql, args, new SingleColumnRowMapper(elementType));
+	}
+
+	// 39
+	public List queryForList(String sql, final Object[] args) throws DataAccessException
+	{
+		return queryEx(sql, args, this.getColumnMapRowMapperEx());
+	}
+
+	// 39
+	public List queryForList(String sql, final String arg) throws DataAccessException
+	{
+		return queryEx(sql, new Object[] { arg }, this.getColumnMapRowMapperEx());
+
+	}
+
+	// 40
+	public Map queryForMap(String sql, Object[] args, int[] argTypes) throws DataAccessException
+	{
+		try
+		{
+			return (Map) queryForObject(sql, args, argTypes, this.getColumnMapRowMapperEx());
+		}
+		catch (IncorrectResultSizeDataAccessException e)
+		{
+			return new HashMap();
+		}
+	}
+
+	// 41
+	public Map queryForMap(String sql) throws DataAccessException
+	{
+		try
+		{
+			return (Map) queryForObject(sql, this.getColumnMapRowMapperEx());
+		}
+		catch (IncorrectResultSizeDataAccessException e)
+		{
+			return new HashMap();
+		}
+	}
+
+	// 42
+	public Map queryForMap(String sql, Object[] args) throws DataAccessException
+	{
+		try
+		{
+			return (Map) queryForObject(sql, args, this.getColumnMapRowMapperEx());
+		}
+		catch (IncorrectResultSizeDataAccessException e)
+		{
+			return new HashMap();
+		}
+	}
+
+	public Map queryForMap(String sql, String arg) throws DataAccessException
+	{
+		try
+		{
+			return (Map) queryForObject(sql, new Object[] { arg }, this.getColumnMapRowMapperEx());
+		}
+		catch (IncorrectResultSizeDataAccessException e)
+		{
+			return new HashMap();
+		}
+	}
+
+	// 43
+	public String queryForString(String sql) throws DataAccessException
+	{
+		try
+		{
+			return (String) queryForObject(sql, String.class);
+		}
+		catch (IncorrectResultSizeDataAccessException e)
+		{
+			return "";
+		}
+	}
+
+	// 44
+	public String queryForString(String sql, Object args[]) throws DataAccessException
+	{
+		try
+		{
+			return (String) queryForObject(sql, args, String.class);
+		}
+		catch (IncorrectResultSizeDataAccessException e)
+		{
+			return "";
+		}
+
+	}
+
+	// 45
+	public int update(String sql, final Object[] args) throws DataAccessException
+	{
+		return update(sql, new ArgPreparedStatementSetter(args));
+	}
+
+	// 45
+	public int update(String sql, final Object[] args, int[] types) throws DataAccessException
+	{
+		return super.update(sql, args, types);
+	}
+
+	// 46
+	public int[] batchUpdate(String sql, final BatchPreparedStatementSetter pss)
+			throws DataAccessException
+	{
+		if (logger.isDebugEnabled())
+		{
+			logger.debug("Executing SQL batch update [" + sql + "]");
+		}
+		return (int[]) execute(sql, new PreparedStatementCallback()
+		{
+			public Object doInPreparedStatement(PreparedStatement ps) throws SQLException
+			{
+				try
+				{
+					int batchSize = pss.getBatchSize();
+					if (JdbcUtils.supportsBatchUpdates(ps.getConnection()))
+					{
+						for (int i = 0; i < batchSize; i++)
+						{
+							pss.setValues(ps, i);
+							ps.addBatch();
+						}
+						return ps.executeBatch();
+					}
+					else
+					{
+						int[] rowsAffected = new int[batchSize];
+						for (int i = 0; i < batchSize; i++)
+						{
+							pss.setValues(ps, i);
+							rowsAffected[i] = ps.executeUpdate();
+						}
+						return rowsAffected;
+					}
+				}
+				finally
+				{
+					if (pss instanceof ParameterDisposer)
+					{
+						((ParameterDisposer) pss).cleanupParameters();
+					}
+				}
+			}
+		});
+	}
+
+	// 47
+	public boolean hasResult(String sql) throws DataAccessException
+	{
+		this.setFirstResult(1);
+		this.setLastResult(1);
+		List list = queryForList(sql);
+		this.setFirstResult(1);
+		this.setLastResult(Integer.MAX_VALUE);
+		if (list == null) return false;
+		if (list.size() == 0) return false;
+		return true;
+	}
+
+	// 48
+	public boolean hasResult(String sql, Object args[]) throws DataAccessException
+	{
+		this.setFirstResult(1);
+		this.setLastResult(1);
+		List list = queryForList(sql, args);
+		this.setFirstResult(1);
+		this.setLastResult(Integer.MAX_VALUE);
+		if (list == null) return false;
+		if (list.size() == 0) return false;
+		return true;
+	}
+
+	// 49
+	private LobHelper getLobHelper()
+	{
+		ApplicationContext ctx = ApplicationFactory.getContext();
+		if (ctx.containsBeanDefinition("lobHelper"))
+		{
+			return (LobHelper) ctx.getBean("lobHelper");
+		}
+		return null;
+	}
+
+	// 50
+	private RowMapper getColumnMapRowMapperEx()
+	{
+		ApplicationContext ctx = ApplicationFactory.getContext();
+		if (ctx.containsBeanDefinition("dataTypeMapping"))
+		{
+			return (RowMapper) ctx.getBean("dataTypeMapping");
+		}
+		return new ColumnMapRowMapper();
+	}
+
+	// 51
+	private AbstractSequenceMaxValueIncrementer getSequenceIncrementer(String tableName)
+	{
+		ApplicationContext ctx = ApplicationFactory.getContext();
+		if (ctx.containsBeanDefinition("SequenceIncrementer"))
+		{
+			AbstractSequenceMaxValueIncrementer sequenceIncrementer = (AbstractSequenceMaxValueIncrementer) ctx
+					.getBean("SequenceIncrementer");
+			sequenceIncrementer.setDataSource(this.getDataSource());
+			return sequenceIncrementer;
+		}
+		return null;
+	}
+}

+ 53 - 0
src/com/acc/framework/FrameworkFactory.java

@@ -0,0 +1,53 @@
+package com.acc.framework;
+
+import oracle.net.ano.AuthenticationService;
+
+import org.springframework.context.ApplicationContext;
+
+import com.acc.common.spring.ApplicationFactory;
+import com.acc.framework.dictionary.service.DictionaryService;
+import com.acc.framework.resources.PropertiesUtils;
+import com.acc.framework.session.service.SessionService;
+import com.acc.util.common.StringValue;
+import com.acc.util.common.UrlPrefix;
+
+public class FrameworkFactory
+{
+
+	public static AuthenticationService getAuthenticationService()
+	{
+		ApplicationContext ctx = ApplicationFactory.getContext();
+		return (AuthenticationService) ctx.getBean("AuthenticationService");
+	}
+
+	public static UrlPrefix getURLPrefix()
+	{
+		ApplicationContext ctx = ApplicationFactory.getContext();
+		return (UrlPrefix) ctx.getBean("UrlPrefix");
+	}
+
+	public static DictionaryService getDictionaryService()
+	{
+		ApplicationContext ctx = ApplicationFactory.getContext();
+		return (DictionaryService) ctx.getBean("DictionaryService");
+	}
+
+	public static PropertiesUtils getPropertiesUtils()
+	{
+		ApplicationContext ctx = ApplicationFactory.getContext();
+		return (PropertiesUtils) ctx.getBean("propertiesUtils");
+	}
+
+	public static String getBackupDir()
+	{
+		ApplicationContext ctx = ApplicationFactory.getContext();
+		StringValue sv = (StringValue) ctx.getBean("SysBackup");
+		return sv.getStringValue();
+	}
+
+	public static SessionService getSessionService()
+	{
+		ApplicationContext ctx = ApplicationFactory.getContext();
+		return (SessionService) ctx.getBean("SessionService");
+	}
+}

+ 134 - 0
src/com/acc/framework/dictionary/action/DictionaryAction.java

@@ -0,0 +1,134 @@
+package com.acc.framework.dictionary.action;
+
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.util.List;
+import java.util.Map;
+
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletResponse;
+
+import net.sf.json.JSONArray;
+
+import org.apache.commons.collections.MapUtils;
+import org.apache.struts2.ServletActionContext;
+import org.springframework.stereotype.Component;
+
+import com.acc.framework.dictionary.service.DictionaryService;
+import com.acc.util.common.ParameterUtil;
+import com.opensymphony.xwork2.ActionSupport;
+
+@Component
+public class DictionaryAction extends ActionSupport {
+	/*
+	@Resource(name = "DictionaryService")
+	private DictionaryService dictionaryService;
+	private List list;
+	private String str;
+	private String datadictid;
+	public String getStr() {
+		return str;
+	}
+
+	public void setStr(String str) {
+		this.str = str;
+	}
+
+	public List getList() {
+		return list;
+	}
+
+	public void setList(List list) {
+		this.list = list;
+	}
+	public String getDatadictid() {
+		return datadictid;
+	}
+
+	public void setDatadictid(String datadictid) {
+		this.datadictid = datadictid;
+	}
+	/*
+	 * 取到数据字典中的父节点和子节点;
+	 */
+	/*
+	public String list() throws Exception {
+		HttpServletResponse response = ServletActionContext.getResponse();
+		response.setCharacterEncoding("UTF-8");
+		response.setContentType("application/json; charset=UTF-8");
+		PrintWriter out = response.getWriter();
+		List<Map> list = dictionaryService.getDictionaryTree();
+		for (int i = list.size() - 1; i > -1; i--) {
+			Map map = list.get(i);
+			map.put("id", MapUtils.getObject(map, "ID"));
+			map.put("pId", MapUtils.getObject(map, "PID"));
+			map.put("name", MapUtils.getObject(map, "NAME"));
+			map.put("url", MapUtils.getObject(map, "URL"));
+			map.put("target", MapUtils.getObject(map, "TARGET"));
+		}
+		JSONArray jsonArray = JSONArray.fromObject(list);
+		out.write(jsonArray.toString());
+		return null;
+	}
+
+	public String frame() throws Exception {
+		return "dictionary";
+	}
+
+	public String detail() throws Exception {
+	return "dictionary";
+	}
+	/*
+	 * 添加数据字典添加成功返回result值 -1为插入值存在 -2为插入未成功
+	 */
+	/*
+	public String insert() throws Exception{
+		Map map = ParameterUtil.getParameter(ServletActionContext.getRequest());
+		String result=dictionaryService.insertSecondTree(map);
+		ServletActionContext.getResponse().getWriter().write(result.toString());
+		return null;
+	}
+	/*
+	 * 修改数据字典-1为修改id存在 -2修改不成功 1为修改成功
+	 */
+	/*
+	public String update() throws Exception {
+		Map map = ParameterUtil.getParameter(ServletActionContext.getRequest());
+		String result=dictionaryService.saveOrUpdate(map);
+		ServletActionContext.getResponse().getWriter().write(result);
+		return null;
+	}
+	/*
+	 * 删除字典数据
+	 */
+	/*
+	public String delete() throws Exception {
+		Map map = ParameterUtil.getParameter(ServletActionContext.getRequest());
+		String result=dictionaryService.deleteDictionary(map);
+		ServletActionContext.getResponse().getWriter().write(result);
+		return null;
+	}
+	/*
+	 * 通过父节点找到子节点然后按order排序 拼接成option形式以便于前台select(下拉)
+	 */
+	/*
+	public String order() throws Exception {
+		String DATADICTINFOID = ServletActionContext.getRequest().getParameter("DATADICTINFOID");
+		String str=dictionaryService.queryDictionary(DATADICTINFOID);
+		this.setStr(str);
+		this.setDatadictid(DATADICTINFOID);
+		return "dictionary";
+	}
+	/*
+	 * 通过父节点重新排序 返回1成功 -1 不成功
+	 
+	
+	public String updateorder() throws Exception {
+		String DATADICTORDER[]=ServletActionContext.getRequest().getParameterValues("ReferenceID");
+		String DATADICTINFOID=ServletActionContext.getRequest().getParameter("DATADICTINFOID");
+		String result=dictionaryService.updateDataDictOrder(DATADICTINFOID, DATADICTORDER);
+		ServletActionContext.getResponse().getWriter().write(result);
+		return null;
+	}
+	*/
+}

+ 146 - 0
src/com/acc/framework/dictionary/dao/DataDictInfoDAO.java

@@ -0,0 +1,146 @@
+package com.acc.framework.dictionary.dao;
+
+import java.util.List;
+import java.util.Map;
+
+import org.apache.commons.collections.MapUtils;
+
+import com.acc.common.jdbc.JdbcDaoSupportEx;
+import com.acc.common.jdbc.JdbcTemplateEx;
+
+
+public class DataDictInfoDAO extends JdbcDaoSupportEx
+{
+	public void insertDAO(Map map)
+	{
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		template.insertMap(map, "DataDictInfo");
+	}
+	public void insertDAOlog(Map map)
+	{
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		template.insertMap(map, "DATADICTINFO_LOG");
+	}
+
+	public void updateDataDict(String DATADICTID, String REFERENCEID,String ID,String VALUE,String ISPREDEFINE)
+	{
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		String sql = "update DataDictInfo set ReferenceID=?,referencevalue=?,ispredefine=?  where DataDictInfoId=? and ReferenceID=?";
+		template.update(sql, new Object[] { ID,VALUE,ISPREDEFINE,DATADICTID, REFERENCEID});
+	}
+
+	public void updateDataDictOrder(String DataDictOrder, String DataDictInfoId, String ReferenceID)
+	{
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		String sql = "update DataDictInfo set DataDictOrder=? where DataDictInfoId=? and ReferenceID=?";
+		template.update(sql, new Object[] { DataDictOrder, DataDictInfoId, ReferenceID });
+	}
+
+	public void deleteDAO(String DataDictInfoId, String ReferenceID)
+	{
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		String sql = " delete from DataDictInfo where DataDictInfoId=? and ReferenceID=?";
+		template.update(sql, new Object[] { DataDictInfoId, ReferenceID });
+	}
+
+	public boolean checkDictionaryNumberExist(String DataDictInfoId, String ReferenceID)
+	{
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		String sql = "select * from DataDictInfo where DataDictInfoId=? and ReferenceID=?";
+		return template.hasResult(sql, new Object[] { DataDictInfoId, ReferenceID });
+	}
+	public Map opinionReferenceID(String DataDictInfoId, String ReferenceID)
+	{
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		String sql = "select * from DataDictInfo where datadictinfoid=? and ReferenceID=?";
+		return template.queryForMap(sql, DataDictInfoId,ReferenceID);
+	}
+	public Map opinionReferenceValue(String DataDictInfoId, String Value)
+	{
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		String sql = "select * from DataDictInfo where datadictinfoid=? and referencevalue=?";
+		return template.queryForMap(sql, DataDictInfoId,Value);
+	}
+	public int queryMaxDatadictorder(String DataDictInfoId)
+	{
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		String sql="select max(datadictorder) datadictorder from datadictinfo where datadictinfoid =?";
+		List list =template.queryForList(sql, new Object[] { DataDictInfoId});
+		Map map=(Map)list.get(0);
+		return MapUtils.getIntValue(map, "DATADICTORDER");
+	}
+	public List checkDictionaryNameExist(String DataDictInfoId, String ReferenceValue)
+	{
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		String sql = "select * from DataDictInfo where datadictinfoid=? and referenceid=?";
+		return template.queryForList(sql, new Object[] { DataDictInfoId, ReferenceValue});
+	}
+	public List selectFirstDelete(String DataDictInfoId, String referenceid)
+	{
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		String sql = "select * from DataDictInfo where datadictinfoid=? and referenceid=? ";
+		return template.queryForList(sql, new Object[] { DataDictInfoId,referenceid});
+	}
+
+	public List queryDataDictInfoById(String DataDictInfoId)
+	{
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		String sql = " select * from DataDictInfo where DataDictInfoId=? order by DataDictOrder";
+		return template.queryForList(sql, new Object[] { DataDictInfoId });
+	}
+
+	public List queryDataDictInfoIdList()
+	{
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		String sql = "select distinct DataDictInfoId from DataDictInfo order by DataDictInfoId";
+		return template.queryForList(sql);
+	}
+	
+	
+
+	
+	public List queryDataDicDiQU()
+	{
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		String sql="select referenceid from datadictinfo where datadictinfoid ='Area'";
+		return template.queryForList(sql);
+	}
+	
+
+	public List queryDataDicJieDao(String DiQu)
+	{
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		String sql="select referenceid from datadictinfo where datadictinfoid ='Area' and referenceid like '%"+DiQu+"%'";
+		return template.queryForList(sql);
+	}
+
+	public List queryDataDicPinPai(String goods)
+	{
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		String sql="select referenceid from datadictinfo where datadictinfoid ='Good'and referenceid like '%"+goods+"%'";
+		return template.queryForList(sql);
+	}
+
+	
+	public List queryDataPaiChuSuo(String fenju)
+	{
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		String sql="select referenceid from datadictinfo where datadictinfoid ='SJ'and referenceid like '%"+fenju+"%'";
+		return template.queryForList(sql);
+	}
+	
+	public String getBoroughName(String boroughId)
+	{
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		String sql="select referencevalue from datadictinfo where datadictinfoid = 'XZQH' and referenceid = '"+boroughId+"'";
+		
+		return template.queryForMap(sql).get("referencevalue").toString();
+	}
+	
+	public List getResultByDatadictinfoid(String datadictinfoid)
+	{
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		String sql="select * from datadictinfo t where datadictinfoid = '"+datadictinfoid+"'";
+		return template.queryForList(sql);
+	}
+}

+ 38 - 0
src/com/acc/framework/dictionary/dao/DictionaryDAO.java

@@ -0,0 +1,38 @@
+package com.acc.framework.dictionary.dao;
+
+import java.util.List;
+import java.util.Map;
+
+import com.acc.common.jdbc.JdbcDaoSupportEx;
+import com.acc.common.jdbc.JdbcTemplateEx;
+
+public class DictionaryDAO extends JdbcDaoSupportEx
+{
+	/*
+	 * 取到英文父节点
+	 */
+	public List queryDictionaryParent0()
+	{
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		String sql = "select t.DataDictId,t.datadictname from datadict t where t.datadictid in (select parentid from datadict)";
+		return template.queryForList(sql);
+	}
+	/*
+	 * 取到节点中为父节点为-1的节点
+	 */
+	public List queryDictionaryParent1()
+	{
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		String sql = "select t.DataDictId,t.datadictname,t.parentid from datadict t where t.parentid ='-1'";
+		return template.queryForList(sql);
+	}
+	/*
+	 * 
+	 */
+	public List queryDatadictinfo(String DataDictId)
+	{
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		String sql = "select t.DataDictId,t.datadictname,t.parentid from datadict t where t.parentid=?";
+		return template.queryForList(sql, new Object[] { DataDictId});
+	}
+}

+ 33 - 0
src/com/acc/framework/dictionary/sql/DictionarySQL.java

@@ -0,0 +1,33 @@
+package com.acc.framework.dictionary.sql;
+
+import javax.servlet.ServletConfig;
+import javax.servlet.http.HttpServletRequest;
+
+import com.acc.common.jdbc.ISQL;
+
+public class DictionarySQL implements ISQL
+{
+	/**
+	 * getSQL
+	 * 
+	 * @param request HttpServletRequest
+	 * @param servletConfig ServletConfig
+	 * @return String
+	 */
+	public String getSQL(HttpServletRequest request, ServletConfig servletConfig)
+	{
+		String DATADICTID=request.getParameter("datadictid");
+		String REFERENCEID=request.getParameter("REFERENCEID");
+		String REFERENCEVALUE=request.getParameter("REFERENCEVALUE");
+		String sql = "select * from DataDictInfo where DataDictInfoId='"+DATADICTID+"'";
+		if (REFERENCEID != null && REFERENCEID.length()>0){
+			   sql=sql+" and referenceid='"+REFERENCEID+"'";
+		}
+		if (REFERENCEVALUE != null && REFERENCEVALUE.length()>0){
+			  sql=sql+" and referencevalue like'%"+REFERENCEVALUE+"%'";
+		}
+		  	  sql=sql+" order by DataDictOrder";
+		return sql;
+	}
+
+}

+ 48 - 0
src/com/acc/framework/resources/PropertiesUtils.java

@@ -0,0 +1,48 @@
+package com.acc.framework.resources;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+
+import org.apache.commons.lang.StringUtils;
+import org.springframework.beans.BeansException;
+import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
+import org.springframework.beans.factory.config.PropertyPlaceholderConfigurer;
+
+public class PropertiesUtils extends PropertyPlaceholderConfigurer
+{
+	private static Map<String, List> ctxPropertiesMap;
+
+	@Override
+	protected void processProperties(ConfigurableListableBeanFactory beanFactory, Properties props)
+			throws BeansException
+	{
+
+		super.processProperties(beanFactory, props);
+		ctxPropertiesMap = new HashMap<String, List>();
+		for (Object key : props.keySet())
+		{
+			List list = new ArrayList();
+			String keyStr = key.toString();
+			String value = props.getProperty(keyStr);
+			String[] mapstr = StringUtils.split(value, ",");
+			for (String str : mapstr)
+			{
+				Map map = new HashMap();
+				String[] sgile = StringUtils.split(str, ":");
+				map.put("key", sgile[0]);
+				map.put("value", sgile[1]);
+				list.add(map);
+			}
+			ctxPropertiesMap.put(keyStr, list);
+		}
+	}
+
+	public static List getResourceProperty(String keyname)
+	{
+		return ctxPropertiesMap.get(keyname);
+	}
+
+}

+ 4 - 0
src/com/acc/framework/resources/SystemResources.properties

@@ -0,0 +1,4 @@
+systemmanager.page.openstat=0:\u5173\u95ed,1:\u6253\u5f00
+systemmanager.page.opentype=0:\u7236\u83dc\u5355,1:\u5de6\u83dc\u5355,2:\u5185\u5bb9\u533a
+systemmanager.dict.opentype=0:\u505c\u7528,1:\u542f\u7528
+systemmanager.user.userstatus=1:\u6b63\u5e38,2:\u505c\u7528

+ 4 - 0
src/com/acc/framework/resources/SystemResources_src.properties

@@ -0,0 +1,4 @@
+systemmanager.page.openstat=0:关闭,1:打开
+systemmanager.page.opentype=0:父菜单,1:左菜单,2:内容区
+systemmanager.dict.opentype=0:停用,1:启用
+systemmanager.user.userstatus=1:正常,2:停用

+ 2 - 0
src/com/acc/framework/resources/run.bat

@@ -0,0 +1,2 @@
+del ApplicationResources.properties 
+native2ascii SystemResources_src.properties SystemResources.properties

+ 31 - 0
src/com/acc/framework/session/service/SessionListener.java

@@ -0,0 +1,31 @@
+package com.acc.framework.session.service;
+
+import javax.servlet.http.HttpSession;
+import javax.servlet.http.HttpSessionBindingEvent;
+import javax.servlet.http.HttpSessionBindingListener;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import com.acc.GlobalsParameter;
+import com.acc.framework.FrameworkFactory;
+
+public class SessionListener implements HttpSessionBindingListener
+{
+	protected Log log = LogFactory.getLog(this.getClass());
+
+	public void valueBound(HttpSessionBindingEvent event)
+	{
+
+	}
+
+	public void valueUnbound(HttpSessionBindingEvent event)
+	{
+		HttpSession session = event.getSession();
+		if (event.getName().equals(GlobalsParameter.SYSTEM_LOGIN))
+		{
+			SessionService service = FrameworkFactory.getSessionService();
+			service.removeSession(session.getId());
+		}
+	}
+}

+ 16 - 0
src/com/acc/framework/session/service/SessionService.java

@@ -0,0 +1,16 @@
+package com.acc.framework.session.service;
+
+import java.util.HashMap;
+
+import javax.servlet.http.HttpSession;
+
+import com.acc.framework.session.UserInfo;
+
+public interface SessionService
+{
+	public void addSession(UserInfo userinfo, HttpSession session);
+
+	public void removeSession(String sessionId);
+
+	public HashMap getSessionMap();
+}

+ 56 - 0
src/com/acc/framework/session/service/SessionServiceImpl.java

@@ -0,0 +1,56 @@
+package com.acc.framework.session.service;
+
+import java.util.HashMap;
+
+import javax.servlet.http.HttpSession;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import com.acc.GlobalsParameter;
+import com.acc.framework.session.UserInfo;
+import com.acc.framework.session.dao.OnlineSessionDAO;
+
+public class SessionServiceImpl implements SessionService
+{
+	protected Log log = LogFactory.getLog(this.getClass());
+
+	private HashMap sessionMap;
+
+	private OnlineSessionDAO onlineSessionDAO;
+
+	public void setOnlineSessionDAO(OnlineSessionDAO onlineSessionDAO)
+	{
+		this.onlineSessionDAO = onlineSessionDAO;
+	}
+
+	public HashMap getSessionMap()
+	{
+		return sessionMap;
+	}
+
+	public OnlineSessionDAO getOnlineSessionDAO()
+	{
+		return onlineSessionDAO;
+	}
+
+	public void init()
+	{
+		sessionMap = new HashMap();
+		onlineSessionDAO.deleteOnline();
+	}
+
+	public void addSession(UserInfo userinfo, HttpSession session)
+	{
+		session.setAttribute(GlobalsParameter.SYSTEM_LOGIN, new SessionListener());
+		sessionMap.put(session.getId(), session);
+		//onlineSessionDAO.insertSessionByUserInfo(userinfo);
+	}
+
+	public void removeSession(String sessionId)
+	{
+		sessionMap.remove(sessionId);
+		//onlineSessionDAO.deleteSessionById(sessionId);
+	}
+
+}

+ 40 - 0
src/com/acc/framework/session/util/SessionUtil.java

@@ -0,0 +1,40 @@
+package com.acc.framework.session.util;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpSession;
+
+import com.acc.framework.FrameworkFactory;
+import com.acc.framework.session.service.SessionService;
+
+public class SessionUtil
+{
+	public static HttpSession getSession(HttpServletRequest request, boolean create)
+	{
+		HttpSession session = request.getSession(create);
+		String jsessionid = request.getParameter("Tool_SessionId");
+		if (jsessionid != null && jsessionid.length() > 0)
+		{
+			SessionService service = FrameworkFactory.getSessionService();
+			HttpSession toolSession = (HttpSession) service.getSessionMap().get(jsessionid);
+			if (toolSession != null) return toolSession;
+		}
+		return session;
+	}
+
+	public static HttpSession getSession(HttpServletRequest request)
+	{
+		HttpSession session = request.getSession();
+		String jsessionid = request.getParameter("Tool_SessionId");
+		if (jsessionid != null && jsessionid.length() > 0)
+		{
+			SessionService service = FrameworkFactory.getSessionService();
+			HttpSession toolSession = (HttpSession) service.getSessionMap().get(jsessionid);
+			if (toolSession != null)
+			{
+				return toolSession;
+			}
+		}
+		return session;
+	}
+
+}

+ 272 - 0
src/com/acc/framework/tht/action/LoginAction.java

@@ -0,0 +1,272 @@
+package com.acc.framework.tht.action;
+
+import java.io.IOException;
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.HttpSession;
+
+import net.sf.json.JSONArray;
+
+import org.apache.commons.collections.MapUtils;
+import org.apache.commons.lang.StringUtils;
+import org.apache.struts2.ServletActionContext;
+import org.springframework.stereotype.Component;
+
+import com.acc.framework.tht.service.LoginService;
+import com.acc.util.common.IPUtil;
+import com.acc.util.common.ParameterUtil;
+import com.opensymphony.xwork2.ActionSupport;
+
+@Component
+public class LoginAction extends ActionSupport
+{
+	@Resource(name = "loginService")
+	private LoginService loginService;
+	/*
+	 * 查询登陆
+	 * 唐朝
+	 */
+	public String login() throws IOException{
+		Map map = ParameterUtil.getParameter(ServletActionContext.getRequest());
+		Object result = "-1";
+		List userList=loginService.queryUser(map);
+		try
+		{
+			if(userList.size()==1){
+				HttpServletRequest request = ServletActionContext.getRequest();  
+				HttpSession session=request.getSession();
+				String powerId=MapUtils.getString((Map) userList.get(0), "powerId");
+				String userName=MapUtils.getString((Map) userList.get(0), "userName");
+				String user=MapUtils.getString((Map) userList.get(0), "user");
+				session.setAttribute("powerId", powerId);
+				session.setAttribute("user", user);
+				session.setAttribute("userName", userName);
+				result = "1" ;
+			}
+		}
+		catch (Exception ex)
+		{
+			result = "-2";
+		}
+		ServletActionContext.getResponse().getWriter().write(result.toString());
+		return null;
+
+	}
+	/*
+	 * 查询列表
+	 * 唐朝
+	 */
+	
+	public String queryMenu() throws IOException
+	{
+		HttpServletRequest request = ServletActionContext.getRequest();  
+		String powerId=request.getParameter("powerId");
+		List menuList = loginService.queryMenu(powerId);
+		request.setAttribute("menuList",menuList);
+		return "menu";
+	}
+	
+	/*
+	 * 查询列表
+	 * 唐朝
+	 */
+	
+	public String left() throws IOException{
+		Map map = ParameterUtil.getParameter(ServletActionContext.getRequest());
+		try
+		{
+			HttpServletRequest request = ServletActionContext.getRequest();  
+			String powerId=request.getParameter("powerId");
+			List menuList = loginService.queryMenu(powerId);
+			JSONArray jsonArr = JSONArray.fromObject(menuList);
+			HttpServletResponse response=ServletActionContext.getResponse();
+			response.setCharacterEncoding("UTF-8");
+			ServletActionContext.getResponse().getWriter().write(jsonArr.toString());
+		}
+		catch (Exception e)
+		{
+			e.printStackTrace();
+		}
+		
+		
+		return null;
+
+	}
+	
+	
+	/*
+	 * 查询列表
+	 * 唐朝
+	 */
+	
+	public String inputUser() throws IOException{
+		Map map = ParameterUtil.getParameter(ServletActionContext.getRequest());
+		try
+		{
+			HttpServletRequest request = ServletActionContext.getRequest();  
+			String powerId=request.getParameter("powerId");
+			List userList = loginService.queryUser();
+			JSONArray jsonArr = JSONArray.fromObject(userList);
+			HttpServletResponse response=ServletActionContext.getResponse();
+			response.setCharacterEncoding("UTF-8");
+			ServletActionContext.getResponse().getWriter().write(jsonArr.toString());
+		}
+		catch (Exception e)
+		{
+			e.printStackTrace();
+		}
+		
+		
+		return null;
+
+	}
+	
+	/*
+	 * 用户管理
+	 * 查询用户
+	 * 唐朝
+	 */
+	
+	public String query() throws IOException
+	{
+		Map map = ParameterUtil.getParameter(ServletActionContext.getRequest());
+		HttpServletRequest request = ServletActionContext.getRequest();
+		String flag="0";
+		String a=MapUtils.getString(map, "flag","0");
+		flag=a;
+		List userList=new ArrayList();
+		String userNameC=MapUtils.getString(map, "userNameC","0");
+		if(flag.equals("1")){
+			String updateIp=IPUtil.getIpAddr(request);
+			map.put("updateIp", updateIp);
+			loginService.addUser(map);
+		}
+		//修改
+		else if(flag.equals("2")){
+			String updateIp=IPUtil.getIpAddr(request);
+			map.put("updateIp", updateIp);
+			loginService.updateUser(map);
+		}
+		//删除
+		else if(flag.equals("3")){
+			String user=MapUtils.getString(map, "user");
+			loginService.deleteUser(user);
+		}
+		if(userNameC.equals("0")){
+			userList=loginService.queryUser();
+		}else{
+			userList=loginService.queryUser(userNameC);
+		}
+		request.setAttribute("userList",userList);
+		return "list";
+	}
+	/*
+	 * 用户管理
+	 * 查询用户
+	 * 唐朝
+	 */
+	
+	public String queryUser() throws IOException
+	{
+		Map map = ParameterUtil.getParameter(ServletActionContext.getRequest());
+		HttpServletRequest request = ServletActionContext.getRequest();
+		String flag="0";
+		String a=MapUtils.getString(map, "flag","0");
+		flag=a;
+		List userList=new ArrayList();
+		String userNameC=MapUtils.getString(map, "userNameC","0");
+		if(flag.equals("1")){
+			String updateIp=IPUtil.getIpAddr(request);
+			map.put("updateIp", updateIp);
+			loginService.addUser(map);
+		}
+		//修改
+		else if(flag.equals("2")){
+			String updateIp=IPUtil.getIpAddr(request);
+			map.put("updateIp", updateIp);
+			loginService.updateUser(map);
+		}
+		//删除
+		else if(flag.equals("3")){
+			String user=MapUtils.getString(map, "user");
+			loginService.deleteUser(user);
+		}
+		if(userNameC.equals("0")){
+			userList=loginService.queryUser();
+		}else{
+			userList=loginService.queryUser(userNameC);
+		}
+		request.setAttribute("userList",userList);
+		return "wl";
+	}
+	/*
+	 * 修改用户前先查询用户信息
+	 * 唐朝
+	 */
+	public String update() throws IOException
+	{
+		HttpServletRequest request = ServletActionContext.getRequest();
+		String user=request.getParameter("user");
+		List updateList=loginService.updateUser(user);
+		request.setAttribute("updateList",updateList);
+		return "list";
+	}
+	/*
+	 * 修改用户前先查询用户信息
+	 * 唐朝
+	 */
+	public String updateUser() throws IOException
+	{
+		HttpServletRequest request = ServletActionContext.getRequest();
+		String user=request.getParameter("user");
+		List updateList=loginService.updateUser(user);
+		request.setAttribute("updateList",updateList);
+		return "wl";
+	}
+	/*
+	 * 公告 当点击修改是在数据库中添加一条信息 作为历史展示最后一条信息
+	 * 唐朝
+	 */
+	public String right() throws IOException
+	{
+		Map map = ParameterUtil.getParameter(ServletActionContext.getRequest());
+		HttpServletRequest request = ServletActionContext.getRequest();
+		HttpSession session=request.getSession();
+		String user=(String)session.getAttribute("user");
+		String flag=MapUtils.getString(map, "flag","0");
+		if(!flag.equals("0")&&StringUtils.isNotBlank(flag)){
+			map.put("user", user);
+			loginService.addAnnoun(map);
+		}
+		Map annMap=loginService.selectAnnoun();
+		request.setAttribute("annMap",annMap);
+		return "right";
+	}
+	public String updateU() throws IOException
+	{
+		HttpServletRequest request = ServletActionContext.getRequest();  
+		HttpSession session=request.getSession();
+		String user=(String)session.getAttribute("user");
+		Map map = ParameterUtil.getParameter(ServletActionContext.getRequest());
+		String flag=MapUtils.getString(map,"flag","");
+		if(flag.equals("2")){
+			loginService.updateUser(map);
+		}
+		List passList=loginService.selectuser(user);
+		request.setAttribute("passList",passList);
+		return "list";
+	}
+	
+	
+	public static void main(String[] args) {
+		System.out.println("");
+               
+	}
+}

+ 131 - 0
src/com/acc/framework/tht/dao/LoginDAO.java

@@ -0,0 +1,131 @@
+package com.acc.framework.tht.dao;
+
+import java.util.List;
+import java.util.Map;
+
+import org.apache.commons.collections.MapUtils;
+import org.springframework.stereotype.Repository;
+
+import com.acc.common.annotation.inject.parent.InjectItem;
+import com.acc.common.annotation.inject.parent.ParentInject;
+import com.acc.common.jdbc.JdbcDaoSupportEx;
+import com.acc.common.jdbc.JdbcTemplateEx;
+import com.acc.util.common.MapUtil;
+
+@Repository
+@ParentInject(items = @InjectItem(attr = "dataSource", ref = "jdbcdataSource"))
+public class LoginDAO extends JdbcDaoSupportEx
+{
+	/*
+	 * 查询当前用户是否为系统用户
+	 * 唐朝
+	 */
+	public List queryUser(String loginName, String password)
+	{
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		String sql = "select * from userinfor where user=? and password= ?";
+		return template.queryForList(sql, new Object[] { loginName, password });
+	}
+	
+	/*
+	 * 根据权限查询菜单
+	 * 唐朝
+	 */
+	
+	public List queryMenu(String powerId)
+	{
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		String sql = "select * from menuinfor where powerId like '%"+powerId+"%' order by id";
+		return template.queryForList(sql);
+		
+		//return template.queryForList(sql, new Object[] { powerId});
+	}
+	
+	/*
+	 * 用户管理
+	 * 查询用户
+	 * 唐朝
+	 */
+	public List queryUser()
+	{
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		String sql = "select * from userinfor where powerId!='0'";
+		return template.queryForList(sql);
+	}
+	
+	/*
+	 * 查询用户
+	 * 唐朝
+	 */
+	
+	public List queryUser(String user)
+	{
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		String sql = "select * from userinfor where user = '"+user+"'";
+		return template.queryForList(sql);
+	}
+	public List queryUserName(String userName)
+	{
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		String sql = "select * from userinfor where userName like '%"+userName+"%' and powerId!='0'";
+		return template.queryForList(sql);
+	}
+	
+	public List querPower(String powerId){
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		String sql = "select * from power_wordbook where powerId = '"+powerId+"'";
+		return template.queryForList(sql);
+	}
+	/*
+	 * 修改用户
+	 * 唐朝
+	 */
+	public void updateUser(Map map)
+	{
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		MapUtil.filterMap(map);
+		template.updateMap(map, "userinfor", "id");
+	}
+	/*
+	 * 删除用户
+	 * 唐朝
+	 */
+	public void deleteUser(String user){
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		String sql = "delete from userinfor where user='" + user + "'";
+		template.execute(sql);
+	}
+	
+	public List querUserCountId(){
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		String sql = "select max(id) id from userinfor ";
+		return template.queryForList(sql);
+	}
+	public void addUser(Map map)
+	{
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		template.insertMap(map, "userinfor", "id");
+	}
+	
+	public int selectAnnoun(){
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		String sql = "select max(id) id from announ ";
+		return MapUtils.getIntValue((Map)template.queryForList(sql).get(0),"id");
+	}
+	
+	public void addAnnoun(Map map)
+	{
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		template.insertMap(map, "announ", "id");
+	}
+	public Map queryAnnoun(){
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		String sql = "SELECT * FROM announ t where t.id=(SELECT max(id) id from announ)";
+		return (Map)template.queryForList(sql).get(0);
+	}
+	
+	public List selectuser(String sql){
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		return template.queryForList(sql);
+	}
+}

+ 22 - 0
src/com/acc/framework/tht/service/LoginService.java

@@ -0,0 +1,22 @@
+package com.acc.framework.tht.service;
+
+import java.util.List;
+import java.util.Map;
+
+public interface LoginService
+{
+	
+	public List queryUser();
+	public List queryUser(Map map);
+	public List queryMenu(String powerId);
+	public List updateUser(String user);
+	public void updateUser(Map map);
+	public void deleteUser(String user);
+	public void addUser(Map map);
+	public List queryUser(String userName);
+	public void addAnnoun(Map map);
+	public Map selectAnnoun();
+	
+	public List selectuser(String user);
+
+}

+ 155 - 0
src/com/acc/framework/tht/service/impl/LoginServiceImpl.java

@@ -0,0 +1,155 @@
+package com.acc.framework.tht.service.impl;
+
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+import javax.annotation.Resource;
+
+import org.apache.commons.collections.MapUtils;
+import org.apache.commons.lang.StringUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.springframework.stereotype.Service;
+
+import com.acc.framework.tht.dao.LoginDAO;
+import com.acc.framework.tht.service.LoginService;
+import com.acc.util.common.DateUtil;
+
+@Service(value = "loginService")
+public class LoginServiceImpl implements LoginService
+{
+
+	private static final Log logger = LogFactory.getLog(LoginServiceImpl.class);
+
+	@Resource(name = "loginDAO")
+	private LoginDAO loginDAO;
+	/*
+	 * 判断用户登录是否存在
+	 * 唐朝
+	 */
+
+	
+	public List queryUser(Map map) {
+		
+		String user=MapUtils.getString(map, "user");
+		String password=MapUtils.getString(map, "password");
+		List login=loginDAO.queryUser(user,password);
+		return login;
+	}
+	/*
+	 * 查询当前用户的权限菜单
+	 * 唐朝
+	 */
+	public List queryMenu(String powerId) {
+		List menu=loginDAO.queryMenu(powerId);
+		return menu;
+	}
+	
+	
+	/*
+	 * 用户管理
+	 * 查询所有用户
+	 * 唐朝
+	 */
+
+	public List queryUser() {
+		List userList=loginDAO.queryUser();
+		return userList;
+	}
+	/*
+	 * 按姓名查询
+	 * 唐朝
+	 */
+	public List queryUser(String userName){
+		List userList=loginDAO.queryUserName(userName);
+		return userList;
+	}
+	/*
+	 * 修改时先查询
+	 * 唐朝
+	 */
+	public List updateUser(String user){
+		List updateList=loginDAO.queryUser(user);
+		return updateList;
+	}
+	/*
+	 * 修改用户表
+	 * 唐朝
+	 */
+	public void updateUser(Map map){
+		map.remove("flag");
+		map.remove("passworded");
+		String updateDate=DateUtil.getDateW3CFormat(new Date());
+		map.put("updateDate", updateDate);
+		String powerId=MapUtils.getString(map,"powerId");
+		String addDate=MapUtils.getString(map, "addDate");
+		map.put("addDate", addDate);
+		List powerList=loginDAO.querPower(powerId);
+		if(powerList.size()>0){
+			Map powerMap=(Map)powerList.get(0);
+			String permission=MapUtils.getString(powerMap, "permission");
+			map.put("powerName",permission );
+		}
+		loginDAO.updateUser(map);
+	}
+	/*
+	 * 删除用户
+	 * 唐朝
+	 */
+	public void  deleteUser(String user){
+		loginDAO.deleteUser(user);
+	}
+	/*
+	 * 添加用户
+	 * 唐朝
+	 */
+	public void  addUser(Map map){
+		map.remove("flag");
+		//Date date=new Date();  
+		//SimpleDateFormat formatter=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");  
+		String updateDate=DateUtil.getDateW3CFormat(new Date());
+		map.put("updateDate", updateDate);
+		map.put("addDate", updateDate);
+		String powerId=MapUtils.getString(map, "powerId");
+		List powerList=loginDAO.querPower(powerId);
+		if(powerList.size()>0){
+			Map powerMap=(Map)powerList.get(0);
+			String permission=MapUtils.getString(powerMap, "permission");
+			map.put("powerName",permission );
+		}
+		List countList=loginDAO.querUserCountId();
+		if(countList.size()>0){
+			Map countMap=(Map)countList.get(0);
+			int id=MapUtils.getIntValue(countMap, "id");
+			map.put("id",id+1 );
+		}
+		loginDAO.addUser(map);
+	}
+	
+	public void addAnnoun(Map map){
+		int id=loginDAO.selectAnnoun();
+		map.remove("flag");
+		map.put("id",id+1);
+		String createDate=DateUtil.getDateW3CFormat(new Date());
+		map.put("createDate",createDate);
+		try{
+			loginDAO.addAnnoun(map);
+		}catch(Exception e){
+			e.printStackTrace();
+		}
+		
+	}
+	public Map selectAnnoun(){
+		Map annMap=loginDAO.queryAnnoun();
+		return annMap;
+	}
+	public List selectuser(String user) {
+		String sql="select * from userinfor t where 1=1";
+		if(StringUtils.isNotBlank(user)){
+			sql+=" and t.user='"+user+"'";
+		}
+		List passList=loginDAO.selectuser(sql);
+		return passList;
+	}
+}

+ 501 - 0
src/com/acc/framework/thtkehu/action/CustomerAction.java

@@ -0,0 +1,501 @@
+package com.acc.framework.thtkehu.action;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.HttpSession;
+
+import net.sf.json.JSONArray;
+
+import org.apache.commons.collections.MapUtils;
+import org.apache.commons.lang.StringUtils;
+import org.apache.struts2.ServletActionContext;
+import org.springframework.stereotype.Component;
+
+import com.acc.framework.tht.service.LoginService;
+import com.acc.framework.thtkehu.service.CustomerService;
+import com.acc.util.common.IPUtil;
+import com.acc.util.common.ParameterUtil;
+import com.opensymphony.xwork2.ActionSupport;
+
+@Component
+public class CustomerAction extends ActionSupport
+{
+	@Resource(name = "customerService")
+	private CustomerService customerService;
+	
+	/*
+	 * 客户管理
+	 * 查询客户
+	 * 唐朝
+	 */
+	
+	public String query() throws IOException
+	{
+		Map map = ParameterUtil.getParameter(ServletActionContext.getRequest());
+		HttpServletRequest request = ServletActionContext.getRequest();
+		String flag=MapUtils.getString(map, "flag","0");
+		//添加报价客户或公司
+		if(flag.equals("1")){
+			String updateIp=IPUtil.getIpAddr(request);
+			map.put("ip", updateIp);
+			customerService.addCustomer(map);
+		}
+		//修改报价客户或公司
+		else if(flag.equals("2")){
+			String updateIp=IPUtil.getIpAddr(request);
+			map.put("ip", updateIp);
+			customerService.updateCustomer(map);
+		}
+		List customerList=customerService.queryCustomer(map);
+		request.setAttribute("customerList",customerList);
+		return "list";
+	}
+	
+	
+	/*
+	 * 修改客户前先查询客户信息
+	 * 唐朝
+	 */
+	public String update() throws IOException
+	{
+		HttpServletRequest request = ServletActionContext.getRequest();
+		String id=request.getParameter("id");
+		List customerList=customerService.selectCustomer(id);
+		request.setAttribute("customerList",customerList);
+		return "list";
+	}
+	/*
+	 * 客户管理
+	 * 查询合同中的部门和部门经理
+	 * 唐朝
+	 */
+	
+	public String queryht() throws IOException
+	{
+		Map map = ParameterUtil.getParameter(ServletActionContext.getRequest());
+		HttpServletRequest request = ServletActionContext.getRequest();
+		String flag=MapUtils.getString(map, "flag","0");
+		//添加报价客户或公司
+		if(flag.equals("1")){
+			String updateIp=IPUtil.getIpAddr(request);
+			map.put("ip", updateIp);
+			customerService.addDepart(map);
+		}
+		//修改报价客户或公司
+		else if(flag.equals("2")){
+			String updateIp=IPUtil.getIpAddr(request);
+			map.put("ip", updateIp);
+			customerService.updateDepart(map);
+		}
+		List customerList=customerService.queryDepart(map);
+		request.setAttribute("customerList",customerList);
+		return "depart";
+	}
+	
+	/*
+	 * 修改客户前先查询客户信息
+	 * 唐朝
+	 */
+	public String updateht() throws IOException
+	{
+		HttpServletRequest request = ServletActionContext.getRequest();
+		//String id=request.getParameter("id");
+		Map map = ParameterUtil.getParameter(ServletActionContext.getRequest());
+		List customerList=customerService.queryDepart(map);
+		request.setAttribute("customerList",customerList);
+		return "depart";
+	}
+	
+	
+	
+	
+	/*
+	 * 仓库管理
+	 * 唐朝
+	 */
+	
+	public String queryHouse() throws IOException
+	{
+		Map map = ParameterUtil.getParameter(ServletActionContext.getRequest());
+		HttpServletRequest request = ServletActionContext.getRequest();
+		String flag=MapUtils.getString(map, "flag","0");
+		//添加报价客户或公司
+		if(flag.equals("1")){
+			customerService.addHouse(map);
+		}//修改报价客户或公司
+		else if(flag.equals("3")){
+			customerService.deleteHouse(map);
+		}
+		List customerList=customerService.queryHouse(map);
+		request.setAttribute("customerList",customerList);
+		return "wl";
+	}
+	
+	
+	/*
+	 * 客户管理
+	 * 唐朝
+	 */
+	
+	public String queryCustom() throws IOException
+	{
+		Map map = ParameterUtil.getParameter(ServletActionContext.getRequest());
+		HttpServletRequest request = ServletActionContext.getRequest();
+		String flag=MapUtils.getString(map, "flag","0");
+		//添加报价客户或公司
+		if(flag.equals("1")){
+			customerService.addCustom(map);
+		}//修改报价客户或公司
+		else if(flag.equals("3")){
+			customerService.deleteCustom(map);
+		}
+		List customerList=customerService.queryCustom(map);
+		request.setAttribute("customerList",customerList);
+		return "wl";
+	}
+	
+	
+	/*
+	 * 发货管理
+	 * 唐朝
+	 */
+	
+	public String queryTransport() throws IOException
+	{
+		Map map = ParameterUtil.getParameter(ServletActionContext.getRequest());
+		HttpServletRequest request = ServletActionContext.getRequest();
+		HttpSession session=request.getSession();
+		String user=(String) session.getAttribute("user");
+		String flag=MapUtils.getString(map, "flag","0");
+		
+		if(flag.equals("1")){
+			customerService.addTransport(map);
+		}
+		else if(flag.equals("2")){
+			customerService.updateTransport(map);
+		}
+		if(flag.equals("3")){
+			customerService.updateVocational4up(map);
+		}
+		List customerList=customerService.queryTransport(map,user);
+		request.setAttribute("customerList",customerList);
+		return "wl";
+	}
+	
+	
+	/*
+	 * 发货管理
+	 * 唐朝
+	 */
+	
+	public String queryTransportshou() throws IOException
+	{
+		Map map = ParameterUtil.getParameter(ServletActionContext.getRequest());
+		HttpServletRequest request = ServletActionContext.getRequest();
+		HttpSession session=request.getSession();
+		String user=(String) session.getAttribute("user");
+		String flag=MapUtils.getString(map, "flag","0");
+		
+		if(flag.equals("2")){
+			customerService.updateTransportshou(map,user);
+		}
+		if(flag.equals("3")){
+			customerService.updateVocational4up(map);
+		}
+		List customerList=customerService.queryTransportshou(map,user);
+		request.setAttribute("customerList",customerList);
+		return "wl";
+	}
+	
+	
+	public String add_transport() throws IOException
+	{
+		Map map = ParameterUtil.getParameter(ServletActionContext.getRequest());
+		HttpServletRequest request = ServletActionContext.getRequest();
+		HttpSession session=request.getSession();
+		String user=(String) session.getAttribute("user");
+		List customerList=customerService.queryHouseUser(user);
+		request.setAttribute("customerList",customerList);
+		return "wl";
+	}
+	
+	/*
+	 * 查询列表
+	 * 唐朝
+	 */
+	
+	public String inputHouse() throws IOException{
+		Map map = ParameterUtil.getParameter(ServletActionContext.getRequest());
+		try
+		{
+			HttpServletRequest request = ServletActionContext.getRequest();  
+			String powerId=request.getParameter("powerId");
+			List customerList = customerService.queryHouse(map);
+			JSONArray jsonArr = JSONArray.fromObject(customerList);
+			HttpServletResponse response=ServletActionContext.getResponse();
+			response.setCharacterEncoding("UTF-8");
+			ServletActionContext.getResponse().getWriter().write(jsonArr.toString());
+		}
+		catch (Exception e)
+		{
+			e.printStackTrace();
+		}
+		
+		
+		return null;
+
+	}
+	
+	/*
+	 * 查询列表
+	 * 唐朝
+	 */
+	
+	public String inputCustom() throws IOException{
+		Map map = ParameterUtil.getParameter(ServletActionContext.getRequest());
+		try
+		{
+			HttpServletRequest request = ServletActionContext.getRequest();  
+			List customerList = customerService.queryCustom(map);
+			JSONArray jsonArr = JSONArray.fromObject(customerList);
+			HttpServletResponse response=ServletActionContext.getResponse();
+			response.setCharacterEncoding("UTF-8");
+			ServletActionContext.getResponse().getWriter().write(jsonArr.toString());
+		}
+		catch (Exception e)
+		{
+			e.printStackTrace();
+		}
+		
+		
+		return null;
+
+	}
+	/*
+	 * 发货管理
+	 * 唐朝
+	 */
+	
+	public String queryVocational() throws IOException
+	{
+		Map map = ParameterUtil.getParameter(ServletActionContext.getRequest());
+		HttpServletRequest request = ServletActionContext.getRequest();
+		HttpSession session=request.getSession();
+		String user=(String) session.getAttribute("user");
+		String flag=MapUtils.getString(map, "flag","0");
+		
+		if(flag.equals("1")){
+			customerService.addVocational(map,user);
+		}
+		else if(flag.equals("2")){
+			customerService.updateVocational(map);
+		}
+		List customerList=customerService.queryVocational(map,user);
+		request.setAttribute("customerList",customerList);
+		return "wl";
+	}
+	/*
+	 * 发货管理
+	 * 唐朝
+	 */
+	
+	public String queryVocational4() throws IOException
+	{
+		Map map = ParameterUtil.getParameter(ServletActionContext.getRequest());
+		HttpServletRequest request = ServletActionContext.getRequest();
+		HttpSession session=request.getSession();
+		String user=(String) session.getAttribute("user");
+		String flag=MapUtils.getString(map, "flag","0");
+		
+		if(flag.equals("2")){
+			customerService.updateVocational4(map);
+		}
+		List customerList=customerService.queryVocational4(map,user);
+		request.setAttribute("customerList",customerList);
+		return "wl";
+	}
+	public String queryTransportup() throws IOException
+	{
+		Map map = ParameterUtil.getParameter(ServletActionContext.getRequest());
+		HttpServletRequest request = ServletActionContext.getRequest();
+		HttpSession session=request.getSession();
+		String flag=MapUtils.getString(map, "flag","0");
+		
+		
+		List customerList=customerService.queryVocational4up(map);
+		request.setAttribute("customerList",customerList);
+		return "wl";
+	}
+	public String queryTransportget() throws IOException
+	{
+		Map map = ParameterUtil.getParameter(ServletActionContext.getRequest());
+		HttpServletRequest request = ServletActionContext.getRequest();
+		HttpSession session=request.getSession();
+		
+		List customerList=customerService.queryVocational4up(map);
+		request.setAttribute("customerList",customerList);
+		return "wl";
+	}
+	
+	
+	
+	public String add_vocational() throws IOException
+	{
+		Map map = ParameterUtil.getParameter(ServletActionContext.getRequest());
+		HttpServletRequest request = ServletActionContext.getRequest();
+		HttpSession session=request.getSession();
+		String user=(String) session.getAttribute("user");
+		List customerList=customerService.queryHouseUser(user);
+		request.setAttribute("customerList",customerList);
+		return "wl";
+	}
+	public String updateVocational() throws IOException
+	{
+		HttpServletRequest request = ServletActionContext.getRequest();
+		//String id=request.getParameter("id");
+		Map map = ParameterUtil.getParameter(ServletActionContext.getRequest());
+		List customerList=customerService.queryVocational2(map);
+		request.setAttribute("customerList",customerList);
+		return "wl";
+	}
+	
+	public String queryVocational3() throws IOException
+	{
+		Map map = ParameterUtil.getParameter(ServletActionContext.getRequest());
+		HttpServletRequest request = ServletActionContext.getRequest();
+		String flag=MapUtils.getString(map, "flag","0");
+		if(flag.equals("2")){
+			customerService.updateVocational3(map);
+		}
+		if(flag.equals("3")){
+			customerService.updateVocational3sc(map);
+		}
+		List customerList=customerService.queryVocational(map);
+		request.setAttribute("customerList",customerList);
+		return "wl";
+	}
+	
+	public String queryVocational3get() throws IOException
+	{
+		Map map = ParameterUtil.getParameter(ServletActionContext.getRequest());
+		HttpServletRequest request = ServletActionContext.getRequest();
+		List customerList=customerService.queryVocational3get(map);
+		request.setAttribute("customerList",customerList);
+		return "wl";
+	}
+	
+	public String queryVocational3getO() throws IOException
+	{
+		Map map = ParameterUtil.getParameter(ServletActionContext.getRequest());
+		HttpServletRequest request = ServletActionContext.getRequest();
+		List customerList=customerService.queryVocational3getO(map);
+		request.setAttribute("customerList",customerList);
+		return "wl";
+	}
+	
+	public String queryVocationaldh() throws IOException
+	{
+		Map map = ParameterUtil.getParameter(ServletActionContext.getRequest());
+		HttpServletRequest request = ServletActionContext.getRequest();
+		String flag=MapUtils.getString(map, "flag","0");
+		if(flag.equals("2")){
+			customerService.updateVocationaldh(map);
+		}
+		List customerList=customerService.queryVocationaldh(map);
+		request.setAttribute("customerList",customerList);
+		return "wl";
+	}
+	
+	
+	
+	public String queryVocationalhs() throws IOException
+	{
+		Map map = ParameterUtil.getParameter(ServletActionContext.getRequest());
+		HttpServletRequest request = ServletActionContext.getRequest();
+		String flag=MapUtils.getString(map, "flag","0");
+		if(flag.equals("2")){
+			customerService.updateVocationalhs(map);
+		}
+		List customerList=customerService.queryVocationaldh(map);
+		request.setAttribute("customerList",customerList);
+		return "wl";
+	}
+	
+	public String updateVocational3() throws IOException
+	{
+		HttpServletRequest request = ServletActionContext.getRequest();
+		//String id=request.getParameter("id");
+		Map map = ParameterUtil.getParameter(ServletActionContext.getRequest());
+		List customerList=customerService.queryVocational3(map);
+		String vocational3id=MapUtils.getString((Map)customerList.get(0), "vocational3id");
+		List customerList3=customerService.queryVocational3(vocational3id);
+		request.setAttribute("customerList",customerList);
+		request.setAttribute("customerList3",customerList3);
+		return "wl";
+	}
+	
+	
+	/*
+	 * 客户管理
+	 * 唐朝
+	 */
+	
+	public String queryDjcs() throws IOException
+	{
+		Map map = ParameterUtil.getParameter(ServletActionContext.getRequest());
+		HttpServletRequest request = ServletActionContext.getRequest();
+		String flag=MapUtils.getString(map, "flag","0");
+		//添加报价客户或公司
+		if(flag.equals("1")){
+			customerService.addDjcs(map);
+		}//修改报价客户或公司
+		else if(flag.equals("3")){
+			customerService.deleteDjcs(map);
+		}
+		List customerList=customerService.queryDjcs(map);
+		request.setAttribute("customerList",customerList);
+		return "wl";
+	}
+	public String queryTransportzh() throws IOException
+	{
+		Map map = ParameterUtil.getParameter(ServletActionContext.getRequest());
+		HttpServletRequest request = ServletActionContext.getRequest();
+		HttpSession session=request.getSession();
+		String user=(String) session.getAttribute("user");
+		String flag=MapUtils.getString(map, "flag","0");
+		String transportid=MapUtils.getString(map, "transportid");
+		List customerList=customerService.queryVocational4(map,user);
+		request.setAttribute("customerList",customerList);
+		request.setAttribute("transportid",transportid);
+		return "wl";
+	}
+	
+	/*
+	 * 查询登陆
+	 * 唐朝
+	 */
+	public String inputzh() throws IOException{
+		Map map = ParameterUtil.getParameter(ServletActionContext.getRequest());
+		Object result = "-1";
+		try
+		{
+			customerService.inputzh(map);
+			result = "1" ;
+			
+		}
+		catch (Exception ex)
+		{
+			result = "-2";
+		}
+		ServletActionContext.getResponse().getWriter().write(result.toString());
+		return null;
+
+	}
+	
+}

+ 135 - 0
src/com/acc/framework/thtkehu/dao/CustomerDAO.java

@@ -0,0 +1,135 @@
+package com.acc.framework.thtkehu.dao;
+
+import java.util.List;
+import java.util.Map;
+
+import org.apache.commons.collections.MapUtils;
+import org.springframework.stereotype.Repository;
+
+import com.acc.common.annotation.inject.parent.InjectItem;
+import com.acc.common.annotation.inject.parent.ParentInject;
+import com.acc.common.jdbc.JdbcDaoSupportEx;
+import com.acc.common.jdbc.JdbcTemplateEx;
+import com.acc.util.common.MapUtil;
+
+@Repository
+@ParentInject(items = @InjectItem(attr = "dataSource", ref = "jdbcdataSource"))
+public class CustomerDAO extends JdbcDaoSupportEx
+{
+	public List queryCustomer(String sql){
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		return template.queryForList(sql);
+	}
+	
+	public void addCustomer(Map map)
+	{
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		template.insertMap(map, "customer", "id");
+	}
+	
+	public void updateCustomer(Map map)
+	{
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		MapUtil.filterMap(map);
+		template.updateMap(map, "customer", "id");
+	}
+	
+	public int customerId(){
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		String sql = "select max(id) id from customer ";
+		return MapUtils.getIntValue((Map)template.queryForList(sql).get(0),"id");
+	}
+	
+	
+	public void addDepart(Map map)
+	{
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		template.insertMap(map, "depart");
+	}
+	public void updateDepart(Map map)
+	{
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		MapUtil.filterMap(map);
+		template.updateMap(map, "depart", "id");
+	}
+	public void deleteHouse(int id){
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		String sql = "delete from warehouse where id='" + id + "'";
+		template.execute(sql);
+	}
+	
+	
+	public void deleteCustom(int id){
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		String sql = "delete from custom where id='" + id + "'";
+		template.execute(sql);
+	}
+	public void deleteDjcs(int id){
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		String sql = "delete from djcs where id='" + id + "'";
+		template.execute(sql);
+	}
+	public void addHouse(Map map)
+	{
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		template.insertMap(map, "warehouse");
+	}
+	public void addDjcs(Map map)
+	{
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		template.insertMap(map, "djcs");
+	}
+	
+	
+	public void addCustom(Map map)
+	{
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		template.insertMap(map, "custom");
+	}
+	public void addTransportid(Map map)
+	{
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		template.insertMap(map, "transport");
+	}
+	
+	public void updateVocational2(Map map)
+	{
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		MapUtil.filterMap(map);
+		template.updateMap(map, "vocational2", "id");
+	}
+	public void updateVocational4(Map map)
+	{
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		MapUtil.filterMap(map);
+		template.updateMap(map, "vocational4", "id");
+	}
+	public void addVocational2(Map map)
+	{
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		template.insertMap(map, "vocational2");
+	}
+	public void addVocational4(Map map)
+	{
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		template.insertMap(map, "vocational4");
+	}
+	public void addVocational3(Map map)
+	{
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		template.insertMap(map, "vocational3");
+	}
+	public void updateVocational3(Map map)
+	{
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		MapUtil.filterMap(map);
+		template.updateMap(map, "vocational3", "id");
+	}
+	
+	public void updateTransport(Map map)
+	{
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		MapUtil.filterMap(map);
+		template.updateMap(map, "transport", "transportid");
+	}
+}

+ 61 - 0
src/com/acc/framework/thtkehu/service/CustomerService.java

@@ -0,0 +1,61 @@
+package com.acc.framework.thtkehu.service;
+
+import java.util.List;
+import java.util.Map;
+
+public interface CustomerService
+{
+	
+	public void addCustomer(Map map);
+	public void updateCustomer(Map map);
+	public List queryCustomer(Map map);
+	public List selectCustomer(String id);
+	public List queryDepart(Map map);
+	
+	public void addDepart(Map map);
+	public void updateDepart(Map map);
+	public void addHouse(Map map);
+	public void deleteHouse(Map map);
+	public List queryHouse(Map map);
+	public List queryHouseUser(String user);
+	public void addCustom(Map map);
+	public void deleteCustom(Map map);
+	public List queryCustom(Map map);
+	
+	public void addTransport(Map map);
+	public void updateTransport(Map map);
+	public void updateTransportshou(Map map,String user);
+	
+	public List queryTransport(Map map,String user);
+	public List queryTransportshou(Map map,String user);
+	
+	public void addVocational(Map map,String user);
+	public void updateVocational(Map map);
+	public List queryVocational(Map map,String user);
+	public List queryVocational2(Map map);
+	public void addVocational(Map map);
+	public List queryVocational(Map map);
+	public List queryVocationaldh(Map map);
+	public List queryVocational3(Map map);
+	public List queryVocational3(String vocational3id);
+	public void updateVocational3(Map map);
+	public List queryVocational3get(Map map);
+	public List queryVocational3getO(Map map);
+	public void updateVocational3sc(Map map);
+	
+	public void updateVocationaldh(Map map);
+	public void updateVocationalhs(Map map);
+	
+	public void addDjcs(Map map);
+	public void deleteDjcs(Map map);
+	public List queryDjcs(Map map);
+	
+	
+	public void updateVocational4(Map map);
+	public List queryVocational4(Map map,String user);
+	public void inputzh(Map map);
+	
+	public void updateVocational4up(Map map);
+	public List queryVocational4up(Map map);
+	
+}

+ 600 - 0
src/com/acc/framework/thtkehu/service/impl/CustomerServiceImpl.java

@@ -0,0 +1,600 @@
+package com.acc.framework.thtkehu.service.impl;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.annotation.Resource;
+
+import org.apache.commons.collections.MapUtils;
+import org.apache.commons.lang.StringUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.springframework.stereotype.Service;
+
+import com.acc.framework.thtkehu.dao.CustomerDAO;
+import com.acc.framework.thtkehu.service.CustomerService;
+import com.acc.util.common.DateUtil;
+
+@Service(value = "customerService")
+public class CustomerServiceImpl implements CustomerService
+{
+
+	private static final Log logger = LogFactory.getLog(CustomerServiceImpl.class);
+
+	@Resource(name = "customerDAO")
+	private CustomerDAO customerDAO;
+	
+	
+
+	public void addCustomer(Map map){
+		int id=customerDAO.customerId();
+		String updateTime=DateUtil.getDateW3CFormat(new Date());
+		map.put("id", id+1);
+		map.put("updateTime", updateTime);
+		map.put("createTime", updateTime);
+		map.remove("flag");
+		customerDAO.addCustomer(map);
+	}
+	public void updateCustomer(Map map){
+		String updateTime=DateUtil.getDateW3CFormat(new Date());
+		map.put("updateTime", updateTime);
+		map.remove("flag");
+		customerDAO.updateCustomer(map);
+	}
+	public List queryCustomer(Map map){
+		String sql="select * from customer where 1=1";
+		String companyName=MapUtils.getString(map, "companyName","10");
+		String state=MapUtils.getString(map, "state","10");
+		if(!state.equals("10")&&StringUtils.isNotBlank(state)){
+			sql+=" and state like'%"+state+"%'";
+		}
+		if(!companyName.equals("10")&&StringUtils.isNotBlank(companyName)){
+			sql+=" and companyName like'%"+companyName+"%'";
+		}
+		return customerDAO.queryCustomer(sql);
+	}
+	
+	
+	public List selectCustomer(String id){
+		
+		String sql="select * from customer t where 1=1 and t.id="+id;
+		return customerDAO.queryCustomer(sql);
+	}
+	
+	public List queryDepart(Map map){
+		String id=MapUtils.getString(map,"id","0");
+		String name=MapUtils.getString(map,"name","0");//人员姓名
+		String section=MapUtils.getString(map,"section","0");//部门名称
+		String pactNumber=MapUtils.getString(map,"pactNumber","0");
+		String sql="select * from depart where 1=1";
+		if(!id.equals("0")&&StringUtils.isNotBlank(id)){
+			sql+=" and id='"+id+"'";
+		}
+		if(!name.equals("0")&&StringUtils.isNotBlank(name)){
+			sql+=" and name like'%"+name+"%'";
+		}
+		if(!section.equals("0")&&StringUtils.isNotBlank(section)){
+			sql+=" and section like'%"+section+"%'";
+		}
+		if(!pactNumber.equals("0")&&StringUtils.isNotBlank(pactNumber)){
+			sql+=" and pactNumber like'%"+pactNumber+"%'";
+		}
+		return customerDAO.queryCustomer(sql);
+	}
+	
+	public void addDepart(Map map){
+		String addTime=DateUtil.getDateW3CFormat(new Date());
+		map.put("addTime", addTime);
+		map.remove("flag");
+		customerDAO.addDepart(map);
+	}
+	public void updateDepart(Map map){
+		String updateTime=DateUtil.getDateW3CFormat(new Date());
+		String addTime=MapUtils.getString(map,"addTime","");
+		String addT=addTime.substring(0,19);
+		map.put("updateTime", updateTime);
+		map.put("addTime", addT);
+		map.remove("flag");
+		customerDAO.updateDepart(map);
+	}
+	public void addHouse(Map map){
+		String ctime=DateUtil.getDateW3CFormat(new Date());
+		String user=MapUtils.getString(map, "user");
+		map.put("username", selectUsername(user));
+		map.put("crtime", ctime);
+		map.put("id",selectHouse()+1);
+		map.remove("flag");
+		customerDAO.addHouse(map);
+	}
+	public int selectHouse(){
+		
+		String sql="select max(id) id from warehouse t ";
+		return MapUtils.getIntValue((Map)customerDAO.queryCustomer(sql).get(0),"id",0);
+	}
+	public String selectUsername(String user){
+		
+		String sql="select username from userinfor t where user='"+user+"'";
+		return MapUtils.getString((Map)customerDAO.queryCustomer(sql).get(0),"userName");
+	}
+	public void updateHouse(Map map){
+		String addTime=MapUtils.getString(map,"ctime","");
+		String addT=addTime.substring(0,19);
+		map.put("ctime", addT);
+		map.remove("flag");
+		customerDAO.updateDepart(map);
+	}
+	
+	public void deleteHouse(Map map){
+		int id=MapUtils.getIntValue(map, "id");
+		customerDAO.deleteHouse(id);
+	}
+	
+	
+	
+	public void addCustom(Map map){
+		String ctime=DateUtil.getDateW3CFormat(new Date());
+		String user=MapUtils.getString(map, "user"," ");
+		if(StringUtils.isNotBlank(user)){
+			map.put("username", selectUsername(user));
+		}
+		/*String address=MapUtils.getString(map, "address"," ");
+		String pk=MapUtils.getString(map, "pk"," ");
+		String pknamel=MapUtils.getString(map, "pknamel"," ");
+		String zlxpeople=MapUtils.getString(map, "zlxpeople"," ");
+		String zlxphone=MapUtils.getString(map, "zlxphone"," ");
+		String wlxpeople=MapUtils.getString(map, "wlxpeople"," ");
+		String wlxphone=MapUtils.getString(map, "wlxphone"," ");
+		
+		if(!StringUtils.isNotBlank(address)) map.put("address", null);
+		if(!StringUtils.isNotBlank(pk)) map.put("pk", null);
+		if(!StringUtils.isNotBlank(zlxpeople)) map.put("zlxpeople",null);
+		if(!StringUtils.isNotBlank(pknamel)) map.put("pknamel",null);
+		if(!StringUtils.isNotBlank(zlxphone)) map.put("zlxphone",null);
+		if(!StringUtils.isNotBlank(wlxpeople)) map.put("wlxpeople",null);
+		if(!StringUtils.isNotBlank(wlxphone)) map.put("wlxphone",null);
+		
+		map.put("zlxpeople", zlxpeople);
+		map.put("zlxphone", zlxphone);
+		map.put("pknamel", pknamel);
+		map.put("wlxpeople", wlxpeople);
+		map.put("wlxphone", wlxphone);
+		map.put("address", address);*/
+		map.put("crtime", ctime);
+		map.put("id",selectCustom()+1);
+		map.remove("flag");
+		customerDAO.addCustom(map);
+	}
+	public int selectCustom(){
+		
+		String sql="select max(id) id from custom t ";
+		return MapUtils.getIntValue((Map)customerDAO.queryCustomer(sql).get(0),"id",0);
+	}
+	public void deleteCustom(Map map){
+		int id=MapUtils.getIntValue(map, "id");
+		customerDAO.deleteCustom(id);
+	}
+	@Override
+	public List queryCustom(Map map) {
+		String sql="select * from custom t ";
+		return customerDAO.queryCustomer(sql);
+	}
+	@Override
+	public void addTransport(Map map) {
+		//List houseList=selectHouse(user);
+		
+		String crtime=DateUtil.getDateW3CFormat(new Date());
+		map.put("crtime", crtime);
+		map.put("style", "0");
+		map.put("transportid",selectTransport()+1);
+		map.remove("flag");
+		customerDAO.addTransportid(map);
+	}
+	
+	
+	
+	public int selectTransport(){
+		
+		String sql="select max(transportid) transportid from transport t ";
+		return MapUtils.getIntValue((Map)customerDAO.queryCustomer(sql).get(0),"transportid",0);
+	}
+	
+	@Override
+	public List queryTransport(Map map,String user) {
+		List houseList=selectHouse(user);
+		String sql="select * from transport t where style!=3 ";
+		if(houseList.size()>0){
+			String cid=MapUtils.getString((Map)houseList.get(0), "cid");
+			sql+=" and fahouse='"+cid+"'";
+		}
+		sql+="order by transportid desc";
+		List fhlist=customerDAO.queryCustomer(sql);
+		List chefList=new ArrayList();
+		for(int i=0;i<fhlist.size();i++){
+			Map fhMap=(Map) fhlist.get(i);
+			String fahouse=MapUtils.getString(fhMap, "fahouse");
+			String shouhouse=MapUtils.getString(fhMap, "shouhouse");
+			String faaddress=zcwarehouse(fahouse);
+			String shouaddress=zcwarehouse(shouhouse);
+			fhMap.put("faaddress", faaddress);
+			fhMap.put("shouaddress", shouaddress);
+			chefList.add(fhMap);
+		}
+		return chefList;
+	}
+	
+	@Override
+	public List queryTransportshou(Map map,String user) {
+		List houseList=selectHouse(user);
+		String sql="select * from transport t where style!=3 ";
+		if(houseList.size()>0){
+			String cid=MapUtils.getString((Map)houseList.get(0), "cid");
+			sql+=" and shouhouse='"+cid+"'";
+		}
+		sql+="order by transportid desc";
+		List fhlist=customerDAO.queryCustomer(sql);
+		List chefList=new ArrayList();
+		for(int i=0;i<fhlist.size();i++){
+			Map fhMap=(Map) fhlist.get(i);
+			String fahouse=MapUtils.getString(fhMap, "fahouse");
+			String shouhouse=MapUtils.getString(fhMap, "shouhouse");
+			String faaddress=zcwarehouse(fahouse);
+			String shouaddress=zcwarehouse(shouhouse);
+			fhMap.put("faaddress", faaddress);
+			fhMap.put("shouaddress", shouaddress);
+			chefList.add(fhMap);
+		}
+		return chefList;
+	}
+	
+	@Override
+	public List queryHouseUser(String user) {
+		List userList=selectHouse(user);
+		return userList;
+	}
+	@Override
+	public void addVocational(Map map2,String user) {
+		String crtime=DateUtil.getDateW3CFormat(new Date());
+		int zjs=MapUtils.getIntValue(map2, "zjs",0);
+		map2.put("crtime", crtime);
+		map2.put("zjs", zjs);
+		map2.put("id",selectVocational2()+1);
+		map2.put("vocationalid",String.valueOf(new Date().getTime()));
+		List houseList=queryHouseUser(user);
+		String house="";
+		if(houseList.size()>0){
+			house=MapUtils.getString((Map)houseList.get(0),"cid" );
+		}
+		map2.put("house",house);
+		String vocational3id= String.valueOf(new Date().getTime());
+		map2.put("vocational3id",vocational3id);
+		map2.remove("flag");
+		Map map3=new HashMap();
+		map3.put("id",vocational3id);
+		map3.put("style", "0");
+		
+		customerDAO.addVocational2(map2);
+		customerDAO.addVocational3(map3);
+		map2.put("id", selectVocational4()+1);
+		customerDAO.addVocational4(map2);
+	}
+	
+	
+	@Override
+	public List queryVocational(Map map, String user) {
+		String sql="select * from vocational2 t where 1=1 ";
+		List houseList=selectHouse(user);
+		if(houseList.size()>0){
+			String cid=MapUtils.getString((Map)houseList.get(0), "cid");
+			sql+=" and house='"+cid+"'";
+		}
+		sql+="order by id  desc";
+		return customerDAO.queryCustomer(sql);
+	}
+	
+	@Override
+	public List queryVocational4(Map map, String user) {
+		String sql="select * from vocational4 t where 1=1 ";
+		List houseList=selectHouse(user);
+		if(houseList.size()>0){
+			String cid=MapUtils.getString((Map)houseList.get(0), "cid");
+			sql+=" and house='"+cid+"'";
+		}
+		sql+=" and yscc='' or yscc=' ' or yscc is null  ";
+		sql+=" order by id  desc";
+		return customerDAO.queryCustomer(sql);
+	}
+	
+	
+	@Override
+	public List queryVocational4up(Map map) {
+		int transportid=MapUtils.getIntValue(map, "transportid");
+		String sql="select * from vocational4 t where 1=1 ";
+		sql+=" and yscc='"+transportid+"'";
+		sql+=" order by id  desc";
+		return customerDAO.queryCustomer(sql);
+	}
+	@Override
+	public void updateVocational(Map map) {
+		map.remove("flag");
+		customerDAO.updateVocational2(map);
+	}
+	@Override
+	public void updateVocational4(Map map) {
+		map.remove("flag");
+		customerDAO.updateVocational4(map);
+	}
+	@Override
+	public void updateVocational4up(Map map) {
+		String id4=MapUtils.getString(map, "id");
+		List list4=zcvocaltional4(id4);
+		Map map4=(Map)list4.get(0);
+		map4.remove("flag");
+		map4.put("yscc"," ");
+		map4.put("chuhouse"," ");
+		map4.put("chuaddress"," ");
+		map4.put("ruhouse"," ");
+		map4.put("ruaddress"," ");
+		customerDAO.updateVocational4(map4);
+	}
+	
+	@Override
+	public void updateVocational3(Map map) {
+		map.remove("flag");
+		String ywjluser=MapUtils.getString(map, "ywjluser","");
+		customerDAO.updateVocational3(map);
+	}
+	
+	@Override
+	public void updateVocational3sc(Map map) {
+		map.remove("flag");
+		String vocational3id=MapUtils.getString(map, "vocational3id","");
+		List list3=queryVocational3(vocational3id);
+		List djlist=queryDjcs(map);
+		for(int i=0;i<djlist.size();i++){
+			Map djmap=(Map)djlist.get(i);
+			String qp=MapUtils.getString(djmap, "qp");
+			String ds=MapUtils.getString(djmap, "ds");
+			double money=MapUtils.getDoubleValue(djmap, "money");
+			for(int j=0;j<list3.size();j++){
+				Map map3=(Map)list3.get(j);
+				map3.put("t1", qp);
+				map3.put("t2", ds);
+				map3.put("t3", money);
+				customerDAO.updateVocational3(map3);
+			}
+		}
+		
+	}
+	
+	
+	@Override
+	public void updateVocationaldh(Map map) {
+		map.remove("flag");
+		String id=MapUtils.getString(map, "id");
+		List list3=queryVocational3(id);
+		Map map3=(Map)list3.get(0);
+		map3.put("style", "1");
+		customerDAO.updateVocational3(map3);
+	}
+	
+	
+	@Override
+	public void updateVocationalhs(Map map) {
+		map.remove("flag");
+		String id=MapUtils.getString(map, "id");
+		List list3=queryVocational3(id);
+		Map map3=(Map)list3.get(0);
+		map3.put("style", "2");
+		customerDAO.updateVocational3(map3);
+	}
+	
+	
+	public List queryVocational2(Map map){
+		int id=MapUtils.getIntValue(map, "id");
+		String sql="select * from vocational2 t where id='"+id+"'";
+		return customerDAO.queryCustomer(sql);
+	}
+	@Override
+	public List queryVocational(Map map) {
+		String sql="SELECT * FROM vocational2 order by id desc";
+		return customerDAO.queryCustomer(sql);
+	}
+	
+	@Override
+	public List queryVocationaldh(Map map) {
+		String sql="SELECT * FROM vocational2 a,vocational3 b where a.vocational3id=b.id order by a.id desc";
+		return customerDAO.queryCustomer(sql);
+	}
+	
+	
+	@Override
+	public List queryVocational3get(Map map) {
+		int id=MapUtils.getIntValue(map, "id");
+		String sql="SELECT * FROM vocational2 a,vocational3 b,warehouse  c  where a.vocational3id=b.id and a.house=c.cid  and a.id='"+id+"' order by a.id desc";
+		return customerDAO.queryCustomer(sql);
+	}
+	
+	@Override
+	public List queryVocational3getO(Map map) {
+		String vocationalid=MapUtils.getString(map, "vocationalid");
+		String sql="SELECT * FROM vocational4  where vocationalid='"+vocationalid+"' order by id desc";
+		return customerDAO.queryCustomer(sql);
+	}
+	
+	@Override
+	public void addVocational(Map map) {
+		// TODO Auto-generated method stub
+		
+	}
+	
+	public List queryVocational3(Map map){
+		String vocationalid=MapUtils.getString(map, "vocationalid");
+		String sql="SELECT a.* FROM vocational2 a where a.vocationalid='"+vocationalid+"'";
+		return customerDAO.queryCustomer(sql);
+	}
+	public List queryVocational3(String  vocational3id){
+		String sql="SELECT a.* FROM vocational3 a where a.id='"+vocational3id+"'";
+		return customerDAO.queryCustomer(sql);
+	}
+	@Override
+	public void addDjcs(Map map) {
+		map.put("id", selectDjcs()+1);
+		map.put("crtime", DateUtil.getDateW3CFormat(new Date()));
+		map.remove("flag");
+		customerDAO.addDjcs(map);
+	}
+	
+	public int selectDjcs(){
+		
+		String sql="select max(id) id from djcs t ";
+		return MapUtils.getIntValue((Map)customerDAO.queryCustomer(sql).get(0),"id",0);
+	}
+	public void deleteDjcs(Map map){
+		int id=MapUtils.getIntValue(map, "id");
+		customerDAO.deleteDjcs(id);
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see com.acc.framework.thtkehu.service.CustomerService#inputzh(java.util.Map)
+	 * 装车
+	 */
+	@Override
+	public void inputzh(Map map) {
+		int transportid=MapUtils.getIntValue(map, "transportid");
+		String checkboxx=MapUtils.getString(map, "checkboxx");
+		
+		List chelist=chetransport(transportid);
+		if(chelist.size()>0){
+			for(int i=0;i<chelist.size();i++){
+				Map chemap=(Map)chelist.get(i);
+				String carnum=MapUtils.getString(chemap, "carnum");
+				String fahouse=MapUtils.getString(chemap, "fahouse");
+				String shouhouse=MapUtils.getString(chemap, "shouhouse");
+				String chuaddress=zcwarehouse(fahouse);
+				String ruaddress=zcwarehouse(shouhouse);
+				String [] s=checkboxx.split(",");
+				for(int j=0;j<s.length;j++){
+					String id4=s[j];
+					List zcList=zcvocaltional4(id4);
+					Map zcmap=(Map)zcList.get(0);
+					zcmap.put("yscc", transportid);
+					zcmap.put("chuhouse", fahouse);
+					zcmap.put("ruhouse", shouhouse);
+					zcmap.put("chuaddress", chuaddress);
+					zcmap.put("ruaddress", ruaddress);
+					customerDAO.updateVocational4(zcmap);
+				}
+				chemap.put("style","4");
+				customerDAO.updateTransport(chemap);
+			}
+		}
+		
+		
+	}
+	
+	@Override
+	public void updateTransport(Map map) {
+		int transportid=MapUtils.getIntValue(map, "transportid");
+		String crtime=DateUtil.getDateW3CFormat(new Date());
+		List cheList=chetransport(transportid);
+		Map chemap=(Map)cheList.get(0);
+		chemap.put("style","1");
+		chemap.put("fctime",crtime);
+		try{
+			customerDAO.updateTransport(chemap);
+			List ysList=ysccvocaltional4(transportid);
+			for(int i=0;i<ysList.size();i++){
+				Map ysmap=(Map)ysList.get(i);
+				ysmap.put("fhtime", crtime);
+				updateVocational4(ysmap);
+			}
+		}
+		catch (Exception e)
+		{
+			e.printStackTrace();
+		}
+	}
+	@Override
+	public void updateTransportshou(Map map,String user) {
+		int transportid=MapUtils.getIntValue(map, "transportid");
+		String crtime=DateUtil.getDateW3CFormat(new Date());
+		List cheList=chetransport(transportid);
+		Map chemap=(Map)cheList.get(0);
+		chemap.put("style","2");
+		chemap.put("dhtime",crtime);
+		try{
+			List houseList=queryHouseUser(user);
+			String house="";
+			if(houseList.size()>0){
+				house=MapUtils.getString((Map)houseList.get(0),"cid" );
+			}
+			customerDAO.updateTransport(chemap);
+			List ysList=ysccvocaltional4(transportid);
+			for(int i=0;i<ysList.size();i++){
+				Map ysmap=(Map)ysList.get(i);
+				ysmap.put("rktime", crtime);
+				updateVocational4(ysmap);
+				ysmap.remove("rktime");
+				ysmap.remove("fhtime");
+				ysmap.remove("ruaddress");
+				ysmap.remove("ruhouse");
+				ysmap.remove("chuhouse");
+				ysmap.remove("chuaddress");
+				ysmap.remove("yscc");
+				ysmap.put("id", selectVocational4()+1);
+				ysmap.put("crtime", crtime);
+				ysmap.put("house", house);
+				customerDAO.addVocational4(ysmap);
+			}
+		}
+		catch (Exception e)
+		{
+			e.printStackTrace();
+		}
+	}
+	
+	public List chetransport(int transportid){
+		String sql="select * from transport t where t.transportid='"+transportid+"'";
+		return customerDAO.queryCustomer(sql);
+	}
+	public List zcvocaltional4(String id4){
+		String sql="select * from vocational4 t where t.id='"+id4+"'";
+		return customerDAO.queryCustomer(sql);
+	}
+	public List ysccvocaltional4(int yscc){
+		String sql="select * from vocational4 t where t.yscc='"+yscc+"'";
+		return customerDAO.queryCustomer(sql);
+	}
+	public String zcwarehouse(String cid){
+		String sql="select t.cname from warehouse t where t.cid='"+cid+"'";
+		return MapUtils.getString((Map)customerDAO.queryCustomer(sql).get(0),"cname");
+	}
+	
+	public int selectVocational2(){
+		
+		String sql="select max(id) id from vocational2 t ";
+		return MapUtils.getIntValue((Map)customerDAO.queryCustomer(sql).get(0),"id",0);
+	}
+	public int selectVocational4(){
+		
+		String sql="select max(id) id from vocational4 t ";
+		return MapUtils.getIntValue((Map)customerDAO.queryCustomer(sql).get(0),"id",0);
+	}
+	public List queryHouse(Map map){
+		String sql="select * from warehouse where 1=1";
+		return customerDAO.queryCustomer(sql);
+	}
+	public List queryDjcs(Map map){
+		String sql="SELECT a.* FROM djcs a ";
+		return customerDAO.queryCustomer(sql);
+	}
+	public List selectHouse(String user){
+		
+		String sql="select *  from warehouse t where style=1 and user='"+user+"'";
+		return customerDAO.queryCustomer(sql);
+	}
+}

+ 610 - 0
src/com/acc/framework/thtopera/action/OperaAction.java

@@ -0,0 +1,610 @@
+package com.acc.framework.thtopera.action;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpSession;
+
+import org.apache.commons.collections.MapUtils;
+import org.apache.commons.lang.StringUtils;
+import org.apache.struts2.ServletActionContext;
+import org.springframework.stereotype.Component;
+
+import com.acc.framework.thtopera.service.OperaService;
+import com.acc.util.common.IPUtil;
+import com.acc.util.common.ParameterUtil;
+import com.opensymphony.xwork2.ActionSupport;
+
+@Component
+public class OperaAction extends ActionSupport
+{
+	@Resource(name = "operaService")
+	private OperaService operaService;
+	/*
+	 * flag 1添加 为0查询
+	 * userNameC 有值按名字模糊查询
+	 * 唐朝
+	 */
+	public String query() throws IOException{
+		Map map = ParameterUtil.getParameter(ServletActionContext.getRequest());
+		HttpServletRequest request = ServletActionContext.getRequest();
+		String flag=MapUtils.getString(map,"flag","0");
+		String id=request.getParameter("id");
+		if(flag.equals("1")){
+			//获取当前操作人IP
+			String createIp=IPUtil.getIpAddr(request);
+			map.put("createIp", createIp);
+			try{
+				//添加信息
+				operaService.addOpera(map);
+			}catch(Exception e){
+				e.printStackTrace();
+			}
+		}
+		//修改
+		else if(flag.equals("2")){
+			String createIp=IPUtil.getIpAddr(request);
+			map.put("createIp", createIp);
+			try{
+				//添加信息
+				operaService.updateOpera(map);
+			}catch(Exception e){
+				e.printStackTrace();
+			}
+		}
+		//提交
+		else if(flag.equals("3")){
+			String createIp=IPUtil.getIpAddr(request);
+			map.put("createIp", createIp);
+			try{
+				//添加信息
+				operaService.updateOperaStell(map);
+			}catch(Exception e){
+				e.printStackTrace();
+			}
+		}
+		if(StringUtils.isNotBlank(id)){
+			
+			List quoteList=operaService.selectQuote(id);
+			try{
+				//添加信息
+				operaService.updateQuote(quoteList);
+			}catch(Exception e){
+				e.printStackTrace();
+			}
+		}
+		List operaList=operaService.queryOpera(map);
+		request.setAttribute("operaList",operaList);
+		
+		return "list";
+	}
+	
+	/*
+	 * 修改填报信息之前查询
+	 * 唐朝
+	 */
+	
+	public String updateOpera() throws IOException{
+		HttpServletRequest request = ServletActionContext.getRequest();
+		String inforId=request.getParameter("inforId");
+		List inforList=operaService.queryOperaInfor(inforId,"2");//2代表修改之前的查询
+		List containerList=operaService.queryContainer(inforId);
+		request.setAttribute("inforList",inforList);
+		request.setAttribute("containerList",containerList);
+		return "list";
+	}
+	/*
+	 * 查询详细信息
+	 * 唐朝
+	 */
+	public String opper() throws IOException{
+		HttpServletRequest request = ServletActionContext.getRequest();
+		String inforId=request.getParameter("inforId");
+		List inforList=operaService.queryOperaInfor(inforId,"1");//1代表查询详情
+		List containerList=operaService.queryContainer(inforId);
+		List information=operaService.queryInformation(inforId);
+		request.setAttribute("inforList",inforList);
+		request.setAttribute("containerList",containerList);
+		request.setAttribute("information",information);
+		return "list";
+	}
+	/*
+	 * 报价
+	 * 唐朝
+	 */
+	public String quote() throws IOException{
+		Map map = ParameterUtil.getParameter(ServletActionContext.getRequest());
+		HttpServletRequest request = ServletActionContext.getRequest();
+		String flag=MapUtils.getString(map, "flag","");
+		String inforId=request.getParameter("inforId");
+		if(!StringUtils.isNotBlank(inforId)){
+			inforId=MapUtils.getString(map, "inforId");
+		}
+		if(flag.equals("2")){
+			String createIp=IPUtil.getIpAddr(request);
+			map.put("createIp", createIp);
+			operaService.updateQuoteSh(map);
+		}
+		List operaList=operaService.queryQuote(inforId);
+		request.setAttribute("operaList",operaList);
+		return "list";
+	}
+	
+	/*
+	 * 审核页面
+	 * 唐朝
+	 */
+	public String audit() throws IOException{
+		Map map = ParameterUtil.getParameter(ServletActionContext.getRequest());
+		HttpServletRequest request = ServletActionContext.getRequest();
+		String inforId=request.getParameter("inforId");
+		String referUser=request.getParameter("referUser");
+		List operaList=operaService.queryQuote(inforId,referUser);
+		request.setAttribute("operaList",operaList);
+		return "list";
+	}
+	
+	/*
+	 * 查询详细信息
+	 * 唐朝
+	 */
+	public String all() throws IOException{
+		Map map = ParameterUtil.getParameter(ServletActionContext.getRequest());
+		HttpServletRequest request = ServletActionContext.getRequest();
+		String inforId=request.getParameter("inforId");
+		String referUser=request.getParameter("referUser");
+		List operaList=operaService.queryQuote(inforId,referUser);
+		List auditList=operaService.queryAudit(inforId,referUser);
+		request.setAttribute("operaList",operaList);
+		request.setAttribute("auditList",auditList);
+		return "list";
+	}
+	/*
+	 * 查询出库管理
+	 * 唐朝
+	 */
+	public String chukuQuery() throws IOException{
+		Map map = ParameterUtil.getParameter(ServletActionContext.getRequest());
+		HttpServletRequest request = ServletActionContext.getRequest();
+		String flag=MapUtils.getString(map, "flag","0");
+		if(flag.equals("2")){
+			String createIp=IPUtil.getIpAddr(request);
+			map.put("addIp", createIp);
+			operaService.updateChuku(map);
+		}
+		List chukuList=operaService.queryChuku(map);
+		request.setAttribute("chukuList",chukuList);
+		return "chuku";
+	}
+	
+	/*
+	 * 出库管理
+	 * 唐朝
+	 */
+	public String chukuUpdate() throws IOException{
+		Map map = ParameterUtil.getParameter(ServletActionContext.getRequest());
+		HttpServletRequest request = ServletActionContext.getRequest();
+		String id=request.getParameter("id");
+		String pactNumber=request.getParameter("pactNumber");
+		List updateList=operaService.queryChuku(id);
+		String inforId=MapUtils.getString((Map)updateList.get(0),"inforId","");
+		List contList=operaService.contInforId(inforId);
+		List information=operaService.queryInformation(inforId);
+		request.setAttribute("updateList",updateList);
+		request.setAttribute("contList",contList);
+		request.setAttribute("information",information);
+		request.setAttribute("pactNumber",pactNumber);
+		return "chuku";
+	}
+	/*
+	 * 历史填报信息查询
+	 * 唐朝
+	 */
+	public String history() throws IOException{
+		Map map = ParameterUtil.getParameter(ServletActionContext.getRequest());
+		HttpServletRequest request = ServletActionContext.getRequest();
+		List hisList=operaService.historyCheck(map);
+		request.setAttribute("hisList",hisList);
+		return "list";
+	}
+	/*
+	 * 历史填报信息查询详细
+	 * 唐朝
+	 */
+	public String historyxx() throws IOException{
+		Map map = ParameterUtil.getParameter(ServletActionContext.getRequest());
+		
+		HttpServletRequest request = ServletActionContext.getRequest();
+		String inforId=request.getParameter("inforId");
+		String checked=request.getParameter("checked");
+		map.put("inforId", inforId);
+		map.put("checked", checked);
+		List hisListxx=operaService.historyCheck(map);
+		List containerList=operaService.queryContainer(inforId);
+		List information=operaService.queryInformation(inforId);
+		request.setAttribute("hisListxx",hisListxx);
+		request.setAttribute("containerList",containerList);
+		request.setAttribute("information",information);
+		return "list";
+	}
+	/*
+	 * 查询出信息
+	 */
+	public String quoteUpQuery() throws IOException{
+		Map map = ParameterUtil.getParameter(ServletActionContext.getRequest());
+		HttpServletRequest request = ServletActionContext.getRequest();
+		HttpSession session=request.getSession();
+		String flag=MapUtils.getString(map,"flag","0");
+		String user=(String)session.getAttribute("user");
+		String createIp=IPUtil.getIpAddr(request);
+		if(flag.equals("0")){
+			map.put("createIp", createIp);
+			map.put("user", user);
+			operaService.addQuoteup(map);
+		}
+		//加价
+		else if(flag.equals("2")){
+			map.put("createIp", createIp);
+			map.put("user", user);
+			operaService.updateQuoteup(map);
+		}
+		//审核
+		else if(flag.equals("3")){
+			map.put("createIp", createIp);
+			map.put("user", user);
+			operaService.updateQuoteup(map);
+		}
+		List quoteupList=operaService.selectQuoteup(map);
+		request.setAttribute("quoteupList", quoteupList);
+		return "quoteup";
+	}
+	//添加价格
+	public String addPrice() throws IOException{
+		Map map = ParameterUtil.getParameter(ServletActionContext.getRequest());
+		HttpServletRequest request = ServletActionContext.getRequest();
+		String id=request.getParameter("id");
+		//添加价格之前查询出数据
+		List quoteupList=operaService.updateOrSelect(id);
+		request.setAttribute("quoteupList", quoteupList);
+		return "quoteup";
+	}
+	//审核价格
+	public String verify() throws IOException{
+		Map map = ParameterUtil.getParameter(ServletActionContext.getRequest());
+		HttpServletRequest request = ServletActionContext.getRequest();
+		String id=request.getParameter("id");
+		//添加价格之前查询出数据
+		List quoteupList=operaService.updateOrSelect(id);
+		request.setAttribute("quoteupList", quoteupList);
+		return "quoteup";
+	}
+	
+	public String quoteuphisOper() throws IOException{
+		Map map = ParameterUtil.getParameter(ServletActionContext.getRequest());
+		HttpServletRequest request = ServletActionContext.getRequest();
+		String inforId=request.getParameter("inforId");
+		String pactNumber=request.getParameter("pactNumber");
+		String referUser=request.getParameter("referUser");
+		//添加价格之前查询出数据
+		List quoteupList=operaService.quoteuphisOper(inforId,referUser);
+		request.setAttribute("quoteupList", quoteupList);
+		request.setAttribute("pactNumber", pactNumber);
+		request.setAttribute("referUser", referUser);
+		return "quoteup";
+	}
+	
+	
+	
+	/*
+	 * 维护学生表基本信息
+	 * 唐朝
+	 */
+	
+	
+	
+	public String querystu() throws IOException{
+		Map map = ParameterUtil.getParameter(ServletActionContext.getRequest());
+		HttpServletRequest request = ServletActionContext.getRequest();
+		String flag="0";
+		String a=MapUtils.getString(map, "flag","0");
+		flag=a;
+		List stuList=new ArrayList();
+		String name=MapUtils.getString(map, "name","0");
+		if(flag.equals("1")){
+			operaService.addStu(map);
+		}
+		//修改
+		else if(flag.equals("2")){
+			operaService.updateStu(map);
+		}
+		//删除
+		else if(flag.equals("3")){
+			operaService.deleteStu(map);
+		}
+		//上午发送短信
+		else if(flag.equals("4")){
+			operaService.aMStu(map);
+		}
+		//下午发送短信
+		else if(flag.equals("5")){
+			operaService.pMStu(map);
+		}
+		if(!name.equals("0")){
+			stuList=operaService.queryStu(name);
+		}else{
+			stuList=operaService.queryStu();
+		}
+		request.setAttribute("stuList",stuList);
+		return "stu";
+	}
+	public String updatestu() throws IOException{
+		Map map = ParameterUtil.getParameter(ServletActionContext.getRequest());
+		HttpServletRequest request = ServletActionContext.getRequest();
+		String id=MapUtils.getString(map, "id","0");
+		List stuList=operaService.queryStuId(id);
+		request.setAttribute("stuList", stuList);
+		return "stu";
+	}
+	public String xxstu() throws IOException{
+		Map map = ParameterUtil.getParameter(ServletActionContext.getRequest());
+		HttpServletRequest request = ServletActionContext.getRequest();
+		String id=MapUtils.getString(map, "id","0");
+		List stuList=operaService.queryStuId(id);
+		request.setAttribute("stuList", stuList);
+		return "stu";
+	}
+	
+	
+	public String querystuSms() throws IOException{
+		Map map = ParameterUtil.getParameter(ServletActionContext.getRequest());
+		HttpServletRequest request = ServletActionContext.getRequest();
+		String flag="0";
+		String a=MapUtils.getString(map, "flag","0");
+		flag=a;
+		List stuList=new ArrayList();
+		String phone=MapUtils.getString(map, "name","0");
+		String file=MapUtils.getString(map, "PictureUrl","0");
+		System.out.println(file);
+		if(!file.equals("0")){
+			operaService.addexcelsms(file);
+		}
+		//全部发送
+		if(flag.equals("10")){
+		//	operaService.qbfsSms();
+		}
+		if(!phone.equals("0")){
+			stuList=operaService.queryExcelSms(phone);
+		}else{
+			stuList=operaService.queryExcelSms();
+		}
+		request.setAttribute("stuList",stuList);
+		return "stu";
+	}
+	
+	public String queryYYSms() throws IOException{
+		Map map = ParameterUtil.getParameter(ServletActionContext.getRequest());
+		HttpServletRequest request = ServletActionContext.getRequest();
+		String flag="0";
+		String a=MapUtils.getString(map, "flag","0");
+		flag=a;
+		List stuList=new ArrayList();
+		String name=MapUtils.getString(map, "name","0");
+		/*if(flag.equals("1")){
+			operaService.addYYSms(map);
+		}*/
+		if(!name.equals("0")){
+			stuList=operaService.queryYY(name);
+		}else{
+			stuList=operaService.queryYY();
+		}
+		request.setAttribute("stuList",stuList);
+		return "stu";
+	}
+	
+	public String queryBesp() throws IOException{
+		Map map = ParameterUtil.getParameter(ServletActionContext.getRequest());
+		HttpServletRequest request = ServletActionContext.getRequest();
+		
+		return "stu";
+	}
+	
+	public String addYY() throws IOException{
+		Map map = ParameterUtil.getParameter(ServletActionContext.getRequest());
+		Object result = "-1";
+		List yyList=operaService.queryYY(map);
+		try
+		{
+			if(yyList.size()==0){
+				String id=operaService.addYYSmsId();
+				int maxid=Integer.parseInt(id)+1;
+				operaService.addYY(map,maxid);
+				result = maxid ;
+			}else{
+				result = "-3";
+			}
+		}
+		catch (Exception ex)
+		{
+			result = "-2";
+		}
+		ServletActionContext.getResponse().getWriter().write(result.toString());
+		return null;
+
+	}
+	
+	/*
+	 * 维护题库信息
+	 * 唐朝
+	 */
+	
+	
+	
+	public String queryQuestion() throws IOException{
+		Map map = ParameterUtil.getParameter(ServletActionContext.getRequest());
+		HttpServletRequest request = ServletActionContext.getRequest();
+		String flag="0";
+		String a=MapUtils.getString(map, "flag","0");
+		flag=a;
+		List operaList=new ArrayList();
+		String biaoti=MapUtils.getString(map, "biaoti","0");
+		if(flag.equals("1")){
+			operaService.addQuestion(map);
+		}
+		//修改
+		else if(flag.equals("2")){
+			operaService.updateQuestion(map);
+		}
+		//删除
+		else if(flag.equals("3")){
+			operaService.deleteQuestion(map);
+		}
+		if(!biaoti.equals("0")&&StringUtils.isNotBlank(biaoti)){
+			operaList=operaService.queryQuestion(biaoti);
+		}else{
+			operaList=operaService.queryQuestion();
+		}
+		request.setAttribute("operaList",operaList);
+		return "que";
+	}
+	
+	/*
+	 * 修改前查询
+	 */
+	public String updateQuestion() throws IOException{
+		Map map = ParameterUtil.getParameter(ServletActionContext.getRequest());
+		HttpServletRequest request = ServletActionContext.getRequest();
+		String questionid=MapUtils.getString(map, "questionid","0");
+		List queList=operaService.queryQuestionId(questionid);
+		request.setAttribute("queList", queList);
+		return "que";
+	}
+	
+	
+	/*
+	 * 生成卷子前参数
+	 */
+	
+	public String queryGenera() throws IOException{
+		Map map = ParameterUtil.getParameter(ServletActionContext.getRequest());
+		HttpServletRequest request = ServletActionContext.getRequest();
+		String flag="0";
+		String a=MapUtils.getString(map, "flag","0");
+		flag=a;
+		List generaList=new ArrayList();
+		if(flag.equals("1")){
+			operaService.addGenera(map);
+		}
+		//修改
+		else if(flag.equals("2")){
+			operaService.updateGenera(map);
+		}
+		//删除
+		else if(flag.equals("3")){
+			operaService.deleteGenera(map);
+		}
+		generaList=operaService.queryGenera();
+		request.setAttribute("generaList",generaList);
+		return "que";
+	}
+	/*
+	 * 修改前查询
+	 */
+	public String updateGenera() throws IOException{
+		Map map = ParameterUtil.getParameter(ServletActionContext.getRequest());
+		HttpServletRequest request = ServletActionContext.getRequest();
+		String generatingid=MapUtils.getString(map, "generatingid","0");
+		List queList=operaService.queryGeneraId(generatingid);
+		request.setAttribute("queList", queList);
+		return "que";
+	}
+	
+	/*
+	 * 维护学生中考分基本表
+	 * 唐朝
+	 */
+	
+	
+	
+	public String queryFractional() throws IOException{
+		Map map = ParameterUtil.getParameter(ServletActionContext.getRequest());
+		HttpServletRequest request = ServletActionContext.getRequest();
+		String flag="0";
+		String a=MapUtils.getString(map, "flag","0");
+		flag=a;
+		
+		String name=MapUtils.getString(map, "name","");
+		String file=MapUtils.getString(map, "PictureUrl","0");
+		System.out.println(file);
+		if(!file.equals("0")){
+			operaService.addexcelFractional(file);
+		}
+		/*if(flag.equals("1")){
+			operaService.addStu(map);
+		}
+		//修改
+		else if(flag.equals("2")){
+			operaService.updateStu(map);
+		}*/
+		//删除else
+		if(flag.equals("3")){
+			operaService.deleteFractional(map);
+		}
+		List fList=new ArrayList();
+		if(StringUtils.isNotBlank(name)){
+			fList=operaService.queryFractional(name);
+		}else{
+			fList=operaService.queryFractional();
+		}
+		request.setAttribute("fList",fList);
+		return "fract";
+	}
+	/*
+	 * 根据姓名准考证号查询
+	 */
+	public String queryqzfy() throws IOException{
+		Map map = ParameterUtil.getParameter(ServletActionContext.getRequest());
+		HttpServletRequest request = ServletActionContext.getRequest();
+		String zkh=MapUtils.getString(map, "zkh","");
+		if(!StringUtils.isNotBlank(zkh)){
+			zkh=request.getParameter("zkh");
+		}
+		String name=MapUtils.getString(map, "name","");
+		if(!StringUtils.isNotBlank(name)){
+			name=request.getParameter("name");
+		}
+		List fList=operaService.queryFractional(zkh,name);
+		request.setAttribute("fList", fList);
+		return "fract";
+	}
+	
+	
+	/*
+	 * 查询登陆
+	 * 唐朝
+	 */
+	public String queryqzfyList() throws IOException{
+		Map map = ParameterUtil.getParameter(ServletActionContext.getRequest());
+		String zkh=MapUtils.getString(map, "zkh","");
+		String name=MapUtils.getString(map, "name","");
+		Object result = "-1";
+		List fList=operaService.queryFractional(zkh,name);
+		try
+		{
+			if(fList.size()==1){
+				result = "1" ;
+			}
+		}
+		catch (Exception ex)
+		{
+			result = "-2";
+		}
+		ServletActionContext.getResponse().getWriter().write(result.toString());
+		return null;
+
+	}
+	
+}

+ 552 - 0
src/com/acc/framework/thtopera/dao/OperaDAO.java

@@ -0,0 +1,552 @@
+package com.acc.framework.thtopera.dao;
+
+import java.util.List;
+import java.util.Map;
+
+import org.apache.commons.collections.MapUtils;
+import org.apache.commons.lang.StringUtils;
+import org.springframework.stereotype.Repository;
+
+import com.acc.common.annotation.inject.parent.InjectItem;
+import com.acc.common.annotation.inject.parent.ParentInject;
+import com.acc.common.jdbc.JdbcDaoSupportEx;
+import com.acc.common.jdbc.JdbcTemplateEx;
+import com.acc.util.common.MapUtil;
+
+@Repository
+@ParentInject(items = @InjectItem(attr = "dataSource", ref = "jdbcdataSource"))
+public class OperaDAO extends JdbcDaoSupportEx
+{
+
+
+	/*
+	 * 查询所有填报
+	 * 唐朝
+	 */
+	public List queryOpera(String operaSql)
+	{
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		String sql = "select * from receipt "+operaSql;
+		return template.queryForList(sql);
+	}
+	
+	/*
+	 * 根据合同号查询填报数据
+	 * 唐朝
+	 */
+	public List queryOperaInfor(String inforId)
+	{
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		String sql = "select * from receipt t where inforId='"+inforId+"'";
+		return template.queryForList(sql);
+	}
+	
+	public List queryShipments(String inforId)
+	{
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		String sql = "select * from chuku t where inforId='"+inforId+"'";
+		return template.queryForList(sql);
+	}
+	public List queryContainer(String inforId){
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		String sql = "select * from container t where inforId='"+inforId+"'";
+		return template.queryForList(sql);
+	}
+	public List queryInformation(String inforId){
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		String sql = "select * from information t where inforId='"+inforId+"'";
+		return template.queryForList(sql);
+	}
+	
+	
+	/*
+	 * 添加填报信息
+	 * 唐朝
+	 */
+	public void addOpera(Map map){
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		template.insertMap(map, "receipt", "inforId");
+	}
+	public void updateContainer(Map map){
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		MapUtil.filterMap(map);
+		template.updateMap(map, "container", "id");
+	}
+	public void updateOpera(Map map){
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		MapUtil.filterMap(map);
+		template.updateMap(map, "receipt", "inforId");
+	}
+	/*
+	 * 添加报价信息
+	 */
+	public void addQuote(Map map){
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		template.insertMap(map, "quote", "id");
+	}
+	/*
+	 * 根据结束时间查询招标信息
+	 * 唐朝
+	 */
+	public Map queryGlobe(String endTime)
+	{
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		String sql = "select * from receipt t where t.endTime>=STR_TO_DATE('"+endTime+"','%Y-%m-%d %H:%i:%s')";
+		return template.queryForMap(sql);
+	}
+	/*
+	 * 查询所有人对合同的报价
+	 * 唐朝
+	 */
+	
+	public List queryQuote(String inforId)
+	{
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		String sql = "select * from quote t where (t.referStatus='1' or t.referStatus='2') and t.inforId='"+inforId+"' order by quote ";
+		return template.queryForList(sql);
+	}
+	
+	public List queryQuote(String inforId,String user)
+	{
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		String sql = "select * from quote t where inforId='"+inforId+"' and referUser='"+user+"'";
+		return template.queryForList(sql);
+	}
+	public List queryAudit(String inforId,String user)
+	{
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		String sql = "select * from audit t where inforId='"+inforId+"' and referUser='"+user+"'";
+		return template.queryForList(sql);
+	}
+	/*
+	 * 查询报价未结束的数据
+	 * 唐朝
+	 */
+	public List queryEnd(String endTime)
+	{
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		String sql = "select * from receipt t where t.endTime>=STR_TO_DATE('"+endTime+"','%Y-%m-%d %H:%i:%s') and t.stell='1'";
+		return template.queryForList(sql);
+	}
+	
+	public void updateQuote(Map map){
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		MapUtil.filterMap(map);
+		template.updateMap(map, "quote", "id");
+	}
+	
+	public int selectShipmentsId(){
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		String sql = "select max(id) id from chuku t";
+		return MapUtils.getIntValue((Map)template.queryForList(sql).get(0), "id");
+	}
+	public int selectAuditId(){
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		String sql = "select max(id) id from audit t";
+		return MapUtils.getIntValue((Map)template.queryForList(sql).get(0), "id");
+	}
+	public List selectAudit(String inforId,String referUser){
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		String sql = "select * from audit t where t.inforId='"+inforId+"' and t.referUser='"+referUser+"'";
+		return template.queryForList(sql);
+	}
+	public List selectShipments(String inforId,String referUser){
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		String sql = "select * from chuku t where t.inforId='"+inforId+"' and t.referUser='"+referUser+"'";
+		return template.queryForList(sql);
+	
+	}
+	public void addShipments(Map map){
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		template.insertMap(map, "chuku", "id");
+	}
+	
+	
+	public void addAudit(Map map){
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		template.insertMap(map, "audit", "id");
+	}
+	public List queryChuku1(String chukuSql){
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		String sql = "select * from chuku "+chukuSql;
+		return template.queryForList(sql);
+	}
+	//查询出库信息
+	public List queryChuku2(String id){
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		String sql = "select * from chuku t where t.id="+id;
+		return template.queryForList(sql);
+	}
+	//根据数据单号查询 出库箱信息
+	public List contInforId(String inforId){
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		String sql = "select * from container t where t.inforId="+inforId;
+		return template.queryForList(sql);
+	}
+	
+	public void updateChuku(Map map){
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		MapUtil.filterMap(map);
+		template.updateMap(map, "chuku", "id");
+	
+	}
+	
+	public void updateInformation(Map map){
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		MapUtil.filterMap(map);
+		template.updateMap(map, "information", "id");
+	
+	}
+	
+	public List informationBe(String inforId,String packBoxId){
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		String sql = "select * from information t where t.inforId='"+inforId+"' and t.packBoxId='"+packBoxId+"'";
+		return template.queryForList(sql);
+	}
+	
+	public int maxInformationId(){
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		String sql = "select max(id) id from information t ";
+		return MapUtils.getIntValue((Map)template.queryForList(sql).get(0),"id",0);
+	}
+	
+	public List historyCheck(String hisSql){
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		return template.queryForList(hisSql);
+	}
+	
+	
+	public int maxId(){
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		String sql = "select max(id) id from container t";
+		return MapUtils.getIntValue((Map)template.queryForList(sql).get(0), "id");
+	}
+	//查询
+	public List contBe(String inforId,String packBoxId){
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		String sql = "select *  from container t where t.inforId='"+inforId+"' and t.packBoxId='"+packBoxId+"'";
+		return template.queryForList(sql);
+	}
+	
+	public void addContainer(Map map){
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		template.insertMap(map, "container", "id");
+	}
+	
+	
+	public void addInformation(Map map){
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		template.insertMap(map, "information", "id");
+	}
+	
+	/*
+	 * 根据用户名和时间查询出当前可报价。
+	 * 唐朝
+	 */
+	
+	public List selectQuote(String quoteSql)
+	{
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		String sql = "select * from quote t "+quoteSql;
+		return template.queryForList(sql);
+	}
+	public List selectQuoteup(String quoteupSql){
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		String sql = "select * from quoteup t "+quoteupSql;
+		return template.queryForList(sql);
+	}
+	public int MaxquoteupId(){
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		String sql = "select max(id) id from quoteup t ";
+		return MapUtils.getIntValue((Map)template.queryForList(sql).get(0), "id");
+	}
+	
+	public int MaxquoteuphisId(){
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		String sql = "select max(id) id from quoteuphis t ";
+		return MapUtils.getIntValue((Map)template.queryForList(sql).get(0), "id");
+	}
+	
+	public void updateQuoteup(Map map){
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		MapUtil.filterMap(map);
+		template.updateMap(map, "quoteup", "id");
+	}
+	
+	public List selectReceipt(String sql){
+
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		return template.queryForList(sql);
+	}
+	public void addQuoteup(Map map){
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		template.insertMap(map, "quoteup", "id");
+	}
+	
+	
+	public void addQuoteuphis(Map map){
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		template.insertMap(map, "quoteuphis", "id");
+	}
+	public List quoteuphisOper(String hisSql){
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		String sql = "select * from quoteuphis "+hisSql;
+		return template.queryForList(sql);
+	}
+	
+	
+	public List quertStu(String hisSql){
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		String sql = "select * from studentxx "+hisSql;
+		return template.queryForList(sql);
+	}
+	public List quertStu(){
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		String sql = "select * from studentxx ";
+		return template.queryForList(sql);
+	}
+	public int MaxstuId(){
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		String sql = "select max(id) id from studentxx t ";
+		return MapUtils.getIntValue((Map)template.queryForList(sql).get(0), "id");
+	}
+	
+	public void addStu(Map map){
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		template.insertMap(map, "studentxx", "id");
+	}
+	public void updateStu(Map map){
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		MapUtil.filterMap(map);
+		template.updateMap(map, "studentxx", "id");
+	}
+	/*
+	 * 删除用户
+	 * 唐朝
+	 */
+	public void deleteStu(int id){
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		String sql = "delete from studentxx where id='" + id + "'";
+		template.execute(sql);
+	}
+	public int maxES(){
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		String sql = "select max(id) id from excelsms ";
+		return MapUtils.getIntValue((Map)template.queryForList(sql).get(0), "id");
+	}
+	public void addexcelsms(Map map){
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		template.insertMap(map, "excelsms", "id");
+	}
+	public int MaxYYId(){
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		String sql = "select max(id) id from yuyueSms t ";
+		return MapUtils.getIntValue((Map)template.queryForList(sql).get(0), "id");
+	}
+	public void addYY(Map map){
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		template.insertMap(map, "yuyueSms", "id");
+	}
+	
+	public List quertYY(){
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		String sql = "select * from yuyueSms order by id ";
+		return template.queryForList(sql);
+	}
+	public List quertYY(String hisSql){
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		String sql = "select * from yuyueSms "+hisSql;
+		return template.queryForList(sql);
+	}
+	
+	
+	
+	
+	
+	public List quertSms(){
+		
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		String sql = "select count(distinct tmp.id_) as sum,tmp.assignee_ as userid,c.mobile as dh from";
+		sql += "   ( ";
+		sql += "           SELECT task.id_,task.assignee_ ";
+		sql += "	   	           FROM ACT_RU_TASK task ";
+		sql += "                LEFT JOIN bpm_task_read tread ON task.id_ =tread.TASKID  ";
+		sql += "					 LEFT JOIN SYS_USER_POS uo on tread.userId=uo.userid ";
+		sql += "                LEFT JOIN BPM_PRO_RUN run ON task.PROC_INST_ID_ = run.actInstId ";
+		sql += "                LEFT JOIN sys_gl_type TYPE ON TYPE.typeid = run.typeid ";
+		sql += "	                LEFT JOIN BPM_DEFINITION def on task.PROC_DEF_ID_=def.actDefId ";
+
+		sql += "	          WHERE  task.DESCRIPTION_!='39' and def.status!=3 ";
+
+		sql += "	         UNION ALL ";
+
+		sql += "	           SELECT task.id_,task.assignee_ ";
+		sql += "	           FROM ACT_RU_TASK task ";
+		sql += "	                LEFT JOIN bpm_task_read tread ON task.id_ =tread.TASKID ";
+		sql += "						 LEFT JOIN SYS_USER_POS uo on tread.userId=uo.userid ";
+		sql += "		                LEFT JOIN BPM_PRO_RUN run ON task.PROC_INST_ID_ = run.actInstId ";
+		sql += "                LEFT JOIN sys_gl_type TYPE ON TYPE.typeid = run.typeid ";
+		sql += "                LEFT JOIN BPM_DEFINITION def on task.PROC_DEF_ID_=def.actDefId ";
+
+		sql += "           		JOIN act_ru_identitylink ident ON task.id_ = ident.TASK_ID_ ";
+		sql += "          WHERE  task.ASSIGNEE_ =0 and task.DESCRIPTION_!='39' and def.status!=3 ";
+
+		sql += "          UNION ALL ";
+
+		sql += "       SELECT task.id_,task.assignee_ ";
+		sql += "         FROM ACT_RU_TASK task ";
+		sql += "            LEFT JOIN bpm_task_read tread ON task.id_ =tread.TASKID  ";
+		sql += "			LEFT JOIN SYS_USER_POS uuo ON tread.userId=uuo.userid ";
+		sql += "              LEFT JOIN BPM_PRO_RUN run ON task.PROC_INST_ID_ = run.actInstId ";
+		sql += "        LEFT JOIN sys_gl_type TYPE ON TYPE.typeid = run.typeid ";
+		sql += "            LEFT JOIN BPM_DEFINITION def on task.PROC_DEF_ID_=def.actDefId ";
+
+		sql += "    	  JOIN act_ru_identitylink ident ON task.id_ = ident.TASK_ID_ ";
+		sql += "	WHERE ident.type_ = 'org' and ident.group_id_ in (select uo.orgid from SYS_USER_POS uo ) ";
+		sql += "     and task.ASSIGNEE_ =0 and task.DESCRIPTION_!='39' and def.status!=3 ";
+
+		sql += "      UNION ALL ";
+
+		sql += "     SELECT task.id_,task.assignee_ ";
+		sql += "         FROM ACT_RU_TASK task ";
+		sql += "            LEFT JOIN bpm_task_read tread ON task.id_ =tread.TASKID  ";
+		sql += "			LEFT JOIN sys_user_role uur ON tread.userId= uur.userid ";
+		sql += "           LEFT JOIN BPM_PRO_RUN run ON task.PROC_INST_ID_ = run.actInstId ";
+		sql += "                LEFT JOIN sys_gl_type TYPE ON TYPE.typeid = run.typeid ";
+		sql += "               LEFT JOIN BPM_DEFINITION def on task.PROC_DEF_ID_=def.actDefId ";
+
+		sql += "  	  JOIN act_ru_identitylink ident ON task.id_ = ident.TASK_ID_ ";
+		sql += "	WHERE ident.type_ = 'role' and ident.group_id_ in (select ur.roleid from sys_user_role ur  ) ";
+		sql += "   and task.ASSIGNEE_ =0 and task.DESCRIPTION_!='39' and def.status!=3 ";
+
+		sql += "   UNION ALL ";
+
+		sql += "   SELECT task.id_,task.assignee_ ";
+		sql += "    FROM ACT_RU_TASK task ";
+		sql += "        LEFT JOIN bpm_task_read tread ON task.id_ =tread.TASKID  ";
+		sql += "		LEFT JOIN sys_user_pos uup ON tread.userId=uup.userid ";
+		sql += "       LEFT JOIN BPM_PRO_RUN run ON task.PROC_INST_ID_ = run.actInstId ";
+		sql += "      LEFT JOIN sys_gl_type TYPE ON TYPE.typeid = run.typeid ";
+		sql += "     LEFT JOIN BPM_DEFINITION def on task.PROC_DEF_ID_=def.actDefId ";
+
+		sql += "	  JOIN act_ru_identitylink ident ON task.id_ = ident.TASK_ID_ ";
+		sql += "	WHERE ident.type_ = 'pos' and ident.group_id_ in (select up.posid from sys_user_pos up where  up.isdelete=0) ";
+		sql += "     and task.ASSIGNEE_ =0 and task.DESCRIPTION_!='39'  and def.status!=3 ";
+
+		sql += "     UNION ALL ";
+
+		sql += "    SELECT task.id_,task.assignee_ ";
+
+		sql += "     FROM ACT_RU_TASK task ";
+		sql += "         LEFT JOIN bpm_task_read tread ON task.id_ =tread.TASKID  ";
+		sql += "		LEFT JOIN SYS_USER_POS uuo ON tread.userId=uuo.userid ";
+		sql += "         LEFT JOIN BPM_PRO_RUN run ON task.PROC_INST_ID_ = run.actInstId ";
+		sql += "           LEFT JOIN sys_gl_type TYPE ON TYPE.typeid = run.typeid ";
+		sql += "        LEFT JOIN BPM_DEFINITION def on task.PROC_DEF_ID_=def.actDefId ";
+
+		sql += "   	  JOIN act_ru_identitylink ident ON task.id_ = ident.TASK_ID_ ";
+		sql += "  	WHERE ident.type_ = 'job' and ident.group_id_ in (select p.jobid from SYS_USER_POS uo inner join sys_pos p on p.posid=uo.posid ) ";
+		sql += "       and task.ASSIGNEE_ =0 and task.DESCRIPTION_!='39'  and def.status!=3 ";
+		sql += "      ) ";
+		sql += "	  tmp,sys_user c where tmp.assignee_=c.userid ";
+		sql += " group by tmp.assignee_,c.mobile ";
+
+		return template.queryForList(sql);
+	}
+	
+	public List querzs(){
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		String sql="select count(doctitle) hz,channelid from WCMIVTABLE57 group by channelid order by hz desc";
+		return template.queryForList(sql);
+	}
+	
+	public List querhf(){
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		String sql="select count(t.group1__hui_fu_nei_rong) hz,t.channelid from WCMIVTABLE57 t group by t.channelid order by hz desc";
+		return template.queryForList(sql);
+	}
+	
+	public List quertSmszf(){
+		
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		String sql=" SELECT count(*) as sum,cpt.cc_uid as userid,u.mobile as dh	FROM BPM_PRO_CPTO cpt 	left join SYS_GL_TYPE type on cpt.DEF_TYPEID = type.typeId	";
+			   sql += " left join BPM_PRO_RUN_HIS run  on cpt.RUN_ID = run.runId ";
+			   sql += " left join BPM_DEFINITION def on run.defId = def.defId ";
+			   sql += " left join sys_user u on u.userid=cpt.cc_uid ";
+			   sql += " where  cpt.is_readed='0'  group by cpt.cc_uid,u.mobile ";
+	
+		return template.queryForList(sql);
+	}
+	
+	
+	/*
+	 * 题库
+	 */
+	public List queryQuestion(String sql){
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		return template.queryForList(sql);
+	}
+	public int MaxQuestionId(){
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		String sql = "select max(questionid) questionid from question t ";
+		return MapUtils.getIntValue((Map)template.queryForList(sql).get(0), "questionid");
+	}
+	
+	public void addQuestion(Map map){
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		template.insertMap(map, "question");
+	}
+	public void updateQuestion(Map map){
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		MapUtil.filterMap(map);
+		template.updateMap(map, "question", "questionid");
+	}
+	public void deleteQuestionid(int id){
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		String sql = "delete from question where questionid='" + id + "'";
+		template.execute(sql);
+	}
+	/*
+	 * 生成卷子前配置
+	 */
+	public List queryGenera(String sql){
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		return template.queryForList(sql);
+	}
+	public int MaxGeneraId(){
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		String sql = "select max(generatingid) generating from generating t ";
+		return MapUtils.getIntValue((Map)template.queryForList(sql).get(0), "generatingid");
+	}
+	
+	public void addGenera(Map map){
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		template.insertMap(map, "generating");
+	}
+	public void updateGenera(Map map){
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		MapUtil.filterMap(map);
+		template.updateMap(map, "generating", "generatingid");
+	}
+	public void deleteGenera(int id){
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		String sql = "delete from generating where generatingid='" + id + "'";
+		template.execute(sql);
+	}
+	
+	public void deleteFractional(int id){
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		String sql = "delete from fractional where id='" + id + "'";
+		template.execute(sql);
+	}
+	public int maxFractional(){
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		String sql = "select max(id) id from fractional ";
+		return MapUtils.getIntValue((Map)template.queryForList(sql).get(0), "id");
+	}
+	public void addexcelFractional(Map map){
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		template.insertMap(map, "fractional", "id");
+	}
+	
+}

+ 145 - 0
src/com/acc/framework/thtopera/service/OperaService.java

@@ -0,0 +1,145 @@
+package com.acc.framework.thtopera.service;
+
+import java.util.List;
+import java.util.Map;
+
+public interface OperaService
+{
+	
+	//添加信息receipt container 填报信息 和发运包装箱
+	public void addOpera(Map map);
+	//修改receipt  container   修改填报信息 和发运包装箱
+	public void updateOpera(Map map);
+	//提交 修改状态值
+	public void updateOperaStell(Map map);
+	//查询quote(报价人)
+	public List selectQuote(String id);
+	public void updateQuote(List quoteList);
+	public List queryOpera(Map map);
+	
+	//查询详细信息
+	public List queryOperaInfor(String inforId,String flag);
+	public List queryContainer(String inforId);
+	public List queryInformation(String inforId);
+	
+	//查询提交报价单
+	public List queryQuote(String inforId);
+	//插入出库箱信息,修改出库信息
+	public void updateChuku(Map map);
+	// 查询所有出库未出库
+	public List queryChuku(Map map);
+	
+	//根据编号查询出库信息
+	public List queryChuku(String id);
+	//根据数据单号查询 出库箱信息
+	public List contInforId(String inforId);
+	
+	public void addQuote(Map map);
+	public Map queryGlobe();
+	
+	public List queryQuote(String inforId,String user);
+	public List queryAudit(String inforId,String user);
+	public List queryEnd(String endTime);
+	
+	public void updateQuoteSh(Map map);
+	
+	/*
+	 * 添加报价商为中标的信息
+	 * 唐朝
+	 *
+	 */
+	public void addQuoteup(Map map);
+	/*
+	 * 查询报价商改价表
+	 * 唐朝
+	 */
+	public List selectQuoteup(Map map);
+	
+	//查询历史信息
+	public List historyCheck(Map map);
+	//添加价格之前查询出数据
+	public List updateOrSelect(String id);
+	public void updateQuoteup(Map map);
+	//查询历史记录信息
+	public List quoteuphisOper(String inforId,String referUser);
+	
+	public List queryStu(String name);
+	public List queryStu();
+	public void addStu(Map map);
+	public List queryStuId(String id);
+	public void updateStu(Map map);
+	public void deleteStu(Map map);
+	public void aMStu(Map map);
+	public void pMStu(Map map);
+	public List queryExcelSms(String name);
+	public List queryExcelSms();
+	public void  addexcelsms(String file);
+	public void  addexcelFractional(String file);
+	
+	
+	public void addYYSms(Map map);
+	public List queryYY(String name);
+	public List queryYY(Map map);
+	public List queryYY();
+	public String  addYYSmsId();
+	public void addYY(Map map,int id);
+	
+	/*
+	 * 查询题库
+	 */
+	public List queryQuestion();
+	/*
+	 * 按照标题查询
+	 */
+	public List queryQuestion(String biaoti);
+	/*
+	 * 添加题库
+	 */
+	public void addQuestion(Map map);
+	/*
+	 * 修改题库
+	 */
+	public void updateQuestion(Map map);
+	/*
+	 * 删除题库
+	 */
+	public void deleteQuestion(Map map);
+	/*
+	 * 修改前查询
+	 */
+	public List queryQuestionId(String id);
+	/*
+	 * 查询生成卷子设置
+	 */
+	public List queryGenera();
+	/*
+	 * 添加生成卷子设置
+	 */
+	public void addGenera(Map map);
+	/*
+	 * 修改生成卷子设置
+	 */
+	public void updateGenera(Map map);
+	/*
+	 * 删除生成卷子设置
+	 */
+	public void deleteGenera(Map map);
+	/*
+	 * 修改前查询
+	 */
+	public List queryGeneraId(String id);
+	/*
+	 * 查询分数库
+	 */
+	public List queryFractional();
+	/*
+	 * 按照姓名查询
+	 */
+	public List queryFractional(String name);
+	public List queryFractional(String zkh,String name);
+	/*
+	 * 删除分数单条
+	 */
+	
+	public void deleteFractional(Map map);
+}

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 1366 - 0
src/com/acc/framework/thtopera/service/impl/OperaServiceImpl.java


+ 133 - 0
src/com/acc/framework/thtquote/action/QuoteAction.java

@@ -0,0 +1,133 @@
+package com.acc.framework.thtquote.action;
+
+import java.io.IOException;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpSession;
+
+import org.apache.commons.collections.MapUtils;
+import org.apache.commons.lang.StringUtils;
+import org.apache.struts2.ServletActionContext;
+import org.springframework.stereotype.Component;
+
+import com.acc.framework.thtopera.service.OperaService;
+import com.acc.framework.thtquote.service.QuoteService;
+import com.acc.util.common.DateUtil;
+import com.acc.util.common.IPUtil;
+import com.acc.util.common.ParameterUtil;
+import com.opensymphony.xwork2.ActionSupport;
+
+@Component
+public class QuoteAction extends ActionSupport
+{
+	@Resource(name = "quoteService")
+	private QuoteService quoteService;
+	@Resource(name = "operaService")
+	private OperaService operaService;
+	
+	public String query() throws IOException{
+		Map map = ParameterUtil.getParameter(ServletActionContext.getRequest());
+		HttpServletRequest request = ServletActionContext.getRequest();
+		HttpSession session=request.getSession();
+		String flag=MapUtils.getString(map,"flag","0");
+		String user=(String)session.getAttribute("user");
+		if(StringUtils.isNotBlank(user)){
+			Date date=new Date();
+			String endTime=DateUtil.getDateW3CFormat(date);
+			//查询是否有可报价的
+			List operaList=operaService.queryEnd(endTime);
+			for(int i=0;i<operaList.size();i++){
+				Map operaMap=(Map)operaList.get(i);
+				String inforId=MapUtils.getString(operaMap, "inforId","");
+				if(StringUtils.isNotBlank(inforId)){
+					List htList=quoteService.queryQuoteid(user,inforId);
+					if(htList.size()==0){
+						//获取当前操作人IP
+						String createIp=IPUtil.getIpAddr(request);
+						//把没有的招标数据添加到用户下
+						quoteService.addQuoteInfor(operaMap,user,createIp);
+						
+					}
+				}
+			}
+			//修改 填报数据
+			if(flag.equals("2")){
+				
+				String createIp=IPUtil.getIpAddr(request);
+				map.put("quoteIp", createIp);
+				map.put("referUser", user);
+				String id=MapUtils.getString(map, "id");
+				quoteService.updateQuote(map,id);
+			}
+			//提交
+			else if(flag.equals("3")){
+				String id=MapUtils.getString(map, "id");
+				List byList=quoteService.queryOut(id);
+				if(byList.size()>0){
+					Map byMap=(Map)byList.get(0);
+					String createIp=IPUtil.getIpAddr(request);
+					byMap.remove("quoteIp");
+					byMap.remove("referUser");
+					byMap.put("quoteIp", createIp);
+					byMap.put("referUser", user);
+					byMap.put("flag", "3");
+					quoteService.updateQuote(byMap,id);
+				}
+			}
+			//弃标
+			else if(flag.equals("4")){
+				String id=MapUtils.getString(map, "id");
+				List byList=quoteService.queryOut(id);
+				if(byList.size()>0){
+					Map byMap=(Map)byList.get(0);
+					String createIp=IPUtil.getIpAddr(request);
+					byMap.remove("quoteIp");
+					byMap.remove("referUser");
+					byMap.put("quoteIp", createIp);
+					byMap.put("referUser", user);
+					byMap.put("flag", "4");
+					quoteService.updateQuote(byMap,id);
+				}
+			}
+			//查询报价数据是否存在
+			List quoteList=quoteService.queryQuote(user,endTime,map);
+			
+			request.setAttribute("quoteList",quoteList);
+		}
+		return "list";
+	}
+	
+	/*
+	 * 用户填报前查询详细信息
+	 * 唐朝
+	 */
+	public String quote()throws IOException{
+		HttpServletRequest request = ServletActionContext.getRequest();
+		String id=request.getParameter("id");
+		//用户填报
+		List quoteList=quoteService.queryOut(id);
+		List operaList=operaService.queryOpera((Map)quoteList.get(0));
+		request.setAttribute("operaList",operaList);
+		request.setAttribute("quoteList",quoteList);
+		return "list";
+	}
+	
+	/*
+	 * 用户填报查询招标详细信息
+	 * 唐朝
+	 */
+	public String minute()throws IOException{
+		HttpServletRequest request = ServletActionContext.getRequest();
+		String id=request.getParameter("id");
+		//用户填报
+		List quoteList=quoteService.queryOut(id);
+		List operaList=operaService.queryOpera((Map)quoteList.get(0));
+		request.setAttribute("operaList",operaList);
+		request.setAttribute("quoteList",quoteList);
+		return "list";
+	}
+}

+ 102 - 0
src/com/acc/framework/thtquote/dao/QuoteDAO.java

@@ -0,0 +1,102 @@
+package com.acc.framework.thtquote.dao;
+
+import java.util.List;
+import java.util.Map;
+
+import org.apache.commons.collections.MapUtils;
+import org.springframework.stereotype.Repository;
+
+import com.acc.common.annotation.inject.parent.InjectItem;
+import com.acc.common.annotation.inject.parent.ParentInject;
+import com.acc.common.jdbc.JdbcDaoSupportEx;
+import com.acc.common.jdbc.JdbcTemplateEx;
+import com.acc.util.common.MapUtil;
+
+@Repository
+@ParentInject(items = @InjectItem(attr = "dataSource", ref = "jdbcdataSource"))
+public class QuoteDAO extends JdbcDaoSupportEx
+{
+
+
+	/*
+	 * 根据用户名和时间查询出当前可报价。
+	 * 唐朝
+	 */
+	
+	public List queryQuote(String quoteSql)
+	{
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		String sql = "select * from quote t "+quoteSql;
+		return template.queryForList(sql);
+	}
+	
+	public List queryQuote()
+	{
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		String sql = "select * from quote";
+		return template.queryForList(sql);
+	}
+	public List selectReceipt(String sql){
+
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		return template.queryForList(sql);
+	}
+	/*
+	 * 更具用户名和合同号查询这个用户下的所有报价单
+	 * 唐朝
+	 */
+	public List queryQuoteid(String user, String inforId){
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		String sql = "select * from quote t where t.referUser='"+user+"' and t.inforId='"+inforId+"'";
+		return template.queryForList(sql);
+	}
+	/*
+	 * 通过查询获取最大iD.
+	 * 唐朝
+	 */
+	public int selectId(){
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		String sql = "select max(id) id from quote t";
+		return MapUtils.getIntValue((Map)template.queryForList(sql).get(0), "id",0);
+	}
+	/*
+	 * 把可报价的数据添加到客户报价中
+	 * 唐朝
+	 */
+	public void insertQuote(Map quoteMap){
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		template.insertMap(quoteMap, "quote", "id");
+	}
+	public List queryOut(String id){
+		
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		String sql = "select * from quote t where t.id="+id;
+		return template.queryForList(sql);
+	}
+	
+	
+	public void updateQuote(Map map,String id){
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		MapUtil.filterMap(map);
+		template.updateMap(map, "quote", "id");
+		
+	}
+	public List selectChuku(String inforId ,String referUser){
+		
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		String sql = "select * from chuku t where t.inforId='"+inforId+"' and t.referUser='"+referUser+"'";
+		return template.queryForList(sql);
+	}
+	public void deleteChuku(String inforId ,String referUser){
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		String sql = "delete from chuku  where inforId='"+inforId+"' and referUser='"+referUser+"'";
+		template.execute(sql);
+	}
+	
+	public List selectQuoteup(String quoteupSql){
+		JdbcTemplateEx template = this.getJdbcTemplate();
+		String sql = "select * from quoteup "+quoteupSql;
+		return template.queryForList(sql);
+	}
+
+}

+ 13 - 0
src/com/acc/framework/thtquote/service/QuoteService.java

@@ -0,0 +1,13 @@
+package com.acc.framework.thtquote.service;
+
+import java.util.List;
+import java.util.Map;
+
+public interface QuoteService
+{
+	public List queryQuote(String user,String endTime,Map map);
+	public List queryQuoteid(String user,String inforId);
+	public List queryOut(String id);
+	public void addQuoteInfor(Map operaMap,String user,String ip);
+	public void updateQuote(Map map,String id);
+}

+ 206 - 0
src/com/acc/framework/thtquote/service/impl/QuoteServiceImpl.java

@@ -0,0 +1,206 @@
+package com.acc.framework.thtquote.service.impl;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.annotation.Resource;
+
+import org.apache.commons.collections.MapUtils;
+import org.apache.commons.lang.StringUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.springframework.stereotype.Service;
+
+import com.acc.framework.thtopera.dao.OperaDAO;
+import com.acc.framework.thtquote.dao.QuoteDAO;
+import com.acc.framework.thtquote.service.QuoteService;
+import com.acc.util.common.DateUtil;
+import com.acc.util.common.StringUtil;
+
+@Service(value = "quoteService")
+public class QuoteServiceImpl implements QuoteService
+{
+	
+	private static final Log logger = LogFactory.getLog(QuoteServiceImpl.class);
+
+	@Resource(name = "quoteDAO")
+	private QuoteDAO quoteDAO;
+	/*
+	 * (non-Javadoc)
+	 * @see com.acc.framework.thtquote.service.QuoteService#queryQuote(java.lang.String, java.lang.String)
+	 * 用用户和结束时间查看可填报信息
+	 * 唐朝
+	 */
+	public List queryQuote(String user,String endTime,Map map) {
+		String sql=" where 1=1";
+		sql+=" and t.referUser='"+user+"'";
+		String referStatus=MapUtils.getString(map,"referStatus","10");
+		String checked=MapUtils.getString(map,"checked","10");
+		if(!referStatus.equals("10") && StringUtils.isNotBlank(referStatus)){
+			sql+=" and referStatus='"+referStatus+"'";
+		}
+		if(!checked.equals("10") && StringUtils.isNotBlank(checked)){
+			sql+=" and checked='"+checked+"'";
+		}
+		List nullList=new ArrayList();
+		//查询当前用户下的所有报价单
+		List quoteList=quoteDAO.queryQuote(sql);
+		//查询所有报价单
+		List queryQuote=quoteDAO.queryQuote();
+		for(int i=0;i<quoteList.size();i++){
+			Map quoteMap=(Map)quoteList.get(i);
+			String inforId=MapUtils.getString(quoteMap,"inforId");
+			for(int j=0;j<queryQuote.size();j++){
+				Map queryMap=(Map)queryQuote.get(j);
+				String inforIdq=MapUtils.getString(queryMap,"inforId");
+				if(inforId.equals(inforIdq)){
+					String checkedq=MapUtils.getString(queryMap,"checked","0");
+					if(checkedq.equals("2")){
+						quoteMap.put("checkedis", checkedq);
+					}
+				}
+			}
+			nullList.add(quoteMap);
+		}
+		List addNullList=pactNumber(nullList);
+		String quoteupSql=" where 1=1 and stell='2'";
+		List quoteupList=quoteDAO.selectQuoteup(quoteupSql);
+		List queryList=new ArrayList();
+		for(int i=0;i<addNullList.size();i++){
+			Map addMap=(Map)addNullList.get(i);
+			String inforId=MapUtils.getString(addMap,"inforId");
+			String referUser=MapUtils.getString(addMap,"referUser");
+			for(int k=0;k<quoteupList.size();k++){
+				Map quoteupMap=(Map)quoteupList.get(k);
+				String qinforId=MapUtils.getString(quoteupMap,"inforId");
+				String qreferUser=MapUtils.getString(quoteupMap,"referUser");
+				if(inforId.equals(qinforId)&&referUser.equals(qreferUser)){
+					int price=MapUtils.getIntValue(quoteupMap, "price",0);
+					addMap.put("price", price);
+				}
+				
+			}
+			queryList.add(addMap);
+		}
+		return queryList;
+	}
+	/*
+	 * (non-Javadoc)
+	 * @see com.acc.framework.thtquote.service.QuoteService#queryQuoteid(java.lang.String, java.lang.String)
+	 * 用用户和单号查询是否存在
+	 * 唐朝
+	 */
+	public List queryQuoteid(String user, String inforId) {
+		List inforList=quoteDAO.queryQuoteid(user,inforId);
+		return inforList;
+	}
+	/*
+	 * (non-Javadoc)
+	 * @see com.acc.framework.thtquote.service.QuoteService#addQuoteInfor(java.util.Map, java.lang.String, java.lang.String)
+	 * 把quote报价表中用户没有的数据添加上
+	 * 唐朝
+	 */
+	public void addQuoteInfor(Map operaMap,String user,String ip) {
+		Map quoteMap=new HashMap();
+		String inforId=MapUtils.getString(operaMap, "inforId");
+		Date endTime=(Date)operaMap.get("endTime");
+		Date date=new Date();
+		String priceTime=DateUtil.getDateW3CFormat(date);
+		String end=DateUtil.getDateW3CFormat(endTime);
+		int id=quoteDAO.selectId();
+		quoteMap.put("id", id+1);
+		quoteMap.put("inforId",inforId);
+		quoteMap.put("referUser",user);
+		quoteMap.put("priceTime",priceTime);
+		quoteMap.put("endTime",end);
+		quoteMap.put("company","未报价");
+		quoteMap.put("referStatus","0");
+		quoteMap.put("quote",0);
+		quoteMap.put("quoteIp",ip);
+		quoteMap.put("checked","0");
+		quoteMap.put("arrivalTime",priceTime);
+		quoteMap.put("carFactoryTime",priceTime);
+		quoteDAO.insertQuote(quoteMap);
+	}
+	/*
+	 * (non-Javadoc)
+	 * @see com.acc.framework.thtquote.service.QuoteService#queryOut(java.lang.String)
+	 * 通过ID查询这次填报的信息基本信息
+	 * 唐朝
+	 */
+	public List queryOut(String id) {
+		List idList=quoteDAO.queryOut(id);
+		return idList;
+	}
+	/*
+	 * (non-Javadoc)
+	 * @see com.acc.framework.thtquote.service.QuoteService#updateQuote(java.util.Map, java.lang.String)
+	 * 修改填报信息
+	 * 唐朝
+	 */
+	public void updateQuote(Map map, String id) {
+		String flag=MapUtils.getString(map,"flag","0");
+		Date date=new Date();
+		String priceTime=DateUtil.getDateW3CFormat(date);
+		map.remove("flag");
+	
+		if(flag.equals("2")){
+			String endTime=MapUtils.getString(map,"endTime");
+			map.remove("endTime");
+			map.put("priceTime", priceTime);
+			map.put("endTime", endTime);
+		}else if(flag.equals("3")){
+			String endTime=DateUtil.getDateW3CFormat((Date)map.get("endTime"));
+			String arrivalTime=DateUtil.getDateW3CFormat((Date)map.get("arrivalTime"));
+			String  carFactoryTime=DateUtil.getDateW3CFormat((Date)map.get("carFactoryTime"));
+			map.put("priceTime", priceTime);
+			map.put("endTime", endTime);
+			map.put("arrivalTime", arrivalTime);
+			map.put("carFactoryTime", carFactoryTime);
+			map.put("referStatus","1");
+		}else if(flag.equals("4")){
+			String endTime=DateUtil.getDateW3CFormat((Date)map.get("endTime"));
+			String arrivalTime=DateUtil.getDateW3CFormat((Date)map.get("arrivalTime"));
+			String  carFactoryTime=DateUtil.getDateW3CFormat((Date)map.get("carFactoryTime"));
+			map.put("priceTime", priceTime);
+			map.put("endTime", endTime);
+			map.put("arrivalTime", arrivalTime);
+			map.put("carFactoryTime", carFactoryTime);
+			map.put("referStatus","2");
+			map.put("checked","4");
+			String inforId=MapUtils.getString(map, "inforId");
+			String referUser=MapUtils.getString(map, "referUser");
+			List chukuList=quoteDAO.selectChuku(inforId,referUser);
+			if(chukuList.size()>0){
+				quoteDAO.deleteChuku(inforId, referUser);
+			}
+		}
+		quoteDAO.updateQuote(map,id);
+	}
+	
+	
+	public List pactNumber(List list){
+		String receiptSql="select * from receipt t";
+		List receiptList=quoteDAO.selectReceipt(receiptSql);
+		List nullList=new ArrayList();
+		for(int i=0;i<list.size();i++){
+			Map map=(Map)list.get(i);
+			String inforId=MapUtils.getString(map, "inforId");
+			for(int k=0;k<receiptList.size();k++){
+				Map reMap=(Map)receiptList.get(k);
+				String inforIded=MapUtils.getString(reMap, "inforId");
+				if(inforId.equals(inforIded)){
+					String pactNumber=MapUtils.getString(reMap,"pactNumber");
+					map.put("pactNumber", pactNumber);
+					nullList.add(map);
+					break;
+				}
+			}
+		}
+		
+		return nullList;
+	} 
+}

+ 146 - 0
src/com/acc/taglib/html/CheckBoxTag.java

@@ -0,0 +1,146 @@
+package com.acc.taglib.html;
+
+import java.io.IOException;
+import java.util.List;
+import java.util.Map;
+
+import javax.servlet.jsp.JspException;
+import javax.servlet.jsp.tagext.TagSupport;
+
+import org.apache.commons.collections.KeyValue;
+import org.apache.commons.lang.StringUtils;
+
+public class CheckBoxTag extends TagSupport {
+
+	/**
+	 * checkbox名称
+	 */
+	private String name;
+
+	/**
+	 * 要显示的集合列表
+	 */
+	private List collection;
+
+	/**
+	 * 要选中显示,集合中的指定的记录集
+	 */
+	private List selectedlist;
+
+	/**
+	 * 记录集的ID列
+	 */
+	private String mapkey;
+
+	/**
+	 * 显示记录集合中指定的列
+	 */
+	private String mapvalue;
+
+	/**
+	 * 在标签上显示自定义html代码
+	 */
+	private String html;
+
+	public String getName() {
+		return name;
+	}
+
+	public void setName(String name) {
+		this.name = name;
+	}
+
+	public List getCollection() {
+		return collection;
+	}
+
+	public void setCollection(List collection) {
+		this.collection = collection;
+	}
+
+	public String getMapkey() {
+		return mapkey;
+	}
+
+	public void setMapkey(String mapkey) {
+		this.mapkey = mapkey;
+	}
+
+	public String getMapvalue() {
+		return mapvalue;
+	}
+
+	public void setMapvalue(String mapvalue) {
+		this.mapvalue = mapvalue;
+	}
+
+	public List getSelectedlist() {
+		return selectedlist;
+	}
+
+	public void setSelectedlist(List selectedlist) {
+		this.selectedlist = selectedlist;
+	}
+
+	public String getHtml() {
+		return html;
+	}
+
+	public void setHtml(String html) {
+		this.html = html;
+	}
+
+	public int doStartTag() throws JspException {
+		if (collection == null) {
+			return SKIP_BODY;
+		}
+		for (int i = 0; i < collection.size(); i++) {
+			Object object = collection.get(i);
+			if (object instanceof java.util.Map) {
+				if (mapkey != null && mapkey.length() > 0 && mapvalue != null
+						&& mapvalue.length() > 0) {
+					Map map = (Map) object;
+					String key = (String) map.get(mapkey);
+					String value = (String) map.get(mapvalue);
+					try {
+						pageContext.getOut().print(getCheckbox(key, value));
+					} catch (IOException e) {
+						throw new JspException(e);
+					}
+//					ResponseUtils.write(pageContext, getCheckbox(key, value));
+				}
+			}
+			if (object instanceof KeyValue) {
+				KeyValue kv = (KeyValue) object;
+				String key = kv.getKey().toString();
+				String value = kv.getValue().toString();
+
+				try {
+					pageContext.getOut().print(getCheckbox(key, value));
+				} catch (IOException e) {
+					throw new JspException(e);
+				}
+
+			}
+		}
+
+		return (SKIP_BODY);
+	}
+
+	private String getCheckbox(String key, String value) {
+		String checkbox = "";
+		String checked = "";
+		if (selectedlist != null && selectedlist.size() > 0) {
+			for (int i = 0; i < selectedlist.size(); i++) {
+				String selectedvalue = (String) selectedlist.get(i);
+				if (key != null && key.equals(selectedvalue))
+					checked = "checked";
+			}
+		}
+		html = StringUtils.trimToEmpty(html);
+		checkbox = " <input " + html + " type=\"checkbox\" name=\"" + name
+				+ "\" value=\"" + key + "\" " + checked + ">" + value + " ";
+		return checkbox;
+	}
+
+}

+ 57 - 0
src/com/acc/taglib/html/FieldOrderTag.java

@@ -0,0 +1,57 @@
+package com.acc.taglib.html;
+
+import java.io.IOException;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.jsp.JspException;
+import javax.servlet.jsp.tagext.TagSupport;
+
+public class FieldOrderTag extends TagSupport
+{
+
+	/**
+	 * 要排序的列
+	 * 
+	 */
+	private String inputField;
+
+	public void setInputField(String inputField)
+	{
+		this.inputField = inputField;
+	}
+
+	public String getInputField()
+	{
+		return inputField;
+	}
+
+	public int doStartTag() throws JspException
+	{
+		HttpServletRequest request = (HttpServletRequest) pageContext.getRequest();
+		String field = request.getParameter("orderField");
+		String type = request.getParameter("orderType");
+
+		if (field == null || type == null || inputField == null) return (SKIP_BODY);
+		if (!inputField.equals(field)) return (SKIP_BODY);
+
+		String viewGif = "";
+		if (type.equals("asc"))
+		{
+			viewGif = "<img src=\"/images/order_up.gif\"/>";
+		}
+		if (type.equals("desc"))
+		{
+			viewGif = "<img src=\"/images/order_down.gif\"/>";
+
+		}
+		
+		try {
+			pageContext.getOut().print(viewGif);
+		} catch (IOException e) {
+			throw new JspException(e);
+		}		
+		
+//		ResponseUtils.write(pageContext, viewGif);
+		return (SKIP_BODY);
+	}
+}

+ 55 - 0
src/com/acc/taglib/html/FormLabel.java

@@ -0,0 +1,55 @@
+package com.acc.taglib.html;
+
+import javax.servlet.jsp.JspException;
+import javax.servlet.jsp.tagext.TagSupport;
+
+public class FormLabel extends TagSupport
+{
+	private String name = "com.acc.taglib.GEAN";
+
+	private String property;
+
+	public String getProperty()
+	{
+		return property;
+	}
+
+	public void setName(String name)
+	{
+		this.name = name;
+	}
+
+	public void setProperty(String property)
+	{
+		this.property = property;
+	}
+
+	public String getName()
+	{
+		return name;
+	}
+
+	public FormLabel()
+	{
+	}
+
+	public int doStartTag() throws JspException
+	{
+
+		// Object value = RequestUtils.lookup(pageContext, name, this.property, null);
+		// if (value == null) value = "";
+		// value = ResponseUtils.filter(value.toString());
+		// ResponseUtils.write(pageContext, value.toString());
+		return (SKIP_BODY);
+	}
+
+	/**
+	 * Release all allocated resources.
+	 */
+	public void release()
+	{
+		super.release();
+		name = null;
+	}
+
+}

+ 149 - 0
src/com/acc/taglib/html/OptionTag.java

@@ -0,0 +1,149 @@
+package com.acc.taglib.html;
+
+import java.io.IOException;
+import java.util.List;
+import java.util.Map;
+
+import javax.servlet.jsp.JspException;
+import javax.servlet.jsp.tagext.TagSupport;
+
+import org.apache.commons.collections.KeyValue;
+
+import com.acc.util.common.StringUtil;
+
+public class OptionTag extends TagSupport
+{
+	/**
+	 * 要显示的集合列表
+	 */
+	private List collection;
+
+	/**
+	 * 要选中显示,集合中的指定的记录
+	 */
+	private String selectedvalue;
+
+	/**
+	 * 多重动态选择(市局)
+	 */
+	private String valuelength;
+	/**
+	 * 记录集的ID列
+	 */
+	private String mapkey;
+
+	/**
+	 * 显示记录集合中指定的列
+	 */
+	private String mapvalue;
+
+	public List getCollection()
+	{
+		return collection;
+	}
+
+	public void setCollection(List collection)
+	{
+		this.collection = collection;
+	}
+
+	public String getMapkey()
+	{
+		return mapkey;
+	}
+
+	public void setMapkey(String mapkey)
+	{
+		this.mapkey = mapkey;
+	}
+
+	public String getMapvalue()
+	{
+		return mapvalue;
+	}
+
+	public void setMapvalue(String mapvalue)
+	{
+		this.mapvalue = mapvalue;
+	}
+
+	public String getSelectedvalue()
+	{
+		return selectedvalue;
+	}
+
+	public void setSelectedvalue(String selectedvalue)
+	{
+		this.selectedvalue = selectedvalue;
+	}
+
+	public int doStartTag() throws JspException
+	{
+		if (collection == null)
+		{
+			return SKIP_BODY;
+		}
+		for (int i = 0; i < collection.size(); i++)
+		{
+			Object object = collection.get(i);
+			if (object instanceof java.util.Map)
+			{
+				if (mapkey != null && mapkey.length() > 0 && mapvalue != null
+						&& mapvalue.length() > 0)
+				{
+					Map map = (Map) object;
+					try {
+		    			pageContext.getOut().print(getOption(map.get(mapkey), map.get(mapvalue)));
+		    		} catch (IOException e) {
+		    			throw new JspException(e);
+		    		}
+//					ResponseUtils.write(pageContext, getOption(map.get(mapkey), map.get(mapvalue)));
+				}
+			}
+			if (object instanceof KeyValue)
+			{
+				KeyValue kv = (KeyValue) object;
+				String key = kv.getKey().toString();
+				String value = kv.getValue().toString();
+//				ResponseUtils.write(pageContext, getOption(key, value));
+				try {
+	    			pageContext.getOut().print(getOption(key, value));
+	    		} catch (IOException e) {
+	    			throw new JspException(e);
+	    		}
+			}
+		}
+		return SKIP_BODY;
+	}
+
+	private String getOption(Object key, Object value)
+	{
+		String option = "";
+		String selected = "";
+		if (selectedvalue != null && selectedvalue.trim().length() > 0)
+		{
+			if (key != null && key.equals(selectedvalue)) selected = "selected";
+		}
+		value = StringUtil.objToStr(value, "", "");
+		if(valuelength!=null)
+		{
+			if(((key+"").length()+"").equals(valuelength))
+				option = "<option " + selected + " value=\"" + key + "\">" + value + "</option>";
+		}
+		else
+		{
+			option = "<option " + selected + " value=\"" + key + "\">" + value + "</option>";
+		}
+		return option;
+	}
+
+	public String getValuelength()
+	{
+		return valuelength;
+	}
+
+	public void setValuelength(String valuelength)
+	{
+		this.valuelength = valuelength;
+	}
+}

+ 132 - 0
src/com/acc/taglib/html/OptionsTag.java

@@ -0,0 +1,132 @@
+package com.acc.taglib.html;
+
+import java.io.IOException;
+import java.util.List;
+import java.util.Map;
+
+import javax.servlet.jsp.JspException;
+import javax.servlet.jsp.tagext.TagSupport;
+
+import org.apache.commons.collections.KeyValue;
+
+public class OptionsTag extends TagSupport
+{
+	/**
+	 * 要显示的集合列表
+	 */
+	private List collection;
+
+	/**
+	 * 要选中显示,集合中的指定的记录集
+	 */
+	private List selectedlist;
+
+	/**
+	 * 记录集的ID列
+	 */
+	private String mapkey;
+
+	/**
+	 * 显示记录集合中指定的列
+	 */
+	private String mapvalue;
+
+	public List getCollection()
+	{
+		return collection;
+	}
+
+	public void setCollection(List collection)
+	{
+		this.collection = collection;
+	}
+
+	public String getMapkey()
+	{
+		return mapkey;
+	}
+
+	public void setMapkey(String mapkey)
+	{
+		this.mapkey = mapkey;
+	}
+
+	public String getMapvalue()
+	{
+		return mapvalue;
+	}
+
+	public void setMapvalue(String mapvalue)
+	{
+		this.mapvalue = mapvalue;
+	}
+
+	public List getSelectedlist()
+	{
+		return selectedlist;
+	}
+
+	public void setSelectedlist(List selectedlist)
+	{
+		this.selectedlist = selectedlist;
+	}
+
+	public int doStartTag() throws JspException
+	{
+		if (collection == null)
+		{
+			return SKIP_BODY;
+		}
+		for (int i = 0; i < collection.size(); i++)
+		{
+			Object object = collection.get(i);
+			if (object instanceof Map)
+			{
+				if (mapkey != null && mapkey.length() > 0 && mapvalue != null
+						&& mapvalue.length() > 0)
+				{
+					Map map = (Map) object;
+					String key = (String) map.get(mapkey);
+					String value = (String) map.get(mapvalue);
+//					ResponseUtils.write(pageContext, getOptions(key, value));					
+					try {
+		    			pageContext.getOut().print(getOptions(key, value));
+		    		} catch (IOException e) {
+		    			throw new JspException(e);
+		    		}
+		    		
+		    		
+				}
+			}
+			if (object instanceof KeyValue)
+			{
+				KeyValue kv = (KeyValue) object;
+				String key = kv.getKey().toString();
+				String value = kv.getValue().toString();
+				try {
+	    			pageContext.getOut().print( getOptions(key, value));
+	    		} catch (IOException e) {
+	    			throw new JspException(e);
+	    		}
+//				ResponseUtils.write(pageContext, getOptions(key, value));
+			}
+		}
+		return (SKIP_BODY);
+	}
+
+	private String getOptions(String key, String value)
+	{
+		String option = "";
+		String selected = "";
+		if (selectedlist != null && selectedlist.size() > 0)
+		{
+			for (int i = 0; i < selectedlist.size(); i++)
+			{
+				String selectedvalue = (String) selectedlist.get(i);
+				if (key != null && key.equals(selectedvalue)) selected = "selected";
+			}
+		}
+		option = "<option " + selected + " value=\"" + key + "\">" + value + "</option>";
+		return option;
+	}
+}

+ 61 - 0
src/com/acc/taglib/html/ParameterTag.java

@@ -0,0 +1,61 @@
+package com.acc.taglib.html;
+
+import java.io.IOException;
+
+import javax.servlet.jsp.JspException;
+import javax.servlet.jsp.tagext.TagSupport;
+
+import org.apache.commons.lang.StringEscapeUtils;
+
+public class ParameterTag extends TagSupport
+{
+
+	// ------------------------------------------------------------- Properties
+	/**
+	 * Name of the bean that contains the data we will be rendering.
+	 */
+	protected String name = null;
+
+	public String getName()
+	{
+		return (this.name);
+	}
+
+	public void setName(String name)
+	{
+		this.name = name;
+	}
+
+	// --------------------------------------------------------- Public Methods
+
+	/**
+	 * Process the start tag.
+	 * 
+	 * @exception JspException if a JSP exception has occurred
+	 */
+	public int doStartTag() throws JspException
+	{
+		String value = pageContext.getRequest().getParameter(name);
+		if (value != null && value.length() > 0)
+		{
+			value = StringEscapeUtils.escapeHtml(value);
+			try {
+    			pageContext.getOut().print(value);
+    		} catch (IOException e) {
+    			throw new JspException(e);
+    		}
+//			ResponseUtils.write(pageContext, value);
+		}
+		return (SKIP_BODY);
+	}
+
+	/**
+	 * Release all allocated resources.
+	 */
+	public void release()
+	{
+		super.release();
+		name = null;
+	}
+
+}

+ 162 - 0
src/com/acc/taglib/html/RadioTag.java

@@ -0,0 +1,162 @@
+package com.acc.taglib.html;
+
+import java.io.IOException;
+import java.util.List;
+import java.util.Map;
+
+import javax.servlet.jsp.JspException;
+import javax.servlet.jsp.tagext.TagSupport;
+
+import org.apache.commons.collections.KeyValue;
+import org.apache.commons.lang.StringUtils;
+
+public class RadioTag extends TagSupport
+{
+
+	/**
+	 * Radio名称
+	 */
+	private String name;
+
+	/**
+	 * 要显示的集合列表
+	 */
+	private List collection;
+
+	/**
+	 * 要选中显示,集合中的指定的记录
+	 */
+	private String selectedvalue;
+
+	/**
+	 * 记录集的ID列
+	 */
+	private String mapkey;
+
+	/**
+	 * 显示记录集合中指定的列
+	 */
+	private String mapvalue;
+
+	/**
+	 * 在标签上显示自定义html代码
+	 */
+	private String html;
+
+	public String getName()
+	{
+		return name;
+	}
+
+	public void setName(String name)
+	{
+		this.name = name;
+	}
+
+	public List getCollection()
+	{
+		return collection;
+	}
+
+	public void setCollection(List collection)
+	{
+		this.collection = collection;
+	}
+
+	public String getHtml()
+	{
+		return html;
+	}
+
+	public void setHtml(String html)
+	{
+		this.html = html;
+	}
+
+	public String getMapkey()
+	{
+		return mapkey;
+	}
+
+	public void setMapkey(String mapkey)
+	{
+		this.mapkey = mapkey;
+	}
+
+	public String getMapvalue()
+	{
+		return mapvalue;
+	}
+
+	public void setMapvalue(String mapvalue)
+	{
+		this.mapvalue = mapvalue;
+	}
+
+	public String getSelectedvalue()
+	{
+		return selectedvalue;
+	}
+
+	public void setSelectedvalue(String selectedvalue)
+	{
+		this.selectedvalue = selectedvalue;
+	}
+
+	public int doStartTag() throws JspException
+	{
+		if (collection == null)
+		{
+			return SKIP_BODY;
+		}
+		for (int i = 0; i < collection.size(); i++)
+		{
+			Object object = collection.get(i);
+			if (object instanceof java.util.Map)
+			{
+				if (mapkey != null && mapkey.length() > 0 && mapvalue != null
+						&& mapvalue.length() > 0)
+				{
+					Map map = (Map) object;
+					String key = (String) map.get(mapkey);
+					String value = (String) map.get(mapvalue);
+					try {
+		    			pageContext.getOut().print(getRadio(key, value));
+		    		} catch (IOException e) {
+		    			throw new JspException(e);
+		    		}
+//					ResponseUtils.write(pageContext, getRadio(key, value));
+				}
+			}
+			if (object instanceof KeyValue)
+			{
+				KeyValue kv = (KeyValue) object;
+				String key = kv.getKey().toString();
+				String value = kv.getValue().toString();
+				try {
+	    			pageContext.getOut().print(getRadio(key, value));
+	    		} catch (IOException e) {
+	    			throw new JspException(e);
+	    		}
+//				ResponseUtils.write(pageContext, getRadio(key, value));
+			}
+		}
+		return (SKIP_BODY);
+	}
+
+	private String getRadio(String key, String value)
+	{
+		String radio = "";
+		String checked = "";
+		if (selectedvalue != null && selectedvalue.trim().length() > 0)
+		{
+			if (key != null && key.equals(selectedvalue)) checked = "checked";
+		}
+		html = StringUtils.trimToEmpty(html);
+		radio = " <input name=\"" + name + "\" " + html + " value=\"" + key + "\" type=\"radio\" "
+				+ checked + ">" + value + " ";
+
+		return radio;
+	}
+
+}

+ 46 - 0
src/com/acc/taglib/page/IPageResult.java

@@ -0,0 +1,46 @@
+/***************************************************************************************************
+ * <class>: IPageViewResult.java <desc>: PageViewResult interface Dependencies: (if applicable) (c)
+ * 2003, DeliriumCybertouch (BJ) Limited. All rights reserved. Last Modified By: $Author: $ Last
+ * Modified On: $Date: $
+ **************************************************************************************************/
+
+package com.acc.taglib.page;
+
+import java.util.List;
+
+/**
+ * <p>
+ * <tt>IPageViewResult</tt>是关于翻页结果的抽象接口类�??
+ * </p>
+ * 
+ * 
+ * @author Tony.Su
+ * @version $Revision: 1.0 $ $Date: 2002/11/25 01:30:40 $
+ */
+
+public interface IPageResult
+{
+
+	/***********************************************************************************************
+	 * //**public method
+	 **********************************************************************************************/
+
+	/**
+	 * 获取翻业过程总集合所有记录数
+	 * 
+	 * @throws Exception 异常
+	 */
+	public long getAllRecordCount() throws Exception;
+
+	/**
+	 * 获取当前页翻页结果集列表
+	 * 
+	 * @param start 当前页包含结果集占�?�结果集�?始位�?
+	 * 
+	 * 
+	 * @param end 当前页包含结果集占�?�结果集结束位置
+	 * @throws Exception 异常
+	 */
+	public List getCurrentPageResultList(long start, long end) throws Exception;
+
+}

+ 137 - 0
src/com/acc/taglib/page/ListPageResultTag.java

@@ -0,0 +1,137 @@
+/***************************************************************************************************
+ * <class>: ListPageViewResult.java <desc>: ListPageViewResult Dependencies: (if applicable) (c)
+ * 2003, DeliriumCybertouch (BJ) Limited. All rights reserved. Last Modified By: $Author: $ Last
+ * Modified On: $Date: $
+ **************************************************************************************************/
+
+package com.acc.taglib.page;
+
+import java.util.List;
+import java.util.Vector;
+
+import javax.servlet.jsp.JspException;
+import javax.servlet.jsp.tagext.TagSupport;
+
+import org.springframework.context.support.MessageSourceAccessor;
+
+import com.acc.common.spring.ApplicationFactory;
+
+/**
+ * <p>
+ * <tt>ListPageResult</tt>是翻页结果接口的List方式实现的Jsp Tag类�?�这个Jsp Tag�?<tt>ListPageResult</tt>放置在pageContext的attribute中�??
+ * </p>
+ * 
+ * 
+ * @author Tony.Su
+ * @version $Revision: 1.0 $ $Date: 2002/11/25 01:30:40 $
+ */
+
+public class ListPageResultTag extends TagSupport implements IPageResult
+{
+
+	/***********************************************************************************************
+	 * //**成员变量
+	 **********************************************************************************************/
+
+	/**
+	 * 内部输入列表
+	 */
+
+	private List allRecord = null;
+
+	/**
+	 * 输入列表
+	 */
+	protected String inputList = null;
+
+	/**
+	 * Taglib ID
+	 */
+	protected String id = null;
+
+	/**
+	 * 包内的Message Resources.
+	 */
+	protected static MessageSourceAccessor messages = ApplicationFactory.getMessageSourceAccessor();
+
+	/***********************************************************************************************
+	 * public method
+	 **********************************************************************************************/
+
+	/**
+	 * 缺省构�?�方�?
+	 * 
+	 * 
+	 */
+	public ListPageResultTag()
+	{
+		this.allRecord = new Vector();
+	}
+
+	/**
+	 * 获取TagID
+	 */
+	public String getId()
+	{
+		return (this.id);
+	}
+
+	/**
+	 * 设置TagID
+	 */
+	public void setId(String id)
+	{
+		this.id = id;
+	}
+
+	/**
+	 * 获取输入列表
+	 */
+	public String getInputList()
+	{
+		return this.inputList;
+	}
+
+	/**
+	 * 设置输入列表
+	 */
+	public void setInputList(String inputList)
+	{
+		this.inputList = inputList;
+	}
+
+	/**
+	 * 获取翻业集合�?有记录数
+	 */
+	public long getAllRecordCount() throws Exception
+	{
+		return allRecord.size();
+	}
+
+	/**
+	 * 获取当前页翻页结果集列表
+	 */
+	public List getCurrentPageResultList(long start, long end) throws Exception
+	{
+		int stai = new Long(start).intValue();
+		int endi = new Long(end).intValue();
+		return allRecord.subList(stai - 1, endi);
+	}
+
+	/**
+	 * Tag Libary�?始调�?
+	 * 
+	 * 
+	 */
+	public int doStartTag() throws JspException
+	{
+		allRecord = (List) pageContext.getAttribute(inputList);
+		if (allRecord == null)
+		{
+			throw new JspException(messages.getMessage(
+					"ListPageResultTag.parameter.inputList.error", new Object[] { id, inputList }));
+		}
+		pageContext.setAttribute(id, this);
+		return (SKIP_BODY);
+	}
+}

+ 4 - 0
src/com/acc/taglib/page/LocalStrings.properties

@@ -0,0 +1,4 @@
+SQLPageResultTag.parameter.iSQLName.error = SQLPageResultTag "{0}" -->Parameter iSQLName error -->System cannot find iSQLName "{1}" in classpath
+SQLPageResultTag.parameter.jspsql.error = SQLPageResultTag "{0}" -->Parameter jspsql error -->System cannot find jspsql "{1}" SQL Statement
+ListPageResultTag.parameter.inputList.error=ListPageResultTag "{0}" -->Parameter inputList error -->system cannot find inputList argument  "{1}" in pageContext
+PreSQLPageResultTag.parameter.iPreSQLName.error=PreSQLPageResultTag "{0}" -->Parameter iPreSQLName error -->System cannot find iPreSQLName "{1}" in classpath

+ 29 - 0
src/com/acc/taglib/page/PageResultTei.java

@@ -0,0 +1,29 @@
+/***************************************************************************************************
+ * <class>: SQLPageResultTei.java <desc>: SQLPageResultTei Dependencies: (if applicable) (c) 2003,
+ * DeliriumCybertouch (BJ) Limited. All rights reserved. Last Modified By: $Author: $ Last Modified
+ * On: $Date: $
+ **************************************************************************************************/
+
+package com.acc.taglib.page;
+
+import javax.servlet.jsp.tagext.TagData;
+import javax.servlet.jsp.tagext.TagExtraInfo;
+import javax.servlet.jsp.tagext.VariableInfo;
+
+/**
+ * <p>
+ * <tt>PageResultTei</tt>应用了TagExtraInfo接口类�??
+ * </p>
+ * 
+ * @author Tony.Su
+ * @version $Revision: 1.0 $ $Date: 2002/11/25 01:30:40 $
+ */
+
+public class PageResultTei extends TagExtraInfo
+{
+	public VariableInfo[] getVariableInfo(TagData data)
+	{
+		return new VariableInfo[] { new VariableInfo(data.getAttributeString("id"),
+				"com.acc.taglib.page.IPageResult", true, VariableInfo.AT_BEGIN) };
+	}
+}

+ 200 - 0
src/com/acc/taglib/page/PageViewContext.java

@@ -0,0 +1,200 @@
+/***************************************************************************************************
+ * <class>: PageViewContext.java <desc>: PageViewContext Dependencies: (if applicable) (c) 2003,
+ * DeliriumCybertouch (BJ) Limited. All rights reserved. Last Modified By: $Author: $ Last Modified
+ * On: $Date: $
+ **************************************************************************************************/
+
+package com.acc.taglib.page;
+
+import java.util.List;
+
+/**
+ * <p>
+ * <tt>PageViewContext</tt>是关于翻页当前页结果集类。它包括当前翻页状�?�,翻页 �?包含的信息�??<tt>PageViewContext</tt>是一个标准的Java
+ * Bean,相关的翻页信息�?
+ * 
+ * 
+ * 参�?�下面的Java Bean属�?��??
+ * </p>
+ * 
+ * 
+ * @author Tony.Su
+ * @version $Revision: 1.0 $ $Date: 2002/11/25 01:30:40 $
+ */
+
+public class PageViewContext
+{
+	/**
+	 * 翻页页码
+	 */
+	protected long pageNum = 0L;
+
+	/**
+	 * 翻页每页纪录�?
+	 * 
+	 * 
+	 */
+	protected long pageSize = 0L;
+
+	/**
+	 * 翻页总数
+	 */
+	protected long totalPage = 0L;
+
+	/**
+	 * 翻页总纪录数
+	 */
+	protected long totalCount = 0L;
+
+	/**
+	 * 是否有上�?�?
+	 * 
+	 * 
+	 */
+	protected boolean last = false;
+
+	/**
+	 * 是否有下�?�?
+	 * 
+	 * 
+	 */
+	protected boolean next = false;
+
+	/**
+	 * 下一页页�?
+	 * 
+	 * 
+	 */
+	protected long nextPage = 0L;
+
+	/**
+	 * 上一页页�?
+	 * 
+	 * 
+	 */
+	protected long lastPage = 0L;
+
+	/**
+	 * 结果集列�?
+	 * 
+	 * 
+	 */
+	protected List resultList = null;
+
+	/**
+	 * 
+	 * 是否存在上一�?
+	 * 
+	 * 
+	 */
+	public boolean isLast()
+	{
+		return last;
+	}
+
+	/**
+	 * 是否存在下一�?
+	 * 
+	 * 
+	 */
+	public boolean isNext()
+	{
+		return next;
+	}
+
+	/**
+	 * 获取当前页结果集列表
+	 */
+	public List getResultList()
+	{
+		return this.resultList;
+	}
+
+	public long getPageNum()
+	{
+		return pageNum;
+	}
+
+	public long getPageSize()
+	{
+		return pageSize;
+	}
+
+	public long getTotalCount()
+	{
+		return totalCount;
+	}
+
+	public long getTotalPage()
+	{
+		return totalPage;
+	}
+
+	public long getNextPage()
+	{
+		return nextPage;
+	}
+
+	public long getLastPage()
+	{
+		return lastPage;
+	}
+
+	/**
+	 * 设置当前页结果集列表
+	 */
+	public void setResultList(List resultList)
+	{
+		this.resultList = resultList;
+	}
+
+	/**
+	 * 设置是否存在上一�?
+	 * 
+	 * 
+	 */
+	public void setLast(boolean last)
+	{
+		this.last = last;
+	}
+
+	/**
+	 * 设置是否存在下一�?
+	 * 
+	 * 
+	 */
+	public void setNext(boolean next)
+	{
+		this.next = next;
+	}
+
+	public void setPageNum(long pageNum)
+	{
+		this.pageNum = pageNum;
+	}
+
+	public void setPageSize(long pageSize)
+	{
+		this.pageSize = pageSize;
+	}
+
+	public void setTotalCount(long totalCount)
+	{
+		this.totalCount = totalCount;
+	}
+
+	public void setTotalPage(long totalPage)
+	{
+		this.totalPage = totalPage;
+	}
+
+	public void setNextPage(long nextPage)
+	{
+		this.nextPage = nextPage;
+	}
+
+	public void setLastPage(long lastPage)
+	{
+		this.lastPage = lastPage;
+	}
+}

+ 310 - 0
src/com/acc/taglib/page/PageViewTag.java

@@ -0,0 +1,310 @@
+/***************************************************************************************************
+ * <class>: PageViewTag.java <desc>: PageViewTag Dependencies: (if applicable) (c) 2003,
+ * DeliriumCybertouch (BJ) Limited. All rights reserved. Last Modified By: $Author: $ Last Modified
+ * On: $Date: $
+ **************************************************************************************************/
+
+package com.acc.taglib.page;
+
+import java.util.Vector;
+
+import javax.servlet.jsp.JspException;
+import javax.servlet.jsp.tagext.TagSupport;
+
+import com.acc.util.common.ExceptionUtil;
+
+/**
+ * <p>
+ * <tt>PageViewTag</tt>是关于翻页的Tag Libary类�?�该Taglib将PageViewContext�?
+ * 
+ * 存储在JSP pageContext的Tag ID里�?�其中pageNum属�?�是翻页页码,pageSize是翻页每
+ * 页纪录数,pageResult是翻页结果的接口IPageResult实现类在pageContext中的某个 attribute名称�?
+ * </p>
+ * 
+ * <pre>
+ *    例如�?
+ *    
+ *    &amp;lttable border=1&gt;
+ *    &amp;lttr&gt;
+ *       &amp;lttd&gt;ID&amp;lt/td&gt;
+ *       &amp;lttd&gt;Name&amp;lt/td&gt;
+ *       &amp;lttd&gt;IntNum&amp;lt/td&gt;
+ *       &amp;lttd&gt;FloatNum&amp;lt/td&gt;
+ *       &amp;lttd&gt;LongNum&amp;lt/td&gt;
+ *       &amp;lttd&gt;AddressID&amp;lt/td&gt;
+ *       &amp;lttd&gt;DD&amp;lt/td&gt;
+ *       &amp;lttd&gt;MM&amp;lt/td&gt;
+ *       &amp;lttd&gt;TT&amp;lt/td&gt;
+ *       &amp;lttd&gt;TestID&amp;lt/td&gt;
+ *       &amp;lttd&gt;update&amp;lt/td&gt;
+ *    &amp;lt/tr&gt;
+ *    &lt; %String ppage=(String)request.getParameter(&quot;page&quot;);%&gt;
+ *    &lt; page:SQLPageResult id=&quot;result&quot; resultBeanName=&quot;com.project.example.entity.People&quot; iSQLName=&quot;com.project.example.sql.PeopleSQL&quot; /&gt;
+ *    &lt; page:pageview id=&quot;pp&quot; pageNum=&quot;&lt; %=ppage%&gt;&quot; pageSize=&quot;10&quot; pageResult=&quot;result&quot;/&gt;
+ *    &lt; c:forEach var=&quot;entity&quot; items=&quot;${pp.resultList}&quot;&gt;
+ * < tr>
+ *       &amp;lttd&gt;&amp;lta href=&quot;Address2.do?action=detailView&amp;ID=&amp;ltc:out value=&quot;${entity.ID}&quot;/&gt;&amp;
+ *             entityName=com.project.example.entity.People&quot;&gt;&amp;ltc:out value=&quot;${entity.ID}&quot;/&gt;&amp;lt/a&gt;
+ *       &amp;lt/td&gt;
+ *       &amp;lttd&gt;&amp;ltc:out value=&quot;${entity.name}&quot;/&gt;&amp;lt/td&gt;
+ *       &amp;lttd&gt;&amp;ltc:out value=&quot;${entity.intNum}&quot;/&gt;&amp;lt/td&gt;
+ *       &amp;lttd&gt;&amp;ltc:out value=&quot;${entity.floatNum}&quot;/&gt;&amp;lt/td&gt;
+ *       &amp;lttd&gt;&amp;ltc:out value=&quot;${entity.longNum}&quot;/&gt;&amp;lt/td&gt;
+ *       &amp;lttd&gt;
+ *         &amp;ltbean:define id=&quot;addressid&quot; name=&quot;entity&quot; property=&quot;addressID&quot;/&gt;
+ *         &amp;ltpage:resource  bundle=&quot;com.project.example.resource.kk&quot; str=&quot;&amp;lt%=addressid+&quot;&quot;%&gt;&quot; /&gt;
+ *       &amp;lt/td&gt;
+ *       &amp;lttd&gt;&amp;ltc:out value=&quot;${entity.DD}&quot;/&gt;&amp;lt/td&gt;
+ *       &amp;lttd&gt;&amp;ltc:out value=&quot;${entity.MM}&quot;/&gt;&amp;lt/td&gt;
+ *       &amp;lttd&gt;&amp;ltc:out value=&quot;${entity.TT}&quot;/&gt;&amp;lt/td&gt;
+ *       &amp;lttd&gt;
+ *          &amp;ltc:set var=&quot;testID&quot; value=&quot;${entity.testID}&quot; /&gt;
+ *          &amp;ltpage:resourceData id=&quot;res&quot;  bundle=&quot;com.project.example.resource.kk&quot;
+ *                   str=&quot;&amp;lt%=pageContext.getAttribute(&quot;testID&quot;)+&quot;&quot;%&gt;&quot; /&gt;
+ *          &amp;ltc:forEach var=&quot;resource&quot; items=&quot;${res}&quot;&gt;
+ *             &amp;ltc:out value=&quot;${resource.label}&quot; /&gt;
+ *          &amp;lt/c:forEach&gt;
+ *       &amp;lt/td&gt;
+ *       &amp;lttd&gt;&amp;lta href=&quot;Address2.do?action=updateView&amp;ID=&amp;ltc:out value=&quot;${entity.ID}&quot;/&gt;&amp;
+ *                   entityName=com.project.example.entity.People&quot;&gt;update&amp;lt/a&gt;
+ *       &amp;lt/td&gt;
+ *    &amp;lt/tr&gt;
+ *    &amp;lt/c:forEach&gt;
+ *    &amp;lt/table&gt;
+ *    �?&amp;ltc:out value=&quot;${pp.totalCount}&quot; /&gt;条纪�?
+ *    
+ *    �?&amp;lt%=pp.getPageNum()%&gt;�?
+ *    
+ *    �?&amp;lt%=pp.getTotalPage()%&gt;�?
+ *    
+ *    &amp;ltc_rt:if test=&quot;&amp;lt%=pp.isNext()%&gt;&quot;&gt;
+ *    &amp;lta href=&quot;javascript:PageNext(&amp;lt%=pp.getNextPage()%&gt;)&quot;&gt;下一�?&amp;lt/a&gt;
+ *    &amp;lt/c_rt:if&gt;
+ *    &amp;ltc_rt:if test=&quot;&amp;lt%=pp.isLast()%&gt;&quot;&gt;
+ *    &amp;lta href=&quot;javascript:PageNext(&amp;lt%=pp.getLastPage()%&gt;)&quot;&gt;上一�?&amp;lt/a&gt;
+ *    &amp;lt/c_rt:if&gt;
+ * </pre>
+ * 
+ * @author Tony.Su
+ * @version $Revision: 1.0 $ $Date: 2002/11/25 01:30:40 $
+ */
+
+public class PageViewTag extends TagSupport
+{
+
+	/***********************************************************************************************
+	 * //**成员变量
+	 **********************************************************************************************/
+
+	/**
+	 * Taglib ID
+	 */
+	protected String id = null;
+
+	/**
+	 * 翻页页码
+	 */
+	protected String pageNum = null;
+
+	/**
+	 * 翻页每页纪录�?
+	 * 
+	 */
+	protected String pageSize = null;
+
+	/**
+	 * 翻页结果的接口pageContext attribute
+	 */
+	protected String pageResult = null;
+
+	/***********************************************************************************************
+	 * //**public method
+	 **********************************************************************************************/
+
+	/**
+	 * 获取TagID
+	 */
+	public String getId()
+	{
+		return (this.id);
+	}
+
+	/**
+	 * 设置TagID
+	 */
+	public void setId(String id)
+	{
+		this.id = id;
+	}
+
+	/**
+	 * 设置页码
+	 */
+	public void setPageNum(String pageNum)
+	{
+		this.pageNum = pageNum;
+	}
+
+	/**
+	 * 获取页码
+	 */
+	public String getPageNum()
+	{
+		return this.pageNum;
+	}
+
+	/**
+	 * 设置每页纪录�?
+	 * 
+	 */
+	public void setPageSize(String pageSize)
+	{
+		this.pageSize = pageSize;
+	}
+
+	/**
+	 * 获取每页纪录�?
+	 * 
+	 */
+	public String getPageSize()
+	{
+		return this.pageSize;
+	}
+
+	/**
+	 * 获取翻页结果的接口pageContext attribute
+	 */
+	public String getPageResult()
+	{
+		return this.pageResult;
+	}
+
+	/**
+	 * 设置翻页结果的接口pageContext attribute
+	 */
+	public void setPageResult(String pageResult)
+	{
+		this.pageResult = pageResult;
+	}
+
+	/**
+	 * Tag Libary�?始调�?
+	 * 
+	 */
+	public int doStartTag() throws JspException
+	{
+		PageViewContext pvContext = new PageViewContext();
+		int ipageSize = 15;
+		try
+		{
+			ipageSize = Integer.parseInt(pageSize);
+		}
+		catch (Exception e)
+		{
+		}
+		if (ipageSize <= 0)
+		{
+			ipageSize = 15;
+		}
+		IPageResult result = (IPageResult) pageContext.getAttribute(pageResult);
+		if (result == null)
+		{
+			pvContext.setPageSize(ipageSize);
+			pvContext.setPageNum(0);
+			pvContext.setTotalCount(0);
+			pvContext.setTotalPage(0);
+			pvContext.setResultList(new Vector());
+			pageContext.setAttribute(id, pvContext);
+			return (SKIP_BODY);
+		}
+		long totalCount = 0;
+		try
+		{
+			totalCount = result.getAllRecordCount();
+		}
+		catch (Exception e)
+		{
+			throw new JspException(ExceptionUtil.getStackTrace(e));
+		}
+		if (totalCount == 0)
+		{
+			pvContext.setPageSize(ipageSize);
+			pvContext.setPageNum(0);
+			pvContext.setTotalCount(0);
+			pvContext.setTotalPage(0);
+			pvContext.setResultList(new Vector());
+			pageContext.setAttribute(id, pvContext);
+			return (SKIP_BODY);
+		}
+		long curPage = 1;
+		try
+		{
+			curPage = Integer.parseInt(pageNum);
+		}
+		catch (Exception e)
+		{
+			curPage = 1;
+		}
+		if (curPage < 1)
+		{
+			curPage = 1;
+		}
+		long maxPage = 0;
+
+		// 计算总页�?
+
+		if (totalCount % ipageSize == 0)
+		{
+			maxPage = totalCount / ipageSize;
+		}
+		else
+		{
+			maxPage = totalCount / ipageSize + 1;
+
+		}
+		if (curPage > maxPage)
+		{
+			curPage = maxPage;
+		}
+		pvContext.setPageSize(ipageSize);
+		pvContext.setPageNum(curPage);
+		pvContext.setTotalCount(totalCount);
+		pvContext.setTotalPage(maxPage);
+
+		if (curPage != 1)
+		{
+			pvContext.setLast(true);
+			pvContext.setLastPage(curPage - 1);
+		}
+		long maxRecord = totalCount - 1;
+		if (curPage != maxPage)
+		{
+			maxRecord = curPage * ipageSize - 1;
+			pvContext.setNext(true);
+			pvContext.setNextPage(curPage + 1);
+		}
+		try
+		{
+			pvContext.setResultList(result.getCurrentPageResultList((curPage - 1) * ipageSize + 1,
+					maxRecord + 1));
+		}
+		catch (Exception e)
+		{
+			throw new JspException(ExceptionUtil.getStackTrace(e));
+		}
+		pageContext.setAttribute(id, pvContext);
+		return (SKIP_BODY);
+	}
+
+	/**
+	 * Taglib 释放调用
+	 */
+	public void release()
+	{
+		super.release();
+		id = null;
+		pageNum = null;
+		pageSize = null;
+		pageResult = null;
+	}
+}

+ 29 - 0
src/com/acc/taglib/page/PageViewTei.java

@@ -0,0 +1,29 @@
+/***************************************************************************************************
+ * <class>: PageViewTei.java <desc>: PageViewTei Dependencies: (if applicable) (c) 2003,
+ * DeliriumCybertouch (BJ) Limited. All rights reserved. Last Modified By: $Author: $ Last Modified
+ * On: $Date: $
+ **************************************************************************************************/
+
+package com.acc.taglib.page;
+
+import javax.servlet.jsp.tagext.TagData;
+import javax.servlet.jsp.tagext.TagExtraInfo;
+import javax.servlet.jsp.tagext.VariableInfo;
+
+/**
+ * <p>
+ * <tt>PageViewTei</tt>应用了TagExtraInfo接口类�??
+ * </p>
+ * 
+ * @author Tony.Su
+ * @version $Revision: 1.0 $ $Date: 2002/11/25 01:30:40 $
+ */
+
+public class PageViewTei extends TagExtraInfo {
+	public VariableInfo[] getVariableInfo(TagData data) {
+		return new VariableInfo[] { new VariableInfo(data
+				.getAttributeString("id"),
+				"com.acc.taglib.page.PageViewContext", true,
+				VariableInfo.AT_BEGIN) };
+	}
+}

+ 148 - 0
src/com/acc/taglib/page/PageViewUtil.java

@@ -0,0 +1,148 @@
+package com.acc.taglib.page;
+
+import java.util.Vector;
+
+public class PageViewUtil
+{
+	/**
+	 * 翻页页码
+	 */
+	protected String pageNum = null;
+
+	/**
+	 * 翻页每页纪录�?
+	 * 
+	 * 
+	 */
+	protected String pageSize = null;
+
+	/**
+	 * 
+	 * 设置页码
+	 */
+	public void setPageNum(String pageNum)
+	{
+		this.pageNum = pageNum;
+	}
+
+	/**
+	 * 获取页码
+	 */
+	public String getPageNum()
+	{
+		return this.pageNum;
+	}
+
+	/**
+	 * 设置每页纪录�?
+	 * 
+	 * 
+	 */
+	public void setPageSize(String pageSize)
+	{
+		this.pageSize = pageSize;
+	}
+
+	/**
+	 * 获取每页纪录�?
+	 * 
+	 * 
+	 */
+	public String getPageSize()
+	{
+		return this.pageSize;
+	}
+
+	public PageViewUtil(String pageNum, String pageSize)
+	{
+		this.pageNum = pageNum;
+		this.pageSize = pageSize;
+	}
+
+	public PageViewContext getPageResult(IPageResult result) throws Exception
+	{
+		PageViewContext pvContext = new PageViewContext();
+		long ipageSize = 20;
+		try
+		{
+			ipageSize = Integer.parseInt(pageSize);
+		}
+		catch (Exception e)
+		{
+		}
+		if (ipageSize <= 0)
+		{
+			ipageSize = 20;
+		}
+		if (result == null)
+		{
+			pvContext.setPageSize(ipageSize);
+			pvContext.setPageNum(0);
+			pvContext.setTotalCount(0);
+			pvContext.setTotalPage(0);
+			pvContext.setResultList(new Vector());
+			return pvContext;
+		}
+		long totalCount = result.getAllRecordCount();
+
+		if (totalCount == 0)
+		{
+			pvContext.setPageSize(ipageSize);
+			pvContext.setPageNum(0);
+			pvContext.setTotalCount(0);
+			pvContext.setTotalPage(0);
+			pvContext.setResultList(new Vector());
+			return pvContext;
+		}
+		long curPage = 1;
+		try
+		{
+			curPage = Integer.parseInt(pageNum);
+		}
+		catch (Exception e)
+		{
+			curPage = 1;
+		}
+		if (curPage < 1)
+		{
+			curPage = 1;
+		}
+		long maxPage = 0;
+
+		// 计算总页�?
+
+		if (totalCount % ipageSize == 0)
+		{
+			maxPage = totalCount / ipageSize;
+		}
+		else
+		{
+			maxPage = totalCount / ipageSize + 1;
+
+		}
+		if (curPage > maxPage)
+		{
+			curPage = maxPage;
+		}
+		pvContext.setPageSize(ipageSize);
+		pvContext.setPageNum(curPage);
+		pvContext.setTotalCount(totalCount);
+		pvContext.setTotalPage(maxPage);
+
+		if (curPage != 1)
+		{
+			pvContext.setLast(true);
+			pvContext.setLastPage(curPage - 1);
+		}
+		long maxRecord = totalCount - 1;
+		if (curPage != maxPage)
+		{
+			maxRecord = curPage * ipageSize - 1;
+			pvContext.setNext(true);
+			pvContext.setNextPage(curPage + 1);
+		}
+		pvContext.setResultList(result.getCurrentPageResultList((curPage - 1) * ipageSize + 1,
+				maxRecord + 1));
+		return pvContext;
+	}
+}

+ 185 - 0
src/com/acc/taglib/page/PreSQLPageResultTag.java

@@ -0,0 +1,185 @@
+/***************************************************************************************************
+ * <class>: PreSQLPageResult.java <desc>: PreSQLPageResult Dependencies: (if applicable) (c) 2003,
+ * DeliriumCybertouch (BJ) Limited. All rights reserved. Last Modified By: $Author: $ Last Modified
+ * On: $Date: $
+ **************************************************************************************************/
+
+package com.acc.taglib.page;
+
+import java.util.List;
+
+import javax.servlet.jsp.JspException;
+import javax.servlet.jsp.tagext.TagSupport;
+
+import com.acc.common.jdbc.IPreSQL;
+import com.acc.common.jdbc.JdbcTemplateEx;
+import com.acc.common.jdbc.Variant;
+import com.acc.common.spring.ApplicationFactory;
+import com.acc.util.common.ExceptionUtil;
+
+/**
+ * <p>
+ * <tt>PreSQLPageResult</tt>是翻页结果接口的IPreSQL方式实现的Jsp Tag类�?��?�过
+ * IPreSQL和resultBean方式获取翻页�?�?的�?�纪录数和当前页纪录。这个Jsp Tag�?
+ * 
+ * 
+ * <tt>PreSQLPageResult</tt>放置在pageContext的attribute中�??
+ * </p>
+ * 
+ * 
+ * @author Tony.Su
+ * @version $Revision: 1.0 $ $Date: 2002/11/25 01:30:40 $
+ */
+
+public class PreSQLPageResultTag extends TagSupport implements IPageResult
+{
+
+	/***********************************************************************************************
+	 * //**成员变量
+	 **********************************************************************************************/
+
+	private JdbcTemplateEx template;
+
+	/**
+	 * 内部变量SQL
+	 */
+	private String internal_SQL;
+
+	private Variant[] vars = null;
+
+	/**
+	 * IPreSQL名称
+	 */
+	protected String iPreSQLName = null;
+
+	/**
+	 * 翻页结果的javaBean
+	 */
+	protected String resultBeanName = null;
+
+	/**
+	 * Taglib ID
+	 */
+	protected String id = null;
+
+	/**
+	 * 包内的Message Resources.
+	 */
+//	protected static MessageResources messages = MessageResources
+//			.getMessageResources("com.acc.taglib.page.LocalStrings");
+
+	/***********************************************************************************************
+	 * //**public method
+	 **********************************************************************************************/
+
+	/**
+	 * 缺省构�?�方�?
+	 * 
+	 * 
+	 */
+	public PreSQLPageResultTag()
+	{
+		internal_SQL = "";
+	}
+
+	/**
+	 * 获取TagID
+	 */
+	public String getId()
+	{
+		return (this.id);
+	}
+
+	/**
+	 * 设置TagID
+	 */
+	public void setId(String id)
+	{
+		this.id = id;
+	}
+
+	/**
+	 * 设置翻页结果的javaBean
+	 */
+	public void setResultBeanName(String resultBeanName)
+	{
+		this.resultBeanName = resultBeanName;
+	}
+
+	/**
+	 * 获取翻页结果的javaBean
+	 */
+	public String getResultBeanName()
+	{
+		return this.resultBeanName;
+	}
+
+	/**
+	 * 设置iPreSQL名称
+	 */
+	public void setiPreSQLName(String iPreSQLName)
+	{
+		this.iPreSQLName = iPreSQLName;
+	}
+
+	/**
+	 * 获取iPreSQL名称
+	 */
+	public String getiPreSQLName()
+	{
+		return this.iPreSQLName;
+	}
+
+	/**
+	 * 获取翻业集合�?有记录数
+	 */
+	public long getAllRecordCount() throws Exception
+	{
+		long totalCount = 0;
+		IPreSQL ipresql = null;
+		try
+		{
+			ipresql = (IPreSQL) Class.forName(this.iPreSQLName).newInstance();
+		}
+		catch (Exception e)
+		{
+//			throw new Exception(messages.getMessage(
+//					"PreSQLPageResultTag.parameter.iPreSQLName.error", id, iPreSQLName));
+		}
+		internal_SQL = ipresql.getPreSQL((javax.servlet.http.HttpServletRequest) pageContext
+				.getRequest(), pageContext.getServletConfig());
+		vars = ipresql.getVariant((javax.servlet.http.HttpServletRequest) pageContext.getRequest(),
+				pageContext.getServletConfig());
+		totalCount = template.getQueryCount(internal_SQL, vars);
+		return totalCount;
+	}
+
+	/**
+	 * 获取当前页翻页结果集列表
+	 */
+	public List getCurrentPageResultList(long start, long end) throws Exception
+	{
+		template.setFirstResult(((Long)start).intValue());
+		template.setLastResult(((Long)end).intValue());
+		return template.queryForList(internal_SQL, vars, Class.forName(resultBeanName));
+	}
+
+	/**
+	 * Tag Libary�?始调�?
+	 * 
+	 * 
+	 */
+	public int doStartTag() throws JspException
+	{
+		try
+		{
+			template = new JdbcTemplateEx(ApplicationFactory.getDataSource());
+		}
+		catch (Exception e)
+		{
+			throw new JspException(ExceptionUtil.getStackTrace(e));
+		}
+		pageContext.setAttribute(id, this);
+		return (SKIP_BODY);
+	}
+}

+ 281 - 0
src/com/acc/taglib/page/SQLPageResultTag.java

@@ -0,0 +1,281 @@
+/***************************************************************************************************
+ * <class>: SQLPageViewResult.java <desc>: SQLPageViewResult Dependencies: (if applicable) (c) 2003,
+ * DeliriumCybertouch (BJ) Limited. All rights reserved. Last Modified By: $Author: $ Last Modified
+ * On: $Date: $
+ **************************************************************************************************/
+
+package com.acc.taglib.page;
+import java.util.List;
+
+import javax.servlet.RequestDispatcher;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.jsp.JspException;
+import javax.servlet.jsp.tagext.TagSupport;
+
+import org.springframework.context.support.MessageSourceAccessor;
+
+import com.acc.common.jdbc.ISQL;
+import com.acc.common.jdbc.JdbcTemplateEx;
+import com.acc.common.spring.ApplicationFactory;
+import com.acc.util.common.ExceptionUtil;
+
+/**
+ * <p>
+ * <tt>SQLPageResult</tt>是翻页结果接口的ISQL方式实现的Jsp Tag类�?��?�过
+ * ISQL和resultBean方式获取翻页�?�?的�?�纪录数和当前页纪录。这个Jsp Tag�?
+ * 
+ * 
+ * <tt>SQLPageResult</tt>放置在pageContext的attribute中�??
+ * </p>
+ * 
+ * 
+ * @author Tony.Su
+ * @version $Revision: 1.0 $ $Date: 2002/11/25 01:30:40 $
+ */
+
+public class SQLPageResultTag extends TagSupport implements IPageResult
+{
+
+	/***********************************************************************************************
+	 * //**成员变量
+	 **********************************************************************************************/
+	private JdbcTemplateEx template;
+
+	// ���Դ
+	private String datasource;
+
+	/**
+	 * 内部变量SQL
+	 */
+	private String internal_SQL;
+
+	/**
+	 * ISQL名称
+	 */
+	protected String iSQLName = null;
+
+	/**
+	 * 翻页结果的javaBean
+	 */
+	protected String resultBeanName = null;
+
+	/**
+	 * Taglib ID
+	 */
+	protected String id = null;
+
+	/**
+	 * 参数类型
+	 */
+	protected String parameter = null;
+
+	/**
+	 * 包内的Message Resources.
+	 */
+
+	protected static MessageSourceAccessor messages = ApplicationFactory.getMessageSourceAccessor();
+
+	private String sql;
+
+	private String jspsql;
+
+	/***********************************************************************************************
+	 * //**public method
+	 **********************************************************************************************/
+
+	public static final String JSP_SQLSTRING = "com.acc.taglib.page.SQLPageResultTag.JSP_SQLSTRING";
+
+	/**
+	 * 缺省构�?�方�?
+	 * 
+	 * 
+	 */
+	public SQLPageResultTag()
+	{
+		internal_SQL = "";
+	}
+
+	/**
+	 * 获取TagID
+	 */
+	public String getId()
+	{
+		return (this.id);
+	}
+
+	/**
+	 * 设置TagID
+	 */
+	public void setId(String id)
+	{
+		this.id = id;
+	}
+
+	/**
+	 * 设置翻页结果的javaBean
+	 */
+	public void setResultBeanName(String resultBeanName)
+	{
+		this.resultBeanName = resultBeanName;
+	}
+
+	/**
+	 * 获取翻页结果的javaBean
+	 */
+	public String getResultBeanName()
+	{
+		return this.resultBeanName;
+	}
+
+	/**
+	 * 设置iSQL名称
+	 */
+	public void setiSQLName(String iSQLName)
+	{
+		this.iSQLName = iSQLName;
+	}
+
+	/**
+	 * 获取iSQL名称
+	 */
+	public String getiSQLName()
+	{
+		return this.iSQLName;
+	}
+
+	/**
+	 * 设置Parameter
+	 */
+	public void setParameter(String para)
+	{
+		this.parameter = para;
+	}
+
+	public void setSql(String sql)
+	{
+		this.sql = sql;
+	}
+
+	public void setJspsql(String jspsql)
+	{
+		this.jspsql = jspsql;
+	}
+
+	/**
+	 * 获取Parameter
+	 */
+	public String getParameter()
+	{
+		return this.parameter;
+	}
+
+	public String getSql()
+	{
+		return sql;
+	}
+
+	public String getJspsql()
+	{
+		return jspsql;
+	}
+
+	public String getDatasource()
+	{
+		return datasource;
+	}
+
+	public void setDatasource(String datasource)
+	{
+		this.datasource = datasource;
+	}
+
+	/**
+	 * 获取翻业集合�?有记录数
+	 */
+	public long getAllRecordCount() throws Exception
+	{
+		return template.getQueryCount(internal_SQL);
+	}
+
+	/**
+	 * 获取当前页翻页结果集列表
+	 */
+	public List getCurrentPageResultList(long start, long end) throws Exception
+	{
+		
+		template.setFirstResult(((Long)start).intValue());
+		template.setLastResult(((Long)end).intValue());
+		if (resultBeanName != null)
+		{
+			template.setFirstResult(((Long)start).intValue());
+			template.setLastResult(((Long)end).intValue());
+			return template.queryForList(internal_SQL, Class.forName(resultBeanName));
+		}
+		else
+		{
+			template.setFirstResult(((Long)start).intValue());
+			template.setLastResult(((Long)end).intValue());
+			return template.queryForList(internal_SQL);
+		}
+	}
+
+	/**
+	 * Tag Libary�?始调�?
+	 * 
+	 * 
+	 */
+	public int doStartTag() throws JspException
+	{
+
+		HttpServletRequest request = (HttpServletRequest) pageContext.getRequest();
+		request.setAttribute("parameter", this.parameter);
+		try
+		{
+			if (datasource == null || datasource.length() == 0)
+				template = new JdbcTemplateEx(ApplicationFactory.getDataSource());
+			else template = new JdbcTemplateEx(ApplicationFactory.getDataSource(datasource));
+			this.setCustomizedSQL();
+		}
+		catch (Exception e)
+		{
+			e.printStackTrace(System.out);
+			throw new JspException(ExceptionUtil.getStackTrace(e));
+		}
+		pageContext.setAttribute(id, this);
+		return (SKIP_BODY);
+	}
+
+	private void setCustomizedSQL() throws Exception
+	{
+		this.internal_SQL = this.sql;
+		if (this.iSQLName != null && this.iSQLName.length() > 0)
+		{
+			ISQL isql = null;
+			try
+			{
+				isql = (ISQL) Class.forName(this.iSQLName).newInstance();
+			}
+			catch (Exception e)
+			{
+				throw new Exception(messages.getMessage(
+						"SQLPageResultTag.parameter.iSQLName.error", new Object[] { id, iSQLName }));
+			}
+			internal_SQL = isql.getSQL((javax.servlet.http.HttpServletRequest) pageContext
+					.getRequest(), pageContext.getServletConfig());
+		}
+		if (this.jspsql != null && this.jspsql.length() > 0)
+		{
+			ServletRequest request = this.pageContext.getRequest();
+			ServletResponse response = this.pageContext.getResponse();
+			RequestDispatcher rd = request.getRequestDispatcher(this.jspsql);
+			rd.include(request, response);
+			internal_SQL = (String) request.getAttribute(JSP_SQLSTRING);
+			if (internal_SQL == null || internal_SQL.length() == 0)
+				throw new Exception(messages.getMessage("SQLPageResultTag.parameter.jspsql.error",
+						new Object[] { id, jspsql }));
+		}
+	}
+
+}

+ 207 - 0
src/com/acc/taglib/page/SQLResultTag.java

@@ -0,0 +1,207 @@
+/***************************************************************************************************
+ * <class>: SQLPageViewResult.java <desc>: SQLPageViewResult Dependencies: (if applicable) (c) 2003,
+ * DeliriumCybertouch (BJ) Limited. All rights reserved. Last Modified By: $Author: $ Last Modified
+ * On: $Date: $
+ **************************************************************************************************/
+
+package com.acc.taglib.page;
+
+import java.util.List;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.jsp.JspException;
+import javax.servlet.jsp.tagext.TagSupport;
+
+import org.springframework.context.support.MessageSourceAccessor;
+
+import com.acc.common.jdbc.ISQL;
+import com.acc.common.jdbc.JdbcTemplateEx;
+import com.acc.common.spring.ApplicationFactory;
+import com.acc.util.common.ExceptionUtil;
+
+/**
+ * <p>
+ * <tt>SQLResult</tt>是翻页结果接口的ISQL方式实现的Jsp Tag类�?��?�过
+ * ISQL和resultBean方式获取翻页�?�?的�?�纪录数和当前页纪录。这个Jsp Tag�?
+ * 
+ * 
+ * 
+ * <tt>SQLPageResult</tt>放置在pageContext的attribute中�??
+ * </p>
+ * 
+ * 
+ * @author Tony.Su
+ * @version $Revision: 1.0 $ $Date: 2002/11/25 01:30:40 $
+ */
+
+public class SQLResultTag extends TagSupport
+{
+
+	/***********************************************************************************************
+	 * //**成员变量
+	 **********************************************************************************************/
+
+	private JdbcTemplateEx template;
+
+	/**
+	 * 内部变量SQL
+	 */
+	private String internal_SQL;
+
+	/**
+	 * ISQL名称
+	 */
+	protected String iSQLName = null;
+
+	/**
+	 * 翻页结果的javaBean
+	 */
+	protected String resultBeanName = null;
+
+	/**
+	 * Taglib ID
+	 */
+	protected String id = null;
+
+	/**
+	 * 参数类型
+	 */
+	protected String parameter = null;
+
+	/**
+	 * 包内的Message Resources.
+	 */
+	protected static MessageSourceAccessor messages = ApplicationFactory.getMessageSourceAccessor();
+
+	/***********************************************************************************************
+	 * //**public method
+	 **********************************************************************************************/
+
+	/**
+	 * 缺省构�?�方�?
+	 * 
+	 * 
+	 * 
+	 */
+	public SQLResultTag()
+	{
+		internal_SQL = "";
+	}
+
+	/**
+	 * 获取TagID
+	 */
+	public String getId()
+	{
+		return (this.id);
+	}
+
+	/**
+	 * 设置TagID
+	 */
+	public void setId(String id)
+	{
+		this.id = id;
+	}
+
+	/**
+	 * 设置翻页结果的javaBean
+	 */
+	public void setResultBeanName(String resultBeanName)
+	{
+		this.resultBeanName = resultBeanName;
+	}
+
+	/**
+	 * 获取翻页结果的javaBean
+	 */
+	public String getResultBeanName()
+	{
+		return this.resultBeanName;
+	}
+
+	/**
+	 * 设置iSQL名称
+	 */
+	public void setiSQLName(String iSQLName)
+	{
+		this.iSQLName = iSQLName;
+	}
+
+	/**
+	 * 获取iSQL名称
+	 */
+	public String getiSQLName()
+	{
+		return this.iSQLName;
+	}
+
+	/**
+	 * 设置Parameter
+	 */
+	public void setParameter(String para)
+	{
+		this.parameter = para;
+	}
+
+	/**
+	 * 获取Parameter
+	 */
+	public String getParameter()
+	{
+		return this.parameter;
+	}
+
+	/**
+	 * 获取当前页翻页结果集列表
+	 */
+	public List getResultList() throws Exception
+	{
+		ISQL isql = null;
+		try
+		{
+			isql = (ISQL) Class.forName(this.iSQLName).newInstance();
+		}
+		catch (Exception e)
+		{
+			throw new Exception(messages.getMessage("SQLPageResultTag.parameter.iSQLName.error",
+					new Object[] { id, iSQLName }));
+		}
+		internal_SQL = isql.getSQL(
+				(javax.servlet.http.HttpServletRequest) pageContext.getRequest(), pageContext
+						.getServletConfig());
+
+		if (resultBeanName != null)
+		{
+			return template.queryForList(internal_SQL, Class.forName(resultBeanName));
+		}
+		else
+		{
+			return template.queryForList(internal_SQL);
+		}
+
+	}
+
+	/**
+	 * Tag Libary�?始调�?
+	 * 
+	 * 
+	 * 
+	 */
+	public int doStartTag() throws JspException
+	{
+
+		HttpServletRequest request = (HttpServletRequest) pageContext.getRequest();
+		request.setAttribute("parameter", this.parameter);
+		try
+		{
+			template = new JdbcTemplateEx(ApplicationFactory.getDataSource());
+			pageContext.setAttribute(id, getResultList());
+		}
+		catch (Exception e)
+		{
+			throw new JspException(ExceptionUtil.getStackTrace(e));
+		}
+		return (SKIP_BODY);
+	}
+}

+ 29 - 0
src/com/acc/taglib/page/SQLResultTei.java

@@ -0,0 +1,29 @@
+/***************************************************************************************************
+ * <class>: ResourceDataTei.java <desc>: ResourceDataTei Dependencies: (if applicable) (c) 2003,
+ * DeliriumCybertouch (BJ) Limited. All rights reserved. Last Modified By: $Author: $ Last Modified
+ * On: $Date: $
+ **************************************************************************************************/
+
+package com.acc.taglib.page;
+
+import javax.servlet.jsp.tagext.TagData;
+import javax.servlet.jsp.tagext.TagExtraInfo;
+import javax.servlet.jsp.tagext.VariableInfo;
+
+/**
+ * <p>
+ * <tt>ResourceDataTei</tt>应用了TagExtraInfo接口类�??
+ * </p>
+ * 
+ * @author Tony.Su
+ * @version $Revision: 1.0 $ $Date: 2002/11/25 01:30:40 $
+ */
+
+public class SQLResultTei extends TagExtraInfo
+{
+	public VariableInfo[] getVariableInfo(TagData data)
+	{
+		return new VariableInfo[] { new VariableInfo(data.getAttributeString("id"),
+				"java.util.List", true, VariableInfo.AT_BEGIN) };
+	}
+}

+ 77 - 0
src/com/acc/taglib/util/EncodingMessageTag.java

@@ -0,0 +1,77 @@
+package com.acc.taglib.util;
+
+import java.net.URLEncoder;
+
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.jsp.JspException;
+
+import org.apache.struts.taglib.bean.MessageTag;
+import org.apache.struts.util.RequestUtils;
+import org.apache.struts.util.ResponseUtils;
+
+public class EncodingMessageTag extends MessageTag {
+
+	private String encoding;
+
+	public void setEncoding(String encoding) {
+		this.encoding = encoding;
+	}
+
+	public String getEncoding() {
+		return encoding;
+	}
+
+	public int doStartTag() throws JspException {
+
+		String key = this.key;
+		if (key == null) {
+			// Look up the requested property value
+			Object value = RequestUtils.lookup(pageContext, name, property,
+					scope);
+			if (value != null && !(value instanceof String)) {
+				JspException e = new JspException(messages.getMessage(
+						"message.property", key));
+				RequestUtils.saveException(pageContext, e);
+				throw e;
+			}
+			key = (String) value;
+		}
+
+		// Construct the optional arguments array we will be using
+		Object args[] = new Object[5];
+		args[0] = arg0;
+		args[1] = arg1;
+		args[2] = arg2;
+		args[3] = arg3;
+		args[4] = arg4;
+
+		// Retrieve the message string we are looking for
+		String message = RequestUtils.message(pageContext, this.bundle,
+				this.localeKey, key, args);
+		if (message == null) {
+			String kk = messages.getMessage("message.message", key);
+			JspException e = new JspException(kk);
+			RequestUtils.saveException(pageContext, e);
+			throw e;
+		}
+
+		HttpServletResponse response = (HttpServletResponse) pageContext
+				.getResponse();
+		try {
+			if (this.encoding != null && this.encoding.length() > 0) {
+				message = URLEncoder.encode(message, this.encoding);
+			} else {
+				message = URLEncoder.encode(message, response
+						.getCharacterEncoding());
+			}
+
+			// pageContext.setAttribute(this.id, message);
+		} catch (Exception e) {
+			e.printStackTrace(System.out);
+		}
+		ResponseUtils.write(pageContext, message);
+		// Continue processing this page
+		return (SKIP_BODY);
+
+	}
+}

+ 69 - 0
src/com/acc/taglib/util/FieldOrder.java

@@ -0,0 +1,69 @@
+package com.acc.taglib.util;
+
+import java.io.IOException;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.jsp.JspException;
+import javax.servlet.jsp.tagext.TagSupport;
+
+public class FieldOrder extends TagSupport {
+	private String inputField;
+
+	private String otherField;
+
+	public void setInputField(String inputField) {
+		this.inputField = inputField;
+	}
+
+	public void setOtherField(String otherField) {
+		this.otherField = otherField;
+	}
+
+	public String getInputField() {
+		return inputField;
+	}
+
+	public String getOtherField() {
+		return otherField;
+	}
+
+	public int doStartTag() throws JspException {
+		HttpServletRequest request = (HttpServletRequest) pageContext
+				.getRequest();
+		String field = this.getInputField();
+		String value = request.getParameter("field");
+		String type = request.getParameter("type");
+		String otherfieldName = request.getParameter("otherfieldName");
+
+		if (otherfieldName != null && this.otherField != null) {
+			if (!otherfieldName.equals(this.otherField)) {
+				return (SKIP_BODY);
+			}
+		}
+		if (field == null || value == null || type == null)
+			return (SKIP_BODY);
+		if (!field.equals(value))
+			return (SKIP_BODY);
+
+		String viewGif = "";
+		if (type.equals("asc")) {
+			viewGif = "<img src=\"/images/order_up.gif\"/>";
+		}
+		if (type.equals("desc")) {
+			viewGif = "<img src=\"/images/order_down.gif\"/>";
+
+		}
+		try {
+			pageContext.getOut().print(viewGif);
+		} catch (IOException e) {
+			throw new JspException(e);
+		}
+		// ResponseUtils.write(pageContext, viewGif);
+		return (SKIP_BODY);
+	}
+
+	public void release() {
+		super.release();
+	}
+
+}

+ 55 - 0
src/com/acc/taglib/util/LabelValueDisplay.java

@@ -0,0 +1,55 @@
+package com.acc.taglib.util;
+
+import java.io.IOException;
+import java.util.List;
+import javax.servlet.jsp.JspException;
+import javax.servlet.jsp.tagext.TagSupport;
+
+import org.apache.struts.util.LabelValueBean;
+import org.apache.struts.util.ResponseUtils;
+
+public class LabelValueDisplay extends TagSupport {
+
+	private String inputValue;
+
+	private String inputList;
+
+	public void setInputValue(String inputValue) {
+		this.inputValue = inputValue;
+	}
+
+	public void setInputList(String inputList) {
+		this.inputList = inputList;
+	}
+
+	public String getInputValue() {
+		return inputValue;
+	}
+
+	public String getInputList() {
+		return inputList;
+	}
+
+	public int doStartTag() throws JspException {
+		List list = (List) pageContext.getAttribute(inputList);
+		for (int i = 0; i < list.size(); i++) {
+			LabelValueBean sh = (LabelValueBean) list.get(i);
+			String value = sh.getValue();
+			if (value != null && value.toString().equals(inputValue)) {
+				// ResponseUtils.write(pageContext, sh.getLabel());
+				try {
+					pageContext.getOut().write(sh.getLabel());
+				} catch (IOException e) {
+					e.printStackTrace();
+				}
+				break;
+			}
+		}
+		return (SKIP_BODY);
+	}
+
+	public void release() {
+		super.release();
+	}
+
+}

+ 3 - 0
src/com/acc/taglib/util/LocalStrings.properties

@@ -0,0 +1,3 @@
+resourceData.miss.bundle=Resource bundle "{0}" for the specified base name can be found in classpath
+resourceData.order.error=Resource bundle "{0}" order error: can not find "{1}" ,please check resouce bundle order value
+

+ 138 - 0
src/com/acc/taglib/util/OptionsArrayTag.java

@@ -0,0 +1,138 @@
+package com.acc.taglib.util;
+
+import java.lang.reflect.InvocationTargetException;
+import java.util.Iterator;
+import javax.servlet.jsp.JspException;
+
+import org.apache.commons.beanutils.PropertyUtils;
+import org.apache.struts.taglib.html.OptionsCollectionTag;
+import org.apache.struts.util.RequestUtils;
+import org.apache.struts.util.ResponseUtils;
+
+public class OptionsArrayTag extends OptionsCollectionTag
+{
+	private String selectedvalue;
+
+	public void setSelectedvalue(String selectedvalue)
+	{
+		this.selectedvalue = selectedvalue;
+	}
+
+	public String getSelectedvalue()
+	{
+		return selectedvalue;
+	}
+
+	public int doStartTag() throws JspException
+	{
+
+		// Acquire the collection containing our options
+		Object collection = pageContext.getAttribute(name);
+
+		if (collection == null)
+		{
+			JspException e = new JspException(messages
+					.getMessage("optionsCollectionTag.collection"));
+			RequestUtils.saveException(pageContext, e);
+			throw e;
+		}
+
+		// Acquire an iterator over the options collection
+		Iterator iter = getIterator(collection);
+
+		StringBuffer sb = new StringBuffer();
+
+		// Render the options
+		while (iter.hasNext())
+		{
+
+			Object bean = iter.next();
+			Object beanLabel = null;
+			Object beanValue = null;
+
+			// Get the label for this option
+			try
+			{
+				beanLabel = PropertyUtils.getProperty(bean, label);
+				if (beanLabel == null)
+				{
+					beanLabel = "";
+				}
+			}
+			catch (IllegalAccessException e)
+			{
+				JspException jspe = new JspException(messages.getMessage("getter.access", label,
+						bean));
+				RequestUtils.saveException(pageContext, jspe);
+				throw jspe;
+			}
+			catch (InvocationTargetException e)
+			{
+				Throwable t = e.getTargetException();
+				JspException jspe = new JspException(messages.getMessage("getter.result", label, t
+						.toString()));
+				RequestUtils.saveException(pageContext, jspe);
+				throw jspe;
+			}
+			catch (NoSuchMethodException e)
+			{
+				JspException jspe = new JspException(messages.getMessage("getter.method", label,
+						bean));
+				RequestUtils.saveException(pageContext, jspe);
+				throw jspe;
+			}
+
+			// Get the value for this option
+			try
+			{
+				beanValue = PropertyUtils.getProperty(bean, value);
+				if (beanValue == null)
+				{
+					beanValue = "";
+				}
+			}
+			catch (IllegalAccessException e)
+			{
+				JspException jspe = new JspException(messages.getMessage("getter.access", value,
+						bean));
+				RequestUtils.saveException(pageContext, jspe);
+				throw jspe;
+			}
+			catch (InvocationTargetException e)
+			{
+				Throwable t = e.getTargetException();
+				JspException jspe = new JspException(messages.getMessage("getter.result", value, t
+						.toString()));
+				RequestUtils.saveException(pageContext, jspe);
+				throw jspe;
+			}
+			catch (NoSuchMethodException e)
+			{
+				JspException jspe = new JspException(messages.getMessage("getter.method", value,
+						bean));
+				RequestUtils.saveException(pageContext, jspe);
+				throw jspe;
+			}
+
+			String stringLabel = beanLabel.toString();
+			String stringValue = beanValue.toString();
+
+			// Render this option
+			if (selectedvalue != null && selectedvalue.equals(stringValue))
+			{
+				addOption(sb, stringLabel, stringValue, true);
+			}
+			else
+			{
+				addOption(sb, stringLabel, stringValue, false);
+			}
+		}
+
+		// Render this element to our writer
+		ResponseUtils.write(pageContext, sb.toString());
+
+		return SKIP_BODY;
+
+	}
+
+}

+ 89 - 0
src/com/acc/taglib/util/OptionsCheckboxTag.java

@@ -0,0 +1,89 @@
+package com.acc.taglib.util;
+
+import java.util.List;
+import javax.servlet.jsp.JspException;
+import javax.servlet.jsp.tagext.TagSupport;
+
+import org.apache.struts.util.LabelValueBean;
+import org.apache.struts.util.ResponseUtils;
+
+public class OptionsCheckboxTag extends TagSupport
+{
+	private String name;
+
+	private String dbvalue;
+
+	private Object checkedvalue;
+
+	public void setName(String name)
+	{
+		this.name = name;
+	}
+
+	public void setCheckedvalue(Object checkedvalue)
+	{
+		this.checkedvalue = checkedvalue;
+	}
+
+	public void setDbvalue(String dbvalue)
+	{
+		this.dbvalue = dbvalue;
+	}
+
+	public String getName()
+	{
+		return name;
+	}
+
+	public Object getCheckedvalue()
+	{
+		return checkedvalue;
+	}
+
+	public String getDbvalue()
+	{
+		return dbvalue;
+	}
+
+	public int doStartTag() throws JspException
+	{
+		List list = (List) pageContext.getAttribute(name);
+		for (int i = 0; i < list.size(); i++)
+		{
+			LabelValueBean sh = (LabelValueBean) list.get(i);
+			String value = sh.getValue();
+			String checkbox = "";
+			String checked = "";
+			String inputarray[] = (String[]) checkedvalue;
+			if (inputarray.length == 1 && dbvalue != null && dbvalue.trim().length() > 0)
+			{
+				String inputarray2[] = dbvalue.split(",");
+				for (int j = 1; j < inputarray2.length; j++)
+				{
+					String check = inputarray2[j];
+					if (value != null && (value.toString()).equals(check)) checked = "checked";
+				}
+			}
+			else
+			{
+				for (int j = 0; j < inputarray.length; j++)
+				{
+					String check = inputarray[j];
+					if (value != null && (value.toString()).equals(check)) checked = "checked";
+				}
+			}
+
+			checkbox = "<input type=\"checkbox\" name=\"" + name + "\" value=\"" + value + "\" "
+					+ checked + ">" + sh.getLabel();
+			ResponseUtils.write(pageContext, checkbox);
+
+		}
+		return (SKIP_BODY);
+	}
+
+	public void release()
+	{
+		super.release();
+	}
+
+}

+ 65 - 0
src/com/acc/taglib/util/OptionsRadioTag.java

@@ -0,0 +1,65 @@
+package com.acc.taglib.util;
+
+import java.util.List;
+
+import javax.servlet.jsp.JspException;
+import javax.servlet.jsp.tagext.TagSupport;
+
+import org.apache.struts.util.LabelValueBean;
+import org.apache.struts.util.ResponseUtils;
+
+public class OptionsRadioTag extends TagSupport
+{
+	private String name;
+
+	private String checkedvalue;
+
+	public String getCheckedvalue()
+	{
+		return checkedvalue;
+	}
+
+	public void setName(String name)
+	{
+		this.name = name;
+	}
+
+	public void setCheckedvalue(String checkedvalue)
+	{
+		this.checkedvalue = checkedvalue;
+	}
+
+	public String getName()
+	{
+		return name;
+	}
+
+	public int doStartTag() throws JspException
+	{
+		List list = (List) pageContext.getAttribute(name);
+		for (int i = 0; i < list.size(); i++)
+		{
+			LabelValueBean sh = (LabelValueBean) list.get(i);
+			String value = sh.getValue();
+			String checkbox = "";
+			String checked = "";
+
+			if (checkedvalue != null && checkedvalue.trim().length() > 0)
+			{
+				if (value != null && (value.toString()).equals(checkedvalue)) checked = "checked";
+			}
+			checkbox = "<input type=\"radio\" name=\"" + name + "\" value=\"" + value + "\" "
+					+ checked + ">" + sh.getLabel();
+			ResponseUtils.write(pageContext, checkbox);
+			
+
+		}
+		return (SKIP_BODY);
+	}
+
+	public void release()
+	{
+		super.release();
+	}
+
+}

+ 56 - 0
src/com/acc/taglib/util/ParameterTag.java

@@ -0,0 +1,56 @@
+package com.acc.taglib.util;
+
+import javax.servlet.jsp.JspException;
+import javax.servlet.jsp.tagext.TagSupport;
+
+import org.apache.commons.lang.StringEscapeUtils;
+import org.apache.struts.util.ResponseUtils;
+
+public class ParameterTag extends TagSupport
+{
+
+	// ------------------------------------------------------------- Properties
+
+	/**
+	 * Name of the bean that contains the data we will be rendering.
+	 */
+	protected String name = null;
+
+	public String getName()
+	{
+		return (this.name);
+	}
+
+	public void setName(String name)
+	{
+		this.name = name;
+	}
+
+	// --------------------------------------------------------- Public Methods
+
+	/**
+	 * Process the start tag.
+	 * 
+	 * @exception JspException if a JSP exception has occurred
+	 */
+	public int doStartTag() throws JspException
+	{
+		String value = pageContext.getRequest().getParameter(name);
+		if (value != null && value.length() > 0)
+		{
+			value = StringEscapeUtils.escapeHtml(value);
+			ResponseUtils.write(pageContext, value);
+		}
+		return (SKIP_BODY);
+	}
+
+	/**
+	 * Release all allocated resources.
+	 */
+	public void release()
+	{
+		super.release();
+		name = null;
+	}
+
+}

+ 291 - 0
src/com/acc/taglib/util/ResourceDataTag.java

@@ -0,0 +1,291 @@
+/***************************************************************************************************
+ * <class>: ResourceDataTag.java <desc>: ResourceDataTag Dependencies: (if applicable) (c) 2003,
+ * DeliriumCybertouch (BJ) Limited. All rights reserved. Last Modified By: $Author: $ Last Modified
+ * On: $Date: $
+ **************************************************************************************************/
+
+package com.acc.taglib.util;
+
+import java.util.Enumeration;
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+import java.util.StringTokenizer;
+import java.util.Vector;
+import javax.servlet.jsp.JspException;
+import javax.servlet.jsp.tagext.TagSupport;
+
+import org.apache.struts.util.LabelValueBean;
+import org.apache.struts.util.MessageResources;
+
+/**
+ * <p>
+ * <tt>ResourceDataTag</tt>是关于ResourceData的Tag Libary类。该Taglib将Vector 类存储在pageContext的tag
+ * id属性中。Vector向量表中存放Resource Bundle文件的key
+ * 和Value的包装类org.apache.struts.util.LabelValueBean。其中Str是过滤字符串,过 滤是否返回java
+ * Propertis文件的key\value对。delim是分割符,却省是“#”。
+ * </p>
+ * 
+ * <pre>
+ *    例如:文件com.erp5i5j.rent.client.customersRequirementR.CUSTOMERSREQUIREMENTTYPERS.properties
+ *    
+ *    order=8,1,3,2,5,4,6,7
+ *    7=筒子楼
+ *    6=别墅
+ *    5=平房
+ *    4=新式里弄
+ *    2=小高层
+ *    3=多层
+ *    1=高层
+ *    8=其他
+ *    其中order表示排序
+ * </pre>
+ * 
+ * <p>
+ * 如果设置Str="#7#8#2#",则Vector中存储7=筒子楼,8=其他,2=小高层。
+ * </p>
+ * 
+ * <p>
+ * 与Struts select taglib配合使用,
+ * 
+ * <pre>
+ *    例如:
+ *    下拉单选框:
+ *     &amp;ltpage:resourceData id=&quot;options&quot; bundle=&quot;com.project.example.resource.kk&quot; /&gt;
+ *     &amp;lthtml:select  property=&quot;AddressID&quot;&gt;
+ *       &amp;lthtml:options collection=&quot;options&quot; property=&quot;value&quot; labelProperty=&quot;label&quot;/&gt;
+ *     &amp;lt/html:select&gt;
+ *    下拉多选框:
+ *     &amp;ltpage:resourceData id=&quot;options&quot; bundle=&quot;com.project.example.resource.kk&quot; /&gt;
+ *     &amp;lthtml:select  property=&quot;AddressID&quot; multiple=&quot;true&quot;&gt;
+ *       &amp;lthtml:options collection=&quot;options&quot; property=&quot;value&quot; labelProperty=&quot;label&quot;/&gt;
+ *     &amp;lt/html:select&gt;
+ *    Radio框:
+ *     &amp;ltpage:resourceData id=&quot;items&quot; bundle=&quot;com.project.example.resource.kk&quot; /&gt;
+ *     &amp;ltc:forEach var=&quot;resource&quot; items=&quot;${items}&quot;&gt;
+ *      &amp;ltc:out value=&quot;${resource.label}&quot; /&gt;
+ *      &amp;ltc:set var=&quot;val&quot; value=&quot;${resource.value}&quot; /&gt;
+ *      &amp;lthtml:radio property=&quot;AddressID&quot;  value=&quot;&amp;lt%=pageContext.getAttribute(&quot;val&quot;)+&quot;&quot;%&gt;&quot; /&gt;
+ *     &amp;lt/c:forEach&gt;
+ *    CheckBox框:
+ *     &amp;ltc:forEach var=&quot;resource&quot; items=&quot;${items}&quot;&gt;
+ *      &amp;ltc:out value=&quot;${resource.label}&quot; /&gt;
+ *      &amp;lthtml:multibox property=&quot;TestID&quot;&gt;&amp;ltc:out value=&quot;${resource.value}&quot; /&gt;&amp;lt/html:multibox&gt;
+ *     &amp;lt/c:forEach&gt;
+ * </pre>
+ * 
+ * @author Tony.Su
+ * @version $Revision: 1.0 $ $Date: 2002/11/25 01:30:40 $
+ */
+
+public class ResourceDataTag extends TagSupport
+{
+
+	/***********************************************************************************************
+	 * //**成员变量
+	 **********************************************************************************************/
+
+	/**
+	 * Taglib ID
+	 */
+	protected String id = null;
+
+	/**
+	 * Resource Bundle文件名
+	 */
+	protected String bundle = null;
+
+	/**
+	 * 过滤字符串
+	 */
+	protected String str = null;
+
+	/**
+	 * 分割符字符串
+	 */
+	protected String delim = null;
+
+	/**
+	 * 包内的Message Resources.
+	 */
+	protected static MessageResources messages = MessageResources
+			.getMessageResources("com.acc.taglib.util.LocalStrings");
+
+	/***********************************************************************************************
+	 * //**public method
+	 **********************************************************************************************/
+
+	/**
+	 * 获取TagID
+	 */
+	public String getId()
+	{
+		return (this.id);
+	}
+
+	/**
+	 * 设置TagID
+	 */
+	public void setId(String id)
+	{
+		this.id = id;
+	}
+
+	/**
+	 * 设置Resource Bundle文件名称
+	 */
+	public void setBundle(String bundle)
+	{
+		this.bundle = bundle;
+	}
+
+	/**
+	 * 获取Resource Bundle文件名称
+	 */
+	public String getBundle()
+	{
+		return this.bundle;
+	}
+
+	/**
+	 * 获取过滤字符串
+	 */
+	public String getStr()
+	{
+		return this.str;
+	}
+
+	/**
+	 * 设置过滤字符串
+	 */
+	public void setStr(String str)
+	{
+		this.str = str;
+	}
+
+	/**
+	 * 获取分割符字符串
+	 */
+	public String getDelim()
+	{
+		return this.delim;
+	}
+
+	/**
+	 * 设置分割符字符串
+	 */
+	public void setDelim(String delim)
+	{
+		this.delim = delim;
+	}
+
+	/**
+	 * Tag Libary开始调用
+	 */
+	public int doStartTag() throws JspException
+	{
+		pageContext.removeAttribute(id);
+		Vector v = new Vector();
+		ResourceBundle myResources = null;
+		try
+		{
+			myResources = ResourceBundle.getBundle(bundle);
+		}
+		catch (MissingResourceException mre)
+		{
+			throw new JspException(messages.getMessage("resourceData.miss.bundle", bundle));
+		}
+		if (str != null)
+		{
+			if (str.length() > 1 && str.startsWith("#"))
+			{
+				if (delim == null)
+				{
+					delim = "#";
+				}
+				String store = str.substring(1, str.length() - 1);
+				StringTokenizer st = new StringTokenizer(store, delim);
+				while (st.hasMoreTokens())
+				{
+					String keyval = (String) st.nextToken();
+					try
+					{
+						String value = myResources.getString(keyval);
+						value = new String(value.getBytes("ISO-8859-1"));
+						LabelValueBean sh = new LabelValueBean(value, keyval);
+						v.add(sh);
+					}
+					catch (Exception e)
+					{
+					}
+				}
+				pageContext.setAttribute(id, v);
+				return (SKIP_BODY);
+			}
+			else
+			{
+				return (SKIP_BODY);
+			}
+		}
+
+		String order = null;
+		try
+		{
+			order = myResources.getString("order");
+		}
+		catch (Exception efx)
+		{
+		}
+		if (order != null && !order.equals(""))
+		{
+			StringTokenizer st = new StringTokenizer(order, ",");
+			while (st.hasMoreTokens())
+			{
+				String keyval = (String) st.nextToken();
+				try
+				{
+					String value = myResources.getString(keyval);
+					value = new String(value.getBytes("ISO-8859-1"));
+					LabelValueBean sh = new LabelValueBean(value, keyval);
+					v.add(sh);
+				}
+				catch (Exception e)
+				{
+					throw new JspException(messages.getMessage("resourceData.order.error", bundle,
+							keyval));
+				}
+			}
+		}
+		else
+		{
+			Enumeration e = myResources.getKeys();
+			while (e.hasMoreElements())
+			{
+				String keyval = (String) e.nextElement();
+				try
+				{
+					String value = myResources.getString(keyval);
+					value = new String(value.getBytes("ISO-8859-1"));
+					LabelValueBean sh = new LabelValueBean(value, keyval);
+					v.add(sh);
+				}
+				catch (Exception ex)
+				{
+				}
+			}
+		}
+		pageContext.setAttribute(id, v);
+		return (SKIP_BODY);
+	}
+
+	/**
+	 * Taglib 释放调用
+	 */
+	public void release()
+	{
+		super.release();
+		id = null;
+		bundle = null;
+		str = null;
+		delim = null;
+	}
+}

+ 29 - 0
src/com/acc/taglib/util/ResourceDataTei.java

@@ -0,0 +1,29 @@
+/***************************************************************************************************
+ * <class>: ResourceDataTei.java <desc>: ResourceDataTei Dependencies: (if applicable) (c) 2003,
+ * DeliriumCybertouch (BJ) Limited. All rights reserved. Last Modified By: $Author: $ Last Modified
+ * On: $Date: $
+ **************************************************************************************************/
+
+package com.acc.taglib.util;
+
+import javax.servlet.jsp.tagext.TagData;
+import javax.servlet.jsp.tagext.TagExtraInfo;
+import javax.servlet.jsp.tagext.VariableInfo;
+
+/**
+ * <p>
+ * <tt>ResourceDataTei</tt>应用了TagExtraInfo接口类�??
+ * </p>
+ * 
+ * @author Tony.Su
+ * @version $Revision: 1.0 $ $Date: 2002/11/25 01:30:40 $
+ */
+
+public class ResourceDataTei extends TagExtraInfo
+{
+	public VariableInfo[] getVariableInfo(TagData data)
+	{
+		return new VariableInfo[] { new VariableInfo(data.getAttributeString("id"),
+				"java.util.Vector", true, VariableInfo.AT_BEGIN) };
+	}
+}

+ 104 - 0
src/com/acc/taglib/util/ResourceTableTag.java

@@ -0,0 +1,104 @@
+package com.acc.taglib.util;
+
+import java.util.List;
+import java.util.Map;
+
+import javax.servlet.jsp.JspException;
+import javax.servlet.jsp.tagext.TagSupport;
+
+import com.acc.common.jdbc.JdbcTemplateEx;
+import com.acc.common.spring.ApplicationFactory;
+
+public class ResourceTableTag extends TagSupport
+{
+	private String table;
+
+	private String referenceID;
+
+	private String referenceValue;
+
+	private String value;
+
+	public String getValue()
+	{
+		return value;
+	}
+
+	public String getReferenceValue()
+	{
+		return referenceValue;
+	}
+
+	public String getReferenceID()
+	{
+		return referenceID;
+	}
+
+	public void setTable(String table)
+	{
+		this.table = table;
+	}
+
+	public void setValue(String value)
+	{
+		this.value = value;
+	}
+
+	public void setReferenceValue(String referenceValue)
+	{
+		this.referenceValue = referenceValue;
+	}
+
+	public void setReferenceID(String referenceID)
+	{
+		this.referenceID = referenceID;
+	}
+
+	public String getTable()
+	{
+		return table;
+	}
+
+	public ResourceTableTag()
+	{
+	}
+
+	public int doStartTag() throws JspException
+	{
+		String optionstr = "";
+		try
+		{
+			JdbcTemplateEx template = new JdbcTemplateEx(ApplicationFactory.getDataSource());
+			String sql = "select * from " + table;
+			List result = template.queryForList(sql);
+			for (int i = 0; i < result.size(); i++)
+			{
+				Map map = (Map) result.get(i);
+				String id = map.get(this.referenceID).toString();
+				String val = map.get(this.referenceValue).toString();
+				if (id.equals(this.value))
+				{
+					optionstr = optionstr + "<option value=\"" + id + "\" selected>" + val
+							+ "</option>";
+				}
+				else
+				{
+					optionstr = optionstr + "<option value=\"" + id + "\">" + val + "</option>";
+				}
+			}
+		}
+		catch (Exception e)
+		{
+
+		}
+
+		return (SKIP_BODY);
+
+	}
+
+	public void release()
+	{
+		super.release();
+	}
+
+}

+ 139 - 0
src/com/acc/taglib/util/ResourceTag.java

@@ -0,0 +1,139 @@
+/***************************************************************************************************
+ * <class>: ResourceDataTag.java <desc>: ResourceDataTag Dependencies: (if applicable) (c) 2003,
+ * DeliriumCybertouch (BJ) Limited. All rights reserved. Last Modified By: $Author: $ Last Modified
+ * On: $Date: $
+ **************************************************************************************************/
+
+package com.acc.taglib.util;
+
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+import javax.servlet.jsp.JspException;
+import javax.servlet.jsp.tagext.TagSupport;
+
+import org.apache.struts.util.MessageResources;
+
+/**
+ * <p>
+ * <tt>ResourceTag</tt>是关于获取单�?Resource名称值的Tag Libary类�?�Str选择�?
+ * 
+ * 个过滤字符串Resource Bundle文件的key值,获取相应Value值,将它显示在JSP上�??
+ * </p>
+ * 
+ * <pre>
+ *    例如�?
+ *    
+ *     &amp;ltbean:define id=&quot;addressid&quot; name=&quot;entity&quot; property=&quot;addressID&quot;/&gt;
+ *     &amp;ltpage:resource  bundle=&quot;com.project.example.resource.kk&quot;
+ *             str=&quot;&amp;lt%=addressid+&quot;&quot;%&gt;&quot; /&gt;
+ * </pre>
+ */
+
+public class ResourceTag extends TagSupport
+{
+
+	/***********************************************************************************************
+	 * //**成员变量
+	 **********************************************************************************************/
+
+	/**
+	 * Resource Bundle文件�?
+	 * 
+	 */
+	protected String bundle = null;
+
+	/**
+	 * 过滤字符�?
+	 * 
+	 */
+	protected String str = null;
+
+	/**
+	 * 包内的Message Resources.
+	 */
+	protected static MessageResources messages = MessageResources
+			.getMessageResources("com.acc.taglib.util.LocalStrings");
+
+	/***********************************************************************************************
+	 * //**public method
+	 **********************************************************************************************/
+
+	/**
+	 * 设置Resource Bundle文件名称
+	 */
+	public void setBundle(String bundle)
+	{
+		this.bundle = bundle;
+	}
+
+	/**
+	 * 获取Resource Bundle文件名称
+	 */
+	public String getBundle()
+	{
+		return this.bundle;
+	}
+
+	/**
+	 * 获取过滤字符�?
+	 * 
+	 */
+	public String getStr()
+	{
+		return this.str;
+	}
+
+	/**
+	 * 设置过滤字符�?
+	 * 
+	 */
+	public void setStr(String str)
+	{
+		this.str = str;
+	}
+
+	/**
+	 * Tag Libary�?始调�?
+	 * 
+	 */
+	public int doStartTag() throws JspException
+	{
+		ResourceBundle myResources = null;
+
+		try
+		{
+			myResources = ResourceBundle.getBundle(bundle);
+		}
+		catch (MissingResourceException mre)
+		{
+			throw new JspException(messages.getMessage("resourceData.miss.bundle", bundle));
+		}
+
+		if (str != null && str.length() > 0)
+		{
+			try
+			{
+				String value = myResources.getString(str);
+				value = new String(value.getBytes("ISO-8859-1"));
+				pageContext.getOut().print(value);
+				return (SKIP_BODY);
+			}
+			catch (Exception e)
+			{
+			}
+		}
+
+		return (SKIP_BODY);
+
+	}
+
+	/**
+	 * Taglib 释放调用
+	 */
+	public void release()
+	{
+		super.release();
+		bundle = null;
+		str = null;
+	}
+}

+ 165 - 0
src/com/acc/taglib/util/TableDataDisplay.java

@@ -0,0 +1,165 @@
+package com.acc.taglib.util;
+
+import java.util.List;
+import java.util.Map;
+import java.util.Vector;
+
+import javax.servlet.jsp.JspException;
+import javax.servlet.jsp.tagext.TagSupport;
+
+import org.apache.struts.util.ResponseUtils;
+
+import com.acc.common.jdbc.DBUtil;
+import com.acc.common.jdbc.JdbcTemplateEx;
+import com.acc.common.spring.ApplicationFactory;
+
+public class TableDataDisplay extends TagSupport
+{
+
+	private String referenceValue;
+
+	private String referenceTable;
+
+	private String referenceSQL;
+
+	private String inputValue;
+
+	private String referencePKName;
+
+	public String getReferenceValue()
+	{
+		return referenceValue;
+	}
+
+	public void setReferenceTable(String referenceTable)
+	{
+		this.referenceTable = referenceTable;
+	}
+
+	public void setReferenceValue(String referenceValue)
+	{
+		this.referenceValue = referenceValue;
+	}
+
+	public void setReferenceSQL(String referenceSQL)
+	{
+		this.referenceSQL = referenceSQL;
+	}
+
+	public void setInputValue(String inputValue)
+	{
+		this.inputValue = inputValue;
+	}
+
+	public void setReferencePKName(String referencePKName)
+	{
+		this.referencePKName = referencePKName;
+	}
+
+	public String getReferenceTable()
+	{
+		return referenceTable;
+	}
+
+	public String getReferenceSQL()
+	{
+		return referenceSQL;
+	}
+
+	public String getInputValue()
+	{
+		return inputValue;
+	}
+
+	public String getReferencePKName()
+	{
+		return referencePKName;
+	}
+
+	public TableDataDisplay()
+	{
+	}
+
+	public int doStartTag() throws JspException
+	{
+		if (referenceValue == null || referenceValue.length() == 0)
+			referenceValue = "ReferenceValue";
+
+		List list = this.getReference();
+		String pkname = this.getReferencePKName();
+		if (pkname == null || pkname.length() == 0) pkname = "ReferenceID";
+		String value = "";
+		for (int i = 0; i < list.size(); i++)
+		{
+			Map map = (Map) list.get(i);
+			String pk = map.get(pkname).toString();
+			if (inputValue.indexOf(",") > -1)
+			{
+				String[] inputValueArray = inputValue.split(",");
+				for (int j = 0; j < inputValueArray.length; j++)
+				{
+					String itemValue = inputValueArray[j];
+					if (pk != null && (pk.toString()).equals(itemValue))
+					{
+						value = value + "," + map.get(referenceValue);
+						break;
+					}
+				}
+			}
+			else
+			{
+				if (pk != null && (pk.toString()).equals(inputValue))
+				{
+					value = "," + (String) map.get(referenceValue);
+					break;
+				}
+			}
+		}
+
+		if (value.length() > 0) value = value.substring(1);
+
+		ResponseUtils.write(pageContext, value);
+		return (SKIP_BODY);
+	}
+
+	private List getReference()
+	{
+		List list = (List) this.pageContext.getAttribute(id + "_Reference");
+		if (list != null) return list;
+		try
+		{
+			JdbcTemplateEx template = new JdbcTemplateEx(ApplicationFactory.getDataSource());
+			if (referenceSQL != null && referenceSQL.length() > 0)
+				list = template.queryForList(referenceSQL);
+			else list = template.queryForList("select * from " + referenceTable);
+			this.pageContext.setAttribute(id + "_Reference", list);
+		}
+		catch (Exception e)
+		{
+			list = new Vector();
+		}
+		return list;
+	}
+
+	private String getPKName()
+	{
+		String str = (String) this.pageContext.getAttribute(id + "_pk");
+		if (str != null) return str;
+		try
+		{
+			DBUtil util = new DBUtil();
+			str = util.getPKFromTable(this.referenceTable);
+			this.pageContext.setAttribute(id + "_pk", str);
+		}
+		catch (Exception e)
+		{
+		}
+		return str;
+	}
+
+	public void release()
+	{
+		super.release();
+	}
+
+}

+ 137 - 0
src/com/acc/taglib/util/TableDataTag.java

@@ -0,0 +1,137 @@
+package com.acc.taglib.util;
+
+import java.util.List;
+import java.util.Map;
+import java.util.Vector;
+
+import javax.servlet.jsp.JspException;
+import javax.servlet.jsp.tagext.TagSupport;
+
+import org.apache.struts.util.LabelValueBean;
+
+import com.acc.common.jdbc.DBUtil;
+import com.acc.common.jdbc.JdbcTemplateEx;
+import com.acc.common.spring.ApplicationFactory;
+
+public class TableDataTag extends TagSupport
+{
+	private String referencePKName;
+
+	private String referenceValue;
+
+	private String referenceTable;
+
+	private String referenceSQL;
+
+	public String getReferenceValue()
+	{
+		return referenceValue;
+	}
+
+	public void setReferenceTable(String referenceTable)
+	{
+		this.referenceTable = referenceTable;
+	}
+
+	public void setReferenceValue(String referenceValue)
+	{
+		this.referenceValue = referenceValue;
+	}
+
+	public void setReferenceSQL(String referenceSQL)
+	{
+		this.referenceSQL = referenceSQL;
+	}
+
+	public void setReferencePKName(String referencePKName)
+	{
+		this.referencePKName = referencePKName;
+	}
+
+	public String getReferenceTable()
+	{
+		return referenceTable;
+	}
+
+	public String getReferenceSQL()
+	{
+		return referenceSQL;
+	}
+
+	public String getReferencePKName()
+	{
+		return referencePKName;
+	}
+
+	public TableDataTag()
+	{
+	}
+
+	public int doStartTag() throws JspException
+	{
+		if (referenceValue == null || referenceValue.length() == 0)
+			referenceValue = "ReferenceValue";
+		// String pkName = this.getPKName();
+		String pkName = "ReferenceID";
+		if (referencePKName != null) pkName = referencePKName;
+		List list = this.getReference();
+		Vector v = new Vector();
+		for (int i = 0; i < list.size(); i++)
+		{
+			Map map = (Map) list.get(i);
+			Object key = map.get(pkName);
+			if (key != null)
+			{
+				Object obj = map.get(this.referenceValue);
+				if (obj != null)
+				{
+					LabelValueBean sh = new LabelValueBean(obj.toString(), key.toString());
+					v.add(sh);
+				}
+			}
+		}
+		pageContext.setAttribute(id, v);
+		return (SKIP_BODY);
+	}
+
+	private List getReference()
+	{
+		List list = (List) this.pageContext.getAttribute(id + "_Reference");
+		if (list != null) return list;
+		try
+		{
+			JdbcTemplateEx template = new JdbcTemplateEx(ApplicationFactory.getDataSource());
+			if (referenceSQL != null && referenceSQL.length() > 0)
+				list = template.queryForList(referenceSQL);
+			else list = template.queryForList("select * from " + referenceTable);
+			this.pageContext.setAttribute(id + "_Reference", list);
+		}
+		catch (Exception e)
+		{
+			list = new Vector();
+		}
+		return list;
+	}
+
+	private String getPKName()
+	{
+		String str = (String) this.pageContext.getAttribute(id + "_pk");
+		if (str != null) return str;
+		try
+		{
+			DBUtil util = new DBUtil();
+			str = util.getPKFromTable(this.referenceTable);
+			this.pageContext.setAttribute(id + "_pk", str);
+		}
+		catch (Exception e)
+		{
+		}
+		return str;
+	}
+
+	public void release()
+	{
+		super.release();
+	}
+
+}

+ 14 - 0
src/com/acc/taglib/util/TableDataTei.java

@@ -0,0 +1,14 @@
+package com.acc.taglib.util;
+
+import javax.servlet.jsp.tagext.TagData;
+import javax.servlet.jsp.tagext.TagExtraInfo;
+import javax.servlet.jsp.tagext.VariableInfo;
+
+public class TableDataTei extends TagExtraInfo
+{
+	public VariableInfo[] getVariableInfo(TagData data)
+	{
+		return new VariableInfo[] { new VariableInfo(data.getAttributeString("id"),
+				"java.util.Vector", true, VariableInfo.AT_BEGIN) };
+	}
+}

+ 80 - 0
src/com/acc/taglib/util/TableValueDisplay.java

@@ -0,0 +1,80 @@
+package com.acc.taglib.util;
+
+import java.util.List;
+import java.util.Map;
+
+import javax.servlet.jsp.JspException;
+import javax.servlet.jsp.tagext.TagSupport;
+
+import org.apache.struts.util.ResponseUtils;
+
+import com.acc.common.jdbc.JdbcTemplateEx;
+import com.acc.common.spring.ApplicationFactory;
+
+public class TableValueDisplay extends TagSupport
+{
+	private String inputSQL;
+
+	private String inputName;
+
+	private String displayFormat;
+
+	public void setInputSQL(String inputSQL)
+	{
+		this.inputSQL = inputSQL;
+	}
+	
+	public void setDisplayFormat(String displayFormat)
+	{
+		this.displayFormat = displayFormat;
+	}
+
+	public void setInputName(String inputName)
+	{
+		this.inputName = inputName;
+	}
+
+	public String getInputSQL()
+	{
+		return inputSQL;
+	}
+
+	public String getDisplayFormat()
+	{
+		return displayFormat;
+	}
+
+	public String getInputName()
+	{
+		return inputName;
+	}
+
+	public int doStartTag() throws JspException
+	{
+		List list = null;
+
+		JdbcTemplateEx template = new JdbcTemplateEx(ApplicationFactory.getDataSource());
+		list = template.queryForList(inputSQL);
+		Object value = "";
+		if (list == null || list.size() == 0)
+		{
+			// Number�ͺ�String
+			if (displayFormat != null && displayFormat.equals("String"))
+				value = "";
+			else value = "0";
+		}
+		else
+		{
+			Map map = (Map) list.get(0);
+			value = (Object) map.get(inputName);
+		}
+		ResponseUtils.write(pageContext, value.toString());
+		return (SKIP_BODY);
+	}
+
+	public void release()
+	{
+		super.release();
+	}
+
+}

+ 86 - 0
src/com/acc/taglib/util/URLEncodingTag.java

@@ -0,0 +1,86 @@
+package com.acc.taglib.util;
+
+import javax.servlet.jsp.tagext.*;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.jsp.JspException;
+import java.net.URLEncoder;
+import org.apache.commons.logging.*;
+
+public class URLEncodingTag extends TagSupport
+
+{
+	private Log log = LogFactory.getLog(this.getClass());
+
+	private String id;
+
+	private String encoding;
+
+	private String name;
+
+	public void setId(String id)
+	{
+		this.id = id;
+	}
+
+	public void setEncoding(String encoding)
+	{
+		this.encoding = encoding;
+	}
+
+	public void setName(String name)
+	{
+		this.name = name;
+	}
+
+	public String getId()
+	{
+		return id;
+	}
+
+	public String getEncoding()
+	{
+		return encoding;
+	}
+
+	public String getName()
+	{
+		return name;
+	}
+
+	public URLEncodingTag()
+	{
+	}
+
+	/**
+	 * Tag Libary�?始调�?
+	 * 
+	 * 
+	 */
+	public int doStartTag() throws JspException
+	{
+
+		String idstr = (String) pageContext.getAttribute(this.name);
+		if (idstr != null && idstr.length() > 0)
+		{
+			HttpServletResponse response = (HttpServletResponse) pageContext.getResponse();
+			try
+			{
+				if (this.encoding != null && this.encoding.length() > 0)
+				{
+					idstr = URLEncoder.encode(idstr, this.encoding);
+				}
+				else
+				{
+					idstr = URLEncoder.encode(idstr, response.getCharacterEncoding());
+				}
+				pageContext.setAttribute(this.id, idstr);
+			}
+			catch (Exception e)
+			{
+				e.printStackTrace(System.out);
+			}
+		}
+		return (SKIP_BODY);
+	}
+
+}

+ 14 - 0
src/com/acc/taglib/util/URLEncodingTei.java

@@ -0,0 +1,14 @@
+package com.acc.taglib.util;
+
+import javax.servlet.jsp.tagext.TagData;
+import javax.servlet.jsp.tagext.TagExtraInfo;
+import javax.servlet.jsp.tagext.VariableInfo;
+
+public class URLEncodingTei extends TagExtraInfo
+{
+	public VariableInfo[] getVariableInfo(TagData data)
+	{
+		return new VariableInfo[] { new VariableInfo(data.getAttributeString("id"),
+				"java.lang.String", true, VariableInfo.AT_BEGIN) };
+	}
+}

+ 60 - 0
src/com/acc/util/common/AutnQueryUtil.java

@@ -0,0 +1,60 @@
+package com.acc.util.common;
+
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+import org.apache.commons.lang.StringUtils;
+
+public class AutnQueryUtil
+{
+	private static final String[] specialChar = new String[] { "\\", "+", "-", "&&", "||", "!",
+		"(", ")", "{", "}", "[", "]", "^", "\"", "~", "*", "?", ":" };
+
+	public static String genField(String fName, String fValue)
+	{
+		String str = "" + EscapSpecialChar(fValue) + ":" + fName;
+		return str;
+	}
+	
+	public static String genMatchField(String fName, String fValue)
+	{
+		String str = "MATCH{" + EscapSpecialChar(fValue) + "}:" + fName;
+		return str;
+	}
+	
+	public static String genNRangeField(String fName, int fValue1, int fValue2)
+	{
+		String str = "NRANGE{" + fValue1 + "," + fValue2 + "}:" + fName;
+		return str;
+	}
+	
+	public static String genEQUALField(String fName, String fValue)
+	{
+		String str = "EQUAL{" + fValue + "}:" + fName;
+		return str;
+	}
+	
+	public static String genDRangeField(String fName, String date1, String date2)
+	{
+		String str = "ARANGE{" + date1 + "," + date2 + "}:" + fName;
+		return str;
+	}
+	
+	public static String genDRangeField(String fName, Date date1, Date date2)
+	{
+		SimpleDateFormat df = new SimpleDateFormat("dd/mm/yyyy");
+	
+		String str = "RANGE{" + df.format(date1) + "," + df.format(date2) + "}:" + fName;
+		return str;
+	}
+	
+	private static String EscapSpecialChar(String str)
+	{
+		for (int i = 0; i < specialChar.length; i++)
+		{
+			StringUtils.replace(str, specialChar[i], "");
+		}
+		return str;
+	}
+
+}

+ 51 - 0
src/com/acc/util/common/Base64Encode.java

@@ -0,0 +1,51 @@
+package com.acc.util.common;
+
+public class Base64Encode {
+
+	/**
+	 * the encode alphabet
+	 */
+	private static char[] alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="
+			.toCharArray();
+
+	/**
+	 * Encode a block of binary data as base64 as specified in RFC1521.
+	 * 
+	 * @param data
+	 *            the binary data to encode.
+	 * @return An array of characters that represent the data encoded as Base64
+	 */
+	public static char[] encodeBase64(byte[] data) {
+		char[] out = new char[((data.length + 2) / 3) * 4];
+
+		//
+		// 3 bytes encode to 4 chars. Output is always an even
+		// multiple of 4 characters.
+		//
+		for (int i = 0, index = 0; i < data.length; i += 3, index += 4) {
+			boolean quad = false;
+			boolean triple = false;
+			// convert to unsigned byte
+			int val = (0xFF & (int) data[i]);
+			val <<= 8;
+			if ((i + 1) < data.length) {
+				val |= (0xFF & (int) data[i + 1]);
+				triple = true;
+			}
+			val <<= 8;
+			if ((i + 2) < data.length) {
+				val |= (0xFF & (int) data[i + 2]);
+				quad = true;
+			}
+			out[index + 3] = alphabet[(quad ? (val & 0x3F) : 64)];
+			val >>= 6;
+			out[index + 2] = alphabet[(triple ? (val & 0x3F) : 64)];
+			val >>= 6;
+			out[index + 1] = alphabet[val & 0x3F];
+			val >>= 6;
+			out[index + 0] = alphabet[val & 0x3F];
+		}
+		return out;
+	}
+
+}

+ 176 - 0
src/com/acc/util/common/ChineseSpelling.java

@@ -0,0 +1,176 @@
+package com.acc.util.common;
+
+public class ChineseSpelling {
+
+	private static int[] pyvalue = new int[] { -20319, -20317, -20304, -20295,
+			-20292, -20283, -20265, -20257, -20242, -20230, -20051, -20036,
+			-20032, -20026, -20002, -19990, -19986, -19982, -19976, -19805,
+			-19784, -19775, -19774, -19763, -19756, -19751, -19746, -19741,
+			-19739, -19728, -19725, -19715, -19540, -19531, -19525, -19515,
+			-19500, -19484, -19479, -19467, -19289, -19288, -19281, -19275,
+			-19270, -19263, -19261, -19249, -19243, -19242, -19238, -19235,
+			-19227, -19224, -19218, -19212, -19038, -19023, -19018, -19006,
+			-19003, -18996, -18977, -18961, -18952, -18783, -18774, -18773,
+			-18763, -18756, -18741, -18735, -18731, -18722, -18710, -18697,
+			-18696, -18526, -18518, -18501, -18490, -18478, -18463, -18448,
+			-18447, -18446, -18239, -18237, -18231, -18220, -18211, -18201,
+			-18184, -18183, -18181, -18012, -17997, -17988, -17970, -17964,
+			-17961, -17950, -17947, -17931, -17928, -17922, -17759, -17752,
+			-17733, -17730, -17721, -17703, -17701, -17697, -17692, -17683,
+			-17676, -17496, -17487, -17482, -17468, -17454, -17433, -17427,
+			-17417, -17202, -17185, -16983, -16970, -16942, -16915, -16733,
+			-16708, -16706, -16689, -16664, -16657, -16647, -16474, -16470,
+			-16465, -16459, -16452, -16448, -16433, -16429, -16427, -16423,
+			-16419, -16412, -16407, -16403, -16401, -16393, -16220, -16216,
+			-16212, -16205, -16202, -16187, -16180, -16171, -16169, -16158,
+			-16155, -15959, -15958, -15944, -15933, -15920, -15915, -15903,
+			-15889, -15878, -15707, -15701, -15681, -15667, -15661, -15659,
+			-15652, -15640, -15631, -15625, -15454, -15448, -15436, -15435,
+			-15419, -15416, -15408, -15394, -15385, -15377, -15375, -15369,
+			-15363, -15362, -15183, -15180, -15165, -15158, -15153, -15150,
+			-15149, -15144, -15143, -15141, -15140, -15139, -15128, -15121,
+			-15119, -15117, -15110, -15109, -14941, -14937, -14933, -14930,
+			-14929, -14928, -14926, -14922, -14921, -14914, -14908, -14902,
+			-14894, -14889, -14882, -14873, -14871, -14857, -14678, -14674,
+			-14670, -14668, -14663, -14654, -14645, -14630, -14594, -14429,
+			-14407, -14399, -14384, -14379, -14368, -14355, -14353, -14345,
+			-14170, -14159, -14151, -14149, -14145, -14140, -14137, -14135,
+			-14125, -14123, -14122, -14112, -14109, -14099, -14097, -14094,
+			-14092, -14090, -14087, -14083, -13917, -13914, -13910, -13907,
+			-13906, -13905, -13896, -13894, -13878, -13870, -13859, -13847,
+			-13831, -13658, -13611, -13601, -13406, -13404, -13400, -13398,
+			-13395, -13391, -13387, -13383, -13367, -13359, -13356, -13343,
+			-13340, -13329, -13326, -13318, -13147, -13138, -13120, -13107,
+			-13096, -13095, -13091, -13076, -13068, -13063, -13060, -12888,
+			-12875, -12871, -12860, -12858, -12852, -12849, -12838, -12831,
+			-12829, -12812, -12802, -12607, -12597, -12594, -12585, -12556,
+			-12359, -12346, -12320, -12300, -12120, -12099, -12089, -12074,
+			-12067, -12058, -12039, -11867, -11861, -11847, -11831, -11798,
+			-11781, -11604, -11589, -11536, -11358, -11340, -11339, -11324,
+			-11303, -11097, -11077, -11067, -11055, -11052, -11045, -11041,
+			-11038, -11024, -11020, -11019, -11018, -11014, -10838, -10832,
+			-10815, -10800, -10790, -10780, -10764, -10587, -10544, -10533,
+			-10519, -10331, -10329, -10328, -10322, -10315, -10309, -10307,
+			-10296, -10281, -10274, -10270, -10262, -10260, -10256, -10254 };
+
+	private static String[] pystr = new String[] { "a", "ai", "an", "ang",
+			"ao", "ba", "bai", "ban", "bang", "bao", "bei", "ben", "beng",
+			"bi", "bian", "biao", "bie", "bin", "bing", "bo", "bu", "ca",
+			"cai", "can", "cang", "cao", "ce", "ceng", "cha", "chai", "chan",
+			"chang", "chao", "che", "chen", "cheng", "chi", "chong", "chou",
+			"chu", "chuai", "chuan", "chuang", "chui", "chun", "chuo", "ci",
+			"cong", "cou", "cu", "cuan", "cui", "cun", "cuo", "da", "dai",
+			"dan", "dang", "dao", "de", "deng", "di", "dian", "diao", "die",
+			"ding", "diu", "dong", "dou", "du", "duan", "dui", "dun", "duo",
+			"e", "en", "er", "fa", "fan", "fang", "fei", "fen", "feng", "fo",
+			"fou", "fu", "ga", "gai", "gan", "gang", "gao", "ge", "gei", "gen",
+			"geng", "gong", "gou", "gu", "gua", "guai", "guan", "guang", "gui",
+			"gun", "guo", "ha", "hai", "han", "hang", "hao", "he", "hei",
+			"hen", "heng", "hong", "hou", "hu", "hua", "huai", "huan", "huang",
+			"hui", "hun", "huo", "ji", "jia", "jian", "jiang", "jiao", "jie",
+			"jin", "jing", "jiong", "jiu", "ju", "juan", "jue", "jun", "ka",
+			"kai", "kan", "kang", "kao", "ke", "ken", "keng", "kong", "kou",
+			"ku", "kua", "kuai", "kuan", "kuang", "kui", "kun", "kuo", "la",
+			"lai", "lan", "lang", "lao", "le", "lei", "leng", "li", "lia",
+			"lian", "liang", "liao", "lie", "lin", "ling", "liu", "long",
+			"lou", "lu", "lv", "luan", "lue", "lun", "luo", "ma", "mai", "man",
+			"mang", "mao", "me", "mei", "men", "meng", "mi", "mian", "miao",
+			"mie", "min", "ming", "miu", "mo", "mou", "mu", "na", "nai", "nan",
+			"nang", "nao", "ne", "nei", "nen", "neng", "ni", "nian", "niang",
+			"niao", "nie", "nin", "ning", "niu", "nong", "nu", "nv", "nuan",
+			"nue", "nuo", "o", "ou", "pa", "pai", "pan", "pang", "pao", "pei",
+			"pen", "peng", "pi", "pian", "piao", "pie", "pin", "ping", "po",
+			"pu", "qi", "qia", "qian", "qiang", "qiao", "qie", "qin", "qing",
+			"qiong", "qiu", "qu", "quan", "que", "qun", "ran", "rang", "rao",
+			"re", "ren", "reng", "ri", "rong", "rou", "ru", "ruan", "rui",
+			"run", "ruo", "sa", "sai", "san", "sang", "sao", "se", "sen",
+			"seng", "sha", "shai", "shan", "shang", "shao", "she", "shen",
+			"sheng", "shi", "shou", "shu", "shua", "shuai", "shuan", "shuang",
+			"shui", "shun", "shuo", "si", "song", "sou", "su", "suan", "sui",
+			"sun", "suo", "ta", "tai", "tan", "tang", "tao", "te", "teng",
+			"ti", "tian", "tiao", "tie", "ting", "tong", "tou", "tu", "tuan",
+			"tui", "tun", "tuo", "wa", "wai", "wan", "wang", "wei", "wen",
+			"weng", "wo", "wu", "xi", "xia", "xian", "xiang", "xiao", "xie",
+			"xin", "xing", "xiong", "xiu", "xu", "xuan", "xue", "xun", "ya",
+			"yan", "yang", "yao", "ye", "yi", "yin", "ying", "yo", "yong",
+			"you", "yu", "yuan", "yue", "yun", "za", "zai", "zan", "zang",
+			"zao", "ze", "zei", "zen", "zeng", "zha", "zhai", "zhan", "zhang",
+			"zhao", "zhe", "zhen", "zheng", "zhi", "zhong", "zhou", "zhu",
+			"zhua", "zhuai", "zhuan", "zhuang", "zhui", "zhun", "zhuo", "zi",
+			"zong", "zou", "zu", "zuan", "zui", "zun", "zuo" };
+
+	private static StringBuilder buffer;
+
+	private static ChineseSpelling chineseSpelling = new ChineseSpelling();
+
+	public static ChineseSpelling getInstance() {
+		return chineseSpelling;
+	}
+
+	private static int getChsAscii(String chs) {
+		int asc = 0;
+		try {
+
+			byte[] bytes = chs.getBytes("gb2312");
+
+			if (bytes == null || bytes.length > 2 || bytes.length <= 0) { // 错误
+
+				// log
+
+				throw new RuntimeException("illegal resource string");
+				// System.out.println("error");
+
+			}
+			if (bytes.length == 1) { // 英文字符
+
+				asc = bytes[0];
+			}
+			if (bytes.length == 2) { // 中文字符
+
+				int hightByte = 256 + bytes[0];
+				int lowByte = 256 + bytes[1];
+				asc = (256 * hightByte + lowByte) - 256 * 256;
+			}
+		} catch (Exception e) {
+			System.out
+					.println("ERROR:ChineseSpelling.class-getChsAscii(String chs)"
+							+ e);
+		}
+		return asc;
+	}
+
+	public static String convert(String str) {
+		String result = null;
+		int ascii = getChsAscii(str);
+		if (ascii > 0 && ascii < 160) {
+			result = String.valueOf((char) ascii);
+		} else {
+			for (int i = (pyvalue.length - 1); i >= 0; i--) {
+				if (pyvalue[i] <= ascii) {
+					result = pystr[i];
+					break;
+				}
+			}
+		}
+		return result;
+	}
+
+	public static String getSelling(String chs) {
+		String key, value;
+		buffer = new StringBuilder();
+		for (int i = 0; i < chs.length(); i++) {
+			key = chs.substring(i, i + 1);
+			if (key.getBytes().length == 2) {
+				value = (String) convert(key);
+				if (value == null) {
+					value = "unknown";
+				}
+			} else {
+				value = key;
+			}
+
+			buffer.append(value + " ");
+		}
+		return buffer.toString().trim();
+	}
+}

+ 539 - 0
src/com/acc/util/common/CnToSpell.java

@@ -0,0 +1,539 @@
+package com.acc.util.common;
+
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.Set;
+
+/**
+ * 汉字转化为全拼 
+ * @version :JDK版本:1.4
+ */
+public class CnToSpell {
+	private static LinkedHashMap spellMap = null;
+	static {
+		if (spellMap == null) {
+			spellMap = new LinkedHashMap(400);
+		}
+		initialize();
+		System.out.println("Chinese transfer Spell Done.");
+	}
+
+	private CnToSpell() {
+	}
+
+	private static void spellPut(String spell, int ascii) {
+		spellMap.put(spell, new Integer(ascii));
+	}
+
+	private static void initialize() {
+		spellPut("a", -20319);
+		spellPut("ai", -20317);
+		spellPut("an", -20304);
+		spellPut("ang", -20295);
+		spellPut("ao", -20292);
+		spellPut("ba", -20283);
+		spellPut("bai", -20265);
+		spellPut("ban", -20257);
+		spellPut("bang", -20242);
+		spellPut("bao", -20230);
+		spellPut("bei", -20051);
+		spellPut("ben", -20036);
+		spellPut("beng", -20032);
+		spellPut("bi", -20026);
+		spellPut("bian", -20002);
+		spellPut("biao", -19990);
+		spellPut("bie", -19986);
+		spellPut("bin", -19982);
+		spellPut("bing", -19976);
+		spellPut("bo", -19805);
+		spellPut("bu", -19784);
+		spellPut("ca", -19775);
+		spellPut("cai", -19774);
+		spellPut("can", -19763);
+		spellPut("cang", -19756);
+		spellPut("cao", -19751);
+		spellPut("ce", -19746);
+		spellPut("ceng", -19741);
+		spellPut("cha", -19739);
+		spellPut("chai", -19728);
+		spellPut("chan", -19725);
+		spellPut("chang", -19715);
+		spellPut("chao", -19540);
+		spellPut("che", -19531);
+		spellPut("chen", -19525);
+		spellPut("cheng", -19515);
+		spellPut("chi", -19500);
+		spellPut("chong", -19484);
+		spellPut("chou", -19479);
+		spellPut("chu", -19467);
+		spellPut("chuai", -19289);
+		spellPut("chuan", -19288);
+		spellPut("chuang", -19281);
+		spellPut("chui", -19275);
+		spellPut("chun", -19270);
+		spellPut("chuo", -19263);
+		spellPut("ci", -19261);
+		spellPut("cong", -19249);
+		spellPut("cou", -19243);
+		spellPut("cu", -19242);
+		spellPut("cuan", -19238);
+		spellPut("cui", -19235);
+		spellPut("cun", -19227);
+		spellPut("cuo", -19224);
+		spellPut("da", -19218);
+		spellPut("dai", -19212);
+		spellPut("dan", -19038);
+		spellPut("dang", -19023);
+		spellPut("dao", -19018);
+		spellPut("de", -19006);
+		spellPut("deng", -19003);
+		spellPut("di", -18996);
+		spellPut("dian", -18977);
+		spellPut("diao", -18961);
+		spellPut("die", -18952);
+		spellPut("ding", -18783);
+		spellPut("diu", -18774);
+		spellPut("dong", -18773);
+		spellPut("dou", -18763);
+		spellPut("du", -18756);
+		spellPut("duan", -18741);
+		spellPut("dui", -18735);
+		spellPut("dun", -18731);
+		spellPut("duo", -18722);
+		spellPut("e", -18710);
+		spellPut("en", -18697);
+		spellPut("er", -18696);
+		spellPut("fa", -18526);
+		spellPut("fan", -18518);
+		spellPut("fang", -18501);
+		spellPut("fei", -18490);
+		spellPut("fen", -18478);
+		spellPut("feng", -18463);
+		spellPut("fo", -18448);
+		spellPut("fou", -18447);
+		spellPut("fu", -18446);
+		spellPut("ga", -18239);
+		spellPut("gai", -18237);
+		spellPut("gan", -18231);
+		spellPut("gang", -18220);
+		spellPut("gao", -18211);
+		spellPut("ge", -18201);
+		spellPut("gei", -18184);
+		spellPut("gen", -18183);
+		spellPut("geng", -18181);
+		spellPut("gong", -18012);
+		spellPut("gou", -17997);
+		spellPut("gu", -17988);
+		spellPut("gua", -17970);
+		spellPut("guai", -17964);
+		spellPut("guan", -17961);
+		spellPut("guang", -17950);
+		spellPut("gui", -17947);
+		spellPut("gun", -17931);
+		spellPut("guo", -17928);
+		spellPut("ha", -17922);
+		spellPut("hai", -17759);
+		spellPut("han", -17752);
+		spellPut("hang", -17733);
+		spellPut("hao", -17730);
+		spellPut("he", -17721);
+		spellPut("hei", -17703);
+		spellPut("hen", -17701);
+		spellPut("heng", -17697);
+		spellPut("hong", -17692);
+		spellPut("hou", -17683);
+		spellPut("hu", -17676);
+		spellPut("hua", -17496);
+		spellPut("huai", -17487);
+		spellPut("huan", -17482);
+		spellPut("huang", -17468);
+		spellPut("hui", -17454);
+		spellPut("hun", -17433);
+		spellPut("huo", -17427);
+		spellPut("ji", -17417);
+		spellPut("jia", -17202);
+		spellPut("jian", -17185);
+		spellPut("jiang", -16983);
+		spellPut("jiao", -16970);
+		spellPut("jie", -16942);
+		spellPut("jin", -16915);
+		spellPut("jing", -16733);
+		spellPut("jiong", -16708);
+		spellPut("jiu", -16706);
+		spellPut("ju", -16689);
+		spellPut("juan", -16664);
+		spellPut("jue", -16657);
+		spellPut("jun", -16647);
+		spellPut("ka", -16474);
+		spellPut("kai", -16470);
+		spellPut("kan", -16465);
+		spellPut("kang", -16459);
+		spellPut("kao", -16452);
+		spellPut("ke", -16448);
+		spellPut("ken", -16433);
+		spellPut("keng", -16429);
+		spellPut("kong", -16427);
+		spellPut("kou", -16423);
+		spellPut("ku", -16419);
+		spellPut("kua", -16412);
+		spellPut("kuai", -16407);
+		spellPut("kuan", -16403);
+		spellPut("kuang", -16401);
+		spellPut("kui", -16393);
+		spellPut("kun", -16220);
+		spellPut("kuo", -16216);
+		spellPut("la", -16212);
+		spellPut("lai", -16205);
+		spellPut("lan", -16202);
+		spellPut("lang", -16187);
+		spellPut("lao", -16180);
+		spellPut("le", -16171);
+		spellPut("lei", -16169);
+		spellPut("leng", -16158);
+		spellPut("li", -16155);
+		spellPut("lia", -15959);
+		spellPut("lian", -15958);
+		spellPut("liang", -15944);
+		spellPut("liao", -15933);
+		spellPut("lie", -15920);
+		spellPut("lin", -15915);
+		spellPut("ling", -15903);
+		spellPut("liu", -15889);
+		spellPut("long", -15878);
+		spellPut("lou", -15707);
+		spellPut("lu", -15701);
+		spellPut("lv", -15681);
+		spellPut("luan", -15667);
+		spellPut("lue", -15661);
+		spellPut("lun", -15659);
+		spellPut("luo", -15652);
+		spellPut("ma", -15640);
+		spellPut("mai", -15631);
+		spellPut("man", -15625);
+		spellPut("mang", -15454);
+		spellPut("mao", -15448);
+		spellPut("me", -15436);
+		spellPut("mei", -15435);
+		spellPut("men", -15419);
+		spellPut("meng", -15416);
+		spellPut("mi", -15408);
+		spellPut("mian", -15394);
+		spellPut("miao", -15385);
+		spellPut("mie", -15377);
+		spellPut("min", -15375);
+		spellPut("ming", -15369);
+		spellPut("miu", -15363);
+		spellPut("mo", -15362);
+		spellPut("mou", -15183);
+		spellPut("mu", -15180);
+		spellPut("na", -15165);
+		spellPut("nai", -15158);
+		spellPut("nan", -15153);
+		spellPut("nang", -15150);
+		spellPut("nao", -15149);
+		spellPut("ne", -15144);
+		spellPut("nei", -15143);
+		spellPut("nen", -15141);
+		spellPut("neng", -15140);
+		spellPut("ni", -15139);
+		spellPut("nian", -15128);
+		spellPut("niang", -15121);
+		spellPut("niao", -15119);
+		spellPut("nie", -15117);
+		spellPut("nin", -15110);
+		spellPut("ning", -15109);
+		spellPut("niu", -14941);
+		spellPut("nong", -14937);
+		spellPut("nu", -14933);
+		spellPut("nv", -14930);
+		spellPut("nuan", -14929);
+		spellPut("nue", -14928);
+		spellPut("nuo", -14926);
+		spellPut("o", -14922);
+		spellPut("ou", -14921);
+		spellPut("pa", -14914);
+		spellPut("pai", -14908);
+		spellPut("pan", -14902);
+		spellPut("pang", -14894);
+		spellPut("pao", -14889);
+		spellPut("pei", -14882);
+		spellPut("pen", -14873);
+		spellPut("peng", -14871);
+		spellPut("pi", -14857);
+		spellPut("pian", -14678);
+		spellPut("piao", -14674);
+		spellPut("pie", -14670);
+		spellPut("pin", -14668);
+		spellPut("ping", -14663);
+		spellPut("po", -14654);
+		spellPut("pu", -14645);
+		spellPut("qi", -14630);
+		spellPut("qia", -14594);
+		spellPut("qian", -14429);
+		spellPut("qiang", -14407);
+		spellPut("qiao", -14399);
+		spellPut("qie", -14384);
+		spellPut("qin", -14379);
+		spellPut("qing", -14368);
+		spellPut("qiong", -14355);
+		spellPut("qiu", -14353);
+		spellPut("qu", -14345);
+		spellPut("quan", -14170);
+		spellPut("que", -14159);
+		spellPut("qun", -14151);
+		spellPut("ran", -14149);
+		spellPut("rang", -14145);
+		spellPut("rao", -14140);
+		spellPut("re", -14137);
+		spellPut("ren", -14135);
+		spellPut("reng", -14125);
+		spellPut("ri", -14123);
+		spellPut("rong", -14122);
+		spellPut("rou", -14112);
+		spellPut("ru", -14109);
+		spellPut("ruan", -14099);
+		spellPut("rui", -14097);
+		spellPut("run", -14094);
+		spellPut("ruo", -14092);
+		spellPut("sa", -14090);
+		spellPut("sai", -14087);
+		spellPut("san", -14083);
+		spellPut("sang", -13917);
+		spellPut("sao", -13914);
+		spellPut("se", -13910);
+		spellPut("sen", -13907);
+		spellPut("seng", -13906);
+		spellPut("sha", -13905);
+		spellPut("shai", -13896);
+		spellPut("shan", -13894);
+		spellPut("shang", -13878);
+		spellPut("shao", -13870);
+		spellPut("she", -13859);
+		spellPut("shen", -13847);
+		spellPut("sheng", -13831);
+		spellPut("shi", -13658);
+		spellPut("shou", -13611);
+		spellPut("shu", -13601);
+		spellPut("shua", -13406);
+		spellPut("shuai", -13404);
+		spellPut("shuan", -13400);
+		spellPut("shuang", -13398);
+		spellPut("shui", -13395);
+		spellPut("shun", -13391);
+		spellPut("shuo", -13387);
+		spellPut("si", -13383);
+		spellPut("song", -13367);
+		spellPut("sou", -13359);
+		spellPut("su", -13356);
+		spellPut("suan", -13343);
+		spellPut("sui", -13340);
+		spellPut("sun", -13329);
+		spellPut("suo", -13326);
+		spellPut("ta", -13318);
+		spellPut("tai", -13147);
+		spellPut("tan", -13138);
+		spellPut("tang", -13120);
+		spellPut("tao", -13107);
+		spellPut("te", -13096);
+		spellPut("teng", -13095);
+		spellPut("ti", -13091);
+		spellPut("tian", -13076);
+		spellPut("tiao", -13068);
+		spellPut("tie", -13063);
+		spellPut("ting", -13060);
+		spellPut("tong", -12888);
+		spellPut("tou", -12875);
+		spellPut("tu", -12871);
+		spellPut("tuan", -12860);
+		spellPut("tui", -12858);
+		spellPut("tun", -12852);
+		spellPut("tuo", -12849);
+		spellPut("wa", -12838);
+		spellPut("wai", -12831);
+		spellPut("wan", -12829);
+		spellPut("wang", -12812);
+		spellPut("wei", -12802);
+		spellPut("wen", -12607);
+		spellPut("weng", -12597);
+		spellPut("wo", -12594);
+		spellPut("wu", -12585);
+		spellPut("xi", -12556);
+		spellPut("xia", -12359);
+		spellPut("xian", -12346);
+		spellPut("xiang", -12320);
+		spellPut("xiao", -12300);
+		spellPut("xie", -12120);
+		spellPut("xin", -12099);
+		spellPut("xing", -12089);
+		spellPut("xiong", -12074);
+		spellPut("xiu", -12067);
+		spellPut("xu", -12058);
+		spellPut("xuan", -12039);
+		spellPut("xue", -11867);
+		spellPut("xun", -11861);
+		spellPut("ya", -11847);
+		spellPut("yan", -11831);
+		spellPut("yang", -11798);
+		spellPut("yao", -11781);
+		spellPut("ye", -11604);
+		spellPut("yi", -11589);
+		spellPut("yin", -11536);
+		spellPut("ying", -11358);
+		spellPut("yo", -11340);
+		spellPut("yong", -11339);
+		spellPut("you", -11324);
+		spellPut("yu", -11303);
+		spellPut("yuan", -11097);
+		spellPut("yue", -11077);
+		spellPut("yun", -11067);
+		spellPut("za", -11055);
+		spellPut("zai", -11052);
+		spellPut("zan", -11045);
+		spellPut("zang", -11041);
+		spellPut("zao", -11038);
+		spellPut("ze", -11024);
+		spellPut("zei", -11020);
+		spellPut("zen", -11019);
+		spellPut("zeng", -11018);
+		spellPut("zha", -11014);
+		spellPut("zhai", -10838);
+		spellPut("zhan", -10832);
+		spellPut("zhang", -10815);
+		spellPut("zhao", -10800);
+		spellPut("zhe", -10790);
+		spellPut("zhen", -10780);
+		spellPut("zheng", -10764);
+		spellPut("zhi", -10587);
+		spellPut("zhong", -10544);
+		spellPut("zhou", -10533);
+		spellPut("zhu", -10519);
+		spellPut("zhua", -10331);
+		spellPut("zhuai", -10329);
+		spellPut("zhuan", -10328);
+		spellPut("zhuang", -10322);
+		spellPut("zhui", -10315);
+		spellPut("zhun", -10309);
+		spellPut("zhuo", -10307);
+		spellPut("zi", -10296);
+		spellPut("zong", -10281);
+		spellPut("zou", -10274);
+		spellPut("zu", -10270);
+		spellPut("zuan", -10262);
+		spellPut("zui", -10260);
+		spellPut("zun", -10256);
+		spellPut("zuo", -10254);
+	}
+
+	/**
+	 * 获得单个汉字的Ascii.
+	 * 
+	 * @param cn 
+	 * char 汉字字符
+	 * @return int 错误返回 0,否则返回ascii
+	 */
+	public static int getCnAscii(char cn) {
+		byte[] bytes = (String.valueOf(cn)).getBytes();
+		if (bytes == null || bytes.length > 2 || bytes.length <= 0) { // 错误
+			return 0;
+		}
+		if (bytes.length == 1) { // 英文字符
+			return bytes[0];
+		}
+		if (bytes.length == 2) { // 中文字符
+			int hightByte = 256 + bytes[0];
+			int lowByte = 256 + bytes[1];
+			int ascii = (256 * hightByte + lowByte) - 256 * 256;
+			// System.out.println("ASCII=" + ascii);
+			return ascii;
+		}
+		return 0; // 错误
+	}
+
+	/**
+	 * 根据ASCII码到SpellMap中查找对应的拼音
+	 * 
+	 * @param ascii int 字符对应的ASCII
+	 * @return String 拼音,首先判断ASCII是否>0&<160,如果是返回对应的字符,
+	 * 
+	 * 否则到SpellMap中查找,如果没有找到拼音,则返回null,如果找到则返回拼音.
+	 */
+	public static String getSpellByAscii(int ascii) {
+		if (ascii > 0 && ascii < 160) { // 单字符
+			return String.valueOf((char) ascii);
+		}
+		if (ascii < -20319 || ascii > -10247) { // 不知道的字符
+			return null;
+		}
+		Set keySet = spellMap.keySet();
+		Iterator it = keySet.iterator();
+		String spell0 = null;
+		;
+		String spell = null;
+		int asciiRang0 = -20319;
+		int asciiRang;
+		while (it.hasNext()) {
+			spell = (String) it.next();
+			Object valObj = spellMap.get(spell);
+			if (valObj instanceof Integer) {
+				asciiRang = ((Integer) valObj).intValue();
+				if (ascii >= asciiRang0 && ascii < asciiRang) { // 区间找到
+					return (spell0 == null) ? spell : spell0;
+				} else {
+					spell0 = spell;
+					asciiRang0 = asciiRang;
+				}
+			}
+		}
+		return null;
+	}
+
+	/**
+	 * 返回字符串的全拼,是汉字转化为全拼,其它字符不进行转换
+	 * 
+	 * @param cnStr String 字符串
+	 * @return String 转换成全拼后的字符串
+	 */
+	public static String getFullSpell(String cnStr) {
+		if (null == cnStr || "".equals(cnStr.trim())) {
+			return cnStr;
+		}
+		char[] chars = cnStr.toCharArray();
+		StringBuffer retuBuf = new StringBuffer();
+		for (int i = 0, Len = chars.length; i < Len; i++) {
+			int ascii = getCnAscii(chars[i]);
+			if (ascii == 0) { //取ascii时出错
+				retuBuf.append(chars[i]);
+			} else {
+				String spell = getSpellByAscii(ascii);
+				if (spell == null) {
+					retuBuf.append(chars[i]);
+				} else {
+					retuBuf.append(spell);
+					retuBuf.append(" ");
+					System.out.println(i);
+				} // end of if spell == null
+			} // end of if ascii <= -20400
+		} // end of for
+		return retuBuf.toString();
+	}
+
+	public static String getFirstSpell(String cnStr) {
+		return null;
+	}
+
+	public static void main(String[] args) {
+		String str = null;
+		str = "谢海101普降喜雨";
+		System.out.println("Spell=" + CnToSpell.getFullSpell(str));
+		str = "张牙舞爪》。,";
+		System.out.println("Spell=" + CnToSpell.getFullSpell(str));
+		str = "擦亮眼睛,可耻下场。";
+		System.out.println("Spell=" + CnToSpell.getFullSpell(str));
+		str = "猪油,猪八戒。";
+		System.out.println("Spell=" + CnToSpell.getFullSpell(str));
+		str = "乔补来";
+		System.out.println("Spell=" + CnToSpell.getFullSpell(str));
+		str = "qiao bu lai";
+		System.out.println("Spell=" + CnToSpell.getFullSpell(str));
+	}
+}

+ 104 - 0
src/com/acc/util/common/DESEncryptUtil.java

@@ -0,0 +1,104 @@
+package com.acc.util.common;
+
+import java.security.Key;
+import java.security.Security;
+import javax.crypto.Cipher;
+import javax.crypto.spec.SecretKeySpec;
+
+import org.apache.commons.codec.binary.Base64;
+
+public class DESEncryptUtil
+{
+	public static Key getBlowfishKey(byte[] desEncode)
+	{
+		Security.insertProviderAt(new com.sun.crypto.provider.SunJCE(), 1);
+		SecretKeySpec destmp = new SecretKeySpec(desEncode, "Blowfish");
+		Key key = destmp;
+		return key;
+	}
+
+	/**
+	 * ??????????????????????м???
+	 * 
+	 * @param key ???
+	 * @param data ???????????
+	 * 
+	 * @return byte[] ?????????
+	 * @throws util.EncryptException
+	 */
+	public static byte[] doEncrypt(Key key, byte[] data) throws Exception
+	{
+		try
+		{
+			Cipher cipher = Cipher.getInstance("Blowfish");
+			cipher.init(Cipher.ENCRYPT_MODE, key);
+			byte[] raw = cipher.doFinal(data);
+			return raw;
+		}
+		catch (Exception e)
+		{
+			e.printStackTrace();
+			throw new Exception("Do encrypt occurs Exception.[" + e.getMessage() + "]");
+		}
+	}
+
+	/**
+	 * ????????????????????????????н???
+	 * 
+	 * @param key ???
+	 * @param raw ?????????
+	 * @return byte[] ?????????
+	 * @throws util.EncryptException
+	 */
+	public static byte[] doDecrypt(Key key, byte[] raw) throws Exception
+	{
+		try
+		{
+			Cipher cipher = Cipher.getInstance("Blowfish");
+			cipher.init(Cipher.DECRYPT_MODE, key);
+			byte[] data = cipher.doFinal(raw);
+			return data;
+		}
+		catch (Exception e)
+		{
+			e.printStackTrace();
+			throw new Exception("Do decrypt occurs Exception.[" + e.getMessage() + "]");
+		}
+	}
+
+	public static String encodingString(String all)
+	{
+		String code = "Y$fS*McvS5";
+		try
+		{
+			Key key = getBlowfishKey(code.getBytes());
+			byte[] raw = all.getBytes("UTF-8");
+			raw = DESEncryptUtil.doEncrypt(key, raw);
+			all = new String(Base64.encodeBase64(raw), "UTF-8");
+			return all;
+		}
+		catch (Exception e)
+		{
+			e.printStackTrace(System.out);
+		}
+		return "";
+	}
+
+	public static String decodingString(String all)
+	{
+		String code = "Y$fS*McvS5";
+		try
+		{
+			Key key = getBlowfishKey(code.getBytes());
+			byte[] raw = Base64.decodeBase64(all.getBytes("UTF-8"));
+			raw = doDecrypt(key, raw);
+			return new String(raw, "UTF-8");
+		}
+		catch (Exception e)
+		{
+			e.printStackTrace(System.out);
+		}
+		return "";
+	}
+
+}

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 1787 - 0
src/com/acc/util/common/DateUtil.java


+ 0 - 0
src/com/acc/util/common/ExceptionUtil.java


Vissa filer visades inte eftersom för många filer har ändrats