Browse Source

first commit

fenghanchao 3 years ago
commit
8ed3156182
100 changed files with 1152039 additions and 0 deletions
  1. 298 0
      .gitignore
  2. 5 0
      .svn/dir-prop-base
  3. 1227 0
      .svn/entries
  4. 36 0
      .svn/text-base/.classpath.svn-base
  5. 23 0
      .svn/text-base/.project.svn-base
  6. 161 0
      .svn/text-base/buildinglist.csv.svn-base
  7. 167 0
      .svn/text-base/buildinglist.json.svn-base
  8. 161 0
      .svn/text-base/buildinglist2.csv.svn-base
  9. 5 0
      .svn/text-base/buildinglistgld.json.svn-base
  10. 33 0
      .svn/text-base/config.json.svn-base
  11. 27 0
      .svn/text-base/def_buildingcomputetime.json.svn-base
  12. 45 0
      .svn/text-base/def_computedetail.json.svn-base
  13. 50 0
      .svn/text-base/def_computedetail1.json.svn-base
  14. 62 0
      .svn/text-base/def_computedetail2.json.svn-base
  15. 38 0
      .svn/text-base/def_computelog.json.svn-base
  16. 48 0
      .svn/text-base/def_computelog1.json.svn-base
  17. 43 0
      .svn/text-base/def_computelog2.json.svn-base
  18. 44 0
      .svn/text-base/def_metercomputetime.json.svn-base
  19. 51 0
      .svn/text-base/def_near.json.svn-base
  20. 51 0
      .svn/text-base/def_near1.json.svn-base
  21. 51 0
      .svn/text-base/def_near2.json.svn-base
  22. 39 0
      .svn/text-base/def_pointlist.json.svn-base
  23. 57 0
      .svn/text-base/def_rate.json.svn-base
  24. 51 0
      .svn/text-base/def_service.json.svn-base
  25. 50 0
      .svn/text-base/def_servicecomputedetail.json.svn-base
  26. 54 0
      .svn/text-base/def_servicecomputelog.json.svn-base
  27. 76 0
      .svn/text-base/def_static.json.svn-base
  28. 34 0
      .svn/text-base/hbase-site.xml.svn-base
  29. 17 0
      .svn/text-base/log4j.properties.svn-base
  30. 3571 0
      .svn/text-base/pointlist.csv.svn-base
  31. 10 0
      .svn/text-base/pointlist.json.svn-base
  32. 557182 0
      .svn/text-base/pointlist2.csv.svn-base
  33. 5176 0
      .svn/text-base/pointlist2.json.svn-base
  34. 557182 0
      .svn/text-base/pointlist3.csv.svn-base
  35. 10 0
      .svn/text-base/pointlist3.json.svn-base
  36. 5173 0
      .svn/text-base/pointlistgld.csv.svn-base
  37. 5177 0
      .svn/text-base/pointlistgld.json.svn-base
  38. 169 0
      .svn/text-base/pom.xml.svn-base
  39. 42 0
      config-1101080001-1/port1.xml
  40. 35 0
      config-1101080001-1/port2.xml
  41. 11 0
      config-1101080001-1/port3.xml
  42. 52 0
      config-1101080001-1/port4.xml
  43. 52 0
      config.json
  44. BIN
      config.xls
  45. 52 0
      config2.json
  46. BIN
      configbak.xls
  47. 34 0
      hbase-site.xml
  48. 17 0
      log4j.properties
  49. BIN
      pointlistadd.xls
  50. 173 0
      pom.xml
  51. 5 0
      src/.svn/dir-prop-base
  52. 34 0
      src/.svn/entries
  53. 5 0
      src/main/.svn/dir-prop-base
  54. 34 0
      src/main/.svn/entries
  55. 5 0
      src/main/java/.svn/dir-prop-base
  56. 235 0
      src/main/java/.svn/entries
  57. 37 0
      src/main/java/.svn/text-base/SS.java.svn-base
  58. 20 0
      src/main/java/.svn/text-base/TDD.java.svn-base
  59. 43 0
      src/main/java/.svn/text-base/TestCSV.java.svn-base
  60. 56 0
      src/main/java/.svn/text-base/TestInsert.java.svn-base
  61. 116 0
      src/main/java/.svn/text-base/TestPointList.java.svn-base
  62. 63 0
      src/main/java/.svn/text-base/TestResetCompute.java.svn-base
  63. 6 0
      src/main/java/com/saga/entity/Data.java
  64. 5 0
      src/main/java/com/saga/entity/Device.java
  65. 7 0
      src/main/java/com/saga/entity/EntityHbase.java
  66. 11 0
      src/main/java/com/saga/entity/EntityMysql.java
  67. 20 0
      src/main/java/com/saga/entity/EntityPoint.java
  68. 5 0
      src/main/java/com/saga/entity/Function.java
  69. 11 0
      src/main/java/com/saga/entity/Point.java
  70. 20 0
      src/main/java/com/saga/entity/PointSet.java
  71. 13 0
      src/main/java/com/saga/entity/Record.java
  72. 13 0
      src/main/java/com/saga/entity/RecordMsg.java
  73. 8 0
      src/main/java/com/saga/entity/Report.java
  74. 10 0
      src/main/java/com/saga/entity/Server.java
  75. 16 0
      src/main/java/com/saga/entity/Transfer.java
  76. 720 0
      src/main/java/com/saga/main/Main.java
  77. 316 0
      src/main/java/com/saga/test/ShenQI.java
  78. 85 0
      src/main/java/com/saga/test/Simulator.java
  79. 222 0
      src/main/java/com/saga/test/Sunyifu.java
  80. 672 0
      src/main/java/com/saga/test/Test.java
  81. 893 0
      src/main/java/com/saga/thread/common/CheckThread.java
  82. 833 0
      src/main/java/com/saga/thread/common/LoadConfigThread.java
  83. 457 0
      src/main/java/com/saga/thread/common/SaveThread.java
  84. 103 0
      src/main/java/com/saga/thread/common/StatsThread.java
  85. 63 0
      src/main/java/com/saga/thread/common/WTDBThread.java
  86. 1525 0
      src/main/java/com/saga/thread/down/DownThread.java
  87. 214 0
      src/main/java/com/saga/thread/up/TransferThread.java
  88. 791 0
      src/main/java/com/saga/thread/up/UpThread.java
  89. 271 0
      src/main/java/com/saga/tool/ImportPoints.java
  90. 1735 0
      src/main/java/com/saga/util/Constant.java
  91. 106 0
      src/main/java/com/saga/util/ExcelUtil.java
  92. 2613 0
      src/main/java/com/saga/util/HBaseUtil.java
  93. 1674 0
      src/main/java/com/saga/util/MySQLUtil.java
  94. 5 0
      src/main/resources/.svn/dir-prop-base
  95. 640 0
      src/main/resources/.svn/entries
  96. 27 0
      src/main/resources/.svn/text-base/def_buildingcomputetime.json.svn-base
  97. 47 0
      src/main/resources/.svn/text-base/def_computedetail.json.svn-base
  98. 51 0
      src/main/resources/.svn/text-base/def_computedetail1.json.svn-base
  99. 56 0
      src/main/resources/.svn/text-base/def_computedetail2.json.svn-base
  100. 0 0
      src/main/resources/.svn/text-base/def_computelog.json.svn-base

+ 298 - 0
.gitignore

@@ -0,0 +1,298 @@
+
+# Created by https://www.gitignore.io/api/git,java,maven,macos,linux,windows,eclipse,netbeans,java-web,code-java,intellij+all
+# Edit at https://www.gitignore.io/?templates=git,java,maven,macos,linux,windows,eclipse,netbeans,java-web,code-java,intellij+all
+
+### Code-Java ###
+# Language Support for Java(TM) by Red Hat extension for Visual Studio Code - https://marketplace.visualstudio.com/items?itemName=redhat.java
+
+.project
+.classpath
+factoryConfiguration.json
+
+### Eclipse ###
+.metadata
+bin/
+tmp/
+*.tmp
+*.bak
+*.swp
+*~.nib
+local.properties
+.settings/
+.loadpath
+.recommenders
+
+# External tool builders
+.externalToolBuilders/
+
+# Locally stored "Eclipse launch configurations"
+*.launch
+
+# PyDev specific (Python IDE for Eclipse)
+*.pydevproject
+
+# CDT-specific (C/C++ Development Tooling)
+.cproject
+
+# CDT- autotools
+.autotools
+
+# Java annotation processor (APT)
+.factorypath
+
+# PDT-specific (PHP Development Tools)
+.buildpath
+
+# sbteclipse plugin
+.target
+
+# Tern plugin
+.tern-project
+
+# TeXlipse plugin
+.texlipse
+
+# STS (Spring Tool Suite)
+.springBeans
+
+# Code Recommenders
+.recommenders/
+
+# Annotation Processing
+.apt_generated/
+
+# Scala IDE specific (Scala & Java development for Eclipse)
+.cache-main
+.scala_dependencies
+.worksheet
+
+### Eclipse Patch ###
+# Eclipse Core
+
+# JDT-specific (Eclipse Java Development Tools)
+
+# Annotation Processing
+.apt_generated
+
+.sts4-cache/
+
+### Git ###
+# Created by git for backups. To disable backups in Git:
+# $ git config --global mergetool.keepBackup false
+*.orig
+
+# Created by git when using merge tools for conflicts
+*.BACKUP.*
+*.BASE.*
+*.LOCAL.*
+*.REMOTE.*
+*_BACKUP_*.txt
+*_BASE_*.txt
+*_LOCAL_*.txt
+*_REMOTE_*.txt
+
+### Intellij+all ###
+# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm
+# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
+
+# User-specific stuff
+.idea/**/workspace.xml
+.idea/**/tasks.xml
+.idea/**/usage.statistics.xml
+.idea/**/dictionaries
+.idea/**/shelf
+
+# Generated files
+.idea/**/contentModel.xml
+
+# Sensitive or high-churn files
+.idea/**/dataSources/
+.idea/**/dataSources.ids
+.idea/**/dataSources.local.xml
+.idea/**/sqlDataSources.xml
+.idea/**/dynamic.xml
+.idea/**/uiDesigner.xml
+.idea/**/dbnavigator.xml
+
+# Gradle
+.idea/**/gradle.xml
+.idea/**/libraries
+
+# Gradle and Maven with auto-import
+# When using Gradle or Maven with auto-import, you should exclude module files,
+# since they will be recreated, and may cause churn.  Uncomment if using
+# auto-import.
+# .idea/modules.xml
+# .idea/*.iml
+# .idea/modules
+
+# CMake
+cmake-build-*/
+
+# Mongo Explorer plugin
+.idea/**/mongoSettings.xml
+
+# File-based project format
+*.iws
+
+# IntelliJ
+out/
+
+# mpeltonen/sbt-idea plugin
+.idea_modules/
+
+# JIRA plugin
+atlassian-ide-plugin.xml
+
+# Cursive Clojure plugin
+.idea/replstate.xml
+
+# Crashlytics plugin (for Android Studio and IntelliJ)
+com_crashlytics_export_strings.xml
+crashlytics.properties
+crashlytics-build.properties
+fabric.properties
+
+# Editor-based Rest Client
+.idea/httpRequests
+
+# Android studio 3.1+ serialized cache file
+.idea/caches/build_file_checksums.ser
+
+### Intellij+all Patch ###
+# Ignores the whole .idea folder and all .iml files
+# See https://github.com/joeblau/gitignore.io/issues/186 and https://github.com/joeblau/gitignore.io/issues/360
+
+.idea/
+
+# Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-249601023
+
+*.iml
+modules.xml
+.idea/misc.xml
+*.ipr
+
+# Sonarlint plugin
+.idea/sonarlint
+
+### Java ###
+# Compiled class file
+*.class
+
+# Log file
+*.log
+
+# BlueJ files
+*.ctxt
+
+# Mobile Tools for Java (J2ME)
+.mtj.tmp/
+
+# Package Files #
+*.jar
+*.war
+*.nar
+*.ear
+*.zip
+*.tar.gz
+*.rar
+
+# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
+hs_err_pid*
+
+### Java-Web ###
+## ignoring target file
+target/
+
+### Linux ###
+*~
+
+# temporary files which can be created if a process still has a handle open of a deleted file
+.fuse_hidden*
+
+# KDE directory preferences
+.directory
+
+# Linux trash folder which might appear on any partition or disk
+.Trash-*
+
+# .nfs files are created when an open file is removed but is still being accessed
+.nfs*
+
+### macOS ###
+# General
+.DS_Store
+.AppleDouble
+.LSOverride
+
+# Icon must end with two \r
+Icon
+
+# Thumbnails
+._*
+
+# Files that might appear in the root of a volume
+.DocumentRevisions-V100
+.fseventsd
+.Spotlight-V100
+.TemporaryItems
+.Trashes
+.VolumeIcon.icns
+.com.apple.timemachine.donotpresent
+
+# Directories potentially created on remote AFP share
+.AppleDB
+.AppleDesktop
+Network Trash Folder
+Temporary Items
+.apdisk
+
+### Maven ###
+pom.xml.tag
+pom.xml.releaseBackup
+pom.xml.versionsBackup
+pom.xml.next
+release.properties
+dependency-reduced-pom.xml
+buildNumber.properties
+.mvn/timing.properties
+.mvn/wrapper/maven-wrapper.jar
+
+### NetBeans ###
+**/nbproject/private/
+**/nbproject/Makefile-*.mk
+**/nbproject/Package-*.bash
+build/
+nbbuild/
+dist/
+nbdist/
+.nb-gradle/
+
+### Windows ###
+# Windows thumbnail cache files
+Thumbs.db
+ehthumbs.db
+ehthumbs_vista.db
+
+# Dump file
+*.stackdump
+
+# Folder config file
+[Dd]esktop.ini
+
+# Recycle Bin used on file shares
+$RECYCLE.BIN/
+
+# Windows Installer files
+*.cab
+*.msi
+*.msix
+*.msm
+*.msp
+
+# Windows shortcuts
+*.lnk
+
+# End of https://www.gitignore.io/api/git,java,maven,macos,linux,windows,eclipse,netbeans,java-web,code-java,intellij+all
+
+*.yml

+ 5 - 0
.svn/dir-prop-base

@@ -0,0 +1,5 @@
+K 14
+bugtraq:number
+V 4
+true
+END

File diff suppressed because it is too large
+ 1227 - 0
.svn/entries


+ 36 - 0
.svn/text-base/.classpath.svn-base

@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="src" output="target/classes" path="src/main/java">
+		<attributes>
+			<attribute name="optional" value="true"/>
+			<attribute name="maven.pomderived" value="true"/>
+		</attributes>
+	</classpathentry>
+	<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
+		<attributes>
+			<attribute name="maven.pomderived" value="true"/>
+		</attributes>
+	</classpathentry>
+	<classpathentry kind="src" output="target/test-classes" path="src/test/java">
+		<attributes>
+			<attribute name="optional" value="true"/>
+			<attribute name="maven.pomderived" value="true"/>
+		</attributes>
+	</classpathentry>
+	<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
+		<attributes>
+			<attribute name="maven.pomderived" value="true"/>
+		</attributes>
+	</classpathentry>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
+		<attributes>
+			<attribute name="maven.pomderived" value="true"/>
+		</attributes>
+	</classpathentry>
+	<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
+		<attributes>
+			<attribute name="maven.pomderived" value="true"/>
+		</attributes>
+	</classpathentry>
+	<classpathentry kind="output" path="target/classes"/>
+</classpath>

+ 23 - 0
.svn/text-base/.project.svn-base

@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>compute-fjd</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.m2e.core.maven2Builder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+		<nature>org.eclipse.m2e.core.maven2Nature</nature>
+	</natures>
+</projectDescription>

+ 161 - 0
.svn/text-base/buildinglist.csv.svn-base

@@ -0,0 +1,161 @@
+2301030001,2016-05-01 00:00:00
+2306020001,2012-08-01 00:00:00
+2308010001,2015-10-01 00:00:00
+2303000001,2016-08-01 00:00:00
+2310000001,2016-08-01 00:00:00
+2101020001,2016-09-01 00:00:00
+2101060002,2015-12-01 00:00:00
+2101060001,2013-05-01 00:00:00
+2101120001,2014-01-01 00:00:00
+2108040001,2017-03-01 00:00:00
+2106030001,2013-12-01 00:00:00
+2111030001,2016-12-01 00:00:00
+2113020001,2017-03-01 00:00:00
+2102110001,2014-01-01 00:00:00
+2102130001,2015-09-01 00:00:00
+2201030001,2014-03-01 00:00:00
+2203030001,2016-08-01 00:00:00
+2224010001,2017-12-01 00:00:00
+1502040001,2015-08-01 00:00:00
+1504020001,2017-01-01 00:00:00
+1507810001,2017-02-01 00:00:00
+1600000001,2016-08-01 00:00:00
+1505020001,2016-09-01 00:00:00
+1101050001,2015-08-01 00:00:00
+1101070037,2011-01-01 00:00:00
+1101060002,2017-02-01 00:00:00
+1101060001,2017-02-01 00:00:00
+1310030001,2012-05-01 00:00:00
+1301080001,2012-08-01 00:00:00
+1201020001,2015-01-01 00:00:00
+1302020001,2012-08-01 00:00:00
+1401070001,2015-09-01 00:00:00
+3701030002,2016-07-01 00:00:00
+3701020001,2016-11-01 00:00:00
+2710000009,2015-08-01 00:00:00
+3714020001,2015-12-01 00:00:00
+3723010000,2017-03-01 00:00:00
+3708011001,2014-10-01 00:00:00
+3702030001,2011-01-01 00:00:00
+3702130001,2013-06-01 00:00:00
+3706020001,2015-02-01 00:00:00
+3706020002,2017-01-01 00:00:00
+3707010001,2015-02-01 00:00:00
+4101020001,2012-08-01 00:00:00
+4101030001,2013-06-01 00:00:00
+4101080001,2017-03-01 00:00:00
+4101040001,2017-03-01 00:00:00
+4201030001,2012-08-01 00:00:00
+4201050001,2012-08-01 00:00:00
+4201060001,2014-01-01 00:00:00
+4201060002,2014-01-01 00:00:00
+4202020001,2015-07-01 00:00:00
+4205000001,2017-04-01 00:00:00
+4208040001,2016-06-01 00:00:00
+4203000001,2016-08-01 00:00:00
+3401110000,2016-02-01 00:00:00
+3401040001,2013-06-01 00:00:00
+3401020001,2016-11-01 00:00:00
+3415000001,2017-04-01 00:00:00
+2360000001,2016-11-01 00:00:00
+3402020001,2013-06-01 00:00:00
+3403020001,2014-05-01 00:00:00
+3405040001,2014-10-01 00:00:00
+3413020001,2017-03-01 00:00:00
+3601060001,2013-06-01 00:00:00
+3609020001,2017-01-01 00:00:00
+3611000001,2017-03-01 00:00:00
+4301050001,2017-01-01 00:00:00
+4303040001,2016-09-01 00:00:00
+4307020001,2016-10-01 00:00:00
+6401060001,2012-08-01 00:00:00
+6401050001,2014-10-01 00:00:00
+6201020001,2014-10-01 00:00:00
+6301000001,2016-12-01 00:00:00
+6501000001,2016-12-01 00:00:00
+5101060001,2013-06-01 00:00:00
+6100660001,2016-07-01 00:00:00
+5101050001,2017-03-01 00:00:00
+5101220001,2017-04-01 00:00:00
+5107030001,2013-07-01 00:00:00
+5108020001,2015-07-01 00:00:00
+5106030001,2016-12-01 00:00:00
+5110110001,2015-08-01 00:00:00
+5120000001,2016-12-01 00:00:00
+5109030001,2016-12-01 00:00:00
+5111020001,2016-12-01 00:00:00
+6101121001,2014-11-01 00:00:00
+6101122001,2015-01-01 00:00:00
+6101120001,2014-04-01 00:00:00
+7140000001,2015-08-01 00:00:00
+4000600001,2011-02-01 00:00:00
+5001010001,2014-04-01 00:00:00
+5001130001,2015-12-01 00:00:00
+5001180001,2016-10-01 00:00:00
+6500000001,2015-04-01 00:00:00
+6661000001,2015-11-01 00:00:00
+4501030001,2015-01-01 00:00:00
+4503050001,2015-12-01 00:00:00
+4502040001,2017-01-01 00:00:00
+3501030001,2016-12-01 00:00:00
+3501040001,2012-07-01 00:00:00
+3501810001,2014-12-01 00:00:00
+3505030001,2013-05-01 00:00:00
+3503020001,2013-04-01 00:00:00
+3509010001,2013-06-01 00:00:00
+3650000001,2017-02-01 00:00:00
+3505820001,2013-06-01 00:00:00
+3502060001,2012-06-01 00:00:00
+3502110001,2013-10-01 00:00:00
+3506020001,2013-05-01 00:00:00
+3506810001,2017-02-01 00:00:00
+4401110001,2012-04-01 00:00:00
+4401830001,2014-06-01 00:00:00
+4401130001,2017-04-01 00:00:00
+4401120001,2015-07-01 00:00:00
+4401150001,2015-12-01 00:00:00
+4418020001,2017-05-01 00:00:00
+4406820001,2015-01-01 00:00:00
+4406070001,2017-01-01 00:00:00
+4407030001,2014-12-01 00:00:00
+5240000001,2016-08-01 00:00:00
+4601060001,2017-03-01 00:00:00
+4419000001,2014-02-01 00:00:00
+4419010002,2015-12-01 00:00:00
+4419010003,2017-01-01 00:00:00
+4414000001,2016-09-01 00:00:00
+3201050001,2011-01-01 00:00:00
+3201150001,2014-06-01 00:00:00
+3211020001,2012-08-01 00:00:00
+3208020001,2016-10-01 00:00:00
+3212020001,2012-08-01 00:00:00
+3203040001,2014-07-01 00:00:00
+3203120001,2017-04-01 00:00:00
+3207000001,2017-03-01 00:00:00
+2140000005,2015-07-01 00:00:00
+3202060001,2014-06-01 00:00:00
+3204110001,2012-08-01 00:00:00
+3204120001,2017-02-01 00:00:00
+3202810001,2013-06-01 00:00:00
+3202820001,2014-07-01 00:00:00
+3205850001,2013-06-01 00:00:00
+2016060001,2014-10-01 00:00:00
+3101140001,2012-08-01 00:00:00
+3101130001,2012-08-01 00:00:00
+3101170001,2014-08-01 00:00:00
+3101160001,2015-07-01 00:00:00
+3302120001,2014-12-01 00:00:00
+3302050001,2015-12-02 00:00:00
+3302810001,2014-03-01 00:00:00
+3307020001,2014-07-01 00:00:00
+3307820001,2016-12-01 00:00:00
+3303030001,2013-06-01 00:00:00
+3254010001,2014-12-01 00:00:00
+3310000001,2016-10-01 00:00:00
+3301050001,2015-02-01 00:00:00
+3306210001,2016-07-01 00:00:00
+3306820001,2017-01-01 00:00:00
+3305020001,2017-01-01 00:00:00
+4505030001,2017-06-01 00:00:00
+3205060001,2016-05-01 00:00:00
+1130000002,2016-01-04 00:00:00

+ 167 - 0
.svn/text-base/buildinglist.json.svn-base

@@ -0,0 +1,167 @@
+{
+"Buildings":[
+{"building":"2301030001","time":"2016-05-01 00:00:00"},
+{"building":"2306020001","time":"2012-08-01 00:00:00"},
+{"building":"2308010001","time":"2015-10-01 00:00:00"},
+{"building":"2303000001","time":"2016-08-01 00:00:00"},
+{"building":"2310000001","time":"2016-08-01 00:00:00"},
+{"building":"2101020001","time":"2016-09-01 00:00:00"},
+{"building":"2101060002","time":"2015-12-01 00:00:00"},
+{"building":"2101060001","time":"2013-05-01 00:00:00"},
+{"building":"2101120001","time":"2014-01-01 00:00:00"},
+{"building":"2108040001","time":"2017-03-01 00:00:00"},
+{"building":"2106030001","time":"2013-12-01 00:00:00"},
+{"building":"2111030001","time":"2016-12-01 00:00:00"},
+{"building":"2113020001","time":"2017-03-01 00:00:00"},
+{"building":"2102110001","time":"2014-01-01 00:00:00"},
+{"building":"2102130001","time":"2015-09-01 00:00:00"},
+{"building":"2201030001","time":"2014-03-01 00:00:00"},
+{"building":"2203030001","time":"2016-08-01 00:00:00"},
+{"building":"2224010001","time":"2017-12-01 00:00:00"},
+{"building":"1502040001","time":"2015-08-01 00:00:00"},
+{"building":"1504020001","time":"2017-01-01 00:00:00"},
+{"building":"1507810001","time":"2017-02-01 00:00:00"},
+{"building":"1600000001","time":"2016-08-01 00:00:00"},
+{"building":"1505020001","time":"2016-09-01 00:00:00"},
+{"building":"1101050001","time":"2015-08-01 00:00:00"},
+{"building":"1101070037","time":"2011-01-01 00:00:00"},
+{"building":"1101060002","time":"2017-02-01 00:00:00"},
+{"building":"1101060001","time":"2017-02-01 00:00:00"},
+{"building":"1310030001","time":"2012-05-01 00:00:00"},
+{"building":"1301080001","time":"2012-08-01 00:00:00"},
+{"building":"1201020001","time":"2015-01-01 00:00:00"},
+{"building":"1302020001","time":"2012-08-01 00:00:00"},
+{"building":"1401070001","time":"2015-09-01 00:00:00"},
+{"building":"3701030002","time":"2016-07-01 00:00:00"},
+{"building":"3701020001","time":"2016-11-01 00:00:00"},
+{"building":"2710000009","time":"2015-08-01 00:00:00"},
+{"building":"3714020001","time":"2015-12-01 00:00:00"},
+{"building":"3723010000","time":"2017-03-01 00:00:00"},
+{"building":"3708011001","time":"2014-10-01 00:00:00"},
+{"building":"3702030001","time":"2011-01-01 00:00:00"},
+{"building":"3702130001","time":"2013-06-01 00:00:00"},
+{"building":"3706020001","time":"2015-02-01 00:00:00"},
+{"building":"3706020002","time":"2017-01-01 00:00:00"},
+{"building":"3707010001","time":"2015-02-01 00:00:00"},
+{"building":"4101020001","time":"2012-08-01 00:00:00"},
+{"building":"4101030001","time":"2013-06-01 00:00:00"},
+{"building":"4101080001","time":"2017-03-01 00:00:00"},
+{"building":"4101040001","time":"2017-03-01 00:00:00"},
+{"building":"4201030001","time":"2012-08-01 00:00:00"},
+{"building":"4201050001","time":"2012-08-01 00:00:00"},
+{"building":"4201060001","time":"2014-01-01 00:00:00"},
+{"building":"4201060002","time":"2014-01-01 00:00:00"},
+{"building":"4202020001","time":"2015-07-01 00:00:00"},
+{"building":"4205000001","time":"2017-04-01 00:00:00"},
+{"building":"4208040001","time":"2016-06-01 00:00:00"},
+{"building":"4203000001","time":"2016-08-01 00:00:00"},
+{"building":"3401110000","time":"2016-02-01 00:00:00"},
+{"building":"3401040001","time":"2013-06-01 00:00:00"},
+{"building":"3401020001","time":"2016-11-01 00:00:00"},
+{"building":"3415000001","time":"2017-04-01 00:00:00"},
+{"building":"2360000001","time":"2016-11-01 00:00:00"},
+{"building":"3402020001","time":"2013-06-01 00:00:00"},
+{"building":"3403020001","time":"2014-05-01 00:00:00"},
+{"building":"3405040001","time":"2014-10-01 00:00:00"},
+{"building":"3413020001","time":"2017-03-01 00:00:00"},
+{"building":"3601060001","time":"2013-06-01 00:00:00"},
+{"building":"3609020001","time":"2017-01-01 00:00:00"},
+{"building":"3611000001","time":"2017-03-01 00:00:00"},
+
+{"building":"4301050001","time":"2017-01-01 00:00:00"},
+
+{"building":"4303040001","time":"2016-09-01 00:00:00"},
+{"building":"4307020001","time":"2016-10-01 00:00:00"},
+{"building":"6401060001","time":"2012-08-01 00:00:00"},
+{"building":"6401050001","time":"2014-10-01 00:00:00"},
+{"building":"6201020001","time":"2014-10-01 00:00:00"},
+{"building":"6301000001","time":"2016-12-01 00:00:00"},
+{"building":"6501000001","time":"2016-12-01 00:00:00"},
+{"building":"5101060001","time":"2013-06-01 00:00:00"},
+{"building":"6100660001","time":"2016-07-01 00:00:00"},
+{"building":"5101050001","time":"2017-03-01 00:00:00"},
+{"building":"5101220001","time":"2017-04-01 00:00:00"},
+{"building":"5107030001","time":"2013-07-01 00:00:00"},
+{"building":"5108020001","time":"2015-07-01 00:00:00"},
+{"building":"5106030001","time":"2016-12-01 00:00:00"},
+{"building":"5110110001","time":"2015-08-01 00:00:00"},
+{"building":"5120000001","time":"2016-12-01 00:00:00"},
+{"building":"5109030001","time":"2016-12-01 00:00:00"},
+{"building":"5111020001","time":"2016-12-01 00:00:00"},
+{"building":"6101121001","time":"2014-11-01 00:00:00"},
+{"building":"6101122001","time":"2015-01-01 00:00:00"},
+{"building":"6101120001","time":"2014-04-01 00:00:00"},
+{"building":"7140000001","time":"2015-08-01 00:00:00"},
+{"building":"4000600001","time":"2011-02-01 00:00:00"},
+{"building":"5001010001","time":"2014-04-01 00:00:00"},
+{"building":"5001130001","time":"2015-12-01 00:00:00"},
+{"building":"5001180001","time":"2016-10-01 00:00:00"},
+{"building":"6500000001","time":"2015-04-01 00:00:00"},
+{"building":"6661000001","time":"2015-11-01 00:00:00"},
+{"building":"4501030001","time":"2015-01-01 00:00:00"},
+{"building":"4503050001","time":"2015-12-01 00:00:00"},
+{"building":"4502040001","time":"2017-01-01 00:00:00"},
+{"building":"3501030001","time":"2016-12-01 00:00:00"},
+{"building":"3501040001","time":"2012-07-01 00:00:00"},
+{"building":"3501810001","time":"2014-12-01 00:00:00"},
+{"building":"3505030001","time":"2013-05-01 00:00:00"},
+{"building":"3503020001","time":"2013-04-01 00:00:00"},
+{"building":"3509010001","time":"2013-06-01 00:00:00"},
+{"building":"3650000001","time":"2017-02-01 00:00:00"},
+{"building":"3505820001","time":"2013-06-01 00:00:00"},
+{"building":"3502060001","time":"2012-06-01 00:00:00"},
+{"building":"3502110001","time":"2013-10-01 00:00:00"},
+{"building":"3506020001","time":"2013-05-01 00:00:00"},
+{"building":"3506810001","time":"2017-02-01 00:00:00"},
+{"building":"4401110001","time":"2012-04-01 00:00:00"},
+{"building":"4401830001","time":"2014-06-01 00:00:00"},
+{"building":"4401130001","time":"2017-04-01 00:00:00"},
+{"building":"4401120001","time":"2015-07-01 00:00:00"},
+{"building":"4401150001","time":"2015-12-01 00:00:00"},
+{"building":"4418020001","time":"2017-05-01 00:00:00"},
+{"building":"4406820001","time":"2015-01-01 00:00:00"},
+{"building":"4406070001","time":"2017-01-01 00:00:00"},
+{"building":"4407030001","time":"2014-12-01 00:00:00"},
+{"building":"5240000001","time":"2016-08-01 00:00:00"},
+{"building":"4601060001","time":"2017-03-01 00:00:00"},
+{"building":"4419000001","time":"2014-02-01 00:00:00"},
+{"building":"4419010002","time":"2015-12-01 00:00:00"},
+{"building":"4419010003","time":"2017-01-01 00:00:00"},
+{"building":"4414000001","time":"2016-09-01 00:00:00"},
+{"building":"3201050001","time":"2011-01-01 00:00:00"},
+{"building":"3201150001","time":"2014-06-01 00:00:00"},
+{"building":"3211020001","time":"2012-08-01 00:00:00"},
+{"building":"3208020001","time":"2016-10-01 00:00:00"},
+{"building":"3212020001","time":"2012-08-01 00:00:00"},
+{"building":"3203040001","time":"2014-07-01 00:00:00"},
+{"building":"3203120001","time":"2017-04-01 00:00:00"},
+{"building":"3207000001","time":"2017-03-01 00:00:00"},
+{"building":"2140000005","time":"2015-07-01 00:00:00"},
+{"building":"3202060001","time":"2014-06-01 00:00:00"},
+{"building":"3204110001","time":"2012-08-01 00:00:00"},
+{"building":"3204120001","time":"2017-02-01 00:00:00"},
+{"building":"3202810001","time":"2013-06-01 00:00:00"},
+{"building":"3202820001","time":"2014-07-01 00:00:00"},
+{"building":"3205850001","time":"2013-06-01 00:00:00"},
+{"building":"2016060001","time":"2014-10-01 00:00:00"},
+{"building":"3101140001","time":"2012-08-01 00:00:00"},
+{"building":"3101130001","time":"2012-08-01 00:00:00"},
+{"building":"3101170001","time":"2014-08-01 00:00:00"},
+{"building":"3101160001","time":"2015-07-01 00:00:00"},
+{"building":"3302120001","time":"2014-12-01 00:00:00"},
+{"building":"3302050001","time":"2015-12-02 00:00:00"},
+{"building":"3302810001","time":"2014-03-01 00:00:00"},
+{"building":"3307020001","time":"2014-07-01 00:00:00"},
+{"building":"3307820001","time":"2016-12-01 00:00:00"},
+{"building":"3303030001","time":"2013-06-01 00:00:00"},
+{"building":"3254010001","time":"2014-12-01 00:00:00"},
+{"building":"3310000001","time":"2016-10-01 00:00:00"},
+{"building":"3301050001","time":"2015-02-01 00:00:00"},
+{"building":"3306210001","time":"2016-07-01 00:00:00"},
+{"building":"3306820001","time":"2017-01-01 00:00:00"},
+{"building":"3305020001","time":"2017-01-01 00:00:00"},
+{"building":"4505030001","time":"2017-06-01 00:00:00"},
+{"building":"3205060001","time":"2016-05-01 00:00:00"},
+{"building":"1130000002","time":"2016-01-04 00:00:00"}
+]	
+}

+ 161 - 0
.svn/text-base/buildinglist2.csv.svn-base

@@ -0,0 +1,161 @@
+2301030001,2016-05-01 00:00:00
+2306020001,2012-08-01 00:00:00
+2308010001,2015-10-01 00:00:00
+2303000001,2016-08-01 00:00:00
+2310000001,2016-08-01 00:00:00
+2101020001,2016-09-01 00:00:00
+2101060002,2015-12-01 00:00:00
+2101060001,2013-05-01 00:00:00
+2101120001,2014-01-01 00:00:00
+2108040001,2017-03-01 00:00:00
+2106030001,2013-12-01 00:00:00
+2111030001,2016-12-01 00:00:00
+2113020001,2017-03-01 00:00:00
+2102110001,2014-01-01 00:00:00
+2102130001,2015-09-01 00:00:00
+2201030001,2014-03-01 00:00:00
+2203030001,2016-08-01 00:00:00
+2224010001,2017-12-01 00:00:00
+1502040001,2015-08-01 00:00:00
+1504020001,2017-01-01 00:00:00
+1507810001,2017-02-01 00:00:00
+1600000001,2016-08-01 00:00:00
+1505020001,2016-09-01 00:00:00
+1101050001,2015-08-01 00:00:00
+1101070037,2011-01-01 00:00:00
+1101060002,2017-02-01 00:00:00
+1101060001,2017-02-01 00:00:00
+1310030001,2012-05-01 00:00:00
+1301080001,2012-08-01 00:00:00
+1201020001,2015-01-01 00:00:00
+1302020001,2012-08-01 00:00:00
+1401070001,2015-09-01 00:00:00
+3701030002,2016-07-01 00:00:00
+3701020001,2016-11-01 00:00:00
+2710000009,2015-08-01 00:00:00
+3714020001,2015-12-01 00:00:00
+3723010000,2017-03-01 00:00:00
+3708011001,2014-10-01 00:00:00
+3702030001,2011-01-01 00:00:00
+3702130001,2013-06-01 00:00:00
+3706020001,2015-02-01 00:00:00
+3706020002,2017-01-01 00:00:00
+3707010001,2015-02-01 00:00:00
+4101020001,2012-08-01 00:00:00
+4101030001,2013-06-01 00:00:00
+4101080001,2017-03-01 00:00:00
+4101040001,2017-03-01 00:00:00
+4201030001,2012-08-01 00:00:00
+4201050001,2012-08-01 00:00:00
+4201060001,2014-01-01 00:00:00
+4201060002,2014-01-01 00:00:00
+4202020001,2015-07-01 00:00:00
+4205000001,2017-04-01 00:00:00
+4208040001,2016-06-01 00:00:00
+4203000001,2016-08-01 00:00:00
+3401110000,2016-02-01 00:00:00
+3401040001,2013-06-01 00:00:00
+3401020001,2016-11-01 00:00:00
+3415000001,2017-04-01 00:00:00
+2360000001,2016-11-01 00:00:00
+3402020001,2013-06-01 00:00:00
+3403020001,2014-05-01 00:00:00
+3405040001,2014-10-01 00:00:00
+3413020001,2017-03-01 00:00:00
+3601060001,2013-06-01 00:00:00
+3609020001,2017-01-01 00:00:00
+3611000001,2017-03-01 00:00:00
+4301050001,2014-03-01 00:00:00
+4303040001,2016-09-01 00:00:00
+4307020001,2016-10-01 00:00:00
+6401060001,2012-08-01 00:00:00
+6401050001,2014-10-01 00:00:00
+6201020001,2014-10-01 00:00:00
+6301000001,2016-12-01 00:00:00
+6501000001,2016-12-01 00:00:00
+5101060001,2013-06-01 00:00:00
+6100660001,2016-07-01 00:00:00
+5101050001,2017-03-01 00:00:00
+5101220001,2017-04-01 00:00:00
+5107030001,2013-07-01 00:00:00
+5108020001,2015-07-01 00:00:00
+5106030001,2016-12-01 00:00:00
+5110110001,2015-08-01 00:00:00
+5120000001,2016-12-01 00:00:00
+5109030001,2016-12-01 00:00:00
+5111020001,2016-12-01 00:00:00
+6101121001,2014-11-01 00:00:00
+6101122001,2015-01-01 00:00:00
+6101120001,2014-04-01 00:00:00
+7140000001,2015-08-01 00:00:00
+4000600001,2011-02-01 00:00:00
+5001010001,2014-04-01 00:00:00
+5001130001,2015-12-01 00:00:00
+5001180001,2016-10-01 00:00:00
+6500000001,2015-04-01 00:00:00
+6661000001,2015-11-01 00:00:00
+4501030001,2015-01-01 00:00:00
+4503050001,2015-12-01 00:00:00
+4502040001,2017-01-01 00:00:00
+3501030001,2016-12-01 00:00:00
+3501040001,2012-07-01 00:00:00
+3501810001,2014-12-01 00:00:00
+3505030001,2013-05-01 00:00:00
+3503020001,2013-04-01 00:00:00
+3509010001,2013-06-01 00:00:00
+3650000001,2017-02-01 00:00:00
+3505820001,2013-06-01 00:00:00
+3502060001,2012-06-01 00:00:00
+3502110001,2013-10-01 00:00:00
+3506020001,2013-05-01 00:00:00
+3506810001,2017-02-01 00:00:00
+4401110001,2012-04-01 00:00:00
+4401830001,2014-06-01 00:00:00
+4401130001,2017-04-01 00:00:00
+4401120001,2015-07-01 00:00:00
+4401150001,2015-12-01 00:00:00
+4418020001,2017-05-01 00:00:00
+4406820001,2015-01-01 00:00:00
+4406070001,2017-01-01 00:00:00
+4407030001,2014-12-01 00:00:00
+5240000001,2016-08-01 00:00:00
+4601060001,2017-03-01 00:00:00
+4419000001,2014-02-01 00:00:00
+4419010002,2015-12-01 00:00:00
+4419010003,2017-01-01 00:00:00
+4414000001,2016-09-01 00:00:00
+3201050001,2011-01-01 00:00:00
+3201150001,2014-06-01 00:00:00
+3211020001,2012-08-01 00:00:00
+3208020001,2016-10-01 00:00:00
+3212020001,2012-08-01 00:00:00
+3203040001,2014-07-01 00:00:00
+3203120001,2017-04-01 00:00:00
+3207000001,2017-03-01 00:00:00
+2140000005,2015-07-01 00:00:00
+3202060001,2014-06-01 00:00:00
+3204110001,2012-08-01 00:00:00
+3204120001,2017-02-01 00:00:00
+3202810001,2013-06-01 00:00:00
+3202820001,2014-07-01 00:00:00
+3205850001,2013-06-01 00:00:00
+2016060001,2014-10-01 00:00:00
+3101140001,2012-08-01 00:00:00
+3101130001,2012-08-01 00:00:00
+3101170001,2014-08-01 00:00:00
+3101160001,2015-07-01 00:00:00
+3302120001,2014-12-01 00:00:00
+3302050001,2015-12-02 00:00:00
+3302810001,2014-03-01 00:00:00
+3307020001,2014-07-01 00:00:00
+3307820001,2016-12-01 00:00:00
+3303030001,2013-06-01 00:00:00
+3254010001,2014-12-01 00:00:00
+3310000001,2016-10-01 00:00:00
+3301050001,2015-02-01 00:00:00
+3306210001,2016-07-01 00:00:00
+3306820001,2017-01-01 00:00:00
+3305020001,2017-01-01 00:00:00
+4505030001,2017-06-01 00:00:00
+3205060001,2016-05-01 00:00:00
+1130000002,2016-01-04 00:00:00

+ 5 - 0
.svn/text-base/buildinglistgld.json.svn-base

@@ -0,0 +1,5 @@
+{
+"Buildings":[
+{"building":"1101080001","time":"2016-01-01 00:00:00"}
+]	
+}

+ 33 - 0
.svn/text-base/config.json.svn-base

@@ -0,0 +1,33 @@
+{
+	"Work_DB":[
+		"db_wanda"
+	],
+	"ComputeCycle":[
+		"16"
+	],
+	"ComputeDensity":[
+		"15min"
+	],
+	"ComputeDensity_SS":[
+		"5min"
+	],
+	"BreakEndure":[
+		"300"
+	],
+	"AbandonEndure":[
+		"900"
+	],
+	"Thread_Count":[
+		"20"
+	],
+	"PointResource_Format":[
+		"CSV"
+	],
+	"compute_realtime":[
+		"true"
+	],
+	"compute_buildings":[
+		"1101080001,1101080002"
+	]
+	
+}

+ 27 - 0
.svn/text-base/def_buildingcomputetime.json.svn-base

@@ -0,0 +1,27 @@
+{
+	"Columns":[
+		{
+			"Name":"building",
+			"Multiplicity":"1",
+			"Type":"String"
+		},
+		{
+			"Name":"compute_time",
+			"Multiplicity":"1",
+			"Type":"String"
+		},
+		{
+			"Name":"first_compute_time",
+			"Multiplicity":"1",
+			"Type":"String"
+		}
+		
+	],
+	"Key":[
+		"building"
+	],
+	"Indexes":[
+		
+	]
+	
+}

+ 45 - 0
.svn/text-base/def_computedetail.json.svn-base

@@ -0,0 +1,45 @@
+{
+	"Columns":[
+		{
+			"Name":"building",
+			"Multiplicity":"1",
+			"Type":"String"
+		},
+		{
+			"Name":"compute_round",
+			"Multiplicity":"1",
+			"Type":"Long"
+		},
+		{
+			"Name":"meter",
+			"Multiplicity":"1",
+			"Type":"String"
+		},
+		{
+			"Name":"funcid",
+			"Multiplicity":"1",
+			"Type":"Long"
+		},
+		{
+			"Name":"valid_time_from",
+			"Multiplicity":"1",
+			"Type":"String"
+		},
+		{
+			"Name":"valid_time_to",
+			"Multiplicity":"1",
+			"Type":"String"
+		}
+		
+	],
+	"Key":[
+		"building",
+		"compute_round",
+		"meter",
+		"funcid"
+	],
+	"Indexes":[
+		
+	]
+	
+}

+ 50 - 0
.svn/text-base/def_computedetail1.json.svn-base

@@ -0,0 +1,50 @@
+{
+	"Columns":[
+		{
+			"Name":"building",
+			"Multiplicity":"1",
+			"Type":"String"
+		},
+		{
+			"Name":"compute_round",
+			"Multiplicity":"1",
+			"Type":"Long"
+		},
+		{
+			"Name":"meter",
+			"Multiplicity":"1",
+			"Type":"String"
+		},
+		{
+			"Name":"funcid",
+			"Multiplicity":"1",
+			"Type":"Long"
+		},
+		{
+			"Name":"data_time",
+			"Multiplicity":"1",
+			"Type":"String"
+		},
+		{
+			"Name":"label2",
+			"Multiplicity":"1",
+			"Type":"Long"
+		},
+		{
+			"Name":"meter_cleaned2",
+			"Multiplicity":"1",
+			"Type":"Double"
+		}
+		
+	],
+	"Key":[
+		"building",
+		"compute_round",
+		"meter",
+		"funcid",
+		"data_time"
+	],
+	"Indexes":[	
+	]
+	
+}

+ 62 - 0
.svn/text-base/def_computedetail2.json.svn-base

@@ -0,0 +1,62 @@
+{
+	"Columns":[
+		{
+			"Name":"building",
+			"Multiplicity":"1",
+			"Type":"String"
+		},
+		{
+			"Name":"compute_round",
+			"Multiplicity":"1",
+			"Type":"Long"
+		},
+		{
+			"Name":"meter",
+			"Multiplicity":"1",
+			"Type":"String"
+		},
+		{
+			"Name":"funcid",
+			"Multiplicity":"1",
+			"Type":"Long"
+		},
+		{
+			"Name":"time_period",
+			"Multiplicity":"1",
+			"Type":"String"
+		},
+		{
+			"Name":"data_time",
+			"Multiplicity":"1",
+			"Type":"String"
+		},
+		{
+			"Name":"data_flag",
+			"Multiplicity":"1",
+			"Type":"Long"
+		},
+		{
+			"Name":"data_value",
+			"Multiplicity":"1",
+			"Type":"Double"
+		},
+		{
+			"Name":"data_value_old",
+			"Multiplicity":"1",
+			"Type":"Double"
+		}
+		
+	],
+	"Key":[
+		"building",
+		"compute_round",
+		"meter",
+		"funcid",
+		"time_period",
+		"data_time"
+	],
+	"Indexes":[
+		
+	]
+	
+}

+ 38 - 0
.svn/text-base/def_computelog.json.svn-base

@@ -0,0 +1,38 @@
+{
+	"Columns":[
+		{
+			"Name":"building",
+			"Multiplicity":"1",
+			"Type":"String"
+		},
+		{
+			"Name":"compute_round",
+			"Multiplicity":"1",
+			"Type":"Long"
+		},
+		{
+			"Name":"compute_time_from",
+			"Multiplicity":"1",
+			"Type":"String"
+		},
+		{
+			"Name":"compute_time_to",
+			"Multiplicity":"1",
+			"Type":"String"
+		},
+		{
+			"Name":"is_finished",
+			"Multiplicity":"1",
+			"Type":"Long"
+		}
+		
+	],
+	"Key":[
+		"building",
+		"compute_round"
+	],
+	"Indexes":[
+		
+	]
+	
+}

+ 48 - 0
.svn/text-base/def_computelog1.json.svn-base

@@ -0,0 +1,48 @@
+{
+	"Columns":[
+		{
+			"Name":"building",
+			"Multiplicity":"1",
+			"Type":"String"
+		},
+		{
+			"Name":"compute_round",
+			"Multiplicity":"1",
+			"Type":"Long"
+		},
+		{
+			"Name":"fjd_compute_round_from",
+			"Multiplicity":"1",
+			"Type":"Long"
+		},
+		{
+			"Name":"fjd_compute_round_to",
+			"Multiplicity":"1",
+			"Type":"Long"
+		},
+		{
+			"Name":"compute_time_from",
+			"Multiplicity":"1",
+			"Type":"String"
+		},
+		{
+			"Name":"compute_time_to",
+			"Multiplicity":"1",
+			"Type":"String"
+		},
+		{
+			"Name":"is_finished",
+			"Multiplicity":"1",
+			"Type":"Long"
+		}
+		
+	],
+	"Key":[
+		"building",
+		"compute_round"
+	],
+	"Indexes":[
+		
+	]
+	
+}

+ 43 - 0
.svn/text-base/def_computelog2.json.svn-base

@@ -0,0 +1,43 @@
+{
+	"Columns":[
+		{
+			"Name":"building",
+			"Multiplicity":"1",
+			"Type":"String"
+		},
+		{
+			"Name":"meter",
+			"Multiplicity":"1",
+			"Type":"String"
+		},
+		{
+			"Name":"funcid",
+			"Multiplicity":"1",
+			"Type":"Long"
+		},
+		{
+			"Name":"compute_round",
+			"Multiplicity":"1",
+			"Type":"Long"
+		},
+		{
+			"Name":"compute_time_from",
+			"Multiplicity":"1",
+			"Type":"String"
+		},
+		{
+			"Name":"compute_time_to",
+			"Multiplicity":"1",
+			"Type":"String"
+		}
+		
+	],
+	"Key":[
+		"building",
+		"compute_round"
+	],
+	"Indexes":[
+		
+	]
+	
+}

+ 44 - 0
.svn/text-base/def_metercomputetime.json.svn-base

@@ -0,0 +1,44 @@
+{
+	"Columns":[
+		{
+			"Name":"building",
+			"Multiplicity":"1",
+			"Type":"String"
+		},
+		{
+			"Name":"meter",
+			"Multiplicity":"1",
+			"Type":"String"
+		},
+		{
+			"Name":"funcid",
+			"Multiplicity":"1",
+			"Type":"Long"
+		},
+		{
+			"Name":"compute_time",
+			"Multiplicity":"1",
+			"Type":"String"
+		},
+		{
+			"Name":"data_time",
+			"Multiplicity":"1",
+			"Type":"String"
+		},
+		{
+			"Name":"first_compute_time",
+			"Multiplicity":"1",
+			"Type":"String"
+		}
+		
+	],
+	"Key":[
+		"building",
+		"meter",
+		"funcid"
+	],
+	"Indexes":[
+		
+	]
+	
+}

+ 51 - 0
.svn/text-base/def_near.json.svn-base

@@ -0,0 +1,51 @@
+{
+	"Columns":[
+		{
+			"Name":"building",
+			"Multiplicity":"1",
+			"Type":"String"
+		},
+		{
+			"Name":"meter",
+			"Multiplicity":"1",
+			"Type":"String"
+		},
+		{
+			"Name":"funcid",
+			"Multiplicity":"1",
+			"Type":"Long"
+		},
+		{
+			"Name":"time_period",
+			"Multiplicity":"1",
+			"Type":"String"
+		},
+		{
+			"Name":"data_time",
+			"Multiplicity":"1",
+			"Type":"String"
+		},
+		{
+			"Name":"data_flag",
+			"Multiplicity":"1",
+			"Type":"Long"
+		},
+		{
+			"Name":"data_value",
+			"Multiplicity":"1",
+			"Type":"Double"
+		}
+		
+	],
+	"Key":[
+		"building",
+		"meter",
+		"funcid",
+		"time_period",
+		"data_time"
+	],
+	"Indexes":[
+		
+	]
+	
+}

+ 51 - 0
.svn/text-base/def_near1.json.svn-base

@@ -0,0 +1,51 @@
+{
+	"Columns":[
+		{
+			"Name":"building",
+			"Multiplicity":"1",
+			"Type":"String"
+		},
+		{
+			"Name":"meter",
+			"Multiplicity":"1",
+			"Type":"String"
+		},
+		{
+			"Name":"funcid",
+			"Multiplicity":"1",
+			"Type":"Long"
+		},
+		{
+			"Name":"time_period",
+			"Multiplicity":"1",
+			"Type":"String"
+		},
+		{
+			"Name":"data_time",
+			"Multiplicity":"1",
+			"Type":"String"
+		},
+		{
+			"Name":"data_flag",
+			"Multiplicity":"1",
+			"Type":"Long"
+		},
+		{
+			"Name":"data_value",
+			"Multiplicity":"1",
+			"Type":"Double"
+		}
+		
+	],
+	"Key":[
+		"building",
+		"meter",
+		"funcid",
+		"time_period",
+		"data_time"
+	],
+	"Indexes":[
+		
+	]
+	
+}

+ 51 - 0
.svn/text-base/def_near2.json.svn-base

@@ -0,0 +1,51 @@
+{
+	"Columns":[
+		{
+			"Name":"building",
+			"Multiplicity":"1",
+			"Type":"String"
+		},
+		{
+			"Name":"meter",
+			"Multiplicity":"1",
+			"Type":"String"
+		},
+		{
+			"Name":"funcid",
+			"Multiplicity":"1",
+			"Type":"Long"
+		},
+		{
+			"Name":"time_period",
+			"Multiplicity":"1",
+			"Type":"String"
+		},
+		{
+			"Name":"data_time",
+			"Multiplicity":"1",
+			"Type":"String"
+		},
+		{
+			"Name":"data_flag",
+			"Multiplicity":"1",
+			"Type":"Long"
+		},
+		{
+			"Name":"data_value",
+			"Multiplicity":"1",
+			"Type":"Double"
+		}
+		
+	],
+	"Key":[
+		"building",
+		"meter",
+		"funcid",
+		"time_period",
+		"data_time"
+	],
+	"Indexes":[
+		
+	]
+	
+}

+ 39 - 0
.svn/text-base/def_pointlist.json.svn-base

@@ -0,0 +1,39 @@
+{
+	"Columns":[
+		{
+			"Name":"building",
+			"Multiplicity":"1",
+			"Type":"String"
+		},
+		{
+			"Name":"meter",
+			"Multiplicity":"1",
+			"Type":"String"
+		},
+		{
+			"Name":"funcid",
+			"Multiplicity":"1",
+			"Type":"Long"
+		},
+		{
+			"Name":"data_type",
+			"Multiplicity":"1",
+			"Type":"String"
+		},
+		{
+			"Name":"collect_cycle",
+			"Multiplicity":"1",
+			"Type":"String"
+		}
+		
+	],
+	"Key":[
+		"building",
+		"meter",
+		"funcid"
+	],
+	"Indexes":[
+		
+	]
+	
+}

+ 57 - 0
.svn/text-base/def_rate.json.svn-base

@@ -0,0 +1,57 @@
+{
+	"Columns":[
+		{
+			"Name":"building",
+			"Multiplicity":"1",
+			"Type":"String"
+		},
+		{
+			"Name":"meter",
+			"Multiplicity":"1",
+			"Type":"String"
+		},
+		{
+			"Name":"funcid",
+			"Multiplicity":"1",
+			"Type":"Long"
+		},
+		{
+			"Name":"time_period",
+			"Multiplicity":"1",
+			"Type":"String"
+		},
+		{
+			"Name":"data_time",
+			"Multiplicity":"1",
+			"Type":"String"
+		},
+		{
+			"Name":"data_flag",
+			"Multiplicity":"1",
+			"Type":"Long"
+		},
+		{
+			"Name":"status_value",
+			"Multiplicity":"1",
+			"Type":"Double"
+		},
+		{
+			"Name":"status_ratio",
+			"Multiplicity":"1",
+			"Type":"Double"
+		}
+		
+	],
+	"Key":[
+		"building",
+		"meter",
+		"funcid",
+		"time_period",
+		"data_time",
+		"status_value"
+	],
+	"Indexes":[
+		
+	]
+	
+}

+ 51 - 0
.svn/text-base/def_service.json.svn-base

@@ -0,0 +1,51 @@
+{
+	"Columns":[
+		{
+			"Name":"building",
+			"Multiplicity":"1",
+			"Type":"String"
+		},
+		{
+			"Name":"meter",
+			"Multiplicity":"1",
+			"Type":"String"
+		},
+		{
+			"Name":"funcid",
+			"Multiplicity":"1",
+			"Type":"Long"
+		},
+		{
+			"Name":"time_period",
+			"Multiplicity":"1",
+			"Type":"String"
+		},
+		{
+			"Name":"data_time",
+			"Multiplicity":"1",
+			"Type":"String"
+		},
+		{
+			"Name":"data_flag",
+			"Multiplicity":"1",
+			"Type":"Long"
+		},
+		{
+			"Name":"data_value",
+			"Multiplicity":"1",
+			"Type":"Double"
+		}
+		
+	],
+	"Key":[
+		"building",
+		"meter",
+		"funcid",
+		"time_period",
+		"data_time"
+	],
+	"Indexes":[
+		
+	]
+	
+}

+ 50 - 0
.svn/text-base/def_servicecomputedetail.json.svn-base

@@ -0,0 +1,50 @@
+{
+	"Columns":[
+		{
+			"Name":"building",
+			"Multiplicity":"1",
+			"Type":"String"
+		},
+		{
+			"Name":"compute_round",
+			"Multiplicity":"1",
+			"Type":"Long"
+		},
+		{
+			"Name":"fjd_source",
+			"Multiplicity":"1",
+			"Type":"Long"
+		},
+		{
+			"Name":"meter",
+			"Multiplicity":"1",
+			"Type":"String"
+		},
+		{
+			"Name":"funcid",
+			"Multiplicity":"1",
+			"Type":"Long"
+		},
+		{
+			"Name":"valid_time_from",
+			"Multiplicity":"1",
+			"Type":"String"
+		},
+		{
+			"Name":"valid_time_to",
+			"Multiplicity":"1",
+			"Type":"String"
+		}
+		
+	],
+	"Key":[
+		"building",
+		"compute_round",
+		"fjd_source",
+		"meter",
+		"funcid"
+	],
+	"Indexes":[	
+	]
+	
+}

+ 54 - 0
.svn/text-base/def_servicecomputelog.json.svn-base

@@ -0,0 +1,54 @@
+{
+	"Columns":[
+		{
+			"Name":"building",
+			"Multiplicity":"1",
+			"Type":"String"
+		},
+		{
+			"Name":"compute_round",
+			"Multiplicity":"1",
+			"Type":"Long"
+		},
+		{
+			"Name":"fjd_source",
+			"Multiplicity":"1",
+			"Type":"Long"
+		},
+		{
+			"Name":"fjd_compute_round_from",
+			"Multiplicity":"1",
+			"Type":"Long"
+		},
+		{
+			"Name":"fjd_compute_round_to",
+			"Multiplicity":"1",
+			"Type":"Long"
+		},
+		{
+			"Name":"compute_time_from",
+			"Multiplicity":"1",
+			"Type":"String"
+		},
+		{
+			"Name":"compute_time_to",
+			"Multiplicity":"1",
+			"Type":"String"
+		},
+		{
+			"Name":"is_finished",
+			"Multiplicity":"1",
+			"Type":"Long"
+		}
+		
+	],
+	"Key":[
+		"building",
+		"compute_round",
+		"fjd_source"
+	],
+	"Indexes":[
+		
+	]
+	
+}

+ 76 - 0
.svn/text-base/def_static.json.svn-base

@@ -0,0 +1,76 @@
+{
+	"Columns":[
+		{
+			"Name":"building",
+			"Multiplicity":"1",
+			"Type":"String"
+		},
+		{
+			"Name":"meter",
+			"Multiplicity":"1",
+			"Type":"String"
+		},
+		{
+			"Name":"funcid",
+			"Multiplicity":"1",
+			"Type":"Long"
+		},
+		{
+			"Name":"time_period",
+			"Multiplicity":"1",
+			"Type":"String"
+		},
+		{
+			"Name":"data_time",
+			"Multiplicity":"1",
+			"Type":"String"
+		},
+		{
+			"Name":"data_flag",
+			"Multiplicity":"1",
+			"Type":"Long"
+		},
+		{
+			"Name":"data_count",
+			"Multiplicity":"1",
+			"Type":"Long"
+		},
+		{
+			"Name":"data_avg",
+			"Multiplicity":"1",
+			"Type":"Double"
+		},
+		{
+			"Name":"data_max",
+			"Multiplicity":"1",
+			"Type":"Double"
+		},
+		{
+			"Name":"time_max",
+			"Multiplicity":"1",
+			"Type":"String"
+		},
+		{
+			"Name":"data_min",
+			"Multiplicity":"1",
+			"Type":"Double"
+		},
+		{
+			"Name":"time_min",
+			"Multiplicity":"1",
+			"Type":"String"
+		}
+		
+	],
+	"Key":[
+		"building",
+		"meter",
+		"funcid",
+		"time_period",
+		"data_time"
+	],
+	"Indexes":[
+		
+	]
+	
+}

+ 34 - 0
.svn/text-base/hbase-site.xml.svn-base

@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
+<configuration>
+	<!-- hbase-site.xml -->
+	<property>
+		<name>dfs.replication</name>
+		<value>1</value>
+	</property>
+
+	<property>
+		<name>hbase.rootdir</name>
+		<value>hdfs://namenode:8020/hbase</value>
+	</property>
+	<property>
+		<name>hbase.cluster.distributed</name>
+		<value>true</value>
+	</property>
+	<property>
+		<name>hbase.zookeeper.quorum</name>
+		<value>zookeeper1,zookeeper2,zookeeper3</value>
+	</property>
+	<property>
+		<name>hbase.zookeeper.property.dataDir</name>
+		<value>/var/zookeeper/data</value>
+	</property>
+
+	<!--
+	<property>
+		<name>hbase.security.authentication</name>
+		<value>simple</value>
+	</property>
+	-->
+
+</configuration>

+ 17 - 0
.svn/text-base/log4j.properties.svn-base

@@ -0,0 +1,17 @@
+log4j.rootLogger=INFO,ConsoleAppender,RollingLogFileAppender
+
+log4j.appender.RollingLogFileAppender=org.apache.log4j.DailyRollingFileAppender
+log4j.appender.RollingLogFileAppender.Threshold=INFO
+log4j.appender.RollingLogFileAppender.ImmediateFlush=true
+log4j.appender.RollingLogFileAppender.File=log.log
+log4j.appender.RollingLogFileAppender.DatePattern=yyyy-MM-dd'.log'  
+log4j.appender.RollingLogFileAppender.Append=true
+log4j.appender.RollingLogFileAppender.layout=org.apache.log4j.PatternLayout
+log4j.appender.RollingLogFileAppender.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %t %m%n
+
+log4j.appender.ConsoleAppender=org.apache.log4j.ConsoleAppender
+log4j.appender.ConsoleAppender.Threshold=INFO
+log4j.appender.ConsoleAppender.ImmediateFlush=true
+log4j.appender.ConsoleAppender.Target=System.out
+log4j.appender.ConsoleAppender.layout=org.apache.log4j.PatternLayout
+log4j.appender.ConsoleAppender.layout.ConversionPattern=%d{yyyy-MM-dd HH\:mm\:ss} %t %m%n

File diff suppressed because it is too large
+ 3571 - 0
.svn/text-base/pointlist.csv.svn-base


+ 10 - 0
.svn/text-base/pointlist.json.svn-base

@@ -0,0 +1,10 @@
+{
+"Points":[
+{"building":"4301050001","meter":"1001","funcid":0,"data_type":"Inst","collect_cycle":"5min"},
+{"building":"4301050001","meter":"1002","funcid":0,"data_type":"Acc","collect_cycle":"5min"},
+{"building":"4301050001","meter":"1003","funcid":0,"data_type":"Boolv","collect_cycle":"5min"},
+{"building":"4301050001","meter":"1004","funcid":0,"data_type":"Enumv","collect_cycle":"5min"},
+{"building":"4301050001","meter":"6666","funcid":0,"data_type":"Acc","collect_cycle":"5min"}
+
+]	
+}

File diff suppressed because it is too large
+ 557182 - 0
.svn/text-base/pointlist2.csv.svn-base


File diff suppressed because it is too large
+ 5176 - 0
.svn/text-base/pointlist2.json.svn-base


File diff suppressed because it is too large
+ 557182 - 0
.svn/text-base/pointlist3.csv.svn-base


+ 10 - 0
.svn/text-base/pointlist3.json.svn-base

@@ -0,0 +1,10 @@
+{
+"Points":[
+{"building":"4301050001","meter":"1001","funcid":0,"data_type":"Inst","collect_cycle":"5min"},
+{"building":"4301050001","meter":"1002","funcid":0,"data_type":"Acc","collect_cycle":"5min"},
+{"building":"4301050001","meter":"1003","funcid":0,"data_type":"Boolv","collect_cycle":"5min"},
+{"building":"4301050001","meter":"1004","funcid":0,"data_type":"Enumv","collect_cycle":"5min"},
+{"building":"4301050001","meter":"6666","funcid":0,"data_type":"Acc","collect_cycle":"5min"}
+
+]	
+}

File diff suppressed because it is too large
+ 5173 - 0
.svn/text-base/pointlistgld.csv.svn-base


File diff suppressed because it is too large
+ 5177 - 0
.svn/text-base/pointlistgld.json.svn-base


+ 169 - 0
.svn/text-base/pom.xml.svn-base

@@ -0,0 +1,169 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+	<modelVersion>4.0.0</modelVersion>
+	<groupId>com.sagacloud</groupId>
+	<artifactId>compute-fjd</artifactId>
+	<version>1.0-SNAPSHOT</version>
+	<properties>
+		<maven.compiler.source>1.8</maven.compiler.source>
+		<maven.compiler.target>1.8</maven.compiler.target>
+	</properties>
+
+	<repositories>
+		<repository>
+			<id>SagaCloud</id>
+			<name>SagaCloud</name>
+			<url>http://172.16.0.86:8081/repository/SagaCloud/</url>
+			<snapshots>
+				<enabled>true</enabled>
+			</snapshots>
+			<releases>
+				<enabled>true</enabled>
+			</releases>
+		</repository>
+		<repository>
+			<id>alimaven</id>
+			<name>aliyun maven</name>
+			<url>http://maven.aliyun.com/nexus/content/groups/public</url>
+		</repository>
+		<repository>
+			<id>mvnrepository</id>
+			<url>https://mvnrepository.com/</url>
+		</repository>
+		<repository>
+			<id>sonatype-nexus-snapshots</id>
+			<name>Sonatype Nexus Snapshots</name>
+			<url>http://oss.sonatype.org/content/repositories/snapshots</url>
+		</repository>
+	</repositories>
+
+	<dependencies>
+		<dependency>
+			<groupId>mysql</groupId>
+			<artifactId>mysql-connector-java</artifactId>
+			<version>5.1.13</version>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.hbase</groupId>
+			<artifactId>hbase-server</artifactId>
+			<version>1.3.0</version>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.hbase</groupId>
+			<artifactId>hbase-client</artifactId>
+			<version>1.3.0</version>
+		</dependency>
+		<dependency>
+			<groupId>dom4j</groupId>
+			<artifactId>dom4j</artifactId>
+			<version>1.6.1</version>
+		</dependency>
+		<dependency>
+			<groupId>jaxen</groupId>
+			<artifactId>jaxen</artifactId>
+			<version>1.1.6</version>
+		</dependency>
+		<dependency>
+			<groupId>com.sagacloud</groupId>
+			<artifactId>zillion-util</artifactId>
+			<version>1.2</version>
+			<type>jar</type>
+		</dependency>
+		<dependency>
+			<groupId>com.sagacloud</groupId>
+			<artifactId>json-lib-zillion</artifactId>
+			<version>1.0</version>
+			<type>jar</type>
+		</dependency>
+		<dependency>
+			<groupId>jdk.tools</groupId>
+			<artifactId>jdk.tools</artifactId>
+			<version>1.8</version>
+			<scope>system</scope>
+			<systemPath>${JAVA_HOME}/lib/tools.jar</systemPath>
+		</dependency>
+	</dependencies>
+
+	<build>
+		<resources>
+			<resource>
+				<directory>src/main/resources</directory>
+				<targetPath>${project.build.directory}</targetPath>
+			</resource>
+		</resources>
+		<plugins>
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-compiler-plugin</artifactId>
+				<version>2.4</version>
+				<configuration>
+					<defaultLibBundleDir></defaultLibBundleDir>
+					<source>1.8</source>
+					<target>1.8</target>
+					<encoding>gbk</encoding>
+				</configuration>
+			</plugin>
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-jar-plugin</artifactId>
+				<version>2.4</version>
+				<configuration>
+					<archive>
+						<manifest>
+							<addClasspath>true</addClasspath>
+							<classpathPrefix></classpathPrefix>
+							<mainClass>com.persagy.compute.main.ComputeMain</mainClass>
+						</manifest>
+					</archive>
+				</configuration>
+			</plugin>
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-dependency-plugin</artifactId>
+				<version>2.4</version>
+				<executions>
+					<execution>
+						<id>copy</id>
+						<phase>package</phase>
+						<goals>
+							<goal>copy-dependencies</goal>
+						</goals>
+						<configuration>
+							<outputDirectory>
+								${project.build.directory}
+							</outputDirectory>
+						</configuration>
+					</execution>
+				</executions>
+			</plugin>
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-resources-plugin</artifactId>
+				<version>2.4</version>
+				<configuration>
+					<encoding>UTF-8</encoding>
+				</configuration>
+			</plugin>
+		</plugins>
+	</build>
+
+	<profiles>
+		<profile>
+			<id>dev</id>
+			<build>
+				<plugins>
+					<plugin>
+						<groupId>org.apache.maven.plugins</groupId>
+						<artifactId>maven-shade-plugin</artifactId>
+						<executions>
+							<execution>
+								<phase>none</phase>
+							</execution>
+						</executions>
+					</plugin>
+				</plugins>
+			</build>
+		</profile>
+	</profiles>
+
+</project>

+ 42 - 0
config-1101080001-1/port1.xml

@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <portpara>
+    <baud>9600</baud>
+    <databit>8</databit>
+    <parity>N</parity>
+    <stopbit>1</stopbit>
+    <timeout>1000</timeout>
+  </portpara>
+  <portdev>
+    <devtype meterid="1000">
+      <addr>01</addr>
+      <loacation>BIM</loacation>
+      <protocolname>persagy-spb</protocolname>
+      <interval>1</interval>
+      <factor></factor>
+      <offset></offset>
+      <funset>
+        <funid>11101</funid>
+        <funid>11201</funid>
+        <funid>11301</funid>
+        <funid>11303</funid>
+        <funid>11401</funid>
+      </funset>
+    </devtype>
+    <devtype meterid="1001">
+      <addr>00</addr>
+      <loacation>BIM</loacation>
+      <protocolname>persagy-spb</protocolname>
+      <interval>1</interval>
+      <factor></factor>
+      <offset></offset>
+      <funset>
+        <funid>11101</funid>
+        <funid>11201</funid>
+        <funid>11301</funid>
+        <funid>11303</funid>
+        <funid>11401</funid>
+      </funset>
+    </devtype>
+  </portdev>
+</root>

+ 35 - 0
config-1101080001-1/port2.xml

@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <portpara>
+    <baud>9600</baud>
+    <databit>8</databit>
+    <parity>N</parity>
+    <stopbit>1</stopbit>
+    <timeout>1000</timeout>
+  </portpara>
+  <portdev>
+    <devtype meterid="1002">
+      <addr>02</addr>
+      <loacation>BIM</loacation>
+      <protocolname>cyw11</protocolname>
+      <interval>1</interval>
+      <factor></factor>
+      <offset></offset>
+      <funset>
+        <funid>12109</funid>
+      </funset>
+    </devtype>
+    <devtype meterid="1003">
+      <addr>06</addr>
+      <loacation></loacation>
+      <protocolname>07dlt645</protocolname>
+      <interval>0</interval>
+      <factor></factor>
+      <offset></offset>
+      <funset>
+        <funid>10101</funid>
+        <funid>10704</funid>
+      </funset>
+    </devtype>
+  </portdev>
+</root>

+ 11 - 0
config-1101080001-1/port3.xml

@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <portpara>
+    <baud>9600</baud>
+    <databit>8</databit>
+    <parity>N</parity>
+    <stopbit>1</stopbit>
+    <timeout>1000</timeout>
+  </portpara>
+  <portdev />
+</root>

+ 52 - 0
config-1101080001-1/port4.xml

@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <portpara>
+    <baud>9600</baud>
+    <databit>8</databit>
+    <parity>N</parity>
+    <stopbit>1</stopbit>
+    <timeout>1000</timeout>
+  </portpara>
+  <portdev>
+    <devtype meterid="4001">
+      <addr>05</addr>
+      <loacation>测试</loacation>
+      <protocolname>pqm1001-4</protocolname>
+      <interval>10</interval>
+      <factor />
+      <offset />
+      <funset>
+        <funid>10101</funid>
+        <funid>10102</funid>
+        <funid>10103</funid>
+        <funid>10104</funid>
+        <funid>10201</funid>
+        <funid>10202</funid>
+        <funid>10203</funid>
+        <funid>10204</funid>
+        <funid>10205</funid>
+        <funid>10206</funid>
+        <funid>10207</funid>
+        <funid>10208</funid>
+        <funid>10209</funid>
+        <funid>10214</funid>
+        <funid>10301</funid>
+        <funid>10302</funid>
+        <funid>10303</funid>
+        <funid>10304</funid>
+        <funid>10305</funid>
+        <funid>10306</funid>
+        <funid>10307</funid>
+        <funid>10308</funid>
+        <funid>10309</funid>
+        <funid>10310</funid>
+        <funid>10311</funid>
+        <funid>10312</funid>
+        <funid>10313</funid>
+        <funid>10314</funid>
+        <funid>10315</funid>
+        <funid>10316</funid>
+      </funset>
+    </devtype>
+  </portdev>
+</root>

+ 52 - 0
config.json

@@ -0,0 +1,52 @@
+{
+	"DB": [{
+			"building": "1101080001",
+			"database": "db_public_10",
+			"buildingadds": [{
+					"building": "1101020001"
+				},
+				{
+					"building": "1101020002"
+				}
+			]
+		},
+		{
+			"building": "1101080002",
+			"database": "db_public_10"
+		},
+		{
+			"building": "1101080003",
+			"database": "db_public_10"
+		},
+		{
+			"insertthread": "1"
+		}
+	],
+	"Port": [{
+			"type": "Up",
+			"port": "9999",
+			"Compress": "false",
+			"History": "false"
+		},
+		{
+			"type": "Down",
+			"port": "80",
+			"Compress": "false",
+			"History": "false"
+		}
+	],
+	"BlackList": [{
+		"buildings": [{
+				"building": "1234567890"
+			},
+			{
+				"building": "8989898989"
+			}
+		]
+	}],
+	"WhiteList": [{
+		"funcids": [{
+			"funcid": 0
+		}]
+	}]
+}

BIN
config.xls


+ 52 - 0
config2.json

@@ -0,0 +1,52 @@
+{
+	"DB": [{
+			"building": "1101080001",
+			"database": "db_public_10",
+			"buildingadds": [{
+					"building": "1101020001"
+				},
+				{
+					"building": "1101020002"
+				}
+			]
+		},
+		{
+			"building": "1101080002",
+			"database": "db_public_10"
+		},
+		{
+			"building": "1101080003",
+			"database": "db_public_10"
+		},
+		{
+			"insertthread": "1"
+		}
+	],
+	"Port": [{
+			"type": "Up",
+			"port": "9999",
+			"Compress": "false",
+			"History": "false"
+		},
+		{
+			"type": "Down",
+			"port": "80",
+			"Compress": "false",
+			"History": "false"
+		}
+	],
+	"BlackList": [{
+		"buildings": [{
+				"building": "1234567890"
+			},
+			{
+				"building": "8989898989"
+			}
+		]
+	}],
+	"WhiteList": [{
+		"funcids": [{
+			"funcid": 0
+		}]
+	}]
+}

BIN
configbak.xls


+ 34 - 0
hbase-site.xml

@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
+<configuration>
+	<!-- hbase-site.xml -->
+	<property>
+		<name>dfs.replication</name>
+		<value>1</value>
+	</property>
+
+	<property>
+		<name>hbase.rootdir</name>
+		<value>hdfs://namenode:8020/hbase</value>
+	</property>
+	<property>
+		<name>hbase.cluster.distributed</name>
+		<value>true</value>
+	</property>
+	<property>
+		<name>hbase.zookeeper.quorum</name>
+		<value>zookeeper1,zookeeper2,zookeeper3</value>
+	</property>
+	<property>
+		<name>hbase.zookeeper.property.dataDir</name>
+		<value>/var/zookeeper/data</value>
+	</property>
+
+	<!--
+	<property>
+		<name>hbase.security.authentication</name>
+		<value>simple</value>
+	</property>
+	-->
+
+</configuration>

+ 17 - 0
log4j.properties

@@ -0,0 +1,17 @@
+log4j.rootLogger=INFO,ConsoleAppender,RollingLogFileAppender
+
+log4j.appender.RollingLogFileAppender=org.apache.log4j.DailyRollingFileAppender
+log4j.appender.RollingLogFileAppender.Threshold=INFO
+log4j.appender.RollingLogFileAppender.ImmediateFlush=true
+log4j.appender.RollingLogFileAppender.File=log.log
+log4j.appender.RollingLogFileAppender.DatePattern=yyyy-MM-dd'.log'  
+log4j.appender.RollingLogFileAppender.Append=true
+log4j.appender.RollingLogFileAppender.layout=org.apache.log4j.PatternLayout
+log4j.appender.RollingLogFileAppender.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss SSS} %t %m%n
+
+log4j.appender.ConsoleAppender=org.apache.log4j.ConsoleAppender
+log4j.appender.ConsoleAppender.Threshold=INFO
+log4j.appender.ConsoleAppender.ImmediateFlush=true
+log4j.appender.ConsoleAppender.Target=System.out
+log4j.appender.ConsoleAppender.layout=org.apache.log4j.PatternLayout
+log4j.appender.ConsoleAppender.layout.ConversionPattern=%d{yyyy-MM-dd HH\:mm\:ss SSS} %t %m%n

BIN
pointlistadd.xls


+ 173 - 0
pom.xml

@@ -0,0 +1,173 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+	<modelVersion>4.0.0</modelVersion>
+	<groupId>com.sagacloud</groupId>
+	<artifactId>collect</artifactId>
+	<version>1.0-SNAPSHOT</version>
+	<properties>
+		<maven.compiler.source>1.8</maven.compiler.source>
+		<maven.compiler.target>1.8</maven.compiler.target>
+	</properties>
+
+	<repositories>
+		<repository>
+			<id>SagaCloud</id>
+			<name>SagaCloud</name>
+			<url>http://172.16.0.86:8081/repository/SagaCloud/</url>
+			<snapshots>
+				<enabled>true</enabled>
+			</snapshots>
+			<releases>
+				<enabled>true</enabled>
+			</releases>
+		</repository>
+		<repository>
+			<id>alimaven</id>
+			<name>aliyun maven</name>
+			<url>http://maven.aliyun.com/nexus/content/groups/public</url>
+		</repository>
+		<repository>
+			<id>mvnrepository</id>
+			<url>https://mvnrepository.com/</url>
+		</repository>
+		<repository>
+			<id>sonatype-nexus-snapshots</id>
+			<name>Sonatype Nexus Snapshots</name>
+			<url>http://oss.sonatype.org/content/repositories/snapshots</url>
+		</repository>
+	</repositories>
+
+	<dependencies>
+		<dependency>
+			<groupId>mysql</groupId>
+			<artifactId>mysql-connector-java</artifactId>
+			<version>5.1.13</version>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.hbase</groupId>
+			<artifactId>hbase-server</artifactId>
+			<version>1.3.0</version>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.hbase</groupId>
+			<artifactId>hbase-client</artifactId>
+			<version>1.3.0</version>
+		</dependency>
+		<dependency>
+			<groupId>dom4j</groupId>
+			<artifactId>dom4j</artifactId>
+			<version>1.6.1</version>
+		</dependency>
+		<dependency>
+			<groupId>jaxen</groupId>
+			<artifactId>jaxen</artifactId>
+			<version>1.1.6</version>
+		</dependency>
+		<!--- <dependency> <groupId>com.sagacloud</groupId> <artifactId>zillion-util</artifactId> 
+			<version>1.2</version> <type>jar</type> </dependency> -->
+		<dependency>
+			<groupId>com.sagacloud</groupId>
+			<artifactId>json-lib-zillion</artifactId>
+			<version>1.0</version>
+			<type>jar</type>
+		</dependency>
+		<dependency>
+			<groupId>jdk.tools</groupId>
+			<artifactId>jdk.tools</artifactId>
+			<version>1.8</version>
+			<scope>system</scope>
+			<systemPath>${JAVA_HOME}/lib/tools.jar</systemPath>
+		</dependency>
+
+		<!-- https://mvnrepository.com/artifact/net.sourceforge.jexcelapi/jxl -->
+		<dependency>
+			<groupId>net.sourceforge.jexcelapi</groupId>
+			<artifactId>jxl</artifactId>
+			<version>2.6.12</version>
+		</dependency>
+
+	</dependencies>
+
+	<build>
+		<resources>
+			<resource>
+				<directory>src/main/resources</directory>
+				<targetPath>${project.build.directory}</targetPath>
+			</resource>
+		</resources>
+		<plugins>
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-compiler-plugin</artifactId>
+				<version>2.4</version>
+				<configuration>
+					<defaultLibBundleDir></defaultLibBundleDir>
+					<source>1.8</source>
+					<target>1.8</target>
+					<encoding>gbk</encoding>
+				</configuration>
+			</plugin>
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-jar-plugin</artifactId>
+				<version>2.4</version>
+				<configuration>
+					<archive>
+						<manifest>
+							<addClasspath>true</addClasspath>
+							<classpathPrefix></classpathPrefix>
+							<mainClass>com.persagy.compute.main.ComputeMain</mainClass>
+						</manifest>
+					</archive>
+				</configuration>
+			</plugin>
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-dependency-plugin</artifactId>
+				<version>2.4</version>
+				<executions>
+					<execution>
+						<id>copy</id>
+						<phase>package</phase>
+						<goals>
+							<goal>copy-dependencies</goal>
+						</goals>
+						<configuration>
+							<outputDirectory>
+								${project.build.directory}
+							</outputDirectory>
+						</configuration>
+					</execution>
+				</executions>
+			</plugin>
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-resources-plugin</artifactId>
+				<version>2.4</version>
+				<configuration>
+					<encoding>UTF-8</encoding>
+				</configuration>
+			</plugin>
+		</plugins>
+	</build>
+
+	<profiles>
+		<profile>
+			<id>dev</id>
+			<build>
+				<plugins>
+					<plugin>
+						<groupId>org.apache.maven.plugins</groupId>
+						<artifactId>maven-shade-plugin</artifactId>
+						<executions>
+							<execution>
+								<phase>none</phase>
+							</execution>
+						</executions>
+					</plugin>
+				</plugins>
+			</build>
+		</profile>
+	</profiles>
+
+</project>

+ 5 - 0
src/.svn/dir-prop-base

@@ -0,0 +1,5 @@
+K 14
+bugtraq:number
+V 4
+true
+END

+ 34 - 0
src/.svn/entries

@@ -0,0 +1,34 @@
+10
+
+dir
+7
+svn://60.205.112.142/Saga_Project_Compute/compute-fjd/src
+svn://60.205.112.142/Saga_Project_Compute
+
+
+
+2017-06-06T11:22:23.110374Z
+5
+menglu
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+76837162-0bd0-9d41-b8e9-7b9c1ee79ca4
+
+main
+dir
+
+test
+dir
+

+ 5 - 0
src/main/.svn/dir-prop-base

@@ -0,0 +1,5 @@
+K 14
+bugtraq:number
+V 4
+true
+END

+ 34 - 0
src/main/.svn/entries

@@ -0,0 +1,34 @@
+10
+
+dir
+7
+svn://60.205.112.142/Saga_Project_Compute/compute-fjd/src/main
+svn://60.205.112.142/Saga_Project_Compute
+
+
+
+2017-06-06T11:22:23.110374Z
+5
+menglu
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+76837162-0bd0-9d41-b8e9-7b9c1ee79ca4
+
+java
+dir
+
+resources
+dir
+

+ 5 - 0
src/main/java/.svn/dir-prop-base

@@ -0,0 +1,5 @@
+K 14
+bugtraq:number
+V 4
+true
+END

+ 235 - 0
src/main/java/.svn/entries

@@ -0,0 +1,235 @@
+10
+
+dir
+7
+svn://60.205.112.142/Saga_Project_Compute/compute-fjd/src/main/java
+svn://60.205.112.142/Saga_Project_Compute
+
+
+
+2017-06-06T11:22:23.110374Z
+5
+menglu
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+76837162-0bd0-9d41-b8e9-7b9c1ee79ca4
+
+SS.java
+file
+9
+
+
+
+2017-07-13T06:42:22.816000Z
+74077f0dafe47fbaeffcdfb171656608
+2017-08-18T02:06:56.468898Z
+9
+lijingqiang
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+1369
+
+TDD.java
+file
+9
+
+
+
+2017-06-30T09:59:00.057000Z
+a5d8b35291ac41ceede92e8f5c275802
+2017-08-18T02:06:56.468898Z
+9
+lijingqiang
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+665
+
+TestCSV.java
+file
+9
+
+
+
+2017-06-02T10:29:06.196000Z
+7be23e7b6fa1ca8bb7edf898b4b7f759
+2017-08-18T02:06:56.468898Z
+9
+lijingqiang
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+1117
+
+TestInsert.java
+file
+9
+
+
+
+2017-06-13T09:46:56.582000Z
+3266ba2232f560667733dc1cc2218946
+2017-08-18T02:06:56.468898Z
+9
+lijingqiang
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+2203
+
+TestPointList.java
+file
+
+
+
+
+2017-05-31T02:31:09.791838Z
+84b51d234654008e23c87ead8e3277c4
+2017-05-31T02:20:14.846128Z
+1
+menglu
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+4609
+
+TestResetCompute.java
+file
+
+
+
+
+2017-05-31T02:31:09.789833Z
+295f92ddca1ea98d82f5d2f8cc7f527b
+2017-05-31T02:20:14.846128Z
+1
+menglu
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+2400
+
+com
+dir
+

+ 37 - 0
src/main/java/.svn/text-base/SS.java.svn-base

@@ -0,0 +1,37 @@
+import com.saga.compute.util.DB.DBOperate;
+import com.saga.compute.util.common.Constant;
+import com.sagacloud.json.JSONObject;
+
+public class SS {
+
+	public static void main(String[] args) throws Exception {
+		// TODO Auto-generated method stub
+
+		// JSONObject deleteObject = new JSONObject();
+		// deleteObject.put("building", "4301050001");
+		// deleteObject.put("meter", "1001");
+		// deleteObject.put("funcid", Long.valueOf(String.valueOf(0)));
+		// if ((DBOperate.Instance().selectFirstDate(deleteObject,
+		// "fjd_0_metercomputetime")) == null) {
+		// System.out.println("xxx");
+		//
+		// }
+		// try {
+		// System.out.println(DBOperate.Instance().selectFirstDate(deleteObject,
+		// "fjd_0_metercomputetime"));
+		//
+		// } catch (Exception e) {
+		// // TODO Auto-generated catch block
+		// e.printStackTrace();
+		// }
+		String timefrom = "20170713140000";
+		String timeto = "20170713141500";
+		System.out.println((Constant.parseDB(timefrom).getTime() + "-" + Constant.parseDB(timeto).getTime() + " " + "="
+				+ (Constant.parseDB(timeto).getTime() - Constant.parseDB(timefrom).getTime()) + " "
+				+ (Constant.parseDB(timeto).getTime() - Constant.parseDB(timefrom).getTime() < (24 * 60 * 60 * 1000L)
+						? Constant.SIMPLEDATEFORMATDB.format(Constant.parseDB(timeto).getTime() + 24 * 60 * 60 * 1000L)
+						: timeto)));
+
+	}
+
+}

+ 20 - 0
src/main/java/.svn/text-base/TDD.java.svn-base

@@ -0,0 +1,20 @@
+import java.text.ParseException;
+import java.util.HashMap;
+import java.util.Map;
+
+import com.persagy.compute.entity.EntityServiceLog;
+import com.persagy.compute.util.QueryUtil;
+import com.saga.compute.util.common.Constant;
+
+public class TDD {
+
+	public static void main(String[] args) throws ParseException {
+		// TODO Auto-generated method stub
+		System.out.println(
+				Constant.parse("20170629155800").getTime() < Constant.parse("20170629155845").getTime() ? 1 : 2);
+		Map<Long, EntityServiceLog> servicelog = new HashMap<Long, EntityServiceLog>();
+		servicelog.put(0l, new EntityServiceLog());
+		System.out.println(servicelog.get(1l));
+	}
+
+}

+ 43 - 0
src/main/java/.svn/text-base/TestCSV.java.svn-base

@@ -0,0 +1,43 @@
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileReader;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.zillion.util.log.LogUtil;
+
+public class TestCSV {
+
+	public static void main(String[] args) {
+		// TODO Auto-generated method stub
+		String resource = "/wandapointlist.csv";
+		File csv = new File(LogUtil.GetPath() + resource);
+		BufferedReader br = null;
+		try {
+			br = new BufferedReader(new FileReader(csv));
+		} catch (FileNotFoundException e) {
+			e.printStackTrace();
+		}
+		String line = "";
+		String everyLine = "";
+		try {
+			List<String> allString = new ArrayList<>();
+			while ((line = br.readLine()) != null) // 读取到的内容给line变量
+			{
+				everyLine = line;
+				String[] str = everyLine.split(",");
+				for (String s : str) {
+					System.out.print(s + " ");
+				}
+				System.out.println();
+				allString.add(everyLine);
+			}
+			System.out.println("csv表格中所有行数:" + allString.size());
+		} catch (IOException e) {
+			e.printStackTrace();
+		}
+	}
+
+}

+ 56 - 0
src/main/java/.svn/text-base/TestInsert.java.svn-base

@@ -0,0 +1,56 @@
+
+import java.io.FileInputStream;
+
+import org.apache.hadoop.conf.Configuration;
+import org.zillion.util.log.LogUtil;
+
+import com.saga.compute.util.DB.DBOperate;
+import com.saga.compute.util.common.Constant;
+import com.sagacloud.json.JSONObject;
+import com.zillion.database.agent.ZillionAgent;
+
+public class TestInsert {
+
+	public static void main(String[] arsg) throws Exception {
+		String resource = "/hbase-site.xml";
+		Configuration configuration = new Configuration();
+		LogUtil.info(LogUtil.GetPath());
+		configuration.addResource(new FileInputStream(LogUtil.GetPath() + resource));
+		String zookeeper_connectionAddress = "zookeeper1:2181,zookeeper2:2181,zookeeper3:2181";
+		int zookeeper_sessionTimeout = 300000;
+		Constant.agent = new ZillionAgent(configuration, zookeeper_connectionAddress, zookeeper_sessionTimeout);
+		Constant.agent.Start();
+
+		// JSONObject InsertObject_detail = new JSONObject();
+		// InsertObject_detail.put("building", "4301050001");
+		// InsertObject_detail.put("compute_round", 1l);
+		// InsertObject_detail.put("meter", "1001");
+		// InsertObject_detail.put("funcid", 0l);
+		// InsertObject_detail.put("data_time", "20170102000000");
+		// InsertObject_detail.put("label2", 0l);
+		// InsertObject_detail.put("meter_cleaned2", 1111.22);
+		//
+		// JSONObject wrapperObject = new JSONObject();
+		// wrapperObject.put("QueryType", "insert");
+		// wrapperObject.put("Database", "db_wanda");
+		// wrapperObject.put("Datatable", "fjd_1_computedetail");
+		// wrapperObject.put("InsertObject", InsertObject_detail);
+		// Constant.agent.Query(wrapperObject);
+
+		JSONObject deleteObject = new JSONObject();
+		deleteObject.put("building", "4301050001");
+		deleteObject.put("meter", "1001");
+		deleteObject.put("funcid", 0l);
+		String[] time_periods = { "5min", "15min", "1h", "1d" };
+		for (String timePeriod : time_periods) {
+			deleteObject.put("time_period", timePeriod);
+			JSONObject range = new JSONObject();
+			range.put("$gte", "20170105000000");
+			range.put("$lte", "20170106000000");
+			deleteObject.put("data_time", range);
+			DBOperate.Instance().deleteData(deleteObject, "fjd_0_near");
+		}
+
+		System.exit(0);
+	}
+}

+ 116 - 0
src/main/java/.svn/text-base/TestPointList.java.svn-base

@@ -0,0 +1,116 @@
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.hbase.HBaseConfiguration;
+
+import com.persagy.compute.main.ComputeMain;
+import com.sagacloud.json.JSONArray;
+import com.sagacloud.json.JSONObject;
+import com.zillion.database.agent.ZillionAgent;
+
+public class TestPointList {
+	public static String database_name = "db_public";
+
+	public static void main(String[] args) throws Exception {
+		Configuration configuration = HBaseConfiguration.create();
+		String zookeeper_connectionAddress = "zookeeper1:2181,zookeeper2:2181,zookeeper3:2181";
+		int zookeeper_sessionTimeout = 300000;
+		ZillionAgent agent = new ZillionAgent(configuration, zookeeper_connectionAddress, zookeeper_sessionTimeout);
+		agent.Start();
+
+		JSONObject Criteria = new JSONObject();
+		JSONObject wrapperObject = new JSONObject();
+		wrapperObject.put("QueryType", "select");
+		wrapperObject.put("Database", database_name);
+		wrapperObject.put("Datatable", "dy_pointlist");
+		wrapperObject.put("Criteria", Criteria);
+		JSONObject queryResult = agent.Query(wrapperObject);
+		JSONArray resultContent = (JSONArray) queryResult.get("Content");
+
+		for (int i = 0; i < resultContent.size(); i++) {
+			JSONObject contentItem = (JSONObject) resultContent.get(i);
+			String building = (String) contentItem.get("building");
+			if (building.equals("1101080002")) {
+				contentItem.remove("building");
+				contentItem.put("building", "1101080001");
+
+				wrapperObject = new JSONObject();
+				wrapperObject.put("QueryType", "insert");
+				wrapperObject.put("Database", ComputeMain.database_name);
+				wrapperObject.put("Datatable", "dy_pointlist");
+				wrapperObject.put("InsertObject", contentItem);
+				agent.Query(wrapperObject);
+			}
+		}
+		Criteria = new JSONObject();
+		Criteria.put("building", "1101080002");
+		wrapperObject = new JSONObject();
+		wrapperObject.put("QueryType", "delete");
+		wrapperObject.put("Database", database_name);
+		wrapperObject.put("Datatable", "dy_pointlist");
+		wrapperObject.put("Criteria", Criteria);
+		agent.Query(wrapperObject);
+
+		// for (int i = 0; i < resultContent.size(); i++) {
+		// JSONObject contentItem = (JSONObject) resultContent.get(i);
+		// String building = (String) contentItem.get("building");
+		// String meter = (String) contentItem.get("meter");
+		// long funcid = (Long) contentItem.get("funcid");
+		// String data_type = (String) contentItem.get("data_type");
+		//
+		// Criteria = new JSONObject();
+		// Criteria.put("building", building);
+		// Criteria.put("meter", meter);
+		// Criteria.put("funcid", funcid);
+		// JSONObject Set = new JSONObject();
+		// if (data_type.equals("Acc")) {
+		// Set.put("collect_cycle", "15min");
+		// } else {
+		// Set.put("collect_cycle", "5min");
+		// }
+		// wrapperObject = new JSONObject();
+		// wrapperObject.put("QueryType", "update");
+		// wrapperObject.put("Database", ComputeMain.database_name);
+		// wrapperObject.put("Datatable", "dy_pointlist");
+		// wrapperObject.put("Criteria", Criteria);
+		// wrapperObject.put("Set", Set);
+		// agent.Query(wrapperObject);
+		// }
+		//
+		// int index_first = 0;
+		// for (int i = 1; i < resultContent.size() - 1; i++) {
+		// JSONObject item = (JSONObject) resultContent.get(i);
+		// String building = (String) item.get("building");
+		// String meter = (String) item.get("meter");
+		// JSONObject item_first = (JSONObject) resultContent.get(index_first);
+		// String building_first = (String) item_first.get("building");
+		// String meter_first = (String) item_first.get("meter");
+		// long funcid_first = (Long) item_first.get("funcid");
+		// if (building_first.equals(building) && meter_first.equals(meter)) {
+		// continue;
+		// }
+		//
+		// if (i - index_first == 9) {
+		// JSONObject item_final = (JSONObject) resultContent.get(i - 1);
+		// long funcid_final = (Long) item_final.get("funcid");
+		// if (funcid_first == 4 && funcid_final == 26) {
+		// JSONObject InsertObject = new JSONObject();
+		// InsertObject.put("building", building_first);
+		// InsertObject.put("meter", meter_first);
+		// InsertObject.put("funcid", 0L);
+		// InsertObject.put("data_type", "Acc");
+		// InsertObject.put("collect_cycle", "15min");
+		// wrapperObject = new JSONObject();
+		// wrapperObject.put("QueryType", "insert");
+		// wrapperObject.put("Database", ComputeMain.database_name);
+		// wrapperObject.put("Datatable", "dy_pointlist");
+		// wrapperObject.put("InsertObject", InsertObject);
+		// agent.Query(wrapperObject);
+		// }
+		// }
+		//
+		// index_first = i;
+		// }
+
+		agent.Stop();
+	}
+
+}

+ 63 - 0
src/main/java/.svn/text-base/TestResetCompute.java.svn-base

@@ -0,0 +1,63 @@
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.hbase.HBaseConfiguration;
+
+import com.sagacloud.json.JSONObject;
+import com.zillion.database.agent.ZillionAgent;
+
+public class TestResetCompute {
+	public static String database_name = "db_public";
+
+	public static void main(String[] args) throws Exception {
+		Configuration configuration = HBaseConfiguration.create();
+		String zookeeper_connectionAddress = "zookeeper1:2181,zookeeper2:2181,zookeeper3:2181";
+		int zookeeper_sessionTimeout = 300000;
+		ZillionAgent agent = new ZillionAgent(configuration, zookeeper_connectionAddress, zookeeper_sessionTimeout);
+		agent.Start();
+
+		JSONObject Criteria = new JSONObject();
+		JSONObject wrapperObject = new JSONObject();
+		wrapperObject.put("QueryType", "delete");
+		wrapperObject.put("Database", database_name);
+		wrapperObject.put("Datatable", "fjd_0_computelog");
+		wrapperObject.put("Criteria", Criteria);
+		agent.Query(wrapperObject);
+
+		Criteria = new JSONObject();
+		wrapperObject = new JSONObject();
+		wrapperObject.put("QueryType", "delete");
+		wrapperObject.put("Database", database_name);
+		wrapperObject.put("Datatable", "fjd_0_computedetail");
+		wrapperObject.put("Criteria", Criteria);
+		agent.Query(wrapperObject);
+
+		Criteria = new JSONObject();
+		wrapperObject = new JSONObject();
+		wrapperObject.put("QueryType", "delete");
+		wrapperObject.put("Database", database_name);
+		wrapperObject.put("Datatable", "fjd_0_metercomputetime");
+		wrapperObject.put("Criteria", Criteria);
+		agent.Query(wrapperObject);
+
+		Criteria = new JSONObject();
+		wrapperObject = new JSONObject();
+		wrapperObject.put("QueryType", "delete");
+		wrapperObject.put("Database", database_name);
+		wrapperObject.put("Datatable", "fjd_0_buildingcomputetime");
+		wrapperObject.put("Criteria", Criteria);
+		agent.Query(wrapperObject);
+
+		JSONObject InsertObject = new JSONObject();
+		InsertObject.put("building", "1101080001");
+		InsertObject.put("compute_time", "20170101000000");
+		InsertObject.put("first_compute_time", "20170101000000");
+		wrapperObject = new JSONObject();
+		wrapperObject.put("QueryType", "insert");
+		wrapperObject.put("Database", database_name);
+		wrapperObject.put("Datatable", "fjd_0_buildingcomputetime");
+		wrapperObject.put("InsertObject", InsertObject);
+		agent.Query(wrapperObject);
+
+		agent.Stop();
+	}
+
+}

+ 6 - 0
src/main/java/com/saga/entity/Data.java

@@ -0,0 +1,6 @@
+package com.saga.entity;
+
+public class Data {
+	public String value;
+	public String receivetime;
+}

+ 5 - 0
src/main/java/com/saga/entity/Device.java

@@ -0,0 +1,5 @@
+package com.saga.entity;
+
+public class Device {
+	public String MACID;
+}

+ 7 - 0
src/main/java/com/saga/entity/EntityHbase.java

@@ -0,0 +1,7 @@
+package com.saga.entity;
+
+public class EntityHbase {
+	public String Address;
+	public String UploadDatabase;
+	public String UploadTable;
+}

+ 11 - 0
src/main/java/com/saga/entity/EntityMysql.java

@@ -0,0 +1,11 @@
+package com.saga.entity;
+
+public class EntityMysql {
+	public String Ip;
+	public int Port;
+	public String User;
+	public String Password;
+	public String UploadDatabase;
+	public String UploadTable;
+
+}

+ 20 - 0
src/main/java/com/saga/entity/EntityPoint.java

@@ -0,0 +1,20 @@
+package com.saga.entity;
+
+public class EntityPoint {
+	public String building;
+	public String meter;
+	public long funcid;
+	public String system;
+	public String source;
+	public String address_1;
+	public String ip_port;
+	public String address_2;
+	public String address_3;
+	public String address_4;
+	public String data_type;
+	public String collect_cycle;
+	public String unit;
+	public String remark1;
+	public String remark2;
+	public String remark3;
+}

+ 5 - 0
src/main/java/com/saga/entity/Function.java

@@ -0,0 +1,5 @@
+package com.saga.entity;
+
+public class Function {
+	public long functionID;
+}

+ 11 - 0
src/main/java/com/saga/entity/Point.java

@@ -0,0 +1,11 @@
+package com.saga.entity;
+
+import java.util.HashSet;
+import java.util.Set;
+
+public class Point {
+	public String MAC;
+	public String buildingSign;
+	public String meterSign;
+	public Set<Function> functionList = new HashSet<Function>();
+}

+ 20 - 0
src/main/java/com/saga/entity/PointSet.java

@@ -0,0 +1,20 @@
+package com.saga.entity;
+
+public class PointSet {
+	public String uploadName;
+	public String address;
+	public String[] content;
+	public int ID;
+	public double sendTime = 0;
+	public double recTime = 0;
+	public String status;
+	public String buildingSignUP;
+	public String buildingSign;
+	public String mac;
+
+	public String meterSign;
+	public int funcID;
+	public String collectorMAC;
+	public String cmd;
+	public String dataSet;
+}

+ 13 - 0
src/main/java/com/saga/entity/Record.java

@@ -0,0 +1,13 @@
+package com.saga.entity;
+
+import java.util.Date;
+
+public class Record {
+	public String seq;
+	public String buildingSign;
+	public String meterSign;
+	public int funcID;
+	public Date receivetime;
+	public double data;
+	public String addtion;
+}

+ 13 - 0
src/main/java/com/saga/entity/RecordMsg.java

@@ -0,0 +1,13 @@
+package com.saga.entity;
+
+import java.util.Date;
+
+public class RecordMsg {
+	public String seq;
+	public String buildingSign;
+	public String meterSign;
+	public int funcID;
+	public Date receivetime;
+	public String data;
+	public String addtion;
+}

+ 8 - 0
src/main/java/com/saga/entity/Report.java

@@ -0,0 +1,8 @@
+package com.saga.entity;
+
+public class Report {
+	public String UploadName;
+	public int ReportID;
+	public long resend;
+	public Record record;
+}

+ 10 - 0
src/main/java/com/saga/entity/Server.java

@@ -0,0 +1,10 @@
+package com.saga.entity;
+
+public class Server {
+	public String IP;
+	public int Port;
+	public String PROTOCOL;
+	public String Mode;
+	public int Max_size;
+	public boolean compress;
+}

+ 16 - 0
src/main/java/com/saga/entity/Transfer.java

@@ -0,0 +1,16 @@
+package com.saga.entity;
+
+public class Transfer {
+	public String PROTOCOL;
+	public String IP;
+	public int Port;
+	public String ServerIP;
+	public int ServerPort;
+	public String Mode;
+	public int Max_size;
+	public int SleepCount;
+	public String Separate;
+	public String Separate_begin;
+	public String Separate_end;
+	public boolean compress;
+}

+ 720 - 0
src/main/java/com/saga/main/Main.java

@@ -0,0 +1,720 @@
+package com.saga.main;
+
+import java.sql.DriverManager;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.hadoop.conf.Configuration;
+import org.zillion.util.log.LogUtil;
+
+import com.saga.entity.EntityHbase;
+import com.saga.entity.EntityMysql;
+import com.saga.thread.common.CheckThread;
+import com.saga.thread.common.LoadConfigThread;
+import com.saga.thread.common.SaveThread;
+import com.saga.thread.common.StatsThread;
+import com.saga.thread.common.WTDBThread;
+import com.saga.thread.down.DownThread;
+import com.saga.thread.up.TransferThread;
+import com.saga.thread.up.UpThread;
+import com.saga.util.Constant;
+import com.zillion.database.agent.ZillionAgent;
+
+public class Main {
+	public static void main(String[] args) {
+		// TODO Auto-generated method stub
+		// 初始化
+		init(args);
+		// 业务进程启动
+		threadStart();
+	}
+
+	/**
+	 * 启动各业务线程
+	 */
+	private static void threadStart() {
+		// TODO Auto-generated method stub
+		// 点位状态监控
+		try {
+			new CheckThread().start();
+			Thread.sleep(3L);
+		} catch (Exception e) {
+			// TODO Auto-generated catch block
+			LogUtil.error("Main.threadStart.CheckThread: " + e.toString());
+		}
+		// 配置实时加载进程
+		try {
+			new LoadConfigThread().start();
+			Thread.sleep(Constant.Millisecond.SECOND_1);
+		} catch (Exception e) {
+			// TODO Auto-generated catch block
+			LogUtil.error("Main.threadStart.LoadConfigThread: " + e.toString());
+		}
+		// Down进程
+		try {
+			new DownThread(Constant.TypeServer.get("Down")).start();
+			Thread.sleep(3L);
+		} catch (Exception e) {
+			// TODO Auto-generated catch block
+			LogUtil.error("Main.threadStart.DownThread: " + e.toString());
+		}
+		// Up进程
+		try {
+			new UpThread(Constant.TypeServer.get("Up")).start();
+			Thread.sleep(3L);
+		} catch (Exception e) {
+			// TODO Auto-generated catch block
+			LogUtil.error("Main.threadStart.UpThread: " + e.toString());
+		}
+		// Transfer进程
+		try {
+			new TransferThread().start();
+			Thread.sleep(3L);
+		} catch (Exception e) {
+			// TODO Auto-generated catch block
+			LogUtil.error("Main.threadStart.TransferThread: " + e.toString());
+		}
+
+		// 数据处理进程
+		try {
+			new SaveThread().start();
+			Thread.sleep(3L);
+		} catch (Exception e) {
+			// TODO Auto-generated catch block
+			LogUtil.error("Main.threadStart.SaveThread: " + e.toString());
+		}
+		// 数据写库进程
+		try {
+			List<WTDBThread> wtdbthreadList = new ArrayList<WTDBThread>();
+			for (int i = 0; i < Constant.InsertThread; i++) {
+				WTDBThread thread = new WTDBThread();
+				thread.start();
+				wtdbthreadList.add(thread);
+			}
+		} catch (Exception e) {
+			// TODO Auto-generated catch block
+			LogUtil.error("Main.threadStart.WTDBThread: " + e.toString());
+		}
+
+		// 统计进程
+		try {
+			new StatsThread().start();
+			Thread.sleep(3L);
+		} catch (Exception e) {
+			// TODO Auto-generated catch block
+			LogUtil.error("Main.threadStart.StatsThread: " + e.toString());
+		}
+	}
+
+	/**
+	 * 初始化
+	 */
+	private static void init(String[] args) {
+		// TODO Auto-generated method stub
+		try {
+			// loadExcelConfig
+			LoadConfigThread.loadExcelConfig();
+			// DB 连接
+			dbConnect();
+			// 初始化数据库环境
+			initDB();
+			// 加载DB配置
+			loadDB();
+			//// 加载Config文件配置
+			// loadFileConfig();
+		} catch (Exception e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+			LogUtil.error("Main.init: " + e.toString());
+			System.exit(0);
+		}
+	}
+
+	// private static void loadFileConfig() {
+	// // TODO Auto-generated method stub
+	// // 加载采集器配置文件
+	// // 文件夹命名格式:config+"-"+楼号+"-"+mac序号,示例:config-1101080002-1
+	// Constant.getConfigFile(LogUtil.GetPath(), "config-", "port");
+	// // 采集器点位位置信息写入数据库
+	// for (Entry<String, String> pi : Constant.pointInfo.entrySet()) {
+	// String building = pi.getKey().split("-")[0];
+	// String mac = pi.getKey().split("-")[1];
+	// String node = mac;
+	// String point = pi.getKey().split("-")[2];
+	// String busno = pi.getValue().split("-")[0];
+	// String site = pi.getValue().split("-")[1];
+	// try {
+	// HBaseUtil.InsertPointInfo(Constant.agent,
+	// Constant.BuildingDB.get(building), building, node, point,
+	// busno, site);
+	// } catch (Exception e) {
+	// // TODO Auto-generated catch block
+	// e.printStackTrace();
+	// }
+	// // System.out.println(building + node + point + busno + site);
+	// }
+	// }
+
+	/**
+	 * DB 连接
+	 */
+	private static void dbConnect() {
+		// TODO Auto-generated method stub
+		if (Constant.DbConnection.containsKey("Db-Mysql")) {
+			mysqlConnect();
+		} else if (Constant.DbConnection.containsKey("Db-Hbase")) {
+			hbaseConnect();
+		}
+		if (Constant.DbConnection.containsKey("Upload-Mysql")) {
+			mysqlUploadConnect();
+		} else if (Constant.DbConnection.containsKey("Upload-Hbase")) {
+			hbaseUploadConnect();
+		}
+	}
+
+	/**
+	 * HBase 连接
+	 */
+	private static void hbaseUploadConnect() {
+		try {
+			EntityHbase entityHbase = new EntityHbase();
+			entityHbase = (EntityHbase) Constant.DbConnection.get("Db-Hbase");
+			Configuration configuration = new Configuration();
+			configuration.set("hbase.cluster.distributed", "true");
+			configuration.set("hbase.zookeeper.quorum", entityHbase.Address);
+			Constant.agentUpload = new ZillionAgent(configuration);
+			Constant.agentUpload.Start();
+		} catch (Exception e) {
+			e.printStackTrace();
+			LogUtil.error("Main.init.hbaseUploadConnect: " + e.toString());
+		}
+	}
+
+	/**
+	 * MySQL 连接
+	 */
+	private static void mysqlUploadConnect() {
+		try {
+			Class.forName("com.mysql.jdbc.Driver");
+			EntityMysql entityMysql = new EntityMysql();
+			entityMysql = (EntityMysql) Constant.DbConnection.get("Upload-Mysql");
+			Constant.connUpload = DriverManager.getConnection(
+					"jdbc:mysql://" + entityMysql.Ip + ":" + entityMysql.Port + "/", entityMysql.User,
+					entityMysql.Password);
+		} catch (Exception e) {
+			e.printStackTrace();
+			LogUtil.error("Main.init.mysqlUploadConnect: " + e.toString());
+		}
+	}
+
+	/**
+	 * MySQL 连接
+	 */
+	private static void mysqlConnect() {
+		// TODO Auto-generated method stub
+		try {
+			Class.forName("com.mysql.jdbc.Driver");
+			EntityMysql entityMysql = new EntityMysql();
+			entityMysql = (EntityMysql) Constant.DbConnection.get("Db-Mysql");
+			Constant.conn = DriverManager.getConnection("jdbc:mysql://" + entityMysql.Ip + ":" + entityMysql.Port + "/",
+					entityMysql.User, entityMysql.Password);
+		} catch (Exception e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+			LogUtil.error("Main.init.mysqlConnect: " + e.toString());
+		}
+	}
+
+	/**
+	 * 加载DB配置
+	 */
+	private static void loadDB() {
+		// TODO Auto-generated method stub
+		// // V1.0点位日志结构
+		// {
+		// loadStatus();
+		// }
+		// V2.0点位日志结构
+		{
+			// 先加载状态再加载列表,如无状态记录则根据列表生成null
+			// loadStatus2();
+			loadStatus2();
+			// loadPointList2();
+			loadPointList2();
+		}
+	}
+	//
+	// private static void loadPointList2() {
+	// // TODO Auto-generated method stub
+	// // 重新启动加载点位列表
+	// for (Entry<String, String> bd : Constant.BuildingDB.entrySet()) {
+	// try {
+	// String project = bd.getKey();
+	// String db = bd.getValue();
+	// HBaseUtil.LoadDB2Cache_dy_pointlist(Constant.agent, db, "dy_pointlist",
+	// project);
+	//
+	// } catch (Exception e) {
+	// // TODO Auto-generated catch block
+	// e.printStackTrace();
+	// LogUtil.error("Main.loadPointList2: " + e.toString());
+	// }
+	// }
+	// }
+
+	/**
+	 * 加载点位列表
+	 */
+	private static void loadPointList2() {
+		// TODO Auto-generated method stub
+		// 重新启动加载点位列表
+		Constant.loadDB2Cache_dy_pointlist();
+	}
+	// private static void loadStatus() {
+	// // TODO Auto-generated method stub
+	// // 重新启动加载节点、点位状态
+	// for (Entry<String, String> bd : Constant.BuildingDB.entrySet()) {
+	// try {
+	// String project = bd.getKey();
+	// String db = bd.getValue();
+	// HBaseUtil.GetCollectorStatus(Constant.agent, db, "pointgatewaystatus",
+	// project);
+	// HBaseUtil.GetPointStatus(Constant.agent, db, "pointstatus", project);
+	// } catch (Exception e) {
+	// // TODO Auto-generated catch block
+	// e.printStackTrace();
+	// LogUtil.error("Main.loadStatus: " + e.toString());
+	// }
+	// }
+	// }
+	//
+	// private static void loadStatus2() {
+	// // TODO Auto-generated method stub
+	// // 重新启动加载节点、点位状态
+	// for (Entry<String, String> bd : Constant.BuildingDB.entrySet()) {
+	// try {
+	// String project = bd.getKey();
+	// String db = bd.getValue();
+	// HBaseUtil.LoadDB2Cache_ps_physical_status(Constant.agent, db,
+	// "ps_physical_status", project);
+	// HBaseUtil.LoadDB2Cache_ps_virtual_meter_status(Constant.agent, db,
+	// "ps_virtual_meter_status", project);
+	// HBaseUtil.LoadDB2Cache_ps_virtual_point_status(Constant.agent, db,
+	// "ps_virtual_point_status", project);
+	// HBaseUtil.LoadDB2Cache_ps_virtual_project_status(Constant.agent, db,
+	// "ps_virtual_project_status",
+	// project);
+	//
+	// } catch (Exception e) {
+	// // TODO Auto-generated catch block
+	// e.printStackTrace();
+	// LogUtil.error("Main.loadStatus2: " + e.toString());
+	// }
+	// }
+	// }
+
+	/**
+	 * 加载点位状态
+	 */
+	private static void loadStatus2() {
+		// TODO Auto-generated method stub
+		// 重新启动加载节点、点位状态
+		try {
+			Constant.LoadDB2Cache_ps_physical_status(Constant.Database, "ps_physical_status");
+			Constant.LoadDB2Cache_ps_virtual_meter_status(Constant.Database, "ps_virtual_meter_status");
+			Constant.LoadDB2Cache_ps_virtual_point_status(Constant.Database, "ps_virtual_point_status");
+			Constant.LoadDB2Cache_ps_virtual_project_status(Constant.Database, "ps_virtual_project_status");
+		} catch (Exception e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+			LogUtil.error("Main.loadStatus2: " + e.toString());
+		}
+	}
+
+	/**
+	 * 初始化数据库环境
+	 */
+	private static void initDB() {
+		// TODO Auto-generated method stub
+		try {
+			// createDB(db);
+			Constant.CreateDB(Constant.Database);
+			Thread.sleep(Constant.Millisecond.SECOND_1);
+
+			// // V1.0点位日志结构
+			// {
+			// Thread.sleep(Constant.Millisecond.SECOND_1);
+			// // dropTB(db);
+			// // Thread.sleep(Constant.Millisecond.SECOND_1);
+			// createTB(db);
+			// }
+
+			// V2.0点位日志结构
+			{
+				// dropTB2(db);
+				// Thread.sleep(Constant.Millisecond.SECOND_1);
+				// createTB2(db);
+				createTB2(Constant.Database);
+			}
+
+			Thread.sleep(Constant.Millisecond.SECOND_1);
+		} catch (Exception e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		}
+	}
+
+	// private static void createTB2(String db) {
+	// // TODO Auto-generated method stub
+	// try {
+	// HBaseUtil.CreateTable(Constant.agent, db, "original_month");
+	// Thread.sleep(Constant.Millisecond.SECOND_3);
+	// HBaseUtil.CreateTable_present(Constant.agent, db, "original_present");
+	// Thread.sleep(Constant.Millisecond.SECOND_3);
+	// HBaseUtil.CreateTable_set(Constant.agent, db, "originalset");
+	// Thread.sleep(Constant.Millisecond.SECOND_3);
+	// HBaseUtil.CreateTable_setpresent(Constant.agent, db,
+	// "originalset_present");
+	// Thread.sleep(Constant.Millisecond.SECOND_3);
+	// // dy_pointlist
+	// HBaseUtil.CreateTable_dy_pointlist(Constant.agent, db, "dy_pointlist");
+	// Thread.sleep(Constant.Millisecond.SECOND_3);
+	// // fjd_0_buildingcomputetime
+	// HBaseUtil.CreateTable_fjd_0_buildingcomputetime(Constant.agent, db,
+	// "fjd_0_buildingcomputetime");
+	// Thread.sleep(Constant.Millisecond.SECOND_3);
+	//
+	// // ps_physical_status
+	// HBaseUtil.CreateTable_ps_physical_status(Constant.agent, db,
+	// "ps_physical_status");
+	// Thread.sleep(Constant.Millisecond.SECOND_3);
+	//
+	// // ps_physical_log
+	// HBaseUtil.CreateTable_ps_physical_log(Constant.agent, db,
+	// "ps_physical_log");
+	// Thread.sleep(Constant.Millisecond.SECOND_3);
+	//
+	// // ps_virtual_point_status
+	// HBaseUtil.CreateTable_ps_virtual_point_status(Constant.agent, db,
+	// "ps_virtual_point_status");
+	// Thread.sleep(Constant.Millisecond.SECOND_3);
+	//
+	// // ps_virtual_point_log
+	// HBaseUtil.CreateTable_ps_virtual_point_log(Constant.agent, db,
+	// "ps_virtual_point_log");
+	// Thread.sleep(Constant.Millisecond.SECOND_3);
+	//
+	// // ps_virtual_meter_status
+	// HBaseUtil.CreateTable_ps_virtual_meter_status(Constant.agent, db,
+	// "ps_virtual_meter_status");
+	// Thread.sleep(Constant.Millisecond.SECOND_3);
+	//
+	// // ps_virtual_meter_log
+	// HBaseUtil.CreateTable_ps_virtual_meter_log(Constant.agent, db,
+	// "ps_virtual_meter_log");
+	// Thread.sleep(Constant.Millisecond.SECOND_3);
+	//
+	// // ps_virtual_project_status
+	// HBaseUtil.CreateTable_ps_virtual_project_status(Constant.agent, db,
+	// "ps_virtual_project_status");
+	// Thread.sleep(Constant.Millisecond.SECOND_3);
+	//
+	// // ps_virtual_project_log
+	// HBaseUtil.CreateTable_ps_virtual_project_log(Constant.agent, db,
+	// "ps_virtual_project_log");
+	// Thread.sleep(Constant.Millisecond.SECOND_3);
+	//
+	// Thread.sleep(Constant.Millisecond.SECOND_30);
+	// } catch (Exception e) {
+	// // TODO Auto-generated catch block
+	// e.printStackTrace();
+	// LogUtil.error("Main.createTB2: " + e.toString());
+	// }
+	// }
+
+	/**
+	 * 初始化建表
+	 */
+	private static void createTB2(String db) {
+		// TODO Auto-generated method stub
+		try {
+			// original_month
+			Constant.CreateTable(db, "original_month");
+			Thread.sleep(Constant.Millisecond.SECOND_1);
+			// original_detail
+			Constant.CreateTable_detail(db, "original_detail");
+			Thread.sleep(Constant.Millisecond.SECOND_1);
+			// original_upload
+			Constant.CreateTable_upload();
+			Thread.sleep(Constant.Millisecond.SECOND_1);
+			// original_present
+			Constant.CreateTable_present(db, "original_present");
+			Thread.sleep(Constant.Millisecond.SECOND_1);
+			// originalset
+			Constant.CreateTable_set(db, "originalset");
+			Thread.sleep(Constant.Millisecond.SECOND_1);
+			// originalset_present
+			Constant.CreateTable_setpresent(db, "originalset_present");
+			Thread.sleep(Constant.Millisecond.SECOND_1);
+			// dy_pointlist
+			Constant.CreateTable_dy_pointlist(db, "dy_pointlist");
+			Thread.sleep(Constant.Millisecond.SECOND_1);
+			// fjd_0_buildingcomputetime
+			Constant.CreateTable_fjd_0_buildingcomputetime(db, "fjd_0_buildingcomputetime");
+			Thread.sleep(Constant.Millisecond.SECOND_1);
+
+			// ps_physical_status
+			Constant.CreateTable_ps_physical_status(db, "ps_physical_status");
+			Thread.sleep(Constant.Millisecond.SECOND_1);
+
+			// ps_physical_log
+			Constant.CreateTable_ps_physical_log(db, "ps_physical_log");
+			Thread.sleep(Constant.Millisecond.SECOND_1);
+
+			// ps_virtual_point_status
+			Constant.CreateTable_ps_virtual_point_status(db, "ps_virtual_point_status");
+			Thread.sleep(Constant.Millisecond.SECOND_1);
+
+			// ps_virtual_point_log
+			Constant.CreateTable_ps_virtual_point_log(db, "ps_virtual_point_log");
+			Thread.sleep(Constant.Millisecond.SECOND_1);
+
+			// ps_virtual_meter_status
+			Constant.CreateTable_ps_virtual_meter_status(db, "ps_virtual_meter_status");
+			Thread.sleep(Constant.Millisecond.SECOND_1);
+
+			// ps_virtual_meter_log
+			Constant.CreateTable_ps_virtual_meter_log(db, "ps_virtual_meter_log");
+			Thread.sleep(Constant.Millisecond.SECOND_1);
+
+			// ps_virtual_project_status
+			Constant.CreateTable_ps_virtual_project_status(db, "ps_virtual_project_status");
+			Thread.sleep(Constant.Millisecond.SECOND_1);
+
+			// ps_virtual_project_log
+			Constant.CreateTable_ps_virtual_project_log(db, "ps_virtual_project_log");
+			Thread.sleep(Constant.Millisecond.SECOND_1);
+
+			Thread.sleep(Constant.Millisecond.SECOND_3);
+		} catch (Exception e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+			LogUtil.error("Main.init.initDB.createTB2: " + e.toString());
+		}
+	}
+	//
+	// private static void dropTB2(String db) {
+	// // TODO Auto-generated method stub
+	// try {
+	// // Constant.agent.DDL_DropTable(db, "original_month");
+	// // Thread.sleep(Constant.Millisecond.SECOND_3);
+	// // Constant.agent.DDL_DropTable(db, "original_present");
+	// // Thread.sleep(Constant.Millisecond.SECOND_3);
+	// // Constant.agent.DDL_DropTable(db, "originalset");
+	// // Thread.sleep(Constant.Millisecond.SECOND_3);
+	// // Constant.agent.DDL_DropTable(db, "originalset_present");
+	// // Thread.sleep(Constant.Millisecond.SECOND_3);
+	// // // dy_pointlist
+	// // Constant.agent.DDL_DropTable(db, "dy_pointlist");
+	// // Thread.sleep(Constant.Millisecond.SECOND_3);
+	//
+	// // ps_physical_status
+	// Constant.agent.DDL_DropTable(db, "ps_physical_status");
+	// Thread.sleep(Constant.Millisecond.SECOND_3);
+	//
+	// // ps_physical_log
+	// Constant.agent.DDL_DropTable(db, "ps_physical_log");
+	// Thread.sleep(Constant.Millisecond.SECOND_3);
+	//
+	// // ps_virtual_point_status
+	// Constant.agent.DDL_DropTable(db, "ps_virtual_point_status");
+	// Thread.sleep(Constant.Millisecond.SECOND_3);
+	//
+	// // ps_virtual_point_log
+	// Constant.agent.DDL_DropTable(db, "ps_virtual_point_log");
+	// Thread.sleep(Constant.Millisecond.SECOND_3);
+	//
+	// // ps_virtual_meter_status
+	// Constant.agent.DDL_DropTable(db, "ps_virtual_meter_status");
+	// Thread.sleep(Constant.Millisecond.SECOND_3);
+	//
+	// // ps_virtual_meter_log
+	// Constant.agent.DDL_DropTable(db, "ps_virtual_meter_log");
+	// Thread.sleep(Constant.Millisecond.SECOND_3);
+	//
+	// // ps_virtual_project_status
+	// Constant.agent.DDL_DropTable(db, "ps_virtual_project_status");
+	// Thread.sleep(Constant.Millisecond.SECOND_3);
+	//
+	// // ps_virtual_project_log
+	// Constant.agent.DDL_DropTable(db, "ps_virtual_project_log");
+	// Thread.sleep(Constant.Millisecond.SECOND_3);
+	//
+	// Thread.sleep(Constant.Millisecond.SECOND_30);
+	// } catch (Exception e) {
+	// // TODO Auto-generated catch block
+	// e.printStackTrace();
+	// }
+	// }
+
+	// private static void createTB(String db) {
+	// // TODO Auto-generated method stub
+	// try {
+	// HBaseUtil.CreateTable(Constant.agent, db, "original_month");
+	// Thread.sleep(Constant.Millisecond.SECOND_3);
+	// HBaseUtil.CreateTable_present(Constant.agent, db, "original_present");
+	// Thread.sleep(Constant.Millisecond.SECOND_3);
+	// HBaseUtil.CreateTable_set(Constant.agent, db, "originalset");
+	// Thread.sleep(Constant.Millisecond.SECOND_3);
+	// HBaseUtil.CreateTable_setpresent(Constant.agent, db,
+	// "originalset_present");
+	// Thread.sleep(Constant.Millisecond.SECOND_3);
+	// HBaseUtil.CreateTable_CollectorStatus(Constant.agent, db,
+	// "pointgatewaystatus");
+	// Thread.sleep(Constant.Millisecond.SECOND_3);
+	// HBaseUtil.CreateTable_CollectorCommunicationLog(Constant.agent, db,
+	// "pointgatewaylog");
+	// Thread.sleep(Constant.Millisecond.SECOND_3);
+	// HBaseUtil.CreateTable_PointStatus(Constant.agent, db, "pointstatus");
+	// Thread.sleep(Constant.Millisecond.SECOND_3);
+	// HBaseUtil.CreateTable_PointCommunicationLog(Constant.agent, db,
+	// "pointlog");
+	// Thread.sleep(Constant.Millisecond.SECOND_3);
+	// HBaseUtil.CreateTable_PointInfo(Constant.agent, db, "pointinfo");
+	// } catch (Exception e) {
+	// // TODO Auto-generated catch block
+	// e.printStackTrace();
+	// }
+	// }
+
+	// private static void dropTB(String db) {
+	// // TODO Auto-generated method stub
+	// try {
+	// // Constant.agent.DDL_DropTable(db, "original_month");
+	// // Thread.sleep(Constant.Millisecond.SECOND_3);
+	// // Constant.agent.DDL_DropTable(db, "original_present");
+	// // Thread.sleep(Constant.Millisecond.SECOND_3);
+	// // Constant.agent.DDL_DropTable(db, "originalset");
+	// // Thread.sleep(Constant.Millisecond.SECOND_3);
+	// // Constant.agent.DDL_DropTable(db, "originalset_present");
+	// Thread.sleep(Constant.Millisecond.SECOND_3);
+	// Constant.agent.DDL_DropTable(db, "collectorstatus");
+	// Thread.sleep(Constant.Millisecond.SECOND_3);
+	// Constant.agent.DDL_DropTable(db, "collectorcommunicationlog");
+	// Thread.sleep(Constant.Millisecond.SECOND_3);
+	// Constant.agent.DDL_DropTable(db, "pointstatus");
+	// Thread.sleep(Constant.Millisecond.SECOND_3);
+	// Constant.agent.DDL_DropTable(db, "pointcommunicationlog");
+	// Thread.sleep(Constant.Millisecond.SECOND_3);
+	// Constant.agent.DDL_DropTable(db, "pointinfo");
+	// Thread.sleep(Constant.Millisecond.SECOND_30);
+	// } catch (Exception e) {
+	// // TODO Auto-generated catch block
+	// e.printStackTrace();
+	// }
+	// }
+
+	// private static void createDB(String db) {
+	// // TODO Auto-generated method stub
+	// try {
+	// HBaseUtil.CreateDB(Constant.agent, db);
+	// } catch (Exception e) {
+	// // TODO Auto-generated catch block
+	// e.printStackTrace();
+	// }
+	// }
+
+	// private static void createAgentsDB(String db) {
+	// // TODO Auto-generated method stub
+	// try {
+	// HBaseUtil.CreateDB(db);
+	// Thread.sleep(1000L);
+	// } catch (Exception e) {
+	// // TODO Auto-generated catch block
+	// e.printStackTrace();
+	// }
+	//
+	// }
+
+	// private static void agentStart(String[] args) {
+	// // TODO Auto-generated method stub
+	// try {
+	// String resource = "/hbase-site.xml";
+	// Configuration configuration = new Configuration();
+	//
+	// configuration.addResource(new
+	// FileInputStream(System.getProperty("user.dir") + resource));
+	// String zookeeper_connectionAddress =
+	// "zookeeper1:2181,zookeeper2:2181,zookeeper3:2181";
+	//
+	// if (args != null && args.length > 0 && "test".equalsIgnoreCase(args[0]))
+	// {
+	// // zookeeper_connectionAddress =
+	// // "zk01.td.com:2181,zk02.td.com:2181,zk03.td.com:2181";
+	// zookeeper_connectionAddress = "zookeeper1,zookeeper2,zookeeper3";
+	// }
+	//
+	// int zookeeper_sessionTimeout = 300000;
+	// Constant.agent = new ZillionAgent(configuration,
+	// zookeeper_connectionAddress, zookeeper_sessionTimeout);
+	//
+	// Constant.agent.Start();
+	// // LogUtil.info("" + Constant.BuildingDB);
+	// // LogUtil.info("" + Constant.BuildingAdds);
+	// // LogUtil.info("" + Constant.BuildingConv);
+	//
+	// } catch (Exception e) {
+	// // TODO Auto-generated catch block
+	// LogUtil.error("Main.init.agentStart: " + e.toString());
+	// }
+	// }
+
+	/**
+	 * HBase 连接
+	 */
+	private static void hbaseConnect() {
+		// TODO Auto-generated method stub
+		// try {
+		// String resource = "/hbase-site.xml";
+		// Configuration configuration = new Configuration();
+		// configuration.addResource(new
+		// FileInputStream(System.getProperty("user.dir") + resource));
+		// int zookeeper_sessionTimeout = 300000;
+
+		// List<String> qrlist = new ArrayList<String>();
+		// qrlist.add("zookeeper1:2181,zookeeper2:2181,zookeeper3:2181");
+		// qrlist.add("zookeeper1,zookeeper2,zookeeper3");
+		// qrlist.add("zookeeper1.saga");
+		// qrlist.add("zookeeper");
+
+		// for (String qr : qrlist) {
+		try {
+			EntityHbase entityHbase = new EntityHbase();
+			entityHbase = (EntityHbase) Constant.DbConnection.get("Db-Hbase");
+			Configuration configuration = new Configuration();
+			configuration.set("hbase.cluster.distributed", "true");
+			configuration.set("hbase.zookeeper.quorum", entityHbase.Address);
+			Constant.agent = new ZillionAgent(configuration);
+			Constant.agent.Start();
+		} catch (Exception e) {
+			e.printStackTrace();
+			LogUtil.error("Main.init.hbaseConnect: " + e.toString());
+		}
+		// }
+		// Constant.agents.add(new ZillionAgent(configuration,
+		// "zookeeper1:2181,zookeeper2:2181,zookeeper3:2181",
+		// zookeeper_sessionTimeout));
+		// Constant.agents
+		// .add(new ZillionAgent(configuration,
+		// "zookeeper1,zookeeper2,zookeeper3", zookeeper_sessionTimeout));
+		// Constant.agents.add(new ZillionAgent(configuration, "zookeeper1",
+		// zookeeper_sessionTimeout));
+		// Constant.agents.add(new ZillionAgent(configuration,
+		// "zookeeper1.saga", zookeeper_sessionTimeout));
+
+		// } catch (Exception e) {
+		// // TODO Auto-generated catch block
+		// LogUtil.error("Main.init.hbaseConnect: " + e.toString());
+		// }
+	}
+}

+ 316 - 0
src/main/java/com/saga/test/ShenQI.java

@@ -0,0 +1,316 @@
+package com.saga.test;
+
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.OutputStream;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Map.Entry;
+
+import org.apache.hadoop.conf.Configuration;
+import org.apache.poi.hssf.usermodel.HSSFRow;
+import org.apache.poi.hssf.usermodel.HSSFSheet;
+import org.apache.poi.hssf.usermodel.HSSFWorkbook;
+import org.zillion.util.log.LogUtil;
+
+import com.saga.util.Constant;
+import com.sagacloud.json.JSONArray;
+import com.sagacloud.json.JSONObject;
+import com.zillion.database.agent.ZillionAgent;
+
+public class ShenQI {
+	public ShenQI() {
+
+	}
+
+	static Map<String, String> meterList = new HashMap<String, String>();
+	static Map<String, Map<String, Map<String, Double>>> dataList = new HashMap<String, Map<String, Map<String, Double>>>();
+	static Map<String, String> funcList = new HashMap<String, String>();
+	static ZillionAgent agent;
+	static String building = "1101010001";
+
+	public static void main(String[] args) {
+		// TODO Auto-generated method stub
+		try {
+			String resource = "/hbase-site.xml";
+			Configuration configuration = new Configuration();
+
+			configuration.addResource(new FileInputStream(System.getProperty("user.dir") + resource));
+			String zookeeper_connectionAddress = "zookeeper1:2181,zookeeper2:2181,zookeeper3:2181";
+			int zookeeper_sessionTimeout = 300000;
+			//agent = new ZillionAgent(configuration, zookeeper_connectionAddress, zookeeper_sessionTimeout);
+			agent = new ZillionAgent(configuration);
+			agent.Start();
+			Thread.sleep(10L);
+			// 创建HSSFWorkbook对象(excel的文档对象)
+
+			GetPointList(agent, "db_time_data", "dy_pointlist", building);
+
+			// String timefrom = "20171001000000";
+			// String timeto = "20171101000000";
+			// export2(timefrom, timeto);
+			// timefrom = "20171101000000";
+			// timeto = "20171201000000";
+			// export2(timefrom, timeto);
+			// timefrom = "20180301000000";
+			// timeto = "20180401000000";
+			// export2(timefrom, timeto);
+			// timefrom = "20180701000000";
+			// timeto = "20180801000000";
+			// export2(timefrom, timeto);
+			String timefrom = "20171001000000";
+			String timeto = "20180814000000";
+			Calendar calendarFrom = Calendar.getInstance();
+			Calendar calendarTo = Calendar.getInstance();
+			Date from = Constant.parse(timefrom);
+			Date to = Constant.parse(timeto);
+			calendarFrom.setTime(from);
+			calendarTo.setTime(to);
+			while (calendarFrom.before(calendarTo)) {
+				Date datetmp = calendarFrom.getTime();
+				calendarFrom.add(Calendar.MONTH, 1);
+
+				export2(Constant.format(datetmp), Constant.format(calendarFrom.getTime()));
+			}
+			// export2(timefrom, timeto);
+
+		} catch (Exception e) {
+			// TODO Auto-generated catch block
+			LogUtil.error("Main: " + e.toString());
+		}
+	}
+
+	private static void export2(String timefrom, String timeto) {
+		// TODO Auto-generated method stub
+
+		try {
+			LogUtil.info("get data begin...");
+			LogUtil.info("from " + Constant.parse(timefrom) + " to " + Constant.parse(timeto));
+
+			HSSFWorkbook wb = new HSSFWorkbook();
+
+			for (Entry<String, String> m : meterList.entrySet()) {
+				LogUtil.info("create sheet " + m.getKey());
+				HSSFSheet sheet = wb.createSheet(m.getKey());
+				// 抬头
+				HSSFRow row = sheet.createRow(0);
+				row.createCell(1).setCellValue("meter");
+				row.createCell(2).setCellValue("funcid");
+				row.createCell(3).setCellValue("receivetime");
+				row.createCell(4).setCellValue("data");
+				int r = 0;
+				for (Entry<String, String> funcid : funcList.entrySet()) {
+
+					try {
+						Map<String, Double> data = new HashMap<String, Double>();
+						data = GetFJD(agent, "db_time_data", "fjd_0_near_15min", building, m.getKey(),
+								Long.parseLong(funcid.getKey()), timefrom, timeto);
+						// 数据
+						for (Entry<String, Double> d : data.entrySet()) {
+							r++;
+							row = sheet.createRow(r);
+							row.createCell(1).setCellValue(m.getKey());
+							row.createCell(2).setCellValue(funcid.getKey());
+							row.createCell(3).setCellValue(d.getKey());
+							row.createCell(4).setCellValue(d.getValue());
+						}
+						Thread.sleep(10L);
+					} catch (Exception e) {
+						// TODO Auto-generated catch block
+						e.printStackTrace();
+					}
+				}
+			}
+			LogUtil.info("get data end...");
+			LogUtil.info("insert excel start...");
+
+			// 输出Excel文件
+			OutputStream output = new FileOutputStream("d:/data" + timefrom.substring(0, 6) + ".xls");
+			wb.write(output);
+			output.close();
+			LogUtil.info("insert excel end...");
+		} catch (Exception e1) {
+			// TODO Auto-generated catch block
+			e1.printStackTrace();
+		}
+	}
+
+	private static void export(String timefrom, String timeto) {
+		// TODO Auto-generated method stub
+
+		try {
+			LogUtil.info("get data begin...");
+			LogUtil.info("from " + Constant.parse(timefrom) + " to " + Constant.parse(timeto));
+
+			HSSFWorkbook wb = new HSSFWorkbook();
+			for (Entry<String, String> m : meterList.entrySet()) {
+				for (Entry<String, String> funcid : funcList.entrySet()) {
+
+					// 建立新的sheet对象(excel的表单)
+					// LogUtil.info("create sheet " + timefrom.substring(0,
+					// 8)+"~"+ timeto.substring(0, 8));
+					// HSSFSheet sheet = wb.createSheet(timefrom.substring(0,
+					// 8)+"~"+ timeto.substring(0, 8));
+					LogUtil.info("create sheet " + m.getKey() + "-" + funcid.getKey());
+					HSSFSheet sheet = wb.createSheet(m.getKey() + "-" + funcid.getKey());
+					// 抬头
+					HSSFRow row = sheet.createRow(1);
+					row.createCell(1).setCellValue("meter");
+					row.createCell(2).setCellValue("funcid");
+					row.createCell(3).setCellValue("receivetime");
+					row.createCell(4).setCellValue("data");
+					int r = 0;
+
+					try {
+						Map<String, Double> data = new HashMap<String, Double>();
+						data = GetOriginal(agent, "db_time_data", "original_month", building, m.getKey(),
+								Long.parseLong(funcid.getKey()), timefrom, timeto);
+						// 数据
+						for (Entry<String, Double> d : data.entrySet()) {
+
+							r++;
+							row = sheet.createRow(r);
+							row.createCell(1).setCellValue(m.getKey());
+							row.createCell(2).setCellValue(funcid.getKey());
+							row.createCell(3).setCellValue(d.getKey());
+							row.createCell(4).setCellValue(d.getValue());
+						}
+						Thread.sleep(10L);
+					} catch (Exception e) {
+						// TODO Auto-generated catch block
+						e.printStackTrace();
+					}
+				}
+			}
+			LogUtil.info("get data end...");
+			LogUtil.info("insert excel start...");
+
+			// 输出Excel文件
+			OutputStream output = new FileOutputStream(
+					"d:/data" + timefrom.substring(0, 8) + "-" + timeto.substring(0, 8) + ".xls");
+			wb.write(output);
+			output.close();
+			LogUtil.info("insert excel end...");
+		} catch (Exception e1) {
+			// TODO Auto-generated catch block
+			e1.printStackTrace();
+		}
+	}
+
+	private static Map<String, Double> GetFJD(ZillionAgent agent, String db, String tb, String building, String meter,
+			long funcid, String query_from, String query_to) throws Exception {
+		Map<String, Double> result = new HashMap<String, Double>();
+		JSONObject Criteria = new JSONObject();
+		Criteria.put("building", building);
+		Criteria.put("meter", meter);
+		Criteria.put("funcid", funcid);
+		JSONObject range = new JSONObject();
+		range.put("$gte", query_from);
+		range.put("$lte", query_to);
+		Criteria.put("data_time", range);
+		JSONObject wrapperObject = new JSONObject();
+		wrapperObject.put("QueryType", "select");
+		wrapperObject.put("Database", db);
+		wrapperObject.put("Datatable", tb);
+		wrapperObject.put("Criteria", Criteria);
+		JSONObject queryResult = agent.Query(wrapperObject);
+		JSONArray resultContent = (JSONArray) queryResult.get("Content");
+
+		// LogUtil.info("GetFJD" + " " + db + " " + tb + " " + building + " " +
+		// meter + " " + funcid + " " + query_from
+		// + " " + query_to);
+		for (int i = 0; i < resultContent.size(); i++) {
+			JSONObject dataItem = (JSONObject) resultContent.get(i);
+			String receivetime = (String) dataItem.get("data_time");
+			Double data = (Double) dataItem.get("data_value");
+			result.put(receivetime, data);
+			// dataList.get(meter).get(String.valueOf(funcid)).put(receivetime,
+			// data);
+			// LogUtil.info(("receivetime " + receivetime + " data:" + data));
+		}
+		return result;
+	}
+
+	private static Map<String, Double> GetOriginal(ZillionAgent agent, String db, String tb, String building,
+			String meter, long funcid, String query_from, String query_to) throws Exception {
+		Map<String, Double> result = new HashMap<String, Double>();
+		JSONObject Criteria = new JSONObject();
+		Criteria.put("building", building);
+		Criteria.put("meter", meter);
+		Criteria.put("funcid", funcid);
+		JSONObject range = new JSONObject();
+		range.put("$gte", query_from);
+		range.put("$lte", query_to);
+		Criteria.put("receivetime", range);
+		JSONObject wrapperObject = new JSONObject();
+		wrapperObject.put("QueryType", "select");
+		wrapperObject.put("Database", db);
+		wrapperObject.put("Datatable", tb);
+		wrapperObject.put("Criteria", Criteria);
+		JSONObject queryResult = agent.Query(wrapperObject);
+		JSONArray resultContent = (JSONArray) queryResult.get("Content");
+
+		LogUtil.info("GetOriginal" + " " + db + " " + tb + " " + building + " " + meter + " " + funcid + " "
+				+ query_from + " " + query_to);
+		for (int i = 0; i < resultContent.size(); i++) {
+			JSONObject dataItem = (JSONObject) resultContent.get(i);
+
+			String receivetime = (String) dataItem.get("receivetime");
+			Double data = (Double) dataItem.get("data");
+			result.put(receivetime, data);
+			// dataList.get(meter).get(String.valueOf(funcid)).put(receivetime,
+			// data);
+			// LogUtil.info(("receivetime " + receivetime + " data:" + data));
+		}
+		return result;
+	}
+
+	private static void GetPointList(ZillionAgent agent, String db, String tb, String building) throws Exception {
+
+		JSONObject Criteria = new JSONObject();
+		Criteria.put("building", building);
+
+		JSONObject wrapperObject = new JSONObject();
+		wrapperObject.put("QueryType", "select");
+		wrapperObject.put("Database", db);
+		wrapperObject.put("Datatable", tb);
+		wrapperObject.put("Criteria", Criteria);
+		JSONObject queryResult = agent.Query(wrapperObject);
+		JSONArray resultContent = (JSONArray) queryResult.get("Content");
+
+		for (int i = 0; i < resultContent.size(); i++) {
+			JSONObject dataItem = (JSONObject) resultContent.get(i);
+
+			meterList.put(String.valueOf(dataItem.get("meter")), null);
+			funcList.put(String.valueOf(dataItem.get("funcid")), null);
+
+		}
+	}
+
+	private static void Set_buildingcomputetime(ZillionAgent agent, String db, String tb, String building,
+			String compute_time) throws Exception {
+		JSONObject Criteria = new JSONObject();
+		Criteria.put("building", building);
+		JSONObject Set = new JSONObject();
+		Set.put("compute_time", compute_time);
+		JSONObject wrapperObject = new JSONObject();
+		wrapperObject.put("QueryType", "update");
+		wrapperObject.put("Database", db);
+		wrapperObject.put("Datatable", tb);
+		wrapperObject.put("Criteria", Criteria);
+		wrapperObject.put("Set", Set);
+		agent.Query(wrapperObject);
+		LogUtil.info(wrapperObject.toFormatString());
+	}
+
+	private static boolean in(long[] funcs, long funcid) {
+		for (long func : funcs) {
+			if (func == funcid) {
+				return true;
+			}
+		}
+		return false;
+	}
+}

+ 85 - 0
src/main/java/com/saga/test/Simulator.java

@@ -0,0 +1,85 @@
+package com.saga.test;
+
+import org.zillion.util.log.LogUtil;
+
+import com.persagy.communication.entity.Packet;
+import com.persagy.communication.entity.PacketEntity;
+import com.persagy.communication.mina.udp.server.UDPServerManager;
+import com.persagy.communication.util.IServerManager;
+import com.saga.util.Constant;
+
+public class Simulator {
+
+	private static final String MAC = "AC-CF-23-E9-3C-22";
+	private static long needSend = 0l;
+	private static IServerManager simulator = new UDPServerManager("0.0.0.0", 9756, "utf-8", 1000);
+
+	private static boolean needSend() {
+		if (System.currentTimeMillis() - needSend > Constant.Millisecond.MINUTE_1) {
+			needSend = System.currentTimeMillis();
+			return true;
+		}
+		return false;
+	}
+
+	public static void main(String[] args) {
+		// TODO Auto-generated method stub
+
+		simulator.Start();
+		simulator.AllowJustSend_UDP(true);
+		while (true) {
+			PacketEntity p;
+			p = simulator.PopRece();
+			returnReport(p);
+			sendReport();
+
+		}
+	}
+
+	private static void returnReport(PacketEntity p) {
+		// TODO Auto-generated method stub
+		try {
+			if ((p != null) && (p.content != null) && (p.content.packetString != null)
+					&& (p.content.packetString.length() > 0)) {
+				LogUtil.info(simulator.Name() + " PopRece:" + p.address + " " + p.content.packetString);
+				String[] rList = p.content.packetString.replace("(", "").replace(")", "").replace(" ", "").split(";");
+				// (00-50-56-C0-00-08; control;1255581314001;2;21;0;22;1;)
+				// (00-50-56-C0-00-08;controlack;1255581314001;1;)
+				if ("control".equalsIgnoreCase(rList[1])) {
+					simulator.AppendToSend(p.address,
+							new Packet("(" + rList[0] + ";" + "controlack" + ";" + rList[2] + ";1;" + ")"));
+					LogUtil.info(simulator.Name() + " AppendToSend:" + p.address + " " + "(" + rList[0] + ";"
+							+ "reportack" + ";" + rList[2] + ")");
+					// (00-50-56-C0-00-08; get;1255581314001;)
+					// (00-50-56-C0-00-08;getack;1255581314001;9;11;22.3;12;33.3;13;32.3;14;22.2;
+					// 21;1;22;0;23;0;24;0;25;1)
+				} else if ("get".equalsIgnoreCase(rList[1])) {
+					simulator.AppendToSend(p.address, new Packet("(" + rList[0] + ";" + "getack" + ";" + rList[2] + ";"
+							+ "9;11;22.3;12;33.3;13;32.3;14;22.2;21;1;22;0;23;0;24;0;25;1)"));
+					LogUtil.info(simulator.Name() + " AppendToSend:" + p.address + " " + "(" + rList[0] + ";" + "getack"
+							+ ";" + rList[2] + ";" + "9;11;22.3;12;33.3;13;32.3;14;22.2;21;1;22;0;23;0;24;0;25;1)");
+
+				}
+			}
+		} catch (Exception e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+			LogUtil.error("CollectSenddownThread.handlePacket.Exception: " + e.toString());
+		}
+	}
+
+	private static void sendReport() {
+		// TODO Auto-generated method stub
+		if (needSend()) {
+			StringBuffer sb = new StringBuffer();
+			sb.append("(");
+			sb.append(MAC);
+			sb.append(";report;");
+			sb.append(System.currentTimeMillis());
+			sb.append(";9;11;22.3;12;33.3;13;32.3;14;22.2;21;1;22;0;23;0;24;0;25;1)");
+			simulator.AppendToSend("/192.168.20.159:8756", new Packet(sb.toString()));
+			LogUtil.info(simulator.Name() + " AppendToSend:" + "/192.168.20.159:80" + " " + sb.toString());
+		}
+	}
+
+}

+ 222 - 0
src/main/java/com/saga/test/Sunyifu.java

@@ -0,0 +1,222 @@
+package com.saga.test;
+
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.OutputStream;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Map.Entry;
+
+import org.apache.hadoop.conf.Configuration;
+import org.apache.poi.hssf.usermodel.HSSFRow;
+import org.apache.poi.hssf.usermodel.HSSFSheet;
+import org.apache.poi.hssf.usermodel.HSSFWorkbook;
+import org.zillion.util.log.LogUtil;
+
+import com.saga.util.Constant;
+import com.sagacloud.json.JSONArray;
+import com.sagacloud.json.JSONObject;
+import com.zillion.database.agent.ZillionAgent;
+
+public class Sunyifu {
+	static Map<String, String> meterList = new HashMap<String, String>();
+	static Map<String, Map<String, Map<String, Double>>> dataList = new HashMap<String, Map<String, Map<String, Double>>>();
+	static long[] funcs = { 11011, 11012, 11013, 11014 };
+	static ZillionAgent agent;
+
+	public static void main(String[] args) {
+		// TODO Auto-generated method stub
+		try {
+			String resource = "/hbase-site.xml";
+			Configuration configuration = new Configuration();
+
+			configuration.addResource(new FileInputStream(System.getProperty("user.dir") + resource));
+			String zookeeper_connectionAddress = "zookeeper1:2181,zookeeper2:2181,zookeeper3:2181";
+			int zookeeper_sessionTimeout = 300000;
+			// agent = new ZillionAgent(configuration,
+			// zookeeper_connectionAddress, zookeeper_sessionTimeout);
+			agent = new ZillionAgent(configuration);
+			agent.Start();
+			Thread.sleep(10L);
+			// for (int i = 0; i < 20; i++) {
+			// Set_buildingcomputetime(agent, "db_time_data",
+			// "fjd_0_buildingcomputetime", "1101080002",
+			// "20170701000000");
+			// Thread.sleep(1L);
+			// }
+			// Thread.sleep(Constant.Millisecond.MINUTE_30);
+			String timefrom = "20170701000000";
+			String timeto = "20180901000000";
+			// long[] funcs = { 11011, 11012, 11013, 11014 };
+			GetPointList(agent, "db_time_data", "dy_pointlist", "1101080002");
+
+			Calendar calendarFrom = Calendar.getInstance();
+			Calendar calendarTo = Calendar.getInstance();
+			Date from = Constant.parse(timefrom);
+			Date to = Constant.parse(timeto);
+			calendarFrom.setTime(from);
+			calendarTo.setTime(to);
+			while (calendarFrom.before(calendarTo)) {
+				Date datetmp = calendarFrom.getTime();
+				calendarFrom.add(Calendar.MONTH, 1);
+
+				export2(Constant.format(datetmp), Constant.format(calendarFrom.getTime()));
+			}
+		} catch (Exception e) {
+			// TODO Auto-generated catch block
+			LogUtil.error("Main: " + e.toString());
+		}
+	}
+
+	private static void export2(String timefrom, String timeto) {
+		try {
+			LogUtil.info("get data begin...");
+			for (Entry<String, String> m : meterList.entrySet()) {
+				dataList.put(m.getKey(), new HashMap<String, Map<String, Double>>());
+				for (long funcid : funcs) {
+					dataList.get(m.getKey()).put(String.valueOf(funcid), new HashMap<String, Double>());
+					try {
+						GetFJD(agent, "db_time_data", "fjd_0_near_15min", "1101080002", m.getKey(), funcid, timefrom,
+								timeto);
+						Thread.sleep(10L);
+					} catch (Exception e) {
+						// TODO Auto-generated catch block
+						e.printStackTrace();
+					}
+				}
+			}
+			LogUtil.info("get data end...");
+			LogUtil.info("insert excel start...");
+			Calendar calendarFrom = Calendar.getInstance();
+			Calendar calendarTo = Calendar.getInstance();
+			Date from = Constant.parse(timefrom);
+			Date to = Constant.parse(timeto);
+			calendarFrom.setTime(from);
+			calendarTo.setTime(to);
+
+			// 创建HSSFWorkbook对象(excel的文档对象)
+			HSSFWorkbook wb = new HSSFWorkbook();
+			for (long funcid : funcs) {
+				// 建立新的sheet对象(excel的表单)
+				LogUtil.info("create sheet " + funcid);
+				HSSFSheet sheet = wb.createSheet(String.valueOf(funcid));
+				int col = 0;
+				// 在sheet里创建第二行
+				HSSFRow row = sheet.createRow(1);
+				for (Entry<String, String> m : meterList.entrySet()) {
+					col++;
+
+					// 创建单元格并设置单元格内容
+					row.createCell(col).setCellValue(m.getKey());
+
+				}
+				calendarFrom.setTime(from);
+				int r = 1;
+				while (calendarFrom.before(calendarTo)) {
+					col = 0;
+					r++;
+					row = sheet.createRow(r);
+					row.createCell(col).setCellValue(Constant.format(calendarFrom.getTime()));
+					for (Entry<String, String> m : meterList.entrySet()) {
+						col++;
+						if (dataList.get(m.getKey()).get(String.valueOf(funcid))
+								.get(Constant.format(calendarFrom.getTime())) != null) {
+							row.createCell(col).setCellValue(dataList.get(m.getKey()).get(String.valueOf(funcid))
+									.get(Constant.format(calendarFrom.getTime())));
+						}
+					}
+					calendarFrom.add(Calendar.MINUTE, 15);
+				}
+			}
+
+			// 输出Excel文件
+			OutputStream output = new FileOutputStream("d:/data" + timefrom.substring(0, 6) + ".xls");
+			wb.write(output);
+			output.close();
+			LogUtil.info("insert excel end...");
+		} catch (Exception e1) {
+			// TODO Auto-generated catch block
+			e1.printStackTrace();
+		}
+	}
+
+	private static void GetFJD(ZillionAgent agent, String db, String tb, String building, String meter, long funcid,
+			String query_from, String query_to) throws Exception {
+
+		JSONObject Criteria = new JSONObject();
+		Criteria.put("building", building);
+		Criteria.put("meter", meter);
+		Criteria.put("funcid", funcid);
+		JSONObject range = new JSONObject();
+		range.put("$gte", query_from);
+		range.put("$lte", query_to);
+		Criteria.put("data_time", range);
+		JSONObject wrapperObject = new JSONObject();
+		wrapperObject.put("QueryType", "select");
+		wrapperObject.put("Database", db);
+		wrapperObject.put("Datatable", tb);
+		wrapperObject.put("Criteria", Criteria);
+		JSONObject queryResult = agent.Query(wrapperObject);
+		JSONArray resultContent = (JSONArray) queryResult.get("Content");
+
+		LogUtil.info("GetFJD" + " " + db + " " + tb + " " + building + " " + meter + " " + funcid + " " + query_from
+				+ " " + query_to);
+		for (int i = 0; i < resultContent.size(); i++) {
+			JSONObject dataItem = (JSONObject) resultContent.get(i);
+
+			String receivetime = (String) dataItem.get("data_time");
+
+			Double data = (Double) dataItem.get("data_value");
+			dataList.get(meter).get(String.valueOf(funcid)).put(receivetime, data);
+			// LogUtil.info(("receivetime " + receivetime + " data:" + data));
+		}
+	}
+
+	private static void GetPointList(ZillionAgent agent, String db, String tb, String building) throws Exception {
+
+		JSONObject Criteria = new JSONObject();
+		Criteria.put("building", building);
+
+		JSONObject wrapperObject = new JSONObject();
+		wrapperObject.put("QueryType", "select");
+		wrapperObject.put("Database", db);
+		wrapperObject.put("Datatable", tb);
+		wrapperObject.put("Criteria", Criteria);
+		JSONObject queryResult = agent.Query(wrapperObject);
+		JSONArray resultContent = (JSONArray) queryResult.get("Content");
+
+		for (int i = 0; i < resultContent.size(); i++) {
+			JSONObject dataItem = (JSONObject) resultContent.get(i);
+			if (in(funcs, Long.parseLong(String.valueOf(dataItem.get("funcid"))))) {
+				meterList.put(String.valueOf(dataItem.get("meter")), null);
+			}
+		}
+	}
+
+	private static void Set_buildingcomputetime(ZillionAgent agent, String db, String tb, String building,
+			String compute_time) throws Exception {
+		JSONObject Criteria = new JSONObject();
+		Criteria.put("building", building);
+		JSONObject Set = new JSONObject();
+		Set.put("compute_time", compute_time);
+		JSONObject wrapperObject = new JSONObject();
+		wrapperObject.put("QueryType", "update");
+		wrapperObject.put("Database", db);
+		wrapperObject.put("Datatable", tb);
+		wrapperObject.put("Criteria", Criteria);
+		wrapperObject.put("Set", Set);
+		agent.Query(wrapperObject);
+		LogUtil.info(wrapperObject.toFormatString());
+	}
+
+	private static boolean in(long[] funcs, long funcid) {
+		for (long func : funcs) {
+			if (func == funcid) {
+				return true;
+			}
+		}
+		return false;
+	}
+}

File diff suppressed because it is too large
+ 672 - 0
src/main/java/com/saga/test/Test.java


+ 893 - 0
src/main/java/com/saga/thread/common/CheckThread.java

@@ -0,0 +1,893 @@
+package com.saga.thread.common;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+
+import org.zillion.util.log.LogUtil;
+
+import com.saga.entity.Server;
+import com.saga.util.Constant;
+
+/**
+ * 点位状态监控
+ *
+ * @author 李井强
+ */
+public class CheckThread extends Thread {
+	// ZillionAgent agent;
+	long realCheck = 0;
+	private Server server;
+	// private String ip = null;
+	// private Map<String, String> nodeStatus = new HashMap<String, String>();
+	private Map<String, String> pointStatus = new HashMap<String, String>();
+	private Map<String, String> meterStatus = new HashMap<String, String>();
+	private Map<String, String> projectStatus = new HashMap<String, String>();
+	private Map<String, String> physicalStatus = new HashMap<String, String>();
+
+	public CheckThread() {
+		try {
+			// this.agent = agent;
+			server = Constant.TypeServer.get("Down");
+		} catch (Exception e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+			LogUtil.error("CheckThread.Exception: " + e.toString());
+			System.exit(0);
+		}
+	}
+
+	public void run() {
+		LogUtil.info("CheckThread-" + this.getName() + " Starting ...");
+		// 初次加载生成当前状态
+		this.excuteDBStatus();
+		this.loadDBStatus();
+
+		while (true) {
+			try {
+				// // V1.0点位日志结构
+				// this.realCheck();
+				// V2.0点位日志结构
+				this.realCheck2();
+				// Constant.showStatus();
+				Thread.sleep(Constant.Millisecond.SECOND_1);
+			} catch (Exception e) {
+				// TODO Auto-generated catch block
+				LogUtil.error("CheckThread.run.Exception: " + e.toString());
+			}
+		}
+	}
+
+	/**
+	 * 加载DB中点位状态
+	 */
+	private void loadDBStatus() {
+		// TODO Auto-generated method stub
+		try {
+			this.physicalStatus.putAll(Constant.ps_physical_status(Constant.Database, "ps_physical_status"));
+			this.meterStatus.putAll(Constant.ps_virtual_meter_status(Constant.Database, "ps_virtual_meter_status"));
+			this.pointStatus.putAll(Constant.ps_virtual_point_status(Constant.Database, "ps_virtual_point_status"));
+			this.projectStatus
+					.putAll(Constant.ps_virtual_project_status(Constant.Database, "ps_virtual_project_status"));
+
+		} catch (Exception e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+			LogUtil.error("CheckThread.loadDBStatus: " + e.toString());
+		}
+
+		return;
+
+	}
+
+	/**
+	 * 生成点位状态
+	 */
+	private void excuteDBStatus() {
+		// TODO Auto-generated method stub
+		// for (Entry<String, Long> pns : Constant.ps_NodeStatus.entrySet()) {
+		// if (System.currentTimeMillis() - pns.getValue() <
+		// Constant.Millisecond.MINUTE_1) {
+		// this.nodeStatus.put(pns.getKey(), "conn");
+		// } else {
+		// this.nodeStatus.put(pns.getKey(), "disconn");
+		// }
+		// }
+		for (Entry<String, Long> ppsu : Constant.ps_PointStatusUp.entrySet()) {
+			if (ppsu.getValue() != null) {
+				if (System.currentTimeMillis() - ppsu.getValue() < Constant.Disconnect) {
+					this.pointStatus.put(ppsu.getKey(), "conn");
+				} else {
+					this.pointStatus.put(ppsu.getKey(), "disconn");
+				}
+			} else {
+				this.pointStatus.put(ppsu.getKey(), null);
+			}
+		}
+
+		for (Entry<String, Long> pps : Constant.ps_PhysicalStatus.entrySet()) {
+			// if (!pps.getKey().endsWith(";;;")) {
+			if (pps.getValue() != null) {
+				if (System.currentTimeMillis() - pps.getValue() < Constant.Disconnect) {
+					this.physicalStatus.put(pps.getKey(), "conn");
+				} else {
+					this.physicalStatus.put(pps.getKey(), "disconn");
+				}
+			} else {
+				this.physicalStatus.put(pps.getKey(), null);
+			}
+
+			// }
+		}
+		for (Entry<String, Long> pps : Constant.ps_ProjectStatus.entrySet()) {
+			if (pps.getValue() != null) {
+				if (System.currentTimeMillis() - pps.getValue() < Constant.Disconnect) {
+					this.projectStatus.put(pps.getKey(), "conn");
+				} else {
+					this.projectStatus.put(pps.getKey(), "disconn");
+				}
+			} else {
+				this.projectStatus.put(pps.getKey(), null);
+			}
+
+		}
+		for (Entry<String, Long> pmsu : Constant.ps_MeterStatusUp.entrySet()) {
+			if (pmsu.getValue() != null) {
+				if (System.currentTimeMillis() - pmsu.getValue() < Constant.Disconnect) {
+					this.meterStatus.put(pmsu.getKey(), "conn");
+				} else {
+					this.meterStatus.put(pmsu.getKey(), "disconn");
+				}
+			} else {
+				this.meterStatus.put(pmsu.getKey(), null);
+			}
+		}
+	}
+
+	/**
+	 * 检查点位状态
+	 */
+	private void realCheck2() {
+		// TODO Auto-generated method stub
+
+		if (System.currentTimeMillis() - this.realCheck > Constant.Millisecond.SECOND_3) {
+			this.realCheck = System.currentTimeMillis();
+
+			try {
+				this.virtual_point_status_up_Check();
+				this.virtual_point_status_down_Check();
+				this.physical_status_address_Check();
+
+				this.virtual_meter_status_up_Check();
+				this.virtual_project_status_up_Check();
+
+			} catch (Exception e) {
+				// TODO Auto-generated catch block
+				e.printStackTrace();
+				LogUtil.error("CheckThread.realCheck2.Exception: " + e.toString());
+			}
+		}
+	}
+
+	/**
+	 * 检查点位状态-project
+	 */
+	private void virtual_project_status_up_Check() {
+		// TODO Auto-generated method stub
+		synchronized (Constant.ps_ProjectList) {
+			for (Entry<String, List<String>> ps : Constant.ps_ProjectList.entrySet()) {
+				String project = ps.getKey();
+				List<String> plist = ps.getValue();
+				String status = this.gatherStatus(plist);
+				try {
+					if ("conn".equalsIgnoreCase(status)) {
+						Constant.Insert_ps_virtual_project_status(Constant.Database, project, status,
+								Constant.format(new Date()), "");
+					}
+					if (
+					// 首次
+					!this.projectStatus.containsKey(project) || null == this.projectStatus.get(project) ||
+					// 已有记录且状态发生变化
+							!status.equalsIgnoreCase(this.projectStatus.get(project))) {
+						Constant.Insert_ps_virtual_project_log(Constant.Database, project, Constant.format(new Date()),
+								status);
+						if ("disconn".equalsIgnoreCase(status)) {
+							Constant.Insert_ps_virtual_project_status(Constant.Database, project, status,
+									Constant.format(new Date()), "");
+						}
+					}
+				} catch (Exception e) {
+					// TODO Auto-generated catch block
+					e.printStackTrace();
+				}
+				this.projectStatus.put(project, status);
+			}
+		}
+	}
+
+	/**
+	 * 检查点位状态-meter
+	 */
+	private void virtual_meter_status_up_Check() {
+		// TODO Auto-generated method stub
+		synchronized (Constant.ps_MeterList) {
+			for (Entry<String, List<String>> ms : Constant.ps_MeterList.entrySet()) {
+				String pm = ms.getKey();
+				List<String> plist = ms.getValue();
+				String status = this.gatherStatus(plist);
+				String[] ml = pm.split("-");
+				String project = ml[0];
+				String meter = ml[1];
+				try {
+					if ("conn".equalsIgnoreCase(status)) {
+						Constant.Insert_ps_virtual_meter_status(Constant.Database, project, meter, "up", status,
+								Constant.format(new Date()), "");
+					}
+					if (
+					// 首次
+					!this.meterStatus.containsKey(pm) || null == this.meterStatus.get(pm) ||
+					// 已有记录且状态发生变化
+							!status.equalsIgnoreCase(this.meterStatus.get(pm))) {
+						Constant.Insert_ps_virtual_meter_log(Constant.Database, project, meter, "up",
+								Constant.format(new Date()), status);
+						if ("disconn".equalsIgnoreCase(status)) {
+							Constant.Insert_ps_virtual_meter_status(Constant.Database, project, meter, "up", status,
+									Constant.format(new Date()), "");
+						}
+					}
+				} catch (Exception e) {
+					// TODO Auto-generated catch block
+					e.printStackTrace();
+				}
+				this.meterStatus.put(pm, status);
+			}
+		}
+	}
+	
+	/**
+	 * 检查点位状态-物理结构
+	 */
+	private void physical_status_address_Check() {
+		// TODO Auto-generated method stub
+		synchronized (Constant.ps_PhysicalList) {
+			for (Entry<String, List<String>> ps : Constant.ps_PhysicalList.entrySet()) {
+				String physical = ps.getKey();
+				String[] pl = physical.split(";");
+				String project = pl[0];
+				String address_1 = pl.length < 2 ? "" : pl[1];
+				if ("".equalsIgnoreCase(address_1)) {
+					continue;
+				}
+				String address_2 = pl.length < 3 ? "" : pl[2];
+				String address_3 = pl.length < 4 ? "" : pl[3];
+				String address_4 = pl.length < 5 ? "" : pl[4];
+				String status = "disconn";
+				if (!physical.endsWith(";;;")) {
+					List<String> plist = ps.getValue();
+					status = this.gatherStatus(plist);
+				} else {
+					if (Constant.ps_PhysicalStatus.get(physical) != null) {
+						if (this.realCheck - Constant.ps_PhysicalStatus.get(physical) < Constant.Millisecond.MINUTE_1) {
+							status = "conn";
+						}
+					} else {
+						status = "disconn";
+					}
+				}
+				try {
+					if ("conn".equalsIgnoreCase(status)) {
+						Constant.Insert_ps_physical_status(Constant.Database, project, address_1, address_2, address_3,
+								address_4, status, Constant.format(new Date()), "");
+					}
+					if (
+					// 首次
+					!this.physicalStatus.containsKey(physical) || null == this.physicalStatus.get(physical) ||
+					// 已有记录且状态发生变化
+							!status.equalsIgnoreCase(this.physicalStatus.get(physical))) {
+						Constant.Insert_ps_physical_log(Constant.Database, project, address_1, address_2, address_3,
+								address_4, Constant.format(new Date()), status);
+						if ("disconn".equalsIgnoreCase(status)) {
+							Constant.Insert_ps_physical_status(Constant.Database, project, address_1, address_2,
+									address_3, address_4, status, Constant.format(new Date()), "");
+						}
+					}
+				} catch (Exception e) {
+					// TODO Auto-generated catch block
+					e.printStackTrace();
+				}
+				this.physicalStatus.put(physical, status);
+			}
+		}
+	}
+
+	/**
+	 * 根据下级统计状态
+	 */
+	private String gatherStatus(List<String> l) {
+		// TODO Auto-generated method stub
+		for (String s : l) {
+			if ("conn".equalsIgnoreCase(this.pointStatus.get(s))) {
+				return "conn";
+			}
+		}
+		return "disconn";
+	}
+
+	/**
+	 * 检查点位状态-point
+	 */
+	private void virtual_point_status_down_Check() {
+		// TODO Auto-generated method stub
+		// down
+		try {
+			List<String> nk = new ArrayList<String>();
+			List<String> ps = new ArrayList<String>();
+			synchronized (Constant.ps_ID2Time) {
+				Iterator<Entry<String, Long>> it = Constant.ps_ID2Time.entrySet().iterator();
+				while (it.hasNext()) {
+					try {
+						Entry<String, Long> n = it.next();
+
+						String building = Constant.ps_ID2Point.get(n.getKey()).split("-")[0];
+						String mac = Constant.ps_ID2Point.get(n.getKey()).split("-")[1];
+						String point = Constant.ps_ID2Point.get(n.getKey()).split("-")[2];
+
+						String[] slist = point.split("\\.");
+						StringBuffer sb = new StringBuffer();
+						for (int i = 0; i < slist.length - 1; i++) {
+							if (i > 0) {
+								sb.append(".");
+							}
+							sb.append(slist[i]);
+						}
+						String meter = sb.toString();
+						String funcid = slist[slist.length - 1];
+
+						// String function =
+						// Constant.id2function.get(n.getKey());
+
+						if (n.getValue() != null
+								&& System.currentTimeMillis() - n.getValue() > Constant.Millisecond.SECOND_10) {
+							try {
+								if ("finish:finish:success".equalsIgnoreCase(Constant.ps_ID2Status.get(n.getKey()))) {
+									// HBaseUtil.InsertPointStatus(Constant.agent,
+									// Constant.BuildingDB.get(building),
+									// building, this.ip, mac, meter,
+									// funcid, "down", "conn",
+									// // function + ":" +
+									// Constant.format(new
+									// Date(Constant.id2time.get(n.getKey()))),
+									// Constant.id2status.get(n.getKey()));
+									ps.add(Constant.Database + ";" + building + ";" + this.server.IP + ";" + mac + ";"
+											+ meter + ";" + funcid + ";" + "down" + ";" + "conn" + ";"
+											+ Constant.format(new Date(Constant.ps_ID2Time.get(n.getKey()))) + ";"
+											+ Constant.ps_ID2Status.get(n.getKey()));
+								} else {
+									// Constant.pointListDown.put(n.getKey(),
+									// null);
+									// HBaseUtil.InsertPointStatus(Constant.agent,
+									// Constant.BuildingDB.get(building),
+									// building, this.ip, mac, meter,
+									// funcid, "down", "disconn",
+									// // function + ":" +
+									// Constant.format(new
+									// Date(Constant.id2time.get(n.getKey()))),
+									// Constant.id2status.get(n.getKey()));
+									ps.add(Constant.Database + ";" + building + ";" + this.server.IP + ";" + mac + ";"
+											+ meter + ";" + funcid + ";" + "down" + ";" + "disconn" + ";"
+											+ Constant.format(new Date(Constant.ps_ID2Time.get(n.getKey()))) + ";"
+											+ Constant.ps_ID2Status.get(n.getKey()));
+								}
+
+							} catch (Exception e) {
+								// TODO Auto-generated catch block
+								e.printStackTrace();
+							}
+							nk.add(n.getKey());
+							it.remove();
+						}
+					} catch (Exception e) {
+						// TODO Auto-generated catch block
+						e.printStackTrace();
+					}
+				}
+			}
+
+			synchronized (Constant.ps_ID2Point) {
+				for (String k : nk) {
+					if (Constant.ps_ID2Point.containsKey(k)) {
+						Constant.ps_ID2Point.remove(k);
+					}
+				}
+			}
+			synchronized (Constant.ps_ID2Status) {
+				for (String k : nk) {
+					if (Constant.ps_ID2Status.containsKey(k)) {
+						Constant.ps_ID2Status.remove(k);
+					}
+				}
+			}
+			synchronized (Constant.ps_ID2Function) {
+				for (String k : nk) {
+					if (Constant.ps_ID2Function.containsKey(k)) {
+						Constant.ps_ID2Function.remove(k);
+					}
+				}
+			}
+
+			nk = new ArrayList<String>();
+			for (String s : ps) {
+				String[] a = s.split(";");
+				String time = a[8];
+
+				Constant.Insert_ps_virtual_point_status(Constant.Database, a[1], a[4], Long.valueOf(a[5]), a[6], a[7],
+						time, a[9]);
+				Thread.sleep(1L);
+			}
+			ps = new ArrayList<String>();
+		} catch (Exception e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+			LogUtil.error("CheckThread.realCheck2.PointStatus.down.Exception:" + e.toString());
+		}
+	}
+
+	/**
+	 * 检查点位状态-point
+	 */
+	private void virtual_point_status_up_Check() {
+		// TODO Auto-generated method stub
+		// PointStatus
+		// up
+		// LogUtil.info("Constant.pointListUp:" + Constant.pointListUp);
+		// synchronized (Constant.pointListUp) {
+		// if (Constant.pointListUp.size() > 0) {
+
+		// Iterator<Entry<String, Long>> pu =
+		// Constant.pointListUp.entrySet().iterator();
+		Map<String, Long> pu = new HashMap<String, Long>();
+		synchronized (Constant.ps_PointStatusUp) {
+			if (Constant.ps_PointStatusUp.size() > 0) {
+				pu.putAll(Constant.ps_PointStatusUp);
+			}
+		}
+		for (Entry<String, Long> pointUp : pu.entrySet()) {
+			try {
+				String building = pointUp.getKey().split("-")[0];
+				String point = pointUp.getKey().split("-")[1];
+
+				String[] slist = point.split("\\.");
+				StringBuffer sb = new StringBuffer();
+				for (int i = 0; i < slist.length - 1; i++) {
+					if (i > 0) {
+						sb.append(".");
+					}
+					sb.append(slist[i]);
+				}
+				String meter = sb.toString();
+				String funcid = slist[slist.length - 1];
+				String status = "";
+
+				if (pointUp.getValue() != null) {
+					if (this.realCheck - pointUp.getValue() < Constant.Disconnect) {
+						status = "conn";
+					} else {
+						status = "disconn";
+					}
+				} else {
+					// 首次
+					status = "disconn";
+				}
+				if ("conn".equalsIgnoreCase(status)) {
+					// this.Insert_ps_virtual_point_status(building, meter,
+					// Long.valueOf(funcid), "up", status,
+					// pointUp.getValue(), "");
+					long time = pointUp.getValue() == null ? System.currentTimeMillis() : pointUp.getValue();
+					Constant.Insert_ps_virtual_point_status(Constant.Database, building, meter, Long.valueOf(funcid),
+							"up", status, Constant.format(new Date(time)), "");
+				}
+
+				if (
+				// 首次
+				!this.pointStatus.containsKey(pointUp.getKey()) || null == this.pointStatus.get(pointUp.getKey()))
+
+				{
+					// this.Insert_ps_virtual_point_log(building, meter,
+					// Long.valueOf(funcid), "up",
+					// System.currentTimeMillis(), 0l, status, "");
+
+					Constant.Insert_ps_virtual_point_log(Constant.Database, building, meter, Long.valueOf(funcid), "up",
+							Constant.format(new Date()), 0l, status, "");
+					if ("disconn".equalsIgnoreCase(status)) {
+						// this.Insert_ps_virtual_point_status(building, meter,
+						// Long.valueOf(funcid), "up", status,
+						// pointUp.getValue(), "");
+						long time = pointUp.getValue() == null ? System.currentTimeMillis() : pointUp.getValue();
+						Constant.Insert_ps_virtual_point_status(Constant.Database, building, meter,
+								Long.valueOf(funcid), "up", status, Constant.format(new Date(time)), "");
+					}
+				} else if (
+				// 已有记录且状态发生变化
+				(!status.equalsIgnoreCase(this.pointStatus.get(pointUp.getKey())))) {
+					// 添加Log记录
+					if (Constant.RecordAddress.containsKey(building + "-" + point.replace(".", "-"))) {
+						if (Constant.RecordAddress.get(building + "-" + point.replace(".", "-")) != null) {
+							int address = Constant.RecordAddress.get(building + "-" + point.replace(".", "-"));
+							// this.Insert_ps_virtual_point_log(building, meter,
+							// Long.valueOf(funcid), "up",
+							// pointUp.getValue(),
+							// Long.valueOf(Constant.RecordList.get(address).seq),
+							// status, "");
+							long time = pointUp.getValue() == null ? System.currentTimeMillis() : pointUp.getValue();
+							Constant.Insert_ps_virtual_point_log(Constant.Database, building, meter,
+									Long.valueOf(funcid), "up", Constant.format(new Date(time)),
+									Long.valueOf(Constant.RecordList.get(address).seq), status, "");
+							if ("disconn".equalsIgnoreCase(status)) {
+								// this.Insert_ps_virtual_point_status(building,
+								// meter, Long.valueOf(funcid), "up", status,
+								// pointUp.getValue(), "");
+								Constant.Insert_ps_virtual_point_status(Constant.Database, building, meter,
+										Long.valueOf(funcid), "up", status, Constant.format(new Date(time)), "");
+							}
+						}
+					} else {
+						long time = pointUp.getValue() == null ? System.currentTimeMillis() : pointUp.getValue();
+						Constant.Insert_ps_virtual_point_log(Constant.Database, building, meter, Long.valueOf(funcid),
+								"up", Constant.format(new Date(time)), 0l, status, "");
+						if ("disconn".equalsIgnoreCase(status)) {
+							// this.Insert_ps_virtual_point_status(building,
+							// meter, Long.valueOf(funcid), "up", status,
+							// pointUp.getValue(), "");
+							Constant.Insert_ps_virtual_point_status(Constant.Database, building, meter,
+									Long.valueOf(funcid), "up", status, Constant.format(new Date(time)), "");
+						}
+					}
+				}
+				// 更新Status
+				this.pointStatus.put(pointUp.getKey(), status);
+			} catch (Exception e) {
+				// TODO Auto-generated catch block
+				// e.printStackTrace();
+				// LogUtil.error("CheckThread.virtual_point_status_up_Check.Exception:"
+				// + e.toString());
+			}
+		}
+	}
+
+	// private void Insert_ps_virtual_point_log(String building, String meter,
+	// Long funcid, String updown, Long time,
+	// Long seq, String status, String feedback) {
+	// // TODO Auto-generated method stub
+	// try {
+	// if (time == null) {
+	// HBaseUtil.Insert_ps_virtual_point_log(Constant.agent,
+	// Constant.BuildingDB.get(building), building,
+	// meter, Long.valueOf(funcid), updown, Constant.format(new Date()), seq,
+	// status, feedback);
+	// } else {
+	// HBaseUtil.Insert_ps_virtual_point_log(Constant.agent,
+	// Constant.BuildingDB.get(building), building,
+	// meter, Long.valueOf(funcid), updown, Constant.format(new Date(time)),
+	// seq, status, feedback);
+	// }
+	// } catch (Exception e) {
+	// // TODO Auto-generated catch block
+	// e.printStackTrace();
+	// }
+	// }
+
+	// private void physical_status_address_1_Check() {
+	// // TODO Auto-generated method stub
+	// // physical_status
+	// // address_1
+	// for (Entry<String, Long> node : Constant.ps_NodeStatus.entrySet()) {
+	// try {
+	// String building = node.getKey().split("-")[0];
+	// String mac = node.getKey().split("-")[1];
+	// String status = "";
+	// if (node.getValue() != null && this.realCheck - node.getValue() <
+	// Constant.Millisecond.MINUTE_1) {
+	// status = "conn";
+	// HBaseUtil.Insert_ps_physical_status(Constant.agent,
+	// Constant.BuildingDB.get(building), building,
+	// mac, "", "", "", status, Constant.format(new Date(node.getValue())), "");
+	// } else {
+	// status = "disconn";
+	// HBaseUtil.Insert_ps_physical_status(Constant.agent,
+	// Constant.BuildingDB.get(building), building,
+	// mac, "", "", "", status, Constant.format(new Date(node.getValue())), "");
+	// }
+	//
+	// if ((!this.nodeStatus.containsKey(node.getKey()))
+	// || (!status.equalsIgnoreCase(this.nodeStatus.get(node.getKey())))) {
+	// // 添加Log记录
+	// HBaseUtil.Insert_ps_physical_log(Constant.agent,
+	// Constant.BuildingDB.get(building), building, mac,
+	// "", "", "", Constant.format(new Date(node.getValue())), (status));
+	// }
+	// // 更新Status
+	// this.nodeStatus.put(node.getKey(), status);
+	// } catch (Exception e) {
+	// // TODO Auto-generated catch block
+	// e.printStackTrace();
+	// LogUtil.error("CheckThread.realCheck.CollectorStatus.Exception: " +
+	// e.toString());
+	// }
+	// }
+	// }
+
+	// private void Insert_ps_virtual_point_status(String building, String
+	// meter, Long funcid, String updown,
+	// String status, Long time, String detail) {
+	// // TODO Auto-generated method stub
+	// try {
+	// if (time == null) {
+	// HBaseUtil.Insert_ps_virtual_point_status(Constant.agent,
+	// Constant.BuildingDB.get(building), building,
+	// meter, Long.valueOf(funcid), "up", status, Constant.format(new Date()),
+	// "");
+	//
+	// } else {
+	// HBaseUtil.Insert_ps_virtual_point_status(Constant.agent,
+	// Constant.BuildingDB.get(building), building,
+	// meter, Long.valueOf(funcid), "up", status, Constant.format(new
+	// Date(time)), "");
+	// }
+	// } catch (Exception e) {
+	// // TODO Auto-generated catch block
+	// e.printStackTrace();
+	// }
+	// }
+
+	// private void realCheck() {
+	// // TODO Auto-generated method stub
+	//
+	// if (System.currentTimeMillis() - this.realCheck >
+	// Constant.Millisecond.SECOND_3) {
+	// this.realCheck = System.currentTimeMillis();
+	//
+	// try {
+	// // CollectorStatus
+	// // LogUtil.info("Constant.nodeList:" + Constant.nodeList);
+	// for (Entry<String, Long> node : Constant.ps_NodeStatus.entrySet()) {
+	// try {
+	// String building = node.getKey().split("-")[0];
+	// String mac = node.getKey().split("-")[1];
+	// String status = "";
+	// if (node.getValue() != null
+	// && this.realCheck - node.getValue() < Constant.Millisecond.MINUTE_1) {
+	// HBaseUtil.InsertCollectorStatus(Constant.agent,
+	// Constant.BuildingDB.get(building), building,
+	// this.ip, mac, "conn", Constant.format(new Date(node.getValue())));
+	// status = "conn";
+	// } else {
+	// HBaseUtil.InsertCollectorStatus(Constant.agent,
+	// Constant.BuildingDB.get(building), building,
+	// this.ip, mac, "disconn", Constant.format(new Date(node.getValue())));
+	// status = "disconn";
+	// }
+	//
+	// if ((!this.nodeStatus.containsKey(node.getKey()))
+	// || (!status.equalsIgnoreCase(this.nodeStatus.get(node.getKey())))) {
+	// // 添加Log记录
+	// HBaseUtil.InsertCollectorCommunicationLog(Constant.agent,
+	// Constant.BuildingDB.get(building),
+	// building, this.ip, mac, Constant.format(new Date(node.getValue())),
+	// (status));
+	// }
+	// // 更新Status
+	// this.nodeStatus.put(node.getKey(), status);
+	// } catch (Exception e) {
+	// // TODO Auto-generated catch block
+	// e.printStackTrace();
+	// LogUtil.error("CheckThread.realCheck.CollectorStatus.Exception: " +
+	// e.toString());
+	// }
+	// }
+	// // PointStatus
+	// // up
+	// // LogUtil.info("Constant.pointListUp:" + Constant.pointListUp);
+	// // synchronized (Constant.pointListUp) {
+	// // if (Constant.pointListUp.size() > 0) {
+	//
+	// // Iterator<Entry<String, Long>> pu =
+	// // Constant.pointListUp.entrySet().iterator();
+	// Map<String, Long> pu = new HashMap<String, Long>();
+	// synchronized (Constant.ps_PointStatusUp) {
+	// if (Constant.ps_PointStatusUp.size() > 0) {
+	// pu.putAll(Constant.ps_PointStatusUp);
+	// }
+	// }
+	// for (Entry<String, Long> pointUp : pu.entrySet()) {
+	// try {
+	// String building = pointUp.getKey().split("-")[0];
+	// String mac = pointUp.getKey().split("-")[1];
+	// String point = pointUp.getKey().split("-")[2];
+	// // System.out.println(point);
+	// String[] slist = point.split("\\.");
+	// StringBuffer sb = new StringBuffer();
+	// for (int i = 0; i < slist.length - 1; i++) {
+	// if (i > 0) {
+	// sb.append(".");
+	// }
+	// sb.append(slist[i]);
+	// }
+	// String meter = sb.toString();
+	// String funcid = slist[slist.length - 1];
+	// // System.out.println(meter);
+	// // System.out.println(funcid);
+	// String status = "";
+	//
+	// if (pointUp.getValue() != null
+	// && this.realCheck - pointUp.getValue() < Constant.Millisecond.MINUTE_15)
+	// {
+	// HBaseUtil.InsertPointStatus(Constant.agent,
+	// Constant.BuildingDB.get(building), building,
+	// this.ip, mac, meter, funcid, "up", "conn",
+	// Constant.format(new Date(pointUp.getValue())), "");
+	// status = "conn";
+	// } else {
+	// if (pointUp.getValue() != null) {
+	// HBaseUtil.InsertPointStatus(Constant.agent,
+	// Constant.BuildingDB.get(building), building,
+	// this.ip, mac, meter, funcid, "up", "disconn",
+	// Constant.format(new Date(pointUp.getValue())), "");
+	// status = "disconn";
+	// }
+	// }
+	// if ((!this.pointStatus.containsKey(pointUp.getKey()))
+	// || (!status.equalsIgnoreCase(this.pointStatus.get(pointUp.getKey())))) {
+	// // 添加Log记录
+	// if (Constant.RecordAddress.containsKey(building + "-" +
+	// point.replace(".", "-"))) {
+	// int address = Constant.RecordAddress.get(building + "-" +
+	// point.replace(".", "-"));
+	// if (pointUp.getValue() != null) {
+	// HBaseUtil.InsertPointCommunicationLog(Constant.agent,
+	// Constant.BuildingDB.get(building), building, this.ip, mac, meter, funcid,
+	// "up", (status), Constant.RecordList.get(address).seq,
+	// Constant.format(new Date(pointUp.getValue())), "");
+	// }
+	// }
+	//
+	// }
+	// // 更新Status
+	// this.pointStatus.put(pointUp.getKey(), status);
+	// } catch (Exception e) {
+	// // TODO Auto-generated catch block
+	// e.printStackTrace();
+	// LogUtil.error("CheckThread.realCheck.PointStatus.up.Exception:" +
+	// e.toString());
+	// }
+	// }
+	// // down
+	// try {
+	// List<String> nk = new ArrayList<String>();
+	// List<String> ps = new ArrayList<String>();
+	// synchronized (Constant.ps_ID2Time) {
+	// Iterator<Entry<String, Long>> it =
+	// Constant.ps_ID2Time.entrySet().iterator();
+	// while (it.hasNext()) {
+	// try {
+	// Entry<String, Long> n = it.next();
+	//
+	// String building = Constant.ps_ID2Point.get(n.getKey()).split("-")[0];
+	// String mac = Constant.ps_ID2Point.get(n.getKey()).split("-")[1];
+	// String point = Constant.ps_ID2Point.get(n.getKey()).split("-")[2];
+	//
+	// String[] slist = point.split("\\.");
+	// StringBuffer sb = new StringBuffer();
+	// for (int i = 0; i < slist.length - 1; i++) {
+	// if (i > 0) {
+	// sb.append(".");
+	// }
+	// sb.append(slist[i]);
+	// }
+	// String meter = sb.toString();
+	// String funcid = slist[slist.length - 1];
+	//
+	// // String function =
+	// // Constant.id2function.get(n.getKey());
+	//
+	// if (n.getValue() != null
+	// && System.currentTimeMillis() - n.getValue() >
+	// Constant.Millisecond.SECOND_10) {
+	// try {
+	// if ("finish:finish:success"
+	// .equalsIgnoreCase(Constant.ps_ID2Status.get(n.getKey()))) {
+	// // HBaseUtil.InsertPointStatus(Constant.agent,
+	// // Constant.BuildingDB.get(building),
+	// // building, this.ip, mac, meter,
+	// // funcid, "down", "conn",
+	// // // function + ":" +
+	// // Constant.format(new
+	// // Date(Constant.id2time.get(n.getKey()))),
+	// // Constant.id2status.get(n.getKey()));
+	// ps.add(Constant.BuildingDB.get(building) + ";" + building + ";" + this.ip
+	// + ";" + mac + ";" + meter + ";" + funcid + ";" + "down" + ";"
+	// + "conn" + ";"
+	// + Constant.format(new Date(Constant.ps_ID2Time.get(n.getKey())))
+	// + ";" + Constant.ps_ID2Status.get(n.getKey()));
+	// } else {
+	// // Constant.pointListDown.put(n.getKey(),
+	// // null);
+	// // HBaseUtil.InsertPointStatus(Constant.agent,
+	// // Constant.BuildingDB.get(building),
+	// // building, this.ip, mac, meter,
+	// // funcid, "down", "disconn",
+	// // // function + ":" +
+	// // Constant.format(new
+	// // Date(Constant.id2time.get(n.getKey()))),
+	// // Constant.id2status.get(n.getKey()));
+	// ps.add(Constant.BuildingDB.get(building) + ";" + building + ";" + this.ip
+	// + ";" + mac + ";" + meter + ";" + funcid + ";" + "down" + ";"
+	// + "disconn" + ";"
+	// + Constant.format(new Date(Constant.ps_ID2Time.get(n.getKey())))
+	// + ";" + Constant.ps_ID2Status.get(n.getKey()));
+	// }
+	//
+	// } catch (Exception e) {
+	// // TODO Auto-generated catch block
+	// e.printStackTrace();
+	// }
+	// nk.add(n.getKey());
+	// it.remove();
+	// }
+	// } catch (Exception e) {
+	// // TODO Auto-generated catch block
+	// e.printStackTrace();
+	// }
+	// }
+	// }
+	//
+	// synchronized (Constant.ps_ID2Point) {
+	// for (String k : nk) {
+	// if (Constant.ps_ID2Point.containsKey(k)) {
+	// Constant.ps_ID2Point.remove(k);
+	// }
+	// }
+	// }
+	// synchronized (Constant.ps_ID2Status) {
+	// for (String k : nk) {
+	// if (Constant.ps_ID2Status.containsKey(k)) {
+	// Constant.ps_ID2Status.remove(k);
+	// }
+	// }
+	// }
+	// synchronized (Constant.ps_ID2Function) {
+	// for (String k : nk) {
+	// if (Constant.ps_ID2Function.containsKey(k)) {
+	// Constant.ps_ID2Function.remove(k);
+	// }
+	// }
+	// }
+	//
+	// nk = new ArrayList<String>();
+	// for (String s : ps) {
+	// String[] a = s.split(";");
+	// HBaseUtil.InsertPointStatus(Constant.agent, a[0], a[1], a[2], a[3], a[4],
+	// a[5], a[6], a[7],
+	// a[8], a[9]);
+	// Thread.sleep(1L);
+	// }
+	// ps = new ArrayList<String>();
+	//
+	// } catch (Exception e) {
+	// // TODO Auto-generated catch block
+	// e.printStackTrace();
+	// LogUtil.error("CheckThread.realCheck.PointStatus.down.Exception:" +
+	// e.toString());
+	// }
+	// } catch (Exception e) {
+	// // TODO Auto-generated catch block
+	// e.printStackTrace();
+	// LogUtil.error("CheckThread.realCheck.Exception: " + e.toString());
+	// }
+	// }
+	// }
+
+}

+ 833 - 0
src/main/java/com/saga/thread/common/LoadConfigThread.java

@@ -0,0 +1,833 @@
+package com.saga.thread.common;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import org.zillion.util.log.LogUtil;
+import com.saga.entity.EntityHbase;
+import com.saga.entity.EntityMysql;
+import com.saga.entity.Server;
+import com.saga.entity.Transfer;
+import com.saga.util.Constant;
+import com.saga.util.ExcelUtil;
+
+/**
+ * 加载配置信息
+ *
+ * @author 李井强
+ */
+public class LoadConfigThread extends Thread {
+	public LoadConfigThread() {
+		try {
+		} catch (Exception e) {
+			// TODO Auto-generated catch block
+			LogUtil.error("LoadConfigThread.Exception: " + e.toString());
+			System.exit(0);
+		}
+	}
+
+	public void run() {
+		LogUtil.info("LoadConfigThread" + this.getName() + " Starting ...");
+		while (true) {
+			try {
+				// 加载config配置文件
+				// this.loadJsonConfig();
+				loadExcelConfig();
+				// 加载DB点位列表
+				this.loadPointList2();
+				// 加载采集器配置文件
+				// this.loadCJQ();
+				Thread.sleep(Constant.Millisecond.MINUTE_5);
+
+			} catch (Exception e) {
+				// TODO Auto-generated catch block
+				LogUtil.error("LoadConfigThread.run.Exception: " + e.toString());
+			}
+		}
+	}
+
+	/**
+	 * 加载DB点位列表
+	 */
+	private void loadPointList2() {
+		// TODO Auto-generated method stub
+		LogUtil.info("Clear Project Point List" + " Begin...");
+		synchronized (Constant.ps_PhysicalList) {
+			Constant.ps_PhysicalList = null;
+			Constant.ps_PhysicalList = new HashMap<String, List<String>>();
+			// Constant.ps_PhysicalList.clear();
+		}
+		synchronized (Constant.ps_ProjectList) {
+			Constant.ps_ProjectList = null;
+			Constant.ps_ProjectList = new HashMap<String, List<String>>();
+			// Constant.ps_ProjectList.clear();
+		}
+		synchronized (Constant.ps_MeterList) {
+			Constant.ps_MeterList = null;
+			Constant.ps_MeterList = new HashMap<String, List<String>>();
+			// Constant.ps_MeterList.clear();
+		}
+		LogUtil.info("Clear Project Point List" + " End...");
+		try {
+			Constant.LoadDB2Cache_dy_pointlist(Constant.Database, "dy_pointlist");
+		} catch (Exception e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+			LogUtil.error("LoadConfigThread.loadPointList2: " + e.toString());
+		}
+	}
+
+	// private void loadCJQ() {
+	// // TODO Auto-generated method stub
+	// // 文件夹命名格式:config+"-"+楼号+"-"+mac序号,示例:config-1101080002-1
+	// Constant.getConfigFile(LogUtil.GetPath(), "config-", "port");
+	// // 采集器点位位置信息写入数据库
+	// for (Entry<String, String> pi : Constant.pointInfo.entrySet()) {
+	// String building = pi.getKey().split("-")[0];
+	// String mac = pi.getKey().split("-")[1];
+	// String node = mac;
+	// String point = pi.getKey().split("-")[2];
+	// String busno = pi.getValue().split("-")[0];
+	// String site = pi.getValue().split("-")[1];
+	// try {
+	// LogUtil.info(building + " " + node + " " + point + " " + busno + " " +
+	// site);
+	// HBaseUtil.InsertPointInfo(Constant.agent,
+	// Constant.BuildingDB.get(building), building, node, point,
+	// busno, site);
+	// } catch (Exception e) {
+	// // TODO Auto-generated catch block
+	// e.printStackTrace();
+	// }
+	// // System.out.println(building + node + point + busno +
+	// // site);
+	// }
+	// try {
+	// Thread.sleep(Constant.Millisecond.MINUTE_1);
+	// } catch (InterruptedException e) {
+	// // TODO Auto-generated catch block
+	// e.printStackTrace();
+	// }
+	// }
+
+	/**
+	 * 加载config配置文件
+	 */
+	public static void loadExcelConfig() {
+		// TODO Auto-generated method stub
+		String resource = "/config.xls";
+		String path = null;
+		try {
+			LogUtil.info("System.get " + System.getProperty("user.dir") + resource);
+			LogUtil.info("LogUtil.get " + LogUtil.GetPath() + resource);
+			path = LogUtil.GetPath() + resource;
+			File file = new File(path);
+			if (file.exists()) {
+				excuteDbMysql(file);
+				excuteDbHbase(file);
+				excuteNetworkTransfer(file);
+				excuteNetworkUp(file);
+				excuteNetworkDown(file);
+				excuteRulesGlobal(file);
+				excuteRulesBuildingConvert(file);
+				excuteRulesFuncConvert(file);
+				excuteRulesWhiteList(file);
+				excuteRulesTransferList(file);
+				excuteRulesBlackList(file);
+				excuteUploadMysql(file);
+				excuteUploadHbase(file);
+			}
+		} catch (Exception e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		}
+	}
+
+	/**
+	 * 加载黑名单
+	 */
+	private static void excuteRulesBlackList(File file) {
+		// TODO Auto-generated method stub
+
+		int begin = 65535;
+		int end = 65535;
+		Map<String, Integer> pty = new HashMap<String, Integer>();
+		// Map<Integer, String> ptyValue = new HashMap<Integer, String>();
+
+		Map<Integer, Map<Integer, Map<Integer, String>>> excelData = ExcelUtil.readExcel(file);
+		for (int k = 0; k < excelData.size(); k++) {
+			Map<Integer, Map<Integer, String>> sheetData = excelData.get(k);
+			for (int i = 0; i < sheetData.size(); i++) {
+				Map<Integer, String> rowData = sheetData.get(i);
+				if ("Rules-BlackList".equalsIgnoreCase(rowData.get(0))) {
+					begin = i;
+					// Constant.info("Rules-BlackList begin: " + i);
+					for (int j = 1; j < rowData.size(); j++) {
+						pty.put(rowData.get(j), j);
+						// ptyValue.put(j, rowData.get(j));
+					}
+				} else if ((rowData.get(0).length() > 0) && !("Rules-BlackList".equalsIgnoreCase(rowData.get(0)))) {
+					begin = 65535;
+					end = 65535;
+					pty = new HashMap<String, Integer>();
+					// ptyValue = new HashMap<Integer, String>();
+					// Constant.info("Rules-BlackList end: " + i);
+				} else if (i > begin && i < end) {
+					// Constant.info("Rules-BlackList add: " + i);
+					if (rowData.get(1) == null || rowData.get(1).length() == 0) {
+						continue;
+					}
+
+					pty = Constant.toLower(pty);
+					String building = rowData.get(pty.get("building"));
+
+					Constant.black_Buildings.put(building, null);
+				}
+			}
+		}
+	}
+
+	/**
+	 * 加载白名单
+	 */
+	private static void excuteRulesWhiteList(File file) {
+		// TODO Auto-generated method stub
+
+		int begin = 65535;
+		int end = 65535;
+		Map<String, Integer> pty = new HashMap<String, Integer>();
+		// Map<Integer, String> ptyValue = new HashMap<Integer, String>();
+
+		Map<Integer, Map<Integer, Map<Integer, String>>> excelData = ExcelUtil.readExcel(file);
+		for (int k = 0; k < excelData.size(); k++) {
+			Map<Integer, Map<Integer, String>> sheetData = excelData.get(k);
+			for (int i = 0; i < sheetData.size(); i++) {
+				Map<Integer, String> rowData = sheetData.get(i);
+				if ("Rules-WhiteList".equalsIgnoreCase(rowData.get(0))) {
+					begin = i;
+					// Constant.info("Rules-WhiteList begin: " + i);
+					for (int j = 1; j < rowData.size(); j++) {
+						pty.put(rowData.get(j), j);
+						// ptyValue.put(j, rowData.get(j));
+					}
+				} else if ((rowData.get(0).length() > 0) && !("Rules-WhiteList".equalsIgnoreCase(rowData.get(0)))) {
+					begin = 65535;
+					end = 65535;
+					pty = new HashMap<String, Integer>();
+					// ptyValue = new HashMap<Integer, String>();
+					// Constant.info("Rules-WhiteList end: " + i);
+				} else if (i > begin && i < end) {
+					// Constant.info("Rules-WhiteList add: " + i);
+					if (rowData.get(1) == null || rowData.get(1).length() == 0) {
+						continue;
+					}
+
+					pty = Constant.toLower(pty);
+
+					String building = rowData.get(pty.get("building"));
+					String meter = rowData.get(pty.get("meter"));
+					String funcid = rowData.get(pty.get("funcid"));
+
+					Constant.whilte_Points.put(building + "-" + meter + "-" + funcid, null);
+				}
+			}
+		}
+	}
+
+	/**
+	 * 加载转发列表
+	 */
+	private static void excuteRulesTransferList(File file) {
+		// TODO Auto-generated method stub
+
+		int begin = 65535;
+		int end = 65535;
+		Map<String, Integer> pty = new HashMap<String, Integer>();
+		// Map<Integer, String> ptyValue = new HashMap<Integer, String>();
+
+		Map<Integer, Map<Integer, Map<Integer, String>>> excelData = ExcelUtil.readExcel(file);
+		for (int k = 0; k < excelData.size(); k++) {
+			Map<Integer, Map<Integer, String>> sheetData = excelData.get(k);
+			for (int i = 0; i < sheetData.size(); i++) {
+				Map<Integer, String> rowData = sheetData.get(i);
+				if ("Rules-TransferList".equalsIgnoreCase(rowData.get(0))) {
+					begin = i;
+					// Constant.info("Rules-TransferList begin: " + i);
+					for (int j = 1; j < rowData.size(); j++) {
+						pty.put(rowData.get(j), j);
+						// ptyValue.put(j, rowData.get(j));
+					}
+				} else if ((rowData.get(0).length() > 0) && !("Rules-TransferList".equalsIgnoreCase(rowData.get(0)))) {
+					begin = 65535;
+					end = 65535;
+					pty = new HashMap<String, Integer>();
+					// ptyValue = new HashMap<Integer, String>();
+					// Constant.info("Rules-TransferList end: " + i);
+				} else if (i > begin && i < end) {
+					// Constant.info("Rules-TransferList add: " + i);
+					if (rowData.get(1) == null || rowData.get(1).length() == 0) {
+						continue;
+					}
+
+					pty = Constant.toLower(pty);
+
+					String building = rowData.get(pty.get("building"));
+					String meter = rowData.get(pty.get("meter"));
+					String funcid = rowData.get(pty.get("funcid"));
+
+					Constant.transfer_List.put(building + "-" + meter + "-" + funcid, null);
+				}
+			}
+		}
+	}
+
+	/**
+	 * 加载表号转换规则
+	 */
+	private static void excuteRulesFuncConvert(File file) {
+		// TODO Auto-generated method stub
+
+		int begin = 65535;
+		int end = 65535;
+		Map<String, Integer> pty = new HashMap<String, Integer>();
+		// Map<Integer, String> ptyValue = new HashMap<Integer, String>();
+
+		Map<Integer, Map<Integer, Map<Integer, String>>> excelData = ExcelUtil.readExcel(file);
+		for (int k = 0; k < excelData.size(); k++) {
+			Map<Integer, Map<Integer, String>> sheetData = excelData.get(k);
+			for (int i = 0; i < sheetData.size(); i++) {
+				Map<Integer, String> rowData = sheetData.get(i);
+				if ("Rules-FuncConvert".equalsIgnoreCase(rowData.get(0))) {
+					begin = i;
+					// Constant.info("Rules-FuncConvert begin: " + i);
+					for (int j = 1; j < rowData.size(); j++) {
+						pty.put(rowData.get(j), j);
+						// ptyValue.put(j, rowData.get(j));
+					}
+				} else if ((rowData.get(0).length() > 0) && !("Rules-FuncConvert".equalsIgnoreCase(rowData.get(0)))) {
+					begin = 65535;
+					end = 65535;
+					pty = new HashMap<String, Integer>();
+					// ptyValue = new HashMap<Integer, String>();
+					// Constant.info("Rules-FuncConvert end: " + i);
+				} else if (i > begin && i < end) {
+					// Constant.info("Rules-FuncConvert add: " + i);
+					if (rowData.get(1) == null || rowData.get(1).length() == 0) {
+						continue;
+					}
+
+					pty = Constant.toLower(pty);
+					String funcidOld = rowData.get(pty.get("oldfuncid"));
+					String funcidNew = rowData.get(pty.get("newfuncid"));
+
+					Constant.FunctionConv.put(funcidOld, funcidNew);
+					Constant.FunctionConvReverse.put(funcidNew, funcidOld);
+				}
+			}
+		}
+	}
+
+	/**
+	 * 加载建筑转换规则
+	 */
+	private static void excuteRulesBuildingConvert(File file) {
+		// TODO Auto-generated method stub
+
+		int begin = 65535;
+		int end = 65535;
+		Map<String, Integer> pty = new HashMap<String, Integer>();
+		// Map<Integer, String> ptyValue = new HashMap<Integer, String>();
+
+		Map<Integer, Map<Integer, Map<Integer, String>>> excelData = ExcelUtil.readExcel(file);
+		for (int k = 0; k < excelData.size(); k++) {
+			Map<Integer, Map<Integer, String>> sheetData = excelData.get(k);
+			for (int i = 0; i < sheetData.size(); i++) {
+				Map<Integer, String> rowData = sheetData.get(i);
+				if ("Rules-BuildingConvert".equalsIgnoreCase(rowData.get(0))) {
+					begin = i;
+					// Constant.info("Rules-BuildingConvert begin: " + i);
+					for (int j = 1; j < rowData.size(); j++) {
+						pty.put(rowData.get(j), j);
+						// ptyValue.put(j, rowData.get(j));
+					}
+				} else if ((rowData.get(0).length() > 0)
+						&& !("Rules-BuildingConvert".equalsIgnoreCase(rowData.get(0)))) {
+					begin = 65535;
+					end = 65535;
+					pty = new HashMap<String, Integer>();
+					// ptyValue = new HashMap<Integer, String>();
+					// Constant.info("Rules-BuildingConvert end: " + i);
+				} else if (i > begin && i < end) {
+					// Constant.info("Rules-BuildingConvert add: " + i);
+					if (rowData.get(1) == null || rowData.get(1).length() == 0) {
+						continue;
+					}
+					pty = Constant.toLower(pty);
+					String buildingOld = rowData.get(pty.get("oldbuilding"));
+					String buildingNew = rowData.get(pty.get("newbuilding"));
+					String timeOffset = rowData.get(pty.get("timeoffset"));
+					if (!Constant.BuildingAdds.containsKey(buildingOld)) {
+						Constant.BuildingAdds.put(buildingOld, new ArrayList<String>());
+					}
+					Constant.BuildingAdds.get(buildingOld).add(buildingNew);
+					Constant.BuildingConv.put(buildingNew, buildingOld);
+					Constant.BuildingOffset.put(buildingOld, Boolean.getBoolean(timeOffset));
+				}
+			}
+		}
+	}
+
+	/**
+	 * 加载全局配置
+	 */
+	private static void excuteRulesGlobal(File file) {
+		// TODO Auto-generated method stub
+		int begin = 65535;
+		int end = 65535;
+		Map<String, Integer> pty = new HashMap<String, Integer>();
+		// Map<Integer, String> ptyValue = new HashMap<Integer, String>();
+
+		Map<Integer, Map<Integer, Map<Integer, String>>> excelData = ExcelUtil.readExcel(file);
+		for (int k = 0; k < excelData.size(); k++) {
+			Map<Integer, Map<Integer, String>> sheetData = excelData.get(k);
+			for (int i = 0; i < sheetData.size(); i++) {
+				Map<Integer, String> rowData = sheetData.get(i);
+				if ("Rules-Global".equalsIgnoreCase(rowData.get(0))) {
+					begin = i;
+					// Constant.info("Rules-Global begin: " + i);
+					for (int j = 1; j < rowData.size(); j++) {
+						pty.put(rowData.get(j), j);
+						// ptyValue.put(j, rowData.get(j));
+					}
+				} else if ((rowData.get(0).length() > 0) && !("Rules-Global".equalsIgnoreCase(rowData.get(0)))) {
+					begin = 65535;
+					end = 65535;
+					pty = new HashMap<String, Integer>();
+					// ptyValue = new HashMap<Integer, String>();
+					// Constant.info("Rules-Global end: " + i);
+				} else if (i > begin && i < end) {
+					// Constant.info("Rules-Global add: " + i);
+					if (rowData.get(1) == null || rowData.get(1).length() == 0) {
+						continue;
+					}
+					pty = Constant.toLower(pty);
+
+					Constant.Disconnect = Constant.getMillisecond(rowData.get(pty.get("disconnect")));
+					Constant.Database = rowData.get(pty.get("database"));
+					Constant.InsertThread = Integer.valueOf(rowData.get(pty.get("insertthread")));
+					// if (rowData.get(pty.get("uploadtable")) != null) {
+					// for (String upload :
+					// rowData.get(pty.get("uploadtable")).split(",")) {
+					// Constant.uploadList.add(upload);
+					// }
+					// }
+					if (rowData.get(pty.get("savetype")) != null) {
+						for (String savetype : rowData.get(pty.get("savetype")).split(",")) {
+							Constant.saveTypeList.add(savetype);
+						}
+					}
+					if (rowData.get(pty.get("delay")) != null) {
+						String delay = rowData.get(pty.get("delay"));
+						delay = delay.replace("Second", "").replace("second", "").replace("s", "").replace("S", "");
+						Constant.delay = Constant.Millisecond.SECOND_1 * Long.parseLong(delay);
+					}
+				}
+			}
+		}
+	}
+
+	/**
+	 * 加载网络配置(对下)
+	 */
+	private static void excuteNetworkDown(File file) {
+		// TODO Auto-generated method stub
+		int begin = 65535;
+		int end = 65535;
+
+		Map<String, Integer> pty = new HashMap<String, Integer>();
+		// Map<Integer, String> ptyValue = new HashMap<Integer, String>();
+		Map<Integer, Map<Integer, Map<Integer, String>>> excelData = ExcelUtil.readExcel(file);
+		for (int k = 0; k < excelData.size(); k++) {
+			Map<Integer, Map<Integer, String>> sheetData = excelData.get(k);
+			for (int i = 0; i < sheetData.size(); i++) {
+				Map<Integer, String> rowData = sheetData.get(i);
+				if ("Network-Down".equalsIgnoreCase(rowData.get(0))) {
+					begin = i;
+					// Constant.info("Network-Down begin: " + i);
+					for (int j = 1; j < rowData.size(); j++) {
+						pty.put(rowData.get(j), j);
+						// ptyValue.put(j, rowData.get(j));
+					}
+				} else if ((rowData.get(0).length() > 0) && !("Network-Down".equalsIgnoreCase(rowData.get(0)))) {
+					begin = 65535;
+					end = 65535;
+					pty = new HashMap<String, Integer>();
+					// ptyValue = new HashMap<Integer, String>();
+					// Constant.info("Network-Down end: " + i);
+				} else if (i > begin && i < end) {
+					// Constant.info("Network-Down add: " + i);
+					if (rowData.get(1) == null || rowData.get(1).length() == 0) {
+						continue;
+					}
+					pty = Constant.toLower(pty);
+					Server server = new Server();
+					server.IP = rowData.get(pty.get("ip"));
+					server.Port = Integer.valueOf(rowData.get(pty.get("port")));
+					server.compress = Boolean.getBoolean(rowData.get(pty.get("compress")));
+
+					Constant.TypeServer.put("Down", server);
+				}
+			}
+		}
+	}
+
+	/**
+	 * 加载网络配置(对上)
+	 */
+	private static void excuteNetworkTransfer(File file) {
+		// TODO Auto-generated method stub
+
+		int begin = 65535;
+		int end = 65535;
+		Map<String, Integer> pty = new HashMap<String, Integer>();
+		// Map<Integer, String> ptyValue = new HashMap<Integer, String>();
+		Map<Integer, Map<Integer, Map<Integer, String>>> excelData = ExcelUtil.readExcel(file);
+		for (int k = 0; k < excelData.size(); k++) {
+			Map<Integer, Map<Integer, String>> sheetData = excelData.get(k);
+			for (int i = 0; i < sheetData.size(); i++) {
+				Map<Integer, String> rowData = sheetData.get(i);
+				if ("Network-Transfer".equalsIgnoreCase(rowData.get(0))) {
+					begin = i;
+					// Constant.info("Network-Transfer begin: " + i);
+					for (int j = 1; j < rowData.size(); j++) {
+						pty.put(rowData.get(j), j);
+						// ptyValue.put(j, rowData.get(j));
+					}
+				} else if ((rowData.get(0).length() > 0) && !("Network-Transfer".equalsIgnoreCase(rowData.get(0)))) {
+					begin = 65535;
+					end = 65535;
+					pty = new HashMap<String, Integer>();
+					// ptyValue = new HashMap<Integer, String>();
+					// Constant.info("Network-Transfer end: " + i);
+				} else if (i > begin && i < end) {
+					// Constant.info("Network-Transfer add: " + i);
+					if (rowData.get(1) == null || rowData.get(1).length() == 0) {
+						continue;
+					}
+					pty = Constant.toLower(pty);
+					Constant.transfer.PROTOCOL = rowData.get(pty.get("protocol"));
+					Constant.transfer.IP = rowData.get(pty.get("ip"));
+					Constant.transfer.Port = Integer.valueOf(rowData.get(pty.get("port")));
+					Constant.transfer.ServerIP = rowData.get(pty.get("serverip"));
+					Constant.transfer.ServerPort = Integer.valueOf(rowData.get(pty.get("serverport")));
+					Constant.transfer.Mode = rowData.get(pty.get("mode"));
+					Constant.transfer.Max_size = Integer.valueOf(rowData.get(pty.get("max_size")));
+					Constant.transfer.SleepCount = Integer.valueOf(rowData.get(pty.get("sleepcount")));
+					Constant.transfer.Separate = rowData.get(pty.get("separate"));
+					Constant.transfer.Separate_begin = rowData.get(pty.get("separate_begin"));
+					Constant.transfer.Separate_end = rowData.get(pty.get("separate_end"));
+					Constant.transfer.compress = Boolean.getBoolean(rowData.get(pty.get("compress")));
+				}
+			}
+		}
+	}
+
+	/**
+	 * 加载网络配置(对上)
+	 */
+	private static void excuteNetworkUp(File file) {
+		// TODO Auto-generated method stub
+
+		int begin = 65535;
+		int end = 65535;
+		Map<String, Integer> pty = new HashMap<String, Integer>();
+		// Map<Integer, String> ptyValue = new HashMap<Integer, String>();
+		Map<Integer, Map<Integer, Map<Integer, String>>> excelData = ExcelUtil.readExcel(file);
+		for (int k = 0; k < excelData.size(); k++) {
+			Map<Integer, Map<Integer, String>> sheetData = excelData.get(k);
+			for (int i = 0; i < sheetData.size(); i++) {
+				Map<Integer, String> rowData = sheetData.get(i);
+				if ("Network-Up".equalsIgnoreCase(rowData.get(0))) {
+					begin = i;
+					// Constant.info("Network-Up begin: " + i);
+					for (int j = 1; j < rowData.size(); j++) {
+						pty.put(rowData.get(j), j);
+						// ptyValue.put(j, rowData.get(j));
+					}
+				} else if ((rowData.get(0).length() > 0) && !("Network-Up".equalsIgnoreCase(rowData.get(0)))) {
+					begin = 65535;
+					end = 65535;
+					pty = new HashMap<String, Integer>();
+					// ptyValue = new HashMap<Integer, String>();
+					// Constant.info("Network-Up end: " + i);
+				} else if (i > begin && i < end) {
+					// Constant.info("Network-Up add: " + i);
+					if (rowData.get(1) == null || rowData.get(1).length() == 0) {
+						continue;
+					}
+					pty = Constant.toLower(pty);
+					Server server = new Server();
+					server.IP = rowData.get(pty.get("ip"));
+					server.Port = Integer.valueOf(rowData.get(pty.get("port")));
+					server.compress = Boolean.getBoolean(rowData.get(pty.get("compress")));
+
+					Constant.TypeServer.put("Up", server);
+				}
+			}
+		}
+	}
+
+	/**
+	 * 加载HBase配置
+	 */
+	private static void excuteDbHbase(File file) {
+		// TODO Auto-generated method stub
+
+		int begin = 65535;
+		int end = 65535;
+		Map<String, Integer> pty = new HashMap<String, Integer>();
+		// Map<Integer, String> ptyValue = new HashMap<Integer, String>();
+
+		Map<Integer, Map<Integer, Map<Integer, String>>> excelData = ExcelUtil.readExcel(file);
+		for (int k = 0; k < excelData.size(); k++) {
+			Map<Integer, Map<Integer, String>> sheetData = excelData.get(k);
+			for (int i = 0; i < sheetData.size(); i++) {
+				Map<Integer, String> rowData = sheetData.get(i);
+				if ("Db-Hbase".equalsIgnoreCase(rowData.get(0))) {
+					begin = i;
+					// Constant.info("Db-Hbase begin: " + i);
+					for (int j = 1; j < rowData.size(); j++) {
+						pty.put(rowData.get(j), j);
+						// ptyValue.put(j, rowData.get(j));
+					}
+				} else if ((rowData.get(0).length() > 0) && !("Db-Hbase".equalsIgnoreCase(rowData.get(0)))) {
+					begin = 65535;
+					end = 65535;
+					pty = new HashMap<String, Integer>();
+					// ptyValue = new HashMap<Integer, String>();
+					// Constant.info("Db-Hbase end: " + i);
+				} else if (i > begin && i < end) {
+					// Constant.info("Db-Hbase add: " + i);
+					if (rowData.get(1) == null || rowData.get(1).length() == 0) {
+						continue;
+					}
+					pty = Constant.toLower(pty);
+					EntityHbase entityHbase = new EntityHbase();
+					entityHbase.Address = rowData.get(pty.get("address"));
+
+					Constant.DbConnection.put("Db-Hbase", entityHbase);
+				}
+			}
+		}
+	}
+
+	/**
+	 * 加载mysql配置
+	 */
+	private static void excuteDbMysql(File file) {
+		// TODO Auto-generated method stub
+
+		int begin = 65535;
+		int end = 65535;
+		Map<String, Integer> pty = new HashMap<String, Integer>();
+		// Map<Integer, String> ptyValue = new HashMap<Integer, String>();
+
+		Map<Integer, Map<Integer, Map<Integer, String>>> excelData = ExcelUtil.readExcel(file);
+		for (int k = 0; k < excelData.size(); k++) {
+			Map<Integer, Map<Integer, String>> sheetData = excelData.get(k);
+			for (int i = 0; i < sheetData.size(); i++) {
+				Map<Integer, String> rowData = sheetData.get(i);
+				if ("Db-Mysql".equalsIgnoreCase(rowData.get(0))) {
+					begin = i;
+					// Constant.info("Db-Mysql begin: " + i);
+					for (int j = 1; j < rowData.size(); j++) {
+						pty.put(rowData.get(j), j);
+						// ptyValue.put(j, rowData.get(j));
+					}
+				} else if ((rowData.get(0).length() > 0) && !("Db-Mysql".equalsIgnoreCase(rowData.get(0)))) {
+					begin = 65535;
+					end = 65535;
+					pty = new HashMap<String, Integer>();
+					// ptyValue = new HashMap<Integer, String>();
+					// Constant.info("Db-Mysql end: " + i);
+				} else if (i > begin && i < end) {
+					// Constant.info("Db-Mysql add: " + i);
+					if (rowData.get(1) == null || rowData.get(1).length() == 0) {
+						continue;
+					}
+					pty = Constant.toLower(pty);
+					EntityMysql entityMysql = new EntityMysql();
+					entityMysql.Ip = rowData.get(pty.get("ip"));
+					entityMysql.Port = Integer.valueOf(rowData.get(pty.get("port")));
+					entityMysql.User = rowData.get(pty.get("user"));
+					entityMysql.Password = rowData.get(pty.get("password"));
+
+					Constant.DbConnection.put("Db-Mysql", entityMysql);
+				}
+			}
+		}
+	}
+
+	/**
+	 * 加载mysql配置
+	 */
+	private static void excuteUploadMysql(File file) {
+		// TODO Auto-generated method stub
+
+		int begin = 65535;
+		int end = 65535;
+		Map<String, Integer> pty = new HashMap<String, Integer>();
+		// Map<Integer, String> ptyValue = new HashMap<Integer, String>();
+
+		Map<Integer, Map<Integer, Map<Integer, String>>> excelData = ExcelUtil.readExcel(file);
+		for (int k = 0; k < excelData.size(); k++) {
+			Map<Integer, Map<Integer, String>> sheetData = excelData.get(k);
+			for (int i = 0; i < sheetData.size(); i++) {
+				Map<Integer, String> rowData = sheetData.get(i);
+				if ("Upload-Mysql".equalsIgnoreCase(rowData.get(0))) {
+					begin = i;
+					// Constant.info("Upload-Mysql begin: " + i);
+					for (int j = 1; j < rowData.size(); j++) {
+						pty.put(rowData.get(j), j);
+						// ptyValue.put(j, rowData.get(j));
+					}
+				} else if ((rowData.get(0).length() > 0) && !("Upload-Mysql".equalsIgnoreCase(rowData.get(0)))) {
+					begin = 65535;
+					end = 65535;
+					pty = new HashMap<String, Integer>();
+					// ptyValue = new HashMap<Integer, String>();
+					// Constant.info("Upload-Mysql end: " + i);
+				} else if (i > begin && i < end) {
+					// Constant.info("Upload-Mysql add: " + i);
+					if (rowData.get(1) == null || rowData.get(1).length() == 0) {
+						continue;
+					}
+					pty = Constant.toLower(pty);
+					EntityMysql entityMysql = new EntityMysql();
+					entityMysql.Ip = rowData.get(pty.get("ip"));
+					entityMysql.Port = Integer.valueOf(rowData.get(pty.get("port")));
+					entityMysql.User = rowData.get(pty.get("user"));
+					entityMysql.Password = rowData.get(pty.get("password"));
+					entityMysql.UploadDatabase = rowData.get(pty.get("uploaddatabase"));
+					entityMysql.UploadTable = rowData.get(pty.get("uploadtable"));
+					Constant.DbConnection.put("Upload-Mysql", entityMysql);
+				}
+			}
+		}
+	}
+
+	/**
+	 * 加载HBase配置
+	 */
+	private static void excuteUploadHbase(File file) {
+		// TODO Auto-generated method stub
+
+		int begin = 65535;
+		int end = 65535;
+		Map<String, Integer> pty = new HashMap<String, Integer>();
+		// Map<Integer, String> ptyValue = new HashMap<Integer, String>();
+
+		Map<Integer, Map<Integer, Map<Integer, String>>> excelData = ExcelUtil.readExcel(file);
+		for (int k = 0; k < excelData.size(); k++) {
+			Map<Integer, Map<Integer, String>> sheetData = excelData.get(k);
+			for (int i = 0; i < sheetData.size(); i++) {
+				Map<Integer, String> rowData = sheetData.get(i);
+				if ("Upload-Hbase".equalsIgnoreCase(rowData.get(0))) {
+					begin = i;
+					// Constant.info("Upload-Hbase begin: " + i);
+					for (int j = 1; j < rowData.size(); j++) {
+						pty.put(rowData.get(j), j);
+						// ptyValue.put(j, rowData.get(j));
+					}
+				} else if ((rowData.get(0).length() > 0) && !("Upload-Hbase".equalsIgnoreCase(rowData.get(0)))) {
+					begin = 65535;
+					end = 65535;
+					pty = new HashMap<String, Integer>();
+					// ptyValue = new HashMap<Integer, String>();
+					// Constant.info("Upload-Hbase end: " + i);
+				} else if (i > begin && i < end) {
+					// Constant.info("Upload-Hbase add: " + i);
+					if (rowData.get(1) == null || rowData.get(1).length() == 0) {
+						continue;
+					}
+					pty = Constant.toLower(pty);
+					EntityHbase entityHbase = new EntityHbase();
+					entityHbase.Address = rowData.get(pty.get("address"));
+					entityHbase.UploadDatabase = rowData.get(pty.get("UploadDatabase"));
+					entityHbase.UploadTable = rowData.get(pty.get("UploadTable"));
+
+					Constant.DbConnection.put("Upload-Hbase", entityHbase);
+				}
+			}
+		}
+	}
+	// private void loadJsonConfig() {
+	// // TODO Auto-generated method stub
+	// String resource = "/config.json";
+	// String path = null;
+	// JsonParser config = new JsonParser();
+	//
+	// try {
+	// LogUtil.info("System.get " + System.getProperty("user.dir") + resource);
+	// LogUtil.info("LogUtil.get " + LogUtil.GetPath() + resource);
+	// path = LogUtil.GetPath() + resource;
+	//
+	// JsonObject object = (JsonObject) config.parse(new FileReader(path));
+	//
+	// JsonArray db = object.get("DB").getAsJsonArray();
+	// for (int i = 0; i < db.size(); i++) {
+	// JsonObject subObject = db.get(i).getAsJsonObject();
+	// if (subObject.get("building") != null) {
+	// String building = subObject.get("building").getAsString();
+	// // if(Constant.BuildingDB.containsKey(building)){
+	// // continue;
+	// // }
+	// Constant.BuildingDB.put(building,
+	// subObject.get("database").getAsString());
+	//
+	// if (subObject.get("buildingadds") != null) {
+	// JsonArray buildingAdds = subObject.get("buildingadds").getAsJsonArray();
+	// for (int j = 0; j < buildingAdds.size(); j++) {
+	// JsonObject addObject = buildingAdds.get(j).getAsJsonObject();
+	// String builing_new = addObject.get("building").getAsString();
+	// if (!Constant.BuildingAdds.containsKey(building)) {
+	// Constant.BuildingAdds.put(building, new ArrayList<String>());
+	// }
+	// if (!exist(builing_new)) {
+	// Constant.BuildingAdds.get(building).add(builing_new);
+	// Constant.BuildingConv.put(builing_new, building);
+	// }
+	// }
+	//
+	// }
+	// } else if (subObject.get("insertthread") != null) {
+	// Constant.InsertThread = subObject.get("insertthread").getAsInt();
+	// }
+	// }
+	// JsonArray port = object.get("Port").getAsJsonArray();
+	// for (int i = 0; i < port.size(); i++) {
+	// JsonObject subObject = port.get(i).getAsJsonObject();
+	// Constant.TypePort.put(subObject.get("type").getAsString(),
+	// subObject.get("port").getAsString());
+	// Constant.PortCompress.put(Integer.valueOf(subObject.get("port").getAsString()),
+	// subObject.get("Compress").getAsString());
+	// Constant.PortHistory.put(Integer.valueOf(subObject.get("port").getAsString()),
+	// subObject.get("History").getAsString());
+	// }
+	//
+	// } catch (Exception e) {
+	// // TODO Auto-generated catch block
+	// e.printStackTrace();
+	// }
+	// }
+	//
+	// private boolean exist(String builing_new) {
+	// // TODO Auto-generated method stub
+	// if (Constant.BuildingConv.containsKey(builing_new)) {
+	// return true;
+	// }
+	// return false;
+	// }
+}

+ 457 - 0
src/main/java/com/saga/thread/common/SaveThread.java

@@ -0,0 +1,457 @@
+package com.saga.thread.common;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.Iterator;
+import java.util.List;
+
+import org.zillion.util.log.LogUtil;
+
+import com.saga.entity.Record;
+import com.saga.util.Constant;
+
+/**
+ * 数据处理
+ *
+ * @author 李井强
+ */
+public class SaveThread extends Thread {
+	// private List<String> pointCommunicationList = new ArrayList<String>();
+	// private String ip = null;
+	private List<String> streportList = new ArrayList<String>();
+	private List<Record> strecordList = new ArrayList<Record>();
+
+	public SaveThread() {
+		try {
+			// this.ip = Constant.getLocalHostLANAddress().getHostAddress() +
+			// ":" + Constant.TypePort.get("Down");
+		} catch (Exception e) {
+			// TODO Auto-generated catch block
+			// this.ip = "0.0.0.0" + ":" + Constant.TypePort.get("Down");
+			e.printStackTrace();
+		}
+	}
+
+	public void run() {
+		LogUtil.info("SaveThread" + " Starting ...");
+		while (true) {
+			try {
+				// this.insertPointCommunicationLog();
+				this.handleCollectReportList2();
+				// this.handleCollectReportList1();
+
+				Thread.sleep(1L);
+			} catch (InterruptedException e) {
+				// TODO Auto-generated catch block
+				e.printStackTrace();
+			}
+		}
+	}
+
+	// private void insertPointCommunicationLog() {
+	// // TODO Auto-generated method stub
+	//
+	// // PointCommunicationLog添加记录
+	// try {
+	// if (pointCommunicationList.size() > 0) {
+	// // LogUtil.info("pointCommunicationList.size: " +
+	// // pointCommunicationList.size());
+	// // LogUtil.info("InsertPointCommunicationLog begin...");
+	// HBaseUtil.InsertPointCommunicationLog(pointCommunicationList);
+	// // LogUtil.info("InsertPointCommunicationLog end...");
+	// pointCommunicationList = new ArrayList<String>();
+	// }
+	// } catch (Exception e) {
+	// // TODO Auto-generated catch block
+	// e.printStackTrace();
+	// }
+	// }
+
+	/**
+	 * 报文处理
+	 */
+	private void handleCollectReportList2() {
+		// TODO Auto-generated method stub
+		try {
+			synchronized (Constant.CollectReportList) {
+				if (Constant.CollectReportList.size() > 0) {
+					LogUtil.info("Constant.CollectReportList:" + Constant.CollectReportList.size());
+					this.streportList.addAll(Constant.CollectReportList);
+					Constant.CollectReportList.clear();
+					// Constant.CollectReportList = new ArrayList<String>();
+					LogUtil.info("Constant.CollectReportList:" + Constant.CollectReportList.size());
+					if (Constant.CollectReportList.size() > 0) {
+						LogUtil.warn("Constant.CollectReportList:" + Constant.CollectReportList.size());
+						Constant.CollectReportList.clear();
+						System.gc();
+					}
+
+				} else {
+					return;
+				}
+			}
+			Constant.collectReportCount += this.streportList.size();
+			LogUtil.info("ReportList:" + this.streportList.size());
+			int seq = 0;
+
+			while (this.streportList.size() > 0) {
+				seq++;
+				LogUtil.info("ReportList:" + this.streportList.size() + " seq:" + seq);
+				int no = 5000 > this.streportList.size() ? this.streportList.size() : 5000;
+				if (no == 5000 || seq > 1) {
+					LogUtil.info("ReportList:" + this.streportList.size() + " seq:" + seq);
+				}
+				String b = this.streportList.get(0).replace("(", "").replace(")", "").replace("", "");
+				if (b == null || b.length() == 0) {
+					this.streportList.remove(0);
+					return;
+				}
+				b = this.streportList.get(0).replace("(", "").replace(")", "").replace(" ", "").split(";")[0];
+
+				while (Constant.RecordListToDB.size() > 0) {
+					LogUtil.info("wait Constant.RecordListToDB progressing ... ");
+					if (Constant.RecordListToDB.size() == 0) {
+						LogUtil.warn("wait Constant.RecordListToDB end ");
+						break;
+					} else {
+						Thread.sleep(3L);
+					}
+					Thread.sleep(1L);
+				}
+
+				// recordList = new ArrayList<Record>();
+				if (this.strecordList.size() > 0) {
+					LogUtil.warn("SaveThread.recordList " + this.strecordList.size());
+					this.strecordList.clear();
+					System.gc();
+				}
+				Iterator<String> it = this.streportList.iterator();
+				int c = 0;
+				synchronized (Constant.ps_PointStatusUp) {
+					while (it.hasNext()) {
+						try {
+							String report = it.next().replace("(", "").replace(")", "").replace(" ", "");
+							if (c < no) {
+								if (report != null) {
+									String[] rList = report.replace("(", "").replace(")", "").replace(" ", "")
+											.split(";");
+									if (rList != null && rList.length > 8) {
+										String building = rList[0];
+										if (!building.equalsIgnoreCase(b)) {
+											continue;
+										}
+										// String mac = rList[1];
+										String function = rList[2];
+										Date time = Constant.parse(rList[3]);
+										String meter = rList[5];
+										int count = Integer.valueOf(rList[6]);
+										// String id = rList[4];
+
+										for (int i = 0; i < count; i++) {
+											Record record = new Record();
+											if ("report".equalsIgnoreCase(function)) {
+												record.funcID = Integer.valueOf(rList[7 + 2 * i]);
+												record.data = Double.valueOf(rList[8 + 2 * i]);
+												// synchronized
+												// (Constant.pointListUp) {
+												Constant.ps_PointStatusUp.put(
+														building + "-" + meter + "." + record.funcID,
+														System.currentTimeMillis());
+												// }
+
+											} else if ("reportaddtion".equalsIgnoreCase(function)) {
+												record.funcID = Integer.valueOf(rList[7 + 3 * i]);
+												record.data = Double.valueOf(rList[8 + 3 * i]);
+												record.addtion = "null".equalsIgnoreCase(rList[9 + i * 3]) ? ""
+														: (rList[9 + i * 3]);
+												// synchronized
+												// (Constant.pointListUp) {
+												Constant.ps_PointStatusUp.put(
+														building + "-" + meter + "." + record.funcID,
+														System.currentTimeMillis());
+
+												// }
+											}
+
+											record.buildingSign = building;
+											record.meterSign = meter;
+											record.receivetime = time;
+											record.receivetime = Constant.getOffSetTime(record);
+											record.funcID = Constant.getFunctionConv(record);
+
+											if (toDB(record.buildingSign, record.meterSign, record.funcID)) {
+												this.strecordList.add(record);
+											}
+										}
+										it.remove();
+										// LogUtil.info("HBase.BatchInsert "
+										// +
+										// report);
+									} else {
+										it.remove();
+									}
+
+								} else {
+									it.remove();
+								}
+							} else {
+								break;
+							}
+							c++;
+							// Thread.sleep(1L);
+						} catch (Exception e) {
+							// TODO Auto-generated catch block
+							it.remove();
+							LogUtil.error("SaveThread.run.Exception: " + e.toString());
+						}
+					}
+				}
+
+				Constant.RecordListToDB.addAll(this.strecordList);
+				Constant.report2DBCount += this.strecordList.size();
+				LogUtil.info("Constant.RecordListToDB add " + this.strecordList.size());
+				// recordList = new ArrayList<Record>();
+				this.strecordList.clear();
+
+				Thread.sleep(1L);
+
+				// Thread.sleep(Constant.Millisecond.SECOND_1);
+			}
+			if (this.streportList.size() > 0) {
+				LogUtil.warn("SaveThread.reportList " + streportList.size());
+				this.streportList.clear();
+				System.gc();
+				LogUtil.warn("SaveThread.reportList " + streportList.size());
+			}
+		} catch (Exception e) {
+			// TODO Auto-generated catch block
+			LogUtil.error("SaveThread.run.Exception: " + e.toString());
+			// Constant.DBConn = false;
+		}
+	}
+
+	/**
+	 * 是否需要进库
+	 * 
+	 * @param meterSign
+	 */
+	private boolean toDB(String buildingSign, String meterSign, int funcID) {
+		// TODO Auto-generated method stub
+		if (toDB_building(buildingSign) && toDB_Point(buildingSign, meterSign, funcID)) {
+			return true;
+		}
+		return false;
+	}
+
+	/**
+	 * 是否需要进库
+	 * 
+	 * @param meterSign
+	 * @param buildingSign
+	 */
+	private boolean toDB_Point(String buildingSign, String meterSign, int funcID) {
+		// TODO Auto-generated method stub
+		if (Constant.whilte_Points == null || Constant.whilte_Points.size() == 0) {
+			return true;
+		}
+		if (Constant.whilte_Points.containsKey(buildingSign + "-" + meterSign + "-" + funcID)
+				|| Constant.whilte_Points.containsKey(buildingSign + "-" + meterSign + "-" + "all")
+				|| Constant.whilte_Points.containsKey(buildingSign + "-" + "all" + "-" + "all")
+				|| Constant.whilte_Points.containsKey(buildingSign + "-" + "all" + "-" + funcID)) {
+			return true;
+		}
+		return false;
+	}
+
+	/**
+	 * 是否需要进库
+	 */
+	private boolean toDB_building(String buildingSign) {
+		// TODO Auto-generated method stub
+		if (!Constant.black_Buildings.containsKey(buildingSign)) {
+			return true;
+		}
+		return false;
+	}
+
+	// private void addPointCommunicationList(String building, String ip, String
+	// mac, String point, String id,
+	// String receivetime, String addtion) {
+	// // TODO Auto-generated method stub
+	// this.pointCommunicationList.add(building + ";" + ip + ";" + mac + ";" +
+	// point + ";" + "conn/disconn" + ";" + id
+	// + ";" + receivetime + ";" + addtion);
+	// }
+
+	// private void handleCollectReportList1() {
+	// // TODO Auto-generated method stub
+	// try {
+	// synchronized (Constant.CollectReportList) {
+	//
+	// if (Constant.CollectReportList.size() > 0) {
+	// // LogUtil.info("SaveThread Challenge
+	// // Constant.CollectReportList
+	// // begin...");
+	// // synchronized (Constant.CollectReportList) {
+	// // LogUtil.info("SaveThread Challenge
+	// // Constant.CollectReportList get...");
+	// // LogUtil.info("Constant.CollectReportList.size(): " +
+	// // Constant.CollectReportList.size());
+	// int no = 5000 > Constant.CollectReportList.size() ?
+	// Constant.CollectReportList.size() : 5000;
+	// String b = Constant.CollectReportList.get(0).replace("(",
+	// "").replace(")", "").replace(" ", "");
+	// if (b == null || b.length() == 0) {
+	// Constant.CollectReportList.remove(0);
+	// return;
+	// }
+	// b = Constant.CollectReportList.get(0).replace("(", "").replace(")",
+	// "").replace(" ", "")
+	// .split(";")[0];
+	// // if (Constant.RecordListToDB.size() > 0) {
+	// // LogUtil.info("wait Constant.RecordListToDB begin");
+	// // LogUtil.info("size:" + Constant.RecordListToDB.size()
+	// // + "-->0");
+	// // }
+	// while (Constant.RecordListToDB.size() > 0) {
+	// if (Constant.RecordListToDB.size() == 0) {
+	// LogUtil.info("wait Constant.RecordListToDB end ");
+	// break;
+	// } else {
+	// Thread.sleep(3L);
+	// LogUtil.info(
+	// "wait Constant.RecordListToDB.size:" + Constant.RecordListToDB.size() +
+	// "-->0");
+	// }
+	// Thread.sleep(1L);
+	// }
+	//
+	// // List<Record> recordList = new ArrayList<Record>();
+	// this.strecordList.clear();
+	// Iterator<String> it = Constant.CollectReportList.iterator();
+	// int c = 0;
+	// while (it.hasNext()) {
+	// // LogUtil.info("Constant.CollectReportList deal " + c);
+	// try {
+	//
+	// String report = it.next().replace("(", "").replace(")", "").replace(" ",
+	// "");
+	// if (c < no) {
+	// if (report != null) {
+	// String[] rList = report.replace("(", "").replace(")", "").replace(" ",
+	// "")
+	// .split(";");
+	// if (rList != null && rList.length > 8) {
+	// String building = rList[0];
+	// if (!building.equalsIgnoreCase(b)) {
+	// continue;
+	// }
+	// String mac = rList[1];
+	// String function = rList[2];
+	// Date time = Constant.parse(rList[3]);
+	// String meter = rList[5];
+	// int count = Integer.valueOf(rList[6]);
+	// // String id = rList[4];
+	//
+	// for (int i = 0; i < count; i++) {
+	// Record record = new Record();
+	// if ("report".equalsIgnoreCase(function)) {
+	// Constant.collectReportCount++;
+	// record.funcID = Integer.valueOf(rList[7 + 2 * i]);
+	// record.data = Double.valueOf(rList[8 + 2 * i]);
+	// Constant.ps_PointStatusUp.put(
+	// building + "-" + mac + "-" + meter + "." + record.funcID,
+	// System.currentTimeMillis());
+	// // // PointCommunicationLog添加记录
+	// // this.pointCommunicationList.add(building
+	// // + ";" + this.ip + ";" + mac
+	// // + ";" + meter + "." +
+	// // record.funcID + ";" +
+	// // function + ";" + id
+	// // + ";" + rList[3] + ";" + "");
+	// } else if ("reportaddtion".equalsIgnoreCase(function)) {
+	// Constant.collectReportCount++;
+	// record.funcID = Integer.valueOf(rList[7 + 3 * i]);
+	// record.data = Double.valueOf(rList[8 + 3 * i]);
+	// record.addtion = "null".equalsIgnoreCase(rList[9 + i * 3]) ? ""
+	// : (rList[9 + i * 3]);
+	// Constant.ps_PointStatusUp.put(
+	// building + "-" + mac + "-" + meter + "." + record.funcID,
+	// System.currentTimeMillis());
+	// // // PointCommunicationLog添加记录
+	// // this.pointCommunicationList.add(building
+	// // + ";" + this.ip + ";" + mac
+	// // + ";" + meter + "." +
+	// // record.funcID + ";" +
+	// // function + ";" + id
+	// // + ";" + rList[3] + ";" +
+	// // record.addtion);
+	// // HBaseUtil.InsertPointCommunicationLog(Constant.agent,
+	// // Constant.BuildingDB.get(building),
+	// // building,
+	// // Constant.getLocalHostLANAddress().getHostAddress(),
+	// // mac,
+	// // meter + "." + record.funcID,
+	// // function, id, rList[3],
+	// // record.addtion);
+	//
+	// }
+	//
+	// record.buildingSign = building;
+	// record.meterSign = meter;
+	// record.receivetime = time;
+	//
+	// this.strecordList.add(record);
+	//
+	// }
+	// it.remove();
+	// // LogUtil.info("HBase.BatchInsert "
+	// // +
+	// // report);
+	// } else {
+	// it.remove();
+	// }
+	//
+	// } else {
+	// it.remove();
+	// }
+	// } else {
+	// break;
+	// }
+	// c++;
+	// Thread.sleep(1L);
+	// } catch (Exception e) {
+	// // TODO Auto-generated catch block
+	// it.remove();
+	// LogUtil.error("SaveThread.run.Exception: " + e.toString());
+	// }
+	// }
+	// }
+	// }
+	// // LogUtil.info("SaveThread Challenge
+	// // Constant.RecordListToDB begin...");
+	// Constant.RecordListToDB.addAll(this.strecordList);
+	// Constant.report2DBCount += this.strecordList.size();
+	// this.strecordList.clear();
+	// if (this.strecordList.size() > 0) {
+	// this.strecordList = new ArrayList<Record>();
+	// System.gc();
+	// }
+	// // LogUtil.info("SaveThread Challenge
+	// // Constant.RecordListToDB realse...");
+	// // HBaseUtil.BatchInsert(Constant.agent,
+	// // Constant.BuildingDB.get(b), recordList);
+	// // }
+	// // LogUtil.info("SaveThread Challenge
+	// // Constant.CollectReportList
+	// // realse...");
+	// Thread.sleep(1L);
+	//
+	// // Thread.sleep(Constant.Millisecond.SECOND_1);
+	// } catch (Exception e) {
+	// // TODO Auto-generated catch block
+	// LogUtil.error("SaveThread.run.Exception: " + e.toString());
+	// // Constant.DBConn = false;
+	// }
+	// }
+}

+ 103 - 0
src/main/java/com/saga/thread/common/StatsThread.java

@@ -0,0 +1,103 @@
+package com.saga.thread.common;
+
+import java.util.Date;
+
+import org.zillion.util.log.LogUtil;
+
+import com.saga.util.Constant;
+
+/**
+ * 统计
+ *
+ * @author 李井强
+ */
+public class StatsThread extends Thread {
+	private Date from = new Date();
+
+	public StatsThread() {
+	}
+
+	public void run() {
+		LogUtil.warn("StatsThread" + " Starting ...");
+		try {
+			Thread.sleep(Constant.Millisecond.MINUTE_3);
+		} catch (Exception e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		}
+		while (true) {
+			try {
+				LogUtil.warn("StatsThread" + " begin ...");
+				Date to = new Date();
+				this.statsCollect(to);
+				this.statsTransfer(to);
+				this.statsSend(to);
+				this.statsWTDB(to);
+				this.statsPointSet(to);
+				this.from = to;
+				LogUtil.warn("StatsThread" + " end ...");
+				Thread.sleep(Constant.Millisecond.MINUTE_5);
+			} catch (InterruptedException e) {
+				// TODO Auto-generated catch block
+				e.printStackTrace();
+			}
+		}
+	}
+
+	/**
+	 * 指令统计
+	 */
+	private void statsPointSet(Date to) {
+		// TODO Auto-generated method stub
+		LogUtil.warn("StatsThread: " + "PointSet Remain: " + Constant.pointSetList.size());
+	}
+
+	/**
+	 * 入库统计
+	 */
+	private void statsWTDB(Date to) {
+		// TODO Auto-generated method stub
+		LogUtil.warn("StatsThread: " + this.from + " ~ " + to + " Report received :" + Constant.collectCount
+				+ " , saved :" + Constant.collectReportCount + " , to DB :" + Constant.report2DBCount + " Remain: "
+				+ Constant.CollectReportList.size() + " , DB writen :" + Constant.writeDB + " Remain: "
+				+ Constant.RecordListToDB.size());
+		Constant.collectCount = 0;
+		Constant.collectReportCount = 0;
+		Constant.report2DBCount = 0;
+		Constant.writeDB = 0;
+	}
+
+	/**
+	 * 报文发送统计
+	 */
+	private void statsSend(Date to) {
+		// TODO Auto-generated method stub
+		LogUtil.warn("StatsThread: " + this.from + " ~ " + to + " SEND received :" + Constant.sendRec + " sent :"
+				+ Constant.sendSend);
+		Constant.sendRec = 0;
+		Constant.sendSend = 0;
+	}
+
+	/**
+	 * 报文转发统计
+	 */
+	private void statsTransfer(Date to) {
+		// TODO Auto-generated method stub
+		LogUtil.warn("StatsThread: " + this.from + " ~ " + to + " Transfer sent :" + Constant.transferSendCount
+				+ " received :" + Constant.transferRecCount + " Remain: " + Constant.TransferReportList.size());
+		Constant.transferSendCount = 0;
+		Constant.transferRecCount = 0;
+	}
+
+	/**
+	 * 报文接收统计
+	 */
+	private void statsCollect(Date to) {
+		// TODO Auto-generated method stub
+		LogUtil.warn("StatsThread: " + this.from + " ~ " + to + " Collect received :" + Constant.collectRec + " sent :"
+				+ Constant.collectSend);
+		Constant.collectRec = 0;
+		Constant.collectSend = 0;
+	}
+
+}

+ 63 - 0
src/main/java/com/saga/thread/common/WTDBThread.java

@@ -0,0 +1,63 @@
+package com.saga.thread.common;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.zillion.util.log.LogUtil;
+
+import com.saga.entity.Record;
+import com.saga.util.Constant;
+
+/**
+ * д¿â
+ *
+ * @author Àǿ
+ */
+public class WTDBThread extends Thread {
+
+	private List<Record> wtdbrecordList = new ArrayList<Record>();
+	public static long write = 0L;
+
+	public WTDBThread() {
+		try {
+		} catch (Exception e) {
+			LogUtil.error("WTDBThread.Exception: " + e.toString());
+			System.exit(0);
+		}
+	}
+
+	public void run() {
+		LogUtil.info("WTDBThread-" + this.getName() + " Starting ...");
+		while (true) {
+			try {
+				if (Constant.RecordListToDB.size() == 0) {
+					Thread.sleep(10L);
+					continue;
+				}
+				wtdbrecordList.addAll(Constant.RecordListToDB);
+				Constant.RecordListToDB = new ArrayList<Record>();
+				LogUtil.info("Constant.RecordListToDB remove " + wtdbrecordList.size());
+				if (delayToDb()) {
+					Thread.sleep(10L);
+					continue;
+				}
+				Constant.BatchInsert(Constant.Database, wtdbrecordList);
+				Constant.BatchInsertUpload(wtdbrecordList);
+				write = System.currentTimeMillis();
+				LogUtil.error("WTDBThread-" + this.getName() + ".write: " + write);
+				wtdbrecordList = new ArrayList<Record>();
+				Thread.sleep(10L);
+			} catch (Exception e) {
+				LogUtil.error("WTDBThread-" + this.getName() + ".run.Exception: " + e.toString());
+			}
+		}
+	}
+
+	private boolean delayToDb() {
+		if (wtdbrecordList.size() == 0
+				|| (wtdbrecordList.size() < 500 && (System.currentTimeMillis() - this.write < Constant.delay))) {
+			return true;
+		}
+		return false;
+	}
+}

File diff suppressed because it is too large
+ 1525 - 0
src/main/java/com/saga/thread/down/DownThread.java


+ 214 - 0
src/main/java/com/saga/thread/up/TransferThread.java

@@ -0,0 +1,214 @@
+package com.saga.thread.up;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.zillion.util.log.LogUtil;
+
+import com.persagy.communication.entity.Packet;
+import com.persagy.communication.mina.tcp.client.TCPClientManager;
+import com.persagy.communication.mina.udp.client.UDPClientManager;
+import com.persagy.communication.util.IClientManager;
+import com.saga.util.Constant;
+
+/**
+ * 数据转发
+ *
+ * @author 李井强
+ */
+public class TransferThread extends Thread {
+	private IClientManager transferClient = null;
+
+	public TransferThread() {
+		try {
+			// if
+			// ("UDP".equalsIgnoreCase(Constant.transfer.PROTOCOL.toString())) {
+			// if (Constant.transfer.compress) {
+			// this.transferClient = new
+			// UDPClientManager(Constant.transfer.IP.toString(),
+			// Constant.transfer.Port,
+			// Constant.transfer.ServerIP.toString(),
+			// Constant.transfer.ServerPort, "utf-8", true,
+			// Constant.transfer.Max_size);
+			// } else {
+			// this.transferClient = new
+			// UDPClientManager(Constant.transfer.IP.toString(),
+			// Constant.transfer.Port,
+			// Constant.transfer.ServerIP.toString(),
+			// Constant.transfer.ServerPort, "utf-8", false,
+			// Constant.transfer.Max_size);
+			// }
+			// } else {
+			// if (Constant.transfer.compress) {
+			// if ("true".equalsIgnoreCase(Constant.transfer.Separate)) {
+			// this.transferClient = new
+			// TCPClientManager(Constant.transfer.ServerIP.toString(),
+			// Constant.transfer.ServerPort, "utf-8", true,
+			// Constant.transfer.Max_size,
+			//// (byte) Constant.transfer.Separate_begin.charAt(0),
+			//// (byte) Constant.transfer.Separate_end.charAt(0)
+			// (byte) '(', (byte) ')'
+			// );
+			// } else {
+			// this.transferClient = new
+			// TCPClientManager(Constant.transfer.ServerIP.toString(),
+			// Constant.transfer.ServerPort, "utf-8", true,
+			// Constant.transfer.Max_size);
+			// }
+			// } else {
+			// if ("true".equalsIgnoreCase(Constant.transfer.Separate)) {
+			// this.transferClient = new
+			// TCPClientManager(Constant.transfer.ServerIP.toString(),
+			// Constant.transfer.ServerPort, "utf-8", false,
+			// Constant.transfer.Max_size,
+			//// (byte) Constant.transfer.Separate_begin.charAt(0),
+			//// (byte) Constant.transfer.Separate_end.charAt(0)
+			// (byte) '(', (byte) ')'
+			// );
+			// } else {
+			// this.transferClient = new
+			// TCPClientManager(Constant.transfer.ServerIP.toString(),
+			// Constant.transfer.ServerPort, "utf-8", false,
+			// Constant.transfer.Max_size);
+			// }
+			// }
+			// }
+			if ("UDP".equalsIgnoreCase(Constant.transfer.PROTOCOL.toString())) {
+				this.transferClient = new UDPClientManager(Constant.transfer.IP.toString(), Constant.transfer.Port,
+						Constant.transfer.ServerIP.toString(), Constant.transfer.ServerPort, "gbk", false,
+						Constant.transfer.Max_size);
+			} else {
+				this.transferClient = new TCPClientManager(Constant.transfer.ServerIP.toString(),
+						Constant.transfer.ServerPort, "gbk", false, Constant.transfer.Max_size, (byte) '(', (byte) ')');
+			}
+
+			this.transferClient.Start();
+			LogUtil.info("TransferThread" + ": " + this.transferClient.Name() + " Created ...");
+		} catch (Exception e) {
+			e.printStackTrace();
+			LogUtil.error("TransferThread.Exception: " + e.toString());
+			LogUtil.info("TransferThread" + ": " + this.transferClient.Name() + " failed to excute, exit!");
+			// System.exit(0);
+		}
+	}
+
+	public void run() {
+		while (true) {
+			try {
+				// 处理PopRece包
+				Packet packageRece = this.transferClient.PopRece();
+				if (packageRece != null) {
+					this.handlePopRece(packageRece);
+				}
+				// 转发report包
+				this.transferReport();
+				Thread.sleep(1L);
+			} catch (Exception e) {
+				LogUtil.error("TransferThread.run.Exception: " + e.toString());
+			}
+		}
+	}
+
+	/**
+	 * 转发数据报文
+	 */
+	private void transferReport() {
+		List<String> reportList = new ArrayList<String>();
+		synchronized (Constant.TransferReportList) {
+			reportList.addAll(this.valaidTransferReport(Constant.TransferReportList));
+			Constant.TransferReportList.clear();
+		}
+
+		for (String report : reportList) {
+			try {
+				this.transferClient.AppendToSend(new Packet(report));
+				Thread.sleep(1L);
+			} catch (Exception e) {
+				e.printStackTrace();
+			}
+		}
+		Constant.transferSendCount += reportList.size();
+	}
+
+	/**
+	 * 生成有效转发数据报文
+	 */
+	private List<String> valaidTransferReport(List<String> transferReportList) {
+		List<String> result = new ArrayList<String>();
+		for (String report : transferReportList) {
+			try {
+				String[] list = report.split(";");
+				String buildingSign = list[0];
+				String meterSign = list[5];
+				int funcID = Integer.valueOf(list[7]);
+				if (!isTransfer(buildingSign, meterSign, funcID)) {
+					continue;
+				}
+				result.add(report);
+			} catch (Exception e) {
+				e.printStackTrace();
+			}
+		}
+		return result;
+	}
+
+	/**
+	 * 数据报文处理
+	 */
+	private void handlePopRece(Packet packageRece) {
+		if (packageRece != null && packageRece.packetString != null && packageRece.packetString.length() > 0) {
+			LogUtil.info(this.transferClient.Name() + " PopRece: " + packageRece.packetString);
+			Constant.transferRecCount++;
+		}
+	}
+
+	/**
+	 * 是否需要转发
+	 * 
+	 * @param buildingSign
+	 *            楼号
+	 * @param meterSign
+	 *            表号
+	 * @param funcID
+	 *            功能号
+	 */
+	private boolean isTransfer(String buildingSign, String meterSign, int funcID) {
+		// TODO Auto-generated method stub
+		if (isTransfer_building(buildingSign) && isTransfer_Point(buildingSign, meterSign, funcID)) {
+			return true;
+		}
+		return false;
+	}
+
+	/**
+	 * 是否需要转发
+	 * 
+	 * @param meterSign
+	 * @param buildingSign
+	 */
+	private boolean isTransfer_Point(String buildingSign, String meterSign, int funcID) {
+		// TODO Auto-generated method stub
+		if (Constant.transfer_List == null || Constant.transfer_List.size() == 0) {
+			return true;
+		}
+		if (Constant.transfer_List.containsKey(buildingSign + "-" + meterSign + "-" + funcID)
+				|| Constant.transfer_List.containsKey(buildingSign + "-" + meterSign + "-" + "all")
+				|| Constant.transfer_List.containsKey(buildingSign + "-" + "all" + "-" + "all")
+				|| Constant.transfer_List.containsKey(buildingSign + "-" + "all" + "-" + funcID)) {
+			return true;
+		}
+		return false;
+	}
+
+	/**
+	 * 是否需要转发
+	 */
+	private boolean isTransfer_building(String buildingSign) {
+		// TODO Auto-generated method stub
+		if (!Constant.transfer_List.containsKey(buildingSign)) {
+			return true;
+		}
+		return false;
+	}
+
+}

+ 791 - 0
src/main/java/com/saga/thread/up/UpThread.java

@@ -0,0 +1,791 @@
+package com.saga.thread.up;
+
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Map.Entry;
+
+import org.zillion.util.log.LogUtil;
+
+import com.persagy.communication.entity.Packet;
+import com.persagy.communication.entity.PacketEntity;
+import com.persagy.communication.mina.tcp.server.TCPServerManager;
+import com.persagy.communication.mina.udp.server.UDPServerManager;
+import com.persagy.communication.util.IServerManager;
+import com.saga.entity.PointSet;
+import com.saga.entity.Record;
+import com.saga.entity.Server;
+import com.saga.util.Constant;
+
+/**
+ * 上层通信
+ *
+ * @author 李井强
+ */
+public class UpThread extends Thread {
+
+	// private IServerManager uploadServer = null;
+	// private String ip = null;
+	private Map<String, IServerManager> serverList = new HashMap<String, IServerManager>();
+	private Map<String, String> pointMac_UP = new HashMap<String, String>();
+
+	public UpThread(Server server) {
+		// TODO Auto-generated constructor stub
+		try {
+			// try {
+			// // this.ip = Constant.getLocalHostLANAddress().getHostAddress()
+			// // + ":" + Constant.TypePort.get("Down");
+			// } catch (Exception e) {
+			// // TODO Auto-generated catch block
+			// // this.ip = "0.0.0.0" + ":" + Constant.TypePort.get("Down");
+			// e.printStackTrace();
+			// }
+			this.serverList.put("UDP", new UDPServerManager(server.IP, server.Port, "gbk", server.compress, 1000));
+			this.serverList.put("TCP",
+					new TCPServerManager(server.IP, server.Port, "gbk", server.compress, 1000, (byte) '(', (byte) ')'));
+		} catch (Exception e) {
+			LogUtil.error("UpThread.Exception: " + e.toString());
+			LogUtil.error("UpThread(" + ": " + server.IP + ":" + server.Port + ") failed to excute, exit!");
+			System.exit(0);
+		}
+	}
+
+	public void run() {
+		try {
+			for (Entry<String, IServerManager> server : this.serverList.entrySet()) {
+				LogUtil.info("UpThread(" + server.getValue().Name() + "): " + " Created ...");
+				server.getValue().Start();
+				LogUtil.info("UpThread(" + server.getValue().Name() + "): " + " Starting ...");
+			}
+		} catch (Exception e) {
+			LogUtil.error("UpThread.run.Exception: " + e.toString());
+		}
+		while (true) {
+			try {
+				for (Entry<String, IServerManager> server : this.serverList.entrySet()) {
+					PacketEntity packageRece = server.getValue().PopRece();
+					// Constant.setlog = new File(
+					// System.getProperty("user.dir") + "/setlog" +
+					// Constant.format_day(new Date()) + ".log");
+					// // V1.0点位日志结构
+					// {
+					// // 返pointset结果包
+					// this.returnPointSet();
+					// // 处理PopRece包
+					// PacketEntity packageRece = this.uploadServer.PopRece();
+					// if (packageRece != null) {
+					// this.handlePopRece(packageRece);
+					// }
+					// }
+					// V2.0点位日志结构
+					{
+						// 返pointset结果包
+						this.returnPointSet2(server.getValue());
+						// 处理PopRece包
+						this.handlePopRece2(server.getValue(), packageRece);
+					}
+
+					Thread.sleep(1L);
+				}
+			} catch (Exception e) {
+				// TODO Auto-generated catch block
+				LogUtil.error("UpThread.run.Exception: " + e.toString());
+			}
+		}
+	}
+
+	// private void returnPointSet() {
+	// // TODO Auto-generated method stub
+	// try {
+	// synchronized (Constant.pointSetList) {
+	// if (Constant.pointSetList.size() > 0) {
+	// Iterator<PointSet> it = Constant.pointSetList.iterator();
+	// while (it.hasNext()) {
+	// StringBuffer sb = new StringBuffer();
+	// PointSet ps = it.next();
+	// // String address =
+	// // Constant.CollectorPointSetList.get(ps.buildingSign +
+	// // ";"
+	// // + ps.ID + ";");
+	// // String address = ps.address;
+	//
+	// if (!ps.uploadName.equalsIgnoreCase(this.uploadServer.Name())) {
+	// break;
+	// }
+	//
+	// if (ps.address == null) {
+	// break;
+	// }
+	// String MAC = ps.mac;
+	// if (this.pointMac_UP.containsKey(ps.buildingSignUP + "-" + ps.meterSign))
+	// {
+	// MAC = this.pointMac_UP.get(ps.buildingSignUP + "-" + ps.meterSign);
+	// }
+	// // 已得到控制设备的反馈状态,移除
+	// if (ps.recTime > 0 && ps.sendTime > 0 && (ps.status != null &&
+	// ps.status.length() > 0)) {
+	// sb.append(ps.buildingSignUP).append(";").append(MAC).append(";").append("pointsetack")
+	// .append(";").append(Constant.format(new
+	// Date())).append(";").append(ps.ID)
+	// .append(";").append(ps.meterSign).append(";").append(ps.funcID).append(";")
+	// .append(ps.status).append(";");
+	// this.uploadServer.AppendToSend(ps.address, new Packet(sb.toString()));
+	// Constant.sendSend += sb.toString().length();
+	// HBaseUtil.BatchInsert_Set2(Constant.agent,
+	// Constant.BuildingDB.get(ps.buildingSign), ps);
+	// LogUtil.info(
+	// this.uploadServer.Name() + " AppendToSend: " + ps.address + " " +
+	// sb.toString());
+	//
+	// String id = ps.buildingSignUP + "-" + ps.mac + "-" + ps.ID;
+	// HBaseUtil.InsertPointCommunicationLog(Constant.agent,
+	// Constant.BuildingDB.get(ps.buildingSignUP), ps.buildingSignUP, this.ip,
+	// ps.mac,
+	// ps.meterSign, String.valueOf(ps.funcID), "down", "pointsetack",
+	// String.valueOf(ps.ID), Constant.format(new Date()), "finish:finish:" +
+	// ps.status);
+	//
+	// synchronized (Constant.ps_ID2Status) {
+	// Constant.ps_ID2Status.put(id, "finish:finish:" + ps.status);
+	// }
+	//
+	// // CSVUtil.insert(Constant.setlog, new
+	// // StringBuffer(Constant.format_Log(new Date())
+	// // + ": "
+	// // + ps.meterSign + "." + ps.funcID + " set " +
+	// // ps.dataSet + " " + ps.status + "!"
+	// // + " Consuming:" + (ps.recTime - ps.sendTime <
+	// // 0 ? 0 : ps.recTime - ps.sendTime)
+	// // + "ms!" + "\r\n"));
+	// it.remove();
+	//
+	// } // 超时未得到设备的反馈状态,移除
+	// else if (ps.recTime == 0 && ps.sendTime > 0
+	// && (System.currentTimeMillis() - ps.sendTime >
+	// Constant.getWaitingtime())) {
+	// sb.append(ps.buildingSignUP).append(";").append(MAC).append(";").append("pointsetack")
+	// .append(";").append(Constant.format(new
+	// Date())).append(";").append(ps.ID)
+	// .append(";").append(ps.meterSign).append(";").append(ps.funcID).append(";")
+	// .append("fail:timeout").append(";");
+	// this.uploadServer.AppendToSend(ps.address, new Packet(sb.toString()));
+	// Constant.sendSend += sb.toString().length();
+	// HBaseUtil.BatchInsert_Set3(Constant.agent,
+	// Constant.BuildingDB.get(ps.buildingSign), ps);
+	// LogUtil.info(
+	// this.uploadServer.Name() + " AppendToSend: " + ps.address + " " +
+	// sb.toString());
+	// String id = ps.buildingSignUP + "-" + ps.mac + "-" + ps.ID;
+	//
+	// // LogUtil.info("InsertPointCommunicationLog" + "
+	// // begin");
+	// HBaseUtil.InsertPointCommunicationLog(Constant.agent,
+	// Constant.BuildingDB.get(ps.buildingSignUP), ps.buildingSignUP, this.ip,
+	// ps.mac,
+	// ps.meterSign, String.valueOf(ps.funcID), "down", "pointsetack",
+	// String.valueOf(ps.ID), Constant.format(new Date()),
+	// "finish:finish:" + "fail:timeout");
+	//
+	// synchronized (Constant.ps_ID2Status) {
+	// Constant.ps_ID2Status.put(id, "finish:finish:" + "fail:timeout");
+	// }
+	// // LogUtil.info("InsertPointCommunicationLog" + "
+	// // end");
+	//
+	// // CSVUtil.insert(Constant.setlog,
+	// // new StringBuffer(
+	// // Constant.format_Log(new Date()) + ": " +
+	// // ps.meterSign + "." + ps.funcID
+	// // + " set " + ps.dataSet + " fail(timeout) " +
+	// // "!" + " Consuming:"
+	// // + (System.currentTimeMillis() - ps.sendTime)
+	// // + "ms!" + "\r\n"));
+	// it.remove();
+	// }
+	// if (sb.length() > 0) {
+	// // Constant.CollectorPointSetList.remove(ps.buildingSign
+	// // + ";" + ps.ID + ";");
+	// break;
+	// // CSVUtil.insert(Constant.setlog, new
+	// // StringBuffer(Constant.format_Log(new Date())
+	// // + ": "
+	// // + this.uploadClient.Name() + " AppendToSend:
+	// // " + sb.toString() + "\r\n"));
+	// }
+	// }
+	// }
+	// }
+	//
+	// } catch (Exception e) {
+	// // TODO Auto-generated catch block
+	// LogUtil.error("UpThread.returnPointSet.Exception: " + e.toString());
+	// }
+	// }
+
+	/**
+	 * 数据报文处理
+	 */
+	private void handlePopRece2(IServerManager server, PacketEntity packageRece) {
+		// TODO Auto-generated method stub
+		if ((packageRece != null) && (packageRece.content.packetString != null)
+				&& (packageRece.content.packetString.length() > 0)) {
+			LogUtil.info(server.Name() + " PopRece: " + packageRece.address + " " + packageRece.content.packetString);
+			Constant.sendRec += packageRece.content.packetString.length();
+			String results = packageRece.content.packetString.replace("(", "").replace(")", "").replace(" ", "");
+			String[] resultArray = results.split("&");
+
+			for (String result : resultArray) {
+				String[] rList = result.split(";");
+				if (rList.length > 6) {
+					String MAC = rList[1];
+
+					if (Constant.pointMAC.containsKey(rList[0] + "-" + rList[5])) {
+						MAC = Constant.pointMAC.get(rList[0] + "-" + rList[5]);
+						LogUtil.info("MAC:" + (rList[0] + "-" + rList[5]) + " " + rList[1] + "-->" + MAC);
+					}
+					String id = rList[0] + "-" + MAC + "-" + rList[4];
+					String key = rList[0] + "-" + MAC + "-" + rList[5] + "." + rList[6];
+					// Constant.id2time.put(id, System.currentTimeMillis());
+					// Constant.id2point.put(id, key);
+					// Constant.id2function.put(id, rList[2]);
+					// Constant.id2status.put(id, "processing:rcvd");
+
+					try {
+						// HBaseUtil.Insert_ps_virtual_point_log(Constant.agent,
+						// Constant.BuildingDB.get(rList[0]),
+						// rList[0], rList[5], Long.valueOf(rList[6]),
+						// this.getupdown(rList[2]),
+						// Constant.format(new Date()), Long.valueOf(rList[4]),
+						// rList[2], "processing:rcvd");
+						Constant.Insert_ps_virtual_point_log(Constant.Database, rList[0], rList[5],
+								Long.valueOf(rList[6]), this.getupdown(rList[2]), Constant.format(new Date()),
+								Long.valueOf(rList[4]), rList[2], "processing:rcvd");
+					} catch (Exception e1) {
+						// TODO Auto-generated catch block
+						e1.printStackTrace();
+					}
+
+					if ("pointset".equalsIgnoreCase(rList[2])) {
+						// 1101070037;1;pointset;;123;1001;11;3.1
+						synchronized (Constant.ps_ID2Time) {
+							Constant.ps_ID2Time.put(id, System.currentTimeMillis());
+						}
+						synchronized (Constant.ps_ID2Point) {
+							Constant.ps_ID2Point.put(id, key);
+						}
+						synchronized (Constant.ps_ID2Function) {
+							Constant.ps_ID2Function.put(id, rList[2]);
+						}
+						synchronized (Constant.ps_ID2Status) {
+							Constant.ps_ID2Status.put(id, "processing:rcvd");
+						}
+
+						PointSet ps = new PointSet();
+						ps.uploadName = server.Name();
+						ps.address = packageRece.address;
+						ps.content = rList;
+						ps.sendTime = 0;
+						ps.recTime = 0;
+						ps.buildingSign = rList[0];
+						ps.buildingSignUP = rList[0];
+						// 楼号有转换规则,且转换后的楼-表有数据才进行转换
+						// 解决一楼多楼号时总有部分仪表无法下发的问题
+						if (Constant.BuildingConv.containsKey(ps.buildingSign) && Constant.Meter_Collector_Control
+								.containsKey(Constant.BuildingConv.get(ps.buildingSign) + "-" + ps.meterSign)) {
+							ps.buildingSign = Constant.BuildingConv.get(ps.buildingSign);
+						}
+
+						ps.ID = Integer.valueOf(rList[4]);
+						ps.meterSign = rList[5];
+						ps.mac = MAC;
+						this.pointMac_UP.put(ps.buildingSignUP + "-" + ps.meterSign, rList[1]);
+						ps.funcID = Integer.valueOf(rList[6]);
+						ps.dataSet = (rList[7]);
+						// String adress = packageRece.address;
+						// String cmd = ps.buildingSign + ";" + ps.ID + ";";
+						// +ps.meterSign + ";" + ps.funcID + ";"
+						// + ps.dataSet;
+
+						// Constant.CollectorPointSetList.put(cmd, adress);
+						StringBuffer sb = new StringBuffer();
+						sb.append(ps.buildingSignUP).append(";").append(ps.mac).append(";").append("pointsetack")
+								.append(";").append(Constant.format(new Date())).append(";").append(ps.ID).append(";")
+								.append(ps.meterSign).append(";").append(ps.funcID).append(";")
+								.append("processing:rcvd").append(";");
+						server.AppendToSend(ps.address, new Packet(sb.toString()));
+						synchronized (Constant.pointSetList) {
+							Constant.pointSetList.add(ps);
+						}
+
+					} else if (rList.length > 6 && "pointread".equalsIgnoreCase(rList[2])) {
+						try {
+							StringBuffer sb = new StringBuffer();
+							sb = this.getCacheData(rList);
+							if (sb != null && sb.toString().length() > 0) {
+								server.AppendToSend(packageRece.address, new Packet(sb.toString()));
+								LogUtil.info(
+										server.Name() + " AppendToSend: " + packageRece.address + " " + sb.toString());
+								// Constant.id2status.put(id, "finish:finish:" +
+								// "success");
+								// HBaseUtil.Insert_ps_virtual_point_log(Constant.agent,
+								// Constant.BuildingDB.get(rList[0]),
+								// rList[0], rList[5], Long.valueOf(rList[6]),
+								// this.getupdown(rList[2]),
+								// Constant.format(new Date()),
+								// Long.valueOf(rList[4]), "pointreadack",
+								// "finish:finish:" + "success");
+								Constant.Insert_ps_virtual_point_log(Constant.Database, rList[0], rList[5],
+										Long.valueOf(rList[6]), this.getupdown(rList[2]), Constant.format(new Date()),
+										Long.valueOf(rList[4]), "pointreadack", "finish:finish:" + "success");
+							} else {
+								// Constant.id2status.put(id, "finish:finish:" +
+								// "fail");
+								// HBaseUtil.Insert_ps_virtual_point_log(Constant.agent,
+								// Constant.BuildingDB.get(rList[0]),
+								// rList[0], rList[5], Long.valueOf(rList[6]),
+								// this.getupdown(rList[2]),
+								// Constant.format(new Date()),
+								// Long.valueOf(rList[4]), "pointreadack",
+								// "finish:finish:" + "fail");
+								Constant.Insert_ps_virtual_point_log(Constant.Database, rList[0], rList[5],
+										Long.valueOf(rList[6]), this.getupdown(rList[2]), Constant.format(new Date()),
+										Long.valueOf(rList[4]), "pointreadack", "finish:finish:" + "fail");
+							}
+
+						} catch (Exception e) {
+							e.printStackTrace();
+							LogUtil.error("UpThread.handlePopRece2.pointread.Exception: " + e.toString());
+						}
+
+					} else if (rList.length > 6 && "realtimepointdata".equalsIgnoreCase(rList[2])) {
+						try {
+							StringBuffer sb = new StringBuffer();
+							sb = this.getCacheData2(rList);
+							if (sb != null && sb.toString().length() > 0) {
+								server.AppendToSend(packageRece.address, new Packet(sb.toString()));
+								LogUtil.info(
+										server.Name() + " AppendToSend: " + packageRece.address + " " + sb.toString());
+								// Constant.id2status.put(id, "finish:finish:" +
+								// "success");
+								// HBaseUtil.Insert_ps_virtual_point_log(Constant.agent,
+								// Constant.BuildingDB.get(rList[0]),
+								// rList[0], rList[5], Long.valueOf(rList[6]),
+								// this.getupdown(rList[2]),
+								// Constant.format(new Date()),
+								// Long.valueOf(rList[4]),
+								// "realtimepointdataack",
+								// "finish:finish:" + "success");
+								Constant.Insert_ps_virtual_point_log(Constant.Database, rList[0], rList[5],
+										Long.valueOf(rList[6]), this.getupdown(rList[2]), Constant.format(new Date()),
+										Long.valueOf(rList[4]), "realtimepointdataack", "finish:finish:" + "success");
+							} else {
+								// Constant.id2status.put(id, "finish:finish:" +
+								// "fail");
+								// HBaseUtil.Insert_ps_virtual_point_log(Constant.agent,
+								// Constant.BuildingDB.get(rList[0]),
+								// rList[0], rList[5], Long.valueOf(rList[6]),
+								// this.getupdown(rList[2]),
+								// Constant.format(new Date()),
+								// Long.valueOf(rList[4]),
+								// "realtimepointdataack",
+								// "finish:finish:" + "fail");
+								Constant.Insert_ps_virtual_point_log(Constant.Database, rList[0], rList[5],
+										Long.valueOf(rList[6]), this.getupdown(rList[2]), Constant.format(new Date()),
+										Long.valueOf(rList[4]), "realtimepointdataack", "finish:finish:" + "fail");
+							}
+
+						} catch (Exception e) {
+							e.printStackTrace();
+							LogUtil.error("UpThread.handlePopRece2.realtimepointdata.Exception: " + e.toString());
+						}
+					}
+				}
+			}
+		}
+	}
+
+	/**
+	 * 指令处理
+	 */
+	private void returnPointSet2(IServerManager server) {
+		// TODO Auto-generated method stub
+		try {
+			synchronized (Constant.pointSetList) {
+				if (Constant.pointSetList.size() > 0) {
+					Iterator<PointSet> it = Constant.pointSetList.iterator();
+					while (it.hasNext()) {
+						try {
+							StringBuffer sb = new StringBuffer();
+							PointSet ps = it.next();
+							// String address =
+							// Constant.CollectorPointSetList.get(ps.buildingSign
+							// +
+							// ";"
+							// + ps.ID + ";");
+							// String address = ps.address;
+
+							if (!ps.uploadName.equalsIgnoreCase(server.Name())) {
+								continue;
+							}
+
+							if (ps.address == null) {
+								continue;
+							}
+							String MAC = ps.mac;
+							if (this.pointMac_UP.containsKey(ps.buildingSignUP + "-" + ps.meterSign)) {
+								MAC = this.pointMac_UP.get(ps.buildingSignUP + "-" + ps.meterSign);
+							}
+							// 已得到控制设备的反馈状态,移除
+							if (ps.recTime > 0 && ps.sendTime > 0 && (ps.status != null && ps.status.length() > 0)) {
+								sb.append(ps.buildingSignUP).append(";").append(MAC).append(";").append("pointsetack")
+										.append(";").append(Constant.format(new Date())).append(";").append(ps.ID)
+										.append(";").append(ps.meterSign).append(";").append(ps.funcID).append(";")
+										.append(ps.status).append(";");
+								server.AppendToSend(ps.address, new Packet(sb.toString()));
+								Constant.sendSend += sb.toString().length();
+								// HBaseUtil.BatchInsert_Set2(Constant.agent,
+								// Constant.BuildingDB.get(ps.buildingSign),
+								// ps);
+								Constant.BatchInsert_Set2(Constant.Database, ps);
+								LogUtil.info(server.Name() + " AppendToSend: " + ps.address + " " + sb.toString());
+
+								String id = ps.buildingSignUP + "-" + ps.mac + "-" + ps.ID;
+								// HBaseUtil.Insert_ps_virtual_point_log(Constant.agent,
+								// Constant.BuildingDB.get(ps.buildingSignUP),
+								// ps.buildingSignUP, ps.meterSign,
+								// Long.valueOf(ps.funcID),
+								// this.getupdown("pointsetack"),
+								// Constant.format(new Date()),
+								// Long.valueOf(ps.ID), "pointsetack",
+								// "finish:finish:" + ps.status);
+								Constant.Insert_ps_virtual_point_log(Constant.Database, ps.buildingSignUP, ps.meterSign,
+										Long.valueOf(ps.funcID), this.getupdown("pointsetack"),
+										Constant.format(new Date()), Long.valueOf(ps.ID), "pointsetack",
+										"finish:finish:" + ps.status);
+
+								synchronized (Constant.ps_ID2Status) {
+									Constant.ps_ID2Status.put(id, "finish:finish:" + ps.status);
+								}
+
+								// CSVUtil.insert(Constant.setlog, new
+								// StringBuffer(Constant.format_Log(new Date())
+								// + ": "
+								// + ps.meterSign + "." + ps.funcID + " set " +
+								// ps.dataSet + " " + ps.status + "!"
+								// + " Consuming:" + (ps.recTime - ps.sendTime <
+								// 0 ? 0 : ps.recTime - ps.sendTime)
+								// + "ms!" + "\r\n"));
+								it.remove();
+
+							} // 超时未得到设备的反馈状态,移除
+							else if (ps.recTime == 0 && ps.sendTime > 0
+									&& (System.currentTimeMillis() - ps.sendTime > Constant.getWaitingtime())) {
+								sb.append(ps.buildingSignUP).append(";").append(MAC).append(";").append("pointsetack")
+										.append(";").append(Constant.format(new Date())).append(";").append(ps.ID)
+										.append(";").append(ps.meterSign).append(";").append(ps.funcID).append(";")
+										.append("fail:timeout").append(";");
+								server.AppendToSend(ps.address, new Packet(sb.toString()));
+								Constant.sendSend += sb.toString().length();
+								// HBaseUtil.BatchInsert_Set3(Constant.agent,
+								// Constant.BuildingDB.get(ps.buildingSign),
+								// ps);
+								Constant.BatchInsert_Set3(Constant.Database, ps);
+
+								LogUtil.info(server.Name() + " AppendToSend: " + ps.address + " " + sb.toString());
+								String id = ps.buildingSignUP + "-" + ps.mac + "-" + ps.ID;
+
+								// LogUtil.info("InsertPointCommunicationLog" +
+								// "
+								// begin");
+								// HBaseUtil.Insert_ps_virtual_point_log(Constant.agent,
+								// Constant.BuildingDB.get(ps.buildingSignUP),
+								// ps.buildingSignUP, ps.meterSign,
+								// Long.valueOf(ps.funcID),
+								// this.getupdown("pointsetack"),
+								// Constant.format(new Date()),
+								// Long.valueOf(ps.ID), "pointsetack",
+								// "finish:finish:" + "fail:timeout");
+								Constant.Insert_ps_virtual_point_log(Constant.Database, ps.buildingSignUP, ps.meterSign,
+										Long.valueOf(ps.funcID), this.getupdown("pointsetack"),
+										Constant.format(new Date()), Long.valueOf(ps.ID), "pointsetack",
+										"finish:finish:" + "fail:timeout");
+
+								synchronized (Constant.ps_ID2Status) {
+									Constant.ps_ID2Status.put(id, "finish:finish:" + "fail:timeout");
+								}
+								// LogUtil.info("InsertPointCommunicationLog" +
+								// "
+								// end");
+
+								// CSVUtil.insert(Constant.setlog,
+								// new StringBuffer(
+								// Constant.format_Log(new Date()) + ": " +
+								// ps.meterSign + "." + ps.funcID
+								// + " set " + ps.dataSet + " fail(timeout) " +
+								// "!" + " Consuming:"
+								// + (System.currentTimeMillis() - ps.sendTime)
+								// + "ms!" + "\r\n"));
+								it.remove();
+							}
+							if (sb.length() > 0) {
+								// Constant.CollectorPointSetList.remove(ps.buildingSign
+								// + ";" + ps.ID + ";");
+								break;
+								// CSVUtil.insert(Constant.setlog, new
+								// StringBuffer(Constant.format_Log(new Date())
+								// + ": "
+								// + this.uploadClient.Name() + " AppendToSend:
+								// " + sb.toString() + "\r\n"));
+							}
+						} catch (Exception e) {
+							it.remove();
+							LogUtil.error("UpThread.returnPointSet2.Foreach.Exception: " + e.toString());
+						}
+					}
+				}
+			}
+
+		} catch (Exception e) {
+			// TODO Auto-generated catch block
+			LogUtil.error("UpThread.returnPointSet2.Exception: " + e.toString());
+		}
+	}
+
+	// private void handlePopRece(PacketEntity packageRece) {
+	// // TODO Auto-generated method stub
+	// if ((packageRece != null) && (packageRece.content.packetString != null)
+	// && (packageRece.content.packetString.length() > 0)) {
+	// LogUtil.info(this.uploadServer.Name() + " PopRece: " +
+	// packageRece.address + " "
+	// + packageRece.content.packetString);
+	// Constant.sendRec += packageRece.content.packetString.length();
+	// String results = packageRece.content.packetString.replace("(",
+	// "").replace(")", "").replace(" ", "");
+	// String[] resultArray = results.split("&");
+	//
+	// for (String result : resultArray) {
+	// String[] rList = result.split(";");
+	// if (rList.length > 6) {
+	// String MAC = rList[1];
+	//
+	// if (Constant.pointMAC.containsKey(rList[0] + "-" + rList[5])) {
+	// MAC = Constant.pointMAC.get(rList[0] + "-" + rList[5]);
+	// LogUtil.info("MAC:" + (rList[0] + "-" + rList[5]) + " " + rList[1] +
+	// "-->" + MAC);
+	// }
+	// String id = rList[0] + "-" + MAC + "-" + rList[4];
+	// String key = rList[0] + "-" + MAC + "-" + rList[5] + "." + rList[6];
+	// // Constant.id2time.put(id, System.currentTimeMillis());
+	// // Constant.id2point.put(id, key);
+	// // Constant.id2function.put(id, rList[2]);
+	// // Constant.id2status.put(id, "processing:rcvd");
+	//
+	// try {
+	// HBaseUtil.InsertPointCommunicationLog(Constant.agent,
+	// Constant.BuildingDB.get(rList[0]),
+	// rList[0], this.ip, MAC, rList[5], (rList[6]), this.getupdown(rList[2]),
+	// rList[2],
+	// String.valueOf(rList[4]), Constant.format(new Date()),
+	// "processing:rcvd");
+	// } catch (UnknownHostException e1) {
+	// // TODO Auto-generated catch block
+	// e1.printStackTrace();
+	// } catch (Exception e1) {
+	// // TODO Auto-generated catch block
+	// e1.printStackTrace();
+	// }
+	//
+	// if ("pointset".equalsIgnoreCase(rList[2])) {
+	// // 1101070037;1;pointset;;123;1001;11;3.1
+	// synchronized (Constant.ps_ID2Time) {
+	// Constant.ps_ID2Time.put(id, System.currentTimeMillis());
+	// }
+	// synchronized (Constant.ps_ID2Point) {
+	// Constant.ps_ID2Point.put(id, key);
+	// }
+	// synchronized (Constant.ps_ID2Function) {
+	// Constant.ps_ID2Function.put(id, rList[2]);
+	// }
+	// synchronized (Constant.ps_ID2Status) {
+	// Constant.ps_ID2Status.put(id, "processing:rcvd");
+	// }
+	//
+	// PointSet ps = new PointSet();
+	// ps.uploadName = this.uploadServer.Name();
+	// ps.address = packageRece.address;
+	// ps.content = rList;
+	// ps.sendTime = 0;
+	// ps.recTime = 0;
+	// ps.buildingSign = rList[0];
+	// ps.buildingSignUP = rList[0];
+	// // 楼号有转换规则,且转换后的楼-表有数据才进行转换
+	// // 解决一楼多楼号时总有部分仪表无法下发的问题
+	// if (Constant.BuildingConv.containsKey(ps.buildingSign) &&
+	// Constant.Meter_Collector_Control
+	// .containsKey(Constant.BuildingConv.get(ps.buildingSign) + "-" +
+	// ps.meterSign)) {
+	// ps.buildingSign = Constant.BuildingConv.get(ps.buildingSign);
+	// }
+	//
+	// ps.ID = Integer.valueOf(rList[4]);
+	// ps.meterSign = rList[5];
+	// ps.mac = MAC;
+	// this.pointMac_UP.put(ps.buildingSignUP + "-" + ps.meterSign, rList[1]);
+	// ps.funcID = Integer.valueOf(rList[6]);
+	// ps.dataSet = Double.valueOf(rList[7]);
+	// // String adress = packageRece.address;
+	// // String cmd = ps.buildingSign + ";" + ps.ID + ";";
+	// // +ps.meterSign + ";" + ps.funcID + ";"
+	// // + ps.dataSet;
+	//
+	// // Constant.CollectorPointSetList.put(cmd, adress);
+	// synchronized (Constant.pointSetList) {
+	// Constant.pointSetList.add(ps);
+	// }
+	//
+	// } else if (rList.length > 6 && "pointread".equalsIgnoreCase(rList[2])) {
+	// try {
+	// StringBuffer sb = new StringBuffer();
+	// sb = this.getCacheData(rList);
+	// if (sb != null && sb.toString().length() > 0) {
+	// this.uploadServer.AppendToSend(packageRece.address, new
+	// Packet(sb.toString()));
+	// LogUtil.info(this.uploadServer.Name() + " AppendToSend: " +
+	// packageRece.address + " "
+	// + sb.toString());
+	// // Constant.id2status.put(id, "finish:finish:" +
+	// // "success");
+	// HBaseUtil.InsertPointCommunicationLog(Constant.agent,
+	// Constant.BuildingDB.get(rList[0]),
+	// rList[0], this.ip, rList[1], rList[5], (rList[6]), "down",
+	// "pointreadack",
+	// String.valueOf(rList[4]), Constant.format(new Date()),
+	// "finish:finish:" + "success");
+	// } else {
+	// // Constant.id2status.put(id, "finish:finish:" +
+	// // "fail");
+	// HBaseUtil.InsertPointCommunicationLog(Constant.agent,
+	// Constant.BuildingDB.get(rList[0]),
+	// rList[0], this.ip, rList[1], rList[5], (rList[6]), "down",
+	// "pointreadack",
+	// String.valueOf(rList[4]), Constant.format(new Date()),
+	// "finish:finish:" + "fail");
+	// }
+	//
+	// } catch (Exception e) {
+	// e.printStackTrace();
+	// LogUtil.error("UpThread.handlePopRece.pointread.Exception: " +
+	// e.toString());
+	// }
+	//
+	// } else if (rList.length > 6 &&
+	// "realtimepointdata".equalsIgnoreCase(rList[2])) {
+	// try {
+	// StringBuffer sb = new StringBuffer();
+	// sb = this.getCacheData2(rList);
+	// if (sb != null && sb.toString().length() > 0) {
+	// this.uploadServer.AppendToSend(packageRece.address, new
+	// Packet(sb.toString()));
+	// LogUtil.info(this.uploadServer.Name() + " AppendToSend: " +
+	// packageRece.address + " "
+	// + sb.toString());
+	// // Constant.id2status.put(id, "finish:finish:" +
+	// // "success");
+	// HBaseUtil.InsertPointCommunicationLog(Constant.agent,
+	// Constant.BuildingDB.get(rList[0]),
+	// rList[0], this.ip, rList[1], rList[5], (rList[6]), "down",
+	// "realtimepointdataack", String.valueOf(rList[4]), Constant.format(new
+	// Date()),
+	// "finish:finish:" + "success");
+	// } else {
+	// // Constant.id2status.put(id, "finish:finish:" +
+	// // "fail");
+	// HBaseUtil.InsertPointCommunicationLog(Constant.agent,
+	// Constant.BuildingDB.get(rList[0]),
+	// rList[0], this.ip, rList[1], rList[5], (rList[6]), "down",
+	// "realtimepointdataack", String.valueOf(rList[4]), Constant.format(new
+	// Date()),
+	// "finish:finish:" + "fail");
+	// }
+	//
+	// } catch (Exception e) {
+	// e.printStackTrace();
+	// LogUtil.error("UpThread.handlePopRece.realtimepointdata.Exception: " +
+	// e.toString());
+	// }
+	// }
+	// }
+	// }
+	// }
+	// }
+
+	/**
+	 * 判断报文发起来源
+	 */
+	private String getupdown(String function) {
+		// TODO Auto-generated method stub
+		if ("report".equalsIgnoreCase(function)) {
+			return "up";
+		} else if ("reportaddtion".equalsIgnoreCase(function)) {
+			return "up";
+		} else {
+			return "down";
+		}
+
+	}
+
+	/**
+	 * 获取缓存数据
+	 */
+	private StringBuffer getCacheData(String[] rList) {
+		// TODO Auto-generated method stub
+		Record record = new Record();
+		StringBuffer sb = new StringBuffer();
+		if (Constant.RecordAddress.get(rList[0] + "-" + rList[5] + "-" + rList[6]) != null) {
+			int address = Constant.RecordAddress.get(rList[0] + "-" + rList[5] + "-" + rList[6]);
+			record = Constant.RecordList.get(address);
+			// Constant.info("get pointread by address !");
+		} else {
+			for (Record r : Constant.RecordList) {
+				if (rList[0].equalsIgnoreCase(r.buildingSign) && rList[5].equalsIgnoreCase(r.meterSign)
+						&& Integer.valueOf(rList[6]) == r.funcID) {
+					record = r;
+					// Constant.info("get pointread by for circle !");
+					break;
+				}
+			}
+		}
+		sb.append(rList[0]).append(";").append(rList[1]).append(";").append("pointreadack").append(";")
+				.append(Constant.format(record.receivetime)).append(";").append(rList[4]).append(";")
+				.append(record.meterSign).append(";").append(record.funcID).append(";").append(record.data).append(";");
+		return sb;
+	}
+
+	/**
+	 * 获取缓存数据
+	 */
+	private StringBuffer getCacheData2(String[] rList) {
+		// TODO Auto-generated method stub
+		Record record = new Record();
+		StringBuffer sb = new StringBuffer();
+		if (Constant.RecordAddress.get(rList[0] + "-" + rList[5] + "-" + rList[6]) != null) {
+			int address = Constant.RecordAddress.get(rList[0] + "-" + rList[5] + "-" + rList[6]);
+			record = Constant.RecordList.get(address);
+			// Constant.info("get pointread by address !");
+		} else {
+			for (Record r : Constant.RecordList) {
+				if (rList[0].equalsIgnoreCase(r.buildingSign) && rList[5].equalsIgnoreCase(r.meterSign)
+						&& Integer.valueOf(rList[6]) == r.funcID) {
+					record = r;
+					// Constant.info("get pointread by for circle !");
+					break;
+				}
+			}
+		}
+		sb.append(rList[0]).append(";").append(rList[1]).append(";").append("realtimepointdataack").append(";")
+				.append(Constant.format(record.receivetime)).append(";").append(rList[4]).append(";")
+				.append(record.meterSign).append(";").append(record.funcID).append(";").append(record.data).append(";");
+		return sb;
+	}
+}

+ 271 - 0
src/main/java/com/saga/tool/ImportPoints.java

@@ -0,0 +1,271 @@
+package com.saga.tool;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+
+import org.apache.hadoop.conf.Configuration;
+import org.zillion.util.log.LogUtil;
+
+import com.saga.entity.EntityPoint;
+import com.saga.util.Constant;
+import com.zillion.database.agent.ZillionAgent;
+
+import jxl.Cell;
+import jxl.Sheet;
+import jxl.Workbook;
+import jxl.read.biff.BiffException;
+
+public class ImportPoints {
+
+	public static void main(String[] args) {
+		// TODO Auto-generated method stub
+		// agentStart();
+		// agentsStart();
+		// importPoints();
+		// System.exit(0);
+	}
+
+	private static Map<Integer, Map<Integer, Map<Integer, String>>> readExcel(File file) {
+		Map<Integer, Map<Integer, Map<Integer, String>>> result = new HashMap<Integer, Map<Integer, Map<Integer, String>>>();
+		try {
+			Workbook book = Workbook.getWorkbook(file);
+			// System.out.println(book.getNumberOfSheets());
+			// 遍历sheet
+			for (int k = 0; k < book.getNumberOfSheets(); k++) {
+				// excel导入map存储,sheet页/行/列
+				result.put(k, new HashMap<Integer, Map<Integer, String>>());
+				Sheet sheet = book.getSheet(k);
+				// System.out.println("Received:" + sheet.getName());
+				int rownum = sheet.getRows();
+				int colnum = sheet.getColumns();
+				if (rownum != 0) {
+					for (int j = 0; j < rownum; j++) {
+						result.get(k).put(j, new HashMap<Integer, String>());
+						for (int i = 0; i < colnum; i++) {
+							Cell cell = sheet.getCell(i, j);
+							String content = cell.getContents();
+							result.get(k).get(j).put(i, content);
+						}
+					}
+				}
+			}
+
+		} catch (BiffException e) {
+			e.printStackTrace();
+		} catch (IndexOutOfBoundsException e) {
+			e.printStackTrace();
+		} catch (IOException e) {
+			e.printStackTrace();
+		}
+
+		return result;
+	}
+
+	private static Map<Integer, Map<Integer, String>> readExcel(File file, String sheetName) {
+		Map<Integer, Map<Integer, String>> result = new HashMap<Integer, Map<Integer, String>>();
+		try {
+			Workbook book = Workbook.getWorkbook(file);
+
+			// excel导入map存储,行/列
+
+			Sheet sheet = book.getSheet(sheetName);
+			// System.out.println("Received:" + sheet.getName());
+			if (sheet == null) {
+				return result;
+			}
+			int rownum = sheet.getRows();
+			int colnum = sheet.getColumns();
+			if (rownum != 0) {
+				for (int j = 0; j < rownum; j++) {
+					result.put(j, new HashMap<Integer, String>());
+					for (int i = 0; i < colnum; i++) {
+						Cell cell = sheet.getCell(i, j);
+						String content = cell.getContents();
+						result.get(j).put(i, content);
+						// System.out.println("(" + i + "," + j + ")=" +
+						// content);
+					}
+				}
+			}
+		} catch (BiffException e) {
+			e.printStackTrace();
+		} catch (IndexOutOfBoundsException e) {
+			e.printStackTrace();
+		} catch (IOException e) {
+			e.printStackTrace();
+		}
+
+		return result;
+	}
+
+	// private static void importPoints() {
+	// // TODO Auto-generated method stub
+	// try {
+	// String filepathPoints = "\\pointlistadd.xls";
+	// File file = new File(System.getProperty("user.dir") + filepathPoints);
+	// Map<Integer, Map<Integer, Map<Integer, String>>> points =
+	// readExcel(file);
+	// Map<String, List<EntityPoint>> buildingPointList = new HashMap<String,
+	// List<EntityPoint>>();
+	// for (Entry<Integer, Map<Integer, Map<Integer, String>>> s :
+	// points.entrySet()) {
+	// Map<String, Integer> cv = new HashMap<String, Integer>();
+	// for (Entry<Integer, Map<Integer, String>> r : s.getValue().entrySet()) {
+	// if (r.getKey() == 0) {
+	// for (Entry<Integer, String> c : r.getValue().entrySet()) {
+	// cv.put(c.getValue(), c.getKey());
+	// }
+	// } else {
+	//
+	// EntityPoint ep = new EntityPoint();
+	//
+	// ep.building = r.getValue().get(cv.get("building"));
+	// ep.meter = r.getValue().get(cv.get("meter"));
+	// ep.funcid = Long.valueOf(r.getValue().get(cv.get("funcid")));
+	// ep.system = r.getValue().get(cv.get("system"));
+	// ep.source = r.getValue().get(cv.get("source"));
+	// ep.address_1 = r.getValue().get(cv.get("address_1"));
+	// ep.ip_port = r.getValue().get(cv.get("ip_port"));
+	// ep.address_2 = r.getValue().get(cv.get("address_2"));
+	// ep.address_3 = r.getValue().get(cv.get("address_3"));
+	// ep.address_4 = r.getValue().get(cv.get("address_4"));
+	// ep.data_type = r.getValue().get(cv.get("data_type"));
+	// ep.collect_cycle = r.getValue().get(cv.get("collect_cycle"));
+	// ep.unit = r.getValue().get(cv.get("unit"));
+	// ep.remark1 = r.getValue().get(cv.get("remark1"));
+	// ep.remark2 = r.getValue().get(cv.get("remark2"));
+	// ep.remark3 = r.getValue().get(cv.get("remark3"));
+	//
+	// if (!buildingPointList.containsKey(ep.building)) {
+	// buildingPointList.put(ep.building, new ArrayList<EntityPoint>());
+	// }
+	// buildingPointList.get(ep.building).add(ep);
+	// }
+	// }
+	// }
+	//
+	// for (Entry<String, List<EntityPoint>> e : buildingPointList.entrySet()) {
+	// for (EntityPoint p : e.getValue()) {
+	// try {
+	// // HBaseUtil.Insert_dy_pointlist(Constant.agent,
+	// // Constant.BuildingDB.get(p.building), p.building,
+	// // p.meter, p.funcid, p.system, p.source, p.address_1,
+	// // p.ip_port, p.address_2, p.address_3,
+	// // p.address_4, p.collect_cycle, p.data_type, p.unit);
+	// Constant.Insert_agents_dy_pointlist(p.building, p.meter, (int) p.funcid,
+	// p.system, p.source,
+	// p.address_1, p.ip_port, p.address_2, p.address_3, p.address_4,
+	// p.collect_cycle,
+	// p.data_type, p.unit);
+	// } catch (Exception e1) {
+	// // TODO Auto-generated catch block
+	// e1.printStackTrace();
+	// }
+	// }
+	// LogUtil.info(" batch_insert dy_pointlist " + e.getKey() + " complete!");
+	// }
+	// } catch (Exception e) {
+	// // TODO Auto-generated catch block
+	// e.printStackTrace();
+	// }
+	//
+	// }
+
+	private static void agentsStart() {
+		// TODO Auto-generated method stub
+		try {
+			// String resource = "/hbase-site.xml";
+			// Configuration configuration = new Configuration();
+			// configuration.addResource(new
+			// FileInputStream(System.getProperty("user.dir") + resource));
+			// int zookeeper_sessionTimeout = 300000;
+
+			List<String> qrlist = new ArrayList<String>();
+			qrlist.add("zookeeper1:2181,zookeeper2:2181,zookeeper3:2181");
+			qrlist.add("zookeeper1,zookeeper2,zookeeper3");
+			qrlist.add("zookeeper1");
+			qrlist.add("zookeeper1.saga");
+
+			for (String qr : qrlist) {
+				try {
+					Configuration configuration = new Configuration();
+					configuration.set("hbase.cluster.distributed", "true");
+					configuration.set("hbase.zookeeper.quorum", qr);
+					Constant.agent = new ZillionAgent(configuration);
+					Constant.agent.setFull_name(qr);
+					Constant.agent.Start();
+
+				} catch (Exception e) {
+					e.printStackTrace();
+					LogUtil.error("Main.init.agentsStart: " + e.toString());
+				}
+			}
+			// Constant.agents.add(new ZillionAgent(configuration,
+			// "zookeeper1:2181,zookeeper2:2181,zookeeper3:2181",
+			// zookeeper_sessionTimeout));
+			// Constant.agents
+			// .add(new ZillionAgent(configuration,
+			// "zookeeper1,zookeeper2,zookeeper3", zookeeper_sessionTimeout));
+			// Constant.agents.add(new ZillionAgent(configuration, "zookeeper1",
+			// zookeeper_sessionTimeout));
+			// Constant.agents.add(new ZillionAgent(configuration,
+			// "zookeeper1.saga", zookeeper_sessionTimeout));
+
+			// Iterator<ZillionAgent> it = Constant.agents.iterator();
+			// while (it.hasNext()) {
+			// ZillionAgent agent = it.next();
+			// try {
+			// agent.Start();
+			// LogUtil.info(agent.getFull_name() + " starting ...");
+			// } catch (Exception e) {
+			// // TODO Auto-generated catch block
+			// // agent启动失败则移除,以免造成资源浪费
+			// LogUtil.warn(agent.getFull_name() + " failed to start ,now remove
+			// !");
+			// it.remove();
+			// LogUtil.error("Main.init.agentsStart: " + e.toString());
+			// }
+			// }
+		} catch (Exception e) {
+			// TODO Auto-generated catch block
+			LogUtil.error("Main.init.agentsStart: " + e.toString());
+		}
+	}
+
+	// private static void agentStart() {
+	// // TODO Auto-generated method stub
+	// try {
+	// String resource = "/hbase-site.xml";
+	// Configuration configuration = new Configuration();
+	// configuration.addResource(new
+	// FileInputStream(System.getProperty("user.dir") + resource));
+	// int zookeeper_sessionTimeout = 300000;
+	//
+	// Constant.agents.add(new ZillionAgent(configuration,
+	// "zookeeper1:2181,zookeeper2:2181,zookeeper3:2181",
+	// zookeeper_sessionTimeout));
+	// Constant.agents
+	// .add(new ZillionAgent(configuration, "zookeeper1,zookeeper2,zookeeper3",
+	// zookeeper_sessionTimeout));
+	// for (ZillionAgent agent : Constant.agents) {
+	// try {
+	// agent.Start();
+	// } catch (Exception e) {
+	// // TODO Auto-generated catch block
+	// LogUtil.error("Main.init.agentsStart: " + e.toString());
+	// }
+	// }
+	//
+	// } catch (Exception e) {
+	// // TODO Auto-generated catch block
+	// e.printStackTrace();
+	// }
+	// }
+}

File diff suppressed because it is too large
+ 1735 - 0
src/main/java/com/saga/util/Constant.java


+ 106 - 0
src/main/java/com/saga/util/ExcelUtil.java

@@ -0,0 +1,106 @@
+package com.saga.util;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
+
+import jxl.Cell;
+import jxl.Sheet;
+import jxl.Workbook;
+import jxl.read.biff.BiffException;
+
+/**
+ * excel工具
+ *
+ * @author 李井强
+ */
+public class ExcelUtil {
+
+	/**
+	 * 读取excel至缓存
+	 */
+	public static Map<Integer, Map<Integer, Map<Integer, String>>> readExcel(File file) {
+		Map<Integer, Map<Integer, Map<Integer, String>>> result = new HashMap<Integer, Map<Integer, Map<Integer, String>>>();
+		try {
+			Workbook book = Workbook.getWorkbook(file);
+			// System.out.println(book.getNumberOfSheets());
+			// 遍历sheet
+			for (int k = 0; k < book.getNumberOfSheets(); k++) {
+				// excel导入map存储,sheet页/行/列
+				result.put(k, new HashMap<Integer, Map<Integer, String>>());
+				Sheet sheet = book.getSheet(k);
+				// System.out.println("Received:" + sheet.getName());
+				int rownum = sheet.getRows();
+				int colnum = sheet.getColumns();
+				if (rownum != 0) {
+					for (int j = 0; j < rownum; j++) {
+						result.get(k).put(j, new HashMap<Integer, String>());
+						for (int i = 0; i < colnum; i++) {
+							Cell cell = sheet.getCell(i, j);
+							String content = cell.getContents();
+							result.get(k).get(j).put(i, content);
+							// System.out.println("(" + i + "," + j + ")=" +
+							// content);
+						}
+					}
+				}
+			}
+
+		} catch (BiffException e) {
+			e.printStackTrace();
+		} catch (IndexOutOfBoundsException e) {
+			e.printStackTrace();
+		} catch (IOException e) {
+			e.printStackTrace();
+		}
+
+		return result;
+	}
+
+	/**
+	 * 读取sheet至缓存
+	 */
+	public static Map<Integer, Map<Integer, String>> readExcel(File file, String sheetName) {
+		Map<Integer, Map<Integer, String>> result = new HashMap<Integer, Map<Integer, String>>();
+		try {
+			Workbook book = Workbook.getWorkbook(file);
+
+			// excel导入map存储,行/列
+
+			Sheet sheet = book.getSheet(sheetName);
+			// System.out.println("Received:" + sheet.getName());
+			if (sheet == null) {
+				return result;
+			}
+			int rownum = sheet.getRows();
+			int colnum = sheet.getColumns();
+			if (rownum != 0) {
+				for (int j = 0; j < rownum; j++) {
+					result.put(j, new HashMap<Integer, String>());
+					for (int i = 0; i < colnum; i++) {
+						Cell cell = sheet.getCell(i, j);
+						String content = cell.getContents();
+						result.get(j).put(i, content);
+						// System.out.println("(" + i + "," + j + ")=" +
+						// content);
+					}
+				}
+			}
+		} catch (BiffException e) {
+			e.printStackTrace();
+		} catch (IndexOutOfBoundsException e) {
+			e.printStackTrace();
+		} catch (IOException e) {
+			e.printStackTrace();
+		}
+
+		return result;
+	}
+
+	// public static void main(String args[]) {
+	// File file = new File("C:/Users/LJQ/Desktop/config.xls");
+	// readExcel(file);
+	// // readExcel(file, "opcv1");
+	// }
+}

File diff suppressed because it is too large
+ 2613 - 0
src/main/java/com/saga/util/HBaseUtil.java


File diff suppressed because it is too large
+ 1674 - 0
src/main/java/com/saga/util/MySQLUtil.java


+ 5 - 0
src/main/resources/.svn/dir-prop-base

@@ -0,0 +1,5 @@
+K 14
+bugtraq:number
+V 4
+true
+END

+ 640 - 0
src/main/resources/.svn/entries

@@ -0,0 +1,640 @@
+10
+
+dir
+7
+svn://60.205.112.142/Saga_Project_Compute/compute-fjd/src/main/resources
+svn://60.205.112.142/Saga_Project_Compute
+
+
+
+2017-05-31T02:20:14.846128Z
+1
+menglu
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+76837162-0bd0-9d41-b8e9-7b9c1ee79ca4
+
+def_buildingcomputetime.json
+file
+
+
+
+
+2017-05-31T02:31:09.873054Z
+5fab12248f0e43d7dacbc9e423fdeba3
+2017-05-31T02:20:14.846128Z
+1
+menglu
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+328
+
+def_computedetail.json
+file
+
+
+
+
+2017-05-31T02:31:09.865033Z
+8ff6b364dad84fdd3dbceb3a4b7b751d
+2017-05-31T02:20:14.846128Z
+1
+menglu
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+643
+
+def_computedetail1.json
+file
+
+
+
+
+2017-05-31T02:31:09.876068Z
+f0fd8f1fb18dc84d7a39f709160e5fa2
+2017-05-31T02:20:14.846128Z
+1
+menglu
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+686
+
+def_computedetail2.json
+file
+
+
+
+
+2017-05-31T02:31:09.877065Z
+b567804f8e7ced085fb8bb9f782ff46c
+2017-05-31T02:20:14.846128Z
+1
+menglu
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+769
+
+def_computelog.json
+file
+
+
+
+
+2017-05-31T02:31:09.874057Z
+61d01bbde5fbd769e0f8123e6d2066ef
+2017-05-31T02:20:14.846128Z
+1
+menglu
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+510
+
+def_computelog1.json
+file
+
+
+
+
+2017-05-31T02:31:09.863028Z
+ca46f8fd3a22462fbbd73e6886579c95
+2017-05-31T02:20:14.846128Z
+1
+menglu
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+688
+
+def_computelog2.json
+file
+
+
+
+
+2017-05-31T02:31:09.866037Z
+d7b368453152d85c93097c32467f2424
+2017-05-31T02:20:14.846128Z
+1
+menglu
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+605
+
+def_metercomputetime.json
+file
+
+
+
+
+2017-05-31T02:31:09.887091Z
+a0555e803db305a27598182cba869c7b
+2017-05-31T02:20:14.846128Z
+1
+menglu
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+493
+
+def_near.json
+file
+
+
+
+
+2017-05-31T02:31:09.882086Z
+c26a7825d1c4e4664d3f2e5121346129
+2017-05-31T02:20:14.846128Z
+1
+menglu
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+683
+
+def_near1.json
+file
+
+
+
+
+2017-05-31T02:31:09.868041Z
+c26a7825d1c4e4664d3f2e5121346129
+2017-05-31T02:20:14.846128Z
+1
+menglu
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+683
+
+def_near2.json
+file
+
+
+
+
+2017-05-31T02:31:09.870046Z
+c26a7825d1c4e4664d3f2e5121346129
+2017-05-31T02:20:14.846128Z
+1
+menglu
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+683
+
+def_pointlist.json
+file
+
+
+
+
+2017-05-31T02:31:09.880073Z
+3865bbc82575c138190a0ca9674572de
+2017-05-31T02:20:14.846128Z
+1
+menglu
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+494
+
+def_rate.json
+file
+
+
+
+
+2017-05-31T02:31:09.859033Z
+c1200e8b960bcbd31ec2942603f02ebe
+2017-05-31T02:20:14.846128Z
+1
+menglu
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+786
+
+def_static.json
+file
+
+
+
+
+2017-05-31T02:31:09.883081Z
+b0a06c9bef287142ce2a82387190c8b0
+2017-05-31T02:20:14.846128Z
+1
+menglu
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+1071
+
+hbase-site.xml
+file
+
+
+
+
+2017-05-31T02:31:09.861022Z
+d45288b36056d189172a3e2af0a01d14
+2017-05-31T02:20:14.846128Z
+1
+menglu
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+748
+
+log4j.properties
+file
+
+
+
+
+2017-05-31T02:31:09.879070Z
+0599a2d30a9eddc64f978904dd9ce2f3
+2017-05-31T02:20:14.846128Z
+1
+menglu
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+979
+
+pointlist.json
+file
+
+
+
+
+2017-05-31T02:31:09.872052Z
+669e0f5b31879c86215ec455ac857042
+2017-05-31T02:20:14.846128Z
+1
+menglu
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+523904
+
+pointlistxx.json
+file
+
+
+
+
+2017-05-31T02:31:09.885086Z
+1d09ff0e405d19e5329fff09f26d3af2
+2017-05-31T02:20:14.846128Z
+1
+menglu
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+516
+

+ 27 - 0
src/main/resources/.svn/text-base/def_buildingcomputetime.json.svn-base

@@ -0,0 +1,27 @@
+{
+	"Columns":[
+		{
+			"Name":"building",
+			"Multiplicity":"1",
+			"Type":"String"
+		},
+		{
+			"Name":"compute_time",
+			"Multiplicity":"1",
+			"Type":"String"
+		},
+		{
+			"Name":"first_compute_time",
+			"Multiplicity":"1",
+			"Type":"String"
+		}
+		
+	],
+	"Key":[
+		"building"
+	],
+	"Indexes":[
+		
+	]
+	
+}

+ 47 - 0
src/main/resources/.svn/text-base/def_computedetail.json.svn-base

@@ -0,0 +1,47 @@
+{
+	"Columns":[
+		{
+			"Name":"building",
+			"Multiplicity":"1",
+			"Type":"String"
+		},
+		{
+			"Name":"compute_round",
+			"Multiplicity":"1",
+			"Type":"Long"
+		},
+		{
+			"Name":"meter",
+			"Multiplicity":"1",
+			"Type":"String"
+		},
+		{
+			"Name":"funcid",
+			"Multiplicity":"1",
+			"Type":"Long"
+		},
+		{
+			"Name":"valid_time_from",
+			"Multiplicity":"1",
+			"Type":"String"
+		},
+		{
+			"Name":"valid_time_to",
+			"Multiplicity":"1",
+			"Type":"String"
+		}
+		
+	],
+	"Key":[
+		"building",
+		"compute_round",
+		"meter",
+		"funcid",
+		"valid_time_from",
+		"valid_time_to"
+	],
+	"Indexes":[
+		
+	]
+	
+}

+ 51 - 0
src/main/resources/.svn/text-base/def_computedetail1.json.svn-base

@@ -0,0 +1,51 @@
+{
+	"Columns":[
+		{
+			"Name":"building",
+			"Multiplicity":"1",
+			"Type":"String"
+		},
+		{
+			"Name":"compute_round",
+			"Multiplicity":"1",
+			"Type":"Long"
+		},
+		{
+			"Name":"meter",
+			"Multiplicity":"1",
+			"Type":"String"
+		},
+		{
+			"Name":"funcid",
+			"Multiplicity":"1",
+			"Type":"Long"
+		},
+		{
+			"Name":"data_time",
+			"Multiplicity":"1",
+			"Type":"String"
+		},
+		{
+			"Name":"label2",
+			"Multiplicity":"1",
+			"Type":"Long"
+		},
+		{
+			"Name":"meter_cleaned2",
+			"Multiplicity":"1",
+			"Type":"Double"
+		}
+		
+	],
+	"Key":[
+		"building",
+		"compute_round",
+		"meter",
+		"funcid",
+		"data_time"
+	],
+	"Indexes":[
+		
+	]
+	
+}

+ 56 - 0
src/main/resources/.svn/text-base/def_computedetail2.json.svn-base

@@ -0,0 +1,56 @@
+{
+	"Columns":[
+		{
+			"Name":"building",
+			"Multiplicity":"1",
+			"Type":"String"
+		},
+		{
+			"Name":"compute_round",
+			"Multiplicity":"1",
+			"Type":"Long"
+		},
+		{
+			"Name":"meter",
+			"Multiplicity":"1",
+			"Type":"String"
+		},
+		{
+			"Name":"funcid",
+			"Multiplicity":"1",
+			"Type":"Long"
+		},
+		{
+			"Name":"data_time",
+			"Multiplicity":"1",
+			"Type":"String"
+		},
+		{
+			"Name":"data_flag",
+			"Multiplicity":"1",
+			"Type":"Long"
+		},
+		{
+			"Name":"data_value",
+			"Multiplicity":"1",
+			"Type":"Double"
+		},
+		{
+			"Name":"data_value_old",
+			"Multiplicity":"1",
+			"Type":"Double"
+		}
+		
+	],
+	"Key":[
+		"building",
+		"compute_round",
+		"meter",
+		"funcid",
+		"data_time"
+	],
+	"Indexes":[
+		
+	]
+	
+}

+ 0 - 0
src/main/resources/.svn/text-base/def_computelog.json.svn-base


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